@platned/ui 0.10.4 → 1.1.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 (63) hide show
  1. package/README.md +66 -99
  2. package/dist/blocks-charts.cjs +460 -0
  3. package/dist/blocks-charts.cjs.map +1 -0
  4. package/dist/blocks-charts.d.cts +64 -0
  5. package/dist/blocks-charts.d.ts +64 -0
  6. package/dist/blocks-charts.js +442 -0
  7. package/dist/blocks-charts.js.map +1 -0
  8. package/dist/blocks.cjs +8099 -0
  9. package/dist/blocks.cjs.map +1 -0
  10. package/dist/blocks.d.cts +3136 -0
  11. package/dist/blocks.d.ts +3136 -0
  12. package/dist/blocks.js +8330 -0
  13. package/dist/blocks.js.map +1 -0
  14. package/dist/chart.cjs +227 -0
  15. package/dist/chart.cjs.map +1 -0
  16. package/dist/chart.d.ts +66 -0
  17. package/dist/chart.js +184 -0
  18. package/dist/chart.js.map +1 -0
  19. package/dist/chunk-6BJ3OMUZ.js +3177 -0
  20. package/dist/chunk-6BJ3OMUZ.js.map +1 -0
  21. package/dist/chunk-7RXFHQL5.js +201 -0
  22. package/dist/chunk-7RXFHQL5.js.map +1 -0
  23. package/dist/chunk-MJC4A7I4.js +13 -0
  24. package/dist/chunk-MJC4A7I4.js.map +1 -0
  25. package/dist/chunk-QYFD7KIK.js +179 -0
  26. package/dist/chunk-QYFD7KIK.js.map +1 -0
  27. package/dist/code-block-BgEiLXpO.d.ts +111 -0
  28. package/dist/code-block-highlight.cjs +490 -0
  29. package/dist/code-block-highlight.cjs.map +1 -0
  30. package/dist/code-block-highlight.d.ts +28 -0
  31. package/dist/code-block-highlight.js +121 -0
  32. package/dist/code-block-highlight.js.map +1 -0
  33. package/dist/data-table-Dec6t8NO.d.ts +729 -0
  34. package/dist/data-table.cjs +3507 -2219
  35. package/dist/data-table.cjs.map +1 -1
  36. package/dist/data-table.d.ts +2 -1
  37. package/dist/data-table.js +1397 -246
  38. package/dist/data-table.js.map +1 -1
  39. package/dist/index.cjs +13232 -12876
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.ts +2748 -5343
  42. package/dist/index.js +8273 -9760
  43. package/dist/index.js.map +1 -1
  44. package/dist/map.cjs +433 -0
  45. package/dist/map.cjs.map +1 -0
  46. package/dist/map.d.cts +294 -0
  47. package/dist/map.d.ts +294 -0
  48. package/dist/map.js +428 -0
  49. package/dist/map.js.map +1 -0
  50. package/dist/theme.css +1897 -0
  51. package/package.json +60 -24
  52. package/dist/chunk-OVIRTNT4.js +0 -2787
  53. package/dist/chunk-OVIRTNT4.js.map +0 -1
  54. package/dist/data-table-JX-vnL0F.d.ts +0 -464
  55. package/dist/sidebar.cjs +0 -108
  56. package/dist/sidebar.cjs.map +0 -1
  57. package/dist/sidebar.d.cts +0 -257
  58. package/dist/sidebar.d.ts +0 -257
  59. package/dist/sidebar.js +0 -70
  60. package/dist/sidebar.js.map +0 -1
  61. package/dist/styles.css +0 -1
  62. package/dist/tokens.css +0 -1
  63. package/tailwind-preset.cjs +0 -446
