@assure-one/design-system 1.31.0 → 1.33.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 (42) hide show
  1. package/README.md +61 -6
  2. package/codemods/0.2.0-radix-migration.mjs +315 -0
  3. package/codemods/README.md +365 -0
  4. package/codemods/lib/css-selectors.mjs +33 -0
  5. package/codemods/lib/css-values.mjs +223 -0
  6. package/codemods/lib/ds-stylesheet.mjs +168 -0
  7. package/codemods/lib/environment.mjs +72 -0
  8. package/codemods/lib/files.mjs +100 -0
  9. package/codemods/lib/forms.mjs +253 -0
  10. package/codemods/lib/jsx.mjs +0 -0
  11. package/codemods/lib/ledger.mjs +84 -0
  12. package/codemods/lib/registry.mjs +32 -0
  13. package/codemods/lib/report.mjs +119 -0
  14. package/codemods/lib/runner.mjs +164 -0
  15. package/codemods/run.mjs +161 -0
  16. package/codemods/transforms/cm-14-hidden-mirrors.mjs +275 -0
  17. package/codemods/transforms/cm-15-dom-selectors.mjs +573 -0
  18. package/codemods/transforms/cm-16-globals-css.mjs +487 -0
  19. package/codemods/transforms/cm-20-select-sentinels.mjs +442 -0
  20. package/dist/css/base.css +60 -0
  21. package/dist/css/components.css +7 -0
  22. package/dist/css/legacy-aliases.css +665 -0
  23. package/dist/css/shadcn.css +155 -0
  24. package/dist/css/tailwind.css +296 -0
  25. package/dist/css/tokens.css +630 -0
  26. package/dist/index.d.ts +807 -27
  27. package/dist/index.js +2038 -683
  28. package/dist/index.js.map +1 -1
  29. package/dist/styles.css +1 -1
  30. package/dist/system-BDU18fVg.d.ts +559 -0
  31. package/dist/testing/index.cjs +458 -0
  32. package/dist/testing/index.d.cts +253 -0
  33. package/dist/testing/index.d.ts +253 -0
  34. package/dist/testing/index.js +452 -0
  35. package/dist/testing/setup.cjs +123 -0
  36. package/dist/testing/setup.js +121 -0
  37. package/dist/testing/style-stub.cjs +7 -0
  38. package/dist/testing/style-stub.js +5 -0
  39. package/dist/tokens/index.d.ts +50 -439
  40. package/dist/tokens/index.js +557 -50
  41. package/dist/tokens/index.js.map +1 -1
  42. package/package.json +74 -5
@@ -1,52 +1,52 @@
1
1
  // src/tokens/reference.ts
