@prismora/elements 0.0.0-stage → 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 (393) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -2
  3. package/components.json +15600 -0
  4. package/custom-elements.json +56320 -0
  5. package/dist/base.d.ts +42 -0
  6. package/dist/base.js +62 -0
  7. package/dist/catalog.d.ts +33 -0
  8. package/dist/catalog.js +803 -0
  9. package/dist/components/accordion.d.ts +31 -0
  10. package/dist/components/accordion.js +63 -0
  11. package/dist/components/alert.d.ts +27 -0
  12. package/dist/components/alert.js +40 -0
  13. package/dist/components/avatar-group.d.ts +23 -0
  14. package/dist/components/avatar-group.js +43 -0
  15. package/dist/components/avatar.d.ts +24 -0
  16. package/dist/components/avatar.js +43 -0
  17. package/dist/components/back-to-top.d.ts +32 -0
  18. package/dist/components/back-to-top.js +50 -0
  19. package/dist/components/badge.d.ts +17 -0
  20. package/dist/components/badge.js +20 -0
  21. package/dist/components/banner.d.ts +34 -0
  22. package/dist/components/banner.js +54 -0
  23. package/dist/components/breadcrumb.d.ts +42 -0
  24. package/dist/components/breadcrumb.js +63 -0
  25. package/dist/components/button-group.d.ts +14 -0
  26. package/dist/components/button-group.js +28 -0
  27. package/dist/components/button.d.ts +59 -0
  28. package/dist/components/button.js +162 -0
  29. package/dist/components/calendar.d.ts +48 -0
  30. package/dist/components/calendar.js +296 -0
  31. package/dist/components/card.d.ts +23 -0
  32. package/dist/components/card.js +44 -0
  33. package/dist/components/carousel.d.ts +41 -0
  34. package/dist/components/carousel.js +156 -0
  35. package/dist/components/cascader.d.ts +70 -0
  36. package/dist/components/cascader.js +220 -0
  37. package/dist/components/chart.d.ts +59 -0
  38. package/dist/components/chart.js +267 -0
  39. package/dist/components/chat.d.ts +98 -0
  40. package/dist/components/chat.js +134 -0
  41. package/dist/components/checkbox-group.d.ts +48 -0
  42. package/dist/components/checkbox-group.js +111 -0
  43. package/dist/components/checkbox.d.ts +23 -0
  44. package/dist/components/checkbox.js +70 -0
  45. package/dist/components/code-block.d.ts +46 -0
  46. package/dist/components/code-block.js +86 -0
  47. package/dist/components/color-picker.d.ts +46 -0
  48. package/dist/components/color-picker.js +292 -0
  49. package/dist/components/combobox.d.ts +89 -0
  50. package/dist/components/combobox.js +384 -0
  51. package/dist/components/command.d.ts +96 -0
  52. package/dist/components/command.js +289 -0
  53. package/dist/components/context-menu.d.ts +23 -0
  54. package/dist/components/context-menu.js +110 -0
  55. package/dist/components/copy-button.d.ts +33 -0
  56. package/dist/components/copy-button.js +62 -0
  57. package/dist/components/countdown.d.ts +36 -0
  58. package/dist/components/countdown.js +56 -0
  59. package/dist/components/data-table.d.ts +180 -0
  60. package/dist/components/data-table.js +1060 -0
  61. package/dist/components/date-picker.d.ts +47 -0
  62. package/dist/components/date-picker.js +267 -0
  63. package/dist/components/description-list.d.ts +38 -0
  64. package/dist/components/description-list.js +41 -0
  65. package/dist/components/dialog.d.ts +47 -0
  66. package/dist/components/dialog.js +189 -0
  67. package/dist/components/divider.d.ts +16 -0
  68. package/dist/components/divider.js +23 -0
  69. package/dist/components/drawer.d.ts +19 -0
  70. package/dist/components/drawer.js +27 -0
  71. package/dist/components/editor.d.ts +50 -0
  72. package/dist/components/editor.js +474 -0
  73. package/dist/components/empty-state.d.ts +24 -0
  74. package/dist/components/empty-state.js +27 -0
  75. package/dist/components/file-upload.d.ts +56 -0
  76. package/dist/components/file-upload.js +176 -0
  77. package/dist/components/form-control.d.ts +69 -0
  78. package/dist/components/form-control.js +134 -0
  79. package/dist/components/form.d.ts +38 -0
  80. package/dist/components/form.js +161 -0
  81. package/dist/components/format-number.d.ts +37 -0
  82. package/dist/components/format-number.js +86 -0
  83. package/dist/components/icon.d.ts +34 -0
  84. package/dist/components/icon.js +47 -0
  85. package/dist/components/image.d.ts +44 -0
  86. package/dist/components/image.js +53 -0
  87. package/dist/components/indicator.d.ts +41 -0
  88. package/dist/components/indicator.js +65 -0
  89. package/dist/components/inline-edit.d.ts +45 -0
  90. package/dist/components/inline-edit.js +129 -0
  91. package/dist/components/input.d.ts +55 -0
  92. package/dist/components/input.js +186 -0
  93. package/dist/components/kbd.d.ts +15 -0
  94. package/dist/components/kbd.js +18 -0
  95. package/dist/components/list.d.ts +68 -0
  96. package/dist/components/list.js +180 -0
  97. package/dist/components/menu.d.ts +22 -0
  98. package/dist/components/menu.js +182 -0
  99. package/dist/components/menubar.d.ts +20 -0
  100. package/dist/components/menubar.js +120 -0
  101. package/dist/components/meter.d.ts +38 -0
  102. package/dist/components/meter.js +48 -0
  103. package/dist/components/nav.d.ts +91 -0
  104. package/dist/components/nav.js +228 -0
  105. package/dist/components/number-input.d.ts +26 -0
  106. package/dist/components/number-input.js +70 -0
  107. package/dist/components/pagination.d.ts +44 -0
  108. package/dist/components/pagination.js +94 -0
  109. package/dist/components/pin-input.d.ts +25 -0
  110. package/dist/components/pin-input.js +128 -0
  111. package/dist/components/popover.d.ts +23 -0
  112. package/dist/components/popover.js +140 -0
  113. package/dist/components/progress.d.ts +26 -0
  114. package/dist/components/progress.js +66 -0
  115. package/dist/components/pull-refresh.d.ts +41 -0
  116. package/dist/components/pull-refresh.js +101 -0
  117. package/dist/components/qr-code.d.ts +33 -0
  118. package/dist/components/qr-code.js +54 -0
  119. package/dist/components/radio-group.d.ts +37 -0
  120. package/dist/components/radio-group.js +82 -0
  121. package/dist/components/range-slider.d.ts +46 -0
  122. package/dist/components/range-slider.js +95 -0
  123. package/dist/components/rating.d.ts +38 -0
  124. package/dist/components/rating.js +80 -0
  125. package/dist/components/relative-time.d.ts +31 -0
  126. package/dist/components/relative-time.js +51 -0
  127. package/dist/components/scheduler.d.ts +84 -0
  128. package/dist/components/scheduler.js +187 -0
  129. package/dist/components/segmented.d.ts +58 -0
  130. package/dist/components/segmented.js +129 -0
  131. package/dist/components/select.d.ts +62 -0
  132. package/dist/components/select.js +140 -0
  133. package/dist/components/share-button.d.ts +37 -0
  134. package/dist/components/share-button.js +60 -0
  135. package/dist/components/signature.d.ts +54 -0
  136. package/dist/components/signature.js +152 -0
  137. package/dist/components/skeleton.d.ts +21 -0
  138. package/dist/components/skeleton.js +26 -0
  139. package/dist/components/slider.d.ts +31 -0
  140. package/dist/components/slider.js +80 -0
  141. package/dist/components/sortable.d.ts +22 -0
  142. package/dist/components/sortable.js +196 -0
  143. package/dist/components/sparkline.d.ts +28 -0
  144. package/dist/components/sparkline.js +46 -0
  145. package/dist/components/spinner.d.ts +16 -0
  146. package/dist/components/spinner.js +22 -0
  147. package/dist/components/splitter.d.ts +28 -0
  148. package/dist/components/splitter.js +89 -0
  149. package/dist/components/stat.d.ts +28 -0
  150. package/dist/components/stat.js +33 -0
  151. package/dist/components/steps.d.ts +53 -0
  152. package/dist/components/steps.js +91 -0
  153. package/dist/components/switch.d.ts +12 -0
  154. package/dist/components/switch.js +18 -0
  155. package/dist/components/table.d.ts +58 -0
  156. package/dist/components/table.js +96 -0
  157. package/dist/components/tabs.d.ts +62 -0
  158. package/dist/components/tabs.js +310 -0
  159. package/dist/components/tag.d.ts +32 -0
  160. package/dist/components/tag.js +58 -0
  161. package/dist/components/textarea.d.ts +25 -0
  162. package/dist/components/textarea.js +56 -0
  163. package/dist/components/theme-switch.d.ts +51 -0
  164. package/dist/components/theme-switch.js +85 -0
  165. package/dist/components/time-picker.d.ts +39 -0
  166. package/dist/components/time-picker.js +257 -0
  167. package/dist/components/timeline.d.ts +38 -0
  168. package/dist/components/timeline.js +56 -0
  169. package/dist/components/toaster.d.ts +25 -0
  170. package/dist/components/toaster.js +44 -0
  171. package/dist/components/toggle-group.d.ts +70 -0
  172. package/dist/components/toggle-group.js +172 -0
  173. package/dist/components/toolbar.d.ts +23 -0
  174. package/dist/components/toolbar.js +81 -0
  175. package/dist/components/tooltip.d.ts +18 -0
  176. package/dist/components/tooltip.js +92 -0
  177. package/dist/components/tour.d.ts +41 -0
  178. package/dist/components/tour.js +197 -0
  179. package/dist/components/transfer.d.ts +57 -0
  180. package/dist/components/transfer.js +161 -0
  181. package/dist/components/tree-select.d.ts +66 -0
  182. package/dist/components/tree-select.js +282 -0
  183. package/dist/components/tree.d.ts +129 -0
  184. package/dist/components/tree.js +427 -0
  185. package/dist/components/virtual-list.d.ts +41 -0
  186. package/dist/components/virtual-list.js +77 -0
  187. package/dist/confirm.d.ts +21 -0
  188. package/dist/confirm.js +69 -0
  189. package/dist/count.d.ts +5 -0
  190. package/dist/count.js +12 -0
  191. package/dist/data-table/icons.d.ts +8 -0
  192. package/dist/data-table/icons.js +10 -0
  193. package/dist/data-table/logic.d.ts +33 -0
  194. package/dist/data-table/logic.js +141 -0
  195. package/dist/data-table/strings.d.ts +37 -0
  196. package/dist/data-table/strings.js +36 -0
  197. package/dist/data-table/types.d.ts +76 -0
  198. package/dist/data-table/types.js +1 -0
  199. package/dist/define.d.ts +2 -0
  200. package/dist/define.js +2 -0
  201. package/dist/field-validity.d.ts +42 -0
  202. package/dist/field-validity.js +58 -0
  203. package/dist/floating.d.ts +13 -0
  204. package/dist/floating.js +65 -0
  205. package/dist/highlight.d.ts +11 -0
  206. package/dist/highlight.js +103 -0
  207. package/dist/id.d.ts +2 -0
  208. package/dist/id.js +3 -0
  209. package/dist/index.d.ts +102 -0
  210. package/dist/index.js +102 -0
  211. package/dist/manifest.d.ts +51 -0
  212. package/dist/manifest.js +11 -0
  213. package/dist/named-icon.d.ts +8 -0
  214. package/dist/named-icon.js +8 -0
  215. package/dist/patterns/account.d.ts +6 -0
  216. package/dist/patterns/account.js +137 -0
  217. package/dist/patterns/app.d.ts +7 -0
  218. package/dist/patterns/app.js +351 -0
  219. package/dist/patterns/commerce.d.ts +4 -0
  220. package/dist/patterns/commerce.js +200 -0
  221. package/dist/patterns/flows.d.ts +3 -0
  222. package/dist/patterns/flows.js +100 -0
  223. package/dist/patterns/index.d.ts +9 -0
  224. package/dist/patterns/index.js +29 -0
  225. package/dist/patterns/marketing.d.ts +4 -0
  226. package/dist/patterns/marketing.js +173 -0
  227. package/dist/patterns/more.d.ts +15 -0
  228. package/dist/patterns/more.js +581 -0
  229. package/dist/patterns/shell.d.ts +9 -0
  230. package/dist/patterns/shell.js +48 -0
  231. package/dist/patterns/types.d.ts +19 -0
  232. package/dist/patterns/types.js +1 -0
  233. package/dist/position.d.ts +2 -0
  234. package/dist/position.js +33 -0
  235. package/dist/prismora.standalone.js +5222 -0
  236. package/dist/prismora.standalone.js.map +199 -0
  237. package/dist/qr.d.ts +14 -0
  238. package/dist/qr.js +258 -0
  239. package/dist/register.d.ts +8 -0
  240. package/dist/register.js +21 -0
  241. package/dist/registry.d.ts +203 -0
  242. package/dist/registry.js +203 -0
  243. package/dist/remote.d.ts +58 -0
  244. package/dist/remote.js +130 -0
  245. package/dist/sheet.d.ts +34 -0
  246. package/dist/sheet.js +153 -0
  247. package/dist/styles/accordion.d.ts +2 -0
  248. package/dist/styles/accordion.js +3 -0
  249. package/dist/styles/alert.d.ts +2 -0
  250. package/dist/styles/alert.js +3 -0
  251. package/dist/styles/avatar.d.ts +2 -0
  252. package/dist/styles/avatar.js +3 -0
  253. package/dist/styles/badge.d.ts +2 -0
  254. package/dist/styles/badge.js +3 -0
  255. package/dist/styles/banner.d.ts +2 -0
  256. package/dist/styles/banner.js +3 -0
  257. package/dist/styles/breadcrumb.d.ts +2 -0
  258. package/dist/styles/breadcrumb.js +3 -0
  259. package/dist/styles/button.d.ts +2 -0
  260. package/dist/styles/button.js +3 -0
  261. package/dist/styles/calendar.d.ts +2 -0
  262. package/dist/styles/calendar.js +3 -0
  263. package/dist/styles/card.d.ts +2 -0
  264. package/dist/styles/card.js +3 -0
  265. package/dist/styles/carousel.d.ts +2 -0
  266. package/dist/styles/carousel.js +3 -0
  267. package/dist/styles/chart.d.ts +2 -0
  268. package/dist/styles/chart.js +3 -0
  269. package/dist/styles/chat.d.ts +2 -0
  270. package/dist/styles/chat.js +3 -0
  271. package/dist/styles/checkbox.d.ts +2 -0
  272. package/dist/styles/checkbox.js +3 -0
  273. package/dist/styles/color-picker.d.ts +2 -0
  274. package/dist/styles/color-picker.js +3 -0
  275. package/dist/styles/combobox.d.ts +2 -0
  276. package/dist/styles/combobox.js +3 -0
  277. package/dist/styles/command.d.ts +2 -0
  278. package/dist/styles/command.js +3 -0
  279. package/dist/styles/data-table.d.ts +2 -0
  280. package/dist/styles/data-table.js +3 -0
  281. package/dist/styles/description-list.d.ts +2 -0
  282. package/dist/styles/description-list.js +3 -0
  283. package/dist/styles/dialog.d.ts +2 -0
  284. package/dist/styles/dialog.js +3 -0
  285. package/dist/styles/drawer.d.ts +2 -0
  286. package/dist/styles/drawer.js +3 -0
  287. package/dist/styles/editor.d.ts +2 -0
  288. package/dist/styles/editor.js +3 -0
  289. package/dist/styles/empty-state.d.ts +2 -0
  290. package/dist/styles/empty-state.js +3 -0
  291. package/dist/styles/extras.d.ts +2 -0
  292. package/dist/styles/extras.js +3 -0
  293. package/dist/styles/field.d.ts +2 -0
  294. package/dist/styles/field.js +3 -0
  295. package/dist/styles/file-upload.d.ts +2 -0
  296. package/dist/styles/file-upload.js +3 -0
  297. package/dist/styles/foundation.d.ts +2 -0
  298. package/dist/styles/foundation.js +3 -0
  299. package/dist/styles/helpers.d.ts +2 -0
  300. package/dist/styles/helpers.js +3 -0
  301. package/dist/styles/icon.d.ts +2 -0
  302. package/dist/styles/icon.js +3 -0
  303. package/dist/styles/image.d.ts +2 -0
  304. package/dist/styles/image.js +3 -0
  305. package/dist/styles/indicator.d.ts +2 -0
  306. package/dist/styles/indicator.js +3 -0
  307. package/dist/styles/input.d.ts +2 -0
  308. package/dist/styles/input.js +3 -0
  309. package/dist/styles/kbd.d.ts +2 -0
  310. package/dist/styles/kbd.js +3 -0
  311. package/dist/styles/list.d.ts +2 -0
  312. package/dist/styles/list.js +3 -0
  313. package/dist/styles/listbox.d.ts +2 -0
  314. package/dist/styles/listbox.js +3 -0
  315. package/dist/styles/meter.d.ts +2 -0
  316. package/dist/styles/meter.js +3 -0
  317. package/dist/styles/nav.d.ts +2 -0
  318. package/dist/styles/nav.js +3 -0
  319. package/dist/styles/number-input.d.ts +2 -0
  320. package/dist/styles/number-input.js +3 -0
  321. package/dist/styles/overlay.d.ts +2 -0
  322. package/dist/styles/overlay.js +3 -0
  323. package/dist/styles/pagination.d.ts +2 -0
  324. package/dist/styles/pagination.js +3 -0
  325. package/dist/styles/pickers.d.ts +2 -0
  326. package/dist/styles/pickers.js +3 -0
  327. package/dist/styles/pin-input.d.ts +2 -0
  328. package/dist/styles/pin-input.js +3 -0
  329. package/dist/styles/popover.d.ts +2 -0
  330. package/dist/styles/popover.js +3 -0
  331. package/dist/styles/progress.d.ts +2 -0
  332. package/dist/styles/progress.js +3 -0
  333. package/dist/styles/pull-refresh.d.ts +2 -0
  334. package/dist/styles/pull-refresh.js +3 -0
  335. package/dist/styles/range-slider.d.ts +2 -0
  336. package/dist/styles/range-slider.js +3 -0
  337. package/dist/styles/rating.d.ts +2 -0
  338. package/dist/styles/rating.js +3 -0
  339. package/dist/styles/scheduler.d.ts +2 -0
  340. package/dist/styles/scheduler.js +3 -0
  341. package/dist/styles/segmented.d.ts +2 -0
  342. package/dist/styles/segmented.js +3 -0
  343. package/dist/styles/select.d.ts +2 -0
  344. package/dist/styles/select.js +3 -0
  345. package/dist/styles/separator.d.ts +2 -0
  346. package/dist/styles/separator.js +3 -0
  347. package/dist/styles/sheet.d.ts +2 -0
  348. package/dist/styles/sheet.js +3 -0
  349. package/dist/styles/skeleton.d.ts +2 -0
  350. package/dist/styles/skeleton.js +3 -0
  351. package/dist/styles/slider.d.ts +2 -0
  352. package/dist/styles/slider.js +3 -0
  353. package/dist/styles/sortable.d.ts +2 -0
  354. package/dist/styles/sortable.js +3 -0
  355. package/dist/styles/spinner.d.ts +2 -0
  356. package/dist/styles/spinner.js +3 -0
  357. package/dist/styles/splitter.d.ts +2 -0
  358. package/dist/styles/splitter.js +3 -0
  359. package/dist/styles/stat.d.ts +2 -0
  360. package/dist/styles/stat.js +3 -0
  361. package/dist/styles/steps.d.ts +2 -0
  362. package/dist/styles/steps.js +3 -0
  363. package/dist/styles/surface.d.ts +2 -0
  364. package/dist/styles/surface.js +3 -0
  365. package/dist/styles/switch.d.ts +2 -0
  366. package/dist/styles/switch.js +3 -0
  367. package/dist/styles/table.d.ts +2 -0
  368. package/dist/styles/table.js +3 -0
  369. package/dist/styles/tabs.d.ts +2 -0
  370. package/dist/styles/tabs.js +3 -0
  371. package/dist/styles/tag.d.ts +2 -0
  372. package/dist/styles/tag.js +3 -0
  373. package/dist/styles/time-picker.d.ts +2 -0
  374. package/dist/styles/time-picker.js +3 -0
  375. package/dist/styles/timeline.d.ts +2 -0
  376. package/dist/styles/timeline.js +3 -0
  377. package/dist/styles/toast.d.ts +2 -0
  378. package/dist/styles/toast.js +3 -0
  379. package/dist/styles/toggle.d.ts +2 -0
  380. package/dist/styles/toggle.js +3 -0
  381. package/dist/styles/toolbar.d.ts +2 -0
  382. package/dist/styles/toolbar.js +3 -0
  383. package/dist/styles/tooltip.d.ts +2 -0
  384. package/dist/styles/tooltip.js +3 -0
  385. package/dist/styles/tree.d.ts +2 -0
  386. package/dist/styles/tree.js +3 -0
  387. package/dist/table-core.d.ts +75 -0
  388. package/dist/table-core.js +205 -0
  389. package/dist/toast.d.ts +42 -0
  390. package/dist/toast.js +206 -0
  391. package/dist/top-layer.d.ts +4 -0
  392. package/dist/top-layer.js +33 -0
  393. package/package.json +101 -4
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Shared by <pm-table> (basic) and <pm-data-table> (advanced): column type, natural sorting and locale formatting.
3
+ * Kept small and free of side effects so the basic table stays light.
4
+ */
5
+ import { html } from 'lit';
6
+ const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' });
7
+ /** Natural, case-insensitive compare; empty values sort last. */
8
+ export function compare(a, b) {
9
+ if (a == null || a === '')
10
+ return b == null || b === '' ? 0 : 1;
11
+ if (b == null || b === '')
12
+ return -1;
13
+ if (a instanceof Date && b instanceof Date)
14
+ return a.getTime() - b.getTime();
15
+ if (typeof a === 'number' && typeof b === 'number')
16
+ return a - b;
17
+ if (typeof a === 'boolean' && typeof b === 'boolean')
18
+ return Number(a) - Number(b);
19
+ return collator.compare(String(a), String(b));
20
+ }
21
+ /** Sort rows by several keys (stable). */
22
+ export function sortRows(rows, sorts, columns, first) {
23
+ const getters = sorts.map((s) => {
24
+ const c = columns.find((x) => x.key === s.key);
25
+ return [c?.sortValue ?? ((r) => r[s.key]), s.direction === 'desc' ? -1 : 1];
26
+ });
27
+ if (!getters.length && !first)
28
+ return rows;
29
+ return [...rows].sort((a, b) => {
30
+ const f = first?.(a, b);
31
+ if (f)
32
+ return f;
33
+ for (const [get, m] of getters) {
34
+ const d = compare(get(a), get(b));
35
+ if (d)
36
+ return d * m;
37
+ }
38
+ return 0;
39
+ });
40
+ }
41
+ const fmtCache = new Map();
42
+ function fmt(locale, type, currency, extra) {
43
+ const id = `${locale}|${type}|${currency}|${extra ? JSON.stringify(extra) : ''}`;
44
+ let f = fmtCache.get(id);
45
+ if (!f) {
46
+ const o = extra ?? {};
47
+ f = type === 'date' ? new Intl.DateTimeFormat(locale, { dateStyle: 'medium', ...o })
48
+ : type === 'datetime' ? new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short', ...o })
49
+ : type === 'time' ? new Intl.DateTimeFormat(locale, { timeStyle: 'short', ...o })
50
+ : type === 'currency' ? new Intl.NumberFormat(locale, { style: 'currency', currency: currency ?? 'USD', ...o })
51
+ : type === 'percent' ? new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1, ...o })
52
+ : new Intl.NumberFormat(locale, o);
53
+ fmtCache.set(id, f);
54
+ }
55
+ return f;
56
+ }
57
+ const BYTE_UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte'];
58
+ function bytes(n, locale) {
59
+ let i = 0;
60
+ while (Math.abs(n) >= 1024 && i < BYTE_UNITS.length - 1) {
61
+ n /= 1024;
62
+ i++;
63
+ }
64
+ return new Intl.NumberFormat(locale, { style: 'unit', unit: BYTE_UNITS[i], unitDisplay: 'short', maximumFractionDigits: i ? 1 : 0 }).format(n);
65
+ }
66
+ /** "09:30" or "09:30:15" as a Date today (for `type: 'time'`). */
67
+ const timeOf = (v) => { const m = v.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/); if (!m)
68
+ return null; const d = new Date(); d.setHours(+m[1], +m[2], +(m[3] ?? 0), 0); return d; };
69
+ function typed(value, col, locale) {
70
+ const t = col.type;
71
+ const o = col.formatOptions;
72
+ if (t === 'date' || t === 'datetime' || t === 'time') {
73
+ const d = value instanceof Date ? value : t === 'time' && typeof value === 'string' && timeOf(value) ? timeOf(value) : new Date(value);
74
+ return Number.isNaN(d.getTime()) ? String(value) : fmt(locale, t, undefined, o).format(d);
75
+ }
76
+ if (t === 'number' || t === 'currency' || t === 'percent' || t === 'bytes') {
77
+ const n = typeof value === 'number' ? value : Number(value);
78
+ if (!Number.isFinite(n))
79
+ return String(value);
80
+ return t === 'bytes' ? bytes(n, locale) : fmt(locale, t, col.currency, o).format(n);
81
+ }
82
+ if (t === 'boolean')
83
+ return value ? '✓' : '—';
84
+ if (Array.isArray(value))
85
+ return value.join(', ');
86
+ if (value instanceof Date)
87
+ return fmt(locale, 'date', undefined, o).format(value);
88
+ if (typeof value === 'object')
89
+ return JSON.stringify(value);
90
+ return value;
91
+ }
92
+ /** Display value for a cell (no templates): `format`, else Intl by `type` (+ `formatOptions`), plus prefix/suffix. */
93
+ export function formatValue(value, col, row, locale) {
94
+ if (col.format)
95
+ return col.format(value, row);
96
+ if (value == null || value === '')
97
+ return '';
98
+ const v = typed(value, col, locale);
99
+ return col.prefix || col.suffix ? `${col.prefix ?? ''}${String(v)}${col.suffix ?? ''}` : v;
100
+ }
101
+ /* ---------- Declarative templates: <template data-cell="key"> / <template data-header="key"> ---------- */
102
+ const get = (o, path) => path.split('.').reduce((x, k) => (x == null ? undefined : x[k]), o);
103
+ const URL_ATTRS = /^(href|src|action|formaction|xlink:href|srcdoc|poster|data)$/i;
104
+ /**
105
+ * Clone a template and fill `{{field}}` placeholders in text and attributes with escaped values (never parsed as
106
+ * HTML). Event-handler attributes and `javascript:` URLs are removed. Available fields: the row's fields (dotted
107
+ * paths allowed), `value` (raw), `text` (formatted), `key`, `label`.
108
+ */
109
+ export function fillTemplate(tpl, data) {
110
+ const frag = tpl.content.cloneNode(true);
111
+ const sub = (s) => s.replace(/\{\{\s*([\w.$-]+)\s*\}\}/g, (_, k) => { const v = get(data, k); return v == null ? '' : String(v); });
112
+ const walker = document.createTreeWalker(frag, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
113
+ for (let n = walker.nextNode(); n; n = walker.nextNode()) {
114
+ if (n.nodeType === Node.TEXT_NODE) {
115
+ const t = n;
116
+ if (t.data.includes('{{'))
117
+ t.data = sub(t.data);
118
+ continue;
119
+ }
120
+ const el = n;
121
+ for (const a of [...el.attributes]) {
122
+ if (/^on/i.test(a.name)) {
123
+ el.removeAttribute(a.name);
124
+ continue;
125
+ }
126
+ if (!a.value.includes('{{'))
127
+ continue;
128
+ const v = sub(a.value);
129
+ if (URL_ATTRS.test(a.name) && /^\s*(javascript|vbscript|data:text\/html)/i.test(v.replace(/[\u0000-\u001f\s]/g, '')))
130
+ el.removeAttribute(a.name);
131
+ else
132
+ el.setAttribute(a.name, v);
133
+ }
134
+ }
135
+ return frag;
136
+ }
137
+ const tplOf = (host, kind, key) => host?.querySelector(`:scope > template[data-${kind}="${CSS.escape(key)}"]`) ?? null;
138
+ /** Cell content, first match wins: `render(row)` → `<template data-cell="key">` → formatted value. */
139
+ export function cellContent(col, row, locale, host) {
140
+ if (col.render)
141
+ return col.render(row);
142
+ const value = row[col.key];
143
+ const text = formatValue(value, col, row, locale);
144
+ const tpl = tplOf(host, 'cell', col.key);
145
+ if (tpl)
146
+ return fillTemplate(tpl, { ...row, value, text, key: col.key, label: col.label });
147
+ if (col.type === 'badge' && text !== '') {
148
+ const tone = col.tones?.[String(value)] ?? 'neutral';
149
+ return html `<span class="pm-badge" data-tone=${tone}>${text}</span>`;
150
+ }
151
+ return text;
152
+ }
153
+ /** Header content: `renderHeader(col)` → `<template data-header="key">` → label. */
154
+ export function headerContent(col, host) {
155
+ if (col.renderHeader)
156
+ return col.renderHeader(col);
157
+ const tpl = tplOf(host, 'header', col.key);
158
+ return tpl ? fillTemplate(tpl, { key: col.key, label: col.label }) : col.label;
159
+ }
160
+ /** Classes for a cell. */
161
+ export const cellClassOf = (col, row) => (typeof col.cellClass === 'function' ? col.cellClass(row) : col.cellClass) || undefined;
162
+ /** Whether a column's text should stay on one line. */
163
+ export const noWrap = (c) => c.wrap === false || (c.wrap !== true && !!c.type && c.type !== 'text');
164
+ export const isNumeric = (c) => c.type === 'number' || c.type === 'currency' || c.type === 'percent' || c.type === 'bytes';
165
+ export const alignOf = (c) => c.align ?? (isNumeric(c) ? 'end' : undefined);
166
+ export const SORT_ICON = (dir) => html `<svg viewBox="0 0 24 24" width="0.9em" height="0.9em" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${dir === 'asc' ? html `<path d="M12 19V5M6 11l6-6 6 6"/>` : dir === 'desc' ? html `<path d="M12 5v14M6 13l6 6 6-6"/>` : html `<path d="M8 9l4-4 4 4M8 15l4 4 4-4"/>`}</svg>`;
167
+ /** Accept JSON strings for array properties (attribute-style values passed as properties by some frameworks). */
168
+ export function parseArray(v) {
169
+ if (Array.isArray(v))
170
+ return v;
171
+ if (typeof v === 'string') {
172
+ try {
173
+ const p = JSON.parse(v);
174
+ return Array.isArray(p) ? p : [];
175
+ }
176
+ catch {
177
+ return [];
178
+ }
179
+ }
180
+ return [];
181
+ }
182
+ /** Re-render the host when `<template data-cell|data-header>` children are added or removed. */
183
+ export function watchTemplates(host) {
184
+ if (typeof MutationObserver === 'undefined')
185
+ return undefined;
186
+ const mo = new MutationObserver((list) => {
187
+ if (list.some((m) => [...m.addedNodes, ...m.removedNodes].some((n) => n instanceof HTMLTemplateElement)))
188
+ host.requestUpdate();
189
+ });
190
+ mo.observe(host, { childList: true });
191
+ return mo;
192
+ }
193
+ /**
194
+ * Custom header content keeps the visible text as the accessible name (WCAG 2.5.3); only headers with no readable
195
+ * text (icons, symbols) are named by the column `label`. Call after render on elements marked `data-custom-head`.
196
+ */
197
+ export function nameCustomHeaders(root) {
198
+ for (const el of root.querySelectorAll('[data-custom-head]')) {
199
+ const readable = /[\p{L}\p{N}]/u.test(el.textContent ?? '');
200
+ if (readable)
201
+ el.removeAttribute('aria-label');
202
+ else
203
+ el.setAttribute('aria-label', el.dataset.customHead);
204
+ }
205
+ }
@@ -0,0 +1,42 @@
1
+ export type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
2
+ export type ToastTone = 'accent' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
3
+ export interface ToastOptions {
4
+ title?: string;
5
+ description?: string;
6
+ tone?: ToastTone;
7
+ /** ms before auto-dismiss; 0 = persistent (default for danger/warning and toasts with an action). */
8
+ duration?: number;
9
+ action?: {
10
+ label: string;
11
+ onClick: () => void;
12
+ };
13
+ /** Reuse an id to update a toast in place instead of stacking a new one. */
14
+ id?: string;
15
+ /** Show a spinner instead of the tone icon (used by `toast.promise`). */
16
+ loading?: boolean;
17
+ /** Hide the close button. */
18
+ dismissible?: boolean;
19
+ /** Called after the toast is removed. */
20
+ onDismiss?: () => void;
21
+ }
22
+ /**
23
+ * Show a toast. Returns a function that dismisses it. Toasts stack at the toaster's `position` (bottom-end by
24
+ * default; centred and full-width on phones), pause on hover/focus, and can be swiped away.
25
+ * @example toast({ title: 'Saved', description: 'Your changes are live.', tone: 'success' })
26
+ */
27
+ export declare function toast(opts: ToastOptions | string): () => void;
28
+ export declare namespace toast {
29
+ var success: Shortcut;
30
+ var error: Shortcut;
31
+ var warning: Shortcut;
32
+ var info: Shortcut;
33
+ var dismiss: (id?: string) => void;
34
+ var promise: <T>(p: Promise<T>, m: {
35
+ loading: string;
36
+ success: string | ((v: T) => string);
37
+ error: string | ((e: unknown) => string);
38
+ description?: string;
39
+ }) => Promise<T>;
40
+ }
41
+ type Shortcut = (title: string, opts?: Omit<ToastOptions, 'title' | 'tone'>) => () => void;
42
+ export {};
package/dist/toast.js ADDED
@@ -0,0 +1,206 @@
1
+ import { nextId } from './id.js';
2
+ import { adoptDocumentStyles } from './register.js';
3
+ import buttonCss from './styles/button.js';
4
+ import overlayCss from './styles/overlay.js';
5
+ import toastCss from './styles/toast.js';
6
+ import { closeTopLayer } from './top-layer.js';
7
+ import { isPhone } from './sheet.js';
8
+ const SVG = (d) => `<svg viewBox="0 0 24 24" width="1.15em" height="1.15em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${d}</svg>`;
9
+ const TOAST_ICONS = {
10
+ success: SVG('<circle cx="12" cy="12" r="9"/><path d="M8 12.5l2.5 2.5L16 9.5"/>'),
11
+ warning: SVG('<path d="M12 3.5L2.5 20h19z"/><path d="M12 10v4M12 17h.01"/>'),
12
+ danger: SVG('<circle cx="12" cy="12" r="9"/><path d="M15 9l-6 6M9 9l6 6"/>'),
13
+ info: SVG('<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>'),
14
+ accent: SVG('<path d="M12 3l2 5.5L19.5 10 14 12l-2 5.5L10 12 4.5 10 10 8.5z"/>'),
15
+ neutral: SVG('<circle cx="12" cy="12" r="9"/><path d="M12 8v4l2.5 2"/>'),
16
+ };
17
+ const SPINNER = '<span class="pm-toast-spinner"></span>';
18
+ const CLOSE = SVG('<path d="M18 6L6 18M6 6l12 12"/>');
19
+ /** Region that holds toasts (created on demand; a `<pm-toaster>` element configures it). */
20
+ function toaster() {
21
+ adoptDocumentStyles([overlayCss, buttonCss, toastCss]);
22
+ let region = document.querySelector('pm-toaster, [data-pm-toaster]');
23
+ if (!region) {
24
+ region = document.createElement('div');
25
+ region.setAttribute('data-pm-toaster', '');
26
+ region.setAttribute('role', 'region');
27
+ region.setAttribute('aria-label', 'Notifications');
28
+ document.body.append(region);
29
+ }
30
+ return region;
31
+ }
32
+ const positionOf = () => toaster().getAttribute('position') ?? 'bottom-end';
33
+ const maxOf = () => Number(toaster().getAttribute('max')) || 4;
34
+ function announce(text, urgent = false) {
35
+ const doc = document;
36
+ if (typeof doc.ariaNotify === 'function') {
37
+ doc.ariaNotify(text, urgent ? { priority: 'high' } : undefined);
38
+ return;
39
+ }
40
+ const id = urgent ? 'pm-live-assertive' : 'pm-live';
41
+ let live = document.getElementById(id);
42
+ if (!live) {
43
+ live = document.createElement('div');
44
+ live.id = id;
45
+ live.className = 'pm-visually-hidden';
46
+ live.setAttribute('aria-live', urgent ? 'assertive' : 'polite');
47
+ document.body.append(live);
48
+ }
49
+ live.textContent = '';
50
+ setTimeout(() => { live.textContent = text; }, 50);
51
+ }
52
+ function restack() {
53
+ const pos = isPhone() && !toaster().hasAttribute('keep-position') ? `${positionOf().split('-')[0]}-center` : positionOf();
54
+ let offset = 0;
55
+ const toasts = [...toaster().querySelectorAll('.pm-toast:not([data-closing])')].reverse();
56
+ for (const t of toasts) {
57
+ t.dataset.position = pos;
58
+ t.style.setProperty('--pm-toast-offset', `${offset}px`);
59
+ offset += t.getBoundingClientRect().height + 8;
60
+ }
61
+ }
62
+ const LIVE = new Map();
63
+ /**
64
+ * Show a toast. Returns a function that dismisses it. Toasts stack at the toaster's `position` (bottom-end by
65
+ * default; centred and full-width on phones), pause on hover/focus, and can be swiped away.
66
+ * @example toast({ title: 'Saved', description: 'Your changes are live.', tone: 'success' })
67
+ */
68
+ export function toast(opts) {
69
+ const o = typeof opts === 'string' ? { title: opts } : opts;
70
+ const existing = o.id ? LIVE.get(o.id) : undefined;
71
+ if (existing) {
72
+ existing.update(o);
73
+ return () => void existing.dismiss();
74
+ }
75
+ const el = document.createElement('div');
76
+ el.className = 'pm-toast';
77
+ el.setAttribute('popover', 'manual');
78
+ const id = o.id ?? nextId('toast');
79
+ el.innerHTML = `<span class="pm-toast-icon" aria-hidden="true"></span>
80
+ <div class="pm-toast-title"></div>
81
+ <div class="pm-toast-body"></div>
82
+ <button type="button" class="pm-button pm-toast-close" data-variant="ghost" data-tone="neutral" data-size="xs" data-icon aria-label="Close">${CLOSE}</button>`;
83
+ let timer = 0;
84
+ let current = {};
85
+ const render = (n) => {
86
+ current = { ...current, ...n };
87
+ if (n.loading === undefined && (n.tone || n.title))
88
+ current.loading = n.loading;
89
+ const tone = current.tone ?? 'neutral';
90
+ el.dataset.tone = tone;
91
+ el.querySelector('.pm-toast-icon').innerHTML = current.loading ? SPINNER : TOAST_ICONS[tone] ?? '';
92
+ el.querySelector('.pm-toast-title').textContent = current.title ?? '';
93
+ const body = el.querySelector('.pm-toast-body');
94
+ body.textContent = current.description ?? '';
95
+ body.hidden = !current.description;
96
+ el.querySelector('.pm-toast-close').hidden = current.dismissible === false;
97
+ el.querySelector('.pm-toast-action')?.remove();
98
+ if (current.action) {
99
+ const btn = document.createElement('button');
100
+ btn.type = 'button';
101
+ btn.className = 'pm-button pm-toast-action';
102
+ btn.dataset.variant = 'soft';
103
+ btn.dataset.size = 'xs';
104
+ btn.textContent = current.action.label;
105
+ const action = current.action;
106
+ btn.addEventListener('click', () => { action.onClick(); void dismiss(); });
107
+ el.append(btn);
108
+ }
109
+ el.setAttribute('aria-busy', current.loading ? 'true' : 'false');
110
+ clearTimeout(timer);
111
+ start();
112
+ restack();
113
+ };
114
+ const durationOf = () => current.loading ? 0 : current.duration ?? (current.tone === 'danger' || current.tone === 'warning' || current.action ? 0 : 5000);
115
+ const start = () => { const d = durationOf(); if (d > 0 && !el.matches(':hover, :focus-within'))
116
+ timer = window.setTimeout(() => void dismiss(), d); };
117
+ const pause = () => clearTimeout(timer);
118
+ async function dismiss() {
119
+ clearTimeout(timer);
120
+ LIVE.delete(id);
121
+ if (!el.isConnected)
122
+ return;
123
+ const hadFocus = el.contains(document.activeElement);
124
+ await closeTopLayer(el, () => el.hidePopover());
125
+ el.remove();
126
+ restack();
127
+ current.onDismiss?.();
128
+ if (hadFocus)
129
+ toaster().querySelector('.pm-toast .pm-toast-close')?.focus();
130
+ }
131
+ toaster().append(el);
132
+ el.showPopover();
133
+ render(o);
134
+ LIVE.set(id, { el, dismiss, update: (n) => { render(n); announce([n.title, n.description].filter(Boolean).join('. '), n.tone === 'danger'); } });
135
+ announce([o.title, o.description, o.action ? 'Actions available' : ''].filter(Boolean).join('. '), o.tone === 'danger');
136
+ // Keep at most `max` toasts: the oldest leave first.
137
+ const all = [...toaster().querySelectorAll('.pm-toast:not([data-closing])')];
138
+ for (const old of all.slice(0, Math.max(0, all.length - maxOf())))
139
+ [...LIVE.values()].find((l) => l.el === old)?.dismiss();
140
+ el.addEventListener('pointerenter', pause);
141
+ el.addEventListener('pointerleave', start);
142
+ el.addEventListener('focusin', pause);
143
+ el.addEventListener('focusout', (e) => { if (!el.contains(e.relatedTarget))
144
+ start(); });
145
+ el.querySelector('.pm-toast-close')?.addEventListener('click', () => void dismiss());
146
+ // Swipe sideways (touch or mouse drag) to dismiss.
147
+ let sx = 0;
148
+ let dragging = false;
149
+ let pid = -1;
150
+ el.addEventListener('pointerdown', (e) => { if (e.target.closest('button'))
151
+ return; sx = e.clientX; pid = e.pointerId; dragging = false; });
152
+ el.addEventListener('pointermove', (e) => {
153
+ if (e.pointerId !== pid)
154
+ return;
155
+ const dx = e.clientX - sx;
156
+ if (!dragging && Math.abs(dx) > 8) {
157
+ dragging = true;
158
+ el.setAttribute('data-swiping', '');
159
+ try {
160
+ el.setPointerCapture(pid);
161
+ }
162
+ catch { /* ignore */ }
163
+ }
164
+ if (dragging) {
165
+ el.style.translate = `${dx}px 0`;
166
+ el.style.opacity = String(Math.max(0.2, 1 - Math.abs(dx) / 240));
167
+ }
168
+ });
169
+ const end = (e) => {
170
+ if (e.pointerId !== pid)
171
+ return;
172
+ pid = -1;
173
+ if (!dragging)
174
+ return;
175
+ el.removeAttribute('data-swiping');
176
+ if (Math.abs(e.clientX - sx) > 90)
177
+ void dismiss();
178
+ else {
179
+ el.style.translate = '';
180
+ el.style.opacity = '';
181
+ }
182
+ };
183
+ el.addEventListener('pointerup', end);
184
+ el.addEventListener('pointercancel', end);
185
+ return () => void dismiss();
186
+ }
187
+ const tone = (t) => (title, opts) => toast({ ...opts, title, tone: t });
188
+ /** `toast.success('Saved')` and friends. */
189
+ toast.success = tone('success');
190
+ toast.error = tone('danger');
191
+ toast.warning = tone('warning');
192
+ toast.info = tone('info');
193
+ /** Dismiss one toast by id, or all of them. */
194
+ toast.dismiss = (id) => { for (const [k, l] of LIVE)
195
+ if (!id || k === id)
196
+ void l.dismiss(); };
197
+ /**
198
+ * Loading → success/error toast for async work. Returns the promise.
199
+ * @example toast.promise(save(), { loading: 'Saving…', success: 'Saved', error: (e) => `Failed: ${e.message}` })
200
+ */
201
+ toast.promise = (p, m) => {
202
+ const id = nextId('toast-p');
203
+ toast({ id, title: m.loading, description: m.description, loading: true, tone: 'neutral' });
204
+ p.then((v) => toast({ id, title: typeof m.success === 'function' ? m.success(v) : m.success, tone: 'success', loading: false, duration: 4000 }), (e) => toast({ id, title: typeof m.error === 'function' ? m.error(e) : m.error, tone: 'danger', loading: false, duration: 0 }));
205
+ return p;
206
+ };
@@ -0,0 +1,4 @@
1
+ export declare function canTransitionDisplay(): boolean;
2
+ export declare const supportsTopLayerExit: () => boolean;
3
+ /** Close a dialog/popover with its exit transition, in every browser. */
4
+ export declare function closeTopLayer(el: HTMLElement, close: () => void): Promise<void>;
@@ -0,0 +1,33 @@
1
+ /* ------------------------------------------------------------------ */
2
+ /* Top-layer exit animation helper (guide: animate-to-from-top-layer) */
3
+ /* ------------------------------------------------------------------ */
4
+ let displayTransition;
5
+ export function canTransitionDisplay() {
6
+ if (displayTransition !== undefined)
7
+ return displayTransition;
8
+ if (!globalThis.CSS?.supports?.('transition-behavior', 'allow-discrete') || !document.body)
9
+ return false;
10
+ const probe = document.createElement('div');
11
+ probe.style.cssText = 'transition: display 1s allow-discrete !important; display: block;';
12
+ document.body.appendChild(probe);
13
+ getComputedStyle(probe).display;
14
+ probe.style.display = 'none';
15
+ displayTransition = getComputedStyle(probe).display === 'block';
16
+ probe.remove();
17
+ return displayTransition;
18
+ }
19
+ export const supportsTopLayerExit = () => Boolean(globalThis.CSS?.supports?.('overlay', 'auto')) && canTransitionDisplay();
20
+ /** Close a dialog/popover with its exit transition, in every browser. */
21
+ export async function closeTopLayer(el, close) {
22
+ if (!supportsTopLayerExit()) {
23
+ el.setAttribute('data-closing', '');
24
+ const anims = el.getAnimations({ subtree: true });
25
+ if (anims.length) {
26
+ await Promise.race([Promise.allSettled(anims.map((a) => a.finished)), new Promise((r) => setTimeout(r, 2000))]);
27
+ }
28
+ if (!el.hasAttribute('data-closing'))
29
+ return;
30
+ el.removeAttribute('data-closing');
31
+ }
32
+ close();
33
+ }
package/package.json CHANGED
@@ -1,6 +1,103 @@
1
1
  {
2
2
  "name": "@prismora/elements",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Prismora web components (Lit). Work in any framework or plain HTML.",
5
+ "keywords": [
6
+ "prismora",
7
+ "design-system",
8
+ "web-components",
9
+ "custom-elements",
10
+ "lit",
11
+ "ui",
12
+ "components"
13
+ ],
14
+ "homepage": "https://prismora.design",
15
+ "bugs": {
16
+ "url": "https://github.com/axxra/prismora/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/axxra/prismora.git",
21
+ "directory": "packages/elements"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Aravind Kumar",
25
+ "type": "module",
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.js"
32
+ },
33
+ "./define": {
34
+ "types": "./dist/define.d.ts",
35
+ "default": "./dist/define.js"
36
+ },
37
+ "./custom-elements.json": "./custom-elements.json",
38
+ "./catalog": {
39
+ "types": "./dist/catalog.d.ts",
40
+ "default": "./dist/catalog.js"
41
+ },
42
+ "./manifest": {
43
+ "types": "./dist/manifest.d.ts",
44
+ "default": "./dist/manifest.js"
45
+ },
46
+ "./components.json": "./components.json",
47
+ "./patterns": {
48
+ "types": "./dist/patterns/index.d.ts",
49
+ "default": "./dist/patterns/index.js"
50
+ },
51
+ "./base": {
52
+ "types": "./dist/base.d.ts",
53
+ "default": "./dist/base.js"
54
+ },
55
+ "./sheet": {
56
+ "types": "./dist/sheet.d.ts",
57
+ "default": "./dist/sheet.js"
58
+ },
59
+ "./*": {
60
+ "types": "./dist/components/*.d.ts",
61
+ "default": "./dist/components/*.js"
62
+ },
63
+ "./toast": {
64
+ "types": "./dist/toast.d.ts",
65
+ "default": "./dist/toast.js"
66
+ },
67
+ "./confirm": {
68
+ "types": "./dist/confirm.d.ts",
69
+ "default": "./dist/confirm.js"
70
+ },
71
+ "./highlight": {
72
+ "types": "./dist/highlight.d.ts",
73
+ "default": "./dist/highlight.js"
74
+ },
75
+ "./qr": {
76
+ "types": "./dist/qr.d.ts",
77
+ "default": "./dist/qr.js"
78
+ }
79
+ },
80
+ "files": [
81
+ "dist",
82
+ "components.json",
83
+ "custom-elements.json"
84
+ ],
85
+ "sideEffects": [
86
+ "./dist/components/*.js",
87
+ "./dist/define.js",
88
+ "./dist/registry.js",
89
+ "./dist/index.js",
90
+ "./dist/standalone.js",
91
+ "./dist/*.js"
92
+ ],
93
+ "dependencies": {
94
+ "@prismora/css": "^0.1.0",
95
+ "@prismora/motion": "^0.1.0",
96
+ "lit": "^3",
97
+ "@lit/reactive-element": "^2.1.0"
98
+ },
99
+ "publishConfig": {
100
+ "access": "public"
101
+ },
102
+ "customElements": "custom-elements.json"
103
+ }