@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dashboard-layout/dashboard-layout.tsx"],"sourcesContent":["// Server-safe. A dashboard, read from the products' home screens (Orochia's creator studio, Orazaka's console for\n// Eric): the screen's heading with its actions and filters, then a responsive grid of widgets — one column on a phone,\n// two from `sm`, four from `xl`; a widget spans 1, 2, 3 columns or the full row, and keeps its order everywhere.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const dashboardLayout = tv({\n slots: {\n root: \"flex w-full flex-col gap-6\",\n head: \"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\",\n text: \"flex min-w-0 flex-col gap-1\",\n eyebrow: \"font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-fg-accent\",\n title: \"font-display text-2xl font-extrabold tracking-tight text-fg sm:text-[1.75rem]\",\n description: \"max-w-2xl text-sm text-fg-secondary\",\n actions: \"flex shrink-0 flex-wrap items-center gap-2\",\n toolbar: \"flex flex-wrap items-center gap-2\",\n grid: \"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\",\n widget: \"flex min-w-0 flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-4 sm:p-5\",\n widgetHead: \"flex items-start justify-between gap-3\",\n widgetTitle: \"text-sm font-semibold text-fg\",\n widgetDescription: \"mt-0.5 text-xs text-fg-secondary\",\n widgetBody: \"min-w-0 flex-1\",\n },\n variants: {\n span: {\n 1: { widget: \"\" },\n 2: { widget: \"sm:col-span-2\" },\n 3: { widget: \"sm:col-span-2 xl:col-span-3\" },\n full: { widget: \"sm:col-span-2 xl:col-span-4\" },\n },\n },\n defaultVariants: { span: 1 },\n});\nconst s = dashboardLayout();\n\nexport type DashboardLayoutProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The screen's title: `Good morning, Eric`. */\n title: React.ReactNode;\n /** A mono line above it (the workspace, the date). */\n eyebrow?: React.ReactNode;\n /** One sentence under it. */\n description?: React.ReactNode;\n /** The screen's actions (a primary Button, a DropdownMenu). */\n actions?: React.ReactNode;\n /** Under the heading: the period, the filters (Segmented tabs, a DateRangePicker, a FilterBar). */\n toolbar?: React.ReactNode;\n /**\n * The heading's level: `h1` when the dashboard is the screen, `h2` inside an AppShell whose header holds the h1.\n * @default \"h1\"\n */\n headingAs?: \"h1\" | \"h2\";\n /** The widgets (`Widget`), in reading order. */\n children: React.ReactNode;\n};\n\n/** A dashboard screen: heading, actions, filters, then the grid of widgets. */\nexport function DashboardLayout({ title, eyebrow, description, actions, toolbar, headingAs: H = \"h1\", className, children, ...props }: DashboardLayoutProps) {\n return (\n <div className={s.root({ className })} {...props}>\n <div className={s.head()}>\n <div className={s.text()}>\n {eyebrow && <p className={s.eyebrow()}>{eyebrow}</p>}\n <H className={s.title()}>{title}</H>\n {description && <p className={s.description()}>{description}</p>}\n </div>\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n {toolbar && <div className={s.toolbar()}>{toolbar}</div>}\n <div className={s.grid()}>{children}</div>\n </div>\n );\n}\n\nexport type WidgetProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** The widget's title: it names the region. */\n title: React.ReactNode;\n /** One line under the title (the period, the source). */\n description?: React.ReactNode;\n /** An action on the right of the title (`See all`). */\n action?: React.ReactNode;\n /**\n * The columns it takes: 1, 2, 3 or the full row (from `sm`; one column on a phone).\n * @default 1\n */\n span?: 1 | 2 | 3 | \"full\";\n /**\n * The title's level: one under the dashboard's heading — `2` under an `h1`, `3` inside an AppShell (`headingAs=\"h2\"`).\n * @default 2\n */\n level?: 2 | 3;\n /** The content: a Stat, a chart of @krizaka/charts, a DataTable, a list. */\n children: React.ReactNode;\n};\n\n/** A widget of the dashboard: a titled region on a card. */\nexport function Widget({ title, description, action, span = 1, level = 2, className, children, id, ...props }: WidgetProps) {\n const H = level === 2 ? \"h2\" : \"h3\";\n const sv = dashboardLayout({ span });\n const auto = React.useId();\n const titleId = `${id ?? auto}-title`;\n return (\n <section className={sv.widget({ className })} aria-labelledby={titleId} id={id} {...props}>\n <div className={s.widgetHead()}>\n <div className=\"min-w-0\">\n <H id={titleId} className={s.widgetTitle()}>\n {title}\n </H>\n {description && <p className={s.widgetDescription()}>{description}</p>}\n </div>\n {action}\n </div>\n <div className={s.widgetBody()}>{children}</div>\n </section>\n );\n}\n"],"mappings":";AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAwDX,SACc,KADd;AAtDD,IAAM,kBAAkB,GAAG;AAAA,EAChC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,IACP,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,YAAY;AAAA,EACd;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,GAAG,EAAE,QAAQ,GAAG;AAAA,MAChB,GAAG,EAAE,QAAQ,gBAAgB;AAAA,MAC7B,GAAG,EAAE,QAAQ,8BAA8B;AAAA,MAC3C,MAAM,EAAE,QAAQ,8BAA8B;AAAA,IAChD;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,MAAM,EAAE;AAC7B,CAAC;AACD,IAAM,IAAI,gBAAgB;AAuBnB,SAAS,gBAAgB,EAAE,OAAO,SAAS,aAAa,SAAS,SAAS,WAAW,IAAI,MAAM,WAAW,UAAU,GAAG,MAAM,GAAyB;AAC3J,SACE,qBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACzC;AAAA,yBAAC,SAAI,WAAW,EAAE,KAAK,GACrB;AAAA,2BAAC,SAAI,WAAW,EAAE,KAAK,GACpB;AAAA,mBAAW,oBAAC,OAAE,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,QAChD,oBAAC,KAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,QAC/B,eAAe,oBAAC,OAAE,WAAW,EAAE,YAAY,GAAI,uBAAY;AAAA,SAC9D;AAAA,MACC,WAAW,oBAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,OACpD;AAAA,IACC,WAAW,oBAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,IAClD,oBAAC,SAAI,WAAW,EAAE,KAAK,GAAI,UAAS;AAAA,KACtC;AAEJ;AAwBO,SAAS,OAAO,EAAE,OAAO,aAAa,QAAQ,OAAO,GAAG,QAAQ,GAAG,WAAW,UAAU,IAAI,GAAG,MAAM,GAAgB;AAC1H,QAAM,IAAI,UAAU,IAAI,OAAO;AAC/B,QAAM,KAAK,gBAAgB,EAAE,KAAK,CAAC;AACnC,QAAM,OAAa,YAAM;AACzB,QAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,SACE,qBAAC,aAAQ,WAAW,GAAG,OAAO,EAAE,UAAU,CAAC,GAAG,mBAAiB,SAAS,IAAS,GAAG,OAClF;AAAA,yBAAC,SAAI,WAAW,EAAE,WAAW,GAC3B;AAAA,2BAAC,SAAI,WAAU,WACb;AAAA,4BAAC,KAAE,IAAI,SAAS,WAAW,EAAE,YAAY,GACtC,iBACH;AAAA,QACC,eAAe,oBAAC,OAAE,WAAW,EAAE,kBAAkB,GAAI,uBAAY;AAAA,SACpE;AAAA,MACC;AAAA,OACH;AAAA,IACA,oBAAC,SAAI,WAAW,EAAE,WAAW,GAAI,UAAS;AAAA,KAC5C;AAEJ;","names":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const detailLayout: tailwind_variants.TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
7
|
+
root?: tailwind_variants.ClassValue;
|
|
8
|
+
back?: tailwind_variants.ClassValue;
|
|
9
|
+
header?: tailwind_variants.ClassValue;
|
|
10
|
+
media?: tailwind_variants.ClassValue;
|
|
11
|
+
text?: tailwind_variants.ClassValue;
|
|
12
|
+
eyebrow?: tailwind_variants.ClassValue;
|
|
13
|
+
titleRow?: tailwind_variants.ClassValue;
|
|
14
|
+
title?: tailwind_variants.ClassValue;
|
|
15
|
+
meta?: tailwind_variants.ClassValue;
|
|
16
|
+
actions?: tailwind_variants.ClassValue;
|
|
17
|
+
columns?: tailwind_variants.ClassValue;
|
|
18
|
+
main?: tailwind_variants.ClassValue;
|
|
19
|
+
aside?: tailwind_variants.ClassValue;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
[x: string]: {
|
|
24
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
25
|
+
root?: tailwind_variants.ClassValue;
|
|
26
|
+
back?: tailwind_variants.ClassValue;
|
|
27
|
+
header?: tailwind_variants.ClassValue;
|
|
28
|
+
media?: tailwind_variants.ClassValue;
|
|
29
|
+
text?: tailwind_variants.ClassValue;
|
|
30
|
+
eyebrow?: tailwind_variants.ClassValue;
|
|
31
|
+
titleRow?: tailwind_variants.ClassValue;
|
|
32
|
+
title?: tailwind_variants.ClassValue;
|
|
33
|
+
meta?: tailwind_variants.ClassValue;
|
|
34
|
+
actions?: tailwind_variants.ClassValue;
|
|
35
|
+
columns?: tailwind_variants.ClassValue;
|
|
36
|
+
main?: tailwind_variants.ClassValue;
|
|
37
|
+
aside?: tailwind_variants.ClassValue;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
} | {}, {
|
|
41
|
+
root: string;
|
|
42
|
+
back: string;
|
|
43
|
+
header: string;
|
|
44
|
+
media: string;
|
|
45
|
+
text: string;
|
|
46
|
+
eyebrow: string;
|
|
47
|
+
titleRow: string;
|
|
48
|
+
title: string;
|
|
49
|
+
meta: string;
|
|
50
|
+
actions: string;
|
|
51
|
+
columns: string;
|
|
52
|
+
main: string;
|
|
53
|
+
aside: string;
|
|
54
|
+
}, undefined, {
|
|
55
|
+
[key: string]: {
|
|
56
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
57
|
+
root?: tailwind_variants.ClassValue;
|
|
58
|
+
back?: tailwind_variants.ClassValue;
|
|
59
|
+
header?: tailwind_variants.ClassValue;
|
|
60
|
+
media?: tailwind_variants.ClassValue;
|
|
61
|
+
text?: tailwind_variants.ClassValue;
|
|
62
|
+
eyebrow?: tailwind_variants.ClassValue;
|
|
63
|
+
titleRow?: tailwind_variants.ClassValue;
|
|
64
|
+
title?: tailwind_variants.ClassValue;
|
|
65
|
+
meta?: tailwind_variants.ClassValue;
|
|
66
|
+
actions?: tailwind_variants.ClassValue;
|
|
67
|
+
columns?: tailwind_variants.ClassValue;
|
|
68
|
+
main?: tailwind_variants.ClassValue;
|
|
69
|
+
aside?: tailwind_variants.ClassValue;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
} | {}, {
|
|
73
|
+
root: string;
|
|
74
|
+
back: string;
|
|
75
|
+
header: string;
|
|
76
|
+
media: string;
|
|
77
|
+
text: string;
|
|
78
|
+
eyebrow: string;
|
|
79
|
+
titleRow: string;
|
|
80
|
+
title: string;
|
|
81
|
+
meta: string;
|
|
82
|
+
actions: string;
|
|
83
|
+
columns: string;
|
|
84
|
+
main: string;
|
|
85
|
+
aside: string;
|
|
86
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
87
|
+
root: string;
|
|
88
|
+
back: string;
|
|
89
|
+
header: string;
|
|
90
|
+
media: string;
|
|
91
|
+
text: string;
|
|
92
|
+
eyebrow: string;
|
|
93
|
+
titleRow: string;
|
|
94
|
+
title: string;
|
|
95
|
+
meta: string;
|
|
96
|
+
actions: string;
|
|
97
|
+
columns: string;
|
|
98
|
+
main: string;
|
|
99
|
+
aside: string;
|
|
100
|
+
}>>;
|
|
101
|
+
type DetailLayoutProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
102
|
+
/** The way back to the list: your router's link (`<Link href="/videos">Videos</Link>`), drawn with its arrow. */
|
|
103
|
+
back?: React.ReactNode;
|
|
104
|
+
/** A thumbnail, a cover or an avatar beside the name. */
|
|
105
|
+
media?: React.ReactNode;
|
|
106
|
+
/** A mono line above the name (the object's kind, its id). */
|
|
107
|
+
eyebrow?: React.ReactNode;
|
|
108
|
+
/** The object's name: the `h1`. */
|
|
109
|
+
title: React.ReactNode;
|
|
110
|
+
/** Beside the name: its status (a Badge). */
|
|
111
|
+
status?: React.ReactNode;
|
|
112
|
+
/** Under the name: its facts (the author, a date, a count — `Facts` or plain text). */
|
|
113
|
+
meta?: React.ReactNode;
|
|
114
|
+
/** The object's actions (edit, publish, a DropdownMenu). */
|
|
115
|
+
actions?: React.ReactNode;
|
|
116
|
+
/** Under the header: the object's tabs (`Tabs.List` of @krizaka/ui/tabs, inside your `Tabs.Root` around the layout). */
|
|
117
|
+
tabs?: React.ReactNode;
|
|
118
|
+
/** The side panel: details, related objects, activity (under the content on a phone). */
|
|
119
|
+
aside?: React.ReactNode;
|
|
120
|
+
/** The content (the current tab). */
|
|
121
|
+
children: React.ReactNode;
|
|
122
|
+
};
|
|
123
|
+
/** One object's page: header (back, media, name, status, facts, actions), tabs, content and a side panel. */
|
|
124
|
+
declare function DetailLayout({ back, media, eyebrow, title, status, meta, actions, tabs, aside, className, children, ...props }: DetailLayoutProps): React.JSX.Element;
|
|
125
|
+
|
|
126
|
+
export { DetailLayout, type DetailLayoutProps, detailLayout };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/detail-layout/detail-layout.tsx
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var detailLayout = tv({
|
|
5
|
+
slots: {
|
|
6
|
+
root: "flex w-full flex-col gap-6",
|
|
7
|
+
back: "inline-flex w-fit items-center gap-1.5 rounded-md text-sm font-medium text-fg-secondary no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
8
|
+
header: "flex flex-col gap-4 border-b border-border-subtle pb-5 sm:flex-row sm:items-start",
|
|
9
|
+
media: "shrink-0 overflow-hidden rounded-xl [&>img]:block [&>img]:h-full [&>img]:w-full [&>img]:object-cover",
|
|
10
|
+
text: "flex min-w-0 flex-1 flex-col gap-2",
|
|
11
|
+
eyebrow: "font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-fg-accent",
|
|
12
|
+
titleRow: "flex flex-wrap items-center gap-2",
|
|
13
|
+
title: "min-w-0 font-display text-2xl font-extrabold tracking-tight text-fg break-words",
|
|
14
|
+
meta: "flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-fg-secondary",
|
|
15
|
+
actions: "flex shrink-0 flex-wrap items-center gap-2",
|
|
16
|
+
columns: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem] lg:gap-8",
|
|
17
|
+
main: "flex min-w-0 flex-col gap-5",
|
|
18
|
+
aside: "flex min-w-0 flex-col gap-4 lg:sticky lg:top-20 lg:self-start"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var s = detailLayout();
|
|
22
|
+
function DetailLayout({ back, media, eyebrow, title, status, meta, actions, tabs, aside, className, children, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), ...props, children: [
|
|
24
|
+
back && /* @__PURE__ */ jsx("div", { className: s.back(), children: back }),
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: s.header(), children: [
|
|
26
|
+
media && /* @__PURE__ */ jsx("div", { className: s.media(), children: media }),
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: s.text(), children: [
|
|
28
|
+
eyebrow && /* @__PURE__ */ jsx("p", { className: s.eyebrow(), children: eyebrow }),
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: s.titleRow(), children: [
|
|
30
|
+
/* @__PURE__ */ jsx("h1", { className: s.title(), children: title }),
|
|
31
|
+
status
|
|
32
|
+
] }),
|
|
33
|
+
meta && /* @__PURE__ */ jsx("div", { className: s.meta(), children: meta })
|
|
34
|
+
] }),
|
|
35
|
+
actions && /* @__PURE__ */ jsx("div", { className: s.actions(), children: actions })
|
|
36
|
+
] }),
|
|
37
|
+
tabs,
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: aside ? s.columns() : void 0, children: [
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: s.main(), children }),
|
|
40
|
+
aside && /* @__PURE__ */ jsx("aside", { className: s.aside(), children: aside })
|
|
41
|
+
] })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
DetailLayout,
|
|
46
|
+
detailLayout
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=detail-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/detail-layout/detail-layout.tsx"],"sourcesContent":["// Server-safe. The page of one object, read from the products' detail screens (a video, a job, an account, a pack):\n// its header — the way back, a media or an avatar, the name, its facts and status, the actions — then its tabs, the\n// content, and a side panel (details, related, activity) that goes under the content on a phone.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const detailLayout = tv({\n slots: {\n root: \"flex w-full flex-col gap-6\",\n back: \"inline-flex w-fit items-center gap-1.5 rounded-md text-sm font-medium text-fg-secondary no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n header: \"flex flex-col gap-4 border-b border-border-subtle pb-5 sm:flex-row sm:items-start\",\n media: \"shrink-0 overflow-hidden rounded-xl [&>img]:block [&>img]:h-full [&>img]:w-full [&>img]:object-cover\",\n text: \"flex min-w-0 flex-1 flex-col gap-2\",\n eyebrow: \"font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-fg-accent\",\n titleRow: \"flex flex-wrap items-center gap-2\",\n title: \"min-w-0 font-display text-2xl font-extrabold tracking-tight text-fg break-words\",\n meta: \"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-fg-secondary\",\n actions: \"flex shrink-0 flex-wrap items-center gap-2\",\n columns: \"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem] lg:gap-8\",\n main: \"flex min-w-0 flex-col gap-5\",\n aside: \"flex min-w-0 flex-col gap-4 lg:sticky lg:top-20 lg:self-start\",\n },\n});\nconst s = detailLayout();\n\nexport type DetailLayoutProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The way back to the list: your router's link (`<Link href=\"/videos\">Videos</Link>`), drawn with its arrow. */\n back?: React.ReactNode;\n /** A thumbnail, a cover or an avatar beside the name. */\n media?: React.ReactNode;\n /** A mono line above the name (the object's kind, its id). */\n eyebrow?: React.ReactNode;\n /** The object's name: the `h1`. */\n title: React.ReactNode;\n /** Beside the name: its status (a Badge). */\n status?: React.ReactNode;\n /** Under the name: its facts (the author, a date, a count — `Facts` or plain text). */\n meta?: React.ReactNode;\n /** The object's actions (edit, publish, a DropdownMenu). */\n actions?: React.ReactNode;\n /** Under the header: the object's tabs (`Tabs.List` of @krizaka/ui/tabs, inside your `Tabs.Root` around the layout). */\n tabs?: React.ReactNode;\n /** The side panel: details, related objects, activity (under the content on a phone). */\n aside?: React.ReactNode;\n /** The content (the current tab). */\n children: React.ReactNode;\n};\n\n/** One object's page: header (back, media, name, status, facts, actions), tabs, content and a side panel. */\nexport function DetailLayout({ back, media, eyebrow, title, status, meta, actions, tabs, aside, className, children, ...props }: DetailLayoutProps) {\n return (\n <div className={s.root({ className })} {...props}>\n {back && <div className={s.back()}>{back}</div>}\n <div className={s.header()}>\n {media && <div className={s.media()}>{media}</div>}\n <div className={s.text()}>\n {eyebrow && <p className={s.eyebrow()}>{eyebrow}</p>}\n <div className={s.titleRow()}>\n <h1 className={s.title()}>{title}</h1>\n {status}\n </div>\n {meta && <div className={s.meta()}>{meta}</div>}\n </div>\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n {tabs}\n <div className={aside ? s.columns() : undefined}>\n <div className={s.main()}>{children}</div>\n {aside && <aside className={s.aside()}>{aside}</aside>}\n </div>\n </div>\n );\n}\n"],"mappings":";AAIA,SAAS,UAAU;AAgDJ,cAKL,YALK;AA9CR,IAAM,eAAe,GAAG;AAAA,EAC7B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;AACD,IAAM,IAAI,aAAa;AA0BhB,SAAS,aAAa,EAAE,MAAM,OAAO,SAAS,OAAO,QAAQ,MAAM,SAAS,MAAM,OAAO,WAAW,UAAU,GAAG,MAAM,GAAsB;AAClJ,SACE,qBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACxC;AAAA,YAAQ,oBAAC,SAAI,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,IACzC,qBAAC,SAAI,WAAW,EAAE,OAAO,GACtB;AAAA,eAAS,oBAAC,SAAI,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,MAC5C,qBAAC,SAAI,WAAW,EAAE,KAAK,GACpB;AAAA,mBAAW,oBAAC,OAAE,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,QAChD,qBAAC,SAAI,WAAW,EAAE,SAAS,GACzB;AAAA,8BAAC,QAAG,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,UAChC;AAAA,WACH;AAAA,QACC,QAAQ,oBAAC,SAAI,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,SAC3C;AAAA,MACC,WAAW,oBAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,OACpD;AAAA,IACC;AAAA,IACD,qBAAC,SAAI,WAAW,QAAQ,EAAE,QAAQ,IAAI,QACpC;AAAA,0BAAC,SAAI,WAAW,EAAE,KAAK,GAAI,UAAS;AAAA,MACnC,SAAS,oBAAC,WAAM,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,OAChD;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const docsLayout: tailwind_variants.TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
7
|
+
sidebar?: tailwind_variants.ClassValue;
|
|
8
|
+
mobileNav?: tailwind_variants.ClassValue;
|
|
9
|
+
mobileBody?: tailwind_variants.ClassValue;
|
|
10
|
+
article?: tailwind_variants.ClassValue;
|
|
11
|
+
toc?: tailwind_variants.ClassValue;
|
|
12
|
+
root?: tailwind_variants.ClassValue;
|
|
13
|
+
mobileSummary?: tailwind_variants.ClassValue;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
[x: string]: {
|
|
18
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
19
|
+
sidebar?: tailwind_variants.ClassValue;
|
|
20
|
+
mobileNav?: tailwind_variants.ClassValue;
|
|
21
|
+
mobileBody?: tailwind_variants.ClassValue;
|
|
22
|
+
article?: tailwind_variants.ClassValue;
|
|
23
|
+
toc?: tailwind_variants.ClassValue;
|
|
24
|
+
root?: tailwind_variants.ClassValue;
|
|
25
|
+
mobileSummary?: tailwind_variants.ClassValue;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
} | {}, {
|
|
29
|
+
root: string;
|
|
30
|
+
sidebar: string;
|
|
31
|
+
mobileNav: string;
|
|
32
|
+
mobileSummary: string;
|
|
33
|
+
mobileBody: string;
|
|
34
|
+
article: string;
|
|
35
|
+
toc: string;
|
|
36
|
+
}, undefined, {
|
|
37
|
+
[key: string]: {
|
|
38
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
39
|
+
sidebar?: tailwind_variants.ClassValue;
|
|
40
|
+
mobileNav?: tailwind_variants.ClassValue;
|
|
41
|
+
mobileBody?: tailwind_variants.ClassValue;
|
|
42
|
+
article?: tailwind_variants.ClassValue;
|
|
43
|
+
toc?: tailwind_variants.ClassValue;
|
|
44
|
+
root?: tailwind_variants.ClassValue;
|
|
45
|
+
mobileSummary?: tailwind_variants.ClassValue;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
} | {}, {
|
|
49
|
+
root: string;
|
|
50
|
+
sidebar: string;
|
|
51
|
+
mobileNav: string;
|
|
52
|
+
mobileSummary: string;
|
|
53
|
+
mobileBody: string;
|
|
54
|
+
article: string;
|
|
55
|
+
toc: string;
|
|
56
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
57
|
+
root: string;
|
|
58
|
+
sidebar: string;
|
|
59
|
+
mobileNav: string;
|
|
60
|
+
mobileSummary: string;
|
|
61
|
+
mobileBody: string;
|
|
62
|
+
article: string;
|
|
63
|
+
toc: string;
|
|
64
|
+
}>>;
|
|
65
|
+
type DocsLayoutProps = React.ComponentProps<"div"> & {
|
|
66
|
+
/** The pages of the documentation (a nav of links, grouped). */
|
|
67
|
+
sidebar: React.ReactNode;
|
|
68
|
+
/** On a phone the sidebar is folded: the words that open it (`Pages of the documentation`). */
|
|
69
|
+
sidebarLabel: string;
|
|
70
|
+
/** The page's table of contents (a `Toc` of @krizaka/ui/toc): beside the article from `xl`. */
|
|
71
|
+
toc?: React.ReactNode;
|
|
72
|
+
/** The article: its title, its body. */
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
};
|
|
75
|
+
/** A documentation page: pages · article · contents, in the site's frame. */
|
|
76
|
+
declare function DocsLayout({ sidebar, sidebarLabel, toc, className, children, ...props }: DocsLayoutProps): React.JSX.Element;
|
|
77
|
+
|
|
78
|
+
export { DocsLayout, type DocsLayoutProps, docsLayout };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/docs-layout/docs-layout.tsx
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
// src/glyphs.tsx
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function Glyph({ className = "h-4 w-4", fill, children }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
className,
|
|
12
|
+
fill: fill ? "currentColor" : "none",
|
|
13
|
+
stroke: fill ? "none" : "currentColor",
|
|
14
|
+
strokeWidth: "2",
|
|
15
|
+
strokeLinecap: "round",
|
|
16
|
+
strokeLinejoin: "round",
|
|
17
|
+
"aria-hidden": true,
|
|
18
|
+
focusable: "false",
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
var ChevronGlyph = ({ direction = "down", ...p }) => /* @__PURE__ */ jsx(Glyph, { ...p, children: /* @__PURE__ */ jsx("path", { d: { left: "m15 6-6 6 6 6", right: "m9 6 6 6-6 6", up: "m6 15 6-6 6 6", down: "m6 9 6 6 6-6" }[direction] }) });
|
|
24
|
+
|
|
25
|
+
// src/docs-layout/docs-layout.tsx
|
|
26
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
27
|
+
var docsLayout = tv({
|
|
28
|
+
slots: {
|
|
29
|
+
root: "mx-auto grid w-full max-w-[calc(var(--kz-page-max-docs,88rem)+2*var(--kz-page-gutter,24px))] grid-cols-1 gap-8 px-(--kz-page-gutter,16px) pt-(--kz-hero-top,6rem) pb-16 lg:grid-cols-[15rem_minmax(0,1fr)] xl:grid-cols-[15rem_minmax(0,1fr)_13rem]",
|
|
30
|
+
sidebar: "hidden lg:block lg:sticky lg:top-24 lg:max-h-[calc(100dvh-7rem)] lg:self-start lg:overflow-y-auto",
|
|
31
|
+
mobileNav: "rounded-xl border border-border-default bg-surface-1 lg:hidden",
|
|
32
|
+
mobileSummary: "flex min-h-11 cursor-pointer list-none items-center justify-between gap-2 px-4 text-sm font-semibold text-fg [&::-webkit-details-marker]:hidden rounded-xl focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring [[open]>&>svg]:rotate-180",
|
|
33
|
+
mobileBody: "border-t border-border-subtle px-2 py-2",
|
|
34
|
+
article: "min-w-0 max-w-3xl",
|
|
35
|
+
toc: "hidden xl:block xl:sticky xl:top-24 xl:self-start"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
var s = docsLayout();
|
|
39
|
+
function DocsLayout({ sidebar, sidebarLabel, toc, className, children, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsxs2("div", { className: s.root({ className }), ...props, children: [
|
|
41
|
+
/* @__PURE__ */ jsx2("div", { className: s.sidebar(), children: sidebar }),
|
|
42
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-col gap-6", children: [
|
|
43
|
+
/* @__PURE__ */ jsxs2("details", { className: s.mobileNav(), children: [
|
|
44
|
+
/* @__PURE__ */ jsxs2("summary", { className: s.mobileSummary(), children: [
|
|
45
|
+
sidebarLabel,
|
|
46
|
+
" ",
|
|
47
|
+
/* @__PURE__ */ jsx2(ChevronGlyph, { className: "h-4 w-4 transition-transform motion-reduce:transition-none" })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsx2("div", { className: s.mobileBody(), children: sidebar })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsx2("article", { className: s.article(), children })
|
|
52
|
+
] }),
|
|
53
|
+
toc && /* @__PURE__ */ jsx2("div", { className: s.toc(), children: toc })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
DocsLayout,
|
|
58
|
+
docsLayout
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=docs-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/docs-layout/docs-layout.tsx","../src/glyphs.tsx"],"sourcesContent":["// Server-safe. A documentation page in the site's frame (--kz-page-max-docs): the sidebar of pages, the article, the\n// table of contents — the three columns of the frame on a wide screen, the sidebar folded into a disclosure above the\n// article on a phone, the contents under the title as chips (a `Toc`). Its edges are the bar's: no column runs to the\n// window's edge.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { ChevronGlyph } from \"../glyphs\";\n\nexport const docsLayout = tv({\n slots: {\n root:\n \"mx-auto grid w-full max-w-[calc(var(--kz-page-max-docs,88rem)+2*var(--kz-page-gutter,24px))] grid-cols-1 gap-8 px-(--kz-page-gutter,16px) \" +\n \"pt-(--kz-hero-top,6rem) pb-16 lg:grid-cols-[15rem_minmax(0,1fr)] xl:grid-cols-[15rem_minmax(0,1fr)_13rem]\",\n sidebar: \"hidden lg:block lg:sticky lg:top-24 lg:max-h-[calc(100dvh-7rem)] lg:self-start lg:overflow-y-auto\",\n mobileNav: \"rounded-xl border border-border-default bg-surface-1 lg:hidden\",\n mobileSummary:\n \"flex min-h-11 cursor-pointer list-none items-center justify-between gap-2 px-4 text-sm font-semibold text-fg [&::-webkit-details-marker]:hidden \" +\n \"rounded-xl focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring [[open]>&>svg]:rotate-180\",\n mobileBody: \"border-t border-border-subtle px-2 py-2\",\n article: \"min-w-0 max-w-3xl\",\n toc: \"hidden xl:block xl:sticky xl:top-24 xl:self-start\",\n },\n});\nconst s = docsLayout();\n\nexport type DocsLayoutProps = React.ComponentProps<\"div\"> & {\n /** The pages of the documentation (a nav of links, grouped). */\n sidebar: React.ReactNode;\n /** On a phone the sidebar is folded: the words that open it (`Pages of the documentation`). */\n sidebarLabel: string;\n /** The page's table of contents (a `Toc` of @krizaka/ui/toc): beside the article from `xl`. */\n toc?: React.ReactNode;\n /** The article: its title, its body. */\n children: React.ReactNode;\n};\n\n/** A documentation page: pages · article · contents, in the site's frame. */\nexport function DocsLayout({ sidebar, sidebarLabel, toc, className, children, ...props }: DocsLayoutProps) {\n return (\n <div className={s.root({ className })} {...props}>\n <div className={s.sidebar()}>{sidebar}</div>\n <div className=\"flex min-w-0 flex-col gap-6\">\n <details className={s.mobileNav()}>\n <summary className={s.mobileSummary()}>\n {sidebarLabel} <ChevronGlyph className=\"h-4 w-4 transition-transform motion-reduce:transition-none\" />\n </summary>\n <div className={s.mobileBody()}>{sidebar}</div>\n </details>\n <article className={s.article()}>{children}</article>\n </div>\n {toc && <div className={s.toc()}>{toc}</div>}\n </div>\n );\n}\n","// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\n"],"mappings":";AAKA,SAAS,UAAU;;;ACIf,cAsBF,YAtBE;AAFJ,SAAS,MAAM,EAAE,YAAY,WAAW,MAAM,SAAS,GAA+D;AACpH,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR;AAAA,MACA,MAAM,OAAO,iBAAiB;AAAA,MAC9B,QAAQ,OAAO,SAAS;AAAA,MACxB,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAW;AAAA,MACX,WAAU;AAAA,MAET;AAAA;AAAA,EACH;AAEJ;AA+CO,IAAM,eAAe,CAAC,EAAE,YAAY,QAAQ,GAAG,EAAE,MACtD,oBAAC,SAAO,GAAG,GACT,8BAAC,UAAK,GAAG,EAAE,MAAM,iBAAiB,OAAO,gBAAgB,IAAI,iBAAiB,MAAM,eAAe,EAAE,SAAS,GAAG,GACnH;;;ADhCI,gBAAAA,MAGI,QAAAC,aAHJ;AAhCC,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,SAAS;AAAA,IACT,WAAW;AAAA,IACX,eACE;AAAA,IAEF,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,KAAK;AAAA,EACP;AACF,CAAC;AACD,IAAM,IAAI,WAAW;AAcd,SAAS,WAAW,EAAE,SAAS,cAAc,KAAK,WAAW,UAAU,GAAG,MAAM,GAAoB;AACzG,SACE,gBAAAA,MAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACzC;AAAA,oBAAAD,KAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,IACtC,gBAAAC,MAAC,SAAI,WAAU,+BACb;AAAA,sBAAAA,MAAC,aAAQ,WAAW,EAAE,UAAU,GAC9B;AAAA,wBAAAA,MAAC,aAAQ,WAAW,EAAE,cAAc,GACjC;AAAA;AAAA,UAAa;AAAA,UAAC,gBAAAD,KAAC,gBAAa,WAAU,8DAA6D;AAAA,WACtG;AAAA,QACA,gBAAAA,KAAC,SAAI,WAAW,EAAE,WAAW,GAAI,mBAAQ;AAAA,SAC3C;AAAA,MACA,gBAAAA,KAAC,aAAQ,WAAW,EAAE,QAAQ,GAAI,UAAS;AAAA,OAC7C;AAAA,IACC,OAAO,gBAAAA,KAAC,SAAI,WAAW,EAAE,IAAI,GAAI,eAAI;AAAA,KACxC;AAEJ;","names":["jsx","jsxs"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Krizaka flock — the geometry of the mascots, drawn by the web `Mascot` (`./mascot.tsx`) and the native one
|
|
3
|
+
* (`../native/mascots.tsx`). Five birds that have carried the Krizaka story since the first site (the sentry falcon,
|
|
4
|
+
* the owl that reads, the developer duck, the flamingo that answers, the carrier pigeon) and the lovebird that
|
|
5
|
+
* introduces (2026-10, with Yazakia: "l'inséparable présente"), redrawn on one 120 × 120 grid so that any bird can
|
|
6
|
+
* wear any mood.
|
|
7
|
+
*
|
|
8
|
+
* Colours are roles, never fixed: `brand` (the default) paints a bird in the host's accent (`--kz-accent`,
|
|
9
|
+
* `--kz-accent-2`), so the same falcon is blue on krizaka.com, orange in Orazaka and violet in Orochia; `own` gives
|
|
10
|
+
* each bird the signature palette it has in the Krizaka story (the brand layer's exception, like the marks). Shades
|
|
11
|
+
* and highlights are black and white at a low opacity over the role, so they hold in both themes.
|
|
12
|
+
*/
|
|
13
|
+
declare const MASCOT_BIRDS: readonly ["falcon", "owl", "duck", "flamingo", "pigeon", "lovebird"];
|
|
14
|
+
type MascotBird = (typeof MASCOT_BIRDS)[number];
|
|
15
|
+
declare const MASCOT_MOODS: readonly ["welcome", "thinking", "success", "empty", "error"];
|
|
16
|
+
type MascotMood = (typeof MASCOT_MOODS)[number];
|
|
17
|
+
type MascotTone = "brand" | "own";
|
|
18
|
+
|
|
19
|
+
export { type MascotBird as M, type MascotMood as a, type MascotTone as b, MASCOT_BIRDS as c, MASCOT_MOODS as d };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as StoryVariant } from './story-variant-CLn4H5Nt.js';
|
|
3
|
+
|
|
4
|
+
type GoalGaugeProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
5
|
+
/** What the gauge counts (“Backers”, “Dares completed”) — passed translated; the meter's accessible name. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** The number of steps of the goal (2–24). */
|
|
8
|
+
segments: number;
|
|
9
|
+
/**
|
|
10
|
+
* The steps reached (lit), from 0 to `segments`.
|
|
11
|
+
* @default segments
|
|
12
|
+
*/
|
|
13
|
+
value?: number;
|
|
14
|
+
/** The value in words (“6 of 10”, “€420 raised”); default `value / segments`. */
|
|
15
|
+
valueText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* How the scene plays it: `fill` lights the reached steps one by one; `drain` empties the spent ones (a countdown of
|
|
18
|
+
* what is left: tickets, lives, problems still standing).
|
|
19
|
+
* @default "fill"
|
|
20
|
+
*/
|
|
21
|
+
mode?: "fill" | "drain";
|
|
22
|
+
/**
|
|
23
|
+
* Shows the label and the value above the segments.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
showLabel?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* `default`: rounded segments. `arcade`: the boss gauge — a skewed frame, gradient cells, a centred mono label.
|
|
29
|
+
* @default "default"
|
|
30
|
+
*/
|
|
31
|
+
variant?: StoryVariant;
|
|
32
|
+
/** A brand scope (`orochia` → `.brand-orochia`). */
|
|
33
|
+
brand?: string;
|
|
34
|
+
};
|
|
35
|
+
/** A goal in steps: `role="meter"`, the reached steps lit, the value in words beside the label. */
|
|
36
|
+
declare function GoalGauge({ label, segments, value, valueText, mode, showLabel, variant, brand, className, style, ...props }: GoalGaugeProps): React.JSX.Element;
|
|
37
|
+
|
|
38
|
+
export { GoalGauge, type GoalGaugeProps };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
brandClass,
|
|
3
|
+
cn,
|
|
4
|
+
storyVariantClass
|
|
5
|
+
} from "./chunk-VCAAHCHL.js";
|
|
6
|
+
|
|
7
|
+
// src/goal-gauge/goal-gauge.tsx
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function GoalGauge({ label, segments, value, valueText, mode = "fill", showLabel = true, variant, brand, className, style, ...props }) {
|
|
10
|
+
const total = Math.max(1, Math.round(segments));
|
|
11
|
+
const lit = Math.min(total, Math.max(0, Math.round(value ?? total)));
|
|
12
|
+
const words = valueText ?? `${lit} / ${total}`;
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
role: "meter",
|
|
17
|
+
"aria-label": label,
|
|
18
|
+
"aria-valuemin": 0,
|
|
19
|
+
"aria-valuemax": total,
|
|
20
|
+
"aria-valuenow": lit,
|
|
21
|
+
"aria-valuetext": words,
|
|
22
|
+
"data-mode": mode,
|
|
23
|
+
className: cn("kzs-gauge", storyVariantClass(variant), brandClass(brand), className),
|
|
24
|
+
style: { "--kzs-segments": total, ...style },
|
|
25
|
+
...props,
|
|
26
|
+
children: [
|
|
27
|
+
showLabel && /* @__PURE__ */ jsxs("div", { className: "kzs-gauge-head", "aria-hidden": true, children: [
|
|
28
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-gauge-label", children: label }),
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-gauge-value", children: words })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: "kzs-gauge-cells", "aria-hidden": true, children: Array.from({ length: total }, (_, i) => {
|
|
32
|
+
const on = i < lit;
|
|
33
|
+
const animate = mode === "fill" ? on : !on;
|
|
34
|
+
const order = mode === "fill" ? i : i - lit;
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
className: "kzs-gauge-cell",
|
|
39
|
+
"data-lit": on ? "" : void 0,
|
|
40
|
+
"data-animate": animate ? "" : void 0,
|
|
41
|
+
style: animate ? { "--i": order } : void 0
|
|
42
|
+
},
|
|
43
|
+
i
|
|
44
|
+
);
|
|
45
|
+
}) })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
GoalGauge
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=goal-gauge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/goal-gauge/goal-gauge.tsx"],"sourcesContent":["// Server-safe. A goal counted in steps (story.css): 6 of 10 backers, 3 of 5 dares done, 8 problems out of the way. A\n// `meter` with its value in words; in a `Scene` of a `ScrollStage` the segments light (or drain) one by one, once.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type GoalGaugeProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> & {\n /** What the gauge counts (“Backers”, “Dares completed”) — passed translated; the meter's accessible name. */\n label: string;\n /** The number of steps of the goal (2–24). */\n segments: number;\n /**\n * The steps reached (lit), from 0 to `segments`.\n * @default segments\n */\n value?: number;\n /** The value in words (“6 of 10”, “€420 raised”); default `value / segments`. */\n valueText?: string;\n /**\n * How the scene plays it: `fill` lights the reached steps one by one; `drain` empties the spent ones (a countdown of\n * what is left: tickets, lives, problems still standing).\n * @default \"fill\"\n */\n mode?: \"fill\" | \"drain\";\n /**\n * Shows the label and the value above the segments.\n * @default true\n */\n showLabel?: boolean;\n /**\n * `default`: rounded segments. `arcade`: the boss gauge — a skewed frame, gradient cells, a centred mono label.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /** A brand scope (`orochia` → `.brand-orochia`). */\n brand?: string;\n};\n\n/** A goal in steps: `role=\"meter\"`, the reached steps lit, the value in words beside the label. */\nexport function GoalGauge({ label, segments, value, valueText, mode = \"fill\", showLabel = true, variant, brand, className, style, ...props }: GoalGaugeProps) {\n const total = Math.max(1, Math.round(segments));\n const lit = Math.min(total, Math.max(0, Math.round(value ?? total)));\n const words = valueText ?? `${lit} / ${total}`;\n return (\n <div\n role=\"meter\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={total}\n aria-valuenow={lit}\n aria-valuetext={words}\n data-mode={mode}\n className={cn(\"kzs-gauge\", storyVariantClass(variant), brandClass(brand), className)}\n style={{ \"--kzs-segments\": total, ...style } as React.CSSProperties}\n {...props}\n >\n {showLabel && (\n <div className=\"kzs-gauge-head\" aria-hidden>\n <span className=\"kzs-gauge-label\">{label}</span>\n <span className=\"kzs-gauge-value\">{words}</span>\n </div>\n )}\n <div className=\"kzs-gauge-cells\" aria-hidden>\n {Array.from({ length: total }, (_, i) => {\n const on = i < lit;\n const animate = mode === \"fill\" ? on : !on;\n const order = mode === \"fill\" ? i : i - lit;\n return (\n <span\n key={i}\n className=\"kzs-gauge-cell\"\n data-lit={on ? \"\" : undefined}\n data-animate={animate ? \"\" : undefined}\n style={animate ? ({ \"--i\": order } as React.CSSProperties) : undefined}\n />\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AA0DQ,SACE,KADF;AAlBD,SAAS,UAAU,EAAE,OAAO,UAAU,OAAO,WAAW,OAAO,QAAQ,YAAY,MAAM,SAAS,OAAO,WAAW,OAAO,GAAG,MAAM,GAAmB;AAC5J,QAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,QAAQ,CAAC;AAC9C,QAAM,MAAM,KAAK,IAAI,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,KAAK,CAAC,CAAC;AACnE,QAAM,QAAQ,aAAa,GAAG,GAAG,MAAM,KAAK;AAC5C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,kBAAgB;AAAA,MAChB,aAAW;AAAA,MACX,WAAW,GAAG,aAAa,kBAAkB,OAAO,GAAG,WAAW,KAAK,GAAG,SAAS;AAAA,MACnF,OAAO,EAAE,kBAAkB,OAAO,GAAG,MAAM;AAAA,MAC1C,GAAG;AAAA,MAEH;AAAA,qBACC,qBAAC,SAAI,WAAU,kBAAiB,eAAW,MACzC;AAAA,8BAAC,UAAK,WAAU,mBAAmB,iBAAM;AAAA,UACzC,oBAAC,UAAK,WAAU,mBAAmB,iBAAM;AAAA,WAC3C;AAAA,QAEF,oBAAC,SAAI,WAAU,mBAAkB,eAAW,MACzC,gBAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MAAM;AACvC,gBAAM,KAAK,IAAI;AACf,gBAAM,UAAU,SAAS,SAAS,KAAK,CAAC;AACxC,gBAAM,QAAQ,SAAS,SAAS,IAAI,IAAI;AACxC,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,WAAU;AAAA,cACV,YAAU,KAAK,KAAK;AAAA,cACpB,gBAAc,UAAU,KAAK;AAAA,cAC7B,OAAO,UAAW,EAAE,OAAO,MAAM,IAA4B;AAAA;AAAA,YAJxD;AAAA,UAKP;AAAA,QAEJ,CAAC,GACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -34,10 +34,19 @@ declare function OrazakaLogo({ size, animated, title, className }: MarkProps): R
|
|
|
34
34
|
*/
|
|
35
35
|
declare function OrochiaLogo({ size, animated, title, className }: MarkProps): React.JSX.Element;
|
|
36
36
|
|
|
37
|
-
type BrandId = "krizaka" | "orazaka" | "orochia";
|
|
37
|
+
type BrandId = "krizaka" | "orazaka" | "orochia" | "yazakia";
|
|
38
38
|
/** The mark of a Krizaka brand by id — for navigation, cards and lists driven by data. */
|
|
39
39
|
declare function ProductLogo({ id, ...props }: MarkProps & {
|
|
40
40
|
id: BrandId;
|
|
41
41
|
}): React.JSX.Element;
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The Yazakia mark: two voices — two solid speech bubbles that overlap, the left a shade deeper — in the Yazakia
|
|
45
|
+
* gradient (emerald → turquoise, the brand's mark gradient of @krizaka/tokens, the same in dark and light). Where they
|
|
46
|
+
* overlap, what the two share, is the bright core: a lens lit from above that breathes. The pair, two nodes on the
|
|
47
|
+
* dashed orbit, turns slowly around it — the family's grammar (orbit, ring, bold emblem, bright core). Below 48 px it
|
|
48
|
+
* crops to the emblem.
|
|
49
|
+
*/
|
|
50
|
+
declare function YazakiaLogo({ size, animated, title, className }: MarkProps): React.JSX.Element;
|
|
51
|
+
|
|
52
|
+
export { type BrandId, KrizakaLogo, type MarkProps, OrazakaLogo, OrochiaLogo, ProductLogo, YazakiaLogo, cx };
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,16 @@ var marks = /* @__PURE__ */ Object.freeze({
|
|
|
42
42
|
"100%",
|
|
43
43
|
"#f472b6"
|
|
44
44
|
]
|
|
45
|
+
],
|
|
46
|
+
"yazakia": [
|
|
47
|
+
[
|
|
48
|
+
"0%",
|
|
49
|
+
"#079d61"
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"100%",
|
|
53
|
+
"#089b96"
|
|
54
|
+
]
|
|
45
55
|
]
|
|
46
56
|
});
|
|
47
57
|
|
|
@@ -247,12 +257,86 @@ function OrochiaLogo({ size = 36, animated = true, title, className }) {
|
|
|
247
257
|
] });
|
|
248
258
|
}
|
|
249
259
|
|
|
260
|
+
// src/marks/yazakia-geometry.ts
|
|
261
|
+
var turquoise = marks.yazakia[marks.yazakia.length - 1][1];
|
|
262
|
+
var YAZAKIA = {
|
|
263
|
+
viewBox: "0 0 400 400",
|
|
264
|
+
croppedViewBox: "80 80 240 240",
|
|
265
|
+
center: 200,
|
|
266
|
+
/** The two voices, left then right: each a bubble (cut around the lens) and its tail. */
|
|
267
|
+
voices: [
|
|
268
|
+
{ body: "M191.9 109 A80 80 0 1 0 191.9 259 A87 87 0 0 1 191.9 109 Z", tail: "M98 230 Q104 268 88 294 Q122 288 144 262 L130 200 Z" },
|
|
269
|
+
{ body: "M208.1 109 A80 80 0 1 1 208.1 259 A87 87 0 0 0 208.1 109 Z", tail: "M302 230 Q296 268 312 294 Q278 288 256 262 L270 200 Z" }
|
|
270
|
+
],
|
|
271
|
+
/** The left voice, a shade deeper: the depth between the two. */
|
|
272
|
+
shade: { color: "#000", opacity: 0.22 },
|
|
273
|
+
/** Where the bubbles overlap: the core, lit from above. */
|
|
274
|
+
lens: { d: "M200 112.6 A80 80 0 0 1 200 255.4 A80 80 0 0 1 200 112.6 Z", y1: 112.6, y2: 255.4 },
|
|
275
|
+
gradient: { x1: 110, y1: 300, x2: 290, y2: 100, stops: marks.yazakia },
|
|
276
|
+
/** The light on the lens: bright at the top, fading down. */
|
|
277
|
+
highlight: { color: "#f0fdfa", from: 0.75, to: 0.2 },
|
|
278
|
+
/** The pair: two nodes on the orbit, opposite each other, that turn with it. */
|
|
279
|
+
pair: { r: 8, at: [[40, 200], [360, 200]] },
|
|
280
|
+
glow: { color: turquoise, opacity: 0.16 },
|
|
281
|
+
/** The core's breathing shadow (web), in the mark's turquoise. */
|
|
282
|
+
pulse: { color: turquoise, low: 0.3, high: 0.6 },
|
|
283
|
+
orbit: { r: 160, dash: "8 8", width: 1.5 },
|
|
284
|
+
ring: { r: 134, width: 1 }
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
// src/marks/YazakiaLogo.tsx
|
|
288
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
289
|
+
var CSS4 = `
|
|
290
|
+
.yzm-orbit { transform-origin: 200px 200px; animation: yzm-orbit 30s linear infinite; }
|
|
291
|
+
.yzm-core { transform-box: fill-box; transform-origin: center; animation: yzm-core 3.2s ease-in-out infinite; }
|
|
292
|
+
@keyframes yzm-orbit { to { transform: rotate(360deg); } }
|
|
293
|
+
@keyframes yzm-core {
|
|
294
|
+
0%, 100% { filter: drop-shadow(0 0 6px ${withAlpha(YAZAKIA.pulse.color, YAZAKIA.pulse.low)}); opacity: .9; }
|
|
295
|
+
50% { filter: drop-shadow(0 0 14px ${withAlpha(YAZAKIA.pulse.color, YAZAKIA.pulse.high)}); opacity: 1; }
|
|
296
|
+
}
|
|
297
|
+
@media (prefers-reduced-motion: reduce) { .yzm-orbit, .yzm-core { animation: none; } }
|
|
298
|
+
`;
|
|
299
|
+
function YazakiaLogo({ size = 32, animated = true, title, className }) {
|
|
300
|
+
const id = useIds("yzm", ["gradient", "light", "glow"]);
|
|
301
|
+
const fill = `url(#${id.gradient})`;
|
|
302
|
+
return /* @__PURE__ */ jsxs4("svg", { width: size, height: size, viewBox: size < 48 ? YAZAKIA.croppedViewBox : YAZAKIA.viewBox, fill: "none", xmlns: "http://www.w3.org/2000/svg", className, ...a11y(title), children: [
|
|
303
|
+
/* @__PURE__ */ jsx4("style", { children: CSS4 }),
|
|
304
|
+
/* @__PURE__ */ jsxs4("defs", { children: [
|
|
305
|
+
/* @__PURE__ */ jsx4("linearGradient", { id: id.gradient, gradientUnits: "userSpaceOnUse", x1: YAZAKIA.gradient.x1, y1: YAZAKIA.gradient.y1, x2: YAZAKIA.gradient.x2, y2: YAZAKIA.gradient.y2, children: YAZAKIA.gradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx4("stop", { offset, stopColor: color }, offset)) }),
|
|
306
|
+
/* @__PURE__ */ jsxs4("linearGradient", { id: id.light, gradientUnits: "userSpaceOnUse", x1: "0", y1: YAZAKIA.lens.y1, x2: "0", y2: YAZAKIA.lens.y2, children: [
|
|
307
|
+
/* @__PURE__ */ jsx4("stop", { offset: "0%", stopColor: YAZAKIA.highlight.color, stopOpacity: YAZAKIA.highlight.from }),
|
|
308
|
+
/* @__PURE__ */ jsx4("stop", { offset: "100%", stopColor: YAZAKIA.highlight.color, stopOpacity: YAZAKIA.highlight.to })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ jsxs4("radialGradient", { id: id.glow, cx: "50%", cy: "50%", r: "50%", children: [
|
|
311
|
+
/* @__PURE__ */ jsx4("stop", { offset: "0%", stopColor: YAZAKIA.glow.color, stopOpacity: YAZAKIA.glow.opacity }),
|
|
312
|
+
/* @__PURE__ */ jsx4("stop", { offset: "100%", stopColor: YAZAKIA.glow.color, stopOpacity: "0" })
|
|
313
|
+
] })
|
|
314
|
+
] }),
|
|
315
|
+
size >= 48 ? /* @__PURE__ */ jsx4("circle", { cx: YAZAKIA.center, cy: YAZAKIA.center, r: "190", fill: `url(#${id.glow})` }) : null,
|
|
316
|
+
/* @__PURE__ */ jsx4("circle", { cx: YAZAKIA.center, cy: YAZAKIA.center, r: YAZAKIA.ring.r, stroke: neutral("--kz-border-default", 30), strokeWidth: YAZAKIA.ring.width, opacity: ".35" }),
|
|
317
|
+
/* @__PURE__ */ jsxs4("g", { className: animated ? "yzm-orbit" : void 0, children: [
|
|
318
|
+
/* @__PURE__ */ jsx4("circle", { cx: YAZAKIA.center, cy: YAZAKIA.center, r: YAZAKIA.orbit.r, stroke: neutral("--kz-border-strong", 40), strokeWidth: YAZAKIA.orbit.width, strokeDasharray: YAZAKIA.orbit.dash, opacity: ".6" }),
|
|
319
|
+
YAZAKIA.pair.at.map(([cx2, cy]) => /* @__PURE__ */ jsx4("circle", { cx: cx2, cy, r: YAZAKIA.pair.r, fill }, cx2))
|
|
320
|
+
] }),
|
|
321
|
+
YAZAKIA.voices.map((v, i) => /* @__PURE__ */ jsxs4("g", { children: [
|
|
322
|
+
/* @__PURE__ */ jsx4("path", { d: v.body, fill }),
|
|
323
|
+
/* @__PURE__ */ jsx4("path", { d: v.tail, fill }),
|
|
324
|
+
i === 0 ? /* @__PURE__ */ jsx4("path", { d: `${v.body} ${v.tail}`, fill: YAZAKIA.shade.color, opacity: YAZAKIA.shade.opacity }) : null
|
|
325
|
+
] }, v.body)),
|
|
326
|
+
/* @__PURE__ */ jsxs4("g", { className: animated ? "yzm-core" : void 0, children: [
|
|
327
|
+
/* @__PURE__ */ jsx4("path", { d: YAZAKIA.lens.d, fill }),
|
|
328
|
+
/* @__PURE__ */ jsx4("path", { d: YAZAKIA.lens.d, fill: `url(#${id.light})` })
|
|
329
|
+
] })
|
|
330
|
+
] });
|
|
331
|
+
}
|
|
332
|
+
|
|
250
333
|
// src/marks/ProductLogo.tsx
|
|
251
|
-
import { jsx as
|
|
334
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
252
335
|
function ProductLogo({ id, ...props }) {
|
|
253
|
-
if (id === "krizaka") return /* @__PURE__ */
|
|
254
|
-
if (id === "orazaka") return /* @__PURE__ */
|
|
255
|
-
return /* @__PURE__ */
|
|
336
|
+
if (id === "krizaka") return /* @__PURE__ */ jsx5(KrizakaLogo, { ...props });
|
|
337
|
+
if (id === "orazaka") return /* @__PURE__ */ jsx5(OrazakaLogo, { ...props });
|
|
338
|
+
if (id === "yazakia") return /* @__PURE__ */ jsx5(YazakiaLogo, { ...props });
|
|
339
|
+
return /* @__PURE__ */ jsx5(OrochiaLogo, { ...props });
|
|
256
340
|
}
|
|
257
341
|
export {
|
|
258
342
|
KrizakaLogo,
|
|
@@ -261,6 +345,7 @@ export {
|
|
|
261
345
|
OrochiaLogo,
|
|
262
346
|
ProductLogo,
|
|
263
347
|
RotatingWord,
|
|
348
|
+
YazakiaLogo,
|
|
264
349
|
cx
|
|
265
350
|
};
|
|
266
351
|
//# sourceMappingURL=index.js.map
|