@pihanga2/shadcn 0.1.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 (399) hide show
  1. package/README.md +114 -0
  2. package/cards/badge/badge.component.d.ts +14 -0
  3. package/cards/badge/badge.component.js +18 -0
  4. package/cards/badge/badge.component.js.map +1 -0
  5. package/cards/badge/badge.types.d.ts +37 -0
  6. package/cards/badge/badge.types.js +7 -0
  7. package/cards/badge/badge.types.js.map +1 -0
  8. package/cards/badge/index.d.ts +1 -0
  9. package/cards/badge/index.js +12 -0
  10. package/cards/badge/index.js.map +1 -0
  11. package/cards/box/box.component.d.ts +4 -0
  12. package/cards/box/box.component.js +24 -0
  13. package/cards/box/box.component.js.map +1 -0
  14. package/cards/box/box.types.d.ts +71 -0
  15. package/cards/box/box.types.js +7 -0
  16. package/cards/box/box.types.js.map +1 -0
  17. package/cards/box/index.d.ts +1 -0
  18. package/cards/box/index.js +12 -0
  19. package/cards/box/index.js.map +1 -0
  20. package/cards/button/button.component.d.ts +4 -0
  21. package/cards/button/button.component.js +71 -0
  22. package/cards/button/button.component.js.map +1 -0
  23. package/cards/button/button.types.d.ts +106 -0
  24. package/cards/button/button.types.js +7 -0
  25. package/cards/button/button.types.js.map +1 -0
  26. package/cards/button/index.d.ts +1 -0
  27. package/cards/button/index.js +13 -0
  28. package/cards/button/index.js.map +1 -0
  29. package/cards/checkbox/checkbox.component.d.ts +4 -0
  30. package/cards/checkbox/checkbox.component.js +36 -0
  31. package/cards/checkbox/checkbox.component.js.map +1 -0
  32. package/cards/checkbox/checkbox.types.d.ts +37 -0
  33. package/cards/checkbox/checkbox.types.js +7 -0
  34. package/cards/checkbox/checkbox.types.js.map +1 -0
  35. package/cards/checkbox/index.d.ts +1 -0
  36. package/cards/checkbox/index.js +13 -0
  37. package/cards/checkbox/index.js.map +1 -0
  38. package/cards/conditional/conditional.component.d.ts +11 -0
  39. package/cards/conditional/conditional.component.js +15 -0
  40. package/cards/conditional/conditional.component.js.map +1 -0
  41. package/cards/conditional/conditional.types.d.ts +29 -0
  42. package/cards/conditional/conditional.types.js +7 -0
  43. package/cards/conditional/conditional.types.js.map +1 -0
  44. package/cards/conditional/index.d.ts +1 -0
  45. package/cards/conditional/index.js +12 -0
  46. package/cards/conditional/index.js.map +1 -0
  47. package/cards/core-index.d.ts +30 -0
  48. package/cards/core-index.js +61 -0
  49. package/cards/dataTable/dataTable.component.d.ts +4 -0
  50. package/cards/dataTable/dataTable.component.js +209 -0
  51. package/cards/dataTable/dataTable.component.js.map +1 -0
  52. package/cards/dataTable/dataTable.types.d.ts +196 -0
  53. package/cards/dataTable/dataTable.types.js +13 -0
  54. package/cards/dataTable/dataTable.types.js.map +1 -0
  55. package/cards/dataTable/dataTableRowDetail.component.d.ts +26 -0
  56. package/cards/dataTable/dataTableRowDetail.component.js +47 -0
  57. package/cards/dataTable/dataTableRowDetail.component.js.map +1 -0
  58. package/cards/dataTable/index.d.ts +1 -0
  59. package/cards/dataTable/index.js +16 -0
  60. package/cards/dataTable/index.js.map +1 -0
  61. package/cards/dialog/dialog.component.d.ts +4 -0
  62. package/cards/dialog/dialog.component.js +89 -0
  63. package/cards/dialog/dialog.component.js.map +1 -0
  64. package/cards/dialog/dialog.types.d.ts +115 -0
  65. package/cards/dialog/dialog.types.js +11 -0
  66. package/cards/dialog/dialog.types.js.map +1 -0
  67. package/cards/dialog/index.d.ts +1 -0
  68. package/cards/dialog/index.js +13 -0
  69. package/cards/dialog/index.js.map +1 -0
  70. package/cards/dropDownMenu/drop-down.component.d.ts +4 -0
  71. package/cards/dropDownMenu/drop-down.component.js +205 -0
  72. package/cards/dropDownMenu/drop-down.component.js.map +1 -0
  73. package/cards/dropDownMenu/drop-down.types.d.ts +131 -0
  74. package/cards/dropDownMenu/drop-down.types.js +7 -0
  75. package/cards/dropDownMenu/drop-down.types.js.map +1 -0
  76. package/cards/dropDownMenu/dropdown-context.d.ts +7 -0
  77. package/cards/dropDownMenu/dropdown-context.js +7 -0
  78. package/cards/dropDownMenu/dropdown-context.js.map +1 -0
  79. package/cards/dropDownMenu/dropdown-menu.ui.d.ts +42 -0
  80. package/cards/dropDownMenu/dropdown-menu.ui.js +111 -0
  81. package/cards/dropDownMenu/dropdown-menu.ui.js.map +1 -0
  82. package/cards/dropDownMenu/index.d.ts +1 -0
  83. package/cards/dropDownMenu/index.js +13 -0
  84. package/cards/dropDownMenu/index.js.map +1 -0
  85. package/cards/emptyCard.d.ts +7 -0
  86. package/cards/field/field.component.d.ts +4 -0
  87. package/cards/field/field.component.js +38 -0
  88. package/cards/field/field.component.js.map +1 -0
  89. package/cards/field/field.types.d.ts +30 -0
  90. package/cards/field/field.types.js +7 -0
  91. package/cards/field/field.types.js.map +1 -0
  92. package/cards/field/index.d.ts +1 -0
  93. package/cards/field/index.js +12 -0
  94. package/cards/field/index.js.map +1 -0
  95. package/cards/flexGrid/flexGrid.component.d.ts +4 -0
  96. package/cards/flexGrid/flexGrid.component.js +40 -0
  97. package/cards/flexGrid/flexGrid.component.js.map +1 -0
  98. package/cards/flexGrid/flexGrid.types.d.ts +23 -0
  99. package/cards/flexGrid/flexGrid.types.js +7 -0
  100. package/cards/flexGrid/flexGrid.types.js.map +1 -0
  101. package/cards/flexGrid/index.d.ts +1 -0
  102. package/cards/flexGrid/index.js +12 -0
  103. package/cards/flexGrid/index.js.map +1 -0
  104. package/cards/form/form.component.d.ts +4 -0
  105. package/cards/form/form.component.js +64 -0
  106. package/cards/form/form.component.js.map +1 -0
  107. package/cards/form/form.context.d.ts +23 -0
  108. package/cards/form/form.context.js +13 -0
  109. package/cards/form/form.context.js.map +1 -0
  110. package/cards/form/form.types.d.ts +43 -0
  111. package/cards/form/form.types.js +7 -0
  112. package/cards/form/form.types.js.map +1 -0
  113. package/cards/form/index.d.ts +2 -0
  114. package/cards/form/index.js +14 -0
  115. package/cards/form/index.js.map +1 -0
  116. package/cards/framework/framework.component.d.ts +3 -0
  117. package/cards/framework/framework.component.js +21 -0
  118. package/cards/framework/framework.component.js.map +1 -0
  119. package/cards/framework/index.d.ts +2 -0
  120. package/cards/framework/index.js +12 -0
  121. package/cards/framework/index.js.map +1 -0
  122. package/cards/graphin/graphin.component.d.ts +4 -0
  123. package/cards/graphin/graphin.types.d.ts +18 -0
  124. package/cards/graphin/index.d.ts +2 -0
  125. package/cards/graphin/tooltip.component.d.ts +10 -0
  126. package/cards/icons.d.ts +15 -0
  127. package/cards/icons.js +15 -0
  128. package/cards/icons.js.map +1 -0
  129. package/cards/input/index.d.ts +1 -0
  130. package/cards/input/index.js +13 -0
  131. package/cards/input/index.js.map +1 -0
  132. package/cards/input/input.component.d.ts +4 -0
  133. package/cards/input/input.component.js +69 -0
  134. package/cards/input/input.component.js.map +1 -0
  135. package/cards/input/input.types.d.ts +80 -0
  136. package/cards/input/input.types.js +7 -0
  137. package/cards/input/input.types.js.map +1 -0
  138. package/cards/jsonViewer/index.d.ts +1 -0
  139. package/cards/jsonViewer/jsonViewer.component.d.ts +4 -0
  140. package/cards/jsonViewer/jsonViewer.types.d.ts +76 -0
  141. package/cards/list/index.d.ts +1 -0
  142. package/cards/list/index.js +13 -0
  143. package/cards/list/index.js.map +1 -0
  144. package/cards/list/list.component.d.ts +4 -0
  145. package/cards/list/list.component.js +102 -0
  146. package/cards/list/list.component.js.map +1 -0
  147. package/cards/list/list.types.d.ts +65 -0
  148. package/cards/list/list.types.js +7 -0
  149. package/cards/list/list.types.js.map +1 -0
  150. package/cards/loadingOverlay/index.d.ts +1 -0
  151. package/cards/loadingOverlay/index.js +12 -0
  152. package/cards/loadingOverlay/index.js.map +1 -0
  153. package/cards/loadingOverlay/loadingOverlay.component.d.ts +4 -0
  154. package/cards/loadingOverlay/loadingOverlay.component.js +31 -0
  155. package/cards/loadingOverlay/loadingOverlay.component.js.map +1 -0
  156. package/cards/loadingOverlay/loadingOverlay.types.d.ts +13 -0
  157. package/cards/loadingOverlay/loadingOverlay.types.js +7 -0
  158. package/cards/loadingOverlay/loadingOverlay.types.js.map +1 -0
  159. package/cards/loadingSkeleton/index.d.ts +1 -0
  160. package/cards/loadingSkeleton/index.js +12 -0
  161. package/cards/loadingSkeleton/index.js.map +1 -0
  162. package/cards/loadingSkeleton/loading-skeleton.component.d.ts +19 -0
  163. package/cards/loadingSkeleton/loading-skeleton.component.js +33 -0
  164. package/cards/loadingSkeleton/loading-skeleton.component.js.map +1 -0
  165. package/cards/loadingSkeleton/loading-skeleton.types.d.ts +94 -0
  166. package/cards/loadingSkeleton/loading-skeleton.types.js +7 -0
  167. package/cards/loadingSkeleton/loading-skeleton.types.js.map +1 -0
  168. package/cards/markdownViewer/index.d.ts +1 -0
  169. package/cards/markdownViewer/markdownViewer.component.d.ts +4 -0
  170. package/cards/markdownViewer/markdownViewer.types.d.ts +28 -0
  171. package/cards/menu/index.d.ts +1 -0
  172. package/cards/menu/index.js +13 -0
  173. package/cards/menu/index.js.map +1 -0
  174. package/cards/menu/menu.component.d.ts +4 -0
  175. package/cards/menu/menu.component.js +23 -0
  176. package/cards/menu/menu.component.js.map +1 -0
  177. package/cards/menu/menu.types.d.ts +53 -0
  178. package/cards/menu/menu.types.js +7 -0
  179. package/cards/menu/menu.types.js.map +1 -0
  180. package/cards/modeToggle/index.d.ts +1 -0
  181. package/cards/modeToggle/index.js +13 -0
  182. package/cards/modeToggle/index.js.map +1 -0
  183. package/cards/modeToggle/mode-toggle.component.d.ts +4 -0
  184. package/cards/modeToggle/mode-toggle.component.js +32 -0
  185. package/cards/modeToggle/mode-toggle.component.js.map +1 -0
  186. package/cards/modeToggle/mode-toggle.types.d.ts +20 -0
  187. package/cards/modeToggle/mode-toggle.types.js +7 -0
  188. package/cards/modeToggle/mode-toggle.types.js.map +1 -0
  189. package/cards/navbarSearch/index.d.ts +1 -0
  190. package/cards/navbarSearch/index.js +13 -0
  191. package/cards/navbarSearch/index.js.map +1 -0
  192. package/cards/navbarSearch/navbarSearch.component.d.ts +3 -0
  193. package/cards/navbarSearch/navbarSearch.component.js +88 -0
  194. package/cards/navbarSearch/navbarSearch.component.js.map +1 -0
  195. package/cards/navbarSearch/navbarSearch.type.d.ts +32 -0
  196. package/cards/navbarSearch/navbarSearch.type.js +11 -0
  197. package/cards/navbarSearch/navbarSearch.type.js.map +1 -0
  198. package/cards/pageWithNavbar/index.d.ts +2 -0
  199. package/cards/pageWithNavbar/index.js +14 -0
  200. package/cards/pageWithNavbar/index.js.map +1 -0
  201. package/cards/pageWithNavbar/pageWithNavbar.component.d.ts +12 -0
  202. package/cards/pageWithNavbar/pageWithNavbar.component.js +153 -0
  203. package/cards/pageWithNavbar/pageWithNavbar.component.js.map +1 -0
  204. package/cards/pageWithNavbar/pageWithNavbar.type.d.ts +81 -0
  205. package/cards/pageWithNavbar/pageWithNavbar.type.js +7 -0
  206. package/cards/pageWithNavbar/pageWithNavbar.type.js.map +1 -0
  207. package/cards/pasteTarget/index.d.ts +1 -0
  208. package/cards/pasteTarget/index.js +13 -0
  209. package/cards/pasteTarget/index.js.map +1 -0
  210. package/cards/pasteTarget/pasteTarget.component.d.ts +4 -0
  211. package/cards/pasteTarget/pasteTarget.component.js +158 -0
  212. package/cards/pasteTarget/pasteTarget.component.js.map +1 -0
  213. package/cards/pasteTarget/pasteTarget.types.d.ts +46 -0
  214. package/cards/pasteTarget/pasteTarget.types.js +11 -0
  215. package/cards/pasteTarget/pasteTarget.types.js.map +1 -0
  216. package/cards/resizable/index.d.ts +1 -0
  217. package/cards/resizable/resizable.component.d.ts +4 -0
  218. package/cards/resizable/resizable.types.d.ts +49 -0
  219. package/cards/select/index.d.ts +1 -0
  220. package/cards/select/index.js +13 -0
  221. package/cards/select/index.js.map +1 -0
  222. package/cards/select/select.component.d.ts +4 -0
  223. package/cards/select/select.component.js +41 -0
  224. package/cards/select/select.component.js.map +1 -0
  225. package/cards/select/select.types.d.ts +73 -0
  226. package/cards/select/select.types.js +11 -0
  227. package/cards/select/select.types.js.map +1 -0
  228. package/cards/stack/index.d.ts +1 -0
  229. package/cards/stack/index.js +12 -0
  230. package/cards/stack/index.js.map +1 -0
  231. package/cards/stack/stack.component.d.ts +7 -0
  232. package/cards/stack/stack.component.js +83 -0
  233. package/cards/stack/stack.component.js.map +1 -0
  234. package/cards/stack/stack.types.d.ts +47 -0
  235. package/cards/stack/stack.types.js +7 -0
  236. package/cards/stack/stack.types.js.map +1 -0
  237. package/cards/stepper/index.d.ts +1 -0
  238. package/cards/stepper/index.js +13 -0
  239. package/cards/stepper/index.js.map +1 -0
  240. package/cards/stepper/stepper.component.d.ts +4 -0
  241. package/cards/stepper/stepper.component.js +48 -0
  242. package/cards/stepper/stepper.component.js.map +1 -0
  243. package/cards/stepper/stepper.types.d.ts +96 -0
  244. package/cards/stepper/stepper.types.js +7 -0
  245. package/cards/stepper/stepper.types.js.map +1 -0
  246. package/cards/switch/index.d.ts +1 -0
  247. package/cards/switch/index.js +13 -0
  248. package/cards/switch/index.js.map +1 -0
  249. package/cards/switch/switch.component.d.ts +4 -0
  250. package/cards/switch/switch.component.js +34 -0
  251. package/cards/switch/switch.component.js.map +1 -0
  252. package/cards/switch/switch.types.d.ts +39 -0
  253. package/cards/switch/switch.types.js +7 -0
  254. package/cards/switch/switch.types.js.map +1 -0
  255. package/cards/tabs/index.d.ts +1 -0
  256. package/cards/tabs/index.js +13 -0
  257. package/cards/tabs/index.js.map +1 -0
  258. package/cards/tabs/tabs.component.d.ts +4 -0
  259. package/cards/tabs/tabs.component.js +42 -0
  260. package/cards/tabs/tabs.component.js.map +1 -0
  261. package/cards/tabs/tabs.types.d.ts +72 -0
  262. package/cards/tabs/tabs.types.js +7 -0
  263. package/cards/tabs/tabs.types.js.map +1 -0
  264. package/cards/textField/index.d.ts +1 -0
  265. package/cards/textField/index.js +13 -0
  266. package/cards/textField/index.js.map +1 -0
  267. package/cards/textField/textField.component.d.ts +4 -0
  268. package/cards/textField/textField.component.js +29 -0
  269. package/cards/textField/textField.component.js.map +1 -0
  270. package/cards/textField/textField.types.d.ts +36 -0
  271. package/cards/textField/textField.types.js +7 -0
  272. package/cards/textField/textField.types.js.map +1 -0
  273. package/cards/toast/index.d.ts +1 -0
  274. package/cards/toast/index.js +13 -0
  275. package/cards/toast/index.js.map +1 -0
  276. package/cards/toast/toast.component.d.ts +4 -0
  277. package/cards/toast/toast.component.js +76 -0
  278. package/cards/toast/toast.component.js.map +1 -0
  279. package/cards/toast/toast.types.d.ts +100 -0
  280. package/cards/toast/toast.types.js +12 -0
  281. package/cards/toast/toast.types.js.map +1 -0
  282. package/cards/toggleGroup/index.d.ts +1 -0
  283. package/cards/toggleGroup/index.js +13 -0
  284. package/cards/toggleGroup/index.js.map +1 -0
  285. package/cards/toggleGroup/toggleGroup.component.d.ts +4 -0
  286. package/cards/toggleGroup/toggleGroup.component.js +55 -0
  287. package/cards/toggleGroup/toggleGroup.component.js.map +1 -0
  288. package/cards/toggleGroup/toggleGroup.types.d.ts +96 -0
  289. package/cards/toggleGroup/toggleGroup.types.js +7 -0
  290. package/cards/toggleGroup/toggleGroup.types.js.map +1 -0
  291. package/cards/types.d.ts +72 -0
  292. package/cards/types.js +22 -0
  293. package/cards/types.js.map +1 -0
  294. package/cards/typography/index.d.ts +1 -0
  295. package/cards/typography/index.js +12 -0
  296. package/cards/typography/index.js.map +1 -0
  297. package/cards/typography/typography.component.d.ts +4 -0
  298. package/cards/typography/typography.component.js +44 -0
  299. package/cards/typography/typography.component.js.map +1 -0
  300. package/cards/typography/typography.types.d.ts +23 -0
  301. package/cards/typography/typography.types.js +7 -0
  302. package/cards/typography/typography.types.js.map +1 -0
  303. package/components/hooks/use-is-touch-device.d.ts +1 -0
  304. package/components/lib/utils.js +10 -0
  305. package/components/lib/utils.js.map +1 -0
  306. package/components/theme-provider/index.d.ts +4 -0
  307. package/components/theme-provider/index.js +12 -0
  308. package/components/theme-provider/index.js.map +1 -0
  309. package/components/theme-provider/theme-provider.component.d.ts +2 -0
  310. package/components/theme-provider/theme-provider.component.js +31 -0
  311. package/components/theme-provider/theme-provider.component.js.map +1 -0
  312. package/components/theme-provider/theme-provider.types.d.ts +12 -0
  313. package/components/theme-provider/theme-provider.types.js +9 -0
  314. package/components/theme-provider/theme-provider.types.js.map +1 -0
  315. package/components/ui/avatar.js +30 -0
  316. package/components/ui/avatar.js.map +1 -0
  317. package/components/ui/badge.js +26 -0
  318. package/components/ui/badge.js.map +1 -0
  319. package/components/ui/button.js +98 -0
  320. package/components/ui/button.js.map +1 -0
  321. package/components/ui/dialog.js +109 -0
  322. package/components/ui/dialog.js.map +1 -0
  323. package/components/ui/field.js +68 -0
  324. package/components/ui/field.js.map +1 -0
  325. package/components/ui/input.js +16 -0
  326. package/components/ui/input.js.map +1 -0
  327. package/components/ui/label.js +16 -0
  328. package/components/ui/label.js.map +1 -0
  329. package/components/ui/menubar.js +62 -0
  330. package/components/ui/menubar.js.map +1 -0
  331. package/components/ui/select.js +84 -0
  332. package/components/ui/select.js.map +1 -0
  333. package/components/ui/separator.js +5 -0
  334. package/components/ui/sheet.js +49 -0
  335. package/components/ui/sheet.js.map +1 -0
  336. package/components/ui/spinner.js +35 -0
  337. package/components/ui/spinner.js.map +1 -0
  338. package/components/ui/stepper.js +145 -0
  339. package/components/ui/stepper.js.map +1 -0
  340. package/components/ui/switch.js +20 -0
  341. package/components/ui/switch.js.map +1 -0
  342. package/components/ui/table.js +61 -0
  343. package/components/ui/table.js.map +1 -0
  344. package/components/ui/tabs.js +38 -0
  345. package/components/ui/tabs.js.map +1 -0
  346. package/components/ui/toggle-group.js +50 -0
  347. package/components/ui/toggle-group.js.map +1 -0
  348. package/components/ui/toggle.js +27 -0
  349. package/components/ui/toggle.js.map +1 -0
  350. package/components/ui/tooltip.js +38 -0
  351. package/components/ui/tooltip.js.map +1 -0
  352. package/lib/utils.d.ts +2 -0
  353. package/lib/utils.js +10 -0
  354. package/lib/utils.js.map +1 -0
  355. package/mountain-snow.svg +4 -0
  356. package/package.json +203 -0
  357. package/pihanga-shadcn.css +2 -0
  358. package/r/badge.json +35 -0
  359. package/r/box.json +26 -0
  360. package/r/button.json +39 -0
  361. package/r/checkbox.json +31 -0
  362. package/r/conditional.json +30 -0
  363. package/r/dataTable.json +43 -0
  364. package/r/dialog.json +36 -0
  365. package/r/dropDownMenu.json +47 -0
  366. package/r/field.json +35 -0
  367. package/r/flexGrid.json +32 -0
  368. package/r/form.json +37 -0
  369. package/r/framework.json +28 -0
  370. package/r/graphin.json +42 -0
  371. package/r/input.json +35 -0
  372. package/r/jsonViewer.json +40 -0
  373. package/r/list.json +39 -0
  374. package/r/loadingOverlay.json +39 -0
  375. package/r/loadingSkeleton.json +30 -0
  376. package/r/markdownViewer.json +51 -0
  377. package/r/menu.json +34 -0
  378. package/r/modeToggle.json +36 -0
  379. package/r/navbarSearch.json +31 -0
  380. package/r/pageWithNavbar.json +46 -0
  381. package/r/pasteTarget.json +41 -0
  382. package/r/pihanga-base.json +11 -0
  383. package/r/pihanga-cards-icons.json +16 -0
  384. package/r/pihanga-cards-types.json +16 -0
  385. package/r/pihanga-hook-use-is-touch-device.json +15 -0
  386. package/r/pihanga-lib-utils.json +18 -0
  387. package/r/pihanga-theme-provider.json +25 -0
  388. package/r/pihanga-ui-extras.json +68 -0
  389. package/r/registry.json +171 -0
  390. package/r/resizable.json +35 -0
  391. package/r/select.json +35 -0
  392. package/r/stack.json +27 -0
  393. package/r/stepper.json +39 -0
  394. package/r/switch.json +36 -0
  395. package/r/tabs.json +33 -0
  396. package/r/textField.json +32 -0
  397. package/r/toast.json +32 -0
  398. package/r/toggleGroup.json +35 -0
  399. package/r/typography.json +31 -0
