@assure-one/design-system 1.39.0 → 1.40.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 (54) hide show
  1. package/README.md +48 -28
  2. package/codemods/README.md +24 -7
  3. package/codemods/lib/registry.mjs +27 -0
  4. package/codemods/lib/runner.mjs +8 -3
  5. package/codemods/run.mjs +27 -5
  6. package/codemods/transforms/cm-15-dom-selectors.mjs +16 -9
  7. package/dist/brand-scope-BOHId6BY.d.ts +58 -0
  8. package/dist/{brand-theme-B6rem2II.d.ts → brand-theme-ZYM867Jz.d.ts} +1 -1
  9. package/dist/chunk-2MKLYYIY.js +3754 -0
  10. package/dist/chunk-2MKLYYIY.js.map +1 -0
  11. package/dist/chunk-6S2R2VWN.js +5527 -0
  12. package/dist/chunk-6S2R2VWN.js.map +1 -0
  13. package/dist/chunk-7U3ADR2Q.js +4336 -0
  14. package/dist/chunk-7U3ADR2Q.js.map +1 -0
  15. package/dist/chunk-CPOGSNXS.js +389 -0
  16. package/dist/chunk-CPOGSNXS.js.map +1 -0
  17. package/dist/chunk-EUHGZA6Q.js +313 -0
  18. package/dist/chunk-EUHGZA6Q.js.map +1 -0
  19. package/dist/chunk-KQBYTTAN.js +1829 -0
  20. package/dist/chunk-KQBYTTAN.js.map +1 -0
  21. package/dist/chunk-X76J4QSJ.js +164 -0
  22. package/dist/chunk-X76J4QSJ.js.map +1 -0
  23. package/dist/css/components.css +1 -1
  24. package/dist/css/legacy-aliases.css +2 -0
  25. package/dist/css/tailwind.css +2 -0
  26. package/dist/css/tokens.css +2 -0
  27. package/dist/data-table-view-ep8al7P9.d.ts +1132 -0
  28. package/dist/{design-system-provider-BM_F1C13.d.ts → design-system-provider-CfD2g2lY.d.ts} +11 -12
  29. package/dist/icons/index.d.ts +1 -1
  30. package/dist/icons/index.js +2 -1835
  31. package/dist/icons/index.js.map +1 -1
  32. package/dist/index.d.ts +373 -388
  33. package/dist/index.js +8688 -24271
  34. package/dist/index.js.map +1 -1
  35. package/dist/legacy/index.d.ts +1462 -7
  36. package/dist/legacy/index.js +5 -1
  37. package/dist/legacy/index.js.map +1 -1
  38. package/dist/next/index.d.ts +2 -2
  39. package/dist/styles.css +2 -1
  40. package/dist/suite/index.d.ts +989 -4
  41. package/dist/suite/index.js +6 -1
  42. package/dist/suite/index.js.map +1 -1
  43. package/dist/testing/index.cjs +3 -2
  44. package/dist/testing/index.js +3 -2
  45. package/dist/tokens/index.d.ts +1 -1
  46. package/dist/tokens/index.js +3 -856
  47. package/dist/tokens/index.js.map +1 -1
  48. package/dist/{types-k_kjwipx.d.ts → types-Coqw8iaS.d.ts} +28 -1
  49. package/docs/components.md +54 -54
  50. package/docs/components.registry.json +6 -6
  51. package/docs/for-ai-agents.md +12 -6
  52. package/package.json +5 -3
  53. package/dist/index-BAAuIQqP.d.ts +0 -2579
  54. package/dist/index-DxBjmBBp.d.ts +0 -1038
