Skip to content

Commit f5cfc92

Browse files
author
Luke Bowerman
authored
Remove theme.colors.palette usage (#989)
* Port all components to slots instead of palette * Deprecate all internal palette usage * Snapshot updates (palette to slot) * Polishing up snapshots and changes * Menu fix-ups * Change `inverseText` to `inverseOn` to be internally consistent with `icon` use cases * Fix-up AvatarIcon background color * Tweak docs a bit
1 parent f2691db commit f5cfc92

File tree

171 files changed

+752
-1885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+752
-1885
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
### Changed
2121

22+
- `theme.colors.palette` no longer used internally except in very limited (and soon-to-be-deprecated) cases.
2223
- `Button*` font sizes updated to match design specifications
2324
- `theme.colors` shape has been significantly refactored (documentation updates to follow)
2425
- `Banner` is now `MessageBar`

packages/components/src/Accordion/AccordionDisclosure.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const AccordionDisclosure = styled(AccordionDisclosureLayout)`
8080
padding: ${({ theme: { space } }) => `${space.xsmall} ${space.none}`};
8181
8282
&:focus {
83-
border-color: ${({ theme }) => theme.colors.palette.purple300};
83+
border-color: ${({ theme }) => theme.colors.keyFocus};
8484
}
8585
`
8686

packages/components/src/ActionList/ActionListHeader/ActionListHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ const ActionListHeaderInternal: FC<CompatibleHTMLProps<HTMLDivElement>> = ({
5151
}
5252

5353
export const ActionListHeader = styled(ActionListHeaderInternal)`
54-
border-bottom: solid 1px ${(props) => props.theme.colors.palette.charcoal200};
55-
color: ${(props) => props.theme.colors.palette.charcoal900};
54+
border-bottom: solid 1px ${({ theme }) => theme.colors.ui2};
55+
color: ${(props) => props.theme.colors.text0};
5656
display: flex;
5757
font-size: ${(props) => props.theme.fontSizes.xsmall};
5858
font-weight: ${(props) => props.theme.fontWeights.semiBold};

packages/components/src/ActionList/ActionListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ const ActionListItemInternal: FC<ActionListItemProps> = ({
128128
}
129129

130130
export const ActionListItem = styled(ActionListItemInternal)`
131-
border-bottom: solid 1px ${(props) => props.theme.colors.palette.charcoal200};
131+
border-bottom: solid 1px ${(props) => props.theme.colors.ui2};
132132
display: flex;
133133
`

packages/components/src/ActionList/ActionListItemColumn.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ const ActionListItemColumnLayout: FC<ActionListItemColumnProps> = ({
6262
export const ActionListItemColumn = styled(ActionListItemColumnLayout)<
6363
ActionListItemColumnProps
6464
>`
65-
color: ${(props) => props.theme.colors.palette.charcoal700};
66-
display: ${(props) => (props.indicator ? 'flex' : undefined)};
67-
font-size: ${(props) => props.theme.fontSizes.xsmall};
65+
color: ${({ theme }) => theme.colors.text2};
66+
display: ${({ indicator }) => indicator && 'flex'};
67+
font-size: ${({ theme }) => theme.fontSizes.xsmall};
6868
word-break: break-all;
6969
overflow: hidden;
7070

packages/components/src/ActionList/ActionListRow.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ ActionListRowLayout.displayName = 'ActionListRowLayout'
8282
export const ActionListRow = styled(ActionListRowLayout)`
8383
display: flex;
8484
85-
background: ${({ disabled, theme }) =>
86-
disabled && theme.colors.palette.charcoal100};
85+
background: ${({ disabled, theme }) => disabled && theme.colors.ui1};
8786
8887
&:focus,
8988
&:hover {

packages/components/src/ActionList/utils/actionListFormatting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const primaryKeyColumnCSS = (columnIndices: number[]) =>
4646
(columnIndex) =>
4747
css`
4848
${ActionListItemColumn}:nth-child(${columnIndex + 1}) {
49-
color: ${(props) => props.theme.colors.palette.charcoal900};
49+
color: ${({ theme }) => theme.colors.text0};
5050
font-size: ${(props) => props.theme.fontSizes.small};
5151
}
5252
`

packages/components/src/Avatar/Avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export type AvatarSizes =
4949
export interface AvatarProps extends SpaceProps {
5050
className?: string
5151
/**
52-
* @default `palette.purple400`
52+
* @default `key`
5353
**/
5454
color?: string
5555
/**

packages/components/src/Avatar/AvatarCombo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export interface AvatarComboProps
3535
extends Omit<AvatarIconProps & AvatarUserProps, 'size'> {
3636
secondaryIcon: IconNames
3737
/**
38-
* @default `palette.purple300`
38+
* @default `keyFocus`
3939
**/
4040
secondaryColor?: string
4141
/**
42-
* @default `palette.purple300`
42+
* @default `keyFocus`
4343
**/
4444
secondaryBg?: string
4545
}

packages/components/src/Avatar/AvatarIcon.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ export interface AvatarIconProps extends AvatarProps {
3838
icon?: IconNames
3939

4040
/**
41-
* @default 'palette.purple300'
41+
* @default 'keyFocus'
4242
*/
4343
color?: string
4444

4545
/**
46-
* @default 'palette.white'
46+
* @default 'keyText'
4747
*/
4848
bg?: string
4949
}
@@ -95,7 +95,7 @@ export const AvatarIcon = styled(AvatarLayout)`
9595
`
9696

9797
AvatarIcon.defaultProps = {
98-
bg: 'palette.white',
99-
color: 'palette.purple300',
98+
bg: 'background',
99+
color: 'keyFocus',
100100
size: 'small',
101101
}

0 commit comments

Comments
 (0)