@@ -0,0 +1,69 @@
1
+ import { useFormContext as e } from "../form/form.context.js";
2
+ import { Label as t } from "../../components/ui/label.js";
3
+ import { Input as n } from "../../components/ui/input.js";
4
+ import r from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ //#region src/cards/input/input.component.tsx
7
+ var o = (o) => {
8
+ let { name: s, value: c = "", type: l = "text", placeholder: u, disabled: d, label: f, description: p, className: m, cardName: h, onChanged: g, onCommitted: _ } = o, v = o.id, y = !!o.invalid, b = e(), x = b.isInForm && !!s, [S, C] = r.useState(l === "file" ? "" : c);
9
+ r.useEffect(() => {
10
+ !x && l !== "file" && C(c);
11
+ }, [
12
+ c,
13
+ x,
14
+ l
15
+ ]);
16
+ let w = l === "file" ? void 0 : x ? b.formData[s] ?? "" : S;
17
+ function T(e) {
18
+ let t = l === "file" ? e.target.files?.[0]?.name ?? "" : e.target.value;
19
+ x ? b.handleChange(s, t) : (C(t), g({
20
+ name: s,
21
+ value: t
22
+ }));
23
+ }
24
+ function E() {
25
+ !x && l !== "file" && _({
26
+ name: s,
27
+ value: S
28
+ });
29
+ }
30
+ function D(e) {
31
+ e.key === "Enter" && !x && l !== "file" && _({
32
+ name: s,
33
+ value: S
34
+ });
35
+ }
36
+ let O = `${h}-${s ?? "input"}`, k = v ?? O;
37
+ return /* @__PURE__ */ a("div", {
38
+ "data-pihanga": h,
39
+ className: "grid w-full gap-1.5",
40
+ children: [
41
+ f && /* @__PURE__ */ i(t, {
42
+ htmlFor: k,
43
+ children: f
44
+ }),
45
+ /* @__PURE__ */ i(n, {
46
+ id: k,
47
+ type: l,
48
+ value: w,
49
+ onChange: T,
50
+ onBlur: E,
51
+ onKeyDown: D,
52
+ placeholder: u,
53
+ disabled: d,
54
+ className: m,
55
+ "aria-invalid": y || void 0,
56
+ "aria-describedby": p ? `${k}-desc` : void 0
57
+ }),
58
+ p && /* @__PURE__ */ i("p", {
59
+ id: `${k}-desc`,
60
+ className: "text-sm text-muted-foreground",
61
+ children: p
62
+ })
63
+ ]
64
+ });
65
+ };
66
+ //#endregion
67
+ export { o as InputComponent };
68
+
69
+ //# sourceMappingURL=input.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.component.js","names":[],"sources":["../../../src/cards/input/input.component.tsx"],"sourcesContent":["import React from \"react\";\nimport {type PiCardProps} from \"@pihanga2/core\";\nimport {Input} from \"@/components/ui/input\";\nimport {Label} from \"@/components/ui/label\";\nimport {useFormContext} from \"@/cards/form/form.context\";\nimport type {PiInputEvents, PiInputProps} from \"./input.types\";\n\nexport const InputComponent = (\n props: PiCardProps<PiInputProps, PiInputEvents>,\n): React.ReactNode => {\n const {\n name,\n value: propValue = \"\",\n type = \"text\",\n placeholder,\n disabled,\n label,\n description,\n className,\n cardName,\n onChanged,\n onCommitted,\n } = props;\n\n // `id` and `invalid` may be injected by a parent pi/field card via\n // Pihanga's extra-prop forwarding. They are not in the official type so\n // we read them through an escape hatch.\n const injectedId = (props as {id?: string}).id;\n const invalid = Boolean((props as {invalid?: boolean}).invalid);\n\n // Detect if we are inside a pi/form card via React context.\n const form = useFormContext();\n const useFormData = form.isInForm && Boolean(name);\n\n // Local display state — lets the user type freely without triggering Redux\n // on every keystroke. Only `onCommitted` (blur / Enter) writes back to\n // Redux, so callers that use `onCommitted` instead of `onChanged` avoid\n // per-keystroke panel rebuilds.\n const [localValue, setLocalValue] = React.useState<string>(\n type === \"file\" ? \"\" : propValue,\n );\n\n // Sync local value when the prop changes from outside (e.g. when a different\n // card is selected in the playground, resetting the controls panel).\n React.useEffect(() => {\n if (!useFormData && type !== \"file\") {\n setLocalValue(propValue);\n }\n }, [propValue, useFormData, type]);\n\n // Derive the effective value for the controlled <Input>:\n // - inside a form → read from form.formData[name]\n // - standalone → use localValue (updated on every keystroke locally)\n // - file inputs → uncontrolled (no value binding)\n const inputValue =\n type === \"file\"\n ? undefined\n : useFormData\n ? ((form.formData[name!] as string | undefined) ?? \"\")\n : localValue;\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const newValue =\n type === \"file\" ? (e.target.files?.[0]?.name ?? \"\") : e.target.value;\n if (useFormData) {\n form.handleChange(name!, newValue);\n } else {\n setLocalValue(newValue);\n onChanged({name, value: newValue});\n }\n }\n\n // Fire onCommitted when the user leaves the field or presses Enter.\n function handleBlur() {\n if (!useFormData && type !== \"file\") {\n onCommitted({name, value: localValue});\n }\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === \"Enter\" && !useFormData && type !== \"file\") {\n onCommitted({name, value: localValue});\n }\n }\n\n // Use the id injected by pi/field (for label↔control linking); fall back\n // to a locally-generated id when used standalone.\n const selfId = `${cardName}-${name ?? \"input\"}`;\n const fieldId = injectedId ?? selfId;\n\n return (\n <div data-pihanga={cardName} className=\"grid w-full gap-1.5\">\n {label && <Label htmlFor={fieldId}>{label}</Label>}\n <Input\n id={fieldId}\n type={type}\n value={inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled}\n className={className}\n aria-invalid={invalid || undefined}\n aria-describedby={description ? `${fieldId}-desc` : undefined}\n />\n {description && (\n <p id={`${fieldId}-desc`} className=\"text-sm text-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;AAOA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,SACA,OAAO,IAAY,IACnB,UAAO,QACP,gBACA,aACA,UACA,gBACA,cACA,aACA,cACA,mBACE,GAKE,IAAc,EAAwB,IACtC,IAAU,EAAS,EAA8B,SAGjD,IAAO,EAAe,GACtB,IAAc,EAAK,YAAY,EAAQ,GAMvC,CAAC,GAAY,KAAiB,EAAM,SACxC,MAAS,SAAS,KAAK,CACzB;CAIA,EAAM,gBAAgB;EACpB,AAAI,CAAC,KAAe,MAAS,UAC3B,EAAc,CAAS;CAE3B,GAAG;EAAC;EAAW;EAAa;CAAI,CAAC;CAMjC,IAAM,IACJ,MAAS,SACL,KAAA,IACA,IACI,EAAK,SAAS,MAAiC,KACjD;CAER,SAAS,EAAa,GAAwC;EAC5D,IAAM,IACJ,MAAS,SAAU,EAAE,OAAO,QAAQ,IAAI,QAAQ,KAAM,EAAE,OAAO;EACjE,AAAI,IACF,EAAK,aAAa,GAAO,CAAQ,KAEjC,EAAc,CAAQ,GACtB,EAAU;GAAC;GAAM,OAAO;EAAQ,CAAC;CAErC;CAGA,SAAS,IAAa;EACpB,AAAI,CAAC,KAAe,MAAS,UAC3B,EAAY;GAAC;GAAM,OAAO;EAAU,CAAC;CAEzC;CAEA,SAAS,EAAc,GAA0C;EAC/D,AAAI,EAAE,QAAQ,WAAW,CAAC,KAAe,MAAS,UAChD,EAAY;GAAC;GAAM,OAAO;EAAU,CAAC;CAEzC;CAIA,IAAM,IAAS,GAAG,EAAS,GAAG,KAAQ,WAChC,IAAU,KAAc;CAE9B,OACE,kBAAC,OAAD;EAAK,gBAAc;EAAU,WAAU;YAAvC;GACG,KAAS,kBAAC,GAAD;IAAO,SAAS;cAAU;GAAa,CAAA;GACjD,kBAAC,GAAD;IACE,IAAI;IACE;IACN,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACE;IACH;IACC;IACX,gBAAc,KAAW,KAAA;IACzB,oBAAkB,IAAc,GAAG,EAAQ,SAAS,KAAA;GACrD,CAAA;GACA,KACC,kBAAC,KAAD;IAAG,IAAI,GAAG,EAAQ;IAAQ,WAAU;cACjC;GACA,CAAA;EAEF;;AAET"}
@@ -0,0 +1,80 @@
1
+ export declare const PI_INPUT_CARD = "pi/input";
2
+ export declare const PiInput: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<PiInputProps, S, PiInputEvents>) => import('@pihanga2/core').PiCardDef;
3
+ export declare const PI_INPUT_ACTION: {
4
+ CHANGED: string;
5
+ COMMITTED: string;
6
+ };
7
+ export declare const onPiInputChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
8
+ cardID: string;
9
+ } & PiInputChangedEvent>) => void;
10
+ /**
11
+ * Subscribe to "committed" events — fired when the user finishes editing
12
+ * (blur or Enter key). Unlike `onChanged` (which fires on every keystroke),
13
+ * `onCommitted` only fires once per editing session, making it the preferred
14
+ * handler for controlled inputs that trigger expensive downstream work.
15
+ */
16
+ export declare const onPiInputCommitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
17
+ cardID: string;
18
+ } & PiInputCommittedEvent>) => void;
19
+ export type PiInputProps = {
20
+ /**
21
+ * Field name used to bind to FormContext when inside a pi/form card.
22
+ * When provided the component reads its value from form state and writes
23
+ * back via form.handleChange.
24
+ */
25
+ name?: string;
26
+ /**
27
+ * Controlled value used in standalone mode (outside a Form).
28
+ * Ignored when `name` is set and the component is inside a pi/form.
29
+ */
30
+ value?: string;
31
+ /**
32
+ * HTML input type.
33
+ * Common values: "text" | "email" | "password" | "number" | "search" |
34
+ * "url" | "tel" | "date" | "file".
35
+ * Defaults to "text".
36
+ */
37
+ type?: string;
38
+ /** Placeholder text shown when the input is empty. */
39
+ placeholder?: string;
40
+ /** When true, the input is disabled and non-interactive. */
41
+ disabled?: boolean;
42
+ /**
43
+ * Optional label text rendered in a `<label>` element above the input.
44
+ * The label is automatically associated with the input via `htmlFor`.
45
+ */
46
+ label?: string;
47
+ /**
48
+ * Optional helper / description text rendered below the input.
49
+ * Use this for hints, formatting guidance, or validation feedback.
50
+ */
51
+ description?: string;
52
+ /** Extra Tailwind / CSS classes forwarded to the underlying <input> element. */
53
+ className?: string;
54
+ };
55
+ export type PiInputChangedEvent = {
56
+ /** Field name, mirrors the `name` prop if provided. */
57
+ name?: string;
58
+ /** New value after the change. */
59
+ value: string;
60
+ };
61
+ /**
62
+ * Payload for the `onCommitted` event (blur / Enter key).
63
+ * Same shape as `PiInputChangedEvent`.
64
+ */
65
+ export type PiInputCommittedEvent = {
66
+ /** Field name, mirrors the `name` prop if provided. */
67
+ name?: string;
68
+ /** Final committed value. */
69
+ value: string;
70
+ };
71
+ export type PiInputEvents = {
72
+ /** Fires on every keystroke. */
73
+ onChanged: PiInputChangedEvent;
74
+ /**
75
+ * Fires once when the user finishes editing (blur or Enter key).
76
+ * Use this instead of `onChanged` when each change triggers expensive
77
+ * downstream work (e.g. rebuilding a panel).
78
+ */
79
+ onCommitted: PiInputCommittedEvent;
80
+ };
@@ -0,0 +1,7 @@
1
+ import { createCardDeclaration as e, createOnAction as t, registerActions as n } from "@pihanga2/core";
2
+ //#region src/cards/input/input.types.ts
3
+ var r = "pi/input", i = e(r), a = n(r, ["changed", "committed"]), o = t(a.CHANGED), s = t(a.COMMITTED);
4
+ //#endregion
5
+ export { a as PI_INPUT_ACTION, r as PI_INPUT_CARD, i as PiInput, o as onPiInputChanged, s as onPiInputCommitted };
6
+
7
+ //# sourceMappingURL=input.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.types.js","names":[],"sources":["../../../src/cards/input/input.types.ts"],"sourcesContent":["import {\n createCardDeclaration,\n createOnAction,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const PI_INPUT_CARD = \"pi/input\";\n\nexport const PiInput = createCardDeclaration<PiInputProps, PiInputEvents>(\n PI_INPUT_CARD,\n);\n\nexport const PI_INPUT_ACTION = registerActions(PI_INPUT_CARD, [\n \"changed\",\n \"committed\",\n]);\n\nexport const onPiInputChanged = createOnAction<PiInputChangedEvent>(\n PI_INPUT_ACTION.CHANGED,\n);\n\n/**\n * Subscribe to \"committed\" events — fired when the user finishes editing\n * (blur or Enter key). Unlike `onChanged` (which fires on every keystroke),\n * `onCommitted` only fires once per editing session, making it the preferred\n * handler for controlled inputs that trigger expensive downstream work.\n */\nexport const onPiInputCommitted = createOnAction<PiInputCommittedEvent>(\n PI_INPUT_ACTION.COMMITTED,\n);\n\n// ---------------------------------------------------------------------------\n// Props & Events\n// ---------------------------------------------------------------------------\n\nexport type PiInputProps = {\n /**\n * Field name used to bind to FormContext when inside a pi/form card.\n * When provided the component reads its value from form state and writes\n * back via form.handleChange.\n */\n name?: string;\n\n /**\n * Controlled value used in standalone mode (outside a Form).\n * Ignored when `name` is set and the component is inside a pi/form.\n */\n value?: string;\n\n /**\n * HTML input type.\n * Common values: \"text\" | \"email\" | \"password\" | \"number\" | \"search\" |\n * \"url\" | \"tel\" | \"date\" | \"file\".\n * Defaults to \"text\".\n */\n type?: string;\n\n /** Placeholder text shown when the input is empty. */\n placeholder?: string;\n\n /** When true, the input is disabled and non-interactive. */\n disabled?: boolean;\n\n /**\n * Optional label text rendered in a `<label>` element above the input.\n * The label is automatically associated with the input via `htmlFor`.\n */\n label?: string;\n\n /**\n * Optional helper / description text rendered below the input.\n * Use this for hints, formatting guidance, or validation feedback.\n */\n description?: string;\n\n /** Extra Tailwind / CSS classes forwarded to the underlying <input> element. */\n className?: string;\n};\n\nexport type PiInputChangedEvent = {\n /** Field name, mirrors the `name` prop if provided. */\n name?: string;\n /** New value after the change. */\n value: string;\n};\n\n/**\n * Payload for the `onCommitted` event (blur / Enter key).\n * Same shape as `PiInputChangedEvent`.\n */\nexport type PiInputCommittedEvent = {\n /** Field name, mirrors the `name` prop if provided. */\n name?: string;\n /** Final committed value. */\n value: string;\n};\n\nexport type PiInputEvents = {\n /** Fires on every keystroke. */\n onChanged: PiInputChangedEvent;\n /**\n * Fires once when the user finishes editing (blur or Enter key).\n * Use this instead of `onChanged` when each change triggers expensive\n * downstream work (e.g. rebuilding a panel).\n */\n onCommitted: PiInputCommittedEvent;\n};\n"],"mappings":";;AAMA,IAAa,IAAgB,YAEhB,IAAU,EACrB,CACF,GAEa,IAAkB,EAAgB,GAAe,CAC5D,WACA,WACF,CAAC,GAEY,IAAmB,EAC9B,EAAgB,OAClB,GAQa,IAAqB,EAChC,EAAgB,SAClB"}
@@ -0,0 +1 @@
1
+ export * from './jsonViewer.types';
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PiCardProps } from '@pihanga2/core';
3
+ import { JsonViewerProps, JsonViewerEvents } from './jsonViewer.types';
4
+ export declare const JsonViewerComponent: (props: PiCardProps<JsonViewerProps, JsonViewerEvents>) => React.ReactNode;
@@ -0,0 +1,76 @@
1
+ export declare const JSON_VIEWER_CARD = "json-viewer";
2
+ export declare const JsonViewer: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<JsonViewerProps<object>, S, JsonViewerEvents>) => import('@pihanga2/core').PiCardDef;
3
+ export declare const JSON_VIEWER_ACTION: {
4
+ CLICKED: string;
5
+ COPIED: string;
6
+ };
7
+ export declare const onJsonViewerClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
8
+ cardID: string;
9
+ } & ClickedEvent>) => void;
10
+ export declare const onJsonViewerCopied: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
11
+ cardID: string;
12
+ } & CopiedEvent>) => void;
13
+ export type JsonViewerProps<S = object> = {
14
+ /** The JSON value to display. */
15
+ source: unknown;
16
+ /**
17
+ * Theme name. Maps loosely to a visual style.
18
+ * Use "monokai", "solarized", "ocean", etc. (visual only — actual theming
19
+ * is done via className / global CSS since react-json-view-lite uses CSS
20
+ * variables rather than named themes).
21
+ */
22
+ theme?: string;
23
+ iconStyle?: "circle" | "triangle" | "square";
24
+ /**
25
+ * When `true`, all nodes are collapsed.
26
+ * When `false`, all nodes are expanded.
27
+ * When a number N, nodes at depth >= N are collapsed (root is depth 0).
28
+ * Default: 1 (expand root only).
29
+ */
30
+ collapsed?: boolean | number;
31
+ /** When `true`, a click-to-expand interaction is enabled on node labels. */
32
+ enableClipboard?: boolean;
33
+ /** When `true`, removes quotes from object keys in display. */
34
+ removeQuotesOnKeys?: boolean;
35
+ /** When `true`, objects and arrays are labelled with their size. */
36
+ displayObjectSize?: boolean;
37
+ /** When `true`, data-type labels prefix values. */
38
+ displayDataTypes?: boolean;
39
+ /**
40
+ * Called after the JSON is rendered, allowing post-render DOM modifications.
41
+ * Receives the raw `source` value and the container element.
42
+ */
43
+ modifyFn?: ModifyFn;
44
+ /**
45
+ * When `true`, shows a copy-to-clipboard icon button in the top-right
46
+ * corner of the viewer. Clicking it copies the pretty-printed JSON to the
47
+ * clipboard using `ClipboardItem` with `text/plain` MIME type.
48
+ */
49
+ copyToClipboard?: boolean;
50
+ /**
51
+ * Icon name resolved via the global icon registry (`getIconElement`).
52
+ * If omitted or the name is not registered, falls back to the Lucide
53
+ * `Copy` icon automatically.
54
+ *
55
+ * @example
56
+ * // Register your own icon first:
57
+ * registerIcon("my-copy", MyCustomCopyIcon);
58
+ * // Then pass the name to the card:
59
+ * JsonViewer({ copyToClipboard: true, copyIcon: "my-copy", ... })
60
+ */
61
+ copyIcon?: string;
62
+ /** Inline style for the react-json-view-lite container. */
63
+ style?: S;
64
+ /** Additional CSS class for the outer wrapper. */
65
+ className?: string;
66
+ };
67
+ export type ModifyFn = (source: unknown, el: HTMLElement | null) => void;
68
+ export type ClickedEvent = Record<string, never>;
69
+ export type CopiedEvent = {
70
+ /** `true` when the clipboard write succeeded, `false` on error. */
71
+ success: boolean;
72
+ };
73
+ export type JsonViewerEvents = {
74
+ onClicked: ClickedEvent;
75
+ onCopied: CopiedEvent;
76
+ };
@@ -0,0 +1 @@
1
+ export * from './list.types';
@@ -0,0 +1,13 @@
1
+ import { ListComponent as e } from "./list.component.js";
2
+ import { LIST_ACTION as t, LIST_CARD as n, List as r, onListItemClicked as i } from "./list.types.js";
3
+ import { actionTypesToEvents as a, registerCardComponent as o } from "@pihanga2/core";
4
+ //#region src/cards/list/index.ts
5
+ o({
6
+ name: n,
7
+ component: e,
8
+ events: a(t)
9
+ });
10
+ //#endregion
11
+ export { t as LIST_ACTION, n as LIST_CARD, r as List, i as onListItemClicked };
12
+
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/list/index.ts"],"sourcesContent":["import {actionTypesToEvents, registerCardComponent} from \"@pihanga2/core\";\n\nimport {ListComponent} from \"./list.component\";\nimport {LIST_ACTION, LIST_CARD} from \"./list.types\";\n\nexport * from \"./list.types\";\n\nregisterCardComponent({\n name: LIST_CARD,\n component: ListComponent,\n events: actionTypesToEvents(LIST_ACTION),\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;CACX,QAAQ,EAAoB,CAAW;AACzC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PiCardProps } from '@pihanga2/core';
2
+ import { ListEvents, ListProps } from './list.types';
3
+ import * as React from "react";
4
+ export declare const ListComponent: (props: PiCardProps<ListProps, ListEvents>) => React.ReactNode;
@@ -0,0 +1,102 @@
1
+ import { Badge as e } from "../../components/ui/badge.js";
2
+ import { cn as t } from "../../lib/utils.js";
3
+ import { getIcon as n } from "../icons.js";
4
+ import { Avatar as r, AvatarFallback as i, AvatarImage as a } from "../../components/ui/avatar.js";
5
+ import { Card as o } from "@pihanga2/core";
6
+ import * as s from "react";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import { ChevronDown as u } from "lucide-react";
9
+ //#region src/cards/list/list.component.tsx
10
+ var d = {
11
+ sm: "px-2 py-1 text-xs gap-1.5",
12
+ md: "px-2 py-1.5 text-sm gap-2",
13
+ lg: "px-3 py-2 text-base gap-2.5"
14
+ }, f = {
15
+ sm: "text-xs",
16
+ md: "text-xs",
17
+ lg: "text-sm"
18
+ }, p = {
19
+ sm: "size-5",
20
+ md: "size-6",
21
+ lg: "size-7"
22
+ };
23
+ function m(s, u, d) {
24
+ if (!s) return null;
25
+ switch (s.type) {
26
+ case "icon": return /* @__PURE__ */ c("span", {
27
+ className: t("flex shrink-0 items-center [&>svg]:size-4", s.className),
28
+ children: n(s.name)
29
+ });
30
+ case "avatar": return /* @__PURE__ */ l(r, {
31
+ className: t(p[u], s.className),
32
+ children: [/* @__PURE__ */ c(a, { src: s.src }), /* @__PURE__ */ c(i, { children: s.fallback ?? "" })]
33
+ });
34
+ case "chip": return /* @__PURE__ */ c(e, {
35
+ variant: "secondary",
36
+ className: s.className,
37
+ children: s.text
38
+ });
39
+ case "card": return /* @__PURE__ */ c(o, {
40
+ cardName: s.cardName,
41
+ parentCard: d
42
+ });
43
+ default: return null;
44
+ }
45
+ }
46
+ function h({ item: e, size: n, onItemClicked: r, cardName: i }) {
47
+ let [a, o] = s.useState(!1), p = !!e.nested?.length;
48
+ function g() {
49
+ p ? o((e) => !e) : r({ itemID: e.id });
50
+ }
51
+ return /* @__PURE__ */ l("li", { children: [/* @__PURE__ */ l("button", {
52
+ type: "button",
53
+ className: t("flex w-full items-center rounded-sm outline-none transition-colors", "hover:bg-accent hover:text-accent-foreground", "focus-visible:ring-1 focus-visible:ring-ring", e.isSelected && "bg-accent text-accent-foreground font-medium", d[n], e.className),
54
+ onClick: g,
55
+ "aria-expanded": p ? a : void 0,
56
+ "data-selected": e.isSelected || void 0,
57
+ children: [
58
+ m(e.startDecorator, n, i),
59
+ /* @__PURE__ */ l("span", {
60
+ className: "flex min-w-0 flex-1 flex-col items-start",
61
+ children: [/* @__PURE__ */ c("span", {
62
+ className: "truncate leading-none",
63
+ children: e.title
64
+ }), e.subTitle && /* @__PURE__ */ c("span", {
65
+ className: t("mt-0.5 truncate text-muted-foreground", f[n]),
66
+ children: e.subTitle
67
+ })]
68
+ }),
69
+ !p && m(e.endDecorator, n, i),
70
+ p && /* @__PURE__ */ c(u, { className: t("ml-auto size-4 shrink-0 text-muted-foreground transition-transform duration-200", a && "rotate-180") })
71
+ ]
72
+ }), p && a && /* @__PURE__ */ c("ul", {
73
+ className: t("ml-3 mt-0.5 flex flex-col gap-0.5 border-l border-border pl-2", "list-none p-0", n === "lg" ? "ml-4 pl-3" : "ml-3 pl-2"),
74
+ children: e.nested.map((e, t) => /* @__PURE__ */ c(h, {
75
+ item: e,
76
+ size: n,
77
+ onItemClicked: r,
78
+ cardName: i
79
+ }, e.id ?? t))
80
+ })] });
81
+ }
82
+ var g = (e) => {
83
+ let { items: n, size: r = "md", marker: i, className: a, style: o, onItemClicked: s, cardName: l } = e, u = {
84
+ ...o,
85
+ ...i && i !== "none" ? { listStyleType: i } : void 0
86
+ };
87
+ return /* @__PURE__ */ c("ul", {
88
+ className: t("flex flex-col gap-0.5 p-0", i && i !== "none" ? "list-inside" : "list-none", a),
89
+ style: u,
90
+ "data-pihanga": l,
91
+ children: n.map((e, t) => /* @__PURE__ */ c(h, {
92
+ item: e,
93
+ size: r,
94
+ onItemClicked: s,
95
+ cardName: l
96
+ }, e.id ?? t))
97
+ });
98
+ };
99
+ //#endregion
100
+ export { g as ListComponent };
101
+
102
+ //# sourceMappingURL=list.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.component.js","names":[],"sources":["../../../src/cards/list/list.component.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\nimport {ChevronDown} from \"lucide-react\";\nimport {cn} from \"@/lib/utils\";\nimport {Avatar, AvatarFallback, AvatarImage} from \"@/components/ui/avatar\";\nimport {Badge} from \"@/components/ui/badge\";\nimport {getIcon} from \"@/cards/icons\";\nimport type {DecoratorT, ListEvents, ListItem, ListProps} from \"./list.types\";\n\n// ---------------------------------------------------------------------------\n// Size tokens\n// ---------------------------------------------------------------------------\n\n/** Padding + font-size + gap for item buttons */\nconst ITEM_SIZE: Record<\"sm\" | \"md\" | \"lg\", string> = {\n sm: \"px-2 py-1 text-xs gap-1.5\",\n md: \"px-2 py-1.5 text-sm gap-2\",\n lg: \"px-3 py-2 text-base gap-2.5\",\n};\n\n/** Sub-title font-size (one step smaller than title) */\nconst SUB_SIZE: Record<\"sm\" | \"md\" | \"lg\", string> = {\n sm: \"text-xs\",\n md: \"text-xs\",\n lg: \"text-sm\",\n};\n\n/** Avatar size per density */\nconst AVATAR_SIZE: Record<\"sm\" | \"md\" | \"lg\", string> = {\n sm: \"size-5\",\n md: \"size-6\",\n lg: \"size-7\",\n};\n\n// ---------------------------------------------------------------------------\n// Decorator renderer\n// ---------------------------------------------------------------------------\n\nfunction renderDecorator(\n decorator: DecoratorT | undefined,\n size: \"sm\" | \"md\" | \"lg\",\n parentCard: string,\n): React.ReactNode {\n if (!decorator) return null;\n\n switch (decorator.type) {\n case \"icon\":\n return (\n <span\n className={cn(\n \"flex shrink-0 items-center [&>svg]:size-4\",\n decorator.className,\n )}\n >\n {getIcon(decorator.name)}\n </span>\n );\n\n case \"avatar\":\n return (\n <Avatar className={cn(AVATAR_SIZE[size], decorator.className)}>\n <AvatarImage src={decorator.src} />\n <AvatarFallback>{decorator.fallback ?? \"\"}</AvatarFallback>\n </Avatar>\n );\n\n case \"chip\":\n return (\n <Badge variant=\"secondary\" className={decorator.className}>\n {decorator.text}\n </Badge>\n );\n\n case \"card\":\n return <Card cardName={decorator.cardName} parentCard={parentCard} />;\n\n default:\n return null;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Single item row (recursive for nested)\n// ---------------------------------------------------------------------------\n\ntype ItemRowProps = {\n item: ListItem;\n size: \"sm\" | \"md\" | \"lg\";\n onItemClicked: (ev: {itemID: string | number}) => void;\n cardName: string;\n};\n\nfunction ItemRow({\n item,\n size,\n onItemClicked,\n cardName,\n}: ItemRowProps): React.ReactNode {\n const [open, setOpen] = React.useState(false);\n const hasNested = Boolean(item.nested?.length);\n\n function handleClick() {\n if (hasNested) {\n setOpen((prev) => !prev);\n } else {\n onItemClicked({itemID: item.id});\n }\n }\n\n return (\n <li>\n {/* Item button ---------------------------------------------------- */}\n <button\n type=\"button\"\n className={cn(\n \"flex w-full items-center rounded-sm outline-none transition-colors\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:ring-1 focus-visible:ring-ring\",\n item.isSelected && \"bg-accent text-accent-foreground font-medium\",\n ITEM_SIZE[size],\n item.className,\n )}\n onClick={handleClick}\n aria-expanded={hasNested ? open : undefined}\n data-selected={item.isSelected || undefined}\n >\n {/* Start decorator */}\n {renderDecorator(item.startDecorator, size, cardName)}\n\n {/* Title + subtitle */}\n <span className=\"flex min-w-0 flex-1 flex-col items-start\">\n <span className=\"truncate leading-none\">{item.title}</span>\n {item.subTitle && (\n <span\n className={cn(\n \"mt-0.5 truncate text-muted-foreground\",\n SUB_SIZE[size],\n )}\n >\n {item.subTitle}\n </span>\n )}\n </span>\n\n {/* End decorator (suppress if we're showing the chevron) */}\n {!hasNested && renderDecorator(item.endDecorator, size, cardName)}\n\n {/* Expand/collapse chevron for nested items */}\n {hasNested && (\n <ChevronDown\n className={cn(\n \"ml-auto size-4 shrink-0 text-muted-foreground transition-transform duration-200\",\n open && \"rotate-180\",\n )}\n />\n )}\n </button>\n\n {/* Nested list ---------------------------------------------------- */}\n {hasNested && open && (\n <ul\n className={cn(\n \"ml-3 mt-0.5 flex flex-col gap-0.5 border-l border-border pl-2\",\n \"list-none p-0\",\n // keep the indent aligned regardless of density\n size === \"lg\" ? \"ml-4 pl-3\" : \"ml-3 pl-2\",\n )}\n >\n {item.nested!.map((child, idx) => (\n <ItemRow\n key={child.id ?? idx}\n item={child}\n size={size}\n onItemClicked={onItemClicked}\n cardName={cardName}\n />\n ))}\n </ul>\n )}\n </li>\n );\n}\n\n// ---------------------------------------------------------------------------\n// List card component\n// ---------------------------------------------------------------------------\n\nexport const ListComponent = (\n props: PiCardProps<ListProps, ListEvents>,\n): React.ReactNode => {\n const {\n items,\n size = \"md\",\n marker,\n className,\n style,\n onItemClicked,\n cardName,\n } = props;\n\n // When a marker is requested, expose it via CSS custom property so the\n // list-style-type cascade works without a wrapper element.\n const rootStyle: React.CSSProperties = {\n ...style,\n ...(marker && marker !== \"none\" ? {listStyleType: marker} : undefined),\n };\n\n return (\n <ul\n className={cn(\n \"flex flex-col gap-0.5 p-0\",\n marker && marker !== \"none\" ? \"list-inside\" : \"list-none\",\n className,\n )}\n style={rootStyle}\n data-pihanga={cardName}\n >\n {items.map((item, idx) => (\n <ItemRow\n key={item.id ?? idx}\n item={item}\n size={size}\n onItemClicked={onItemClicked}\n cardName={cardName}\n />\n ))}\n </ul>\n );\n};\n"],"mappings":";;;;;;;;;AAcA,IAAM,IAAgD;CACpD,IAAI;CACJ,IAAI;CACJ,IAAI;AACN,GAGM,IAA+C;CACnD,IAAI;CACJ,IAAI;CACJ,IAAI;AACN,GAGM,IAAkD;CACtD,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAMA,SAAS,EACP,GACA,GACA,GACiB;CACjB,IAAI,CAAC,GAAW,OAAO;CAEvB,QAAQ,EAAU,MAAlB;EACE,KAAK,QACH,OACE,kBAAC,QAAD;GACE,WAAW,EACT,6CACA,EAAU,SACZ;aAEC,EAAQ,EAAU,IAAI;EACnB,CAAA;EAGV,KAAK,UACH,OACE,kBAAC,GAAD;GAAQ,WAAW,EAAG,EAAY,IAAO,EAAU,SAAS;aAA5D,CACE,kBAAC,GAAD,EAAa,KAAK,EAAU,IAAM,CAAA,GAClC,kBAAC,GAAD,EAAA,UAAiB,EAAU,YAAY,GAAmB,CAAA,CACpD;;EAGZ,KAAK,QACH,OACE,kBAAC,GAAD;GAAO,SAAQ;GAAY,WAAW,EAAU;aAC7C,EAAU;EACN,CAAA;EAGX,KAAK,QACH,OAAO,kBAAC,GAAD;GAAM,UAAU,EAAU;GAAsB;EAAa,CAAA;EAEtE,SACE,OAAO;CACX;AACF;AAaA,SAAS,EAAQ,EACf,SACA,SACA,kBACA,eACgC;CAChC,IAAM,CAAC,GAAM,KAAW,EAAM,SAAS,EAAK,GACtC,IAAY,EAAQ,EAAK,QAAQ;CAEvC,SAAS,IAAc;EACrB,AAAI,IACF,GAAS,MAAS,CAAC,CAAI,IAEvB,EAAc,EAAC,QAAQ,EAAK,GAAE,CAAC;CAEnC;CAEA,OACE,kBAAC,MAAD,EAAA,UAAA,CAEE,kBAAC,UAAD;EACE,MAAK;EACL,WAAW,EACT,sEACA,gDACA,gDACA,EAAK,cAAc,gDACnB,EAAU,IACV,EAAK,SACP;EACA,SAAS;EACT,iBAAe,IAAY,IAAO,KAAA;EAClC,iBAAe,EAAK,cAAc,KAAA;YAZpC;GAeG,EAAgB,EAAK,gBAAgB,GAAM,CAAQ;GAGpD,kBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,kBAAC,QAAD;KAAM,WAAU;eAAyB,EAAK;IAAY,CAAA,GACzD,EAAK,YACJ,kBAAC,QAAD;KACE,WAAW,EACT,yCACA,EAAS,EACX;eAEC,EAAK;IACF,CAAA,CAEJ;;GAGL,CAAC,KAAa,EAAgB,EAAK,cAAc,GAAM,CAAQ;GAG/D,KACC,kBAAC,GAAD,EACE,WAAW,EACT,mFACA,KAAQ,YACV,EACD,CAAA;EAEG;KAGP,KAAa,KACZ,kBAAC,MAAD;EACE,WAAW,EACT,iEACA,iBAEA,MAAS,OAAO,cAAc,WAChC;YAEC,EAAK,OAAQ,KAAK,GAAO,MACxB,kBAAC,GAAD;GAEE,MAAM;GACA;GACS;GACL;EACX,GALM,EAAM,MAAM,CAKlB,CACF;CACC,CAAA,CAEJ,EAAA,CAAA;AAER;AAMA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,UACA,UAAO,MACP,WACA,cACA,UACA,kBACA,gBACE,GAIE,IAAiC;EACrC,GAAG;EACH,GAAI,KAAU,MAAW,SAAS,EAAC,eAAe,EAAM,IAAI,KAAA;CAC9D;CAEA,OACE,kBAAC,MAAD;EACE,WAAW,EACT,6BACA,KAAU,MAAW,SAAS,gBAAgB,aAC9C,CACF;EACA,OAAO;EACP,gBAAc;YAEb,EAAM,KAAK,GAAM,MAChB,kBAAC,GAAD;GAEQ;GACA;GACS;GACL;EACX,GALM,EAAK,MAAM,CAKjB,CACF;CACC,CAAA;AAER"}
@@ -0,0 +1,65 @@
1
+ import { PiCardRef } from '@pihanga2/core';
2
+ import * as React from "react";
3
+ export declare const LIST_CARD = "shad/list";
4
+ export declare const List: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<ListProps, S, ListEvents>) => import('@pihanga2/core').PiCardDef;
5
+ export declare const LIST_ACTION: {
6
+ ITEM_CLICKED: string;
7
+ };
8
+ export declare const onListItemClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
9
+ cardID: string;
10
+ } & ItemClickedEvent>) => void;
11
+ export type IconDecorator = {
12
+ type: "icon";
13
+ /** Name registered via registerIcon() in src/cards/icons.ts */
14
+ name: string;
15
+ className?: string;
16
+ };
17
+ export type AvatarDecorator = {
18
+ type: "avatar";
19
+ src: string;
20
+ fallback?: string;
21
+ className?: string;
22
+ };
23
+ export type ChipDecorator = {
24
+ type: "chip";
25
+ text: string;
26
+ className?: string;
27
+ };
28
+ export type CardDecorator = {
29
+ type: "card";
30
+ cardName: PiCardRef;
31
+ };
32
+ export type DecoratorT = IconDecorator | AvatarDecorator | ChipDecorator | CardDecorator;
33
+ export type ListItem = {
34
+ /** React key — must be unique within the list. */
35
+ id: string | number;
36
+ isSelected?: boolean;
37
+ title: string;
38
+ subTitle?: string;
39
+ /** When present the item becomes a collapsible parent. */
40
+ nested?: ListItem[];
41
+ startDecorator?: DecoratorT;
42
+ endDecorator?: DecoratorT;
43
+ /** Extra CSS classes on this item's button. */
44
+ className?: string;
45
+ };
46
+ export type ListProps = {
47
+ items: ListItem[];
48
+ /** Visual density — defaults to "md". */
49
+ size?: "sm" | "md" | "lg";
50
+ /**
51
+ * CSS `list-style-type` value (e.g. "disc", "decimal", "none").
52
+ * Defaults to "none" (plain list without markers).
53
+ */
54
+ marker?: string;
55
+ /** CSS classes applied directly to the root `<ul>`. */
56
+ className?: string;
57
+ /** Inline styles applied directly to the root `<ul>`. */
58
+ style?: React.CSSProperties;
59
+ };
60
+ export type ItemClickedEvent = {
61
+ itemID: string | number;
62
+ };
63
+ export type ListEvents = {
64
+ onItemClicked: ItemClickedEvent;
65
+ };
@@ -0,0 +1,7 @@
1
+ import { createCardDeclaration as e, createOnAction as t, registerActions as n } from "@pihanga2/core";
2
+ //#region src/cards/list/list.types.ts
3
+ var r = "shad/list", i = e(r), a = n(r, ["item_clicked"]), o = t(a.ITEM_CLICKED);
4
+ //#endregion
5
+ export { a as LIST_ACTION, r as LIST_CARD, i as List, o as onListItemClicked };
6
+
7
+ //# sourceMappingURL=list.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.types.js","names":[],"sources":["../../../src/cards/list/list.types.ts"],"sourcesContent":["import * as React from \"react\";\nimport {\n PiCardRef,\n createCardDeclaration,\n createOnAction,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const LIST_CARD = \"shad/list\";\n\nexport const List = createCardDeclaration<ListProps, ListEvents>(LIST_CARD);\n\nexport const LIST_ACTION = registerActions(LIST_CARD, [\"item_clicked\"]);\n\nexport const onListItemClicked = createOnAction<ItemClickedEvent>(\n LIST_ACTION.ITEM_CLICKED,\n);\n\n// Decorator shown before or after an item's title/subtitle block.\nexport type IconDecorator = {\n type: \"icon\";\n /** Name registered via registerIcon() in src/cards/icons.ts */\n name: string;\n className?: string;\n};\n\nexport type AvatarDecorator = {\n type: \"avatar\";\n src: string;\n fallback?: string;\n className?: string;\n};\n\nexport type ChipDecorator = {\n type: \"chip\";\n text: string;\n className?: string;\n};\n\nexport type CardDecorator = {\n type: \"card\";\n cardName: PiCardRef;\n};\n\nexport type DecoratorT =\n | IconDecorator\n | AvatarDecorator\n | ChipDecorator\n | CardDecorator;\n\nexport type ListItem = {\n /** React key — must be unique within the list. */\n id: string | number;\n isSelected?: boolean;\n title: string;\n subTitle?: string;\n /** When present the item becomes a collapsible parent. */\n nested?: ListItem[];\n startDecorator?: DecoratorT;\n endDecorator?: DecoratorT;\n /** Extra CSS classes on this item's button. */\n className?: string;\n};\n\nexport type ListProps = {\n items: ListItem[];\n /** Visual density — defaults to \"md\". */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * CSS `list-style-type` value (e.g. \"disc\", \"decimal\", \"none\").\n * Defaults to \"none\" (plain list without markers).\n */\n marker?: string;\n /** CSS classes applied directly to the root `<ul>`. */\n className?: string;\n /** Inline styles applied directly to the root `<ul>`. */\n style?: React.CSSProperties;\n};\n\nexport type ItemClickedEvent = {\n itemID: string | number;\n};\n\nexport type ListEvents = {\n onItemClicked: ItemClickedEvent;\n};\n"],"mappings":";;AAQA,IAAa,IAAY,aAEZ,IAAO,EAA6C,CAAS,GAE7D,IAAc,EAAgB,GAAW,CAAC,cAAc,CAAC,GAEzD,IAAoB,EAC/B,EAAY,YACd"}
@@ -0,0 +1 @@
1
+ export * from './loadingOverlay.types';
@@ -0,0 +1,12 @@
1
+ import { LoadingOverlayComponent as e } from "./loadingOverlay.component.js";
2
+ import { LOADING_OVERLAY_CARD as t, LoadingOverlay as n } from "./loadingOverlay.types.js";
3
+ import { registerCardComponent as r } from "@pihanga2/core";
4
+ //#region src/cards/loadingOverlay/index.ts
5
+ r({
6
+ name: t,
7
+ component: e
8
+ });
9
+ //#endregion
10
+ export { t as LOADING_OVERLAY_CARD, n as LoadingOverlay };
11
+
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/loadingOverlay/index.ts"],"sourcesContent":["import {registerCardComponent} from \"@pihanga2/core\";\n\nimport {LoadingOverlayComponent} from \"./loadingOverlay.component\";\nimport {LOADING_OVERLAY_CARD} from \"./loadingOverlay.types\";\n\nexport * from \"./loadingOverlay.types\";\n\nregisterCardComponent({\n name: LOADING_OVERLAY_CARD,\n component: LoadingOverlayComponent,\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PiCardProps } from '@pihanga2/core';
2
+ import { LoadingOverlayProps } from './loadingOverlay.types';
3
+ import * as React from "react";
4
+ export declare const LoadingOverlayComponent: (props: PiCardProps<LoadingOverlayProps>) => React.ReactNode;
@@ -0,0 +1,31 @@
1
+ import { Spinner as e } from "../../components/ui/spinner.js";
2
+ /* empty css */
3
+ import { Card as t } from "@pihanga2/core";
4
+ import "react";
5
+ import n from "clsx";
6
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
7
+ //#region src/cards/loadingOverlay/loadingOverlay.component.tsx
8
+ var a = (a) => {
9
+ let { cardName: o, content: s, isLoading: c, label: l, fillParent: u, viewportCentered: d, className: f, contentClassName: p, overlayClassName: m } = a;
10
+ return s ? /* @__PURE__ */ r("div", {
11
+ "data-pihanga": o,
12
+ className: n("overlay-wrapper", c && "is-loading", u && "fill-parent", d && "viewport-centered", f),
13
+ children: /* @__PURE__ */ i("div", {
14
+ className: n("overlay-content", p),
15
+ children: [/* @__PURE__ */ r(t, {
16
+ cardName: s,
17
+ parentCard: o
18
+ }), /* @__PURE__ */ r("div", {
19
+ className: n("loading-overlay", m),
20
+ children: /* @__PURE__ */ i("div", {
21
+ className: "loading-overlay__content",
22
+ children: [/* @__PURE__ */ r(e, { size: "icon" }), /* @__PURE__ */ r("span", { children: l ?? "Loading..." })]
23
+ })
24
+ })]
25
+ })
26
+ }) : null;
27
+ };
28
+ //#endregion
29
+ export { a as LoadingOverlayComponent };
30
+
31
+ //# sourceMappingURL=loadingOverlay.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadingOverlay.component.js","names":[],"sources":["../../../src/cards/loadingOverlay/loadingOverlay.component.tsx"],"sourcesContent":["import * as React from \"react\";\nimport clsx from \"clsx\";\n\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\n\nimport {Spinner} from \"@/registry/ui/spinner\";\n\nimport type {LoadingOverlayProps} from \"./loadingOverlay.types\";\nimport \"./loadingOverlay.css\";\n\nexport const LoadingOverlayComponent = (\n props: PiCardProps<LoadingOverlayProps>,\n): React.ReactNode => {\n const {\n cardName,\n content,\n isLoading,\n label,\n fillParent,\n viewportCentered,\n className,\n contentClassName,\n overlayClassName,\n } = props;\n\n if (!content) return null;\n\n return (\n <div\n data-pihanga={cardName}\n className={clsx(\n \"overlay-wrapper\",\n isLoading && \"is-loading\",\n fillParent && \"fill-parent\",\n viewportCentered && \"viewport-centered\",\n className,\n )}\n >\n <div className={clsx(\"overlay-content\", contentClassName)}>\n <Card cardName={content} parentCard={cardName} />\n <div className={clsx(\"loading-overlay\", overlayClassName)}>\n <div className=\"loading-overlay__content\">\n <Spinner size=\"icon\" />\n <span>{label ?? \"Loading...\"}</span>\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAUA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,aACA,YACA,cACA,UACA,eACA,qBACA,cACA,qBACA,wBACE;CAIJ,OAFK,IAGH,kBAAC,OAAD;EACE,gBAAc;EACd,WAAW,EACT,mBACA,KAAa,cACb,KAAc,eACd,KAAoB,qBACpB,CACF;YAEA,kBAAC,OAAD;GAAK,WAAW,EAAK,mBAAmB,CAAgB;aAAxD,CACE,kBAAC,GAAD;IAAM,UAAU;IAAS,YAAY;GAAW,CAAA,GAChD,kBAAC,OAAD;IAAK,WAAW,EAAK,mBAAmB,CAAgB;cACtD,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD,EAAS,MAAK,OAAQ,CAAA,GACtB,kBAAC,QAAD,EAAA,UAAO,KAAS,aAAmB,CAAA,CAChC;;GACF,CAAA,CACF;;CACF,CAAA,IAtBc;AAwBvB"}
@@ -0,0 +1,13 @@
1
+ import { PiCardRef } from '@pihanga2/core';
2
+ export declare const LOADING_OVERLAY_CARD = "loading-overlay";
3
+ export type LoadingOverlayProps = {
4
+ content: PiCardRef;
5
+ isLoading?: boolean;
6
+ label?: string;
7
+ fillParent?: boolean;
8
+ viewportCentered?: boolean;
9
+ className?: string;
10
+ contentClassName?: string;
11
+ overlayClassName?: string;
12
+ };
13
+ export declare const LoadingOverlay: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<LoadingOverlayProps, S, {}>) => import('@pihanga2/core').PiCardDef;
@@ -0,0 +1,7 @@
1
+ import { createCardDeclaration as e } from "@pihanga2/core";
2
+ //#region src/cards/loadingOverlay/loadingOverlay.types.ts
3
+ var t = "loading-overlay", n = e(t);
4
+ //#endregion
5
+ export { t as LOADING_OVERLAY_CARD, n as LoadingOverlay };
6
+
7
+ //# sourceMappingURL=loadingOverlay.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadingOverlay.types.js","names":[],"sources":["../../../src/cards/loadingOverlay/loadingOverlay.types.ts"],"sourcesContent":["import {createCardDeclaration, type PiCardRef} from \"@pihanga2/core\";\n\nexport const LOADING_OVERLAY_CARD = \"loading-overlay\";\n\nexport type LoadingOverlayProps = {\n content: PiCardRef;\n isLoading?: boolean;\n label?: string;\n fillParent?: boolean;\n viewportCentered?: boolean;\n className?: string;\n contentClassName?: string;\n overlayClassName?: string;\n};\n\nexport const LoadingOverlay = createCardDeclaration<LoadingOverlayProps>(\n LOADING_OVERLAY_CARD,\n);\n"],"mappings":";;AAEA,IAAa,IAAuB,mBAavB,IAAiB,EAC5B,CACF"}
@@ -0,0 +1 @@
1
+ export * from './loading-skeleton.types';
@@ -0,0 +1,12 @@
1
+ import { LoadingSkeletonComponent as e } from "./loading-skeleton.component.js";
2
+ import { LOADING_SKELETON_CARD as t, LoadingSkeleton as n } from "./loading-skeleton.types.js";
3
+ import { registerCardComponent as r } from "@pihanga2/core";
4
+ //#region src/cards/loadingSkeleton/index.ts
5
+ r({
6
+ name: t,
7
+ component: e
8
+ });
9
+ //#endregion
10
+ export { t as LOADING_SKELETON_CARD, n as LoadingSkeleton };
11
+
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/loadingSkeleton/index.ts"],"sourcesContent":["import {registerCardComponent} from \"@pihanga2/core\";\nimport {LoadingSkeletonComponent} from \"./loading-skeleton.component\";\nimport {LOADING_SKELETON_CARD} from \"./loading-skeleton.types\";\n\nexport * from \"./loading-skeleton.types\";\n\n// No events — display-only card.\nregisterCardComponent({\n name: LOADING_SKELETON_CARD,\n component: LoadingSkeletonComponent,\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC"}