@krizaka/ui 2.6.0 → 2.9.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/README.md +37 -4
- package/dist/achievement.d.ts +54 -0
- package/dist/achievement.js +73 -0
- package/dist/achievement.js.map +1 -0
- package/dist/app-shell.d.ts +203 -0
- package/dist/app-shell.js +137 -0
- package/dist/app-shell.js.map +1 -0
- package/dist/auth-layout.d.ts +136 -0
- package/dist/auth-layout.js +75 -0
- package/dist/auth-layout.js.map +1 -0
- package/dist/choice-grid.d.ts +84 -0
- package/dist/choice-grid.js +141 -0
- package/dist/choice-grid.js.map +1 -0
- package/dist/chunk-555LWYIN.js +11 -0
- package/dist/chunk-555LWYIN.js.map +1 -0
- package/dist/chunk-AZPKXP3O.js +36 -0
- package/dist/chunk-AZPKXP3O.js.map +1 -0
- package/dist/chunk-NOVUREEC.js +274 -0
- package/dist/chunk-NOVUREEC.js.map +1 -0
- package/dist/chunk-VCAAHCHL.js +17 -0
- package/dist/chunk-VCAAHCHL.js.map +1 -0
- package/dist/code-block.js +23 -44
- package/dist/code-block.js.map +1 -1
- package/dist/continue-prompt.d.ts +48 -0
- package/dist/continue-prompt.js +200 -0
- package/dist/continue-prompt.js.map +1 -0
- package/dist/dashboard-layout.d.ts +139 -0
- package/dist/dashboard-layout.js +68 -0
- package/dist/dashboard-layout.js.map +1 -0
- package/dist/detail-layout.d.ts +126 -0
- package/dist/detail-layout.js +48 -0
- package/dist/detail-layout.js.map +1 -0
- package/dist/docs-layout.d.ts +78 -0
- package/dist/docs-layout.js +60 -0
- package/dist/docs-layout.js.map +1 -0
- package/dist/geometry-CXrAW34x.d.ts +19 -0
- package/dist/goal-gauge.d.ts +38 -0
- package/dist/goal-gauge.js +53 -0
- package/dist/goal-gauge.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.js +89 -4
- package/dist/index.js.map +1 -1
- package/dist/landscape.d.ts +41 -0
- package/dist/landscape.js +836 -0
- package/dist/landscape.js.map +1 -0
- package/dist/marketing-layout.d.ts +60 -0
- package/dist/marketing-layout.js +25 -0
- package/dist/marketing-layout.js.map +1 -0
- package/dist/mascot-quote.d.ts +4 -3
- package/dist/mascot-quote.js +21 -1
- package/dist/mascot-quote.js.map +1 -1
- package/dist/mascot-state.d.ts +128 -0
- package/dist/mascot-state.js +95 -0
- package/dist/mascot-state.js.map +1 -0
- package/dist/mascots.d.ts +18 -20
- package/dist/mascots.js +65 -221
- package/dist/mascots.js.map +1 -1
- package/dist/native.d.ts +124 -7
- package/dist/native.js +641 -239
- package/dist/native.js.map +1 -1
- package/dist/profile-card.d.ts +85 -0
- package/dist/profile-card.js +87 -0
- package/dist/profile-card.js.map +1 -0
- package/dist/promise-card.d.ts +28 -0
- package/dist/promise-card.js +29 -0
- package/dist/promise-card.js.map +1 -0
- package/dist/scroll-stage.d.ts +603 -0
- package/dist/scroll-stage.js +59 -0
- package/dist/scroll-stage.js.map +1 -0
- package/dist/settings-layout.d.ts +154 -0
- package/dist/settings-layout.js +57 -0
- package/dist/settings-layout.js.map +1 -0
- package/dist/split-view.d.ts +106 -0
- package/dist/split-view.js +41 -0
- package/dist/split-view.js.map +1 -0
- package/dist/stage-banner.d.ts +34 -0
- package/dist/stage-banner.js +26 -0
- package/dist/stage-banner.js.map +1 -0
- package/dist/story-variant-CLn4H5Nt.d.ts +4 -0
- package/dist/story.css +432 -0
- package/package.json +267 -10
- package/registry/achievement.json +322 -0
- package/registry/action-bar.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +451 -0
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +230 -0
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +5 -5
- package/registry/card-grid.json +5 -5
- package/registry/card.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +318 -0
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +3 -3
- package/registry/continue-prompt.json +312 -0
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +273 -0
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/detail-layout.json +233 -0
- package/registry/dialog.json +1 -1
- package/registry/docs-layout.json +148 -0
- package/registry/dropdown-menu.json +3 -3
- package/registry/empty-state.json +1 -1
- package/registry/examples/achievement/arcade.d.ts +4 -0
- package/registry/examples/achievement/arcade.js +15 -0
- package/registry/examples/achievement/arcade.tsx +12 -0
- package/registry/examples/achievement/milestones.d.ts +4 -0
- package/registry/examples/achievement/milestones.js +15 -0
- package/registry/examples/achievement/milestones.tsx +12 -0
- package/registry/examples/app-shell/admin-console.d.ts +4 -0
- package/registry/examples/app-shell/admin-console.js +52 -0
- package/registry/examples/app-shell/admin-console.tsx +64 -0
- package/registry/examples/app-shell/basic.d.ts +4 -0
- package/registry/examples/app-shell/basic.js +37 -0
- package/registry/examples/app-shell/basic.tsx +31 -0
- package/registry/examples/app-shell/orochia-studio.d.ts +4 -0
- package/registry/examples/app-shell/orochia-studio.js +89 -0
- package/registry/examples/app-shell/orochia-studio.tsx +101 -0
- package/registry/examples/auth-layout/onboarding.d.ts +4 -0
- package/registry/examples/auth-layout/onboarding.js +56 -0
- package/registry/examples/auth-layout/onboarding.tsx +47 -0
- package/registry/examples/auth-layout/sign-in.d.ts +4 -0
- package/registry/examples/auth-layout/sign-in.js +55 -0
- package/registry/examples/auth-layout/sign-in.tsx +47 -0
- package/registry/examples/auth-layout/verify.d.ts +4 -0
- package/registry/examples/auth-layout/verify.js +23 -0
- package/registry/examples/auth-layout/verify.tsx +19 -0
- package/registry/examples/choice-grid/line-up.d.ts +4 -0
- package/registry/examples/choice-grid/line-up.js +37 -0
- package/registry/examples/choice-grid/line-up.tsx +32 -0
- package/registry/examples/choice-grid/plans.d.ts +4 -0
- package/registry/examples/choice-grid/plans.js +28 -0
- package/registry/examples/choice-grid/plans.tsx +24 -0
- package/registry/examples/continue-prompt/arcade.d.ts +4 -0
- package/registry/examples/continue-prompt/arcade.js +28 -0
- package/registry/examples/continue-prompt/arcade.tsx +25 -0
- package/registry/examples/continue-prompt/offer.d.ts +4 -0
- package/registry/examples/continue-prompt/offer.js +24 -0
- package/registry/examples/continue-prompt/offer.tsx +19 -0
- package/registry/examples/dashboard-layout/orazaka-eric.d.ts +4 -0
- package/registry/examples/dashboard-layout/orazaka-eric.js +58 -0
- package/registry/examples/dashboard-layout/orazaka-eric.tsx +80 -0
- package/registry/examples/dashboard-layout/widgets.d.ts +4 -0
- package/registry/examples/dashboard-layout/widgets.js +17 -0
- package/registry/examples/dashboard-layout/widgets.tsx +22 -0
- package/registry/examples/detail-layout/job.d.ts +4 -0
- package/registry/examples/detail-layout/job.js +25 -0
- package/registry/examples/detail-layout/job.tsx +20 -0
- package/registry/examples/detail-layout/video.d.ts +4 -0
- package/registry/examples/detail-layout/video.js +44 -0
- package/registry/examples/detail-layout/video.tsx +53 -0
- package/registry/examples/docs-layout/page.d.ts +4 -0
- package/registry/examples/docs-layout/page.js +26 -0
- package/registry/examples/docs-layout/page.tsx +30 -0
- package/registry/examples/goal-gauge/arcade.d.ts +4 -0
- package/registry/examples/goal-gauge/arcade.js +11 -0
- package/registry/examples/goal-gauge/arcade.tsx +10 -0
- package/registry/examples/goal-gauge/challenge.d.ts +4 -0
- package/registry/examples/goal-gauge/challenge.js +11 -0
- package/registry/examples/goal-gauge/challenge.tsx +10 -0
- package/registry/examples/goal-gauge/drain.d.ts +4 -0
- package/registry/examples/goal-gauge/drain.js +11 -0
- package/registry/examples/goal-gauge/drain.tsx +10 -0
- package/registry/examples/goal-gauge/native/default.d.ts +4 -0
- package/registry/examples/goal-gauge/native/default.dark.png +0 -0
- package/registry/examples/goal-gauge/native/default.js +15 -0
- package/registry/examples/goal-gauge/native/default.light.png +0 -0
- package/registry/examples/goal-gauge/native/default.tsx +12 -0
- package/registry/examples/landscape/backdrop.d.ts +4 -0
- package/registry/examples/landscape/backdrop.js +14 -0
- package/registry/examples/landscape/backdrop.tsx +11 -0
- package/registry/examples/landscape/brand.d.ts +4 -0
- package/registry/examples/landscape/brand.js +11 -0
- package/registry/examples/landscape/brand.tsx +10 -0
- package/registry/examples/marketing-layout/basic.d.ts +4 -0
- package/registry/examples/marketing-layout/basic.js +31 -0
- package/registry/examples/marketing-layout/basic.tsx +28 -0
- package/registry/examples/marketing-layout/docs-hub.d.ts +4 -0
- package/registry/examples/marketing-layout/docs-hub.js +37 -0
- package/registry/examples/marketing-layout/docs-hub.tsx +44 -0
- package/registry/examples/marketing-layout/pricing.d.ts +4 -0
- package/registry/examples/marketing-layout/pricing.js +45 -0
- package/registry/examples/marketing-layout/pricing.tsx +55 -0
- package/registry/examples/marketing-layout/product-page.d.ts +4 -0
- package/registry/examples/marketing-layout/product-page.js +79 -0
- package/registry/examples/marketing-layout/product-page.tsx +83 -0
- package/registry/examples/mascot-state/empty.d.ts +4 -0
- package/registry/examples/mascot-state/empty.js +22 -0
- package/registry/examples/mascot-state/empty.tsx +20 -0
- package/registry/examples/mascot-state/error.d.ts +4 -0
- package/registry/examples/mascot-state/error.js +23 -0
- package/registry/examples/mascot-state/error.tsx +21 -0
- package/registry/examples/mascot-state/loading.d.ts +4 -0
- package/registry/examples/mascot-state/loading.js +22 -0
- package/registry/examples/mascot-state/loading.tsx +16 -0
- package/registry/examples/mascot-state/native/default.d.ts +4 -0
- package/registry/examples/mascot-state/native/default.dark.png +0 -0
- package/registry/examples/mascot-state/native/default.js +25 -0
- package/registry/examples/mascot-state/native/default.light.png +0 -0
- package/registry/examples/mascot-state/native/default.tsx +19 -0
- package/registry/examples/mascot-state/success.d.ts +4 -0
- package/registry/examples/mascot-state/success.js +21 -0
- package/registry/examples/mascot-state/success.tsx +19 -0
- package/registry/examples/mascot-state/welcome.d.ts +4 -0
- package/registry/examples/mascot-state/welcome.js +21 -0
- package/registry/examples/mascot-state/welcome.tsx +19 -0
- package/registry/examples/mascots/flock.tsx +1 -1
- package/registry/examples/mascots/lovebird.d.ts +4 -0
- package/registry/examples/mascots/lovebird.js +19 -0
- package/registry/examples/mascots/lovebird.tsx +18 -0
- package/registry/examples/mascots/native/lovebird.d.ts +4 -0
- package/registry/examples/mascots/native/lovebird.dark.png +0 -0
- package/registry/examples/mascots/native/lovebird.js +21 -0
- package/registry/examples/mascots/native/lovebird.light.png +0 -0
- package/registry/examples/mascots/native/lovebird.tsx +18 -0
- package/registry/examples/mascots/native/phoenix.d.ts +4 -0
- package/registry/examples/mascots/native/phoenix.dark.png +0 -0
- package/registry/examples/mascots/native/phoenix.js +21 -0
- package/registry/examples/mascots/native/phoenix.light.png +0 -0
- package/registry/examples/mascots/native/phoenix.tsx +18 -0
- package/registry/examples/mascots/phoenix.d.ts +4 -0
- package/registry/examples/mascots/phoenix.js +14 -0
- package/registry/examples/mascots/phoenix.tsx +11 -0
- package/registry/examples/profile-card/arcade.d.ts +4 -0
- package/registry/examples/profile-card/arcade.js +25 -0
- package/registry/examples/profile-card/arcade.tsx +19 -0
- package/registry/examples/profile-card/creator.d.ts +4 -0
- package/registry/examples/profile-card/creator.js +31 -0
- package/registry/examples/profile-card/creator.tsx +26 -0
- package/registry/examples/profile-card/match.d.ts +4 -0
- package/registry/examples/profile-card/match.js +25 -0
- package/registry/examples/profile-card/match.tsx +19 -0
- package/registry/examples/profile-card/native/default.d.ts +4 -0
- package/registry/examples/profile-card/native/default.dark.png +0 -0
- package/registry/examples/profile-card/native/default.js +27 -0
- package/registry/examples/profile-card/native/default.light.png +0 -0
- package/registry/examples/profile-card/native/default.tsx +22 -0
- package/registry/examples/promise-card/arcade.d.ts +4 -0
- package/registry/examples/promise-card/arcade.js +25 -0
- package/registry/examples/promise-card/arcade.tsx +19 -0
- package/registry/examples/promise-card/guarantee.d.ts +4 -0
- package/registry/examples/promise-card/guarantee.js +23 -0
- package/registry/examples/promise-card/guarantee.tsx +17 -0
- package/registry/examples/scroll-stage/arcade.d.ts +4 -0
- package/registry/examples/scroll-stage/arcade.js +16 -0
- package/registry/examples/scroll-stage/arcade.tsx +15 -0
- package/registry/examples/scroll-stage/chapters.d.ts +4 -0
- package/registry/examples/scroll-stage/chapters.js +25 -0
- package/registry/examples/scroll-stage/chapters.tsx +22 -0
- package/registry/examples/settings-layout/account.d.ts +4 -0
- package/registry/examples/settings-layout/account.js +51 -0
- package/registry/examples/settings-layout/account.tsx +50 -0
- package/registry/examples/settings-layout/sections.d.ts +4 -0
- package/registry/examples/settings-layout/sections.js +27 -0
- package/registry/examples/settings-layout/sections.tsx +24 -0
- package/registry/examples/split-view/empty.d.ts +4 -0
- package/registry/examples/split-view/empty.js +19 -0
- package/registry/examples/split-view/empty.tsx +13 -0
- package/registry/examples/split-view/messages.d.ts +4 -0
- package/registry/examples/split-view/messages.js +49 -0
- package/registry/examples/split-view/messages.tsx +52 -0
- package/registry/examples/stage-banner/round.d.ts +4 -0
- package/registry/examples/stage-banner/round.js +14 -0
- package/registry/examples/stage-banner/round.tsx +11 -0
- package/registry/examples/stage-banner/steps.d.ts +4 -0
- package/registry/examples/stage-banner/steps.js +14 -0
- package/registry/examples/stage-banner/steps.tsx +11 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +322 -0
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +337 -5
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landscape.json +189 -0
- package/registry/link-card.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/marketing-layout.json +172 -0
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +6 -6
- package/registry/mascot-state.json +1249 -0
- package/registry/mascots.json +140 -23
- package/registry/media-capture.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +3 -3
- package/registry/page.json +5 -5
- package/registry/pagination.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/profile-card.json +501 -0
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +228 -0
- package/registry/radio-group.json +1 -1
- package/registry/scroll-stage.json +197 -0
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/settings-layout.json +231 -0
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +233 -0
- package/registry/stage-banner.json +221 -0
- package/registry/stat.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.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/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
brandClass,
|
|
4
|
+
storyVariantClass
|
|
5
|
+
} from "./chunk-555LWYIN.js";
|
|
6
|
+
import {
|
|
7
|
+
cn
|
|
8
|
+
} from "./chunk-5AXLA4LK.js";
|
|
9
|
+
|
|
10
|
+
// src/scroll-stage/scroll-stage.tsx
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
var SCENE = "[data-kzs-scene]";
|
|
13
|
+
function ScrollStage({ as: Tag = "div", variant, threshold = 0.2, className, children, ...props }) {
|
|
14
|
+
const ref = React.useRef(null);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
const root = ref.current;
|
|
17
|
+
if (!root || typeof IntersectionObserver === "undefined") return;
|
|
18
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
19
|
+
const io = new IntersectionObserver(
|
|
20
|
+
(entries) => {
|
|
21
|
+
for (const entry of entries) {
|
|
22
|
+
const el = entry.target;
|
|
23
|
+
if (entry.isIntersecting) {
|
|
24
|
+
el.setAttribute("data-in", "");
|
|
25
|
+
el.setAttribute("data-live", "");
|
|
26
|
+
} else el.removeAttribute("data-live");
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{ threshold }
|
|
30
|
+
);
|
|
31
|
+
const watch = (scope) => scope.querySelectorAll(SCENE).forEach((el) => io.observe(el));
|
|
32
|
+
if (root.matches(SCENE)) io.observe(root);
|
|
33
|
+
watch(root);
|
|
34
|
+
const mo = new MutationObserver((records) => {
|
|
35
|
+
for (const record of records)
|
|
36
|
+
record.addedNodes.forEach((node) => {
|
|
37
|
+
if (!(node instanceof Element)) return;
|
|
38
|
+
if (node.matches(SCENE)) io.observe(node);
|
|
39
|
+
watch(node);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
mo.observe(root, { childList: true, subtree: true });
|
|
43
|
+
root.setAttribute("data-kzs-stage", "on");
|
|
44
|
+
return () => {
|
|
45
|
+
io.disconnect();
|
|
46
|
+
mo.disconnect();
|
|
47
|
+
root.removeAttribute("data-kzs-stage");
|
|
48
|
+
};
|
|
49
|
+
}, [threshold]);
|
|
50
|
+
return React.createElement(Tag, { ref, className: cn(storyVariantClass(variant), className), ...props }, children);
|
|
51
|
+
}
|
|
52
|
+
function Scene({ as: Tag = "section", brand, className, children, ...props }) {
|
|
53
|
+
return React.createElement(Tag, { "data-kzs-scene": "", className: cn(brandClass(brand), className) || void 0, ...props }, children);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
Scene,
|
|
57
|
+
ScrollStage
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=scroll-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/scroll-stage/scroll-stage.tsx"],"sourcesContent":["// Client. The conductor of a told page (story.css): chapters that play their entrance once, in order, when they first\n// come into view, and whose one slow loop runs only while they are on screen. One IntersectionObserver for the stage,\n// no animation frame, nothing at all under prefers-reduced-motion.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type { StoryVariant };\n\nconst SCENE = \"[data-kzs-scene]\";\n\ntype Polymorphic = \"div\" | \"main\" | \"article\" | \"section\";\n\nexport type ScrollStageProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The element the stage renders.\n * @default \"div\"\n */\n as?: Polymorphic;\n /**\n * The look of every storytelling component inside (each one can still set its own): `default` or `arcade`.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /**\n * How much of a scene must be visible before it plays (0–1).\n * @default 0.2\n */\n threshold?: number;\n};\n\n/**\n * Plays the scenes (`Scene`, or any `[data-kzs-scene]`) it contains: each one gets `data-in` once, when it first enters\n * the viewport — its parts then arrive in order (the visual, the announcement, the words: `data-kzs-reveal`) — and\n * `data-live` while it is visible, which runs its one loop. Until the stage has switched motion on, and under\n * `prefers-reduced-motion`, everything is visible and still.\n */\nexport function ScrollStage({ as: Tag = \"div\", variant, threshold = 0.2, className, children, ...props }: ScrollStageProps) {\n const ref = React.useRef<HTMLElement>(null);\n React.useEffect(() => {\n const root = ref.current;\n if (!root || typeof IntersectionObserver === \"undefined\") return;\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n const io = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const el = entry.target as HTMLElement;\n if (entry.isIntersecting) {\n el.setAttribute(\"data-in\", \"\");\n el.setAttribute(\"data-live\", \"\");\n } else el.removeAttribute(\"data-live\");\n }\n },\n { threshold },\n );\n const watch = (scope: ParentNode) => scope.querySelectorAll(SCENE).forEach((el) => io.observe(el));\n if (root.matches(SCENE)) io.observe(root);\n watch(root);\n const mo = new MutationObserver((records) => {\n for (const record of records)\n record.addedNodes.forEach((node) => {\n if (!(node instanceof Element)) return;\n if (node.matches(SCENE)) io.observe(node);\n watch(node);\n });\n });\n mo.observe(root, { childList: true, subtree: true });\n root.setAttribute(\"data-kzs-stage\", \"on\");\n return () => {\n io.disconnect();\n mo.disconnect();\n root.removeAttribute(\"data-kzs-stage\");\n };\n }, [threshold]);\n return React.createElement(Tag, { ref, className: cn(storyVariantClass(variant), className), ...props }, children);\n}\n\nexport type SceneProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The element the scene renders.\n * @default \"section\"\n */\n as?: Polymorphic | \"header\" | \"footer\" | \"li\";\n /** A brand scope for the scene (`orochia` → `.brand-orochia`): its accent and gradient become that brand's. */\n brand?: string;\n};\n\n/** A chapter of a `ScrollStage`: played once when it enters the viewport, its loop running while it is visible. */\nexport function Scene({ as: Tag = \"section\", brand, className, children, ...props }: SceneProps) {\n return React.createElement(Tag, { \"data-kzs-scene\": \"\", className: cn(brandClass(brand), className) || undefined, ...props }, children);\n}\n"],"mappings":";;;;;;;;;;AAGA,YAAY,WAAW;AAOvB,IAAM,QAAQ;AA4BP,SAAS,YAAY,EAAE,IAAI,MAAM,OAAO,SAAS,YAAY,KAAK,WAAW,UAAU,GAAG,MAAM,GAAqB;AAC1H,QAAM,MAAY,aAAoB,IAAI;AAC1C,EAAM,gBAAU,MAAM;AACpB,UAAM,OAAO,IAAI;AACjB,QAAI,CAAC,QAAQ,OAAO,yBAAyB,YAAa;AAC1D,QAAI,OAAO,WAAW,kCAAkC,EAAE,QAAS;AACnE,UAAM,KAAK,IAAI;AAAA,MACb,CAAC,YAAY;AACX,mBAAW,SAAS,SAAS;AAC3B,gBAAM,KAAK,MAAM;AACjB,cAAI,MAAM,gBAAgB;AACxB,eAAG,aAAa,WAAW,EAAE;AAC7B,eAAG,aAAa,aAAa,EAAE;AAAA,UACjC,MAAO,IAAG,gBAAgB,WAAW;AAAA,QACvC;AAAA,MACF;AAAA,MACA,EAAE,UAAU;AAAA,IACd;AACA,UAAM,QAAQ,CAAC,UAAsB,MAAM,iBAAiB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;AACjG,QAAI,KAAK,QAAQ,KAAK,EAAG,IAAG,QAAQ,IAAI;AACxC,UAAM,IAAI;AACV,UAAM,KAAK,IAAI,iBAAiB,CAAC,YAAY;AAC3C,iBAAW,UAAU;AACnB,eAAO,WAAW,QAAQ,CAAC,SAAS;AAClC,cAAI,EAAE,gBAAgB,SAAU;AAChC,cAAI,KAAK,QAAQ,KAAK,EAAG,IAAG,QAAQ,IAAI;AACxC,gBAAM,IAAI;AAAA,QACZ,CAAC;AAAA,IACL,CAAC;AACD,OAAG,QAAQ,MAAM,EAAE,WAAW,MAAM,SAAS,KAAK,CAAC;AACnD,SAAK,aAAa,kBAAkB,IAAI;AACxC,WAAO,MAAM;AACX,SAAG,WAAW;AACd,SAAG,WAAW;AACd,WAAK,gBAAgB,gBAAgB;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AACd,SAAa,oBAAc,KAAK,EAAE,KAAK,WAAW,GAAG,kBAAkB,OAAO,GAAG,SAAS,GAAG,GAAG,MAAM,GAAG,QAAQ;AACnH;AAaO,SAAS,MAAM,EAAE,IAAI,MAAM,WAAW,OAAO,WAAW,UAAU,GAAG,MAAM,GAAe;AAC/F,SAAa,oBAAc,KAAK,EAAE,kBAAkB,IAAI,WAAW,GAAG,WAAW,KAAK,GAAG,SAAS,KAAK,QAAW,GAAG,MAAM,GAAG,QAAQ;AACxI;","names":[]}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const settingsLayout: tailwind_variants.TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
7
|
+
root?: tailwind_variants.ClassValue;
|
|
8
|
+
head?: tailwind_variants.ClassValue;
|
|
9
|
+
title?: tailwind_variants.ClassValue;
|
|
10
|
+
description?: tailwind_variants.ClassValue;
|
|
11
|
+
columns?: tailwind_variants.ClassValue;
|
|
12
|
+
nav?: tailwind_variants.ClassValue;
|
|
13
|
+
navList?: tailwind_variants.ClassValue;
|
|
14
|
+
content?: tailwind_variants.ClassValue;
|
|
15
|
+
section?: tailwind_variants.ClassValue;
|
|
16
|
+
sectionHead?: tailwind_variants.ClassValue;
|
|
17
|
+
sectionTitle?: tailwind_variants.ClassValue;
|
|
18
|
+
sectionDescription?: tailwind_variants.ClassValue;
|
|
19
|
+
sectionBody?: tailwind_variants.ClassValue;
|
|
20
|
+
sectionFooter?: tailwind_variants.ClassValue;
|
|
21
|
+
navLink?: tailwind_variants.ClassValue;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
[x: string]: {
|
|
26
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
27
|
+
root?: tailwind_variants.ClassValue;
|
|
28
|
+
head?: tailwind_variants.ClassValue;
|
|
29
|
+
title?: tailwind_variants.ClassValue;
|
|
30
|
+
description?: tailwind_variants.ClassValue;
|
|
31
|
+
columns?: tailwind_variants.ClassValue;
|
|
32
|
+
nav?: tailwind_variants.ClassValue;
|
|
33
|
+
navList?: tailwind_variants.ClassValue;
|
|
34
|
+
content?: tailwind_variants.ClassValue;
|
|
35
|
+
section?: tailwind_variants.ClassValue;
|
|
36
|
+
sectionHead?: tailwind_variants.ClassValue;
|
|
37
|
+
sectionTitle?: tailwind_variants.ClassValue;
|
|
38
|
+
sectionDescription?: tailwind_variants.ClassValue;
|
|
39
|
+
sectionBody?: tailwind_variants.ClassValue;
|
|
40
|
+
sectionFooter?: tailwind_variants.ClassValue;
|
|
41
|
+
navLink?: tailwind_variants.ClassValue;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
} | {}, {
|
|
45
|
+
root: string;
|
|
46
|
+
head: string;
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
columns: string;
|
|
50
|
+
nav: string;
|
|
51
|
+
navList: string;
|
|
52
|
+
navLink: string;
|
|
53
|
+
content: string;
|
|
54
|
+
section: string;
|
|
55
|
+
sectionHead: string;
|
|
56
|
+
sectionTitle: string;
|
|
57
|
+
sectionDescription: string;
|
|
58
|
+
sectionBody: string;
|
|
59
|
+
sectionFooter: string;
|
|
60
|
+
}, undefined, {
|
|
61
|
+
[key: string]: {
|
|
62
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
63
|
+
root?: tailwind_variants.ClassValue;
|
|
64
|
+
head?: tailwind_variants.ClassValue;
|
|
65
|
+
title?: tailwind_variants.ClassValue;
|
|
66
|
+
description?: tailwind_variants.ClassValue;
|
|
67
|
+
columns?: tailwind_variants.ClassValue;
|
|
68
|
+
nav?: tailwind_variants.ClassValue;
|
|
69
|
+
navList?: tailwind_variants.ClassValue;
|
|
70
|
+
content?: tailwind_variants.ClassValue;
|
|
71
|
+
section?: tailwind_variants.ClassValue;
|
|
72
|
+
sectionHead?: tailwind_variants.ClassValue;
|
|
73
|
+
sectionTitle?: tailwind_variants.ClassValue;
|
|
74
|
+
sectionDescription?: tailwind_variants.ClassValue;
|
|
75
|
+
sectionBody?: tailwind_variants.ClassValue;
|
|
76
|
+
sectionFooter?: tailwind_variants.ClassValue;
|
|
77
|
+
navLink?: tailwind_variants.ClassValue;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
} | {}, {
|
|
81
|
+
root: string;
|
|
82
|
+
head: string;
|
|
83
|
+
title: string;
|
|
84
|
+
description: string;
|
|
85
|
+
columns: string;
|
|
86
|
+
nav: string;
|
|
87
|
+
navList: string;
|
|
88
|
+
navLink: string;
|
|
89
|
+
content: string;
|
|
90
|
+
section: string;
|
|
91
|
+
sectionHead: string;
|
|
92
|
+
sectionTitle: string;
|
|
93
|
+
sectionDescription: string;
|
|
94
|
+
sectionBody: string;
|
|
95
|
+
sectionFooter: string;
|
|
96
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
97
|
+
root: string;
|
|
98
|
+
head: string;
|
|
99
|
+
title: string;
|
|
100
|
+
description: string;
|
|
101
|
+
columns: string;
|
|
102
|
+
nav: string;
|
|
103
|
+
navList: string;
|
|
104
|
+
navLink: string;
|
|
105
|
+
content: string;
|
|
106
|
+
section: string;
|
|
107
|
+
sectionHead: string;
|
|
108
|
+
sectionTitle: string;
|
|
109
|
+
sectionDescription: string;
|
|
110
|
+
sectionBody: string;
|
|
111
|
+
sectionFooter: string;
|
|
112
|
+
}>>;
|
|
113
|
+
interface SettingsNavItem {
|
|
114
|
+
/** Its id (the anchor of a section on one long page). */
|
|
115
|
+
id: string;
|
|
116
|
+
/** Its words. */
|
|
117
|
+
label: string;
|
|
118
|
+
/** Where it leads: a page (`/settings/billing`) or an anchor (`#billing`). */
|
|
119
|
+
href: string;
|
|
120
|
+
/** Its icon (a signature icon). */
|
|
121
|
+
icon?: React.ReactNode;
|
|
122
|
+
/** The section shown now: `aria-current`. */
|
|
123
|
+
current?: boolean;
|
|
124
|
+
}
|
|
125
|
+
type SettingsLayoutProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
126
|
+
/** The screen's title (`Settings`). */
|
|
127
|
+
title?: React.ReactNode;
|
|
128
|
+
/** One sentence under it. */
|
|
129
|
+
description?: React.ReactNode;
|
|
130
|
+
/** The sections. */
|
|
131
|
+
nav: readonly SettingsNavItem[];
|
|
132
|
+
/** The navigation's accessible name (`Settings sections`). */
|
|
133
|
+
navLabel: string;
|
|
134
|
+
/** The app's link component for the sections (Next's `Link`); an `<a>` otherwise. */
|
|
135
|
+
linkAs?: React.ElementType;
|
|
136
|
+
/** The current section's forms (`SettingsSection`). */
|
|
137
|
+
children: React.ReactNode;
|
|
138
|
+
};
|
|
139
|
+
/** A settings screen: sections on the left (chips on a phone), forms on the right. */
|
|
140
|
+
declare function SettingsLayout({ title, description, nav, navLabel, linkAs: Link, className, children, ...props }: SettingsLayoutProps): React.JSX.Element;
|
|
141
|
+
type SettingsSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
142
|
+
/** The section's title: it names the region (and is its anchor's target when `id` is set). */
|
|
143
|
+
title: React.ReactNode;
|
|
144
|
+
/** What these settings change, in one sentence. */
|
|
145
|
+
description?: React.ReactNode;
|
|
146
|
+
/** At the foot: the section's own save (a Button), a note. */
|
|
147
|
+
footer?: React.ReactNode;
|
|
148
|
+
/** The fields. */
|
|
149
|
+
children: React.ReactNode;
|
|
150
|
+
};
|
|
151
|
+
/** A group of settings: a titled card with its fields and its own save. */
|
|
152
|
+
declare function SettingsSection({ title, description, footer, id, className, children, ...props }: SettingsSectionProps): React.JSX.Element;
|
|
153
|
+
|
|
154
|
+
export { SettingsLayout, type SettingsLayoutProps, type SettingsNavItem, SettingsSection, type SettingsSectionProps, settingsLayout };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/settings-layout/settings-layout.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var settingsLayout = tv({
|
|
6
|
+
slots: {
|
|
7
|
+
root: "flex w-full flex-col gap-6",
|
|
8
|
+
head: "flex flex-col gap-1",
|
|
9
|
+
title: "font-display text-2xl font-extrabold tracking-tight text-fg",
|
|
10
|
+
description: "max-w-2xl text-sm text-fg-secondary",
|
|
11
|
+
columns: "grid grid-cols-1 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-10",
|
|
12
|
+
nav: "-mx-4 overflow-x-auto px-4 [scrollbar-width:none] lg:mx-0 lg:overflow-visible lg:px-0",
|
|
13
|
+
navList: "flex w-max gap-2 lg:sticky lg:top-20 lg:w-auto lg:flex-col lg:gap-0.5",
|
|
14
|
+
navLink: "flex h-9 items-center gap-2.5 whitespace-nowrap rounded-full border border-border-default bg-surface-1 px-3.5 text-sm font-medium text-fg-secondary no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current]:border-accent aria-[current]:text-fg lg:rounded-lg lg:border-transparent lg:bg-transparent lg:px-3 lg:hover:bg-surface-2 lg:aria-[current]:bg-accent-soft [&>svg]:h-4 [&>svg]:w-4",
|
|
15
|
+
content: "flex min-w-0 flex-col gap-6",
|
|
16
|
+
section: "rounded-xl border border-border-default bg-surface-1",
|
|
17
|
+
sectionHead: "flex flex-col gap-1 px-5 pt-5",
|
|
18
|
+
sectionTitle: "text-base font-bold text-fg",
|
|
19
|
+
sectionDescription: "text-sm text-fg-secondary",
|
|
20
|
+
sectionBody: "flex flex-col gap-4 px-5 py-5",
|
|
21
|
+
sectionFooter: "flex flex-wrap items-center justify-end gap-2 border-t border-border-subtle bg-surface-2/40 px-5 py-3 rounded-b-xl"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var s = settingsLayout();
|
|
25
|
+
function SettingsLayout({ title, description, nav, navLabel, linkAs: Link = "a", className, children, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), ...props, children: [
|
|
27
|
+
(title || description) && /* @__PURE__ */ jsxs("div", { className: s.head(), children: [
|
|
28
|
+
title && /* @__PURE__ */ jsx("h1", { className: s.title(), children: title }),
|
|
29
|
+
description && /* @__PURE__ */ jsx("p", { className: s.description(), children: description })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsxs("div", { className: s.columns(), children: [
|
|
32
|
+
/* @__PURE__ */ jsx("nav", { "aria-label": navLabel, className: s.nav(), children: /* @__PURE__ */ jsx("ul", { className: s.navList(), children: nav.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Link, { href: item.href, className: s.navLink(), "aria-current": item.current ? item.href.startsWith("#") ? "location" : "page" : void 0, children: [
|
|
33
|
+
item.icon,
|
|
34
|
+
item.label
|
|
35
|
+
] }) }, item.id)) }) }),
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: s.content(), children })
|
|
37
|
+
] })
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
function SettingsSection({ title, description, footer, id, className, children, ...props }) {
|
|
41
|
+
const auto = React.useId();
|
|
42
|
+
const titleId = `${id ?? auto}-title`;
|
|
43
|
+
return /* @__PURE__ */ jsxs("section", { id, "aria-labelledby": titleId, className: s.section({ className }), ...props, children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: s.sectionHead(), children: [
|
|
45
|
+
/* @__PURE__ */ jsx("h2", { id: titleId, className: s.sectionTitle(), children: title }),
|
|
46
|
+
description && /* @__PURE__ */ jsx("p", { className: s.sectionDescription(), children: description })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: s.sectionBody(), children }),
|
|
49
|
+
footer && /* @__PURE__ */ jsx("div", { className: s.sectionFooter(), children: footer })
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
SettingsLayout,
|
|
54
|
+
SettingsSection,
|
|
55
|
+
settingsLayout
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=settings-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/settings-layout/settings-layout.tsx"],"sourcesContent":["// Server-safe. Settings, read from the products' account and administration screens: a list of sections on the left\n// (a row of chips that scrolls on a phone), the current section's forms on the right, each form a titled card with its\n// own save at the foot. The sections are links (one page each) or anchors (one long page).\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const settingsLayout = tv({\n slots: {\n root: \"flex w-full flex-col gap-6\",\n head: \"flex flex-col gap-1\",\n title: \"font-display text-2xl font-extrabold tracking-tight text-fg\",\n description: \"max-w-2xl text-sm text-fg-secondary\",\n columns: \"grid grid-cols-1 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-10\",\n nav: \"-mx-4 overflow-x-auto px-4 [scrollbar-width:none] lg:mx-0 lg:overflow-visible lg:px-0\",\n navList: \"flex w-max gap-2 lg:sticky lg:top-20 lg:w-auto lg:flex-col lg:gap-0.5\",\n navLink:\n \"flex h-9 items-center gap-2.5 whitespace-nowrap rounded-full border border-border-default bg-surface-1 px-3.5 text-sm font-medium text-fg-secondary no-underline \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current]:border-accent aria-[current]:text-fg \" +\n \"lg:rounded-lg lg:border-transparent lg:bg-transparent lg:px-3 lg:hover:bg-surface-2 lg:aria-[current]:bg-accent-soft [&>svg]:h-4 [&>svg]:w-4\",\n content: \"flex min-w-0 flex-col gap-6\",\n section: \"rounded-xl border border-border-default bg-surface-1\",\n sectionHead: \"flex flex-col gap-1 px-5 pt-5\",\n sectionTitle: \"text-base font-bold text-fg\",\n sectionDescription: \"text-sm text-fg-secondary\",\n sectionBody: \"flex flex-col gap-4 px-5 py-5\",\n sectionFooter: \"flex flex-wrap items-center justify-end gap-2 border-t border-border-subtle bg-surface-2/40 px-5 py-3 rounded-b-xl\",\n },\n});\nconst s = settingsLayout();\n\nexport interface SettingsNavItem {\n /** Its id (the anchor of a section on one long page). */\n id: string;\n /** Its words. */\n label: string;\n /** Where it leads: a page (`/settings/billing`) or an anchor (`#billing`). */\n href: string;\n /** Its icon (a signature icon). */\n icon?: React.ReactNode;\n /** The section shown now: `aria-current`. */\n current?: boolean;\n}\n\nexport type SettingsLayoutProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The screen's title (`Settings`). */\n title?: React.ReactNode;\n /** One sentence under it. */\n description?: React.ReactNode;\n /** The sections. */\n nav: readonly SettingsNavItem[];\n /** The navigation's accessible name (`Settings sections`). */\n navLabel: string;\n /** The app's link component for the sections (Next's `Link`); an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /** The current section's forms (`SettingsSection`). */\n children: React.ReactNode;\n};\n\n/** A settings screen: sections on the left (chips on a phone), forms on the right. */\nexport function SettingsLayout({ title, description, nav, navLabel, linkAs: Link = \"a\", className, children, ...props }: SettingsLayoutProps) {\n return (\n <div className={s.root({ className })} {...props}>\n {(title || description) && (\n <div className={s.head()}>\n {title && <h1 className={s.title()}>{title}</h1>}\n {description && <p className={s.description()}>{description}</p>}\n </div>\n )}\n <div className={s.columns()}>\n <nav aria-label={navLabel} className={s.nav()}>\n <ul className={s.navList()}>\n {nav.map((item) => (\n <li key={item.id}>\n <Link href={item.href} className={s.navLink()} aria-current={item.current ? (item.href.startsWith(\"#\") ? \"location\" : \"page\") : undefined}>\n {item.icon}\n {item.label}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n <div className={s.content()}>{children}</div>\n </div>\n </div>\n );\n}\n\nexport type SettingsSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** The section's title: it names the region (and is its anchor's target when `id` is set). */\n title: React.ReactNode;\n /** What these settings change, in one sentence. */\n description?: React.ReactNode;\n /** At the foot: the section's own save (a Button), a note. */\n footer?: React.ReactNode;\n /** The fields. */\n children: React.ReactNode;\n};\n\n/** A group of settings: a titled card with its fields and its own save. */\nexport function SettingsSection({ title, description, footer, id, className, children, ...props }: SettingsSectionProps) {\n const auto = React.useId();\n const titleId = `${id ?? auto}-title`;\n return (\n <section id={id} aria-labelledby={titleId} className={s.section({ className })} {...props}>\n <div className={s.sectionHead()}>\n <h2 id={titleId} className={s.sectionTitle()}>\n {title}\n </h2>\n {description && <p className={s.sectionDescription()}>{description}</p>}\n </div>\n <div className={s.sectionBody()}>{children}</div>\n {footer && <div className={s.sectionFooter()}>{footer}</div>}\n </section>\n );\n}\n"],"mappings":";AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AA2DX,SACY,KADZ;AAzDD,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,SAAS;AAAA,IACT,KAAK;AAAA,IACL,SAAS;AAAA,IACT,SACE;AAAA,IAGF,SAAS;AAAA,IACT,SAAS;AAAA,IACT,aAAa;AAAA,IACb,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,eAAe;AAAA,EACjB;AACF,CAAC;AACD,IAAM,IAAI,eAAe;AA+BlB,SAAS,eAAe,EAAE,OAAO,aAAa,KAAK,UAAU,QAAQ,OAAO,KAAK,WAAW,UAAU,GAAG,MAAM,GAAwB;AAC5I,SACE,qBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACvC;AAAA,cAAS,gBACT,qBAAC,SAAI,WAAW,EAAE,KAAK,GACpB;AAAA,eAAS,oBAAC,QAAG,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,MAC1C,eAAe,oBAAC,OAAE,WAAW,EAAE,YAAY,GAAI,uBAAY;AAAA,OAC9D;AAAA,IAEF,qBAAC,SAAI,WAAW,EAAE,QAAQ,GACxB;AAAA,0BAAC,SAAI,cAAY,UAAU,WAAW,EAAE,IAAI,GAC1C,8BAAC,QAAG,WAAW,EAAE,QAAQ,GACtB,cAAI,IAAI,CAAC,SACR,oBAAC,QACC,+BAAC,QAAK,MAAM,KAAK,MAAM,WAAW,EAAE,QAAQ,GAAG,gBAAc,KAAK,UAAW,KAAK,KAAK,WAAW,GAAG,IAAI,aAAa,SAAU,QAC7H;AAAA,aAAK;AAAA,QACL,KAAK;AAAA,SACR,KAJO,KAAK,EAKd,CACD,GACH,GACF;AAAA,MACA,oBAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,UAAS;AAAA,OACzC;AAAA,KACF;AAEJ;AAcO,SAAS,gBAAgB,EAAE,OAAO,aAAa,QAAQ,IAAI,WAAW,UAAU,GAAG,MAAM,GAAyB;AACvH,QAAM,OAAa,YAAM;AACzB,QAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,SACE,qBAAC,aAAQ,IAAQ,mBAAiB,SAAS,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAI,GAAG,OAClF;AAAA,yBAAC,SAAI,WAAW,EAAE,YAAY,GAC5B;AAAA,0BAAC,QAAG,IAAI,SAAS,WAAW,EAAE,aAAa,GACxC,iBACH;AAAA,MACC,eAAe,oBAAC,OAAE,WAAW,EAAE,mBAAmB,GAAI,uBAAY;AAAA,OACrE;AAAA,IACA,oBAAC,SAAI,WAAW,EAAE,YAAY,GAAI,UAAS;AAAA,IAC1C,UAAU,oBAAC,SAAI,WAAW,EAAE,cAAc,GAAI,kBAAO;AAAA,KACxD;AAEJ;","names":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const splitView: tailwind_variants.TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
7
|
+
list?: tailwind_variants.ClassValue;
|
|
8
|
+
listHead?: tailwind_variants.ClassValue;
|
|
9
|
+
listTitle?: tailwind_variants.ClassValue;
|
|
10
|
+
listBody?: tailwind_variants.ClassValue;
|
|
11
|
+
detail?: tailwind_variants.ClassValue;
|
|
12
|
+
detailHead?: tailwind_variants.ClassValue;
|
|
13
|
+
back?: tailwind_variants.ClassValue;
|
|
14
|
+
detailBody?: tailwind_variants.ClassValue;
|
|
15
|
+
empty?: tailwind_variants.ClassValue;
|
|
16
|
+
root?: tailwind_variants.ClassValue;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
[x: string]: {
|
|
21
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
22
|
+
list?: tailwind_variants.ClassValue;
|
|
23
|
+
listHead?: tailwind_variants.ClassValue;
|
|
24
|
+
listTitle?: tailwind_variants.ClassValue;
|
|
25
|
+
listBody?: tailwind_variants.ClassValue;
|
|
26
|
+
detail?: tailwind_variants.ClassValue;
|
|
27
|
+
detailHead?: tailwind_variants.ClassValue;
|
|
28
|
+
back?: tailwind_variants.ClassValue;
|
|
29
|
+
detailBody?: tailwind_variants.ClassValue;
|
|
30
|
+
empty?: tailwind_variants.ClassValue;
|
|
31
|
+
root?: tailwind_variants.ClassValue;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
} | {}, {
|
|
35
|
+
root: string;
|
|
36
|
+
list: string;
|
|
37
|
+
listHead: string;
|
|
38
|
+
listTitle: string;
|
|
39
|
+
listBody: string;
|
|
40
|
+
detail: string;
|
|
41
|
+
detailHead: string;
|
|
42
|
+
back: string;
|
|
43
|
+
detailBody: string;
|
|
44
|
+
empty: string;
|
|
45
|
+
}, undefined, {
|
|
46
|
+
[key: string]: {
|
|
47
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
48
|
+
list?: tailwind_variants.ClassValue;
|
|
49
|
+
listHead?: tailwind_variants.ClassValue;
|
|
50
|
+
listTitle?: tailwind_variants.ClassValue;
|
|
51
|
+
listBody?: tailwind_variants.ClassValue;
|
|
52
|
+
detail?: tailwind_variants.ClassValue;
|
|
53
|
+
detailHead?: tailwind_variants.ClassValue;
|
|
54
|
+
back?: tailwind_variants.ClassValue;
|
|
55
|
+
detailBody?: tailwind_variants.ClassValue;
|
|
56
|
+
empty?: tailwind_variants.ClassValue;
|
|
57
|
+
root?: tailwind_variants.ClassValue;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
} | {}, {
|
|
61
|
+
root: string;
|
|
62
|
+
list: string;
|
|
63
|
+
listHead: string;
|
|
64
|
+
listTitle: string;
|
|
65
|
+
listBody: string;
|
|
66
|
+
detail: string;
|
|
67
|
+
detailHead: string;
|
|
68
|
+
back: string;
|
|
69
|
+
detailBody: string;
|
|
70
|
+
empty: string;
|
|
71
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
72
|
+
root: string;
|
|
73
|
+
list: string;
|
|
74
|
+
listHead: string;
|
|
75
|
+
listTitle: string;
|
|
76
|
+
listBody: string;
|
|
77
|
+
detail: string;
|
|
78
|
+
detailHead: string;
|
|
79
|
+
back: string;
|
|
80
|
+
detailBody: string;
|
|
81
|
+
empty: string;
|
|
82
|
+
}>>;
|
|
83
|
+
type SplitViewProps = React.ComponentProps<"div"> & {
|
|
84
|
+
/** The list pane's title (`Messages`): it names the region. */
|
|
85
|
+
listTitle: React.ReactNode;
|
|
86
|
+
/** Actions in the list's head (a search, a filter, a new item). */
|
|
87
|
+
listActions?: React.ReactNode;
|
|
88
|
+
/** The items (a list of links, a DataTable). */
|
|
89
|
+
list: React.ReactNode;
|
|
90
|
+
/** The open item's head: its name, its actions. */
|
|
91
|
+
detailHead?: React.ReactNode;
|
|
92
|
+
/** The open item, or nothing. */
|
|
93
|
+
detail?: React.ReactNode;
|
|
94
|
+
/** What the detail pane says when nothing is open (desktop). */
|
|
95
|
+
empty?: React.ReactNode;
|
|
96
|
+
/** On a phone, the open item replaces the list. Usually: an item is selected in the address. */
|
|
97
|
+
showDetail?: boolean;
|
|
98
|
+
/** The way back to the list on a phone: your router's link (`<Link href="/inbox">Messages</Link>`). */
|
|
99
|
+
back?: React.ReactNode;
|
|
100
|
+
/** The list pane's accessible name when `listTitle` is not text. */
|
|
101
|
+
listLabel?: string;
|
|
102
|
+
};
|
|
103
|
+
/** A list and its open item: two panes on a desktop, one at a time on a phone. */
|
|
104
|
+
declare function SplitView({ listTitle, listActions, list, detailHead, detail, empty, showDetail, back, listLabel, className, ...props }: SplitViewProps): React.JSX.Element;
|
|
105
|
+
|
|
106
|
+
export { SplitView, type SplitViewProps, splitView };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/split-view/split-view.tsx
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var splitView = tv({
|
|
5
|
+
slots: {
|
|
6
|
+
root: "grid w-full min-h-[min(40rem,calc(100dvh-8rem))] overflow-hidden rounded-xl border border-border-default bg-surface-1 md:grid-cols-[minmax(16rem,22rem)_minmax(0,1fr)]",
|
|
7
|
+
list: "flex min-h-0 min-w-0 flex-col border-border-subtle md:border-r data-[hidden-on-phone]:hidden md:data-[hidden-on-phone]:flex",
|
|
8
|
+
listHead: "flex h-14 shrink-0 items-center gap-2 border-b border-border-subtle px-4",
|
|
9
|
+
listTitle: "text-sm font-bold text-fg",
|
|
10
|
+
listBody: "min-h-0 flex-1 overflow-y-auto",
|
|
11
|
+
detail: "flex min-h-0 min-w-0 flex-col bg-surface-0 data-[hidden-on-phone]:hidden md:data-[hidden-on-phone]:flex",
|
|
12
|
+
detailHead: "flex h-14 shrink-0 items-center gap-2 border-b border-border-subtle px-4",
|
|
13
|
+
back: "md:hidden",
|
|
14
|
+
detailBody: "min-h-0 flex-1 overflow-y-auto p-4 md:p-6",
|
|
15
|
+
empty: "flex flex-1 items-center justify-center p-8 text-center text-sm text-fg-secondary"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var s = splitView();
|
|
19
|
+
function SplitView({ listTitle, listActions, list, detailHead, detail, empty, showDetail = false, back, listLabel, className, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), ...props, children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("section", { className: s.list(), "aria-label": listLabel, "data-hidden-on-phone": showDetail ? "" : void 0, children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: s.listHead(), children: [
|
|
23
|
+
/* @__PURE__ */ jsx("h2", { className: s.listTitle(), children: listTitle }),
|
|
24
|
+
/* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center gap-1.5", children: listActions })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx("div", { className: s.listBody(), children: list })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsxs("section", { className: s.detail(), "data-hidden-on-phone": showDetail ? void 0 : "", children: [
|
|
29
|
+
(back || detailHead) && /* @__PURE__ */ jsxs("div", { className: s.detailHead(), children: [
|
|
30
|
+
back && /* @__PURE__ */ jsx("div", { className: s.back(), children: back }),
|
|
31
|
+
detailHead
|
|
32
|
+
] }),
|
|
33
|
+
detail ? /* @__PURE__ */ jsx("div", { className: s.detailBody(), children: detail }) : /* @__PURE__ */ jsx("div", { className: s.empty(), children: empty })
|
|
34
|
+
] })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
SplitView,
|
|
39
|
+
splitView
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=split-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/split-view/split-view.tsx"],"sourcesContent":["// Server-safe. A list and the item open beside it, read from the products' inboxes and queues (messages, moderation,\n// jobs): two panes on a desktop; on a phone one at a time — the list, or the open item with the way back — chosen by\n// `showDetail` (the address says which item is open: URL = state).\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const splitView = tv({\n slots: {\n root:\n \"grid w-full min-h-[min(40rem,calc(100dvh-8rem))] overflow-hidden rounded-xl border border-border-default bg-surface-1 \" +\n \"md:grid-cols-[minmax(16rem,22rem)_minmax(0,1fr)]\",\n list: \"flex min-h-0 min-w-0 flex-col border-border-subtle md:border-r data-[hidden-on-phone]:hidden md:data-[hidden-on-phone]:flex\",\n listHead: \"flex h-14 shrink-0 items-center gap-2 border-b border-border-subtle px-4\",\n listTitle: \"text-sm font-bold text-fg\",\n listBody: \"min-h-0 flex-1 overflow-y-auto\",\n detail: \"flex min-h-0 min-w-0 flex-col bg-surface-0 data-[hidden-on-phone]:hidden md:data-[hidden-on-phone]:flex\",\n detailHead: \"flex h-14 shrink-0 items-center gap-2 border-b border-border-subtle px-4\",\n back: \"md:hidden\",\n detailBody: \"min-h-0 flex-1 overflow-y-auto p-4 md:p-6\",\n empty: \"flex flex-1 items-center justify-center p-8 text-center text-sm text-fg-secondary\",\n },\n});\nconst s = splitView();\n\nexport type SplitViewProps = React.ComponentProps<\"div\"> & {\n /** The list pane's title (`Messages`): it names the region. */\n listTitle: React.ReactNode;\n /** Actions in the list's head (a search, a filter, a new item). */\n listActions?: React.ReactNode;\n /** The items (a list of links, a DataTable). */\n list: React.ReactNode;\n /** The open item's head: its name, its actions. */\n detailHead?: React.ReactNode;\n /** The open item, or nothing. */\n detail?: React.ReactNode;\n /** What the detail pane says when nothing is open (desktop). */\n empty?: React.ReactNode;\n /** On a phone, the open item replaces the list. Usually: an item is selected in the address. */\n showDetail?: boolean;\n /** The way back to the list on a phone: your router's link (`<Link href=\"/inbox\">Messages</Link>`). */\n back?: React.ReactNode;\n /** The list pane's accessible name when `listTitle` is not text. */\n listLabel?: string;\n};\n\n/** A list and its open item: two panes on a desktop, one at a time on a phone. */\nexport function SplitView({ listTitle, listActions, list, detailHead, detail, empty, showDetail = false, back, listLabel, className, ...props }: SplitViewProps) {\n return (\n <div className={s.root({ className })} {...props}>\n <section className={s.list()} aria-label={listLabel} data-hidden-on-phone={showDetail ? \"\" : undefined}>\n <div className={s.listHead()}>\n <h2 className={s.listTitle()}>{listTitle}</h2>\n <div className=\"ml-auto flex items-center gap-1.5\">{listActions}</div>\n </div>\n <div className={s.listBody()}>{list}</div>\n </section>\n <section className={s.detail()} data-hidden-on-phone={showDetail ? undefined : \"\"}>\n {(back || detailHead) && (\n <div className={s.detailHead()}>\n {back && <div className={s.back()}>{back}</div>}\n {detailHead}\n </div>\n )}\n {detail ? <div className={s.detailBody()}>{detail}</div> : <div className={s.empty()}>{empty}</div>}\n </section>\n </div>\n );\n}\n"],"mappings":";AAIA,SAAS,UAAU;AA8CX,SACE,KADF;AA5CD,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,MAAM;AAAA,IACN,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AACF,CAAC;AACD,IAAM,IAAI,UAAU;AAwBb,SAAS,UAAU,EAAE,WAAW,aAAa,MAAM,YAAY,QAAQ,OAAO,aAAa,OAAO,MAAM,WAAW,WAAW,GAAG,MAAM,GAAmB;AAC/J,SACE,qBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACzC;AAAA,yBAAC,aAAQ,WAAW,EAAE,KAAK,GAAG,cAAY,WAAW,wBAAsB,aAAa,KAAK,QAC3F;AAAA,2BAAC,SAAI,WAAW,EAAE,SAAS,GACzB;AAAA,4BAAC,QAAG,WAAW,EAAE,UAAU,GAAI,qBAAU;AAAA,QACzC,oBAAC,SAAI,WAAU,qCAAqC,uBAAY;AAAA,SAClE;AAAA,MACA,oBAAC,SAAI,WAAW,EAAE,SAAS,GAAI,gBAAK;AAAA,OACtC;AAAA,IACA,qBAAC,aAAQ,WAAW,EAAE,OAAO,GAAG,wBAAsB,aAAa,SAAY,IAC3E;AAAA,eAAQ,eACR,qBAAC,SAAI,WAAW,EAAE,WAAW,GAC1B;AAAA,gBAAQ,oBAAC,SAAI,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,QACxC;AAAA,SACH;AAAA,MAED,SAAS,oBAAC,SAAI,WAAW,EAAE,WAAW,GAAI,kBAAO,IAAS,oBAAC,SAAI,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,OAC/F;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as StoryVariant } from './story-variant-CLn4H5Nt.js';
|
|
3
|
+
|
|
4
|
+
type StageBannerProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
5
|
+
/** Where the reader is: “Step 02”, “Chapter 3”, “Final round”. */
|
|
6
|
+
stage: React.ReactNode;
|
|
7
|
+
/** `sm`: the name of the chapter, beside the stage. */
|
|
8
|
+
name?: React.ReactNode;
|
|
9
|
+
/** `lg`: the title under the stage. */
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/** `lg`: one line under the title. */
|
|
12
|
+
subtitle?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* `sm`: one line, before a chapter's heading. `lg`: centred, the stage above a title and a line — a section's opening.
|
|
15
|
+
* @default "sm"
|
|
16
|
+
*/
|
|
17
|
+
size?: "sm" | "lg";
|
|
18
|
+
/**
|
|
19
|
+
* The element of the `lg` title: a heading when the banner opens a section that has none.
|
|
20
|
+
* @default "p"
|
|
21
|
+
*/
|
|
22
|
+
titleAs?: "p" | "h2" | "h3";
|
|
23
|
+
/**
|
|
24
|
+
* `default`: a sober eyebrow. `arcade`: the stage call — a skewed plate that slams in, a light that sweeps it.
|
|
25
|
+
* @default "default"
|
|
26
|
+
*/
|
|
27
|
+
variant?: StoryVariant;
|
|
28
|
+
/** A brand scope (`orochia` → `.brand-orochia`). */
|
|
29
|
+
brand?: string;
|
|
30
|
+
};
|
|
31
|
+
/** Announces a chapter: a stage and its name on one line, or (`size="lg"`) a stage, a title and a line, centred. */
|
|
32
|
+
declare function StageBanner({ stage, name, title, subtitle, size, titleAs: Title, variant, brand, className, ...props }: StageBannerProps): React.JSX.Element;
|
|
33
|
+
|
|
34
|
+
export { StageBanner, type StageBannerProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
brandClass,
|
|
3
|
+
cn,
|
|
4
|
+
storyVariantClass
|
|
5
|
+
} from "./chunk-VCAAHCHL.js";
|
|
6
|
+
|
|
7
|
+
// src/stage-banner/stage-banner.tsx
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function StageBanner({ stage, name, title, subtitle, size = "sm", titleAs: Title = "p", variant, brand, className, ...props }) {
|
|
10
|
+
const cls = cn("kzs-banner", storyVariantClass(variant), brandClass(brand), className);
|
|
11
|
+
if (size === "lg")
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { "data-size": "lg", className: cls, ...props, children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-banner-stage", children: stage }),
|
|
14
|
+
title && /* @__PURE__ */ jsx(Title, { className: "kzs-banner-title", children: title }),
|
|
15
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "kzs-banner-sub", children: subtitle })
|
|
16
|
+
] });
|
|
17
|
+
return /* @__PURE__ */ jsxs("p", { className: cls, ...props, children: [
|
|
18
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-banner-stage", children: stage }),
|
|
19
|
+
name && /* @__PURE__ */ jsx("span", { className: "kzs-banner-name", children: name }),
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-banner-sweep", "aria-hidden": true })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
StageBanner
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=stage-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/stage-banner/stage-banner.tsx"],"sourcesContent":["// Server-safe. The announcement of a chapter (story.css): “Step 02 · Payments”, or, large, a round with its title and a\n// line under it. In a `Scene` of a `ScrollStage` it arrives once, after the scene's visual.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type StageBannerProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** Where the reader is: “Step 02”, “Chapter 3”, “Final round”. */\n stage: React.ReactNode;\n /** `sm`: the name of the chapter, beside the stage. */\n name?: React.ReactNode;\n /** `lg`: the title under the stage. */\n title?: React.ReactNode;\n /** `lg`: one line under the title. */\n subtitle?: React.ReactNode;\n /**\n * `sm`: one line, before a chapter's heading. `lg`: centred, the stage above a title and a line — a section's opening.\n * @default \"sm\"\n */\n size?: \"sm\" | \"lg\";\n /**\n * The element of the `lg` title: a heading when the banner opens a section that has none.\n * @default \"p\"\n */\n titleAs?: \"p\" | \"h2\" | \"h3\";\n /**\n * `default`: a sober eyebrow. `arcade`: the stage call — a skewed plate that slams in, a light that sweeps it.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /** A brand scope (`orochia` → `.brand-orochia`). */\n brand?: string;\n};\n\n/** Announces a chapter: a stage and its name on one line, or (`size=\"lg\"`) a stage, a title and a line, centred. */\nexport function StageBanner({ stage, name, title, subtitle, size = \"sm\", titleAs: Title = \"p\", variant, brand, className, ...props }: StageBannerProps) {\n const cls = cn(\"kzs-banner\", storyVariantClass(variant), brandClass(brand), className);\n if (size === \"lg\")\n return (\n <div data-size=\"lg\" className={cls} {...props}>\n <span className=\"kzs-banner-stage\">{stage}</span>\n {title && <Title className=\"kzs-banner-title\">{title}</Title>}\n {subtitle && <p className=\"kzs-banner-sub\">{subtitle}</p>}\n </div>\n );\n return (\n <p className={cls} {...props}>\n <span className=\"kzs-banner-stage\">{stage}</span>\n {name && <span className=\"kzs-banner-name\">{name}</span>}\n <span className=\"kzs-banner-sweep\" aria-hidden />\n </p>\n );\n}\n"],"mappings":";;;;;;;AAwCM,SACE,KADF;AAJC,SAAS,YAAY,EAAE,OAAO,MAAM,OAAO,UAAU,OAAO,MAAM,SAAS,QAAQ,KAAK,SAAS,OAAO,WAAW,GAAG,MAAM,GAAqB;AACtJ,QAAM,MAAM,GAAG,cAAc,kBAAkB,OAAO,GAAG,WAAW,KAAK,GAAG,SAAS;AACrF,MAAI,SAAS;AACX,WACE,qBAAC,SAAI,aAAU,MAAK,WAAW,KAAM,GAAG,OACtC;AAAA,0BAAC,UAAK,WAAU,oBAAoB,iBAAM;AAAA,MACzC,SAAS,oBAAC,SAAM,WAAU,oBAAoB,iBAAM;AAAA,MACpD,YAAY,oBAAC,OAAE,WAAU,kBAAkB,oBAAS;AAAA,OACvD;AAEJ,SACE,qBAAC,OAAE,WAAW,KAAM,GAAG,OACrB;AAAA,wBAAC,UAAK,WAAU,oBAAoB,iBAAM;AAAA,IACzC,QAAQ,oBAAC,UAAK,WAAU,mBAAmB,gBAAK;AAAA,IACjD,oBAAC,UAAK,WAAU,oBAAmB,eAAW,MAAC;AAAA,KACjD;AAEJ;","names":[]}
|