@thewrong/ui 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs.js +1 -0
  2. package/dist/components/_shared/form-size-tokens.cjs.js +1 -0
  3. package/dist/components/_shared/form-size-tokens.esm.js +29 -0
  4. package/dist/components/action-toast/ActionToast.cjs.js +1 -0
  5. package/dist/components/action-toast/ActionToast.esm.js +228 -0
  6. package/dist/components/animated-height/AnimatedHeight.cjs.js +1 -0
  7. package/dist/components/animated-height/AnimatedHeight.esm.js +36 -0
  8. package/dist/components/badge/Badge.cjs.js +1 -0
  9. package/dist/components/badge/Badge.esm.js +30 -0
  10. package/dist/components/badge/utils.cjs.js +1 -0
  11. package/dist/components/badge/utils.esm.js +38 -0
  12. package/dist/components/button/Button.cjs.js +1 -0
  13. package/dist/components/button/Button.esm.js +84 -0
  14. package/dist/components/button/utils.cjs.js +1 -0
  15. package/dist/components/button/utils.esm.js +38 -0
  16. package/dist/components/checkbox/Checkbox.cjs.js +1 -0
  17. package/dist/components/checkbox/Checkbox.esm.js +68 -0
  18. package/dist/components/checkbox/utils.cjs.js +1 -0
  19. package/dist/components/checkbox/utils.esm.js +44 -0
  20. package/dist/components/collapsible/Collapsible.cjs.js +1 -0
  21. package/dist/components/collapsible/Collapsible.esm.js +19 -0
  22. package/dist/components/date-input/DateInput.cjs.js +1 -0
  23. package/dist/components/date-input/DateInput.esm.js +39 -0
  24. package/dist/components/date-picker/date-picker.cjs.js +1 -0
  25. package/dist/components/date-picker/date-picker.esm.js +231 -0
  26. package/dist/components/date-picker/date-range-picker.cjs.js +1 -0
  27. package/dist/components/date-picker/date-range-picker.esm.js +287 -0
  28. package/dist/components/date-picker/month-picker.cjs.js +1 -0
  29. package/dist/components/date-picker/month-picker.esm.js +147 -0
  30. package/dist/components/drawer/Drawer.cjs.js +1 -0
  31. package/dist/components/drawer/Drawer.esm.js +113 -0
  32. package/dist/components/info-tooltip/InfoTooltip.cjs.js +1 -0
  33. package/dist/components/info-tooltip/InfoTooltip.esm.js +24 -0
  34. package/dist/components/input/Input.cjs.js +1 -0
  35. package/dist/components/input/Input.esm.js +95 -0
  36. package/dist/components/input/PasswordInput.cjs.js +1 -0
  37. package/dist/components/input/PasswordInput.esm.js +29 -0
  38. package/dist/components/input/format.cjs.js +1 -0
  39. package/dist/components/input/format.esm.js +33 -0
  40. package/dist/components/input/utils.cjs.js +1 -0
  41. package/dist/components/input/utils.esm.js +23 -0
  42. package/dist/components/loading-spinner/LoadingSpinner.cjs.js +1 -0
  43. package/dist/components/loading-spinner/LoadingSpinner.esm.js +47 -0
  44. package/dist/components/modal/Modal.cjs.js +1 -0
  45. package/dist/components/modal/Modal.esm.js +137 -0
  46. package/dist/components/modal/ModalSubView.cjs.js +1 -0
  47. package/dist/components/modal/ModalSubView.esm.js +91 -0
  48. package/dist/components/modal/StandardModal.cjs.js +1 -0
  49. package/dist/components/modal/StandardModal.esm.js +54 -0
  50. package/dist/components/page-title/PageTitle.cjs.js +1 -0
  51. package/dist/components/page-title/PageTitle.esm.js +16 -0
  52. package/dist/components/popover/Popover.cjs.js +1 -0
  53. package/dist/components/popover/Popover.esm.js +57 -0
  54. package/dist/components/search-box/ExactMatchToggle.cjs.js +1 -0
  55. package/dist/components/search-box/ExactMatchToggle.esm.js +27 -0
  56. package/dist/components/search-box/SearchBox.cjs.js +1 -0
  57. package/dist/components/search-box/SearchBox.esm.js +154 -0
  58. package/dist/components/search-box/SearchBoxChips.cjs.js +1 -0
  59. package/dist/components/search-box/SearchBoxChips.esm.js +36 -0
  60. package/dist/components/search-box/SearchBoxDateRange.cjs.js +1 -0
  61. package/dist/components/search-box/SearchBoxDateRange.esm.js +57 -0
  62. package/dist/components/search-box/SearchBoxDateSingle.cjs.js +1 -0
  63. package/dist/components/search-box/SearchBoxDateSingle.esm.js +37 -0
  64. package/dist/components/search-box/SearchBoxField.cjs.js +1 -0
  65. package/dist/components/search-box/SearchBoxField.esm.js +48 -0
  66. package/dist/components/search-box/SearchBoxFloatingInput.cjs.js +1 -0
  67. package/dist/components/search-box/SearchBoxFloatingInput.esm.js +38 -0
  68. package/dist/components/search-box/SearchBoxFloatingSelect.cjs.js +1 -0
  69. package/dist/components/search-box/SearchBoxFloatingSelect.esm.js +74 -0
  70. package/dist/components/search-box/SearchBoxMonth.cjs.js +1 -0
  71. package/dist/components/search-box/SearchBoxMonth.esm.js +35 -0
  72. package/dist/components/search-box/SearchBoxMultiSelect.cjs.js +1 -0
  73. package/dist/components/search-box/SearchBoxMultiSelect.esm.js +78 -0
  74. package/dist/components/search-box/SearchBoxSheetContext.cjs.js +1 -0
  75. package/dist/components/search-box/SearchBoxSheetContext.esm.js +5 -0
  76. package/dist/components/search-box/dateRangePresets.cjs.js +1 -0
  77. package/dist/components/search-box/dateRangePresets.esm.js +59 -0
  78. package/dist/components/search-box/parseDateRange.cjs.js +1 -0
  79. package/dist/components/search-box/parseDateRange.esm.js +21 -0
  80. package/dist/components/search-box/parseSearchValues.cjs.js +1 -0
  81. package/dist/components/search-box/parseSearchValues.esm.js +15 -0
  82. package/dist/components/search-box/useSearchBoxState.cjs.js +1 -0
  83. package/dist/components/search-box/useSearchBoxState.esm.js +87 -0
  84. package/dist/components/select/MultiSelect.cjs.js +1 -0
  85. package/dist/components/select/MultiSelect.esm.js +277 -0
  86. package/dist/components/select/Select.cjs.js +1 -0
  87. package/dist/components/select/Select.esm.js +308 -0
  88. package/dist/components/select/loading-dots.cjs.js +1 -0
  89. package/dist/components/select/loading-dots.esm.js +23 -0
  90. package/dist/components/switch/Switch.cjs.js +1 -0
  91. package/dist/components/switch/Switch.esm.js +36 -0
  92. package/dist/components/switch/utils.cjs.js +1 -0
  93. package/dist/components/switch/utils.esm.js +39 -0
  94. package/dist/components/table/accordion-table.cjs.js +1 -0
  95. package/dist/components/table/accordion-table.esm.js +418 -0
  96. package/dist/components/table/column-group-utils.cjs.js +1 -0
  97. package/dist/components/table/column-group-utils.esm.js +53 -0
  98. package/dist/components/table/components/ColumnPresetSelector.cjs.js +1 -0
  99. package/dist/components/table/components/ColumnPresetSelector.esm.js +165 -0
  100. package/dist/components/table/components/ColumnSettingsTable.cjs.js +4 -0
  101. package/dist/components/table/components/ColumnSettingsTable.esm.js +196 -0
  102. package/dist/components/table/components/KeyboardNavButton.cjs.js +1 -0
  103. package/dist/components/table/components/KeyboardNavButton.esm.js +24 -0
  104. package/dist/components/table/components/PageJumpInput.cjs.js +1 -0
  105. package/dist/components/table/components/PageJumpInput.esm.js +53 -0
  106. package/dist/components/table/components/Pagination.cjs.js +1 -0
  107. package/dist/components/table/components/Pagination.esm.js +162 -0
  108. package/dist/components/table/components/PaginationFooter.cjs.js +1 -0
  109. package/dist/components/table/components/PaginationFooter.esm.js +80 -0
  110. package/dist/components/table/components/SortableHeaderCell.cjs.js +1 -0
  111. package/dist/components/table/components/SortableHeaderCell.esm.js +30 -0
  112. package/dist/components/table/hooks/useColumnPresets.cjs.js +1 -0
  113. package/dist/components/table/hooks/useColumnPresets.esm.js +165 -0
  114. package/dist/components/table/hooks/useColumnResize.cjs.js +1 -0
  115. package/dist/components/table/hooks/useColumnResize.esm.js +106 -0
  116. package/dist/components/table/hooks/useFillEmptyRows.cjs.js +1 -0
  117. package/dist/components/table/hooks/useFillEmptyRows.esm.js +49 -0
  118. package/dist/components/table/hooks/useInfiniteScroll.cjs.js +1 -0
  119. package/dist/components/table/hooks/useInfiniteScroll.esm.js +32 -0
  120. package/dist/components/table/hooks/useTableColumnState.cjs.js +1 -0
  121. package/dist/components/table/hooks/useTableColumnState.esm.js +46 -0
  122. package/dist/components/table/hooks/useTableDragSelection.cjs.js +1 -0
  123. package/dist/components/table/hooks/useTableDragSelection.esm.js +76 -0
  124. package/dist/components/table/hooks/useTableSort.cjs.js +1 -0
  125. package/dist/components/table/hooks/useTableSort.esm.js +30 -0
  126. package/dist/components/table/hooks/useVirtualTable.cjs.js +1 -0
  127. package/dist/components/table/hooks/useVirtualTable.esm.js +18 -0
  128. package/dist/components/table/mini-table.cjs.js +1 -0
  129. package/dist/components/table/mini-table.esm.js +126 -0
  130. package/dist/components/table/paginated-mini-table.cjs.js +1 -0
  131. package/dist/components/table/paginated-mini-table.esm.js +31 -0
  132. package/dist/components/table/paginated-table.cjs.js +1 -0
  133. package/dist/components/table/paginated-table.esm.js +31 -0
  134. package/dist/components/table/table.cjs.js +1 -0
  135. package/dist/components/table/table.esm.js +342 -0
  136. package/dist/components/table/utils.cjs.js +37 -0
  137. package/dist/components/table/utils.esm.js +16 -0
  138. package/dist/components/table-checkbox/TableCheckbox.cjs.js +1 -0
  139. package/dist/components/table-checkbox/TableCheckbox.esm.js +39 -0
  140. package/dist/components/table-page-layout/TablePageLayout.cjs.js +1 -0
  141. package/dist/components/table-page-layout/TablePageLayout.esm.js +37 -0
  142. package/dist/components/textarea/Textarea.cjs.js +1 -0
  143. package/dist/components/textarea/Textarea.esm.js +62 -0
  144. package/dist/components/toast/ToastProvider.cjs.js +1 -0
  145. package/dist/components/toast/ToastProvider.esm.js +82 -0
  146. package/dist/components/toast/index.esm.js +3 -0
  147. package/dist/components/toolbar/Toolbar.cjs.js +1 -0
  148. package/dist/components/toolbar/Toolbar.esm.js +148 -0
  149. package/dist/components/tooltip/Tooltip.cjs.js +1 -0
  150. package/dist/components/tooltip/Tooltip.esm.js +39 -0
  151. package/dist/hooks/useBottomSheetDrag.cjs.js +1 -0
  152. package/dist/hooks/useBottomSheetDrag.esm.js +17 -0
  153. package/dist/hooks/useClickOutside.cjs.js +1 -0
  154. package/dist/hooks/useClickOutside.esm.js +20 -0
  155. package/dist/hooks/useMediaQuery.cjs.js +1 -0
  156. package/dist/hooks/useMediaQuery.esm.js +15 -0
  157. package/dist/hooks/useScrollLock.cjs.js +1 -0
  158. package/dist/hooks/useScrollLock.esm.js +16 -0
  159. package/dist/hooks.cjs.js +1 -0
  160. package/dist/hooks.esm.js +5 -0
  161. package/dist/index.cjs.js +1 -40
  162. package/dist/index.esm.js +58 -0
  163. package/dist/lib/Portal.cjs.js +1 -0
  164. package/dist/lib/Portal.esm.js +11 -0
  165. package/dist/lib/column-preset-storage.cjs.js +1 -0
  166. package/dist/lib/column-preset-storage.esm.js +123 -0
  167. package/dist/lib/overlay-stack.cjs.js +1 -0
  168. package/dist/lib/overlay-stack.esm.js +28 -0
  169. package/dist/lib/utils.cjs.js +1 -0
  170. package/dist/lib/utils.esm.js +11 -0
  171. package/dist/node_modules/clsx/dist/clsx.cjs.js +1 -0
  172. package/dist/node_modules/clsx/dist/clsx.esm.js +16 -0
  173. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.js +1 -0
  174. package/dist/node_modules/lucide-react/dist/esm/Icon.esm.js +23 -0
  175. package/dist/node_modules/lucide-react/dist/esm/context.cjs.js +1 -0
  176. package/dist/node_modules/lucide-react/dist/esm/context.esm.js +6 -0
  177. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.js +1 -0
  178. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.esm.js +17 -0
  179. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.js +1 -0
  180. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.esm.js +14 -0
  181. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.cjs.js +1 -0
  182. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.esm.js +10 -0
  183. package/dist/node_modules/lucide-react/dist/esm/icons/calendar.cjs.js +1 -0
  184. package/dist/node_modules/lucide-react/dist/esm/icons/calendar.esm.js +25 -0
  185. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.js +1 -0
  186. package/dist/node_modules/lucide-react/dist/esm/icons/check.esm.js +7 -0
  187. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs.js +1 -0
  188. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.esm.js +7 -0
  189. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.js +1 -0
  190. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.esm.js +7 -0
  191. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.js +1 -0
  192. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.esm.js +7 -0
  193. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-left.cjs.js +1 -0
  194. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-left.esm.js +10 -0
  195. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-right.cjs.js +1 -0
  196. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-right.esm.js +10 -0
  197. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.js +1 -0
  198. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.esm.js +12 -0
  199. package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.cjs.js +1 -0
  200. package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.esm.js +19 -0
  201. package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.cjs.js +1 -0
  202. package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.esm.js +21 -0
  203. package/dist/node_modules/lucide-react/dist/esm/icons/eye.cjs.js +1 -0
  204. package/dist/node_modules/lucide-react/dist/esm/icons/eye.esm.js +12 -0
  205. package/dist/node_modules/lucide-react/dist/esm/icons/grip-vertical.cjs.js +1 -0
  206. package/dist/node_modules/lucide-react/dist/esm/icons/grip-vertical.esm.js +41 -0
  207. package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs.js +1 -0
  208. package/dist/node_modules/lucide-react/dist/esm/icons/info.esm.js +19 -0
  209. package/dist/node_modules/lucide-react/dist/esm/icons/keyboard.cjs.js +1 -0
  210. package/dist/node_modules/lucide-react/dist/esm/icons/keyboard.esm.js +45 -0
  211. package/dist/node_modules/lucide-react/dist/esm/icons/list-filter.cjs.js +1 -0
  212. package/dist/node_modules/lucide-react/dist/esm/icons/list-filter.esm.js +17 -0
  213. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.js +1 -0
  214. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.esm.js +7 -0
  215. package/dist/node_modules/lucide-react/dist/esm/icons/minus.cjs.js +1 -0
  216. package/dist/node_modules/lucide-react/dist/esm/icons/minus.esm.js +7 -0
  217. package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.cjs.js +1 -0
  218. package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.esm.js +10 -0
  219. package/dist/node_modules/lucide-react/dist/esm/icons/save.cjs.js +1 -0
  220. package/dist/node_modules/lucide-react/dist/esm/icons/save.esm.js +17 -0
  221. package/dist/node_modules/lucide-react/dist/esm/icons/search.cjs.js +1 -0
  222. package/dist/node_modules/lucide-react/dist/esm/icons/search.esm.js +12 -0
  223. package/dist/node_modules/lucide-react/dist/esm/icons/settings.cjs.js +1 -0
  224. package/dist/node_modules/lucide-react/dist/esm/icons/settings.esm.js +12 -0
  225. package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.cjs.js +1 -0
  226. package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.esm.js +17 -0
  227. package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs.js +1 -0
  228. package/dist/node_modules/lucide-react/dist/esm/icons/wrench.esm.js +7 -0
  229. package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.js +1 -0
  230. package/dist/node_modules/lucide-react/dist/esm/icons/x.esm.js +10 -0
  231. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs.js +1 -0
  232. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.esm.js +7 -0
  233. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs.js +1 -0
  234. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.esm.js +4 -0
  235. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs.js +1 -0
  236. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.esm.js +4 -0
  237. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs.js +1 -0
  238. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.esm.js +4 -0
  239. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs.js +1 -0
  240. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.esm.js +8 -0
  241. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.js +1 -0
  242. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.esm.js +1714 -0
  243. package/dist/node_modules/use-debounce/dist/index.module.cjs.js +1 -0
  244. package/dist/node_modules/use-debounce/dist/index.module.esm.js +70 -0
  245. package/dist/src/components/action-toast/ActionToast.d.ts +6 -1
  246. package/dist/src/components/button/Button.d.ts +16 -0
  247. package/dist/src/components/drawer/Drawer.d.ts +6 -1
  248. package/dist/src/components/info-tooltip/InfoTooltip.d.ts +7 -0
  249. package/dist/src/components/loading-spinner/LoadingSpinner.d.ts +7 -0
  250. package/dist/src/components/modal/Modal.d.ts +7 -1
  251. package/dist/src/components/popover/Popover.d.ts +19 -1
  252. package/dist/src/components/tooltip/Tooltip.d.ts +10 -0
  253. package/dist/ui.css +1 -1
  254. package/llms.txt +91 -0
  255. package/package.json +10 -4
  256. package/dist/index.es.js +0 -8066
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
@@ -0,0 +1 @@
1
+ var e={mini:`h-3.5 w-3.5`,small:`h-4 w-4`,medium:`h-4.5 w-4.5`,large:`h-5 w-5`},t={mini:`h-3.5 w-3.5`,small:`h-4 w-4`,medium:`h-4.5 w-4.5`,large:`h-5 w-5`},n={mini:`[&>svg]:h-3.5 [&>svg]:w-3.5`,small:`[&>svg]:h-4 [&>svg]:w-4`,medium:`[&>svg]:h-4.5 [&>svg]:w-4.5`,large:`[&>svg]:h-5 [&>svg]:w-5`},r={mini:`text-[10px]`,small:`text-xs`,medium:`text-xs`,large:`text-sm`},i={mini:`gap-1.5`,small:`gap-2`,medium:`gap-3`,large:`gap-3.5`};exports.CHEVRON_SIZE_CLASS=t,exports.SLOT_BADGE_TEXT_CLASS=r,exports.SLOT_CHILD_ICON_CLASS=n,exports.SLOT_GAP_CLASS=i,exports.SLOT_ICON_SIZE_CLASS=e;
@@ -0,0 +1,29 @@
1
+ //#region src/components/_shared/form-size-tokens.ts
2
+ var e = {
3
+ mini: "h-3.5 w-3.5",
4
+ small: "h-4 w-4",
5
+ medium: "h-4.5 w-4.5",
6
+ large: "h-5 w-5"
7
+ }, t = {
8
+ mini: "h-3.5 w-3.5",
9
+ small: "h-4 w-4",
10
+ medium: "h-4.5 w-4.5",
11
+ large: "h-5 w-5"
12
+ }, n = {
13
+ mini: "[&>svg]:h-3.5 [&>svg]:w-3.5",
14
+ small: "[&>svg]:h-4 [&>svg]:w-4",
15
+ medium: "[&>svg]:h-4.5 [&>svg]:w-4.5",
16
+ large: "[&>svg]:h-5 [&>svg]:w-5"
17
+ }, r = {
18
+ mini: "text-[10px]",
19
+ small: "text-xs",
20
+ medium: "text-xs",
21
+ large: "text-sm"
22
+ }, i = {
23
+ mini: "gap-1.5",
24
+ small: "gap-2",
25
+ medium: "gap-3",
26
+ large: "gap-3.5"
27
+ };
28
+ //#endregion
29
+ export { t as CHEVRON_SIZE_CLASS, r as SLOT_BADGE_TEXT_CLASS, n as SLOT_CHILD_ICON_CLASS, i as SLOT_GAP_CLASS, e as SLOT_ICON_SIZE_CLASS };
@@ -0,0 +1 @@
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../button/Button.cjs.js"),n=require("../../node_modules/lucide-react/dist/esm/icons/circle-x.cjs.js"),r=require("../../node_modules/lucide-react/dist/esm/icons/info.cjs.js"),i=require("../../node_modules/lucide-react/dist/esm/icons/triangle-alert.cjs.js"),a=require("../input/Input.cjs.js"),o=require("../textarea/Textarea.cjs.js"),s=require("../../lib/utils.cjs.js"),c=require("../../hooks/useMediaQuery.cjs.js"),l=require("../../lib/overlay-stack.cjs.js");let u=require("react"),d=require("react/jsx-runtime"),f=require("motion/react"),p=require("react-hot-toast");p=e.__toESM(p,1);let m=require("react-dom");var h=`action-toast-singleton`;function g(e){_=e,e?l.overlayStack.push(l.ACTION_TOAST_OVERLAY_ID,l.ACTION_TOAST_PRIORITY):l.overlayStack.pop(l.ACTION_TOAST_OVERLAY_ID)}var _=!1;function v({message:e,actions:t,tone:n=`warning`,icon:r,input:i,widthPx:a,backdrop:o=!0,className:s}){return g(!0),p.default.custom(c=>(0,d.jsx)(w,{toastInstance:c,message:e,actions:t,tone:n,icon:r,input:i,widthPx:a,backdrop:o,className:s}),{id:h,duration:1/0})}function y(){p.default.dismiss(h),g(!1)}function b(){return _}function x(e){if(e===`tertiary`)return`dark:bg-white/10 dark:hover:bg-white/15 dark:active:bg-white/20 dark:text-white`}var S={warning:`text-amber-400`,info:`text-blue-400`,danger:`text-rose-400`};function C(e,t){let n=`${t} shrink-0 ${S[e]}`;return e===`info`?(0,d.jsx)(r.Info,{className:n,strokeWidth:2,"aria-hidden":!0}):(0,d.jsx)(i.TriangleAlert,{className:n,strokeWidth:2,"aria-hidden":!0})}function w({toastInstance:e,message:r,actions:i,tone:h,icon:_,input:v,widthPx:y=680,backdrop:b,className:S}){let w=c.useIsMobile(),T=w?`h-4 w-4`:`h-4.5 w-4.5`,E=w?`text-xs`:`text-sm`,D=w?`mini`:`small`,O=w?`px-3 py-2.5`:`px-4 py-3`,k=w?`px-3 py-3`:`px-4 py-3.5`,A=w?`gap-2`:`gap-3`,j=_===void 0?C(h,T):_,[M,N]=(0,u.useState)(v?.defaultValue??``);(0,u.useEffect)(()=>{let t=t=>{t.key===`Escape`&&l.overlayStack.isTop(`action-toast-overlay`)&&(p.default.dismiss(e.id),g(!1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.id]);let P=(0,u.useRef)(null),[F,I]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=P.current;if(!e)return;let t=()=>{let t=window.getComputedStyle(e),n=parseFloat(t.lineHeight);!Number.isFinite(n)||n<=0||I(e.scrollHeight>n+1.5)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r]);let L=w&&F&&!v;(0,u.useEffect)(()=>{N(v?.defaultValue??``)},[v?.defaultValue,v?.type]);let R=t=>{(t.closeOnClick??!0)&&(p.default.dismiss(e.id),g(!1)),t.onClick(M)},z=b?null:(0,d.jsx)(`button`,{type:`button`,onClick:()=>{p.default.dismiss(e.id),g(!1)},className:`ml-1 shrink-0 text-white/70 hover:text-white transition-colors cursor-pointer`,"aria-label":`닫기`,children:(0,d.jsx)(n.CircleX,{className:T,fill:`currentColor`,stroke:`var(--color-secondary-700)`,strokeWidth:2})}),B=(e,n=!1)=>i.length>0&&(0,d.jsx)(`div`,{className:e,children:i.map((e,r)=>(0,d.jsx)(t.Button,{variant:e.variant,appearance:e.appearance,size:e.size??D,leadingIcon:e.leadingIcon,trailingIcon:e.trailingIcon,disabled:n?void 0:e.disabled,onClick:n?void 0:()=>R(e),tabIndex:n?-1:void 0,className:n?void 0:x(e.variant),children:e.label},r))});return(0,d.jsxs)(d.Fragment,{children:[b&&(0,m.createPortal)((0,d.jsx)(f.motion.div,{initial:{opacity:0},animate:{opacity:+!!e.visible},transition:{duration:.18},onClick:()=>{p.default.dismiss(e.id),g(!1)},className:`fixed inset-0 z-9998 bg-black/15 ${e.visible?``:`pointer-events-none`}`,"aria-hidden":!0}),document.body),(0,d.jsx)(f.motion.div,{initial:{opacity:0,scale:.98},animate:e.visible?{opacity:1,scale:1}:{opacity:0,scale:.98},transition:{duration:.22,ease:[.16,1,.3,1]},className:s.cn(`dark relative rounded-2xl bg-secondary-700 text-white shadow-lg`,e.visible?``:`pointer-events-none`,S),style:{width:`min(${y}px, calc(100vw - 32px))`},role:`alertdialog`,"aria-modal":b?`true`:void 0,"aria-label":`확인이 필요한 알림`,children:v?(0,d.jsxs)(`div`,{className:`flex flex-col gap-2.5 ${k}`,children:[(0,d.jsxs)(`div`,{className:`flex items-start ${A}`,children:[j,(0,d.jsx)(`div`,{className:`min-w-0 flex-1 ${E} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,children:r}),z]}),v.type===`text`?(0,d.jsx)(a.Input,{variant:`box`,inputSize:w?`mini`:`small`,autoFocus:!0,value:M,onChange:e=>N(e.target.value),onKeyDown:e=>{if(e.key!==`Enter`||e.nativeEvent.isComposing)return;let t=i[i.length-1];!t||t.disabled||(e.preventDefault(),R(t))},placeholder:v.placeholder}):(0,d.jsx)(o.Textarea,{textareaSize:w?`mini`:`small`,rows:v.rows??3,autoFocus:!0,value:M,onChange:e=>N(e.target.value),placeholder:v.placeholder}),B(`flex justify-end gap-1.5`)]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{"aria-hidden":!0,className:`invisible pointer-events-none absolute inset-0 flex items-center ${A} ${O}`,children:[(0,d.jsx)(`span`,{className:`${T} shrink-0`}),(0,d.jsx)(`div`,{ref:P,className:`min-w-0 flex-1 ${E} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,children:r}),B(`flex shrink-0 gap-1.5`,!0)]}),L?(0,d.jsxs)(`div`,{className:`relative flex flex-col ${A} ${k}`,children:[z&&(0,d.jsx)(`div`,{className:`absolute right-3 top-3`,children:z}),(0,d.jsx)(`div`,{className:`flex justify-center`,children:j}),(0,d.jsx)(`div`,{className:`${E} leading-relaxed text-center whitespace-pre-line break-keep wrap-break-word`,children:r}),B(`flex justify-end gap-1.5`)]}):(0,d.jsxs)(`div`,{className:`flex items-center ${A} ${O}`,children:[j,(0,d.jsx)(`div`,{className:`min-w-0 flex-1 ${E} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,children:r}),B(`flex shrink-0 gap-1.5`),z]})]})})]})}exports.dismissActionToast=y,exports.isActionToastActive=b,exports.showActionToast=v;
@@ -0,0 +1,228 @@
1
+ import { Button as e } from "../button/Button.esm.js";
2
+ import { CircleX as t } from "../../node_modules/lucide-react/dist/esm/icons/circle-x.esm.js";
3
+ import { Info as n } from "../../node_modules/lucide-react/dist/esm/icons/info.esm.js";
4
+ import { TriangleAlert as r } from "../../node_modules/lucide-react/dist/esm/icons/triangle-alert.esm.js";
5
+ import { Input as i } from "../input/Input.esm.js";
6
+ import { Textarea as a } from "../textarea/Textarea.esm.js";
7
+ import { cn as o } from "../../lib/utils.esm.js";
8
+ import { useIsMobile as s } from "../../hooks/useMediaQuery.esm.js";
9
+ import { ACTION_TOAST_OVERLAY_ID as c, ACTION_TOAST_PRIORITY as l, overlayStack as u } from "../../lib/overlay-stack.esm.js";
10
+ import { useEffect as d, useRef as f, useState as p } from "react";
11
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
12
+ import { motion as _ } from "motion/react";
13
+ import v from "react-hot-toast";
14
+ import { createPortal as y } from "react-dom";
15
+ //#region src/components/action-toast/ActionToast.tsx
16
+ var b = "action-toast-singleton";
17
+ function x(e) {
18
+ S = e, e ? u.push(c, l) : u.pop(c);
19
+ }
20
+ var S = !1;
21
+ function C({ message: e, actions: t, tone: n = "warning", icon: r, input: i, widthPx: a, backdrop: o = !0, className: s }) {
22
+ return x(!0), v.custom((c) => /* @__PURE__ */ h(k, {
23
+ toastInstance: c,
24
+ message: e,
25
+ actions: t,
26
+ tone: n,
27
+ icon: r,
28
+ input: i,
29
+ widthPx: a,
30
+ backdrop: o,
31
+ className: s
32
+ }), {
33
+ id: b,
34
+ duration: Infinity
35
+ });
36
+ }
37
+ function w() {
38
+ v.dismiss(b), x(!1);
39
+ }
40
+ function T() {
41
+ return S;
42
+ }
43
+ function E(e) {
44
+ if (e === "tertiary") return "dark:bg-white/10 dark:hover:bg-white/15 dark:active:bg-white/20 dark:text-white";
45
+ }
46
+ var D = {
47
+ warning: "text-amber-400",
48
+ info: "text-blue-400",
49
+ danger: "text-rose-400"
50
+ };
51
+ function O(e, t) {
52
+ let i = `${t} shrink-0 ${D[e]}`;
53
+ return h(e === "info" ? n : r, {
54
+ className: i,
55
+ strokeWidth: 2,
56
+ "aria-hidden": !0
57
+ });
58
+ }
59
+ function k({ toastInstance: n, message: r, actions: c, tone: l, icon: b, input: S, widthPx: C = 680, backdrop: w, className: T }) {
60
+ let D = s(), k = D ? "h-4 w-4" : "h-4.5 w-4.5", A = D ? "text-xs" : "text-sm", j = D ? "mini" : "small", M = D ? "px-3 py-2.5" : "px-4 py-3", N = D ? "px-3 py-3" : "px-4 py-3.5", P = D ? "gap-2" : "gap-3", F = b === void 0 ? O(l, k) : b, [I, L] = p(S?.defaultValue ?? "");
61
+ d(() => {
62
+ let e = (e) => {
63
+ e.key === "Escape" && u.isTop("action-toast-overlay") && (v.dismiss(n.id), x(!1));
64
+ };
65
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
66
+ }, [n.id]);
67
+ let R = f(null), [z, B] = p(!1);
68
+ d(() => {
69
+ let e = R.current;
70
+ if (!e) return;
71
+ let t = () => {
72
+ let t = window.getComputedStyle(e), n = parseFloat(t.lineHeight);
73
+ !Number.isFinite(n) || n <= 0 || B(e.scrollHeight > n + 1.5);
74
+ };
75
+ t();
76
+ let n = new ResizeObserver(t);
77
+ return n.observe(e), () => n.disconnect();
78
+ }, [r]);
79
+ let V = D && z && !S;
80
+ d(() => {
81
+ L(S?.defaultValue ?? "");
82
+ }, [S?.defaultValue, S?.type]);
83
+ let H = (e) => {
84
+ (e.closeOnClick ?? !0) && (v.dismiss(n.id), x(!1)), e.onClick(I);
85
+ }, U = w ? null : /* @__PURE__ */ h("button", {
86
+ type: "button",
87
+ onClick: () => {
88
+ v.dismiss(n.id), x(!1);
89
+ },
90
+ className: "ml-1 shrink-0 text-white/70 hover:text-white transition-colors cursor-pointer",
91
+ "aria-label": "닫기",
92
+ children: /* @__PURE__ */ h(t, {
93
+ className: k,
94
+ fill: "currentColor",
95
+ stroke: "var(--color-secondary-700)",
96
+ strokeWidth: 2
97
+ })
98
+ }), W = (t, n = !1) => c.length > 0 && /* @__PURE__ */ h("div", {
99
+ className: t,
100
+ children: c.map((t, r) => /* @__PURE__ */ h(e, {
101
+ variant: t.variant,
102
+ appearance: t.appearance,
103
+ size: t.size ?? j,
104
+ leadingIcon: t.leadingIcon,
105
+ trailingIcon: t.trailingIcon,
106
+ disabled: n ? void 0 : t.disabled,
107
+ onClick: n ? void 0 : () => H(t),
108
+ tabIndex: n ? -1 : void 0,
109
+ className: n ? void 0 : E(t.variant),
110
+ children: t.label
111
+ }, r))
112
+ });
113
+ return /* @__PURE__ */ g(m, { children: [w && y(/* @__PURE__ */ h(_.div, {
114
+ initial: { opacity: 0 },
115
+ animate: { opacity: +!!n.visible },
116
+ transition: { duration: .18 },
117
+ onClick: () => {
118
+ v.dismiss(n.id), x(!1);
119
+ },
120
+ className: `fixed inset-0 z-9998 bg-black/15 ${n.visible ? "" : "pointer-events-none"}`,
121
+ "aria-hidden": !0
122
+ }), document.body), /* @__PURE__ */ h(_.div, {
123
+ initial: {
124
+ opacity: 0,
125
+ scale: .98
126
+ },
127
+ animate: n.visible ? {
128
+ opacity: 1,
129
+ scale: 1
130
+ } : {
131
+ opacity: 0,
132
+ scale: .98
133
+ },
134
+ transition: {
135
+ duration: .22,
136
+ ease: [
137
+ .16,
138
+ 1,
139
+ .3,
140
+ 1
141
+ ]
142
+ },
143
+ className: o("dark relative rounded-2xl bg-secondary-700 text-white shadow-lg", n.visible ? "" : "pointer-events-none", T),
144
+ style: { width: `min(${C}px, calc(100vw - 32px))` },
145
+ role: "alertdialog",
146
+ "aria-modal": w ? "true" : void 0,
147
+ "aria-label": "확인이 필요한 알림",
148
+ children: S ? /* @__PURE__ */ g("div", {
149
+ className: `flex flex-col gap-2.5 ${N}`,
150
+ children: [
151
+ /* @__PURE__ */ g("div", {
152
+ className: `flex items-start ${P}`,
153
+ children: [
154
+ F,
155
+ /* @__PURE__ */ h("div", {
156
+ className: `min-w-0 flex-1 ${A} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
157
+ children: r
158
+ }),
159
+ U
160
+ ]
161
+ }),
162
+ S.type === "text" ? /* @__PURE__ */ h(i, {
163
+ variant: "box",
164
+ inputSize: D ? "mini" : "small",
165
+ autoFocus: !0,
166
+ value: I,
167
+ onChange: (e) => L(e.target.value),
168
+ onKeyDown: (e) => {
169
+ if (e.key !== "Enter" || e.nativeEvent.isComposing) return;
170
+ let t = c[c.length - 1];
171
+ !t || t.disabled || (e.preventDefault(), H(t));
172
+ },
173
+ placeholder: S.placeholder
174
+ }) : /* @__PURE__ */ h(a, {
175
+ textareaSize: D ? "mini" : "small",
176
+ rows: S.rows ?? 3,
177
+ autoFocus: !0,
178
+ value: I,
179
+ onChange: (e) => L(e.target.value),
180
+ placeholder: S.placeholder
181
+ }),
182
+ W("flex justify-end gap-1.5")
183
+ ]
184
+ }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
185
+ "aria-hidden": !0,
186
+ className: `invisible pointer-events-none absolute inset-0 flex items-center ${P} ${M}`,
187
+ children: [
188
+ /* @__PURE__ */ h("span", { className: `${k} shrink-0` }),
189
+ /* @__PURE__ */ h("div", {
190
+ ref: R,
191
+ className: `min-w-0 flex-1 ${A} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
192
+ children: r
193
+ }),
194
+ W("flex shrink-0 gap-1.5", !0)
195
+ ]
196
+ }), V ? /* @__PURE__ */ g("div", {
197
+ className: `relative flex flex-col ${P} ${N}`,
198
+ children: [
199
+ U && /* @__PURE__ */ h("div", {
200
+ className: "absolute right-3 top-3",
201
+ children: U
202
+ }),
203
+ /* @__PURE__ */ h("div", {
204
+ className: "flex justify-center",
205
+ children: F
206
+ }),
207
+ /* @__PURE__ */ h("div", {
208
+ className: `${A} leading-relaxed text-center whitespace-pre-line break-keep wrap-break-word`,
209
+ children: r
210
+ }),
211
+ W("flex justify-end gap-1.5")
212
+ ]
213
+ }) : /* @__PURE__ */ g("div", {
214
+ className: `flex items-center ${P} ${M}`,
215
+ children: [
216
+ F,
217
+ /* @__PURE__ */ h("div", {
218
+ className: `min-w-0 flex-1 ${A} leading-relaxed whitespace-pre-line break-keep wrap-break-word`,
219
+ children: r
220
+ }),
221
+ W("flex shrink-0 gap-1.5"),
222
+ U
223
+ ]
224
+ })] })
225
+ })] });
226
+ }
227
+ //#endregion
228
+ export { w as dismissActionToast, T as isActionToastActive, C as showActionToast };
@@ -0,0 +1 @@
1
+ let e=require("react"),t=require("react/jsx-runtime"),n=require("motion/react");function r({children:r,durationMs:i=220,ease:a=[.16,1,.3,1],className:o=``}){let s=(0,e.useRef)(null),[c,l]=(0,e.useState)(`auto`),u=(0,e.useRef)(!0),[d,f]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(([e])=>{if(!e)return;let t=e.contentRect.height;l(t),u.current&&(u.current=!1,requestAnimationFrame(()=>f(!0)))});return t.observe(e),()=>t.disconnect()},[]),(0,t.jsx)(n.motion.div,{animate:{height:c},transition:d?{duration:i/1e3,ease:a}:{duration:0},style:{overflow:`hidden`},className:o,children:(0,t.jsx)(`div`,{ref:s,children:r})})}exports.AnimatedHeight=r;
@@ -0,0 +1,36 @@
1
+ import { useEffect as e, useRef as t, useState as n } from "react";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { motion as i } from "motion/react";
4
+ //#region src/components/animated-height/AnimatedHeight.tsx
5
+ function a({ children: a, durationMs: o = 220, ease: s = [
6
+ .16,
7
+ 1,
8
+ .3,
9
+ 1
10
+ ], className: c = "" }) {
11
+ let l = t(null), [u, d] = n("auto"), f = t(!0), [p, m] = n(!1);
12
+ return e(() => {
13
+ let e = l.current;
14
+ if (!e) return;
15
+ let t = new ResizeObserver(([e]) => {
16
+ if (!e) return;
17
+ let t = e.contentRect.height;
18
+ d(t), f.current && (f.current = !1, requestAnimationFrame(() => m(!0)));
19
+ });
20
+ return t.observe(e), () => t.disconnect();
21
+ }, []), /* @__PURE__ */ r(i.div, {
22
+ animate: { height: u },
23
+ transition: p ? {
24
+ duration: o / 1e3,
25
+ ease: s
26
+ } : { duration: 0 },
27
+ style: { overflow: "hidden" },
28
+ className: c,
29
+ children: /* @__PURE__ */ r("div", {
30
+ ref: l,
31
+ children: a
32
+ })
33
+ });
34
+ }
35
+ //#endregion
36
+ export { a as AnimatedHeight };
@@ -0,0 +1 @@
1
+ const e=require("./utils.cjs.js");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.forwardRef)((t,r)=>{let{size:i=`medium`,variant:a=`fill`,color:o=`neutral`,className:s=``,children:c,...l}=t,u=[e.getBadgeBaseClasses(),e.getBadgeColorClasses(o,a),e.getBadgeSizeClasses(i),s].filter(Boolean).join(` `);if(`as`in t&&t.as===`div`){let{as:e,...t}=l;return(0,n.jsx)(`div`,{ref:r,className:u,...t,children:c})}return(0,n.jsx)(`span`,{ref:r,className:u,...l,children:c})});r.displayName=`Badge`,exports.Badge=r;
@@ -0,0 +1,30 @@
1
+ import { getBadgeBaseClasses as e, getBadgeColorClasses as t, getBadgeSizeClasses as n } from "./utils.esm.js";
2
+ import { forwardRef as r } from "react";
3
+ import { jsx as i } from "react/jsx-runtime";
4
+ //#region src/components/badge/Badge.tsx
5
+ var a = r((r, a) => {
6
+ let { size: o = "medium", variant: s = "fill", color: c = "neutral", className: l = "", children: u, ...d } = r, f = [
7
+ e(),
8
+ t(c, s),
9
+ n(o),
10
+ l
11
+ ].filter(Boolean).join(" ");
12
+ if ("as" in r && r.as === "div") {
13
+ let { as: e, ...t } = d;
14
+ return /* @__PURE__ */ i("div", {
15
+ ref: a,
16
+ className: f,
17
+ ...t,
18
+ children: u
19
+ });
20
+ }
21
+ return /* @__PURE__ */ i("span", {
22
+ ref: a,
23
+ className: f,
24
+ ...d,
25
+ children: u
26
+ });
27
+ });
28
+ a.displayName = "Badge";
29
+ //#endregion
30
+ export { a as Badge };
@@ -0,0 +1 @@
1
+ var e=(e=`neutral`,t=`fill`)=>({primary:{fill:`bg-primary-500 text-white`,weak:`bg-primary-50 text-primary-600 border border-primary-300`},secondary:{fill:`bg-secondary-500 text-white`,weak:`bg-secondary-50 text-secondary-600 border border-secondary-300`},success:{fill:`bg-success-500 text-white`,weak:`bg-success-50 text-success-600 border border-success-300`},error:{fill:`bg-error-500 text-white`,weak:`bg-error-50 text-error-600 border border-error-300`},warning:{fill:`bg-warning-500 text-white`,weak:`bg-warning-50 text-warning-600 border border-warning-300`},info:{fill:`bg-info-500 text-white`,weak:`bg-info-50 text-info-600 border border-info-300`},neutral:{fill:`bg-neutral-500 text-white`,weak:`bg-neutral-50 text-neutral-600 border border-neutral-300`}})[e][t],t=(e=`medium`)=>({xsmall:`px-1.5 py-0.5 text-xs`,small:`px-2 py-1 text-xs`,medium:`px-2.5 py-1 text-sm`,large:`px-3 py-1.5 text-base`})[e],n=()=>`inline-flex items-center justify-center font-medium rounded-md whitespace-nowrap`;exports.getBadgeBaseClasses=n,exports.getBadgeColorClasses=e,exports.getBadgeSizeClasses=t;
@@ -0,0 +1,38 @@
1
+ //#region src/components/badge/utils.ts
2
+ var e = (e = "neutral", t = "fill") => ({
3
+ primary: {
4
+ fill: "bg-primary-500 text-white",
5
+ weak: "bg-primary-50 text-primary-600 border border-primary-300"
6
+ },
7
+ secondary: {
8
+ fill: "bg-secondary-500 text-white",
9
+ weak: "bg-secondary-50 text-secondary-600 border border-secondary-300"
10
+ },
11
+ success: {
12
+ fill: "bg-success-500 text-white",
13
+ weak: "bg-success-50 text-success-600 border border-success-300"
14
+ },
15
+ error: {
16
+ fill: "bg-error-500 text-white",
17
+ weak: "bg-error-50 text-error-600 border border-error-300"
18
+ },
19
+ warning: {
20
+ fill: "bg-warning-500 text-white",
21
+ weak: "bg-warning-50 text-warning-600 border border-warning-300"
22
+ },
23
+ info: {
24
+ fill: "bg-info-500 text-white",
25
+ weak: "bg-info-50 text-info-600 border border-info-300"
26
+ },
27
+ neutral: {
28
+ fill: "bg-neutral-500 text-white",
29
+ weak: "bg-neutral-50 text-neutral-600 border border-neutral-300"
30
+ }
31
+ })[e][t], t = (e = "medium") => ({
32
+ xsmall: "px-1.5 py-0.5 text-xs",
33
+ small: "px-2 py-1 text-xs",
34
+ medium: "px-2.5 py-1 text-sm",
35
+ large: "px-3 py-1.5 text-base"
36
+ })[e], n = () => "inline-flex items-center justify-center font-medium rounded-md whitespace-nowrap";
37
+ //#endregion
38
+ export { n as getBadgeBaseClasses, e as getBadgeColorClasses, t as getBadgeSizeClasses };
@@ -0,0 +1 @@
1
+ const e=require("./utils.cjs.js");let t=require("react"),n=require("react/jsx-runtime");var r=()=>(0,n.jsxs)(`svg`,{className:`animate-spin h-4 w-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,n.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,n.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}),i=(0,t.forwardRef)((i,a)=>{let{variant:o=`primary`,appearance:s=`filled`,size:c=`medium`,display:l=`inline`,loading:u=!1,clickThrottleMs:d=0,leadingIcon:f,trailingIcon:p,className:m=``,children:h,...g}=i,[_,v]=(0,t.useState)(!1),y=(0,t.useRef)(null),b=()=>{d&&(v(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{v(!1),y.current=null},d))};(0,t.useEffect)(()=>()=>{y.current&&clearTimeout(y.current)},[]);let x=[e.getButtonBaseClasses(),e.getButtonColorClasses(o,s),e.getButtonSizeClasses(c),e.getButtonDisplayClasses(l),e.getButtonFocusRing(o),u?`opacity-70 cursor-wait`:``,m].filter(Boolean).join(` `),S=`as`in i&&i.as===`a`,C=(`disabled`in i?i.disabled:!1)||u||_;if(S){let e=g,t=t=>{if(C){t.preventDefault();return}b(),e.onClick?.(t)};return(0,n.jsxs)(`a`,{ref:a,className:`${x} ${C?`pointer-events-none opacity-60`:``}`.trim(),"aria-disabled":C,tabIndex:C?-1:e.tabIndex,...e,onClick:t,children:[u?(0,n.jsx)(r,{}):f,h,!u&&p]})}let w=g,T=e=>{if(C){e.preventDefault();return}b(),w.onClick?.(e)};return(0,n.jsxs)(`button`,{ref:a,className:x,disabled:C,...w,onClick:T,children:[u?(0,n.jsx)(r,{}):f,h,!u&&p]})});i.displayName=`Button`,exports.Button=i;
@@ -0,0 +1,84 @@
1
+ import { getButtonBaseClasses as e, getButtonColorClasses as t, getButtonDisplayClasses as n, getButtonFocusRing as r, getButtonSizeClasses as i } from "./utils.esm.js";
2
+ import { forwardRef as a, useEffect as o, useRef as s, useState as c } from "react";
3
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
+ //#region src/components/button/Button.tsx
5
+ var d = () => /* @__PURE__ */ u("svg", {
6
+ className: "animate-spin h-4 w-4",
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ fill: "none",
9
+ viewBox: "0 0 24 24",
10
+ children: [/* @__PURE__ */ l("circle", {
11
+ className: "opacity-25",
12
+ cx: "12",
13
+ cy: "12",
14
+ r: "10",
15
+ stroke: "currentColor",
16
+ strokeWidth: "4"
17
+ }), /* @__PURE__ */ l("path", {
18
+ className: "opacity-75",
19
+ fill: "currentColor",
20
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
21
+ })]
22
+ }), f = a((a, f) => {
23
+ let { variant: p = "primary", appearance: m = "filled", size: h = "medium", display: g = "inline", loading: _ = !1, clickThrottleMs: v = 0, leadingIcon: y, trailingIcon: b, className: x = "", children: S, ...C } = a, [w, T] = c(!1), E = s(null), D = () => {
24
+ v && (T(!0), E.current && clearTimeout(E.current), E.current = setTimeout(() => {
25
+ T(!1), E.current = null;
26
+ }, v));
27
+ };
28
+ o(() => () => {
29
+ E.current && clearTimeout(E.current);
30
+ }, []);
31
+ let O = [
32
+ e(),
33
+ t(p, m),
34
+ i(h),
35
+ n(g),
36
+ r(p),
37
+ _ ? "opacity-70 cursor-wait" : "",
38
+ x
39
+ ].filter(Boolean).join(" "), k = "as" in a && a.as === "a", A = ("disabled" in a ? a.disabled : !1) || _ || w;
40
+ if (k) {
41
+ let e = C, t = (t) => {
42
+ if (A) {
43
+ t.preventDefault();
44
+ return;
45
+ }
46
+ D(), e.onClick?.(t);
47
+ };
48
+ return /* @__PURE__ */ u("a", {
49
+ ref: f,
50
+ className: `${O} ${A ? "pointer-events-none opacity-60" : ""}`.trim(),
51
+ "aria-disabled": A,
52
+ tabIndex: A ? -1 : e.tabIndex,
53
+ ...e,
54
+ onClick: t,
55
+ children: [
56
+ _ ? /* @__PURE__ */ l(d, {}) : y,
57
+ S,
58
+ !_ && b
59
+ ]
60
+ });
61
+ }
62
+ let j = C, M = (e) => {
63
+ if (A) {
64
+ e.preventDefault();
65
+ return;
66
+ }
67
+ D(), j.onClick?.(e);
68
+ };
69
+ return /* @__PURE__ */ u("button", {
70
+ ref: f,
71
+ className: O,
72
+ disabled: A,
73
+ ...j,
74
+ onClick: M,
75
+ children: [
76
+ _ ? /* @__PURE__ */ l(d, {}) : y,
77
+ S,
78
+ !_ && b
79
+ ]
80
+ });
81
+ });
82
+ f.displayName = "Button";
83
+ //#endregion
84
+ export { f as Button };
@@ -0,0 +1 @@
1
+ var e=(e=`primary`,t=`filled`)=>({primary:{filled:`border-transparent bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700 disabled:bg-secondary-200 disabled:text-secondary-300 dark:disabled:bg-secondary-700 dark:disabled:text-secondary-500`,outlined:`bg-white dark:bg-transparent text-secondary-800 dark:text-secondary-100 border-secondary-400 dark:border-secondary-500 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300 disabled:border-secondary-200 disabled:bg-transparent`,transparent:`border-transparent bg-transparent text-secondary-800 dark:text-secondary-100 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300`},secondary:{filled:`border-transparent bg-primary-300 text-white hover:bg-primary-500 active:bg-primary-600 disabled:bg-secondary-200 disabled:text-secondary-300 dark:disabled:bg-secondary-700 dark:disabled:text-secondary-500`,outlined:`bg-white dark:bg-transparent text-secondary-500 dark:text-secondary-400 border-secondary-200 dark:border-secondary-700 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300 disabled:border-secondary-100 disabled:bg-transparent`,transparent:`border-transparent bg-transparent text-secondary-500 dark:text-secondary-400 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300`},tertiary:{filled:`border-transparent bg-secondary-100 dark:bg-secondary-700 text-secondary-500 dark:text-secondary-300 hover:bg-secondary-200 dark:hover:bg-secondary-600 active:bg-secondary-300 dark:active:bg-secondary-500 disabled:bg-secondary-50 dark:disabled:bg-secondary-900 disabled:text-secondary-300`,outlined:`bg-white dark:bg-transparent text-secondary-400 dark:text-secondary-500 border-secondary-200 dark:border-secondary-600 hover:bg-secondary-50 dark:hover:bg-secondary-900 active:bg-secondary-100 dark:active:bg-secondary-800 disabled:text-secondary-300 disabled:border-secondary-100 disabled:bg-transparent`,transparent:`border-transparent bg-transparent text-secondary-400 dark:text-secondary-500 hover:bg-secondary-50 dark:hover:bg-secondary-900 active:bg-secondary-100 dark:active:bg-secondary-800 disabled:text-secondary-300`},danger:{filled:`border-transparent bg-error-500 text-white hover:bg-error-600 active:bg-error-700 disabled:bg-secondary-200 disabled:text-secondary-300 dark:disabled:bg-secondary-700 dark:disabled:text-secondary-500`,outlined:`bg-white dark:bg-transparent text-error-600 dark:text-error-400 border-error-500 dark:border-error-400 hover:bg-error-50 dark:hover:bg-error-950 active:bg-error-100 dark:active:bg-error-900 disabled:text-error-300 disabled:border-error-200 disabled:bg-transparent`,transparent:`border-transparent bg-transparent text-error-600 dark:text-error-400 hover:bg-error-50 dark:hover:bg-error-950 active:bg-error-100 dark:active:bg-error-900 disabled:text-error-300`}})[e][t],t=(e=`medium`)=>({mini:`h-7 px-2 text-xs gap-1 rounded-md`,small:`h-9 px-3 text-sm gap-1.5 rounded-lg`,medium:`h-11 px-3.5 text-sm gap-2 rounded-xl`,large:`h-12 px-5 text-base gap-2 rounded-xl`})[e],n=(e=`inline`)=>({inline:`inline-flex`,block:`flex w-full`})[e],r=()=>`items-center justify-center font-medium border-[1.5px] transition-colors duration-200 ease-out outline-none focus:ring-2 focus:ring-inset disabled:cursor-not-allowed disabled:pointer-events-none`,i=(e=`primary`)=>({primary:`focus:ring-primary-300`,secondary:`focus:ring-primary-300`,tertiary:`focus:ring-secondary-400`,danger:`focus:ring-error-300`})[e];exports.getButtonBaseClasses=r,exports.getButtonColorClasses=e,exports.getButtonDisplayClasses=n,exports.getButtonFocusRing=i,exports.getButtonSizeClasses=t;
@@ -0,0 +1,38 @@
1
+ //#region src/components/button/utils.ts
2
+ var e = (e = "primary", t = "filled") => ({
3
+ primary: {
4
+ filled: "border-transparent bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700 disabled:bg-secondary-200 disabled:text-secondary-300 dark:disabled:bg-secondary-700 dark:disabled:text-secondary-500",
5
+ outlined: "bg-white dark:bg-transparent text-secondary-800 dark:text-secondary-100 border-secondary-400 dark:border-secondary-500 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300 disabled:border-secondary-200 disabled:bg-transparent",
6
+ transparent: "border-transparent bg-transparent text-secondary-800 dark:text-secondary-100 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300"
7
+ },
8
+ secondary: {
9
+ filled: "border-transparent bg-primary-300 text-white hover:bg-primary-500 active:bg-primary-600 disabled:bg-secondary-200 disabled:text-secondary-300 dark:disabled:bg-secondary-700 dark:disabled:text-secondary-500",
10
+ outlined: "bg-white dark:bg-transparent text-secondary-500 dark:text-secondary-400 border-secondary-200 dark:border-secondary-700 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300 disabled:border-secondary-100 disabled:bg-transparent",
11
+ transparent: "border-transparent bg-transparent text-secondary-500 dark:text-secondary-400 hover:bg-secondary-50 dark:hover:bg-secondary-800 active:bg-secondary-100 dark:active:bg-secondary-700 disabled:text-secondary-300"
12
+ },
13
+ tertiary: {
14
+ filled: "border-transparent bg-secondary-100 dark:bg-secondary-700 text-secondary-500 dark:text-secondary-300 hover:bg-secondary-200 dark:hover:bg-secondary-600 active:bg-secondary-300 dark:active:bg-secondary-500 disabled:bg-secondary-50 dark:disabled:bg-secondary-900 disabled:text-secondary-300",
15
+ outlined: "bg-white dark:bg-transparent text-secondary-400 dark:text-secondary-500 border-secondary-200 dark:border-secondary-600 hover:bg-secondary-50 dark:hover:bg-secondary-900 active:bg-secondary-100 dark:active:bg-secondary-800 disabled:text-secondary-300 disabled:border-secondary-100 disabled:bg-transparent",
16
+ transparent: "border-transparent bg-transparent text-secondary-400 dark:text-secondary-500 hover:bg-secondary-50 dark:hover:bg-secondary-900 active:bg-secondary-100 dark:active:bg-secondary-800 disabled:text-secondary-300"
17
+ },
18
+ danger: {
19
+ filled: "border-transparent bg-error-500 text-white hover:bg-error-600 active:bg-error-700 disabled:bg-secondary-200 disabled:text-secondary-300 dark:disabled:bg-secondary-700 dark:disabled:text-secondary-500",
20
+ outlined: "bg-white dark:bg-transparent text-error-600 dark:text-error-400 border-error-500 dark:border-error-400 hover:bg-error-50 dark:hover:bg-error-950 active:bg-error-100 dark:active:bg-error-900 disabled:text-error-300 disabled:border-error-200 disabled:bg-transparent",
21
+ transparent: "border-transparent bg-transparent text-error-600 dark:text-error-400 hover:bg-error-50 dark:hover:bg-error-950 active:bg-error-100 dark:active:bg-error-900 disabled:text-error-300"
22
+ }
23
+ })[e][t], t = (e = "medium") => ({
24
+ mini: "h-7 px-2 text-xs gap-1 rounded-md",
25
+ small: "h-9 px-3 text-sm gap-1.5 rounded-lg",
26
+ medium: "h-11 px-3.5 text-sm gap-2 rounded-xl",
27
+ large: "h-12 px-5 text-base gap-2 rounded-xl"
28
+ })[e], n = (e = "inline") => ({
29
+ inline: "inline-flex",
30
+ block: "flex w-full"
31
+ })[e], r = () => "items-center justify-center font-medium border-[1.5px] transition-colors duration-200 ease-out outline-none focus:ring-2 focus:ring-inset disabled:cursor-not-allowed disabled:pointer-events-none", i = (e = "primary") => ({
32
+ primary: "focus:ring-primary-300",
33
+ secondary: "focus:ring-primary-300",
34
+ tertiary: "focus:ring-secondary-400",
35
+ danger: "focus:ring-error-300"
36
+ })[e];
37
+ //#endregion
38
+ export { r as getButtonBaseClasses, e as getButtonColorClasses, n as getButtonDisplayClasses, i as getButtonFocusRing, t as getButtonSizeClasses };
@@ -0,0 +1 @@
1
+ const e=require("./utils.cjs.js");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.forwardRef)(({variant:t,inputType:r=`checkbox`,size:i=24,baseColor:a=`primary`,label:o,onCheckedChange:s,onChange:c,className:l=``,...u},d)=>{let f=e=>{c?.(e),s?.(e.target.checked)},p=e.getCheckboxVariantClasses(t,a),m=e.getCheckboxSizeStyle(i),h=(0,n.jsxs)(`div`,{className:`inline-flex items-center relative`,children:[(0,n.jsx)(`input`,{ref:d,type:r,className:`sr-only peer`,onChange:f,...u}),(0,n.jsx)(`div`,{className:`${p} ${l} peer-checked:[&_path]:scale-100`,style:m,children:(0,n.jsx)(`svg`,{className:`absolute inset-0 w-full h-full pointer-events-none`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M5 12l5 5L20 7`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`origin-center scale-0 transition-transform duration-200 ease-out`})})})]});return o?(0,n.jsxs)(`label`,{className:e.getLabelClasses(),children:[h,(0,n.jsx)(`span`,{className:`text-base text-neutral-900 dark:text-neutral-100`,children:o})]}):h});r.displayName=`CheckboxInternal`;var i=(0,t.forwardRef)((e,t)=>(0,n.jsx)(r,{ref:t,variant:`circle`,...e}));i.displayName=`Checkbox.Circle`;var a=(0,t.forwardRef)((e,t)=>(0,n.jsx)(r,{ref:t,variant:`line`,...e}));a.displayName=`Checkbox.Line`;var o=(0,t.forwardRef)((e,t)=>(0,n.jsx)(r,{ref:t,variant:`lineTransparent`,...e}));o.displayName=`Checkbox.LineTransparent`;var s={Circle:i,Line:a,LineTransparent:o};exports.Checkbox=s,exports.CheckboxCircle=i,exports.CheckboxLine=a,exports.CheckboxLineTransparent=o;
@@ -0,0 +1,68 @@
1
+ import { getCheckboxSizeStyle as e, getCheckboxVariantClasses as t, getLabelClasses as n } from "./utils.esm.js";
2
+ import { forwardRef as r } from "react";
3
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ //#region src/components/checkbox/Checkbox.tsx
5
+ var o = r(({ variant: r, inputType: o = "checkbox", size: s = 24, baseColor: c = "primary", label: l, onCheckedChange: u, onChange: d, className: f = "", ...p }, m) => {
6
+ let h = (e) => {
7
+ d?.(e), u?.(e.target.checked);
8
+ }, g = t(r, c), _ = e(s), v = /* @__PURE__ */ a("div", {
9
+ className: "inline-flex items-center relative",
10
+ children: [/* @__PURE__ */ i("input", {
11
+ ref: m,
12
+ type: o,
13
+ className: "sr-only peer",
14
+ onChange: h,
15
+ ...p
16
+ }), /* @__PURE__ */ i("div", {
17
+ className: `${g} ${f} peer-checked:[&_path]:scale-100`,
18
+ style: _,
19
+ children: /* @__PURE__ */ i("svg", {
20
+ className: "absolute inset-0 w-full h-full pointer-events-none",
21
+ viewBox: "0 0 24 24",
22
+ fill: "none",
23
+ xmlns: "http://www.w3.org/2000/svg",
24
+ children: /* @__PURE__ */ i("path", {
25
+ d: "M5 12l5 5L20 7",
26
+ stroke: "currentColor",
27
+ strokeWidth: "2.5",
28
+ strokeLinecap: "round",
29
+ strokeLinejoin: "round",
30
+ className: "origin-center scale-0 transition-transform duration-200 ease-out"
31
+ })
32
+ })
33
+ })]
34
+ });
35
+ return l ? /* @__PURE__ */ a("label", {
36
+ className: n(),
37
+ children: [v, /* @__PURE__ */ i("span", {
38
+ className: "text-base text-neutral-900 dark:text-neutral-100",
39
+ children: l
40
+ })]
41
+ }) : v;
42
+ });
43
+ o.displayName = "CheckboxInternal";
44
+ var s = r((e, t) => /* @__PURE__ */ i(o, {
45
+ ref: t,
46
+ variant: "circle",
47
+ ...e
48
+ }));
49
+ s.displayName = "Checkbox.Circle";
50
+ var c = r((e, t) => /* @__PURE__ */ i(o, {
51
+ ref: t,
52
+ variant: "line",
53
+ ...e
54
+ }));
55
+ c.displayName = "Checkbox.Line";
56
+ var l = r((e, t) => /* @__PURE__ */ i(o, {
57
+ ref: t,
58
+ variant: "lineTransparent",
59
+ ...e
60
+ }));
61
+ l.displayName = "Checkbox.LineTransparent";
62
+ var u = {
63
+ Circle: s,
64
+ Line: c,
65
+ LineTransparent: l
66
+ };
67
+ //#endregion
68
+ export { u as Checkbox, s as CheckboxCircle, c as CheckboxLine, l as CheckboxLineTransparent };
@@ -0,0 +1 @@
1
+ function e(){return`appearance-none cursor-pointer transition-all duration-200 focus:outline-hidden`}function t(t=`primary`){return`${e()} rounded-full border-2 ${{primary:`border-neutral-300 peer-checked:bg-primary-500 peer-checked:border-primary-500 text-white`,secondary:`border-neutral-300 peer-checked:bg-secondary-500 peer-checked:border-secondary-500 text-white`,neutral:`border-neutral-300 peer-checked:bg-neutral-600 peer-checked:border-neutral-600 text-white`}[t]} relative flex items-center justify-center transition-all duration-200`}function n(t=`primary`){return`${e()} rounded-sm border-2 ${{primary:`border-neutral-300 peer-checked:bg-primary-500 peer-checked:border-primary-500 text-white`,secondary:`border-neutral-300 peer-checked:bg-secondary-500 peer-checked:border-secondary-500 text-white`,neutral:`border-neutral-300 peer-checked:bg-neutral-600 peer-checked:border-neutral-600 text-white`}[t]} relative flex items-center justify-center transition-all duration-200`}function r(t=`primary`){return`${e()} rounded-sm border-2 bg-transparent ${{primary:`border-neutral-200 peer-checked:border-primary-500 text-primary-500`,secondary:`border-neutral-200 peer-checked:border-secondary-500 text-secondary-500`,neutral:`border-neutral-200 peer-checked:border-neutral-600 text-neutral-600`}[t]} relative flex items-center justify-center transition-all duration-200`}function i(e,i=`primary`){switch(e){case`circle`:return t(i);case`line`:return n(i);case`lineTransparent`:return r(i);default:return n(i)}}function a(e=24){return{width:`${e}px`,height:`${e}px`}}function o(){return`inline-flex items-center gap-2 cursor-pointer select-none`}exports.getCheckboxSizeStyle=a,exports.getCheckboxVariantClasses=i,exports.getLabelClasses=o;