@react-types/shared 3.0.0-nightly.1839 → 3.0.0-nightly.1852

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/shared",
3
- "version": "3.0.0-nightly.1839+86367a392",
3
+ "version": "3.0.0-nightly.1852+286dbcdab",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "86367a392284544e160eb489cd9019eac73a6738"
17
+ "gitHead": "286dbcdabf60102d05a95ef00bc3fed06af91d98"
18
18
  }
package/src/dna.d.ts CHANGED
@@ -32,7 +32,9 @@ export type DimensionValue =
32
32
  | 'size-200'
33
33
  | 'size-225'
34
34
  | 'size-250'
35
+ | 'size-275'
35
36
  | 'size-300'
37
+ | 'size-325'
36
38
  | 'size-350'
37
39
  | 'size-400'
38
40
  | 'size-450'
@@ -235,13 +237,211 @@ export type ColorValue =
235
237
  | 'static-seafoam-500'
236
238
  | 'static-seafoam-600'
237
239
  | 'static-seafoam-700'
240
+ | SemanticColorValue;
241
+
242
+ export type ColorValueV6 =
243
+ | 'gray-50'
244
+ | 'gray-75'
245
+ | 'gray-100'
246
+ | 'gray-200'
247
+ | 'gray-300'
248
+ | 'gray-400'
249
+ | 'gray-500'
250
+ | 'gray-600'
251
+ | 'gray-700'
252
+ | 'gray-800'
253
+ | 'gray-900'
254
+ | 'red-100'
255
+ | 'red-200'
256
+ | 'red-300'
257
+ | 'red-400'
258
+ | 'red-500'
259
+ | 'red-600'
260
+ | 'red-700'
261
+ | 'red-800'
262
+ | 'red-900'
263
+ | 'red-1000'
264
+ | 'red-1100'
265
+ | 'red-1200'
266
+ | 'red-1300'
267
+ | 'red-1400'
268
+ | 'orange-100'
269
+ | 'orange-200'
270
+ | 'orange-300'
271
+ | 'orange-400'
272
+ | 'orange-500'
273
+ | 'orange-600'
274
+ | 'orange-700'
275
+ | 'orange-800'
276
+ | 'orange-900'
277
+ | 'orange-1000'
278
+ | 'orange-1100'
279
+ | 'orange-1200'
280
+ | 'orange-1300'
281
+ | 'orange-1400'
282
+ | 'yellow-100'
283
+ | 'yellow-200'
284
+ | 'yellow-300'
285
+ | 'yellow-400'
286
+ | 'yellow-500'
287
+ | 'yellow-600'
288
+ | 'yellow-700'
289
+ | 'yellow-800'
290
+ | 'yellow-900'
291
+ | 'yellow-1000'
292
+ | 'yellow-1100'
293
+ | 'yellow-1200'
294
+ | 'yellow-1300'
295
+ | 'yellow-1400'
296
+ | 'chartreuse-100'
297
+ | 'chartreuse-200'
298
+ | 'chartreuse-300'
299
+ | 'chartreuse-400'
300
+ | 'chartreuse-500'
301
+ | 'chartreuse-600'
302
+ | 'chartreuse-700'
303
+ | 'chartreuse-800'
304
+ | 'chartreuse-900'
305
+ | 'chartreuse-1000'
306
+ | 'chartreuse-1100'
307
+ | 'chartreuse-1200'
308
+ | 'chartreuse-1300'
309
+ | 'chartreuse-1400'
310
+ | 'celery-100'
311
+ | 'celery-200'
312
+ | 'celery-300'
313
+ | 'celery-400'
314
+ | 'celery-500'
315
+ | 'celery-600'
316
+ | 'celery-700'
317
+ | 'celery-800'
318
+ | 'celery-900'
319
+ | 'celery-1000'
320
+ | 'celery-1100'
321
+ | 'celery-1200'
322
+ | 'celery-1300'
323
+ | 'celery-1400'
324
+ | 'green-100'
325
+ | 'green-200'
326
+ | 'green-300'
327
+ | 'green-400'
328
+ | 'green-500'
329
+ | 'green-600'
330
+ | 'green-700'
331
+ | 'green-800'
332
+ | 'green-900'
333
+ | 'green-1000'
334
+ | 'green-1100'
335
+ | 'green-1200'
336
+ | 'green-1300'
337
+ | 'green-1400'
338
+ | 'seafoam-100'
339
+ | 'seafoam-200'
340
+ | 'seafoam-300'
341
+ | 'seafoam-400'
342
+ | 'seafoam-500'
343
+ | 'seafoam-600'
344
+ | 'seafoam-700'
345
+ | 'seafoam-800'
346
+ | 'seafoam-900'
347
+ | 'seafoam-1000'
348
+ | 'seafoam-1100'
349
+ | 'seafoam-1200'
350
+ | 'seafoam-1300'
351
+ | 'seafoam-1400'
352
+ | 'cyan-100'
353
+ | 'cyan-200'
354
+ | 'cyan-300'
355
+ | 'cyan-400'
356
+ | 'cyan-500'
357
+ | 'cyan-600'
358
+ | 'cyan-700'
359
+ | 'cyan-800'
360
+ | 'cyan-900'
361
+ | 'cyan-1000'
362
+ | 'cyan-1100'
363
+ | 'cyan-1200'
364
+ | 'cyan-1300'
365
+ | 'cyan-1400'
366
+ | 'blue-100'
367
+ | 'blue-200'
368
+ | 'blue-300'
369
+ | 'blue-400'
370
+ | 'blue-500'
371
+ | 'blue-600'
372
+ | 'blue-700'
373
+ | 'blue-800'
374
+ | 'blue-900'
375
+ | 'blue-1000'
376
+ | 'blue-1100'
377
+ | 'blue-1200'
378
+ | 'blue-1300'
379
+ | 'blue-1400'
380
+ | 'indigo-100'
381
+ | 'indigo-200'
382
+ | 'indigo-300'
383
+ | 'indigo-400'
384
+ | 'indigo-500'
385
+ | 'indigo-600'
386
+ | 'indigo-700'
387
+ | 'indigo-800'
388
+ | 'indigo-900'
389
+ | 'indigo-1000'
390
+ | 'indigo-1100'
391
+ | 'indigo-1200'
392
+ | 'indigo-1300'
393
+ | 'indigo-1400'
394
+ | 'purple-100'
395
+ | 'purple-200'
396
+ | 'purple-300'
397
+ | 'purple-400'
398
+ | 'purple-500'
399
+ | 'purple-600'
400
+ | 'purple-700'
401
+ | 'purple-800'
402
+ | 'purple-900'
403
+ | 'purple-1000'
404
+ | 'purple-1100'
405
+ | 'purple-1200'
406
+ | 'purple-1300'
407
+ | 'purple-1400'
408
+ | 'fuchsia-100'
409
+ | 'fuchsia-200'
410
+ | 'fuchsia-300'
411
+ | 'fuchsia-400'
412
+ | 'fuchsia-500'
413
+ | 'fuchsia-600'
414
+ | 'fuchsia-700'
415
+ | 'fuchsia-800'
416
+ | 'fuchsia-900'
417
+ | 'fuchsia-1000'
418
+ | 'fuchsia-1100'
419
+ | 'fuchsia-1200'
420
+ | 'fuchsia-1300'
421
+ | 'fuchsia-1400'
422
+ | 'magenta-100'
423
+ | 'magenta-200'
424
+ | 'magenta-300'
425
+ | 'magenta-400'
426
+ | 'magenta-500'
427
+ | 'magenta-600'
428
+ | 'magenta-700'
429
+ | 'magenta-800'
430
+ | 'magenta-900'
431
+ | 'magenta-1000'
432
+ | 'magenta-1100'
433
+ | 'magenta-1200'
434
+ | 'magenta-1300'
435
+ | 'magenta-1400'
436
+ | SemanticColorValue;
437
+
438
+ type SemanticColorValue =
238
439
  | 'negative'
