@owlmeans/web-panel 0.1.18-rc.9 → 0.1.18

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 (669) hide show
  1. package/README.md +510 -143
  2. package/THIRD-PARTY-NOTICES.txt +24 -0
  3. package/agent-meta/manifest.json +163 -4
  4. package/agent-meta/skills/web-panel/SKILL.md +136 -83
  5. package/agent-meta/skills/web-panel/parts/consent.md +114 -0
  6. package/agent-meta/skills/web-panel/parts/editor.md +47 -0
  7. package/agent-meta/skills/web-panel/parts/forms.md +85 -0
  8. package/agent-meta/skills/web-panel/parts/navigation.md +203 -0
  9. package/agent-meta/skills/web-panel/parts/picker.md +164 -0
  10. package/agent-meta/skills/web-panel/parts/reload.md +46 -0
  11. package/agent-meta/skills/web-panel/parts/sign-in.md +65 -0
  12. package/agent-meta/skills/web-panel/parts/theme.md +74 -0
  13. package/build/@/components/ui/alert-dialog.d.ts +15 -0
  14. package/build/@/components/ui/alert-dialog.d.ts.map +1 -0
  15. package/build/@/components/ui/alert-dialog.js +39 -0
  16. package/build/@/components/ui/alert-dialog.js.map +1 -0
  17. package/build/@/components/ui/alert.js +1 -1
  18. package/build/@/components/ui/alert.js.map +1 -1
  19. package/build/@/components/ui/button.js +1 -1
  20. package/build/@/components/ui/button.js.map +1 -1
  21. package/build/@/components/ui/card.js +1 -1
  22. package/build/@/components/ui/card.js.map +1 -1
  23. package/build/@/components/ui/input.js +1 -1
  24. package/build/@/components/ui/input.js.map +1 -1
  25. package/build/@/components/ui/label.js +1 -1
  26. package/build/@/components/ui/label.js.map +1 -1
  27. package/build/@/components/ui/navigation-menu.js +1 -1
  28. package/build/@/components/ui/navigation-menu.js.map +1 -1
  29. package/build/@/components/ui/popover.d.ts +8 -0
  30. package/build/@/components/ui/popover.d.ts.map +1 -0
  31. package/build/@/components/ui/popover.js +17 -0
  32. package/build/@/components/ui/popover.js.map +1 -0
  33. package/build/@/components/ui/progress.js +1 -1
  34. package/build/@/components/ui/progress.js.map +1 -1
  35. package/build/@/components/ui/separator.js +1 -1
  36. package/build/@/components/ui/separator.js.map +1 -1
  37. package/build/@/components/ui/sheet.d.ts +15 -0
  38. package/build/@/components/ui/sheet.d.ts.map +1 -0
  39. package/build/@/components/ui/sheet.js +40 -0
  40. package/build/@/components/ui/sheet.js.map +1 -0
  41. package/build/auth/context.d.ts.map +1 -1
  42. package/build/auth/context.js +0 -1
  43. package/build/auth/context.js.map +1 -1
  44. package/build/auth/entrypoints.d.ts +10 -0
  45. package/build/auth/entrypoints.d.ts.map +1 -0
  46. package/build/auth/entrypoints.js +4 -0
  47. package/build/auth/entrypoints.js.map +1 -0
  48. package/build/auth/exports.d.ts +4 -4
  49. package/build/auth/exports.d.ts.map +1 -1
  50. package/build/auth/exports.js +3 -3
  51. package/build/auth/exports.js.map +1 -1
  52. package/build/auth/modules.d.ts +1 -1
  53. package/build/auth/modules.d.ts.map +1 -1
  54. package/build/auth/plugins/basic-ed25519.js +4 -4
  55. package/build/auth/plugins/basic-ed25519.js.map +1 -1
  56. package/build/auth/plugins/re-captcha.js +3 -3
  57. package/build/auth/plugins/re-captcha.js.map +1 -1
  58. package/build/auth/plugins/tunnel-consumer.js +1 -1
  59. package/build/auth/plugins/tunnel-consumer.js.map +1 -1
  60. package/build/components/block.js +2 -2
  61. package/build/components/block.js.map +1 -1
  62. package/build/components/consts.local.d.ts +14 -0
  63. package/build/components/consts.local.d.ts.map +1 -0
  64. package/build/components/consts.local.js +26 -0
  65. package/build/components/consts.local.js.map +1 -0
  66. package/build/components/footer/component.d.ts +19 -1
  67. package/build/components/footer/component.d.ts.map +1 -1
  68. package/build/components/footer/component.js +38 -11
  69. package/build/components/footer/component.js.map +1 -1
  70. package/build/components/footer/credit.d.ts +27 -0
  71. package/build/components/footer/credit.d.ts.map +1 -0
  72. package/build/components/footer/credit.js +42 -0
  73. package/build/components/footer/credit.js.map +1 -0
  74. package/build/components/footer/index.d.ts +1 -0
  75. package/build/components/footer/index.d.ts.map +1 -1
  76. package/build/components/footer/index.js +1 -0
  77. package/build/components/footer/index.js.map +1 -1
  78. package/build/components/footer/types.d.ts +22 -1
  79. package/build/components/footer/types.d.ts.map +1 -1
  80. package/build/components/form/button/component.d.ts.map +1 -1
  81. package/build/components/form/button/component.js +5 -3
  82. package/build/components/form/button/component.js.map +1 -1
  83. package/build/components/form/component.js +2 -2
  84. package/build/components/form/component.js.map +1 -1
  85. package/build/components/form/text/component.js +2 -2
  86. package/build/components/form/text/component.js.map +1 -1
  87. package/build/components/helper.d.ts.map +1 -1
  88. package/build/components/helper.js +1 -12
  89. package/build/components/helper.js.map +1 -1
  90. package/build/components/index.d.ts +4 -0
  91. package/build/components/index.d.ts.map +1 -1
  92. package/build/components/index.js +4 -0
  93. package/build/components/index.js.map +1 -1
  94. package/build/components/link.js +3 -3
  95. package/build/components/link.js.map +1 -1
  96. package/build/components/login/append.d.ts +15 -0
  97. package/build/components/login/append.d.ts.map +1 -0
  98. package/build/components/login/append.js +26 -0
  99. package/build/components/login/append.js.map +1 -0
  100. package/build/components/login/consts.d.ts +3 -0
  101. package/build/components/login/consts.d.ts.map +1 -0
  102. package/build/components/login/consts.js +3 -0
  103. package/build/components/login/consts.js.map +1 -0
  104. package/build/components/login/consts.local.d.ts +4 -0
  105. package/build/components/login/consts.local.d.ts.map +1 -0
  106. package/build/components/login/consts.local.js +8 -0
  107. package/build/components/login/consts.local.js.map +1 -0
  108. package/build/components/login/credit.d.ts +12 -0
  109. package/build/components/login/credit.d.ts.map +1 -0
  110. package/build/components/login/credit.js +18 -0
  111. package/build/components/login/credit.js.map +1 -0
  112. package/build/components/login/i18n/be.json +10 -0
  113. package/build/components/login/i18n/de.json +10 -0
  114. package/build/components/login/i18n/en.json +10 -0
  115. package/build/components/login/i18n/es.json +10 -0
  116. package/build/components/login/i18n/fr.json +10 -0
  117. package/build/components/login/i18n/pl.json +10 -0
  118. package/build/components/login/i18n/ru.json +10 -0
  119. package/build/components/login/i18n/uk.json +10 -0
  120. package/build/components/login/i18n.d.ts +2 -0
  121. package/build/components/login/i18n.d.ts.map +1 -0
  122. package/build/components/login/i18n.js +28 -0
  123. package/build/components/login/i18n.js.map +1 -0
  124. package/build/components/login/icons.d.ts +14 -0
  125. package/build/components/login/icons.d.ts.map +1 -0
  126. package/build/components/login/icons.js +29 -0
  127. package/build/components/login/icons.js.map +1 -0
  128. package/build/components/login/index.d.ts +11 -0
  129. package/build/components/login/index.d.ts.map +1 -0
  130. package/build/components/login/index.js +10 -0
  131. package/build/components/login/index.js.map +1 -0
  132. package/build/components/login/notify.d.ts +18 -0
  133. package/build/components/login/notify.d.ts.map +1 -0
  134. package/build/components/login/notify.js +41 -0
  135. package/build/components/login/notify.js.map +1 -0
  136. package/build/components/login/provider.d.ts +20 -0
  137. package/build/components/login/provider.d.ts.map +1 -0
  138. package/build/components/login/provider.js +31 -0
  139. package/build/components/login/provider.js.map +1 -0
  140. package/build/components/login/screen.d.ts +24 -0
  141. package/build/components/login/screen.d.ts.map +1 -0
  142. package/build/components/login/screen.js +92 -0
  143. package/build/components/login/screen.js.map +1 -0
  144. package/build/components/login/terms.d.ts +19 -0
  145. package/build/components/login/terms.d.ts.map +1 -0
  146. package/build/components/login/terms.js +32 -0
  147. package/build/components/login/terms.js.map +1 -0
  148. package/build/components/login/types.d.ts +28 -0
  149. package/build/components/login/types.d.ts.map +1 -0
  150. package/build/components/login/types.js +2 -0
  151. package/build/components/login/types.js.map +1 -0
  152. package/build/components/nav/consts.local.d.ts +41 -0
  153. package/build/components/nav/consts.local.d.ts.map +1 -0
  154. package/build/components/nav/consts.local.js +60 -0
  155. package/build/components/nav/consts.local.js.map +1 -0
  156. package/build/components/nav/index.d.ts +1 -0
  157. package/build/components/nav/index.d.ts.map +1 -1
  158. package/build/components/nav/index.js +1 -0
  159. package/build/components/nav/index.js.map +1 -1
  160. package/build/components/nav/layout.d.ts +9 -2
  161. package/build/components/nav/layout.d.ts.map +1 -1
  162. package/build/components/nav/layout.js +48 -7
  163. package/build/components/nav/layout.js.map +1 -1
  164. package/build/components/nav/mobile.d.ts +21 -0
  165. package/build/components/nav/mobile.d.ts.map +1 -0
  166. package/build/components/nav/mobile.js +55 -0
  167. package/build/components/nav/mobile.js.map +1 -0
  168. package/build/components/nav/side.d.ts.map +1 -1
  169. package/build/components/nav/side.js +10 -10
  170. package/build/components/nav/side.js.map +1 -1
  171. package/build/components/nav/top.d.ts.map +1 -1
  172. package/build/components/nav/top.js +12 -8
  173. package/build/components/nav/top.js.map +1 -1
  174. package/build/components/nav/types.d.ts +64 -1
  175. package/build/components/nav/types.d.ts.map +1 -1
  176. package/build/components/nav/viewport.d.ts +3 -0
  177. package/build/components/nav/viewport.d.ts.map +1 -0
  178. package/build/components/nav/viewport.js +14 -0
  179. package/build/components/nav/viewport.js.map +1 -0
  180. package/build/components/panel-app/component.d.ts.map +1 -1
  181. package/build/components/panel-app/component.js +4 -3
  182. package/build/components/panel-app/component.js.map +1 -1
  183. package/build/components/picker/color-picker.d.ts +9 -0
  184. package/build/components/picker/color-picker.d.ts.map +1 -0
  185. package/build/components/picker/color-picker.js +9 -0
  186. package/build/components/picker/color-picker.js.map +1 -0
  187. package/build/components/picker/consts.local.d.ts +76 -0
  188. package/build/components/picker/consts.local.d.ts.map +1 -0
  189. package/build/components/picker/consts.local.js +214 -0
  190. package/build/components/picker/consts.local.js.map +1 -0
  191. package/build/components/picker/dot.d.ts +8 -0
  192. package/build/components/picker/dot.d.ts.map +1 -0
  193. package/build/components/picker/dot.js +10 -0
  194. package/build/components/picker/dot.js.map +1 -0
  195. package/build/components/picker/grid.d.ts +17 -0
  196. package/build/components/picker/grid.d.ts.map +1 -0
  197. package/build/components/picker/grid.js +73 -0
  198. package/build/components/picker/grid.js.map +1 -0
  199. package/build/components/picker/i18n/be.json +60 -0
  200. package/build/components/picker/i18n/de.json +60 -0
  201. package/build/components/picker/i18n/en.json +60 -0
  202. package/build/components/picker/i18n/es.json +60 -0
  203. package/build/components/picker/i18n/fr.json +60 -0
  204. package/build/components/picker/i18n/pl.json +60 -0
  205. package/build/components/picker/i18n/ru.json +60 -0
  206. package/build/components/picker/i18n/uk.json +60 -0
  207. package/build/components/picker/i18n.d.ts +2 -0
  208. package/build/components/picker/i18n.d.ts.map +1 -0
  209. package/build/components/picker/i18n.js +18 -0
  210. package/build/components/picker/i18n.js.map +1 -0
  211. package/build/components/picker/icon-color-picker.d.ts +14 -0
  212. package/build/components/picker/icon-color-picker.d.ts.map +1 -0
  213. package/build/components/picker/icon-color-picker.js +15 -0
  214. package/build/components/picker/icon-color-picker.js.map +1 -0
  215. package/build/components/picker/icon-picker.d.ts +8 -0
  216. package/build/components/picker/icon-picker.d.ts.map +1 -0
  217. package/build/components/picker/icon-picker.js +8 -0
  218. package/build/components/picker/icon-picker.js.map +1 -0
  219. package/build/components/picker/index.d.ts +11 -0
  220. package/build/components/picker/index.d.ts.map +1 -0
  221. package/build/components/picker/index.js +10 -0
  222. package/build/components/picker/index.js.map +1 -0
  223. package/build/components/picker/panel.d.ts +9 -0
  224. package/build/components/picker/panel.d.ts.map +1 -0
  225. package/build/components/picker/panel.js +23 -0
  226. package/build/components/picker/panel.js.map +1 -0
  227. package/build/components/picker/root.d.ts +13 -0
  228. package/build/components/picker/root.d.ts.map +1 -0
  229. package/build/components/picker/root.js +55 -0
  230. package/build/components/picker/root.js.map +1 -0
  231. package/build/components/picker/roving.d.ts +8 -0
  232. package/build/components/picker/roving.d.ts.map +1 -0
  233. package/build/components/picker/roving.js +62 -0
  234. package/build/components/picker/roving.js.map +1 -0
  235. package/build/components/picker/surface.d.ts +18 -0
  236. package/build/components/picker/surface.d.ts.map +1 -0
  237. package/build/components/picker/surface.js +36 -0
  238. package/build/components/picker/surface.js.map +1 -0
  239. package/build/components/picker/swatches/custom.d.ts +10 -0
  240. package/build/components/picker/swatches/custom.d.ts.map +1 -0
  241. package/build/components/picker/swatches/custom.js +65 -0
  242. package/build/components/picker/swatches/custom.js.map +1 -0
  243. package/build/components/picker/swatches.d.ts +16 -0
  244. package/build/components/picker/swatches.d.ts.map +1 -0
  245. package/build/components/picker/swatches.js +35 -0
  246. package/build/components/picker/swatches.js.map +1 -0
  247. package/build/components/picker/text.d.ts +5 -0
  248. package/build/components/picker/text.d.ts.map +1 -0
  249. package/build/components/picker/text.js +29 -0
  250. package/build/components/picker/text.js.map +1 -0
  251. package/build/components/picker/tile.d.ts +11 -0
  252. package/build/components/picker/tile.d.ts.map +1 -0
  253. package/build/components/picker/tile.js +19 -0
  254. package/build/components/picker/tile.js.map +1 -0
  255. package/build/components/picker/translate.d.ts +9 -0
  256. package/build/components/picker/translate.d.ts.map +1 -0
  257. package/build/components/picker/translate.js +13 -0
  258. package/build/components/picker/translate.js.map +1 -0
  259. package/build/components/picker/trigger.d.ts +12 -0
  260. package/build/components/picker/trigger.d.ts.map +1 -0
  261. package/build/components/picker/trigger.js +29 -0
  262. package/build/components/picker/trigger.js.map +1 -0
  263. package/build/components/picker/types.d.ts +114 -0
  264. package/build/components/picker/types.d.ts.map +1 -0
  265. package/build/components/picker/types.js +2 -0
  266. package/build/components/picker/types.js.map +1 -0
  267. package/build/components/picker/types.local.d.ts +143 -0
  268. package/build/components/picker/types.local.d.ts.map +1 -0
  269. package/build/components/picker/types.local.js +2 -0
  270. package/build/components/picker/types.local.js.map +1 -0
  271. package/build/components/scheme/consts.local.d.ts +8 -0
  272. package/build/components/scheme/consts.local.d.ts.map +1 -0
  273. package/build/components/scheme/consts.local.js +13 -0
  274. package/build/components/scheme/consts.local.js.map +1 -0
  275. package/build/components/scheme/hook.d.ts +16 -0
  276. package/build/components/scheme/hook.d.ts.map +1 -0
  277. package/build/components/scheme/hook.js +52 -0
  278. package/build/components/scheme/hook.js.map +1 -0
  279. package/build/components/scheme/index.d.ts +4 -0
  280. package/build/components/scheme/index.d.ts.map +1 -0
  281. package/build/components/scheme/index.js +3 -0
  282. package/build/components/scheme/index.js.map +1 -0
  283. package/build/components/scheme/toggle.d.ts +14 -0
  284. package/build/components/scheme/toggle.d.ts.map +1 -0
  285. package/build/components/scheme/toggle.js +24 -0
  286. package/build/components/scheme/toggle.js.map +1 -0
  287. package/build/components/scheme/types.d.ts +21 -0
  288. package/build/components/scheme/types.d.ts.map +1 -0
  289. package/build/components/scheme/types.js +2 -0
  290. package/build/components/scheme/types.js.map +1 -0
  291. package/build/components/socket/i18n/be.json +9 -0
  292. package/build/components/socket/i18n/de.json +9 -0
  293. package/build/components/socket/i18n/en.json +9 -0
  294. package/build/components/socket/i18n/es.json +9 -0
  295. package/build/components/socket/i18n/fr.json +9 -0
  296. package/build/components/socket/i18n/pl.json +9 -0
  297. package/build/components/socket/i18n/ru.json +9 -0
  298. package/build/components/socket/i18n/uk.json +9 -0
  299. package/build/components/socket/i18n.d.ts +2 -0
  300. package/build/components/socket/i18n.d.ts.map +1 -0
  301. package/build/components/socket/i18n.js +18 -0
  302. package/build/components/socket/i18n.js.map +1 -0
  303. package/build/components/socket/index.d.ts +3 -0
  304. package/build/components/socket/index.d.ts.map +1 -0
  305. package/build/components/socket/index.js +3 -0
  306. package/build/components/socket/index.js.map +1 -0
  307. package/build/components/socket/reload-dialog.d.ts +22 -0
  308. package/build/components/socket/reload-dialog.d.ts.map +1 -0
  309. package/build/components/socket/reload-dialog.js +34 -0
  310. package/build/components/socket/reload-dialog.js.map +1 -0
  311. package/build/components/status.js +1 -1
  312. package/build/components/status.js.map +1 -1
  313. package/build/components/text.d.ts.map +1 -1
  314. package/build/components/text.js +2 -13
  315. package/build/components/text.js.map +1 -1
  316. package/build/components/toaster.d.ts +16 -0
  317. package/build/components/toaster.d.ts.map +1 -0
  318. package/build/components/toaster.js +52 -0
  319. package/build/components/toaster.js.map +1 -0
  320. package/build/components/uploader/consts.local.d.ts +4 -0
  321. package/build/components/uploader/consts.local.d.ts.map +1 -0
  322. package/build/components/uploader/consts.local.js +6 -0
  323. package/build/components/uploader/consts.local.js.map +1 -0
  324. package/build/components/uploader/image.d.ts.map +1 -1
  325. package/build/components/uploader/image.js +2 -6
  326. package/build/components/uploader/image.js.map +1 -1
  327. package/build/consent/component.d.ts +27 -0
  328. package/build/consent/component.d.ts.map +1 -0
  329. package/build/consent/component.js +60 -0
  330. package/build/consent/component.js.map +1 -0
  331. package/build/consent/consts.d.ts +2 -0
  332. package/build/consent/consts.d.ts.map +1 -0
  333. package/build/consent/consts.js +2 -0
  334. package/build/consent/consts.js.map +1 -0
  335. package/build/consent/consts.local.d.ts +9 -0
  336. package/build/consent/consts.local.d.ts.map +1 -0
  337. package/build/consent/consts.local.js +9 -0
  338. package/build/consent/consts.local.js.map +1 -0
  339. package/build/consent/geo.d.ts +17 -0
  340. package/build/consent/geo.d.ts.map +1 -0
  341. package/build/consent/geo.js +19 -0
  342. package/build/consent/geo.js.map +1 -0
  343. package/build/consent/index.d.ts +11 -0
  344. package/build/consent/index.d.ts.map +1 -0
  345. package/build/consent/index.js +9 -0
  346. package/build/consent/index.js.map +1 -0
  347. package/build/consent/language.d.ts +12 -0
  348. package/build/consent/language.d.ts.map +1 -0
  349. package/build/consent/language.js +11 -0
  350. package/build/consent/language.js.map +1 -0
  351. package/build/consent/menu-widget.d.ts +13 -0
  352. package/build/consent/menu-widget.d.ts.map +1 -0
  353. package/build/consent/menu-widget.js +20 -0
  354. package/build/consent/menu-widget.js.map +1 -0
  355. package/build/consent/presence.d.ts +30 -0
  356. package/build/consent/presence.d.ts.map +1 -0
  357. package/build/consent/presence.js +40 -0
  358. package/build/consent/presence.js.map +1 -0
  359. package/build/consent/service.d.ts +18 -0
  360. package/build/consent/service.d.ts.map +1 -0
  361. package/build/consent/service.js +53 -0
  362. package/build/consent/service.js.map +1 -0
  363. package/build/consent/translate.d.ts +14 -0
  364. package/build/consent/translate.d.ts.map +1 -0
  365. package/build/consent/translate.js +28 -0
  366. package/build/consent/translate.js.map +1 -0
  367. package/build/consent/types.d.ts +39 -0
  368. package/build/consent/types.d.ts.map +1 -0
  369. package/build/consent/types.js +2 -0
  370. package/build/consent/types.js.map +1 -0
  371. package/build/consent/types.local.d.ts +6 -0
  372. package/build/consent/types.local.d.ts.map +1 -0
  373. package/build/consent/types.local.js +2 -0
  374. package/build/consent/types.local.js.map +1 -0
  375. package/build/context.d.ts.map +1 -1
  376. package/build/context.js +10 -0
  377. package/build/context.js.map +1 -1
  378. package/build/editor/component.d.ts +4 -0
  379. package/build/editor/component.d.ts.map +1 -0
  380. package/build/editor/component.js +103 -0
  381. package/build/editor/component.js.map +1 -0
  382. package/build/editor/consts.local.d.ts +6 -0
  383. package/build/editor/consts.local.d.ts.map +1 -0
  384. package/build/editor/consts.local.js +58 -0
  385. package/build/editor/consts.local.js.map +1 -0
  386. package/build/editor/index.d.ts +3 -0
  387. package/build/editor/index.d.ts.map +1 -0
  388. package/build/editor/index.js +2 -0
  389. package/build/editor/index.js.map +1 -0
  390. package/build/editor/types.d.ts +24 -0
  391. package/build/editor/types.d.ts.map +1 -0
  392. package/build/editor/types.js +2 -0
  393. package/build/editor/types.js.map +1 -0
  394. package/build/entrypoints.d.ts +8 -0
  395. package/build/entrypoints.d.ts.map +1 -0
  396. package/build/entrypoints.js +4 -0
  397. package/build/entrypoints.js.map +1 -0
  398. package/build/exports.d.ts +6 -5
  399. package/build/exports.d.ts.map +1 -1
  400. package/build/exports.js +5 -5
  401. package/build/exports.js.map +1 -1
  402. package/build/index.d.ts +1 -1
  403. package/build/index.d.ts.map +1 -1
  404. package/build/index.js +1 -1
  405. package/build/index.js.map +1 -1
  406. package/build/main.d.ts +1 -4
  407. package/build/main.d.ts.map +1 -1
  408. package/build/main.js.map +1 -1
  409. package/build/modules.d.ts +1 -1
  410. package/build/modules.d.ts.map +1 -1
  411. package/build/permission/i18n/be.json +13 -0
  412. package/build/permission/i18n/de.json +13 -0
  413. package/build/permission/i18n/en.json +13 -0
  414. package/build/permission/i18n/es.json +13 -0
  415. package/build/permission/i18n/fr.json +13 -0
  416. package/build/permission/i18n/pl.json +13 -0
  417. package/build/permission/i18n/ru.json +13 -0
  418. package/build/permission/i18n/uk.json +13 -0
  419. package/build/permission/i18n.d.ts +2 -0
  420. package/build/permission/i18n.d.ts.map +1 -0
  421. package/build/permission/i18n.js +13 -0
  422. package/build/permission/i18n.js.map +1 -0
  423. package/build/permission/index.d.ts +6 -0
  424. package/build/permission/index.d.ts.map +1 -0
  425. package/build/permission/index.js +27 -0
  426. package/build/permission/index.js.map +1 -0
  427. package/build/permission/toast.d.ts +5 -0
  428. package/build/permission/toast.d.ts.map +1 -0
  429. package/build/permission/toast.js +8 -0
  430. package/build/permission/toast.js.map +1 -0
  431. package/build/permission/types.d.ts +6 -0
  432. package/build/permission/types.d.ts.map +1 -0
  433. package/build/permission/types.js +2 -0
  434. package/build/permission/types.js.map +1 -0
  435. package/build/picker/icons/consts.d.ts +9 -0
  436. package/build/picker/icons/consts.d.ts.map +1 -0
  437. package/build/picker/icons/consts.js +264 -0
  438. package/build/picker/icons/consts.js.map +1 -0
  439. package/build/picker/icons/types.d.ts +18 -0
  440. package/build/picker/icons/types.d.ts.map +1 -0
  441. package/build/picker/icons/types.js +2 -0
  442. package/build/picker/icons/types.js.map +1 -0
  443. package/build/picker/icons.d.ts +4 -0
  444. package/build/picker/icons.d.ts.map +1 -0
  445. package/build/picker/icons.js +54 -0
  446. package/build/picker/icons.js.map +1 -0
  447. package/build/picker/index.d.ts +11 -0
  448. package/build/picker/index.d.ts.map +1 -0
  449. package/build/picker/index.js +10 -0
  450. package/build/picker/index.js.map +1 -0
  451. package/build/picker/utils/color/types.d.ts +35 -0
  452. package/build/picker/utils/color/types.d.ts.map +1 -0
  453. package/build/picker/utils/color/types.js +2 -0
  454. package/build/picker/utils/color/types.js.map +1 -0
  455. package/build/picker/utils/color.d.ts +4 -0
  456. package/build/picker/utils/color.d.ts.map +1 -0
  457. package/build/picker/utils/color.js +96 -0
  458. package/build/picker/utils/color.js.map +1 -0
  459. package/build/picker/vocabulary/consts.d.ts +26 -0
  460. package/build/picker/vocabulary/consts.d.ts.map +1 -0
  461. package/build/picker/vocabulary/consts.js +336 -0
  462. package/build/picker/vocabulary/consts.js.map +1 -0
  463. package/build/picker/vocabulary/types.d.ts +67 -0
  464. package/build/picker/vocabulary/types.d.ts.map +1 -0
  465. package/build/picker/vocabulary/types.js +2 -0
  466. package/build/picker/vocabulary/types.js.map +1 -0
  467. package/build/picker/vocabulary.d.ts +11 -0
  468. package/build/picker/vocabulary.d.ts.map +1 -0
  469. package/build/picker/vocabulary.js +83 -0
  470. package/build/picker/vocabulary.js.map +1 -0
  471. package/build/scheme/consts.d.ts +8 -0
  472. package/build/scheme/consts.d.ts.map +1 -0
  473. package/build/scheme/consts.js +8 -0
  474. package/build/scheme/consts.js.map +1 -0
  475. package/build/scheme/index.d.ts +4 -0
  476. package/build/scheme/index.d.ts.map +1 -0
  477. package/build/scheme/index.js +3 -0
  478. package/build/scheme/index.js.map +1 -0
  479. package/build/scheme/scheme.d.ts +16 -0
  480. package/build/scheme/scheme.d.ts.map +1 -0
  481. package/build/scheme/scheme.js +58 -0
  482. package/build/scheme/scheme.js.map +1 -0
  483. package/build/scheme/types.d.ts +30 -0
  484. package/build/scheme/types.d.ts.map +1 -0
  485. package/build/scheme/types.js +2 -0
  486. package/build/scheme/types.js.map +1 -0
  487. package/build/types.d.ts +18 -2
  488. package/build/types.d.ts.map +1 -1
  489. package/package.json +107 -52
  490. package/src/@/components/ui/alert-dialog.tsx +156 -0
  491. package/src/@/components/ui/alert.tsx +1 -1
  492. package/src/@/components/ui/button.tsx +1 -1
  493. package/src/@/components/ui/card.tsx +1 -1
  494. package/src/@/components/ui/input.tsx +1 -1
  495. package/src/@/components/ui/label.tsx +1 -1
  496. package/src/@/components/ui/navigation-menu.tsx +1 -1
  497. package/src/@/components/ui/popover.tsx +47 -0
  498. package/src/@/components/ui/progress.tsx +1 -1
  499. package/src/@/components/ui/separator.tsx +1 -1
  500. package/src/@/components/ui/sheet.tsx +142 -0
  501. package/src/auth/context.ts +0 -2
  502. package/src/auth/entrypoints.ts +5 -0
  503. package/src/auth/exports.ts +4 -4
  504. package/src/auth/plugins/basic-ed25519.tsx +4 -4
  505. package/src/auth/plugins/re-captcha.tsx +3 -3
  506. package/src/auth/plugins/tunnel-consumer.tsx +1 -1
  507. package/src/components/block.tsx +2 -2
  508. package/src/components/consts.local.ts +29 -0
  509. package/src/components/footer/component.tsx +58 -16
  510. package/src/components/footer/credit.tsx +61 -0
  511. package/src/components/footer/index.ts +1 -0
  512. package/src/components/footer/types.ts +22 -1
  513. package/src/components/form/button/component.tsx +7 -4
  514. package/src/components/form/component.tsx +2 -2
  515. package/src/components/form/text/component.tsx +2 -2
  516. package/src/components/helper.ts +1 -13
  517. package/src/components/index.ts +4 -0
  518. package/src/components/link.tsx +3 -3
  519. package/src/components/login/append.ts +34 -0
  520. package/src/components/login/consts.local.ts +10 -0
  521. package/src/components/login/consts.ts +2 -0
  522. package/src/components/login/credit.tsx +33 -0
  523. package/src/components/login/i18n/be.json +10 -0
  524. package/src/components/login/i18n/de.json +10 -0
  525. package/src/components/login/i18n/en.json +10 -0
  526. package/src/components/login/i18n/es.json +10 -0
  527. package/src/components/login/i18n/fr.json +10 -0
  528. package/src/components/login/i18n/pl.json +10 -0
  529. package/src/components/login/i18n/ru.json +10 -0
  530. package/src/components/login/i18n/uk.json +10 -0
  531. package/src/components/login/i18n.ts +29 -0
  532. package/src/components/login/icons.tsx +39 -0
  533. package/src/components/login/index.ts +11 -0
  534. package/src/components/login/notify.ts +48 -0
  535. package/src/components/login/provider.tsx +57 -0
  536. package/src/components/login/screen.tsx +178 -0
  537. package/src/components/login/terms.tsx +75 -0
  538. package/src/components/login/types.ts +30 -0
  539. package/src/components/nav/consts.local.ts +64 -0
  540. package/src/components/nav/index.ts +1 -0
  541. package/src/components/nav/layout.tsx +184 -26
  542. package/src/components/nav/mobile.tsx +165 -0
  543. package/src/components/nav/side.tsx +43 -27
  544. package/src/components/nav/top.tsx +44 -22
  545. package/src/components/nav/types.ts +65 -2
  546. package/src/components/nav/viewport.ts +16 -0
  547. package/src/components/panel-app/component.tsx +9 -1
  548. package/src/components/picker/color-picker.tsx +15 -0
  549. package/src/components/picker/consts.local.ts +267 -0
  550. package/src/components/picker/dot.tsx +21 -0
  551. package/src/components/picker/grid.tsx +138 -0
  552. package/src/components/picker/i18n/be.json +60 -0
  553. package/src/components/picker/i18n/de.json +60 -0
  554. package/src/components/picker/i18n/en.json +60 -0
  555. package/src/components/picker/i18n/es.json +60 -0
  556. package/src/components/picker/i18n/fr.json +60 -0
  557. package/src/components/picker/i18n/pl.json +60 -0
  558. package/src/components/picker/i18n/ru.json +60 -0
  559. package/src/components/picker/i18n/uk.json +60 -0
  560. package/src/components/picker/i18n.ts +19 -0
  561. package/src/components/picker/icon-color-picker.tsx +25 -0
  562. package/src/components/picker/icon-picker.tsx +13 -0
  563. package/src/components/picker/index.ts +11 -0
  564. package/src/components/picker/panel.tsx +61 -0
  565. package/src/components/picker/root.tsx +81 -0
  566. package/src/components/picker/roving.ts +70 -0
  567. package/src/components/picker/surface.tsx +62 -0
  568. package/src/components/picker/swatches/custom.tsx +110 -0
  569. package/src/components/picker/swatches.tsx +67 -0
  570. package/src/components/picker/text.ts +46 -0
  571. package/src/components/picker/tile.tsx +35 -0
  572. package/src/components/picker/translate.ts +15 -0
  573. package/src/components/picker/trigger.tsx +54 -0
  574. package/src/components/picker/types.local.ts +154 -0
  575. package/src/components/picker/types.ts +125 -0
  576. package/src/components/scheme/consts.local.ts +13 -0
  577. package/src/components/scheme/hook.ts +62 -0
  578. package/src/components/scheme/index.ts +4 -0
  579. package/src/components/scheme/toggle.tsx +32 -0
  580. package/src/components/scheme/types.ts +23 -0
  581. package/src/components/socket/i18n/be.json +9 -0
  582. package/src/components/socket/i18n/de.json +9 -0
  583. package/src/components/socket/i18n/en.json +9 -0
  584. package/src/components/socket/i18n/es.json +9 -0
  585. package/src/components/socket/i18n/fr.json +9 -0
  586. package/src/components/socket/i18n/pl.json +9 -0
  587. package/src/components/socket/i18n/ru.json +9 -0
  588. package/src/components/socket/i18n/uk.json +9 -0
  589. package/src/components/socket/i18n.ts +19 -0
  590. package/src/components/socket/index.ts +2 -0
  591. package/src/components/socket/reload-dialog.tsx +61 -0
  592. package/src/components/status.tsx +1 -1
  593. package/src/components/text.tsx +2 -14
  594. package/src/components/toaster.tsx +65 -0
  595. package/src/components/uploader/consts.local.ts +7 -0
  596. package/src/components/uploader/image.tsx +2 -6
  597. package/src/consent/component.tsx +84 -0
  598. package/src/consent/consts.local.ts +10 -0
  599. package/src/consent/consts.ts +1 -0
  600. package/src/consent/geo.ts +26 -0
  601. package/src/consent/index.ts +24 -0
  602. package/src/consent/language.ts +12 -0
  603. package/src/consent/menu-widget.tsx +22 -0
  604. package/src/consent/presence.ts +45 -0
  605. package/src/consent/service.ts +75 -0
  606. package/src/consent/translate.ts +31 -0
  607. package/src/consent/types.local.ts +6 -0
  608. package/src/consent/types.ts +43 -0
  609. package/src/context.ts +12 -0
  610. package/src/editor/component.tsx +172 -0
  611. package/src/editor/consts.local.ts +62 -0
  612. package/src/editor/index.ts +2 -0
  613. package/src/editor/types.ts +24 -0
  614. package/src/entrypoints.ts +5 -0
  615. package/src/exports.ts +6 -5
  616. package/src/index.ts +1 -1
  617. package/src/main.tsx +2 -6
  618. package/src/permission/i18n/be.json +13 -0
  619. package/src/permission/i18n/de.json +13 -0
  620. package/src/permission/i18n/en.json +13 -0
  621. package/src/permission/i18n/es.json +13 -0
  622. package/src/permission/i18n/fr.json +13 -0
  623. package/src/permission/i18n/pl.json +13 -0
  624. package/src/permission/i18n/ru.json +13 -0
  625. package/src/permission/i18n/uk.json +13 -0
  626. package/src/permission/i18n.ts +13 -0
  627. package/src/permission/index.ts +27 -0
  628. package/src/permission/toast.tsx +20 -0
  629. package/src/permission/types.ts +5 -0
  630. package/src/picker/icons/consts.ts +309 -0
  631. package/src/picker/icons/types.ts +18 -0
  632. package/src/picker/icons.ts +70 -0
  633. package/src/picker/index.ts +11 -0
  634. package/src/picker/utils/color/types.ts +37 -0
  635. package/src/picker/utils/color.ts +119 -0
  636. package/src/picker/vocabulary/consts.ts +347 -0
  637. package/src/picker/vocabulary/types.ts +72 -0
  638. package/src/picker/vocabulary.ts +111 -0
  639. package/src/scheme/consts.ts +8 -0
  640. package/src/scheme/index.ts +3 -0
  641. package/src/scheme/scheme.ts +66 -0
  642. package/src/scheme/types.ts +30 -0
  643. package/src/types.ts +19 -2
  644. package/tests/consent-language.spec.ts +31 -0
  645. package/tests/consent.spec.ts +112 -0
  646. package/tests/context.ts +4 -0
  647. package/tests/editor.spec.ts +58 -0
  648. package/tests/harness/editor.tsx +32 -0
  649. package/tests/harness/index.html +1 -0
  650. package/tests/harness/lazy-screen.tsx +9 -0
  651. package/tests/harness/mount.tsx +370 -29
  652. package/tests/harness/picker.tsx +110 -0
  653. package/tests/lazy.spec.ts +104 -0
  654. package/tests/login-provider.spec.ts +114 -0
  655. package/tests/login.spec.ts +447 -0
  656. package/tests/nav.spec.ts +449 -3
  657. package/tests/package-boundary.spec.ts +19 -0
  658. package/tests/picker-shots.spec.ts +174 -0
  659. package/tests/picker-vocabulary.spec.ts +217 -0
  660. package/tests/picker.spec.ts +333 -0
  661. package/tests/scheme.spec.ts +149 -0
  662. package/tests/smoke.spec.ts +2 -2
  663. package/tests/socket-dialog.spec.ts +154 -0
  664. package/tests/toaster.spec.ts +59 -0
  665. package/zz-tw.d.mts +2 -0
  666. package/zz-tw.d.mts.map +1 -0
  667. package/build/.gitkeep +0 -0
  668. package/src/auth/modules.ts +0 -5
  669. package/src/modules.ts +0 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/components/picker/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACrD,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAErD,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { FC } from 'react';