2
2
  var colors = {
3
3
  /* Surfaces */
4
- bg: "#FDFDFC",
5
- bg2: "#F7F7F5",
6
- bg3: "#F0F0ED",
7
- surface: "#FFFFFF",
8
- surface2: "#FAFAF8",
4
+ bg: "#ffffff",
5
+ bg2: "#f1f3f8",
6
+ bg3: "#e7eaf1",
7
+ surface: "#ffffff",
8
+ surface2: "#f7f8fc",
9
9
  /* Foreground */
10
- fg: "#0A0A0A",
11
- fg2: "#38383B",
12
- fg3: "#6B6B70",
13
- fg4: "#9A9AA0",
14
- fg5: "#C4C4C8",
10
+ fg: "#0a0a0a",
11
+ fg2: "#38383b",
12
+ fg3: "#5f5f64",
13
+ fg4: "#6b6b70",
14
+ fg5: "#9a9aa0",
15
15
  /* Rules */
16
- rule: "#EAEAE6",
17
- ruleSoft: "#F0F0EC",
18
- ruleStrong: "#DADAD4",
16
+ rule: "#e4e7ef",
17
+ ruleSoft: "#eef0f5",
18
+ ruleStrong: "#d3d8e3",
19
19
  /* Accent (cyan) */
20
- accent: "#0066FF",
21
- accent2: "#0052CC",
22
- accentTint: "#E8F0FF",
23
- accentHover: "#005BE6",
24
- accentActive: "#004FCC",
20
+ accent: "#6c42f8",
21
+ accent2: "#5127e8",
22
+ accentTint: "#efeaff",
23
+ accentHover: "#5e35f2",
24
+ accentActive: "#5127e8",
25
25
  /* Pro (purple) */
26
- proBg: "#F4F1FF",
27
- proBgHover: "#EEE9FF",
28
- proBgActive: "#E4DDFF",
29
- proFg: "#6C42F8",
30
- proHover: "#5E35F2",
31
- proActive: "#5127E8",
32
- proDisabled: "#B7A7F3",
33
- proLine: "#7B5BD8",
26
+ proBg: "#f4f1ff",
27
+ proBgHover: "#eee9ff",
28
+ proBgActive: "#e4ddff",
29
+ proFg: "#6c42f8",
30
+ proHover: "#5e35f2",
31
+ proActive: "#5127e8",
32
+ proDisabled: "#b7a7f3",
33
+ proLine: "#7b5bd8",
34
34
  /* Disabled */
35
- fgDisabled: "#A7A7AC",
36
- bgDisabled: "#F3F3F1",
35
+ fgDisabled: "#a7a7ac",
36
+ bgDisabled: "#f3f3f1",
37
37
  /* Status */
38
- successFg: "#1F7A3D",
39
- successBg: "#EAF6EE",
40
- successLine: "#C5E5CF",
41
- warningFg: "#B45F0A",
42
- warningBg: "#FFF3E5",
43
- warningLine: "#F5D5A8",
44
- dangerFg: "#C43838",
45
- dangerBg: "#FBEAEA",
46
- dangerLine: "#ECC5C5",
38
+ successFg: "#1f7a3d",
39
+ successBg: "#eaf6ee",
40
+ successLine: "#c5e5cf",
41
+ warningFg: "#8a4606",
42
+ warningBg: "#fff3e5",
43
+ warningLine: "#f5d5a8",
44
+ dangerFg: "#c43838",
45
+ dangerBg: "#fbeaea",
46
+ dangerLine: "#ecc5c5",
47
47
  /* On-brand */
48
- fgOnAccent: "#FFFFFF",
49
- fgOnPro: "#FFFFFF"
48
+ fgOnAccent: "#ffffff",
49
+ fgOnPro: "#ffffff"
50
50
  };
