@teamturing/react-kit 2.21.5 → 2.21.7

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.
@@ -131,88 +131,88 @@ const BaseButton = styled(UnstyledButton)(({
131
131
  prop: 'variant',
132
132
  variants: {
133
133
  primary: {
134
- 'backgroundColor': theme.color['bg/primary'],
135
- 'color': theme.color['text/inverse'],
134
+ 'backgroundColor': theme.colors['bg/primary'],
135
+ 'color': theme.colors['text/inverse'],
136
136
  '& svg': {
137
- color: theme.color['icon/inverse']
137
+ color: theme.colors['icon/inverse']
138
138
  },
139
139
  '&:hover:not(:disabled)': {
140
- backgroundColor: theme.color['bg/primary/hovered']
140
+ backgroundColor: theme.colors['bg/primary/hovered']
141
141
  },
142
142
  '&:active:not(:disabled)': {
143
- backgroundColor: theme.color['bg/primary/pressed']
143
+ backgroundColor: theme.colors['bg/primary/pressed']
144
144
  },
145
145
  '&:focus-visible': {
146
- outlineColor: theme.color['border/focused'],
146
+ outlineColor: theme.colors['border/focused'],
147
147
  outlineStyle: 'solid',
148
148
  outlineWidth: 2,
149
149
  outlineOffset: 2
150
150
  },
151
151
  ...($disabled ? {
152
- 'backgroundColor': theme.color['bg/disabled'],
153
- 'color': theme.color['text/disabled'],
152
+ 'backgroundColor': theme.colors['bg/disabled'],
153
+ 'color': theme.colors['text/disabled'],
154
154
  '& svg': {
155
- color: theme.color['icon/disabled']
155
+ color: theme.colors['icon/disabled']
156
156
  }
157
157
  } : {})
158
158
  },
159
159
  secondary: {
160
- 'backgroundColor': theme.color['bg/secondary'],
161
- 'color': theme.color['text/primary'],
160
+ 'backgroundColor': theme.colors['bg/secondary'],
161
+ 'color': theme.colors['text/primary'],
162
162
  '& svg': {
163
- color: theme.color['icon/primary']
163
+ color: theme.colors['icon/primary']
164
164
  },
165
165
  '&:hover:not(:disabled)': {
166
- backgroundColor: theme.color['bg/secondary/hovered']
166
+ backgroundColor: theme.colors['bg/secondary/hovered']
167
167
  },
168
168
  '&:active:not(:disabled)': {
169
- backgroundColor: theme.color['bg/secondary/pressed']
169
+ backgroundColor: theme.colors['bg/secondary/pressed']
170
170
  },
171
171
  '&:focus-visible': {
172
- outlineColor: theme.color['border/focused'],
172
+ outlineColor: theme.colors['border/focused'],
173
173
  outlineStyle: 'solid',
174
174
  outlineWidth: 2,
175
175
  outlineOffset: 2
176
176
  },
177
177
  ...($disabled ? {
178
- 'backgroundColor': theme.color['bg/disabled'],
179
- 'color': theme.color['text/disabled'],
178
+ 'backgroundColor': theme.colors['bg/disabled'],
179
+ 'color': theme.colors['text/disabled'],
180
180
  '& svg': {
181
- color: theme.color['icon/disabled']
181
+ color: theme.colors['icon/disabled']
182
182
  }
183
183
  } : {})
184
184
  },
185
185
  neutral: {
186
- 'backgroundColor': theme.color['bg/neutral'],
187
- 'color': theme.color['text/neutral'],
186
+ 'backgroundColor': theme.colors['bg/neutral'],
187
+ 'color': theme.colors['text/neutral'],
188
188
  '& svg': {
189
- color: theme.color['icon/accent/gray']
189
+ color: theme.colors['icon/accent/gray']
190
190
  },
191
191
  '&:hover:not(:disabled)': {
192
- backgroundColor: theme.color['bg/neutral/hovered']
192
+ backgroundColor: theme.colors['bg/neutral/hovered']
193
193
  },
194
194
  '&:active:not(:disabled)': {
195
- backgroundColor: theme.color['bg/neutral/pressed']
195
+ backgroundColor: theme.colors['bg/neutral/pressed']
196
196
  },
197
197
  '&:focus-visible': {
198
- outlineColor: theme.color['border/focused'],
198
+ outlineColor: theme.colors['border/focused'],
199
199
  outlineStyle: 'solid',
200
200
  outlineWidth: 2,
201
201
  outlineOffset: 2
202
202
  },
203
203
  ...($disabled ? {
204
- 'backgroundColor': theme.color['bg/disabled'],
205
- 'color': theme.color['text/disabled'],
204
+ 'backgroundColor': theme.colors['bg/disabled'],
205
+ 'color': theme.colors['text/disabled'],
206
206
  '& svg': {
207
- color: theme.color['icon/disabled']
207
+ color: theme.colors['icon/disabled']
208
208
  }
209
209
  } : {})
210
210
  },
211
211
  outlined: {
212
- 'backgroundColor': theme.color['bg/neutral/subtler'],
213
- 'color': theme.color['text/neutral/subtle'],
212
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
213
+ 'color': theme.colors['text/neutral/subtle'],
214
214
  '& svg': {
215
- color: theme.color['icon/neutral/bolder']
215
+ color: theme.colors['icon/neutral/bolder']
216
216
  },
217
217
  '&:after': {
218
218
  content: '""',
@@ -223,27 +223,27 @@ const BaseButton = styled(UnstyledButton)(({
223
223
  left: 0,
224
224
  borderWidth: 1,
225
225
  borderStyle: 'solid',
226
- borderColor: theme.color['border/neutral/bolder'],
226
+ borderColor: theme.colors['border/neutral/bolder'],
227
227
  borderRadius: theme.radii.full,
228
228
  boxSizing: 'border-box'
229
229
  },
230
230
  '&:hover:not(:disabled)': {
231
- backgroundColor: theme.color['bg/neutral/subtler/hovered']
231
+ backgroundColor: theme.colors['bg/neutral/subtler/hovered']
232
232
  },
233
233
  '&:active:not(:disabled)': {
234
- backgroundColor: theme.color['bg/neutral/subtler/pressed']
234
+ backgroundColor: theme.colors['bg/neutral/subtler/pressed']
235
235
  },
236
236
  '&:focus-visible': {
237
- outlineColor: theme.color['border/focused'],
237
+ outlineColor: theme.colors['border/focused'],
238
238
  outlineStyle: 'solid',
239
239
  outlineWidth: 2,
240
240
  outlineOffset: 2
241
241
  },
242
242
  ...($disabled ? {
243
- 'backgroundColor': theme.color['bg/disabled'],
244
- 'color': theme.color['text/disabled'],
243
+ 'backgroundColor': theme.colors['bg/disabled'],
244
+ 'color': theme.colors['text/disabled'],
245
245
  '& svg': {
246
- color: theme.color['icon/disabled']
246
+ color: theme.colors['icon/disabled']
247
247
  },
248
248
  '&:after': {
249
249
  display: 'none'
@@ -251,60 +251,60 @@ const BaseButton = styled(UnstyledButton)(({
251
251
  } : {})
252
252
  },
253
253
  plain: {
254
- 'backgroundColor': theme.color['bg/neutral/subtler'],
255
- 'color': theme.color['text/neutral/subtle'],
254
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
255
+ 'color': theme.colors['text/neutral/subtle'],
256
256
  '& svg': {
257
- color: theme.color['icon/neutral/bolder']
257
+ color: theme.colors['icon/neutral/bolder']
258
258
  },
259
259
  '&:hover:not(:disabled)': {
260
- 'color': theme.color['text/neutral'],
260
+ 'color': theme.colors['text/neutral'],
261
261
  '& svg': {
262
- color: theme.color['icon/accent/gray']
262
+ color: theme.colors['icon/accent/gray']
263
263
  }
264
264
  },
265
265
  '&:active:not(:disabled)': {
266
- 'color': theme.color['text/neutral'],
266
+ 'color': theme.colors['text/neutral'],
267
267
  '& svg': {
268
- color: theme.color['icon/accent/gray']
268
+ color: theme.colors['icon/accent/gray']
269
269
  }
270
270
  },
271
271
  '&:focus-visible': {
272
- outlineColor: theme.color['border/focused'],
272
+ outlineColor: theme.colors['border/focused'],
273
273
  outlineStyle: 'solid',
274
274
  outlineWidth: 2,
275
275
  outlineOffset: 2
276
276
  },
277
277
  ...($disabled ? {
278
- 'backgroundColor': theme.color['bg/disabled/subtlest'],
279
- 'color': theme.color['text/disabled'],
278
+ 'backgroundColor': theme.colors['bg/disabled/subtlest'],
279
+ 'color': theme.colors['text/disabled'],
280
280
  '& svg': {
281
- color: theme.color['icon/disabled']
281
+ color: theme.colors['icon/disabled']
282
282
  }
283
283
  } : {})
284
284
  },
285
285
  danger: {
286
- 'backgroundColor': theme.color['bg/danger/bold'],
287
- 'color': theme.color['text/inverse'],
286
+ 'backgroundColor': theme.colors['bg/danger/bold'],
287
+ 'color': theme.colors['text/inverse'],
288
288
  '& svg': {
289
- color: theme.color['icon/inverse']
289
+ color: theme.colors['icon/inverse']
290
290
  },
291
291
  '&:hover:not(:disabled)': {
292
- backgroundColor: theme.color['bg/danger/bold/hovered']
292
+ backgroundColor: theme.colors['bg/danger/bold/hovered']
293
293
  },
294
294
  '&:active:not(:disabled)': {
295
- backgroundColor: theme.color['bg/danger/bold/pressed']
295
+ backgroundColor: theme.colors['bg/danger/bold/pressed']
296
296
  },
297
297
  '&:focus-visible': {
298
- outlineColor: theme.color['border/focused'],
298
+ outlineColor: theme.colors['border/focused'],
299
299
  outlineStyle: 'solid',
300
300
  outlineWidth: 2,
301
301
  outlineOffset: 2
302
302
  },
303
303
  ...($disabled ? {
304
- 'backgroundColor': theme.color['bg/disabled'],
305
- 'color': theme.color['text/disabled'],
304
+ 'backgroundColor': theme.colors['bg/disabled'],
305
+ 'color': theme.colors['text/disabled'],
306
306
  '& svg': {
307
- color: theme.color['icon/disabled']
307
+ color: theme.colors['icon/disabled']
308
308
  }
309
309
  } : {})
310
310
  }
@@ -332,22 +332,22 @@ const BaseSpinner = styled(Spinner)(variant({
332
332
  prop: 'variant',
333
333
  variants: {
334
334
  primary: {
335
- color: theme.color['icon/inverse']
335
+ color: theme.colors['icon/inverse']
336
336
  },
337
337
  secondary: {
338
- color: theme.color['icon/primary']
338
+ color: theme.colors['icon/primary']
339
339
  },
340
340
  neutral: {
341
- color: theme.color['icon/accent/gray']
341
+ color: theme.colors['icon/accent/gray']
342
342
  },
343
343
  outlined: {
344
- color: theme.color['icon/neutral/bolder']
344
+ color: theme.colors['icon/neutral/bolder']
345
345
  },
346
346
  plain: {
347
- color: theme.color['icon/neutral/bolder']
347
+ color: theme.colors['icon/neutral/bolder']
348
348
  },
349
349
  danger: {
350
- color: theme.color['icon/inverse']
350
+ color: theme.colors['icon/inverse']
351
351
  }
352
352
  }
353
353
  }));
@@ -1,6 +1,3 @@
1
- import color from '../../packages/token-studio/esm/token/color/index.js';
2
- import radii from '../../packages/token-studio/esm/token/radii/index.js';
3
- import typography from '../../packages/token-studio/esm/token/typography/index.js';
4
1
  import styled from 'styled-components';
5
2
  import '../../node_modules/styled-system/dist/index.esm.js';
6
3
  import { sx } from '../../utils/styled-system/index.js';
@@ -22,17 +19,20 @@ const Chip = ({
22
19
  trailingIcon: TrailingIcon,
23
20
  children: [LeadingIcon ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingIcon, {}) : null, children, TrailingIcon ? /*#__PURE__*/jsxRuntimeExports.jsx(TrailingIcon, {}) : null]
24
21
  });
25
- const BaseChip = styled.span({
22
+ const BaseChip = styled.span(({
23
+ theme
24
+ }) => ({
26
25
  position: 'relative',
27
26
  width: 'fit-content',
28
- borderRadius: radii.full,
27
+ borderRadius: theme.radii.full,
29
28
  outline: 'none',
30
29
  display: 'flex',
31
30
  flexDirection: 'row',
32
31
  alignItems: 'center'
33
- }, ({
32
+ }), ({
34
33
  leadingIcon,
35
- trailingIcon
34
+ trailingIcon,
35
+ theme
36
36
  }) => variant({
37
37
  prop: 'size',
38
38
  variants: {
@@ -40,9 +40,9 @@ const BaseChip = styled.span({
40
40
  'pl': leadingIcon ? 2 : 3,
41
41
  'pr': trailingIcon ? 2 : 3,
42
42
  'py': 1,
43
- 'fontSize': typography['s'].fontSize,
44
- 'fontWeight': typography['s'].fontWeight,
45
- 'lineHeight': typography['s'].lineHeight,
43
+ 'fontSize': theme.fontSizes.s,
44
+ 'fontWeight': theme.fontWeights.medium,
45
+ 'lineHeight': theme.lineHeights[2],
46
46
  'columnGap': 1,
47
47
  '& svg': {
48
48
  width: 16,
@@ -53,9 +53,9 @@ const BaseChip = styled.span({
53
53
  'pl': leadingIcon ? 2 : 3,
54
54
  'pr': trailingIcon ? 2 : 3,
55
55
  'py': 1,
56
- 'fontSize': typography['xs'].fontSize,
57
- 'fontWeight': typography['xs'].fontWeight,
58
- 'lineHeight': typography['xs'].lineHeight,
56
+ 'fontSize': theme.fontSizes.xs,
57
+ 'fontWeight': theme.fontWeights.medium,
58
+ 'lineHeight': theme.lineHeights[2],
59
59
  'columnGap': 0.5,
60
60
  '& svg': {
61
61
  width: 16,
@@ -66,9 +66,9 @@ const BaseChip = styled.span({
66
66
  'pl': !leadingIcon && trailingIcon ? 3 : 2,
67
67
  'pr': leadingIcon && !trailingIcon ? 3 : 2,
68
68
  'py': 0.5,
69
- 'fontSize': typography['xxs'].fontSize,
70
- 'fontWeight': typography['xxs'].fontWeight,
71
- 'lineHeight': typography['xxs'].lineHeight,
69
+ 'fontSize': theme.fontSizes.xxs,
70
+ 'fontWeight': theme.fontWeights.medium,
71
+ 'lineHeight': theme.lineHeights[2],
72
72
  'columnGap': 0.5,
73
73
  '& svg': {
74
74
  width: 12,
@@ -76,28 +76,30 @@ const BaseChip = styled.span({
76
76
  }
77
77
  }
78
78
  }
79
- }), variant({
79
+ }), ({
80
+ theme
81
+ }) => variant({
80
82
  prop: 'variant',
81
83
  variants: {
82
84
  'primary': {
83
- 'backgroundColor': color['bg/primary'],
84
- 'color': color['text/inverse'],
85
+ 'backgroundColor': theme.colors['bg/primary'],
86
+ 'color': theme.colors['text/inverse'],
85
87
  '& svg': {
86
- color: color['icon/inverse']
88
+ color: theme.colors['icon/inverse']
87
89
  }
88
90
  },
89
91
  'secondary': {
90
- 'backgroundColor': color['bg/secondary'],
91
- 'color': color['text/primary'],
92
+ 'backgroundColor': theme.colors['bg/secondary'],
93
+ 'color': theme.colors['text/primary'],
92
94
  '& svg': {
93
- color: color['icon/primary']
95
+ color: theme.colors['icon/primary']
94
96
  }
95
97
  },
96
98
  'outlined-primary': {
97
- 'backgroundColor': color['bg/neutral/subtler'],
98
- 'color': color['text/primary'],
99
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
100
+ 'color': theme.colors['text/primary'],
99
101
  '& svg': {
100
- color: color['icon/primary']
102
+ color: theme.colors['icon/primary']
101
103
  },
102
104
  '&:after': {
103
105
  content: '""',
@@ -108,16 +110,16 @@ const BaseChip = styled.span({
108
110
  left: 0,
109
111
  borderWidth: 1,
110
112
  borderStyle: 'solid',
111
- borderColor: color['border/primary'],
112
- borderRadius: radii.full,
113
+ borderColor: theme.colors['border/primary'],
114
+ borderRadius: theme.radii.full,
113
115
  boxSizing: 'border-box'
114
116
  }
115
117
  },
116
118
  'outlined-neutral': {
117
- 'backgroundColor': color['bg/neutral/subtler'],
118
- 'color': color['text/neutral/subtle'],
119
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
120
+ 'color': theme.colors['text/neutral/subtle'],
119
121
  '& svg': {
120
- color: color['icon/neutral/bolder']
122
+ color: theme.colors['icon/neutral/bolder']
121
123
  },
122
124
  '&:after': {
123
125
  content: '""',
@@ -128,51 +130,51 @@ const BaseChip = styled.span({
128
130
  left: 0,
129
131
  borderWidth: 1,
130
132
  borderStyle: 'solid',
131
- borderColor: color['border/neutral/bolder'],
132
- borderRadius: radii.full,
133
+ borderColor: theme.colors['border/neutral/bolder'],
134
+ borderRadius: theme.radii.full,
133
135
  boxSizing: 'border-box'
134
136
  }
135
137
  },
136
138
  'neutral': {
137
- 'backgroundColor': color['bg/neutral'],
138
- 'color': color['text/neutral/subtle'],
139
+ 'backgroundColor': theme.colors['bg/neutral'],
140
+ 'color': theme.colors['text/neutral/subtle'],
139
141
  '& svg': {
140
- color: color['icon/neutral/bolder']
142
+ color: theme.colors['icon/neutral/bolder']
141
143
  }
142
144
  },
143
145
  'red': {
144
- 'backgroundColor': color['bg/accent/red/subtlest'],
145
- 'color': color['text/accent/red'],
146
+ 'backgroundColor': theme.colors['bg/accent/red/subtlest'],
147
+ 'color': theme.colors['text/accent/red'],
146
148
  '& svg': {
147
- color: color['icon/accent/red']
149
+ color: theme.colors['icon/accent/red']
148
150
  }
149
151
  },
150
152
  'red-accent': {
151
- 'backgroundColor': color['bg/accent/red'],
152
- 'color': color['text/inverse'],
153
+ 'backgroundColor': theme.colors['bg/accent/red'],
154
+ 'color': theme.colors['text/inverse'],
153
155
  '& svg': {
154
- color: color['icon/inverse']
156
+ color: theme.colors['icon/inverse']
155
157
  }
156
158
  },
157
159
  'yellow': {
158
- 'backgroundColor': color['bg/accent/yellow/subtlest'],
159
- 'color': color['text/accent/yellow'],
160
+ 'backgroundColor': theme.colors['bg/accent/yellow/subtlest'],
161
+ 'color': theme.colors['text/accent/yellow'],
160
162
  '& svg': {
161
- color: color['icon/accent/yellow']
163
+ color: theme.colors['icon/accent/yellow']
162
164
  }
163
165
  },
164
166
  'green': {
165
- 'backgroundColor': color['bg/accent/green/subtlest'],
166
- 'color': color['text/accent/green'],
167
+ 'backgroundColor': theme.colors['bg/accent/green/subtlest'],
168
+ 'color': theme.colors['text/accent/green'],
167
169
  '& svg': {
168
- color: color['icon/accent/green']
170
+ color: theme.colors['icon/accent/green']
169
171
  }
170
172
  },
171
173
  'dim': {
172
- 'backgroundColor': color['dim'],
173
- 'color': color['text/inverse'],
174
+ 'backgroundColor': theme.colors['dim'],
175
+ 'color': theme.colors['text/inverse'],
174
176
  '& svg': {
175
- color: color['icon/inverse']
177
+ color: theme.colors['icon/inverse']
176
178
  }
177
179
  }
178
180
  }
@@ -1,8 +1,5 @@
1
1
  import { forwardRef, useCallback, useRef, useImperativeHandle, useEffect } from 'react';
2
2
  import SvgClose from '../../packages/icons/esm/Close.js';
3
- import color from '../../packages/token-studio/esm/token/color/index.js';
4
- import elevation from '../../packages/token-studio/esm/token/elevation/index.js';
5
- import '../../packages/token-studio/esm/token/typography/index.js';
6
3
  import styled from 'styled-components';
7
4
  import IconButton from '../IconButton/index.js';
8
5
  import View from '../View/index.js';
@@ -135,15 +132,19 @@ const Blanket = styled.span`
135
132
  display: block;
136
133
  cursor: default;
137
134
  content: '';
138
- background: ${color.dim};
135
+ background: ${({
136
+ theme
137
+ }) => theme.colors.dim};
139
138
  }
140
139
  `;
141
- const BaseDialog = styled.div(() => ({
140
+ const BaseDialog = styled.div(({
141
+ theme
142
+ }) => ({
142
143
  display: 'flex',
143
144
  flexDirection: 'column',
144
145
  position: 'relative',
145
- boxShadow: elevation['shadow/overlay'],
146
- backgroundColor: elevation['surface/overlay'],
146
+ boxShadow: theme.shadows['shadow/overlay'],
147
+ backgroundColor: theme.colors['surface/overlay'],
147
148
  outline: 'none',
148
149
  overflow: 'hidden',
149
150
  margin: 'auto'
@@ -1,5 +1,3 @@
1
- import space from '../../packages/token-studio/esm/token/space/index.js';
2
- import '../../packages/token-studio/esm/token/typography/index.js';
3
1
  import { forcePixelValue } from '../../packages/utils/esm/forcePixelValue.js';
4
2
  import { isArray } from '../../packages/utils/esm/isArray.js';
5
3
  import { isNullable } from '../../packages/utils/esm/isNullable.js';
@@ -32,9 +30,11 @@ const Grid = /*#__PURE__*/forwardRef(({
32
30
  const BaseGrid = styled(View)({
33
31
  display: 'flex',
34
32
  flexDirection: 'row'
35
- }, variant({
33
+ }, ({
34
+ theme
35
+ }) => variant({
36
36
  prop: 'gapX',
37
- variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
37
+ variants: Object.fromEntries(Object.entries(theme.space).map(([key, value]) => {
38
38
  const styleValue = {
39
39
  '& > *': {
40
40
  px: forcePixelValue(value / 2)
@@ -43,9 +43,11 @@ const BaseGrid = styled(View)({
43
43
  };
44
44
  return [key, styleValue];
45
45
  }))
46
- }), variant({
46
+ }), ({
47
+ theme
48
+ }) => variant({
47
49
  prop: 'gapY',
48
- variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
50
+ variants: Object.fromEntries(Object.entries(theme.space).map(([key, value]) => {
49
51
  const styleValue = {
50
52
  '& > *': {
51
53
  mt: forcePixelValue(value)