2
+ import type { IconColorPickerProps } from './types.js';
3
+ /**
4
+ * The composite icon + colour picker — the standard editor of a mark a person chooses (a type's,
5
+ * a flow's, a label's). One trigger opens both halves: 24 swatches (plus a colour wheel and a hex
6
+ * field with `customColors`) and a searchable, categorized icon grid tinted in the chosen colour.
7
+ *
8
+ * Every pick commits at once: `onChange({ icon, color })` carries both halves as they now stand —
9
+ * a palette key or `#rrggbb`, a kebab-case lucide name; a half never chosen stays `undefined`. It
10
+ * opens as a popover from 768px up and as a bottom sheet below (`surface`), and stays open until
11
+ * Esc, a click outside or (on the sheet) Done.
12
+ */
13
+ export declare const IconColorPicker: FC<IconColorPickerProps>;
14
+ //# sourceMappingURL=icon-color-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-color-picker.d.ts","sourceRoot":"","sources":["../../../src/components/picker/icon-color-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAMtD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAOnD,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PickerRoot } from './root.js';
3
+ const present = (value) => value != null && value !== '' ? value : undefined;
4
+ /**
5
+ * The composite icon + colour picker — the standard editor of a mark a person chooses (a type's,
6
+ * a flow's, a label's). One trigger opens both halves: 24 swatches (plus a colour wheel and a hex
7
+ * field with `customColors`) and a searchable, categorized icon grid tinted in the chosen colour.
8
+ *
9
+ * Every pick commits at once: `onChange({ icon, color })` carries both halves as they now stand —
10
+ * a palette key or `#rrggbb`, a kebab-case lucide name; a half never chosen stays `undefined`. It
11
+ * opens as a popover from 768px up and as a bottom sheet below (`surface`), and stays open until
12
+ * Esc, a click outside or (on the sheet) Done.
13
+ */
14
+ export const IconColorPicker = ({ value, onChange, trigger = 'button', customColors = false, ...base }) => _jsx(PickerRoot, { ...base, mode: "both", trigger: trigger, customColors: customColors, closeOnPick: false, icon: value?.icon, color: value?.color, onIcon: icon => onChange({ icon, color: present(value?.color) }), onColor: color => onChange({ icon: present(value?.icon), color }) });
15
+ //# sourceMappingURL=icon-color-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-color-picker.js","sourceRoot":"","sources":["../../../src/components/picker/icon-color-picker.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,MAAM,OAAO,GAAG,CAAC,KAAgC,EAAsB,EAAE,CACvE,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAEnD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAA6B,CACvD,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,IAAI,EAAE,EACtE,EAAE,CAAC,KAAC,UAAU,OACV,IAAI,EAAE,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EACtF,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EACtC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAChE,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,GACjE,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { FC } from 'react';
2
+ import type { IconPickerProps } from './types.js';
3
+ /**
4
+ * The icon half alone: a trigger opening the searchable, categorized grid (tinted in `color`).
5
+ * Commits a kebab-case lucide name on click and closes.
6
+ */
7
+ export declare const IconPicker: FC<IconPickerProps>;
8
+ //# sourceMappingURL=icon-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-picker.d.ts","sourceRoot":"","sources":["../../../src/components/picker/icon-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAIvC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PickerRoot } from './root.js';
3
+ /**
4
+ * The icon half alone: a trigger opening the searchable, categorized grid (tinted in `color`).
5
+ * Commits a kebab-case lucide name on click and closes.
6
+ */
7
+ export const IconPicker = ({ value, onChange, color, trigger = 'button', ...base }) => _jsx(PickerRoot, { ...base, mode: "icon", trigger: trigger, closeOnPick: true, icon: value, color: color, onIcon: onChange, onColor: () => undefined });
8
+ //# sourceMappingURL=icon-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-picker.js","sourceRoot":"","sources":["../../../src/components/picker/icon-picker.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CACzG,KAAC,UAAU,OACL,IAAI,EAAE,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,WAAW,QAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAC7E,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,GAC1C,CAAA"}
@@ -0,0 +1,11 @@
1
+ export type * from './types.js';
2
+ export * from './icon-color-picker.js';
3
+ export * from './icon-picker.js';
4
+ export * from './color-picker.js';
5
+ export { ColorSwatches } from './swatches.js';
6
+ export { IconGrid } from './grid.js';
7
+ export * from './tile.js';
8
+ export * from './dot.js';
9
+ export * from './translate.js';
10
+ export * from './i18n.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/picker/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,10 @@
1
+ export * from './icon-color-picker.js';
2
+ export * from './icon-picker.js';
3
+ export * from './color-picker.js';
4
+ export { ColorSwatches } from './swatches.js';
5
+ export { IconGrid } from './grid.js';
6
+ export * from './tile.js';
7
+ export * from './dot.js';
8
+ export * from './translate.js';
9
+ export * from './i18n.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/picker/index.ts"],"names":[],"mappings":"AAEA,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { FC } from 'react';
2
+ import type { PickerPanelProps } from './types.local.js';
3
+ /**
4
+ * A picker's content: a preview header (the mark as it will render, the title, the current choice
5
+ * — and on the sheet a 44px Done button), then the swatches and the icon grid, scrolling between a
6
+ * fixed header and the surface's edge.
7
+ */
8
+ export declare const PickerPanel: FC<PickerPanelProps>;
9
+ //# sourceMappingURL=panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../src/components/picker/panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAQxD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2C5C,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PlusIcon } from 'lucide-react';
3
+ import { cn } from '../../@/lib/utils.js';
4
+ import { pickerColorHelper } from '../../picker/vocabulary.js';
5
+ import { IconBrowser } from './grid.js';
6
+ import { SwatchGrid } from './swatches.js';
7
+ import { IconTile } from './tile.js';
8
+ import { BODY, DONE, HAIRLINE, HEADER, HEADER_SUMMARY, HEADER_TITLE, ICON_GRID_PAD, SECTION, SECTION_TITLE, TRIGGER_EMPTY, } from './consts.local.js';
9
+ /**
10
+ * A picker's content: a preview header (the mark as it will render, the title, the current choice
11
+ * — and on the sheet a 44px Done button), then the swatches and the icon grid, scrolling between a
12
+ * fixed header and the surface's edge.
13
+ */
14
+ export const PickerPanel = ({ mode, icon, color, onIcon, onColor, onCustomColor, colors, icons, customColors, text, layout, title, onDone, searchRef, }) => {
15
+ const resolved = pickerColorHelper.resolve(color, colors);
16
+ const summary = text.summary(icon, resolved, mode) ?? text.text('nothing', 'Nothing chosen yet');
17
+ return _jsxs("div", { "data-picker-panel": true, className: "flex min-h-0 flex-1 flex-col", children: [_jsxs("div", { className: HEADER[layout], children: [mode === 'color'
18
+ ? _jsx("span", { "aria-hidden": "true", style: pickerColorHelper.styleOf(color, colors), className: cn('size-12 shrink-0 rounded-full bg-(--pick-swatch)', HAIRLINE, resolved == null && 'opacity-40') })
19
+ : (icon == null || icon === '') && resolved == null
20
+ ? _jsx("span", { "aria-hidden": "true", className: cn(TRIGGER_EMPTY, 'size-12 rounded-xl [&>svg]:size-5'), children: _jsx(PlusIcon, {}) })
21
+ : _jsx(IconTile, { icon: icon, color: color, colors: colors, size: "lg" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { "aria-hidden": "true", className: HEADER_TITLE, children: title }), _jsx("p", { "data-picker-summary": true, className: HEADER_SUMMARY, children: summary })] }), onDone != null && _jsx("button", { type: "button", "data-picker-done": true, "aria-label": text.text('done', 'Done'), onClick: onDone, className: DONE, children: text.text('done', 'Done') })] }), _jsxs("div", { "data-picker-scroll": true, className: BODY, children: [mode !== 'icon' && _jsxs("section", { className: cn(SECTION[layout], mode === 'color' && ICON_GRID_PAD[layout]), children: [mode === 'both' && _jsx("h3", { className: SECTION_TITLE, children: text.text('color', 'Colour') }), _jsx(SwatchGrid, { value: color, onChange: onColor, onCustomChange: onCustomColor, colors: colors, customColors: customColors, text: text, layout: layout, label: text.text('color', 'Colour') })] }), mode !== 'color' && _jsxs("section", { className: cn(SECTION[layout], ICON_GRID_PAD[layout]), children: [mode === 'both' && _jsx("h3", { className: SECTION_TITLE, children: text.text('icon', 'Icon') }), _jsx(IconBrowser, { value: icon, onChange: onIcon, color: color, colors: colors, icons: icons, text: text, layout: layout, label: text.text('icon', 'Icon'), searchRef: searchRef })] })] })] });
22
+ };
23
+ //# sourceMappingURL=panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel.js","sourceRoot":"","sources":["../../../src/components/picker/panel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA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AAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,aAChF,IAAI,KAAK,MAAM,IAAI,aAAI,SAAS,EAAE,aAAa,YAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAAM,EAClF,KAAC,WAAW,IACV,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EACrG,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,GACtD,IACM,IACN,IACF,CAAA;AACR,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { FC } from 'react';
2
+ import type { PickerRootProps } from './types.local.js';
3
+ /**
4
+ * The state every picker shares: open or closed, and on which surface.
5
+ *
6
+ * `surface="auto"` is decided when the picker OPENS — a popover from 768px up, a sheet below — and
7
+ * kept until it closes, so a resize or an on-screen keyboard never swaps the surface under the
8
+ * person's finger. Picks commit at once through `onIcon` / `onColor`; a single-purpose picker then
9
+ * closes, the composite stays open for its other half. On open, a fine pointer lands in the search
10
+ * field; anything else on the selected cell (no keyboard pops up on a phone).
11
+ */
12
+ export declare const PickerRoot: FC<PickerRootProps>;
13
+ //# sourceMappingURL=root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../src/components/picker/root.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAUvD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA0D1C,CAAA"}
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo, useRef, useState } from 'react';
3
+ import { PICKER_COLORS } from '../../picker/vocabulary/consts.js';
4
+ import { PickerPanel } from './panel.js';
5
+ import { PickerSurface } from './surface.js';
6
+ import { PickerTrigger } from './trigger.js';
7
+ import { makePickerText } from './text.js';
8
+ import { FINE_POINTER_QUERY, POPOVER_QUERY } from './consts.local.js';
9
+ const matches = (query) => typeof window !== 'undefined' && typeof window.matchMedia === 'function' && window.matchMedia(query).matches;
10
+ /**
11
+ * The state every picker shares: open or closed, and on which surface.
12
+ *
13
+ * `surface="auto"` is decided when the picker OPENS — a popover from 768px up, a sheet below — and
14
+ * kept until it closes, so a resize or an on-screen keyboard never swaps the surface under the
15
+ * person's finger. Picks commit at once through `onIcon` / `onColor`; a single-purpose picker then
16
+ * closes, the composite stays open for its other half. On open, a fine pointer lands in the search
17
+ * field; anything else on the selected cell (no keyboard pops up on a phone).
18
+ */
19
+ export const PickerRoot = ({ mode, icon, color, onIcon, onColor, colors = PICKER_COLORS, icons, customColors = false, trigger, closeOnPick, label, placeholder, disabled, surface = 'auto', translate, className, id, }) => {
20
+ const text = useMemo(() => makePickerText(translate), [translate]);
21
+ const [open, setOpen] = useState(false);
22
+ const [kind, setKind] = useState('popover');
23
+ const triggerRef = useRef(null);
24
+ const searchRef = useRef(null);
25
+ const title = label != null && label !== ''
26
+ ? label
27
+ : mode === 'both' ? text.text('label', 'Icon and colour')
28
+ : mode === 'icon' ? text.text('icon', 'Icon') : text.text('color', 'Colour');
29
+ const hint = placeholder ?? (mode === 'both' ? text.text('placeholder.both', 'Choose icon and colour')
30
+ : mode === 'icon' ? text.text('placeholder.icon', 'Choose an icon') : text.text('placeholder.color', 'Choose a colour'));
31
+ const show = () => {
32
+ if (disabled === true) {
33
+ return;
34
+ }
35
+ setKind(surface === 'auto' ? (matches(POPOVER_QUERY) ? 'popover' : 'sheet') : surface);
36
+ setOpen(true);
37
+ };
38
+ const picked = (apply) => (value) => {
39
+ apply(value);
40
+ if (closeOnPick) {
41
+ setOpen(false);
42
+ }
43
+ };
44
+ const onOpenFocus = (content) => {
45
+ const search = searchRef.current;
46
+ if (search != null && matches(FINE_POINTER_QUERY)) {
47
+ search.focus();
48
+ return;
49
+ }
50
+ ;
51
+ (content.querySelector('[data-roving-item][tabindex="0"]') ?? content).focus();
52
+ };
53
+ return _jsx(PickerSurface, { open: open, onOpenChange: setOpen, kind: kind, tall: mode !== 'color', title: title, onOpenFocus: onOpenFocus, onCloseFocus: () => triggerRef.current?.focus(), anchor: _jsx(PickerTrigger, { ref: triggerRef, mode: mode, variant: trigger, icon: icon, color: color, colors: colors, text: text, label: label, placeholder: hint, open: open, disabled: disabled, id: id, className: className, onOpen: show }), children: _jsx(PickerPanel, { mode: mode, icon: icon, color: color, onIcon: picked(onIcon), onColor: picked(onColor), onCustomColor: onColor, colors: colors, icons: icons, customColors: customColors, text: text, layout: kind, title: title, onDone: kind === 'sheet' ? () => setOpen(false) : undefined, searchRef: searchRef }) });
54
+ };
55
+ //# sourceMappingURL=root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.js","sourceRoot":"","sources":["../../../src/components/picker/root.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAErE,MAAM,OAAO,GAAG,CAAC,KAAa,EAAW,EAAE,CACzC,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU,IAAI,M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AI,KAAK,OAAO,EAAE,KAAK,EAAE,KAAK,EACnF,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,EACzE,MAAM,EAAE,KAAC,aAAa,IACpB,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EACnG,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,GAC3G,YAEF,KAAC,WAAW,IACV,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,EAC9G,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAChG,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,GACjF,GACY,CAAA;AAClB,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { RovingGrid, RovingGridOptions } from './types.local.js';
2
+ /**
3
+ * Arrow-key focus across the buttons of a grid (or one row): a single tab stop, the arrows move
4
+ * within it — Left/Right along, Up/Down a whole row (counted from the layout, so it follows
5
+ * whatever the CSS grid wrapped to), Home/End to the ends. Enter and Space are the buttons' own.
6
+ */
7
+ export declare const useRovingGrid: ({ count, selected, onExitUp, grid }: RovingGridOptions) => RovingGrid;
8
+ //# sourceMappingURL=roving.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roving.d.ts","sourceRoot":"","sources":["../../../src/components/picker/roving.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAKrE;;;;GAIG;AACH,eAAO,MAAM,aAAa,wCAAgD,iBAAiB,KAAG,UAyD7F,CAAA"}
@@ -0,0 +1,62 @@
1
+ import { useCallback, useRef, useState } from 'react';
2
+ /** What marks a roving item inside the container. */
3
+ const ITEM = '[data-roving-item]';
4
+ /**
5
+ * Arrow-key focus across the buttons of a grid (or one row): a single tab stop, the arrows move
6
+ * within it — Left/Right along, Up/Down a whole row (counted from the layout, so it follows
7
+ * whatever the CSS grid wrapped to), Home/End to the ends. Enter and Space are the buttons' own.
8
+ */
9
+ export const useRovingGrid = ({ count, selected, onExitUp, grid = true }) => {
10
+ const ref = useRef(null);
11
+ const [current, setCurrent] = useState(null);
12
+ const active = Math.min(Math.max(current ?? selected, 0), Math.max(count - 1, 0));
13
+ const items = () => Array.from(ref.current?.querySelectorAll(ITEM) ?? []);
14
+ const columnsOf = (list) => {
15
+ const top = list[0]?.offsetTop;
16
+ const first = list.findIndex(item => item.offsetTop !== top);
17
+ return first < 0 ? list.length : Math.max(first, 1);
18
+ };
19
+ const onKeyDown = (event) => {
20
+ if (event.altKey || event.ctrlKey || event.metaKey) {
21
+ return;
22
+ }
23
+ const list = items();
24
+ const from = list.indexOf(event.target);
25
+ if (from < 0) {
26
+ return;
27
+ }
28
+ const columns = grid ? columnsOf(list) : list.length;
29
+ const step = {
30
+ ArrowRight: 1, ArrowLeft: -1, ...(grid ? { ArrowDown: columns, ArrowUp: -columns } : {}),
31
+ };
32
+ let to;
33
+ if (event.key === 'Home') {
34
+ to = 0;
35
+ }
36
+ else if (event.key === 'End') {
37
+ to = list.length - 1;
38
+ }
39
+ else if (event.key in step) {
40
+ to = from + step[event.key];
41
+ if (event.key === 'ArrowUp' && to < 0 && onExitUp != null) {
42
+ event.preventDefault();
43
+ onExitUp();
44
+ return;
45
+ }
46
+ to = Math.min(Math.max(to, 0), list.length - 1);
47
+ }
48
+ else {
49
+ return;
50
+ }
51
+ event.preventDefault();
52
+ setCurrent(to);
53
+ list[to]?.focus();
54
+ };
55
+ const tabIndexOf = (index) => index === active ? 0 : -1;
56
+ const focusCurrent = useCallback(() => {
57
+ const list = items();
58
+ (list.find(item => item.tabIndex === 0) ?? list[0])?.focus();
59
+ }, []);
60
+ return { ref, onKeyDown, tabIndexOf, setCurrent, focusCurrent };
61
+ };
62
+ //# sourceMappingURL=roving.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roving.js","sourceRoot":"","sources":["../../../src/components/picker/roving.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAIrD,qDAAqD;AACrD,MAAM,IAAI,GAAG,oBAAoB,CAAA;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,EAAqB,EAAc,EAAE;IACzG,MAAM,GAAG,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAA;IAC/C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAEjF,MAAM,KAAK,GAAG,GAAkB,EAAE,CAAC,KAAK,CAAC,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EN,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,CAAA;AACjE,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { FC } from 'react';
2
+ import type { PickerSurfaceProps } from './types.local.js';
3
+ /**
4
+ * Where a picker's panel opens: a popover beside the trigger, or a sheet from the bottom edge.
5
+ *
6
+ * The popover is MODAL. That is what makes it work inside an application's own Dialog or Sheet:
7
+ * the topmost scroll lock and focus scope are its own, so the mouse wheel scrolls it and focus stays
8
+ * in it, where a non-modal one portalled outside the dialog is locked out of both. It keeps 12px off
9
+ * the viewport's edges and never grows past the space it has (`--radix-popover-content-available-height`),
10
+ * scrolling inside instead.
11
+ *
12
+ * The sheet has no close cross: a grab handle, the panel's own Done button, Esc, or a tap outside
13
+ * close it. Both surfaces state their own colours (`bg-popover text-popover-foreground`) — they are
14
+ * portalled to the document body and inherit nothing. Focus goes in on open and back to the trigger
15
+ * on close, by hand, because the trigger is an anchor rather than a Radix trigger.
16
+ */
17
+ export declare const PickerSurface: FC<PickerSurfaceProps>;
18
+ //# sourceMappingURL=surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../src/components/picker/surface.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAG1D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAuChD,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ import { cn } from '../../@/lib/utils.js';
4
+ import { Popover, PopoverAnchor, PopoverContent } from '../../@/components/ui/popover.js';
5
+ import { Sheet, SheetContent, SheetTitle } from '../../@/components/ui/sheet.js';
6
+ import { GRAB, POPOVER, SHEET, TALL } from './consts.local.js';
7
+ /**
8
+ * Where a picker's panel opens: a popover beside the trigger, or a sheet from the bottom edge.
9
+ *
10
+ * The popover is MODAL. That is what makes it work inside an application's own Dialog or Sheet:
11
+ * the topmost scroll lock and focus scope are its own, so the mouse wheel scrolls it and focus stays
12
+ * in it, where a non-modal one portalled outside the dialog is locked out of both. It keeps 12px off
13
+ * the viewport's edges and never grows past the space it has (`--radix-popover-content-available-height`),
14
+ * scrolling inside instead.
15
+ *
16
+ * The sheet has no close cross: a grab handle, the panel's own Done button, Esc, or a tap outside
17
+ * close it. Both surfaces state their own colours (`bg-popover text-popover-foreground`) — they are
18
+ * portalled to the document body and inherit nothing. Focus goes in on open and back to the trigger
19
+ * on close, by hand, because the trigger is an anchor rather than a Radix trigger.
20
+ */
21
+ export const PickerSurface = ({ open, onOpenChange, kind, tall, anchor, title, onOpenFocus, onCloseFocus, children }) => {
22
+ const popover = useRef(null);
23
+ const sheet = useRef(null);
24
+ const focusIn = (content) => (event) => {
25
+ event.preventDefault();
26
+ if (content != null) {
27
+ onOpenFocus(content);
28
+ }
29
+ };
30
+ const focusBack = (event) => {
31
+ event.preventDefault();
32
+ onCloseFocus();
33
+ };
34
+ return _jsxs(_Fragment, { children: [_jsxs(Popover, { open: open && kind === 'popover', onOpenChange: onOpenChange, modal: true, children: [_jsx(PopoverAnchor, { asChild: true, children: anchor }), _jsx(PopoverContent, { ref: popover, "data-picker-surface": "popover", "aria-label": title, align: "start", sideOffset: 6, collisionPadding: 12, onOpenAutoFocus: event => focusIn(popover.current)(event), onCloseAutoFocus: focusBack, className: cn(POPOVER, tall && TALL.popover), children: kind === 'popover' && children })] }), _jsx(Sheet, { open: open && kind === 'sheet', onOpenChange: onOpenChange, children: _jsxs(SheetContent, { ref: sheet, side: "bottom", showCloseButton: false, "aria-describedby": undefined, "data-picker-surface": "sheet", onOpenAutoFocus: event => focusIn(sheet.current)(event), onCloseAutoFocus: focusBack, className: cn(SHEET, tall && TALL.sheet), children: [_jsx(SheetTitle, { className: "sr-only", children: title }), _jsx("div", { "aria-hidden": "true", className: GRAB }), kind === 'sheet' && children] }) })] });
35
+ };
36
+ //# sourceMappingURL=surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.js","sourceRoot":"","sources":["../../../src/components/picker/surface.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACzF,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAEhF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE9D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,CACnD,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,EACtF,EAAE;IACF,MAAM,OAAO,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAA;IACnD,MAAM,KAAK,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAA;IAEjD,MAAM,OAAO,GAAG,CAAC,OAA8B,EAAE,EAAE,CAAC,CAAC,KAAY,EAAQ,EAAE;QACzE,KAAK,CAAC,cAAc,EAAE,CAAA;QACtB,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,WAAW,CAAC,OAAO,CAAC,CAAA;QACtB,CAAC;IACH,CAAC,CAAA;IACD,MAAM,SAAS,GAAG,CAAC,KAAY,EAAQ,EAAE;QACvC,KAAK,CAAC,cAAc,EAAE,CAAA;QACtB,YAAY,EAAE,CAAA;IAChB,CAAC,CAAA;I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';
3
+ /**
4
+ * The opt-in custom colour: a row that opens a colour wheel (react-colorful — accessible sliders,
5
+ * touch) and a hex field. The wheel commits as it moves, like a native colour input; the field
6
+ * commits a full `#rrggbb` while typing and a short `#rgb` on Enter or blur, always normalized to
7
+ * lowercase six digits. Anything else marks the field invalid and changes nothing.
8
+ */
9
+ export declare const CustomColor: FC<CustomColorProps>;
10
+ //# sourceMappingURL=custom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../../../src/components/picker/swatches/custom.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,EAAE,EAAiB,MAAM,OAAO,CAAA;AAK3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAMzD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2F5C,CAAA"}
@@ -0,0 +1,65 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useId, useRef, useState } from 'react';
3
+ import { ChevronDownIcon } from 'lucide-react';
4
+ import { HexColorPicker } from 'react-colorful';
5
+ import { cn } from '../../../@/lib/utils.js';
6
+ import { pickerColorHelper } from '../../../picker/vocabulary.js';
7
+ import { CUSTOM_DISC, CUSTOM_PANEL, CUSTOM_ROW, CUSTOM_START, FIELD, FIELD_ERROR, FULL_HEX, HAIRLINE, HEX_FIELD, RAINBOW, SWATCH_SELECTED, WHEEL_STYLE, } from '../consts.local.js';
8
+ /**
9
+ * The opt-in custom colour: a row that opens a colour wheel (react-colorful — accessible sliders,
10
+ * touch) and a hex field. The wheel commits as it moves, like a native colour input; the field
11
+ * commits a full `#rrggbb` while typing and a short `#rgb` on Enter or blur, always normalized to
12
+ * lowercase six digits. Anything else marks the field invalid and changes nothing.
13
+ */
14
+ export const CustomColor = ({ value, onChange, text }) => {
15
+ const [open, setOpen] = useState(value != null);
16
+ const [draft, setDraft] = useState(value?.key ?? '');
17
+ const [checked, setChecked] = useState(false);
18
+ const typing = useRef(false);
19
+ const panelId = useId();
20
+ const errorId = useId();
21
+ // Follow the committed value, but never under the person's fingers.
22
+ useEffect(() => {
23
+ if (!typing.current) {
24
+ setDraft(value?.key ?? '');
25
+ }
26
+ }, [value?.key]);
27
+ const normalized = pickerColorHelper.normalizeHex(draft);
28
+ const invalid = checked && draft.trim() !== '' && normalized == null;
29
+ const label = text.text('custom', 'Custom colour');
30
+ const commit = (hex) => {
31
+ if (hex !== value?.key) {
32
+ onChange(hex);
33
+ }
34
+ };
35
+ const onText = (event) => {
36
+ const next = event.target.value;
37
+ setDraft(next);
38
+ setChecked(false);
39
+ const full = FULL_HEX.test(next.trim()) ? pickerColorHelper.normalizeHex(next) : null;
40
+ if (full != null) {
41
+ commit(full);
42
+ }
43
+ };
44
+ const settle = () => {
45
+ setChecked(true);
46
+ if (normalized != null) {
47
+ setDraft(normalized);
48
+ commit(normalized);
49
+ }
50
+ };
51
+ const onKey = (event) => {
52
+ if (event.key === 'Enter') {
53
+ // Never the enclosing form's submit.
54
+ event.preventDefault();
55
+ settle();
56
+ }
57
+ };
58
+ const onWheel = (hex) => {
59
+ setDraft(hex);
60
+ setChecked(false);
61
+ commit(hex);
62
+ };
63
+ return _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", "data-picker-color": "custom", "data-selected": value != null || undefined, "aria-label": value != null ? `${label}: ${value.label}` : label, "aria-expanded": open, "aria-controls": open ? panelId : undefined, onClick: () => setOpen(!open), className: CUSTOM_ROW, children: [_jsx("span", { "aria-hidden": "true", style: value != null ? pickerColorHelper.styleOf(value.key) : undefined, className: cn(CUSTOM_DISC, HAIRLINE, value != null ? 'bg-(--pick-swatch)' : RAINBOW, value != null && SWATCH_SELECTED) }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), value != null && _jsx("span", { className: "font-mono text-xs text-muted-foreground", children: value.label }), _jsx(ChevronDownIcon, { "aria-hidden": "true", className: cn('size-4 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none', open && 'rotate-180') })] }), open && _jsxs("div", { id: panelId, className: CUSTOM_PANEL, children: [_jsx(HexColorPicker, { color: normalized ?? value?.key ?? CUSTOM_START, onChange: onWheel, style: WHEEL_STYLE }), _jsx("input", { "data-picker-hex": true, type: "text", inputMode: "text", autoComplete: "off", autoCapitalize: "off", spellCheck: false, enterKeyHint: "done", maxLength: 7, placeholder: CUSTOM_START, "aria-label": text.text('hex', 'Hex colour'), "aria-invalid": invalid || undefined, "aria-describedby": invalid ? errorId : undefined, value: draft, onChange: onText, onKeyDown: onKey, onFocus: () => { typing.current = true; }, onBlur: () => { typing.current = false; settle(); }, className: cn(FIELD, HEX_FIELD) }), invalid && _jsx("p", { id: errorId, className: FIELD_ERROR, children: text.text('invalidHex', 'Enter a colour like #3b82f6') })] })] });
64
+ };
65
+ //# sourceMappingURL=custom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.js","sourceRoot":"","sources":["../../../../src/components/picker/swatches/custom.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,EACL,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAC/G,eAAe,EAAE,WAAW,GAC7B,MAAM,oBAAoB,CAAA;AAE3B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,I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,KAAK,EAChD,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA,CAAC,CAAC,EACxC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,CAAA,CAAC,CAAC,EAClD,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,GAC/B,EACD,OAAO,IAAI,YAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,YAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,6BAA6B,CAAC,GAAK,IAC5G,IACL,CAAA;AACL,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { FC } from 'react';
2
+ import type { ColorSwatchesProps } from './types.js';
3
+ import type { SwatchGridProps } from './types.local.js';
4
+ /**
5
+ * The swatch grid every picker shares, laid out for its surface: twelve to a row in a popover,
6
+ * as many 44px cells as fit in a sheet or below 768px. One tab stop; the arrows move in two
7
+ * dimensions. A swatch is a `<button type="button">` named by its colour and pressed while chosen.
8
+ */
9
+ export declare const SwatchGrid: FC<SwatchGridProps>;
10
+ /**
11
+ * The colour swatches inline — for a dialog or sheet the application already owns. Commits on
12
+ * click; `customColors` adds the colour wheel and hex field. Strings through `translate` (English
13
+ * without it — never an implicit i18n read).
14
+ */
15
+ export declare const ColorSwatches: FC<ColorSwatchesProps>;
16
+ //# sourceMappingURL=swatches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatches.d.ts","sourceRoot":"","sources":["../../../src/components/picker/swatches.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAMvD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiC1C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAShD,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { cn } from '../../@/lib/utils.js';
4
+ import { pickerColorHelper } from '../../picker/vocabulary.js';
5
+ import { PICKER_COLORS } from '../../picker/vocabulary/consts.js';
6
+ import { CustomColor } from './swatches/custom.js';
7
+ import { useRovingGrid } from './roving.js';
8
+ import { makePickerText } from './text.js';
9
+ import { PICK_SCOPE, SWATCH, SWATCH_DISC, SWATCH_SELECTED, SWATCHES } from './consts.local.js';
10
+ /**
11
+ * The swatch grid every picker shares, laid out for its surface: twelve to a row in a popover,
12
+ * as many 44px cells as fit in a sheet or below 768px. One tab stop; the arrows move in two
13
+ * dimensions. A swatch is a `<button type="button">` named by its colour and pressed while chosen.
14
+ */
15
+ export const SwatchGrid = ({ value, onChange, onCustomChange, colors, customColors, text, layout, label, className }) => {
16
+ const resolved = pickerColorHelper.resolve(value, colors);
17
+ const selected = resolved == null || resolved.custom ? -1 : colors.findIndex(color => color.key === resolved.key);
18
+ const roving = useRovingGrid({ count: colors.length, selected });
19
+ return _jsxs("div", { className: className, children: [_jsx("div", { ref: roving.ref, role: "group", "aria-label": label, onKeyDown: roving.onKeyDown, "data-picker-swatches": true, className: SWATCHES[layout], children: colors.map((color, index) => {
20
+ const named = pickerColorHelper.resolve(color.key, colors);
21
+ const name = named != null ? text.color(named) : color.key;
22
+ const chosen = index === selected;
23
+ return _jsx("button", { type: "button", "data-roving-item": true, "data-picker-color": color.key, "aria-label": name, "aria-pressed": chosen, title: name, tabIndex: roving.tabIndexOf(index), onFocus: () => roving.setCurrent(index), onClick: () => onChange(color.key), style: pickerColorHelper.styleOf(color.key, colors), className: cn(PICK_SCOPE, SWATCH), children: _jsx("span", { "aria-hidden": "true", className: cn(SWATCH_DISC, chosen && SWATCH_SELECTED) }) }, color.key);
24
+ }) }), customColors && _jsx(CustomColor, { value: resolved?.custom === true ? resolved : null, onChange: onCustomChange ?? onChange, text: text })] });
25
+ };
26
+ /**
27
+ * The colour swatches inline — for a dialog or sheet the application already owns. Commits on
28
+ * click; `customColors` adds the colour wheel and hex field. Strings through `translate` (English
29
+ * without it — never an implicit i18n read).
30
+ */
31
+ export const ColorSwatches = ({ value, onChange, colors = PICKER_COLORS, customColors = false, translate, label, className }) => {
32
+ const text = useMemo(() => makePickerText(translate), [translate]);
33
+ return _jsx(SwatchGrid, { value: value, onChange: onChange, colors: colors, customColors: customColors, text: text, layout: "inline", label: label ?? text.text('color', 'Colour'), className: className });
34
+ };
35
+ //# sourceMappingURL=swatches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatches.js","sourceRoot":"","sources":["../../../src/components/picker/swatches.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE9F;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAwB,CAC7C,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EACzF,EAAE;IACF,MAAM,QAAQ,GAAG,iBAAiB,C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,GAAG,CAAC,EAClC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,EACnD,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,YAEjC,8BAAkB,MAAM,EAAC,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,eAAe,CAAC,GAAI,IAP7E,KAAK,CAAC,GAAG,CAQP,CAAA;gBACX,CAAC,CAAC,GACE,EACL,YAAY,IAAI,KAAC,WAAW,IAC3B,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,cAAc,IAAI,QAAQ,EAAE,IAAI,EAAE,IAAI,GACpG,IACE,CAAA;AACR,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,CACnD,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,EAAE,YAAY,GAAG,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,EAC9F,EAAE;IACF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAElE,OAAO,KAAC,UAAU,IAChB,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EACzG,KAAK,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,GAClE,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { PickerTranslate } from './types.js';
2
+ import type { PickerText } from './types.local.js';
3
+ /** Every string a picker shows, through one `translate` (English without one). Built once per render. */
4
+ export declare const makePickerText: (translate?: PickerTranslate) => PickerText;
5
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/picker/text.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAU9D,yGAAyG;AACzG,eAAO,MAAM,cAAc,eAAe,eAAe,KAAa,UA+BrE,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { PICKER_COLORS } from '../../picker/vocabulary/consts.js';
2
+ const english = (_key, fallback) => fallback;
3
+ const humanize = (name) => {
4
+ const words = name.replace(/-/g, ' ');
5
+ return words === '' ? name : words[0].toUpperCase() + words.slice(1);
6
+ };
7
+ /** Every string a picker shows, through one `translate` (English without one). Built once per render. */
8
+ export const makePickerText = (translate = english) => {
9
+ const text = (key, fallback) => translate(key, fallback);
10
+ // Only the palette's own names translate; an application palette's labels are shown as given
11
+ // (a status palette may well have a key called `red` labelled "Blocked").
12
+ const color = (resolved) => !resolved.custom && PICKER_COLORS.some(entry => entry.key === resolved.key && entry.label === resolved.label)
13
+ ? translate(`colors.${resolved.key}`, resolved.label)
14
+ : resolved.label;
15
+ const icon = (name) => humanize(name);
16
+ const category = (value) => translate(`categories.${value}`, humanize(value));
17
+ // Filled after translation: a `{count}` placeholder is never one i18next interpolates or strips.
18
+ const count = (value) => translate('results', 'Icons found: {count}').replace('{count}', String(value));
19
+ const empty = (query) => translate('empty', 'No icons match “{query}”').replace('{query}', query);
20
+ const summary = (iconName, resolved, mode) => {
21
+ const parts = [
22
+ mode !== 'color' && iconName != null && iconName !== '' ? icon(iconName) : null,
23
+ mode !== 'icon' && resolved != null ? color(resolved) : null,
24
+ ].filter((part) => part != null);
25
+ return parts.length > 0 ? parts.join(' · ') : null;
26
+ };
27
+ return { text, color, icon, category, count, empty, summary };
28
+ };
29
+ //# sourceMappingURL=text.js.map