@krizaka/ui 2.0.0 → 2.2.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.
Files changed (67) hide show
  1. package/README.md +12 -6
  2. package/dist/index.d.ts +2 -1
  3. package/dist/index.js +52 -10
  4. package/dist/index.js.map +1 -1
  5. package/dist/mascots.d.ts +40 -0
  6. package/dist/mascots.js +253 -0
  7. package/dist/mascots.js.map +1 -0
  8. package/dist/native.d.ts +40 -1
  9. package/dist/native.js +373 -233
  10. package/dist/native.js.map +1 -1
  11. package/dist/theme.d.ts +18 -8
  12. package/dist/theme.js +7 -4
  13. package/dist/theme.js.map +1 -1
  14. package/package.json +14 -4
  15. package/registry/alert.json +1 -1
  16. package/registry/avatar.json +1 -1
  17. package/registry/badge.json +1 -1
  18. package/registry/button.json +1 -1
  19. package/registry/card.json +1 -1
  20. package/registry/checkbox.json +1 -1
  21. package/registry/chip.json +1 -1
  22. package/registry/command.json +1 -1
  23. package/registry/confirm-button.json +1 -1
  24. package/registry/countdown.json +1 -1
  25. package/registry/dialog.json +1 -1
  26. package/registry/dropdown-menu.json +1 -1
  27. package/registry/empty-state.json +1 -1
  28. package/registry/examples/mascots/empty-state.d.ts +4 -0
  29. package/registry/examples/mascots/empty-state.js +24 -0
  30. package/registry/examples/mascots/empty-state.tsx +18 -0
  31. package/registry/examples/mascots/flock.d.ts +4 -0
  32. package/registry/examples/mascots/flock.js +14 -0
  33. package/registry/examples/mascots/flock.tsx +15 -0
  34. package/registry/examples/mascots/long-task.d.ts +4 -0
  35. package/registry/examples/mascots/long-task.js +18 -0
  36. package/registry/examples/mascots/long-task.tsx +15 -0
  37. package/registry/examples/mascots/moods.d.ts +4 -0
  38. package/registry/examples/mascots/moods.js +14 -0
  39. package/registry/examples/mascots/moods.tsx +15 -0
  40. package/registry/examples/mascots/native/default.d.ts +4 -0
  41. package/registry/examples/mascots/native/default.dark.png +0 -0
  42. package/registry/examples/mascots/native/default.js +25 -0
  43. package/registry/examples/mascots/native/default.light.png +0 -0
  44. package/registry/examples/mascots/native/default.tsx +22 -0
  45. package/registry/examples/mascots/own-tone.d.ts +4 -0
  46. package/registry/examples/mascots/own-tone.js +11 -0
  47. package/registry/examples/mascots/own-tone.tsx +12 -0
  48. package/registry/field.json +1 -1
  49. package/registry/index.json +17 -1
  50. package/registry/kbd.json +1 -1
  51. package/registry/mascots.json +314 -0
  52. package/registry/page-header.json +1 -1
  53. package/registry/popover.json +1 -1
  54. package/registry/progress.json +1 -1
  55. package/registry/radio-group.json +1 -1
  56. package/registry/section-backdrop.json +1 -1
  57. package/registry/separator.json +1 -1
  58. package/registry/skeleton.json +1 -1
  59. package/registry/slider.json +1 -1
  60. package/registry/slot.json +1 -1
  61. package/registry/spinner.json +1 -1
  62. package/registry/stat.json +1 -1
  63. package/registry/switch.json +1 -1
  64. package/registry/tabs.json +1 -1
  65. package/registry/theme.json +23 -8
  66. package/registry/toast.json +1 -1
  67. package/registry/tooltip.json +1 -1
@@ -176,7 +176,7 @@
176
176
  },