@@ -1,858 +1,5 @@
1
- // src/tokens/reference.ts
2
- var colors = {
3
- /* Surfaces */
4
- bg: "#f7f8fa",
5
- bg2: "#f1f3f8",
6
- bg3: "#e7eaf1",
7
- surface: "#ffffff",
8
- surface2: "#f7f8fc",
9
- /* Foreground */
10
- fg: "#0a0a0a",
11
- fg2: "#38383b",
12
- fg3: "#5f5f64",
13
- fg4: "#6b6b70",
14
- fg5: "#9a9aa0",
15
- /* Rules */
16
- rule: "#e4e7ef",
17
- ruleSoft: "#eef0f5",
18
- ruleStrong: "#d3d8e3",
19
- /* Accent (cyan) */
20
- accent: "#6c42f8",
21
- accent2: "#5127e8",
22
- accentTint: "#efeaff",
23
- accentHover: "#5e35f2",
24
- accentActive: "#5127e8",
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",
34
- /* Disabled */
35
- fgDisabled: "#a7a7ac",
36
- bgDisabled: "#f1f2f6",
37
- /* Status */
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
- /* On-brand */
48
- fgOnAccent: "#ffffff",
49
- fgOnPro: "#ffffff"
50
- };
51
- var typography = {
52
- family: {
53
- display: '"Plus Jakarta Sans", -apple-system, system-ui, sans-serif',
54
- body: '"Plus Jakarta Sans", -apple-system, system-ui, sans-serif',
55
- mono: '"Plus Jakarta Sans", -apple-system, system-ui, sans-serif'
56
- },
57
- weight: {
58
- regular: 400,
59
- medium: 500,
60
- semibold: 600,
61
- bold: 700
62
- },
63
- /* Universal entrance ease — applies to every motion primitive */
64
- ease: "cubic-bezier(0.25, 1, 0.5, 1)"
65
- };
66
- var radii = {
67
- btn: "7px",
68
- input: "7px",
69
- pill: "6px",
70
- card: "12px",
71
- icon: "4px",
72
- full: "9999px"
73
- };
74
- var shadows = {
75
- quiet: "0 1px 1px rgba(16, 20, 36, 0.03), 0 1px 3px rgba(16, 20, 36, 0.05)",
76
- card: "0 1px 2px rgba(16, 20, 36, 0.04), 0 2px 4px -2px rgba(16, 20, 36, 0.04), 0 8px 16px -6px rgba(16, 20, 36, 0.08)",
77
- pop: "0 0 0 1px rgba(16, 20, 36, 0.04), 0 2px 4px -1px rgba(16, 20, 36, 0.05), 0 6px 12px -3px rgba(16, 20, 36, 0.07), 0 16px 32px -8px rgba(16, 20, 36, 0.12)",
78
- focusRing: "0 0 0 2px #ffffff, 0 0 0 4px #6c42f8"
79
- };
80
- var overlays = {
81
- hover: "rgba(16, 20, 36, 0.04)",
82
- active: "rgba(16, 20, 36, 0.07)"
83
- };
84
- var layout = {
85
- shellSidebarWidth: "200px",
86
- shellHeaderHeight: "56px",
87
- contentPad: "32px"
88
- };
89
- var spacing = {
90
- unit: "4px",
91
- 4: "4px",
92
- 8: "8px",
93
- 12: "12px",
94
- 16: "16px",
95
- 20: "20px",
96
- 24: "24px",
97
- 28: "28px",
98
- 32: "32px",
99
- 36: "36px",
100
- 40: "40px",
101
- 64: "64px",
102
- 80: "80px",
103
- 180: "180px"
104
- };
105
- var surfaces = {
106
- bg: "#f7f8fa",
107
- bg2: "#f1f3f8",
108
- surface: "#ffffff",
109
- surface2: "#f7f8fc"
110
- };
111
- var motion = {
112
- ease: {
113
- outQuart: "cubic-bezier(0.25, 1, 0.5, 1)",
114
- out: "cubic-bezier(0.16, 1, 0.3, 1)",
115
- in: "cubic-bezier(0.7, 0, 0.84, 0)",
116
- inOut: "cubic-bezier(0.65, 0, 0.35, 1)"
117
- },
118
- duration: {
119
- instant: "100ms",
120
- fast: "150ms",
121
- normal: "250ms",
122
- slow: "400ms"
123
- }
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
- };
147
- var reference = {
148
- colors,
149
- typography,
150
- radii,
151
- shadows,
152
- overlays,
153
- layout,
154
- motion,
155
- spacing,
156
- surfaces,
157
- iconSizes,
158
- zIndex,
159
- breakpoints
160
- };
161
-
162
- // src/tokens/system.ts
163
- var systemTokens = {
164
- color: {
165
- /* Surfaces */
166
- bg: "var(--color-bg)",
167
- bg2: "var(--color-bg-2)",
168
- bg3: "var(--color-bg-3)",
169
- surface: "var(--color-surface)",
170
- surface2: "var(--color-surface-2)",
171
- /* Foreground */
172
- fg: "var(--color-fg)",
173
- fg2: "var(--color-fg-2)",
174
- fg3: "var(--color-fg-3)",
175
- fg4: "var(--color-fg-4)",
176
- fg5: "var(--color-fg-5)",
177
- /* Rules */
178
- rule: "var(--color-rule)",
179
- ruleSoft: "var(--color-rule-soft)",
180
- ruleStrong: "var(--color-rule-strong)",
181
- /* Accent (purple) */
182
- accent: "var(--color-accent)",
183
- accent2: "var(--color-accent-2)",
184
- accentTint: "var(--color-accent-tint)",
185
- accentHover: "var(--color-accent-hover)",
186
- accentActive: "var(--color-accent-active)",
187
- accentRing: "var(--color-accent-ring)",
188
- /* Stable cross-product CTA; deliberately independent of [data-brand]. */
189
- suiteAction: "var(--color-suite-action)",
190
- suiteActionHover: "var(--color-suite-action-hover)",
191
- suiteActionActive: "var(--color-suite-action-active)",
192
- fgOnSuiteAction: "var(--color-fg-on-suite-action)",
193
- /* Brand — ambient product family; follows the active [data-brand] scope,
194
- defaulting to Pro. Prefer these (and the generated bg-brand / text-brand
195
- / border-brand-line / text-fg-on-brand utilities) for scope-aware chrome
196
- so the product never appears in a class name. */
197
- brand: "var(--color-brand)",
198
- brandHover: "var(--color-brand-hover)",
199
- brandActive: "var(--color-brand-active)",
200
- brandDisabled: "var(--color-brand-disabled)",
201
- brandBg: "var(--color-brand-bg)",
202
- brandBgHover: "var(--color-brand-bg-hover)",
203
- brandBgActive: "var(--color-brand-bg-active)",
204
- brandLine: "var(--color-brand-line)",
205
- brandRing: "var(--color-brand-ring)",
206
- fgOnBrand: "var(--color-fg-on-brand)",
207
- /* Pro (purple) */
208
- proBg: "var(--color-pro-bg)",
209
- proBgHover: "var(--color-pro-bg-hover)",
210
- proBgActive: "var(--color-pro-bg-active)",
211
- proFg: "var(--color-pro-fg)",
212
- proHover: "var(--color-pro-hover)",
213
- proActive: "var(--color-pro-active)",
214
- proDisabled: "var(--color-pro-disabled)",
215
- proLine: "var(--color-pro-line)",
216
- proRing: "var(--color-pro-ring)",
217
- auditFg: "var(--color-audit-fg)",
218
- auditHover: "var(--color-audit-hover)",
219
- auditActive: "var(--color-audit-active)",
220
- auditDisabled: "var(--color-audit-disabled)",
221
- auditBg: "var(--color-audit-bg)",
222
- auditBgHover: "var(--color-audit-bg-hover)",
223
- auditBgActive: "var(--color-audit-bg-active)",
224
- auditLine: "var(--color-audit-line)",
225
- auditRing: "var(--color-audit-ring)",
226
- booksFg: "var(--color-books-fg)",
227
- booksHover: "var(--color-books-hover)",
228
- booksActive: "var(--color-books-active)",
229
- booksDisabled: "var(--color-books-disabled)",
230
- booksBg: "var(--color-books-bg)",
231
- booksBgHover: "var(--color-books-bg-hover)",
232
- booksBgActive: "var(--color-books-bg-active)",
233
- booksLine: "var(--color-books-line)",
234
- booksRing: "var(--color-books-ring)",
235
- taxFg: "var(--color-tax-fg)",
236
- taxHover: "var(--color-tax-hover)",
237
- taxActive: "var(--color-tax-active)",
238
- taxDisabled: "var(--color-tax-disabled)",
239
- taxBg: "var(--color-tax-bg)",
240
- taxBgHover: "var(--color-tax-bg-hover)",
241
- taxBgActive: "var(--color-tax-bg-active)",
242
- taxLine: "var(--color-tax-line)",
243
- taxRing: "var(--color-tax-ring)",
244
- /* On-brand — text/icon color on a filled brand/product surface */
245
- fgOnAccent: "var(--color-fg-on-accent)",
246
- fgOnPro: "var(--color-fg-on-pro)",
247
- fgOnAudit: "var(--color-fg-on-audit)",
248
- fgOnBooks: "var(--color-fg-on-books)",
249
- fgOnTax: "var(--color-fg-on-tax)",
250
- /* Disabled */
251
- fgDisabled: "var(--color-fg-disabled)",
252
- bgDisabled: "var(--color-bg-disabled)",
253
- /* Overlays */
254
- overlayHover: "var(--color-overlay-hover)",
255
- overlayActive: "var(--color-overlay-active)",
256
- /* Status */
257
- successFg: "var(--color-success-fg)",
258
- successBg: "var(--color-success-bg)",
259
- successLine: "var(--color-success-line)",
260
- warningFg: "var(--color-warning-fg)",
261
- warningBg: "var(--color-warning-bg)",
262
- warningLine: "var(--color-warning-line)",
263
- dangerFg: "var(--color-danger-fg)",
264
- dangerBg: "var(--color-danger-bg)",
265
- dangerLine: "var(--color-danger-line)",
266
- /* Data-viz — chart series ramp + area gradient stops */
267
- chart1: "var(--color-chart-1)",
268
- chart2: "var(--color-chart-2)",
269
- chart3: "var(--color-chart-3)",
270
- chart4: "var(--color-chart-4)",
271
- chartLine: "var(--color-chart-line)",
272
- chartAreaFrom: "var(--color-chart-area-from)",
273
- chartAreaTo: "var(--color-chart-area-to)",
274
- /* Practice service tones — fill + track tint */
275
- serviceTax: "var(--color-service-tax)",
276
- serviceTaxBg: "var(--color-service-tax-bg)",
277
- serviceAudit: "var(--color-service-audit)",
278
- serviceAuditBg: "var(--color-service-audit-bg)",
279
- serviceAccounting: "var(--color-service-accounting)",
280
- serviceAccountingBg: "var(--color-service-accounting-bg)"
281
- },
282
- /** Ordered chart series ramp — index a series by position, cycle with `% 4`. */
283
- chart: [
284
- "var(--color-chart-1)",
285
- "var(--color-chart-2)",
286
- "var(--color-chart-3)",
287
- "var(--color-chart-4)"
288
- ],
289
- gradient: {
290
- brand: "var(--gradient-brand)",
291
- pro: "var(--gradient-pro)",
292
- audit: "var(--gradient-audit)",
293
- books: "var(--gradient-books)",
294
- tax: "var(--gradient-tax)"
295
- },
296
- shadow: {
297
- quiet: "var(--shadow-quiet)",
298
- card: "var(--shadow-card)",
299
- pop: "var(--shadow-pop)",
300
- focusRing: "var(--shadow-focus-ring)",
301
- xs: "var(--shadow-xs)",
302
- sm: "var(--shadow-sm)",
303
- md: "var(--shadow-md)",
304
- lg: "var(--shadow-lg)",
305
- xl: "var(--shadow-xl)",
306
- "2xl": "var(--shadow-2xl)"
307
- },
308
- radius: {
309
- btn: "var(--radius-btn)",
310
- input: "var(--radius-input)",
311
- pill: "var(--radius-pill)",
312
- card: "var(--radius-card)",
313
- icon: "var(--radius-icon)",
314
- full: "var(--radius-full)"
315
- },
316
- type: {
317
- family: {
318
- display: "var(--font-display)",
319
- body: "var(--font-body)",
320
- mono: "var(--font-mono)"
321
- },
322
- weight: {
323
- regular: "var(--font-weight-regular)",
324
- medium: "var(--font-weight-medium)",
325
- semibold: "var(--font-weight-semibold)",
326
- bold: "var(--font-weight-bold)"
327
- }
328
- },
329
- motion: {
330
- ease: {
331
- outQuart: "var(--ease-out-quart)",
332
- out: "var(--ease-out)",
333
- in: "var(--ease-in)",
334
- inOut: "var(--ease-in-out)"
335
- },
336
- duration: {
337
- instant: "var(--duration-instant)",
338
- fast: "var(--duration-fast)",
339
- normal: "var(--duration-normal)",
340
- slow: "var(--duration-slow)"
341
- },
342
- semantic: {
343
- duration: {
344
- press: "var(--motion-duration-press)",
345
- feedback: "var(--motion-duration-feedback)",
346
- overlay: "var(--motion-duration-overlay)",
347
- spatial: "var(--motion-duration-spatial)",
348
- deliberate: "var(--motion-duration-deliberate)"
349
- },
350
- ease: {
351
- enter: "var(--motion-ease-enter)",
352
- exit: "var(--motion-ease-exit)",
353
- move: "var(--motion-ease-move)"
354
- }
355
- }
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
- },
405
- layout: {
406
- shellSidebarWidth: "var(--shell-sidebar-w)",
407
- shellSidebarRailWidth: "var(--shell-sidebar-w-rail)",
408
- shellHeaderHeight: "var(--shell-header-h)",
409
- contentPad: "var(--content-pad)"
410
- },
411
- z: {
412
- base: "var(--z-base)",
413
- dropdown: "var(--z-dropdown)",
414
- sticky: "var(--z-sticky)",
415
- overlay: "var(--z-overlay)",
416
- modal: "var(--z-modal)",
417
- toast: "var(--z-toast)",
418
- tooltip: "var(--z-tooltip)"
419
- }
420
- };
421
-
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 };
1
+ export { BRAND_THEME_PROPERTIES, createBrandTheme, systemTokens } from '../chunk-CPOGSNXS.js';
2
+ import '../chunk-EUHGZA6Q.js';
3
+ export { breakpoints, colors, iconSizes, layout, motion, overlays, radii, reference, shadows, spacing, surfaces, typography, zIndex } from '../chunk-X76J4QSJ.js';
857
4
  //# sourceMappingURL=index.js.map
858
5
  //# sourceMappingURL=index.js.map