239
440
  | 'notice'
240
441
  | 'positive'
241
442
  | 'informative';
242
443
 
243
- export type BorderColorValue =
244
- | 'default'
444
+ type BorderColorAlias =
245
445
  | 'negative'
246
446
  | 'notice'
247
447
  | 'positive'
@@ -257,14 +457,13 @@ export type BorderColorValue =
257
457
  | 'dark'
258
458
  | 'transparent'
259
459
  | 'translucent-dark'
260
- | 'translucent-darker'
261
- | ColorValue;
460
+ | 'translucent-darker';
262
461
 
263
- export type BackgroundColorValue =
462
+ type BackgroundColorAlias =
264
463
  | 'default'
464
+ | 'disabled'
265
465
  | 'transparent'
266
- | 'label-gray'
267
- | ColorValue;
466
+ | 'label-gray';
268
467
 
269
468
  export type IconColorValue =
270
469
  | 'negative'
@@ -284,3 +483,20 @@ export type BorderRadiusValue =
284
483
  | 'regular'
285
484
  | 'medium'
286
485
  | 'large';
486
+
487
+ export type BorderColorValue =
488
+ | 'default'
489
+ | BorderColorAlias
490
+ | ColorValue;
491
+
492
+ export type BorderColorValueV6 =
493
+ | BorderColorAlias
494
+ | ColorValueV6;
495
+
496
+ export type BackgroundColorValue =
497
+ | BackgroundColorAlias
498
+ | ColorValue;
499
+
500
+ export type BackgroundColorValueV6 =
501
+ | BackgroundColorAlias
502
+ | ColorValueV6;
package/src/style.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {BackgroundColorValue, BorderColorValue, BorderRadiusValue, BorderSizeValue, DimensionValue} from './dna';
13
+ import {BackgroundColorValue, BackgroundColorValueV6, BorderColorValue, BorderColorValueV6, BorderRadiusValue, BorderSizeValue, DimensionValue} from './dna';
14
14
  import {CSSProperties} from 'react';
