Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Fixes
- Fix endMedia to not be removed from DOM on mouseleave for `ListItem` @musingh1 ([#278](https://github.com/stardust-ui/react/pull/278))
- Remove `Sizes` and `Weights` enums, use typed string in `Text` instead @jurokapsiar ([#446](https://github.com/stardust-ui/react/pull/446))

### Features
- Make `Grid` keyboard navigable by implementing `gridBehavior` @sophieH29 ([#398](https://github.com/stardust-ui/react/pull/398))
Expand Down
3 changes: 1 addition & 2 deletions docs/src/prototypes/chatPane/chatPaneHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react'
import { Avatar, Button, Divider, Icon, Layout, Segment, Text } from '@stardust-ui/react'

import { ChatData } from './services'
import { Sizes } from 'src/lib/enums'

export interface ChatPaneHeaderProps {
chat?: ChatData
Expand Down Expand Up @@ -50,7 +49,7 @@ class ChatPaneHeader extends React.PureComponent<ChatPaneHeaderProps> {
start={<Avatar name={chat.title} />}
main={
<Text
size={Sizes.Large}
size="large"
content={chat.title}
styles={{ marginLeft: '12px', fontWeight: 600 }}
/>
Expand Down
3 changes: 1 addition & 2 deletions docs/src/prototypes/employeeCard/EmployeeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react'
import { Sizes } from '../../../../src/lib/enums'
import { Extendable, ShorthandValue } from '../../../../types/utils'
import { Avatar, Divider, Grid } from '@stardust-ui/react'
import Text from './Text'
Expand Down Expand Up @@ -37,7 +36,7 @@ class EmployeeCard extends React.Component<Extendable<EmployeeCardProps>, any> {
{...rest}
>
<div>
<Text size={Sizes.Medium} weight={'bold'} as="div">
<Text size={'medium'} weight={'bold'} as="div">
{firstName} {lastName}
</Text>
<Text muted as="div">
Expand Down
3 changes: 1 addition & 2 deletions src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { childrenExist, createShorthandFactory, customPropTypes, UIComponent } f

import { Extendable } from '../../../types/utils'
import { ComponentVariablesInput, ComponentSlotStyle } from '../../themes/types'
import { Sizes } from '../../lib/enums'

export interface TextProps {
as?: any
Expand All @@ -15,7 +14,7 @@ export interface TextProps {
disabled?: boolean
error?: boolean
important?: boolean
size?: Sizes
size?: 'smallest' | 'smaller' | 'small' | 'medium' | 'large' | 'larger' | 'largest'
weight?: 'light' | 'semilight' | 'regular' | 'semibold' | 'bold'
success?: boolean
temporary?: boolean
Expand Down
2 changes: 0 additions & 2 deletions src/lib/enums/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/lib/enums/sizes.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/lib/enums/weights.ts

This file was deleted.

21 changes: 10 additions & 11 deletions src/themes/teams/components/Text/textStyles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Sizes, Weights } from '../../../../lib/enums'
import { ComponentStyleFunctionParam, ICSSInJSStyle } from '../../../types'
import { truncateStyle } from '../../../../styles/customCSS'
import { TextVariables } from './textVariables'
Expand Down Expand Up @@ -44,39 +43,39 @@ export default {
color: v.importantColor,
}),

...(weight === Weights.Light && {
...(weight === 'light' && {
fontWeight: v.fontWeightLight,
}),
...(weight === Weights.Semilight && {
...(weight === 'semilight' && {
fontWeight: v.fontWeightSemilight,
}),
...(weight === Weights.Regular && {
...(weight === 'regular' && {
fontWeight: v.fontWeightRegular,
}),
...(weight === Weights.Semibold && {
...(weight === 'semibold' && {
fontWeight: v.fontWeightSemibold,
}),
...(weight === Weights.Bold && {
...(weight === 'bold' && {
fontWeight: v.fontWeightBold,
}),

...(size === Sizes.Smaller && {
...(size === 'smaller' && {
fontSize: v.fontSizeExtraSmall,
lineHeight: v.fontLineHeightExtraSmall,
}),
...(size === Sizes.Small && {
...(size === 'small' && {
fontSize: v.fontSizeSmall,
lineHeight: v.fontLineHeightSmall,
}),
...(size === Sizes.Medium && {
...(size === 'medium' && {
fontSize: v.fontSizeMedium,
lineHeight: v.fontLineHeightMedium,
}),
...(size === Sizes.Large && {
...(size === 'large' && {
fontSize: v.fontSizeLarge,
lineHeight: v.fontLineHeightLarge,
}),
...(size === Sizes.Larger && {
...(size === 'larger' && {
fontSize: v.fontSizeExtraLarge,
lineHeight: v.fontLineHeightExtraLarge,
}),
Expand Down