-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Design System] - Finish initial base token specification (#5427)
- test: Skip information-architecture test until it is fixed
- Loading branch information
Joel Anton
authored
Apr 23, 2024
1 parent
bc5cf63
commit bd25ae6
Showing
11 changed files
with
242 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { defineTokens } from '@pandacss/dev'; | ||
|
||
export const BORDER_WIDTH_TOKENS = defineTokens.borderWidths({ | ||
'0': { | ||
value: '0', | ||
type: 'borderWidth', | ||
}, | ||
'100': { | ||
value: '1px', | ||
type: 'borderWidth', | ||
}, | ||
'200': { | ||
value: '2px', | ||
type: 'borderWidth', | ||
}, | ||
}); | ||
|
||
export const BORDER_TOKENS = defineTokens.borders({ | ||
none: { | ||
value: 'none', | ||
type: 'border', | ||
}, | ||
solid: { | ||
value: '{borderWidths.100} solid', | ||
type: 'border', | ||
}, | ||
double: { | ||
value: '{borderWidths.200} solid', | ||
type: 'border', | ||
}, | ||
dashed: { | ||
value: '{borderWidths.100} dashed', | ||
type: 'border', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
import { defineSemanticTokens } from '@pandacss/dev'; | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
export const GRADIENT_TOKENS = defineSemanticTokens.gradients({ | ||
vertical: { | ||
value: `linear-gradient(0deg, {colors.legacy.gradientStart} 0%, {colors.legacy.gradientEnd} 100%)`, | ||
type: 'gradient', | ||
}, | ||
horizontal: { | ||
value: `linear-gradient(99deg, {colors.legacy.gradientEnd} 0%, {colors.legacy.gradientStart} 100%)`, | ||
type: 'gradient', | ||
}, | ||
disabled: { | ||
value: { | ||
base: 'linear-gradient(90deg, #F5C4D8 0%, #FFCBC1 100%)', | ||
_dark: 'linear-gradient(90deg, #58203E 0%, #612E29 100%)', | ||
}, | ||
type: 'gradient', | ||
}, | ||
}); | ||
|
||
export const LEGACY_GRADIENT_TOKENS = defineSemanticTokens.gradients({ | ||
vertical: { value: `linear-gradient(0deg, {colors.legacy.gradientStart} 0%, {colors.legacy.gradientEnd} 100%)` }, | ||
horizontal: { value: `linear-gradient(99deg, {colors.legacy.gradientEnd} 0%, {colors.legacy.gradientStart} 100%)` }, | ||
disabled: { value: 'linear-gradient(90deg, #F5C4D8 0%, #FFCBC1 100%)' }, | ||
darkDisabled: { value: 'linear-gradient(90deg, #58203E 0%, #612E29 100%)' }, | ||
darkDisabled: { value: 'linear-gradient(90deg, #58203E 0%, #612E29 100%)', type: 'gradient' }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineTokens } from '@pandacss/dev'; | ||
|
||
export const OPACITY_TOKENS = defineTokens.opacity({ | ||
'0': { | ||
value: '0', | ||
type: 'opacity', | ||
}, | ||
'40': { | ||
value: '40%', | ||
type: 'opacity', | ||
}, | ||
'80': { | ||
value: '80%', | ||
type: 'opacity', | ||
}, | ||
'100': { | ||
value: '100%', | ||
type: 'opacity', | ||
}, | ||
}); | ||
|
||
/** @deprecated */ | ||
export const LEGACY_OPACITY_TOKENS = defineTokens.radii({ | ||
'20': { | ||
value: '20%', | ||
type: 'opacity', | ||
}, | ||
'50': { | ||
value: '50%', | ||
type: 'opacity', | ||
}, | ||
'60': { | ||
value: '60%', | ||
type: 'opacity', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { defineTokens } from '@pandacss/dev'; | ||
|
||
/** | ||
* Represents the size of an element. | ||
* | ||
* Used for properties like width and height. | ||
*/ | ||
export const RADIUS_TOKENS = defineTokens.radii({ | ||
'50': { | ||
value: '0.25rem', | ||
type: 'radius', | ||
}, | ||
'75': { | ||
value: '0.375rem', | ||
type: 'radius', | ||
}, | ||
'100': { | ||
value: '0.5rem', | ||
type: 'radius', | ||
}, | ||
'150': { | ||
value: '0.75rem', | ||
type: 'radius', | ||
}, | ||
circle: { | ||
value: '50%', | ||
type: 'radius', | ||
}, | ||
pill: { | ||
value: '9999px', | ||
type: 'radius', | ||
}, | ||
}); | ||
|
||
/** @deprecated */ | ||
export const LEGACY_RADIUS_TOKENS = defineTokens.radii({ | ||
'63': { | ||
value: '5px', | ||
type: 'radius', | ||
}, | ||
'88': { | ||
value: '7px', | ||
type: 'radius', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { defineSemanticTokens } from '@pandacss/dev'; | ||
|
||
/** | ||
* Specifies the "depth" of UI elements. | ||
* | ||
* Based on the system from ParkUI: | ||
* https://github.com/cschroeter/park-ui/blob/main/plugins/panda/src/theme/tokens/z-index.ts | ||
* It’s similar to the system from MUI as well: https://mui.com/material-ui/customization/z-index/ | ||
*/ | ||
export const Z_INDEX_TOKENS = defineSemanticTokens.zIndex({ | ||
hide: { | ||
value: -1, | ||
type: 'zIndex', | ||
}, | ||
auto: { | ||
value: 'auto', | ||
type: 'zIndex', | ||
}, | ||
base: { | ||
value: 0, | ||
type: 'zIndex', | ||
}, | ||
docked: { | ||
value: 10, | ||
type: 'zIndex', | ||
}, | ||
dropdown: { | ||
value: 1000, | ||
type: 'zIndex', | ||
}, | ||
sticky: { | ||
value: 1100, | ||
type: 'zIndex', | ||
}, | ||
banner: { | ||
value: 1200, | ||
type: 'zIndex', | ||
}, | ||
overlay: { | ||
value: 1300, | ||
type: 'zIndex', | ||
}, | ||
modal: { | ||
value: 1400, | ||
type: 'zIndex', | ||
}, | ||
popover: { | ||
value: 1500, | ||
type: 'zIndex', | ||
}, | ||
skipLink: { | ||
value: 1600, | ||
type: 'zIndex', | ||
}, | ||
toast: { | ||
value: 1700, | ||
type: 'zIndex', | ||
}, | ||
tooltip: { | ||
value: 1800, | ||
type: 'zIndex', | ||
}, | ||
}); |