@krizaka/ui 2.4.0 → 2.6.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 (228) hide show
  1. package/README.md +44 -1
  2. package/dist/action-bar.d.ts +38 -0
  3. package/dist/action-bar.js +52 -0
  4. package/dist/action-bar.js.map +1 -0
  5. package/dist/argument-card.d.ts +67 -0
  6. package/dist/argument-card.js +69 -0
  7. package/dist/argument-card.js.map +1 -0
  8. package/dist/audio-player.js +1 -1
  9. package/dist/block-link-BAg4eoZk.d.ts +12 -0
  10. package/dist/blocks.css +529 -0
  11. package/dist/button.js +5 -94
  12. package/dist/button.js.map +1 -1
  13. package/dist/card-grid.d.ts +42 -0
  14. package/dist/card-grid.js +47 -0
  15. package/dist/card-grid.js.map +1 -0
  16. package/dist/chunk-2AGSO3WH.js +20 -0
  17. package/dist/chunk-2AGSO3WH.js.map +1 -0
  18. package/dist/chunk-AB5D3KBG.js +37 -0
  19. package/dist/chunk-AB5D3KBG.js.map +1 -0
  20. package/dist/{chunk-YX6CNVJA.js → chunk-CPA5CF35.js} +1 -1
  21. package/dist/chunk-CPA5CF35.js.map +1 -0
  22. package/dist/chunk-K3SWZXYT.js +92 -0
  23. package/dist/chunk-K3SWZXYT.js.map +1 -0
  24. package/dist/{chunk-XUMJA5ZI.js → chunk-X6TW3X6Y.js} +2 -2
  25. package/dist/chunk-XCBVFMNV.js +41 -0
  26. package/dist/{chunk-YX6CNVJA.js.map → chunk-XCBVFMNV.js.map} +1 -1
  27. package/dist/chunk-XVLWVTQA.js +28 -0
  28. package/dist/chunk-XVLWVTQA.js.map +1 -0
  29. package/dist/chunk-Z6FUPB3Q.js +102 -0
  30. package/dist/chunk-Z6FUPB3Q.js.map +1 -0
  31. package/dist/code-block.d.ts +42 -0
  32. package/dist/code-block.js +202 -0
  33. package/dist/code-block.js.map +1 -0
  34. package/dist/combobox.js +2 -2
  35. package/dist/cta-panel.d.ts +23 -0
  36. package/dist/cta-panel.js +20 -0
  37. package/dist/cta-panel.js.map +1 -0
  38. package/dist/data-table.js +1 -1
  39. package/dist/date-picker.js +1 -1
  40. package/dist/decision-list.d.ts +34 -0
  41. package/dist/decision-list.js +67 -0
  42. package/dist/decision-list.js.map +1 -0
  43. package/dist/file-upload.js +1 -1
  44. package/dist/filter-bar.js +1 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/link-card.d.ts +35 -0
  47. package/dist/link-card.js +46 -0
  48. package/dist/link-card.js.map +1 -0
  49. package/dist/mascot-quote.d.ts +42 -0
  50. package/dist/mascot-quote.js +267 -0
  51. package/dist/mascot-quote.js.map +1 -0
  52. package/dist/media-capture.js +1 -1
  53. package/dist/motion.css +25 -1
  54. package/dist/native.d.ts +28 -1
  55. package/dist/native.js +29 -5
  56. package/dist/native.js.map +1 -1
  57. package/dist/page-hero.d.ts +44 -0
  58. package/dist/page-hero.js +41 -0
  59. package/dist/page-hero.js.map +1 -0
  60. package/dist/page.d.ts +116 -0
  61. package/dist/page.js +17 -0
  62. package/dist/page.js.map +1 -0
  63. package/dist/pagination.js +25 -44
  64. package/dist/pagination.js.map +1 -1
  65. package/dist/pointer-light.d.ts +20 -0
  66. package/dist/pointer-light.js +12 -0
  67. package/dist/pointer-light.js.map +1 -0
  68. package/dist/search-field.js +1 -1
  69. package/dist/section-backdrop.js +4 -22
  70. package/dist/section-backdrop.js.map +1 -1
  71. package/dist/tag-input.js +2 -2
  72. package/dist/terminal-replay.d.ts +68 -0
  73. package/dist/terminal-replay.js +231 -0
  74. package/dist/terminal-replay.js.map +1 -0
  75. package/dist/toc.d.ts +23 -0
  76. package/dist/toc.js +39 -0
  77. package/dist/toc.js.map +1 -0
  78. package/dist/video-player.js +1 -1
  79. package/package.json +193 -8
  80. package/registry/action-bar.json +205 -0
  81. package/registry/alert.json +1 -1
  82. package/registry/argument-card.json +327 -0
  83. package/registry/audio-player.json +2 -2
  84. package/registry/avatar.json +1 -1
  85. package/registry/badge.json +1 -1
  86. package/registry/button.json +5 -5
  87. package/registry/card-grid.json +221 -0
  88. package/registry/card.json +3 -3
  89. package/registry/checkbox.json +1 -1
  90. package/registry/chip-link.json +1 -1
  91. package/registry/chip.json +1 -1
  92. package/registry/code-block.json +262 -0
  93. package/registry/combobox.json +2 -2
  94. package/registry/command.json +1 -1
  95. package/registry/confirm-button.json +3 -3
  96. package/registry/countdown.json +1 -1
  97. package/registry/cta-panel.json +154 -0
  98. package/registry/data-table.json +2 -2
  99. package/registry/date-picker.json +2 -2
  100. package/registry/decision-list.json +144 -0
  101. package/registry/dialog.json +1 -1
  102. package/registry/dropdown-menu.json +1 -1
  103. package/registry/empty-state.json +1 -1
  104. package/registry/examples/action-bar/buttons.d.ts +4 -0
  105. package/registry/examples/action-bar/buttons.js +22 -0
  106. package/registry/examples/action-bar/buttons.tsx +17 -0
  107. package/registry/examples/action-bar/icons.d.ts +4 -0
  108. package/registry/examples/action-bar/icons.js +24 -0
  109. package/registry/examples/action-bar/icons.tsx +23 -0
  110. package/registry/examples/argument-card/building-block.d.ts +4 -0
  111. package/registry/examples/argument-card/building-block.js +29 -0
  112. package/registry/examples/argument-card/building-block.tsx +29 -0
  113. package/registry/examples/argument-card/grid.d.ts +4 -0
  114. package/registry/examples/argument-card/grid.js +17 -0
  115. package/registry/examples/argument-card/grid.tsx +19 -0
  116. package/registry/examples/argument-card/unfold.d.ts +4 -0
  117. package/registry/examples/argument-card/unfold.js +26 -0
  118. package/registry/examples/argument-card/unfold.tsx +21 -0
  119. package/registry/examples/card-grid/products.d.ts +4 -0
  120. package/registry/examples/card-grid/products.js +16 -0
  121. package/registry/examples/card-grid/products.tsx +13 -0
  122. package/registry/examples/card-grid/reveal.d.ts +4 -0
  123. package/registry/examples/card-grid/reveal.js +13 -0
  124. package/registry/examples/card-grid/reveal.tsx +16 -0
  125. package/registry/examples/code-block/build-tools.d.ts +4 -0
  126. package/registry/examples/code-block/build-tools.js +30 -0
  127. package/registry/examples/code-block/build-tools.tsx +25 -0
  128. package/registry/examples/code-block/file.d.ts +4 -0
  129. package/registry/examples/code-block/file.js +17 -0
  130. package/registry/examples/code-block/file.tsx +13 -0
  131. package/registry/examples/cta-panel/discuss.d.ts +4 -0
  132. package/registry/examples/cta-panel/discuss.js +31 -0
  133. package/registry/examples/cta-panel/discuss.tsx +23 -0
  134. package/registry/examples/decision-list/product.d.ts +4 -0
  135. package/registry/examples/decision-list/product.js +35 -0
  136. package/registry/examples/decision-list/product.tsx +30 -0
  137. package/registry/examples/link-card/docs-hub.d.ts +4 -0
  138. package/registry/examples/link-card/docs-hub.js +18 -0
  139. package/registry/examples/link-card/docs-hub.tsx +20 -0
  140. package/registry/examples/link-card/external.d.ts +4 -0
  141. package/registry/examples/link-card/external.js +22 -0
  142. package/registry/examples/link-card/external.tsx +16 -0
  143. package/registry/examples/link-card/stack.d.ts +4 -0
  144. package/registry/examples/link-card/stack.js +26 -0
  145. package/registry/examples/link-card/stack.tsx +21 -0
  146. package/registry/examples/mascot-quote/callout.d.ts +4 -0
  147. package/registry/examples/mascot-quote/callout.js +11 -0
  148. package/registry/examples/mascot-quote/callout.tsx +10 -0
  149. package/registry/examples/mascot-quote/inline.d.ts +4 -0
  150. package/registry/examples/mascot-quote/inline.js +11 -0
  151. package/registry/examples/mascot-quote/inline.tsx +10 -0
  152. package/registry/examples/page/backdrop.d.ts +4 -0
  153. package/registry/examples/page/backdrop.js +23 -0
  154. package/registry/examples/page/backdrop.tsx +18 -0
  155. package/registry/examples/page/facts.d.ts +4 -0
  156. package/registry/examples/page/facts.js +24 -0
  157. package/registry/examples/page/facts.tsx +21 -0
  158. package/registry/examples/page/frame.d.ts +4 -0
  159. package/registry/examples/page/frame.js +15 -0
  160. package/registry/examples/page/frame.tsx +17 -0
  161. package/registry/examples/page/sections.d.ts +4 -0
  162. package/registry/examples/page/sections.js +14 -0
  163. package/registry/examples/page/sections.tsx +15 -0
  164. package/registry/examples/page-hero/building-block.d.ts +4 -0
  165. package/registry/examples/page-hero/building-block.js +24 -0
  166. package/registry/examples/page-hero/building-block.tsx +20 -0
  167. package/registry/examples/page-hero/hub.d.ts +4 -0
  168. package/registry/examples/page-hero/hub.js +21 -0
  169. package/registry/examples/page-hero/hub.tsx +15 -0
  170. package/registry/examples/pointer-light/list.d.ts +4 -0
  171. package/registry/examples/pointer-light/list.js +16 -0
  172. package/registry/examples/pointer-light/list.tsx +14 -0
  173. package/registry/examples/terminal-replay/at-rest.d.ts +4 -0
  174. package/registry/examples/terminal-replay/at-rest.js +32 -0
  175. package/registry/examples/terminal-replay/at-rest.tsx +26 -0
  176. package/registry/examples/terminal-replay/session.d.ts +4 -0
  177. package/registry/examples/terminal-replay/session.js +34 -0
  178. package/registry/examples/terminal-replay/session.tsx +28 -0
  179. package/registry/examples/toc/reading-page.d.ts +4 -0
  180. package/registry/examples/toc/reading-page.js +21 -0
  181. package/registry/examples/toc/reading-page.tsx +21 -0
  182. package/registry/examples/video-player/native/default.dark.png +0 -0
  183. package/registry/examples/video-player/native/default.light.png +0 -0
  184. package/registry/field.json +1 -1
  185. package/registry/file-upload.json +2 -2
  186. package/registry/filter-bar.json +2 -2
  187. package/registry/glow-card.json +1 -1
  188. package/registry/image-cropper.json +1 -1
  189. package/registry/index.json +241 -1
  190. package/registry/iso.json +1 -1
  191. package/registry/kbd.json +1 -1
  192. package/registry/link-card.json +279 -0
  193. package/registry/loader.json +1 -1
  194. package/registry/marquee.json +1 -1
  195. package/registry/mascot-quote.json +191 -0
  196. package/registry/mascots.json +1 -1
  197. package/registry/media-capture.json +4 -4
  198. package/registry/meter.json +1 -1
  199. package/registry/nav-bar.json +1 -1
  200. package/registry/number-ticker.json +1 -1
  201. package/registry/page-header.json +1 -1
  202. package/registry/page-hero.json +254 -0
  203. package/registry/page.json +497 -0
  204. package/registry/pagination.json +2 -2
  205. package/registry/pointer-light.json +119 -0
  206. package/registry/popover.json +1 -1
  207. package/registry/progress.json +1 -1
  208. package/registry/radio-group.json +1 -1
  209. package/registry/search-field.json +2 -2
  210. package/registry/section-backdrop.json +1 -1
  211. package/registry/separator.json +1 -1
  212. package/registry/skeleton.json +3 -3
  213. package/registry/slider.json +1 -1
  214. package/registry/slot.json +1 -1
  215. package/registry/spinner.json +1 -1
  216. package/registry/stat.json +1 -1
  217. package/registry/stepper.json +1 -1
  218. package/registry/switch.json +1 -1
  219. package/registry/tabs.json +1 -1
  220. package/registry/tag-input.json +1 -1
  221. package/registry/terminal-replay.json +317 -0
  222. package/registry/theme.json +1 -1
  223. package/registry/toast.json +1 -1
  224. package/registry/toc.json +157 -0
  225. package/registry/tooltip.json +1 -1
  226. package/registry/video-player.json +4 -4
  227. package/registry/video-trimmer.json +3 -3
  228. /package/dist/{chunk-XUMJA5ZI.js.map → chunk-X6TW3X6Y.js.map} +0 -0
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+
3
+ type CardGridProps = Omit<React.HTMLAttributes<HTMLElement>, "children"> & {
4
+ /** The cards: one cell each. */
5
+ children: React.ReactNode;
6
+ /**
7
+ * The narrowest a column may be, in pixels: the grid fits as many columns as the width allows.
8
+ * @default 300
9
+ */
10
+ min?: number;
11
+ /**
12
+ * `fill` keeps empty tracks (a lone card keeps its width); `fit` stretches the cards of a short row across the width.
13
+ * @default "fill"
14
+ */
15
+ fit?: "fill" | "fit";
16
+ /**
17
+ * `stretch` gives the cells of a row one height; `start` lets each card keep its own (cards that open a panel).
18
+ * @default "stretch"
19
+ */
20
+ align?: "stretch" | "start";
21
+ /**
22
+ * The cards rise once into place (`[data-reveal]`, MotionObserver), staggered by column. `false` on the first screen.
23
+ * @default true
24
+ */
25
+ reveal?: boolean;
26
+ /**
27
+ * The columns the stagger counts (the delay restarts on every row).
28
+ * @default 3
29
+ */
30
+ columns?: number;
31
+ /**
32
+ * The light that follows the pointer over the cards (`[data-kz-light]`).
33
+ * @default true
34
+ */
35
+ light?: boolean;
36
+ /** `ul` when the cards are a list (each cell an `li`). */
37
+ as?: "div" | "ul" | "ol";
38
+ };
39
+ /** A responsive grid of cards: equal rows, a staggered reveal, the pointer's light. */
40
+ declare function CardGrid({ children, min, fit, align, reveal, columns, light, as: Tag, className, style, ...props }: CardGridProps): React.JSX.Element;
41
+
42
+ export { CardGrid, type CardGridProps };
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import {
3
+ POINTER_LIGHT_TARGET,
4
+ usePointerLight
5
+ } from "./chunk-AB5D3KBG.js";
6
+ import {
7
+ cn
8
+ } from "./chunk-5AXLA4LK.js";
9
+
10
+ // src/card-grid/card-grid.tsx
11
+ import * as React from "react";
12
+ import { jsx } from "react/jsx-runtime";
13
+ var STEP_MS = 70;
14
+ function CardGrid({ children, min = 300, fit = "fill", align = "stretch", reveal = true, columns = 3, light = true, as: Tag = "div", className, style, ...props }) {
15
+ const ref = React.useRef(null);
16
+ usePointerLight(light ? ref : NO_REF, POINTER_LIGHT_TARGET);
17
+ const Cell = Tag === "div" ? "div" : "li";
18
+ return /* @__PURE__ */ jsx(
19
+ Tag,
20
+ {
21
+ ref,
22
+ className: cn("kz-cards", className),
23
+ "data-fit": fit === "fit" ? "" : void 0,
24
+ "data-align": align === "start" ? "start" : void 0,
25
+ style: { "--kz-cards-min": `${min}px`, ...style },
26
+ ...props,
27
+ children: React.Children.toArray(children).map((child, i) => {
28
+ const step = Math.min(i % Math.max(columns, 1), 5);
29
+ return /* @__PURE__ */ jsx(
30
+ Cell,
31
+ {
32
+ className: "kz-cards-cell",
33
+ "data-reveal": reveal ? "" : void 0,
34
+ style: reveal && step ? { "--kz-delay": `${step * STEP_MS}ms` } : void 0,
35
+ children: child
36
+ },
37
+ React.isValidElement(child) && child.key != null ? child.key : i
38
+ );
39
+ })
40
+ }
41
+ );
42
+ }
43
+ var NO_REF = { current: null };
44
+ export {
45
+ CardGrid
46
+ };
47
+ //# sourceMappingURL=card-grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/card-grid/card-grid.tsx"],"sourcesContent":["// Client (the pointer's light). A responsive grid of cards (blocks.css): one column on a phone, the cells of a row\n// share their height, each card rises once as it enters the viewport — staggered by column — and the pointer carries a\n// light over the card it is on.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { POINTER_LIGHT_TARGET, usePointerLight } from \"../pointer-light/pointer-light\";\n\nconst STEP_MS = 70;\n\nexport type CardGridProps = Omit<React.HTMLAttributes<HTMLElement>, \"children\"> & {\n /** The cards: one cell each. */\n children: React.ReactNode;\n /**\n * The narrowest a column may be, in pixels: the grid fits as many columns as the width allows.\n * @default 300\n */\n min?: number;\n /**\n * `fill` keeps empty tracks (a lone card keeps its width); `fit` stretches the cards of a short row across the width.\n * @default \"fill\"\n */\n fit?: \"fill\" | \"fit\";\n /**\n * `stretch` gives the cells of a row one height; `start` lets each card keep its own (cards that open a panel).\n * @default \"stretch\"\n */\n align?: \"stretch\" | \"start\";\n /**\n * The cards rise once into place (`[data-reveal]`, MotionObserver), staggered by column. `false` on the first screen.\n * @default true\n */\n reveal?: boolean;\n /**\n * The columns the stagger counts (the delay restarts on every row).\n * @default 3\n */\n columns?: number;\n /**\n * The light that follows the pointer over the cards (`[data-kz-light]`).\n * @default true\n */\n light?: boolean;\n /** `ul` when the cards are a list (each cell an `li`). */\n as?: \"div\" | \"ul\" | \"ol\";\n};\n\n/** A responsive grid of cards: equal rows, a staggered reveal, the pointer's light. */\nexport function CardGrid({ children, min = 300, fit = \"fill\", align = \"stretch\", reveal = true, columns = 3, light = true, as: Tag = \"div\", className, style, ...props }: CardGridProps) {\n const ref = React.useRef<HTMLElement>(null);\n usePointerLight(light ? ref : NO_REF, POINTER_LIGHT_TARGET);\n const Cell = Tag === \"div\" ? \"div\" : \"li\";\n return (\n <Tag\n ref={ref as React.Ref<never>}\n className={cn(\"kz-cards\", className)}\n data-fit={fit === \"fit\" ? \"\" : undefined}\n data-align={align === \"start\" ? \"start\" : undefined}\n style={{ \"--kz-cards-min\": `${min}px`, ...style } as React.CSSProperties}\n {...props}\n >\n {React.Children.toArray(children).map((child, i) => {\n const step = Math.min(i % Math.max(columns, 1), 5);\n return (\n <Cell\n key={React.isValidElement(child) && child.key != null ? child.key : i}\n className=\"kz-cards-cell\"\n data-reveal={reveal ? \"\" : undefined}\n style={reveal && step ? ({ \"--kz-delay\": `${step * STEP_MS}ms` } as React.CSSProperties) : undefined}\n >\n {child}\n </Cell>\n );\n })}\n </Tag>\n );\n}\n\nconst NO_REF: React.RefObject<HTMLElement | null> = { current: null };\n"],"mappings":";;;;;;;;;;AAGA,YAAY,WAAW;AA6Db;AAxDV,IAAM,UAAU;AAwCT,SAAS,SAAS,EAAE,UAAU,MAAM,KAAK,MAAM,QAAQ,QAAQ,WAAW,SAAS,MAAM,UAAU,GAAG,QAAQ,MAAM,IAAI,MAAM,OAAO,WAAW,OAAO,GAAG,MAAM,GAAkB;AACvL,QAAM,MAAY,aAAoB,IAAI;AAC1C,kBAAgB,QAAQ,MAAM,QAAQ,oBAAoB;AAC1D,QAAM,OAAO,QAAQ,QAAQ,QAAQ;AACrC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,YAAY,SAAS;AAAA,MACnC,YAAU,QAAQ,QAAQ,KAAK;AAAA,MAC/B,cAAY,UAAU,UAAU,UAAU;AAAA,MAC1C,OAAO,EAAE,kBAAkB,GAAG,GAAG,MAAM,GAAG,MAAM;AAAA,MAC/C,GAAG;AAAA,MAEH,UAAM,eAAS,QAAQ,QAAQ,EAAE,IAAI,CAAC,OAAO,MAAM;AAClD,cAAM,OAAO,KAAK,IAAI,IAAI,KAAK,IAAI,SAAS,CAAC,GAAG,CAAC;AACjD,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YACV,eAAa,SAAS,KAAK;AAAA,YAC3B,OAAO,UAAU,OAAQ,EAAE,cAAc,GAAG,OAAO,OAAO,KAAK,IAA4B;AAAA,YAE1F;AAAA;AAAA,UALU,qBAAe,KAAK,KAAK,MAAM,OAAO,OAAO,MAAM,MAAM;AAAA,QAMtE;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;AAEA,IAAM,SAA8C,EAAE,SAAS,KAAK;","names":[]}
@@ -0,0 +1,20 @@
1
+ // src/block-link.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var isExternal = (href) => /^[a-z][a-z0-9+.-]*:/i.test(href);
4
+ function BlockLink({
5
+ href,
6
+ linkAs: Link = "a",
7
+ external = isExternal(href),
8
+ rel,
9
+ ...props
10
+ }) {
11
+ if (external) return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: rel ?? "noopener noreferrer", ...props });
12
+ const Comp = Link;
13
+ return /* @__PURE__ */ jsx(Comp, { href, ...props });
14
+ }
15
+
16
+ export {
17
+ isExternal,
18
+ BlockLink
19
+ };
20
+ //# sourceMappingURL=chunk-2AGSO3WH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/block-link.tsx"],"sourcesContent":["// The links of the page blocks (PageHero's back link, LinkCard, ArgumentCard, ActionBar): an internal path renders\n// through the app's router link (`linkAs`, e.g. Next's `Link`), anything else is an `<a>` that opens in a new tab.\n// Shared by the block entries; never exported on its own.\nimport type * as React from \"react\";\n\n/** The app's link component (Next's `Link`, React Router's `Link`…): receives `href`, `className` and the children. */\nexport type LinkComponent = React.ElementType<{ href: string; className?: string; children?: React.ReactNode; \"aria-label\"?: string; \"aria-describedby\"?: string }>;\n\n/** An address that leaves the app: an absolute URL or a protocol (`mailto:`). */\nexport const isExternal = (href: string) => /^[a-z][a-z0-9+.-]*:/i.test(href);\n\nexport function BlockLink({\n href,\n linkAs: Link = \"a\",\n external = isExternal(href),\n rel,\n ...props\n}: Omit<React.ComponentProps<\"a\">, \"href\"> & { href: string; linkAs?: LinkComponent; external?: boolean }) {\n if (external) return <a href={href} target=\"_blank\" rel={rel ?? \"noopener noreferrer\"} {...props} />;\n const Comp = Link as React.ElementType;\n return <Comp href={href} {...props} />;\n}\n"],"mappings":";AAkBuB;AAThB,IAAM,aAAa,CAAC,SAAiB,uBAAuB,KAAK,IAAI;AAErE,SAAS,UAAU;AAAA,EACxB;AAAA,EACA,QAAQ,OAAO;AAAA,EACf,WAAW,WAAW,IAAI;AAAA,EAC1B;AAAA,EACA,GAAG;AACL,GAA2G;AACzG,MAAI,SAAU,QAAO,oBAAC,OAAE,MAAY,QAAO,UAAS,KAAK,OAAO,uBAAwB,GAAG,OAAO;AAClG,QAAM,OAAO;AACb,SAAO,oBAAC,QAAK,MAAa,GAAG,OAAO;AACtC;","names":[]}
@@ -0,0 +1,37 @@
1
+ "use client";
2
+
3
+ // src/pointer-light/pointer-light.tsx
4
+ import * as React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var POINTER_LIGHT_TARGET = "[data-kz-light]";
7
+ function usePointerLight(ref, target = POINTER_LIGHT_TARGET) {
8
+ React.useEffect(() => {
9
+ const group = ref.current;
10
+ if (!group || typeof window.matchMedia !== "function" || !window.matchMedia("(hover: hover) and (prefers-reduced-motion: no-preference)").matches) return;
11
+ const onMove = (e) => {
12
+ const card = e.target?.closest(target);
13
+ if (!card || !group.contains(card)) return;
14
+ const box = card.getBoundingClientRect();
15
+ card.style.setProperty("--kz-pointer-x", `${Math.round(e.clientX - box.left)}px`);
16
+ card.style.setProperty("--kz-pointer-y", `${Math.round(e.clientY - box.top)}px`);
17
+ };
18
+ group.addEventListener("pointermove", onMove, { passive: true });
19
+ return () => group.removeEventListener("pointermove", onMove);
20
+ }, [ref, target]);
21
+ }
22
+ function PointerLight({ target = POINTER_LIGHT_TARGET }) {
23
+ const ref = React.useRef(null);
24
+ const parent = React.useRef(null);
25
+ React.useLayoutEffect(() => {
26
+ parent.current = ref.current?.parentElement ?? null;
27
+ }, []);
28
+ usePointerLight(parent, target);
29
+ return /* @__PURE__ */ jsx("span", { ref, hidden: true });
30
+ }
31
+
32
+ export {
33
+ POINTER_LIGHT_TARGET,
34
+ usePointerLight,
35
+ PointerLight
36
+ };
37
+ //# sourceMappingURL=chunk-AB5D3KBG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pointer-light/pointer-light.tsx"],"sourcesContent":["// Client. The light that follows the pointer over the cards of a group (blocks.css `.kz-block-card::after`): one passive\n// pointermove listener on the group writes the pointer's position into the card it is over (`--kz-pointer-x/y`); the\n// card's CSS draws the light. Nothing runs on a touch screen or under reduced motion, nothing loops.\nimport * as React from \"react\";\n\n/** Every card of the page blocks carries it: LinkCard, ArgumentCard. */\nexport const POINTER_LIGHT_TARGET = \"[data-kz-light]\";\n\n/** Lights the cards inside `ref` that match `target`. Returns nothing; the effect cleans itself up. */\nexport function usePointerLight(ref: React.RefObject<HTMLElement | null>, target: string = POINTER_LIGHT_TARGET) {\n React.useEffect(() => {\n const group = ref.current;\n if (!group || typeof window.matchMedia !== \"function\" || !window.matchMedia(\"(hover: hover) and (prefers-reduced-motion: no-preference)\").matches) return;\n const onMove = (e: PointerEvent) => {\n const card = (e.target as Element | null)?.closest<HTMLElement>(target);\n if (!card || !group.contains(card)) return;\n const box = card.getBoundingClientRect();\n card.style.setProperty(\"--kz-pointer-x\", `${Math.round(e.clientX - box.left)}px`);\n card.style.setProperty(\"--kz-pointer-y\", `${Math.round(e.clientY - box.top)}px`);\n };\n group.addEventListener(\"pointermove\", onMove, { passive: true });\n return () => group.removeEventListener(\"pointermove\", onMove);\n }, [ref, target]);\n}\n\nexport type PointerLightProps = {\n /**\n * The cards to light, as a selector inside the parent element.\n * @default \"[data-kz-light]\"\n */\n target?: string;\n};\n\n/**\n * Drop it inside any group of cards (a grid, a list) — it listens on its parent element. Renders an empty, hidden span.\n * CardGrid includes it already.\n */\nexport function PointerLight({ target = POINTER_LIGHT_TARGET }: PointerLightProps) {\n const ref = React.useRef<HTMLSpanElement>(null);\n const parent = React.useRef<HTMLElement | null>(null);\n React.useLayoutEffect(() => {\n parent.current = ref.current?.parentElement ?? null;\n }, []);\n usePointerLight(parent, target);\n return <span ref={ref} hidden />;\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAyCd;AAtCF,IAAM,uBAAuB;AAG7B,SAAS,gBAAgB,KAA0C,SAAiB,sBAAsB;AAC/G,EAAM,gBAAU,MAAM;AACpB,UAAM,QAAQ,IAAI;AAClB,QAAI,CAAC,SAAS,OAAO,OAAO,eAAe,cAAc,CAAC,OAAO,WAAW,4DAA4D,EAAE,QAAS;AACnJ,UAAM,SAAS,CAAC,MAAoB;AAClC,YAAM,OAAQ,EAAE,QAA2B,QAAqB,MAAM;AACtE,UAAI,CAAC,QAAQ,CAAC,MAAM,SAAS,IAAI,EAAG;AACpC,YAAM,MAAM,KAAK,sBAAsB;AACvC,WAAK,MAAM,YAAY,kBAAkB,GAAG,KAAK,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC,IAAI;AAChF,WAAK,MAAM,YAAY,kBAAkB,GAAG,KAAK,MAAM,EAAE,UAAU,IAAI,GAAG,CAAC,IAAI;AAAA,IACjF;AACA,UAAM,iBAAiB,eAAe,QAAQ,EAAE,SAAS,KAAK,CAAC;AAC/D,WAAO,MAAM,MAAM,oBAAoB,eAAe,MAAM;AAAA,EAC9D,GAAG,CAAC,KAAK,MAAM,CAAC;AAClB;AAcO,SAAS,aAAa,EAAE,SAAS,qBAAqB,GAAsB;AACjF,QAAM,MAAY,aAAwB,IAAI;AAC9C,QAAM,SAAe,aAA2B,IAAI;AACpD,EAAM,sBAAgB,MAAM;AAC1B,WAAO,UAAU,IAAI,SAAS,iBAAiB;AAAA,EACjD,GAAG,CAAC,CAAC;AACL,kBAAgB,QAAQ,MAAM;AAC9B,SAAO,oBAAC,UAAK,KAAU,QAAM,MAAC;AAChC;","names":[]}
@@ -91,4 +91,4 @@ export {
91
91
  RetryGlyph,
92
92
  SortGlyph
93
93
  };
