@krizaka/ui 3.67.1 → 3.68.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 (254) hide show
  1. package/dist/chunk-PZ4FJOD5.js +44 -0
  2. package/dist/chunk-PZ4FJOD5.js.map +1 -0
  3. package/dist/{chunk-6BMKLAZ7.js → chunk-Z47KIPCT.js} +7 -2
  4. package/dist/{chunk-6BMKLAZ7.js.map → chunk-Z47KIPCT.js.map} +1 -1
  5. package/dist/copy-button.d.ts +29 -0
  6. package/dist/copy-button.js +56 -0
  7. package/dist/copy-button.js.map +1 -0
  8. package/dist/date-picker.d.ts +15 -15
  9. package/dist/filter-bar.d.ts +3 -3
  10. package/dist/index.js +3 -3
  11. package/dist/kind-config-editor.js +106 -129
  12. package/dist/kind-config-editor.js.map +1 -1
  13. package/dist/money-input.d.ts +29 -0
  14. package/dist/money-input.js +78 -0
  15. package/dist/money-input.js.map +1 -0
  16. package/dist/nav-bar.d.ts +28 -4
  17. package/dist/nav-bar.js +20 -10
  18. package/dist/nav-bar.js.map +1 -1
  19. package/dist/promo-code-field.d.ts +38 -0
  20. package/dist/promo-code-field.js +94 -0
  21. package/dist/promo-code-field.js.map +1 -0
  22. package/dist/radio-group.js +1 -1
  23. package/dist/retro-tv.d.ts +39 -4
  24. package/dist/retro-tv.js +217 -40
  25. package/dist/retro-tv.js.map +1 -1
  26. package/dist/status-chip.js +1 -1
  27. package/dist/terminal-replay.js +1 -1
  28. package/dist/virtual.d.ts +3 -3
  29. package/package.json +47 -4
  30. package/registry/account-menu.json +1 -1
  31. package/registry/account-settings.json +1 -1
  32. package/registry/achievement.json +1 -1
  33. package/registry/action-bar.json +1 -1
  34. package/registry/activity-feed.json +1 -1
  35. package/registry/agenda.json +1 -1
  36. package/registry/alert.json +1 -1
  37. package/registry/analysis-report.json +1 -1
  38. package/registry/anatomy-plate.json +1 -1
  39. package/registry/app-frame.json +2 -2
  40. package/registry/app-header.json +1 -1
  41. package/registry/app-shell.json +1 -1
  42. package/registry/argument-card.json +1 -1
  43. package/registry/audio-player.json +1 -1
  44. package/registry/auth-layout.json +1 -1
  45. package/registry/avatar.json +1 -1
  46. package/registry/badge.json +1 -1
  47. package/registry/bird-plate.json +1 -1
  48. package/registry/button.json +1 -1
  49. package/registry/captcha.json +1 -1
  50. package/registry/card-grid.json +1 -1
  51. package/registry/card.json +1 -1
  52. package/registry/catalogue-page.json +1 -1
  53. package/registry/changelog-page.json +1 -1
  54. package/registry/chapter.json +1 -1
  55. package/registry/chat.json +1 -1
  56. package/registry/checkbox.json +1 -1
  57. package/registry/chip-link.json +1 -1
  58. package/registry/chip-row.json +1 -1
  59. package/registry/chip.json +1 -1
  60. package/registry/choice-grid.json +1 -1
  61. package/registry/code-block.json +1 -1
  62. package/registry/collection-switcher.json +1 -1
  63. package/registry/combobox.json +1 -1
  64. package/registry/command.json +1 -1
  65. package/registry/comparison-table.json +1 -1
  66. package/registry/component-page.json +1 -1
  67. package/registry/confirm-button.json +1 -1
  68. package/registry/contact-page.json +1 -1
  69. package/registry/continue-prompt.json +1 -1
  70. package/registry/copy-button.json +382 -0
  71. package/registry/countdown.json +1 -1
  72. package/registry/cover-hero.json +1 -1
  73. package/registry/cta-panel.json +1 -1
  74. package/registry/dashboard-layout.json +1 -1
  75. package/registry/data-table.json +1 -1
  76. package/registry/date-picker.json +1 -1
  77. package/registry/decision-list.json +1 -1
  78. package/registry/description-list.json +1 -1
  79. package/registry/desktop-window.json +1 -1
  80. package/registry/detail-layout.json +1 -1
  81. package/registry/dialog.json +1 -1
  82. package/registry/docs-article-page.json +1 -1
  83. package/registry/docs-hub-page.json +1 -1
  84. package/registry/docs-layout.json +1 -1
  85. package/registry/docs-nav.json +1 -1
  86. package/registry/document-viewer.json +1 -1
  87. package/registry/doodle.json +1 -1
  88. package/registry/drop-overlay.json +1 -1
  89. package/registry/dropdown-menu.json +1 -1
  90. package/registry/elephant.json +2 -2
  91. package/registry/embed-facade.json +1 -1
  92. package/registry/empty-state.json +1 -1
  93. package/registry/engine-flow.json +1 -1
  94. package/registry/entity-header.json +1 -1
  95. package/registry/environment-notice.json +1 -1
  96. package/registry/error-page.json +1 -1
  97. package/registry/examples/copy-button/default.d.ts +4 -0
  98. package/registry/examples/copy-button/default.js +11 -0
  99. package/registry/examples/copy-button/default.tsx +7 -0
  100. package/registry/examples/copy-button/icon-only.d.ts +4 -0
  101. package/registry/examples/copy-button/icon-only.js +11 -0
  102. package/registry/examples/copy-button/icon-only.tsx +7 -0
  103. package/registry/examples/money-input/currencies.d.ts +4 -0
  104. package/registry/examples/money-input/currencies.js +18 -0
  105. package/registry/examples/money-input/currencies.tsx +16 -0
  106. package/registry/examples/money-input/default.d.ts +4 -0
  107. package/registry/examples/money-input/default.js +18 -0
  108. package/registry/examples/money-input/default.tsx +16 -0
  109. package/registry/examples/promo-code-field/applied.d.ts +4 -0
  110. package/registry/examples/promo-code-field/applied.js +11 -0
  111. package/registry/examples/promo-code-field/applied.tsx +7 -0
  112. package/registry/examples/promo-code-field/default.d.ts +4 -0
  113. package/registry/examples/promo-code-field/default.js +19 -0
  114. package/registry/examples/promo-code-field/default.tsx +14 -0
  115. package/registry/examples/promo-code-field/expired.d.ts +4 -0
  116. package/registry/examples/promo-code-field/expired.js +11 -0
  117. package/registry/examples/promo-code-field/expired.tsx +7 -0
  118. package/registry/examples/retro-tv/playlist-channel.d.ts +4 -0
  119. package/registry/examples/retro-tv/playlist-channel.js +15 -0
  120. package/registry/examples/retro-tv/playlist-channel.tsx +10 -0
  121. package/registry/examples/retro-tv/playlist-crossfade.d.ts +4 -0
  122. package/registry/examples/retro-tv/playlist-crossfade.js +15 -0
  123. package/registry/examples/retro-tv/playlist-crossfade.tsx +10 -0
  124. package/registry/examples/retro-tv/playlist-slide.d.ts +4 -0
  125. package/registry/examples/retro-tv/playlist-slide.js +15 -0
  126. package/registry/examples/retro-tv/playlist-slide.tsx +10 -0
  127. package/registry/field.json +1 -1
  128. package/registry/file-upload.json +1 -1
  129. package/registry/filter-bar.json +1 -1
  130. package/registry/flock.json +1 -1
  131. package/registry/footnote.json +1 -1
  132. package/registry/force-update-screen.json +1 -1
  133. package/registry/form.json +1 -1
  134. package/registry/gallery-page.json +1 -1
  135. package/registry/genui.json +1 -1
  136. package/registry/glossary-term.json +1 -1
  137. package/registry/glossary.json +1 -1
  138. package/registry/glow-card.json +1 -1
  139. package/registry/goal-gauge.json +1 -1
  140. package/registry/grade-stamp.json +1 -1
  141. package/registry/how-it-works-page.json +1 -1
  142. package/registry/image-cropper.json +1 -1
  143. package/registry/index.json +108 -9
  144. package/registry/iso.json +1 -1
  145. package/registry/kanban.json +1 -1
  146. package/registry/kbd.json +1 -1
  147. package/registry/kind-config-editor.json +1 -1
  148. package/registry/kpi-explained.json +1 -1
  149. package/registry/landing-page.json +1 -1
  150. package/registry/landscape.json +1 -1
  151. package/registry/language-switch.json +1 -1
  152. package/registry/legal-page.json +1 -1
  153. package/registry/link-card.json +1 -1
  154. package/registry/list.json +1 -1
  155. package/registry/loader.json +1 -1
  156. package/registry/longform-page.json +1 -1
  157. package/registry/maintenance-screen.json +1 -1
  158. package/registry/map.json +2 -2
  159. package/registry/margin-layout.json +1 -1
  160. package/registry/markdown.json +1 -1
  161. package/registry/marketing-layout.json +1 -1
  162. package/registry/marquee.json +1 -1
  163. package/registry/mascot-quote.json +1 -1
  164. package/registry/mascot-state.json +1 -1
  165. package/registry/mascots.json +1 -1
  166. package/registry/match-dialog.json +1 -1
  167. package/registry/media-capture.json +1 -1
  168. package/registry/media-gallery.json +1 -1
  169. package/registry/media-grid.json +1 -1
  170. package/registry/meta-row.json +1 -1
  171. package/registry/meter.json +1 -1
  172. package/registry/money-input.json +236 -0
  173. package/registry/nav-bar.json +22 -8
  174. package/registry/next-actions.json +1 -1
  175. package/registry/notification-preferences.json +1 -1
  176. package/registry/number-ticker.json +1 -1
  177. package/registry/opening-hours.json +1 -1
  178. package/registry/page-header.json +1 -1
  179. package/registry/page-hero.json +1 -1
  180. package/registry/page-index.json +1 -1
  181. package/registry/page.json +1 -1
  182. package/registry/pagination.json +1 -1
  183. package/registry/photo-grid.json +1 -1
  184. package/registry/pointer-light.json +1 -1
  185. package/registry/popover.json +1 -1
  186. package/registry/pricing-page.json +1 -1
  187. package/registry/product-page.json +1 -1
  188. package/registry/profile-card.json +1 -1
  189. package/registry/progress.json +1 -1
  190. package/registry/promise-card.json +1 -1
  191. package/registry/promo-code-field.json +258 -0
  192. package/registry/qr-code.json +1 -1
  193. package/registry/quota-meter.json +1 -1
  194. package/registry/radio-group.json +1 -1
  195. package/registry/rail-nav.json +2 -2
  196. package/registry/recipes.json +1 -1
  197. package/registry/retro-tv.json +120 -8
  198. package/registry/reviews.json +1 -1
  199. package/registry/router.json +1 -1
  200. package/registry/scroll-stage.json +1 -1
  201. package/registry/search-field.json +1 -1
  202. package/registry/section-backdrop.json +1 -1
  203. package/registry/separator.json +1 -1
  204. package/registry/service-card.json +1 -1
  205. package/registry/settings-layout.json +1 -1
  206. package/registry/shop-composer.json +1 -1
  207. package/registry/shop.json +2 -2
  208. package/registry/showcase.json +1 -1
  209. package/registry/signature.json +1 -1
  210. package/registry/site-cahier.json +1 -1
  211. package/registry/site-footer.json +2 -2
  212. package/registry/sites.json +1 -1
  213. package/registry/skeleton.json +1 -1
  214. package/registry/skip-link.json +1 -1
  215. package/registry/slider.json +1 -1
  216. package/registry/slot-picker.json +1 -1
  217. package/registry/slot.json +1 -1
  218. package/registry/specimen-tag.json +1 -1
  219. package/registry/speed-lines.json +1 -1
  220. package/registry/spinner.json +1 -1
  221. package/registry/split-view.json +1 -1
  222. package/registry/stage-banner.json +1 -1
  223. package/registry/stat.json +1 -1
  224. package/registry/status-chip.json +1 -1
  225. package/registry/status-page.json +1 -1
  226. package/registry/step-progress.json +1 -1
  227. package/registry/step-showcase.json +1 -1
  228. package/registry/stepper.json +1 -1
  229. package/registry/sticky-action.json +1 -1
  230. package/registry/stuck.json +1 -1
  231. package/registry/swipe-deck.json +1 -1
  232. package/registry/switch.json +1 -1
  233. package/registry/tabs.json +1 -1
  234. package/registry/tag-input.json +1 -1
  235. package/registry/tag-selector.json +1 -1
  236. package/registry/taped-photo.json +1 -1
  237. package/registry/terminal-replay.json +1 -1
  238. package/registry/text-style.json +1 -1
  239. package/registry/theme.json +1 -1
  240. package/registry/toast.json +1 -1
  241. package/registry/toc.json +1 -1
  242. package/registry/tooltip.json +1 -1
  243. package/registry/tree-view.json +1 -1
  244. package/registry/update-prompt.json +1 -1
  245. package/registry/upload-queue.json +1 -1
  246. package/registry/usage.json +1 -1
  247. package/registry/verified-badge.json +1 -1
  248. package/registry/versus-card.json +1 -1
  249. package/registry/vertical-video.json +1 -1
  250. package/registry/video-player.json +1 -1
  251. package/registry/video-trimmer.json +1 -1
  252. package/registry/virtual.json +1 -1
  253. package/registry/wall.json +1 -1
  254. package/registry/waveform.json +1 -1
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import {
3
+ cn
4
+ } from "./chunk-NSLXEDIS.js";
5
+
6
+ // src/field/field.tsx
7
+ import { tv } from "tailwind-variants";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var field = tv({
10
+ slots: {
11
+ root: "flex flex-col gap-1.5",
12
+ label: "text-xs font-semibold text-fg-secondary",
13
+ control: "flex h-11 w-full rounded-lg border border-border-control bg-surface-2 px-3 text-sm text-fg placeholder:text-fg-muted transition-[border-color,box-shadow] focus-visible:border-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/30",
14
+ hint: "text-xs text-fg-secondary",
15
+ // The message reads in the danger text role (≥ 4.5:1 on every surface, both themes); the dot is the danger fill.
16
+ error: "flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger",
17
+ selectWrap: "relative flex w-full",
18
+ chevron: "pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-fg-secondary"
19
+ }
20
+ });
21
+ var s = field();
22
+ var Field = {
23
+ Root: ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: s.root({ className }), ...props }),
24
+ Label: ({ className, ...props }) => /* @__PURE__ */ jsx("label", { className: s.label({ className }), ...props }),
25
+ Hint: ({ className, ...props }) => /* @__PURE__ */ jsx("p", { className: s.hint({ className }), ...props }),
26
+ Error: ({ className, ...props }) => /* @__PURE__ */ jsx("p", { role: "alert", className: s.error({ className }), ...props })
27
+ };
28
+ var invalidProps = (invalid) => invalid ? { "aria-invalid": true, "data-invalid": "" } : {};
29
+ function Input({ invalid, className, ...props }) {
30
+ return /* @__PURE__ */ jsx("input", { ...invalidProps(invalid), className: s.control({ className }), ...props });
31
+ }
32
+ function Select({ invalid, className, ...props }) {
33
+ return /* @__PURE__ */ jsxs("span", { className: s.selectWrap(), children: [
34
+ /* @__PURE__ */ jsx("select", { ...invalidProps(invalid), className: s.control({ className: cn("appearance-none pr-9", className) }), ...props }),
35
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, className: s.chevron(), children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" }) })
36
+ ] });
37
+ }
38
+
39
+ export {
40
+ Field,
41
+ Input,
42
+ Select
43
+ };
44
+ //# sourceMappingURL=chunk-PZ4FJOD5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/field/field.tsx"],"sourcesContent":["// Server-safe. The label ↔ control wiring is HTML (htmlFor / id, aria-describedby): no context.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\n\nexport const field = tv({\n slots: {\n root: \"flex flex-col gap-1.5\",\n label: \"text-xs font-semibold text-fg-secondary\",\n control:\n \"flex h-11 w-full rounded-lg border border-border-control bg-surface-2 px-3 text-sm text-fg placeholder:text-fg-muted \" +\n \"transition-[border-color,box-shadow] focus-visible:border-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/30\",\n hint: \"text-xs text-fg-secondary\",\n // The message reads in the danger text role (≥ 4.5:1 on every surface, both themes); the dot is the danger fill.\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n selectWrap: \"relative flex w-full\",\n chevron: \"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-fg-secondary\",\n },\n});\nconst s = field();\n\nexport const Field = {\n Root: ({ className, ...props }: React.ComponentProps<\"div\">) => <div className={s.root({ className })} {...props} />,\n Label: ({ className, ...props }: React.ComponentProps<\"label\">) => <label className={s.label({ className })} {...props} />,\n Hint: ({ className, ...props }: React.ComponentProps<\"p\">) => <p className={s.hint({ className })} {...props} />,\n Error: ({ className, ...props }: React.ComponentProps<\"p\">) => <p role=\"alert\" className={s.error({ className })} {...props} />,\n};\n\ntype ControlProps = {\n /** Marks the control invalid: aria-invalid and data-invalid (pair it with a `Field.Error` in aria-describedby). */\n invalid?: boolean;\n};\n\nconst invalidProps = (invalid?: boolean) => (invalid ? { \"aria-invalid\": true as const, \"data-invalid\": \"\" } : {});\n\nexport function Input({ invalid, className, ...props }: React.ComponentProps<\"input\"> & ControlProps) {\n return <input {...invalidProps(invalid)} className={s.control({ className })} {...props} />;\n}\n\nexport function Textarea({ invalid, className, ...props }: React.ComponentProps<\"textarea\"> & ControlProps) {\n return <textarea {...invalidProps(invalid)} className={s.control({ className: cn(\"h-auto min-h-24 py-2\", className) })} {...props} />;\n}\n\n/** A native <select>, styled like the other controls (the platform's menu: accessible and right on phones). */\nexport function Select({ invalid, className, ...props }: React.ComponentProps<\"select\"> & ControlProps) {\n return (\n <span className={s.selectWrap()}>\n <select {...invalidProps(invalid)} className={s.control({ className: cn(\"appearance-none pr-9\", className) })} {...props} />\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className={s.chevron()}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </span>\n );\n}\n"],"mappings":";;;;;;AAEA,SAAS,UAAU;AAsB+C,cAwB9D,YAxB8D;AAlB3D,IAAM,QAAQ,GAAG;AAAA,EACtB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SACE;AAAA,IAGF,MAAM;AAAA;AAAA,IAEN,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AACF,CAAC;AACD,IAAM,IAAI,MAAM;AAET,IAAM,QAAQ;AAAA,EACnB,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,MAAmC,oBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAAA,EAClH,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,MAAqC,oBAAC,WAAM,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAAA,EACxH,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,MAAiC,oBAAC,OAAE,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAAA,EAC9G,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,MAAiC,oBAAC,OAAE,MAAK,SAAQ,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC/H;AAOA,IAAM,eAAe,CAAC,YAAuB,UAAU,EAAE,gBAAgB,MAAe,gBAAgB,GAAG,IAAI,CAAC;AAEzG,SAAS,MAAM,EAAE,SAAS,WAAW,GAAG,MAAM,GAAiD;AACpG,SAAO,oBAAC,WAAO,GAAG,aAAa,OAAO,GAAG,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC3F;AAOO,SAAS,OAAO,EAAE,SAAS,WAAW,GAAG,MAAM,GAAkD;AACtG,SACE,qBAAC,UAAK,WAAW,EAAE,WAAW,GAC5B;AAAA,wBAAC,YAAQ,GAAG,aAAa,OAAO,GAAG,WAAW,EAAE,QAAQ,EAAE,WAAW,GAAG,wBAAwB,SAAS,EAAE,CAAC,GAAI,GAAG,OAAO;AAAA,IAC1H,oBAAC,SAAI,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,KAAI,eAAc,SAAQ,gBAAe,SAAQ,eAAW,MAAC,WAAW,EAAE,QAAQ,GACvJ,8BAAC,UAAK,GAAE,gBAAe,GACzB;AAAA,KACF;AAEJ;","names":[]}
@@ -30,12 +30,17 @@ var RetryGlyph = (p) => /* @__PURE__ */ jsxs(Glyph, { ...p, children: [
30
30
  /* @__PURE__ */ jsx("path", { d: "M4 12a8 8 0 1 0 2.3-5.7L4 8.5" }),
31
31
  /* @__PURE__ */ jsx("path", { d: "M4 4v4.5h4.5" })
32
32
  ] });