15
15
 
16
16
  type ResponsiveProp<T> = {
@@ -112,11 +112,28 @@ export interface StyleProps {
112
112
  isHidden?: Responsive<boolean>
113
113
  }
114
114
 
115
+ export type ColorVersion = 5 | 6;
116
+ type BackgroundColor = {
117
+ 5: BackgroundColorValue,
118
+ 6: BackgroundColorValueV6
119
+ };
120
+
121
+ type BorderColor = {
122
+ 5: BorderColorValue,
123
+ 6: BorderColorValueV6
124
+ }
125
+
115
126
  // These support more properties than specific Spectrum components
116
127
  // but still based on spectrum global/alias variables.
117
- export interface ViewStyleProps extends StyleProps {
128
+ export interface ViewStyleProps<C extends ColorVersion> extends StyleProps {
129
+ /**
130
+ * The Spectrum color token version number.
131
+ * @default 5
132
+ */
133
+ colorVersion?: C,
134
+
118
135
  /** The background color for the element. */
119
- backgroundColor?: Responsive<BackgroundColorValue>,
136
+ backgroundColor?: Responsive<BackgroundColor[C]>,
120
137
 
121
138
  /** The width of the element's border on all four sides. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
122
139
  borderWidth?: Responsive<BorderSizeValue>,
@@ -136,21 +153,21 @@ export interface ViewStyleProps extends StyleProps {
136
153
  borderYWidth?: Responsive<BorderSizeValue>,
137
154
 
138
155
  /** The color of the element's border on all four sides. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color). */
139
- borderColor?: Responsive<BorderColorValue>,
156
+ borderColor?: Responsive<BorderColor[C]>,
140
157
  /** The color of the border on the logical start side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-color). */
141
- borderStartColor?: Responsive<BorderColorValue>,
158
+ borderStartColor?: Responsive<BorderColor[C]>,
142
159
  /** The color of the border on the logical end side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end-color). */
143
- borderEndColor?: Responsive<BorderColorValue>,
160
+ borderEndColor?: Responsive<BorderColor[C]>,
144
161
  // borderLeftColor?: BorderColorValue,
145
162
  // borderRightColor?: BorderColorValue,
146
163
  /** The color of the top border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-color). */
147
- borderTopColor?: Responsive<BorderColorValue>,
164
+ borderTopColor?: Responsive<BorderColor[C]>,
148
165
  /** The color of the bottom border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-color). */
149
- borderBottomColor?: Responsive<BorderColorValue>,
166
+ borderBottomColor?: Responsive<BorderColor[C]>,
150
167
  /** The color of the left and right borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color). */
151
- borderXColor?: Responsive<BorderColorValue>,
168
+ borderXColor?: Responsive<BorderColor[C]>,
152
169
  /** The color of the top and bottom borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
153
- borderYColor?: Responsive<BorderColorValue>,
170
+ borderYColor?: Responsive<BorderColor[C]>,
154
171
 
155
172
  /** The border radius on all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius). */
156
173
  borderRadius?: Responsive<BorderRadiusValue>,