basalt-ui 2.20.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/MIGRATING.md +129 -12
- package/agent/agents/basalt-design-reviewer.md +22 -5
- package/agent/rules/basalt-tokens.md +2 -2
- package/agent/skills/basalt-design/SKILL.md +10 -23
- package/agent/skills/basalt-design/references/anti-defaults.md +24 -0
- package/agent/skills/basalt-design/references/catalogue.md +48 -0
- package/agent/skills/basalt-design/references/concept.md +36 -0
- package/agent/skills/basalt-design/references/encoding-rules.md +45 -0
- package/agent/skills/basalt-design/references/stat-tile.md +24 -0
- package/agent/templates/AGENTS-block.md.tpl +3 -3
- package/configs/oxlint-plugin.js +1 -0
- package/dist/charts/ChartCard.d.ts +6 -2
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +4 -0
- package/dist/charts/state.d.ts +5 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +2 -0
- package/dist/cli/check-theme.d.ts.map +1 -1
- package/dist/cli/check-theme.js +3 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +3 -2
- package/dist/cli/index.d.ts +4 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +27 -15
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +3 -2
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +6 -1
- package/dist/cli/shot/detect.d.ts +51 -0
- package/dist/cli/shot/detect.d.ts.map +1 -0
- package/dist/cli/shot/detect.js +396 -0
- package/dist/cli/shot/index.d.ts.map +1 -1
- package/dist/cli/shot/index.js +7 -4
- package/dist/cli/shot/measure.d.ts +2 -0
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +2 -0
- package/dist/cli/shot/types.d.ts +4 -1
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/shot/types.js +2 -0
- package/dist/cli/sync.d.ts +2 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +2 -2
- package/dist/common/retry-button.d.ts +12 -0
- package/dist/common/retry-button.d.ts.map +1 -0
- package/dist/common/retry-button.js +22 -0
- package/dist/common/retry-button.module.css +58 -0
- package/dist/common/retry-button.module.css.d.ts +8 -0
- package/dist/dashboard/bar-list.d.ts +5 -2
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +2 -2
- package/dist/dashboard/meter-model.d.ts +34 -6
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +44 -13
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +167 -135
- package/dist/dashboard/meter.d.ts +11 -7
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +5 -1
- package/dist/dashboard/meter.module.css +18 -65
- package/dist/dashboard/meter.module.css.d.ts +2 -7
- package/dist/dashboard/query-state.d.ts +1 -1
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +3 -2
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +2 -1
- package/dist/dashboard/stat-strip.d.ts +17 -0
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +35 -5
- package/dist/dashboard/stat-strip.module.css +97 -14
- package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
- package/dist/dashboard/visual-slot.d.ts +2 -0
- package/dist/dashboard/visual-slot.d.ts.map +1 -0
- package/dist/dashboard/visual-slot.js +5 -0
- package/dist/guard/index.d.ts +15 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +14 -0
- package/dist/guard/palette.d.ts +51 -0
- package/dist/guard/palette.d.ts.map +1 -0
- package/dist/guard/palette.js +190 -0
- package/dist/guard/series-file.d.ts +15 -0
- package/dist/guard/series-file.d.ts.map +1 -0
- package/dist/guard/series-file.js +29 -0
- package/dist/guard/types.d.ts +3 -3
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/surfaces.d.ts +1 -1
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +2 -0
- package/dist/theme/controls.module.css +10 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +18 -0
- package/dist/tokens/oklab.d.ts +28 -0
- package/dist/tokens/oklab.d.ts.map +1 -0
- package/dist/tokens/oklab.js +73 -0
- package/llms.txt +7 -5
- package/package.json +1 -1
- package/src/charts/ChartCard.tsx +9 -1
- package/src/charts/state.tsx +9 -0
- package/src/cli/check-theme.ts +3 -0
- package/src/cli/help.ts +18 -1
- package/src/cli/index.ts +48 -17
- package/src/cli/init.ts +2 -1
- package/src/cli/shot/capture.ts +15 -2
- package/src/cli/shot/detect.ts +533 -0
- package/src/cli/shot/index.ts +8 -4
- package/src/cli/shot/measure.ts +4 -0
- package/src/cli/shot/types.ts +5 -1
- package/src/cli/sync.ts +4 -2
- package/src/common/retry-button.module.css +58 -0
- package/src/common/retry-button.module.css.d.ts +8 -0
- package/src/common/retry-button.tsx +29 -0
- package/src/dashboard/bar-list.tsx +11 -8
- package/src/dashboard/meter-model.ts +91 -20
- package/src/dashboard/meter-parts.tsx +155 -115
- package/src/dashboard/meter.module.css +18 -65
- package/src/dashboard/meter.module.css.d.ts +2 -7
- package/src/dashboard/meter.tsx +18 -8
- package/src/dashboard/query-state.tsx +4 -7
- package/src/dashboard/stat-card.tsx +4 -1
- package/src/dashboard/stat-strip.module.css +97 -14
- package/src/dashboard/stat-strip.module.css.d.ts +4 -0
- package/src/dashboard/stat-strip.tsx +85 -5
- package/src/dashboard/visual-slot.ts +8 -0
- package/src/guard/index.ts +16 -4
- package/src/guard/palette.ts +261 -0
- package/src/guard/series-file.ts +51 -0
- package/src/guard/types.ts +3 -2
- package/src/surfaces.ts +2 -0
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +82 -48
- package/src/theme/controls.module.css +10 -0
- package/src/theme/index.ts +26 -0
- package/src/tokens/oklab.ts +97 -0
|
@@ -294,6 +294,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
294
294
|
root: {
|
|
295
295
|
"--button-height": props.size === "md" ? "calc(var(--vx-space-control-height) * var(--mantine-scale))" : void 0,
|
|
296
296
|
"--button-padding-x": buttonPaddingX(props.size),
|
|
297
|
+
"--button-section-padding-x": buttonSectionX(props.size),
|
|
297
298
|
"--button-color": ink.color,
|
|
298
299
|
"--button-hover": ink.hover,
|
|
299
300
|
"--button-bg": ink.bg,
|
|
@@ -305,98 +306,114 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
305
306
|
"outputs": [
|
|
306
307
|
{
|
|
307
308
|
"probes": 542,
|
|
308
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))"}}",
|
|
309
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))"}}",
|
|
309
310
|
},
|
|
310
311
|
{
|
|
311
312
|
"probes": 12,
|
|
312
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
313
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
313
314
|
},
|
|
314
315
|
{
|
|
315
316
|
"probes": 12,
|
|
316
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
317
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
317
318
|
},
|
|
318
319
|
{
|
|
319
320
|
"probes": 12,
|
|
320
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
321
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
321
322
|
},
|
|
322
323
|
{
|
|
323
324
|
"probes": 270,
|
|
324
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))"}}",
|
|
325
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))"}}",
|
|
325
326
|
},
|
|
326
327
|
{
|
|
327
328
|
"probes": 6,
|
|
328
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
329
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
329
330
|
},
|
|
330
331
|
{
|
|
331
332
|
"probes": 6,
|
|
332
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
333
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
333
334
|
},
|
|
334
335
|
{
|
|
335
336
|
"probes": 6,
|
|
336
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
337
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
337
338
|
},
|
|
338
339
|
{
|
|
339
340
|
"probes": 272,
|
|
340
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))"}}",
|
|
341
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))"}}",
|
|
341
342
|
},
|
|
342
343
|
{
|
|
343
344
|
"probes": 6,
|
|
344
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
345
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
345
346
|
},
|
|
346
347
|
{
|
|
347
348
|
"probes": 6,
|
|
348
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
349
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
349
350
|
},
|
|
350
351
|
{
|
|
351
352
|
"probes": 6,
|
|
352
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
353
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
353
354
|
},
|
|
354
355
|
{
|
|
355
356
|
"probes": 270,
|
|
356
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))"}}",
|
|
357
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))"}}",
|
|
357
358
|
},
|
|
358
359
|
{
|
|
359
360
|
"probes": 6,
|
|
360
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
361
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
361
362
|
},
|
|
362
363
|
{
|
|
363
364
|
"probes": 6,
|
|
364
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
365
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
365
366
|
},
|
|
366
367
|
{
|
|
367
368
|
"probes": 6,
|
|
368
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
369
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
369
370
|
},
|
|
370
371
|
{
|
|
371
372
|
"probes": 270,
|
|
372
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))"}}",
|
|
373
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))"}}",
|
|
373
374
|
},
|
|
374
375
|
{
|
|
375
376
|
"probes": 6,
|
|
376
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
377
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
377
378
|
},
|
|
378
379
|
{
|
|
379
380
|
"probes": 6,
|
|
380
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
381
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
381
382
|
},
|
|
382
383
|
{
|
|
383
384
|
"probes": 6,
|
|
384
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
385
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
385
386
|
},
|
|
386
387
|
{
|
|
387
|
-
"probes":
|
|
388
|
+
"probes": 270,
|
|
389
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))"}}",
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"probes": 6,
|
|
393
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"probes": 6,
|
|
397
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"probes": 6,
|
|
401
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"probes": 270,
|
|
388
405
|
"result": "{"root":{}}",
|
|
389
406
|
},
|
|
390
407
|
{
|
|
391
|
-
"probes":
|
|
408
|
+
"probes": 6,
|
|
392
409
|
"result": "{"root":{"--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
393
410
|
},
|
|
394
411
|
{
|
|
395
|
-
"probes":
|
|
412
|
+
"probes": 6,
|
|
396
413
|
"result": "{"root":{"--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
397
414
|
},
|
|
398
415
|
{
|
|
399
|
-
"probes":
|
|
416
|
+
"probes": 6,
|
|
400
417
|
"result": "{"root":{"--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
401
418
|
},
|
|
402
419
|
],
|
|
@@ -1544,6 +1561,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1544
1561
|
root: {
|
|
1545
1562
|
"--button-height": props.size === "md" ? "calc(var(--vx-space-control-height) * var(--mantine-scale))" : void 0,
|
|
1546
1563
|
"--button-padding-x": buttonPaddingX(props.size),
|
|
1564
|
+
"--button-section-padding-x": buttonSectionX(props.size),
|
|
1547
1565
|
"--button-color": ink.color,
|
|
1548
1566
|
"--button-hover": ink.hover,
|
|
1549
1567
|
"--button-bg": ink.bg,
|
|
@@ -1555,98 +1573,114 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1555
1573
|
"outputs": [
|
|
1556
1574
|
{
|
|
1557
1575
|
"probes": 542,
|
|
1558
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))"}}",
|
|
1576
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))"}}",
|
|
1559
1577
|
},
|
|
1560
1578
|
{
|
|
1561
1579
|
"probes": 12,
|
|
1562
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1580
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1563
1581
|
},
|
|
1564
1582
|
{
|
|
1565
1583
|
"probes": 12,
|
|
1566
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1584
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1567
1585
|
},
|
|
1568
1586
|
{
|
|
1569
1587
|
"probes": 12,
|
|
1570
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1588
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-lg)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1571
1589
|
},
|
|
1572
1590
|
{
|
|
1573
1591
|
"probes": 270,
|
|
1574
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))"}}",
|
|
1592
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))"}}",
|
|
1575
1593
|
},
|
|
1576
1594
|
{
|
|
1577
1595
|
"probes": 6,
|
|
1578
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1596
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1579
1597
|
},
|
|
1580
1598
|
{
|
|
1581
1599
|
"probes": 6,
|
|
1582
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1600
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1583
1601
|
},
|
|
1584
1602
|
{
|
|
1585
1603
|
"probes": 6,
|
|
1586
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1604
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-md)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1587
1605
|
},
|
|
1588
1606
|
{
|
|
1589
1607
|
"probes": 272,
|
|
1590
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))"}}",
|
|
1608
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))"}}",
|
|
1591
1609
|
},
|
|
1592
1610
|
{
|
|
1593
1611
|
"probes": 6,
|
|
1594
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1612
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1595
1613
|
},
|
|
1596
1614
|
{
|
|
1597
1615
|
"probes": 6,
|
|
1598
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1616
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1599
1617
|
},
|
|
1600
1618
|
{
|
|
1601
1619
|
"probes": 6,
|
|
1602
|
-
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1620
|
+
"result": "{"root":{"--button-height":"calc(var(--vx-space-control-height) * var(--mantine-scale))","--button-padding-x":"calc((var(--vx-space-stack-lg) + var(--vx-space-stack-xs)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-md) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1603
1621
|
},
|
|
1604
1622
|
{
|
|
1605
1623
|
"probes": 270,
|
|
1606
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))"}}",
|
|
1624
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))"}}",
|
|
1607
1625
|
},
|
|
1608
1626
|
{
|
|
1609
1627
|
"probes": 6,
|
|
1610
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1628
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1611
1629
|
},
|
|
1612
1630
|
{
|
|
1613
1631
|
"probes": 6,
|
|
1614
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1632
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1615
1633
|
},
|
|
1616
1634
|
{
|
|
1617
1635
|
"probes": 6,
|
|
1618
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1636
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-lg) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1619
1637
|
},
|
|
1620
1638
|
{
|
|
1621
1639
|
"probes": 270,
|
|
1622
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))"}}",
|
|
1640
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))"}}",
|
|
1623
1641
|
},
|
|
1624
1642
|
{
|
|
1625
1643
|
"probes": 6,
|
|
1626
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1644
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1627
1645
|
},
|
|
1628
1646
|
{
|
|
1629
1647
|
"probes": 6,
|
|
1630
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1648
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1631
1649
|
},
|
|
1632
1650
|
{
|
|
1633
1651
|
"probes": 6,
|
|
1634
|
-
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1652
|
+
"result": "{"root":{"--button-padding-x":"calc((var(--vx-space-stack-xl) + var(--vx-space-stack-sm)) * var(--mantine-scale))","--button-section-padding-x":"calc(var(--vx-space-stack-xl) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1635
1653
|
},
|
|
1636
1654
|
{
|
|
1637
|
-
"probes":
|
|
1655
|
+
"probes": 270,
|
|
1656
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))"}}",
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
"probes": 6,
|
|
1660
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
"probes": 6,
|
|
1664
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1665
|
+
},
|
|
1666
|
+
{
|
|
1667
|
+
"probes": 6,
|
|
1668
|
+
"result": "{"root":{"--button-section-padding-x":"calc(var(--vx-space-stack-sm) * var(--mantine-scale))","--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
"probes": 270,
|
|
1638
1672
|
"result": "{"root":{}}",
|
|
1639
1673
|
},
|
|
1640
1674
|
{
|
|
1641
|
-
"probes":
|
|
1675
|
+
"probes": 6,
|
|
1642
1676
|
"result": "{"root":{"--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, var(--vx-surface-subtle))","--button-bg":"var(--vx-surface-subtle)"}}",
|
|
1643
1677
|
},
|
|
1644
1678
|
{
|
|
1645
|
-
"probes":
|
|
1679
|
+
"probes": 6,
|
|
1646
1680
|
"result": "{"root":{"--button-color":"var(--vx-ink)","--button-hover":"var(--vx-surface-subtle)","--button-bd":"calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)"}}",
|
|
1647
1681
|
},
|
|
1648
1682
|
{
|
|
1649
|
-
"probes":
|
|
1683
|
+
"probes": 6,
|
|
1650
1684
|
"result": "{"root":{"--button-color":"var(--vx-ink)","--button-hover":"color-mix(in srgb, var(--vx-ink) 6%, transparent)"}}",
|
|
1651
1685
|
},
|
|
1652
1686
|
],
|
|
@@ -135,6 +135,16 @@ html[data-mantine-color-scheme] .inputWrapper[data-variant='default']:not([data-
|
|
|
135
135
|
transition: box-shadow 120ms ease;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
/* Section-side inset on the stack scale (`buttonSectionX`, theme/index.ts) — beats Mantine's
|
|
139
|
+
* zero-specificity `:where([data-with-*-section])` `padding-x / 1.5`. */
|
|
140
|
+
.buttonRoot[data-with-left-section] {
|
|
141
|
+
padding-inline-start: var(--button-section-padding-x, calc(var(--button-padding-x) / 1.5));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.buttonRoot[data-with-right-section] {
|
|
145
|
+
padding-inline-end: var(--button-section-padding-x, calc(var(--button-padding-x) / 1.5));
|
|
146
|
+
}
|
|
147
|
+
|
|
138
148
|
.buttonRoot[data-variant='default'],
|
|
139
149
|
.buttonRoot[data-variant='filled'],
|
|
140
150
|
.buttonRoot[data-variant='light'] {
|
package/src/theme/index.ts
CHANGED
|
@@ -690,6 +690,7 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
690
690
|
? 'calc(var(--vx-space-control-height) * var(--mantine-scale))'
|
|
691
691
|
: undefined,
|
|
692
692
|
'--button-padding-x': buttonPaddingX(props.size),
|
|
693
|
+
'--button-section-padding-x': buttonSectionX(props.size),
|
|
693
694
|
'--button-color': ink.color,
|
|
694
695
|
'--button-hover': ink.hover,
|
|
695
696
|
'--button-bg': ink.bg,
|
|
@@ -1255,6 +1256,31 @@ function buttonPaddingX(size: unknown): string | undefined {
|
|
|
1255
1256
|
return steps === undefined ? undefined : `calc((${steps}) * var(--mantine-scale))`
|
|
1256
1257
|
}
|
|
1257
1258
|
|
|
1259
|
+
/**
|
|
1260
|
+
* The inset on a Button's section side, a step of the same stack scale. Mantine derives it as
|
|
1261
|
+
* `--button-padding-x / 1.5` (`Button.css`, `[data-with-left-section]` / `[data-with-right-section]`),
|
|
1262
|
+
* which lands at 10.67 / 13.33 / 21.33 / 5.33 px — off the scale. Each size takes the nearest step to
|
|
1263
|
+
* that quotient at level 0 (xs 8, sm 12, md 12, lg 16, xl 24; compact-xs/sm 4, compact-md/lg 8,
|
|
1264
|
+
* compact-xl 12; `ctl` 6.67 → 8). Undefined sizes keep Mantine's own value.
|
|
1265
|
+
*/
|
|
1266
|
+
const BUTTON_SECTION_X: Record<string, string> = {
|
|
1267
|
+
xs: 'var(--vx-space-stack-sm)',
|
|
1268
|
+
sm: 'var(--vx-space-stack-md)',
|
|
1269
|
+
md: 'var(--vx-space-stack-md)',
|
|
1270
|
+
lg: 'var(--vx-space-stack-lg)',
|
|
1271
|
+
xl: 'var(--vx-space-stack-xl)',
|
|
1272
|
+
ctl: 'var(--vx-space-stack-sm)',
|
|
1273
|
+
'compact-xs': 'var(--vx-space-stack-xs)',
|
|
1274
|
+
'compact-sm': 'var(--vx-space-stack-xs)',
|
|
1275
|
+
'compact-md': 'var(--vx-space-stack-sm)',
|
|
1276
|
+
'compact-lg': 'var(--vx-space-stack-sm)',
|
|
1277
|
+
'compact-xl': 'var(--vx-space-stack-md)',
|
|
1278
|
+
}
|
|
1279
|
+
function buttonSectionX(size: unknown): string | undefined {
|
|
1280
|
+
const step = BUTTON_SECTION_X[typeof size === 'string' ? size : 'sm']
|
|
1281
|
+
return step === undefined ? undefined : `calc(${step} * var(--mantine-scale))`
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1258
1284
|
/**
|
|
1259
1285
|
* The `ctl` tier's horizontal inset — one number for a Button, a `FilterPill`, a SegmentedControl
|
|
1260
1286
|
* segment and a `kind: 'custom'` Badge, so a home's row reads as one control family
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OKLab / OKLCH and colour-vision-deficiency simulation — Mantine-free, dependency-free.
|
|
3
|
+
*
|
|
4
|
+
* OKLab is Ottosson's definition (https://bottosson.github.io/posts/oklab/); the CVD matrices are
|
|
5
|
+
* Machado, Oliveira & Fernandes (2009), "A Physiologically-based Model for Simulation of Color
|
|
6
|
+
* Vision Deficiency", severity 1.0, applied to LINEAR sRGB. `deltaEOk` is the Euclidean OKLab
|
|
7
|
+
* distance ×100, the unit the series-palette guard's thresholds are written in.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type Oklab = { L: number; a: number; b: number }
|
|
11
|
+
export type Oklch = { L: number; C: number; h: number }
|
|
12
|
+
export type CvdKind = 'protan' | 'deutan'
|
|
13
|
+
|
|
14
|
+
type Rgb = readonly [number, number, number]
|
|
15
|
+
type Matrix = readonly [Rgb, Rgb, Rgb]
|
|
16
|
+
|
|
17
|
+
const MACHADO: Record<CvdKind, Matrix> = {
|
|
18
|
+
protan: [
|
|
19
|
+
[0.152286, 1.052583, -0.204868],
|
|
20
|
+
[0.114503, 0.786281, 0.099216],
|
|
21
|
+
[-0.003882, -0.048116, 1.051998],
|
|
22
|
+
],
|
|
23
|
+
deutan: [
|
|
24
|
+
[0.367322, 0.860646, -0.227968],
|
|
25
|
+
[0.280085, 0.672501, 0.047413],
|
|
26
|
+
[-0.01182, 0.04294, 0.968881],
|
|
27
|
+
],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function hexToLinear(hex: string): Rgb {
|
|
31
|
+
const raw = hex.replace('#', '')
|
|
32
|
+
const full = raw.length === 3 ? [...raw].map((c) => c + c).join('') : raw.slice(0, 6)
|
|
33
|
+
const channel = (i: number) => {
|
|
34
|
+
const c = Number.parseInt(full.slice(i, i + 2), 16) / 255
|
|
35
|
+
return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4
|
|
36
|
+
}
|
|
37
|
+
return [channel(0), channel(2), channel(4)]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function linearToHex([r, g, b]: Rgb): string {
|
|
41
|
+
const encode = (c: number) => {
|
|
42
|
+
const v = Math.min(1, Math.max(0, c))
|
|
43
|
+
const s = v <= 0.0031308 ? v * 12.92 : 1.055 * v ** (1 / 2.4) - 0.055
|
|
44
|
+
return Math.round(s * 255)
|
|
45
|
+
.toString(16)
|
|
46
|
+
.padStart(2, '0')
|
|
47
|
+
}
|
|
48
|
+
return `#${encode(r)}${encode(g)}${encode(b)}`
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function linearToOklab([r, g, b]: Rgb): Oklab {
|
|
52
|
+
const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b)
|
|
53
|
+
const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b)
|
|
54
|
+
const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b)
|
|
55
|
+
return {
|
|
56
|
+
L: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
57
|
+
a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
58
|
+
b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function hexToOklab(hex: string): Oklab {
|
|
63
|
+
return linearToOklab(hexToLinear(hex))
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function hexToOklch(hex: string): Oklch {
|
|
67
|
+
const { L, a, b } = hexToOklab(hex)
|
|
68
|
+
const h = (Math.atan2(b, a) * 180) / Math.PI
|
|
69
|
+
return { L, C: Math.hypot(a, b), h: h < 0 ? h + 360 : h }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Euclidean OKLab distance ×100 between two hex colours. */
|
|
73
|
+
export function deltaEOk(hexA: string, hexB: string): number {
|
|
74
|
+
const x = hexToOklab(hexA)
|
|
75
|
+
const y = hexToOklab(hexB)
|
|
76
|
+
return 100 * Math.hypot(x.L - y.L, x.a - y.a, x.b - y.b)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** What a dichromat sees for `hex`, still in clamped linear RGB (Machado 2009, severity 1.0). */
|
|
80
|
+
function simulateCvdLinear(hex: string, kind: CvdKind): Rgb {
|
|
81
|
+
const [r, g, b] = hexToLinear(hex)
|
|
82
|
+
const [row0, row1, row2] = MACHADO[kind]
|
|
83
|
+
const mix = (row: Rgb) => Math.min(1, Math.max(0, row[0] * r + row[1] * g + row[2] * b))
|
|
84
|
+
return [mix(row0), mix(row1), mix(row2)]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** The hex a dichromat sees for `hex` — for display and tests; the checks stay in linear RGB. */
|
|
88
|
+
export function simulateCvd(hex: string, kind: CvdKind): string {
|
|
89
|
+
return linearToHex(simulateCvdLinear(hex, kind))
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** OKLab ΔE×100 between two colours as a dichromat sees them — no 8-bit round trip. */
|
|
93
|
+
export function deltaEOkCvd(hexA: string, hexB: string, kind: CvdKind): number {
|
|
94
|
+
const x = linearToOklab(simulateCvdLinear(hexA, kind))
|
|
95
|
+
const y = linearToOklab(simulateCvdLinear(hexB, kind))
|
|
96
|
+
return 100 * Math.hypot(x.L - y.L, x.a - y.a, x.b - y.b)
|
|
97
|
+
}
|