@kumix/ui 0.4.0 → 0.4.2

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 (402) hide show
  1. package/README.md +52 -45
  2. package/dist/{cascader-types-DVT-znZ-.d.ts → cascader-types-zhnUQ4sP.d.ts} +11 -3
  3. package/dist/cascader-types-zhnUQ4sP.d.ts.map +1 -0
  4. package/dist/components/agents/agent-code.js +1 -1
  5. package/dist/components/agents/approval-card/index.d.ts +2 -0
  6. package/dist/components/agents/approval-card/index.d.ts.map +1 -1
  7. package/dist/components/agents/approval-card/index.js +2 -0
  8. package/dist/components/agents/approval-card/index.js.map +1 -1
  9. package/dist/components/agents/citations.d.ts +14 -2
  10. package/dist/components/agents/citations.d.ts.map +1 -1
  11. package/dist/components/agents/citations.js +11 -7
  12. package/dist/components/agents/citations.js.map +1 -1
  13. package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
  14. package/dist/components/agents/loading-states/reasoning-text.js +3 -0
  15. package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
  16. package/dist/components/charts/bump-chart/context.js +1 -2
  17. package/dist/components/charts/bump-chart/plot.js +1 -2
  18. package/dist/components/charts/bump-chart/point.js +1 -1
  19. package/dist/components/charts/bump-chart/series.d.ts +1 -0
  20. package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
  21. package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
  22. package/dist/components/charts/candlestick-chart/context.js +69 -0
  23. package/dist/components/charts/candlestick-chart/context.js.map +1 -0
  24. package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
  25. package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
  26. package/dist/components/charts/candlestick-chart/legend.js +56 -0
  27. package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
  28. package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
  29. package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
  30. package/dist/components/charts/candlestick-chart/plot.js +218 -0
  31. package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
  32. package/dist/components/charts/candlestick-chart.d.ts +18 -0
  33. package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
  34. package/dist/components/charts/candlestick-chart.js +34 -0
  35. package/dist/components/charts/candlestick-chart.js.map +1 -0
  36. package/dist/components/charts/composition-chart/context.js +1 -2
  37. package/dist/components/charts/composition-chart/plot.js +1 -1
  38. package/dist/components/charts/donut-chart/center.d.ts +16 -0
  39. package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
  40. package/dist/components/charts/donut-chart/center.js +78 -0
  41. package/dist/components/charts/donut-chart/center.js.map +1 -0
  42. package/dist/components/charts/donut-chart/context.d.ts +68 -0
  43. package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
  44. package/dist/components/charts/donut-chart/context.js +2 -0
  45. package/dist/components/charts/donut-chart/legend.d.ts +17 -0
  46. package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
  47. package/dist/components/charts/donut-chart/legend.js +85 -0
  48. package/dist/components/charts/donut-chart/legend.js.map +1 -0
  49. package/dist/components/charts/donut-chart/plot.d.ts +10 -0
  50. package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
  51. package/dist/components/charts/donut-chart/plot.js +108 -0
  52. package/dist/components/charts/donut-chart/plot.js.map +1 -0
  53. package/dist/components/charts/donut-chart.d.ts +22 -0
  54. package/dist/components/charts/donut-chart.d.ts.map +1 -0
  55. package/dist/components/charts/donut-chart.js +37 -0
  56. package/dist/components/charts/donut-chart.js.map +1 -0
  57. package/dist/components/charts/funnel-chart.d.ts.map +1 -1
  58. package/dist/components/charts/funnel-chart.js +1 -2
  59. package/dist/components/charts/funnel-chart.js.map +1 -1
  60. package/dist/components/charts/heat-calendar/tooltip.js +1 -1
  61. package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -1
  62. package/dist/components/charts/liquidity-heatmap.js +1 -1
  63. package/dist/components/charts/order-book/depth-row.d.ts +8 -2
  64. package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
  65. package/dist/components/charts/order-book/depth-row.js +11 -3
  66. package/dist/components/charts/order-book/depth-row.js.map +1 -1
  67. package/dist/components/charts/order-book.d.ts +33 -1
  68. package/dist/components/charts/order-book.d.ts.map +1 -1
  69. package/dist/components/charts/order-book.js +92 -17
  70. package/dist/components/charts/order-book.js.map +1 -1
  71. package/dist/components/charts/price-target-fan/tooltip.js +1 -1
  72. package/dist/components/charts/returns-calendar/tooltip.js +1 -1
  73. package/dist/components/charts/status-bar/tooltip.js +1 -1
  74. package/dist/components/charts/treemap/tooltip.js +1 -1
  75. package/dist/components/charts/treemap.d.ts.map +1 -1
  76. package/dist/components/charts/volume-profile/tooltip.js +1 -1
  77. package/dist/components/charts/volume-profile.d.ts.map +1 -1
  78. package/dist/components/custom/confirm-dialog.d.ts +1 -0
  79. package/dist/components/custom/toast.d.ts +1 -0
  80. package/dist/components/motion/action-swap.d.ts +1 -1
  81. package/dist/components/motion/action-swap.d.ts.map +1 -1
  82. package/dist/components/motion/action-swap.js +46 -20
  83. package/dist/components/motion/action-swap.js.map +1 -1
  84. package/dist/components/motion/animated-badge.d.ts +1 -1
  85. package/dist/components/motion/animated-badge.d.ts.map +1 -1
  86. package/dist/components/motion/animated-badge.js +60 -101
  87. package/dist/components/motion/animated-badge.js.map +1 -1
  88. package/dist/components/motion/animated-sidebar.d.ts +1 -0
  89. package/dist/components/motion/animated-sidebar.js +1 -1
  90. package/dist/components/motion/animated-toast-stack.js +1 -1
  91. package/dist/components/motion/attachment-upload.d.ts.map +1 -1
  92. package/dist/components/motion/attachment-upload.js +2 -3
  93. package/dist/components/motion/attachment-upload.js.map +1 -1
  94. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
  95. package/dist/components/motion/availability-scheduler/day-row.js +2 -2
  96. package/dist/components/motion/availability-scheduler/index.js +1 -1
  97. package/dist/components/motion/bloom-menu.d.ts +1 -0
  98. package/dist/components/motion/bloom-menu.d.ts.map +1 -1
  99. package/dist/components/motion/bloom-menu.js +73 -8
  100. package/dist/components/motion/bloom-menu.js.map +1 -1
  101. package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
  102. package/dist/components/motion/bottom-sheet.js +6 -10
  103. package/dist/components/motion/bottom-sheet.js.map +1 -1
  104. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
  105. package/dist/components/motion/bounce-sidebar.js +34 -42
  106. package/dist/components/motion/bounce-sidebar.js.map +1 -1
  107. package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
  108. package/dist/components/motion/bouncy-accordion.js +35 -22
  109. package/dist/components/motion/bouncy-accordion.js.map +1 -1
  110. package/dist/components/motion/button/stateful.d.ts.map +1 -1
  111. package/dist/components/motion/button/stateful.js +3 -0
  112. package/dist/components/motion/button/stateful.js.map +1 -1
  113. package/dist/components/motion/card.d.ts +44 -0
  114. package/dist/components/motion/card.d.ts.map +1 -0
  115. package/dist/components/motion/card.js +122 -0
  116. package/dist/components/motion/card.js.map +1 -0
  117. package/dist/components/motion/center-morph-modal.js +1 -1
  118. package/dist/components/motion/checkbox.d.ts +3 -1
  119. package/dist/components/motion/checkbox.d.ts.map +1 -1
  120. package/dist/components/motion/checkbox.js +18 -6
  121. package/dist/components/motion/checkbox.js.map +1 -1
  122. package/dist/components/motion/color-picker.d.ts +110 -0
  123. package/dist/components/motion/color-picker.d.ts.map +1 -0
  124. package/dist/components/motion/color-picker.js +1053 -0
  125. package/dist/components/motion/color-picker.js.map +1 -0
  126. package/dist/components/motion/color-selector.d.ts.map +1 -1
  127. package/dist/components/motion/color-selector.js +9 -2
  128. package/dist/components/motion/color-selector.js.map +1 -1
  129. package/dist/components/motion/combobox/content.d.ts +1 -0
  130. package/dist/components/motion/command-palette.js +3 -3
  131. package/dist/components/motion/command-palette.js.map +1 -1
  132. package/dist/components/motion/context-menu.d.ts +1 -0
  133. package/dist/components/motion/context-menu.js +1 -1
  134. package/dist/components/motion/date-range-picker.d.ts.map +1 -1
  135. package/dist/components/motion/digit-swap.d.ts +9 -1
  136. package/dist/components/motion/digit-swap.d.ts.map +1 -1
  137. package/dist/components/motion/digit-swap.js +18 -7
  138. package/dist/components/motion/digit-swap.js.map +1 -1
  139. package/dist/components/motion/drawer.d.ts +1 -1
  140. package/dist/components/motion/drawer.d.ts.map +1 -1
  141. package/dist/components/motion/drawer.js +10 -10
  142. package/dist/components/motion/drawer.js.map +1 -1
  143. package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
  144. package/dist/components/motion/expandable-control.d.ts +1 -0
  145. package/dist/components/motion/feedback-widget.js +4 -1
  146. package/dist/components/motion/feedback-widget.js.map +1 -1
  147. package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
  148. package/dist/components/motion/knockout-wheel.js +1 -2
  149. package/dist/components/motion/knockout-wheel.js.map +1 -1
  150. package/dist/components/motion/morphing-lightbox.d.ts.map +1 -1
  151. package/dist/components/motion/morphing-lightbox.js +1 -1
  152. package/dist/components/motion/morphing-modal.d.ts +6 -1
  153. package/dist/components/motion/morphing-modal.d.ts.map +1 -1
  154. package/dist/components/motion/morphing-modal.js +37 -5
  155. package/dist/components/motion/morphing-modal.js.map +1 -1
  156. package/dist/components/motion/morphing-search-chips.d.ts +54 -0
  157. package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
  158. package/dist/components/motion/morphing-search-chips.js +599 -0
  159. package/dist/components/motion/morphing-search-chips.js.map +1 -0
  160. package/dist/components/motion/morphing-search.js +1 -1
  161. package/dist/components/motion/morphing-tabs.js +1 -1
  162. package/dist/components/motion/multi-select/content.d.ts +1 -0
  163. package/dist/components/motion/not-found/shared.d.ts +1 -0
  164. package/dist/components/motion/number-ticker.d.ts +6 -1
  165. package/dist/components/motion/number-ticker.d.ts.map +1 -1
  166. package/dist/components/motion/number-ticker.js +19 -9
  167. package/dist/components/motion/number-ticker.js.map +1 -1
  168. package/dist/components/motion/otp-input.js +19 -11
  169. package/dist/components/motion/otp-input.js.map +1 -1
  170. package/dist/components/motion/parallax.js.map +1 -1
  171. package/dist/components/motion/popover-morph.d.ts +5 -3
  172. package/dist/components/motion/popover-morph.d.ts.map +1 -1
  173. package/dist/components/motion/popover-morph.js +47 -52
  174. package/dist/components/motion/popover-morph.js.map +1 -1
  175. package/dist/components/motion/popover.d.ts +1 -0
  176. package/dist/components/motion/popover.js +7 -1
  177. package/dist/components/motion/popover.js.map +1 -1
  178. package/dist/components/motion/prediction-market-card.js +2 -3
  179. package/dist/components/motion/prediction-market-card.js.map +1 -1
  180. package/dist/components/motion/prediction-market.js +1 -1
  181. package/dist/components/motion/project-folder.js +1 -1
  182. package/dist/components/motion/radio.d.ts +8 -2
  183. package/dist/components/motion/radio.d.ts.map +1 -1
  184. package/dist/components/motion/radio.js +70 -10
  185. package/dist/components/motion/radio.js.map +1 -1
  186. package/dist/components/motion/scroll-progress.d.ts +1 -0
  187. package/dist/components/motion/select-morph.d.ts +1 -1
  188. package/dist/components/motion/select-morph.d.ts.map +1 -1
  189. package/dist/components/motion/select-morph.js +89 -21
  190. package/dist/components/motion/select-morph.js.map +1 -1
  191. package/dist/components/motion/select.d.ts.map +1 -1
  192. package/dist/components/motion/select.js +153 -135
  193. package/dist/components/motion/select.js.map +1 -1
  194. package/dist/components/motion/shader-background.d.ts +4 -2
  195. package/dist/components/motion/shader-background.d.ts.map +1 -1
  196. package/dist/components/motion/shader-background.js +9 -3
  197. package/dist/components/motion/shader-background.js.map +1 -1
  198. package/dist/components/motion/shared-layout-bg.d.ts.map +1 -1
  199. package/dist/components/motion/shared-layout-bg.js +17 -3
  200. package/dist/components/motion/shared-layout-bg.js.map +1 -1
  201. package/dist/components/motion/sortable-list.d.ts +1 -0
  202. package/dist/components/motion/sortable-stack.js +1 -2
  203. package/dist/components/motion/swipeable-list.d.ts.map +1 -1
  204. package/dist/components/motion/swipeable-list.js +61 -4
  205. package/dist/components/motion/swipeable-list.js.map +1 -1
  206. package/dist/components/motion/table/row-handle.js +1 -1
  207. package/dist/components/motion/table/table-header.js +1 -1
  208. package/dist/components/motion/tabs.d.ts +13 -3
  209. package/dist/components/motion/tabs.d.ts.map +1 -1
  210. package/dist/components/motion/tabs.js +248 -26
  211. package/dist/components/motion/tabs.js.map +1 -1
  212. package/dist/components/motion/text-reveal.d.ts +1 -0
  213. package/dist/components/motion/theme-toggle.js +1 -1
  214. package/dist/components/motion/tooltip/positioner.d.ts +8 -26
  215. package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
  216. package/dist/components/motion/tooltip/positioner.js +1 -2
  217. package/dist/components/motion/tooltip.d.ts +62 -20
  218. package/dist/components/motion/tooltip.d.ts.map +1 -1
  219. package/dist/components/motion/tooltip.js +1 -135
  220. package/dist/components/motion/wallet-card/account-avatar.js +1 -2
  221. package/dist/components/reui/alert.d.ts +1 -1
  222. package/dist/components/reui/autocomplete.d.ts.map +1 -1
  223. package/dist/components/reui/autocomplete.js +1 -1
  224. package/dist/components/reui/autocomplete.js.map +1 -1
  225. package/dist/components/reui/badge.d.ts +1 -1
  226. package/dist/components/reui/cascader/cascader-async.d.ts +21 -5
  227. package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
  228. package/dist/components/reui/cascader/cascader-async.js +61 -34
  229. package/dist/components/reui/cascader/cascader-async.js.map +1 -1
  230. package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -1
  231. package/dist/components/reui/cascader/cascader-columns.js +5 -2
  232. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  233. package/dist/components/reui/cascader/cascader-context.d.ts +3 -1
  234. package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
  235. package/dist/components/reui/cascader/cascader-context.js.map +1 -1
  236. package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -1
  237. package/dist/components/reui/cascader/cascader-item.d.ts +1 -1
  238. package/dist/components/reui/cascader/cascader-lib.d.ts +34 -8
  239. package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
  240. package/dist/components/reui/cascader/cascader-lib.js +145 -29
  241. package/dist/components/reui/cascader/cascader-lib.js.map +1 -1
  242. package/dist/components/reui/cascader/cascader-nav.d.ts +1 -1
  243. package/dist/components/reui/cascader/cascader-types.d.ts +1 -1
  244. package/dist/components/reui/cascader/cascader.d.ts +13 -8
  245. package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
  246. package/dist/components/reui/cascader/cascader.js +31 -16
  247. package/dist/components/reui/cascader/cascader.js.map +1 -1
  248. package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
  249. package/dist/components/reui/color-picker.d.ts +280 -0
  250. package/dist/components/reui/color-picker.d.ts.map +1 -0
  251. package/dist/components/reui/color-picker.js +2013 -0
  252. package/dist/components/reui/color-picker.js.map +1 -0
  253. package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
  254. package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -0
  255. package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
  256. package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
  257. package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -0
  258. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  259. package/dist/components/reui/data-grid/data-grid-column-header.d.ts +6 -8
  260. package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
  261. package/dist/components/reui/data-grid/data-grid-column-header.js +50 -29
  262. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  263. package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -1
  264. package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -0
  265. package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
  266. package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -1
  267. package/dist/components/reui/data-grid/data-grid-pagination.js +2 -1
  268. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  269. package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
  270. package/dist/components/reui/data-grid/data-grid-scroll-area.js +10 -3
  271. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  272. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
  273. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +15 -10
  274. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  275. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +1 -1
  276. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
  277. package/dist/components/reui/data-grid/data-grid-table-dnd.js +54 -14
  278. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  279. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
  280. package/dist/components/reui/data-grid/data-grid-table-virtual.js +37 -42
  281. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  282. package/dist/components/reui/data-grid/data-grid-table.d.ts +174 -16
  283. package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
  284. package/dist/components/reui/data-grid/data-grid-table.js +223 -89
  285. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  286. package/dist/components/reui/data-grid/data-grid.d.ts +55 -1
  287. package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
  288. package/dist/components/reui/data-grid/data-grid.js +112 -22
  289. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  290. package/dist/components/reui/date-selector.d.ts +1 -0
  291. package/dist/components/reui/date-selector.d.ts.map +1 -1
  292. package/dist/components/reui/date-selector.js +22 -16
  293. package/dist/components/reui/date-selector.js.map +1 -1
  294. package/dist/components/reui/emoji-picker.d.ts +367 -0
  295. package/dist/components/reui/emoji-picker.d.ts.map +1 -0
  296. package/dist/components/reui/emoji-picker.js +1768 -0
  297. package/dist/components/reui/emoji-picker.js.map +1 -0
  298. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +3 -5
  299. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  300. package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
  301. package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -1
  302. package/dist/components/reui/event-calendar/event-calendar-nav.js +4 -4
  303. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  304. package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -1
  305. package/dist/components/reui/event-calendar/event-calendar.js +34 -31
  306. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  307. package/dist/components/reui/file-type.d.ts +792 -0
  308. package/dist/components/reui/file-type.d.ts.map +1 -0
  309. package/dist/components/reui/file-type.js +1367 -0
  310. package/dist/components/reui/file-type.js.map +1 -0
  311. package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
  312. package/dist/components/reui/filters/filters-advanced.js +1 -1
  313. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  314. package/dist/components/reui/filters/filters-builder.d.ts +1 -1
  315. package/dist/components/reui/filters/filters-chip.d.ts +5 -1
  316. package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
  317. package/dist/components/reui/filters/filters-chip.js +1 -1
  318. package/dist/components/reui/filters/filters-lib.d.ts +1 -1
  319. package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
  320. package/dist/components/reui/frame.d.ts.map +1 -1
  321. package/dist/components/reui/frame.js.map +1 -1
  322. package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -1
  323. package/dist/components/reui/gantt/gantt-nav.js +4 -4
  324. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  325. package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
  326. package/dist/components/reui/gantt/gantt.js +5 -2
  327. package/dist/components/reui/gantt/gantt.js.map +1 -1
  328. package/dist/components/reui/icon-tile.d.ts +1 -1
  329. package/dist/components/reui/icon-tile.js +8 -7
  330. package/dist/components/reui/icon-tile.js.map +1 -1
  331. package/dist/components/reui/kanban.d.ts.map +1 -1
  332. package/dist/components/reui/kanban.js +1 -1
  333. package/dist/components/reui/kanban.js.map +1 -1
  334. package/dist/components/reui/number-field.d.ts.map +1 -1
  335. package/dist/components/reui/number-field.js.map +1 -1
  336. package/dist/components/reui/phone-input.js +30 -27
  337. package/dist/components/reui/phone-input.js.map +1 -1
  338. package/dist/components/reui/scrollspy.d.ts +1 -0
  339. package/dist/components/reui/time-picker.js +1 -1
  340. package/dist/components/reui/time-picker.js.map +1 -1
  341. package/dist/components/ui/attachment.d.ts +1 -1
  342. package/dist/components/ui/button-group.d.ts +1 -1
  343. package/dist/components/ui/button.d.ts +1 -1
  344. package/dist/components/ui/chart.d.ts.map +1 -1
  345. package/dist/components/ui/code-block.d.ts +29 -0
  346. package/dist/components/ui/code-block.d.ts.map +1 -0
  347. package/dist/components/ui/code-block.js +124 -0
  348. package/dist/components/ui/code-block.js.map +1 -0
  349. package/dist/components/ui/command.d.ts.map +1 -1
  350. package/dist/components/ui/direction.js +1 -2
  351. package/dist/components/ui/field.d.ts +1 -1
  352. package/dist/components/ui/field.js +1 -1
  353. package/dist/components/ui/input-group.d.ts +1 -1
  354. package/dist/components/ui/marker.d.ts +1 -1
  355. package/dist/components/ui/message-scroller.d.ts.map +1 -1
  356. package/dist/components/ui/questionnaire.d.ts.map +1 -1
  357. package/dist/components/ui/sidebar.js +1 -1
  358. package/dist/components/ui/trace.d.ts +21 -0
  359. package/dist/components/ui/trace.d.ts.map +1 -0
  360. package/dist/components/ui/trace.js +77 -0
  361. package/dist/components/ui/trace.js.map +1 -0
  362. package/dist/context-BYXeJQnz.d.ts.map +1 -1
  363. package/dist/context-tTdLKYNf.js +99 -0
  364. package/dist/context-tTdLKYNf.js.map +1 -0
  365. package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-DOg9Jh-U.js} +2 -2
  366. package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-DOg9Jh-U.js.map} +1 -1
  367. package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
  368. package/dist/hooks/use-focus-trap.d.ts +22 -0
  369. package/dist/hooks/use-focus-trap.d.ts.map +1 -0
  370. package/dist/hooks/use-focus-trap.js +80 -0
  371. package/dist/hooks/use-focus-trap.js.map +1 -0
  372. package/dist/hooks/use-highlighted-code.d.ts +5 -0
  373. package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
  374. package/dist/hooks/use-highlighted-code.js +128 -0
  375. package/dist/hooks/use-highlighted-code.js.map +1 -0
  376. package/dist/hooks/use-hover-gesture.d.ts +1 -0
  377. package/dist/hooks/use-intersection-observer.d.ts +1 -0
  378. package/dist/hooks/use-listbox.d.ts +29 -0
  379. package/dist/hooks/use-listbox.d.ts.map +1 -0
  380. package/dist/hooks/use-listbox.js +75 -0
  381. package/dist/hooks/use-listbox.js.map +1 -0
  382. package/dist/hooks/use-scroll-position.d.ts +1 -0
  383. package/dist/hooks/use-slider-input.d.ts +1 -0
  384. package/dist/hooks/use-viewport.d.ts +1 -0
  385. package/dist/lib/tick-sound.d.ts +1 -0
  386. package/dist/model-NSIg2p7a.d.ts +20 -0
  387. package/dist/model-NSIg2p7a.d.ts.map +1 -0
  388. package/dist/model-_mRyI6V9.d.ts +18 -0
  389. package/dist/model-_mRyI6V9.d.ts.map +1 -0
  390. package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
  391. package/dist/positioner-3r3cfkqT.js.map +1 -0
  392. package/dist/tooltip-Bam5KeYe.js +535 -0
  393. package/dist/tooltip-Bam5KeYe.js.map +1 -0
  394. package/dist/tooltip-C01qUgsW.d.ts.map +1 -1
  395. package/dist/use-position-DOi1gVL0.d.ts +32 -0
  396. package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
  397. package/package.json +11 -11
  398. package/dist/cascader-types-DVT-znZ-.d.ts.map +0 -1
  399. package/dist/components/motion/tooltip.js.map +0 -1
  400. package/dist/model-DfeFradZ.d.ts +0 -9
  401. package/dist/model-DfeFradZ.d.ts.map +0 -1
  402. package/dist/positioner-3mCqiebN.js.map +0 -1