51
51
  var typography = {
52
52
  family: {
@@ -72,17 +72,17 @@ var radii = {
72
72
  full: "9999px"
73
73
  };
74
74
  var shadows = {
75
- quiet: "0 1px 2px rgba(10,10,10,0.03)",
76
- card: "0 12px 28px -16px rgba(10,10,10,0.18), 0 1px 2px rgba(10,10,10,0.04)",
77
- pop: "0 30px 80px -30px rgba(10,10,10,0.18), 0 8px 24px -8px rgba(10,10,10,0.06)",
78
- focusRing: "0 0 0 2px rgba(0, 102, 255, 0.18)"
75
+ quiet: "0 1px 2px rgba(16, 20, 36, 0.05)",
76
+ card: "0 1px 2px rgba(16, 20, 36, 0.04), 0 4px 12px -4px rgba(16, 20, 36, 0.08)",
77
+ pop: "0 0 0 1px rgba(16, 20, 36, 0.03), 0 2px 4px -1px rgba(16, 20, 36, 0.06), 0 12px 28px -6px rgba(16, 20, 36, 0.14)",
78
+ focusRing: "0 0 0 2px #ffffff, 0 0 0 4px #6c42f8"
79
79
  };
80
80
  var overlays = {
81
81
  hover: "rgba(10, 10, 10, 0.03)",
82
82
  active: "rgba(10, 10, 10, 0.05)"
83
83
  };
84
84
  var layout = {
85
- shellSidebarWidth: "256px",
85
+ shellSidebarWidth: "200px",
86
86
  shellHeaderHeight: "56px",
87
87
  contentPad: "32px"
88
88
  };
@@ -103,10 +103,10 @@ var spacing = {
103
103
  180: "180px"
104
104
  };
105
105
  var surfaces = {
106
- bg: "#FDFDFC",
107
- bg2: "#F7F7F5",
108
- surface: "#FFFFFF",
109
- surface2: "#FAFAF8"
106
+ bg: "#ffffff",
107
+ bg2: "#f1f3f8",
108
+ surface: "#ffffff",
109
+ surface2: "#f7f8fc"
110
110
  };
111
111
  var motion = {
112
112
  ease: {
@@ -122,6 +122,28 @@ var motion = {
122
122
  slow: "400ms"
123
123
  }
124
124
  };
125
+ var iconSizes = {
126
+ xs: "12px",
127
+ sm: "14px",
128
+ md: "16px",
129
+ lg: "20px"
130
+ };
131
+ var zIndex = {
132
+ base: 0,
133
+ sticky: 100,
134
+ overlay: 200,
135
+ modal: 300,
136
+ popover: 400,
137
+ toast: 500,
138
+ tooltip: 600
139
+ };
140
+ var breakpoints = {
141
+ sm: "40rem",
142
+ md: "48rem",
143
+ lg: "64rem",
144
+ xl: "80rem",
145
+ "2xl": "96rem"
146
+ };
125
147
  var reference = {
126
148
  colors,
127
149
  typography,
@@ -131,7 +153,10 @@ var reference = {
131
153
  layout,
132
154
  motion,
133
155
  spacing,
134
- surfaces
156
+ surfaces,
157
+ iconSizes,
158
+ zIndex,
159
+ breakpoints
135
160
  };
136
161
 
137
162
  // src/tokens/system.ts
@@ -329,6 +354,54 @@ var systemTokens = {
329
354
  }
330
355
  }
331
356
  },
357
+ /**
358
+ * Control sizing (amendment A1, W2-03). One outer height per size name, with
359
+ * the padding, gap, label size and glyph size derived from it.
360
+ *
361
+ * **Nothing reads these yet** and the numbers are gated on decision D5
362
+ * (implementation plan §3) — what each control renders *today* is in
363
+ * `docs/design-system/control-sizes.md`, and W2-05 is the task that unifies
364
+ * them. Referencing the scale here is also what keeps the custom properties
365
+ * in the published stylesheet, so `[data-ds-density="compact"]` has something
366
+ * to re-point.
367
+ */
368
+ control: {
369
+ height: {
370
+ xs: "var(--control-height-xs)",
371
+ sm: "var(--control-height-sm)",
372
+ md: "var(--control-height-md)",
373
+ lg: "var(--control-height-lg)",
374
+ xl: "var(--control-height-xl)"
375
+ },
376
+ paddingX: {
377
+ xs: "var(--control-padding-x-xs)",
378
+ sm: "var(--control-padding-x-sm)",
379
+ md: "var(--control-padding-x-md)",
380
+ lg: "var(--control-padding-x-lg)",
381
+ xl: "var(--control-padding-x-xl)"
382
+ },
383
+ gap: {
384
+ xs: "var(--control-gap-xs)",
385
+ sm: "var(--control-gap-sm)",
386
+ md: "var(--control-gap-md)",
387
+ lg: "var(--control-gap-lg)",
388
+ xl: "var(--control-gap-xl)"
389
+ },
390
+ fontSize: {
391
+ xs: "var(--control-font-size-xs)",
392
+ sm: "var(--control-font-size-sm)",
393
+ md: "var(--control-font-size-md)",
394
+ lg: "var(--control-font-size-lg)",
395
+ xl: "var(--control-font-size-xl)"
396
+ },
397
+ icon: {
398
+ xs: "var(--control-icon-xs)",
399
+ sm: "var(--control-icon-sm)",
400
+ md: "var(--control-icon-md)",
401
+ lg: "var(--control-icon-lg)",
402
+ xl: "var(--control-icon-xl)"
403
+ }
404
+ },
332
405
  layout: {
333
406
  shellSidebarWidth: "var(--shell-sidebar-w)",
334
407
  shellSidebarRailWidth: "var(--shell-sidebar-w-rail)",
@@ -346,6 +419,440 @@ var systemTokens = {
346
419
  }
347
420
  };
348
421
 
349
- export { colors, layout, motion, overlays, radii, reference, shadows, spacing, surfaces, systemTokens, typography };
422
+ // src/foundation/theme/srgb.ts
423
+ var SRGB_TO_LINEAR_1E6 = [
424
+ 0,
425
+ 304,
426
+ 607,
427
+ 911,
428
+ 1214,
429
+ 1518,
430
+ 1821,
431
+ 2125,
432
+ 2428,
433
+ 2732,
434
+ 3035,
435
+ 3347,
436
+ 3677,
437
+ 4025,
438
+ 4391,
439
+ 4777,
440
+ 5182,
441
+ 5605,
442
+ 6049,
443
+ 6512,
444
+ 6995,
445
+ 7499,
446
+ 8023,
447
+ 8568,
448
+ 9134,
449
+ 9721,
450
+ 10330,
451
+ 10960,
452
+ 11612,
453
+ 12286,
454
+ 12983,
455
+ 13702,
456
+ 14444,
457
+ 15209,
458
+ 15996,
459
+ 16807,
460
+ 17642,
461
+ 18500,
462
+ 19382,
463
+ 20289,
464
+ 21219,
465
+ 22174,
466
+ 23153,
467
+ 24158,
468
+ 25187,
469
+ 26241,
470
+ 27321,
471
+ 28426,
472
+ 29557,
473
+ 30713,
474
+ 31896,
475
+ 33105,
476
+ 34340,
477
+ 35601,
478
+ 36889,
479
+ 38204,
480
+ 39546,
481
+ 40915,
482
+ 42311,
483
+ 43735,
484
+ 45186,
485
+ 46665,
486
+ 48172,
487
+ 49707,
488
+ 51269,
489
+ 52861,
490
+ 54480,
491
+ 56128,
492
+ 57805,
493
+ 59511,
494
+ 61246,
495
+ 63010,
496
+ 64803,
497
+ 66626,
498
+ 68478,
499
+ 70360,
500
+ 72272,
501
+ 74214,
502
+ 76185,
503
+ 78187,
504
+ 80220,
505
+ 82283,
506
+ 84376,
507
+ 86500,
508
+ 88656,
509
+ 90842,
510
+ 93059,
511
+ 95307,
512
+ 97587,
513
+ 99899,
514
+ 102242,
515
+ 104616,
516
+ 107023,
517
+ 109462,
518
+ 111932,
519
+ 114435,
520
+ 116971,
521
+ 119538,
522
+ 122139,
523
+ 124772,
524
+ 127438,
525
+ 130136,
526
+ 132868,
527
+ 135633,
528
+ 138432,
529
+ 141263,
530
+ 144128,
531
+ 147027,
532
+ 149960,
533
+ 152926,
534
+ 155926,
535
+ 158961,
536
+ 162029,
537
+ 165132,
538
+ 168269,
539
+ 171441,
540
+ 174647,
541
+ 177888,
542
+ 181164,
543
+ 184475,
544
+ 187821,
545
+ 191202,
546
+ 194618,
547
+ 198069,
548
+ 201556,
549
+ 205079,
550
+ 208637,
551
+ 212231,
552
+ 215861,
553
+ 219526,
554
+ 223228,
555
+ 226966,
556
+ 230740,
557
+ 234551,
558
+ 238398,
559
+ 242281,
560
+ 246201,
561
+ 250158,
562
+ 254152,
563
+ 258183,
564
+ 262251,
565
+ 266356,
566
+ 270498,
567
+ 274677,
568
+ 278894,
569
+ 283149,
570
+ 287441,
571
+ 291771,
572
+ 296138,
573
+ 300544,
574
+ 304987,
575
+ 309469,
576
+ 313989,
577
+ 318547,
578
+ 323143,
579
+ 327778,
580
+ 332452,
581
+ 337164,
582
+ 341914,
583
+ 346704,
584
+ 351533,
585
+ 356400,
586
+ 361307,
587
+ 366253,
588
+ 371238,
589
+ 376262,
590
+ 381326,
591
+ 386429,
592
+ 391572,
593
+ 396755,
594
+ 401978,
595
+ 407240,
596
+ 412543,
597
+ 417885,
598
+ 423268,
599
+ 428690,
600
+ 434154,
601
+ 439657,
602
+ 445201,
603
+ 450786,
604
+ 456411,
605
+ 462077,
606
+ 467784,
607
+ 473531,
608
+ 479320,
609
+ 485150,
610
+ 491021,
611
+ 496933,
612
+ 502886,
613
+ 508881,
614
+ 514918,
615
+ 520996,
616
+ 527115,
617
+ 533276,
618
+ 539479,
619
+ 545724,
620
+ 552011,
621
+ 558340,
622
+ 564712,
623
+ 571125,
624
+ 577580,
625
+ 584078,
626
+ 590619,
627
+ 597202,
628
+ 603827,
629
+ 610496,
630
+ 617207,
631
+ 623960,
632
+ 630757,
633
+ 637597,
634
+ 644480,
635
+ 651406,
636
+ 658375,
637
+ 665387,
638
+ 672443,
639
+ 679542,
640
+ 686685,
641
+ 693872,
642
+ 701102,
643
+ 708376,
644
+ 715694,
645
+ 723055,
646
+ 730461,
647
+ 737910,
648
+ 745404,
649
+ 752942,
650
+ 760525,
651
+ 768151,
652
+ 775822,
653
+ 783538,
654
+ 791298,
655
+ 799103,
656
+ 806952,
657
+ 814847,
658
+ 822786,
659
+ 830770,
660
+ 838799,
661
+ 846873,
662
+ 854993,
663
+ 863157,
664
+ 871367,
665
+ 879622,
666
+ 887923,
667
+ 896269,
668
+ 904661,
669
+ 913099,
670
+ 921582,
671
+ 930111,
672
+ 938686,
673
+ 947307,
674
+ 955973,
675
+ 964686,
676
+ 973445,
677
+ 982251,
678
+ 991102,
679
+ 1e6
680
+ ];
681
+ var HEX_3 = /^#[0-9a-fA-F]{3}$/;
682
+ var HEX_6 = /^#[0-9a-fA-F]{6}$/;
683
+ var HEX_DIGITS = "0123456789abcdef";
684
+ function parseHexColor(value) {
685
+ if (HEX_6.test(value)) {
686
+ const n = Number.parseInt(value.slice(1), 16);
687
+ return [n >> 16 & 255, n >> 8 & 255, n & 255];
688
+ }
689
+ if (HEX_3.test(value)) {
690
+ const n = Number.parseInt(value.slice(1), 16);
691
+ const r = n >> 8 & 15;
692
+ const g = n >> 4 & 15;
693
+ const b = n & 15;
694
+ return [r * 17, g * 17, b * 17];
695
+ }
696
+ return null;
697
+ }
698
+ function formatHexColor([r, g, b]) {
699
+ const byte = (v) => HEX_DIGITS[v >> 4 & 15] + HEX_DIGITS[v & 15];
700
+ return `#${byte(r)}${byte(g)}${byte(b)}`;
701
+ }
702
+ function relativeLuminance([r, g, b]) {
703
+ const lr = SRGB_TO_LINEAR_1E6[r] / 1e6;
704
+ const lg = SRGB_TO_LINEAR_1E6[g] / 1e6;
705
+ const lb = SRGB_TO_LINEAR_1E6[b] / 1e6;
706
+ return 0.2126 * lr + 0.7152 * lg + 0.0722 * lb;
707
+ }
708
+ function contrastRatio(a, b) {
709
+ const la = relativeLuminance(a);
710
+ const lb = relativeLuminance(b);
711
+ const lighter = la > lb ? la : lb;
712
+ const darker = la > lb ? lb : la;
713
+ return (lighter + 0.05) / (darker + 0.05);
714
+ }
715
+ function mixSrgb(a, b, percent) {
716
+ const mix = (x, y) => Math.round((x * percent + y * (100 - percent)) / 100);
717
+ return [mix(a[0], b[0]), mix(a[1], b[1]), mix(a[2], b[2])];
718
+ }
719
+ var WHITE = [255, 255, 255];
720
+ var BLACK = [0, 0, 0];
721
+ function readableInk(fill) {
722
+ return contrastRatio(BLACK, fill) >= contrastRatio(WHITE, fill) ? BLACK : WHITE;
723
+ }
724
+ function darkenUntilContrast(colour, against, minRatio) {
725
+ for (let percent = 100; percent >= 0; percent -= 1) {
726
+ const candidate = mixSrgb(colour, BLACK, percent);
727
+ if (contrastRatio(candidate, against) >= minRatio) return candidate;
728
+ }
729
+ return BLACK;
730
+ }
731
+
732
+ // src/foundation/theme/brand-theme.ts
733
+ var BRAND_THEME_PROPERTIES = [
734
+ "--ds-color-action-brand-bg",
735
+ "--ds-color-action-brand-bg-hover",
736
+ "--ds-color-action-brand-bg-active",
737
+ "--ds-color-action-brand-bg-disabled",
738
+ "--ds-color-action-brand-subtle-bg",
739
+ "--ds-color-action-brand-subtle-bg-hover",
740
+ "--ds-color-action-brand-subtle-bg-active",
741
+ "--ds-color-action-brand-border",
742
+ "--ds-color-action-brand-ring",
743
+ "--ds-color-action-brand-fg",
744
+ "--ds-color-action-accent-bg",
745
+ "--ds-color-action-accent-bg-strong",
746
+ "--ds-color-action-accent-bg-hover",
747
+ "--ds-color-action-accent-bg-active",
748
+ "--ds-color-action-accent-subtle-bg",
749
+ "--ds-color-action-accent-ring",
750
+ "--ds-color-action-accent-fg",
751
+ "--ds-color-border-focus",
752
+ "--ds-focus-ring-color",
753
+ "--ds-focus-ring-border",
754
+ "--ds-gradient-brand",
755
+ "--ds-compat-color-brand-soft",
756
+ "--ds-compat-color-brand-soft-foreground"
757
+ ];
758
+ var MIN_FILL_CONTRAST = 3;
759
+ var MIN_TEXT_CONTRAST = 4.5;
760
+ var CANVAS = WHITE;
761
+ var RAMP = {
762
+ hover: 88,
763
+ active: 74,
764
+ disabled: 42,
765
+ subtle: 8,
766
+ subtleHover: 13,
767
+ subtleActive: 20,
768
+ border: 45,
769
+ ring: 20,
770
+ /** The soft tint and its ink, which the app-vocabulary bridge reads. */
771
+ soft: 12,
772
+ softInk: 68
773
+ };
774
+ var towardsInk = (colour, percent) => `color-mix(in srgb, ${colour} ${percent}%, var(--ds-color-content))`;
775
+ var towardsTransparent = (colour, percent) => `color-mix(in srgb, ${colour} ${percent}%, transparent)`;
776
+ var ACCEPTED = '#rgb or #rrggbb, for example "#6c42f8"';
777
+ var SEED_KEYS = /* @__PURE__ */ new Set(["brand", "accent"]);
778
+ function describe(value) {
779
+ if (typeof value === "string") return JSON.stringify(value);
780
+ if (value === null) return "null";
781
+ if (Array.isArray(value)) return "an array";
782
+ return typeof value;
783
+ }
784
+ function readColour(key, value) {
785
+ if (typeof value !== "string") {
786
+ throw new TypeError(
787
+ `createBrandTheme: "${key}" must be a hex colour string (${ACCEPTED}), received ${describe(value)}.`
788
+ );
789
+ }
790
+ const rgb = parseHexColor(value);
791
+ if (!rgb) {
792
+ throw new TypeError(
793
+ `createBrandTheme: "${key}" must be a hex colour (${ACCEPTED}), received ${describe(value)}. Named colours, rgb()/hsl() and eight-digit hex with alpha are not accepted \u2014 a brand seed must be opaque and unambiguous.`
794
+ );
795
+ }
796
+ return rgb;
797
+ }
798
+ function validateSeed(seed) {
799
+ if (seed === null || typeof seed !== "object" || Array.isArray(seed)) {
800
+ throw new TypeError(
801
+ `createBrandTheme: expected a seed object with a "brand" colour, received ${describe(seed)}.`
802
+ );
803
+ }
804
+ const unknown = Object.keys(seed).filter((key) => !SEED_KEYS.has(key));
805
+ if (unknown.length) {
806
+ throw new TypeError(
807
+ `createBrandTheme: unknown seed ${unknown.length === 1 ? "key" : "keys"} ${unknown.map((key) => JSON.stringify(key)).join(", ")}. The seed accepts "brand" and an optional "accent" (decision D7).`
808
+ );
809
+ }
810
+ }
811
+ function clampFill(seed) {
812
+ if (contrastRatio(seed, CANVAS) >= MIN_FILL_CONTRAST) return seed;
813
+ return darkenUntilContrast(seed, CANVAS, MIN_FILL_CONTRAST);
814
+ }
815
+ function createBrandTheme(seed) {
816
+ validateSeed(seed);
817
+ const brandSeed = readColour("brand", seed.brand);
818
+ const accentSeed = seed.accent === void 0 || seed.accent === null ? brandSeed : readColour("accent", seed.accent);
819
+ const brand = clampFill(brandSeed);
820
+ const accent = clampFill(accentSeed);
821
+ const brandHex = formatHexColor(brand);
822
+ const accentHex = formatHexColor(accent);
823
+ const soft = mixSrgb(brand, WHITE, RAMP.soft);
824
+ const softInk = darkenUntilContrast(mixSrgb(brand, BLACK, RAMP.softInk), soft, MIN_TEXT_CONTRAST);
825
+ return Object.freeze({
826
+ "--ds-color-action-brand-bg": brandHex,
827
+ "--ds-color-action-brand-bg-hover": towardsInk(brandHex, RAMP.hover),
828
+ "--ds-color-action-brand-bg-active": towardsInk(brandHex, RAMP.active),
829
+ "--ds-color-action-brand-bg-disabled": formatHexColor(mixSrgb(brand, WHITE, RAMP.disabled)),
830
+ "--ds-color-action-brand-subtle-bg": formatHexColor(mixSrgb(brand, WHITE, RAMP.subtle)),
831
+ "--ds-color-action-brand-subtle-bg-hover": formatHexColor(
832
+ mixSrgb(brand, WHITE, RAMP.subtleHover)
833
+ ),
834
+ "--ds-color-action-brand-subtle-bg-active": formatHexColor(
835
+ mixSrgb(brand, WHITE, RAMP.subtleActive)
836
+ ),
837
+ "--ds-color-action-brand-border": formatHexColor(mixSrgb(brand, WHITE, RAMP.border)),
838
+ "--ds-color-action-brand-ring": towardsTransparent(brandHex, RAMP.ring),
839
+ "--ds-color-action-brand-fg": formatHexColor(readableInk(brand)),
840
+ "--ds-color-action-accent-bg": accentHex,
841
+ "--ds-color-action-accent-bg-strong": towardsInk(accentHex, RAMP.active),
842
+ "--ds-color-action-accent-bg-hover": towardsInk(accentHex, RAMP.hover),
843
+ "--ds-color-action-accent-bg-active": towardsInk(accentHex, RAMP.active),
844
+ "--ds-color-action-accent-subtle-bg": formatHexColor(mixSrgb(accent, WHITE, RAMP.subtle)),
845
+ "--ds-color-action-accent-ring": towardsTransparent(accentHex, RAMP.ring),
846
+ "--ds-color-action-accent-fg": formatHexColor(readableInk(accent)),
847
+ "--ds-color-border-focus": accentHex,
848
+ "--ds-focus-ring-color": towardsTransparent(brandHex, RAMP.ring),
849
+ "--ds-focus-ring-border": brandHex,
850
+ "--ds-gradient-brand": `linear-gradient(135deg, ${brandHex}, ${towardsInk(brandHex, RAMP.hover)})`,
851
+ "--ds-compat-color-brand-soft": formatHexColor(soft),
852
+ "--ds-compat-color-brand-soft-foreground": formatHexColor(softInk)
853
+ });
854
+ }
855
+
856
+ export { BRAND_THEME_PROPERTIES, breakpoints, colors, createBrandTheme, iconSizes, layout, motion, overlays, radii, reference, shadows, spacing, surfaces, systemTokens, typography, zIndex };
350
857
  //# sourceMappingURL=index.js.map
351
858
  //# sourceMappingURL=index.js.map