94
- //# sourceMappingURL=chunk-YX6CNVJA.js.map
94
+ //# sourceMappingURL=chunk-CPA5CF35.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/glyphs.tsx"],"sourcesContent":["// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </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AClC;AAEK,IAAM,cAAc,CAAC,MAC1B,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,4BAA2B;AAAA,EACnC,oBAAC,UAAK,GAAE,6CAA4C;AAAA,GACtD;AAEK,IAAM,YAAY,CAAC,MACxB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,mEAAkE;AAAA,EAC1E,oBAAC,UAAK,GAAE,aAAY;AAAA,GACtB;AAEK,IAAM,cAAc,CAAC,MAC1B,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,sFAAqF;AAAA,EAC7F,oBAAC,YAAO,IAAG,MAAK,IAAG,QAAO,GAAE,OAAM;AAAA,GACpC;AAEK,IAAM,YAAY,CAAC,MACxB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,iDAAgD;AAAA,EACxD,oBAAC,UAAK,GAAE,wBAAuB;AAAA,GACjC;AAEK,IAAM,aAAa,CAAC,MACzB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,iCAAgC;AAAA,EACxC,oBAAC,UAAK,GAAE,gBAAe;AAAA,GACzB;AAEK,IAAM,YAAY,CAAC,EAAE,WAAW,GAAG,EAAE,MAC1C,oBAAC,SAAO,GAAG,GACR,wBAAc,cAAc,oBAAC,UAAK,GAAE,iBAAgB,IAAK,cAAc,eAAe,oBAAC,UAAK,GAAE,iBAAgB,IAAK,oBAAC,UAAK,GAAE,6BAA4B,GAC1J;","names":[]}
@@ -0,0 +1,92 @@
1
+ import {
2
+ SectionBackdrop
3
+ } from "./chunk-XVLWVTQA.js";
4
+ import {
5
+ cn
6
+ } from "./chunk-FJDSLNXK.js";
7
+
8
+ // src/page/page.tsx
9
+ import * as React from "react";
10
+ import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
11
+ function Page({ size = "default", as: Tag = "div", className, ...props }) {
12
+ return /* @__PURE__ */ jsx(Tag, { "data-size": size === "default" ? void 0 : size, className: cn("kz-frame", className), ...props });
13
+ }
14
+ function SectionHeading({ id, eyebrow, title, lead, actions, level = 2, size = "md", align = "start", reveal, className, ...props }) {
15
+ const H = level === 2 ? "h2" : "h3";
16
+ return /* @__PURE__ */ jsxs(
17
+ "div",
18
+ {
19
+ className: cn("kz-heading", className),
20
+ "data-size": size === "md" ? void 0 : size,
21
+ "data-align": align === "start" ? void 0 : align,
22
+ "data-actions": actions ? "" : void 0,
23
+ "data-reveal": reveal ? "" : void 0,
24
+ ...props,
25
+ children: [
26
+ eyebrow && /* @__PURE__ */ jsx("p", { className: "kz-eyebrow", children: eyebrow }),
27
+ /* @__PURE__ */ jsx(H, { id, className: "kz-heading-title", children: title }),
28
+ lead && /* @__PURE__ */ jsx("p", { className: "kz-heading-lead", children: lead }),
29
+ actions && /* @__PURE__ */ jsx("div", { className: "kz-heading-actions", children: actions })
30
+ ]
31
+ }
32
+ );
33
+ }
34
+ function Section({
35
+ id,
36
+ eyebrow,
37
+ title,
38
+ lead,
39
+ actions,
40
+ headingSize,
41
+ headingAlign,
42
+ reveal,
43
+ divider,
44
+ spacing = "md",
45
+ size,
46
+ backdrop,
47
+ className,
48
+ children,
49
+ ...props
50
+ }) {
51
+ const body = /* @__PURE__ */ jsxs(Page, { size, children: [
52
+ title && /* @__PURE__ */ jsx(SectionHeading, { id, eyebrow, title, lead, actions, size: headingSize, align: headingAlign, reveal }),
53
+ children
54
+ ] });
55
+ const shared = {
56
+ "aria-labelledby": title && id ? id : void 0,
57
+ "data-divider": divider ? "" : void 0,
58
+ "data-spacing": spacing === "md" ? void 0 : spacing,
59
+ ...props
60
+ };
61
+ if (backdrop) {
62
+ const backdropProps = backdrop === true ? {} : backdrop;
63
+ return /* @__PURE__ */ jsx(SectionBackdrop, { ...backdropProps, ...shared, className: cn("kz-section", className), children: body });
64
+ }
65
+ return /* @__PURE__ */ jsx("section", { ...shared, className: cn("kz-section", className), children: body });
66
+ }
67
+ function Ticks({ children }) {
68
+ const parts = children.split("`");
69
+ return /* @__PURE__ */ jsx(Fragment2, { children: parts.map(
70
+ (part, i) => i % 2 ? /* @__PURE__ */ jsx("code", { className: "kz-ic", children: part }, i) : /* @__PURE__ */ jsx(React.Fragment, { children: part }, i)
71
+ ) });
72
+ }
73
+ function Facts({ items, className, ...props }) {
74
+ return /* @__PURE__ */ jsx("ul", { className: cn("kz-facts", className), ...props, children: items.map((fact) => {
75
+ const body = /* @__PURE__ */ jsxs(Fragment2, { children: [
76
+ /* @__PURE__ */ jsx("span", { className: "kz-fact-dot", "aria-hidden": true }),
77
+ " ",
78
+ fact.label
79
+ ] });
80
+ const tone = fact.tone && fact.tone !== "neutral" ? fact.tone : void 0;
81
+ return /* @__PURE__ */ jsx("li", { children: fact.href ? /* @__PURE__ */ jsx("a", { href: fact.href, target: "_blank", rel: "noopener noreferrer", className: "kz-fact", "data-tone": tone, children: body }) : /* @__PURE__ */ jsx("span", { className: "kz-fact", "data-tone": tone, children: body }) }, fact.label);
82
+ }) });
83
+ }
84
+
85
+ export {
86
+ Page,
87
+ SectionHeading,
88
+ Section,
89
+ Ticks,
90
+ Facts
91
+ };
92
+ //# sourceMappingURL=chunk-K3SWZXYT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/page/page.tsx"],"sourcesContent":["// Server-safe. The frame of every page (blocks.css): one width, one pair of gutters, one vertical rhythm — so the\n// navigation, the hero and every section line up on the same edges, at any width.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { SectionBackdrop, type SectionBackdropProps } from \"../section-backdrop/section-backdrop\";\n\nexport type PageSize = \"narrow\" | \"default\" | \"wide\" | \"full\";\n\nexport type PageProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The width of the content: `default` (72rem, `--kz-page-max`), `narrow` (48rem, a reading column), `wide`\n * (88rem, documentation with a sidebar), `full` (the gutters only).\n * @default \"default\"\n */\n size?: PageSize;\n /** The element: `div` (default), `main`, `header`, `footer`, `section` or `article`. */\n as?: \"div\" | \"main\" | \"header\" | \"footer\" | \"section\" | \"article\";\n};\n\n/** The page frame: centred, at most `--kz-page-max` wide, with the gutters of `--kz-page-gutter` (16 → 32 px). */\nexport function Page({ size = \"default\", as: Tag = \"div\", className, ...props }: PageProps) {\n return <Tag data-size={size === \"default\" ? undefined : size} className={cn(\"kz-frame\", className)} {...props} />;\n}\n\nexport type SectionHeadingProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> & {\n /** The id of the title: the section's anchor and its accessible name. */\n id?: string;\n /** A short mono line above the title (the section's subject). */\n eyebrow?: React.ReactNode;\n /** The title. */\n title: React.ReactNode;\n /** One or two sentences under the title. */\n lead?: React.ReactNode;\n /** Actions on the right of the heading (a link to everything, a filter). */\n actions?: React.ReactNode;\n /**\n * The level of the title.\n * @default 2\n */\n level?: 2 | 3;\n /**\n * `md` for a section that argues, `sm` for a section of a reading page.\n * @default \"md\"\n */\n size?: \"sm\" | \"md\";\n /**\n * `center` for a heading that stands alone above a grid.\n * @default \"start\"\n */\n align?: \"start\" | \"center\";\n /** Rises into place once, as it enters the viewport (`[data-reveal]`, MotionObserver). Never on the first screen. */\n reveal?: boolean;\n};\n\n/** The head of a section: eyebrow (mono, the accent), title, lead — and its actions on the right. */\nexport function SectionHeading({ id, eyebrow, title, lead, actions, level = 2, size = \"md\", align = \"start\", reveal, className, ...props }: SectionHeadingProps) {\n const H = level === 2 ? \"h2\" : \"h3\";\n return (\n <div\n className={cn(\"kz-heading\", className)}\n data-size={size === \"md\" ? undefined : size}\n data-align={align === \"start\" ? undefined : align}\n data-actions={actions ? \"\" : undefined}\n data-reveal={reveal ? \"\" : undefined}\n {...props}\n >\n {eyebrow && <p className=\"kz-eyebrow\">{eyebrow}</p>}\n <H id={id} className=\"kz-heading-title\">\n {title}\n </H>\n {lead && <p className=\"kz-heading-lead\">{lead}</p>}\n {actions && <div className=\"kz-heading-actions\">{actions}</div>}\n </div>\n );\n}\n\nexport type SectionProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The id of the title (and the anchor of the section). Required with a `title`. */\n id?: string;\n /** The heading's eyebrow. */\n eyebrow?: React.ReactNode;\n /** The section's title: an `h2` (a `SectionHeading`), which names the section for assistive technology. */\n title?: React.ReactNode;\n /** The heading's lead. */\n lead?: React.ReactNode;\n /** The heading's actions. */\n actions?: React.ReactNode;\n /**\n * The heading's size: `md` for a page that argues, `sm` for a reading page.\n * @default \"md\"\n */\n headingSize?: \"sm\" | \"md\";\n /**\n * The heading's alignment.\n * @default \"start\"\n */\n headingAlign?: \"start\" | \"center\";\n /** The heading rises into place once (never on the first screen). */\n reveal?: boolean;\n /** A hairline above the section, inside the gutters: the transition between two sections of the same surface. */\n divider?: boolean;\n /**\n * The vertical space above and below: `sm` (a reading page), `md`, `lg` (a page's main moments).\n * @default \"md\"\n */\n spacing?: \"sm\" | \"md\" | \"lg\";\n /**\n * The width of the content.\n * @default \"default\"\n */\n size?: PageSize;\n /** The brand's colour transition behind the section (SectionBackdrop): `true`, or its props (`direction`, `grid`…). */\n backdrop?: boolean | Omit<SectionBackdropProps, \"as\" | \"children\">;\n};\n\n/**\n * A section of a page: full-bleed (its backdrop reaches the edges), its content in the page frame, its heading on top.\n * Sections follow each other on one rhythm; a `divider` or a `backdrop` marks the transition.\n */\nexport function Section({\n id,\n eyebrow,\n title,\n lead,\n actions,\n headingSize,\n headingAlign,\n reveal,\n divider,\n spacing = \"md\",\n size,\n backdrop,\n className,\n children,\n ...props\n}: SectionProps) {\n const body = (\n <Page size={size}>\n {title && <SectionHeading id={id} eyebrow={eyebrow} title={title} lead={lead} actions={actions} size={headingSize} align={headingAlign} reveal={reveal} />}\n {children}\n </Page>\n );\n const shared = {\n \"aria-labelledby\": title && id ? id : undefined,\n \"data-divider\": divider ? \"\" : undefined,\n \"data-spacing\": spacing === \"md\" ? undefined : spacing,\n ...props,\n };\n if (backdrop) {\n const backdropProps = backdrop === true ? {} : backdrop;\n return (\n <SectionBackdrop {...backdropProps} {...shared} className={cn(\"kz-section\", className)}>\n {body}\n </SectionBackdrop>\n );\n }\n return (\n <section {...shared} className={cn(\"kz-section\", className)}>\n {body}\n </section>\n );\n}\n\nexport type TicksProps = {\n /** A sentence where words between backticks are code: \"Every request carries a `requestId`.\" */\n children: string;\n};\n\n/** A sentence of a message catalogue where words between backticks read as code — no markup in the translations. */\nexport function Ticks({ children }: TicksProps) {\n const parts = children.split(\"`\");\n return (\n <>\n {parts.map((part, i) =>\n i % 2 ? (\n <code key={i} className=\"kz-ic\">\n {part}\n </code>\n ) : (\n <React.Fragment key={i}>{part}</React.Fragment>\n ),\n )}\n </>\n );\n}\n\nexport interface Fact {\n /** A few words: `npm 2.5.0`, `Maven Central`, `in progress`. */\n label: string;\n /**\n * `ok` — published, usable today; `wip` — in progress, said honestly; `neutral` — a fact.\n * @default \"neutral\"\n */\n tone?: \"ok\" | \"wip\" | \"neutral\";\n /** Where the fact is proven (a registry page): the fact becomes a link. */\n href?: string;\n}\n\nexport type FactsProps = React.HTMLAttributes<HTMLUListElement> & {\n /** The facts, in reading order. */\n items: readonly Fact[];\n};\n\n/** Compact facts on one line — a dot that says the state, a few mono words. Links open in a new tab. */\nexport function Facts({ items, className, ...props }: FactsProps) {\n return (\n <ul className={cn(\"kz-facts\", className)} {...props}>\n {items.map((fact) => {\n const body = (\n <>\n <span className=\"kz-fact-dot\" aria-hidden /> {fact.label}\n </>\n );\n const tone = fact.tone && fact.tone !== \"neutral\" ? fact.tone : undefined;\n return (\n <li key={fact.label}>\n {fact.href ? (\n <a href={fact.href} target=\"_blank\" rel=\"noopener noreferrer\" className=\"kz-fact\" data-tone={tone}>\n {body}\n </a>\n ) : (\n <span className=\"kz-fact\" data-tone={tone}>\n {body}\n </span>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;AAEA,YAAY,WAAW;AAoBd,SAuJL,YAAAA,WAvJK,KAqCL,YArCK;AADF,SAAS,KAAK,EAAE,OAAO,WAAW,IAAI,MAAM,OAAO,WAAW,GAAG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.js";
18
18
 