177
177
  {
178
178
  "path": "meta.ts",
179
- "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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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 /** 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 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"
179
+ "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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"mascots\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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 /** 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 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"
180
180
  }
181
181
  ],
182
182
  "dependencies": [
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+
3
+ // registry/examples/mascots/empty-state.tsx
4
+ import { Button } from "@krizaka/ui/button";
5
+ import { EmptyState } from "@krizaka/ui/empty-state";
6
+ import { Mascot } from "@krizaka/ui/mascots";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function MascotEmptyState() {
9
+ return /* @__PURE__ */ jsxs("div", { className: "flex w-96 flex-col items-center", children: [
10
+ /* @__PURE__ */ jsx(Mascot, { bird: "owl", mood: "empty", size: 112 }),
11
+ /* @__PURE__ */ jsx(
12
+ EmptyState,
13
+ {
14
+ className: "border-none pt-2",
15
+ title: "No documents checked yet",
16
+ description: "Drop a contract or an invoice: every finding comes with the passage it rests on.",
17
+ action: /* @__PURE__ */ jsx(Button, { variant: "primary", children: "Check a document" })
18
+ }
19
+ )
20
+ ] });
21
+ }
22
+ export {
23
+ MascotEmptyState as default
24
+ };
@@ -0,0 +1,18 @@
1
+ import { Button } from "@krizaka/ui/button";
2
+ import { EmptyState } from "@krizaka/ui/empty-state";
3
+ import { Mascot } from "@krizaka/ui/mascots";
4
+
5
+ // The owl reads documents: it waits above an empty list; the words and the action say what to do.
6
+ export default function MascotEmptyState() {
7
+ return (
8
+ <div className="flex w-96 flex-col items-center">
9
+ <Mascot bird="owl" mood="empty" size={112} />
10
+ <EmptyState
11
+ className="border-none pt-2"
12
+ title="No documents checked yet"
13
+ description="Drop a contract or an invoice: every finding comes with the passage it rests on."
14
+ action={<Button variant="primary">Check a document</Button>}
15
+ />
16
+ </div>
17
+ );
18
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+
3
+ // registry/examples/mascots/flock.tsx
4
+ import { Mascot, MASCOT_BIRDS } from "@krizaka/ui/mascots";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function MascotFlock() {
7
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-end gap-6", children: MASCOT_BIRDS.map((bird) => /* @__PURE__ */ jsxs("figure", { className: "flex flex-col items-center gap-2", children: [
8
+ /* @__PURE__ */ jsx(Mascot, { bird, mood: "welcome", size: 88 }),
9
+ /* @__PURE__ */ jsx("figcaption", { className: "text-xs text-fg-secondary", children: bird })
10
+ ] }, bird)) });
11
+ }
12
+ export {
13
+ MascotFlock as default
14
+ };
@@ -0,0 +1,15 @@
1
+ import { Mascot,MASCOT_BIRDS } from "@krizaka/ui/mascots";
2
+
3
+ // The five birds in the host's brand colours: blue on Krizaka, orange in Orazaka, violet in Orochia.
4
+ export default function MascotFlock() {
5
+ return (
6
+ <div className="flex flex-wrap items-end gap-6">
7
+ {MASCOT_BIRDS.map((bird) => (
8
+ <figure key={bird} className="flex flex-col items-center gap-2">
9
+ <Mascot bird={bird} mood="welcome" size={88} />
10
+ <figcaption className="text-xs text-fg-secondary">{bird}</figcaption>
11
+ </figure>
12
+ ))}
13
+ </div>
14
+ );
15
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+
3
+ // registry/examples/mascots/long-task.tsx
4
+ import { Mascot } from "@krizaka/ui/mascots";
5
+ import { Progress } from "@krizaka/ui/progress";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ function MascotLongTask() {
8
+ return /* @__PURE__ */ jsxs("div", { className: "flex w-96 items-center gap-4 rounded-xl border border-border-default bg-surface-1 p-4", children: [
9
+ /* @__PURE__ */ jsx(Mascot, { bird: "pigeon", mood: "thinking", size: 72 }),
10
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
11
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-fg", children: "Rendering the product video" }),
12
+ /* @__PURE__ */ jsx(Progress, { label: "Rendering", value: 42, className: "mt-2" })
13
+ ] })
14
+ ] });
15
+ }
16
+ export {
17
+ MascotLongTask as default
18
+ };
@@ -0,0 +1,15 @@
1
+ import { Mascot } from "@krizaka/ui/mascots";
2
+ import { Progress } from "@krizaka/ui/progress";
3
+
4
+ // A job of a few minutes: the pigeon thinks beside its progress; the label says what runs.
5
+ export default function MascotLongTask() {
6
+ return (
7
+ <div className="flex w-96 items-center gap-4 rounded-xl border border-border-default bg-surface-1 p-4">
8
+ <Mascot bird="pigeon" mood="thinking" size={72} />
9
+ <div className="flex-1">
10
+ <p className="text-sm font-medium text-fg">Rendering the product video</p>
11
+ <Progress label="Rendering" value={42} className="mt-2" />
12
+ </div>
13
+ </div>
14
+ );
15
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+
3
+ // registry/examples/mascots/moods.tsx
4
+ import { Mascot, MASCOT_MOODS } from "@krizaka/ui/mascots";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function MascotMoods() {
7
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-end gap-6", children: MASCOT_MOODS.map((mood) => /* @__PURE__ */ jsxs("figure", { className: "flex flex-col items-center gap-2", children: [
8
+ /* @__PURE__ */ jsx(Mascot, { bird: "owl", mood, size: 88 }),
9
+ /* @__PURE__ */ jsx("figcaption", { className: "text-xs text-fg-secondary", children: mood })
10
+ ] }, mood)) });
11
+ }
12
+ export {
13
+ MascotMoods as default
14
+ };
@@ -0,0 +1,15 @@
1
+ import { Mascot,MASCOT_MOODS } from "@krizaka/ui/mascots";
2
+
3
+ // One bird, its five moods: a welcome, a long wait, a success, an empty list, an error.
4
+ export default function MascotMoods() {
5
+ return (
6
+ <div className="flex flex-wrap items-end gap-6">
7
+ {MASCOT_MOODS.map((mood) => (
8
+ <figure key={mood} className="flex flex-col items-center gap-2">
9
+ <Mascot bird="owl" mood={mood} size={88} />
10
+ <figcaption className="text-xs text-fg-secondary">{mood}</figcaption>
11
+ </figure>
12
+ ))}
13
+ </div>
14
+ );
15
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ // registry/examples/mascots/native/default.tsx
4
+ import { Mascot, Txt } from "@krizaka/ui/native";
5
+ import { View } from "react-native";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ function NativeMascotDefault() {
8
+ return /* @__PURE__ */ jsxs(View, { style: { flexDirection: "row", gap: 16, alignItems: "flex-end" }, children: [
9
+ /* @__PURE__ */ jsxs(View, { style: { alignItems: "center", gap: 4 }, children: [
10
+ /* @__PURE__ */ jsx(Mascot, { bird: "owl", mood: "welcome", size: 80 }),
11
+ /* @__PURE__ */ jsx(Txt, { variant: "caption", children: "welcome" })
12
+ ] }),
13
+ /* @__PURE__ */ jsxs(View, { style: { alignItems: "center", gap: 4 }, children: [
14
+ /* @__PURE__ */ jsx(Mascot, { bird: "falcon", mood: "success", size: 80 }),
15
+ /* @__PURE__ */ jsx(Txt, { variant: "caption", children: "success" })
16
+ ] }),
17
+ /* @__PURE__ */ jsxs(View, { style: { alignItems: "center", gap: 4 }, children: [
18
+ /* @__PURE__ */ jsx(Mascot, { bird: "duck", mood: "empty", size: 80 }),
19
+ /* @__PURE__ */ jsx(Txt, { variant: "caption", children: "empty" })
20
+ ] })
21
+ ] });
22
+ }
23
+ export {
24
+ NativeMascotDefault as default
25
+ };
@@ -0,0 +1,22 @@
1
+ import { Mascot, Txt } from "@krizaka/ui/native";
2
+ import { View } from "react-native";
3
+
4
+ // The owl welcoming, the falcon done, the duck with nothing yet — in the app's brand colours.
5
+ export default function NativeMascotDefault() {
6
+ return (
7
+ <View style={{ flexDirection: "row", gap: 16, alignItems: "flex-end" }}>
8
+ <View style={{ alignItems: "center", gap: 4 }}>
9
+ <Mascot bird="owl" mood="welcome" size={80} />
10
+ <Txt variant="caption">welcome</Txt>
11
+ </View>
12
+ <View style={{ alignItems: "center", gap: 4 }}>
13
+ <Mascot bird="falcon" mood="success" size={80} />
14
+ <Txt variant="caption">success</Txt>
15
+ </View>
16
+ <View style={{ alignItems: "center", gap: 4 }}>
17
+ <Mascot bird="duck" mood="empty" size={80} />
18
+ <Txt variant="caption">empty</Txt>
19
+ </View>
20
+ </View>
21
+ );
22
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,11 @@
1
+ "use client";
2
+
3
+ // registry/examples/mascots/own-tone.tsx
4
+ import { Mascot, MASCOT_BIRDS } from "@krizaka/ui/mascots";
5
+ import { jsx } from "react/jsx-runtime";
6
+ function MascotOwnTone() {
7
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-end gap-6", children: MASCOT_BIRDS.map((bird) => /* @__PURE__ */ jsx(Mascot, { bird, mood: "welcome", tone: "own", size: 88, title: `The ${bird}` }, bird)) });
8
+ }
9
+ export {
10
+ MascotOwnTone as default
11
+ };
@@ -0,0 +1,12 @@
1
+ import { Mascot,MASCOT_BIRDS } from "@krizaka/ui/mascots";
2
+
3
+ // `tone="own"`: each bird in its colours of the Krizaka story (the story page, the about page) — not in a product.
4
+ export default function MascotOwnTone() {
5
+ return (
6
+ <div className="flex flex-wrap items-end gap-6">
7
+ {MASCOT_BIRDS.map((bird) => (
8
+ <Mascot key={bird} bird={bird} mood="welcome" tone="own" size={88} title={`The ${bird}`} />
9
+ ))}
10
+ </div>
11
+ );
12
+ }
@@ -147,7 +147,7 @@
147
147
  },
148
148
  {
149
149
  "path": "meta.ts",
150
- "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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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 /** 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 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"
150
+ "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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"mascots\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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 /** 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 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"
151
151
  }
152
152
  ],
153
153
  "dependencies": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "items": [
5
5
  {
6
6
  "name": "alert",
@@ -314,6 +314,22 @@
314
314
  ],
315
315
  "registryDependencies": []
316
316
  },
317
+ {
318
+ "name": "mascots",
319
+ "type": "primitive",
320
+ "title": "Mascots",
321
+ "summary": "The Krizaka flock: five birds (falcon, owl, duck, flamingo, pigeon) in five moods, drawn in the product's brand colours.",
322
+ "description": "The Krizaka flock: five birds (falcon, owl, duck, flamingo, pigeon) in five moods, drawn in the product's brand colours.",
323
+ "status": "beta",
324
+ "category": "feedback",
325
+ "platforms": "both",
326
+ "examples": {
327
+ "web": 5,
328
+ "native": 1
329
+ },
330
+ "dependencies": [],
331
+ "registryDependencies": []
332
+ },
317
333
  {
318
334
  "name": "page-header",
319
335
  "type": "primitive",
package/registry/kbd.json CHANGED
@@ -96,7 +96,7 @@
96
96
  },
97
97
  {
98
98
  "path": "meta.ts",
99
- "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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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 /** 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 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"
99
+ "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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"mascots\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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 /** 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 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"
100
100
  }
101
101
  ],
102
102
  "dependencies": [