@krizaka/ui 2.2.0 → 2.3.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 (263) hide show
  1. package/README.md +17 -7
  2. package/dist/{button-Cgfkg_3y.d.ts → button-BMAO7dKF.d.ts} +29 -2
  3. package/dist/button.d.ts +32 -5
  4. package/dist/button.js +62 -9
  5. package/dist/button.js.map +1 -1
  6. package/dist/chip-link.d.ts +53 -0
  7. package/dist/chip-link.js +32 -0
  8. package/dist/chip-link.js.map +1 -0
  9. package/dist/chunk-43PTCDTL.js +31 -0
  10. package/dist/chunk-43PTCDTL.js.map +1 -0
  11. package/dist/chunk-6ISW63JI.js +11 -0
  12. package/dist/chunk-6ISW63JI.js.map +1 -0
  13. package/dist/chunk-HAQWKORZ.js +117 -0
  14. package/dist/chunk-HAQWKORZ.js.map +1 -0
  15. package/dist/{chunk-FHYZSO2S.js → chunk-R6SDS7JM.js} +5 -3
  16. package/dist/chunk-R6SDS7JM.js.map +1 -0
  17. package/dist/chunk-RUPNPMP3.js +103 -0
  18. package/dist/chunk-RUPNPMP3.js.map +1 -0
  19. package/dist/chunk-VDR2EP6K.js +49 -0
  20. package/dist/chunk-VDR2EP6K.js.map +1 -0
  21. package/dist/chunk-WEVYKZIF.js +33 -0
  22. package/dist/chunk-WEVYKZIF.js.map +1 -0
  23. package/dist/command.d.ts +7 -7
  24. package/dist/command.js +3 -2
  25. package/dist/command.js.map +1 -1
  26. package/dist/confirm-button.d.ts +1 -1
  27. package/dist/confirm-button.js +2 -1
  28. package/dist/confirm-button.js.map +1 -1
  29. package/dist/{dialog-GQ4Nvuyf.d.ts → dialog-D42QwYb_.d.ts} +11 -1
  30. package/dist/dialog.d.ts +1 -1
  31. package/dist/dialog.js +3 -2
  32. package/dist/dialog.js.map +1 -1
  33. package/dist/glow-card.d.ts +20 -0
  34. package/dist/glow-card.js +30 -0
  35. package/dist/glow-card.js.map +1 -0
  36. package/dist/index.d.ts +2 -20
  37. package/dist/index.js +7 -64
  38. package/dist/index.js.map +1 -1
  39. package/dist/iso.d.ts +400 -0
  40. package/dist/iso.js +363 -0
  41. package/dist/iso.js.map +1 -0
  42. package/dist/loader.d.ts +206 -0
  43. package/dist/loader.js +138 -0
  44. package/dist/loader.js.map +1 -0
  45. package/dist/marquee.d.ts +33 -0
  46. package/dist/marquee.js +52 -0
  47. package/dist/marquee.js.map +1 -0
  48. package/dist/meter.d.ts +146 -0
  49. package/dist/meter.js +107 -0
  50. package/dist/meter.js.map +1 -0
  51. package/dist/motion.css +394 -3
  52. package/dist/motion.d.ts +46 -0
  53. package/dist/motion.js +10 -0
  54. package/dist/motion.js.map +1 -0
  55. package/dist/nav-bar.d.ts +178 -0
  56. package/dist/nav-bar.js +157 -0
  57. package/dist/nav-bar.js.map +1 -0
  58. package/dist/number-ticker.d.ts +32 -0
  59. package/dist/number-ticker.js +61 -0
  60. package/dist/number-ticker.js.map +1 -0
  61. package/dist/progress.d.ts +56 -1
  62. package/dist/progress.js +72 -25
  63. package/dist/progress.js.map +1 -1
  64. package/dist/skeleton.d.ts +18 -3
  65. package/dist/skeleton.js +9 -1
  66. package/dist/skeleton.js.map +1 -1
  67. package/dist/spinner.d.ts +21 -5
  68. package/dist/spinner.js +13 -12
  69. package/dist/spinner.js.map +1 -1
  70. package/dist/stepper.d.ts +112 -0
  71. package/dist/stepper.js +67 -0
  72. package/dist/stepper.js.map +1 -0
  73. package/dist/tabs.d.ts +1 -1
  74. package/dist/tabs.js +14 -8
  75. package/dist/tabs.js.map +1 -1
  76. package/dist/theme.d.ts +1 -1
  77. package/dist/theme.js +2 -1
  78. package/dist/theme.js.map +1 -1
  79. package/dist/toast.d.ts +39 -4
  80. package/dist/toast.js +81 -7
  81. package/dist/toast.js.map +1 -1
  82. package/package.json +148 -8
  83. package/registry/alert.json +1 -1
  84. package/registry/avatar.json +1 -1
  85. package/registry/badge.json +1 -1
  86. package/registry/button.json +232 -26
  87. package/registry/card.json +1 -1
  88. package/registry/checkbox.json +1 -1
  89. package/registry/chip-link.json +158 -0
  90. package/registry/chip.json +1 -1
  91. package/registry/command.json +1 -1
  92. package/registry/confirm-button.json +91 -7
  93. package/registry/countdown.json +1 -1
  94. package/registry/dialog.json +15 -7
  95. package/registry/dropdown-menu.json +1 -1
  96. package/registry/empty-state.json +1 -1
  97. package/registry/examples/button/error.js +11 -0
  98. package/registry/examples/button/error.tsx +10 -0
  99. package/registry/examples/button/loading.tsx +1 -1
  100. package/registry/examples/button/save-flow.d.ts +4 -0
  101. package/registry/examples/button/save-flow.js +28 -0
  102. package/registry/examples/button/save-flow.tsx +24 -0
  103. package/registry/examples/button/signature.d.ts +4 -0
  104. package/registry/examples/button/signature.js +17 -0
  105. package/registry/examples/button/signature.tsx +19 -0
  106. package/registry/examples/button/upload-progress.d.ts +4 -0
  107. package/registry/examples/button/upload-progress.js +23 -0
  108. package/registry/examples/button/upload-progress.tsx +26 -0
  109. package/registry/examples/chip-link/filters.d.ts +4 -0
  110. package/registry/examples/chip-link/filters.js +12 -0
  111. package/registry/examples/chip-link/filters.tsx +17 -0
  112. package/registry/examples/dialog/left.d.ts +4 -0
  113. package/registry/examples/dialog/left.js +22 -0
  114. package/registry/examples/dialog/left.tsx +32 -0
  115. package/registry/examples/glow-card/link-card.d.ts +4 -0
  116. package/registry/examples/glow-card/link-card.js +14 -0
  117. package/registry/examples/glow-card/link-card.tsx +13 -0
  118. package/registry/examples/glow-card/plans.d.ts +4 -0
  119. package/registry/examples/glow-card/plans.js +25 -0
  120. package/registry/examples/glow-card/plans.tsx +26 -0
  121. package/registry/examples/glow-card/spotlight.d.ts +4 -0
  122. package/registry/examples/glow-card/spotlight.js +14 -0
  123. package/registry/examples/glow-card/spotlight.tsx +15 -0
  124. package/registry/examples/iso/compose.d.ts +4 -0
  125. package/registry/examples/iso/compose.js +22 -0
  126. package/registry/examples/iso/compose.tsx +19 -0
  127. package/registry/examples/iso/orazaka-hero.d.ts +4 -0
  128. package/registry/examples/iso/orazaka-hero.js +26 -0
  129. package/registry/examples/iso/orazaka-hero.tsx +21 -0
  130. package/registry/examples/iso/orochia-hero.d.ts +4 -0
  131. package/registry/examples/iso/orochia-hero.js +29 -0
  132. package/registry/examples/iso/orochia-hero.tsx +23 -0
  133. package/registry/examples/iso/still.d.ts +4 -0
  134. package/registry/examples/iso/still.js +21 -0
  135. package/registry/examples/iso/still.tsx +15 -0
  136. package/registry/examples/loader/endings.d.ts +4 -0
  137. package/registry/examples/loader/endings.js +14 -0
  138. package/registry/examples/loader/endings.tsx +11 -0
  139. package/registry/examples/loader/fetch-flow.d.ts +4 -0
  140. package/registry/examples/loader/fetch-flow.js +24 -0
  141. package/registry/examples/loader/fetch-flow.tsx +24 -0
  142. package/registry/examples/loader/minimal.d.ts +4 -0
  143. package/registry/examples/loader/minimal.js +11 -0
  144. package/registry/examples/loader/minimal.tsx +6 -0
  145. package/registry/examples/loader/overlay.d.ts +4 -0
  146. package/registry/examples/loader/overlay.js +16 -0
  147. package/registry/examples/loader/overlay.tsx +13 -0
  148. package/registry/examples/loader/region-handover.d.ts +4 -0
  149. package/registry/examples/loader/region-handover.js +42 -0
  150. package/registry/examples/loader/region-handover.tsx +29 -0
  151. package/registry/examples/loader/upload-eta.d.ts +4 -0
  152. package/registry/examples/loader/upload-eta.js +11 -0
  153. package/registry/examples/loader/upload-eta.tsx +10 -0
  154. package/registry/examples/marquee/cards.d.ts +4 -0
  155. package/registry/examples/marquee/cards.js +23 -0
  156. package/registry/examples/marquee/cards.tsx +21 -0
  157. package/registry/examples/marquee/logos.d.ts +4 -0
  158. package/registry/examples/marquee/logos.js +12 -0
  159. package/registry/examples/marquee/logos.tsx +17 -0
  160. package/registry/examples/meter/balance.d.ts +4 -0
  161. package/registry/examples/meter/balance.js +14 -0
  162. package/registry/examples/meter/balance.tsx +15 -0
  163. package/registry/examples/meter/quota.d.ts +4 -0
  164. package/registry/examples/meter/quota.js +15 -0
  165. package/registry/examples/meter/quota.tsx +12 -0
  166. package/registry/examples/meter/split.d.ts +4 -0
  167. package/registry/examples/meter/split.js +18 -0
  168. package/registry/examples/meter/split.tsx +18 -0
  169. package/registry/examples/nav-bar/app-bar.d.ts +4 -0
  170. package/registry/examples/nav-bar/app-bar.js +22 -0
  171. package/registry/examples/nav-bar/app-bar.tsx +21 -0
  172. package/registry/examples/nav-bar/menu-open.d.ts +4 -0
  173. package/registry/examples/nav-bar/menu-open.js +26 -0
  174. package/registry/examples/nav-bar/menu-open.tsx +26 -0
  175. package/registry/examples/nav-bar/site.d.ts +4 -0
  176. package/registry/examples/nav-bar/site.js +31 -0
  177. package/registry/examples/nav-bar/site.tsx +36 -0
  178. package/registry/examples/number-ticker/gradient.d.ts +4 -0
  179. package/registry/examples/number-ticker/gradient.js +11 -0
  180. package/registry/examples/number-ticker/gradient.tsx +10 -0
  181. package/registry/examples/number-ticker/live-total.d.ts +4 -0
  182. package/registry/examples/number-ticker/live-total.js +17 -0
  183. package/registry/examples/number-ticker/live-total.tsx +21 -0
  184. package/registry/examples/number-ticker/stats.d.ts +4 -0
  185. package/registry/examples/number-ticker/stats.js +19 -0
  186. package/registry/examples/number-ticker/stats.tsx +23 -0
  187. package/registry/examples/progress/buffer.d.ts +4 -0
  188. package/registry/examples/progress/buffer.js +11 -0
  189. package/registry/examples/progress/buffer.tsx +10 -0
  190. package/registry/examples/progress/statuses.d.ts +4 -0
  191. package/registry/examples/progress/statuses.js +14 -0
  192. package/registry/examples/progress/statuses.tsx +11 -0
  193. package/registry/examples/progress/steps.d.ts +4 -0
  194. package/registry/examples/progress/steps.js +14 -0
  195. package/registry/examples/progress/steps.tsx +13 -0
  196. package/registry/examples/progress/upload.d.ts +4 -0
  197. package/registry/examples/progress/upload.js +11 -0
  198. package/registry/examples/progress/upload.tsx +10 -0
  199. package/registry/examples/skeleton/paragraph.d.ts +4 -0
  200. package/registry/examples/skeleton/paragraph.js +14 -0
  201. package/registry/examples/skeleton/paragraph.tsx +12 -0
  202. package/registry/examples/skeleton/shape-of-content.d.ts +4 -0
  203. package/registry/examples/skeleton/shape-of-content.js +23 -0
  204. package/registry/examples/skeleton/shape-of-content.tsx +26 -0
  205. package/registry/examples/spinner/default.js +5 -2
  206. package/registry/examples/spinner/default.tsx +7 -1
  207. package/registry/examples/spinner/sizes.js +2 -1
  208. package/registry/examples/spinner/sizes.tsx +2 -0
  209. package/registry/examples/spinner/value.d.ts +4 -0
  210. package/registry/examples/spinner/value.js +11 -0
  211. package/registry/examples/spinner/value.tsx +12 -0
  212. package/registry/examples/stepper/checkout.d.ts +4 -0
  213. package/registry/examples/stepper/checkout.js +22 -0
  214. package/registry/examples/stepper/checkout.tsx +17 -0
  215. package/registry/examples/stepper/failed.d.ts +4 -0
  216. package/registry/examples/stepper/failed.js +26 -0
  217. package/registry/examples/stepper/failed.tsx +21 -0
  218. package/registry/examples/stepper/job.d.ts +4 -0
  219. package/registry/examples/stepper/job.js +32 -0
  220. package/registry/examples/stepper/job.tsx +28 -0
  221. package/registry/examples/toast/grouped.d.ts +4 -0
  222. package/registry/examples/toast/grouped.js +21 -0
  223. package/registry/examples/toast/grouped.tsx +23 -0
  224. package/registry/examples/toast/undo.d.ts +4 -0
  225. package/registry/examples/toast/undo.js +29 -0
  226. package/registry/examples/toast/undo.tsx +30 -0
  227. package/registry/examples/toast/upload-progress.d.ts +4 -0
  228. package/registry/examples/toast/upload-progress.js +29 -0
  229. package/registry/examples/toast/upload-progress.tsx +31 -0
  230. package/registry/field.json +1 -1
  231. package/registry/glow-card.json +162 -0
  232. package/registry/index.json +191 -20
  233. package/registry/iso.json +1355 -0
  234. package/registry/kbd.json +1 -1
  235. package/registry/loader.json +399 -0
  236. package/registry/marquee.json +225 -0
  237. package/registry/mascots.json +3 -3
  238. package/registry/meter.json +324 -0
  239. package/registry/nav-bar.json +480 -0
  240. package/registry/number-ticker.json +219 -0
  241. package/registry/page-header.json +1 -1
  242. package/registry/popover.json +1 -1
  243. package/registry/progress.json +116 -11
  244. package/registry/radio-group.json +1 -1
  245. package/registry/section-backdrop.json +1 -1
  246. package/registry/separator.json +1 -1
  247. package/registry/skeleton.json +69 -13
  248. package/registry/slider.json +1 -1
  249. package/registry/slot.json +1 -1
  250. package/registry/spinner.json +91 -27
  251. package/registry/stat.json +1 -1
  252. package/registry/stepper.json +174 -0
  253. package/registry/switch.json +1 -1
  254. package/registry/tabs.json +11 -7
  255. package/registry/theme.json +3 -3
  256. package/registry/toast.json +41 -13
  257. package/registry/tooltip.json +1 -1
  258. package/dist/chunk-FHYZSO2S.js.map +0 -1
  259. package/dist/chunk-PESA2R4U.js +0 -51
  260. package/dist/chunk-PESA2R4U.js.map +0 -1
  261. package/registry/examples/spinner/muted.js +0 -11
  262. package/registry/examples/spinner/muted.tsx +0 -6
  263. /package/registry/examples/{spinner/muted.d.ts → button/error.d.ts} +0 -0
