pentatrion-design 0.3.0 → 1.0.1

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 (324) hide show
  1. package/.github/workflows/deploy-storybook.yml +2 -4
  2. package/.vscode/launch.json +7 -0
  3. package/README.md +1 -1
  4. package/dist/components/accordion/Accordion.d.ts +10 -0
  5. package/dist/components/accordion/Accordion.d.ts.map +1 -0
  6. package/dist/components/accordion/Accordion.js +21 -0
  7. package/dist/components/accordion/AccordionContent.d.ts +7 -0
  8. package/dist/components/accordion/AccordionContent.d.ts.map +1 -0
  9. package/dist/components/accordion/AccordionContent.js +20 -0
  10. package/dist/components/accordion/AccordionItem.d.ts +7 -0
  11. package/dist/components/accordion/AccordionItem.d.ts.map +1 -0
  12. package/dist/components/accordion/AccordionItem.js +7 -0
  13. package/dist/components/accordion/AccordionTrigger.d.ts +7 -0
  14. package/dist/components/accordion/AccordionTrigger.d.ts.map +1 -0
  15. package/dist/components/accordion/AccordionTrigger.js +7 -0
  16. package/dist/components/accordion/index.d.ts +4 -0
  17. package/dist/components/accordion/index.d.ts.map +1 -0
  18. package/dist/components/accordion/index.js +3 -0
  19. package/dist/components/accordion/useAccordion.d.ts +9 -0
  20. package/dist/components/accordion/useAccordion.d.ts.map +1 -0
  21. package/dist/components/accordion/useAccordion.js +9 -0
  22. package/dist/components/autocomplete/Autocomplete.d.ts +3 -3
  23. package/dist/components/autocomplete/Autocomplete.js +8 -8
  24. package/dist/components/autocomplete/AutocompleteOption.d.ts +1 -1
  25. package/dist/components/autocomplete/AutocompleteOption.js +2 -2
  26. package/dist/components/autocomplete/LazyAutocomplete.d.ts +2 -2
  27. package/dist/components/autocomplete/LazyAutocomplete.js +3 -3
  28. package/dist/components/autocomplete/SimpleAutocomplete.d.ts +2 -2
  29. package/dist/components/autocomplete/SimpleAutocomplete.js +3 -3
  30. package/dist/components/autocomplete/index.d.ts +6 -6
  31. package/dist/components/autocomplete/index.js +6 -6
  32. package/dist/components/autocomplete/useAutocompleteContext.d.ts +1 -1
  33. package/dist/components/autocomplete/util.d.ts +1 -1
  34. package/dist/components/badge/Badge.d.ts +1 -1
  35. package/dist/components/badge/Badge.js +4 -4
  36. package/dist/components/badge/index.d.ts +1 -1
  37. package/dist/components/badge/index.js +1 -1
  38. package/dist/components/button/Button.d.ts +4 -4
  39. package/dist/components/button/Button.d.ts.map +1 -1
  40. package/dist/components/button/Button.js +18 -8
  41. package/dist/components/button/HrefButton.d.ts +7 -0
  42. package/dist/components/button/HrefButton.d.ts.map +1 -0
  43. package/dist/components/button/HrefButton.js +11 -0
  44. package/dist/components/button/LinkButton.d.ts +3 -3
  45. package/dist/components/button/LinkButton.js +3 -3
  46. package/dist/components/button/index.d.ts +3 -3
  47. package/dist/components/button/index.js +3 -3
  48. package/dist/components/card/index.d.ts +1 -1
  49. package/dist/components/card/index.js +1 -1
  50. package/dist/components/code/index.d.ts +1 -1
  51. package/dist/components/code/index.js +1 -1
  52. package/dist/components/context-menu/ContextMenu.js +2 -2
  53. package/dist/components/context-menu/index.d.ts +2 -2
  54. package/dist/components/context-menu/index.js +2 -2
  55. package/dist/components/dialog/Dialog.d.ts +1 -1
  56. package/dist/components/dialog/index.d.ts +1 -1
  57. package/dist/components/dialog/index.js +1 -1
  58. package/dist/components/draggable/index.d.ts +6 -6
  59. package/dist/components/draggable/index.js +6 -6
  60. package/dist/components/draggable/useDraggableItem.d.ts +1 -1
  61. package/dist/components/draggable/useDraggableItem.js +1 -1
  62. package/dist/components/draggable/useDraggableMonitor.js +2 -2
  63. package/dist/components/draggable/useDraggableMonitorIndex.js +2 -2
  64. package/dist/components/draggable/util.d.ts +1 -1
  65. package/dist/components/draggable/util.js +1 -1
  66. package/dist/components/draggable-advanced/_fixtures.d.ts +1 -1
  67. package/dist/components/draggable-advanced/context.d.ts +1 -1
  68. package/dist/components/draggable-advanced/context.js +1 -1
  69. package/dist/components/draggable-advanced/registry.js +1 -1
  70. package/dist/components/dropdown-menu/DropdownMenu.d.ts +3 -2
  71. package/dist/components/dropdown-menu/DropdownMenu.d.ts.map +1 -1
  72. package/dist/components/dropdown-menu/DropdownMenu.js +6 -6
  73. package/dist/components/dropdown-menu/DropdownMenuItem.js +2 -2
  74. package/dist/components/dropdown-menu/index.d.ts +5 -5
  75. package/dist/components/dropdown-menu/index.js +4 -4
  76. package/dist/components/dropdown-menu/interface.d.ts +1 -1
  77. package/dist/components/dropdown-menu/useDropdownMenu.d.ts +2 -2
  78. package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -1
  79. package/dist/components/dropdown-menu/useDropdownMenuContext.d.ts +2 -2
  80. package/dist/components/dropdown-menu/useDropdownMenuContext.d.ts.map +1 -1
  81. package/dist/components/dropdown-menu-nested/DropdownMenuNested.d.ts +1 -1
  82. package/dist/components/dropdown-menu-nested/DropdownMenuNested.js +1 -1
  83. package/dist/components/dropdown-menu-nested/MenuItem.js +1 -1
  84. package/dist/components/dropdown-menu-nested/MenuItemWithChildren.d.ts +1 -1
  85. package/dist/components/dropdown-menu-nested/MenuItemWithChildren.js +3 -3
  86. package/dist/components/dropdown-menu-nested/index.d.ts +3 -3
  87. package/dist/components/dropdown-menu-nested/index.js +3 -3
  88. package/dist/components/flash/Flash.d.ts +1 -1
  89. package/dist/components/flash/Flash.js +1 -1
  90. package/dist/components/flash/index.d.ts +1 -1
  91. package/dist/components/flash/index.js +1 -1
  92. package/dist/components/form/InputField.d.ts.map +1 -1
  93. package/dist/components/form/InputField.js +3 -2
  94. package/dist/components/form/SelectField.d.ts +1 -1
  95. package/dist/components/form/SelectField.js +1 -1
  96. package/dist/components/form/index.d.ts +2 -2
  97. package/dist/components/form/index.js +2 -2
  98. package/dist/components/highlight/index.d.ts +1 -1
  99. package/dist/components/highlight/index.js +1 -1
  100. package/dist/components/href/index.d.ts +2 -2
  101. package/dist/components/href/index.d.ts.map +1 -1
  102. package/dist/components/href/index.js +2 -2
  103. package/dist/components/input/AudioRange.d.ts +16 -0
  104. package/dist/components/input/AudioRange.d.ts.map +1 -0
  105. package/dist/components/input/AudioRange.js +38 -0
  106. package/dist/components/input/Checkbox.d.ts +3 -2
  107. package/dist/components/input/Checkbox.d.ts.map +1 -1
  108. package/dist/components/input/Checkbox.js +1 -1
  109. package/dist/components/input/Color.d.ts +1 -1
  110. package/dist/components/input/Color.d.ts.map +1 -1
  111. package/dist/components/input/Color.js +2 -2
  112. package/dist/components/input/Input.d.ts +1 -1
  113. package/dist/components/input/InputButton.d.ts +1 -1
  114. package/dist/components/input/InputButton.js +1 -1
  115. package/dist/components/input/MappedStars.js +2 -2
  116. package/dist/components/input/Radio.d.ts +4 -2
  117. package/dist/components/input/Radio.d.ts.map +1 -1
  118. package/dist/components/input/Radio.js +4 -1
  119. package/dist/components/input/Range.d.ts +3 -2
  120. package/dist/components/input/Range.d.ts.map +1 -1
  121. package/dist/components/input/Range.js +6 -3
  122. package/dist/components/input/Stars.js +2 -2
  123. package/dist/components/input/Toggle.d.ts +1 -1
  124. package/dist/components/input/TotpInput.d.ts +12 -0
  125. package/dist/components/input/TotpInput.d.ts.map +1 -0
  126. package/dist/components/input/TotpInput.js +113 -0
  127. package/dist/components/input/index.d.ts +11 -9
  128. package/dist/components/input/index.d.ts.map +1 -1
  129. package/dist/components/input/index.js +11 -9
  130. package/dist/components/loader/Loader.d.ts +1 -1
  131. package/dist/components/loader/Loader.js +1 -1
  132. package/dist/components/loader/index.d.ts +1 -1
  133. package/dist/components/loader/index.js +1 -1
  134. package/dist/components/media-preview/FileIcon.d.ts +2 -2
  135. package/dist/components/media-preview/FileIcon.d.ts.map +1 -1
  136. package/dist/components/media-preview/FileIcon.js +2 -2
  137. package/dist/components/media-preview/MediaPreview.d.ts +10 -6
  138. package/dist/components/media-preview/MediaPreview.d.ts.map +1 -1
  139. package/dist/components/media-preview/MediaPreview.js +4 -4
  140. package/dist/components/media-preview/index.d.ts +5 -5
  141. package/dist/components/media-preview/index.d.ts.map +1 -1
  142. package/dist/components/media-preview/index.js +4 -4
  143. package/dist/components/media-preview/types.d.ts +2 -2
  144. package/dist/components/media-preview/types.d.ts.map +1 -1
  145. package/dist/components/media-preview/util.d.ts +2 -2
  146. package/dist/components/media-preview/util.d.ts.map +1 -1
  147. package/dist/components/modal/Components.js +3 -3
  148. package/dist/components/modal/Modal.d.ts +1 -1
  149. package/dist/components/modal/Modal.js +2 -2
  150. package/dist/components/modal/ModalContent.d.ts +2 -1
  151. package/dist/components/modal/ModalContent.d.ts.map +1 -1
  152. package/dist/components/modal/ModalContent.js +4 -4
  153. package/dist/components/modal/ModalTrigger.d.ts +1 -1
  154. package/dist/components/modal/ModalTrigger.js +2 -2
  155. package/dist/components/modal/index.d.ts +7 -7
  156. package/dist/components/modal/index.js +6 -6
  157. package/dist/components/modal/interface.d.ts +1 -1
  158. package/dist/components/modal/useModal.d.ts +2 -2
  159. package/dist/components/modal/useModal.d.ts.map +1 -1
  160. package/dist/components/modal/useModalContext.d.ts +2 -2
  161. package/dist/components/modal/useModalContext.d.ts.map +1 -1
  162. package/dist/components/notification/NotificationsContext.d.ts +1 -1
  163. package/dist/components/notification/NotificationsContext.js +1 -1
  164. package/dist/components/notification/NotificationsProvider.js +2 -2
  165. package/dist/components/notification/index.d.ts +4 -4
  166. package/dist/components/notification/index.js +4 -4
  167. package/dist/components/notification/useContextNotifications.d.ts +1 -1
  168. package/dist/components/notification/useContextNotifications.js +1 -1
  169. package/dist/components/notification/useFetch.d.ts +1 -1
  170. package/dist/components/notification/useFetch.js +2 -2
  171. package/dist/components/popover/Components.js +2 -2
  172. package/dist/components/popover/Popover.d.ts +1 -1
  173. package/dist/components/popover/Popover.js +1 -1
  174. package/dist/components/popover/PopoverContent.js +3 -3
  175. package/dist/components/popover/PopoverTrigger.js +3 -3
  176. package/dist/components/popover/index.d.ts +7 -7
  177. package/dist/components/popover/index.js +6 -6
  178. package/dist/components/popover/interface.d.ts +1 -1
  179. package/dist/components/popover/usePopover.d.ts +2 -2
  180. package/dist/components/popover/usePopover.d.ts.map +1 -1
  181. package/dist/components/popover/usePopoverContext.d.ts +2 -2
  182. package/dist/components/popover/usePopoverContext.d.ts.map +1 -1
  183. package/dist/components/portal/index.d.ts +1 -1
  184. package/dist/components/portal/index.js +1 -1
  185. package/dist/components/resizable/Resizable.d.ts +7 -0
  186. package/dist/components/resizable/Resizable.d.ts.map +1 -0
  187. package/dist/components/resizable/Resizable.js +32 -0
  188. package/dist/components/resizable/ResizableHandle.d.ts +7 -0
  189. package/dist/components/resizable/ResizableHandle.d.ts.map +1 -0
  190. package/dist/components/resizable/ResizableHandle.js +35 -0
  191. package/dist/components/resizable/ResizablePanel.d.ts +7 -0
  192. package/dist/components/resizable/ResizablePanel.d.ts.map +1 -0
  193. package/dist/components/resizable/ResizablePanel.js +10 -0
  194. package/dist/components/resizable/context.d.ts +7 -0
  195. package/dist/components/resizable/context.d.ts.map +1 -0
  196. package/dist/components/resizable/context.js +2 -0
  197. package/dist/components/resizable/index.d.ts +4 -0
  198. package/dist/components/resizable/index.d.ts.map +1 -0
  199. package/dist/components/resizable/index.js +3 -0
  200. package/dist/components/resizable/util.d.ts +6 -0
  201. package/dist/components/resizable/util.d.ts.map +1 -0
  202. package/dist/components/resizable/util.js +26 -0
  203. package/dist/components/resize-area/index.d.ts +1 -1
  204. package/dist/components/resize-area/index.js +1 -1
  205. package/dist/components/scroll/index.d.ts +1 -1
  206. package/dist/components/scroll/index.js +1 -1
  207. package/dist/components/select/Select.d.ts +3 -3
  208. package/dist/components/select/Select.d.ts.map +1 -1
  209. package/dist/components/select/Select.js +8 -8
  210. package/dist/components/select/SelectOption.d.ts +1 -1
  211. package/dist/components/select/SelectOption.js +1 -1
  212. package/dist/components/select/SelectSelection.d.ts +1 -1
  213. package/dist/components/select/SelectSelection.js +1 -1
  214. package/dist/components/select/index.d.ts +5 -5
  215. package/dist/components/select/index.js +4 -4
  216. package/dist/components/slot/Slot.d.ts +9 -4
  217. package/dist/components/slot/Slot.d.ts.map +1 -1
  218. package/dist/components/slot/Slot.js +70 -50
  219. package/dist/components/slot/index.d.ts +1 -1
  220. package/dist/components/slot/index.js +1 -1
  221. package/dist/components/snack/Snack.d.ts +1 -1
  222. package/dist/components/snack/Snack.js +4 -4
  223. package/dist/components/snack/index.d.ts +1 -1
  224. package/dist/components/snack/index.js +1 -1
  225. package/dist/components/steps/index.d.ts +2 -2
  226. package/dist/components/steps/index.js +2 -2
  227. package/dist/components/table/index.d.ts +7 -7
  228. package/dist/components/table/index.js +7 -7
  229. package/dist/components/tabs/index.d.ts +1 -1
  230. package/dist/components/tabs/index.js +1 -1
  231. package/dist/components/textarea/Textarea.d.ts +1 -1
  232. package/dist/components/textarea/index.d.ts +1 -1
  233. package/dist/components/textarea/index.js +1 -1
  234. package/dist/components/toast/Toasts.js +2 -2
  235. package/dist/components/toast/index.d.ts +3 -3
  236. package/dist/components/toast/index.js +2 -2
  237. package/dist/components/toast/toastsManager.d.ts +1 -1
  238. package/dist/components/toast/toastsManager.js +1 -1
  239. package/dist/components/tooltip/SimpleTooltip.d.ts +1 -1
  240. package/dist/components/tooltip/SimpleTooltip.js +3 -3
  241. package/dist/components/tooltip/Tooltip.d.ts +1 -1
  242. package/dist/components/tooltip/Tooltip.js +2 -2
  243. package/dist/components/tooltip/TooltipContent.js +4 -4
  244. package/dist/components/tooltip/TooltipTrigger.js +2 -2
  245. package/dist/components/tooltip/index.d.ts +6 -6
  246. package/dist/components/tooltip/index.js +6 -6
  247. package/dist/components/tooltip/interface.d.ts +1 -1
  248. package/dist/components/tooltip/useTooltip.d.ts +2 -2
  249. package/dist/components/tooltip/useTooltip.d.ts.map +1 -1
  250. package/dist/components/tooltip/useTooltipContext.d.ts +2 -2
  251. package/dist/components/tooltip/useTooltipContext.d.ts.map +1 -1
  252. package/dist/hooks/index.d.ts +12 -11
  253. package/dist/hooks/index.d.ts.map +1 -1
  254. package/dist/hooks/index.js +12 -11
  255. package/dist/hooks/useDoubleCheck.d.ts +6 -0
  256. package/dist/hooks/useDoubleCheck.d.ts.map +1 -0
  257. package/dist/hooks/useDoubleCheck.js +32 -0
  258. package/dist/hooks/useEventListener.js +1 -1
  259. package/dist/hooks/useOnClickOutside.js +1 -1
  260. package/dist/hooks/useRipple.js +1 -1
  261. package/dist/lib/compose-refs.d.ts +4 -3
  262. package/dist/lib/compose-refs.d.ts.map +1 -1
  263. package/dist/lib/compose-refs.js +33 -4
  264. package/dist/lib/error.d.ts +1 -1
  265. package/dist/lib/index.d.ts +6 -6
  266. package/dist/lib/index.js +6 -6
  267. package/dist/lib/tailwindVariants.d.ts +1 -1
  268. package/package.json +25 -18
  269. package/src/components/accordion/Accordion.stories.tsx +50 -0
  270. package/src/components/accordion/Accordion.tsx +41 -0
  271. package/src/components/accordion/AccordionContent.tsx +46 -0
  272. package/src/components/accordion/AccordionTrigger.tsx +24 -0
  273. package/src/components/accordion/index.ts +3 -0
  274. package/src/components/accordion/useAccordion.tsx +16 -0
  275. package/src/components/autocomplete/Autocomplete.stories.tsx +1 -1
  276. package/src/components/button/Button.stories.tsx +57 -33
  277. package/src/components/button/Button.tsx +17 -7
  278. package/src/components/button/{LinkButton.stories.tsx → HrefButton.stories.tsx} +4 -4
  279. package/src/components/button/{LinkButton.tsx → HrefButton.tsx} +3 -3
  280. package/src/components/button/index.ts +1 -1
  281. package/src/components/dropdown-menu/DropdownMenu.tsx +4 -2
  282. package/src/components/form/InputField.tsx +3 -1
  283. package/src/components/href/index.ts +2 -2
  284. package/src/components/input/AudioRange.test.tsx +15 -0
  285. package/src/components/input/AudioRange.tsx +131 -0
  286. package/src/components/input/Checkbox.tsx +2 -2
  287. package/src/components/input/Color.tsx +9 -2
  288. package/src/components/input/Radio.stories.tsx +3 -0
  289. package/src/components/input/Radio.tsx +6 -2
  290. package/src/components/input/Range.stories.tsx +17 -1
  291. package/src/components/input/Range.tsx +15 -3
  292. package/src/components/input/TotpInput.stories.tsx +1 -1
  293. package/src/components/input/TotpInput.tsx +6 -3
  294. package/src/components/input/index.ts +2 -0
  295. package/src/components/media-preview/FileIcon.tsx +3 -3
  296. package/src/components/media-preview/MediaPreview.tsx +18 -7
  297. package/src/components/media-preview/index.ts +1 -1
  298. package/src/components/media-preview/types.ts +2 -2
  299. package/src/components/media-preview/util.ts +2 -2
  300. package/src/components/modal/ModalContent.tsx +6 -2
  301. package/src/components/notification/Notification.stories.tsx +1 -1
  302. package/src/components/popover/PopoverTrigger.tsx +1 -1
  303. package/src/components/resizable/Resizable.stories.tsx +36 -0
  304. package/src/components/resizable/Resizable.tsx +48 -0
  305. package/src/components/resizable/ResizableHandle.tsx +71 -0
  306. package/src/components/resizable/ResizablePanel.tsx +18 -0
  307. package/src/components/resizable/context.ts +7 -0
  308. package/src/components/resizable/index.ts +3 -0
  309. package/src/components/resizable/util.ts +31 -0
  310. package/src/components/select/Select.tsx +9 -1
  311. package/src/components/slot/Slot.tsx +88 -57
  312. package/src/components/toast/Toast.stories.tsx +1 -1
  313. package/src/components/tooltip/Tooltip.stories.tsx +42 -5
  314. package/src/components/tooltip/TooltipContent.tsx +1 -1
  315. package/src/components/tooltip/TooltipTrigger.tsx +1 -1
  316. package/src/hooks/index.ts +1 -0
  317. package/src/hooks/useDoubleCheck.ts +41 -0
  318. package/src/lib/compose-refs.ts +35 -9
  319. package/src/tailwind/base.css +29 -3
  320. package/src/tailwind/components-input-outline.css +20 -4
  321. package/src/tailwind/components-range.css +39 -8
  322. package/src/tailwind/theme.css +18 -21
  323. package/tsconfig.build.json +0 -3
  324. package/tsconfig.json +12 -14