33
+ var CopyGlyph = (p) => /* @__PURE__ */ jsxs(Glyph, { ...p, children: [
34
+ /* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
35
+ /* @__PURE__ */ jsx("path", { d: "M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3" })
36
+ ] });
33
37
 
34
38
  export {
35
39
  PlayGlyph,
36
40
  PauseGlyph,
37
41
  ChevronGlyph,
38
42
  CheckGlyph,
39
- RetryGlyph
43
+ RetryGlyph,
44
+ CopyGlyph
40
45
  };
41
- //# sourceMappingURL=chunk-6BMKLAZ7.js.map
46
+ //# sourceMappingURL=chunk-Z47KIPCT.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 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);\nexport const PencilGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4zM13.5 6.5l4 4\" />\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;AAEO,IAAM,YAAY,CAAC,MACxB,oBAAC,SAAO,GAAG,GAAG,MAAI,MAChB,8BAAC,UAAK,GAAE,kFAAiF,GAC3F;AAEK,IAAM,aAAa,CAAC,MACzB,qBAAC,SAAO,GAAG,GAAG,MAAI,MAChB;AAAA,sBAAC,UAAK,GAAE,KAAI,GAAE,KAAI,OAAM,KAAI,QAAO,MAAK,IAAG,KAAI;AAAA,EAC/C,oBAAC,UAAK,GAAE,MAAK,GAAE,KAAI,OAAM,KAAI,QAAO,MAAK,IAAG,KAAI;AAAA,GAClD;AAoCK,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;AAqCK,IAAM,aAAa,CAAC,MACzB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,iCAAgC;AAAA,EACxC,oBAAC,UAAK,GAAE,gBAAe;AAAA,GACzB;","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);\nexport const PencilGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4zM13.5 6.5l4 4\" />\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;AAEO,IAAM,YAAY,CAAC,MACxB,oBAAC,SAAO,GAAG,GAAG,MAAI,MAChB,8BAAC,UAAK,GAAE,kFAAiF,GAC3F;AAEK,IAAM,aAAa,CAAC,MACzB,qBAAC,SAAO,GAAG,GAAG,MAAI,MAChB;AAAA,sBAAC,UAAK,GAAE,KAAI,GAAE,KAAI,OAAM,KAAI,QAAO,MAAK,IAAG,KAAI;AAAA,EAC/C,oBAAC,UAAK,GAAE,MAAK,GAAE,KAAI,OAAM,KAAI,QAAO,MAAK,IAAG,KAAI;AAAA,GAClD;AAoCK,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;AAqCK,IAAM,aAAa,CAAC,MACzB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,iCAAgC;AAAA,EACxC,oBAAC,UAAK,GAAE,gBAAe;AAAA,GACzB;AAwBK,IAAM,YAAY,CAAC,MACxB,qBAAC,SAAO,GAAG,GACT;AAAA,sBAAC,UAAK,GAAE,KAAI,GAAE,KAAI,OAAM,MAAK,QAAO,MAAK,IAAG,KAAI;AAAA,EAChD,oBAAC,UAAK,GAAE,2DAA0D;AAAA,GACpE;","names":[]}
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import { B as ButtonProps } from './button-Cm9pFH3P.js';
3
+ import 'tailwind-variants';
4
+
5
+ type CopyButtonProps = Omit<ButtonProps, "onClick" | "asChild" | "value" | "children"> & {
6
+ /** The text to copy. */
7
+ value: string;
8
+ /** The words of the button (and its accessible name), passed translated: "Copy link". Icon only: set `iconOnly`. */
9
+ label: string;
10
+ /** What it says once copied, announced politely: "Copied". */
11
+ copiedLabel: string;
12
+ /** Said when the clipboard is unavailable, above the selected value: "Press Ctrl+C to copy". */
13
+ fallbackLabel: string;
14
+ /** Shows only the icon (the label stays the accessible name). */
15
+ iconOnly?: boolean;
16
+ /** Replaces the copy icon (a `@krizaka/icons` one, say). */
17
+ icon?: React.ReactNode;
18
+ /** Replaces the check icon shown once copied. */
19
+ copiedIcon?: React.ReactNode;
20
+ /** How long "Copied" stays, in milliseconds (1800 by default). */
21
+ resetMs?: number;
22
+ /** Called after the value is copied. */
23
+ onCopy?: () => void;
24
+ };
25
+ /** A button that copies `value`. State: `data-copied`. */
26
+ declare function CopyButton({ value, label, copiedLabel, fallbackLabel, iconOnly, icon, copiedIcon, resetMs, onCopy, variant, className, ...props }: CopyButtonProps): React.JSX.Element;
27
+
28
+ export { CopyButton };
29
+ export type { CopyButtonProps };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import {
3
+ CheckGlyph,
4
+ CopyGlyph
5
+ } from "./chunk-Z47KIPCT.js";
6
+ import {
7
+ Button
8
+ } from "./chunk-V7W4RLRW.js";
9
+ import "./chunk-D3T54RSL.js";
10
+ import "./chunk-WEVYKZIF.js";
11
+ import {
12
+ cn
13
+ } from "./chunk-NSLXEDIS.js";
14
+
15
+ // src/copy-button/copy-button.tsx
16
+ import * as React from "react";
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ function CopyButton({ value, label, copiedLabel, fallbackLabel, iconOnly, icon, copiedIcon, resetMs = 1800, onCopy, variant = "secondary", className, ...props }) {
19
+ const [copied, setCopied] = React.useState(false);
20
+ const [manual, setManual] = React.useState(false);
21
+ const fieldRef = React.useRef(null);
22
+ React.useEffect(() => {
23
+ if (!copied) return;
24
+ const timer = window.setTimeout(() => setCopied(false), resetMs);
25
+ return () => window.clearTimeout(timer);
26
+ }, [copied, resetMs]);
27
+ React.useEffect(() => {
28
+ if (manual) fieldRef.current?.select();
29
+ }, [manual]);
30
+ const copy = async () => {
31
+ try {
32
+ await navigator.clipboard.writeText(value);
33
+ setManual(false);
34
+ setCopied(true);
35
+ onCopy?.();
36
+ } catch {
37
+ setManual(true);
38
+ }
39
+ };
40
+ const name = copied ? copiedLabel : label;
41
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex flex-col gap-1.5", children: [
42
+ /* @__PURE__ */ jsxs(Button, { type: "button", variant, "aria-label": iconOnly ? name : void 0, title: iconOnly ? name : void 0, "data-copied": copied ? "" : void 0, className: cn(className), onClick: () => void copy(), ...props, children: [
43
+ copied ? copiedIcon ?? /* @__PURE__ */ jsx(CheckGlyph, {}) : icon ?? /* @__PURE__ */ jsx(CopyGlyph, {}),
44
+ !iconOnly && /* @__PURE__ */ jsx("span", { children: name })
45
+ ] }),
46
+ /* @__PURE__ */ jsx("span", { role: "status", "aria-live": "polite", className: "sr-only", children: copied ? copiedLabel : "" }),
47
+ manual && /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1 text-xs text-fg-secondary", children: [
48
+ fallbackLabel,
49
+ /* @__PURE__ */ jsx("input", { ref: fieldRef, readOnly: true, value, onFocus: (event) => event.currentTarget.select(), className: "h-9 rounded-lg border border-border-control bg-surface-2 px-2 text-sm text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring" })
50
+ ] })
51
+ ] });
52
+ }
53
+ export {
54
+ CopyButton
55
+ };
56
+ //# sourceMappingURL=copy-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/copy-button/copy-button.tsx"],"sourcesContent":["// Client (a state, the clipboard). Copies a value and says so in a polite live region. Without the Clipboard API\n// (an insecure page, an old webview) it falls back to a selected, read-only field the person copies by hand: the\n// failure is never silent.\nimport * as React from \"react\";\n\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph, CopyGlyph } from \"../glyphs\";\n\nexport type CopyButtonProps = Omit<ButtonProps, \"onClick\" | \"asChild\" | \"value\" | \"children\"> & {\n /** The text to copy. */\n value: string;\n /** The words of the button (and its accessible name), passed translated: \"Copy link\". Icon only: set `iconOnly`. */\n label: string;\n /** What it says once copied, announced politely: \"Copied\". */\n copiedLabel: string;\n /** Said when the clipboard is unavailable, above the selected value: \"Press Ctrl+C to copy\". */\n fallbackLabel: string;\n /** Shows only the icon (the label stays the accessible name). */\n iconOnly?: boolean;\n /** Replaces the copy icon (a `@krizaka/icons` one, say). */\n icon?: React.ReactNode;\n /** Replaces the check icon shown once copied. */\n copiedIcon?: React.ReactNode;\n /** How long \"Copied\" stays, in milliseconds (1800 by default). */\n resetMs?: number;\n /** Called after the value is copied. */\n onCopy?: () => void;\n};\n\n/** A button that copies `value`. State: `data-copied`. */\nexport function CopyButton({ value, label, copiedLabel, fallbackLabel, iconOnly, icon, copiedIcon, resetMs = 1800, onCopy, variant = \"secondary\", className, ...props }: CopyButtonProps) {\n const [copied, setCopied] = React.useState(false);\n const [manual, setManual] = React.useState(false);\n const fieldRef = React.useRef<HTMLInputElement>(null);\n React.useEffect(() => {\n if (!copied) return;\n const timer = window.setTimeout(() => setCopied(false), resetMs);\n return () => window.clearTimeout(timer);\n }, [copied, resetMs]);\n React.useEffect(() => {\n if (manual) fieldRef.current?.select();\n }, [manual]);\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(value);\n setManual(false);\n setCopied(true);\n onCopy?.();\n } catch {\n // No Clipboard API, or refused: show the value selected, to copy by hand.\n setManual(true);\n }\n };\n const name = copied ? copiedLabel : label;\n return (\n <span className=\"inline-flex flex-col gap-1.5\">\n <Button type=\"button\" variant={variant} aria-label={iconOnly ? name : undefined} title={iconOnly ? name : undefined} data-copied={copied ? \"\" : undefined} className={cn(className)} onClick={() => void copy()} {...props}>\n {copied ? (copiedIcon ?? <CheckGlyph />) : (icon ?? <CopyGlyph />)}\n {!iconOnly && <span>{name}</span>}\n </Button>\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {copied ? copiedLabel : \"\"}\n </span>\n {manual && (\n <label className=\"flex flex-col gap-1 text-xs text-fg-secondary\">\n {fallbackLabel}\n <input ref={fieldRef} readOnly value={value} onFocus={(event) => event.currentTarget.select()} className=\"h-9 rounded-lg border border-border-control bg-surface-2 px-2 text-sm text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" />\n </label>\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AAsDjB,SAC2B,KAD3B;AA1BC,SAAS,WAAW,EAAE,OAAO,OAAO,aAAa,eAAe,UAAU,MAAM,YAAY,UAAU,MAAM,QAAQ,UAAU,aAAa,WAAW,GAAG,MAAM,GAAoB;AACxL,QAAM,CAAC,QAAQ,SAAS,IAAU,eAAS,KAAK;AAChD,QAAM,CAAC,QAAQ,SAAS,IAAU,eAAS,KAAK;AAChD,QAAM,WAAiB,aAAyB,IAAI;AACpD,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,OAAQ;AACb,UAAM,QAAQ,OAAO,WAAW,MAAM,UAAU,KAAK,GAAG,OAAO;AAC/D,WAAO,MAAM,OAAO,aAAa,KAAK;AAAA,EACxC,GAAG,CAAC,QAAQ,OAAO,CAAC;AACpB,EAAM,gBAAU,MAAM;AACpB,QAAI,OAAQ,UAAS,SAAS,OAAO;AAAA,EACvC,GAAG,CAAC,MAAM,CAAC;AACX,QAAM,OAAO,YAAY;AACvB,QAAI;AACF,YAAM,UAAU,UAAU,UAAU,KAAK;AACzC,gBAAU,KAAK;AACf,gBAAU,IAAI;AACd,eAAS;AAAA,IACX,QAAQ;AAEN,gBAAU,IAAI;AAAA,IAChB;AAAA,EACF;AACA,QAAM,OAAO,SAAS,cAAc;AACpC,SACE,qBAAC,UAAK,WAAU,gCACd;AAAA,yBAAC,UAAO,MAAK,UAAS,SAAkB,cAAY,WAAW,OAAO,QAAW,OAAO,WAAW,OAAO,QAAW,eAAa,SAAS,KAAK,QAAW,WAAW,GAAG,SAAS,GAAG,SAAS,MAAM,KAAK,KAAK,GAAI,GAAG,OAClN;AAAA,eAAU,cAAc,oBAAC,cAAW,IAAO,QAAQ,oBAAC,aAAU;AAAA,MAC9D,CAAC,YAAY,oBAAC,UAAM,gBAAK;AAAA,OAC5B;AAAA,IACA,oBAAC,UAAK,MAAK,UAAS,aAAU,UAAS,WAAU,WAC9C,mBAAS,cAAc,IAC1B;AAAA,IACC,UACC,qBAAC,WAAM,WAAU,iDACd;AAAA;AAAA,MACD,oBAAC,WAAM,KAAK,UAAU,UAAQ,MAAC,OAAc,SAAS,CAAC,UAAU,MAAM,cAAc,OAAO,GAAG,WAAU,2JAA0J;AAAA,OACrQ;AAAA,KAEJ;AAEJ;","names":[]}
@@ -175,11 +175,11 @@ declare const dateField: tailwind_variants.TVReturnType<{
175
175
  [key: string]: {
176
176
  [key: string]: tailwind_variants.ClassValue | {
177
177
  root?: tailwind_variants.ClassValue;
178
+ legend?: tailwind_variants.ClassValue;
178
179
  row?: tailwind_variants.ClassValue;
180
+ part?: tailwind_variants.ClassValue;
179
181
  hint?: tailwind_variants.ClassValue;
180
182
  error?: tailwind_variants.ClassValue;
181
- legend?: tailwind_variants.ClassValue;
182
- part?: tailwind_variants.ClassValue;
183
183
  input?: tailwind_variants.ClassValue;
184
184
  };
185
185
  };
@@ -187,11 +187,11 @@ declare const dateField: tailwind_variants.TVReturnType<{
187
187
  [x: string]: {
188
188
  [x: string]: tailwind_variants.ClassValue | {
189
189
  root?: tailwind_variants.ClassValue;
190
+ legend?: tailwind_variants.ClassValue;
190
191
  row?: tailwind_variants.ClassValue;
192
+ part?: tailwind_variants.ClassValue;
191
193
  hint?: tailwind_variants.ClassValue;
192
194
  error?: tailwind_variants.ClassValue;
193
- legend?: tailwind_variants.ClassValue;
194
- part?: tailwind_variants.ClassValue;
195
195
  input?: tailwind_variants.ClassValue;
196
196
  };
197
197
  };
@@ -207,11 +207,11 @@ declare const dateField: tailwind_variants.TVReturnType<{
207
207
  [key: string]: {
208
208
  [key: string]: tailwind_variants.ClassValue | {
209
209
  root?: tailwind_variants.ClassValue;
210
+ legend?: tailwind_variants.ClassValue;
210
211
  row?: tailwind_variants.ClassValue;
212
+ part?: tailwind_variants.ClassValue;
211
213
  hint?: tailwind_variants.ClassValue;
212
214
  error?: tailwind_variants.ClassValue;
213
- legend?: tailwind_variants.ClassValue;
214
- part?: tailwind_variants.ClassValue;
215
215
  input?: tailwind_variants.ClassValue;
216
216
  };
217
217
  };
@@ -294,15 +294,15 @@ declare const datePicker: tailwind_variants.TVReturnType<{
294
294
  [key: string]: {
295
295
  [key: string]: tailwind_variants.ClassValue | {
296
296
  root?: tailwind_variants.ClassValue;
297
- label?: tailwind_variants.ClassValue;
298
297
  row?: tailwind_variants.ClassValue;
298
+ hint?: tailwind_variants.ClassValue;
299
+ error?: tailwind_variants.ClassValue;
300
+ label?: tailwind_variants.ClassValue;
299
301
  icon?: tailwind_variants.ClassValue;
300
302
  content?: tailwind_variants.ClassValue;
301
303
  layout?: tailwind_variants.ClassValue;
302
304
  presets?: tailwind_variants.ClassValue;
303
305
  presetNode?: tailwind_variants.ClassValue;
304
- hint?: tailwind_variants.ClassValue;
305
- error?: tailwind_variants.ClassValue;
306
306
  trigger?: tailwind_variants.ClassValue;
307
307
  clear?: tailwind_variants.ClassValue;
308
308
  preset?: tailwind_variants.ClassValue;
@@ -312,15 +312,15 @@ declare const datePicker: tailwind_variants.TVReturnType<{
312
312
  [x: string]: {
313
313
  [x: string]: tailwind_variants.ClassValue | {
314
314
  root?: tailwind_variants.ClassValue;
315
- label?: tailwind_variants.ClassValue;
316
315
  row?: tailwind_variants.ClassValue;
316
+ hint?: tailwind_variants.ClassValue;
317
+ error?: tailwind_variants.ClassValue;
318
+ label?: tailwind_variants.ClassValue;
317
319
  icon?: tailwind_variants.ClassValue;
318
320
  content?: tailwind_variants.ClassValue;
319
321
  layout?: tailwind_variants.ClassValue;
320
322
  presets?: tailwind_variants.ClassValue;
321
323
  presetNode?: tailwind_variants.ClassValue;
322
- hint?: tailwind_variants.ClassValue;
323
- error?: tailwind_variants.ClassValue;
324
324
  trigger?: tailwind_variants.ClassValue;
325
325
  clear?: tailwind_variants.ClassValue;
326
326
  preset?: tailwind_variants.ClassValue;
@@ -344,15 +344,15 @@ declare const datePicker: tailwind_variants.TVReturnType<{
344
344
  [key: string]: {
345
345
  [key: string]: tailwind_variants.ClassValue | {
346
346
  root?: tailwind_variants.ClassValue;
347
- label?: tailwind_variants.ClassValue;
348
347
  row?: tailwind_variants.ClassValue;
348
+ hint?: tailwind_variants.ClassValue;
349
+ error?: tailwind_variants.ClassValue;
350
+ label?: tailwind_variants.ClassValue;
349
351
  icon?: tailwind_variants.ClassValue;
350
352
  content?: tailwind_variants.ClassValue;
351
353
  layout?: tailwind_variants.ClassValue;
352
354
  presets?: tailwind_variants.ClassValue;
353
355
  presetNode?: tailwind_variants.ClassValue;
354
- hint?: tailwind_variants.ClassValue;
355
- error?: tailwind_variants.ClassValue;
356
356
  trigger?: tailwind_variants.ClassValue;
357
357
  clear?: tailwind_variants.ClassValue;
358
358
  preset?: tailwind_variants.ClassValue;
@@ -74,8 +74,8 @@ declare function SavedViews({ views, current, modified, onSelect, onSave, onRena
74
74
  declare const filterBar: tailwind_variants.TVReturnType<{
75
75
  [key: string]: {
76
76
  [key: string]: tailwind_variants.ClassValue | {
77
- count?: tailwind_variants.ClassValue;
78
77
  root?: tailwind_variants.ClassValue;
78
+ count?: tailwind_variants.ClassValue;
79
79
  controls?: tailwind_variants.ClassValue;
80
80
  active?: tailwind_variants.ClassValue;
81
81
  clear?: tailwind_variants.ClassValue;
@@ -87,8 +87,8 @@ declare const filterBar: tailwind_variants.TVReturnType<{
87
87
  } | {
88
88
  [x: string]: {
89
89
  [x: string]: tailwind_variants.ClassValue | {
90
- count?: tailwind_variants.ClassValue;
91
90
  root?: tailwind_variants.ClassValue;
91
+ count?: tailwind_variants.ClassValue;
92
92
  controls?: tailwind_variants.ClassValue;
93
93
  active?: tailwind_variants.ClassValue;
94
94
  clear?: tailwind_variants.ClassValue;
@@ -109,8 +109,8 @@ declare const filterBar: tailwind_variants.TVReturnType<{
109
109
  }, undefined, {
110
110
  [key: string]: {
111
111
  [key: string]: tailwind_variants.ClassValue | {
112
- count?: tailwind_variants.ClassValue;
113
112
  root?: tailwind_variants.ClassValue;
113
+ count?: tailwind_variants.ClassValue;
114
114
  controls?: tailwind_variants.ClassValue;
115
115
  active?: tailwind_variants.ClassValue;
116
116
  clear?: tailwind_variants.ClassValue;
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  "use client";
2
+ import {
3
+ cx
4
+ } from "./chunk-6ISW63JI.js";
2
5
  import {
3
6
  MotionObserver,
4
7
  RotatingWord
@@ -18,9 +21,6 @@ import {
18
21
  neutral,
19
22
  useIds
20
23
  } from "./chunk-B2HS5EAH.js";
21
- import {
22
- cx
23
- } from "./chunk-6ISW63JI.js";
24
24
 
25
25
  // src/marks/wu-sama-geometry.ts
26
26
  import { marks } from "@krizaka/tokens/native";