@@ -0,0 +1,26 @@
1
+ import { SkeletonShape } from "@krizaka/ui/skeleton";
2
+
3
+ function CreatorCard({ name, line }: { name: string; line: string }) {
4
+ return (
5
+ <div className="flex items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-4">
6
+ <span data-skeleton aria-hidden className="h-10 w-10 shrink-0 rounded-full bg-accent-soft" />
7
+ <div className="min-w-0">
8
+ <p className="font-semibold text-fg">{name}</p>
9
+ <p className="text-sm text-fg-secondary">{line}</p>
10
+ </div>
11
+ </div>
12
+ );
13
+ }
14
+
15
+ // The skeleton of the real card: the same component with placeholder words, its text and media turned into shapes.
16
+ // The layout is exact — nothing drawn twice, nothing jumps when the data arrives. `data-skeleton` marks any other shape.
17
+ export default function SkeletonShapeOfContent() {
18
+ return (
19
+ <div className="flex w-full max-w-sm flex-col gap-3">
20
+ <SkeletonShape>
21
+ <CreatorCard name="Placeholder name" line="Placeholder supporters line" />
22
+ </SkeletonShape>
23
+ <CreatorCard name="Eric Moreau" line="1,204 supporters · Paris" />
24
+ </div>
25
+ );
26
+ }
@@ -2,9 +2,12 @@
2
2
 
