@hoardodile/ui 0.0.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 (356) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +70 -0
  3. package/dist/components/alert.d.ts +13 -0
  4. package/dist/components/alert.js +97 -0
  5. package/dist/components/alert.js.map +1 -0
  6. package/dist/components/app-dialog.d.ts +62 -0
  7. package/dist/components/app-dialog.js +656 -0
  8. package/dist/components/app-dialog.js.map +1 -0
  9. package/dist/components/badge.d.ts +11 -0
  10. package/dist/components/badge.js +70 -0
  11. package/dist/components/badge.js.map +1 -0
  12. package/dist/components/breadcrumb.d.ts +12 -0
  13. package/dist/components/breadcrumb.js +617 -0
  14. package/dist/components/breadcrumb.js.map +1 -0
  15. package/dist/components/button.d.ts +17 -0
  16. package/dist/components/button.js +78 -0
  17. package/dist/components/button.js.map +1 -0
  18. package/dist/components/caption-bar.d.ts +44 -0
  19. package/dist/components/caption-bar.js +827 -0
  20. package/dist/components/caption-bar.js.map +1 -0
  21. package/dist/components/chart-card.d.ts +15 -0
  22. package/dist/components/chart-card.js +27 -0
  23. package/dist/components/chart-card.js.map +1 -0
  24. package/dist/components/checkbox.d.ts +6 -0
  25. package/dist/components/checkbox.js +76 -0
  26. package/dist/components/checkbox.js.map +1 -0
  27. package/dist/components/chip-button.d.ts +28 -0
  28. package/dist/components/chip-button.js +87 -0
  29. package/dist/components/chip-button.js.map +1 -0
  30. package/dist/components/close-confirm-dialog.d.ts +19 -0
  31. package/dist/components/close-confirm-dialog.js +743 -0
  32. package/dist/components/close-confirm-dialog.js.map +1 -0
  33. package/dist/components/color-picker.d.ts +32 -0
  34. package/dist/components/color-picker.js +667 -0
  35. package/dist/components/color-picker.js.map +1 -0
  36. package/dist/components/combobox.d.ts +32 -0
  37. package/dist/components/combobox.js +1211 -0
  38. package/dist/components/combobox.js.map +1 -0
  39. package/dist/components/confirm-by-typing-dialog.d.ts +48 -0
  40. package/dist/components/confirm-by-typing-dialog.js +759 -0
  41. package/dist/components/confirm-by-typing-dialog.js.map +1 -0
  42. package/dist/components/confirm-dialog.d.ts +34 -0
  43. package/dist/components/confirm-dialog.js +710 -0
  44. package/dist/components/confirm-dialog.js.map +1 -0
  45. package/dist/components/count-badge.d.ts +13 -0
  46. package/dist/components/count-badge.js +39 -0
  47. package/dist/components/count-badge.js.map +1 -0
  48. package/dist/components/dialog.d.ts +40 -0
  49. package/dist/components/dialog.js +571 -0
  50. package/dist/components/dialog.js.map +1 -0
  51. package/dist/components/dropdown-menu.d.ts +45 -0
  52. package/dist/components/dropdown-menu.js +1003 -0
  53. package/dist/components/dropdown-menu.js.map +1 -0
  54. package/dist/components/dropdown-select.d.ts +29 -0
  55. package/dist/components/dropdown-select.js +1036 -0
  56. package/dist/components/dropdown-select.js.map +1 -0
  57. package/dist/components/empty.d.ts +15 -0
  58. package/dist/components/empty.js +119 -0
  59. package/dist/components/empty.js.map +1 -0
  60. package/dist/components/filter-rail.d.ts +48 -0
  61. package/dist/components/filter-rail.js +231 -0
  62. package/dist/components/filter-rail.js.map +1 -0
  63. package/dist/components/fixed-action-bar.d.ts +24 -0
  64. package/dist/components/fixed-action-bar.js +48 -0
  65. package/dist/components/fixed-action-bar.js.map +1 -0
  66. package/dist/components/font-picker.d.ts +45 -0
  67. package/dist/components/font-picker.js +759 -0
  68. package/dist/components/font-picker.js.map +1 -0
  69. package/dist/components/form.d.ts +17 -0
  70. package/dist/components/form.js +150 -0
  71. package/dist/components/form.js.map +1 -0
  72. package/dist/components/group-label.d.ts +12 -0
  73. package/dist/components/group-label.js +10 -0
  74. package/dist/components/group-label.js.map +1 -0
  75. package/dist/components/icon-tile.d.ts +16 -0
  76. package/dist/components/icon-tile.js +67 -0
  77. package/dist/components/icon-tile.js.map +1 -0
  78. package/dist/components/icon-toggle.d.ts +24 -0
  79. package/dist/components/icon-toggle.js +81 -0
  80. package/dist/components/icon-toggle.js.map +1 -0
  81. package/dist/components/icon.d.ts +2 -0
  82. package/dist/components/icon.js +49 -0
  83. package/dist/components/icon.js.map +1 -0
  84. package/dist/components/image-crop-panel.d.ts +80 -0
  85. package/dist/components/image-crop-panel.js +1104 -0
  86. package/dist/components/image-crop-panel.js.map +1 -0
  87. package/dist/components/image-cropper.d.ts +63 -0
  88. package/dist/components/image-cropper.js +166 -0
  89. package/dist/components/image-cropper.js.map +1 -0
  90. package/dist/components/input-group.d.ts +22 -0
  91. package/dist/components/input-group.js +270 -0
  92. package/dist/components/input-group.js.map +1 -0
  93. package/dist/components/input.d.ts +16 -0
  94. package/dist/components/input.js +60 -0
  95. package/dist/components/input.js.map +1 -0
  96. package/dist/components/label.d.ts +5 -0
  97. package/dist/components/label.js +40 -0
  98. package/dist/components/label.js.map +1 -0
  99. package/dist/components/list-empty-row.d.ts +16 -0
  100. package/dist/components/list-empty-row.js +40 -0
  101. package/dist/components/list-empty-row.js.map +1 -0
  102. package/dist/components/management-empty.d.ts +14 -0
  103. package/dist/components/management-empty.js +40 -0
  104. package/dist/components/management-empty.js.map +1 -0
  105. package/dist/components/management-skeleton.d.ts +11 -0
  106. package/dist/components/management-skeleton.js +72 -0
  107. package/dist/components/management-skeleton.js.map +1 -0
  108. package/dist/components/meta-chip.d.ts +17 -0
  109. package/dist/components/meta-chip.js +49 -0
  110. package/dist/components/meta-chip.js.map +1 -0
  111. package/dist/components/mobile-drawer.d.ts +29 -0
  112. package/dist/components/mobile-drawer.js +331 -0
  113. package/dist/components/mobile-drawer.js.map +1 -0
  114. package/dist/components/page-header.d.ts +20 -0
  115. package/dist/components/page-header.js +44 -0
  116. package/dist/components/page-header.js.map +1 -0
  117. package/dist/components/page-scaffold.d.ts +34 -0
  118. package/dist/components/page-scaffold.js +157 -0
  119. package/dist/components/page-scaffold.js.map +1 -0
  120. package/dist/components/pagination-bar.d.ts +22 -0
  121. package/dist/components/pagination-bar.js +703 -0
  122. package/dist/components/pagination-bar.js.map +1 -0
  123. package/dist/components/pagination.d.ts +22 -0
  124. package/dist/components/pagination.js +680 -0
  125. package/dist/components/pagination.js.map +1 -0
  126. package/dist/components/panel-toolbar.d.ts +37 -0
  127. package/dist/components/panel-toolbar.js +781 -0
  128. package/dist/components/panel-toolbar.js.map +1 -0
  129. package/dist/components/pill-tabs.d.ts +33 -0
  130. package/dist/components/pill-tabs.js +66 -0
  131. package/dist/components/pill-tabs.js.map +1 -0
  132. package/dist/components/plugin-download-consent.d.ts +52 -0
  133. package/dist/components/plugin-download-consent.js +780 -0
  134. package/dist/components/plugin-download-consent.js.map +1 -0
  135. package/dist/components/popover.d.ts +26 -0
  136. package/dist/components/popover.js +343 -0
  137. package/dist/components/popover.js.map +1 -0
  138. package/dist/components/progress.d.ts +10 -0
  139. package/dist/components/progress.js +103 -0
  140. package/dist/components/progress.js.map +1 -0
  141. package/dist/components/query-state-view.d.ts +36 -0
  142. package/dist/components/query-state-view.js +17 -0
  143. package/dist/components/query-state-view.js.map +1 -0
  144. package/dist/components/radio-group.d.ts +8 -0
  145. package/dist/components/radio-group.js +60 -0
  146. package/dist/components/radio-group.js.map +1 -0
  147. package/dist/components/scroll-area.d.ts +7 -0
  148. package/dist/components/scroll-area.js +80 -0
  149. package/dist/components/scroll-area.js.map +1 -0
  150. package/dist/components/search-field.d.ts +49 -0
  151. package/dist/components/search-field.js +586 -0
  152. package/dist/components/search-field.js.map +1 -0
  153. package/dist/components/secondary-stat.d.ts +13 -0
  154. package/dist/components/secondary-stat.js +56 -0
  155. package/dist/components/secondary-stat.js.map +1 -0
  156. package/dist/components/section-header.d.ts +23 -0
  157. package/dist/components/section-header.js +76 -0
  158. package/dist/components/section-header.js.map +1 -0
  159. package/dist/components/section-label.d.ts +20 -0
  160. package/dist/components/section-label.js +46 -0
  161. package/dist/components/section-label.js.map +1 -0
  162. package/dist/components/section-tabs.d.ts +47 -0
  163. package/dist/components/section-tabs.js +145 -0
  164. package/dist/components/section-tabs.js.map +1 -0
  165. package/dist/components/separator.d.ts +14 -0
  166. package/dist/components/separator.js +49 -0
  167. package/dist/components/separator.js.map +1 -0
  168. package/dist/components/sheet.d.ts +22 -0
  169. package/dist/components/sheet.js +469 -0
  170. package/dist/components/sheet.js.map +1 -0
  171. package/dist/components/sidebar.d.ts +69 -0
  172. package/dist/components/sidebar.js +1645 -0
  173. package/dist/components/sidebar.js.map +1 -0
  174. package/dist/components/skeleton.d.ts +8 -0
  175. package/dist/components/skeleton.js +41 -0
  176. package/dist/components/skeleton.js.map +1 -0
  177. package/dist/components/slider.d.ts +6 -0
  178. package/dist/components/slider.js +75 -0
  179. package/dist/components/slider.js.map +1 -0
  180. package/dist/components/sortable-chip-list.d.ts +26 -0
  181. package/dist/components/sortable-chip-list.js +59 -0
  182. package/dist/components/sortable-chip-list.js.map +1 -0
  183. package/dist/components/spinner.d.ts +5 -0
  184. package/dist/components/spinner.js +65 -0
  185. package/dist/components/spinner.js.map +1 -0
  186. package/dist/components/surface.d.ts +13 -0
  187. package/dist/components/surface.js +51 -0
  188. package/dist/components/surface.js.map +1 -0
  189. package/dist/components/switch.d.ts +8 -0
  190. package/dist/components/switch.js +53 -0
  191. package/dist/components/switch.js.map +1 -0
  192. package/dist/components/table.d.ts +12 -0
  193. package/dist/components/table.js +129 -0
  194. package/dist/components/table.js.map +1 -0
  195. package/dist/components/textarea.d.ts +15 -0
  196. package/dist/components/textarea.js +58 -0
  197. package/dist/components/textarea.js.map +1 -0
  198. package/dist/components/toast.d.ts +19 -0
  199. package/dist/components/toast.js +805 -0
  200. package/dist/components/toast.js.map +1 -0
  201. package/dist/components/toggle.d.ts +12 -0
  202. package/dist/components/toggle.js +63 -0
  203. package/dist/components/toggle.js.map +1 -0
  204. package/dist/components/tooltip.d.ts +9 -0
  205. package/dist/components/tooltip.js +82 -0
  206. package/dist/components/tooltip.js.map +1 -0
  207. package/dist/hooks/use-dialog-footer-actions.d.ts +18 -0
  208. package/dist/hooks/use-dialog-footer-actions.js +11 -0
  209. package/dist/hooks/use-dialog-footer-actions.js.map +1 -0
  210. package/dist/hooks/use-form-field.d.ts +33 -0
  211. package/dist/hooks/use-form-field.js +36 -0
  212. package/dist/hooks/use-form-field.js.map +1 -0
  213. package/dist/hooks/use-mobile.d.ts +34 -0
  214. package/dist/hooks/use-mobile.js +29 -0
  215. package/dist/hooks/use-mobile.js.map +1 -0
  216. package/dist/hooks/use-pinch-pan.d.ts +56 -0
  217. package/dist/hooks/use-pinch-pan.js +223 -0
  218. package/dist/hooks/use-pinch-pan.js.map +1 -0
  219. package/dist/hooks/useMobileBackToClose.d.ts +61 -0
  220. package/dist/hooks/useMobileBackToClose.js +234 -0
  221. package/dist/hooks/useMobileBackToClose.js.map +1 -0
  222. package/dist/icon-BOgL5bpL.d.ts +85 -0
  223. package/dist/icons/actions.d.ts +4 -0
  224. package/dist/icons/actions.js +520 -0
  225. package/dist/icons/actions.js.map +1 -0
  226. package/dist/icons/icon-style.d.ts +2 -0
  227. package/dist/icons/icon-style.js +51 -0
  228. package/dist/icons/icon-style.js.map +1 -0
  229. package/dist/icons/marks.d.ts +15 -0
  230. package/dist/icons/marks.js +48 -0
  231. package/dist/icons/marks.js.map +1 -0
  232. package/dist/icons/registry.d.ts +177 -0
  233. package/dist/icons/registry.js +1180 -0
  234. package/dist/icons/registry.js.map +1 -0
  235. package/dist/index.d.ts +6 -0
  236. package/dist/index.js +653 -0
  237. package/dist/index.js.map +1 -0
  238. package/dist/lib/merge-config.d.ts +15 -0
  239. package/dist/lib/merge-config.js +20 -0
  240. package/dist/lib/merge-config.js.map +1 -0
  241. package/dist/lib/pagination.d.ts +19 -0
  242. package/dist/lib/pagination.js +26 -0
  243. package/dist/lib/pagination.js.map +1 -0
  244. package/dist/lib/utils.d.ts +5 -0
  245. package/dist/lib/utils.js +26 -0
  246. package/dist/lib/utils.js.map +1 -0
  247. package/dist/styles/theme.css +480 -0
  248. package/dist/styles/theme.css.map +1 -0
  249. package/dist/styles/theme.d.ts +2 -0
  250. package/dist/viewport.d.ts +64 -0
  251. package/dist/viewport.js +13 -0
  252. package/dist/viewport.js.map +1 -0
  253. package/package.json +122 -0
  254. package/src/components/alert.tsx +76 -0
  255. package/src/components/app-dialog.tsx +187 -0
  256. package/src/components/badge.tsx +52 -0
  257. package/src/components/breadcrumb.tsx +129 -0
  258. package/src/components/button.tsx +70 -0
  259. package/src/components/caption-bar.test.tsx +151 -0
  260. package/src/components/caption-bar.tsx +392 -0
  261. package/src/components/chart-card.tsx +31 -0
  262. package/src/components/checkbox.tsx +28 -0
  263. package/src/components/chip-button.tsx +69 -0
  264. package/src/components/close-confirm-dialog.tsx +99 -0
  265. package/src/components/color-picker.tsx +186 -0
  266. package/src/components/combobox.tsx +335 -0
  267. package/src/components/confirm-by-typing-dialog.tsx +130 -0
  268. package/src/components/confirm-dialog.test.tsx +39 -0
  269. package/src/components/confirm-dialog.tsx +98 -0
  270. package/src/components/count-badge.tsx +23 -0
  271. package/src/components/dialog.tsx +315 -0
  272. package/src/components/dropdown-menu.tsx +311 -0
  273. package/src/components/dropdown-select.tsx +211 -0
  274. package/src/components/empty.tsx +104 -0
  275. package/src/components/filter-rail.tsx +139 -0
  276. package/src/components/fixed-action-bar.tsx +46 -0
  277. package/src/components/font-picker.tsx +257 -0
  278. package/src/components/form.tsx +127 -0
  279. package/src/components/group-label.tsx +13 -0
  280. package/src/components/icon-tile.tsx +35 -0
  281. package/src/components/icon-toggle.tsx +57 -0
  282. package/src/components/icon.tsx +66 -0
  283. package/src/components/image-crop-panel.test.tsx +167 -0
  284. package/src/components/image-crop-panel.tsx +465 -0
  285. package/src/components/image-cropper.test.tsx +144 -0
  286. package/src/components/image-cropper.tsx +265 -0
  287. package/src/components/input-group.tsx +156 -0
  288. package/src/components/input.tsx +45 -0
  289. package/src/components/label.tsx +20 -0
  290. package/src/components/list-empty-row.tsx +27 -0
  291. package/src/components/management-empty.tsx +25 -0
  292. package/src/components/management-skeleton.tsx +23 -0
  293. package/src/components/meta-chip.tsx +40 -0
  294. package/src/components/mobile-drawer.test.tsx +52 -0
  295. package/src/components/mobile-drawer.tsx +98 -0
  296. package/src/components/page-header.tsx +47 -0
  297. package/src/components/page-scaffold.test.tsx +24 -0
  298. package/src/components/page-scaffold.tsx +131 -0
  299. package/src/components/pagination-bar.test.tsx +87 -0
  300. package/src/components/pagination-bar.tsx +139 -0
  301. package/src/components/pagination.tsx +139 -0
  302. package/src/components/panel-toolbar.tsx +99 -0
  303. package/src/components/pill-tabs.test.tsx +84 -0
  304. package/src/components/pill-tabs.tsx +77 -0
  305. package/src/components/plugin-download-consent.test.tsx +90 -0
  306. package/src/components/plugin-download-consent.tsx +183 -0
  307. package/src/components/popover.tsx +133 -0
  308. package/src/components/progress.tsx +88 -0
  309. package/src/components/query-state-view.tsx +47 -0
  310. package/src/components/radio-group.tsx +36 -0
  311. package/src/components/scroll-area.tsx +52 -0
  312. package/src/components/search-field.test.tsx +86 -0
  313. package/src/components/search-field.tsx +119 -0
  314. package/src/components/secondary-stat.tsx +24 -0
  315. package/src/components/section-header.tsx +54 -0
  316. package/src/components/section-label.tsx +40 -0
  317. package/src/components/section-tabs.test.tsx +154 -0
  318. package/src/components/section-tabs.tsx +190 -0
  319. package/src/components/separator.tsx +38 -0
  320. package/src/components/sheet.tsx +170 -0
  321. package/src/components/sidebar.tsx +725 -0
  322. package/src/components/skeleton.tsx +18 -0
  323. package/src/components/slider.tsx +52 -0
  324. package/src/components/sortable-chip-list.tsx +56 -0
  325. package/src/components/spinner.tsx +35 -0
  326. package/src/components/surface.tsx +37 -0
  327. package/src/components/switch.tsx +30 -0
  328. package/src/components/table.tsx +116 -0
  329. package/src/components/textarea.tsx +41 -0
  330. package/src/components/toast.tsx +239 -0
  331. package/src/components/toggle.tsx +45 -0
  332. package/src/components/tooltip.tsx +64 -0
  333. package/src/hooks/use-dialog-footer-actions.ts +23 -0
  334. package/src/hooks/use-form-field.ts +62 -0
  335. package/src/hooks/use-mobile.ts +54 -0
  336. package/src/hooks/use-pinch-pan.test.tsx +42 -0
  337. package/src/hooks/use-pinch-pan.ts +340 -0
  338. package/src/hooks/useMobileBackToClose.test.tsx +140 -0
  339. package/src/hooks/useMobileBackToClose.ts +508 -0
  340. package/src/icons/actions.ts +10 -0
  341. package/src/icons/icon-style.test.tsx +69 -0
  342. package/src/icons/icon-style.ts +104 -0
  343. package/src/icons/marks.tsx +72 -0
  344. package/src/icons/registry.test.ts +65 -0
  345. package/src/icons/registry.ts +1163 -0
  346. package/src/index.ts +22 -0
  347. package/src/lib/merge-config.test.ts +109 -0
  348. package/src/lib/merge-config.ts +22 -0
  349. package/src/lib/pagination.test.ts +55 -0
  350. package/src/lib/pagination.ts +42 -0
  351. package/src/lib/utils.ts +6 -0
  352. package/src/styles/scan-contract.test.ts +74 -0
  353. package/src/styles/theme.css +798 -0
  354. package/src/test/i18n.tsx +22 -0
  355. package/src/test/setup.ts +104 -0
  356. package/src/viewport.ts +69 -0
