@teamturing/react-kit 2.0.1 → 2.1.1
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 +127 -42
- package/dist/theme/index.d.ts +224 -0
- package/esm/core/Button/index.js +20 -20
- package/esm/core/Chip/index.js +2 -2
- package/esm/core/Grid/index.js +1 -0
- package/esm/core/IconButton/index.js +20 -19
- package/esm/core/IconToggleButton/index.js +2 -1
- package/esm/core/Spinner/index.js +1 -0
- package/esm/core/Stack/index.js +1 -0
- package/esm/core/ThemeProvider/index.js +16 -0
- package/esm/enigma/EnigmaUI/index.js +1 -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 +12 -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,61 @@ 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
|
+
const colorStopList = {
|
|
278
|
+
colorStopListVioletPink: '#8E6CF0, #CF75F3',
|
|
279
|
+
colorStopListBlackGray: '#0F0E0F, #595959',
|
|
280
|
+
colorStopListWhite: '#FFFFFF, #FFFFFF00',
|
|
281
|
+
colorStopListBlack: '#000000, #00000000'
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
const direction = {
|
|
285
|
+
directionToRight: 'to right',
|
|
286
|
+
directionToLeft: 'to left',
|
|
287
|
+
directionToRightBottom: 'to right bottom',
|
|
288
|
+
directionToTop: 'to top'
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
const generateGradientTokenValue = (direction$1, colorStopList$1) => `${direction[direction$1]}, ${colorStopList[colorStopList$1]}`;
|
|
292
|
+
const textGradient = {
|
|
293
|
+
'text/accent': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink')
|
|
294
|
+
};
|
|
295
|
+
const bgGradient = {
|
|
296
|
+
'bg/accent/violet': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink'),
|
|
297
|
+
'bg/accent/neutral': generateGradientTokenValue('directionToRightBottom', 'colorStopListBlackGray')
|
|
298
|
+
};
|
|
299
|
+
const borderGradient = {
|
|
300
|
+
'border/accent/violet': generateGradientTokenValue('directionToRightBottom', 'colorStopListVioletPink')
|
|
301
|
+
};
|
|
302
|
+
const overlayGradient = {
|
|
303
|
+
'overlay/subtlest/toright': generateGradientTokenValue('directionToRight', 'colorStopListWhite'),
|
|
304
|
+
'overlay/subtlest/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListWhite'),
|
|
305
|
+
'overlay/subtlest/totop': generateGradientTokenValue('directionToTop', 'colorStopListWhite'),
|
|
306
|
+
'overlay/floating/toright': generateGradientTokenValue('directionToRight', 'colorStopListWhite'),
|
|
307
|
+
'overlay/floating/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListWhite'),
|
|
308
|
+
'overlay/floating/totop': generateGradientTokenValue('directionToTop', 'colorStopListWhite'),
|
|
309
|
+
'overlay/bold/toright': generateGradientTokenValue('directionToRight', 'colorStopListBlack'),
|
|
310
|
+
'overlay/bold/toleft': generateGradientTokenValue('directionToLeft', 'colorStopListBlack'),
|
|
311
|
+
'overlay/bold/totop': generateGradientTokenValue('directionToTop', 'colorStopListBlack')
|
|
312
|
+
};
|
|
313
|
+
const gradient = {
|
|
314
|
+
...textGradient,
|
|
315
|
+
...bgGradient,
|
|
316
|
+
...borderGradient,
|
|
317
|
+
...overlayGradient
|
|
318
|
+
};
|
|
319
|
+
|
|
265
320
|
const rounding = {
|
|
266
321
|
rounding0: 0,
|
|
267
322
|
rounding4: 4,
|
|
@@ -3015,13 +3070,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3015
3070
|
'& svg': {
|
|
3016
3071
|
color: color$1['icon/inverse']
|
|
3017
3072
|
},
|
|
3018
|
-
'
|
|
3073
|
+
'&:hover:not(:disabled)': {
|
|
3019
3074
|
backgroundColor: color$1['bg/primary/hovered']
|
|
3020
3075
|
},
|
|
3021
|
-
'
|
|
3076
|
+
'&:active:not(:disabled)': {
|
|
3022
3077
|
backgroundColor: color$1['bg/primary/pressed']
|
|
3023
3078
|
},
|
|
3024
|
-
'
|
|
3079
|
+
'&:focus-visible': {
|
|
3025
3080
|
outlineColor: color$1['border/focused'],
|
|
3026
3081
|
outlineStyle: 'solid',
|
|
3027
3082
|
outlineWidth: 2,
|
|
@@ -3041,13 +3096,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3041
3096
|
'& svg': {
|
|
3042
3097
|
color: color$1['icon/primary']
|
|
3043
3098
|
},
|
|
3044
|
-
'
|
|
3099
|
+
'&:hover:not(:disabled)': {
|
|
3045
3100
|
backgroundColor: color$1['bg/secondary/hovered']
|
|
3046
3101
|
},
|
|
3047
|
-
'
|
|
3102
|
+
'&:active:not(:disabled)': {
|
|
3048
3103
|
backgroundColor: color$1['bg/secondary/pressed']
|
|
3049
3104
|
},
|
|
3050
|
-
'
|
|
3105
|
+
'&:focus-visible': {
|
|
3051
3106
|
outlineColor: color$1['border/focused'],
|
|
3052
3107
|
outlineStyle: 'solid',
|
|
3053
3108
|
outlineWidth: 2,
|
|
@@ -3067,13 +3122,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3067
3122
|
'& svg': {
|
|
3068
3123
|
color: color$1['icon/accent/gray']
|
|
3069
3124
|
},
|
|
3070
|
-
'
|
|
3125
|
+
'&:hover:not(:disabled)': {
|
|
3071
3126
|
backgroundColor: color$1['bg/neutral/hovered']
|
|
3072
3127
|
},
|
|
3073
|
-
'
|
|
3128
|
+
'&:active:not(:disabled)': {
|
|
3074
3129
|
backgroundColor: color$1['bg/neutral/pressed']
|
|
3075
3130
|
},
|
|
3076
|
-
'
|
|
3131
|
+
'&:focus-visible': {
|
|
3077
3132
|
outlineColor: color$1['border/focused'],
|
|
3078
3133
|
outlineStyle: 'solid',
|
|
3079
3134
|
outlineWidth: 2,
|
|
@@ -3093,7 +3148,7 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3093
3148
|
'& svg': {
|
|
3094
3149
|
color: color$1['icon/neutral/bolder']
|
|
3095
3150
|
},
|
|
3096
|
-
'
|
|
3151
|
+
'&:after': {
|
|
3097
3152
|
content: '""',
|
|
3098
3153
|
position: 'absolute',
|
|
3099
3154
|
top: 0,
|
|
@@ -3106,13 +3161,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3106
3161
|
borderRadius: radii.full,
|
|
3107
3162
|
boxSizing: 'border-box'
|
|
3108
3163
|
},
|
|
3109
|
-
'
|
|
3164
|
+
'&:hover:not(:disabled)': {
|
|
3110
3165
|
backgroundColor: color$1['bg/neutral/subtler/hovered']
|
|
3111
3166
|
},
|
|
3112
|
-
'
|
|
3167
|
+
'&:active:not(:disabled)': {
|
|
3113
3168
|
backgroundColor: color$1['bg/neutral/subtler/pressed']
|
|
3114
3169
|
},
|
|
3115
|
-
'
|
|
3170
|
+
'&:focus-visible': {
|
|
3116
3171
|
outlineColor: color$1['border/focused'],
|
|
3117
3172
|
outlineStyle: 'solid',
|
|
3118
3173
|
outlineWidth: 2,
|
|
@@ -3124,7 +3179,7 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3124
3179
|
'& svg': {
|
|
3125
3180
|
color: color$1['icon/disabled']
|
|
3126
3181
|
},
|
|
3127
|
-
'
|
|
3182
|
+
'&:after': {
|
|
3128
3183
|
display: 'none'
|
|
3129
3184
|
}
|
|
3130
3185
|
} : {})
|
|
@@ -3135,19 +3190,19 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3135
3190
|
'& svg': {
|
|
3136
3191
|
color: color$1['icon/neutral/bolder']
|
|
3137
3192
|
},
|
|
3138
|
-
'
|
|
3193
|
+
'&:hover:not(:disabled)': {
|
|
3139
3194
|
'color': color$1['text/neutral'],
|
|
3140
3195
|
'& svg': {
|
|
3141
3196
|
color: color$1['icon/accent/gray']
|
|
3142
3197
|
}
|
|
3143
3198
|
},
|
|
3144
|
-
'
|
|
3199
|
+
'&:active:not(:disabled)': {
|
|
3145
3200
|
'color': color$1['text/neutral'],
|
|
3146
3201
|
'& svg': {
|
|
3147
3202
|
color: color$1['icon/accent/gray']
|
|
3148
3203
|
}
|
|
3149
3204
|
},
|
|
3150
|
-
'
|
|
3205
|
+
'&:focus-visible': {
|
|
3151
3206
|
outlineColor: color$1['border/focused'],
|
|
3152
3207
|
outlineStyle: 'solid',
|
|
3153
3208
|
outlineWidth: 2,
|
|
@@ -3167,13 +3222,13 @@ const BaseButton = styled__default.default(UnstyledButton)(({
|
|
|
3167
3222
|
'& svg': {
|
|
3168
3223
|
color: color$1['icon/inverse']
|
|
3169
3224
|
},
|
|
3170
|
-
'
|
|
3225
|
+
'&:hover:not(:disabled)': {
|
|
3171
3226
|
backgroundColor: color$1['bg/danger/bold/hovered']
|
|
3172
3227
|
},
|
|
3173
|
-
'
|
|
3228
|
+
'&:active:not(:disabled)': {
|
|
3174
3229
|
backgroundColor: color$1['bg/danger/bold/pressed']
|
|
3175
3230
|
},
|
|
3176
|
-
'
|
|
3231
|
+
'&:focus-visible': {
|
|
3177
3232
|
outlineColor: color$1['border/focused'],
|
|
3178
3233
|
outlineStyle: 'solid',
|
|
3179
3234
|
outlineWidth: 2,
|
|
@@ -3321,7 +3376,7 @@ const BaseChip = styled__default.default.span({
|
|
|
3321
3376
|
'& svg': {
|
|
3322
3377
|
color: color$1['icon/primary']
|
|
3323
3378
|
},
|
|
3324
|
-
'
|
|
3379
|
+
'&:after': {
|
|
3325
3380
|
content: '""',
|
|
3326
3381
|
position: 'absolute',
|
|
3327
3382
|
top: 0,
|
|
@@ -3341,7 +3396,7 @@ const BaseChip = styled__default.default.span({
|
|
|
3341
3396
|
'& svg': {
|
|
3342
3397
|
color: color$1['icon/neutral/bolder']
|
|
3343
3398
|
},
|
|
3344
|
-
'
|
|
3399
|
+
'&:after': {
|
|
3345
3400
|
content: '""',
|
|
3346
3401
|
position: 'absolute',
|
|
3347
3402
|
top: 0,
|
|
@@ -3595,7 +3650,7 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3595
3650
|
pointerEvents: 'none'
|
|
3596
3651
|
},
|
|
3597
3652
|
'cursor': $loading ? 'progress' : $disabled ? 'not-allowed' : 'pointer',
|
|
3598
|
-
'
|
|
3653
|
+
'&:focus-visible': {
|
|
3599
3654
|
outlineColor: color$1['border/focused'],
|
|
3600
3655
|
outlineStyle: 'solid',
|
|
3601
3656
|
outlineWidth: 2,
|
|
@@ -3634,10 +3689,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3634
3689
|
'primary': {
|
|
3635
3690
|
'backgroundColor': color$1['bg/primary'],
|
|
3636
3691
|
'color': color$1['icon/inverse'],
|
|
3637
|
-
'
|
|
3692
|
+
'&:hover:not(:disabled)': {
|
|
3638
3693
|
backgroundColor: color$1['bg/primary/hovered']
|
|
3639
3694
|
},
|
|
3640
|
-
'
|
|
3695
|
+
'&:active:not(:disabled)': {
|
|
3641
3696
|
backgroundColor: color$1['bg/primary/pressed']
|
|
3642
3697
|
},
|
|
3643
3698
|
...($disabled ? {
|
|
@@ -3648,10 +3703,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3648
3703
|
'secondary': {
|
|
3649
3704
|
'backgroundColor': color$1['bg/secondary'],
|
|
3650
3705
|
'color': color$1['icon/primary'],
|
|
3651
|
-
'
|
|
3706
|
+
'&:hover:not(:disabled)': {
|
|
3652
3707
|
backgroundColor: color$1['bg/secondary/hovered']
|
|
3653
3708
|
},
|
|
3654
|
-
'
|
|
3709
|
+
'&:active:not(:disabled)': {
|
|
3655
3710
|
backgroundColor: color$1['bg/secondary/pressed']
|
|
3656
3711
|
},
|
|
3657
3712
|
...($disabled ? {
|
|
@@ -3662,10 +3717,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3662
3717
|
'tertiary': {
|
|
3663
3718
|
'backgroundColor': color$1['bg/neutral'],
|
|
3664
3719
|
'color': color$1['icon/accent/gray'],
|
|
3665
|
-
'
|
|
3720
|
+
'&:hover:not(:disabled)': {
|
|
3666
3721
|
backgroundColor: color$1['bg/neutral/hovered']
|
|
3667
3722
|
},
|
|
3668
|
-
'
|
|
3723
|
+
'&:active:not(:disabled)': {
|
|
3669
3724
|
backgroundColor: color$1['bg/neutral/pressed']
|
|
3670
3725
|
},
|
|
3671
3726
|
...($disabled ? {
|
|
@@ -3676,7 +3731,7 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3676
3731
|
'outlined': {
|
|
3677
3732
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3678
3733
|
'color': color$1['icon/neutral/bolder'],
|
|
3679
|
-
'
|
|
3734
|
+
'&:after': {
|
|
3680
3735
|
content: '""',
|
|
3681
3736
|
position: 'absolute',
|
|
3682
3737
|
top: 0,
|
|
@@ -3689,16 +3744,16 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3689
3744
|
borderRadius: radii.full,
|
|
3690
3745
|
boxSizing: 'border-box'
|
|
3691
3746
|
},
|
|
3692
|
-
'
|
|
3747
|
+
'&:hover:not(:disabled)': {
|
|
3693
3748
|
backgroundColor: color$1['bg/neutral/subtler/hovered']
|
|
3694
3749
|
},
|
|
3695
|
-
'
|
|
3750
|
+
'&:active:not(:disabled)': {
|
|
3696
3751
|
backgroundColor: color$1['bg/neutral/subtler/pressed']
|
|
3697
3752
|
},
|
|
3698
3753
|
...($disabled ? {
|
|
3699
3754
|
'backgroundColor': color$1['bg/disabled'],
|
|
3700
3755
|
'color': color$1['icon/disabled'],
|
|
3701
|
-
'
|
|
3756
|
+
'&:after': {
|
|
3702
3757
|
display: 'none'
|
|
3703
3758
|
}
|
|
3704
3759
|
} : {})
|
|
@@ -3706,10 +3761,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3706
3761
|
'plain-bold': {
|
|
3707
3762
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3708
3763
|
'color': color$1['icon/neutral/bolder'],
|
|
3709
|
-
'
|
|
3764
|
+
'&:hover:not(:disabled)': {
|
|
3710
3765
|
color: color$1['icon/accent/gray']
|
|
3711
3766
|
},
|
|
3712
|
-
'
|
|
3767
|
+
'&:active:not(:disabled)': {
|
|
3713
3768
|
color: color$1['icon/accent/gray']
|
|
3714
3769
|
},
|
|
3715
3770
|
...($disabled ? {
|
|
@@ -3720,10 +3775,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3720
3775
|
'plain': {
|
|
3721
3776
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3722
3777
|
'color': color$1['icon/neutral/bold'],
|
|
3723
|
-
'
|
|
3778
|
+
'&:hover:not(:disabled)': {
|
|
3724
3779
|
color: color$1['icon/neutral/bolder']
|
|
3725
3780
|
},
|
|
3726
|
-
'
|
|
3781
|
+
'&:active:not(:disabled)': {
|
|
3727
3782
|
color: color$1['icon/neutral/bolder']
|
|
3728
3783
|
},
|
|
3729
3784
|
...($disabled ? {
|
|
@@ -3734,10 +3789,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3734
3789
|
'plain-subtle': {
|
|
3735
3790
|
'backgroundColor': color$1['bg/neutral/subtler'],
|
|
3736
3791
|
'color': color$1['icon/neutral'],
|
|
3737
|
-
'
|
|
3792
|
+
'&:hover:not(:disabled)': {
|
|
3738
3793
|
color: color$1['icon/neutral/bold']
|
|
3739
3794
|
},
|
|
3740
|
-
'
|
|
3795
|
+
'&:active:not(:disabled)': {
|
|
3741
3796
|
color: color$1['icon/neutral/bold']
|
|
3742
3797
|
},
|
|
3743
3798
|
...($disabled ? {
|
|
@@ -3748,10 +3803,10 @@ const BaseIconButton = styled__default.default(UnstyledButton)(({
|
|
|
3748
3803
|
'danger': {
|
|
3749
3804
|
'backgroundColor': color$1['bg/danger/bold'],
|
|
3750
3805
|
'color': color$1['icon/inverse'],
|
|
3751
|
-
'
|
|
3806
|
+
'&:hover:not(:disabled)': {
|
|
3752
3807
|
backgroundColor: color$1['bg/danger/bold/hovered']
|
|
3753
3808
|
},
|
|
3754
|
-
'
|
|
3809
|
+
'&:active:not(:disabled)': {
|
|
3755
3810
|
backgroundColor: color$1['bg/danger/bold/pressed']
|
|
3756
3811
|
},
|
|
3757
3812
|
...($disabled ? {
|
|
@@ -3794,7 +3849,7 @@ const BaseIconToggleButton = styled__default.default(UnstyledButton)(({
|
|
|
3794
3849
|
display: 'block'
|
|
3795
3850
|
},
|
|
3796
3851
|
'cursor': $disabled ? 'not-allowed' : 'pointer',
|
|
3797
|
-
'
|
|
3852
|
+
'&:focus-visible': {
|
|
3798
3853
|
outlineColor: color$1['border/focused'],
|
|
3799
3854
|
outlineStyle: 'solid',
|
|
3800
3855
|
outlineWidth: 2,
|
|
@@ -3952,6 +4007,34 @@ const StyledIcon = ({
|
|
|
3952
4007
|
children: /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {})
|
|
3953
4008
|
});
|
|
3954
4009
|
|
|
4010
|
+
const theme = {
|
|
4011
|
+
breakpoints,
|
|
4012
|
+
space: space$1,
|
|
4013
|
+
fontWeights,
|
|
4014
|
+
fontSizes,
|
|
4015
|
+
lineHeights,
|
|
4016
|
+
radii,
|
|
4017
|
+
colors: {
|
|
4018
|
+
...color$1,
|
|
4019
|
+
...surfaceElevation
|
|
4020
|
+
},
|
|
4021
|
+
gradients: gradient,
|
|
4022
|
+
shadows: {
|
|
4023
|
+
...shadowElevation
|
|
4024
|
+
}
|
|
4025
|
+
};
|
|
4026
|
+
|
|
4027
|
+
const ThemeProvider = ({
|
|
4028
|
+
theme: propTheme,
|
|
4029
|
+
...props
|
|
4030
|
+
}) => {
|
|
4031
|
+
const theme$1 = propTheme ?? theme;
|
|
4032
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(styled.ThemeProvider, {
|
|
4033
|
+
theme: theme$1,
|
|
4034
|
+
...props
|
|
4035
|
+
});
|
|
4036
|
+
};
|
|
4037
|
+
|
|
3955
4038
|
const useMediaQuery = query => {
|
|
3956
4039
|
const getMatches = query => {
|
|
3957
4040
|
/**
|
|
@@ -4588,8 +4671,10 @@ exports.Spinner = Spinner;
|
|
|
4588
4671
|
exports.Stack = index;
|
|
4589
4672
|
exports.StyledIcon = StyledIcon;
|
|
4590
4673
|
exports.Text = Text;
|
|
4674
|
+
exports.ThemeProvider = ThemeProvider;
|
|
4591
4675
|
exports.UnstyledButton = UnstyledButton;
|
|
4592
4676
|
exports.View = View;
|
|
4677
|
+
exports.theme = theme;
|
|
4593
4678
|
exports.useDevice = useDevice;
|
|
4594
4679
|
exports.useOutsideClick = useOutsideClick;
|
|
4595
4680
|
exports.useProvidedOrCreatedRef = useProvidedOrCreatedRef;
|
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
surface: "#FFFFFF";
|
|
89
|
+
'surface/overlay': "#FFFFFF";
|
|
90
|
+
'scale/violet/0': "#F3EFFD";
|
|
91
|
+
'scale/violet/1': "#E8E1FB";
|
|
92
|
+
'scale/violet/2': "#D9CDF9";
|
|
93
|
+
'scale/violet/3': "#C6B5F6";
|
|
94
|
+
'scale/violet/4': "#9C7EEF";
|
|
95
|
+
'scale/violet/5': "#835EEB";
|
|
96
|
+
'scale/violet/6': "#7756D6";
|
|
97
|
+
'scale/violet/7': "#5D43A7";
|
|
98
|
+
'scale/violet/8': "#483481";
|
|
99
|
+
'scale/violet/9': "#372763";
|
|
100
|
+
dim: "#00000099";
|
|
101
|
+
link: "#4880ee";
|
|
102
|
+
'link/hovered': "#335ba9";
|
|
103
|
+
'link/pressed': "#335ba9";
|
|
104
|
+
'link/neutral': "#7A828D";
|
|
105
|
+
'link/neutral/hovered': "#575C64";
|
|
106
|
+
'link/neutral/pressed': "#575C64";
|
|
107
|
+
'link/neutral/bold': "#575C64";
|
|
108
|
+
'link/neutral/bold/hovered': "#33373B";
|
|
109
|
+
'link/neutral/bold/pressed': "#33373B";
|
|
110
|
+
'link/disabled': "#575C64";
|
|
111
|
+
'icon/neutral': "#D1D5DB";
|
|
112
|
+
'icon/neutral/bold': "#8D94A0";
|
|
113
|
+
'icon/neutral/bolder': "#575C64";
|
|
114
|
+
'icon/accent/gray': "#33373B";
|
|
115
|
+
'icon/accent/blue': "#4880ee";
|
|
116
|
+
'icon/accent/blue/bold': "#335ba9";
|
|
117
|
+
'icon/accent/green': "#1FCCA1";
|
|
118
|
+
'icon/accent/yellow': "#FFC107";
|
|
119
|
+
'icon/accent/red': "#F22735";
|
|
120
|
+
'icon/inverse': "#FFFFFF";
|
|
121
|
+
'icon/disabled': "#D1D5DB";
|
|
122
|
+
'icon/disabled/subtler': "#E5E7EB";
|
|
123
|
+
'icon/selected/violet': "#835EEB";
|
|
124
|
+
'icon/selected': "#33373B";
|
|
125
|
+
'icon/primary/subtle': "#C6B5F6";
|
|
126
|
+
'icon/primary': "#835EEB";
|
|
127
|
+
'icon/primary/bold': "#5D43A7";
|
|
128
|
+
'icon/success': "#1FCCA1";
|
|
129
|
+
'icon/warning': "#FFC107";
|
|
130
|
+
'icon/danger': "#F22735";
|
|
131
|
+
'border/neutral/subtle': "#F3F4F6";
|
|
132
|
+
'border/neutral': "#E5E7EB";
|
|
133
|
+
'border/neutral/bolder': "#D1D5DB";
|
|
134
|
+
'border/input': "#E5E7EB";
|
|
135
|
+
'border/inverse': "#FFFFFF1A";
|
|
136
|
+
'border/selected': "#33373B";
|
|
137
|
+
'border/disabled': "#F3F4F6";
|
|
138
|
+
'border/primary': "#835EEB";
|
|
139
|
+
'border/hovered': "#84aaf4";
|
|
140
|
+
'border/focused': "#4880ee";
|
|
141
|
+
'border/danger': "#F22735";
|
|
142
|
+
'border/success': "#1FCCA1";
|
|
143
|
+
'bg/secondary': "#F3EFFD";
|
|
144
|
+
'bg/secondary/hovered': "#D9CDF9";
|
|
145
|
+
'bg/secondary/pressed': "#D9CDF9";
|
|
146
|
+
'bg/primary': "#835EEB";
|
|
147
|
+
'bg/primary/hovered': "#5D43A7";
|
|
148
|
+
'bg/primary/pressed': "#5D43A7";
|
|
149
|
+
'bg/neutral/subtler': "#FFFFFF00";
|
|
150
|
+
'bg/neutral/subtler/hovered': "#F3F4F6";
|
|
151
|
+
'bg/neutral/subtler/pressed': "#F3F4F6";
|
|
152
|
+
'bg/neutral/subtle': "#F9FAFB";
|
|
153
|
+
'bg/neutral/subtle/hovered': "#E5E7EB";
|
|
154
|
+
'bg/neutral/subtle/pressed': "#E5E7EB";
|
|
155
|
+
'bg/neutral': "#F3F4F6";
|
|
156
|
+
'bg/neutral/hovered': "#D1D5DB";
|
|
157
|
+
'bg/neutral/pressed': "#D1D5DB";
|
|
158
|
+
'bg/neutral/bold': "#575C64";
|
|
159
|
+
'bg/neutral/bold/hovered': "#33373B";
|
|
160
|
+
'bg/neutral/bold/pressed': "#33373B";
|
|
161
|
+
'bg/neutral/bolder': "#33373B";
|
|
162
|
+
'bg/neutral/bolder/hovered': "#000000";
|
|
163
|
+
'bg/neutral/bolder/pressed': "#000000";
|
|
164
|
+
'bg/disabled': "#F3F4F6";
|
|
165
|
+
'bg/disabled/subtlest': "#FFFFFF00";
|
|
166
|
+
'bg/input': "#FFFFFF";
|
|
167
|
+
'bg/accent/blue/subtlest': "#edf2fd";
|
|
168
|
+
'bg/accent/green/subtlest': "#E9FAF6";
|
|
169
|
+
'bg/accent/yellow/subtlest': "#FFF9E6";
|
|
170
|
+
'bg/accent/red/subtlest': "#FEE9EB";
|
|
171
|
+
'bg/accent/red/subtle': "#F5525D";
|
|
172
|
+
'bg/accent/red': "#F22735";
|
|
173
|
+
'bg/accent/gray/subtlest': "#E5E7EB";
|
|
174
|
+
'bg/selected/violet': "#835EEB";
|
|
175
|
+
'bg/selected': "#33373B";
|
|
176
|
+
'bg/selected/subtle': "#F3F4F6";
|
|
177
|
+
'bg/inverse': "#000000";
|
|
178
|
+
'bg/inverse/subtlest': "#FFFFFF1A";
|
|
179
|
+
'bg/success': "#E9FAF6";
|
|
180
|
+
'bg/success/bold': "#1FCCA1";
|
|
181
|
+
'bg/warning': "#FFF9E6";
|
|
182
|
+
'bg/warning/bold': "#FFC107";
|
|
183
|
+
'bg/danger': "#FEE9EB";
|
|
184
|
+
'bg/danger/bold': "#F5525D";
|
|
185
|
+
'bg/danger/bold/hovered': "#DC2330";
|
|
186
|
+
'bg/danger/bold/pressed': "#DC2330";
|
|
187
|
+
'text/primary': "#835EEB";
|
|
188
|
+
'text/accent/blue': "#4880ee";
|
|
189
|
+
'text/accent/green': "#1FCCA1";
|
|
190
|
+
'text/accent/yellow': "#FFC107";
|
|
191
|
+
'text/accent/red': "#F22735";
|
|
192
|
+
'text/neutral/subtlest': "#8D94A0";
|
|
193
|
+
'text/neutral/subtler': "#7A828D";
|
|
194
|
+
'text/neutral/subtle': "#575C64";
|
|
195
|
+
'text/neutral': "#33373B";
|
|
196
|
+
'text/inverse': "#FFFFFF";
|
|
197
|
+
'text/inverse/subtle': "#E5E7EB";
|
|
198
|
+
'text/inverse/subtler': "#D1D5DB";
|
|
199
|
+
'text/disabled': "#8D94A0";
|
|
200
|
+
'text/success': "#1FCCA1";
|
|
201
|
+
'text/warning': "#FFC107";
|
|
202
|
+
'text/danger': "#F22735";
|
|
203
|
+
'text/selected': "#33373B";
|
|
204
|
+
};
|
|
205
|
+
gradients: {
|
|
206
|
+
readonly 'overlay/subtlest/toright': string;
|
|
207
|
+
readonly 'overlay/subtlest/toleft': string;
|
|
208
|
+
readonly 'overlay/subtlest/totop': string;
|
|
209
|
+
readonly 'overlay/floating/toright': string;
|
|
210
|
+
readonly 'overlay/floating/toleft': string;
|
|
211
|
+
readonly 'overlay/floating/totop': string;
|
|
212
|
+
readonly 'overlay/bold/toright': string;
|
|
213
|
+
readonly 'overlay/bold/toleft': string;
|
|
214
|
+
readonly 'overlay/bold/totop': string;
|
|
215
|
+
readonly 'border/accent/violet': string;
|
|
216
|
+
readonly 'bg/accent/violet': string;
|
|
217
|
+
readonly 'bg/accent/neutral': string;
|
|
218
|
+
readonly 'text/accent': string;
|
|
219
|
+
};
|
|
220
|
+
shadows: {
|
|
221
|
+
'shadow/overlay': string;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
export default theme;
|
package/esm/core/Button/index.js
CHANGED
|
@@ -134,13 +134,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
134
134
|
'& svg': {
|
|
135
135
|
color: color['icon/inverse']
|
|
136
136
|
},
|
|
137
|
-
'
|
|
137
|
+
'&:hover:not(:disabled)': {
|
|
138
138
|
backgroundColor: color['bg/primary/hovered']
|
|
139
139
|
},
|
|
140
|
-
'
|
|
140
|
+
'&:active:not(:disabled)': {
|
|
141
141
|
backgroundColor: color['bg/primary/pressed']
|
|
142
142
|
},
|
|
143
|
-
'
|
|
143
|
+
'&:focus-visible': {
|
|
144
144
|
outlineColor: color['border/focused'],
|
|
145
145
|
outlineStyle: 'solid',
|
|
146
146
|
outlineWidth: 2,
|
|
@@ -160,13 +160,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
160
160
|
'& svg': {
|
|
161
161
|
color: color['icon/primary']
|
|
162
162
|
},
|
|
163
|
-
'
|
|
163
|
+
'&:hover:not(:disabled)': {
|
|
164
164
|
backgroundColor: color['bg/secondary/hovered']
|
|
165
165
|
},
|
|
166
|
-
'
|
|
166
|
+
'&:active:not(:disabled)': {
|
|
167
167
|
backgroundColor: color['bg/secondary/pressed']
|
|
168
168
|
},
|
|
169
|
-
'
|
|
169
|
+
'&:focus-visible': {
|
|
170
170
|
outlineColor: color['border/focused'],
|
|
171
171
|
outlineStyle: 'solid',
|
|
172
172
|
outlineWidth: 2,
|
|
@@ -186,13 +186,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
186
186
|
'& svg': {
|
|
187
187
|
color: color['icon/accent/gray']
|
|
188
188
|
},
|
|
189
|
-
'
|
|
189
|
+
'&:hover:not(:disabled)': {
|
|
190
190
|
backgroundColor: color['bg/neutral/hovered']
|
|
191
191
|
},
|
|
192
|
-
'
|
|
192
|
+
'&:active:not(:disabled)': {
|
|
193
193
|
backgroundColor: color['bg/neutral/pressed']
|
|
194
194
|
},
|
|
195
|
-
'
|
|
195
|
+
'&:focus-visible': {
|
|
196
196
|
outlineColor: color['border/focused'],
|
|
197
197
|
outlineStyle: 'solid',
|
|
198
198
|
outlineWidth: 2,
|
|
@@ -212,7 +212,7 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
212
212
|
'& svg': {
|
|
213
213
|
color: color['icon/neutral/bolder']
|
|
214
214
|
},
|
|
215
|
-
'
|
|
215
|
+
'&:after': {
|
|
216
216
|
content: '""',
|
|
217
217
|
position: 'absolute',
|
|
218
218
|
top: 0,
|
|
@@ -225,13 +225,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
225
225
|
borderRadius: radii.full,
|
|
226
226
|
boxSizing: 'border-box'
|
|
227
227
|
},
|
|
228
|
-
'
|
|
228
|
+
'&:hover:not(:disabled)': {
|
|
229
229
|
backgroundColor: color['bg/neutral/subtler/hovered']
|
|
230
230
|
},
|
|
231
|
-
'
|
|
231
|
+
'&:active:not(:disabled)': {
|
|
232
232
|
backgroundColor: color['bg/neutral/subtler/pressed']
|
|
233
233
|
},
|
|
234
|
-
'
|
|
234
|
+
'&:focus-visible': {
|
|
235
235
|
outlineColor: color['border/focused'],
|
|
236
236
|
outlineStyle: 'solid',
|
|
237
237
|
outlineWidth: 2,
|
|
@@ -243,7 +243,7 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
243
243
|
'& svg': {
|
|
244
244
|
color: color['icon/disabled']
|
|
245
245
|
},
|
|
246
|
-
'
|
|
246
|
+
'&:after': {
|
|
247
247
|
display: 'none'
|
|
248
248
|
}
|
|
249
249
|
} : {})
|
|
@@ -254,19 +254,19 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
254
254
|
'& svg': {
|
|
255
255
|
color: color['icon/neutral/bolder']
|
|
256
256
|
},
|
|
257
|
-
'
|
|
257
|
+
'&:hover:not(:disabled)': {
|
|
258
258
|
'color': color['text/neutral'],
|
|
259
259
|
'& svg': {
|
|
260
260
|
color: color['icon/accent/gray']
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
|
-
'
|
|
263
|
+
'&:active:not(:disabled)': {
|
|
264
264
|
'color': color['text/neutral'],
|
|
265
265
|
'& svg': {
|
|
266
266
|
color: color['icon/accent/gray']
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
|
-
'
|
|
269
|
+
'&:focus-visible': {
|
|
270
270
|
outlineColor: color['border/focused'],
|
|
271
271
|
outlineStyle: 'solid',
|
|
272
272
|
outlineWidth: 2,
|
|
@@ -286,13 +286,13 @@ const BaseButton = styled(UnstyledButton)(({
|
|
|
286
286
|
'& svg': {
|
|
287
287
|
color: color['icon/inverse']
|
|
288
288
|
},
|
|
289
|
-
'
|
|
289
|
+
'&:hover:not(:disabled)': {
|
|
290
290
|
backgroundColor: color['bg/danger/bold/hovered']
|
|
291
291
|
},
|
|
292
|
-
'
|
|
292
|
+
'&:active:not(:disabled)': {
|
|
293
293
|
backgroundColor: color['bg/danger/bold/pressed']
|
|
294
294
|
},
|
|
295
|
-
'
|
|
295
|
+
'&:focus-visible': {
|
|
296
296
|
outlineColor: color['border/focused'],
|
|
297
297
|
outlineStyle: 'solid',
|
|
298
298
|
outlineWidth: 2,
|
package/esm/core/Chip/index.js
CHANGED
|
@@ -99,7 +99,7 @@ const BaseChip = styled.span({
|
|
|
99
99
|
'& svg': {
|
|
100
100
|
color: color['icon/primary']
|
|
101
101
|
},
|
|
102
|
-
'
|
|
102
|
+
'&:after': {
|
|
103
103
|
content: '""',
|
|
104
104
|
position: 'absolute',
|
|
105
105
|
top: 0,
|
|
@@ -119,7 +119,7 @@ const BaseChip = styled.span({
|
|
|
119
119
|
'& svg': {
|
|
120
120
|
color: color['icon/neutral/bolder']
|
|
121
121
|
},
|
|
122
|
-
'
|
|
122
|
+
'&:after': {
|
|
123
123
|
content: '""',
|
|
124
124
|
position: 'absolute',
|
|
125
125
|
top: 0,
|
package/esm/core/Grid/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
2
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
3
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import styled from 'styled-components';
|
|
5
6
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
@@ -44,7 +45,7 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
44
45
|
pointerEvents: 'none'
|
|
45
46
|
},
|
|
46
47
|
'cursor': $loading ? 'progress' : $disabled ? 'not-allowed' : 'pointer',
|
|
47
|
-
'
|
|
48
|
+
'&:focus-visible': {
|
|
48
49
|
outlineColor: color['border/focused'],
|
|
49
50
|
outlineStyle: 'solid',
|
|
50
51
|
outlineWidth: 2,
|
|
@@ -83,10 +84,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
83
84
|
'primary': {
|
|
84
85
|
'backgroundColor': color['bg/primary'],
|
|
85
86
|
'color': color['icon/inverse'],
|
|
86
|
-
'
|
|
87
|
+
'&:hover:not(:disabled)': {
|
|
87
88
|
backgroundColor: color['bg/primary/hovered']
|
|
88
89
|
},
|
|
89
|
-
'
|
|
90
|
+
'&:active:not(:disabled)': {
|
|
90
91
|
backgroundColor: color['bg/primary/pressed']
|
|
91
92
|
},
|
|
92
93
|
...($disabled ? {
|
|
@@ -97,10 +98,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
97
98
|
'secondary': {
|
|
98
99
|
'backgroundColor': color['bg/secondary'],
|
|
99
100
|
'color': color['icon/primary'],
|
|
100
|
-
'
|
|
101
|
+
'&:hover:not(:disabled)': {
|
|
101
102
|
backgroundColor: color['bg/secondary/hovered']
|
|
102
103
|
},
|
|
103
|
-
'
|
|
104
|
+
'&:active:not(:disabled)': {
|
|
104
105
|
backgroundColor: color['bg/secondary/pressed']
|
|
105
106
|
},
|
|
106
107
|
...($disabled ? {
|
|
@@ -111,10 +112,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
111
112
|
'tertiary': {
|
|
112
113
|
'backgroundColor': color['bg/neutral'],
|
|
113
114
|
'color': color['icon/accent/gray'],
|
|
114
|
-
'
|
|
115
|
+
'&:hover:not(:disabled)': {
|
|
115
116
|
backgroundColor: color['bg/neutral/hovered']
|
|
116
117
|
},
|
|
117
|
-
'
|
|
118
|
+
'&:active:not(:disabled)': {
|
|
118
119
|
backgroundColor: color['bg/neutral/pressed']
|
|
119
120
|
},
|
|
120
121
|
...($disabled ? {
|
|
@@ -125,7 +126,7 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
125
126
|
'outlined': {
|
|
126
127
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
127
128
|
'color': color['icon/neutral/bolder'],
|
|
128
|
-
'
|
|
129
|
+
'&:after': {
|
|
129
130
|
content: '""',
|
|
130
131
|
position: 'absolute',
|
|
131
132
|
top: 0,
|
|
@@ -138,16 +139,16 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
138
139
|
borderRadius: radii.full,
|
|
139
140
|
boxSizing: 'border-box'
|
|
140
141
|
},
|
|
141
|
-
'
|
|
142
|
+
'&:hover:not(:disabled)': {
|
|
142
143
|
backgroundColor: color['bg/neutral/subtler/hovered']
|
|
143
144
|
},
|
|
144
|
-
'
|
|
145
|
+
'&:active:not(:disabled)': {
|
|
145
146
|
backgroundColor: color['bg/neutral/subtler/pressed']
|
|
146
147
|
},
|
|
147
148
|
...($disabled ? {
|
|
148
149
|
'backgroundColor': color['bg/disabled'],
|
|
149
150
|
'color': color['icon/disabled'],
|
|
150
|
-
'
|
|
151
|
+
'&:after': {
|
|
151
152
|
display: 'none'
|
|
152
153
|
}
|
|
153
154
|
} : {})
|
|
@@ -155,10 +156,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
155
156
|
'plain-bold': {
|
|
156
157
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
157
158
|
'color': color['icon/neutral/bolder'],
|
|
158
|
-
'
|
|
159
|
+
'&:hover:not(:disabled)': {
|
|
159
160
|
color: color['icon/accent/gray']
|
|
160
161
|
},
|
|
161
|
-
'
|
|
162
|
+
'&:active:not(:disabled)': {
|
|
162
163
|
color: color['icon/accent/gray']
|
|
163
164
|
},
|
|
164
165
|
...($disabled ? {
|
|
@@ -169,10 +170,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
169
170
|
'plain': {
|
|
170
171
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
171
172
|
'color': color['icon/neutral/bold'],
|
|
172
|
-
'
|
|
173
|
+
'&:hover:not(:disabled)': {
|
|
173
174
|
color: color['icon/neutral/bolder']
|
|
174
175
|
},
|
|
175
|
-
'
|
|
176
|
+
'&:active:not(:disabled)': {
|
|
176
177
|
color: color['icon/neutral/bolder']
|
|
177
178
|
},
|
|
178
179
|
...($disabled ? {
|
|
@@ -183,10 +184,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
183
184
|
'plain-subtle': {
|
|
184
185
|
'backgroundColor': color['bg/neutral/subtler'],
|
|
185
186
|
'color': color['icon/neutral'],
|
|
186
|
-
'
|
|
187
|
+
'&:hover:not(:disabled)': {
|
|
187
188
|
color: color['icon/neutral/bold']
|
|
188
189
|
},
|
|
189
|
-
'
|
|
190
|
+
'&:active:not(:disabled)': {
|
|
190
191
|
color: color['icon/neutral/bold']
|
|
191
192
|
},
|
|
192
193
|
...($disabled ? {
|
|
@@ -197,10 +198,10 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
197
198
|
'danger': {
|
|
198
199
|
'backgroundColor': color['bg/danger/bold'],
|
|
199
200
|
'color': color['icon/inverse'],
|
|
200
|
-
'
|
|
201
|
+
'&:hover:not(:disabled)': {
|
|
201
202
|
backgroundColor: color['bg/danger/bold/hovered']
|
|
202
203
|
},
|
|
203
|
-
'
|
|
204
|
+
'&:active:not(:disabled)': {
|
|
204
205
|
backgroundColor: color['bg/danger/bold/pressed']
|
|
205
206
|
},
|
|
206
207
|
...($disabled ? {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
2
|
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
3
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
5
6
|
import { sx } from '../../utils/styled-system/index.js';
|
|
@@ -39,7 +40,7 @@ const BaseIconToggleButton = styled(UnstyledButton)(({
|
|
|
39
40
|
display: 'block'
|
|
40
41
|
},
|
|
41
42
|
'cursor': $disabled ? 'not-allowed' : 'pointer',
|
|
42
|
-
'
|
|
43
|
+
'&:focus-visible': {
|
|
43
44
|
outlineColor: color['border/focused'],
|
|
44
45
|
outlineStyle: 'solid',
|
|
45
46
|
outlineWidth: 2,
|
|
@@ -1,6 +1,7 @@
|
|
|
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/typography/index.js';
|
|
4
5
|
import styled, { keyframes } from 'styled-components';
|
|
5
6
|
|
|
6
7
|
const spin = keyframes`
|
package/esm/core/Stack/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
import '../../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,5 @@
|
|
|
1
1
|
import breakpoints from '../../packages/token-studio/esm/token/breakpoints/index.js';
|
|
2
|
+
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
3
|
import useMediaQuery from '../../hook/useMediaQuery.js';
|
|
3
4
|
import SingleColumnLayout from '../Layout/SingleColumnLayout/index.js';
|
|
4
5
|
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,12 @@
|
|
|
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
|
+
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.
|
|
3
|
+
"version": "2.1.1",
|
|
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": "a1f6672a71b9573e70b1105a11d8f52650bfba64"
|
|
59
59
|
}
|