3
3
  // registry/examples/spinner/default.tsx
4
4
  import { Spinner } from "@krizaka/ui/spinner";
5
- import { jsx } from "react/jsx-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  function SpinnerDefault() {
7
- return /* @__PURE__ */ jsx(Spinner, { label: "Loading" });
7
+ return /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-sm text-fg-secondary", children: [
8
+ /* @__PURE__ */ jsx(Spinner, { label: "Searching", size: "sm" }),
9
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "Searching your library\u2026" })
10
+ ] });
8
11
  }
9
12
  export {
10
13
  SpinnerDefault as default
@@ -1,5 +1,11 @@
1
1
  import { Spinner } from "@krizaka/ui/spinner";
2
2
 
3
+ // A short wait in place: light travels around the hexagon, the node breathes. Still and legible under reduced motion.
3
4
  export default function SpinnerDefault() {
4
- return <Spinner label="Loading" />;
5
+ return (
6
+ <p className="flex items-center gap-2 text-sm text-fg-secondary">
7
+ <Spinner label="Searching" size="sm" />
8
+ <span aria-hidden>Searching your library…</span>
9
+ </p>
10
+ );
5
11
  }
@@ -7,7 +7,8 @@ function SpinnerSizes() {
7
7
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
8
8
  /* @__PURE__ */ jsx(Spinner, { label: "Loading", size: "sm" }),
9
9
  /* @__PURE__ */ jsx(Spinner, { label: "Loading", size: "md" }),
10
- /* @__PURE__ */ jsx(Spinner, { label: "Loading", size: "lg" })
10
+ /* @__PURE__ */ jsx(Spinner, { label: "Loading", size: "lg" }),
11
+ /* @__PURE__ */ jsx(Spinner, { label: "Loading", size: "lg", className: "text-fg-secondary" })
11
12
  ] });
