Skip to content
Open
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
45 changes: 44 additions & 1 deletion docs/guides/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ type: example
<TextInput renderLabel="Name" placeholder="Doe, John Doe"/>
</InstUISettingsProvider>
```

### Breadcrumb

#### New tokens
#### New tokens

- gapSm - Gap spacing for small size breadcrumbs
- gapMd - Gap spacing for medium size breadcrumbs
Expand Down Expand Up @@ -173,6 +174,48 @@ type: example

- theme variable `lineHeight` is now removed.

### Flex

The following theme variables have been removed. Gap styling now uses `sharedTokens.legacySpacing`:

- `gapButtons`
- `gapCheckboxes`
- `gapDataPoints`
- `gapInputFields`
- `gapLarge`
- `gapMedium`
- `gapMediumSmall`
- `gapModalElements`
- `gapModuleElements`
- `gapPaddingCardLarge`
- `gapPaddingCardMedium`
- `gapPaddingCardSmall`
- `gapRadios`
- `gapSectionElements`
- `gapSections`
- `gapSelects`
- `gapSmall`
- `gapSpace0`
- `gapSpace12`
- `gapSpace16`
- `gapSpace2`
- `gapSpace24`
- `gapSpace36`
- `gapSpace4`
- `gapSpace48`
- `gapSpace60`
- `gapSpace8`
- `gapStatusIndicators`
- `gapTags`
- `gapTextareas`
- `gapToggles`
- `gapTrayElements`
- `gapXLarge`
- `gapXSmall`
- `gapXxLarge`
- `gapXxSmall`
- `gapXxxSmall`

### FormFieldGroup

- theme variable `errorBorderColor` is now removed
Expand Down
5 changes: 2 additions & 3 deletions packages/ui-flex/src/Flex/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ import {
callRenderProp
} from '@instructure/ui-react-utils'
import { View } from '@instructure/ui-view'
import { withStyleRework as withStyle } from '@instructure/emotion'
import { withStyle } from '@instructure/emotion'

import { Item } from './Item'
import type { FlexItemProps } from './Item/props'

import generateStyle from './styles'
import generateComponentTheme from './theme'

import { allowedProps } from './props'
import type { FlexProps } from './props'
Expand All @@ -48,7 +47,7 @@ category: components
---
@module Flex
**/
@withStyle(generateStyle, generateComponentTheme)
@withStyle(generateStyle)
class Flex extends Component<FlexProps> {
static readonly componentId = 'Flex'

Expand Down
16 changes: 9 additions & 7 deletions packages/ui-flex/src/Flex/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* SOFTWARE.
*/

import { getShorthandPropValue } from '@instructure/emotion'
import type { FlexTheme } from '@instructure/shared-types'
import { getShorthandPropValue, makeThemeVars } from '@instructure/emotion'
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
import type { FlexProps, FlexStyle } from './props'

/**
Expand All @@ -42,8 +42,9 @@ import type { FlexProps, FlexStyle } from './props'
*/

const generateStyle = (
componentTheme: FlexTheme,
props: FlexProps
componentTheme: NewComponentTypes['Flex'],
props: FlexProps,
SharedTokens: SharedTokens
): FlexStyle => {
const { justifyItems, wrap, direction, gap } = props

Expand Down Expand Up @@ -87,8 +88,9 @@ const generateStyle = (
}

// gap css prop
const getGapValue = (gap: FlexProps['gap'], theme: FlexTheme) =>
getShorthandPropValue('Flex', theme, gap, 'gap')
const gapValues = makeThemeVars('gap', SharedTokens.legacySpacing)
const getGapValue = (gap: FlexProps['gap'], values: Record<string, string>) =>
getShorthandPropValue('Flex', values, gap, 'gap')

return {
flex: {
Expand All @@ -99,7 +101,7 @@ const generateStyle = (
justifyContent: justifyItemsValues[justifyItems!],
flexWrap: wrapValues[wrap!],
flexDirection: flexDirectionValues[direction!],
gap: getGapValue(gap!, componentTheme)
gap: getGapValue(gap!, gapValues)
}
}
}
Expand Down
47 changes: 0 additions & 47 deletions packages/ui-flex/src/Flex/theme.ts

This file was deleted.

Loading