@@ -1,446 +0,0 @@
1
- /** @type {import('tailwindcss').Config} */
2
- module.exports = {
3
- theme: {
4
- extend: {
5
- backgroundColor: {
6
- // ── Brand ────────────────────────────────────────────────────────────
7
- 'brand': 'var(--color-background-brand-default)',
8
- 'brand-hover': 'var(--color-background-brand-hover)',
9
- 'brand-secondary': 'var(--color-background-brand-secondary)',
10
- 'brand-secondary-hover': 'var(--color-background-brand-secondary-hover)',
11
- 'brand-tertiary': 'var(--color-background-brand-tertiary)',
12
- 'brand-tertiary-hover': 'var(--color-background-brand-tertiary-hover)',
13
- // ── Default / Neutral ─────────────────────────────────────────────────
14
- 'default': 'var(--color-background-default-default)',
15
- 'default-hover': 'var(--color-background-default-default-hover)',
16
- 'default-secondary': 'var(--color-background-default-secondary)',
17
- 'default-secondary-hover': 'var(--color-background-default-secondary-hover)',
18
- 'default-tertiary': 'var(--color-background-default-tertiary)',
19
- // `neutral` was missing through 0.4.0 while `text-neutral` existed, so
20
- // `StatusDot tone="neutral"` and `ProgressBar tone="neutral"` referenced an
21
- // undefined class, emitted no CSS, and rendered as invisible elements.
22
- 'neutral': 'var(--color-background-neutral-default)',
23
- 'neutral-hover': 'var(--color-background-neutral-hover)',
24
- 'neutral-secondary': 'var(--color-background-neutral-secondary)',
25
- 'neutral-tertiary': 'var(--color-background-neutral-tertiary)',
26
- 'neutral-tertiary-hover': 'var(--color-background-neutral-tertiary-hover)',
27
- // ── Danger ───────────────────────────────────────────────────────────
28
- 'danger': 'var(--color-background-danger-default)',
29
- 'danger-hover': 'var(--color-background-danger-hover)',
30
- 'danger-secondary': 'var(--color-background-danger-secondary)',
31
- 'danger-tertiary': 'var(--color-background-danger-tertiary)',
32
- 'danger-tertiary-hover': 'var(--color-background-danger-tertiary-hover)',
33
- // ── Positive / Warning ────────────────────────────────────────────────
34
- 'positive': 'var(--color-background-positive-default)',
35
- 'positive-tertiary': 'var(--color-background-positive-tertiary)',
36
- 'warning': 'var(--color-background-warning-default)',
37
- 'warning-tertiary': 'var(--color-background-warning-tertiary)',
38
- // ── Disabled ──────────────────────────────────────────────────────────
39
- 'disabled': 'var(--color-background-disabled-default)',
40
- // ── Overlay utilities (scrims behind modals / drawers) ─────────────────
41
- 'scrim': 'var(--color-background-utilities-scrim)',
42
- 'blanket': 'var(--color-background-utilities-blanket)',
43
- 'overlay': 'var(--color-background-utilities-overlay)',
44
- // Hairline dividers drawn as a filled element rather than a border
45
- 'divider': 'var(--color-border-default-default)',
46
- // ── Status tones ──────────────────────────────────────────────────────
47
- 'status-neutral': 'var(--status-neutral-bg)',
48
- 'status-info': 'var(--status-info-bg)',
49
- 'status-warning': 'var(--status-warning-bg)',
50
- 'status-caution': 'var(--status-caution-bg)',
51
- 'status-accent': 'var(--status-accent-bg)',
52
- 'status-violet': 'var(--status-violet-bg)',
53
- 'status-positive': 'var(--status-positive-bg)',
54
- 'status-danger': 'var(--status-danger-bg)',
55
- // ── Status tone leading dots ───────────────────────────────────────────
56
- 'status-dot-neutral': 'var(--status-neutral-dot)',
57
- 'status-dot-info': 'var(--status-info-dot)',
58
- 'status-dot-warning': 'var(--status-warning-dot)',
59
- 'status-dot-caution': 'var(--status-caution-dot)',
60
- 'status-dot-accent': 'var(--status-accent-dot)',
61
- 'status-dot-violet': 'var(--status-violet-dot)',
62
- 'status-dot-positive': 'var(--status-positive-dot)',
63
- 'status-dot-danger': 'var(--status-danger-dot)',
64
- // ── Compliance check indicator ─────────────────────────────────────────
65
- 'status-check-passed': 'var(--status-check-passed-bg)',
66
- 'status-check-progress': 'var(--status-check-progress-bg)',
67
- 'status-check-failed': 'var(--status-check-failed-bg)',
68
- 'status-check-pending': 'var(--status-check-pending-bg)',
69
- // ── Badge ─────────────────────────────────────────────────────────────
70
- 'badge-gray': 'var(--badge-gray-bg)',
71
- 'badge-red': 'var(--badge-red-bg)',
72
- 'badge-yellow': 'var(--badge-yellow-bg)',
73
- 'badge-lime': 'var(--badge-lime-bg)',
74
- 'badge-green': 'var(--badge-green-bg)',
75
- 'badge-teal': 'var(--badge-teal-bg)',
76
- 'badge-blue': 'var(--badge-blue-bg)',
77
- 'badge-pink': 'var(--badge-pink-bg)',
78
- 'badge-slate': 'var(--badge-slate-bg)',
79
- 'badge-violet': 'var(--badge-violet-bg)',
80
- },
81
-
82
- borderColor: {
83
- // ── Badge (subtle variant uses the badge bg color as its border) ──────
84
- 'badge-gray': 'var(--color-border-default-default)',
85
- 'badge-red': 'var(--badge-red-bg)',
86
- 'badge-yellow': 'var(--badge-yellow-bg)',
87
- 'badge-lime': 'var(--badge-lime-bg)',
88
- 'badge-green': 'var(--badge-green-bg)',
89
- 'badge-teal': 'var(--badge-teal-bg)',
90
- 'badge-blue': 'var(--badge-blue-bg)',
91
- 'badge-pink': 'var(--badge-pink-bg)',
92
- 'badge-slate': 'var(--badge-slate-bg)',
93
- 'badge-violet': 'var(--badge-violet-bg)',
94
- 'default': 'var(--color-border-default-default)',
95
- 'default-secondary': 'var(--color-border-default-secondary)',
96
- 'brand': 'var(--color-border-brand-default)',
97
- 'brand-secondary': 'var(--color-border-brand-secondary)',
98
- 'brand-tertiary': 'var(--color-border-brand-tertiary)',
99
- // The brand *fill* colour, one step darker than border-brand. For edges that
100
- // must match a bg-brand surface exactly (checked checkbox, active tab rule) —
101
- // border-brand would leave a visibly lighter 1px halo against the fill.
102
- 'brand-emphasis': 'var(--color-background-brand-default)',
103
- 'danger': 'var(--color-border-danger-default)',
104
- 'danger-secondary': 'var(--color-border-danger-secondary)',
105
- 'danger-tertiary': 'var(--color-border-danger-tertiary)',
106
- 'positive-tertiary': 'var(--color-border-positive-tertiary)',
107
- 'warning-tertiary': 'var(--color-border-warning-tertiary)',
108
- 'disabled': 'var(--color-border-disabled-default)',
109
- // ── Compliance check indicator rings ───────────────────────────────────
110
- 'status-check-passed': 'var(--status-check-passed-ring)',
111
- 'status-check-progress': 'var(--status-check-progress-ring)',
112
- 'status-check-failed': 'var(--status-check-failed-ring)',
113
- 'status-check-pending': 'var(--status-check-pending-ring)',
114
- },
115
-
116
- // divideColor is its own Tailwind namespace — extending borderColor does NOT
117
- // populate it, so `divide-default` emitted no CSS and every divided list had to
118
- // escape to `divide-[color:var(--color-border-default-default)]`.
119
- divideColor: {
120
- 'default': 'var(--color-border-default-default)',
121
- 'default-secondary': 'var(--color-border-default-secondary)',
122
- 'brand-tertiary': 'var(--color-border-brand-tertiary)',
123
- 'danger-tertiary': 'var(--color-border-danger-tertiary)',
124
- },
125
-
126
- // ringColor mirrors borderColor — focus rings use the same border token values
127
- ringColor: {
128
- 'default': 'var(--color-border-default-default)',
129
- 'default-secondary': 'var(--color-border-default-secondary)',
130
- 'brand': 'var(--color-border-brand-default)',
131
- 'brand-secondary': 'var(--color-border-brand-secondary)',
132
- 'brand-tertiary': 'var(--color-border-brand-tertiary)',
133
- 'danger': 'var(--color-border-danger-default)',
134
- 'danger-secondary': 'var(--color-border-danger-secondary)',
135
- 'danger-tertiary': 'var(--color-border-danger-tertiary)',
136
- 'disabled': 'var(--color-border-disabled-default)',
137
- },
138
-
139
- // outlineColor is its own Tailwind namespace — it does NOT read borderColor or
140
- // ringColor. Table rows need it because `ring-*` compiles to box-shadow, which
141
- // browsers do not paint on a <tr> under `border-collapse: collapse`.
142
- outlineColor: {
143
- 'default': 'var(--color-border-default-default)',
144
- 'brand': 'var(--color-border-brand-default)',
145
- 'danger': 'var(--color-border-danger-default)',
146
- },
147
-
148
- textColor: {
149
- 'default': 'var(--color-text-default-default)',
150
- 'default-secondary': 'var(--color-text-default-secondary)',
151
- 'default-tertiary': 'var(--color-text-default-tertiary)',
152
- 'brand': 'var(--color-text-brand-default)',
153
- 'brand-on-brand': 'var(--color-text-brand-on-brand)',
154
- // Matches a bg-brand fill — see border-brand-emphasis for the rationale.
155
- 'brand-emphasis': 'var(--color-background-brand-default)',
156
- // TextLink's hover. Missing until 0.7.0, so the hover generated no colour change.
157
- 'brand-secondary': 'var(--color-text-brand-secondary)',
158
- 'neutral': 'var(--color-text-neutral-default)',
159
- // The neutral ramp's quieter steps, for the sidebar's group headings. Note
160
- // `text-default-tertiary` is #B3B3B3 — 1.9:1 on the #F5F5F5 rail, a WCAG failure at
161
- // any size. These are #5A5A5A / 6.3:1 and #767676 / 4.2:1.
162
- 'neutral-secondary': 'var(--color-text-neutral-secondary)',
163
- 'neutral-tertiary': 'var(--color-text-neutral-tertiary)',
164
- // Text on a `bg-neutral` fill (Tooltip, the user's chat bubble). Missing until 0.7.0:
165
- // Tooltip used `text-neutral-on-neutral` from 0.4.0, the class generated no CSS, and its
166
- // text inherited the page colour on the near-black panel.
167
- 'neutral-on-neutral': 'var(--color-text-neutral-on-neutral)',
168
- 'positive': 'var(--color-text-positive-default)',
169
- 'warning': 'var(--color-text-warning-default)',
170
- 'danger': 'var(--color-text-danger-default)',
171
- 'danger-on-danger': 'var(--color-text-danger-on-danger)',
172
- 'disabled': 'var(--color-text-disabled-default)',
173
- 'disabled-on-disabled': 'var(--color-text-disabled-on-disabled)',
174
- // ── Icon (SVG currentColor) ───────────────────────────────────────────
175
- 'icon-default': 'var(--color-icon-default-default)',
176
- 'icon-default-secondary': 'var(--color-icon-default-secondary)',
177
- // Breadcrumb separators. Missing until 0.7.0, so they inherited the text colour.
178
- 'icon-default-tertiary': 'var(--color-icon-default-tertiary)',
179
- 'icon-brand': 'var(--color-icon-brand-default)',
180
- 'icon-brand-on-brand': 'var(--color-icon-brand-on-brand)',
181
- 'icon-disabled': 'var(--color-icon-disabled-default)',
182
- 'icon-danger': 'var(--color-icon-danger-default)',
183
- 'icon-positive': 'var(--color-icon-positive-default)',
184
- 'icon-neutral': 'var(--color-icon-neutral-default)',
185
- 'icon-warning': 'var(--color-icon-warning-default)',
186
- // ── Status tones ──────────────────────────────────────────────────────
187
- 'status-neutral': 'var(--status-neutral-text)',
188
- 'status-info': 'var(--status-info-text)',
189
- 'status-warning': 'var(--status-warning-text)',
190
- 'status-caution': 'var(--status-caution-text)',
191
- 'status-accent': 'var(--status-accent-text)',
192
- 'status-violet': 'var(--status-violet-text)',
193
- 'status-positive': 'var(--status-positive-text)',
194
- 'status-danger': 'var(--status-danger-text)',
195
- // ── Compliance check indicator (glyph shares the ring colour) ──────────
196
- 'status-check-passed': 'var(--status-check-passed-ring)',
197
- 'status-check-progress': 'var(--status-check-progress-ring)',
198
- 'status-check-failed': 'var(--status-check-failed-ring)',
199
- 'status-check-pending': 'var(--status-check-pending-ring)',
200
- // ── Badge ─────────────────────────────────────────────────────────────
201
- 'badge-gray': 'var(--badge-gray-text)',
202
- 'badge-red': 'var(--badge-red-text)',
203
- 'badge-yellow': 'var(--badge-yellow-text)',
204
- 'badge-lime': 'var(--badge-lime-text)',
205
- 'badge-green': 'var(--badge-green-text)',
206
- 'badge-teal': 'var(--badge-teal-text)',
207
- 'badge-blue': 'var(--badge-blue-text)',
208
- 'badge-pink': 'var(--badge-pink-text)',
209
- 'badge-slate': 'var(--badge-slate-text)',
210
- 'badge-violet': 'var(--badge-violet-text)',
211
- },
212
-
213
- fontSize: {
214
- // ── Body ─────────────────────────────────────────────────────────────
215
- // Below `--typo-scale-01` (11px), which is the smallest step the Figma type scale
216
- // defines. For uppercase labels that need to sit well under the content they label —
217
- // the sidebar's group headings — and for nothing that has to be read as prose.
218
- 'body-micro': ['8px', { lineHeight: '1.4' }],
219
- 'body-tiny': ['11px', { lineHeight: '1.4' }],
220
- 'body-xs': ['13px', { lineHeight: '1.4' }],
221
- 'body-sm': ['14px', { lineHeight: '1.4' }],
222
- 'body': ['16px', { lineHeight: '1.4' }],
223
- 'body-lg': ['20px', { lineHeight: '1.4' }],
224
- // ── Heading ──────────────────────────────────────────────────────────
225
- 'heading-sm': ['20px', { lineHeight: '1.3' }],
226
- 'heading': ['24px', { lineHeight: '1.3' }],
227
- 'heading-lg': ['32px', { lineHeight: '1.3' }],
228
- // ── Subheading ───────────────────────────────────────────────────────
229
- 'subheading-sm': ['16px', { lineHeight: '1.4' }],
230
- 'subheading': ['20px', { lineHeight: '1.4' }],
231
- 'subheading-lg': ['24px', { lineHeight: '1.4' }],
232
- // ── Subtitle ─────────────────────────────────────────────────────────
233
- 'subtitle-sm': ['24px', { lineHeight: '1.2' }],
234
- 'subtitle': ['32px', { lineHeight: '1.2' }],
235
- 'subtitle-lg': ['40px', { lineHeight: '1.2' }],
236
- // ── Title ────────────────────────────────────────────────────────────
237
- 'title-sm': ['40px', { lineHeight: '1.2' }],
238
- 'title': ['48px', { lineHeight: '1.2' }],
239
- 'title-lg': ['64px', { lineHeight: '1.2' }],
240
- 'title-hero': ['72px', { lineHeight: '1.2' }],
241
-
242
- // ── Raw scale ────────────────────────────────────────────────────────
243
- // The unopinionated size ramp, matching Figma's `Typography Primitives`
244
- // (`Scale 02`…`Scale 12`) and `--typo-scale-*` in styles/tokens/typography.css.
245
- // These carry no line-height, so `leading-*` stays the caller's decision.
246
- //
247
- // Their absence was a real bug, not a gap: `StatNumber` referenced
248
- // `text-scale-07/08/09` at every size and the preset defined none of them, so an
249
- // undefined class emitted no CSS and the component shipped with no font-size at
250
- // all. Same for `RiskScore size="2xl"` and `WidgetTitle size="lg"` (0.3.0
251
- // CHANGELOG). Prefer the semantic names above; use these when a one-off needs a
252
- // step off the semantic ladder.
253
- 'scale-01': 'var(--typo-scale-01)', // 11px
254
- 'scale-02': 'var(--typo-scale-02)', // 13px
255
- 'scale-03': 'var(--typo-scale-03)', // 14px
256
- 'scale-04': 'var(--typo-scale-04)', // 16px
257
- 'scale-05': 'var(--typo-scale-05)', // 20px
258
- 'scale-06': 'var(--typo-scale-06)', // 24px
259
- 'scale-07': 'var(--typo-scale-07)', // 32px
260
- 'scale-08': 'var(--typo-scale-08)', // 40px
261
- 'scale-09': 'var(--typo-scale-09)', // 48px
262
- 'scale-10': 'var(--typo-scale-10)', // 64px
263
- 'scale-12': 'var(--typo-scale-12)', // 72px
264
- },
265
- fontWeight: {
266
- regular: '400',
267
- },
268
- // Brand directional gradients — bg-gradient-brand-{direction}
269
- backgroundImage: {
270
- 'gradient-brand-n-s': 'var(--gradient-brand-n-s)',
271
- 'gradient-brand-ne-sw': 'var(--gradient-brand-ne-sw)',
272
- 'gradient-brand-e-w': 'var(--gradient-brand-e-w)',
273
- 'gradient-brand-se-nw': 'var(--gradient-brand-se-nw)',
274
- 'gradient-brand-s-n': 'var(--gradient-brand-s-n)',
275
- 'gradient-brand-sw-ne': 'var(--gradient-brand-sw-ne)',
276
- 'gradient-brand-w-e': 'var(--gradient-brand-w-e)',
277
- 'gradient-brand-nw-se': 'var(--gradient-brand-nw-se)',
278
- },
279
-
280
- // gradientColorStops mirrors backgroundColor — from-*/to-*/via-* utilities use `colors`, not backgroundColor
281
- gradientColorStops: {
282
- 'brand': 'var(--color-background-brand-default)',
283
- 'brand-hover': 'var(--color-background-brand-hover)',
284
- 'brand-secondary': 'var(--color-background-brand-secondary)',
285
- 'brand-tertiary': 'var(--color-background-brand-tertiary)',
286
- 'brand-tertiary-hover': 'var(--color-background-brand-tertiary-hover)',
287
- 'default': 'var(--color-background-default-default)',
288
- 'default-hover': 'var(--color-background-default-default-hover)',
289
- 'default-secondary': 'var(--color-background-default-secondary)',
290
- 'default-tertiary': 'var(--color-background-default-tertiary)',
291
- 'danger': 'var(--color-background-danger-default)',
292
- 'danger-secondary': 'var(--color-background-danger-secondary)',
293
- 'danger-tertiary': 'var(--color-background-danger-tertiary)',
294
- 'positive-tertiary': 'var(--color-background-positive-tertiary)',
295
- 'warning-tertiary': 'var(--color-background-warning-tertiary)',
296
- },
297
- // The elevation ramp from styles/tokens/effects.css, which matches the 15 effect
298
- // styles in Figma one-for-one. Until 0.4.0 only `panel` was exposed here, so the
299
- // twelve shadow tokens were unreachable and components reached for stock Tailwind
300
- // (`shadow-lg`/`xl`/`2xl`) instead — untokenised, and invisible to a theme change.
301
- boxShadow: {
302
- panel: '0 2px 16px 0 var(--prim-black-200)',
303
- 100: 'var(--effect-shadow-100)',
304
- 200: 'var(--effect-shadow-200)',
305
- 300: 'var(--effect-shadow-300)',
306
- 400: 'var(--effect-shadow-400)',
307
- 500: 'var(--effect-shadow-500)',
308
- 600: 'var(--effect-shadow-600)',
309
- 'inner-100': 'var(--effect-inner-shadow-100)',
310
- 'inner-200': 'var(--effect-inner-shadow-200)',
311
- 'inner-300': 'var(--effect-inner-shadow-300)',
312
- 'inner-400': 'var(--effect-inner-shadow-400)',
313
- 'inner-500': 'var(--effect-inner-shadow-500)',
314
- 'inner-600': 'var(--effect-inner-shadow-600)',
315
- },
316
-
317
- // `ring-offset-*` reads this namespace, and nothing else does. Without it the
318
- // offset falls back to Tailwind's `#fff`, so the six components using
319
- // `ring-offset-1` drew a white halo on every non-white surface — the sidebar, a
320
- // toned Card, a secondary-background filter bar.
321
- ringOffsetColor: {
322
- 'default': 'var(--color-background-default-default)',
323
- 'default-secondary': 'var(--color-background-default-secondary)',
324
- 'default-tertiary': 'var(--color-background-default-tertiary)',
325
- 'brand': 'var(--color-background-brand-default)',
326
- 'danger': 'var(--color-background-danger-default)',
327
- },
328
-
329
- // The Figma spacing scale, as utilities (`gap-400`, `p-600`, `-mt-200`). New in 0.7.0;
330
- // before it the `--size-space-*` tokens existed but no class reached them, so every
331
- // component spelled spacing in Tailwind's default steps or in arbitrary pixels. The keys
332
- // start at 100 and cannot collide with Tailwind's own (0–96), so `p-4` still means 16px.
333
- spacing: {
334
- '100': 'var(--size-space-100)',
335
- '200': 'var(--size-space-200)',
336
- '300': 'var(--size-space-300)',
337
- '400': 'var(--size-space-400)',
338
- '500': 'var(--size-space-500)',
339
- '600': 'var(--size-space-600)',
340
- '700': 'var(--size-space-700)',
341
- '800': 'var(--size-space-800)',
342
- '1000': 'var(--size-space-1000)',
343
- '1200': 'var(--size-space-1200)',
344
- '1600': 'var(--size-space-1600)',
345
- '2400': 'var(--size-space-2400)',
346
- '4000': 'var(--size-space-4000)',
347
- },
348
-
349
- // The Figma radius scale (`rounded-200` = 8px). The tokens also define `xl` (24px) and
350
- // `full`, but those names are taken: Tailwind's `rounded-xl` is 12px and is used across the
351
- // library, so overriding it would silently enlarge every card and table. Use
352
- // `rounded-[var(--size-radius-xl)]` for the 24px step; `rounded-full` is already 9999px.
353
- borderRadius: {
354
- '100': 'var(--size-radius-100)',
355
- '200': 'var(--size-radius-200)',
356
- '300': 'var(--size-radius-300)',
357
- '400': 'var(--size-radius-400)',
358
- },
359
-
360
- // Breakpoints, pinned explicitly so they are part of the documented contract rather than
361
- // whatever Tailwind's defaults happen to be. These are Tailwind's values. Prefer container
362
- // width over viewport width where a component has to switch structure: see
363
- // `useElementWidth` and DataTable's card mode.
364
- screens: {
365
- sm: '640px',
366
- md: '768px',
367
- lg: '1024px',
368
- xl: '1280px',
369
- '2xl': '1536px',
370
- },
371
-
372
- // Named layers, so a consumer's own z-index cannot land between a Modal and its
373
- // close button. Overlays previously used bare z-50/z-20/z-10 with no scale.
374
- // Motion tokens (styles/tokens/motion.css), new in 0.9.4.
375
- transitionDuration: {
376
- fast: 'var(--motion-duration-fast)',
377
- base: 'var(--motion-duration-base)',
378
- slow: 'var(--motion-duration-slow)',
379
- },
380
- transitionTimingFunction: {
381
- standard: 'var(--motion-ease-standard)',
382
- enter: 'var(--motion-ease-enter)',
383
- exit: 'var(--motion-ease-exit)',
384
- },
385
- zIndex: {
386
- base: '0',
387
- raised: '10',
388
- sticky: '20',
389
- dropdown: '30',
390
- overlay: '40',
391
- modal: '50',
392
- popover: '60',
393
- tooltip: '70',
394
- toast: '80',
395
- },
396
- },
397
- },
398
- plugins: [
399
- // Reduced motion. Until 0.9.4 this was a blanket base rule that cut every animation and
400
- // transition on the page to 0.01ms under `prefers-reduced-motion`, including the app's own.
401
- // It froze spinners mid-turn and stopped colour fades WCAG 2.3.3 has no quarrel with, and an
402
- // app could not opt a single element back in. Components now gate their own movement
403
- // (`motion-reduce:transition-none`, `motion-safe:animate-*`), and the old behaviour is an
404
- // opt-in class for an app that wants it: `<html class="motion-reduce-all">`.
405
- function reducedMotion({ addBase }) {
406
- addBase({
407
- '@media (prefers-reduced-motion: reduce)': {
408
- '.motion-reduce-all, .motion-reduce-all *, .motion-reduce-all *::before, .motion-reduce-all *::after': {
409
- animationDuration: '0.01ms !important',
410
- animationIterationCount: '1 !important',
411
- transitionDuration: '0.01ms !important',
412
- scrollBehavior: 'auto !important',
413
- },
414
- },
415
- });
416
- },
417
- // Lucide icons default to the surrounding font size, as `react-icons` did before 0.7.0.
418
- // lucide-react writes `width="24" height="24"` attributes, whereas react-icons wrote `1em`,
419
- // and every icon slot in the library (and every Cleo call site) was laid out against
420
- // `1em`. `:where()` keeps this at zero specificity, so a `size-*` class on the icon or
421
- // a component's `[&_svg]:size-*` always wins, and it only matches Lucide's own class,
422
- // so chart SVGs and other artwork keep their dimensions.
423
- // 44×44px touch targets (WCAG 2.5.5 / 2.5.8 with margin), ported from SCIC in 0.7.0.
424
- // `touch-target` grows the element itself. `touch-hit` keeps a small control visually small
425
- // (aligned to something else) and grows only an invisible hit area around it.
426
- function touchTargets({ addUtilities }) {
427
- addUtilities({
428
- '.touch-target': { 'min-block-size': '44px', 'min-inline-size': '44px' },
429
- '.touch-hit': { position: 'relative' },
430
- '.touch-hit::after': {
431
- content: "''",
432
- position: 'absolute',
433
- inset: '50%',
434
- 'min-inline-size': '44px',
435
- 'min-block-size': '44px',
436
- transform: 'translate(-50%, -50%)',
437
- },
438
- });
439
- },
440
- function lucideIconSize({ addBase }) {
441
- addBase({
442
- ':where(svg.lucide)': { width: '1em', height: '1em' },
443
- });
444
- },
445
- ],
446
- }