12
13
  }
13
14
  export {
@@ -1,11 +1,13 @@
1
1
  import { Spinner } from "@krizaka/ui/spinner";
2
2
 
3
+ // The minimal API, last: `size` sm · md · lg; the colour is `currentColor` (the accent by default, or `className`).
3
4
  export default function SpinnerSizes() {
4
5
  return (
5
6
  <div className="flex items-center gap-4">
6
7
  <Spinner label="Loading" size="sm" />
7
8
  <Spinner label="Loading" size="md" />
8
9
  <Spinner label="Loading" size="lg" />
10
+ <Spinner label="Loading" size="lg" className="text-fg-secondary" />
9
11
  </div>
10
12
  );
11
13
  }
@@ -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/spinner/value.tsx
4
+ import { Spinner } from "@krizaka/ui/spinner";
5
+ import { jsx } from "react/jsx-runtime";
6
+ function SpinnerValue() {
7
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: [0.25, 0.6, 0.9].map((value) => /* @__PURE__ */ jsx(Spinner, { label: `Uploading, ${Math.round(value * 100)} %`, value, size: "lg" }, value)) });
8
+ }
9
+ export {
10
+ SpinnerValue as default
11
+ };
@@ -0,0 +1,12 @@
1
+ import { Spinner } from "@krizaka/ui/spinner";
2
+
3
+ // `value` (0–1): the trace grows to what is done — a determinate wait in the same small footprint.
4
+ export default function SpinnerValue() {
5
+ return (
6
+ <div className="flex items-center gap-4">
7
+ {[0.25, 0.6, 0.9].map((value) => (
8
+ <Spinner key={value} label={`Uploading, ${Math.round(value * 100)} %`} value={value} size="lg" />
9
+ ))}
10
+ </div>
11
+ );
12
+ }
@@ -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,22 @@
1
+ "use client";
2
+
3
+ // registry/examples/stepper/checkout.tsx
4
+ import { Stepper } from "@krizaka/ui/stepper";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var labels = { done: "Done", current: "Current step", upcoming: "Upcoming", error: "Failed" };
7
+ function StepperCheckout() {
8
+ return /* @__PURE__ */ jsx(
9
+ Stepper,
10
+ {
11
+ "aria-label": "Checkout",
12
+ orientation: "horizontal",
13
+ labels,
14
+ current: 1,
15
+ className: "w-full max-w-xl",
16
+ steps: [{ title: "Plan" }, { title: "Payment" }, { title: "Confirmation" }]
17
+ }
18
+ );
19
+ }
20
+ export {
21
+ StepperCheckout as default
22
+ };
@@ -0,0 +1,17 @@
1
+ import { Stepper } from "@krizaka/ui/stepper";
2
+
3
+ const labels = { done: "Done", current: "Current step", upcoming: "Upcoming", error: "Failed" };
4
+
5
+ // A short journey, horizontal: the connectors fill as it advances.
6
+ export default function StepperCheckout() {
7
+ return (
8
+ <Stepper
9
+ aria-label="Checkout"
10
+ orientation="horizontal"
11
+ labels={labels}
12
+ current={1}
13
+ className="w-full max-w-xl"
14
+ steps={[{ title: "Plan" }, { title: "Payment" }, { title: "Confirmation" }]}
15
+ />
16
+ );
17
+ }
@@ -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,26 @@
1
+ "use client";
2
+
3
+ // registry/examples/stepper/failed.tsx
4
+ import { Button } from "@krizaka/ui/button";
5
+ import { Stepper } from "@krizaka/ui/stepper";
6
+ import { jsx } from "react/jsx-runtime";
7
+ var labels = { done: "Done", current: "In progress", upcoming: "Upcoming", error: "Failed" };
8
+ function StepperFailed() {
9
+ return /* @__PURE__ */ jsx(
10
+ Stepper,
11
+ {
12
+ "aria-label": "Payout",
13
+ labels,
14
+ current: 1,
15
+ className: "w-full max-w-sm",
16
+ steps: [
17
+ { title: "Requested", description: "\u20AC1,240.00" },
18
+ { title: "Bank transfer", description: "The bank refused the account number", status: "error", content: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", children: "Update the account" }) },
19
+ { title: "Received" }
20
+ ]
21
+ }
22
+ );
23
+ }
24
+ export {
25
+ StepperFailed as default
26
+ };
@@ -0,0 +1,21 @@
1
+ import { Button } from "@krizaka/ui/button";
2
+ import { Stepper } from "@krizaka/ui/stepper";
3
+
4
+ const labels = { done: "Done", current: "In progress", upcoming: "Upcoming", error: "Failed" };
5
+
6
+ // A step that failed says so (a cross, the danger colour, “Failed” in words) and offers what to do next.
7
+ export default function StepperFailed() {
8
+ return (
9
+ <Stepper
10
+ aria-label="Payout"
11
+ labels={labels}
12
+ current={1}
13
+ className="w-full max-w-sm"
14
+ steps={[
15
+ { title: "Requested", description: "€1,240.00" },
16
+ { title: "Bank transfer", description: "The bank refused the account number", status: "error", content: <Button size="sm" variant="outline">Update the account</Button> },
17
+ { title: "Received" },
18
+ ]}
19
+ />
20
+ );
21
+ }
@@ -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,32 @@
1
+ "use client";
2
+
3
+ // registry/examples/stepper/job.tsx
4
+ import { Progress } from "@krizaka/ui/progress";
5
+ import { Stepper } from "@krizaka/ui/stepper";
6
+ import { jsx } from "react/jsx-runtime";
7
+ var labels = { done: "Done", current: "In progress", upcoming: "Upcoming", error: "Failed" };
8
+ function StepperJob() {
9
+ return /* @__PURE__ */ jsx(
10
+ Stepper,
11
+ {
12
+ "aria-label": "Publishing \u201CNight walk\u201D",
13
+ labels,
14
+ current: 2,
15
+ className: "w-full max-w-sm",
16
+ steps: [
17
+ { title: "Uploaded", description: "1.2 GB in 48 s" },
18
+ { title: "Checked", description: "Format, rights, safety" },
19
+ {
20
+ title: "Transcoding",
21
+ description: "4K, 1080p, 720p",
22
+ value: 0.58,
23
+ content: /* @__PURE__ */ jsx(Progress, { label: "Transcoding", value: 58, eta: "About 2 min left", showLabel: true, size: "sm" })
24
+ },
25
+ { title: "Published", description: "Visible to your supporters" }
26
+ ]
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ StepperJob as default
32
+ };
@@ -0,0 +1,28 @@
1
+ import { Progress } from "@krizaka/ui/progress";
2
+ import { Stepper } from "@krizaka/ui/stepper";
3
+
4
+ const labels = { done: "Done", current: "In progress", upcoming: "Upcoming", error: "Failed" };
5
+
6
+ // A video job in steps: done ones checked, the current one traced and growing to its value with its own progress and
7
+ // time left, the next ones waiting. Every state is said in words for assistive technology.
8
+ export default function StepperJob() {
9
+ return (
10
+ <Stepper
11
+ aria-label="Publishing “Night walk”"
12
+ labels={labels}
13
+ current={2}
14
+ className="w-full max-w-sm"
15
+ steps={[
16
+ { title: "Uploaded", description: "1.2 GB in 48 s" },
17
+ { title: "Checked", description: "Format, rights, safety" },
18
+ {
19
+ title: "Transcoding",
20
+ description: "4K, 1080p, 720p",
21
+ value: 0.58,
22
+ content: <Progress label="Transcoding" value={58} eta="About 2 min left" showLabel size="sm" />,
23
+ },
24
+ { title: "Published", description: "Visible to your supporters" },
25
+ ]}
26
+ />
27
+ );
28
+ }
@@ -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,21 @@
1
+ "use client";
2
+
3
+ // registry/examples/toast/grouped.tsx
4
+ import { Button } from "@krizaka/ui/button";
5
+ import { groupedToast, Toaster } from "@krizaka/ui/toast";
6
+ import { useEffect } from "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ var toasterId = "grouped";
9
+ var message = () => groupedToast("messages", "New message from @maya", { toasterId, countLabel: (n) => `${n} new messages` });
10
+ function ToastGrouped({ defaultOpen = false }) {
11
+ useEffect(() => {
12
+ if (defaultOpen) for (let i = 0; i < 5; i++) message();
13
+ }, [defaultOpen]);
14
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
15
+ /* @__PURE__ */ jsx(Toaster, { id: toasterId, label: "Notifications", closeLabel: "Dismiss" }),
16
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: message, children: "Receive a message" })
17
+ ] });
18
+ }
19
+ export {
20
+ ToastGrouped as default
21
+ };
@@ -0,0 +1,23 @@
1
+ "use client";
2
+
3
+ import { Button } from "@krizaka/ui/button";
4
+ import { groupedToast, Toaster } from "@krizaka/ui/toast";
5
+ import { useEffect } from "react";
6
+
7
+ const toasterId = "grouped";
8
+ // Five messages in a row fold into one toast that counts, instead of a pile of five.
9
+ const message = () => groupedToast("messages", "New message from @maya", { toasterId, countLabel: (n) => `${n} new messages` });
10
+
11
+ export default function ToastGrouped({ defaultOpen = false }: { defaultOpen?: boolean }) {
12
+ useEffect(() => {
13
+ if (defaultOpen) for (let i = 0; i < 5; i++) message();
14
+ }, [defaultOpen]);
15
+ return (
16
+ <>
17
+ <Toaster id={toasterId} label="Notifications" closeLabel="Dismiss" />
18
+ <Button variant="outline" onClick={message}>
19
+ Receive a message
20
+ </Button>
21
+ </>
22
+ );
23
+ }
@@ -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,29 @@
1
+ "use client";
2
+
3
+ // registry/examples/toast/undo.tsx
4
+ import { Button } from "@krizaka/ui/button";
5
+ import { Toaster, undoToast } from "@krizaka/ui/toast";
6
+ import { useEffect } from "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ var toasterId = "undo";
9
+ var archive = () => undoToast("Conversation archived", {
10
+ toasterId,
11
+ description: "\u201CPricing questions\u201D moved to the archive.",
12
+ undoLabel: "Undo",
13
+ onUndo: () => {
14
+ },
15
+ onCommit: () => {
16
+ }
17
+ });
18
+ function ToastUndo({ defaultOpen = false }) {
19
+ useEffect(() => {
20
+ if (defaultOpen) archive();
21
+ }, [defaultOpen]);
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
23
+ /* @__PURE__ */ jsx(Toaster, { id: toasterId, label: "Notifications", closeLabel: "Dismiss" }),
24
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: archive, children: "Archive" })
25
+ ] });
26
+ }
27
+ export {
28
+ ToastUndo as default
29
+ };
@@ -0,0 +1,30 @@
1
+ "use client";
2
+
3
+ import { Button } from "@krizaka/ui/button";
4
+ import { Toaster, undoToast } from "@krizaka/ui/toast";
5
+ import { useEffect } from "react";
6
+
7
+ const toasterId = "undo";
8
+ // Archive now, make it final later: the hairline counts the time left to undo, and pauses while hovered.
9
+ const archive = () =>
10
+ undoToast("Conversation archived", {
11
+ toasterId,
12
+ description: "“Pricing questions” moved to the archive.",
13
+ undoLabel: "Undo",
14
+ onUndo: () => {},
15
+ onCommit: () => {},
16
+ });
17
+
18
+ export default function ToastUndo({ defaultOpen = false }: { defaultOpen?: boolean }) {
19
+ useEffect(() => {
20
+ if (defaultOpen) archive();
21
+ }, [defaultOpen]);
22
+ return (
23
+ <>
24
+ <Toaster id={toasterId} label="Notifications" closeLabel="Dismiss" />
25
+ <Button variant="outline" onClick={archive}>
26
+ Archive
27
+ </Button>
28
+ </>
29
+ );
30
+ }
@@ -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,29 @@
1
+ "use client";
2
+
3
+ // registry/examples/toast/upload-progress.tsx
4
+ import { Button } from "@krizaka/ui/button";
5
+ import { progressToast, Toaster } from "@krizaka/ui/toast";
6
+ import { useEffect } from "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ var toasterId = "upload";
9
+ var upload = (start = 0.1, step = 0.18, until = 1) => {
10
+ let value = start;
11
+ const id = progressToast("Uploading \u201CNight walk.mp4\u201D", { toasterId, value, doneMessage: "Video uploaded" });
12
+ const timer = setInterval(() => {
13
+ value = Math.min(until, value + step);
14
+ progressToast("Uploading \u201CNight walk.mp4\u201D", { toasterId, id, value, doneMessage: "Video uploaded" });
15
+ if (value >= until) clearInterval(timer);
16
+ }, 800);
17
+ };
18
+ function ToastUploadProgress({ defaultOpen = false }) {
19
+ useEffect(() => {
20
+ if (defaultOpen) progressToast("Uploading \u201CNight walk.mp4\u201D", { toasterId, value: 0.64, description: "About 40 s left" });
21
+ }, [defaultOpen]);
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
23
+ /* @__PURE__ */ jsx(Toaster, { id: toasterId, label: "Notifications", closeLabel: "Dismiss" }),
24
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: () => upload(), children: "Upload a video" })
25
+ ] });
26
+ }
27
+ export {
28
+ ToastUploadProgress as default
29
+ };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ import { Button } from "@krizaka/ui/button";
4
+ import { progressToast, Toaster } from "@krizaka/ui/toast";
5
+ import { useEffect } from "react";
6
+
7
+ const toasterId = "upload";
8
+ // One toast updated in place as the upload advances (same `id`), turning into a success at 100 %.
9
+ const upload = (start = 0.1, step = 0.18, until = 1) => {
10
+ let value = start;
11
+ const id = progressToast("Uploading “Night walk.mp4”", { toasterId, value, doneMessage: "Video uploaded" });
12
+ const timer = setInterval(() => {
13
+ value = Math.min(until, value + step);
14
+ progressToast("Uploading “Night walk.mp4”", { toasterId, id, value, doneMessage: "Video uploaded" });
15
+ if (value >= until) clearInterval(timer);
16
+ }, 800);
17
+ };
18
+
19
+ export default function ToastUploadProgress({ defaultOpen = false }: { defaultOpen?: boolean }) {
20
+ useEffect(() => {
21
+ if (defaultOpen) progressToast("Uploading “Night walk.mp4”", { toasterId, value: 0.64, description: "About 40 s left" });
22
+ }, [defaultOpen]);
23
+ return (
24
+ <>
25
+ <Toaster id={toasterId} label="Notifications" closeLabel="Dismiss" />
26
+ <Button variant="outline" onClick={() => upload()}>
27
+ Upload a video
28
+ </Button>
29
+ </>
30
+ );
31
+ }
@@ -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 | \"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"
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 | \"chip-link\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"glow-card\"\n | \"iso\"\n | \"kbd\"\n | \"loader\"\n | \"marquee\"\n | \"mascots\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\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 | \"stepper\"\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": [