@@ -0,0 +1,1367 @@
1
+ "use client";
2
+ import { cn } from "@kumix/utils";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { cva } from "class-variance-authority";
5
+ //#region src/components/reui/file-type.tsx
6
+ /**
7
+ * The color of a format with no brand or family color of its own. A solid page
8
+ * in it read as a dark slab beside the colored ones, so it fills lighter, and
9
+ * its glyph turns dark gray, where white would fade on the pale page.
10
+ */
11
+ const NEUTRAL = "text-zinc-500 [--file-type-fill:color-mix(in_oklab,currentColor_45%,white)] [--file-type-glyph:color-mix(in_oklab,currentColor_80%,black)]";
12
+ /** Yellow takes dark text, as the JavaScript logo does: white on it stays
13
+ * under 3:1 until the 700 step. */
14
+ const YELLOW = "text-yellow-500 [--file-type-foreground:var(--color-yellow-950)]";
15
+ /** The family colors, which a format without a brand color of its own takes. */
16
+ const CATEGORY_COLORS = {
17
+ archive: NEUTRAL,
18
+ audio: "text-pink-600",
19
+ code: "text-blue-600",
20
+ design: "text-purple-600",
21
+ document: "text-blue-600",
22
+ empty: NEUTRAL,
23
+ executable: NEUTRAL,
24
+ file: NEUTRAL,
25
+ folder: "text-violet-600",
26
+ font: NEUTRAL,
27
+ image: "text-violet-600",
28
+ presentation: "text-red-600",
29
+ spreadsheet: "text-green-600",
30
+ video: "text-blue-600"
31
+ };
32
+ const CATEGORY_NAMES = {
33
+ archive: "Archive",
34
+ audio: "Audio file",
35
+ code: "Code file",
36
+ design: "Design file",
37
+ document: "Document",
38
+ empty: "File",
39
+ executable: "Application",
40
+ file: "File",
41
+ folder: "Folder",
42
+ font: "Font file",
43
+ image: "Image",
44
+ presentation: "Presentation",
45
+ spreadsheet: "Spreadsheet",
46
+ video: "Video"
47
+ };
48
+ /**
49
+ * Known extensions. A format takes its brand's color (Word blue, Excel green,
50
+ * the GitHub language colors for code), else its family's, and a format with
51
+ * neither (archives, plain text, data, config, fonts, installers) is neutral.
52
+ * Every color is the 600 step, so the set reads as one palette with white
53
+ * label text at 3:1 or better.
54
+ */
55
+ const FILE_TYPE_EXTENSIONS = {
56
+ pdf: {
57
+ category: "document",
58
+ color: "text-orange-600"
59
+ },
60
+ doc: {
61
+ category: "document",
62
+ color: "text-blue-600"
63
+ },
64
+ docx: {
65
+ category: "document",
66
+ color: "text-blue-600"
67
+ },
68
+ odt: {
69
+ category: "document",
70
+ color: "text-blue-600"
71
+ },
72
+ rtf: {
73
+ category: "document",
74
+ color: "text-blue-600"
75
+ },
76
+ pages: {
77
+ category: "document",
78
+ color: "text-amber-600"
79
+ },
80
+ txt: {
81
+ category: "document",
82
+ color: NEUTRAL
83
+ },
84
+ md: {
85
+ category: "document",
86
+ color: NEUTRAL
87
+ },
88
+ log: {
89
+ category: "document",
90
+ color: NEUTRAL
91
+ },
92
+ mdx: {
93
+ category: "document",
94
+ color: YELLOW
95
+ },
96
+ mdc: {
97
+ category: "document",
98
+ color: NEUTRAL
99
+ },
100
+ eml: {
101
+ category: "document",
102
+ color: NEUTRAL
103
+ },
104
+ srt: {
105
+ category: "document",
106
+ color: NEUTRAL
107
+ },
108
+ vtt: {
109
+ category: "document",
110
+ color: NEUTRAL
111
+ },
112
+ xls: {
113
+ category: "spreadsheet",
114
+ color: "text-green-600"
115
+ },
116
+ xlsx: {
117
+ category: "spreadsheet",
118
+ color: "text-green-600"
119
+ },
120
+ xlsm: {
121
+ category: "spreadsheet",
122
+ color: "text-green-600"
123
+ },
124
+ ods: {
125
+ category: "spreadsheet",
126
+ color: "text-green-600"
127
+ },
128
+ csv: {
129
+ category: "spreadsheet",
130
+ color: "text-green-600"
131
+ },
132
+ tsv: {
133
+ category: "spreadsheet",
134
+ color: "text-green-600"
135
+ },
136
+ numbers: {
137
+ category: "spreadsheet",
138
+ color: "text-green-600",
139
+ label: "NUM"
140
+ },
141
+ parquet: {
142
+ category: "spreadsheet",
143
+ color: NEUTRAL,
144
+ label: "PARQ"
145
+ },
146
+ sqlite: {
147
+ category: "spreadsheet",
148
+ color: "text-sky-600"
149
+ },
150
+ db: {
151
+ category: "spreadsheet",
152
+ color: NEUTRAL
153
+ },
154
+ ppt: {
155
+ category: "presentation",
156
+ color: "text-red-600"
157
+ },
158
+ pptx: {
159
+ category: "presentation",
160
+ color: "text-red-600"
161
+ },
162
+ odp: {
163
+ category: "presentation",
164
+ color: "text-red-600"
165
+ },
166
+ key: {
167
+ category: "presentation",
168
+ color: "text-blue-600"
169
+ },
170
+ png: {
171
+ category: "image",
172
+ color: YELLOW
173
+ },
174
+ jpg: {
175
+ category: "image",
176
+ color: "text-violet-600"
177
+ },
178
+ jpeg: {
179
+ category: "image",
180
+ color: "text-violet-600"
181
+ },
182
+ gif: {
183
+ category: "image",
184
+ color: "text-violet-600"
185
+ },
186
+ webp: {
187
+ category: "image",
188
+ color: "text-violet-600"
189
+ },
190
+ avif: {
191
+ category: "image",
192
+ color: "text-violet-600"
193
+ },
194
+ heic: {
195
+ category: "image",
196
+ color: "text-violet-600"
197
+ },
198
+ bmp: {
199
+ category: "image",
200
+ color: "text-violet-600"
201
+ },
202
+ tif: {
203
+ category: "image",
204
+ color: "text-violet-600"
205
+ },
206
+ tiff: {
207
+ category: "image",
208
+ color: "text-violet-600"
209
+ },
210
+ ico: {
211
+ category: "image",
212
+ color: "text-violet-600"
213
+ },
214
+ raw: {
215
+ category: "image",
216
+ color: NEUTRAL
217
+ },
218
+ svg: {
219
+ category: "image",
220
+ color: YELLOW
221
+ },
222
+ jxl: {
223
+ category: "image",
224
+ color: "text-violet-600"
225
+ },
226
+ mp4: {
227
+ category: "video",
228
+ color: "text-blue-600"
229
+ },
230
+ mov: {
231
+ category: "video",
232
+ color: "text-blue-600"
233
+ },
234
+ avi: {
235
+ category: "video",
236
+ color: "text-blue-600"
237
+ },
238
+ mkv: {
239
+ category: "video",
240
+ color: "text-blue-600"
241
+ },
242
+ webm: {
243
+ category: "video",
244
+ color: "text-blue-600"
245
+ },
246
+ mpeg: {
247
+ category: "video",
248
+ color: "text-blue-600"
249
+ },
250
+ mpg: {
251
+ category: "video",
252
+ color: "text-blue-600"
253
+ },
254
+ wmv: {
255
+ category: "video",
256
+ color: "text-blue-600"
257
+ },
258
+ m3u8: {
259
+ category: "video",
260
+ color: "text-blue-600"
261
+ },
262
+ mp3: {
263
+ category: "audio",
264
+ color: "text-pink-600"
265
+ },
266
+ wav: {
267
+ category: "audio",
268
+ color: "text-pink-600"
269
+ },
270
+ aac: {
271
+ category: "audio",
272
+ color: "text-pink-600"
273
+ },
274
+ flac: {
275
+ category: "audio",
276
+ color: "text-pink-600"
277
+ },
278
+ ogg: {
279
+ category: "audio",
280
+ color: "text-pink-600"
281
+ },
282
+ m4a: {
283
+ category: "audio",
284
+ color: "text-pink-600"
285
+ },
286
+ aiff: {
287
+ category: "audio",
288
+ color: "text-pink-600"
289
+ },
290
+ opus: {
291
+ category: "audio",
292
+ color: "text-pink-600"
293
+ },
294
+ js: {
295
+ category: "code",
296
+ color: YELLOW
297
+ },
298
+ jsx: {
299
+ category: "code",
300
+ color: YELLOW
301
+ },
302
+ mjs: {
303
+ category: "code",
304
+ color: YELLOW
305
+ },
306
+ ts: {
307
+ category: "code",
308
+ color: "text-blue-600"
309
+ },
310
+ tsx: {
311
+ category: "code",
312
+ color: "text-blue-600"
313
+ },
314
+ html: {
315
+ category: "code",
316
+ color: "text-orange-600"
317
+ },
318
+ htm: {
319
+ category: "code",
320
+ color: "text-orange-600"
321
+ },
322
+ css: {
323
+ category: "code",
324
+ color: "text-purple-600"
325
+ },
326
+ scss: {
327
+ category: "code",
328
+ color: "text-pink-600"
329
+ },
330
+ json: {
331
+ category: "code",
332
+ color: NEUTRAL
333
+ },
334
+ xml: {
335
+ category: "code",
336
+ color: NEUTRAL
337
+ },
338
+ yaml: {
339
+ category: "code",
340
+ color: NEUTRAL
341
+ },
342
+ yml: {
343
+ category: "code",
344
+ color: NEUTRAL
345
+ },
346
+ sql: {
347
+ category: "code",
348
+ color: NEUTRAL
349
+ },
350
+ py: {
351
+ category: "code",
352
+ color: "text-blue-600"
353
+ },
354
+ java: {
355
+ category: "code",
356
+ color: "text-orange-600"
357
+ },
358
+ php: {
359
+ category: "code",
360
+ color: "text-indigo-600"
361
+ },
362
+ rb: {
363
+ category: "code",
364
+ color: "text-red-600"
365
+ },
366
+ go: {
367
+ category: "code",
368
+ color: "text-cyan-600"
369
+ },
370
+ rs: {
371
+ category: "code",
372
+ color: "text-orange-600"
373
+ },
374
+ c: {
375
+ category: "code",
376
+ color: NEUTRAL
377
+ },
378
+ cpp: {
379
+ category: "code",
380
+ color: "text-blue-600"
381
+ },
382
+ h: {
383
+ category: "code",
384
+ color: NEUTRAL
385
+ },
386
+ cs: {
387
+ category: "code",
388
+ color: "text-purple-600"
389
+ },
390
+ sh: {
391
+ category: "code",
392
+ color: "text-green-600"
393
+ },
394
+ rss: {
395
+ category: "code",
396
+ color: "text-orange-600"
397
+ },
398
+ cjs: {
399
+ category: "code",
400
+ color: YELLOW
401
+ },
402
+ mts: {
403
+ category: "code",
404
+ color: "text-blue-600"
405
+ },
406
+ vue: {
407
+ category: "code",
408
+ color: "text-emerald-600"
409
+ },
410
+ svelte: {
411
+ category: "code",
412
+ color: "text-orange-600"
413
+ },
414
+ astro: {
415
+ category: "code",
416
+ color: "text-orange-600"
417
+ },
418
+ graphql: {
419
+ category: "code",
420
+ color: "text-pink-600",
421
+ label: "GQL"
422
+ },
423
+ gql: {
424
+ category: "code",
425
+ color: "text-pink-600"
426
+ },
427
+ prisma: {
428
+ category: "code",
429
+ color: "text-sky-600"
430
+ },
431
+ wasm: {
432
+ category: "code",
433
+ color: "text-indigo-600"
434
+ },
435
+ map: {
436
+ category: "code",
437
+ color: NEUTRAL
438
+ },
439
+ kt: {
440
+ category: "code",
441
+ color: "text-violet-600"
442
+ },
443
+ kts: {
444
+ category: "code",
445
+ color: "text-violet-600"
446
+ },
447
+ swift: {
448
+ category: "code",
449
+ color: "text-red-600"
450
+ },
451
+ dart: {
452
+ category: "code",
453
+ color: "text-teal-600"
454
+ },
455
+ lua: {
456
+ category: "code",
457
+ color: "text-blue-600"
458
+ },
459
+ r: {
460
+ category: "code",
461
+ color: "text-sky-600"
462
+ },
463
+ scala: {
464
+ category: "code",
465
+ color: "text-rose-600"
466
+ },
467
+ ex: {
468
+ category: "code",
469
+ color: "text-purple-600"
470
+ },
471
+ exs: {
472
+ category: "code",
473
+ color: "text-purple-600"
474
+ },
475
+ hpp: {
476
+ category: "code",
477
+ color: "text-blue-600"
478
+ },
479
+ cc: {
480
+ category: "code",
481
+ color: "text-blue-600"
482
+ },
483
+ cu: {
484
+ category: "code",
485
+ color: "text-green-600"
486
+ },
487
+ ps1: {
488
+ category: "code",
489
+ color: "text-blue-600"
490
+ },
491
+ bat: {
492
+ category: "code",
493
+ color: "text-green-600"
494
+ },
495
+ bash: {
496
+ category: "code",
497
+ color: "text-green-600"
498
+ },
499
+ zsh: {
500
+ category: "code",
501
+ color: "text-green-600"
502
+ },
503
+ gradle: {
504
+ category: "code",
505
+ color: "text-cyan-600"
506
+ },
507
+ ipynb: {
508
+ category: "code",
509
+ color: "text-orange-600"
510
+ },
511
+ env: {
512
+ category: "code",
513
+ color: NEUTRAL
514
+ },
515
+ toml: {
516
+ category: "code",
517
+ color: NEUTRAL
518
+ },
519
+ ini: {
520
+ category: "code",
521
+ color: NEUTRAL
522
+ },
523
+ conf: {
524
+ category: "code",
525
+ color: NEUTRAL
526
+ },
527
+ jsonc: {
528
+ category: "code",
529
+ color: NEUTRAL
530
+ },
531
+ lock: {
532
+ category: "code",
533
+ color: NEUTRAL
534
+ },
535
+ git: {
536
+ category: "code",
537
+ color: "text-red-600"
538
+ },
539
+ ignore: {
540
+ category: "code",
541
+ color: NEUTRAL
542
+ },
543
+ dockerfile: {
544
+ category: "code",
545
+ color: "text-blue-600",
546
+ label: "DOCK"
547
+ },
548
+ makefile: {
549
+ category: "code",
550
+ color: "text-green-600",
551
+ label: "MAKE"
552
+ },
553
+ tf: {
554
+ category: "code",
555
+ color: "text-purple-600"
556
+ },
557
+ tfvars: {
558
+ category: "code",
559
+ color: "text-purple-600"
560
+ },
561
+ hcl: {
562
+ category: "code",
563
+ color: "text-purple-600"
564
+ },
565
+ proto: {
566
+ category: "code",
567
+ color: "text-blue-600"
568
+ },
569
+ jsonl: {
570
+ category: "code",
571
+ color: NEUTRAL
572
+ },
573
+ ndjson: {
574
+ category: "code",
575
+ color: NEUTRAL
576
+ },
577
+ diff: {
578
+ category: "code",
579
+ color: NEUTRAL
580
+ },
581
+ patch: {
582
+ category: "code",
583
+ color: NEUTRAL
584
+ },
585
+ pem: {
586
+ category: "code",
587
+ color: NEUTRAL
588
+ },
589
+ crt: {
590
+ category: "code",
591
+ color: NEUTRAL
592
+ },
593
+ zip: {
594
+ category: "archive",
595
+ color: NEUTRAL
596
+ },
597
+ rar: {
598
+ category: "archive",
599
+ color: NEUTRAL
600
+ },
601
+ "7z": {
602
+ category: "archive",
603
+ color: NEUTRAL
604
+ },
605
+ tar: {
606
+ category: "archive",
607
+ color: NEUTRAL
608
+ },
609
+ gz: {
610
+ category: "archive",
611
+ color: NEUTRAL
612
+ },
613
+ tgz: {
614
+ category: "archive",
615
+ color: NEUTRAL
616
+ },
617
+ bz2: {
618
+ category: "archive",
619
+ color: NEUTRAL
620
+ },
621
+ xz: {
622
+ category: "archive",
623
+ color: NEUTRAL
624
+ },
625
+ zst: {
626
+ category: "archive",
627
+ color: NEUTRAL
628
+ },
629
+ jar: {
630
+ category: "archive",
631
+ color: "text-orange-600"
632
+ },
633
+ whl: {
634
+ category: "archive",
635
+ color: "text-blue-600"
636
+ },
637
+ safetensors: {
638
+ category: "archive",
639
+ color: NEUTRAL,
640
+ label: "SAFE"
641
+ },
642
+ gguf: {
643
+ category: "archive",
644
+ color: NEUTRAL
645
+ },
646
+ onnx: {
647
+ category: "archive",
648
+ color: NEUTRAL
649
+ },
650
+ pt: {
651
+ category: "archive",
652
+ color: "text-red-600"
653
+ },
654
+ fig: {
655
+ category: "design",
656
+ color: "text-purple-600"
657
+ },
658
+ sketch: {
659
+ category: "design",
660
+ color: "text-amber-600"
661
+ },
662
+ psd: {
663
+ category: "design",
664
+ color: "text-sky-600"
665
+ },
666
+ ai: {
667
+ category: "design",
668
+ color: "text-orange-600"
669
+ },
670
+ eps: {
671
+ category: "design",
672
+ color: "text-purple-600"
673
+ },
674
+ indd: {
675
+ category: "design",
676
+ color: "text-pink-600"
677
+ },
678
+ aep: {
679
+ category: "design",
680
+ color: "text-violet-600"
681
+ },
682
+ xd: {
683
+ category: "design",
684
+ color: "text-fuchsia-600"
685
+ },
686
+ exe: {
687
+ category: "executable",
688
+ color: NEUTRAL
689
+ },
690
+ msi: {
691
+ category: "executable",
692
+ color: NEUTRAL
693
+ },
694
+ dmg: {
695
+ category: "executable",
696
+ color: NEUTRAL
697
+ },
698
+ apk: {
699
+ category: "executable",
700
+ color: "text-green-600"
701
+ },
702
+ deb: {
703
+ category: "executable",
704
+ color: "text-rose-600"
705
+ },
706
+ iso: {
707
+ category: "executable",
708
+ color: NEUTRAL
709
+ },
710
+ app: {
711
+ category: "executable",
712
+ color: NEUTRAL
713
+ },
714
+ pkg: {
715
+ category: "executable",
716
+ color: NEUTRAL
717
+ },
718
+ ipa: {
719
+ category: "executable",
720
+ color: NEUTRAL
721
+ },
722
+ aab: {
723
+ category: "executable",
724
+ color: "text-green-600"
725
+ },
726
+ rpm: {
727
+ category: "executable",
728
+ color: "text-red-600"
729
+ },
730
+ ttf: {
731
+ category: "font",
732
+ color: NEUTRAL
733
+ },
734
+ otf: {
735
+ category: "font",
736
+ color: NEUTRAL
737
+ },
738
+ woff: {
739
+ category: "font",
740
+ color: NEUTRAL
741
+ },
742
+ woff2: {
743
+ category: "font",
744
+ color: NEUTRAL
745
+ }
746
+ };
747
+ /** The families that can be passed as a `type` on their own, glyph only. */
748
+ const FILE_TYPE_CATEGORIES = [
749
+ "archive",
750
+ "audio",
751
+ "code",
752
+ "design",
753
+ "document",
754
+ "empty",
755
+ "executable",
756
+ "folder",
757
+ "font",
758
+ "image",
759
+ "presentation",
760
+ "spreadsheet",
761
+ "video"
762
+ ];
763
+ const FILE_TYPE_EXTENSION_NAMES = Object.keys(FILE_TYPE_EXTENSIONS);
764
+ const extensions = FILE_TYPE_EXTENSIONS;
765
+ /** `Object.hasOwn` would fail to typecheck in an app below the ES2022 lib. */
766
+ function has(record, key) {
767
+ return Object.hasOwn(record, key);
768
+ }
769
+ function isCategory(value) {
770
+ return FILE_TYPE_CATEGORIES.includes(value);
771
+ }
772
+ function resolveFileType(type) {
773
+ const key = (type ?? "").trim().toLowerCase().replace(/^\.+/, "");
774
+ if (!key || key === "empty") return {
775
+ type: "empty",
776
+ category: "empty",
777
+ color: CATEGORY_COLORS.empty
778
+ };
779
+ const extension = has(extensions, key) ? extensions[key] : null;
780
+ if (extension) return {
781
+ type: key,
782
+ category: extension.category,
783
+ label: extension.label ?? key.toUpperCase(),
784
+ color: extension.color
785
+ };
786
+ if (isCategory(key)) return {
787
+ type: key,
788
+ category: key,
789
+ color: CATEGORY_COLORS[key]
790
+ };
791
+ return {
792
+ type: key,
793
+ category: "file",
794
+ label: key.toUpperCase(),
795
+ color: CATEGORY_COLORS.file
796
+ };
797
+ }
798
+ /**
799
+ * MIME types whose subtype does not name the extension. Anything else under
800
+ * image/, video/, audio/ or font/ falls back to its family.
801
+ */
802
+ const MIME_TYPES = {
803
+ "application/pdf": "pdf",
804
+ "application/msword": "doc",
805
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
806
+ "application/vnd.oasis.opendocument.text": "odt",
807
+ "application/rtf": "rtf",
808
+ "application/vnd.ms-excel": "xls",
809
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
810
+ "application/vnd.oasis.opendocument.spreadsheet": "ods",
811
+ "application/vnd.ms-powerpoint": "ppt",
812
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",
813
+ "application/vnd.oasis.opendocument.presentation": "odp",
814
+ "application/vnd.ms-excel.sheet.macroenabled.12": "xlsm",
815
+ "application/vnd.apple.keynote": "key",
816
+ "application/zip": "zip",
817
+ "application/x-zip-compressed": "zip",
818
+ "application/vnd.rar": "rar",
819
+ "application/x-rar-compressed": "rar",
820
+ "application/x-7z-compressed": "7z",
821
+ "application/x-tar": "tar",
822
+ "application/gzip": "gz",
823
+ "application/x-gzip": "gz",
824
+ "application/x-bzip2": "bz2",
825
+ "application/json": "json",
826
+ "application/xml": "xml",
827
+ "application/yaml": "yaml",
828
+ "application/x-yaml": "yaml",
829
+ "application/rss+xml": "rss",
830
+ "application/javascript": "js",
831
+ "application/x-httpd-php": "php",
832
+ "application/x-sh": "sh",
833
+ "application/x-msdownload": "exe",
834
+ "application/x-msi": "msi",
835
+ "application/vnd.android.package-archive": "apk",
836
+ "application/vnd.debian.binary-package": "deb",
837
+ "application/x-apple-diskimage": "dmg",
838
+ "application/x-iso9660-image": "iso",
839
+ "application/x-font-ttf": "ttf",
840
+ "application/font-woff": "woff",
841
+ "application/postscript": "eps",
842
+ "application/vnd.adobe.photoshop": "psd",
843
+ "image/vnd.adobe.photoshop": "psd",
844
+ "image/jpeg": "jpg",
845
+ "image/svg+xml": "svg",
846
+ "image/x-icon": "ico",
847
+ "image/vnd.microsoft.icon": "ico",
848
+ "video/quicktime": "mov",
849
+ "video/x-msvideo": "avi",
850
+ "video/x-matroska": "mkv",
851
+ "audio/mpeg": "mp3",
852
+ "audio/wav": "wav",
853
+ "audio/x-wav": "wav",
854
+ "audio/mp4": "m4a",
855
+ "audio/x-m4a": "m4a",
856
+ "audio/x-flac": "flac",
857
+ "audio/x-aiff": "aiff",
858
+ "video/x-ms-wmv": "wmv",
859
+ "text/plain": "txt",
860
+ "text/markdown": "md",
861
+ "text/x-markdown": "md",
862
+ "text/x-python": "py",
863
+ "text/x-c": "c",
864
+ "text/yaml": "yaml",
865
+ "text/csv": "csv",
866
+ "text/tab-separated-values": "tsv",
867
+ "text/html": "html",
868
+ "text/css": "css",
869
+ "text/javascript": "js",
870
+ "text/xml": "xml",
871
+ "application/node": "cjs",
872
+ "application/java-archive": "jar",
873
+ "application/x-ipynb+json": "ipynb",
874
+ "application/x-ndjson": "ndjson",
875
+ "application/vnd.sqlite3": "sqlite",
876
+ "application/x-sqlite3": "sqlite",
877
+ "application/vnd.apple.mpegurl": "m3u8",
878
+ "application/x-mpegurl": "m3u8",
879
+ "application/x-subrip": "srt",
880
+ "message/rfc822": "eml",
881
+ "application/x-rpm": "rpm",
882
+ "application/x-pem-file": "pem",
883
+ "application/x-x509-ca-cert": "crt",
884
+ "application/pkix-cert": "crt",
885
+ "application/zstd": "zst",
886
+ "application/x-xz": "xz",
887
+ "text/x-c++src": "cpp",
888
+ "text/x-c++hdr": "hpp",
889
+ "text/x-kotlin": "kt",
890
+ "text/x-swift": "swift",
891
+ "text/x-rsrc": "r",
892
+ "text/x-lua": "lua",
893
+ "text/x-scala": "scala",
894
+ "text/x-diff": "diff",
895
+ "text/x-patch": "patch",
896
+ "text/x-makefile": "makefile"
897
+ };
898
+ /**
899
+ * Names that carry their type with no extension of their own, or with one
900
+ * that names something else ("go.mod" is not a tracker module).
901
+ */
902
+ const FILE_NAMES = {
903
+ containerfile: "dockerfile",
904
+ gnumakefile: "makefile",
905
+ ".dev.vars": "env",
906
+ ".gitignore": "git",
907
+ ".gitattributes": "git",
908
+ ".gitmodules": "git",
909
+ ".gitkeep": "git",
910
+ ".gitconfig": "git",
911
+ ".git-blame-ignore-revs": "git",
912
+ ".mailmap": "git",
913
+ "bun.lockb": "lock",
914
+ "go.sum": "lock",
915
+ "go.mod": "go",
916
+ "go.work": "go",
917
+ gemfile: "rb",
918
+ rakefile: "rb",
919
+ brewfile: "rb",
920
+ podfile: "rb",
921
+ vagrantfile: "rb",
922
+ fastfile: "rb",
923
+ ".bashrc": "bash",
924
+ ".bash_profile": "bash",
925
+ ".bash_aliases": "bash",
926
+ ".bash_logout": "bash",
927
+ ".zshrc": "zsh",
928
+ ".zprofile": "zsh",
929
+ ".zshenv": "zsh",
930
+ ".zlogin": "zsh",
931
+ ".envrc": "sh",
932
+ ".profile": "sh",
933
+ ".editorconfig": "ini",
934
+ ".npmrc": "ini",
935
+ ".pypirc": "ini",
936
+ ".flake8": "ini",
937
+ ".pylintrc": "ini",
938
+ ".coveragerc": "ini",
939
+ caddyfile: "conf",
940
+ ".htaccess": "conf",
941
+ ".babelrc": "json",
942
+ ".swcrc": "json",
943
+ ".cursorrules": "md",
944
+ readme: "txt",
945
+ license: "txt",
946
+ licence: "txt",
947
+ changelog: "txt",
948
+ codeowners: "txt",
949
+ ".nvmrc": "txt",
950
+ ".node-version": "txt",
951
+ ".python-version": "txt",
952
+ ".ruby-version": "txt",
953
+ ".tool-versions": "txt",
954
+ ".terraform-version": "txt"
955
+ };
956
+ /** Other extensions of a known type. */
957
+ const EXTENSION_ALIASES = {
958
+ cer: "crt",
959
+ mak: "makefile",
960
+ mk: "makefile",
961
+ sqlite3: "sqlite"
962
+ };
963
+ /**
964
+ * Name families, read only when the name does not end in a known extension:
965
+ * ".env.local" is an env file and "Dockerfile.dev" a Dockerfile, while
966
+ * "Dockerfile.md" is Markdown.
967
+ */
968
+ const NAME_PATTERNS = [
969
+ [/^\.env\./, "env"],
970
+ [/^(docker|container)file\./, "dockerfile"],
971
+ [/^\.[\w-]+ignore$/, "ignore"]
972
+ ];
973
+ const MIME_FAMILIES = {
974
+ image: "image",
975
+ video: "video",
976
+ audio: "audio",
977
+ font: "font",
978
+ text: "txt"
979
+ };
980
+ const MIME_PATTERN = /^(application|audio|font|image|message|model|multipart|text|video)\/[\w.+-]+$/;
981
+ const URL_ORIGIN = /^[a-z][\w+.-]*:\/\/[^/]*/;
982
+ /**
983
+ * A value ending in an extension or a slash carries no query or hash. An
984
+ * extension has a letter, so "?v=1.2" is still a query.
985
+ */
986
+ const NAME_END = /(\.\d*[a-z][a-z\d]*|[\\/])$/;
987
+ /**
988
+ * Resolves a file name, path, URL, bare extension or MIME type to a `type`.
989
+ * A path ending in a slash is a folder; a well-known name resolves to its
990
+ * type (Dockerfile, .env.local, go.mod, LICENSE); any other name without an
991
+ * extension is an empty file; an unknown extension is returned as is and
992
+ * renders neutral.
993
+ */
994
+ function getFileType(value) {
995
+ let input = value.trim().toLowerCase();
996
+ if (URL_ORIGIN.test(input)) {
997
+ input = input.split(/[?#]/)[0].replace(URL_ORIGIN, "");
998
+ if (input === "/") return "empty";
999
+ } else if (!NAME_END.test(input)) input = input.split(/[?#]/)[0];
1000
+ if (!input) return "empty";
1001
+ if (input.endsWith("/") || input.endsWith("\\")) return "folder";
1002
+ const mime = input.split(";")[0].trim();
1003
+ if (MIME_PATTERN.test(mime)) {
1004
+ if (has(MIME_TYPES, mime)) return MIME_TYPES[mime];
1005
+ const [family, subtype] = mime.split("/");
1006
+ const tail = subtype.slice(subtype.lastIndexOf(".") + 1);
1007
+ if (subtype.includes(".") && has(extensions, tail)) return tail;
1008
+ if (has(extensions, subtype) && (family === "application" || family === "text" || extensions[subtype].category === family)) return subtype;
1009
+ return has(MIME_FAMILIES, family) ? MIME_FAMILIES[family] : "empty";
1010
+ }
1011
+ const name = input.split(/[\\/]/).pop() ?? "";
1012
+ if (has(FILE_NAMES, name)) return FILE_NAMES[name];
1013
+ const dot = name.lastIndexOf(".");
1014
+ const extension = name.slice(dot + 1);
1015
+ if (has(EXTENSION_ALIASES, extension)) return EXTENSION_ALIASES[extension];
1016
+ if (!has(extensions, extension)) {
1017
+ const match = NAME_PATTERNS.find(([pattern]) => pattern.test(name));
1018
+ if (match) return match[1];
1019
+ }
1020
+ if (dot <= 0) return resolveFileType(extension).category === "file" ? "empty" : extension;
1021
+ return extension || "empty";
1022
+ }
1023
+ /** The family of any `type`, for grouping or filtering a file list. */
1024
+ function getFileTypeCategory(type) {
1025
+ return resolveFileType(type).category;
1026
+ }
1027
+ const STROKE = { vectorEffect: "non-scaling-stroke" };
1028
+ const GLYPHS = {
1029
+ document: /* @__PURE__ */ jsx("path", {
1030
+ ...STROKE,
1031
+ d: "M8 12h8M8 15h5.5M8 18h7"
1032
+ }),
1033
+ spreadsheet: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
1034
+ ...STROKE,
1035
+ x: "7.5",
1036
+ y: "11",
1037
+ width: "9",
1038
+ height: "8",
1039
+ rx: "1"
1040
+ }), /* @__PURE__ */ jsx("path", {
1041
+ ...STROKE,
1042
+ d: "M7.5 14.5h9M11 11v8"
1043
+ })] }),
1044
+ presentation: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
1045
+ ...STROKE,
1046
+ x: "7",
1047
+ y: "11",
1048
+ width: "10",
1049
+ height: "5.5",
1050
+ rx: "1"
1051
+ }), /* @__PURE__ */ jsx("path", {
1052
+ ...STROKE,
1053
+ d: "m9.5 19.5 2.5-3 2.5 3"
1054
+ })] }),
1055
+ image: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", {
1056
+ ...STROKE,
1057
+ d: "m7 19.5 3.5-5.5 2.75 3.75 1.25-1.75 2.5 3.5Z"
1058
+ }), /* @__PURE__ */ jsx("circle", {
1059
+ ...STROKE,
1060
+ cx: "14.25",
1061
+ cy: "12",
1062
+ r: "1.25"
1063
+ })] }),
1064
+ video: /* @__PURE__ */ jsx("path", {
1065
+ ...STROKE,
1066
+ d: "M9.5 11v8l7-4Z"
1067
+ }),
1068
+ audio: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", {
1069
+ ...STROKE,
1070
+ d: "M12.5 18v-7l3 1.5"
1071
+ }), /* @__PURE__ */ jsx("circle", {
1072
+ ...STROKE,
1073
+ cx: "10.75",
1074
+ cy: "18",
1075
+ r: "1.75"
1076
+ })] }),
1077
+ code: /* @__PURE__ */ jsx("path", {
1078
+ ...STROKE,
1079
+ d: "m10 12-3 3 3 3m4-6 3 3-3 3"
1080
+ }),
1081
+ archive: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
1082
+ ...STROKE,
1083
+ x: "7",
1084
+ y: "11",
1085
+ width: "10",
1086
+ height: "3",
1087
+ rx: "0.75"
1088
+ }), /* @__PURE__ */ jsx("path", {
1089
+ ...STROKE,
1090
+ d: "M8 14v4.5a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V14M11 16.5h2"
1091
+ })] }),
1092
+ design: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
1093
+ ...STROKE,
1094
+ cx: "10.5",
1095
+ cy: "13",
1096
+ r: "2.5"
1097
+ }), /* @__PURE__ */ jsx("rect", {
1098
+ ...STROKE,
1099
+ x: "12",
1100
+ y: "14.5",
1101
+ width: "5",
1102
+ height: "5",
1103
+ rx: "1"
1104
+ })] }),
1105
+ executable: /* @__PURE__ */ jsxs(Fragment, { children: [
1106
+ /* @__PURE__ */ jsx("rect", {
1107
+ ...STROKE,
1108
+ x: "7.5",
1109
+ y: "10.75",
1110
+ width: "3.5",
1111
+ height: "3.5",
1112
+ rx: "0.75"
1113
+ }),
1114
+ /* @__PURE__ */ jsx("rect", {
1115
+ ...STROKE,
1116
+ x: "13",
1117
+ y: "10.75",
1118
+ width: "3.5",
1119
+ height: "3.5",
1120
+ rx: "0.75"
1121
+ }),
1122
+ /* @__PURE__ */ jsx("rect", {
1123
+ ...STROKE,
1124
+ x: "7.5",
1125
+ y: "16.25",
1126
+ width: "3.5",
1127
+ height: "3.5",
1128
+ rx: "0.75"
1129
+ }),
1130
+ /* @__PURE__ */ jsx("rect", {
1131
+ ...STROKE,
1132
+ x: "13",
1133
+ y: "16.25",
1134
+ width: "3.5",
1135
+ height: "3.5",
1136
+ rx: "0.75"
1137
+ })
1138
+ ] }),
1139
+ font: /* @__PURE__ */ jsx("path", {
1140
+ ...STROKE,
1141
+ d: "M8.5 12.5V11h7v1.5M12 11v8m-1.5 0h3"
1142
+ }),
1143
+ folder: /* @__PURE__ */ jsx("path", {
1144
+ ...STROKE,
1145
+ d: "M7 12a1 1 0 0 1 1-1h2.25a1 1 0 0 1 .8.4l.9 1.1H16a1 1 0 0 1 1 1V18a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1Z"
1146
+ })
1147
+ };
1148
+ /** The page: 16 by 20 units with 2-unit corners and a rounded 6-unit fold. */
1149
+ const PAGE_PATH = "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7.586a2 2 0 0 1 1.414.586l4.414 4.414A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2Z";
1150
+ const FOLD_PATH = "M14 2v5a1 1 0 0 0 1 1h5";
1151
+ /** The folded corner, traced along the page edge so it never leaves the page. */
1152
+ const FLAP_PATH = "M13.586 2a2 2 0 0 1 1.414.586l4.414 4.414A2 2 0 0 1 20 8.414V8h-5a1 1 0 0 1-1-1V2Z";
1153
+ /**
1154
+ * Lyra and Sera square every radius, so the page, its fold and the flap square
1155
+ * too: both shapes render, and a per-style variable shows one. Outside a style
1156
+ * the var() fallback keeps the rounded page.
1157
+ */
1158
+ const PAGE_PATH_SQUARE = "M4 22V2h10l6 6v14Z";
1159
+ const FOLD_PATH_SQUARE = "M14 2v6h6";
1160
+ const FLAP_PATH_SQUARE = "M14 2l6 6h-6Z";
1161
+ const ROUND = "[display:var(--file-type-round,inline)]";
1162
+ const SQUARE = "[display:var(--file-type-square,none)]";
1163
+ /**
1164
+ * CSS variable architecture, all read from the root:
1165
+ *
1166
+ * --file-type-size box width and height, set by `size`
1167
+ * --file-type-stroke line width; unset, 1px up to 40px, then proportional
1168
+ * --file-type-border page outline in outline, light and mono; unset, 40%
1169
+ * muted-foreground, 65% up to 20px
1170
+ * --file-type-fill solid page; unset, the type color
1171
+ * --file-type-glyph glyph, custom icon and label in solid; unset, the
1172
+ * foreground
1173
+ * --file-type-foreground label text, and the glyph in solid
1174
+ * --file-type-radius label corners; unset, the style's own (below)
1175
+ *
1176
+ * The root is an inline-size container and everything inside is measured in
1177
+ * `cqw` against it, so a plain Tailwind size class (`size-20`, `size-full`)
1178
+ * resizes the label and stroke with the box, not just the box. The label band
1179
+ * is the same shape on every type at every size (the Figma's 40px geometry in
1180
+ * percent); its text is 24% of the width (9.6px at 40px), so the capitals
1181
+ * fill half the band, and shrinks only when its characters would run past
1182
+ * the band. `--file-type-chars` carries the length for that fit; 0.72em is a
1183
+ * wide uppercase character, measured on WOFF2 and MPEG. Up to 20px the band
1184
+ * grows, the text turns semibold at a third of the box (5.8px at the 18px
1185
+ * mini), and the outline darkens,
1186
+ * or a row icon reads as a smudge.
1187
+ *
1188
+ * Browsers draw text on a whole-pixel baseline, which left capitals up to
1189
+ * half a pixel off center. The band's margin moves it onto that baseline
1190
+ * instead (`round()` against the label's own `1cap`), so a consumer's `top-*`
1191
+ * still places it; a browser without `round()` or `cap` keeps the plain
1192
+ * position.
1193
+ *
1194
+ * The type color is the root's text color, so one `text-*` class recolors a
1195
+ * type.
1196
+ */
1197
+ const fileTypeVariants = cva([
1198
+ "@container relative inline-block shrink-0 select-none align-middle leading-none",
1199
+ "size-(--file-type-size)",
1200
+ "[--file-type-foreground:white]"
1201
+ ], {
1202
+ variants: { size: {
1203
+ mini: "[--file-type-size:--spacing(4.5)]",
1204
+ xs: "[--file-type-size:--spacing(6)]",
1205
+ sm: "[--file-type-size:--spacing(8)]",
1206
+ default: "[--file-type-size:--spacing(10)]",
1207
+ lg: "[--file-type-size:--spacing(12)]",
1208
+ xl: "[--file-type-size:--spacing(14)]"
1209
+ } },
1210
+ defaultVariants: { size: "default" }
1211
+ });
1212
+ /**
1213
+ * Every type in `mono`: the theme's muted gray in place of its own color, with
1214
+ * the label text in the page color so it reads in both themes.
1215
+ */
1216
+ const MONO = "text-muted-foreground [--file-type-foreground:var(--background)]";
1217
+ const PAGE_CLASS = {
1218
+ outline: "fill-transparent stroke-(color:--file-type-outline)",
1219
+ light: "fill-muted stroke-(color:--file-type-outline)",
1220
+ solid: "fill-[var(--file-type-fill,currentColor)] stroke-[var(--file-type-fill,currentColor)]",
1221
+ mono: "fill-transparent stroke-(color:--file-type-outline)"
1222
+ };
1223
+ const FOLD_CLASS = {
1224
+ outline: "stroke-(color:--file-type-outline)",
1225
+ light: "stroke-(color:--file-type-outline)",
1226
+ solid: "stroke-white/45",
1227
+ mono: "stroke-(color:--file-type-outline)"
1228
+ };
1229
+ /**
1230
+ * Solid paints the glyph in the foreground and mono in its gray, already light
1231
+ * on a dark page. The others use the type color, lifted toward white in dark
1232
+ * mode: a 1px line in a 600 shade is near 3:1 on a near-black page, while the
1233
+ * label keeps the shade its white text needs.
1234
+ */
1235
+ const GLYPH_CLASS = {
1236
+ outline: "dark:text-[color-mix(in_oklab,currentColor_70%,white)]",
1237
+ light: "dark:text-[color-mix(in_oklab,currentColor_70%,white)]",
1238
+ solid: "text-[color:var(--file-type-glyph,var(--file-type-foreground))]",
1239
+ mono: ""
1240
+ };
1241
+ /**
1242
+ * The label overhangs the page's left edge, so it is a band in front of the
1243
+ * sheet. Solid has no band: the text sits on the filled page in the glyph's
1244
+ * color, across the page's width (x 4 to 20). Every label up to 4 characters
1245
+ * takes one size (20.5cqw, 8.2px at 40px), so a row of mixed types reads
1246
+ * even; a longer one shrinks at 0.8em a character (0.9em in semibold up to
1247
+ * 20px, where each label fits on its own). Measured, WMV runs 0.875em and
1248
+ * WEBM 0.79em: at 20.5cqw WEBM spends most of the side padding, and 21cqw
1249
+ * would put it on the page edge, so this is the ceiling.
1250
+ * The band's radius is bespoke chrome in the ReUI Badge's proportions per
1251
+ * style: 10cqw (4px at 40px) where the badge is `rounded-sm` on 20px, a pill
1252
+ * in the round styles, square in lyra and sera. The pill pads 30% of its
1253
+ * height a side (20% elsewhere) so the round ends clear the text, and the text
1254
+ * fit reads the same padding. A label wider than the fit expects (WEBM: W and M
1255
+ * run past 0.72em) spends that extra padding, centered, before it truncates,
1256
+ * and never grows past the band's own 95% cap, so a smaller `px-*` from
1257
+ * `labelClassName` still ends in a whole ellipsis. The no-style fallbacks
1258
+ * live in the `var()`s, not in bare rungs: the registry flattens each ladder
1259
+ * to one bare rung per style, and a second one would win or lose on class
1260
+ * order. The capitals are trimmed to their own height (`text-box`), so they
1261
+ * center in the band whatever the font's ascent; the padding keeps a
1262
+ * descender from clipping.
1263
+ */
1264
+ const LABEL_TEXT_CLASS = {
1265
+ outline: "text-(color:--file-type-foreground)",
1266
+ light: "text-(color:--file-type-foreground)",
1267
+ solid: "max-w-[calc(200cqw/3)] text-[color:var(--file-type-glyph,var(--file-type-foreground))]",
1268
+ mono: "text-(color:--file-type-foreground)"
1269
+ };
1270
+ const LABEL_CLASS = {
1271
+ outline: "bg-current",
1272
+ light: "bg-current",
1273
+ solid: "left-1/6 w-2/3 px-[3cqw] text-[length:min(20.5cqw,calc(65.6cqw/(var(--file-type-chars)*0.8)))] @max-[21px]:px-0 @max-[21px]:text-[length:min(32.5cqw,5.8px,calc(66cqw/(var(--file-type-chars)*0.9)))]",
1274
+ mono: "bg-current"
1275
+ };
1276
+ function FileType({ type, variant = "outline", size = "default", label, glyph, icon, labelClassName, className, ...props }) {
1277
+ const resolved = resolveFileType(type);
1278
+ const text = label !== void 0 ? label : resolved.label;
1279
+ const hasText = text !== void 0 && text !== null && text !== "";
1280
+ const spelled = resolved.label ? resolved.type.toUpperCase() : void 0;
1281
+ const typeName = spelled ? `${spelled} file` : CATEGORY_NAMES[resolved.category];
1282
+ const custom = typeof label === "string" ? label.toUpperCase() : "";
1283
+ const name = custom && custom !== resolved.label && custom !== spelled ? `${label}, ${typeName}` : typeName;
1284
+ const hasIcon = icon !== void 0 && icon !== null && icon !== false;
1285
+ const showLabel = hasText && !glyph && !hasIcon;
1286
+ const glyphNode = showLabel || hasIcon ? null : GLYPHS[resolved.category];
1287
+ return /* @__PURE__ */ jsxs("span", {
1288
+ role: "img",
1289
+ "aria-label": name,
1290
+ "data-slot": "file-type",
1291
+ "data-type": resolved.type,
1292
+ "data-category": resolved.category,
1293
+ "data-variant": variant,
1294
+ "data-size": size,
1295
+ className: cn(fileTypeVariants({ size }), variant === "mono" ? MONO : resolved.color, className),
1296
+ ...props,
1297
+ children: [
1298
+ /* @__PURE__ */ jsxs("svg", {
1299
+ "data-slot": "file-type-icon",
1300
+ viewBox: "0 0 24 24",
1301
+ fill: "none",
1302
+ stroke: "currentColor",
1303
+ strokeLinecap: "round",
1304
+ strokeLinejoin: "round",
1305
+ "aria-hidden": "true",
1306
+ focusable: "false",
1307
+ className: cn("absolute inset-0 size-full overflow-visible @max-[21px]:[--file-type-outline:var(--file-type-border,color-mix(in_oklab,var(--muted-foreground)_65%,transparent))] [--file-type-outline:var(--file-type-border,color-mix(in_oklab,var(--muted-foreground)_40%,transparent))] [stroke-width:var(--file-type-stroke,max(1px,2.5cqw))]", "[--file-type-round:inline]", "[--file-type-square:none]"),
1308
+ children: [
1309
+ /* @__PURE__ */ jsx("path", {
1310
+ ...STROKE,
1311
+ d: PAGE_PATH,
1312
+ className: cn(PAGE_CLASS[variant], ROUND)
1313
+ }),
1314
+ /* @__PURE__ */ jsx("path", {
1315
+ ...STROKE,
1316
+ d: PAGE_PATH_SQUARE,
1317
+ strokeLinejoin: "miter",
1318
+ className: cn(PAGE_CLASS[variant], SQUARE)
1319
+ }),
1320
+ variant === "solid" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", {
1321
+ d: FLAP_PATH,
1322
+ className: cn("fill-white/30 stroke-none", ROUND)
1323
+ }), /* @__PURE__ */ jsx("path", {
1324
+ d: FLAP_PATH_SQUARE,
1325
+ className: cn("fill-white/30 stroke-none", SQUARE)
1326
+ })] }) : null,
1327
+ /* @__PURE__ */ jsx("path", {
1328
+ ...STROKE,
1329
+ d: FOLD_PATH,
1330
+ className: cn(FOLD_CLASS[variant], ROUND)
1331
+ }),
1332
+ /* @__PURE__ */ jsx("path", {
1333
+ ...STROKE,
1334
+ d: FOLD_PATH_SQUARE,
1335
+ strokeLinejoin: "miter",
1336
+ className: cn(FOLD_CLASS[variant], SQUARE)
1337
+ }),
1338
+ glyphNode ? /* @__PURE__ */ jsx("g", {
1339
+ "data-slot": "file-type-glyph",
1340
+ stroke: "currentColor",
1341
+ className: cn("origin-[12px_15px] @max-[21px]:scale-100 scale-75", GLYPH_CLASS[variant]),
1342
+ children: glyphNode
1343
+ }) : null
1344
+ ]
1345
+ }),
1346
+ hasIcon ? /* @__PURE__ */ jsx("span", {
1347
+ "data-slot": "file-type-custom-icon",
1348
+ "aria-hidden": "true",
1349
+ className: cn("-translate-1/2 absolute top-[62.5%] left-1/2 flex @max-[21px]:size-[50cqw] size-[37.5cqw] items-center justify-center [&>svg]:size-full", GLYPH_CLASS[variant]),
1350
+ children: icon
1351
+ }) : null,
1352
+ showLabel ? /* @__PURE__ */ jsx("span", {
1353
+ "data-slot": "file-type-label",
1354
+ style: { "--file-type-chars": typeof text === "string" ? text.length : 4 },
1355
+ className: cn("absolute top-(--file-type-label-y) left-[5%] flex h-(--file-type-label-h) max-w-[95%] items-center justify-center overflow-hidden whitespace-nowrap rounded-(--file-type-radius,var(--file-type-label-radius,10cqw)) px-(--file-type-label-px,7cqw) font-medium", "text-[min(24cqw,calc((95cqw-2*var(--file-type-label-px,7cqw))/(var(--file-type-chars)*0.72)))] [--file-type-label-h:35%] [--file-type-label-y:45%]", "supports-[margin:round(1cap,1px)]:mt-[calc(round(nearest,calc(var(--file-type-label-y)+(var(--file-type-label-h)+1cap)/2),1px)-var(--file-type-label-y)-(var(--file-type-label-h)+1cap)/2)]", "@max-[21px]:px-[4cqw] @max-[21px]:font-semibold @max-[21px]:text-[min(32.5cqw,5.8px,calc(87cqw/(var(--file-type-chars)*0.88)))] @max-[21px]:[--file-type-label-h:45%] @max-[21px]:[--file-type-label-y:40%]", "[--file-type-label-radius:10cqw]", "[--file-type-label-px:7cqw]", LABEL_CLASS[variant], labelClassName),
1356
+ children: /* @__PURE__ */ jsx("span", {
1357
+ className: cn("@max-[21px]:max-w-full max-w-[min(95cqw,calc(100%+2*max(0px,var(--file-type-label-px,7cqw)-7cqw)))] shrink-0 truncate py-[0.25em] [text-box:trim-both_cap_alphabetic]", LABEL_TEXT_CLASS[variant]),
1358
+ children: text
1359
+ })
1360
+ }) : null
1361
+ ]
1362
+ });
1363
+ }
1364
+ //#endregion
1365
+ export { FILE_TYPE_CATEGORIES, FILE_TYPE_EXTENSION_NAMES, FileType, fileTypeVariants, getFileType, getFileTypeCategory };
1366
+
1367
+ //# sourceMappingURL=file-type.js.map