@krizaka/ui 3.43.0 → 3.44.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/dist/blocks.css +12 -0
- package/dist/chip.d.ts +6 -0
- package/dist/chip.js +7 -2
- package/dist/chip.js.map +1 -1
- package/dist/choice-grid.d.ts +5 -1
- package/dist/choice-grid.js +94 -30
- package/dist/choice-grid.js.map +1 -1
- package/dist/chunk-HHFWK2HH.js +163 -0
- package/dist/chunk-HHFWK2HH.js.map +1 -0
- package/dist/{chunk-AAP3U66V.js → chunk-KBQD6HE3.js} +2 -2
- package/dist/chunk-R3LTSMS5.js +75 -0
- package/dist/chunk-R3LTSMS5.js.map +1 -0
- package/dist/{chunk-S5LP7KKW.js → chunk-YHKTYFOQ.js} +2 -2
- package/dist/{chunk-WYQ277F2.js → chunk-ZQW7LF4Y.js} +2 -2
- package/dist/code-block.js +94 -31
- package/dist/code-block.js.map +1 -1
- package/dist/combobox.d.ts +6 -6
- package/dist/combobox.js +2 -2
- package/dist/data-table.js +3 -3
- package/dist/filter-bar.js +2 -2
- package/dist/genui.js +3 -3
- package/dist/nav-bar.js +3 -3
- package/dist/radio-group.d.ts +5 -1
- package/dist/radio-group.js +5 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/router.d.ts +51 -0
- package/dist/router.js +18 -0
- package/dist/router.js.map +1 -0
- package/dist/tabs.d.ts +42 -3
- package/dist/tabs.js +51 -3
- package/dist/tabs.js.map +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/tag-selector.js +1 -1
- package/package.json +18 -7
- package/registry/account-menu.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +32 -3
- package/registry/choice-grid.json +32 -3
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/router/use-route-state.d.ts +4 -0
- package/registry/examples/router/use-route-state.js +20 -0
- package/registry/examples/router/use-route-state.tsx +20 -0
- package/registry/examples/tabs/routes.d.ts +4 -0
- package/registry/examples/tabs/routes.js +16 -0
- package/registry/examples/tabs/routes.tsx +15 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +45 -11
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/radio-group.json +32 -3
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/router.json +123 -0
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/showcase.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +154 -7
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/waveform.json +1 -1
- package/dist/chunk-C3NF7V5Y.js +0 -100
- package/dist/chunk-C3NF7V5Y.js.map +0 -1
- /package/dist/{chunk-AAP3U66V.js.map → chunk-KBQD6HE3.js.map} +0 -0
- /package/dist/{chunk-S5LP7KKW.js.map → chunk-YHKTYFOQ.js.map} +0 -0
- /package/dist/{chunk-WYQ277F2.js.map → chunk-ZQW7LF4Y.js.map} +0 -0
package/dist/combobox.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ import * as React from 'react';
|
|
|
4
4
|
declare const combobox: tailwind_variants.TVReturnType<{
|
|
5
5
|
[key: string]: {
|
|
6
6
|
[key: string]: tailwind_variants.ClassValue | {
|
|
7
|
-
|
|
7
|
+
error?: tailwind_variants.ClassValue;
|
|
8
8
|
input?: tailwind_variants.ClassValue;
|
|
9
|
+
description?: tailwind_variants.ClassValue;
|
|
9
10
|
label?: tailwind_variants.ClassValue;
|
|
10
11
|
option?: tailwind_variants.ClassValue;
|
|
11
12
|
list?: tailwind_variants.ClassValue;
|
|
@@ -13,7 +14,6 @@ declare const combobox: tailwind_variants.TVReturnType<{
|
|
|
13
14
|
hint?: tailwind_variants.ClassValue;
|
|
14
15
|
root?: tailwind_variants.ClassValue;
|
|
15
16
|
check?: tailwind_variants.ClassValue;
|
|
16
|
-
error?: tailwind_variants.ClassValue;
|
|
17
17
|
control?: tailwind_variants.ClassValue;
|
|
18
18
|
icon?: tailwind_variants.ClassValue;
|
|
19
19
|
};
|
|
@@ -21,8 +21,9 @@ declare const combobox: tailwind_variants.TVReturnType<{
|
|
|
21
21
|
} | {
|
|
22
22
|
[x: string]: {
|
|
23
23
|
[x: string]: tailwind_variants.ClassValue | {
|
|
24
|
-
|
|
24
|
+
error?: tailwind_variants.ClassValue;
|
|
25
25
|
input?: tailwind_variants.ClassValue;
|
|
26
|
+
description?: tailwind_variants.ClassValue;
|
|
26
27
|
label?: tailwind_variants.ClassValue;
|
|
27
28
|
option?: tailwind_variants.ClassValue;
|
|
28
29
|
list?: tailwind_variants.ClassValue;
|
|
@@ -30,7 +31,6 @@ declare const combobox: tailwind_variants.TVReturnType<{
|
|
|
30
31
|
hint?: tailwind_variants.ClassValue;
|
|
31
32
|
root?: tailwind_variants.ClassValue;
|
|
32
33
|
check?: tailwind_variants.ClassValue;
|
|
33
|
-
error?: tailwind_variants.ClassValue;
|
|
34
34
|
control?: tailwind_variants.ClassValue;
|
|
35
35
|
icon?: tailwind_variants.ClassValue;
|
|
36
36
|
};
|
|
@@ -51,8 +51,9 @@ declare const combobox: tailwind_variants.TVReturnType<{
|
|
|
51
51
|
}, undefined, {
|
|
52
52
|
[key: string]: {
|
|
53
53
|
[key: string]: tailwind_variants.ClassValue | {
|
|
54
|
-
|
|
54
|
+
error?: tailwind_variants.ClassValue;
|
|
55
55
|
input?: tailwind_variants.ClassValue;
|
|
56
|
+
description?: tailwind_variants.ClassValue;
|
|
56
57
|
label?: tailwind_variants.ClassValue;
|
|
57
58
|
option?: tailwind_variants.ClassValue;
|
|
58
59
|
list?: tailwind_variants.ClassValue;
|
|
@@ -60,7 +61,6 @@ declare const combobox: tailwind_variants.TVReturnType<{
|
|
|
60
61
|
hint?: tailwind_variants.ClassValue;
|
|
61
62
|
root?: tailwind_variants.ClassValue;
|
|
62
63
|
check?: tailwind_variants.ClassValue;
|
|
63
|
-
error?: tailwind_variants.ClassValue;
|
|
64
64
|
control?: tailwind_variants.ClassValue;
|
|
65
65
|
icon?: tailwind_variants.ClassValue;
|
|
66
66
|
};
|
package/dist/combobox.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
Combobox,
|
|
4
4
|
combobox,
|
|
5
5
|
comboboxLabels
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-KBQD6HE3.js";
|
|
7
|
+
import "./chunk-HHFWK2HH.js";
|
|
8
8
|
import "./chunk-D3T54RSL.js";
|
|
9
9
|
import "./chunk-ZIXB33X7.js";
|
|
10
10
|
import "./chunk-FZBWEDQI.js";
|
package/dist/data-table.js
CHANGED
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
dataTableCsv,
|
|
10
10
|
dataTableLabels,
|
|
11
11
|
useDataTable
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YHKTYFOQ.js";
|
|
13
13
|
import "./chunk-YGIN2YIY.js";
|
|
14
14
|
import "./chunk-JXLDUDTD.js";
|
|
15
15
|
import "./chunk-3DHNN5V7.js";
|
|
16
16
|
import "./chunk-KVDB4GXV.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-ZQW7LF4Y.js";
|
|
18
|
+
import "./chunk-HHFWK2HH.js";
|
|
19
19
|
import "./chunk-D3T54RSL.js";
|
|
20
20
|
import "./chunk-J3NC6ER4.js";
|
|
21
21
|
import "./chunk-NSLXEDIS.js";
|
package/dist/filter-bar.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
filterBar,
|
|
6
6
|
readFilterParams,
|
|
7
7
|
writeFilterParams
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-ZQW7LF4Y.js";
|
|
9
|
+
import "./chunk-HHFWK2HH.js";
|
|
10
10
|
import "./chunk-D3T54RSL.js";
|
|
11
11
|
import "./chunk-J3NC6ER4.js";
|
|
12
12
|
import "./chunk-NSLXEDIS.js";
|
package/dist/genui.js
CHANGED
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
} from "./chunk-YKOLME7R.js";
|
|
8
8
|
import {
|
|
9
9
|
DataTable
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YHKTYFOQ.js";
|
|
11
11
|
import "./chunk-YGIN2YIY.js";
|
|
12
12
|
import "./chunk-JXLDUDTD.js";
|
|
13
13
|
import "./chunk-3DHNN5V7.js";
|
|
14
14
|
import "./chunk-KVDB4GXV.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-ZQW7LF4Y.js";
|
|
16
|
+
import "./chunk-HHFWK2HH.js";
|
|
17
17
|
import "./chunk-D3T54RSL.js";
|
|
18
18
|
import "./chunk-J3NC6ER4.js";
|
|
19
19
|
import {
|
package/dist/nav-bar.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
LanguageSwitch
|
|
4
|
+
} from "./chunk-VPO27AFS.js";
|
|
2
5
|
import {
|
|
3
6
|
FamilyMark,
|
|
4
7
|
GitHubGlyph,
|
|
5
8
|
familyLabels,
|
|
6
9
|
sitesByGroup
|
|
7
10
|
} from "./chunk-P4TTKYC4.js";
|
|
8
|
-
import {
|
|
9
|
-
LanguageSwitch
|
|
10
|
-
} from "./chunk-VPO27AFS.js";
|
|
11
11
|
import {
|
|
12
12
|
useSlidingIndicator
|
|
13
13
|
} from "./chunk-4QN5YJ3D.js";
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -80,9 +80,13 @@ type RadioGroupRootProps = React.ComponentProps<typeof RadioGroup$1.Root> & {
|
|
|
80
80
|
* @default "list"
|
|
81
81
|
*/
|
|
82
82
|
variant?: "list" | "cards" | "buttons" | "segmented";
|
|
83
|
+
/** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */
|
|
84
|
+
routeKey?: string;
|
|
85
|
+
/** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */
|
|
86
|
+
routeValues?: readonly string[];
|
|
83
87
|
};
|
|
84
88
|
/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */
|
|
85
|
-
declare function RadioGroupRoot({ label, invalid, variant, className, ...
|
|
89
|
+
declare function RadioGroupRoot({ label, invalid, variant, className, routeKey, routeValues, ...rest }: RadioGroupRootProps): React.JSX.Element;
|
|
86
90
|
type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroup$1.Item>, "children"> & {
|
|
87
91
|
/** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */
|
|
88
92
|
children?: React.ReactNode;
|
package/dist/radio-group.js
CHANGED
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
useSlidingIndicator
|
|
7
7
|
} from "./chunk-4QN5YJ3D.js";
|
|
8
|
+
import {
|
|
9
|
+
useRouteBinding
|
|
10
|
+
} from "./chunk-R3LTSMS5.js";
|
|
8
11
|
import {
|
|
9
12
|
tv
|
|
10
13
|
} from "./chunk-HJFRHYCI.js";
|
|
@@ -39,7 +42,8 @@ var radioGroup = tv({
|
|
|
39
42
|
defaultVariants: { variant: "list" }
|
|
40
43
|
});
|
|
41
44
|
var s = radioGroup();
|
|
42
|
-
function RadioGroupRoot({ label, invalid, variant = "list", className, ...
|
|
45
|
+
function RadioGroupRoot({ label, invalid, variant = "list", className, routeKey, routeValues, ...rest }) {
|
|
46
|
+
const props = useRouteBinding(routeKey, routeValues, rest);
|
|
43
47
|
const { ref } = useSlidingIndicator({ item: "[role=radio]", active: "[role=radio][data-state=checked]" });
|
|
44
48
|
const segmented = variant === "segmented";
|
|
45
49
|
return /* @__PURE__ */ jsx(
|
package/dist/radio-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/radio-group/radio-group.tsx"],"sourcesContent":["// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-strong bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-strong bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, ...props }: RadioGroupRootProps) {\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: RadioGroupButtonProps) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n"],"mappings":";;;;;;;;;;;;;AAMA,SAAS,cAAc,2BAA2B;AA6E9C,cA2BA,YA3BA;AAtEG,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MACE;AAAA,IAGF,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MACE;AAAA;AAAA,IAKF,WACE;AAAA;AAAA,IAGF,QACE;AAAA,IAQF,YAAY;AAAA,IACZ,WACE;AAAA,IAIF,SACE;AAAA,EAIJ;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM,CAAC;AAAA,MACP,OAAO,EAAE,MAAM,uDAAuD;AAAA,MACtE,SAAS,EAAE,MAAM,8BAA8B;AAAA,MAC/C,WAAW,CAAC;AAAA,IACd;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,OAAO;AACrC,CAAC;AACD,IAAM,IAAI,WAAW;AAgBd,SAAS,eAAe,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AU,MAAC,WAAU,6CAClD,8BAAC,cAAW,WAAU,WAAU,GAClC,GACF;AAAA,KACF;AAEJ;AAQO,SAAS,iBAAiB,EAAE,WAAW,UAAU,MAAM,GAAG,MAAM,GAA0B;AAC/F,SACE,qBAAC,oBAAoB,MAApB,EAAyB,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,SAAS,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAAE,CAAC,GAAI,GAAG,OAChH;AAAA,wBAAC,UAAM,UAAS;AAAA,IACf,OAAO,oBAAC,UAAK,WAAW,EAAE,WAAW,GAAI,gBAAK,IAAU;AAAA,KAC3D;AAEJ;AAGO,SAAS,kBAAkB,EAAE,WAAW,GAAG,MAAM,GAA0D;AAChH,SAAO,oBAAC,oBAAoB,MAApB,EAAyB,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACnF;AAGO,IAAM,aAAa,EAAE,MAAM,gBAAgB,MAAM,gBAAgB,MAAM,gBAAgB,QAAQ,kBAAkB,SAAS,kBAAkB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/radio-group/radio-group.tsx"],"sourcesContent":["// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-strong bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-strong bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n /** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */\n routeKey?: string;\n /** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, routeKey, routeValues, ...rest }: RadioGroupRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: RadioGroupButtonProps) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n"],"mappings":";;;;;;;;;;;;;;;;AAMA,SAAS,cAAc,2BAA2B;AAmF9C,cA2BA,YA3B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[]}
|
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/** How a router moves and reads the address: the browser's by default, your framework's through `RouteStateProvider`. */
|
|
4
|
+
interface RouteAdapter {
|
|
5
|
+
/** The current query string, with or without `?` (`""` on the server). */
|
|
6
|
+
search: () => string;
|
|
7
|
+
/** Go to `search` (`?type=bail`, or `""`), keeping the path and the hash; `replace` keeps the history as it is. */
|
|
8
|
+
navigate: (search: string, options: {
|
|
9
|
+
replace: boolean;
|
|
10
|
+
}) => void;
|
|
11
|
+
/** Calls `onChange` when the address changes under you (back, forward, another navigation); returns the unsubscribe. */
|
|
12
|
+
subscribe: (onChange: () => void) => () => void;
|
|
13
|
+
}
|
|
14
|
+
/** The History API: any web app (Vite, a static site). Next.js apps pass their router's adapter once, in the layout. */
|
|
15
|
+
declare const browserAdapter: RouteAdapter;
|
|
16
|
+
interface RouteStateProviderProps {
|
|
17
|
+
/** How your router reads the query string, navigates and tells about changes. */
|
|
18
|
+
adapter: RouteAdapter;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/** Gives `useRouteState` your router: `<RouteStateProvider adapter={nextAdapter}>` once, in the root layout. */
|
|
22
|
+
declare function RouteStateProvider({ adapter, children }: RouteStateProviderProps): React.JSX.Element;
|
|
23
|
+
interface RouteStateOptions<V extends string> {
|
|
24
|
+
/** The values the parameter may hold, as a const list: anything else in the address reads as the default. Omit for free text. */
|
|
25
|
+
values?: readonly V[];
|
|
26
|
+
/** The value when the parameter is absent. It is never written to the address (a clean URL). */
|
|
27
|
+
default: V;
|
|
28
|
+
/** `push` (the default) keeps each change in the history, `replace` overwrites it: use `replace` for a filter typed or toggled in passing. */
|
|
29
|
+
history?: "push" | "replace";
|
|
30
|
+
}
|
|
31
|
+
/** The value a query string holds for `key`, checked against `values`. Pure: the hook and the tests share it. */
|
|
32
|
+
declare function readRouteValue<V extends string>(search: string, key: string, { values, default: fallback }: Pick<RouteStateOptions<V>, "values" | "default">): V;
|
|
33
|
+
/** The query string with `key` set to `value` (removed when it is the default); every other parameter is kept. Pure. */
|
|
34
|
+
declare function writeRouteValue(search: string, key: string, value: string, fallback: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* A value kept in the URL's search parameter `key`: `const [type, setType] = useRouteState("type", { values: TYPES, default: "auto" })`
|
|
37
|
+
* with `const TYPES = ["auto", "lease", "contract", "invoice", "other"] as const`. The value is typed from the list, an
|
|
38
|
+
* unknown one in the address reads as the default, the default is not written, other parameters are kept.
|
|
39
|
+
* `key` undefined makes the hook inert (it returns the default) so a component can call it unconditionally.
|
|
40
|
+
*/
|
|
41
|
+
declare function useRouteState<V extends string>(key: string | undefined, { values, default: fallback, history }: RouteStateOptions<V>): readonly [V, (next: V) => void];
|
|
42
|
+
/** What a selection component spreads on its root: `value` and `onValueChange` bound to the URL when `routeKey` is set. */
|
|
43
|
+
interface RouteBindable {
|
|
44
|
+
value?: string | null;
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
onValueChange?: (value: string) => void;
|
|
47
|
+
}
|
|
48
|
+
/** The props of a selection component bound to the URL (`routeKey`), or its own, unchanged, when there is no `routeKey`. */
|
|
49
|
+
declare function useRouteBinding<P extends RouteBindable>(routeKey: string | undefined, routeValues: readonly string[] | undefined, props: P): P;
|
|
50
|
+
|
|
51
|
+
export { type RouteAdapter, type RouteBindable, type RouteStateOptions, RouteStateProvider, type RouteStateProviderProps, browserAdapter, readRouteValue, useRouteBinding, useRouteState, writeRouteValue };
|
package/dist/router.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
RouteStateProvider,
|
|
4
|
+
browserAdapter,
|
|
5
|
+
readRouteValue,
|
|
6
|
+
useRouteBinding,
|
|
7
|
+
useRouteState,
|
|
8
|
+
writeRouteValue
|
|
9
|
+
} from "./chunk-R3LTSMS5.js";
|
|
10
|
+
export {
|
|
11
|
+
RouteStateProvider,
|
|
12
|
+
browserAdapter,
|
|
13
|
+
readRouteValue,
|
|
14
|
+
useRouteBinding,
|
|
15
|
+
useRouteState,
|
|
16
|
+
writeRouteValue
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/tabs.d.ts
CHANGED
|
@@ -68,19 +68,58 @@ type TabsVariants = VariantProps<typeof tabs>;
|
|
|
68
68
|
type TabsRootProps = React.ComponentProps<typeof Tabs$1.Root> & {
|
|
69
69
|
/** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections). */
|
|
70
70
|
variant?: TabsVariants["variant"];
|
|
71
|
+
/** Binds the active tab to this search parameter of the URL (`?tab=…`): the URL is the state. Without it the state is local — only for an ephemeral choice. */
|
|
72
|
+
routeKey?: string;
|
|
73
|
+
/** The values the parameter may hold (the tabs' `value`s); the first is the default unless `defaultValue` says otherwise. */
|
|
74
|
+
routeValues?: readonly string[];
|
|
71
75
|
};
|
|
72
76
|
/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */
|
|
73
|
-
declare function TabsRoot({ variant, className, ...
|
|
77
|
+
declare function TabsRoot({ variant, className, routeKey, routeValues, ...rest }: TabsRootProps): React.JSX.Element;
|
|
74
78
|
/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */
|
|
75
79
|
declare function TabsList({ className, ...props }: React.ComponentProps<typeof Tabs$1.List>): React.JSX.Element;
|
|
76
80
|
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): React.JSX.Element;
|
|
77
81
|
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Content>): React.JSX.Element;
|
|
78
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Is the link `href` the tab of the route `current` (a path, with its search: `/docs/api?tab=x`)? The path must equal the
|
|
84
|
+
* link's (a trailing slash, a locale-free comparison and the hash do not count); with `exact` false (the default) a deeper
|
|
85
|
+
* path of the same section counts too (`/docs/api/x` is in `/docs/api`); every search parameter of the link must be in
|
|
86
|
+
* `current`. The hub link (`/`) is only ever active on `/` itself.
|
|
87
|
+
*/
|
|
88
|
+
declare function isTabActive(current: string, href: string, exact?: boolean): boolean;
|
|
89
|
+
type TabsNavProps = Omit<React.ComponentProps<"nav">, "children"> & {
|
|
90
|
+
/** The navigation's accessible name (« Sections »). */
|
|
91
|
+
label: string;
|
|
92
|
+
/** The current route, passed in: the path with its search (`usePathname()` + `useSearchParams()`, `/docs?tab=api`). The active tab comes from it; no local state. */
|
|
93
|
+
current: string;
|
|
94
|
+
/** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections). */
|
|
95
|
+
variant?: TabsVariants["variant"];
|
|
96
|
+
/** The tabs: `Tabs.NavLink`. */
|
|
97
|
+
children: React.ReactNode;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Tabs as routes: a `nav` of links, the URL is the state. Per WAI-ARIA these are links, not a tablist: each tab is an
|
|
101
|
+
* anchor, the active one carries `aria-current="page"`, the keyboard is the page's own (Tab walks the links, Enter
|
|
102
|
+
* follows one) and there is no panel — the page is the panel. The same looks and the same gliding light as `Tabs.List`.
|
|
103
|
+
*/
|
|
104
|
+
declare function TabsNav({ label, current, variant, className, children, ...props }: TabsNavProps): React.JSX.Element;
|
|
105
|
+
type TabsNavLinkProps = React.ComponentProps<"a"> & {
|
|
106
|
+
/** Where the tab goes (`/docs/api`, `/docs?tab=api`). */
|
|
107
|
+
href: string;
|
|
108
|
+
/** Match this path only, not the pages below it. */
|
|
109
|
+
exact?: boolean;
|
|
110
|
+
/** Renders your router's `<Link>` (pass it as the only child; the `href` goes on this part and on the link). */
|
|
111
|
+
asChild?: boolean;
|
|
112
|
+
};
|
|
113
|
+
/** One tab of `Tabs.Nav`: an anchor that is active when the current route is its `href`. */
|
|
114
|
+
declare function TabsNavLink({ href, exact, asChild, className, children, ...props }: TabsNavLinkProps): React.JSX.Element;
|
|
115
|
+
/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills on the root. `Tabs.Nav` + `Tabs.NavLink`: the same tabs as routes. */
|
|
79
116
|
declare const Tabs: {
|
|
80
117
|
Root: typeof TabsRoot;
|
|
81
118
|
List: typeof TabsList;
|
|
82
119
|
Trigger: typeof TabsTrigger;
|
|
83
120
|
Content: typeof TabsContent;
|
|
121
|
+
Nav: typeof TabsNav;
|
|
122
|
+
NavLink: typeof TabsNavLink;
|
|
84
123
|
};
|
|
85
124
|
|
|
86
|
-
export { Tabs, TabsContent, TabsList, TabsRoot, type TabsRootProps, TabsTrigger, type TabsVariants, tabs };
|
|
125
|
+
export { Tabs, TabsContent, TabsList, TabsNav, TabsNavLink, type TabsNavLinkProps, type TabsNavProps, TabsRoot, type TabsRootProps, TabsTrigger, type TabsVariants, isTabActive, tabs };
|
package/dist/tabs.js
CHANGED
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useSlidingIndicator
|
|
4
4
|
} from "./chunk-4QN5YJ3D.js";
|
|
5
|
+
import {
|
|
6
|
+
useRouteBinding
|
|
7
|
+
} from "./chunk-R3LTSMS5.js";
|
|
8
|
+
import {
|
|
9
|
+
cn
|
|
10
|
+
} from "./chunk-NSLXEDIS.js";
|
|
5
11
|
|
|
6
12
|
// src/tabs/tabs.tsx
|
|
7
|
-
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
13
|
+
import { Slot, Tabs as TabsPrimitive } from "radix-ui";
|
|
8
14
|
import * as React from "react";
|
|
9
15
|
import { tv } from "tailwind-variants";
|
|
10
16
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -39,7 +45,8 @@ var tabs = tv({
|
|
|
39
45
|
defaultVariants: { variant: "underline" }
|
|
40
46
|
});
|
|
41
47
|
var VariantContext = React.createContext("underline");
|
|
42
|
-
function TabsRoot({ variant = "underline", className, ...
|
|
48
|
+
function TabsRoot({ variant = "underline", className, routeKey, routeValues, ...rest }) {
|
|
49
|
+
const props = useRouteBinding(routeKey, routeValues, rest);
|
|
43
50
|
return /* @__PURE__ */ jsx(VariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { "data-variant": variant, className: tabs({ variant }).root({ className }), ...props }) });
|
|
44
51
|
}
|
|
45
52
|
function TabsList({ className, ...props }) {
|
|
@@ -54,13 +61,54 @@ function TabsTrigger({ className, ...props }) {
|
|
|
54
61
|
function TabsContent({ className, ...props }) {
|
|
55
62
|
return /* @__PURE__ */ jsx(TabsPrimitive.Content, { className: tabs().content({ className }), ...props });
|
|
56
63
|
}
|
|
57
|
-
|
|
64
|
+
function isTabActive(current, href, exact = false) {
|
|
65
|
+
const split = (value) => {
|
|
66
|
+
const url = new URL(value.split("#")[0], "https://tabs.invalid");
|
|
67
|
+
return { path: url.pathname.replace(/\/+$/, "") || "/", search: url.searchParams };
|
|
68
|
+
};
|
|
69
|
+
const here = split(current);
|
|
70
|
+
const target = split(href);
|
|
71
|
+
const samePath = here.path === target.path;
|
|
72
|
+
const deeper = !exact && target.path !== "/" && here.path.startsWith(`${target.path}/`);
|
|
73
|
+
if (!samePath && !deeper) return false;
|
|
74
|
+
for (const [key, value] of target.search) if (here.search.get(key) !== value) return false;
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
var NavContext = React.createContext(null);
|
|
78
|
+
function TabsNav({ label, current, variant = "underline", className, children, ...props }) {
|
|
79
|
+
const { ref } = useSlidingIndicator({ item: "[data-tabs-link]", active: "[data-tabs-link][data-state=active]" });
|
|
80
|
+
const value = React.useMemo(() => ({ current, variant }), [current, variant]);
|
|
81
|
+
return /* @__PURE__ */ jsx(NavContext.Provider, { value, children: /* @__PURE__ */ jsx("nav", { ref, "aria-label": label, "data-variant": variant, "data-orientation": "horizontal", className: tabs({ variant }).list({ className }), ...props, children }) });
|
|
82
|
+
}
|
|
83
|
+
function TabsNavLink({ href, exact, asChild, className, children, ...props }) {
|
|
84
|
+
const ctx = React.useContext(NavContext);
|
|
85
|
+
if (!ctx) throw new Error("Tabs.NavLink must be inside <Tabs.Nav>");
|
|
86
|
+
const active = isTabActive(ctx.current, href, exact);
|
|
87
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
Comp,
|
|
90
|
+
{
|
|
91
|
+
"data-tabs-link": "",
|
|
92
|
+
"data-state": active ? "active" : "inactive",
|
|
93
|
+
"data-orientation": "horizontal",
|
|
94
|
+
"aria-current": active ? "page" : void 0,
|
|
95
|
+
...asChild ? {} : { href },
|
|
96
|
+
className: cn(tabs({ variant: ctx.variant }).trigger(), "no-underline", className),
|
|
97
|
+
...props,
|
|
98
|
+
children
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
var Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent, Nav: TabsNav, NavLink: TabsNavLink };
|
|
58
103
|
export {
|
|
59
104
|
Tabs,
|
|
60
105
|
TabsContent,
|
|
61
106
|
TabsList,
|
|
107
|
+
TabsNav,
|
|
108
|
+
TabsNavLink,
|
|
62
109
|
TabsRoot,
|
|
63
110
|
TabsTrigger,
|
|
111
|
+
isTabActive,
|
|
64
112
|
tabs
|
|
65
113
|
};
|
|
66
114
|
//# sourceMappingURL=tabs.js.map
|
package/dist/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tabs/tabs.tsx"],"sourcesContent":["// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-tabs-panel min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent \" +\n \"data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 \" +\n \"data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) \" +\n \"data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 \" +\n \"data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)\",\n trigger:\n \"relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg \" +\n \"after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent \" +\n \"data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 \" +\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent\",\n },\n /* A view switch: equal segments in a track, the active one filled. */\n segmented: {\n list:\n \"inline-grid auto-cols-fr grid-flow-col gap-1 self-start rounded-xl border border-border-default bg-surface-1 p-1 data-[orientation=vertical]:grid-flow-row \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:bg-accent before:shadow-sm\",\n trigger:\n \"min-h-8 rounded-lg px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-2 hover:text-fg \" +\n \"data-[state=active]:bg-accent data-[state=active]:text-on-accent data-[state=active]:shadow-sm data-[state=active]:hover:bg-accent \" +\n \"transition-colors group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent group-data-[indicator=on]/tabs:data-[state=active]:shadow-none\",\n },\n /* Pills that scroll sideways on a phone: a feed's sections. */\n pills: {\n list:\n \"gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) \" +\n \"before:rounded-sm before:border before:border-accent before:bg-accent-soft\",\n trigger:\n \"h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent\",\n },\n },\n },\n defaultVariants: { variant: \"underline\" },\n});\n\nexport type TabsVariants = VariantProps<typeof tabs>;\ntype Variant = NonNullable<TabsVariants[\"variant\"]>;\n\nconst VariantContext = React.createContext<Variant>(\"underline\");\n\nexport type TabsRootProps = React.ComponentProps<typeof TabsPrimitive.Root> & {\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections). */\n variant?: TabsVariants[\"variant\"];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */\nexport function TabsRoot({ variant = \"underline\", className, ...props }: TabsRootProps) {\n return (\n <VariantContext.Provider value={variant}>\n <TabsPrimitive.Root data-variant={variant} className={tabs({ variant }).root({ className })} {...props} />\n </VariantContext.Provider>\n );\n}\n\n/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */\nexport function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n const variant = React.useContext(VariantContext);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=tab]\", active: \"[role=tab][data-state=active]\" });\n return <TabsPrimitive.List ref={ref} data-variant={variant} className={tabs({ variant }).list({ className })} {...props} />;\n}\n\nexport function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n const variant = React.useContext(VariantContext);\n return <TabsPrimitive.Trigger className={tabs({ variant }).trigger({ className })} {...props} />;\n}\n\nexport function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content className={tabs().content({ className })} {...props} />;\n}\n\n/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills on the root. */\nexport const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent };\n"],"mappings":";;;;;;AAEA,SAAS,QAAQ,qBAAqB;AACtC,YAAY,WAAW;AACvB,SAAS,UAA6B;AA2EhC;AAvEC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MAAM;AAAA;AAAA;AAAA,IAGN,MACE;AAAA,IAGF,SACE;AAAA,IAEF,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA;AAAA,MA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AO,EAAE,MAAM,UAAU,MAAM,UAAU,SAAS,aAAa,SAAS,YAAY;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/tabs/tabs.tsx"],"sourcesContent":["// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Slot, Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-tabs-panel min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent \" +\n \"data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 \" +\n \"data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) \" +\n \"data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 \" +\n \"data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)\",\n trigger:\n \"relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg \" +\n \"after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent \" +\n \"data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 \" +\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent\",\n },\n /* A view switch: equal segments in a track, the active one filled. */\n segmented: {\n list:\n \"inline-grid auto-cols-fr grid-flow-col gap-1 self-start rounded-xl border border-border-default bg-surface-1 p-1 data-[orientation=vertical]:grid-flow-row \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:bg-accent before:shadow-sm\",\n trigger:\n \"min-h-8 rounded-lg px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-2 hover:text-fg \" +\n \"data-[state=active]:bg-accent data-[state=active]:text-on-accent data-[state=active]:shadow-sm data-[state=active]:hover:bg-accent \" +\n \"transition-colors group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent group-data-[indicator=on]/tabs:data-[state=active]:shadow-none\",\n },\n /* Pills that scroll sideways on a phone: a feed's sections. */\n pills: {\n list:\n \"gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) \" +\n \"before:rounded-sm before:border before:border-accent before:bg-accent-soft\",\n trigger:\n \"h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent\",\n },\n },\n },\n defaultVariants: { variant: \"underline\" },\n});\n\nexport type TabsVariants = VariantProps<typeof tabs>;\ntype Variant = NonNullable<TabsVariants[\"variant\"]>;\n\nconst VariantContext = React.createContext<Variant>(\"underline\");\n\nexport type TabsRootProps = React.ComponentProps<typeof TabsPrimitive.Root> & {\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections). */\n variant?: TabsVariants[\"variant\"];\n /** Binds the active tab to this search parameter of the URL (`?tab=…`): the URL is the state. Without it the state is local — only for an ephemeral choice. */\n routeKey?: string;\n /** The values the parameter may hold (the tabs' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */\nexport function TabsRoot({ variant = \"underline\", className, routeKey, routeValues, ...rest }: TabsRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n return (\n <VariantContext.Provider value={variant}>\n <TabsPrimitive.Root data-variant={variant} className={tabs({ variant }).root({ className })} {...props} />\n </VariantContext.Provider>\n );\n}\n\n/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */\nexport function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n const variant = React.useContext(VariantContext);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=tab]\", active: \"[role=tab][data-state=active]\" });\n return <TabsPrimitive.List ref={ref} data-variant={variant} className={tabs({ variant }).list({ className })} {...props} />;\n}\n\nexport function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n const variant = React.useContext(VariantContext);\n return <TabsPrimitive.Trigger className={tabs({ variant }).trigger({ className })} {...props} />;\n}\n\nexport function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content className={tabs().content({ className })} {...props} />;\n}\n\n// ── Route mode: tabs that are links; the URL is the state (Oussama, 2026-10-22) ──────────────────────────────────────\n\n/**\n * Is the link `href` the tab of the route `current` (a path, with its search: `/docs/api?tab=x`)? The path must equal the\n * link's (a trailing slash, a locale-free comparison and the hash do not count); with `exact` false (the default) a deeper\n * path of the same section counts too (`/docs/api/x` is in `/docs/api`); every search parameter of the link must be in\n * `current`. The hub link (`/`) is only ever active on `/` itself.\n */\nexport function isTabActive(current: string, href: string, exact = false): boolean {\n const split = (value: string) => {\n const url = new URL(value.split(\"#\")[0]!, \"https://tabs.invalid\");\n return { path: url.pathname.replace(/\\/+$/, \"\") || \"/\", search: url.searchParams };\n };\n const here = split(current);\n const target = split(href);\n const samePath = here.path === target.path;\n const deeper = !exact && target.path !== \"/\" && here.path.startsWith(`${target.path}/`);\n if (!samePath && !deeper) return false;\n for (const [key, value] of target.search) if (here.search.get(key) !== value) return false;\n return true;\n}\n\ninterface NavState {\n current: string;\n variant: Variant;\n}\nconst NavContext = React.createContext<NavState | null>(null);\n\nexport type TabsNavProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** The navigation's accessible name (« Sections »). */\n label: string;\n /** The current route, passed in: the path with its search (`usePathname()` + `useSearchParams()`, `/docs?tab=api`). The active tab comes from it; no local state. */\n current: string;\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections). */\n variant?: TabsVariants[\"variant\"];\n /** The tabs: `Tabs.NavLink`. */\n children: React.ReactNode;\n};\n\n/**\n * Tabs as routes: a `nav` of links, the URL is the state. Per WAI-ARIA these are links, not a tablist: each tab is an\n * anchor, the active one carries `aria-current=\"page\"`, the keyboard is the page's own (Tab walks the links, Enter\n * follows one) and there is no panel — the page is the panel. The same looks and the same gliding light as `Tabs.List`.\n */\nexport function TabsNav({ label, current, variant = \"underline\", className, children, ...props }: TabsNavProps) {\n const { ref } = useSlidingIndicator<HTMLElement>({ item: \"[data-tabs-link]\", active: \"[data-tabs-link][data-state=active]\" });\n const value = React.useMemo(() => ({ current, variant }), [current, variant]);\n return (\n <NavContext.Provider value={value}>\n <nav ref={ref} aria-label={label} data-variant={variant} data-orientation=\"horizontal\" className={tabs({ variant }).list({ className })} {...props}>\n {children}\n </nav>\n </NavContext.Provider>\n );\n}\n\nexport type TabsNavLinkProps = React.ComponentProps<\"a\"> & {\n /** Where the tab goes (`/docs/api`, `/docs?tab=api`). */\n href: string;\n /** Match this path only, not the pages below it. */\n exact?: boolean;\n /** Renders your router's `<Link>` (pass it as the only child; the `href` goes on this part and on the link). */\n asChild?: boolean;\n};\n\n/** One tab of `Tabs.Nav`: an anchor that is active when the current route is its `href`. */\nexport function TabsNavLink({ href, exact, asChild, className, children, ...props }: TabsNavLinkProps) {\n const ctx = React.useContext(NavContext);\n if (!ctx) throw new Error(\"Tabs.NavLink must be inside <Tabs.Nav>\");\n const active = isTabActive(ctx.current, href, exact);\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <Comp\n data-tabs-link=\"\"\n data-state={active ? \"active\" : \"inactive\"}\n data-orientation=\"horizontal\"\n aria-current={active ? \"page\" : undefined}\n {...(asChild ? {} : { href })}\n className={cn(tabs({ variant: ctx.variant }).trigger(), \"no-underline\", className)}\n {...props}\n >\n {children}\n </Comp>\n );\n}\n\n/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills on the root. `Tabs.Nav` + `Tabs.NavLink`: the same tabs as routes. */\nexport const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent, Nav: TabsNav, NavLink: TabsNavLink };\n"],"mappings":";;;;;;;;;;;;AAEA,SAAS,MAAM,QAAQ,qBAAq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BAAc,SAAS,oBAAiB,cAAa,WAAW,KAAK,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAC1I,UACH,GACF;AAEJ;AAYO,SAAS,YAAY,EAAE,MAAM,OAAO,SAAS,WAAW,UAAU,GAAG,MAAM,GAAqB;AACrG,QAAM,MAAY,iBAAW,UAAU;AACvC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,wCAAwC;AAClE,QAAM,SAAS,YAAY,IAAI,SAAS,MAAM,KAAK;AACnD,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,kBAAe;AAAA,MACf,cAAY,SAAS,WAAW;AAAA,MAChC,oBAAiB;AAAA,MACjB,gBAAc,SAAS,SAAS;AAAA,MAC/B,GAAI,UAAU,CAAC,IAAI,EAAE,KAAK;AAAA,MAC3B,WAAW,GAAG,KAAK,EAAE,SAAS,IAAI,QAAQ,CAAC,EAAE,QAAQ,GAAG,gBAAgB,SAAS;AAAA,MAChF,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAGO,IAAM,OAAO,EAAE,MAAM,UAAU,MAAM,UAAU,SAAS,aAAa,SAAS,aAAa,KAAK,SAAS,SAAS,YAAY;","names":[]}
|
package/dist/tag-input.js
CHANGED
package/dist/tag-selector.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krizaka/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.44.0",
|
|
4
4
|
"description": "The Krizaka front-end platform's components: the primitives (button, card, dialog, toast, menu, field, tabs, chip, switch, slider, command palette, theme, countdown…) on the semantic --kz-* tokens, the animated marks (Krizaka, Orazaka, Orochia, Yasakia, Yororis) and the motion signature — web and /native.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"krizaka",
|
|
@@ -157,6 +157,10 @@
|
|
|
157
157
|
"types": "./dist/tabs.d.ts",
|
|
158
158
|
"import": "./dist/tabs.js"
|
|
159
159
|
},
|
|
160
|
+
"./router": {
|
|
161
|
+
"types": "./dist/router.d.ts",
|
|
162
|
+
"import": "./dist/router.js"
|
|
163
|
+
},
|
|
160
164
|
"./chip": {
|
|
161
165
|
"types": "./dist/chip.d.ts",
|
|
162
166
|
"import": "./dist/chip.js"
|
|
@@ -749,7 +753,7 @@
|
|
|
749
753
|
],
|
|
750
754
|
"peerDependencies": {
|
|
751
755
|
"@krizaka/query": ">=0.2.1",
|
|
752
|
-
"@krizaka/tailwind": ">=3.
|
|
756
|
+
"@krizaka/tailwind": ">=3.44.0",
|
|
753
757
|
"@maplibre/maplibre-react-native": ">=11",
|
|
754
758
|
"@shopify/flash-list": ">=2",
|
|
755
759
|
"expo-camera": ">=16",
|
|
@@ -809,7 +813,7 @@
|
|
|
809
813
|
"typescript": "^5.9.0",
|
|
810
814
|
"vitest": "^4.1.11",
|
|
811
815
|
"zod": "^4.6.5",
|
|
812
|
-
"@krizaka/config": "0.
|
|
816
|
+
"@krizaka/config": "0.6.0",
|
|
813
817
|
"@krizaka/query": "0.2.1"
|
|
814
818
|
},
|
|
815
819
|
"engines": {
|
|
@@ -1137,10 +1141,17 @@
|
|
|
1137
1141
|
"clsx"
|
|
1138
1142
|
]
|
|
1139
1143
|
},
|
|
1144
|
+
{
|
|
1145
|
+
"name": "./router",
|
|
1146
|
+
"path": "dist/router.js",
|
|
1147
|
+
"limit": "1.2 kB",
|
|
1148
|
+
"gzip": true,
|
|
1149
|
+
"rolldown": false
|
|
1150
|
+
},
|
|
1140
1151
|
{
|
|
1141
1152
|
"name": "./tabs",
|
|
1142
1153
|
"path": "dist/tabs.js",
|
|
1143
|
-
"limit": "
|
|
1154
|
+
"limit": "11.2 kB",
|
|
1144
1155
|
"gzip": true,
|
|
1145
1156
|
"ignore": [
|
|
1146
1157
|
"tailwind-variants",
|
|
@@ -2142,7 +2153,7 @@
|
|
|
2142
2153
|
{
|
|
2143
2154
|
"name": "./choice-grid",
|
|
2144
2155
|
"path": "dist/choice-grid.js",
|
|
2145
|
-
"limit": "
|
|
2156
|
+
"limit": "2.2 kB",
|
|
2146
2157
|
"gzip": true,
|
|
2147
2158
|
"ignore": [
|
|
2148
2159
|
"tailwind-variants",
|
|
@@ -2563,8 +2574,8 @@
|
|
|
2563
2574
|
"sonner": "^2.0.8",
|
|
2564
2575
|
"tailwind-variants": "^3.3.1",
|
|
2565
2576
|
"@krizaka/intl": "^0.2.1",
|
|
2566
|
-
"@krizaka/
|
|
2567
|
-
"@krizaka/
|
|
2577
|
+
"@krizaka/pacer": "^0.1.0",
|
|
2578
|
+
"@krizaka/tokens": "^3.44.0"
|
|
2568
2579
|
},
|
|
2569
2580
|
"scripts": {
|
|
2570
2581
|
"build": "node -e \"const fs=require('node:fs');fs.rmSync('dist',{recursive:true,force:true});for(const f of fs.readdirSync('registry/examples',{recursive:true}))if(/\\.(js|d\\.ts)$/.test(f))fs.rmSync('registry/examples/'+f)\" && tsup && node -e \"require('node:fs').copyFileSync('src/motion.css','dist/motion.css');require('node:fs').copyFileSync('src/blocks.css','dist/blocks.css');require('node:fs').copyFileSync('src/story.css','dist/story.css')\" && node scripts/build-registry.mjs",
|