19
19
  // src/combobox/combobox.tsx
20
20
  import * as React from "react";
@@ -280,4 +280,4 @@ export {
280
280
  comboboxLabels,
281
281
  Combobox
282
282
  };
283
- //# sourceMappingURL=chunk-XUMJA5ZI.js.map
283
+ //# sourceMappingURL=chunk-X6TW3X6Y.js.map
@@ -0,0 +1,41 @@
1
+ // src/glyphs.tsx
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ function Glyph({ className = "h-4 w-4", fill, children }) {
4
+ return /* @__PURE__ */ jsx(
5
+ "svg",
6
+ {
7
+ viewBox: "0 0 24 24",
8
+ className,
9
+ fill: fill ? "currentColor" : "none",
10
+ stroke: fill ? "none" : "currentColor",
11
+ strokeWidth: "2",
12
+ strokeLinecap: "round",
13
+ strokeLinejoin: "round",
14
+ "aria-hidden": true,
15
+ focusable: "false",
16
+ children
17
+ }
18
+ );
19
+ }
20
+ var CloseGlyph = (p) => /* @__PURE__ */ jsx(Glyph, { ...p, children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" }) });
21
+ var ChevronGlyph = ({ direction = "down", ...p }) => /* @__PURE__ */ jsx(Glyph, { ...p, children: /* @__PURE__ */ jsx("path", { d: { left: "m15 6-6 6 6 6", right: "m9 6 6 6-6 6", up: "m6 15 6-6 6 6", down: "m6 9 6 6 6-6" }[direction] }) });
22
+ var CheckGlyph = (p) => /* @__PURE__ */ jsx(Glyph, { ...p, children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) });
23
+ var ArrowGlyph = ({ direction = "right", ...p }) => /* @__PURE__ */ jsx(Glyph, { ...p, children: /* @__PURE__ */ jsx("path", { d: direction === "left" ? "M19 12H5m0 0 6-6m-6 6 6 6" : "M5 12h14m0 0-6-6m6 6-6 6" }) });
24
+ var ExternalGlyph = (p) => /* @__PURE__ */ jsxs(Glyph, { ...p, children: [
25
+ /* @__PURE__ */ jsx("path", { d: "M14 4h6v6M20 4l-9 9" }),
26
+ /* @__PURE__ */ jsx("path", { d: "M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4" })
27
+ ] });
28
+ var WarningGlyph = (p) => /* @__PURE__ */ jsxs(Glyph, { ...p, children: [
29
+ /* @__PURE__ */ jsx("path", { d: "M12 4 2.5 20h19L12 4Z" }),
30
+ /* @__PURE__ */ jsx("path", { d: "M12 10v4M12 17.2v.1" })
31
+ ] });
32
+
33
+ export {
34
+ CloseGlyph,
35
+ ChevronGlyph,
36
+ CheckGlyph,
37
+ ArrowGlyph,
38
+ ExternalGlyph,
39
+ WarningGlyph
40
+ };
41
+ //# sourceMappingURL=chunk-XCBVFMNV.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/glyphs.tsx"],"sourcesContent":["// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 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CAA4C;AAAA,GACtD;AAEK,IAAM,YAAY,CAAC,MACxB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,mEAAkE;AAAA,EAC1E,oBAAC,UAAK,GAAE,aAAY;AAAA,GACtB;AAEK,IAAM,cAAc,CAAC,MAC1B,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,sFAAqF;AAAA,EAC7F,oBAAC,YAAO,IAAG,MAAK,IAAG,QAAO,GAAE,OAAM;AAAA,GACpC;AAEK,IAAM,YAAY,CAAC,MACxB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,iDAAgD;AAAA,EACxD,oBAAC,UAAK,GAAE,wBAAuB;AAAA,GACjC;AAEK,IAAM,aAAa,CAAC,MACzB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,iCAAgC;AAAA,EACxC,oBAAC,UAAK,GAAE,gBAAe;AAAA,GACzB;AAEK,IAAM,YAAY,CAAC,EAAE,WAAW,GAAG,EAAE,MAC1C,oBAAC,SAAO,GAAG,GACR,wBAAc,cAAc,oBAAC,UAAK,GAAE,iBAAgB,IAAK,cAAc,eAAe,oBAAC,UAAK,GAAE,iBAAgB,IAAK,oBAAC,UAAK,GAAE,6BAA4B,GAC1J;","names":[]}
1
+ {"version":3,"sources":["../src/glyphs.tsx"],"sourcesContent":["// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\n"],"mappings":";AASI,cAsBF,YAtBE;AAFJ,SAAS,MAAM,EAAE,YAAY,WAAW,MAAM,SAAS,GAA+D;AACpH,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR;AAAA,MACA,MAAM,OAAO,iBAAiB;AAAA,MAC9B,QAAQ,OAAO,SAAS;AAAA,MACxB,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAW;AAAA,MACX,WAAU;AAAA,MAET;AAAA;AAAA,EACH;AAEJ;AA0CO,IAAM,aAAa,CAAC,MACzB,oBAAC,SAAO,GAAG,GACT,8BAAC,UAAK,GAAE,wBAAuB,GACjC;AAEK,IAAM,eAAe,CAAC,EAAE,YAAY,QAAQ,GAAG,EAAE,MACtD,oBAAC,SAAO,GAAG,GACT,8BAAC,UAAK,GAAG,EAAE,MAAM,iBAAiB,OAAO,gBAAgB,IAAI,iBAAiB,MAAM,eAAe,EAAE,SAAS,GAAG,GACnH;AAEK,IAAM,aAAa,CAAC,MACzB,oBAAC,SAAO,GAAG,GACT,8BAAC,UAAK,GAAE,mBAAkB,GAC5B;AAgDK,IAAM,aAAa,CAAC,EAAE,YAAY,SAAS,GAAG,EAAE,MACrD,oBAAC,SAAO,GAAG,GACT,8BAAC,UAAK,GAAG,cAAc,SAAS,8BAA8B,4BAA4B,GAC5F;AAEK,IAAM,gBAAgB,CAAC,MAC5B,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,uBAAsB;AAAA,EAC9B,oBAAC,UAAK,GAAE,4DAA2D;AAAA,GACrE;AAEK,IAAM,eAAe,CAAC,MAC3B,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,yBAAwB;AAAA,EAChC,oBAAC,UAAK,GAAE,uBAAsB;AAAA,GAChC;","names":[]}
@@ -0,0 +1,28 @@
1
+ // src/section-backdrop/section-backdrop.tsx
2
+ import { tv } from "tailwind-variants";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var sectionBackdropVariants = tv({
5
+ slots: {
6
+ root: "kz-backdrop",
7
+ drift: "kz-backdrop-drift",
8
+ dome: "kz-backdrop-dome",
9
+ grid: "kz-backdrop-grid",
10
+ media: "kz-backdrop-media"
11
+ }
12
+ });
13
+ function SectionBackdrop({ as: Tag = "section", direction = "down", dome = true, grid = false, media, animated = true, className, children, ...props }) {
14
+ const s = sectionBackdropVariants();
15
+ return /* @__PURE__ */ jsxs(Tag, { className: s.root({ className }), "data-direction": direction, ...props, children: [
16
+ animated ? /* @__PURE__ */ jsx("div", { "data-backdrop-layer": true, "aria-hidden": true, className: s.drift() }) : null,
17
+ dome ? /* @__PURE__ */ jsx("div", { "data-backdrop-layer": true, "aria-hidden": true, className: s.dome() }) : null,
18
+ grid ? /* @__PURE__ */ jsx("div", { "data-backdrop-layer": true, "aria-hidden": true, className: s.grid() }) : null,
19
+ media ? /* @__PURE__ */ jsx("div", { "data-backdrop-layer": true, "aria-hidden": true, className: s.media(), children: media }) : null,
20
+ children
21
+ ] });
22
+ }
23
+
24
+ export {
25
+ sectionBackdropVariants,
26
+ SectionBackdrop
27
+ };
28
+ //# sourceMappingURL=chunk-XVLWVTQA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/section-backdrop/section-backdrop.tsx"],"sourcesContent":["// Server-safe. The backdrop of a page section in the brand's visual language (packages/tokens/BRAND.md).\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const sectionBackdropVariants = tv({\n slots: {\n root: \"kz-backdrop\",\n drift: \"kz-backdrop-drift\",\n dome: \"kz-backdrop-dome\",\n grid: \"kz-backdrop-grid\",\n media: \"kz-backdrop-media\",\n },\n});\n\nexport interface SectionBackdropProps extends React.HTMLAttributes<HTMLElement> {\n /** The element: `section` (default), `header`, `footer` or `div`. */\n as?: \"section\" | \"header\" | \"footer\" | \"div\";\n /** Where the brand tint sits: `down` (default) starts tinted and ends on the page surface; `up` ends tinted (a closing call to action). */\n direction?: \"down\" | \"up\";\n /** The light dome above the content (the halo of a hero). Default true. */\n dome?: boolean;\n /** A floor of perspective lines under the content. Default false. */\n grid?: boolean;\n /** A foreground illustration or image, blurred for depth of field, behind the content (decorative: hidden from assistive technology). */\n media?: React.ReactNode;\n /** The very slow drift of the light (40 s); always still under prefers-reduced-motion. Default true. */\n animated?: boolean;\n}\n\n/**\n * A section of a page in the Krizaka visual language: the brand's section gradient (`--kz-brand-gradient-*`, so it\n * follows the brand theme and dark/light), a light dome, an optional perspective grid and a blurred foreground. Every\n * section ends on the page surface, so consecutive sections glide from one tint to the next. Text on it reads at AA\n * (tested in @krizaka/tokens).\n */\nexport function SectionBackdrop({ as: Tag = \"section\", direction = \"down\", dome = true, grid = false, media, animated = true, className, children, ...props }: SectionBackdropProps) {\n const s = sectionBackdropVariants();\n return (\n <Tag className={s.root({ className })} data-direction={direction} {...props}>\n {animated ? <div data-backdrop-layer aria-hidden className={s.drift()} /> : null}\n {dome ? <div data-backdrop-layer aria-hidden className={s.dome()} /> : null}\n {grid ? <div data-backdrop-layer aria-hidden className={s.grid()} /> : null}\n {media ? (\n <div data-backdrop-layer aria-hidden className={s.media()}>\n {media}\n </div>\n ) : null}\n {children}\n </Tag>\n );\n}\n"],"mappings":";AAEA,SAAS,UAAU;AAoCf,SACc,KADd;AAlCG,IAAM,0BAA0B,GAAG;AAAA,EACxC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;AAuBM,SAAS,gBAAgB,EAAE,IAAI,MAAM,WAAW,YAAY,QAAQ,OAAO,MAAM,OAAO,OAAO,OAAO,WAAW,MAAM,WAAW,UAAU,GAAG,MAAM,GAAyB;AACnL,QAAM,IAAI,wBAAwB;AAClC,SACE,qBAAC,OAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,kBAAgB,WAAY,GAAG,OACnE;AAAA,eAAW,oBAAC,SAAI,uBAAmB,MAAC,eAAW,MAAC,WAAW,EAAE,MAAM,GAAG,IAAK;AAAA,IAC3E,OAAO,oBAAC,SAAI,uBAAmB,MAAC,eAAW,MAAC,WAAW,EAAE,KAAK,GAAG,IAAK;AAAA,IACtE,OAAO,oBAAC,SAAI,uBAAmB,MAAC,eAAW,MAAC,WAAW,EAAE,KAAK,GAAG,IAAK;AAAA,IACtE,QACC,oBAAC,SAAI,uBAAmB,MAAC,eAAW,MAAC,WAAW,EAAE,MAAM,GACrD,iBACH,IACE;AAAA,IACH;AAAA,KACH;AAEJ;","names":[]}
@@ -0,0 +1,102 @@
1
+ import {
2
+ LoaderGlyph
3
+ } from "./chunk-43PTCDTL.js";
4
+
5
+ // src/button/button.tsx
6
+ import { Slot } from "radix-ui";
7
+ import { tv } from "tailwind-variants";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ var buttonVariants = tv({
10
+ base: "inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98] [&[data-loading]]:opacity-100",
11
+ variants: {
12
+ variant: {
13
+ primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover",
14
+ // The brand's signature: accent → accent-2 (on-accent reads on both stops, tested in @krizaka/tokens).
15
+ gradient: "bg-linear-to-r from-accent to-accent-2 text-on-accent shadow-sm hover:brightness-110",
16
+ secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3",
17
+ outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent",
18
+ ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg",
19
+ // The border and the tint carry the danger; the label stays the primary text role, legible on the tint at rest
20
+ // and hovered over every surface (`text-fg-danger` is for text set directly on a surface).
21
+ danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20"
22
+ },
23
+ size: { sm: "h-8 px-3 text-xs", md: "h-10 px-4 text-sm", lg: "h-12 px-6 text-sm", icon: "h-10 w-10" },
24
+ // `cut`: the Krizaka chamfer — 45° corners (CSS corner-shape, where supported; rounded elsewhere). The border, the
25
+ // focus ring and the hover follow the cut, unlike a clip-path.
26
+ shape: { rounded: "rounded-lg", pill: "rounded-full", cut: "rounded-[10px] [corner-shape:bevel]" }
27
+ },
28
+ defaultVariants: { variant: "secondary", size: "md", shape: "rounded" }
29
+ });
30
+ var STATUS_TEXT = { success: "text-fg-success", error: "text-fg-danger" };
31
+ function Button({
32
+ asChild,
33
+ loading,
34
+ progress,
35
+ status,
36
+ announce,
37
+ indicator = true,
38
+ shimmer,
39
+ magnetic,
40
+ variant,
41
+ size,
42
+ shape,
43
+ className,
44
+ disabled,
45
+ children,
46
+ ...props
47
+ }) {
48
+ const Comp = asChild ? Slot.Root : "button";
49
+ const known = loading && typeof progress === "number" && Number.isFinite(progress);
50
+ const ratio = known ? Math.min(1, Math.max(0, progress)) : 0;
51
+ const glyph = indicator && !asChild && (loading || status) ? status ?? "loading" : null;
52
+ const filled = variant === "primary" || variant === "gradient";
53
+ const button = /* @__PURE__ */ jsx(
54
+ Comp,
55
+ {
56
+ type: asChild ? void 0 : "button",
57
+ "aria-busy": loading || void 0,
58
+ "data-loading": loading ? "" : void 0,
59
+ "data-variant": variant ?? "secondary",
60
+ "data-kz-status": status ?? void 0,
61
+ "data-kz-magnetic": magnetic ? "" : void 0,
62
+ disabled: asChild ? void 0 : disabled || loading,
63
+ "aria-disabled": asChild && (disabled || loading) ? true : void 0,
64
+ className: buttonVariants({
65
+ variant,
66
+ size,
67
+ shape,
68
+ className: [known && "relative isolate overflow-hidden", shimmer && "kz-sheen", className].filter(Boolean).join(" ") || void 0
69
+ }),
70
+ ...props,
71
+ children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
72
+ known && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 -z-10 bg-current opacity-15 transition-[width] duration-500", style: { width: `${ratio * 100}%` } }),
73
+ glyph && /* @__PURE__ */ jsx(
74
+ "span",
75
+ {
76
+ "aria-hidden": true,
77
+ "data-slot": "indicator",
78
+ className: "-my-1 grid grid-cols-[1fr] transition-[grid-template-columns,margin,opacity] duration-300 starting:-mr-2 starting:grid-cols-[0fr] starting:opacity-0",
79
+ children: /* @__PURE__ */ jsx("span", { className: "overflow-hidden", children: /* @__PURE__ */ jsx(LoaderGlyph, { state: glyph, value: known ? ratio : null, className: ["h-4 w-4", glyph !== "loading" && !filled && STATUS_TEXT[glyph]].filter(Boolean).join(" ") }) })
80
+ }
81
+ ),
82
+ children
83
+ ] })
84
+ }
85
+ );
86
+ if (announce === void 0 || asChild) return button;
87
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
88
+ button,
89
+ /* @__PURE__ */ jsx("span", { role: "status", className: "sr-only", children: announce })
90
+ ] });
91
+ }
92
+ function IconButton({ label, size = "icon", children, ...props }) {
93
+ const swap = props.indicator !== false && !props.asChild && (props.loading || props.status);
94
+ return /* @__PURE__ */ jsx(Button, { "aria-label": label, title: label, size, ...props, children: swap ? null : children });
95
+ }
96
+
97
+ export {
98
+ buttonVariants,
99
+ Button,
100
+ IconButton
101
+ };
102
+ //# sourceMappingURL=chunk-Z6FUPB3Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/button/button.tsx"],"sourcesContent":["// Server-safe: no hook, no context. `buttonVariants` styles a <Link> or a Server Component without the component.\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { LoaderGlyph } from \"../spinner/glyph\";\n\nexport const buttonVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98] \" +\n // Busy is not unavailable: a loading button keeps its colour (it is disabled only so it is not pressed twice).\n \"[&[data-loading]]:opacity-100\",\n variants: {\n variant: {\n primary: \"bg-accent text-on-accent shadow-sm hover:bg-accent-hover\",\n // The brand's signature: accent → accent-2 (on-accent reads on both stops, tested in @krizaka/tokens).\n gradient: \"bg-linear-to-r from-accent to-accent-2 text-on-accent shadow-sm hover:brightness-110\",\n secondary: \"border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3\",\n outline: \"border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent\",\n ghost: \"text-fg-secondary hover:bg-surface-2 hover:text-fg\",\n // The border and the tint carry the danger; the label stays the primary text role, legible on the tint at rest\n // and hovered over every surface (`text-fg-danger` is for text set directly on a surface).\n danger: \"border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20\",\n },\n size: { sm: \"h-8 px-3 text-xs\", md: \"h-10 px-4 text-sm\", lg: \"h-12 px-6 text-sm\", icon: \"h-10 w-10\" },\n // `cut`: the Krizaka chamfer — 45° corners (CSS corner-shape, where supported; rounded elsewhere). The border, the\n // focus ring and the hover follow the cut, unlike a clip-path.\n shape: { rounded: \"rounded-lg\", pill: \"rounded-full\", cut: \"rounded-[10px] [corner-shape:bevel]\" },\n },\n defaultVariants: { variant: \"secondary\", size: \"md\", shape: \"rounded\" },\n});\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonProps = React.ComponentProps<\"button\"> &\n ButtonVariants & {\n /**\n * The look: `primary` (the accent), `gradient` (accent → accent-2), `secondary` (a raised surface), `outline`,\n * `ghost`, `danger`.\n * @default \"secondary\"\n */\n variant?: ButtonVariants[\"variant\"];\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"md\"\n */\n size?: ButtonVariants[\"size\"];\n /**\n * rounded · pill · cut (45° corners, the Krizaka chamfer).\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** Renders the child (e.g. a <Link>) instead of the <button>, with props, classes and ref merged. */\n asChild?: boolean;\n /**\n * Disables and signals the wait (aria-busy, data-loading) and shows the Krizaka loader glyph before the label; the\n * button keeps its colour.\n */\n loading?: boolean;\n /**\n * Between 0 and 1, while `loading`: the glyph's trace and a light fill across the button grow to the value (an\n * upload, an export).\n */\n progress?: number | null;\n /**\n * How the action ended: `success` draws a check, `error` a cross (and the button shakes its head once); a ring of\n * the status colour opens around it. Clear it to return to rest.\n */\n status?: \"success\" | \"error\" | null;\n /** A message announced politely by assistive technology when it changes (“Saved”, “Upload failed”) — passed translated. */\n announce?: string;\n /**\n * Shows the glyph while `loading` / with a `status`. `false`: you draw your own.\n * @default true\n */\n indicator?: boolean;\n /** A sheen of light crosses the button on hover — for the one action a page is about. */\n shimmer?: boolean;\n /** The button leans a few pixels toward a fine pointer (driven by `MotionObserver`; never under reduced motion or on touch). */\n magnetic?: boolean;\n };\n\nconst STATUS_TEXT = { success: \"text-fg-success\", error: \"text-fg-danger\" } as const;\n\nexport function Button({\n asChild,\n loading,\n progress,\n status,\n announce,\n indicator = true,\n shimmer,\n magnetic,\n variant,\n size,\n shape,\n className,\n disabled,\n children,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n const known = loading && typeof progress === \"number\" && Number.isFinite(progress);\n const ratio = known ? Math.min(1, Math.max(0, progress)) : 0;\n const glyph = indicator && !asChild && (loading || status) ? (status ?? \"loading\") : null;\n // On a filled variant the glyph stays in the label's colour; on the others it takes the status colour.\n const filled = variant === \"primary\" || variant === \"gradient\";\n const button = (\n <Comp\n type={asChild ? undefined : \"button\"}\n aria-busy={loading || undefined}\n data-loading={loading ? \"\" : undefined}\n data-variant={variant ?? \"secondary\"}\n data-kz-status={status ?? undefined}\n data-kz-magnetic={magnetic ? \"\" : undefined}\n disabled={asChild ? undefined : disabled || loading}\n aria-disabled={asChild && (disabled || loading) ? true : undefined}\n className={buttonVariants({\n variant,\n size,\n shape,\n className: [known && \"relative isolate overflow-hidden\", shimmer && \"kz-sheen\", className].filter(Boolean).join(\" \") || undefined,\n })}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {known && (\n <span aria-hidden className=\"absolute inset-y-0 left-0 -z-10 bg-current opacity-15 transition-[width] duration-500\" style={{ width: `${ratio * 100}%` }} />\n )}\n {glyph && (\n <span\n aria-hidden\n data-slot=\"indicator\"\n className=\"-my-1 grid grid-cols-[1fr] transition-[grid-template-columns,margin,opacity] duration-300 starting:-mr-2 starting:grid-cols-[0fr] starting:opacity-0\"\n >\n <span className=\"overflow-hidden\">\n <LoaderGlyph state={glyph} value={known ? ratio : null} className={[\"h-4 w-4\", glyph !== \"loading\" && !filled && STATUS_TEXT[glyph]].filter(Boolean).join(\" \")} />\n </span>\n </span>\n )}\n {children}\n </>\n )}\n </Comp>\n );\n if (announce === undefined || asChild) return button;\n return (\n <>\n {button}\n <span role=\"status\" className=\"sr-only\">\n {announce}\n </span>\n </>\n );\n}\n\nexport type IconButtonProps = Omit<ButtonProps, \"size\"> & {\n /** The accessible name (and tooltip) of the button — required, passed translated. */\n label: string;\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"icon\"\n */\n size?: ButtonProps[\"size\"];\n};\n\n/** An icon-only button: `label` is required, it is its accessible name. Loading or with a status, the glyph takes the icon's place. */\nexport function IconButton({ label, size = \"icon\", children, ...props }: IconButtonProps) {\n const swap = props.indicator !== false && !props.asChild && (props.loading || props.status);\n return (\n <Button aria-label={label} title={label} size={size} {...props}>\n {swap ? null : children}\n </Button>\n );\n}\n"],"mappings":";;;;;AACA,SAAS,YAAY;AAErB,SAAS,UAA6B;AA+H9B,mBAEI,KAFJ;AA3HD,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MACE;AAAA,EAKF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA;AAAA,MAET,UAAU;AAAA,MACV,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,IACV;AAAA,IACA,MAAM,EAAE,IAAI,oBAAoB,IAAI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