@teamturing/react-kit 2.0.1 → 2.1.0
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/core/ThemeProvider/index.d.ts +9 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +131 -42
- package/dist/theme/index.d.ts +226 -0
- package/esm/core/Button/index.js +21 -20
- package/esm/core/Chip/index.js +3 -2
- package/esm/core/Grid/index.js +2 -0
- package/esm/core/IconButton/index.js +21 -19
- package/esm/core/IconToggleButton/index.js +3 -1
- package/esm/core/Spinner/index.js +2 -0
- package/esm/core/Stack/index.js +2 -0
- package/esm/core/Text/index.js +1 -0
- package/esm/core/ThemeProvider/index.js +16 -0
- package/esm/enigma/EnigmaUI/index.js +2 -0
- package/esm/index.js +2 -0
- package/esm/packages/token-studio/esm/foundation/gradient/colorStopList/index.js +8 -0
- package/esm/packages/token-studio/esm/foundation/gradient/direction/index.js +8 -0
- package/esm/packages/token-studio/esm/foundation/shadow/index.js +5 -0
- package/esm/packages/token-studio/esm/token/elevation/index.js +16 -0
- package/esm/packages/token-studio/esm/token/gradient/index.js +33 -0
- package/esm/theme/index.js +29 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
type Theme = {
|
|
3
|
+
[key in string]: any;
|
|
4
|
+
};
|
|
5
|
+
type Props = {
|
|
6
|
+
theme?: Theme;
|
|
7
|
+
};
|
|
8
|
+
declare const ThemeProvider: ({ theme: propTheme, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default ThemeProvider;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { default as StyledIcon } from './core/StyledIcon';
|
|
|
27
27
|
export type { StyledIconProps } from './core/StyledIcon';
|
|
28
28
|
export { default as Text } from './core/Text';
|
|
29
29
|
export type { TextProps } from './core/Text';
|
|
30
|
+
export { default as ThemeProvider } from './core/ThemeProvider';
|
|
30
31
|
export { default as View } from './core/View';
|
|
31
32
|
export type { ViewProps } from './core/View';
|
|
32
33
|
export { default as UnstyledButton } from './core/_UnstyledButton';
|
|
@@ -43,3 +44,7 @@ export { default as useOutsideClick } from './hook/useOutsideClick';
|
|
|
43
44
|
export { default as useProvidedOrCreatedRef } from './hook/useProvidedOrCreatedRef';
|
|
44
45
|
export { default as useResize } from './hook/useResize';
|
|
45
46
|
export { default as useToggleHandler } from './hook/useToggleHandler';
|
|
47
|
+
/**
|
|
48
|
+
* theme
|
|
49
|
+
*/
|
|
50
|
+
export { default as theme } from './theme';
|
package/dist/index.js
CHANGED
|
@@ -262,6 +262,65 @@ const color$1 = {
|
|
|
262
262
|
...scaleColor
|
|
263
263
|
};
|
|
264
264
|
|
|
265
|
+
const shadow$1 = {
|
|
266
|
+
shadowMedium: '0px 0px 1px 0px rgba(0, 0, 0, 0.06), 0px 8px 24px 0px rgba(0, 0, 0, 0.12)'
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
const surfaceElevation = {
|
|
270
|
+
'surface': palette.white,
|
|
271
|
+
'surface/overlay': palette.white
|
|
272
|
+
};
|
|
273
|
+
const shadowElevation = {
|
|
274
|
+
'shadow/overlay': shadow$1.shadowMedium
|
|
275
|
+
};
|
|
276
|
+
({
|
|
277
|
+
...surfaceElevation,
|
|
278
|
+
...shadowElevation
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
const colorStopList = {
|
|
282
|
+
colorStopListVioletPink: '#8E6CF0, #CF75F3',
|
|
283
|
+
colorStopListBlackGray: '#0F0E0F, #595959',
|
|
284
|
+
colorStopListWhite: '#FFFFFF, #FFFFFF00',
|
|
285
|
+
colorStopListBlack: '#000000, #00000000'
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
const direction = {
|
|
289
|
+
directionToRight: 'to right',
|
|
290
|
+
directionToLeft: 'to left',
|
|
291
|
+
directionToRightBottom: 'to right bottom',
|
|
292
|
+
directionToTop: 'to top'
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const generateGradientTokenValue = (direction$1, colorStopList$1) => `${direction[direction$1]}, ${colorStopList[colorStopList$1]}`;
|
|
296
|
+
const textGradient = {
|
|
297
|
+
'text/accent': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink')
|
|
298
|
+
};
|
|
299
|
+
const bgGradient = {
|
|
300
|
+
'bg/accent/violet': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink'),
|
|
301
|
+
'bg/accent/neutral': generateGradientTokenValue('directionToRightBottom', 'colorStopListBlackGray')
|
|
302
|
+
};
|
|
303
|
+
const borderGradient = {
|
|
304
|
+
'border/accent/violet': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink')
|
|
305
|
+
};
|
|
306
|
+
const overlayGradient = {
|
|
307
|
+
'overlay/subtlest/toright': generateGradientTokenValue('directionToRight', 'colorStopListWhite'),
|
|
308
|
+
'overlay/subtlest/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListWhite'),
|
|
309
|
+
'overlay/subtlest/totop': generateGradientTokenValue('directionToTop', 'colorStopListWhite'),
|
|
310
|
+
'overlay/floating/toright': generateGradientTokenValue('directionToRight', 'colorStopListWhite'),
|
|
311
|
+
'overlay/floating/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListWhite'),
|
|
312
|
+
'overlay/floating/totop': generateGradientTokenValue('directionToTop', 'colorStopListWhite'),
|
|
313
|
+
'overlay/bold/toright': generateGradientTokenValue('directionToRight', 'colorStopListBlack'),
|
|
314
|
+
'overlay/bold/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListBlack'),
|
|
315
|
+
'overlay/bold/totop': generateGradientTokenValue('directionToTop', 'colorStopListBlack')
|
|
316
|
+
};
|
|
317
|
+
const gradient = {
|
|
318
|
+
...textGradient,
|
|
319
|
+
...bgGradient,
|
|
320
|
+
...borderGradient,
|
|
321
|
+
...overlayGradient
|
|
322
|
+
};
|
|
323
|
+
|
|
265
324
|
const rounding = {
|
|
266
325
|
rounding0: 0,
|
|
267
326
|
rounding4: 4,
|
|
@@ -3015,13 +3074,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3015
3074
|
'& svg': {
|
|
3016
3075
|
color: color$1['icon/inverse']
|
|
3017
3076
|
},
|
|
3018
|
-
'
|
|
3077
|
+
'&:hover:not(:disabled)': {
|
|
3019
3078
|
backgroundColor: color$1['bg/primary/hovered']
|
|
3020
3079
|
},
|
|
3021
|
-
'
|
|
3080
|
+
'&:active:not(:disabled)': {
|
|
3022
3081
|
backgroundColor: color$1['bg/primary/pressed']
|
|
3023
3082
|
},
|
|
3024
|
-
'
|
|
3083
|
+
'&:focus-visible': {
|
|
3025
3084
|
outlineColor: color$1['border/focused'],
|
|
3026
3085
|
outlineStyle: 'solid',
|
|
3027
3086
|
outlineWidth: 2,
|
|
@@ -3041,13 +3100,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3041
3100
|
'& svg': {
|
|
3042
3101
|
color: color$1['icon/primary']
|
|
3043
3102
|
},
|
|
3044
|
-
'
|
|
3103
|
+
'&:hover:not(:disabled)': {
|
|
3045
3104
|
backgroundColor: color$1['bg/secondary/hovered']
|
|
3046
3105
|
},
|
|
3047
|
-
'
|
|
3106
|
+
'&:active:not(:disabled)': {
|
|
3048
3107
|
backgroundColor: color$1['bg/secondary/pressed']
|
|
3049
3108
|
},
|
|
3050
|
-
'
|
|
3109
|
+
'&:focus-visible': {
|
|
3051
3110
|
outlineColor: color$1['border/focused'],
|
|
3052
3111
|
outlineStyle: 'solid',
|
|
3053
3112
|
outlineWidth: 2,
|
|
@@ -3067,13 +3126,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3067
3126
|
'& svg': {
|
|
3068
3127
|
color: color$1['icon/accent/gray']
|
|
3069
3128
|
},
|
|
3070
|
-
'
|
|
3129
|
+
'&:hover:not(:disabled)': {
|
|
3071
3130
|
backgroundColor: color$1['bg/neutral/hovered']
|
|
3072
3131
|
},
|
|
3073
|
-
'
|
|
3132
|
+
'&:active:not(:disabled)': {
|
|
3074
3133
|
backgroundColor: color$1['bg/neutral/pressed']
|
|
3075
3134
|
},
|
|
3076
|
-
'
|
|
3135
|
+
'&:focus-visible': {
|
|
3077
3136
|
outlineColor: color$1['border/focused'],
|
|
3078
3137
|
outlineStyle: 'solid',
|
|
3079
3138
|
outlineWidth: 2,
|
|
@@ -3093,7 +3152,7 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3093
3152
|
'& svg': {
|
|
3094
3153
|
color: color$1['icon/neutral/bolder']
|
|
3095
3154
|
},
|
|
3096
|
-
'
|
|
3155
|
+
'&:after': {
|
|
3097
3156
|
content: '""',
|
|
3098
3157
|
position: 'absolute',
|
|
3099
3158
|
top: 0,
|
|
@@ -3106,13 +3165,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3106
3165
|
borderRadius: radii.full,
|
|
3107
3166
|
boxSizing: 'border-box'
|
|
3108
3167
|
},
|
|
3109
|
-
'
|
|
3168
|
+
'&:hover:not(:disabled)': {
|
|
3110
3169
|
backgroundColor: color$1['bg/neutral/subtler/hovered']
|
|
3111
3170
|
},
|
|
3112
|
-
'
|
|
3171
|
+
'&:active:not(:disabled)': {
|
|
3113
3172
|
backgroundColor: color$1['bg/neutral/subtler/pressed']
|
|
3114
3173
|
},
|
|
3115
|
-
'
|
|
3174
|
+
'&:focus-visible': {
|
|
3116
3175
|
outlineColor: color$1['border/focused'],
|
|
3117
3176
|
outlineStyle: 'solid',
|
|
3118
3177
|
outlineWidth: 2,
|
|
@@ -3124,7 +3183,7 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3124
3183
|
'& svg': {
|
|
3125
3184
|
color: color$1['icon/disabled']
|
|
3126
3185
|
},
|
|
3127
|
-
'
|
|
3186
|
+
'&:after': {
|
|
3128
3187
|
display: 'none'
|
|
3129
3188
|
}
|
|
3130
3189
|
} : {})
|
|
@@ -3135,19 +3194,19 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3135
3194
|
'& svg': {
|
|
3136
3195
|
color: color$1['icon/neutral/bolder']
|
|
3137
3196
|
},
|
|
3138
|
-
'
|
|
3197
|
+
'&:hover:not(:disabled)': {
|
|
3139
3198
|
'color': color$1['text/neutral'],
|
|
3140
3199
|
'& svg': {
|
|
3141
3200
|
color: color$1['icon/accent/gray']
|
|
3142
3201
|
}
|
|
3143
3202
|
},
|
|
3144
|
-
'
|
|
3203
|
+
'&:active:not(:disabled)': {
|
|
3145
3204
|
'color': color$1['text/neutral'],
|
|
3146
3205
|
'& svg': {
|
|
3147
3206
|
color: color$1['icon/accent/gray']
|
|
3148
3207
|
}
|
|
3149
3208
|
},
|
|
3150
|
-
'
|
|
3209
|
+
'&:focus-visible': {
|
|
3151
3210
|
outlineColor: color$1['border/focused'],
|
|
3152
3211
|
outlineStyle: 'solid',
|
|
3153
3212
|
outlineWidth: 2,
|
|
@@ -3167,13 +3226,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3167
3226
|
'& svg': {
|
|
3168
3227
|
color: color$1['icon/inverse']
|
|
3169
3228
|
},
|
|
3170
|
-
'
|
|
3229
|
+
'&:hover:not(:disabled)': {
|
|
3171
3230
|
backgroundColor: color$1['bg/danger/bold/hovered']
|
|
3172
3231
|
},
|
|
3173
|
-
'
|
|
3232
|
+
'&:active:not(:disabled)': {
|
|
3174
3233
|
backgroundColor: color$1['bg/danger/bold/pressed']
|
|
3175
3234
|
},
|
|
3176
|
-
'
|
|
3235
|
+
'&:focus-visible': {
|
|
3177
3236
|
outlineColor: color$1['border/focused'],
|
|
3178
3237
|
outlineStyle: 'solid',
|
|
3179
3238
|
outlineWidth: 2,
|
|
@@ -3321,7 +3380,7 @@ const BaseChip = styled__default.default.span({
|
|
|
3321
3380
|
'& svg': {
|
|
3322
3381
|
color: color$1['icon/primary']
|
|
3323
3382
|
},
|
|
3324
|
-
'
|
|
3383
|
+
'&:after': {
|
|
3325
3384
|
content: '""',
|
|
3326
3385
|
position: 'absolute',
|
|
3327
3386
|
top: 0,
|
|
@@ -3341,7 +3400,7 @@ const BaseChip = styled__default.default.span({
|
|
|
3341
3400
|
'& svg': {
|
|
3342
3401
|
color: color$1['icon/neutral/bolder']
|
|
3343
3402
|
},
|
|
3344
|
-
'
|
|
3403
|
+
'&:after': {
|
|
3345
3404
|
content: '""',
|
|
3346
3405
|
position: 'absolute',
|
|
3347
3406
|
top: 0,
|
|
@@ -3595,7 +3654,7 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3595
3654
|
pointerEvents: 'none'
|
|
3596
3655
|
},
|
|
3597
3656
|
'cursor': $loading ? 'progress' : $disabled ? 'not-allowed' : 'pointer',
|
|
3598
|
-
'
|
|
3657
|
+
'&:focus-visible': {
|
|
3599
3658
|
outlineColor: color$1['border/focused'],
|
|
3600
3659
|
outlineStyle: 'solid',
|
|
3601
3660
|
outlineWidth: 2,
|
|
@@ -3634,10 +3693,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3634
3693
|
'primary': {
|
|
3635
3694
|
'backgroundColor': color$1['bg/primary'],
|
|
3636
3695
|
'color': color$1['icon/inverse'],
|
|
3637
|
-
'
|
|
3696
|
+
'&:hover:not(:disabled)': {
|
|
3638
3697
|
backgroundColor: color$1['bg/primary/hovered']
|
|
3639
3698
|
},
|
|
3640
|
-
'
|
|
3699
|
+
'&:active:not(:disabled)': {
|
|
3641
3700
|
backgroundColor: color$1['bg/primary/pressed']
|
|
3642
3701
|
},
|
|
3643
3702
|
...($disabled ? {
|
|
@@ -3648,10 +3707,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3648
3707
|
'secondary': {
|
|
3649
3708
|
'backgroundColor': color$1['bg/secondary'],
|
|
3650
3709
|
'color': color$1['icon/primary'],
|
|
3651
|
-
'
|
|
3710
|
+
'&:hover:not(:disabled)': {
|
|
3652
3711
|
backgroundColor: color$1['bg/secondary/hovered']
|
|
3653
3712
|
},
|
|
3654
|
-
'
|
|
3713
|
+
'&:active:not(:disabled)': {
|
|
3655
3714
|
backgroundColor: color$1['bg/secondary/pressed']
|
|
3656
3715
|
},
|
|
3657
3716
|
...($disabled ? {
|
|
@@ -3662,10 +3721,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3662
3721
|
'tertiary': {
|
|
3663
3722
|
'backgroundColor': color$1['bg/neutral'],
|
|
3664
3723
|
'color': color$1['icon/accent/gray'],
|
|
3665
|
-
'
|
|
3724
|
+
'&:hover:not(:disabled)': {
|
|
3666
3725
|
backgroundColor: color$1['bg/neutral/hovered']
|
|
3667
3726
|
},
|
|
3668
|
-
'
|
|
3727
|
+
'&:active:not(:disabled)': {
|
|
3669
3728
|
backgroundColor: color$1['bg/neutral/pressed']
|
|
3670
3729
|
},
|
|
3671
3730
|
...($disabled ? {
|
|
@@ -3676,7 +3735,7 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3676
3735
|
'outlined': {
|
|
3677
3736
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3678
3737
|
'color': color$1['icon/neutral/bolder'],
|
|
3679
|
-
'
|
|
3738
|
+
'&:after': {
|
|
3680
3739
|
content: '""',
|
|
3681
3740
|
position: 'absolute',
|
|
3682
3741
|
top: 0,
|
|
@@ -3689,16 +3748,16 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3689
3748
|
borderRadius: radii.full,
|
|
3690
3749
|
boxSizing: 'border-box'
|
|
3691
3750
|
},
|
|
3692
|
-
'
|
|
3751
|
+
'&:hover:not(:disabled)': {
|
|
3693
3752
|
backgroundColor: color$1['bg/neutral/subtler/hovered']
|
|
3694
3753
|
},
|
|
3695
|
-
'
|
|
3754
|
+
'&:active:not(:disabled)': {
|
|
3696
3755
|
backgroundColor: color$1['bg/neutral/subtler/pressed']
|
|
3697
3756
|
},
|
|
3698
3757
|
...($disabled ? {
|
|
3699
3758
|
'backgroundColor': color$1['bg/disabled'],
|
|
3700
3759
|
'color': color$1['icon/disabled'],
|
|
3701
|
-
'
|
|
3760
|
+
'&:after': {
|
|
3702
3761
|
display: 'none'
|
|
3703
3762
|
}
|
|
3704
3763
|
} : {})
|
|
@@ -3706,10 +3765,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3706
3765
|
'plain-bold': {
|
|
3707
3766
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3708
3767
|
'color': color$1['icon/neutral/bolder'],
|
|
3709
|
-
'
|
|
3768
|
+
'&:hover:not(:disabled)': {
|
|
3710
3769
|
color: color$1['icon/accent/gray']
|
|
3711
3770
|
},
|
|
3712
|
-
'
|
|
3771
|
+
'&:active:not(:disabled)': {
|
|
3713
3772
|
color: color$1['icon/accent/gray']
|
|
3714
3773
|
},
|
|
3715
3774
|
...($disabled ? {
|
|
@@ -3720,10 +3779,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3720
3779
|
'plain': {
|
|
3721
3780
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3722
3781
|
'color': color$1['icon/neutral/bold'],
|
|
3723
|
-
'
|
|
3782
|
+
'&:hover:not(:disabled)': {
|
|
3724
3783
|
color: color$1['icon/neutral/bolder']
|
|
3725
3784
|
},
|
|
3726
|
-
'
|
|
3785
|
+
'&:active:not(:disabled)': {
|
|
3727
3786
|
color: color$1['icon/neutral/bolder']
|
|
3728
3787
|
},
|
|
3729
3788
|
...($disabled ? {
|
|
@@ -3734,10 +3793,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3734
3793
|
'plain-subtle': {
|
|
3735
3794
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3736
3795
|
'color': color$1['icon/neutral'],
|
|
3737
|
-
'
|
|
3796
|
+
'&:hover:not(:disabled)': {
|
|
3738
3797
|
color: color$1['icon/neutral/bold']
|
|
3739
3798
|
},
|
|
3740
|
-
'
|
|
3799
|
+
'&:active:not(:disabled)': {
|
|
3741
3800
|
color: color$1['icon/neutral/bold']
|
|
3742
3801
|
},
|
|
3743
3802
|
...($disabled ? {
|
|
@@ -3748,10 +3807,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3748
3807
|
'danger': {
|
|
3749
3808
|
'backgroundColor': color$1['bg/danger/bold'],
|
|
3750
3809
|
'color': color$1['icon/inverse'],
|
|
3751
|
-
'
|
|
3810
|
+
'&:hover:not(:disabled)': {
|
|
3752
3811
|
backgroundColor: color$1['bg/danger/bold/hovered']
|
|
3753
3812
|
},
|
|
3754
|
-
'
|
|
3813
|
+
'&:active:not(:disabled)': {
|
|
3755
3814
|
backgroundColor: color$1['bg/danger/bold/pressed']
|
|
3756
3815
|
},
|
|
3757
3816
|
...($disabled ? {
|
|
@@ -3794,7 +3853,7 @@ const BaseIconToggleButton = styled__default.default(UnstyledButton)(({
|
|
|
3794
3853
|
display: 'block'
|
|
3795
3854
|
},
|
|
3796
3855
|
'cursor': $disabled ? 'not-allowed' : 'pointer',
|
|
3797
|
-
'
|
|
3856
|
+
'&:focus-visible': {
|
|
3798
3857
|
outlineColor: color$1['border/focused'],
|
|
3799
3858
|
outlineStyle: 'solid',
|
|
3800
3859
|
outlineWidth: 2,
|
|
@@ -3952,6 +4011,34 @@ const StyledIcon = ({
|
|
|
3952
4011
|
children: /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {})
|
|
3953
4012
|
});
|
|
3954
4013
|
|
|
4014
|
+
const theme = {
|
|
4015
|
+
breakpoints,
|
|
4016
|
+
space: space$1,
|
|
4017
|
+
fontWeights,
|
|
4018
|
+
fontSizes,
|
|
4019
|
+
lineHeights,
|
|
4020
|
+
radii,
|
|
4021
|
+
colors: {
|
|
4022
|
+
...color$1,
|
|
4023
|
+
surfaceElevation
|
|
4024
|
+
},
|
|
4025
|
+
gradients: gradient,
|
|
4026
|
+
shadows: {
|
|
4027
|
+
...shadowElevation
|
|
4028
|
+
}
|
|
4029
|
+
};
|
|
4030
|
+
|
|
4031
|
+
const ThemeProvider = ({
|
|
4032
|
+
theme: propTheme,
|
|
4033
|
+
...props
|
|
4034
|
+
}) => {
|
|
4035
|
+
const theme$1 = propTheme ?? theme;
|
|
4036
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(styled.ThemeProvider, {
|
|
4037
|
+
theme: theme$1,
|
|
4038
|
+
...props
|
|
4039
|
+
});
|
|
4040
|
+
};
|
|
4041
|
+
|
|
3955
4042
|
const useMediaQuery = query => {
|
|
3956
4043
|
const getMatches = query => {
|
|
3957
4044
|
/**
|
|
@@ -4588,8 +4675,10 @@ exports.Spinner = Spinner;
|
|
|
4588
4675
|
exports.Stack = index;
|
|
4589
4676
|
exports.StyledIcon = StyledIcon;
|
|
4590
4677
|
exports.Text = Text;
|
|
4678
|
+
exports.ThemeProvider = ThemeProvider;
|
|
4591
4679
|
exports.UnstyledButton = UnstyledButton;
|
|
4592
4680
|
exports.View = View;
|
|
4681
|
+
exports.theme = theme;
|
|
4593
4682
|
exports.useDevice = useDevice;
|
|
4594
4683
|
exports.useOutsideClick = useOutsideClick;
|
|
4595
4684
|
exports.useProvidedOrCreatedRef = useProvidedOrCreatedRef;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
declare const theme: {
|
|
2
|
+
breakpoints: string[];
|
|
3
|
+
space: {
|
|
4
|
+
readonly '-80': number;
|
|
5
|
+
readonly '-50': number;
|
|
6
|
+
readonly '-48': number;
|
|
7
|
+
readonly '-40': number;
|
|
8
|
+
readonly '-32': number;
|
|
9
|
+
readonly '-30': number;
|
|
10
|
+
readonly '-28': number;
|
|
11
|
+
readonly '-24': number;
|
|
12
|
+
readonly '-20': number;
|
|
13
|
+
readonly '-18': number;
|
|
14
|
+
readonly '-16': number;
|
|
15
|
+
readonly '-14': number;
|
|
16
|
+
readonly '-12': number;
|
|
17
|
+
readonly '-10': number;
|
|
18
|
+
readonly '-8': number;
|
|
19
|
+
readonly '-7': number;
|
|
20
|
+
readonly '-6': number;
|
|
21
|
+
readonly '-5': number;
|
|
22
|
+
readonly '-4': number;
|
|
23
|
+
readonly '-3': number;
|
|
24
|
+
readonly '-2': number;
|
|
25
|
+
readonly '-1': number;
|
|
26
|
+
readonly '-0.5': number;
|
|
27
|
+
readonly '-0.25': number;
|
|
28
|
+
readonly 0: number;
|
|
29
|
+
readonly 0.25: number;
|
|
30
|
+
readonly 0.5: number;
|
|
31
|
+
readonly 1: number;
|
|
32
|
+
readonly 2: number;
|
|
33
|
+
readonly 3: number;
|
|
34
|
+
readonly 4: number;
|
|
35
|
+
readonly 5: number;
|
|
36
|
+
readonly 6: number;
|
|
37
|
+
readonly 7: number;
|
|
38
|
+
readonly 8: number;
|
|
39
|
+
readonly 10: number;
|
|
40
|
+
readonly 12: number;
|
|
41
|
+
readonly 14: number;
|
|
42
|
+
readonly 16: number;
|
|
43
|
+
readonly 18: number;
|
|
44
|
+
readonly 20: number;
|
|
45
|
+
readonly 24: number;
|
|
46
|
+
readonly 28: number;
|
|
47
|
+
readonly 30: number;
|
|
48
|
+
readonly 32: number;
|
|
49
|
+
readonly 40: number;
|
|
50
|
+
readonly 48: number;
|
|
51
|
+
readonly 50: number;
|
|
52
|
+
readonly 80: number;
|
|
53
|
+
};
|
|
54
|
+
fontWeights: {
|
|
55
|
+
readonly regular: number;
|
|
56
|
+
readonly medium: number;
|
|
57
|
+
readonly bold: number;
|
|
58
|
+
};
|
|
59
|
+
fontSizes: {
|
|
60
|
+
xxs: number;
|
|
61
|
+
xs: number;
|
|
62
|
+
s: number;
|
|
63
|
+
m: number;
|
|
64
|
+
l: number;
|
|
65
|
+
xl: number;
|
|
66
|
+
xxl: number;
|
|
67
|
+
display4: number;
|
|
68
|
+
display3: number;
|
|
69
|
+
display2: number;
|
|
70
|
+
display1: number;
|
|
71
|
+
};
|
|
72
|
+
lineHeights: {
|
|
73
|
+
readonly 1: number;
|
|
74
|
+
readonly 2: number;
|
|
75
|
+
};
|
|
76
|
+
radii: {
|
|
77
|
+
readonly none: number;
|
|
78
|
+
readonly xxs: number;
|
|
79
|
+
readonly xs: number;
|
|
80
|
+
readonly s: number;
|
|
81
|
+
readonly m: number;
|
|
82
|
+
readonly l: number;
|
|
83
|
+
readonly xl: number;
|
|
84
|
+
readonly xxl: number;
|
|
85
|
+
readonly full: number;
|
|
86
|
+
};
|
|
87
|
+
colors: {
|
|
88
|
+
surfaceElevation: {
|
|
89
|
+
readonly surface: "#FFFFFF";
|
|
90
|
+
readonly 'surface/overlay': "#FFFFFF";
|
|
91
|
+
};
|
|
92
|
+
'scale/violet/0': "#F3EFFD";
|
|
93
|
+
'scale/violet/1': "#E8E1FB";
|
|
94
|
+
'scale/violet/2': "#D9CDF9";
|
|
95
|
+
'scale/violet/3': "#C6B5F6";
|
|
96
|
+
'scale/violet/4': "#9C7EEF";
|
|
97
|
+
'scale/violet/5': "#835EEB";
|
|
98
|
+
'scale/violet/6': "#7756D6";
|
|
99
|
+
'scale/violet/7': "#5D43A7";
|
|
100
|
+
'scale/violet/8': "#483481";
|
|
101
|
+
'scale/violet/9': "#372763";
|
|
102
|
+
dim: "#00000099";
|
|
103
|
+
link: "#4880ee";
|
|
104
|
+
'link/hovered': "#335ba9";
|
|
105
|
+
'link/pressed': "#335ba9";
|
|
106
|
+
'link/neutral': "#7A828D";
|
|
107
|
+
'link/neutral/hovered': "#575C64";
|
|
108
|
+
'link/neutral/pressed': "#575C64";
|
|
109
|
+
'link/neutral/bold': "#575C64";
|
|
110
|
+
'link/neutral/bold/hovered': "#33373B";
|
|
111
|
+
'link/neutral/bold/pressed': "#33373B";
|
|
112
|
+
'link/disabled': "#575C64";
|
|
113
|
+
'icon/neutral': "#D1D5DB";
|
|
114
|
+
'icon/neutral/bold': "#8D94A0";
|
|
115
|
+
'icon/neutral/bolder': "#575C64";
|
|
116
|
+
'icon/accent/gray': "#33373B";
|
|
117
|
+
'icon/accent/blue': "#4880ee";
|
|
118
|
+
'icon/accent/blue/bold': "#335ba9";
|
|
119
|
+
'icon/accent/green': "#1FCCA1";
|
|
120
|
+
'icon/accent/yellow': "#FFC107";
|
|
121
|
+
'icon/accent/red': "#F22735";
|
|
122
|
+
'icon/inverse': "#FFFFFF";
|
|
123
|
+
'icon/disabled': "#D1D5DB";
|
|
124
|
+
'icon/disabled/subtler': "#E5E7EB";
|
|
125
|
+
'icon/selected/violet': "#835EEB";
|
|
126
|
+
'icon/selected': "#33373B";
|
|
127
|
+
'icon/primary/subtle': "#C6B5F6";
|
|
128
|
+
'icon/primary': "#835EEB";
|
|
129
|
+
'icon/primary/bold': "#5D43A7";
|
|
130
|
+
'icon/success': "#1FCCA1";
|
|
131
|
+
'icon/warning': "#FFC107";
|
|
132
|
+
'icon/danger': "#F22735";
|
|
133
|
+
'border/neutral/subtle': "#F3F4F6";
|
|
134
|
+
'border/neutral': "#E5E7EB";
|
|
135
|
+
'border/neutral/bolder': "#D1D5DB";
|
|
136
|
+
'border/input': "#E5E7EB";
|
|
137
|
+
'border/inverse': "#FFFFFF1A";
|
|
138
|
+
'border/selected': "#33373B";
|
|
139
|
+
'border/disabled': "#F3F4F6";
|
|
140
|
+
'border/primary': "#835EEB";
|
|
141
|
+
'border/hovered': "#84aaf4";
|
|
142
|
+
'border/focused': "#4880ee";
|
|
143
|
+
'border/danger': "#F22735";
|
|
144
|
+
'border/success': "#1FCCA1";
|
|
145
|
+
'bg/secondary': "#F3EFFD";
|
|
146
|
+
'bg/secondary/hovered': "#D9CDF9";
|
|
147
|
+
'bg/secondary/pressed': "#D9CDF9";
|
|
148
|
+
'bg/primary': "#835EEB";
|
|
149
|
+
'bg/primary/hovered': "#5D43A7";
|
|
150
|
+
'bg/primary/pressed': "#5D43A7";
|
|
151
|
+
'bg/neutral/subtler': "#FFFFFF00";
|
|
152
|
+
'bg/neutral/subtler/hovered': "#F3F4F6";
|
|
153
|
+
'bg/neutral/subtler/pressed': "#F3F4F6";
|
|
154
|
+
'bg/neutral/subtle': "#F9FAFB";
|
|
155
|
+
'bg/neutral/subtle/hovered': "#E5E7EB";
|
|
156
|
+
'bg/neutral/subtle/pressed': "#E5E7EB";
|
|
157
|
+
'bg/neutral': "#F3F4F6";
|
|
158
|
+
'bg/neutral/hovered': "#D1D5DB";
|
|
159
|
+
'bg/neutral/pressed': "#D1D5DB";
|
|
160
|
+
'bg/neutral/bold': "#575C64";
|
|
161
|
+
'bg/neutral/bold/hovered': "#33373B";
|
|
162
|
+
'bg/neutral/bold/pressed': "#33373B";
|
|
163
|
+
'bg/neutral/bolder': "#33373B";
|
|
164
|
+
'bg/neutral/bolder/hovered': "#000000";
|
|
165
|
+
'bg/neutral/bolder/pressed': "#000000";
|
|
166
|
+
'bg/disabled': "#F3F4F6";
|
|
167
|
+
'bg/disabled/subtlest': "#FFFFFF00";
|
|
168
|
+
'bg/input': "#FFFFFF";
|
|
169
|
+
'bg/accent/blue/subtlest': "#edf2fd";
|
|
170
|
+
'bg/accent/green/subtlest': "#E9FAF6";
|
|
171
|
+
'bg/accent/yellow/subtlest': "#FFF9E6";
|
|
172
|
+
'bg/accent/red/subtlest': "#FEE9EB";
|
|
173
|
+
'bg/accent/red/subtle': "#F5525D";
|
|
174
|
+
'bg/accent/red': "#F22735";
|
|
175
|
+
'bg/accent/gray/subtlest': "#E5E7EB";
|
|
176
|
+
'bg/selected/violet': "#835EEB";
|
|
177
|
+
'bg/selected': "#33373B";
|
|
178
|
+
'bg/selected/subtle': "#F3F4F6";
|
|
179
|
+
'bg/inverse': "#000000";
|
|
180
|
+
'bg/inverse/subtlest': "#FFFFFF1A";
|
|
181
|
+
'bg/success': "#E9FAF6";
|
|
182
|
+
'bg/success/bold': "#1FCCA1";
|
|
183
|
+
'bg/warning': "#FFF9E6";
|
|
184
|
+
'bg/warning/bold': "#FFC107";
|
|
185
|
+
'bg/danger': "#FEE9EB";
|
|
186
|
+
'bg/danger/bold': "#F5525D";
|
|
187
|
+
'bg/danger/bold/hovered': "#DC2330";
|
|
188
|
+
'bg/danger/bold/pressed': "#DC2330";
|
|
189
|
+
'text/primary': "#835EEB";
|
|
190
|
+
'text/accent/blue': "#4880ee";
|
|
191
|
+
'text/accent/green': "#1FCCA1";
|
|
192
|
+
'text/accent/yellow': "#FFC107";
|
|
193
|
+
'text/accent/red': "#F22735";
|
|
194
|
+
'text/neutral/subtlest': "#8D94A0";
|
|
195
|
+
'text/neutral/subtler': "#7A828D";
|
|
196
|
+
'text/neutral/subtle': "#575C64";
|
|
197
|
+
'text/neutral': "#33373B";
|
|
198
|
+
'text/inverse': "#FFFFFF";
|
|
199
|
+
'text/inverse/subtle': "#E5E7EB";
|
|
200
|
+
'text/inverse/subtler': "#D1D5DB";
|
|
201
|
+
'text/disabled': "#8D94A0";
|
|
202
|
+
'text/success': "#1FCCA1";
|
|
203
|
+
'text/warning': "#FFC107";
|
|
204
|
+
'text/danger': "#F22735";
|
|
205
|
+
'text/selected': "#33373B";
|
|
206
|
+
};
|
|
207
|
+
gradients: {
|
|
208
|
+
readonly 'overlay/subtlest/toright': string;
|
|
209
|
+
readonly 'overlay/subtlest/toleft': string;
|
|
210
|
+
readonly 'overlay/subtlest/totop': string;
|
|
211
|
+
readonly 'overlay/floating/toright': string;
|
|
212
|
+
readonly 'overlay/floating/toleft': string;
|
|
213
|
+
readonly 'overlay/floating/totop': string;
|
|
214
|
+
readonly 'overlay/bold/toright': string;
|
|
215
|
+
readonly 'overlay/bold/toleft': string;
|
|
216
|
+
readonly 'overlay/bold/totop': string;
|
|
217
|
+
readonly 'border/accent/violet': string;
|
|
218
|
+
readonly 'bg/accent/violet': string;
|
|
219
|
+
readonly 'bg/accent/neutral': string;
|
|
220
|
+
readonly 'text/accent': string;
|
|
221
|
+
};
|
|
222
|
+
shadows: {
|
|
223
|
+
'shadow/overlay': string;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
export default theme;
|
package/esm/core/Button/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
2
3
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
3
4
|
import typography from '../../packages/token-studio/esm/token/typography/index.js';
|
|
4
5
|
import { forwardRef } from 'react';
|
|
@@ -134,13 +135,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
134
135
|
'& svg': {
|
|
135
136
|
color: color['icon/inverse']
|
|
136
137
|
},
|
|
137
|
-
'
|
|
138
|
+
'&:hover:not(:disabled)': {
|
|
138
139
|
backgroundColor: color['bg/primary/hovered']
|
|
139
140
|
},
|
|
140
|
-
'
|
|
141
|
+
'&:active:not(:disabled)': {
|
|
141
142
|
backgroundColor: color['bg/primary/pressed']
|
|
142
143
|
},
|
|
143
|
-
'
|
|
144
|
+
'&:focus-visible': {
|
|
144
145
|
outlineColor: color['border/focused'],
|
|
145
146
|
outlineStyle: 'solid',
|
|
146
147
|
outlineWidth: 2,
|
|
@@ -160,13 +161,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
160
161
|
'& svg': {
|
|
161
162
|
color: color['icon/primary']
|
|
162
163
|
},
|
|
163
|
-
'
|
|
164
|
+
'&:hover:not(:disabled)': {
|
|
164
165
|
backgroundColor: color['bg/secondary/hovered']
|
|
165
166
|
},
|
|
166
|
-
'
|
|
167
|
+
'&:active:not(:disabled)': {
|
|
167
168
|
backgroundColor: color['bg/secondary/pressed']
|
|
168
169
|
},
|
|
169
|
-
'
|
|
170
|
+
'&:focus-visible': {
|
|
170
171
|
outlineColor: color['border/focused'],
|
|
171
172
|
outlineStyle: 'solid',
|
|
172
173
|
outlineWidth: 2,
|
|
@@ -186,13 +187,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
186
187
|
'& svg': {
|
|
187
188
|
color: color['icon/accent/gray']
|
|
188
189
|
},
|
|
189
|
-
'
|
|
190
|
+
'&:hover:not(:disabled)': {
|
|
190
191
|
backgroundColor: color['bg/neutral/hovered']
|
|
191
192
|
},
|
|
192
|
-
'
|
|
193
|
+
'&:active:not(:disabled)': {
|
|
193
194
|
backgroundColor: color['bg/neutral/pressed']
|
|
194
195
|
},
|
|
195
|
-
'
|
|
196
|
+
'&:focus-visible': {
|
|
196
197
|
outlineColor: color['border/focused'],
|
|
197
198
|
outlineStyle: 'solid',
|
|
198
199
|
outlineWidth: 2,
|
|
@@ -212,7 +213,7 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
212
213
|
'& svg': {
|
|
213
214
|
color: color['icon/neutral/bolder']
|
|
214
215
|
},
|
|
215
|
-
'
|
|
216
|
+
'&:after': {
|
|
216
217
|
content: '""',
|
|
217
218
|
position: 'absolute',
|
|
218
219
|
top: 0,
|
|
@@ -225,13 +226,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
225
226
|
borderRadius: radii.full,
|
|
226
227
|
boxSizing: 'border-box'
|
|
227
228
|
},
|
|
228
|
-
'
|
|
229
|
+
'&:hover:not(:disabled)': {
|
|
229
230
|
backgroundColor: color['bg/neutral/subtler/hovered']
|
|
230
231
|
},
|
|
231
|
-
'
|
|
232
|
+
'&:active:not(:disabled)': {
|
|
232
233
|
backgroundColor: color['bg/neutral/subtler/pressed']
|
|
233
234
|
},
|
|
234
|
-
'
|
|
235
|
+
'&:focus-visible': {
|
|
235
236
|
outlineColor: color['border/focused'],
|
|
236
237
|
outlineStyle: 'solid',
|
|
237
238
|
outlineWidth: 2,
|
|
@@ -243,7 +244,7 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
243
244
|
'& svg': {
|
|
244
245
|
color: color['icon/disabled']
|
|
245
246
|
},
|
|
246
|
-
'
|
|
247
|
+
'&:after': {
|
|
247
248
|
display: 'none'
|
|
248
249
|
}
|
|
249
250
|
} : {})
|
|
@@ -254,19 +255,19 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
254
255
|
'& svg': {
|
|
255
256
|
color: color['icon/neutral/bolder']
|
|
256
257
|
},
|
|
257
|
-
'
|
|
258
|
+
'&:hover:not(:disabled)': {
|
|
258
259
|
'color': color['text/neutral'],
|
|
259
260
|
'& svg': {
|
|
260
261
|
color: color['icon/accent/gray']
|
|
261
262
|
}
|
|
262
263
|
},
|
|
263
|
-
'
|
|
264
|
+
'&:active:not(:disabled)': {
|
|
264
265
|
'color': color['text/neutral'],
|
|
265
266
|
'& svg': {
|
|
266
267
|
color: color['icon/accent/gray']
|
|
267
268
|
}
|
|
268
269
|
},
|
|
269
|
-
'
|
|
270
|
+
'&:focus-visible': {
|
|
270
271
|
outlineColor: color['border/focused'],
|
|
271
272
|
outlineStyle: 'solid',
|
|
272
273
|
outlineWidth: 2,
|
|
@@ -286,13 +287,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
286
287
|
'& svg': {
|
|
287
288
|
color: color['icon/inverse']
|
|
288
289
|
},
|
|
289
|
-
'
|
|
290
|
+
'&:hover:not(:disabled)': {
|
|
290
291
|
backgroundColor: color['bg/danger/bold/hovered']
|
|
291
292
|
},
|
|
292
|
-
'
|
|
293
|
+
'&:active:not(:disabled)': {
|
|
293
294
|
backgroundColor: color['bg/danger/bold/pressed']
|
|
294
295
|
},
|
|
295
|
-
'
|
|
296
|
+
'&:focus-visible': {
|
|
296
297
|
outlineColor: color['border/focused'],
|
|
297
298
|
outlineStyle: 'solid',
|
|
298
299
|
outlineWidth: 2,
|
package/esm/core/Chip/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
2
3
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
3
4
|
import typography from '../../packages/token-studio/esm/token/typography/index.js';
|
|
4
5
|
import styled from 'styled-components';
|
|
@@ -99,7 +100,7 @@ const BaseChip = styled.span({
|
|
|
99
100
|
'& svg': {
|
|
100
101
|
color: color['icon/primary']
|
|
101
102
|
},
|
|
102
|
-
'
|
|
103
|
+
'&:after': {
|
|
103
104
|
content: '""',
|
|
104
105
|
position: 'absolute',
|
|
105
106
|
top: 0,
|
|
@@ -119,7 +120,7 @@ const BaseChip = styled.span({
|
|
|
119
120
|
'& svg': {
|
|
120
121
|
color: color['icon/neutral/bolder']
|
|
121
122
|
},
|
|
122
|
-
'
|
|
123
|
+
'&:after': {
|
|
123
124
|
content: '""',
|
|
124
125
|
position: 'absolute',
|
|
125
126
|
top: 0,
|
package/esm/core/Grid/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
1
2
|
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
3
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
4
|
import { forwardRef } from 'react';
|
|
3
5
|
import styled from 'styled-components';
|
|
4
6
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
2
3
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
4
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
3
5
|
import { forwardRef } from 'react';
|
|
4
6
|
import styled from 'styled-components';
|
|
5
7
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
@@ -44,7 +46,7 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
44
46
|
pointerEvents: 'none'
|
|
45
47
|
},
|
|
46
48
|
'cursor': $loading ? 'progress' : $disabled ? 'not-allowed' : 'pointer',
|
|
47
|
-
'
|
|
49
|
+
'&:focus-visible': {
|
|
48
50
|
outlineColor: color['border/focused'],
|
|
49
51
|
outlineStyle: 'solid',
|
|
50
52
|
outlineWidth: 2,
|
|
@@ -83,10 +85,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
83
85
|
'primary': {
|
|
84
86
|
'backgroundColor': color['bg/primary'],
|
|
85
87
|
'color': color['icon/inverse'],
|
|
86
|
-
'
|
|
88
|
+
'&:hover:not(:disabled)': {
|
|
87
89
|
backgroundColor: color['bg/primary/hovered']
|
|
88
90
|
},
|
|
89
|
-
'
|
|
91
|
+
'&:active:not(:disabled)': {
|
|
90
92
|
backgroundColor: color['bg/primary/pressed']
|
|
91
93
|
},
|
|
92
94
|
...($disabled ? {
|
|
@@ -97,10 +99,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
97
99
|
'secondary': {
|
|
98
100
|
'backgroundColor': color['bg/secondary'],
|
|
99
101
|
'color': color['icon/primary'],
|
|
100
|
-
'
|
|
102
|
+
'&:hover:not(:disabled)': {
|
|
101
103
|
backgroundColor: color['bg/secondary/hovered']
|
|
102
104
|
},
|
|
103
|
-
'
|
|
105
|
+
'&:active:not(:disabled)': {
|
|
104
106
|
backgroundColor: color['bg/secondary/pressed']
|
|
105
107
|
},
|
|
106
108
|
...($disabled ? {
|
|
@@ -111,10 +113,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
111
113
|
'tertiary': {
|
|
112
114
|
'backgroundColor': color['bg/neutral'],
|
|
113
115
|
'color': color['icon/accent/gray'],
|
|
114
|
-
'
|
|
116
|
+
'&:hover:not(:disabled)': {
|
|
115
117
|
backgroundColor: color['bg/neutral/hovered']
|
|
116
118
|
},
|
|
117
|
-
'
|
|
119
|
+
'&:active:not(:disabled)': {
|
|
118
120
|
backgroundColor: color['bg/neutral/pressed']
|
|
119
121
|
},
|
|
120
122
|
...($disabled ? {
|
|
@@ -125,7 +127,7 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
125
127
|
'outlined': {
|
|
126
128
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
127
129
|
'color': color['icon/neutral/bolder'],
|
|
128
|
-
'
|
|
130
|
+
'&:after': {
|
|
129
131
|
content: '""',
|
|
130
132
|
position: 'absolute',
|
|
131
133
|
top: 0,
|
|
@@ -138,16 +140,16 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
138
140
|
borderRadius: radii.full,
|
|
139
141
|
boxSizing: 'border-box'
|
|
140
142
|
},
|
|
141
|
-
'
|
|
143
|
+
'&:hover:not(:disabled)': {
|
|
142
144
|
backgroundColor: color['bg/neutral/subtler/hovered']
|
|
143
145
|
},
|
|
144
|
-
'
|
|
146
|
+
'&:active:not(:disabled)': {
|
|
145
147
|
backgroundColor: color['bg/neutral/subtler/pressed']
|
|
146
148
|
},
|
|
147
149
|
...($disabled ? {
|
|
148
150
|
'backgroundColor': color['bg/disabled'],
|
|
149
151
|
'color': color['icon/disabled'],
|
|
150
|
-
'
|
|
152
|
+
'&:after': {
|
|
151
153
|
display: 'none'
|
|
152
154
|
}
|
|
153
155
|
} : {})
|
|
@@ -155,10 +157,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
155
157
|
'plain-bold': {
|
|
156
158
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
157
159
|
'color': color['icon/neutral/bolder'],
|
|
158
|
-
'
|
|
160
|
+
'&:hover:not(:disabled)': {
|
|
159
161
|
color: color['icon/accent/gray']
|
|
160
162
|
},
|
|
161
|
-
'
|
|
163
|
+
'&:active:not(:disabled)': {
|
|
162
164
|
color: color['icon/accent/gray']
|
|
163
165
|
},
|
|
164
166
|
...($disabled ? {
|
|
@@ -169,10 +171,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
169
171
|
'plain': {
|
|
170
172
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
171
173
|
'color': color['icon/neutral/bold'],
|
|
172
|
-
'
|
|
174
|
+
'&:hover:not(:disabled)': {
|
|
173
175
|
color: color['icon/neutral/bolder']
|
|
174
176
|
},
|
|
175
|
-
'
|
|
177
|
+
'&:active:not(:disabled)': {
|
|
176
178
|
color: color['icon/neutral/bolder']
|
|
177
179
|
},
|
|
178
180
|
...($disabled ? {
|
|
@@ -183,10 +185,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
183
185
|
'plain-subtle': {
|
|
184
186
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
185
187
|
'color': color['icon/neutral'],
|
|
186
|
-
'
|
|
188
|
+
'&:hover:not(:disabled)': {
|
|
187
189
|
color: color['icon/neutral/bold']
|
|
188
190
|
},
|
|
189
|
-
'
|
|
191
|
+
'&:active:not(:disabled)': {
|
|
190
192
|
color: color['icon/neutral/bold']
|
|
191
193
|
},
|
|
192
194
|
...($disabled ? {
|
|
@@ -197,10 +199,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
197
199
|
'danger': {
|
|
198
200
|
'backgroundColor': color['bg/danger/bold'],
|
|
199
201
|
'color': color['icon/inverse'],
|
|
200
|
-
'
|
|
202
|
+
'&:hover:not(:disabled)': {
|
|
201
203
|
backgroundColor: color['bg/danger/bold/hovered']
|
|
202
204
|
},
|
|
203
|
-
'
|
|
205
|
+
'&:active:not(:disabled)': {
|
|
204
206
|
backgroundColor: color['bg/danger/bold/pressed']
|
|
205
207
|
},
|
|
206
208
|
...($disabled ? {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
2
3
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
4
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
3
5
|
import styled from 'styled-components';
|
|
4
6
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
5
7
|
import { sx } from '../../utils/styled-system/index.js';
|
|
@@ -39,7 +41,7 @@ const BaseIconToggleButton = styled(UnstyledButton)(({
|
|
|
39
41
|
display: 'block'
|
|
40
42
|
},
|
|
41
43
|
'cursor': $disabled ? 'not-allowed' : 'pointer',
|
|
42
|
-
'
|
|
44
|
+
'&:focus-visible': {
|
|
43
45
|
outlineColor: color['border/focused'],
|
|
44
46
|
outlineStyle: 'solid',
|
|
45
47
|
outlineWidth: 2,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import SvgProgressGradient from '../../packages/icons/esm/ProgressGradient.js';
|
|
3
3
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
4
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
5
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
4
6
|
import styled, { keyframes } from 'styled-components';
|
|
5
7
|
|
|
6
8
|
const spin = keyframes`
|
package/esm/core/Stack/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
1
2
|
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
3
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
4
|
import { forwardRef } from 'react';
|
|
3
5
|
import styled from 'styled-components';
|
|
4
6
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
package/esm/core/Text/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
1
2
|
import typography from '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import { fontSize, fontWeight, lineHeight, textAlign } from '../../node_modules/styled-system/dist/index.esm.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ThemeProvider as ThemeProvider$1 } from 'styled-components';
|
|
2
|
+
import theme from '../../theme/index.js';
|
|
3
|
+
import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
|
|
4
|
+
|
|
5
|
+
const ThemeProvider = ({
|
|
6
|
+
theme: propTheme,
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
const theme$1 = propTheme ?? theme;
|
|
10
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, {
|
|
11
|
+
theme: theme$1,
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { ThemeProvider as default };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import breakpoints from '../../packages/token-studio/esm/token/breakpoints/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/elevation/index.js';
|
|
3
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
4
|
import useMediaQuery from '../../hook/useMediaQuery.js';
|
|
3
5
|
import SingleColumnLayout from '../Layout/SingleColumnLayout/index.js';
|
|
4
6
|
import ImageView from '../View/ImageView/index.js';
|
package/esm/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { default as Spinner } from './core/Spinner/index.js';
|
|
|
11
11
|
export { default as Stack } from './core/Stack/index.js';
|
|
12
12
|
export { default as StyledIcon } from './core/StyledIcon/index.js';
|
|
13
13
|
export { default as Text } from './core/Text/index.js';
|
|
14
|
+
export { default as ThemeProvider } from './core/ThemeProvider/index.js';
|
|
14
15
|
export { default as View } from './core/View/index.js';
|
|
15
16
|
export { default as UnstyledButton } from './core/_UnstyledButton.js';
|
|
16
17
|
export { default as EnigmaUI } from './enigma/EnigmaUI/index.js';
|
|
@@ -19,3 +20,4 @@ export { default as useOutsideClick } from './hook/useOutsideClick.js';
|
|
|
19
20
|
export { default as useProvidedOrCreatedRef } from './hook/useProvidedOrCreatedRef.js';
|
|
20
21
|
export { default as useResize } from './hook/useResize.js';
|
|
21
22
|
export { default as useToggleHandler } from './hook/useToggleHandler.js';
|
|
23
|
+
export { default as theme } from './theme/index.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import palette from '../../foundation/palette/index.js';
|
|
2
|
+
import shadow from '../../foundation/shadow/index.js';
|
|
3
|
+
|
|
4
|
+
const surfaceElevation = {
|
|
5
|
+
'surface': palette.white,
|
|
6
|
+
'surface/overlay': palette.white
|
|
7
|
+
};
|
|
8
|
+
const shadowElevation = {
|
|
9
|
+
'shadow/overlay': shadow.shadowMedium
|
|
10
|
+
};
|
|
11
|
+
({
|
|
12
|
+
...surfaceElevation,
|
|
13
|
+
...shadowElevation
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { shadowElevation, surfaceElevation };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import colorStopList from '../../foundation/gradient/colorStopList/index.js';
|
|
2
|
+
import direction from '../../foundation/gradient/direction/index.js';
|
|
3
|
+
|
|
4
|
+
const generateGradientTokenValue = (direction$1, colorStopList$1) => `${direction[direction$1]}, ${colorStopList[colorStopList$1]}`;
|
|
5
|
+
const textGradient = {
|
|
6
|
+
'text/accent': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink')
|
|
7
|
+
};
|
|
8
|
+
const bgGradient = {
|
|
9
|
+
'bg/accent/violet': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink'),
|
|
10
|
+
'bg/accent/neutral': generateGradientTokenValue('directionToRightBottom', 'colorStopListBlackGray')
|
|
11
|
+
};
|
|
12
|
+
const borderGradient = {
|
|
13
|
+
'border/accent/violet': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink')
|
|
14
|
+
};
|
|
15
|
+
const overlayGradient = {
|
|
16
|
+
'overlay/subtlest/toright': generateGradientTokenValue('directionToRight', 'colorStopListWhite'),
|
|
17
|
+
'overlay/subtlest/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListWhite'),
|
|
18
|
+
'overlay/subtlest/totop': generateGradientTokenValue('directionToTop', 'colorStopListWhite'),
|
|
19
|
+
'overlay/floating/toright': generateGradientTokenValue('directionToRight', 'colorStopListWhite'),
|
|
20
|
+
'overlay/floating/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListWhite'),
|
|
21
|
+
'overlay/floating/totop': generateGradientTokenValue('directionToTop', 'colorStopListWhite'),
|
|
22
|
+
'overlay/bold/toright': generateGradientTokenValue('directionToRight', 'colorStopListBlack'),
|
|
23
|
+
'overlay/bold/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListBlack'),
|
|
24
|
+
'overlay/bold/totop': generateGradientTokenValue('directionToTop', 'colorStopListBlack')
|
|
25
|
+
};
|
|
26
|
+
const gradient = {
|
|
27
|
+
...textGradient,
|
|
28
|
+
...bgGradient,
|
|
29
|
+
...borderGradient,
|
|
30
|
+
...overlayGradient
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { bgGradient, borderGradient, gradient as default, overlayGradient, textGradient };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import breakpoints from '../packages/token-studio/esm/token/breakpoints/index.js';
|
|
2
|
+
import color from '../packages/token-studio/esm/token/color/index.js';
|
|
3
|
+
import { surfaceElevation, shadowElevation } from '../packages/token-studio/esm/token/elevation/index.js';
|
|
4
|
+
import gradient from '../packages/token-studio/esm/token/gradient/index.js';
|
|
5
|
+
import radii from '../packages/token-studio/esm/token/radii/index.js';
|
|
6
|
+
import space from '../packages/token-studio/esm/token/space/index.js';
|
|
7
|
+
import '../packages/token-studio/esm/token/typography/index.js';
|
|
8
|
+
import fontSizes from '../packages/token-studio/esm/token/typography/fontSizes.js';
|
|
9
|
+
import fontWeights from '../packages/token-studio/esm/token/typography/fontWeights.js';
|
|
10
|
+
import lineHeights from '../packages/token-studio/esm/token/typography/lineHeights.js';
|
|
11
|
+
|
|
12
|
+
const theme = {
|
|
13
|
+
breakpoints,
|
|
14
|
+
space,
|
|
15
|
+
fontWeights,
|
|
16
|
+
fontSizes,
|
|
17
|
+
lineHeights,
|
|
18
|
+
radii,
|
|
19
|
+
colors: {
|
|
20
|
+
...color,
|
|
21
|
+
surfaceElevation
|
|
22
|
+
},
|
|
23
|
+
gradients: gradient,
|
|
24
|
+
shadows: {
|
|
25
|
+
...shadowElevation
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { theme as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-kit",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "React components, hooks for create teamturing web application",
|
|
5
5
|
"author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
|
|
6
6
|
"homepage": "https://github.com/weareteamturing/bombe#readme",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"lodash.throttle": "^4.1.1",
|
|
56
56
|
"styled-system": "^5.1.5"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ff56ac7dc09f3aa5318b939a50aae9d0fdbc522c"
|
|
59
59
|
}
|