@servicetitan/hammer-token 2.1.0 → 2.2.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.
Files changed (51) hide show
  1. package/.turbo/turbo-build.log +4 -1
  2. package/CHANGELOG.md +20 -0
  3. package/build/web/core/component-variables.scss +139 -0
  4. package/build/web/core/component.js +645 -0
  5. package/build/web/core/component.scss +69 -0
  6. package/build/web/core/css-utils/border.css +46 -28
  7. package/build/web/core/css-utils/color.css +220 -102
  8. package/build/web/core/css-utils/font.css +46 -42
  9. package/build/web/core/css-utils/spacing.css +72 -0
  10. package/build/web/core/css-utils/utils.css +563 -367
  11. package/build/web/core/index.js +2 -1
  12. package/build/web/core/raw.js +28 -24
  13. package/build/web/core/semantic-variables.scss +28 -24
  14. package/build/web/core/semantic.js +44 -24
  15. package/build/web/core/semantic.scss +13 -11
  16. package/config.js +98 -22
  17. package/package.json +3 -2
  18. package/src/global/primitive/breakpoint.js +19 -0
  19. package/src/global/primitive/color.js +231 -0
  20. package/src/global/primitive/duration.js +16 -0
  21. package/src/global/primitive/font.js +60 -0
  22. package/src/global/primitive/radius.js +31 -0
  23. package/src/global/primitive/size.js +55 -0
  24. package/src/global/primitive/transition.js +16 -0
  25. package/src/theme/core/background.js +148 -0
  26. package/src/theme/core/border.js +93 -0
  27. package/src/theme/core/component/button.js +708 -0
  28. package/src/theme/core/component/checkbox.js +405 -0
  29. package/src/theme/core/focus.js +35 -0
  30. package/src/theme/core/foreground.js +148 -0
  31. package/src/theme/core/overlay.js +137 -0
  32. package/src/theme/core/shadow.js +29 -0
  33. package/src/theme/core/status.js +49 -0
  34. package/src/theme/core/typography.js +82 -0
  35. package/src/utils/css-utils-format-utils.js +105 -33
  36. package/type/types.ts +75 -0
  37. package/src/global/primitive/breakpoint.json +0 -19
  38. package/src/global/primitive/color.json +0 -231
  39. package/src/global/primitive/duration.json +0 -16
  40. package/src/global/primitive/font.json +0 -60
  41. package/src/global/primitive/radius.json +0 -31
  42. package/src/global/primitive/size.json +0 -55
  43. package/src/global/primitive/transition.json +0 -16
  44. package/src/theme/core/background.json +0 -144
  45. package/src/theme/core/border.json +0 -87
  46. package/src/theme/core/focus.json +0 -31
  47. package/src/theme/core/foreground.json +0 -132
  48. package/src/theme/core/overlay.json +0 -134
  49. package/src/theme/core/shadow.json +0 -25
  50. package/src/theme/core/status.json +0 -46
  51. package/src/theme/core/typography.json +0 -79
