basalt-ui 2.12.0 → 2.13.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 +23 -0
- package/MIGRATING.md +39 -12
- package/agent/rules/basalt-state.md +1 -1
- package/agent/skills/basalt-app/SKILL.md +1 -1
- package/agent/templates/main.tpl +1 -0
- package/dist/cli/basalt-install.d.ts +10 -0
- package/dist/cli/basalt-install.d.ts.map +1 -0
- package/dist/cli/basalt-install.js +0 -0
- package/dist/cli/check-theme.js +1 -1
- package/dist/cli/doctor-upgrade.d.ts +3 -3
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +28 -44
- package/dist/cli/doctor.js +3 -3
- package/dist/cli/index.d.ts +4 -28
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -49
- package/dist/cli/provider-tags.d.ts +12 -0
- package/dist/cli/provider-tags.d.ts.map +1 -0
- package/dist/cli/provider-tags.js +28 -0
- package/dist/cli/render-imports.d.ts +24 -0
- package/dist/cli/render-imports.d.ts.map +1 -0
- package/dist/cli/render-imports.js +74 -0
- package/dist/cli/router-wiring.d.ts +12 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +18 -0
- package/dist/cli/source-text.d.ts +7 -0
- package/dist/cli/source-text.d.ts.map +1 -1
- package/dist/cli/source-text.js +34 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +18 -13
- package/dist/guard/fonts-hint.d.ts +3 -0
- package/dist/guard/fonts-hint.d.ts.map +1 -0
- package/dist/guard/fonts-hint.js +4 -0
- package/dist/guard/index.d.ts +1 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/provider/create-router.d.ts +57 -10
- package/dist/provider/create-router.d.ts.map +1 -1
- package/dist/provider/create-router.js +28 -17
- package/dist/provider/index.d.ts +2 -2
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +23 -7
- package/dist/query-client.d.ts +2 -62
- package/dist/query-client.d.ts.map +1 -1
- package/dist/query-client.js +13 -18
- package/dist/router-tanstack/search-store-warnings.d.ts +33 -0
- package/dist/router-tanstack/search-store-warnings.d.ts.map +1 -0
- package/dist/router-tanstack/search-store-warnings.js +77 -0
- package/dist/router-tanstack/search-store.d.ts +2 -5
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/search-store.js +111 -110
- package/dist/telemetry.d.ts +31 -2
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +32 -12
- package/dist/theme/ctl-theme.d.ts.map +1 -1
- package/dist/theme/ctl-theme.js +17 -30
- package/dist/theme/extend.d.ts +18 -0
- package/dist/theme/extend.d.ts.map +1 -0
- package/dist/theme/extend.js +6 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +44 -84
- package/dist/unwrap.d.ts +29 -0
- package/dist/unwrap.d.ts.map +1 -0
- package/dist/unwrap.js +18 -0
- package/llms.txt +9 -5
- package/package.json +1 -1
- package/src/cli/basalt-install.ts +9 -0
- package/src/cli/check-theme.ts +1 -1
- package/src/cli/doctor-upgrade.ts +40 -61
- package/src/cli/doctor.ts +3 -3
- package/src/cli/index.ts +14 -71
- package/src/cli/provider-tags.ts +38 -0
- package/src/cli/render-imports.ts +104 -0
- package/src/cli/router-wiring.ts +23 -0
- package/src/cli/source-text.ts +39 -0
- package/src/cli/sync.ts +27 -21
- package/src/guard/fonts-hint.ts +2 -0
- package/src/guard/index.ts +2 -2
- package/src/index.ts +4 -2
- package/src/provider/create-router.tsx +103 -39
- package/src/provider/index.tsx +27 -9
- package/src/query-client.ts +20 -78
- package/src/router-tanstack/search-store-warnings.ts +120 -0
- package/src/router-tanstack/search-store.ts +200 -206
- package/src/telemetry.ts +71 -13
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +2354 -0
- package/src/theme/ctl-theme.tsx +20 -19
- package/src/theme/extend.ts +18 -0
- package/src/theme/index.ts +50 -49
- package/src/unwrap.ts +44 -0
package/dist/theme/index.js
CHANGED
|
@@ -1,50 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Accordion,
|
|
3
|
-
ActionIcon,
|
|
4
|
-
Alert,
|
|
5
|
-
AppShell,
|
|
6
|
-
Badge,
|
|
7
|
-
Breadcrumbs,
|
|
8
|
-
Button,
|
|
9
|
-
Card,
|
|
10
|
-
Checkbox,
|
|
11
|
-
CheckboxCard,
|
|
12
|
-
Chip,
|
|
13
|
-
Code,
|
|
14
|
-
Combobox,
|
|
15
2
|
createTheme,
|
|
16
3
|
defaultVariantColorsResolver,
|
|
17
|
-
Drawer,
|
|
18
4
|
getPrimaryShade,
|
|
19
|
-
Indicator,
|
|
20
|
-
Input,
|
|
21
|
-
Kbd,
|
|
22
|
-
Menu,
|
|
23
5
|
mergeThemeOverrides,
|
|
24
|
-
|
|
25
|
-
NavLink,
|
|
26
|
-
Notification,
|
|
27
|
-
NumberInput,
|
|
28
|
-
Pagination,
|
|
29
|
-
PaginationControl,
|
|
30
|
-
Paper,
|
|
31
|
-
PasswordInput,
|
|
32
|
-
PillsInput,
|
|
33
|
-
Popover,
|
|
34
|
-
Progress,
|
|
35
|
-
Radio,
|
|
36
|
-
RadioCard,
|
|
37
|
-
rem,
|
|
38
|
-
Select,
|
|
39
|
-
SegmentedControl,
|
|
40
|
-
Stepper,
|
|
41
|
-
Switch,
|
|
42
|
-
Table,
|
|
43
|
-
Tabs,
|
|
44
|
-
Textarea,
|
|
45
|
-
TextInput,
|
|
46
|
-
Timeline,
|
|
47
|
-
Tooltip
|
|
6
|
+
rem
|
|
48
7
|
} from "@mantine/core";
|
|
49
8
|
import {
|
|
50
9
|
BP,
|
|
@@ -63,6 +22,7 @@ import navLinkClasses from "./nav-link.module.css";
|
|
|
63
22
|
import segmentedControlClasses from "./segmented-control.module.css";
|
|
64
23
|
import timelineClasses from "./timeline.module.css";
|
|
65
24
|
import { HIT_ATTR } from "./ctl-theme.js";
|
|
25
|
+
import { ext } from "./extend.js";
|
|
66
26
|
import { useBasaltSpacing } from "./use-basalt-spacing.js";
|
|
67
27
|
import { CTL_THEME, CtlSlot } from "./ctl-theme.js";
|
|
68
28
|
function hexToRgb(h) {
|
|
@@ -275,7 +235,7 @@ function buildTheme(data, options = {}) {
|
|
|
275
235
|
// • radius → `--vx-radius-card` (7px).
|
|
276
236
|
// This is the single source the user's "strict surface across components" demands; the
|
|
277
237
|
// `raw-surface` guard then stops consumers re-overriding any of it inline.
|
|
278
|
-
Card:
|
|
238
|
+
Card: ext({
|
|
279
239
|
styles: {
|
|
280
240
|
root: {
|
|
281
241
|
backgroundColor: "var(--vx-surface-panel)",
|
|
@@ -284,7 +244,7 @@ function buildTheme(data, options = {}) {
|
|
|
284
244
|
}
|
|
285
245
|
}
|
|
286
246
|
}),
|
|
287
|
-
Paper:
|
|
247
|
+
Paper: ext({
|
|
288
248
|
styles: {
|
|
289
249
|
root: {
|
|
290
250
|
backgroundColor: "var(--vx-surface-panel)",
|
|
@@ -296,12 +256,12 @@ function buildTheme(data, options = {}) {
|
|
|
296
256
|
// Mantine's default Badge radius is a full 1000px pill; the spec's delta/status badges sit at
|
|
297
257
|
// radius 6 (docs/DESIGN-SPEC.md §4/§5). Count badges (radius 5) are a distinct, smaller-radius
|
|
298
258
|
// usage left to the call site (`radius={5}` prop) since Badge has no state to key off here.
|
|
299
|
-
Badge:
|
|
259
|
+
Badge: ext({ defaultProps: { radius: radius.ctrl } }),
|
|
300
260
|
// Alert renders its title in the body font by default; bring it onto the head-font idiom
|
|
301
261
|
// (docs/DESIGN-SPEC.md §5) like every other titled surface. Radius/padding/color tint are
|
|
302
262
|
// already on-system (defaultRadius 'md' control tier + the variant color resolver), so only
|
|
303
263
|
// the title font is overridden.
|
|
304
|
-
Alert:
|
|
264
|
+
Alert: ext({
|
|
305
265
|
styles: {
|
|
306
266
|
title: {
|
|
307
267
|
fontFamily: "var(--basalt-font-head)",
|
|
@@ -319,7 +279,7 @@ function buildTheme(data, options = {}) {
|
|
|
319
279
|
// Cast: `AppShellCssVariables` declares only `--app-shell-transition-duration` /
|
|
320
280
|
// `-timing-function`, yet Mantine's OWN AppShell.css sets `--app-shell-border-color` on the
|
|
321
281
|
// same root.
|
|
322
|
-
AppShell:
|
|
282
|
+
AppShell: ext({
|
|
323
283
|
vars: () => ({ root: { "--app-shell-border-color": "var(--vx-divider)" } })
|
|
324
284
|
}),
|
|
325
285
|
// "Ink earns its color" — a nav selection is UI state, not the identity accent on the LABEL.
|
|
@@ -337,7 +297,7 @@ function buildTheme(data, options = {}) {
|
|
|
337
297
|
// set at ink-6% by higher-specificity `:not([data-active])` rules in `nav-link.module.css` /
|
|
338
298
|
// `app-sidebar.module.css` — so it exists to keep the active row responding to the pointer
|
|
339
299
|
// now that its rest state sits in the same tint family as an inactive hover.
|
|
340
|
-
NavLink:
|
|
300
|
+
NavLink: ext({
|
|
341
301
|
vars: () => ({
|
|
342
302
|
root: {
|
|
343
303
|
"--nl-bg": "color-mix(in srgb, var(--vx-ink) 9%, transparent)",
|
|
@@ -384,7 +344,7 @@ function buildTheme(data, options = {}) {
|
|
|
384
344
|
// legal home for the shadow's ring. Theming the base `Input` covers
|
|
385
345
|
// TextInput/NumberInput/PasswordInput/Select/Textarea, which all render it internally (only
|
|
386
346
|
// `size` needs per-component defaults, since each resolves its own).
|
|
387
|
-
Input:
|
|
347
|
+
Input: ext({
|
|
388
348
|
defaultProps: { size: "md" },
|
|
389
349
|
// Density coupling: Input's OWN `varsResolver` sets `--input-height` to
|
|
390
350
|
// `getSize(props.size, 'input-height')` (`@mantine/core/esm/components/Input/Input.mjs`),
|
|
@@ -415,20 +375,20 @@ function buildTheme(data, options = {}) {
|
|
|
415
375
|
}),
|
|
416
376
|
classNames: { wrapper: controlsClasses.inputWrapper, input: controlsClasses.input }
|
|
417
377
|
}),
|
|
418
|
-
TextInput:
|
|
378
|
+
TextInput: ext({ defaultProps: { size: "md" } }),
|
|
419
379
|
// The stepper chevrons sit ~15px apart, so neither can own a 44px overlay; the coarse
|
|
420
380
|
// `.input` min-height floor (theme/controls.module.css) is the touch floor.
|
|
421
|
-
NumberInput:
|
|
422
|
-
PasswordInput:
|
|
423
|
-
Select:
|
|
424
|
-
Textarea:
|
|
381
|
+
NumberInput: ext({ defaultProps: { size: "md" } }),
|
|
382
|
+
PasswordInput: ext({ defaultProps: { size: "md" } }),
|
|
383
|
+
Select: ext({ defaultProps: { size: "md" } }),
|
|
384
|
+
Textarea: ext({ defaultProps: { size: "md" } }),
|
|
425
385
|
// PillsInput (MultiSelect/TagsInput's outer field) renders `InputBase` internally but under
|
|
426
386
|
// its OWN `__staticSelector: 'PillsInput'`, so it never reads `theme.components.Input` — the
|
|
427
387
|
// field idiom above never reached it. `PillsInput.classes === InputBase.classes`, so the SAME
|
|
428
388
|
// part names apply here; reusing both control classes picks up the exact `[data-variant]` rules
|
|
429
389
|
// in controls.module.css for free, no new CSS needed. Both slots are required — `wrapper` alone
|
|
430
390
|
// would land the vars but leave the field flat, since the depth lives on `input`.
|
|
431
|
-
PillsInput:
|
|
391
|
+
PillsInput: ext({
|
|
432
392
|
classNames: { wrapper: controlsClasses.inputWrapper, input: controlsClasses.input }
|
|
433
393
|
}),
|
|
434
394
|
// Button / ActionIcon: depth for EVERY variant that owns a box (docs/DESIGN-SPEC.md §5's
|
|
@@ -456,7 +416,7 @@ function buildTheme(data, options = {}) {
|
|
|
456
416
|
// anchor's doc in `tokens/palette.ts`), so the two can never drift. Scoped to `size === 'md'`,
|
|
457
417
|
// same rationale as Input's override: `undefined` leaves an explicitly different size (e.g.
|
|
458
418
|
// `size="xs"`) on Mantine's own static height.
|
|
459
|
-
Button:
|
|
419
|
+
Button: ext({
|
|
460
420
|
classNames: { root: controlsClasses.buttonRoot },
|
|
461
421
|
vars: (_theme, props) => ({
|
|
462
422
|
root: {
|
|
@@ -464,7 +424,7 @@ function buildTheme(data, options = {}) {
|
|
|
464
424
|
}
|
|
465
425
|
})
|
|
466
426
|
}),
|
|
467
|
-
ActionIcon:
|
|
427
|
+
ActionIcon: ext({
|
|
468
428
|
classNames: { root: controlsClasses.actionIconRoot },
|
|
469
429
|
vars: (_theme, props) => ({
|
|
470
430
|
root: {
|
|
@@ -484,10 +444,10 @@ function buildTheme(data, options = {}) {
|
|
|
484
444
|
// Neither component sets a background of its own, so panel bg is added alongside the shadow —
|
|
485
445
|
// the same panel-bg + depth + no-border triad as Card/Paper — on `shadow-raised`, the shared
|
|
486
446
|
// CONTROL depth, not Card/Paper's `shadow-card`: a selection card is something you click.
|
|
487
|
-
CheckboxCard:
|
|
447
|
+
CheckboxCard: ext({
|
|
488
448
|
classNames: { card: controlsClasses.checkboxCardRoot }
|
|
489
449
|
}),
|
|
490
|
-
RadioCard:
|
|
450
|
+
RadioCard: ext({
|
|
491
451
|
classNames: { card: controlsClasses.radioCardRoot }
|
|
492
452
|
}),
|
|
493
453
|
// Chip: unlike Button/Input, Chip has no literal `variant="default"` — its OWN default (no
|
|
@@ -497,7 +457,7 @@ function buildTheme(data, options = {}) {
|
|
|
497
457
|
// no shadow) — borderless but flat, the same symptom as CheckboxCard/RadioCard above. The class
|
|
498
458
|
// is wired conditionally (function-form `classNames`, same pattern as the `vars` on-color
|
|
499
459
|
// re-points below) so it NEVER reaches a consumer-chosen `light`/`outline` Chip.
|
|
500
|
-
Chip:
|
|
460
|
+
Chip: ext({
|
|
501
461
|
classNames: (_theme, props) => (props.variant ?? "filled") === "filled" ? { label: controlsClasses.chipLabel } : {}
|
|
502
462
|
}),
|
|
503
463
|
// Track = ink-6% tint, radius 7, 2px padding; active segment = an ink-mixed panel fill +
|
|
@@ -532,7 +492,7 @@ function buildTheme(data, options = {}) {
|
|
|
532
492
|
// `tokens/palette.ts`), and `radius.card`/`RADIUS_STEP.tight` two lines below already track the
|
|
533
493
|
// RADIUS knob together, so the inset between them must stay fixed at exactly 2 regardless of
|
|
534
494
|
// density.
|
|
535
|
-
SegmentedControl:
|
|
495
|
+
SegmentedControl: ext({
|
|
536
496
|
defaultProps: { radius: radius.card },
|
|
537
497
|
classNames: {
|
|
538
498
|
label: segmentedControlClasses.label,
|
|
@@ -608,7 +568,7 @@ function buildTheme(data, options = {}) {
|
|
|
608
568
|
})
|
|
609
569
|
}),
|
|
610
570
|
// Track = ink-8%; leader/section fill colors are a per-usage `color` prop (left to consumers).
|
|
611
|
-
Progress:
|
|
571
|
+
Progress: ext({
|
|
612
572
|
// `size` is a NUMBER, not a `var()` string — same rem()-comma-trap reasoning as Timeline's
|
|
613
573
|
// `bulletSize`/`lineWidth` below, so it reads the resolved `spacing.step.progressBarSize`
|
|
614
574
|
// (density-tracking) rather than a hand-typed literal.
|
|
@@ -627,7 +587,7 @@ function buildTheme(data, options = {}) {
|
|
|
627
587
|
// live in `timeline.module.css` instead. `TimelineItem` renders through the PARENT Timeline's
|
|
628
588
|
// style context (`ctx.getStyles`), so `item`/`itemBullet`/`itemTitle`/`itemContent` are all
|
|
629
589
|
// themed from this ONE extend — no separate `TimelineItem` override needed.
|
|
630
|
-
Timeline:
|
|
590
|
+
Timeline: ext({
|
|
631
591
|
// NUMBERS, not `var()` strings: `bulletSize`/`lineWidth` land through Timeline's own
|
|
632
592
|
// `rem()` conversion (`@mantine/core/esm/core/utils/units-converters/rem.mjs` splits on `,`
|
|
633
593
|
// and ` ` before checking numerics), which passes a bare `var(--x)` through intact but
|
|
@@ -661,7 +621,7 @@ function buildTheme(data, options = {}) {
|
|
|
661
621
|
// by the resolver below, so dropdown and arrow always share the same edge color.)
|
|
662
622
|
// Tooltip is a standalone floating primitive (not Popover-based) — themed directly. Its arrow
|
|
663
623
|
// ships border-less (`border: 0`), so the same edge is applied inline to keep the ring closed.
|
|
664
|
-
Tooltip:
|
|
624
|
+
Tooltip: ext({
|
|
665
625
|
defaultProps: { radius: radius.floating },
|
|
666
626
|
styles: {
|
|
667
627
|
tooltip: {
|
|
@@ -675,7 +635,7 @@ function buildTheme(data, options = {}) {
|
|
|
675
635
|
}),
|
|
676
636
|
// Popover is the shared floating primitive underneath Menu (Menu renders `<Popover>`
|
|
677
637
|
// internally with no `radius`/`shadow` of its own), so theming it here covers both.
|
|
678
|
-
Popover:
|
|
638
|
+
Popover: ext({
|
|
679
639
|
defaultProps: { radius: radius.floating },
|
|
680
640
|
styles: {
|
|
681
641
|
dropdown: {
|
|
@@ -689,7 +649,7 @@ function buildTheme(data, options = {}) {
|
|
|
689
649
|
// stripped from `styles` objects, and Menu's internal Popover does NOT consume
|
|
690
650
|
// `components.Popover.styles`, so the dropdown surface is repeated here). Menu.Label = the
|
|
691
651
|
// mono micro-label idiom; dividers use the layout-divider token.
|
|
692
|
-
Menu:
|
|
652
|
+
Menu: ext({
|
|
693
653
|
classNames: { item: floatingClasses.menuItem },
|
|
694
654
|
styles: {
|
|
695
655
|
dropdown: {
|
|
@@ -715,7 +675,7 @@ function buildTheme(data, options = {}) {
|
|
|
715
675
|
}),
|
|
716
676
|
// Combobox is the floating primitive underneath Select/Autocomplete/MultiSelect — like Menu,
|
|
717
677
|
// it doesn't consume `components.Popover.styles`, so the overlay dropdown idiom is repeated.
|
|
718
|
-
Combobox:
|
|
678
|
+
Combobox: ext({
|
|
719
679
|
styles: {
|
|
720
680
|
dropdown: {
|
|
721
681
|
backgroundColor: "var(--vx-surface-overlay)",
|
|
@@ -732,7 +692,7 @@ function buildTheme(data, options = {}) {
|
|
|
732
692
|
// background moves back to opaque, matching the content box it sits above rather than the page
|
|
733
693
|
// behind it. Title = head font; close button = the ghost idiom (floating.module.css). Below the
|
|
734
694
|
// `medium` size class the Modal is a bottom sheet (floating.module.css `sheet*`).
|
|
735
|
-
Modal:
|
|
695
|
+
Modal: ext({
|
|
736
696
|
defaultProps: { radius: radius.floating, closeButtonProps: { ...HIT_ATTR } },
|
|
737
697
|
classNames: {
|
|
738
698
|
close: floatingClasses.closeButton,
|
|
@@ -753,7 +713,7 @@ function buildTheme(data, options = {}) {
|
|
|
753
713
|
}
|
|
754
714
|
}
|
|
755
715
|
}),
|
|
756
|
-
Drawer:
|
|
716
|
+
Drawer: ext({
|
|
757
717
|
classNames: { close: floatingClasses.closeButton },
|
|
758
718
|
styles: {
|
|
759
719
|
content: {
|
|
@@ -772,7 +732,7 @@ function buildTheme(data, options = {}) {
|
|
|
772
732
|
// count-badge bg: ink 6–8%") — mono, ink-7% bg, radius 5.
|
|
773
733
|
// Flat mono chip (mock's ⌘K badge) — Mantine's default Kbd draws a 3px "keyboard key" bottom
|
|
774
734
|
// border that reads as a heavy off-system rule, so the border goes entirely.
|
|
775
|
-
Kbd:
|
|
735
|
+
Kbd: ext({
|
|
776
736
|
styles: {
|
|
777
737
|
root: {
|
|
778
738
|
backgroundColor: "color-mix(in srgb, var(--vx-ink) 7%, transparent)",
|
|
@@ -782,7 +742,7 @@ function buildTheme(data, options = {}) {
|
|
|
782
742
|
}
|
|
783
743
|
}
|
|
784
744
|
}),
|
|
785
|
-
Code:
|
|
745
|
+
Code: ext({
|
|
786
746
|
styles: {
|
|
787
747
|
root: {
|
|
788
748
|
backgroundColor: "color-mix(in srgb, var(--vx-ink) 7%, transparent)",
|
|
@@ -799,7 +759,7 @@ function buildTheme(data, options = {}) {
|
|
|
799
759
|
// rows) is not expressible by it at all. `height` on a table cell behaves as a MINIMUM, so a
|
|
800
760
|
// wrapping cell still grows; `verticalSpacing` keeps working on top of it for a consumer that
|
|
801
761
|
// wants a denser or looser table than the tier.
|
|
802
|
-
Table:
|
|
762
|
+
Table: ext({
|
|
803
763
|
classNames: { table: controlsClasses.tableRoot },
|
|
804
764
|
styles: {
|
|
805
765
|
th: {
|
|
@@ -820,7 +780,7 @@ function buildTheme(data, options = {}) {
|
|
|
820
780
|
// `track` is the Switch's <label>, so the invisible `--vx-hit` overlay (`data-basalt-hit`)
|
|
821
781
|
// still toggles it. Checkbox/Radio boxes are bare <input>s under a plain <div> — an overlay
|
|
822
782
|
// there would swallow clicks, so only their `label` (a real <label>) carries it.
|
|
823
|
-
Switch:
|
|
783
|
+
Switch: ext({
|
|
824
784
|
defaultProps: {
|
|
825
785
|
withThumbIndicator: false,
|
|
826
786
|
attributes: { track: HIT_ATTR }
|
|
@@ -830,7 +790,7 @@ function buildTheme(data, options = {}) {
|
|
|
830
790
|
// control chrome — it reads the divider token instead of the heavy gray-3/dark-4 line
|
|
831
791
|
// (controls.module.css; custom properties are stripped from `styles` objects). The active tab
|
|
832
792
|
// underline keeps `--tabs-color` (accent) untouched.
|
|
833
|
-
Tabs:
|
|
793
|
+
Tabs: ext({
|
|
834
794
|
classNames: { root: controlsClasses.tabsRoot },
|
|
835
795
|
// The on-color re-point (see below). Cast: Mantine's `TabsCssVariables` type declares only
|
|
836
796
|
// `--tabs-color` / `--tabs-radius`, yet Tabs' OWN varsResolver writes `--tabs-text-color` —
|
|
@@ -844,7 +804,7 @@ function buildTheme(data, options = {}) {
|
|
|
844
804
|
// foreground var. Theme `vars` merge AFTER a component's own `varsResolver` (Mantine
|
|
845
805
|
// `useStyles`), so re-pointing that var here wins on every render path. Without this, a dark-mode
|
|
846
806
|
// Checkbox/Radio paints a white checkmark on the light accent fill — invisible.
|
|
847
|
-
Checkbox:
|
|
807
|
+
Checkbox: ext({
|
|
848
808
|
defaultProps: { attributes: { label: HIT_ATTR } },
|
|
849
809
|
vars: (theme, props) => ({
|
|
850
810
|
root: {
|
|
@@ -854,7 +814,7 @@ function buildTheme(data, options = {}) {
|
|
|
854
814
|
}
|
|
855
815
|
})
|
|
856
816
|
}),
|
|
857
|
-
Radio:
|
|
817
|
+
Radio: ext({
|
|
858
818
|
defaultProps: { attributes: { label: HIT_ATTR } },
|
|
859
819
|
vars: (theme, props) => ({
|
|
860
820
|
root: {
|
|
@@ -862,7 +822,7 @@ function buildTheme(data, options = {}) {
|
|
|
862
822
|
}
|
|
863
823
|
})
|
|
864
824
|
}),
|
|
865
|
-
Pagination:
|
|
825
|
+
Pagination: ext({
|
|
866
826
|
vars: (theme, props) => ({
|
|
867
827
|
root: { "--pagination-active-color": onColorFor(theme, props) }
|
|
868
828
|
})
|
|
@@ -870,28 +830,28 @@ function buildTheme(data, options = {}) {
|
|
|
870
830
|
// `Pagination`'s own controls (prev/next/page buttons) resolve `PaginationControl`'s
|
|
871
831
|
// defaultProps independently of the parent — `data-basalt-hit` here is what closes the
|
|
872
832
|
// gap Switch/Checkbox/Radio already close at their own theme entries.
|
|
873
|
-
PaginationControl:
|
|
833
|
+
PaginationControl: ext({
|
|
874
834
|
defaultProps: { ...HIT_ATTR }
|
|
875
835
|
}),
|
|
876
|
-
Stepper:
|
|
836
|
+
Stepper: ext({
|
|
877
837
|
vars: (theme, props) => ({ root: { "--stepper-icon-color": onColorFor(theme, props) } })
|
|
878
838
|
}),
|
|
879
|
-
Indicator:
|
|
839
|
+
Indicator: ext({
|
|
880
840
|
vars: (theme, props) => ({ root: { "--indicator-text-color": onColorFor(theme, props) } })
|
|
881
841
|
}),
|
|
882
842
|
// Accordion (default variant): hairline separators between items only — the color retune AND
|
|
883
843
|
// the last item's outer border-bottom drop both live in controls.module.css.
|
|
884
|
-
Accordion:
|
|
844
|
+
Accordion: ext({ classNames: { item: controlsClasses.accordionItem } }),
|
|
885
845
|
// Parents faint, separator line-colored — the current-page treatment (head font, weight) is a
|
|
886
846
|
// shell-level concern (AppBreadcrumbs), not this generic Mantine primitive.
|
|
887
|
-
Breadcrumbs:
|
|
847
|
+
Breadcrumbs: ext({
|
|
888
848
|
styles: {
|
|
889
849
|
breadcrumb: { color: "var(--vx-faint)" },
|
|
890
850
|
separator: { color: "var(--vx-surface-border)" }
|
|
891
851
|
}
|
|
892
852
|
}),
|
|
893
853
|
// Card idiom — same panel + shadow-card as every other surface.
|
|
894
|
-
Notification:
|
|
854
|
+
Notification: ext({
|
|
895
855
|
defaultProps: { radius: radius.floating },
|
|
896
856
|
styles: {
|
|
897
857
|
root: {
|
|
@@ -1015,7 +975,7 @@ function buildCssVariablesResolver(data) {
|
|
|
1015
975
|
// Links: Mantine reads the accent FILL shade (4.38:1 on the light page, under WCAG AA); the hover
|
|
1016
976
|
// accent is the next step darker and clears 4.5:1 on every light text surface.
|
|
1017
977
|
"--mantine-color-anchor": "var(--vx-accent-hover)",
|
|
1018
|
-
// `--app-shell-border-color` is set by `components.AppShell
|
|
978
|
+
// `--app-shell-border-color` is set by `components.AppShell` `vars` above — this
|
|
1019
979
|
// entry was dead (an element-level declaration always beats an inherited `:root` value).
|
|
1020
980
|
// THE strict-surface lever. Mantine components do NOT chain border/surface colors through
|
|
1021
981
|
// `--mantine-color-default-*`; each hardcodes a RAW ramp step (`--mantine-color-gray-{2,3,4}`
|
package/dist/unwrap.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `unwrap` — the transport-agnostic `{ data, error }` envelope (Eden Treaty, a raw fetch wrapper)
|
|
3
|
+
* to data. Throws the `error` branch (any value that is not `null`/`undefined`) and, when there is
|
|
4
|
+
* no error, on `null`/`undefined` data: a 204 or a silent transport failure must not resolve.
|
|
5
|
+
*
|
|
6
|
+
* One generic signature with a conditional return, so a bare `.then(unwrap)` callback keeps its
|
|
7
|
+
* type (an overload pair resolves to `unknown` there). Pinned by `unwrap.type-guard.test.ts`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* queryFn: () => unwrap(api.users.get({ query: params }))
|
|
11
|
+
* const rows = unwrap(await api.users.get())
|
|
12
|
+
* const rows2 = await api.users.get().then(unwrap)
|
|
13
|
+
*/
|
|
14
|
+
export declare function unwrap<R extends Envelope | PromiseLike<Envelope>>(response: R): UnwrapResult<R>;
|
|
15
|
+
type Envelope<TData = unknown> = {
|
|
16
|
+
data: TData | null | undefined;
|
|
17
|
+
error: unknown;
|
|
18
|
+
};
|
|
19
|
+
/** A `Promise<TData>` for a promised envelope, `TData` for a resolved one; `NonNullable` is applied
|
|
20
|
+
* to the inferred `data` so it distributes over Eden's union of envelope shapes. */
|
|
21
|
+
type UnwrapResult<R> = R extends PromiseLike<{
|
|
22
|
+
data: infer TData;
|
|
23
|
+
error: unknown;
|
|
24
|
+
}> ? Promise<NonNullable<TData>> : R extends {
|
|
25
|
+
data: infer TData;
|
|
26
|
+
error: unknown;
|
|
27
|
+
} ? NonNullable<TData> : never;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=unwrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwrap.d.ts","sourceRoot":"","sources":["../src/unwrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAM/F;AAMD,KAAK,QAAQ,CAAC,KAAK,GAAG,OAAO,IAAI;IAAE,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAA;AAEnF;oFACoF;AACpF,KAAK,YAAY,CAAC,CAAC,IACjB,CAAC,SAAS,WAAW,CAAC;IAAE,IAAI,EAAE,MAAM,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,GACxD,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAC3B,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC7C,WAAW,CAAC,KAAK,CAAC,GAClB,KAAK,CAAA"}
|
package/dist/unwrap.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function unwrap(response) {
|
|
2
|
+
const result = isThenable(response) ? Promise.resolve(response).then(unwrapEnvelope) : unwrapEnvelope(response);
|
|
3
|
+
return result;
|
|
4
|
+
}
|
|
5
|
+
function isThenable(value) {
|
|
6
|
+
return typeof value.then === "function";
|
|
7
|
+
}
|
|
8
|
+
function unwrapEnvelope({ data, error }) {
|
|
9
|
+
if (error !== null && error !== void 0) throw error;
|
|
10
|
+
if (data === null || data === void 0)
|
|
11
|
+
throw new Error(
|
|
12
|
+
"unwrap: null/undefined data with no error \u2014 check for a 204 response or a transport failure"
|
|
13
|
+
);
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
unwrap
|
|
18
|
+
};
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v2.
|
|
1
|
+
# basalt-ui v2.13.0
|
|
2
2
|
# Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets
|
|
3
3
|
#
|
|
4
4
|
# Entry points: use the exact import specifier below; do not guess.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# A subpath's `Install:` line is its required peers; `OptionalPeers:` are import()-only, install on use.
|
|
14
14
|
|
|
15
15
|
Package: basalt-ui
|
|
16
|
-
Version: 2.
|
|
16
|
+
Version: 2.13.0
|
|
17
17
|
|
|
18
18
|
## basalt-ui
|
|
19
19
|
Import: import { ... } from 'basalt-ui'
|
|
@@ -202,11 +202,15 @@ Signature: WidgetHeader(props: WidgetHeaderProps): JSX.Element
|
|
|
202
202
|
sparkline?: ReactNode
|
|
203
203
|
count?: number
|
|
204
204
|
actions?: ReactNode
|
|
205
|
-
Signature:
|
|
205
|
+
Signature: basaltRouterOptions(options: RouterOptionsInput<NoContext> | undefined): BasaltRouterOptions<NoContext>
|
|
206
|
+
context?: (NoContext & ExtraContext)
|
|
207
|
+
query?: QueryClientConfig
|
|
208
|
+
Signature: createBasaltRouter(options: { routeTree: TRouteTree; history?: RouterHistory; basepath?: string; …): BasaltRouter<TRouteTree>
|
|
206
209
|
routeTree: TRouteTree
|
|
207
|
-
|
|
210
|
+
history?: RouterHistory
|
|
211
|
+
basepath?: string
|
|
212
|
+
context?: (NoContext & ExtraContext)
|
|
208
213
|
query?: QueryClientConfig
|
|
209
|
-
defaultViewTransition?: never
|
|
210
214
|
Signature: createBasaltTheme(overrides: Omit<PartialObjectDeep<MantineTheme, { recurseIntoArrays: false; allo…, options: CreateBasaltThemeOptions | undefined): PartialObjectDeep<Ma…
|
|
211
215
|
Signature: defineNav(config: "basalt: declare Register { router }"): NavConfig<G, T>
|
|
212
216
|
Signature: flattenNav(config: { groups: ReadonlyArray<AnyNavGroup>; }): FlatNavItem[]
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The resolved `node_modules/basalt-ui` a command acts on — a type-only leaf shared by `index` and `doctor-upgrade`. */
|
|
2
|
+
export type BasaltInstall = {
|
|
3
|
+
/** Absolute path of the resolved `node_modules/basalt-ui` directory, or null when unresolvable. */
|
|
4
|
+
dir: string | null
|
|
5
|
+
/** The resolved copy's own version, or null. */
|
|
6
|
+
version: string | null
|
|
7
|
+
/** How it was found — `null` when unresolved. `'workspace'` is the isolated-linker case. */
|
|
8
|
+
how: 'cwd' | 'ancestor' | 'workspace' | null
|
|
9
|
+
}
|
package/src/cli/check-theme.ts
CHANGED
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
OXLINT_NO_BIN,
|
|
29
29
|
oxlintBinResolves,
|
|
30
30
|
packageRoot,
|
|
31
|
-
parseJsonc,
|
|
32
31
|
readBasaltConfig,
|
|
33
32
|
readIfExists,
|
|
34
33
|
readSource,
|
|
@@ -38,6 +37,7 @@ import {
|
|
|
38
37
|
SERIES_MODULE_HINT_RE,
|
|
39
38
|
waiverHintFor,
|
|
40
39
|
} from './index'
|
|
40
|
+
import { parseJsonc } from './source-text'
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* What the `.oxlintrc.json` in `dir` does for the AST lane. A plugin load alone enables no rule, so
|