@@ -0,0 +1,81 @@
1
+ import { clsx } from 'clsx';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/lib/utils.ts
6
+ var mergeTheme = {
7
+ text: ["tiny", "ui", "doc", "doc-title", "doc-heading", "quote"],
8
+ spacing: ["chip", "control", "nav", "sidebar", "panel"],
9
+ tracking: ["label"],
10
+ shadow: ["card", "dialog"],
11
+ container: ["reading", "medium", "content"],
12
+ font: ["doc", "heading"],
13
+ ease: ["standard"],
14
+ animate: ["skel", "pop"]
15
+ };
16
+ var twMerge = extendTailwindMerge({
17
+ extend: { theme: mergeTheme }
18
+ });
19
+
20
+ // src/lib/utils.ts
21
+ function cn(...inputs) {
22
+ return twMerge(clsx(inputs));
23
+ }
24
+ var sizeClasses = {
25
+ sm: "size-3",
26
+ md: "size-4",
27
+ lg: "size-5"
28
+ };
29
+ function Icon({
30
+ icon: IconComponent,
31
+ mode,
32
+ size = "md",
33
+ selected,
34
+ className,
35
+ ...rest
36
+ }) {
37
+ return /* @__PURE__ */ jsx(
38
+ IconComponent,
39
+ {
40
+ mode: mode ?? (selected === true ? "bold" : void 0),
41
+ className: cn("hd-icon", sizeClasses[size], className),
42
+ ...rest
43
+ }
44
+ );
45
+ }
46
+ function IconToggle(props) {
47
+ const { value, options, onChange, className } = props;
48
+ return /* @__PURE__ */ jsx(
49
+ "span",
50
+ {
51
+ className: cn(
52
+ "inline-flex shrink-0 items-center gap-0.5 rounded-lg bg-muted p-0.5",
53
+ className
54
+ ),
55
+ children: options.map((option) => {
56
+ const active = option.value === value;
57
+ return /* @__PURE__ */ jsx(
58
+ "button",
59
+ {
60
+ type: "button",
61
+ title: option.label,
62
+ "aria-label": option.label,
63
+ "aria-pressed": active,
64
+ "data-testid": option.testId,
65
+ onClick: () => onChange(option.value),
66
+ className: cn(
67
+ "flex size-7 cursor-pointer items-center justify-center rounded-md",
68
+ active ? "bg-card text-foreground" : "text-muted-foreground hover:text-secondary-foreground"
69
+ ),
70
+ children: /* @__PURE__ */ jsx(Icon, { icon: option.icon, selected: active, className: "size-4" })
71
+ },
72
+ option.value
73
+ );
74
+ })
75
+ }
76
+ );
77
+ }
78
+
79
+ export { IconToggle };
80
+ //# sourceMappingURL=icon-toggle.js.map
81
+ //# sourceMappingURL=icon-toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/merge-config.ts","../../src/lib/utils.ts","../../src/components/icon.tsx","../../src/components/icon-toggle.tsx"],"names":["jsx"],"mappings":";;;;;AAQO,IAAM,UAAA,GAAa;AAAA,EACzB,MAAM,CAAC,MAAA,EAAQ,MAAM,KAAA,EAAO,WAAA,EAAa,eAAe,OAAO,CAAA;AAAA,EAC/D,SAAS,CAAC,MAAA,EAAQ,SAAA,EAAW,KAAA,EAAO,WAAW,OAAO,CAAA;AAAA,EACtD,QAAA,EAAU,CAAC,OAAO,CAAA;AAAA,EAClB,MAAA,EAAQ,CAAC,MAAA,EAAQ,QAAQ,CAAA;AAAA,EACzB,SAAA,EAAW,CAAC,SAAA,EAAW,QAAA,EAAU,SAAS,CAAA;AAAA,EAC1C,IAAA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O,KAAA,KAAU,KAAA;AAChC,QAAA,uBACCA,GAAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACA,IAAA,EAAK,QAAA;AAAA,YAEL,OAAO,MAAA,CAAO,KAAA;AAAA,YACd,cAAY,MAAA,CAAO,KAAA;AAAA,YACnB,cAAA,EAAc,MAAA;AAAA,YACd,eAAa,MAAA,CAAO,MAAA;AAAA,YACpB,OAAA,EAAS,MAAM,QAAA,CAAS,MAAA,CAAO,KAAK,CAAA;AAAA,YACpC,SAAA,EAAW,EAAA;AAAA,cACV,mEAAA;AAAA,cACA,SACG,yBAAA,GACA;AAAA,aACJ;AAAA,YAEA,QAAA,kBAAAA,IAAC,IAAA,EAAA,EAAK,IAAA,EAAM,OAAO,IAAA,EAAM,QAAA,EAAU,MAAA,EAAQ,SAAA,EAAU,QAAA,EAAS;AAAA,WAAA;AAAA,UAbzD,MAAA,CAAO;AAAA,SAcb;AAAA,MAEF,CAAC;AAAA;AAAA,GACF;AAEF","file":"icon-toggle.js","sourcesContent":["import { extendTailwindMerge } from \"tailwind-merge\"\n\n// The app's `@theme inline` tokens (theme.css) generate utility names\n// tailwind-merge doesn't know, so it misclassifies them — e.g. `text-ui` is\n// parsed as a text color and dropped next to any `text-*` color. The default\n// class groups are theme-backed, so extending the theme (keys mirror the v4\n// token namespaces one-to-one) registers every custom utility with correct\n// conflict semantics. merge-config.test.ts pins this list against theme.css.\nexport const mergeTheme = {\n\ttext: [\"tiny\", \"ui\", \"doc\", \"doc-title\", \"doc-heading\", \"quote\"],\n\tspacing: [\"chip\", \"control\", \"nav\", \"sidebar\", \"panel\"],\n\ttracking: [\"label\"],\n\tshadow: [\"card\", \"dialog\"],\n\tcontainer: [\"reading\", \"medium\", \"content\"],\n\tfont: [\"doc\", \"heading\"],\n\tease: [\"standard\"],\n\tanimate: [\"skel\", \"pop\"],\n} as const\n\nexport const twMerge = extendTailwindMerge({\n\textend: { theme: mergeTheme },\n})\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"./merge-config\"\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs))\n}\n","import type { ComponentType } from \"react\"\nimport { cn } from \"../lib/utils.ts\"\nimport type { IconMode } from \"../icons/icon-style.ts\"\n\n/** Anything renderable through `Icon`: a Solar icon (imported from the\n central registry on the web side) or a local utility mark (marks.tsx) —\n both take `className`; registry icons take `mode` (marks ignore it). */\nexport type IconType = ComponentType<{ className?: string; mode?: IconMode }>\n\n/** The three sanctioned icon sizes: `sm` 12 inside pills and meta lines,\n `md` 16 by default, `lg` 20 for primary toolbar actions. */\nexport type IconSize = \"sm\" | \"md\" | \"lg\"\n\nconst sizeClasses = {\n\tsm: \"size-3\",\n\tmd: \"size-4\",\n\tlg: \"size-5\",\n} as const satisfies Record<IconSize, string>\n\n/**\n * Solar icons with the design system's defaults baked in: callers pass\n * the registry icon — by default it renders the boldDuotone weight,\n * whose second tone takes the palette's `--icon-tone` hue (theme.css\n * recolors the duotone accent via `--solar-secondary-color` under the\n * `hd-icon` hook), so colored palettes feel alive while mono stays\n * neutral.\n *\n * Mode is one channel: `mode` picks the weight directly; `selected` maps\n * to `\"bold\"` (the filled, single-color weight — the only sanctioned use\n * of Bold); otherwise the active icon style preference decides.\n *\n * Sizing is class-based, three tiers only — `sm`/`md`/`lg` map to\n * `size-3/4/5` (12/16/20). Escape the tiers with\n * `className=\"size-[18px]\"` — twMerge lets the later class win.\n *\n * ✓/×/+ semantics never use Solar's Circle/Square composites — the\n * container is full-bleed while the informative mark is barely a third\n * of the box, so it goes muddy at small sizes. The plain marks (Check,\n * Cross, Plus from marks.tsx) cover these at every size; `sm` otherwise\n * belongs to simple single-stroke glyphs (arrows, dots, grips).\n */\nexport function Icon({\n\ticon: IconComponent,\n\tmode,\n\tsize = \"md\",\n\tselected,\n\tclassName,\n\t...rest\n}: {\n\ticon: IconType\n\t/** Explicit weight override; `selected` and the style preference lose\n\t to it. */\n\tmode?: IconMode\n\tsize?: IconSize\n\t/** Selected state — renders the icon's `\"bold\"` weight. */\n\tselected?: boolean\n\tclassName?: string\n} & Record<string, unknown>) {\n\treturn (\n\t\t<IconComponent\n\t\t\tmode={mode ?? (selected === true ? \"bold\" : undefined)}\n\t\t\tclassName={cn(\"hd-icon\", sizeClasses[size], className)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n}\n","import { Icon, type IconType } from \"@hoardodile/ui/components/icon\"\nimport { cn } from \"@hoardodile/ui/lib/utils\"\n\nexport type IconToggleOption<T extends string> = {\n\treadonly value: T\n\treadonly icon: IconType\n\t/** Accessible name (also the tooltip). */\n\treadonly label: string\n\treadonly testId?: string\n}\n\ntype IconToggleProps<T extends string> = {\n\treadonly value: T\n\treadonly options: readonly IconToggleOption<T>[]\n\treadonly onChange: (value: T) => void\n\treadonly className?: string\n}\n\n/**\n * Icon toggle: a segmented control of square icon buttons (grid/masonry\n * view switchers). Muted track; the active button lifts to the card fill\n * and its icon takes the Bold weight.\n */\nexport function IconToggle<T extends string>(props: IconToggleProps<T>) {\n\tconst { value, options, onChange, className } = props\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex shrink-0 items-center gap-0.5 rounded-lg bg-muted p-0.5\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{options.map((option) => {\n\t\t\t\tconst active = option.value === value\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\ttitle={option.label}\n\t\t\t\t\t\taria-label={option.label}\n\t\t\t\t\t\taria-pressed={active}\n\t\t\t\t\t\tdata-testid={option.testId}\n\t\t\t\t\t\tonClick={() => onChange(option.value)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"flex size-7 cursor-pointer items-center justify-center rounded-md\",\n\t\t\t\t\t\t\tactive\n\t\t\t\t\t\t\t\t? \"bg-card text-foreground\"\n\t\t\t\t\t\t\t\t: \"text-muted-foreground hover:text-secondary-foreground\",\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={option.icon} selected={active} className=\"size-4\" />\n\t\t\t\t\t</button>\n\t\t\t\t)\n\t\t\t})}\n\t\t</span>\n\t)\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import 'react';
2
+ export { f as Icon, a as IconSize, I as IconType } from '../icon-BOgL5bpL.js';
@@ -0,0 +1,49 @@
1
+ import { clsx } from 'clsx';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/lib/utils.ts
6
+ var mergeTheme = {
7
+ text: ["tiny", "ui", "doc", "doc-title", "doc-heading", "quote"],
8
+ spacing: ["chip", "control", "nav", "sidebar", "panel"],
9
+ tracking: ["label"],
10
+ shadow: ["card", "dialog"],
11
+ container: ["reading", "medium", "content"],
12
+ font: ["doc", "heading"],
13
+ ease: ["standard"],
14
+ animate: ["skel", "pop"]
15
+ };
16
+ var twMerge = extendTailwindMerge({
17
+ extend: { theme: mergeTheme }
18
+ });
19
+
20
+ // src/lib/utils.ts
21
+ function cn(...inputs) {
22
+ return twMerge(clsx(inputs));
23
+ }
24
+ var sizeClasses = {
25
+ sm: "size-3",
26
+ md: "size-4",
27
+ lg: "size-5"
28
+ };
29
+ function Icon({
30
+ icon: IconComponent,
31
+ mode,
32
+ size = "md",
33
+ selected,
34
+ className,
35
+ ...rest
36
+ }) {
37
+ return /* @__PURE__ */ jsx(
38
+ IconComponent,
39
+ {
40
+ mode: mode ?? (selected === true ? "bold" : void 0),
41
+ className: cn("hd-icon", sizeClasses[size], className),
42
+ ...rest
43
+ }
44
+ );
45
+ }
46
+
47
+ export { Icon };
48
+ //# sourceMappingURL=icon.js.map
49
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/merge-config.ts","../../src/lib/utils.ts","../../src/components/icon.tsx"],"names":[],"mappings":";;;;;AA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ACpD,GAAG;AAAA;AAAA,GACL;AAEF","file":"icon.js","sourcesContent":["import { extendTailwindMerge } from \"tailwind-merge\"\n\n// The app's `@theme inline` tokens (theme.css) generate utility names\n// tailwind-merge doesn't know, so it misclassifies them — e.g. `text-ui` is\n// parsed as a text color and dropped next to any `text-*` color. The default\n// class groups are theme-backed, so extending the theme (keys mirror the v4\n// token namespaces one-to-one) registers every custom utility with correct\n// conflict semantics. merge-config.test.ts pins this list against theme.css.\nexport const mergeTheme = {\n\ttext: [\"tiny\", \"ui\", \"doc\", \"doc-title\", \"doc-heading\", \"quote\"],\n\tspacing: [\"chip\", \"control\", \"nav\", \"sidebar\", \"panel\"],\n\ttracking: [\"label\"],\n\tshadow: [\"card\", \"dialog\"],\n\tcontainer: [\"reading\", \"medium\", \"content\"],\n\tfont: [\"doc\", \"heading\"],\n\tease: [\"standard\"],\n\tanimate: [\"skel\", \"pop\"],\n} as const\n\nexport const twMerge = extendTailwindMerge({\n\textend: { theme: mergeTheme },\n})\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"./merge-config\"\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs))\n}\n","import type { ComponentType } from \"react\"\nimport { cn } from \"../lib/utils.ts\"\nimport type { IconMode } from \"../icons/icon-style.ts\"\n\n/** Anything renderable through `Icon`: a Solar icon (imported from the\n central registry on the web side) or a local utility mark (marks.tsx) —\n both take `className`; registry icons take `mode` (marks ignore it). */\nexport type IconType = ComponentType<{ className?: string; mode?: IconMode }>\n\n/** The three sanctioned icon sizes: `sm` 12 inside pills and meta lines,\n `md` 16 by default, `lg` 20 for primary toolbar actions. */\nexport type IconSize = \"sm\" | \"md\" | \"lg\"\n\nconst sizeClasses = {\n\tsm: \"size-3\",\n\tmd: \"size-4\",\n\tlg: \"size-5\",\n} as const satisfies Record<IconSize, string>\n\n/**\n * Solar icons with the design system's defaults baked in: callers pass\n * the registry icon — by default it renders the boldDuotone weight,\n * whose second tone takes the palette's `--icon-tone` hue (theme.css\n * recolors the duotone accent via `--solar-secondary-color` under the\n * `hd-icon` hook), so colored palettes feel alive while mono stays\n * neutral.\n *\n * Mode is one channel: `mode` picks the weight directly; `selected` maps\n * to `\"bold\"` (the filled, single-color weight — the only sanctioned use\n * of Bold); otherwise the active icon style preference decides.\n *\n * Sizing is class-based, three tiers only — `sm`/`md`/`lg` map to\n * `size-3/4/5` (12/16/20). Escape the tiers with\n * `className=\"size-[18px]\"` — twMerge lets the later class win.\n *\n * ✓/×/+ semantics never use Solar's Circle/Square composites — the\n * container is full-bleed while the informative mark is barely a third\n * of the box, so it goes muddy at small sizes. The plain marks (Check,\n * Cross, Plus from marks.tsx) cover these at every size; `sm` otherwise\n * belongs to simple single-stroke glyphs (arrows, dots, grips).\n */\nexport function Icon({\n\ticon: IconComponent,\n\tmode,\n\tsize = \"md\",\n\tselected,\n\tclassName,\n\t...rest\n}: {\n\ticon: IconType\n\t/** Explicit weight override; `selected` and the style preference lose\n\t to it. */\n\tmode?: IconMode\n\tsize?: IconSize\n\t/** Selected state — renders the icon's `\"bold\"` weight. */\n\tselected?: boolean\n\tclassName?: string\n} & Record<string, unknown>) {\n\treturn (\n\t\t<IconComponent\n\t\t\tmode={mode ?? (selected === true ? \"bold\" : undefined)}\n\t\t\tclassName={cn(\"hd-icon\", sizeClasses[size], className)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n}\n"]}
@@ -0,0 +1,80 @@
1
+ import * as React from 'react';
2
+ import { CroppedImage } from './image-cropper.js';
3
+
4
+ type ImageCropPanelProps = {
5
+ readonly aspect?: number;
6
+ readonly mimeType?: "image/png" | "image/jpeg" | "image/webp";
7
+ readonly accept?: string;
8
+ readonly previewShape?: "square" | "circle";
9
+ readonly previewWidth?: number;
10
+ readonly previewHeight?: number;
11
+ /**
12
+ * Called when the user clicks "save". Receives the cropped image
13
+ * payload. Should return a promise that resolves once the upload is
14
+ * complete; the panel then notifies via {@link onSaved}.
15
+ *
16
+ * @throws The implementation may throw to surface an error toast.
17
+ */
18
+ readonly onSave: (cropped: CroppedImage) => Promise<unknown>;
19
+ readonly onSaved?: () => void;
20
+ /**
21
+ * Called when the user clicks the action button but no image has been
22
+ * selected. The parent (e.g. {@link ImageEditPanel}) can treat this as a
23
+ * request to remove the existing image.
24
+ */
25
+ readonly onClear?: () => void;
26
+ /**
27
+ * When set (e.g. canvas snapshot object URL), skips the empty picker and
28
+ * shows the cropper immediately.
29
+ */
30
+ readonly initialSrc?: string;
31
+ /**
32
+ * When false, hides file pick / drag-drop and "reselect" (preset image only).
33
+ */
34
+ readonly allowChangeSource?: boolean;
35
+ /** Notifies parent when an async save starts / finishes (for dialog guards). */
36
+ readonly onSavingChange?: (saving: boolean) => void;
37
+ /** Exact size (px) of the empty picker frame / crop stage. Overrides the default 240×240. */
38
+ readonly cropStageWidth?: number;
39
+ readonly cropStageHeight?: number;
40
+ /**
41
+ * When true, the right-hand live preview is hidden until the user turns
42
+ * the switch on (saves work over large captures / WebGL snapshots).
43
+ */
44
+ readonly showPreviewSwitch?: boolean;
45
+ /**
46
+ * When true, the live preview pane is never rendered — the crop stage is
47
+ * the only surface. Used by creation forms whose panel column has no
48
+ * room for a side-by-side preview.
49
+ */
50
+ readonly hidePreview?: boolean;
51
+ /**
52
+ * When true, the crop stage fills its parent width and keeps the aspect
53
+ * ratio implied by {@link cropStageWidth} / {@link cropStageHeight}
54
+ * (full-bleed `aspect-square w-full` panels). Ignored when only
55
+ * one stage dimension is given.
56
+ */
57
+ readonly fillWidth?: boolean;
58
+ /** Extra classes on the root panel wrapper. */
59
+ readonly panelClassName?: string;
60
+ /** Extra classes on the row that holds the crop stage + preview. */
61
+ readonly containerClassName?: string;
62
+ /** Extra classes on the column wrapping the crop stage (e.g. flex-1 min-w-0). */
63
+ readonly cropColumnClassName?: string;
64
+ /** Extra classes on the bordered crop stage box (merged with defaults via tailwind-merge). */
65
+ readonly cropStageClassName?: string;
66
+ /** When true, the bottom save/remove action button is hidden. */
67
+ readonly hideActionButton?: boolean;
68
+ /**
69
+ * When true, automatically calls {@link onSave} after the user finishes
70
+ * adjusting the crop (debounced by 600 ms). Useful when the action button
71
+ * is hidden and the parent only needs the final crop at form-submit time.
72
+ */
73
+ readonly autoSaveOnCrop?: boolean;
74
+ };
75
+ /**
76
+ * Inline image picker + cropper with live preview.
77
+ */
78
+ declare function ImageCropPanel(props: ImageCropPanelProps): React.JSX.Element;
79
+
80
+ export { ImageCropPanel, type ImageCropPanelProps };