@@ -0,0 +1,708 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ const { foreground } = require("../foreground");
3
+ const { background } = require("../background");
4
+ const { overlay } = require("../overlay");
5
+ const { focus } = require("../focus");
6
+ const { border } = require("../border");
7
+ const { color } = require("../../../global/primitive/color");
8
+ const tinycolor = require("tinycolor2");
9
+
10
+ module.exports = {
11
+ button: {
12
+ primary: {
13
+ foreground: {
14
+ color: {
15
+ default: {
16
+ value: foreground.color.on.primary.value,
17
+ attributes: {
18
+ appearance: {
19
+ dark: {
20
+ value:
21
+ foreground.color.on.primary.attributes.appearance.dark
22
+ .value,
23
+ },
24
+ },
25
+ },
26
+ },
27
+ hover: {
28
+ value: foreground.color.on.primary.value,
29
+ attributes: {
30
+ appearance: {
31
+ dark: {
32
+ value:
33
+ foreground.color.on.primary.attributes.appearance.dark
34
+ .value,
35
+ },
36
+ },
37
+ },
38
+ },
39
+ active: {
40
+ value: foreground.color.on.primary.value,
41
+ attributes: {
42
+ appearance: {
43
+ dark: {
44
+ value:
45
+ foreground.color.on.primary.attributes.appearance.dark
46
+ .value,
47
+ },
48
+ },
49
+ },
50
+ },
51
+ },
52
+ },
53
+ background: {
54
+ color: {
55
+ default: {
56
+ value: background.color.primary.default.value,
57
+ attributes: {
58
+ appearance: {
59
+ dark: {
60
+ value:
61
+ background.color.primary.default.attributes.appearance.dark
62
+ .value,
63
+ },
64
+ },
65
+ },
66
+ },
67
+ hover: {
68
+ // Need to revisit once we have a solid color for overlay
69
+ // potential solution: background.color.primary.hover.value
70
+ value: tinycolor
71
+ .mix(
72
+ background.color.primary.default.value,
73
+ overlay.color.hover.on.primary.value.slice(0, -2),
74
+ 20,
75
+ )
76
+ .toHex8String(),
77
+ attributes: {
78
+ appearance: {
79
+ dark: {
80
+ // Need to revisit once we have a solid color for overlay
81
+ value: tinycolor
82
+ .mix(
83
+ background.color.primary.default.attributes.appearance
84
+ .dark.value,
85
+ overlay.color.hover.on.primary.attributes.appearance.dark.value.slice(
86
+ 0,
87
+ -2,
88
+ ),
89
+ 16,
90
+ )
91
+ .toHex8String(),
92
+ },
93
+ },
94
+ },
95
+ },
96
+ active: {
97
+ // Need to revisit once we have a solid color for overlay
98
+ value: tinycolor
99
+ .mix(
100
+ background.color.primary.default.value,
101
+ overlay.color.active.on.primary.value.slice(0, -2),
102
+ 40,
103
+ )
104
+ .toHex8String(),
105
+ attributes: {
106
+ appearance: {
107
+ dark: {
108
+ // Need to revisit once we have a solid color for overlay
109
+ value: tinycolor
110
+ .mix(
111
+ background.color.primary.default.attributes.appearance
112
+ .dark.value,
113
+ overlay.color.active.on.primary.attributes.appearance.dark.value.slice(
114
+ 0,
115
+ -2,
116
+ ),
117
+ 16,
118
+ )
119
+ .toHex8String(),
120
+ },
121
+ },
122
+ },
123
+ },
124
+ },
125
+ },
126
+ border: {
127
+ color: {
128
+ value: "transparent",
129
+ attributes: {
130
+ appearance: {
131
+ dark: {
132
+ value: "transparent",
133
+ },
134
+ },
135
+ },
136
+ },
137
+ radius: {
138
+ value: border.radius.medium.value,
139
+ },
140
+ },
141
+ "focus-ring": {
142
+ color: {
143
+ value: focus.ring.color.default.value,
144
+ attributes: {
145
+ appearance: {
146
+ dark: {
147
+ value:
148
+ focus.ring.color.default.attributes.appearance.dark.value,
149
+ },
150
+ },
151
+ },
152
+ },
153
+ },
154
+ },
155
+ secondary: {
156
+ foreground: {
157
+ color: {
158
+ default: {
159
+ value: foreground.color.default.value,
160
+ attributes: {
161
+ appearance: {
162
+ dark: {
163
+ value:
164
+ foreground.color.default.attributes.appearance.dark.value,
165
+ },
166
+ },
167
+ },
168
+ },
169
+ hover: {
170
+ value: foreground.color.default.value,
171
+ attributes: {
172
+ appearance: {
173
+ dark: {
174
+ value:
175
+ foreground.color.default.attributes.appearance.dark.value,
176
+ },
177
+ },
178
+ },
179
+ },
180
+ active: {
181
+ value: foreground.color.default.value,
182
+ attributes: {
183
+ appearance: {
184
+ dark: {
185
+ value:
186
+ foreground.color.default.attributes.appearance.dark.value,
187
+ },
188
+ },
189
+ },
190
+ },
191
+ },
192
+ },
193
+ background: {
194
+ color: {
195
+ default: {
196
+ value: tinycolor(color.neutral["500"].value)
197
+ .setAlpha(0.06)
198
+ .toHex8String(),
199
+ attributes: {
200
+ appearance: {
201
+ dark: {
202
+ value: tinycolor(color.neutral["0"].value)
203
+ .setAlpha(0.06)
204
+ .toHex8String(),
205
+ },
206
+ },
207
+ },
208
+ },
209
+ hover: {
210
+ // Need to revisit once we have a solid color for overlay
211
+ value: tinycolor
212
+ .mix(
213
+ tinycolor(color.neutral["500"].value)
214
+ .setAlpha(0.06)
215
+ .toHex8String(),
216
+ overlay.color.hover.default.value.slice(0, -2),
217
+ 8,
218
+ )
219
+ .toHex8String(),
220
+ attributes: {
221
+ appearance: {
222
+ dark: {
223
+ // Need to revisit once we have a solid color for overlay
224
+ value: tinycolor
225
+ .mix(
226
+ tinycolor(color.neutral["0"].value)
227
+ .setAlpha(0.06)
228
+ .toHex8String(),
229
+ overlay.color.hover.default.attributes.appearance.dark.value.slice(
230
+ 0,
231
+ -2,
232
+ ),
233
+ 8,
234
+ )
235
+ .toHex8String(),
236
+ },
237
+ },
238
+ },
239
+ },
240
+ active: {
241
+ // Need to revisit once we have a solid color for overlay
242
+ value: tinycolor
243
+ .mix(
244
+ tinycolor(color.neutral["500"].value)
245
+ .setAlpha(0.06)
246
+ .toHex8String(),
247
+ overlay.color.active.default.value.slice(0, -2),
248
+ 16,
249
+ )
250
+ .toHex8String(),
251
+ attributes: {
252
+ appearance: {
253
+ dark: {
254
+ // Need to revisit once we have a solid color for overlay
255
+ value: tinycolor
256
+ .mix(
257
+ tinycolor(color.neutral["0"].value)
258
+ .setAlpha(0.06)
259
+ .toHex8String(),
260
+ overlay.color.active.default.attributes.appearance.dark.value.slice(
261
+ 0,
262
+ -2,
263
+ ),
264
+ 16,
265
+ )
266
+ .toHex8String(),
267
+ },
268
+ },
269
+ },
270
+ },
271
+ },
272
+ },
273
+ border: {
274
+ color: {
275
+ value: "transparent",
276
+ attributes: {
277
+ appearance: {
278
+ dark: {
279
+ value: "transparent",
280
+ },
281
+ },
282
+ },
283
+ },
284
+ radius: {
285
+ value: border.radius.medium.value,
286
+ },
287
+ },
288
+ "focus-ring": {
289
+ color: {
290
+ value: focus.ring.color.default.value,
291
+ attributes: {
292
+ appearance: {
293
+ dark: {
294
+ value:
295
+ focus.ring.color.default.attributes.appearance.dark.value,
296
+ },
297
+ },
298
+ },
299
+ },
300
+ },
301
+ },
302
+ ghost: {
303
+ foreground: {
304
+ color: {
305
+ default: {
306
+ value: foreground.color.default.value,
307
+ attributes: {
308
+ appearance: {
309
+ dark: {
310
+ value:
311
+ foreground.color.default.attributes.appearance.dark.value,
312
+ },
313
+ },
314
+ },
315
+ },
316
+ hover: {
317
+ value: foreground.color.default.value,
318
+ attributes: {
319
+ appearance: {
320
+ dark: {
321
+ value:
322
+ foreground.color.default.attributes.appearance.dark.value,
323
+ },
324
+ },
325
+ },
326
+ },
327
+ active: {
328
+ value: foreground.color.default.value,
329
+ attributes: {
330
+ appearance: {
331
+ dark: {
332
+ value:
333
+ foreground.color.default.attributes.appearance.dark.value,
334
+ },
335
+ },
336
+ },
337
+ },
338
+ },
339
+ },
340
+ background: {
341
+ color: {
342
+ default: {
343
+ value: "transparent",
344
+ attributes: {
345
+ appearance: {
346
+ dark: {
347
+ value: "transparent",
348
+ },
349
+ },
350
+ },
351
+ },
352
+ hover: {
353
+ // Need to revisit once we have a solid color for overlay
354
+ value: tinycolor(overlay.color.hover.default.value.slice(0, -2))
355
+ .setAlpha(0.08)
356
+ .toHex8String(),
357
+ attributes: {
358
+ appearance: {
359
+ dark: {
360
+ // Need to revisit once we have a solid color for overlay
361
+ value: tinycolor(
362
+ overlay.color.hover.default.attributes.appearance.dark.value.slice(
363
+ 0,
364
+ -2,
365
+ ),
366
+ )
367
+ .setAlpha(0.08)
368
+ .toHex8String(),
369
+ },
370
+ },
371
+ },
372
+ },
373
+ active: {
374
+ // Need to revisit once we have a solid color for overlay
375
+ value: tinycolor(overlay.color.active.default.value)
376
+ .setAlpha(0.16)
377
+ .toHex8String(),
378
+ attributes: {
379
+ appearance: {
380
+ dark: {
381
+ // Need to revisit once we have a solid color for overlay
382
+ value: tinycolor(
383
+ overlay.color.active.default.attributes.appearance.dark.value.slice(
384
+ 0,
385
+ -2,
386
+ ),
387
+ )
388
+ .setAlpha(0.16)
389
+ .toHex8String(),
390
+ },
391
+ },
392
+ },
393
+ },
394
+ },
395
+ },
396
+ border: {
397
+ color: {
398
+ value: "transparent",
399
+ attributes: {
400
+ appearance: {
401
+ dark: {
402
+ value: "transparent",
403
+ },
404
+ },
405
+ },
406
+ },
407
+ radius: {
408
+ value: border.radius.medium.value,
409
+ },
410
+ },
411
+ "focus-ring": {
412
+ color: {
413
+ value: focus.ring.color.default.value,
414
+ attributes: {
415
+ appearance: {
416
+ dark: {
417
+ value:
418
+ focus.ring.color.default.attributes.appearance.dark.value,
419
+ },
420
+ },
421
+ },
422
+ },
423
+ },
424
+ },
425
+ "danger-primary": {
426
+ foreground: {
427
+ color: {
428
+ default: {
429
+ value: foreground.color.on.danger.default.value,
430
+ attributes: {
431
+ appearance: {
432
+ dark: {
433
+ value:
434
+ foreground.color.on.danger.default.attributes.appearance
435
+ .dark.value,
436
+ },
437
+ },
438
+ },
439
+ },
440
+ hover: {
441
+ value: foreground.color.on.danger.default.value,
442
+ attributes: {
443
+ appearance: {
444
+ dark: {
445
+ value:
446
+ foreground.color.on.danger.default.attributes.appearance
447
+ .dark.value,
448
+ },
449
+ },
450
+ },
451
+ },
452
+ active: {
453
+ value: foreground.color.on.danger.default.value,
454
+ attributes: {
455
+ appearance: {
456
+ dark: {
457
+ value:
458
+ foreground.color.on.danger.default.attributes.appearance
459
+ .dark.value,
460
+ },
461
+ },
462
+ },
463
+ },
464
+ },
465
+ },
466
+ background: {
467
+ color: {
468
+ default: {
469
+ value: background.color.danger.default.value,
470
+ attributes: {
471
+ appearance: {
472
+ dark: {
473
+ value:
474
+ background.color.danger.default.attributes.appearance.dark
475
+ .value,
476
+ },
477
+ },
478
+ },
479
+ },
480
+ hover: {
481
+ // Need to revisit once we have a solid color for overlay
482
+ value: tinycolor
483
+ .mix(
484
+ background.color.danger.default.value,
485
+ overlay.color.hover.on.danger.value.slice(0, -2),
486
+ 20,
487
+ )
488
+ .toHex8String(),
489
+ attributes: {
490
+ appearance: {
491
+ dark: {
492
+ // Need to revisit once we have a solid color for overlay
493
+ value: tinycolor
494
+ .mix(
495
+ background.color.danger.default.attributes.appearance.dark
496
+ .value,
497
+ overlay.color.hover.on.danger.attributes.appearance.dark.value.slice(
498
+ 0,
499
+ -2,
500
+ ),
501
+ 16,
502
+ )
503
+ .toHex8String(),
504
+ },
505
+ },
506
+ },
507
+ },
508
+ active: {
509
+ // Need to revisit once we have a solid color for overlay
510
+ value: tinycolor
511
+ .mix(
512
+ background.color.danger.default.value,
513
+ overlay.color.active.on.danger.value.slice(0, -2),
514
+ 40,
515
+ )
516
+ .toHex8String(),
517
+ attributes: {
518
+ appearance: {
519
+ dark: {
520
+ // Need to revisit once we have a solid color for overlay
521
+ value: tinycolor
522
+ .mix(
523
+ background.color.danger.default.attributes.appearance.dark
524
+ .value,
525
+ overlay.color.active.on.danger.attributes.appearance.dark.value.slice(
526
+ 0,
527
+ -2,
528
+ ),
529
+ 16,
530
+ )
531
+ .toHex8String(),
532
+ },
533
+ },
534
+ },
535
+ },
536
+ },
537
+ },
538
+ border: {
539
+ color: {
540
+ value: "transparent",
541
+ attributes: {
542
+ appearance: {
543
+ dark: {
544
+ value: "transparent",
545
+ },
546
+ },
547
+ },
548
+ },
549
+ radius: {
550
+ value: border.radius.medium.value,
551
+ },
552
+ },
553
+ "focus-ring": {
554
+ color: {
555
+ value: focus.ring.color.danger.value,
556
+ attributes: {
557
+ appearance: {
558
+ dark: {
559
+ value: focus.ring.color.danger.attributes.appearance.dark.value,
560
+ },
561
+ },
562
+ },
563
+ },
564
+ },
565
+ },
566
+ "danger-secondary": {
567
+ foreground: {
568
+ color: {
569
+ default: {
570
+ value: foreground.color.on.danger.subdued.value,
571
+ attributes: {
572
+ appearance: {
573
+ dark: {
574
+ value:
575
+ foreground.color.on.danger.subdued.attributes.appearance
576
+ .dark.value,
577
+ },
578
+ },
579
+ },
580
+ },
581
+ hover: {
582
+ value: foreground.color.hover.danger.value,
583
+ attributes: {
584
+ appearance: {
585
+ dark: {
586
+ value:
587
+ foreground.color.hover.danger.attributes.appearance.dark
588
+ .value,
589
+ },
590
+ },
591
+ },
592
+ },
593
+ active: {
594
+ value: foreground.color.active.danger.value,
595
+ attributes: {
596
+ appearance: {
597
+ dark: {
598
+ value:
599
+ foreground.color.active.danger.attributes.appearance.dark
600
+ .value,
601
+ },
602
+ },
603
+ },
604
+ },
605
+ },
606
+ },
607
+ background: {
608
+ color: {
609
+ default: {
610
+ value: background.color.danger.subdued.value,
611
+ attributes: {
612
+ appearance: {
613
+ dark: {
614
+ value:
615
+ background.color.danger.subdued.attributes.appearance.dark
616
+ .value,
617
+ },
618
+ },
619
+ },
620
+ },
621
+ hover: {
622
+ // Need to revisit once we have a solid color for overlay
623
+ value: tinycolor
624
+ .mix(
625
+ background.color.danger.subdued.value,
626
+ overlay.color.hover.danger.value.slice(0, -2),
627
+ 10,
628
+ )
629
+ .toHex8String(),
630
+ attributes: {
631
+ appearance: {
632
+ dark: {
633
+ // Need to revisit once we have a solid color for overlay
634
+ value: tinycolor
635
+ .mix(
636
+ background.color.danger.subdued.attributes.appearance.dark
637
+ .value,
638
+ overlay.color.hover.danger.attributes.appearance.dark.value.slice(
639
+ 0,
640
+ -2,
641
+ ),
642
+ 15,
643
+ )
644
+ .toHex8String(),
645
+ },
646
+ },
647
+ },
648
+ },
649
+ active: {
650
+ // Need to revisit once we have a solid color for overlay
651
+ value: tinycolor
652
+ .mix(
653
+ background.color.danger.subdued.value,
654
+ overlay.color.active.danger.value.slice(0, -2),
655
+ 30,
656
+ )
657
+ .toHex8String(),
658
+ attributes: {
659
+ appearance: {
660
+ dark: {
661
+ // Need to revisit once we have a solid color for overlay
662
+ value: tinycolor
663
+ .mix(
664
+ background.color.danger.subdued.attributes.appearance.dark
665
+ .value,
666
+ overlay.color.active.danger.attributes.appearance.dark.value.slice(
667
+ 0,
668
+ -2,
669
+ ),
670
+ 25,
671
+ )
672
+ .toHex8String(),
673
+ },
674
+ },
675
+ },
676
+ },
677
+ },
678
+ },
679
+ border: {
680
+ color: {
681
+ value: "transparent",
682
+ attributes: {
683
+ appearance: {
684
+ dark: {
685
+ value: "transparent",
686
+ },
687
+ },
688
+ },
689
+ },
690
+ radius: {
691
+ value: border.radius.medium.value,
692
+ },
693
+ },
694
+ "focus-ring": {
695
+ color: {
696
+ value: focus.ring.color.danger.value,
697
+ attributes: {
698
+ appearance: {
699
+ dark: {
700
+ value: focus.ring.color.danger.attributes.appearance.dark.value,
701
+ },
702
+ },
703
+ },
704
+ },
705
+ },
706
+ },
707
+ },
708
+ };