@@ -20,12 +20,10 @@ jobs:
20
20
  - uses: actions/checkout@v4
21
21
 
22
22
  - uses: pnpm/action-setup@v4
23
- with:
24
- version: 9
25
-
23
+ # pnpm version is specified in the package.json packageManager section
26
24
  - uses: actions/setup-node@v4
27
25
  with:
28
- node-version: 20
26
+ node-version: 22
29
27
  cache: pnpm
30
28
 
31
29
  - name: Setup Pages
@@ -9,6 +9,13 @@
9
9
  "name": "pnpm run storybook",
10
10
  "request": "launch",
11
11
  "type": "node-terminal"
12
+ },
13
+ {
14
+ "name": "Vitest unit current file",
15
+ "request": "launch",
16
+ "type": "node",
17
+ "runtimeExecutable": "vitest",
18
+ "runtimeArgs": ["-c", "vitest.config.ts", "${relativeFile}"]
12
19
  }
13
20
  ]
14
21
  }
package/README.md CHANGED
@@ -89,7 +89,7 @@ si on désire plus de contrôle sur nos imports
89
89
  @import "pentatrion-design/tailwind/prose.css";
90
90
  ```
91
91
 
92
- ```json
92
+ ```jsonc
93
93
  // .prettierrc
94
94
  {
95
95
  "plugins": ["prettier-plugin-tailwindcss"]
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ interface Props {
3
+ value?: string | null;
4
+ defaultValue?: string | null;
5
+ onChange?: (value: string | null) => void;
6
+ children: ReactNode;
7
+ }
8
+ export declare function Accordion({ value: controlledValue, defaultValue, onChange, children, }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=Accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAIrD,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAID,wBAAgB,SAAS,CAAC,EACxB,KAAK,EAAE,eAAe,EACtB,YAAY,EACZ,QAAe,EACf,QAAQ,GACT,EAAE,KAAK,2CAsBP"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo, useState } from "react";
3
+ import { AccordionContext } from "./useAccordion";
4
+ import { useEffectEvent } from "../../hooks";
5
+ const noop = () => { };
6
+ export function Accordion({ value: controlledValue, defaultValue, onChange = noop, children, }) {
7
+ const isControlled = typeof controlledValue !== "undefined";
8
+ const [unControlledValue, setUnControlledValue] = useState(defaultValue ?? null);
9
+ const value = (isControlled ? controlledValue : unControlledValue) ?? null;
10
+ const stableOnChange = useEffectEvent(onChange);
11
+ const context = useMemo(() => ({
12
+ value,
13
+ onChange(value) {
14
+ if (!isControlled) {
15
+ setUnControlledValue(value);
16
+ }
17
+ stableOnChange(value);
18
+ },
19
+ }), [value, stableOnChange, isControlled]);
20
+ return _jsx(AccordionContext.Provider, { value: context, children: children });
21
+ }
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ interface Props extends ComponentProps<"div"> {
3
+ name: string;
4
+ }
5
+ export declare function AccordionContent({ name, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=AccordionContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionContent.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/AccordionContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAI1D,UAAU,KAAM,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAqClE"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from "react";
3
+ import { useAccordion } from "./useAccordion";
4
+ import clsx from "clsx";
5
+ export function AccordionContent({ name, children, ...rest }) {
6
+ const { value } = useAccordion();
7
+ const wrapperRef = useRef(null);
8
+ const contentRef = useRef(null);
9
+ const isOpen = value === name;
10
+ useEffect(() => {
11
+ const updateHeight = () => {
12
+ wrapperRef.current.style.setProperty("--accordion-content-height", `${contentRef.current.scrollHeight}px`);
13
+ };
14
+ updateHeight();
15
+ const observer = new ResizeObserver(updateHeight);
16
+ observer.observe(contentRef.current);
17
+ return () => observer.disconnect();
18
+ }, []);
19
+ return (_jsx("div", { ref: wrapperRef, className: clsx("overflow-hidden transition-[height] ease-in-out", isOpen ? "h-(--accordion-content-height)" : "h-0"), ...rest, children: _jsx("div", { className: "p-2", ref: contentRef, children: children }) }));
20
+ }
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ interface Props extends ComponentProps<"div"> {
3
+ name: string;
4
+ }
5
+ export declare function AccordionItem({ name, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=AccordionItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,KAAM,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAQ/D"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAccordion } from "./useAccordion";
3
+ import clsx from "clsx";
4
+ export function AccordionItem({ name, children, ...rest }) {
5
+ const { value } = useAccordion();
6
+ return (_jsx("div", { ...rest, className: clsx(value !== name && "hidden"), children: children }));
7
+ }
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ interface Props extends ComponentProps<"button"> {
3
+ name: string;
4
+ }
5
+ export declare function AccordionTrigger({ name, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=AccordionTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/AccordionTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,KAAM,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAelE"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAccordion } from "./useAccordion";
3
+ import clsx from "clsx";
4
+ export function AccordionTrigger({ name, children, ...rest }) {
5
+ const { value, onChange } = useAccordion();
6
+ return (_jsxs("button", { type: "button", onClick: () => onChange(name === value ? null : name), ...rest, className: "border-l-yellow-4 bg-gray-0 hover:border-l-yellow-4 relative mt-[-1px] flex h-12 w-full cursor-pointer border border-l-4 border-black/5 hover:z-[1] hover:border-black/15", children: [_jsx("div", { className: "flex-center h-12 w-12", children: _jsx("i", { className: clsx("fe-angle-up transition-transform", name !== value && "rotate-180") }) }), _jsx("div", { className: "flex flex-1 items-center", children: children })] }));
7
+ }
@@ -0,0 +1,4 @@
1
+ export { Accordion } from "./Accordion";
2
+ export { AccordionTrigger } from "./AccordionTrigger";
3
+ export { AccordionContent } from "./AccordionContent";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Accordion } from "./Accordion";
2
+ export { AccordionTrigger } from "./AccordionTrigger";
3
+ export { AccordionContent } from "./AccordionContent";
@@ -0,0 +1,9 @@
1
+ export declare const AccordionContext: import("react").Context<{
2
+ value: string | null;
3
+ onChange: (value: string | null) => void;
4
+ } | null>;
5
+ export declare const useAccordion: () => {
6
+ value: string | null;
7
+ onChange: (value: string | null) => void;
8
+ };
9
+ //# sourceMappingURL=useAccordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAccordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/useAccordion.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;WACpB,MAAM,GAAG,IAAI;cACV,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;SAC3B,CAAC;AAEhB,eAAO,MAAM,YAAY;WAJhB,MAAM,GAAG,IAAI;cACV,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;CAWzC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { createContext, useContext } from "react";
2
+ export const AccordionContext = createContext(null);
3
+ export const useAccordion = () => {
4
+ const context = useContext(AccordionContext);
5
+ if (context === null) {
6
+ throw new Error("useAccordion to be use inside Accordion component");
7
+ }
8
+ return context;
9
+ };
@@ -1,8 +1,8 @@
1
1
  import { ReactNode, ComponentProps, RefObject } from "react";
2
- import type { OptionLike, Option } from "../select/index.js";
3
- import { AutocompleteOptionProps } from "./AutocompleteOption.js";
2
+ import type { OptionLike, Option } from "../select";
3
+ import { AutocompleteOptionProps } from "./AutocompleteOption";
4
4
  import { Placement } from "@floating-ui/react";
5
- import { ThemeColor } from "../../types.js";
5
+ import { ThemeColor } from "../../types";
6
6
  export interface AutocompleteProps<O extends OptionLike = Option> extends ComponentProps<"input"> {
7
7
  icon?: boolean | ReactNode;
8
8
  color?: ThemeColor;
@@ -1,16 +1,16 @@
1
1
  import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useMemo, useRef, useState, } from "react";
4
- import { AutocompleteOption } from "./AutocompleteOption.js";
4
+ import { AutocompleteOption } from "./AutocompleteOption";
5
5
  import { FloatingFocusManager, FloatingList, FloatingPortal, autoUpdate, flip, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, } from "@floating-ui/react";
6
- import { AutocompleteContext } from "./useAutocompleteContext.js";
6
+ import { AutocompleteContext } from "./useAutocompleteContext";
7
7
  import clsx from "clsx";
8
- import { useEffectEvent } from "../../hooks/index.js";
9
- import { getOptionLabel, getOptionValue } from "./util.js";
10
- import { Button } from "../button/index.js";
11
- import { Dialog } from "../dialog/index.js";
12
- import { Loader } from "../loader/index.js";
13
- import { inputConfig, sizeVariant } from "../input/Input.js";
8
+ import { useEffectEvent } from "../../hooks";
9
+ import { getOptionLabel, getOptionValue } from "./util";
10
+ import { Button } from "../button";
11
+ import { Dialog } from "../dialog";
12
+ import { Loader } from "../loader";
13
+ import { inputConfig, sizeVariant } from "../input/Input";
14
14
  export function Autocomplete({ className, autoFocus = false, icon = true, color = "yellow", noSearchSuffix, suffix, placement = "bottom", placeholder = "Search...", selection = null, onChangeSelection, autocompleteOptionComponent, loading = false, clearSearchButton = false, searchValue, onChangeSearchValue, options, selectOnFocus = true, readOnly = false, ref, ...rest }) {
15
15
  const [isOpen, setIsOpen] = useState(false);
16
16
  const [activeIndex, setActiveIndex] = useState(null);
@@ -1,4 +1,4 @@
1
- import { OptionLike } from "../select/index.js";
1
+ import { OptionLike } from "../select";
2
2
  export type AutocompleteOptionProps<O extends OptionLike> = O;
3
3
  export declare const AutocompleteOption: import("react").MemoExoticComponent<(<O extends OptionLike>(props: AutocompleteOptionProps<O>) => import("react/jsx-runtime").JSX.Element)>;
4
4
  //# sourceMappingURL=AutocompleteOption.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo, useId } from "react";
3
3
  import { useListItem } from "@floating-ui/react";
4
- import { useAutocomplete } from "./useAutocompleteContext.js";
4
+ import { useAutocomplete } from "./useAutocompleteContext";
5
5
  import clsx from "clsx";
6
- import { getOptionLabel, getOptionValue } from "./util.js";
6
+ import { getOptionLabel, getOptionValue } from "./util";
7
7
  export const AutocompleteOption = memo(function AutocompleteOption(props) {
8
8
  const label = getOptionLabel(props);
9
9
  const id = useId();
@@ -1,5 +1,5 @@
1
- import { AutocompleteProps } from "./Autocomplete.js";
2
- import { OptionLike, Option } from "../select/index.js";
1
+ import { AutocompleteProps } from "./Autocomplete";
2
+ import { OptionLike, Option } from "../select";
3
3
  interface Props<O extends OptionLike = Option> extends Omit<AutocompleteProps<O>, "searchValue" | "onChangeSearchValue" | "options" | "selectOnFocus"> {
4
4
  onChangeSearchValueCallback: (searchValue: string) => Promise<O[]>;
5
5
  debounce?: number;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useRef, useState } from "react";
3
- import { Autocomplete } from "./Autocomplete.js";
4
- import { getOptionLabel } from "./util.js";
5
- import { useStateDebounce, useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks/index.js";
3
+ import { Autocomplete } from "./Autocomplete";
4
+ import { getOptionLabel } from "./util";
5
+ import { useStateDebounce, useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks";
6
6
  export function LazyAutocomplete({ onChangeSearchValueCallback, debounce = 5000, selection = null, onChangeSelection, ...rest }) {
7
7
  const onChangeSelectionStable = useEffectEvent(onChangeSelection);
8
8
  const onChangeSearchValueCallbackStable = useEffectEvent(onChangeSearchValueCallback);
@@ -1,5 +1,5 @@
1
- import { AutocompleteProps } from "./Autocomplete.js";
2
- import { Option, OptionLike } from "../select/index.js";
1
+ import { AutocompleteProps } from "./Autocomplete";
2
+ import { Option, OptionLike } from "../select";
3
3
  interface Props<O extends OptionLike = Option> extends Omit<AutocompleteProps<O>, "searchValue" | "onChangeSearchValue" | "loading" | "clearSearchButton" | "selectOnFocus"> {
4
4
  }
5
5
  export declare function SimpleAutocomplete<O extends OptionLike = Option>({ options, selection, onChangeSelection, ...rest }: Props<O>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useRef, useState } from "react";
3
- import { Autocomplete } from "./Autocomplete.js";
4
- import { useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks/index.js";
5
- import { getOptionLabel } from "./util.js";
3
+ import { Autocomplete } from "./Autocomplete";
4
+ import { useEffectEvent, useIsomorphicLayoutEffect } from "../../hooks";
5
+ import { getOptionLabel } from "./util";
6
6
  export function SimpleAutocomplete({ options, selection = null, onChangeSelection, ...rest }) {
7
7
  const onChangeSelectionStable = useEffectEvent(onChangeSelection);
8
8
  const [searchValue, setSearchValue] = useState(selection ? getOptionLabel(selection) : "");
@@ -1,7 +1,7 @@
1
- export { Autocomplete, type AutocompleteProps } from "./Autocomplete.js";
2
- export { SimpleAutocomplete } from "./SimpleAutocomplete.js";
3
- export { AutocompleteOption } from "./AutocompleteOption.js";
4
- export { LazyAutocomplete } from "./LazyAutocomplete.js";
5
- export { useAutocomplete } from "./useAutocompleteContext.js";
6
- export { getOptionValue, getOptionLabel } from "./util.js";
1
+ export { Autocomplete, type AutocompleteProps } from "./Autocomplete";
2
+ export { SimpleAutocomplete } from "./SimpleAutocomplete";
3
+ export { AutocompleteOption } from "./AutocompleteOption";
4
+ export { LazyAutocomplete } from "./LazyAutocomplete";
5
+ export { useAutocomplete } from "./useAutocompleteContext";
6
+ export { getOptionValue, getOptionLabel } from "./util";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- export { Autocomplete } from "./Autocomplete.js";
2
- export { SimpleAutocomplete } from "./SimpleAutocomplete.js";
3
- export { AutocompleteOption } from "./AutocompleteOption.js";
4
- export { LazyAutocomplete } from "./LazyAutocomplete.js";
5
- export { useAutocomplete } from "./useAutocompleteContext.js";
6
- export { getOptionValue, getOptionLabel } from "./util.js";
1
+ export { Autocomplete } from "./Autocomplete";
2
+ export { SimpleAutocomplete } from "./SimpleAutocomplete";
3
+ export { AutocompleteOption } from "./AutocompleteOption";
4
+ export { LazyAutocomplete } from "./LazyAutocomplete";
5
+ export { useAutocomplete } from "./useAutocompleteContext";
6
+ export { getOptionValue, getOptionLabel } from "./util";
@@ -1,5 +1,5 @@
1
1
  import { useInteractions } from "@floating-ui/react";
2
- import { OptionLike } from "../select/index.js";
2
+ import { OptionLike } from "../select";
3
3
  interface AutocompleteContext {
4
4
  activeIndex: number | null;
5
5
  selection: OptionLike | null;
@@ -1,4 +1,4 @@
1
- import { OptionLike } from "../select/index.js";
1
+ import { OptionLike } from "../select";
2
2
  export declare function getOptionLabel(option: OptionLike): string;
3
3
  export declare function getOptionValue(option: OptionLike): string | number;
4
4
  //# sourceMappingURL=util.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { ThemeColor } from "../../types.js";
2
+ import { ThemeColor } from "../../types";
3
3
  interface Props {
4
4
  children: ReactNode;
5
5
  className?: string;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
- import { buttonVariants } from "../button/Button.js";
4
- import { Tooltip } from "../tooltip/Tooltip.js";
5
- import { TooltipContent } from "../tooltip/TooltipContent.js";
6
- import { TooltipTrigger } from "../tooltip/TooltipTrigger.js";
3
+ import { buttonVariants } from "../button/Button";
4
+ import { Tooltip } from "../tooltip/Tooltip";
5
+ import { TooltipContent } from "../tooltip/TooltipContent";
6
+ import { TooltipTrigger } from "../tooltip/TooltipTrigger";
7
7
  export function Badge({ children, className, onRemove, onClick, tooltip, url, color = "yellow", }) {
8
8
  const badge = (_jsxs("span", { "data-color": color, className: clsx("text-body-xs w-fit rounded-full", buttonVariants({
9
9
  variant: "contained",
@@ -1,2 +1,2 @@
1
- export { Badge } from "./Badge.js";
1
+ export { Badge } from "./Badge";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export { Badge } from "./Badge.js";
1
+ export { Badge } from "./Badge";
@@ -1,10 +1,10 @@
1
1
  import { ComponentProps, RefObject } from "react";
2
- import { ThemeColor } from "../../types.js";
2
+ import { ThemeColor } from "../../types";
3
3
  export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
4
4
  withRipple?: boolean;
5
5
  variant?: "contained" | "light" | "outlined" | "text" | "ghost";
6
6
  size?: "small" | "medium" | "large" | "custom" | "input";
7
- color?: ThemeColor;
7
+ color?: ThemeColor | "yellow-alpha" | "gray-alpha";
8
8
  width?: "fit" | "full" | "custom";
9
9
  loading?: boolean;
10
10
  disabled?: boolean;
@@ -19,10 +19,10 @@ export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
19
19
  }
20
20
  export declare const buttonVariants: (props?: ({
21
21
  clickable?: boolean | null | undefined;
22
- size?: "small" | "input" | "custom" | "medium" | "large" | null | undefined;
22
+ size?: "small" | "input" | "medium" | "large" | "custom" | null | undefined;
23
23
  icon?: boolean | "custom" | null | undefined;
24
24
  width?: "custom" | "fit" | "full" | null | undefined;
25
- variant?: "text" | "light" | "contained" | "outlined" | "ghost" | null | undefined;
25
+ variant?: "light" | "text" | "contained" | "outlined" | "ghost" | null | undefined;
26
26
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
27
27
  export declare function Button({ withRipple, variant, loading, color, size, focusable, className, disabled, children, selected, icon, asChild, width, ref, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
28
28
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAM/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEzD,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IAElC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,cAAc;;;;;;8EAqD1B,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,UAAiB,EACjB,OAAqB,EACrB,OAAe,EACf,KAAgB,EAChB,IAAe,EACf,SAAgB,EAChB,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,QAAgB,EAChB,IAAY,EACZ,OAAe,EACf,KAAa,EACb,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,2CAyDb"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAM/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAazC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEzD,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;IAEnD,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IAElC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,cAAc;;;;;;8EAoD1B,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,UAAiB,EACjB,OAAqB,EACrB,OAAe,EACf,KAAgB,EAChB,IAAe,EACf,SAAgB,EAChB,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,QAAgB,EAChB,IAAY,EACZ,OAAe,EACf,KAAa,EACb,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,2CAyDb"}
@@ -1,10 +1,20 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useImperativeHandle, useRef } from "react";
3
3
  import clsx from "clsx";
4
- import { Loader } from "../loader/index.js";
5
- import { useRipple } from "../../hooks/index.js";
6
- import { Slot } from "../slot/index.js";
4
+ import { Loader } from "../loader";
5
+ import { useRipple } from "../../hooks";
6
+ import { Slot } from "../slot";
7
7
  import { cva } from "class-variance-authority";
8
+ function loaderColor(color) {
9
+ switch (color) {
10
+ case "yellow-alpha":
11
+ return "yellow";
12
+ case "gray-alpha":
13
+ return "gray";
14
+ default:
15
+ return color;
16
+ }
17
+ }
8
18
  export const buttonVariants = cva("relative box-border inline-flex items-center leading-5 no-underline focus-visible-has:outline-2 truncate", {
9
19
  variants: {
10
20
  clickable: {
@@ -19,13 +29,13 @@ export const buttonVariants = cva("relative box-border inline-flex items-center
19
29
  custom: "",
20
30
  },
21
31
  icon: {
22
- true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg)]:pr-4",
32
+ true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg,strong)]:pr-4",
23
33
  false: "rounded-2xl px-4",
24
34
  custom: "",
25
35
  },
26
36
  width: {
27
37
  fit: "w-full max-w-fit",
28
- full: "w-full",
38
+ full: "w-full justify-center",
29
39
  custom: "",
30
40
  },
31
41
  variant: {
@@ -39,9 +49,9 @@ export const buttonVariants = cva("relative box-border inline-flex items-center
39
49
  */
40
50
  contained: "shadow-sm hover:shadow-md active:shadow-md-active outline-offset-0 text-custom-text bg-custom-3 hover:bg-custom-4 current:bg-custom-4 focus-visible-has:outline-custom-5",
41
51
  light: "shadow-sm hover:shadow-md has-checked:shadow-md focus:shadow-md active:shadow-md-active outline-offset-0 bg-custom-1 text-gray-text hover:text-custom-text hover:bg-custom-3 current:bg-custom-3 focus-visible-has:outline-custom-4",
42
- outlined: "bg-gray-0 hover:shadow-xs active:shadow-xs-active text-gray-7 outline-offset-0 border-2 hover:bg-custom-1/50 border-custom-3 focus-visible-has:outline-custom-5 current:bg-custom-3 focus-visible-has:border-transparent",
52
+ outlined: "bg-custom-0 hover:shadow-xs active:shadow-xs-active text-gray-7 outline-offset-0 border-1 hover:bg-custom-1 border-custom-3 focus-visible-has:outline-custom-5 current:bg-custom-3 focus-visible-has:border-transparent",
43
53
  text: "bg-transparent hover:shadow-xs active:shadow-xs-active outline-offset-0 hover:bg-custom-1 dark:hover:bg-custom-1/50 text-gray-7 hover:text-gray-8 current:bg-custom-3 focus-visible-has:outline-custom-5",
44
- ghost: "bg-transparent outline-offset-0 text-gray-7 hover:text-gray-8 current:bg-custom-1 focus-visible-has:outline-custom-5",
54
+ ghost: "outline-offset-0 current:bg-custom-1 focus-visible-has:outline-custom-5",
45
55
  },
46
56
  },
47
57
  defaultVariants: {
@@ -63,5 +73,5 @@ export function Button({ withRipple = true, variant = "contained", loading = fal
63
73
  size,
64
74
  width,
65
75
  icon: width === "custom" && !icon ? "custom" : icon,
66
- }), className, loading && !icon && "text-transparent"), "data-color": color, "data-variant": variant, "aria-checked": selected, disabled: typeof disabled === "boolean" ? disabled : undefined, suppressHydrationWarning: true, "aria-busy": loading, ...props, children: asChild ? (children) : (_jsxs(_Fragment, { children: [!notClickable && withRipple && ripples, children, loading && (_jsx(Loader, { color: color, className: clsx("top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"), position: "absolute" }))] })) }));
76
+ }), className, loading && !icon && "text-transparent"), "data-color": color, "data-variant": variant, "aria-checked": selected, disabled: typeof disabled === "boolean" ? disabled : undefined, suppressHydrationWarning: true, "aria-busy": loading, ...props, children: asChild ? (children) : (_jsxs(_Fragment, { children: [!notClickable && withRipple && ripples, children, loading && (_jsx(Loader, { color: loaderColor(color), className: clsx("top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"), position: "absolute" }))] })) }));
67
77
  }
@@ -0,0 +1,7 @@
1
+ import { ComponentProps, RefObject } from "react";
2
+ import { ButtonProps } from "./Button";
3
+ export type HrefButtonProps = ComponentProps<"a"> & Pick<ButtonProps, "withRipple" | "variant" | "size" | "color" | "selected" | "icon" | "disabled" | "width"> & {
4
+ ref?: RefObject<HTMLAnchorElement>;
5
+ };
6
+ export declare function HrefButton({ withRipple, variant, color, size, width, className, disabled, children, selected, icon, href, ref, ...props }: HrefButtonProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=HrefButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HrefButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/HrefButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,GAC/C,IAAI,CACF,WAAW,EACX,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACzF,GAAG;IAAE,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAA;CAAE,CAAC;AAE7C,wBAAgB,UAAU,CAAC,EACzB,UAAiB,EACjB,OAAqB,EACrB,KAAgB,EAChB,IAAe,EACf,KAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,IAAY,EACZ,IAAI,EACJ,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,2CA8BjB"}
@@ -0,0 +1,11 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useImperativeHandle, useRef } from "react";
3
+ import clsx from "clsx";
4
+ import { useRipple } from "../../hooks/useRipple";
5
+ import { buttonVariants } from "./Button";
6
+ export function HrefButton({ withRipple = true, variant = "contained", color = "yellow", size = "medium", width = "fit", className, disabled, children, selected = false, icon = false, href, ref, ...props }) {
7
+ const anchorRef = useRef(null);
8
+ useImperativeHandle(ref, () => anchorRef.current);
9
+ const ripples = useRipple(anchorRef);
10
+ return (_jsxs("a", { role: "button", href: href, ref: anchorRef, className: clsx(buttonVariants({ variant, size, width, icon: size === "custom" ? "custom" : icon }), className, selected && "active"), "data-color": color, "data-variant": variant, "aria-checked": selected, "aria-disabled": disabled, ...props, children: [!disabled && withRipple && ripples, children] }));
11
+ }
@@ -1,7 +1,7 @@
1
1
  import { ComponentProps, RefObject } from "react";
2
- import { ButtonProps } from "./Button.js";
3
- export type LinkButtonProps = ComponentProps<"a"> & Pick<ButtonProps, "withRipple" | "variant" | "size" | "color" | "selected" | "icon" | "disabled" | "width"> & {
2
+ import { ButtonProps } from "./Button";
3
+ export type HrefButtonProps = ComponentProps<"a"> & Pick<ButtonProps, "withRipple" | "variant" | "size" | "color" | "selected" | "icon" | "disabled" | "width"> & {
4
4
  ref?: RefObject<HTMLAnchorElement>;
5
5
  };
6
- export declare function LinkButton({ withRipple, variant, color, size, width, className, disabled, children, selected, icon, href, ref, ...props }: LinkButtonProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function HrefButton({ withRipple, variant, color, size, width, className, disabled, children, selected, icon, href, ref, ...props }: HrefButtonProps): import("react/jsx-runtime").JSX.Element;
7
7
  //# sourceMappingURL=LinkButton.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useImperativeHandle, useRef } from "react";
3
3
  import clsx from "clsx";
4
- import { useRipple } from "../../hooks/useRipple.js";
5
- import { buttonVariants } from "./Button.js";
6
- export function LinkButton({ withRipple = true, variant = "contained", color = "yellow", size = "medium", width = "fit", className, disabled, children, selected = false, icon = false, href, ref, ...props }) {
4
+ import { useRipple } from "../../hooks/useRipple";
5
+ import { buttonVariants } from "./Button";
6
+ export function HrefButton({ withRipple = true, variant = "contained", color = "yellow", size = "medium", width = "fit", className, disabled, children, selected = false, icon = false, href, ref, ...props }) {
7
7
  const anchorRef = useRef(null);
8
8
  useImperativeHandle(ref, () => anchorRef.current);
9
9
  const ripples = useRipple(anchorRef);
@@ -1,4 +1,4 @@
1
- export { Button, type ButtonProps, buttonVariants } from "./Button.js";
2
- export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup.js";
3
- export { LinkButton } from "./LinkButton.js";
1
+ export { Button, type ButtonProps, buttonVariants } from "./Button";
2
+ export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup";
3
+ export { HrefButton } from "./HrefButton";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,3 @@
1
- export { Button, buttonVariants } from "./Button.js";
2
- export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup.js";
3
- export { LinkButton } from "./LinkButton.js";
1
+ export { Button, buttonVariants } from "./Button";
2
+ export { ButtonGroup, buttonGroupVariants } from "./ButtonGroup";
3
+ export { HrefButton } from "./HrefButton";
@@ -1,2 +1,2 @@
1
- export { cardConfig } from "./config.js";
1
+ export { cardConfig } from "./config";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export { cardConfig } from "./config.js";
1
+ export { cardConfig } from "./config";
@@ -1,2 +1,2 @@
1
- export { Code } from "./Code.js";
1
+ export { Code } from "./Code";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export { Code } from "./Code.js";
1
+ export { Code } from "./Code";
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Children, cloneElement, isValidElement, useEffect, useRef, useState, } from "react";
3
3
  import { FloatingFocusManager, FloatingPortal, autoUpdate, flip, offset, shift, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTypeahead, } from "@floating-ui/react";
4
- import { Dialog } from "../dialog/Dialog.js";
5
- import { useEffectEvent, useRefDebounce } from "../../hooks/index.js";
4
+ import { Dialog } from "../dialog/Dialog";
5
+ import { useEffectEvent, useRefDebounce } from "../../hooks";
6
6
  export function ContextMenu({ targetRef, children, style, eventName = "contextmenu" }) {
7
7
  const [activeIndex, setActiveIndex] = useState(null);
8
8
  const [isOpen, setIsOpen] = useState(false);
@@ -1,3 +1,3 @@
1
- export { ContextMenu } from "./ContextMenu.js";
2
- export { ContextMenuItem, type ContextMenuItemMouseEvent } from "./ContextMenuItem.js";
1
+ export { ContextMenu } from "./ContextMenu";
2
+ export { ContextMenuItem, type ContextMenuItemMouseEvent } from "./ContextMenuItem";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export { ContextMenu } from "./ContextMenu.js";
2
- export { ContextMenuItem } from "./ContextMenuItem.js";
1
+ export { ContextMenu } from "./ContextMenu";
2
+ export { ContextMenuItem } from "./ContextMenuItem";