components-test-pb 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/src/useButtonStyles.styles.js +39 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/theme/defaultTheme.d.ts +2 -0
- package/dist/theme/defaultTheme.js +131 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +3 -0
- package/dist/theme/themeToCSS.d.ts +2 -0
- package/dist/theme/themeToCSS.js +5 -0
- package/dist/theme/tokens.d.ts +2 -0
- package/dist/theme/tokens.js +2 -0
- package/dist/theme/types.d.ts +114 -0
- package/dist/theme/types.js +1 -0
- package/package.json +1 -1
- package/src/components/Button/src/useButtonStyles.styles.ts +46 -2
- package/src/index.ts +3 -0
- package/src/theme/defaultTheme.ts +149 -0
- package/src/theme/index.ts +4 -0
- package/src/theme/themeToCSS.ts +7 -0
- package/src/theme/tokens.ts +6 -0
- package/src/theme/types.ts +147 -0
|
@@ -1,15 +1,51 @@
|
|
|
1
1
|
import { makeResetStyles, makeStyles, mergeClasses } from 'css-engine-test-pb';
|
|
2
|
+
import { tokens } from '../../../theme';
|
|
2
3
|
export const buttonClassNames = {
|
|
3
4
|
root: 'c-button'
|
|
4
5
|
};
|
|
5
|
-
const useResetStyles = makeResetStyles({
|
|
6
|
+
const useResetStyles = makeResetStyles({
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
boxSizing: 'border-box',
|
|
9
|
+
display: 'inline-flex',
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
textDecorationLine: 'none',
|
|
12
|
+
verticalAlign: 'middle',
|
|
13
|
+
margin: 0,
|
|
14
|
+
overflow: 'hidden',
|
|
15
|
+
backgroundColor: tokens.colorNeutralBackground1,
|
|
16
|
+
color: tokens.colorNeutralForeground1,
|
|
17
|
+
border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
|
|
18
|
+
fontFamily: tokens.fontFamilyBase,
|
|
19
|
+
outlineStyle: 'none',
|
|
20
|
+
':hover': {
|
|
21
|
+
backgroundColor: tokens.colorNeutralBackground1Hover,
|
|
22
|
+
borderColor: tokens.colorNeutralStroke1Hover,
|
|
23
|
+
color: tokens.colorNeutralForeground1Hover,
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
},
|
|
26
|
+
':hover:active,:active:focus-visible': {
|
|
27
|
+
backgroundColor: tokens.colorNeutralBackground1Pressed,
|
|
28
|
+
borderColor: tokens.colorNeutralStroke1Pressed,
|
|
29
|
+
color: tokens.colorNeutralForeground1Pressed,
|
|
30
|
+
outlineStyle: 'none',
|
|
31
|
+
},
|
|
32
|
+
padding: `5px ${tokens.spacingHorizontalM}`,
|
|
33
|
+
minWidth: '96px',
|
|
34
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
35
|
+
fontSize: tokens.fontSizeBase300,
|
|
36
|
+
fontWeight: tokens.fontWeightSemibold,
|
|
37
|
+
lineHeight: tokens.lineHeightBase300,
|
|
38
|
+
transitionDuration: tokens.durationFaster,
|
|
39
|
+
transitionProperty: 'background, border, color',
|
|
40
|
+
transitionTimingFunction: tokens.curveEasyEase
|
|
41
|
+
});
|
|
6
42
|
const useVariationStyles = makeStyles({
|
|
7
43
|
primary: {},
|
|
8
44
|
secondary: {},
|
|
9
45
|
ghost: {},
|
|
10
|
-
square: {},
|
|
46
|
+
square: { borderRadius: 0 },
|
|
11
47
|
rounded: {},
|
|
12
|
-
circular: {},
|
|
48
|
+
circular: { borderRadius: '9999px' },
|
|
13
49
|
small: {},
|
|
14
50
|
medium: {},
|
|
15
51
|
large: {}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { assertSlots, slot, useARIAButtonProps } from './utilities';
|
|
2
|
+
export { tokens, defaultTheme, themeToCSS } from './theme';
|
|
3
|
+
export type { Theme } from './theme';
|
|
2
4
|
export { Button, useButton, renderButton, useButtonStyles, buttonClassNames, } from './components';
|
|
3
5
|
export type { ButtonSlots, ButtonAppearance, ButtonShape, ButtonSize, ButtonProps, ButtonState, } from './components';
|
|
4
6
|
export type { JSXIntrinsicElementKeys, JSXIntrinsicElement, SlotRenderFunction, SlotPropsRecord, SlotShorthandValue, UnknownSlotProps, WithSlotRenderFunction, WithoutSlotRenderFunction, IsSingleton, AsIntrinsicElement, Slot, ExtractSlotProps, ComponentProps, ComponentState, SlotClassNames, EventData, EventHandler, DistributiveOmit, UnionToIntersection, ARIAButtonType, ARIAButtonElement, ARIAButtonElementIntersection, ARIAButtonProps, ARIAButtonSlotProps, ARIAButtonAlteredProps, ARIAButtonResultProps, } from './utilities';
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export const defaultTheme = {
|
|
2
|
+
// Colors — Brand
|
|
3
|
+
colorBrandBackground: '#0f6cbd',
|
|
4
|
+
colorBrandBackgroundHover: '#115ea3',
|
|
5
|
+
colorBrandBackgroundPressed: '#0c3b5e',
|
|
6
|
+
colorBrandBackgroundSelected: '#0f548c',
|
|
7
|
+
colorBrandForeground: '#115ea3',
|
|
8
|
+
colorBrandForegroundHover: '#0f548c',
|
|
9
|
+
colorBrandForegroundPressed: '#0c3b5e',
|
|
10
|
+
colorBrandStroke: '#0f6cbd',
|
|
11
|
+
// Colors — Neutral Foreground
|
|
12
|
+
colorNeutralForeground1: '#242424',
|
|
13
|
+
colorNeutralForeground1Hover: '#242424',
|
|
14
|
+
colorNeutralForeground1Pressed: '#242424',
|
|
15
|
+
colorNeutralForeground2: '#424242',
|
|
16
|
+
colorNeutralForeground2Hover: '#242424',
|
|
17
|
+
colorNeutralForeground2Pressed: '#242424',
|
|
18
|
+
colorNeutralForeground3: '#616161',
|
|
19
|
+
colorNeutralForegroundDisabled: '#bdbdbd',
|
|
20
|
+
// Colors — Neutral Background
|
|
21
|
+
colorNeutralBackground1: '#ffffff',
|
|
22
|
+
colorNeutralBackground1Hover: '#f5f5f5',
|
|
23
|
+
colorNeutralBackground1Pressed: '#e0e0e0',
|
|
24
|
+
colorNeutralBackground1Selected: '#ebebeb',
|
|
25
|
+
colorNeutralBackground2: '#fafafa',
|
|
26
|
+
colorNeutralBackground3: '#f5f5f5',
|
|
27
|
+
colorNeutralBackgroundDisabled: '#f0f0f0',
|
|
28
|
+
// Colors — Neutral Stroke
|
|
29
|
+
colorNeutralStroke1: '#d1d1d1',
|
|
30
|
+
colorNeutralStroke1Hover: '#c7c7c7',
|
|
31
|
+
colorNeutralStroke1Pressed: '#b3b3b3',
|
|
32
|
+
colorNeutralStroke2: '#e0e0e0',
|
|
33
|
+
colorNeutralStrokeDisabled: '#e0e0e0',
|
|
34
|
+
// Colors — Subtle
|
|
35
|
+
colorSubtleBackground: 'transparent',
|
|
36
|
+
colorSubtleBackgroundHover: '#f5f5f5',
|
|
37
|
+
colorSubtleBackgroundPressed: '#e0e0e0',
|
|
38
|
+
colorSubtleBackgroundSelected: '#ebebeb',
|
|
39
|
+
colorSubtleForeground: '#424242',
|
|
40
|
+
// Colors — Status
|
|
41
|
+
colorStatusDangerBackground: '#fdf3f4',
|
|
42
|
+
colorStatusDangerForeground: '#c4314b',
|
|
43
|
+
colorStatusDangerStroke: '#c4314b',
|
|
44
|
+
colorStatusSuccessBackground: '#f1faf1',
|
|
45
|
+
colorStatusSuccessForeground: '#0e700e',
|
|
46
|
+
colorStatusSuccessStroke: '#0e700e',
|
|
47
|
+
colorStatusWarningBackground: '#fff9f5',
|
|
48
|
+
colorStatusWarningForeground: '#f7630c',
|
|
49
|
+
colorStatusWarningStroke: '#f7630c',
|
|
50
|
+
// Spacing — Horizontal
|
|
51
|
+
spacingHorizontalXXS: '2px',
|
|
52
|
+
spacingHorizontalXS: '4px',
|
|
53
|
+
spacingHorizontalSNudge: '6px',
|
|
54
|
+
spacingHorizontalS: '8px',
|
|
55
|
+
spacingHorizontalMNudge: '10px',
|
|
56
|
+
spacingHorizontalM: '12px',
|
|
57
|
+
spacingHorizontalL: '16px',
|
|
58
|
+
spacingHorizontalXL: '20px',
|
|
59
|
+
spacingHorizontalXXL: '24px',
|
|
60
|
+
spacingHorizontalXXXL: '32px',
|
|
61
|
+
// Spacing — Vertical
|
|
62
|
+
spacingVerticalXXS: '2px',
|
|
63
|
+
spacingVerticalXS: '4px',
|
|
64
|
+
spacingVerticalSNudge: '6px',
|
|
65
|
+
spacingVerticalS: '8px',
|
|
66
|
+
spacingVerticalMNudge: '10px',
|
|
67
|
+
spacingVerticalM: '12px',
|
|
68
|
+
spacingVerticalL: '16px',
|
|
69
|
+
spacingVerticalXL: '20px',
|
|
70
|
+
spacingVerticalXXL: '24px',
|
|
71
|
+
spacingVerticalXXXL: '32px',
|
|
72
|
+
// Border Radius
|
|
73
|
+
borderRadiusNone: '0',
|
|
74
|
+
borderRadiusSmall: '2px',
|
|
75
|
+
borderRadiusMedium: '4px',
|
|
76
|
+
borderRadiusLarge: '6px',
|
|
77
|
+
borderRadiusXLarge: '8px',
|
|
78
|
+
borderRadiusCircular: '10000px',
|
|
79
|
+
// Font Family
|
|
80
|
+
fontFamilyBase: "Neue Montreal",
|
|
81
|
+
fontFamilyMonospace: "Consolas, 'Courier New', Courier, monospace",
|
|
82
|
+
fontFamilyNumeric: "Bahnschrift, 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif",
|
|
83
|
+
// Font Size
|
|
84
|
+
fontSizeBase100: '10px',
|
|
85
|
+
fontSizeBase200: '12px',
|
|
86
|
+
fontSizeBase300: '14px',
|
|
87
|
+
fontSizeBase400: '16px',
|
|
88
|
+
fontSizeBase500: '20px',
|
|
89
|
+
fontSizeBase600: '24px',
|
|
90
|
+
// Font Weight
|
|
91
|
+
fontWeightRegular: '400',
|
|
92
|
+
fontWeightMedium: '500',
|
|
93
|
+
fontWeightSemibold: '600',
|
|
94
|
+
fontWeightBold: '700',
|
|
95
|
+
// Line Height
|
|
96
|
+
lineHeightBase100: '14px',
|
|
97
|
+
lineHeightBase200: '16px',
|
|
98
|
+
lineHeightBase300: '20px',
|
|
99
|
+
lineHeightBase400: '22px',
|
|
100
|
+
lineHeightBase500: '28px',
|
|
101
|
+
lineHeightBase600: '32px',
|
|
102
|
+
// Shadows
|
|
103
|
+
shadow2: '0 0 2px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.14)',
|
|
104
|
+
shadow4: '0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.14)',
|
|
105
|
+
shadow8: '0 0 2px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.14)',
|
|
106
|
+
shadow16: '0 0 2px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.14)',
|
|
107
|
+
shadow28: '0 0 8px rgba(0, 0, 0, 0.12), 0 14px 28px rgba(0, 0, 0, 0.14)',
|
|
108
|
+
shadow64: '0 0 8px rgba(0, 0, 0, 0.12), 0 32px 64px rgba(0, 0, 0, 0.14)',
|
|
109
|
+
// Stroke Width
|
|
110
|
+
strokeWidthThin: '1px',
|
|
111
|
+
strokeWidthThick: '2px',
|
|
112
|
+
strokeWidthThicker: '3px',
|
|
113
|
+
strokeWidthThickest: '4px',
|
|
114
|
+
// Duration
|
|
115
|
+
durationUltraFast: '50ms',
|
|
116
|
+
durationFaster: '100ms',
|
|
117
|
+
durationFast: '150ms',
|
|
118
|
+
durationNormal: '200ms',
|
|
119
|
+
durationGentle: '250ms',
|
|
120
|
+
durationSlow: '300ms',
|
|
121
|
+
durationSlower: '400ms',
|
|
122
|
+
// Easing
|
|
123
|
+
curveAccelerateMax: 'cubic-bezier(1, 0, 1, 1)',
|
|
124
|
+
curveAccelerateMid: 'cubic-bezier(0.7, 0, 1, 0.5)',
|
|
125
|
+
curveAccelerateMin: 'cubic-bezier(0.8, 0, 1, 1)',
|
|
126
|
+
curveDecelerateMax: 'cubic-bezier(0, 0, 0, 1)',
|
|
127
|
+
curveDecelerateMid: 'cubic-bezier(0.1, 0.9, 0.2, 1)',
|
|
128
|
+
curveDecelerateMin: 'cubic-bezier(0.33, 0, 0.1, 1)',
|
|
129
|
+
curveEasyEase: 'cubic-bezier(0.33, 0, 0.67, 1)',
|
|
130
|
+
curveLinear: 'cubic-bezier(0, 0, 1, 1)',
|
|
131
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export interface Theme {
|
|
2
|
+
colorBrandBackground: string;
|
|
3
|
+
colorBrandBackgroundHover: string;
|
|
4
|
+
colorBrandBackgroundPressed: string;
|
|
5
|
+
colorBrandBackgroundSelected: string;
|
|
6
|
+
colorBrandForeground: string;
|
|
7
|
+
colorBrandForegroundHover: string;
|
|
8
|
+
colorBrandForegroundPressed: string;
|
|
9
|
+
colorBrandStroke: string;
|
|
10
|
+
colorNeutralForeground1: string;
|
|
11
|
+
colorNeutralForeground1Hover: string;
|
|
12
|
+
colorNeutralForeground1Pressed: string;
|
|
13
|
+
colorNeutralForeground2: string;
|
|
14
|
+
colorNeutralForeground2Hover: string;
|
|
15
|
+
colorNeutralForeground2Pressed: string;
|
|
16
|
+
colorNeutralForeground3: string;
|
|
17
|
+
colorNeutralForegroundDisabled: string;
|
|
18
|
+
colorNeutralBackground1: string;
|
|
19
|
+
colorNeutralBackground1Hover: string;
|
|
20
|
+
colorNeutralBackground1Pressed: string;
|
|
21
|
+
colorNeutralBackground1Selected: string;
|
|
22
|
+
colorNeutralBackground2: string;
|
|
23
|
+
colorNeutralBackground3: string;
|
|
24
|
+
colorNeutralBackgroundDisabled: string;
|
|
25
|
+
colorNeutralStroke1: string;
|
|
26
|
+
colorNeutralStroke1Hover: string;
|
|
27
|
+
colorNeutralStroke1Pressed: string;
|
|
28
|
+
colorNeutralStroke2: string;
|
|
29
|
+
colorNeutralStrokeDisabled: string;
|
|
30
|
+
colorSubtleBackground: string;
|
|
31
|
+
colorSubtleBackgroundHover: string;
|
|
32
|
+
colorSubtleBackgroundPressed: string;
|
|
33
|
+
colorSubtleBackgroundSelected: string;
|
|
34
|
+
colorSubtleForeground: string;
|
|
35
|
+
colorStatusDangerBackground: string;
|
|
36
|
+
colorStatusDangerForeground: string;
|
|
37
|
+
colorStatusDangerStroke: string;
|
|
38
|
+
colorStatusSuccessBackground: string;
|
|
39
|
+
colorStatusSuccessForeground: string;
|
|
40
|
+
colorStatusSuccessStroke: string;
|
|
41
|
+
colorStatusWarningBackground: string;
|
|
42
|
+
colorStatusWarningForeground: string;
|
|
43
|
+
colorStatusWarningStroke: string;
|
|
44
|
+
spacingHorizontalXXS: string;
|
|
45
|
+
spacingHorizontalXS: string;
|
|
46
|
+
spacingHorizontalSNudge: string;
|
|
47
|
+
spacingHorizontalS: string;
|
|
48
|
+
spacingHorizontalMNudge: string;
|
|
49
|
+
spacingHorizontalM: string;
|
|
50
|
+
spacingHorizontalL: string;
|
|
51
|
+
spacingHorizontalXL: string;
|
|
52
|
+
spacingHorizontalXXL: string;
|
|
53
|
+
spacingHorizontalXXXL: string;
|
|
54
|
+
spacingVerticalXXS: string;
|
|
55
|
+
spacingVerticalXS: string;
|
|
56
|
+
spacingVerticalSNudge: string;
|
|
57
|
+
spacingVerticalS: string;
|
|
58
|
+
spacingVerticalMNudge: string;
|
|
59
|
+
spacingVerticalM: string;
|
|
60
|
+
spacingVerticalL: string;
|
|
61
|
+
spacingVerticalXL: string;
|
|
62
|
+
spacingVerticalXXL: string;
|
|
63
|
+
spacingVerticalXXXL: string;
|
|
64
|
+
borderRadiusNone: string;
|
|
65
|
+
borderRadiusSmall: string;
|
|
66
|
+
borderRadiusMedium: string;
|
|
67
|
+
borderRadiusLarge: string;
|
|
68
|
+
borderRadiusXLarge: string;
|
|
69
|
+
borderRadiusCircular: string;
|
|
70
|
+
fontFamilyBase: string;
|
|
71
|
+
fontFamilyMonospace: string;
|
|
72
|
+
fontFamilyNumeric: string;
|
|
73
|
+
fontSizeBase100: string;
|
|
74
|
+
fontSizeBase200: string;
|
|
75
|
+
fontSizeBase300: string;
|
|
76
|
+
fontSizeBase400: string;
|
|
77
|
+
fontSizeBase500: string;
|
|
78
|
+
fontSizeBase600: string;
|
|
79
|
+
fontWeightRegular: string;
|
|
80
|
+
fontWeightMedium: string;
|
|
81
|
+
fontWeightSemibold: string;
|
|
82
|
+
fontWeightBold: string;
|
|
83
|
+
lineHeightBase100: string;
|
|
84
|
+
lineHeightBase200: string;
|
|
85
|
+
lineHeightBase300: string;
|
|
86
|
+
lineHeightBase400: string;
|
|
87
|
+
lineHeightBase500: string;
|
|
88
|
+
lineHeightBase600: string;
|
|
89
|
+
shadow2: string;
|
|
90
|
+
shadow4: string;
|
|
91
|
+
shadow8: string;
|
|
92
|
+
shadow16: string;
|
|
93
|
+
shadow28: string;
|
|
94
|
+
shadow64: string;
|
|
95
|
+
strokeWidthThin: string;
|
|
96
|
+
strokeWidthThick: string;
|
|
97
|
+
strokeWidthThicker: string;
|
|
98
|
+
strokeWidthThickest: string;
|
|
99
|
+
durationUltraFast: string;
|
|
100
|
+
durationFaster: string;
|
|
101
|
+
durationFast: string;
|
|
102
|
+
durationNormal: string;
|
|
103
|
+
durationGentle: string;
|
|
104
|
+
durationSlow: string;
|
|
105
|
+
durationSlower: string;
|
|
106
|
+
curveAccelerateMax: string;
|
|
107
|
+
curveAccelerateMid: string;
|
|
108
|
+
curveAccelerateMin: string;
|
|
109
|
+
curveDecelerateMax: string;
|
|
110
|
+
curveDecelerateMid: string;
|
|
111
|
+
curveDecelerateMin: string;
|
|
112
|
+
curveEasyEase: string;
|
|
113
|
+
curveLinear: string;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,13 +1,57 @@
|
|
|
1
1
|
import { makeResetStyles, makeStyles, mergeClasses } from 'css-engine-test-pb';
|
|
2
2
|
import { SlotClassNames } from '../../../utilities';
|
|
3
3
|
import { ButtonSlots, ButtonState } from './Button.types';
|
|
4
|
+
import { tokens } from '../../../theme';
|
|
4
5
|
|
|
5
6
|
export const buttonClassNames: SlotClassNames<ButtonSlots> = {
|
|
6
7
|
root: 'c-button'
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
const useResetStyles = makeResetStyles({
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
display: 'inline-flex',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
textDecorationLine: 'none',
|
|
16
|
+
verticalAlign: 'middle',
|
|
10
17
|
|
|
18
|
+
margin: 0,
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
|
|
21
|
+
backgroundColor: tokens.colorNeutralBackground1,
|
|
22
|
+
color: tokens.colorNeutralForeground1,
|
|
23
|
+
border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
|
|
24
|
+
|
|
25
|
+
fontFamily: tokens.fontFamilyBase,
|
|
26
|
+
outlineStyle: 'none',
|
|
27
|
+
|
|
28
|
+
':hover': {
|
|
29
|
+
backgroundColor: tokens.colorNeutralBackground1Hover,
|
|
30
|
+
borderColor: tokens.colorNeutralStroke1Hover,
|
|
31
|
+
color: tokens.colorNeutralForeground1Hover,
|
|
32
|
+
|
|
33
|
+
cursor: 'pointer',
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
':hover:active,:active:focus-visible': {
|
|
37
|
+
backgroundColor: tokens.colorNeutralBackground1Pressed,
|
|
38
|
+
borderColor: tokens.colorNeutralStroke1Pressed,
|
|
39
|
+
color: tokens.colorNeutralForeground1Pressed,
|
|
40
|
+
|
|
41
|
+
outlineStyle: 'none',
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
padding: `5px ${tokens.spacingHorizontalM}`,
|
|
45
|
+
minWidth: '96px',
|
|
46
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
47
|
+
|
|
48
|
+
fontSize: tokens.fontSizeBase300,
|
|
49
|
+
fontWeight: tokens.fontWeightSemibold,
|
|
50
|
+
lineHeight: tokens.lineHeightBase300,
|
|
51
|
+
|
|
52
|
+
transitionDuration: tokens.durationFaster,
|
|
53
|
+
transitionProperty: 'background, border, color',
|
|
54
|
+
transitionTimingFunction: tokens.curveEasyEase
|
|
11
55
|
});
|
|
12
56
|
|
|
13
57
|
const useVariationStyles = makeStyles({
|
|
@@ -21,9 +65,9 @@ const useVariationStyles = makeStyles({
|
|
|
21
65
|
|
|
22
66
|
},
|
|
23
67
|
|
|
24
|
-
square: {},
|
|
68
|
+
square: { borderRadius: 0 },
|
|
25
69
|
rounded: {},
|
|
26
|
-
circular: {},
|
|
70
|
+
circular: { borderRadius: '9999px' },
|
|
27
71
|
|
|
28
72
|
small: {
|
|
29
73
|
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { Theme } from './types';
|
|
2
|
+
|
|
3
|
+
export const defaultTheme: Theme = {
|
|
4
|
+
// Colors — Brand
|
|
5
|
+
colorBrandBackground: '#0f6cbd',
|
|
6
|
+
colorBrandBackgroundHover: '#115ea3',
|
|
7
|
+
colorBrandBackgroundPressed: '#0c3b5e',
|
|
8
|
+
colorBrandBackgroundSelected: '#0f548c',
|
|
9
|
+
colorBrandForeground: '#115ea3',
|
|
10
|
+
colorBrandForegroundHover: '#0f548c',
|
|
11
|
+
colorBrandForegroundPressed: '#0c3b5e',
|
|
12
|
+
colorBrandStroke: '#0f6cbd',
|
|
13
|
+
|
|
14
|
+
// Colors — Neutral Foreground
|
|
15
|
+
colorNeutralForeground1: '#242424',
|
|
16
|
+
colorNeutralForeground1Hover: '#242424',
|
|
17
|
+
colorNeutralForeground1Pressed: '#242424',
|
|
18
|
+
colorNeutralForeground2: '#424242',
|
|
19
|
+
colorNeutralForeground2Hover: '#242424',
|
|
20
|
+
colorNeutralForeground2Pressed: '#242424',
|
|
21
|
+
colorNeutralForeground3: '#616161',
|
|
22
|
+
colorNeutralForegroundDisabled: '#bdbdbd',
|
|
23
|
+
|
|
24
|
+
// Colors — Neutral Background
|
|
25
|
+
colorNeutralBackground1: '#ffffff',
|
|
26
|
+
colorNeutralBackground1Hover: '#f5f5f5',
|
|
27
|
+
colorNeutralBackground1Pressed: '#e0e0e0',
|
|
28
|
+
colorNeutralBackground1Selected: '#ebebeb',
|
|
29
|
+
colorNeutralBackground2: '#fafafa',
|
|
30
|
+
colorNeutralBackground3: '#f5f5f5',
|
|
31
|
+
colorNeutralBackgroundDisabled: '#f0f0f0',
|
|
32
|
+
|
|
33
|
+
// Colors — Neutral Stroke
|
|
34
|
+
colorNeutralStroke1: '#d1d1d1',
|
|
35
|
+
colorNeutralStroke1Hover: '#c7c7c7',
|
|
36
|
+
colorNeutralStroke1Pressed: '#b3b3b3',
|
|
37
|
+
colorNeutralStroke2: '#e0e0e0',
|
|
38
|
+
colorNeutralStrokeDisabled: '#e0e0e0',
|
|
39
|
+
|
|
40
|
+
// Colors — Subtle
|
|
41
|
+
colorSubtleBackground: 'transparent',
|
|
42
|
+
colorSubtleBackgroundHover: '#f5f5f5',
|
|
43
|
+
colorSubtleBackgroundPressed: '#e0e0e0',
|
|
44
|
+
colorSubtleBackgroundSelected: '#ebebeb',
|
|
45
|
+
colorSubtleForeground: '#424242',
|
|
46
|
+
|
|
47
|
+
// Colors — Status
|
|
48
|
+
colorStatusDangerBackground: '#fdf3f4',
|
|
49
|
+
colorStatusDangerForeground: '#c4314b',
|
|
50
|
+
colorStatusDangerStroke: '#c4314b',
|
|
51
|
+
colorStatusSuccessBackground: '#f1faf1',
|
|
52
|
+
colorStatusSuccessForeground: '#0e700e',
|
|
53
|
+
colorStatusSuccessStroke: '#0e700e',
|
|
54
|
+
colorStatusWarningBackground: '#fff9f5',
|
|
55
|
+
colorStatusWarningForeground: '#f7630c',
|
|
56
|
+
colorStatusWarningStroke: '#f7630c',
|
|
57
|
+
|
|
58
|
+
// Spacing — Horizontal
|
|
59
|
+
spacingHorizontalXXS: '2px',
|
|
60
|
+
spacingHorizontalXS: '4px',
|
|
61
|
+
spacingHorizontalSNudge: '6px',
|
|
62
|
+
spacingHorizontalS: '8px',
|
|
63
|
+
spacingHorizontalMNudge: '10px',
|
|
64
|
+
spacingHorizontalM: '12px',
|
|
65
|
+
spacingHorizontalL: '16px',
|
|
66
|
+
spacingHorizontalXL: '20px',
|
|
67
|
+
spacingHorizontalXXL: '24px',
|
|
68
|
+
spacingHorizontalXXXL: '32px',
|
|
69
|
+
|
|
70
|
+
// Spacing — Vertical
|
|
71
|
+
spacingVerticalXXS: '2px',
|
|
72
|
+
spacingVerticalXS: '4px',
|
|
73
|
+
spacingVerticalSNudge: '6px',
|
|
74
|
+
spacingVerticalS: '8px',
|
|
75
|
+
spacingVerticalMNudge: '10px',
|
|
76
|
+
spacingVerticalM: '12px',
|
|
77
|
+
spacingVerticalL: '16px',
|
|
78
|
+
spacingVerticalXL: '20px',
|
|
79
|
+
spacingVerticalXXL: '24px',
|
|
80
|
+
spacingVerticalXXXL: '32px',
|
|
81
|
+
|
|
82
|
+
// Border Radius
|
|
83
|
+
borderRadiusNone: '0',
|
|
84
|
+
borderRadiusSmall: '2px',
|
|
85
|
+
borderRadiusMedium: '4px',
|
|
86
|
+
borderRadiusLarge: '6px',
|
|
87
|
+
borderRadiusXLarge: '8px',
|
|
88
|
+
borderRadiusCircular: '10000px',
|
|
89
|
+
|
|
90
|
+
// Font Family
|
|
91
|
+
fontFamilyBase: "Neue Montreal",
|
|
92
|
+
fontFamilyMonospace: "Consolas, 'Courier New', Courier, monospace",
|
|
93
|
+
fontFamilyNumeric: "Bahnschrift, 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif",
|
|
94
|
+
|
|
95
|
+
// Font Size
|
|
96
|
+
fontSizeBase100: '10px',
|
|
97
|
+
fontSizeBase200: '12px',
|
|
98
|
+
fontSizeBase300: '14px',
|
|
99
|
+
fontSizeBase400: '16px',
|
|
100
|
+
fontSizeBase500: '20px',
|
|
101
|
+
fontSizeBase600: '24px',
|
|
102
|
+
|
|
103
|
+
// Font Weight
|
|
104
|
+
fontWeightRegular: '400',
|
|
105
|
+
fontWeightMedium: '500',
|
|
106
|
+
fontWeightSemibold: '600',
|
|
107
|
+
fontWeightBold: '700',
|
|
108
|
+
|
|
109
|
+
// Line Height
|
|
110
|
+
lineHeightBase100: '14px',
|
|
111
|
+
lineHeightBase200: '16px',
|
|
112
|
+
lineHeightBase300: '20px',
|
|
113
|
+
lineHeightBase400: '22px',
|
|
114
|
+
lineHeightBase500: '28px',
|
|
115
|
+
lineHeightBase600: '32px',
|
|
116
|
+
|
|
117
|
+
// Shadows
|
|
118
|
+
shadow2: '0 0 2px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.14)',
|
|
119
|
+
shadow4: '0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.14)',
|
|
120
|
+
shadow8: '0 0 2px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.14)',
|
|
121
|
+
shadow16: '0 0 2px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.14)',
|
|
122
|
+
shadow28: '0 0 8px rgba(0, 0, 0, 0.12), 0 14px 28px rgba(0, 0, 0, 0.14)',
|
|
123
|
+
shadow64: '0 0 8px rgba(0, 0, 0, 0.12), 0 32px 64px rgba(0, 0, 0, 0.14)',
|
|
124
|
+
|
|
125
|
+
// Stroke Width
|
|
126
|
+
strokeWidthThin: '1px',
|
|
127
|
+
strokeWidthThick: '2px',
|
|
128
|
+
strokeWidthThicker: '3px',
|
|
129
|
+
strokeWidthThickest: '4px',
|
|
130
|
+
|
|
131
|
+
// Duration
|
|
132
|
+
durationUltraFast: '50ms',
|
|
133
|
+
durationFaster: '100ms',
|
|
134
|
+
durationFast: '150ms',
|
|
135
|
+
durationNormal: '200ms',
|
|
136
|
+
durationGentle: '250ms',
|
|
137
|
+
durationSlow: '300ms',
|
|
138
|
+
durationSlower: '400ms',
|
|
139
|
+
|
|
140
|
+
// Easing
|
|
141
|
+
curveAccelerateMax: 'cubic-bezier(1, 0, 1, 1)',
|
|
142
|
+
curveAccelerateMid: 'cubic-bezier(0.7, 0, 1, 0.5)',
|
|
143
|
+
curveAccelerateMin: 'cubic-bezier(0.8, 0, 1, 1)',
|
|
144
|
+
curveDecelerateMax: 'cubic-bezier(0, 0, 0, 1)',
|
|
145
|
+
curveDecelerateMid: 'cubic-bezier(0.1, 0.9, 0.2, 1)',
|
|
146
|
+
curveDecelerateMin: 'cubic-bezier(0.33, 0, 0.1, 1)',
|
|
147
|
+
curveEasyEase: 'cubic-bezier(0.33, 0, 0.67, 1)',
|
|
148
|
+
curveLinear: 'cubic-bezier(0, 0, 1, 1)',
|
|
149
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Theme } from './types';
|
|
2
|
+
import { defaultTheme } from './defaultTheme';
|
|
3
|
+
|
|
4
|
+
export const tokens: Record<keyof Theme, string> = Object.fromEntries(
|
|
5
|
+
(Object.keys(defaultTheme) as (keyof Theme)[]).map((key) => [key, `var(--${key})`]),
|
|
6
|
+
) as Record<keyof Theme, string>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export interface Theme {
|
|
2
|
+
// Colors — Brand
|
|
3
|
+
colorBrandBackground: string;
|
|
4
|
+
colorBrandBackgroundHover: string;
|
|
5
|
+
colorBrandBackgroundPressed: string;
|
|
6
|
+
colorBrandBackgroundSelected: string;
|
|
7
|
+
colorBrandForeground: string;
|
|
8
|
+
colorBrandForegroundHover: string;
|
|
9
|
+
colorBrandForegroundPressed: string;
|
|
10
|
+
colorBrandStroke: string;
|
|
11
|
+
|
|
12
|
+
// Colors — Neutral Foreground
|
|
13
|
+
colorNeutralForeground1: string;
|
|
14
|
+
colorNeutralForeground1Hover: string;
|
|
15
|
+
colorNeutralForeground1Pressed: string;
|
|
16
|
+
colorNeutralForeground2: string;
|
|
17
|
+
colorNeutralForeground2Hover: string;
|
|
18
|
+
colorNeutralForeground2Pressed: string;
|
|
19
|
+
colorNeutralForeground3: string;
|
|
20
|
+
colorNeutralForegroundDisabled: string;
|
|
21
|
+
|
|
22
|
+
// Colors — Neutral Background
|
|
23
|
+
colorNeutralBackground1: string;
|
|
24
|
+
colorNeutralBackground1Hover: string;
|
|
25
|
+
colorNeutralBackground1Pressed: string;
|
|
26
|
+
colorNeutralBackground1Selected: string;
|
|
27
|
+
colorNeutralBackground2: string;
|
|
28
|
+
colorNeutralBackground3: string;
|
|
29
|
+
colorNeutralBackgroundDisabled: string;
|
|
30
|
+
|
|
31
|
+
// Colors — Neutral Stroke
|
|
32
|
+
colorNeutralStroke1: string;
|
|
33
|
+
colorNeutralStroke1Hover: string;
|
|
34
|
+
colorNeutralStroke1Pressed: string;
|
|
35
|
+
colorNeutralStroke2: string;
|
|
36
|
+
colorNeutralStrokeDisabled: string;
|
|
37
|
+
|
|
38
|
+
// Colors — Subtle
|
|
39
|
+
colorSubtleBackground: string;
|
|
40
|
+
colorSubtleBackgroundHover: string;
|
|
41
|
+
colorSubtleBackgroundPressed: string;
|
|
42
|
+
colorSubtleBackgroundSelected: string;
|
|
43
|
+
colorSubtleForeground: string;
|
|
44
|
+
|
|
45
|
+
// Colors — Status
|
|
46
|
+
colorStatusDangerBackground: string;
|
|
47
|
+
colorStatusDangerForeground: string;
|
|
48
|
+
colorStatusDangerStroke: string;
|
|
49
|
+
colorStatusSuccessBackground: string;
|
|
50
|
+
colorStatusSuccessForeground: string;
|
|
51
|
+
colorStatusSuccessStroke: string;
|
|
52
|
+
colorStatusWarningBackground: string;
|
|
53
|
+
colorStatusWarningForeground: string;
|
|
54
|
+
colorStatusWarningStroke: string;
|
|
55
|
+
|
|
56
|
+
// Spacing — Horizontal
|
|
57
|
+
spacingHorizontalXXS: string;
|
|
58
|
+
spacingHorizontalXS: string;
|
|
59
|
+
spacingHorizontalSNudge: string;
|
|
60
|
+
spacingHorizontalS: string;
|
|
61
|
+
spacingHorizontalMNudge: string;
|
|
62
|
+
spacingHorizontalM: string;
|
|
63
|
+
spacingHorizontalL: string;
|
|
64
|
+
spacingHorizontalXL: string;
|
|
65
|
+
spacingHorizontalXXL: string;
|
|
66
|
+
spacingHorizontalXXXL: string;
|
|
67
|
+
|
|
68
|
+
// Spacing — Vertical
|
|
69
|
+
spacingVerticalXXS: string;
|
|
70
|
+
spacingVerticalXS: string;
|
|
71
|
+
spacingVerticalSNudge: string;
|
|
72
|
+
spacingVerticalS: string;
|
|
73
|
+
spacingVerticalMNudge: string;
|
|
74
|
+
spacingVerticalM: string;
|
|
75
|
+
spacingVerticalL: string;
|
|
76
|
+
spacingVerticalXL: string;
|
|
77
|
+
spacingVerticalXXL: string;
|
|
78
|
+
spacingVerticalXXXL: string;
|
|
79
|
+
|
|
80
|
+
// Border Radius
|
|
81
|
+
borderRadiusNone: string;
|
|
82
|
+
borderRadiusSmall: string;
|
|
83
|
+
borderRadiusMedium: string;
|
|
84
|
+
borderRadiusLarge: string;
|
|
85
|
+
borderRadiusXLarge: string;
|
|
86
|
+
borderRadiusCircular: string;
|
|
87
|
+
|
|
88
|
+
// Font Family
|
|
89
|
+
fontFamilyBase: string;
|
|
90
|
+
fontFamilyMonospace: string;
|
|
91
|
+
fontFamilyNumeric: string;
|
|
92
|
+
|
|
93
|
+
// Font Size
|
|
94
|
+
fontSizeBase100: string;
|
|
95
|
+
fontSizeBase200: string;
|
|
96
|
+
fontSizeBase300: string;
|
|
97
|
+
fontSizeBase400: string;
|
|
98
|
+
fontSizeBase500: string;
|
|
99
|
+
fontSizeBase600: string;
|
|
100
|
+
|
|
101
|
+
// Font Weight
|
|
102
|
+
fontWeightRegular: string;
|
|
103
|
+
fontWeightMedium: string;
|
|
104
|
+
fontWeightSemibold: string;
|
|
105
|
+
fontWeightBold: string;
|
|
106
|
+
|
|
107
|
+
// Line Height
|
|
108
|
+
lineHeightBase100: string;
|
|
109
|
+
lineHeightBase200: string;
|
|
110
|
+
lineHeightBase300: string;
|
|
111
|
+
lineHeightBase400: string;
|
|
112
|
+
lineHeightBase500: string;
|
|
113
|
+
lineHeightBase600: string;
|
|
114
|
+
|
|
115
|
+
// Shadows
|
|
116
|
+
shadow2: string;
|
|
117
|
+
shadow4: string;
|
|
118
|
+
shadow8: string;
|
|
119
|
+
shadow16: string;
|
|
120
|
+
shadow28: string;
|
|
121
|
+
shadow64: string;
|
|
122
|
+
|
|
123
|
+
// Stroke Width
|
|
124
|
+
strokeWidthThin: string;
|
|
125
|
+
strokeWidthThick: string;
|
|
126
|
+
strokeWidthThicker: string;
|
|
127
|
+
strokeWidthThickest: string;
|
|
128
|
+
|
|
129
|
+
// Duration
|
|
130
|
+
durationUltraFast: string;
|
|
131
|
+
durationFaster: string;
|
|
132
|
+
durationFast: string;
|
|
133
|
+
durationNormal: string;
|
|
134
|
+
durationGentle: string;
|
|
135
|
+
durationSlow: string;
|
|
136
|
+
durationSlower: string;
|
|
137
|
+
|
|
138
|
+
// Easing
|
|
139
|
+
curveAccelerateMax: string;
|
|
140
|
+
curveAccelerateMid: string;
|
|
141
|
+
curveAccelerateMin: string;
|
|
142
|
+
curveDecelerateMax: string;
|
|
143
|
+
curveDecelerateMid: string;
|
|
144
|
+
curveDecelerateMin: string;
|
|
145
|
+
curveEasyEase: string;
|
|
146
|
+
curveLinear: string;
|
|
147
|
+
}
|