@krizaka/ui 3.19.0 → 3.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-bar.js +4 -4
- package/dist/argument-card.js +1 -1
- package/dist/avatar/defaults.js +6 -1
- package/dist/avatar/defaults.js.map +1 -1
- package/dist/avatar.js +6 -1
- package/dist/avatar.js.map +1 -1
- package/dist/blocks.css +1 -1
- package/dist/button.js +3 -2
- package/dist/card.js +3 -3
- package/dist/chat.js +1 -1
- package/dist/{chunk-276PTQMQ.js → chunk-3BC4XQ6C.js} +2 -1
- package/dist/{chunk-2NB27LM7.js → chunk-3IN6TOPM.js} +4 -4
- package/dist/{chunk-VDR2EP6K.js → chunk-4QN5YJ3D.js} +17 -5
- package/dist/chunk-4QN5YJ3D.js.map +1 -0
- package/dist/{chunk-YIBKJ36L.js → chunk-KB7OLYIJ.js} +7 -2
- package/dist/{chunk-YIBKJ36L.js.map → chunk-KB7OLYIJ.js.map} +1 -1
- package/dist/chunk-TDG7ED2W.js +1 -0
- package/dist/chunk-TDG7ED2W.js.map +1 -0
- package/dist/code-block.js +17 -5
- package/dist/code-block.js.map +1 -1
- package/dist/data-table.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-picker.js.map +1 -1
- package/dist/file-upload.js +2 -2
- package/dist/file-upload.js.map +1 -1
- package/dist/force-update-screen.d.ts +80 -0
- package/dist/force-update-screen.js +38 -0
- package/dist/force-update-screen.js.map +1 -0
- package/dist/maintenance-screen.d.ts +68 -0
- package/dist/maintenance-screen.js +35 -0
- package/dist/maintenance-screen.js.map +1 -0
- package/dist/match-dialog.js +2 -2
- package/dist/media-grid.d.ts +66 -3
- package/dist/media-grid.js +313 -66
- package/dist/media-grid.js.map +1 -1
- package/dist/native.d.ts +68 -1
- package/dist/native.js +773 -682
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +30 -7
- package/dist/nav-bar.js +69 -15
- package/dist/nav-bar.js.map +1 -1
- package/dist/page-hero.js +3 -3
- package/dist/progress.js +2 -2
- package/dist/progress.js.map +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/settings-layout.js +1 -1
- package/dist/settings-layout.js.map +1 -1
- package/dist/tabs.js +2 -2
- package/dist/tabs.js.map +1 -1
- package/dist/update-prompt.d.ts +86 -0
- package/dist/update-prompt.js +41 -0
- package/dist/update-prompt.js.map +1 -0
- package/dist/vertical-video.d.ts +7 -1
- package/dist/vertical-video.js +7 -5
- package/dist/vertical-video.js.map +1 -1
- package/dist/video-player.d.ts +1 -1
- package/dist/video-player.js +16 -3
- package/dist/video-player.js.map +1 -1
- package/package.json +50 -8
- package/registry/achievement.json +16 -2
- package/registry/action-bar.json +16 -2
- package/registry/action-sheet.json +15 -0
- package/registry/activity-feed.json +13 -2
- package/registry/alert.json +15 -2
- package/registry/app-shell.json +15 -2
- package/registry/argument-card.json +16 -2
- package/registry/audio-player.json +15 -2
- package/registry/auth-layout.json +15 -2
- package/registry/avatar.json +14 -3
- package/registry/badge.json +13 -2
- package/registry/button.json +13 -2
- package/registry/card-grid.json +16 -2
- package/registry/card.json +13 -2
- package/registry/catalogue-page.json +15 -2
- package/registry/changelog-page.json +15 -2
- package/registry/chat.json +15 -4
- package/registry/checkbox.json +13 -2
- package/registry/chip-link.json +15 -2
- package/registry/chip.json +13 -2
- package/registry/choice-grid.json +16 -2
- package/registry/cn.json +12 -0
- package/registry/code-block.json +15 -2
- package/registry/combobox.json +13 -2
- package/registry/command.json +15 -2
- package/registry/component-page.json +15 -2
- package/registry/confirm-button.json +15 -2
- package/registry/contact-page.json +15 -2
- package/registry/continue-prompt.json +16 -2
- package/registry/countdown.json +13 -2
- package/registry/cta-panel.json +16 -2
- package/registry/dashboard-layout.json +15 -2
- package/registry/data-table.json +15 -2
- package/registry/date-picker.json +15 -4
- package/registry/decision-list.json +16 -2
- package/registry/description-list.json +13 -2
- package/registry/detail-layout.json +15 -2
- package/registry/dialog.json +13 -2
- package/registry/docs-article-page.json +15 -2
- package/registry/docs-hub-page.json +15 -2
- package/registry/docs-layout.json +15 -2
- package/registry/document-viewer.json +15 -2
- package/registry/dropdown-menu.json +15 -2
- package/registry/empty-state.json +13 -2
- package/registry/error-page.json +14 -2
- package/registry/examples/chat/conversation.js +2 -2
- package/registry/examples/chat/conversation.tsx +4 -3
- package/registry/examples/force-update-screen/default.d.ts +4 -0
- package/registry/examples/force-update-screen/default.js +25 -0
- package/registry/examples/force-update-screen/default.tsx +19 -0
- package/registry/examples/force-update-screen/native/default.d.ts +4 -0
- package/registry/examples/force-update-screen/native/default.dark.png +0 -0
- package/registry/examples/force-update-screen/native/default.js +24 -0
- package/registry/examples/force-update-screen/native/default.light.png +0 -0
- package/registry/examples/force-update-screen/native/default.tsx +18 -0
- package/registry/examples/glow-card/plans.js +9 -12
- package/registry/examples/glow-card/plans.tsx +18 -14
- package/registry/examples/maintenance-screen/default.d.ts +4 -0
- package/registry/examples/maintenance-screen/default.js +22 -0
- package/registry/examples/maintenance-screen/default.tsx +16 -0
- package/registry/examples/maintenance-screen/native/default.d.ts +4 -0
- package/registry/examples/maintenance-screen/native/default.dark.png +0 -0
- package/registry/examples/maintenance-screen/native/default.js +21 -0
- package/registry/examples/maintenance-screen/native/default.light.png +0 -0
- package/registry/examples/maintenance-screen/native/default.tsx +15 -0
- package/registry/examples/media-grid/loading.d.ts +4 -0
- package/registry/examples/media-grid/loading.js +28 -0
- package/registry/examples/media-grid/loading.tsx +25 -0
- package/registry/examples/nav-bar/family-product.js +16 -13
- package/registry/examples/nav-bar/family-product.tsx +19 -19
- package/registry/examples/update-prompt/default.d.ts +4 -0
- package/registry/examples/update-prompt/default.js +24 -0
- package/registry/examples/update-prompt/default.tsx +18 -0
- package/registry/examples/update-prompt/native/default.d.ts +4 -0
- package/registry/examples/update-prompt/native/default.dark.png +0 -0
- package/registry/examples/update-prompt/native/default.js +23 -0
- package/registry/examples/update-prompt/native/default.light.png +0 -0
- package/registry/examples/update-prompt/native/default.tsx +17 -0
- package/registry/examples/vertical-video/rail.js +3 -2
- package/registry/examples/vertical-video/rail.tsx +4 -3
- package/registry/fab.json +15 -0
- package/registry/field.json +13 -2
- package/registry/file-upload.json +15 -2
- package/registry/filter-bar.json +15 -2
- package/registry/force-update-screen.json +323 -0
- package/registry/form.json +13 -2
- package/registry/gallery-page.json +15 -2
- package/registry/glow-card.json +18 -4
- package/registry/goal-gauge.json +13 -2
- package/registry/header.json +15 -0
- package/registry/how-it-works-page.json +15 -2
- package/registry/image-cropper.json +15 -2
- package/registry/image-viewer.json +15 -0
- package/registry/index.json +1864 -8
- package/registry/iso.json +15 -2
- package/registry/kanban.json +15 -2
- package/registry/kbd.json +14 -2
- package/registry/landing-page.json +15 -2
- package/registry/landscape.json +15 -2
- package/registry/legal-page.json +15 -2
- package/registry/link-card.json +16 -2
- package/registry/list.json +13 -2
- package/registry/loader.json +13 -2
- package/registry/longform-page.json +15 -2
- package/registry/maintenance-screen.json +259 -0
- package/registry/map.json +14 -3
- package/registry/markdown.json +13 -2
- package/registry/marketing-layout.json +15 -2
- package/registry/marquee.json +15 -2
- package/registry/mascot-quote.json +16 -2
- package/registry/mascot-state.json +13 -2
- package/registry/mascots.json +13 -2
- package/registry/match-dialog.json +13 -2
- package/registry/media-capture.json +13 -2
- package/registry/media-grid.json +342 -14
- package/registry/media-picker.json +15 -0
- package/registry/meter.json +13 -2
- package/registry/nav-bar.json +61 -14
- package/registry/number-ticker.json +13 -2
- package/registry/onboarding.json +15 -0
- package/registry/otp-input.json +15 -0
- package/registry/page-header.json +15 -2
- package/registry/page-hero.json +16 -2
- package/registry/page.json +16 -2
- package/registry/pagination.json +13 -2
- package/registry/permission-prompt.json +15 -0
- package/registry/photo-grid.json +13 -2
- package/registry/pointer-light.json +15 -2
- package/registry/popover.json +15 -2
- package/registry/pricing-page.json +15 -2
- package/registry/product-page.json +15 -2
- package/registry/profile-card.json +13 -2
- package/registry/progress.json +14 -3
- package/registry/promise-card.json +16 -2
- package/registry/pull-to-refresh.json +15 -0
- package/registry/radio-group.json +14 -3
- package/registry/recipes.json +14 -2
- package/registry/screen.json +15 -0
- package/registry/scroll-stage.json +15 -2
- package/registry/search-field.json +13 -2
- package/registry/section-backdrop.json +15 -2
- package/registry/segmented.json +15 -0
- package/registry/separator.json +15 -2
- package/registry/settings-layout.json +16 -3
- package/registry/showcase.json +13 -2
- package/registry/site-footer.json +16 -3
- package/registry/sites.json +15 -2
- package/registry/skeleton.json +13 -2
- package/registry/skip-link.json +14 -2
- package/registry/slider.json +13 -2
- package/registry/slot.json +14 -2
- package/registry/spinner.json +13 -2
- package/registry/splash-handoff.json +15 -0
- package/registry/split-view.json +15 -2
- package/registry/stage-banner.json +15 -2
- package/registry/stat.json +15 -2
- package/registry/status-page.json +15 -2
- package/registry/step-progress.json +13 -2
- package/registry/stepper.json +13 -2
- package/registry/swipe-deck.json +13 -2
- package/registry/swipeable-row.json +15 -0
- package/registry/switch.json +13 -2
- package/registry/tab-bar.json +15 -0
- package/registry/tabs.json +15 -4
- package/registry/tag-input.json +15 -2
- package/registry/tag-selector.json +13 -2
- package/registry/terminal-replay.json +15 -2
- package/registry/theme.json +13 -2
- package/registry/toast.json +13 -2
- package/registry/toc.json +15 -2
- package/registry/tooltip.json +14 -2
- package/registry/tree-view.json +15 -2
- package/registry/txt.json +13 -0
- package/registry/update-prompt.json +316 -0
- package/registry/verified-badge.json +13 -2
- package/registry/vertical-video.json +32 -6
- package/registry/video-player.json +16 -5
- package/registry/video-trimmer.json +15 -2
- package/registry/virtual.json +15 -2
- package/dist/chunk-VDR2EP6K.js.map +0 -1
- /package/dist/{chunk-276PTQMQ.js.map → chunk-3BC4XQ6C.js.map} +0 -0
- /package/dist/{chunk-2NB27LM7.js.map → chunk-3IN6TOPM.js.map} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/maintenance-screen/native/default.tsx
|
|
4
|
+
import { MaintenanceScreen, ProductMark } from "@krizaka/ui/native";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function NativeMaintenanceScreenDefault() {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
MaintenanceScreen,
|
|
9
|
+
{
|
|
10
|
+
fill: false,
|
|
11
|
+
mark: /* @__PURE__ */ jsx(ProductMark, { id: "orazaka", size: 96, animated: false }),
|
|
12
|
+
title: "Back in a few minutes",
|
|
13
|
+
message: "We are upgrading our servers. Your work is safe.",
|
|
14
|
+
retryLabel: "Try again",
|
|
15
|
+
onRetry: () => void 0
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
NativeMaintenanceScreenDefault as default
|
|
21
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaintenanceScreen, ProductMark } from "@krizaka/ui/native";
|
|
2
|
+
|
|
3
|
+
// Maintenance is on in the backend's parameters; the operator wrote the message.
|
|
4
|
+
export default function NativeMaintenanceScreenDefault() {
|
|
5
|
+
return (
|
|
6
|
+
<MaintenanceScreen
|
|
7
|
+
fill={false}
|
|
8
|
+
mark={<ProductMark id="orazaka" size={96} animated={false} />}
|
|
9
|
+
title="Back in a few minutes"
|
|
10
|
+
message="We are upgrading our servers. Your work is safe."
|
|
11
|
+
retryLabel="Try again"
|
|
12
|
+
onRetry={() => undefined}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/media-grid/loading.tsx
|
|
4
|
+
import { LoadMore, MediaGridSkeleton } from "@krizaka/ui/media-grid";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function MediaGridLoading() {
|
|
8
|
+
const [loading, setLoading] = useState(false);
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
10
|
+
/* @__PURE__ */ jsx(MediaGridSkeleton, { label: "Loading videos", shelfCount: 4, count: 4 }),
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
LoadMore,
|
|
13
|
+
{
|
|
14
|
+
hasMore: true,
|
|
15
|
+
loading,
|
|
16
|
+
onLoadMore: () => {
|
|
17
|
+
setLoading(true);
|
|
18
|
+
setTimeout(() => setLoading(false), 1200);
|
|
19
|
+
},
|
|
20
|
+
label: "Load more",
|
|
21
|
+
loadingLabel: "Loading more videos"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
MediaGridLoading as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { LoadMore, MediaGridSkeleton } from "@krizaka/ui/media-grid";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
|
|
6
|
+
// The wait, in the shape of the feed: skeleton cards of the real frames (a shelf of 9:16, a grid of 16:9) while the first
|
|
7
|
+
// page loads, then `LoadMore` under the list — the next page is asked a screenful before the end, the button never fails.
|
|
8
|
+
export default function MediaGridLoading() {
|
|
9
|
+
const [loading, setLoading] = useState(false);
|
|
10
|
+
return (
|
|
11
|
+
<div className="flex flex-col gap-6">
|
|
12
|
+
<MediaGridSkeleton label="Loading videos" shelfCount={4} count={4} />
|
|
13
|
+
<LoadMore
|
|
14
|
+
hasMore
|
|
15
|
+
loading={loading}
|
|
16
|
+
onLoadMore={() => {
|
|
17
|
+
setLoading(true);
|
|
18
|
+
setTimeout(() => setLoading(false), 1200);
|
|
19
|
+
}}
|
|
20
|
+
label="Load more"
|
|
21
|
+
loadingLabel="Loading more videos"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -4,28 +4,31 @@
|
|
|
4
4
|
import { OrazakaLogo } from "@krizaka/ui";
|
|
5
5
|
import { Button } from "@krizaka/ui/button";
|
|
6
6
|
import { NavBar } from "@krizaka/ui/nav-bar";
|
|
7
|
-
import { familyLabels } from "@krizaka/ui/sites";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
10
|
-
{
|
|
11
|
-
{
|
|
12
|
-
{ href: "#docs", label: "Docs" }
|
|
8
|
+
var groups = [
|
|
9
|
+
{ id: "product", label: "Product", links: [["#how", "How it works", "Install to first answer in three commands."], ["#studios", "Studios", "Ready-made workflows, priced before you run."], ["#demo", "Demo", "Real runs: prompts, images, videos."]] },
|
|
10
|
+
{ id: "platforms", label: "Platforms", links: [["#web", "Web", "The workspace in your browser."], ["#mac", "Mac", "Orazaka Desktop for Apple Silicon."], ["#self-host", "Self-host", "Install it on your own servers."]] }
|
|
13
11
|
];
|
|
12
|
+
var icon = /* @__PURE__ */ jsxs("svg", { "data-kz-icon": true, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": true, children: [
|
|
13
|
+
/* @__PURE__ */ jsx("path", { d: "M12 3 19.8 7.5v9L12 21l-7.8-4.5v-9Z" }),
|
|
14
|
+
/* @__PURE__ */ jsx("circle", { "data-node": true, cx: "12", cy: "12", r: "2.4", fill: "currentColor" })
|
|
15
|
+
] });
|
|
14
16
|
function NavBarFamilyProduct() {
|
|
15
|
-
return /* @__PURE__ */ jsxs(NavBar.Root, { label: "Main", children: [
|
|
17
|
+
return /* @__PURE__ */ jsxs(NavBar.Root, { label: "Main", floating: false, children: [
|
|
16
18
|
/* @__PURE__ */ jsxs(NavBar.Brand, { href: "#home", children: [
|
|
17
19
|
/* @__PURE__ */ jsx(OrazakaLogo, { size: 22 }),
|
|
18
20
|
"Orazaka"
|
|
19
21
|
] }),
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
/* @__PURE__ */ jsxs(NavBar.Items, { children: [
|
|
23
|
+
groups.map((g) => /* @__PURE__ */ jsx(NavBar.Menu, { value: g.id, label: g.label, children: g.links.map(([href, title, line]) => /* @__PURE__ */ jsx(NavBar.MenuLink, { href, title, description: line, icon }, href)) }, g.id)),
|
|
24
|
+
/* @__PURE__ */ jsx(NavBar.Link, { href: "#docs", children: "Docs" })
|
|
25
|
+
] }),
|
|
23
26
|
/* @__PURE__ */ jsxs(NavBar.Actions, { children: [
|
|
24
|
-
/* @__PURE__ */ jsx(
|
|
25
|
-
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "primary", size: "sm", shape: "
|
|
27
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "ghost", size: "sm", className: "hidden md:inline-flex", children: /* @__PURE__ */ jsx("a", { href: "#sign-in", children: "Sign in" }) }),
|
|
28
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "primary", size: "sm", shape: "cut", className: "hidden md:inline-flex", children: /* @__PURE__ */ jsx("a", { href: "https://www.krizaka.com/contact?topic=orazaka", children: "Talk to us" }) }),
|
|
26
29
|
/* @__PURE__ */ jsxs(NavBar.Mobile, { openLabel: "Open the menu", closeLabel: "Close the menu", children: [
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */ jsx(NavBar.
|
|
30
|
+
groups.map((g) => /* @__PURE__ */ jsx(NavBar.MobileGroup, { label: g.label, children: g.links.map(([href, title]) => /* @__PURE__ */ jsx(NavBar.MobileLink, { href, children: title }, href)) }, g.id)),
|
|
31
|
+
/* @__PURE__ */ jsx(NavBar.MobileLink, { href: "#docs", children: "Docs" })
|
|
29
32
|
] })
|
|
30
33
|
] })
|
|
31
34
|
] });
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { OrazakaLogo } from "@krizaka/ui";
|
|
2
2
|
import { Button } from "@krizaka/ui/button";
|
|
3
3
|
import { NavBar } from "@krizaka/ui/nav-bar";
|
|
4
|
-
import { familyLabels } from "@krizaka/ui/sites";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
5
|
+
// The product-site standard: the mark alone, Product ▾ · Platforms ▾ · Docs, Sign in and one action; the phone panel
|
|
6
|
+
// repeats the groups. Each menu link: icon · title · one line.
|
|
7
|
+
const groups = [
|
|
8
|
+
{ id: "product", label: "Product", links: [["#how", "How it works", "Install to first answer in three commands."], ["#studios", "Studios", "Ready-made workflows, priced before you run."], ["#demo", "Demo", "Real runs: prompts, images, videos."]] },
|
|
9
|
+
{ id: "platforms", label: "Platforms", links: [["#web", "Web", "The workspace in your browser."], ["#mac", "Mac", "Orazaka Desktop for Apple Silicon."], ["#self-host", "Self-host", "Install it on your own servers."]] },
|
|
10
10
|
];
|
|
11
|
+
const icon = <svg data-kz-icon viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" aria-hidden><path d="M12 3 19.8 7.5v9L12 21l-7.8-4.5v-9Z" /><circle data-node cx="12" cy="12" r="2.4" fill="currentColor" /></svg>;
|
|
11
12
|
|
|
12
|
-
// dev.orazaka.com: the product's mark and the family, `DEV · v1.2.3`, three sections, and “Talk to us” on
|
|
13
|
-
// krizaka.com while sign-up is closed.
|
|
14
13
|
export default function NavBarFamilyProduct() {
|
|
15
14
|
return (
|
|
16
|
-
<NavBar.Root label="Main">
|
|
15
|
+
<NavBar.Root label="Main" floating={false}>
|
|
17
16
|
<NavBar.Brand href="#home"><OrazakaLogo size={22} />Orazaka</NavBar.Brand>
|
|
18
|
-
<NavBar.Family current="orazaka" labels={familyLabels.en} />
|
|
19
|
-
<NavBar.Badge env="DEV" version="1.2.3" />
|
|
20
17
|
<NavBar.Items>
|
|
21
|
-
{
|
|
22
|
-
<NavBar.
|
|
18
|
+
{groups.map((g) => (
|
|
19
|
+
<NavBar.Menu key={g.id} value={g.id} label={g.label}>
|
|
20
|
+
{g.links.map(([href, title, line]) => <NavBar.MenuLink key={href} href={href} title={title} description={line} icon={icon} />)}
|
|
21
|
+
</NavBar.Menu>
|
|
23
22
|
))}
|
|
23
|
+
<NavBar.Link href="#docs">Docs</NavBar.Link>
|
|
24
24
|
</NavBar.Items>
|
|
25
25
|
<NavBar.Actions>
|
|
26
|
-
<
|
|
27
|
-
<Button asChild variant="primary" size="sm" shape="
|
|
28
|
-
<a href="https://www.krizaka.com/contact?topic=orazaka">Talk to us</a>
|
|
29
|
-
</Button>
|
|
26
|
+
<Button asChild variant="ghost" size="sm" className="hidden md:inline-flex"><a href="#sign-in">Sign in</a></Button>
|
|
27
|
+
<Button asChild variant="primary" size="sm" shape="cut" className="hidden md:inline-flex"><a href="https://www.krizaka.com/contact?topic=orazaka">Talk to us</a></Button>
|
|
30
28
|
<NavBar.Mobile openLabel="Open the menu" closeLabel="Close the menu">
|
|
31
|
-
{
|
|
32
|
-
<NavBar.
|
|
29
|
+
{groups.map((g) => (
|
|
30
|
+
<NavBar.MobileGroup key={g.id} label={g.label}>
|
|
31
|
+
{g.links.map(([href, title]) => <NavBar.MobileLink key={href} href={href}>{title}</NavBar.MobileLink>)}
|
|
32
|
+
</NavBar.MobileGroup>
|
|
33
33
|
))}
|
|
34
|
-
<NavBar.
|
|
34
|
+
<NavBar.MobileLink href="#docs">Docs</NavBar.MobileLink>
|
|
35
35
|
</NavBar.Mobile>
|
|
36
36
|
</NavBar.Actions>
|
|
37
37
|
</NavBar.Root>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/update-prompt/default.tsx
|
|
4
|
+
import { ProductLogo } from "@krizaka/ui";
|
|
5
|
+
import { UpdatePrompt } from "@krizaka/ui/update-prompt";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function UpdatePromptDefault() {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
UpdatePrompt,
|
|
10
|
+
{
|
|
11
|
+
mark: /* @__PURE__ */ jsx(ProductLogo, { id: "orazaka", size: 40, animated: false }),
|
|
12
|
+
title: "A new version is available",
|
|
13
|
+
message: "Faster chats and a fix for uploads on slow networks.",
|
|
14
|
+
versionLabel: "1.2.0 \u2192 1.4.0",
|
|
15
|
+
updateLabel: "Update",
|
|
16
|
+
onUpdate: () => void 0,
|
|
17
|
+
laterLabel: "Later",
|
|
18
|
+
onLater: () => void 0
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
UpdatePromptDefault as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ProductLogo } from "@krizaka/ui";
|
|
2
|
+
import { UpdatePrompt } from "@krizaka/ui/update-prompt";
|
|
3
|
+
|
|
4
|
+
// The soft update: the backend said `updateMode: "soft"` — a banner the person can dismiss for this version.
|
|
5
|
+
export default function UpdatePromptDefault() {
|
|
6
|
+
return (
|
|
7
|
+
<UpdatePrompt
|
|
8
|
+
mark={<ProductLogo id="orazaka" size={40} animated={false} />}
|
|
9
|
+
title="A new version is available"
|
|
10
|
+
message="Faster chats and a fix for uploads on slow networks."
|
|
11
|
+
versionLabel="1.2.0 → 1.4.0"
|
|
12
|
+
updateLabel="Update"
|
|
13
|
+
onUpdate={() => undefined}
|
|
14
|
+
laterLabel="Later"
|
|
15
|
+
onLater={() => undefined}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/update-prompt/native/default.tsx
|
|
4
|
+
import { ProductMark, UpdatePrompt } from "@krizaka/ui/native";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function NativeUpdatePromptDefault() {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
UpdatePrompt,
|
|
9
|
+
{
|
|
10
|
+
mark: /* @__PURE__ */ jsx(ProductMark, { id: "orazaka", size: 40, animated: false }),
|
|
11
|
+
title: "A new version is available",
|
|
12
|
+
message: "Faster chats and a fix for uploads on slow networks.",
|
|
13
|
+
versionLabel: "1.2.0 \u2192 1.4.0",
|
|
14
|
+
updateLabel: "Update",
|
|
15
|
+
onUpdate: () => void 0,
|
|
16
|
+
laterLabel: "Later",
|
|
17
|
+
onLater: () => void 0
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
NativeUpdatePromptDefault as default
|
|
23
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProductMark, UpdatePrompt } from "@krizaka/ui/native";
|
|
2
|
+
|
|
3
|
+
// The soft update as a card at the top of the home screen; "Later" is remembered for this version.
|
|
4
|
+
export default function NativeUpdatePromptDefault() {
|
|
5
|
+
return (
|
|
6
|
+
<UpdatePrompt
|
|
7
|
+
mark={<ProductMark id="orazaka" size={40} animated={false} />}
|
|
8
|
+
title="A new version is available"
|
|
9
|
+
message="Faster chats and a fix for uploads on slow networks."
|
|
10
|
+
versionLabel="1.2.0 → 1.4.0"
|
|
11
|
+
updateLabel="Update"
|
|
12
|
+
onUpdate={() => undefined}
|
|
13
|
+
laterLabel="Later"
|
|
14
|
+
onLater={() => undefined}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -6,12 +6,13 @@ import { VerticalVideo } from "@krizaka/ui/vertical-video";
|
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
var CDN = "https://krizaka-assets.b-cdn.net/site/people/ui";
|
|
9
|
-
function VerticalVideoRail({ src, poster = `${CDN}/camille-512.9573eaa0b8.webp
|
|
9
|
+
function VerticalVideoRail({ src, poster = `${CDN}/camille-512.9573eaa0b8.webp`, fit = "frame" } = {}) {
|
|
10
10
|
const [liked, setLiked] = useState(false);
|
|
11
11
|
const [following, setFollowing] = useState(false);
|
|
12
|
-
return /* @__PURE__ */ jsx("div", { className: "w-64", children: /* @__PURE__ */ jsx(
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { className: fit === "fill" ? "h-full w-full" : "w-64", children: /* @__PURE__ */ jsx(
|
|
13
13
|
VerticalVideo,
|
|
14
14
|
{
|
|
15
|
+
fit,
|
|
15
16
|
title: "Video: Night shoot, part 2",
|
|
16
17
|
src,
|
|
17
18
|
poster,
|
|
@@ -7,13 +7,14 @@ import { useState } from "react";
|
|
|
7
7
|
const CDN = "https://krizaka-assets.b-cdn.net/site/people/ui";
|
|
8
8
|
|
|
9
9
|
// One short video (`src` and `poster` are yours: a clip of your own): the rail on the right (follow, like, comments, share, your own tip button), the caption bottom-left.
|
|
10
|
-
// Tap pauses, double tap likes, Space pauses and L likes on the focused video.
|
|
11
|
-
export default function VerticalVideoRail({ src, poster = `${CDN}/camille-512.9573eaa0b8.webp
|
|
10
|
+
// Tap pauses, double tap likes, Space pauses and L likes on the focused video. `fit="fill"` fills a box of its own size.
|
|
11
|
+
export default function VerticalVideoRail({ src, poster = `${CDN}/camille-512.9573eaa0b8.webp`, fit = "frame" }: { src?: string; poster?: string; fit?: "frame" | "fill" } = {}) {
|
|
12
12
|
const [liked, setLiked] = useState(false);
|
|
13
13
|
const [following, setFollowing] = useState(false);
|
|
14
14
|
return (
|
|
15
|
-
<div className="w-64">
|
|
15
|
+
<div className={fit === "fill" ? "h-full w-full" : "w-64"}>
|
|
16
16
|
<VerticalVideo
|
|
17
|
+
fit={fit}
|
|
17
18
|
title="Video: Night shoot, part 2"
|
|
18
19
|
src={src}
|
|
19
20
|
poster={poster}
|
package/registry/fab.json
CHANGED
|
@@ -8,6 +8,21 @@
|
|
|
8
8
|
"deprecated": null,
|
|
9
9
|
"category": "actions",
|
|
10
10
|
"platforms": "native",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "n/a",
|
|
14
|
+
"reason": "A floating thumb-zone button is a touch idiom; a web screen puts its main action in the header.",
|
|
15
|
+
"use": "button"
|
|
16
|
+
},
|
|
17
|
+
"native": {
|
|
18
|
+
"state": "yes"
|
|
19
|
+
},
|
|
20
|
+
"desktop": {
|
|
21
|
+
"state": "n/a",
|
|
22
|
+
"reason": "The Mac app puts its main action in the toolbar.",
|
|
23
|
+
"use": "button"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
11
26
|
"whenToUse": [
|
|
12
27
|
"Create on a list screen: a new challenge, a new message.",
|
|
13
28
|
"Record on a camera-first screen."
|
package/registry/field.json
CHANGED
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
"deprecated": null,
|
|
9
9
|
"category": "forms",
|
|
10
10
|
"platforms": "both",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "yes"
|
|
14
|
+
},
|
|
15
|
+
"native": {
|
|
16
|
+
"state": "yes"
|
|
17
|
+
},
|
|
18
|
+
"desktop": {
|
|
19
|
+
"state": "yes"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
11
22
|
"whenToUse": [
|
|
12
23
|
"For every text entry of a form: email, title, description, amount.",
|
|
13
24
|
"`Select` for a choice among many options (a country): the platform's own menu, right on phones."
|
|
@@ -256,11 +267,11 @@
|
|
|
256
267
|
},
|
|
257
268
|
{
|
|
258
269
|
"path": "field/meta.ts",
|
|
259
|
-
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Field\",\n summary: \"A form field: a label, a hint and an error around an `Input`, a `Textarea` or a native `Select`.\",\n status: \"stable\",\n category: \"forms\",\n platforms: \"both\",\n whenToUse: [\n \"For every text entry of a form: email, title, description, amount.\",\n \"`Select` for a choice among many options (a country): the platform's own menu, right on phones.\",\n ],\n whenNotToUse: [\n { when: \"To turn a setting on or off.\", use: \"switch\" },\n { when: \"To choose among two to five options that should all be visible.\", use: \"radio-group\" },\n { when: \"To pick a number in a range by feel.\", use: \"slider\" },\n ],\n bestPractices: [\n \"Always a visible `Field.Label`: a placeholder is an example, never the label.\",\n \"Put the hint before the error is possible (“We never share it”), the error after it is: what is wrong and how to fix it.\",\n \"Use the right `type` (`email`, `url`, `number`) and `autoComplete`: phones show the right keyboard.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"Plain HTML wiring: `Field.Label htmlFor` = the control's `id`; hint and error ids in `aria-describedby`.\",\n \"`invalid` sets `aria-invalid` and `data-invalid` on the control.\",\n \"A disabled control is skipped by Tab: if the value matters, prefer `readOnly`.\",\n ],\n },\n related: [\"checkbox\", \"switch\", \"radio-group\", \"slider\"],\n web: {\n imports: [\"Field\", \"Input\", \"Textarea\", \"Select\"],\n examples: [\n { name: \"default\", title: \"Default\", description: \"A label, an input and a hint.\" },\n { name: \"invalid\", title: \"Invalid\", description: \"`invalid` and its error, read through `aria-describedby`.\" },\n { name: \"disabled\", title: \"Disabled\", description: \"Not editable.\" },\n { name: \"textarea\", title: \"Textarea\", description: \"A longer text.\" },\n { name: \"select\", title: \"Select\", description: \"A native select.\" },\n ],\n },\n native: {\n imports: [\"TextField\", \"Select\"],\n differences: [\n \"One component, `TextField`: the label, the input, the hint or the error together (no `Field.*` parts, no `htmlFor`).\",\n \"Every `TextInput` prop passes through (`secureTextEntry`, `keyboardType`, `autoComplete`, `returnKeyType`); `multiline` is the text area; `onValueChange` gives the text.\",\n \"`end` holds an adornment (a spinner, a check, a show-password button); `inputRef` focuses the input. A choice among many is `Select`: a field that opens a `Sheet` of options.\",\n ],\n examples: [\n { name: \"default\", title: \"Sign-up fields\", description: \"E-mail and password: the right keyboards, autofill, a hint, then an error in place of the hint.\" },\n { name: \"select\", title: \"Select\", description: \"One choice among many: the field opens a sheet of options, picking one closes it.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
270
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Field\",\n summary: \"A form field: a label, a hint and an error around an `Input`, a `Textarea` or a native `Select`.\",\n status: \"stable\",\n category: \"forms\",\n platforms: \"both\",\n parity: { desktop: \"web\" },\n whenToUse: [\n \"For every text entry of a form: email, title, description, amount.\",\n \"`Select` for a choice among many options (a country): the platform's own menu, right on phones.\",\n ],\n whenNotToUse: [\n { when: \"To turn a setting on or off.\", use: \"switch\" },\n { when: \"To choose among two to five options that should all be visible.\", use: \"radio-group\" },\n { when: \"To pick a number in a range by feel.\", use: \"slider\" },\n ],\n bestPractices: [\n \"Always a visible `Field.Label`: a placeholder is an example, never the label.\",\n \"Put the hint before the error is possible (“We never share it”), the error after it is: what is wrong and how to fix it.\",\n \"Use the right `type` (`email`, `url`, `number`) and `autoComplete`: phones show the right keyboard.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"Plain HTML wiring: `Field.Label htmlFor` = the control's `id`; hint and error ids in `aria-describedby`.\",\n \"`invalid` sets `aria-invalid` and `data-invalid` on the control.\",\n \"A disabled control is skipped by Tab: if the value matters, prefer `readOnly`.\",\n ],\n },\n related: [\"checkbox\", \"switch\", \"radio-group\", \"slider\"],\n web: {\n imports: [\"Field\", \"Input\", \"Textarea\", \"Select\"],\n examples: [\n { name: \"default\", title: \"Default\", description: \"A label, an input and a hint.\" },\n { name: \"invalid\", title: \"Invalid\", description: \"`invalid` and its error, read through `aria-describedby`.\" },\n { name: \"disabled\", title: \"Disabled\", description: \"Not editable.\" },\n { name: \"textarea\", title: \"Textarea\", description: \"A longer text.\" },\n { name: \"select\", title: \"Select\", description: \"A native select.\" },\n ],\n },\n native: {\n imports: [\"TextField\", \"Select\"],\n differences: [\n \"One component, `TextField`: the label, the input, the hint or the error together (no `Field.*` parts, no `htmlFor`).\",\n \"Every `TextInput` prop passes through (`secureTextEntry`, `keyboardType`, `autoComplete`, `returnKeyType`); `multiline` is the text area; `onValueChange` gives the text.\",\n \"`end` holds an adornment (a spinner, a check, a show-password button); `inputRef` focuses the input. A choice among many is `Select`: a field that opens a `Sheet` of options.\",\n ],\n examples: [\n { name: \"default\", title: \"Sign-up fields\", description: \"E-mail and password: the right keyboards, autofill, a hint, then an error in place of the hint.\" },\n { name: \"select\", title: \"Select\", description: \"One choice among many: the field opens a sheet of options, picking one closes it.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
260
271
|
},
|
|
261
272
|
{
|
|
262
273
|
"path": "meta.ts",
|
|
263
|
-
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"activity-feed\"\n | \"action-sheet\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"document-viewer\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"map\"\n | \"markdown\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"radio-group\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"splash-handoff\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
274
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"radio-group\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
264
275
|
}
|
|
265
276
|
],
|
|
266
277
|
"dependencies": [
|
|
@@ -8,6 +8,19 @@
|
|
|
8
8
|
"deprecated": null,
|
|
9
9
|
"category": "media",
|
|
10
10
|
"platforms": "web",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "yes"
|
|
14
|
+
},
|
|
15
|
+
"native": {
|
|
16
|
+
"state": "n/a",
|
|
17
|
+
"reason": "On a phone files come from the camera roll or the camera.",
|
|
18
|
+
"use": "media-picker"
|
|
19
|
+
},
|
|
20
|
+
"desktop": {
|
|
21
|
+
"state": "yes"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
11
24
|
"whenToUse": [
|
|
12
25
|
"To send files: a video to publish, documents to index, pictures for a gallery.",
|
|
13
26
|
"With `useUploadQueue` for large files that must survive a pause, a failure or a slow network (Tus, multipart)."
|
|
@@ -272,7 +285,7 @@
|
|
|
272
285
|
},
|
|
273
286
|
{
|
|
274
287
|
"path": "file-upload/meta.ts",
|
|
275
|
-
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"File upload\",\n summary: \"A drop zone that checks type, size and count, a list of uploads with preview, progress, speed and the actions each state allows, and a queue that pauses and resumes — Tus-ready without depending on it.\",\n status: \"beta\",\n category: \"media\",\n platforms: \"web\",\n whenToUse: [\n \"To send files: a video to publish, documents to index, pictures for a gallery.\",\n \"With `useUploadQueue` for large files that must survive a pause, a failure or a slow network (Tus, multipart).\",\n ],\n whenNotToUse: [\n { when: \"To take a picture or a clip with the camera in the page: media capture.\", use: \"media-capture\" },\n { when: \"To choose a picture's frame before sending it: the cropper, then the upload.\", use: \"image-cropper\" },\n ],\n bestPractices: [\n \"Say what is accepted in `hint` (“MP4 or MOV, up to 4 GB”) and enforce it with `accept` and `maxSize`.\",\n \"Explain each refusal with `refusalLabel` (“clip.avi is not a supported format”).\",\n \"Wrap your upload client in `upload(file, { signal, onProgress, resumed })`: abort on `signal`, resume from the offset when `resumed`.\",\n \"Revoke previews you create yourself; `useUploadQueue` revokes its own.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Enter / Space\", action: \"On the button: open the file picker (dropping is never the only way).\" }],\n notes: [\n \"The zone's button is described by the title and the hint; the file input itself stays out of the tab order.\",\n \"Each upload's progress is a `progressbar` named by the file; a failure is announced (`role=\\\"alert\\\"`).\",\n \"Every action is a button named with the file (“Pause clip.mp4”).\",\n ],\n },\n related: [\"progress\", \"media-capture\", \"image-cropper\", \"video-trimmer\"],\n web: {\n imports: [\"Dropzone\", \"UploadList\", \"useUploadQueue\", \"acceptsFile\", \"formatBytes\"],\n examples: [\n { name: \"video\", title: \"Publish a video\", description: \"The zone and the queue together: drop, watch the progress, pause and resume.\" },\n { name: \"states\", title: \"Every state\", description: \"`UploadList` with an upload under way, a paused one, a failed one and a finished one.\" },\n { name: \"images\", title: \"Several pictures\", description: \"Up to six images of 10 MB; the refused ones are listed with their reason.\" },\n { name: \"tus\", title: \"Tus, resumable\", description: \"`useUploadQueue` around a resumable client: abort on pause, continue from the offset on resume.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
288
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"File upload\",\n summary: \"A drop zone that checks type, size and count, a list of uploads with preview, progress, speed and the actions each state allows, and a queue that pauses and resumes — Tus-ready without depending on it.\",\n status: \"beta\",\n category: \"media\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"On a phone files come from the camera roll or the camera.\", use: \"media-picker\" }, desktop: \"web\" },\n whenToUse: [\n \"To send files: a video to publish, documents to index, pictures for a gallery.\",\n \"With `useUploadQueue` for large files that must survive a pause, a failure or a slow network (Tus, multipart).\",\n ],\n whenNotToUse: [\n { when: \"To take a picture or a clip with the camera in the page: media capture.\", use: \"media-capture\" },\n { when: \"To choose a picture's frame before sending it: the cropper, then the upload.\", use: \"image-cropper\" },\n ],\n bestPractices: [\n \"Say what is accepted in `hint` (“MP4 or MOV, up to 4 GB”) and enforce it with `accept` and `maxSize`.\",\n \"Explain each refusal with `refusalLabel` (“clip.avi is not a supported format”).\",\n \"Wrap your upload client in `upload(file, { signal, onProgress, resumed })`: abort on `signal`, resume from the offset when `resumed`.\",\n \"Revoke previews you create yourself; `useUploadQueue` revokes its own.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Enter / Space\", action: \"On the button: open the file picker (dropping is never the only way).\" }],\n notes: [\n \"The zone's button is described by the title and the hint; the file input itself stays out of the tab order.\",\n \"Each upload's progress is a `progressbar` named by the file; a failure is announced (`role=\\\"alert\\\"`).\",\n \"Every action is a button named with the file (“Pause clip.mp4”).\",\n ],\n },\n related: [\"progress\", \"media-capture\", \"image-cropper\", \"video-trimmer\"],\n web: {\n imports: [\"Dropzone\", \"UploadList\", \"useUploadQueue\", \"acceptsFile\", \"formatBytes\"],\n examples: [\n { name: \"video\", title: \"Publish a video\", description: \"The zone and the queue together: drop, watch the progress, pause and resume.\" },\n { name: \"states\", title: \"Every state\", description: \"`UploadList` with an upload under way, a paused one, a failed one and a finished one.\" },\n { name: \"images\", title: \"Several pictures\", description: \"Up to six images of 10 MB; the refused ones are listed with their reason.\" },\n { name: \"tus\", title: \"Tus, resumable\", description: \"`useUploadQueue` around a resumable client: abort on pause, continue from the offset on resume.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
276
289
|
},
|
|
277
290
|
{
|
|
278
291
|
"path": "glyphs.tsx",
|
|
@@ -284,7 +297,7 @@
|
|
|
284
297
|
},
|
|
285
298
|
{
|
|
286
299
|
"path": "meta.ts",
|
|
287
|
-
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"activity-feed\"\n | \"action-sheet\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"document-viewer\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"map\"\n | \"markdown\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"radio-group\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"splash-handoff\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
300
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"radio-group\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
288
301
|
}
|
|
289
302
|
],
|
|
290
303
|
"dependencies": [
|