@onereach/styles 2.19.1-beta.1276.0 → 2.19.1-beta.1279.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/styles",
3
- "version": "2.19.1-beta.1276.0",
3
+ "version": "2.19.1-beta.1279.0",
4
4
  "description": "Styles for or-ui-next",
5
5
  "main": "./main.css",
6
6
  "unpkg": "./main.css",
@@ -24,42 +24,56 @@ module.exports = {
24
24
  darkMode: ['class', '[data-theme="dark"]'],
25
25
 
26
26
  theme: {
27
+ screens: {
28
+ 'sm': '640px',
29
+ 'md': '768px',
30
+ 'lg': '1024px',
31
+ 'xl': '1280px',
32
+ '2xl': '1536px',
33
+ },
34
+
27
35
  spacing: parseSpacingTokens(spacingTokens),
28
36
 
29
37
  backgroundColor: {
30
38
  // Avoid using `text` colors as a background (only for corner cases)
31
39
  ...parseColorTokens(colorTokens, ['generic', 'background', 'text']),
32
40
  'transparent': 'transparent',
41
+ 'current': 'currentColor',
33
42
  'inherit': 'inherit',
34
43
  },
35
44
 
36
45
  textColor: {
37
46
  ...parseColorTokens(colorTokens, ['generic', 'text']),
38
47
  'transparent': 'transparent',
48
+ 'current': 'currentColor',
39
49
  'inherit': 'inherit',
40
50
  },
41
51
 
42
52
  borderColor: {
43
53
  ...parseColorTokens(colorTokens, ['generic']),
44
54
  'transparent': 'transparent',
55
+ 'current': 'currentColor',
45
56
  'inherit': 'inherit',
46
57
  },
47
58
 
48
59
  outlineColor: {
49
60
  ...parseColorTokens(colorTokens, ['generic']),
50
61
  'transparent': 'transparent',
62
+ 'current': 'currentColor',
51
63
  'inherit': 'inherit',
52
64
  },
53
65
 
54
66
  fill: {
55
67
  ...parseColorTokens(colorTokens, ['generic', 'background', 'text']),
56
68
  'transparent': 'transparent',
69
+ 'current': 'currentColor',
57
70
  'inherit': 'inherit',
58
71
  },
59
72
 
60
73
  stroke: {
61
74
  ...parseColorTokens(colorTokens, ['generic', 'background', 'text']),
62
75
  'transparent': 'transparent',
76
+ 'current': 'currentColor',
63
77
  'inherit': 'inherit',
64
78
  },
65
79
 
@@ -119,8 +133,8 @@ module.exports = {
119
133
  },
120
134
 
121
135
  boxShadow: {
136
+ 'generic': '0 1px 1px rgba(0 0 0 / 0.24), 0 0 1px rgba(0 0 0 / 0.16)',
122
137
  ...parseBoxShadowTokens(boxShadowTokens),
123
- DEFAULT: '0 1px 1px rgba(0 0 0 / 0.24), 0 0 1px rgba(0 0 0 / 0.16)',
124
138
  },
125
139
 
126
140
  fontFamily: {
@@ -132,87 +146,24 @@ module.exports = {
132
146
  fontSize: {
133
147
  ...parseFontSizeTokens(typographyTokens),
134
148
  'icon': ['1.15em', { lineHeight: 1 }],
135
- 'inherit': ['inherit', { lineHeight: 'inherit' }],
149
+ 'inherit': 'inherit',
136
150
  },
137
151
 
138
152
  fontWeight: {
139
153
  ...parseFontWeightTokens(typographyTokens),
140
- 'icon': undefined,
141
154
  'inherit': 'inherit',
142
155
  },
143
156
 
144
- transitionDuration: {
145
- 'short': '100ms',
146
- 'medium': '250ms',
147
- 'long': '400ms',
148
- },
157
+ letterSpacing: false,
149
158
 
150
- transitionTimingFunction: {
151
- 'standard': 'cubic-bezier(0.2, 0, 0, 1)',
159
+ lineHeight: {
160
+ 'inherit': 'inherit',
152
161
  },
153
162
  },
154
163
 
155
164
  plugins: [
156
- // Core
157
- plugin(({ addUtilities, addVariant }) => {
158
- addVariant('enabled', ['&:not([disabled])', '&:enabled']);
159
- addVariant('disabled', ['&[disabled]', '&:disabled']);
160
-
161
- addVariant('read-write', ['&:not([readonly])', '&:read-write']);
162
- addVariant('read-only', ['&[readonly]', '&:read-only']);
163
-
164
- addVariant('valid', ['&:not([invalid])', '&:valid']);
165
- addVariant('invalid', ['&[invalid]', '&:invalid']);
166
-
167
- addVariant('required', ['&[required]', '&:required']);
168
- addVariant('optional', ['&:not([required])', '&:optional']);
169
-
170
- addVariant('checked', ['&[checked]', '&:checked']);
171
- addVariant('selected', ['&[selected]', '&:checked']);
172
- addVariant('activated', ['&[activated]']);
173
-
174
- addVariant('hover', '&:hover:not(.interactivity-none)');
175
- addVariant('focus', '&:focus-visible:not(.interactivity-none)');
176
- addVariant('focus-within', '&:focus-within:not(.interactivity-none)');
177
- addVariant('active', '&:active:not(.interactivity-none)');
178
-
179
- // TODO: Remove when migration complete
180
- addUtilities({
181
- '.visually-hidden': {
182
- width: 0,
183
- height: 0,
184
- visibility: 'hidden',
185
- },
186
- });
187
- }),
188
-
189
- // Interactivity
190
- plugin(({ addUtilities }) => {
191
- addUtilities({
192
- '.interactivity-auto': {
193
- pointerEvents: 'auto',
194
- cursor: 'pointer',
195
-
196
- '&[disabled]': {
197
- pointerEvents: 'none',
198
- cursor: 'default',
199
- },
200
- },
201
-
202
- '.interactivity-none': {
203
- pointerEvents: 'none',
204
- cursor: 'default',
205
- },
206
- });
207
- }),
208
-
209
- // Typography
210
- plugin(({ addBase, matchUtilities, theme }) => {
165
+ plugin(({ addBase, addUtilities, addVariant, theme }) => {
211
166
  addBase({
212
- '*': {
213
- userSelect: 'none',
214
- },
215
-
216
167
  ':root': {
217
168
  fontFamily: theme('fontFamily.body-1-regular'),
218
169
  fontSize: theme('fontSize.body-1-regular'),
@@ -220,379 +171,62 @@ module.exports = {
220
171
  },
221
172
  });
222
173
 
223
- matchUtilities({
224
- 'typography': (value) => {
225
- const [fontSizeDesktop, optionsDesktop] = theme('fontSize')[value];
226
- const [fontSizeMobile, optionsMobile] = theme('fontSize')[`mobile-${value}`] ?? [];
227
-
228
- return {
229
- fontFamily: theme(`fontFamily.mobile-${value}`) ?? theme(`fontFamily.${value}`),
230
- fontWeight: theme(`fontWeight.mobile-${value}`) ?? theme(`fontWeight.${value}`),
231
- fontSize: fontSizeMobile ?? fontSizeDesktop,
232
- lineHeight: optionsMobile?.lineHeight ?? optionsDesktop?.lineHeight,
233
-
234
- [`@media (min-width: ${theme('screens.md')})`]: {
235
- fontFamily: theme(`fontFamily.${value}`),
236
- fontWeight: theme(`fontWeight.${value}`),
237
- fontSize: fontSizeDesktop,
238
- lineHeight: optionsDesktop?.lineHeight,
239
- },
240
- };
241
- },
242
- }, {
243
- values: {
244
- 'headline-1': 'headline-1',
245
- 'headline-2': 'headline-2',
246
- 'headline-3': 'headline-3',
247
- 'headline-4': 'headline-4',
248
- 'body-1-regular': 'body-1-regular',
249
- 'body-1-semibold': 'body-1-semibold',
250
- 'body-1-bold': 'body-1-bold',
251
- 'body-2-regular': 'body-2-regular',
252
- 'body-2-semibold': 'body-2-semibold',
253
- 'body-2-bold': 'body-2-bold',
254
- 'caption-regular': 'caption-regular',
255
- 'caption-semibold': 'caption-semibold',
256
- 'caption-bold': 'caption-bold',
257
- 'button': 'button',
258
- 'icon': 'icon',
259
-
260
- 'inherit': 'inherit',
261
- },
262
- });
263
- }),
264
-
265
- // Iconography
266
- plugin(({ matchUtilities }) => {
267
- matchUtilities({
268
- 'iconography': (value) => ({
269
- fontVariationSettings: value,
270
- }),
271
- }, {
272
- values: {
273
- 'outlined': '"opsz" 48, "wght" 400, "FILL" 0, "GRAD" 0',
274
- 'outlined-bold': '"opsz" 24, "wght" 700, "FILL" 0, "GRAD" 0',
275
- 'filled': '"opsz" 48, "wght" 400, "FILL" 1, "GRAD" 0',
276
- 'filled-bold': '"opsz" 24, "wght" 700, "FILL" 1, "GRAD" 0',
277
-
278
- 'inherit': 'inherit',
279
- },
280
- });
281
- }),
282
-
283
- // Theme
284
- plugin(({ matchUtilities, theme }) => {
285
- // Presets
286
- matchUtilities({
287
- 'theme-preset-1': (value) => {
288
- const [color, suffix = ''] = value.split('..');
289
-
290
- return {
291
- backgroundColor: theme(`backgroundColor.${color}` + suffix),
292
- color: theme(`textColor.on-${color}` + suffix),
293
-
294
- borderStyle: 'none',
295
- outlineStyle: 'none',
296
-
297
- '&[disabled]': {
298
- backgroundColor: theme('backgroundColor.disabled' + suffix),
299
- color: theme('textColor.on-disabled' + suffix),
300
- },
301
-
302
- '&:not(.interactivity-none)': {
303
- '&:hover, &:focus-visible': {
304
- backgroundColor: theme(`backgroundColor.${color}-hover` + suffix),
305
- },
306
-
307
- '&:active': {
308
- backgroundColor: theme(`backgroundColor.${color}` + suffix),
309
- },
310
- },
311
-
312
- transitionProperty: 'all',
313
- transitionDuration: theme('transitionDuration.short'),
314
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
315
- };
316
- },
317
-
318
- 'theme-preset-2': (value) => {
319
- const [color, suffix = ''] = value.split('..');
320
-
321
- return {
322
- backgroundColor: theme(`backgroundColor.${color}-opacity-0-08` + suffix),
323
- color: theme(`textColor.${color}` + suffix),
324
-
325
- borderStyle: 'none',
326
- outlineStyle: 'none',
327
-
328
- '&[disabled]': {
329
- backgroundColor: theme('backgroundColor.disabled' + suffix),
330
- color: theme('textColor.on-disabled' + suffix),
331
- },
332
-
333
- '&:not(.interactivity-none)': {
334
- '&:hover, &:focus-visible': {
335
- backgroundColor: theme(`backgroundColor.${color}-opacity-0-12` + suffix),
336
- },
337
-
338
- '&:active': {
339
- backgroundColor: theme(`backgroundColor.${color}-opacity-0-16` + suffix),
340
- },
341
- },
342
-
343
- transitionProperty: 'all',
344
- transitionDuration: theme('transitionDuration.short'),
345
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
346
- };
347
- },
348
-
349
- 'theme-preset-3': (value) => {
350
- const [color, suffix = ''] = value.split('..');
351
-
352
- return {
353
- backgroundColor: 'transparent',
354
- color: theme(`textColor.${color}` + suffix),
355
-
356
- borderStyle: 'none',
357
- outlineStyle: 'none',
358
-
359
- '&[disabled]': {
360
- color: theme('textColor.on-disabled' + suffix),
361
- },
362
-
363
- '&:not(.interactivity-none)': {
364
- '&:hover, &:focus-visible': {
365
- backgroundColor: theme(`backgroundColor.${color}-opacity-0-08` + suffix),
366
- },
367
-
368
- '&:active': {
369
- backgroundColor: theme(`backgroundColor.${color}-opacity-0-16` + suffix),
370
- },
371
- },
372
-
373
- transitionProperty: 'all',
374
- transitionDuration: theme('transitionDuration.short'),
375
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
376
- };
377
- },
378
-
379
- 'theme-preset-4': (value) => {
380
- const [color, suffix = ''] = value.split('..');
381
-
382
- return {
383
- backgroundColor: 'transparent',
384
- color: theme(`textColor.${color}` + suffix),
385
-
386
- borderStyle: 'none',
387
- outlineStyle: 'none',
388
-
389
- '&[disabled]': {
390
- color: theme('textColor.on-disabled' + suffix),
391
- },
392
-
393
- '&:not(.interactivity-none)': {
394
- '&:hover, &:focus-visible': {
395
- color: theme(`textColor.${color}-hover` + suffix),
396
- },
397
-
398
- '&:active': {
399
- color: theme(`textColor.${color}` + suffix),
400
- },
401
- },
402
-
403
- transitionProperty: 'all',
404
- transitionDuration: theme('transitionDuration.short'),
405
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
406
- };
174
+ addUtilities({
175
+ '.font-icon-outlined': {
176
+ fontVariationSettings: '"opsz" 48, "wght" 400, "FILL" 0, "GRAD" 0',
407
177
  },
408
- }, {
409
- values: {
410
- 'primary': 'primary',
411
- 'primary-dark': 'primary..-dark',
412
-
413
- 'success': 'success',
414
- 'success-dark': 'success..-dark',
415
-
416
- 'warning': 'warning',
417
- 'warning-dark': 'warning..-dark',
418
178
 
419
- 'error': 'error',
420
- 'error-dark': 'error..-dark',
179
+ '.font-icon-outlined-bold': {
180
+ fontVariationSettings: '"opsz" 24, "wght" 700, "FILL" 0, "GRAD" 0',
421
181
  },
422
- });
423
-
424
- // Backgrounds
425
- matchUtilities({
426
- 'theme-background': (value) => {
427
- const [color, suffix = ''] = value.split('..');
428
182
 
429
- return {
430
- backgroundColor: theme(`backgroundColor.${color}`),
431
-
432
- '&[disabled]': {
433
- backgroundColor: theme('backgroundColor.disabled' + suffix),
434
- },
435
- };
183
+ '.font-icon-filled': {
184
+ fontVariationSettings: '"opsz" 48, "wght" 400, "FILL" 1, "GRAD" 0',
436
185
  },
437
- }, {
438
- values: {
439
- 'default': 'background',
440
- 'default-dark': 'background..-dark',
441
-
442
- 'primary': 'primary',
443
- 'primary-dark': 'primary..-dark',
444
-
445
- 'primary-container': 'primary-container',
446
- 'primary-container-dark': 'primary-container..-dark',
447
-
448
- 'success': 'success',
449
- 'success-dark': 'success..-dark',
450
-
451
- 'success-container': 'success-container',
452
- 'success-container-dark': 'success-container..-dark',
453
186
 
454
- 'warning': 'warning',
455
- 'warning-dark': 'warning..-dark',
456
-
457
- 'warning-container': 'warning-container',
458
- 'warning-container-dark': 'warning-container..-dark',
459
-
460
- 'error': 'error',
461
- 'error-dark': 'error..-dark',
462
-
463
- 'error-container': 'error-container',
464
- 'error-container-dark': 'error-container..-dark',
465
-
466
- 'inherit': 'inherit',
187
+ '.font-icon-filled-bold': {
188
+ fontVariationSettings: '"opsz" 24, "wght" 700, "FILL" 1, "GRAD" 0',
467
189
  },
468
190
  });
469
191
 
470
- // Foregrounds
471
- matchUtilities({
472
- 'theme-foreground': (value) => {
473
- const [color, suffix = ''] = value.split('..');
474
-
475
- return {
476
- color: theme(`textColor.${color}`),
477
-
478
- '&[disabled]': {
479
- color: theme('textColor.on-disabled' + suffix),
480
- },
481
- };
482
- },
483
- }, {
484
- values: {
485
- 'default': 'on-background',
486
- 'default-dark': 'on-background..-dark',
487
-
488
- 'primary': 'primary',
489
- 'primary-dark': 'primary..-dark',
490
-
491
- 'on-primary': 'on-primary',
492
- 'on-primary-dark': 'on-primary..-dark',
493
-
494
- 'on-primary-container': 'on-primary-container',
495
- 'on-primary-container-dark': 'on-primary-container..-dark',
496
-
497
- 'success': 'success',
498
- 'success-dark': 'success..-dark',
499
-
500
- 'on-success': 'on-success',
501
- 'on-success-dark': 'on-success..-dark',
502
-
503
- 'on-success-container': 'on-success-container',
504
- 'on-success-container-dark': 'on-success-container..-dark',
505
-
506
- 'warning': 'warning',
507
- 'warning-dark': 'warning..-dark',
508
-
509
- 'on-warning': 'on-warning',
510
- 'on-warning-dark': 'on-warning..-dark',
511
-
512
- 'on-warning-container': 'on-warning-container',
513
- 'on-warning-container-dark': 'on-warning-container..-dark',
514
-
515
- 'error': 'error',
516
- 'error-dark': 'error..-dark',
517
-
518
- 'on-error': 'on-error',
519
- 'on-error-dark': 'on-error..-dark',
520
-
521
- 'on-error-container': 'on-error-container',
522
- 'on-error-container-dark': 'on-error-container..-dark',
523
-
524
- 'outline': 'outline',
525
- 'outline-dark': 'outline..-dark',
526
-
527
- 'inherit': 'inherit',
192
+ // TODO: Remove when migration complete
193
+ addUtilities({
194
+ '.visually-hidden': {
195
+ width: 0,
196
+ height: 0,
197
+ visibility: 'hidden',
528
198
  },
529
199
  });
530
200
 
531
- // Borders
532
- matchUtilities({
533
- 'theme-border': (value) => {
534
- const [color, suffix = ''] = value.split('..');
535
-
536
- return {
537
- borderColor: theme(`borderColor.${color}`),
538
- borderStyle: 'solid',
539
- borderWidth: 1,
201
+ addVariant('hover', '&:hover:not(.pointer-events-none)');
202
+ addVariant('focus-visible', '&:focus-visible:not(.pointer-events-none)');
203
+ addVariant('focus-within', '&:focus-within:not(.pointer-events-none)');
540
204
 
541
- '&[disabled]': {
542
- borderColor: theme('borderColor.disabled' + suffix),
543
- },
544
- };
545
- },
546
- }, {
547
- values: {
548
- 'primary': 'primary',
549
- 'primary-dark': 'primary..-dark',
205
+ addVariant('active', [
206
+ '&:active:not(.pointer-events-none)',
207
+ '&[active]:not(.pointer-events-none)',
208
+ ]);
550
209
 
551
- 'success': 'success',
552
- 'success-dark': 'success..-dark',
210
+ addVariant('enabled', '&:not([disabled])');
211
+ addVariant('disabled', '&[disabled]');
553
212
 
554
- 'warning': 'warning',
555
- 'warning-dark': 'warning..-dark',
213
+ addVariant('valid', '&:not([invalid])');
214
+ addVariant('invalid', '&[invalid]');
556
215
 
557
- 'error': 'error',
558
- 'error-dark': 'error..-dark',
216
+ addVariant('readwrite', '&:not([readonly])');
217
+ addVariant('readonly', '&[readonly]');
559
218
 
560
- 'outline': 'outline',
561
- 'outline-dark': 'outline..-dark',
562
-
563
- 'inherit': 'inherit',
564
- },
565
- });
566
-
567
- // Outlines
568
- matchUtilities({
569
- 'theme-outline': (value) => {
570
- const [color, suffix = ''] = value.split('..');
571
-
572
- return {
573
- outlineColor: theme(`outlineColor.${color}-opacity-0-16` + suffix),
574
- outlineStyle: 'solid',
575
- outlineWidth: 2,
576
- outlineOffset: 0,
577
- };
578
- },
579
- }, {
580
- values: {
581
- 'primary': 'primary',
582
- 'primary-dark': 'primary..-dark',
583
-
584
- 'success': 'success',
585
- 'success-dark': 'success..-dark',
586
-
587
- 'warning': 'warning',
588
- 'warning-dark': 'warning..-dark',
589
-
590
- 'error': 'error',
591
- 'error-dark': 'error..-dark',
592
-
593
- 'inherit': 'inherit',
594
- },
595
- });
219
+ addVariant('checked', [
220
+ '&[type="checkbox"]:checked:not(:indeterminate)',
221
+ '&[type="radio"]:checked',
222
+ ]);
596
223
  }),
597
224
  ],
225
+
226
+ safelist: [
227
+ {
228
+ pattern: /^text-(.+)$/,
229
+ variants: ['hover'],
230
+ },
231
+ ],
598
232
  };