@rovula/ui 0.0.21 → 0.0.22

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 (299) hide show
  1. package/dist/cjs/bundle.css +155 -495
  2. package/dist/cjs/bundle.js +3 -3
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/ActionButton/ActionButton.stories.d.ts +7 -7
  5. package/dist/cjs/types/components/Button/Button.d.ts +1 -1
  6. package/dist/cjs/types/components/Button/Button.styles.d.ts +1 -1
  7. package/dist/cjs/types/components/Button/Buttons.stories.d.ts +13 -13
  8. package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +60 -60
  9. package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +64 -64
  10. package/dist/cjs/types/components/Icon/Icon.d.ts +11 -0
  11. package/dist/cjs/types/components/Icon/Icon.stories.d.ts +508 -0
  12. package/dist/cjs/types/components/Icon/Icon.styles.d.ts +4 -0
  13. package/dist/cjs/types/components/Input/Input.stories.d.ts +115 -115
  14. package/dist/cjs/types/components/Label/Label.stories.d.ts +51 -51
  15. package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +54 -54
  16. package/dist/cjs/types/components/Search/Search.stories.d.ts +64 -64
  17. package/dist/cjs/types/components/Slider/Slider.d.ts +5 -0
  18. package/dist/cjs/types/components/Slider/Slider.stories.d.ts +303 -0
  19. package/dist/cjs/types/components/Switch/Switch.d.ts +4 -0
  20. package/dist/cjs/types/components/Switch/Switch.stories.d.ts +305 -0
  21. package/dist/cjs/types/components/Table/Table.stories.d.ts +7 -7
  22. package/dist/cjs/types/components/Tabs/Tabs.d.ts +12 -3
  23. package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +18 -0
  24. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +62 -62
  25. package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +1 -1
  26. package/dist/cjs/types/icons/heroIconConfig.d.ts +1 -0
  27. package/dist/cjs/types/icons/iconConfig.d.ts +2 -0
  28. package/dist/cjs/types/icons/iconRegistry.d.ts +19 -0
  29. package/dist/cjs/types/icons/index.d.ts +1 -0
  30. package/dist/cjs/types/icons/material-icon/outline/ChevronDownIcon.d.ts +3 -0
  31. package/dist/cjs/types/icons/material-icon/outline/CollapseContentIcon.d.ts +3 -0
  32. package/dist/cjs/types/icons/material-icon/outline/ContentCopyIcon.d.ts +3 -0
  33. package/dist/cjs/types/icons/material-icon/outline/ContentPasteIcon.d.ts +3 -0
  34. package/dist/cjs/types/icons/material-icon/outline/DataTableIcon.d.ts +3 -0
  35. package/dist/cjs/types/icons/material-icon/outline/ExpandCircleDownIcon.d.ts +3 -0
  36. package/dist/cjs/types/icons/material-icon/outline/ExpandCircleRightIcon.d.ts +3 -0
  37. package/dist/cjs/types/icons/material-icon/outline/ExpandCircleUpIcon.d.ts +3 -0
  38. package/dist/cjs/types/icons/material-icon/outline/ExpandContentIcon.d.ts +3 -0
  39. package/dist/cjs/types/icons/material-icon/outline/InterestsIcon.d.ts +3 -0
  40. package/dist/cjs/types/icons/material-icon/outline/SaveIcon.d.ts +3 -0
  41. package/dist/cjs/types/icons/material-icon/outline/TableChartIcon.d.ts +3 -0
  42. package/dist/cjs/types/icons/material-icon/outline/index.d.ts +12 -0
  43. package/dist/cjs/types/icons/material-icon/solid/ChevronDownIcon.d.ts +3 -0
  44. package/dist/cjs/types/icons/material-icon/solid/CollapseContentIcon.d.ts +3 -0
  45. package/dist/cjs/types/icons/material-icon/solid/ContentCopyIcon.d.ts +3 -0
  46. package/dist/cjs/types/icons/material-icon/solid/ContentPasteIcon.d.ts +3 -0
  47. package/dist/cjs/types/icons/material-icon/solid/DataTableIcon.d.ts +3 -0
  48. package/dist/cjs/types/icons/material-icon/solid/ExpandCircleDownIcon.d.ts +3 -0
  49. package/dist/cjs/types/icons/material-icon/solid/ExpandCircleRightIcon.d.ts +3 -0
  50. package/dist/cjs/types/icons/material-icon/solid/ExpandCircleUpIcon.d.ts +3 -0
  51. package/dist/cjs/types/icons/material-icon/solid/ExpandContentIcon.d.ts +3 -0
  52. package/dist/cjs/types/icons/material-icon/solid/InterestsIcon.d.ts +3 -0
  53. package/dist/cjs/types/icons/material-icon/solid/SaveIcon.d.ts +3 -0
  54. package/dist/cjs/types/icons/material-icon/solid/TableChartIcon.d.ts +3 -0
  55. package/dist/cjs/types/icons/material-icon/solid/index.d.ts +12 -0
  56. package/dist/cjs/types/icons/materialIconConfig.d.ts +1 -0
  57. package/dist/cjs/types/icons/type.d.ts +8 -0
  58. package/dist/cjs/types/icons/utils.d.ts +1 -0
  59. package/dist/cjs/types/index.d.ts +4 -0
  60. package/dist/components/ActionButton/ActionButton.js +8 -19
  61. package/dist/components/ActionButton/ActionButton.stories.js +12 -22
  62. package/dist/components/ActionButton/ActionButton.styles.js +33 -8
  63. package/dist/components/AlertDialog/Alert.stories.js +5 -16
  64. package/dist/components/AlertDialog/AlertDialog.js +27 -38
  65. package/dist/components/Avatar/Avatar.js +7 -8
  66. package/dist/components/Avatar/Avatar.stories.js +11 -22
  67. package/dist/components/Avatar/Avatar.styles.js +1 -1
  68. package/dist/components/Avatar/AvatarBase.js +9 -20
  69. package/dist/components/Avatar/AvatarGroup.js +9 -10
  70. package/dist/components/Avatar/AvatarGroup.stories.js +9 -20
  71. package/dist/components/Button/Button.js +4 -15
  72. package/dist/components/Button/Button.styles.js +1 -1
  73. package/dist/components/Button/Buttons.stories.js +18 -29
  74. package/dist/components/Calendar/Calendar.js +3 -14
  75. package/dist/components/Calendar/Calendar.stories.js +6 -17
  76. package/dist/components/Checkbox/Checkbox.js +3 -14
  77. package/dist/components/Checkbox/Checkbox.stories.js +12 -23
  78. package/dist/components/Collapsible/Collapsible.js +14 -17
  79. package/dist/components/Collapsible/Collapsible.stories.js +9 -20
  80. package/dist/components/Collapsible/Collapsible.styles.js +4 -4
  81. package/dist/components/Collapsible/CollapsibleContext.js +9 -10
  82. package/dist/components/DataTable/DataTable.js +25 -26
  83. package/dist/components/DataTable/DataTable.stories.js +10 -21
  84. package/dist/components/DatePicker/DatePicker.js +4 -20
  85. package/dist/components/DatePicker/DatePicker.stories.js +6 -17
  86. package/dist/components/Dialog/Dialog.js +22 -33
  87. package/dist/components/Dialog/Dialog.stories.js +8 -19
  88. package/dist/components/Dropdown/Dropdown.js +26 -37
  89. package/dist/components/Dropdown/Dropdown.stories.js +36 -55
  90. package/dist/components/Dropdown/Dropdown.styles.js +3 -3
  91. package/dist/components/Form/Form.js +26 -87
  92. package/dist/components/Form/Text.js +2 -3
  93. package/dist/components/Form/TextInput.js +2 -3
  94. package/dist/components/Icon/Icon.js +37 -0
  95. package/dist/components/Icon/Icon.stories.js +356 -0
  96. package/dist/components/Icon/Icon.styles.js +25 -0
  97. package/dist/components/Input/Input.js +9 -20
  98. package/dist/components/Input/Input.stories.js +6 -17
  99. package/dist/components/Input/Input.styles.js +1 -1
  100. package/dist/components/Label/Label.js +3 -14
  101. package/dist/components/Label/Label.stories.js +5 -16
  102. package/dist/components/Label/Label.styles.js +1 -1
  103. package/dist/components/Loading/Loading.js +5 -17
  104. package/dist/components/Loading/Loading.stories.js +6 -17
  105. package/dist/components/Navbar/Navbar.js +3 -4
  106. package/dist/components/Navbar/Navbar.stories.js +8 -19
  107. package/dist/components/Popover/Popover.js +5 -16
  108. package/dist/components/Popover/Popover.stories.js +5 -16
  109. package/dist/components/ProgressBar/ProgressBar.js +8 -9
  110. package/dist/components/ProgressBar/ProgressBar.stories.js +14 -27
  111. package/dist/components/RadioGroup/RadioGroup.js +6 -17
  112. package/dist/components/RadioGroup/RadioGroup.stories.js +9 -20
  113. package/dist/components/Search/Search.js +2 -13
  114. package/dist/components/Search/Search.stories.js +10 -21
  115. package/dist/components/Slider/Slider.js +22 -0
  116. package/dist/components/Slider/Slider.stories.js +33 -0
  117. package/dist/components/Switch/Switch.js +22 -0
  118. package/dist/components/Switch/Switch.stories.js +32 -0
  119. package/dist/components/Table/Datagrid.js +2 -3
  120. package/dist/components/Table/Table.js +24 -35
  121. package/dist/components/Table/Table.stories.js +5 -16
  122. package/dist/components/Tabs/Tabs.js +56 -9
  123. package/dist/components/Tabs/Tabs.stories.js +13 -24
  124. package/dist/components/Text/Text.js +3 -4
  125. package/dist/components/Text/Text.stories.js +12 -23
  126. package/dist/components/TextInput/TextInput.js +30 -41
  127. package/dist/components/TextInput/TextInput.stories.js +17 -28
  128. package/dist/components/TextInput/TextInput.styles.js +7 -7
  129. package/dist/components/ThemeToggle.js +3 -3
  130. package/dist/esm/bundle.css +155 -495
  131. package/dist/esm/bundle.js +3 -3
  132. package/dist/esm/bundle.js.map +1 -1
  133. package/dist/esm/types/components/ActionButton/ActionButton.stories.d.ts +7 -7
  134. package/dist/esm/types/components/Button/Button.d.ts +1 -1
  135. package/dist/esm/types/components/Button/Button.styles.d.ts +1 -1
  136. package/dist/esm/types/components/Button/Buttons.stories.d.ts +13 -13
  137. package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +60 -60
  138. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +64 -64
  139. package/dist/esm/types/components/Icon/Icon.d.ts +11 -0
  140. package/dist/esm/types/components/Icon/Icon.stories.d.ts +508 -0
  141. package/dist/esm/types/components/Icon/Icon.styles.d.ts +4 -0
  142. package/dist/esm/types/components/Input/Input.stories.d.ts +115 -115
  143. package/dist/esm/types/components/Label/Label.stories.d.ts +51 -51
  144. package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +54 -54
  145. package/dist/esm/types/components/Search/Search.stories.d.ts +64 -64
  146. package/dist/esm/types/components/Slider/Slider.d.ts +5 -0
  147. package/dist/esm/types/components/Slider/Slider.stories.d.ts +303 -0
  148. package/dist/esm/types/components/Switch/Switch.d.ts +4 -0
  149. package/dist/esm/types/components/Switch/Switch.stories.d.ts +305 -0
  150. package/dist/esm/types/components/Table/Table.stories.d.ts +7 -7
  151. package/dist/esm/types/components/Tabs/Tabs.d.ts +12 -3
  152. package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +18 -0
  153. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +62 -62
  154. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +1 -1
  155. package/dist/esm/types/icons/heroIconConfig.d.ts +1 -0
  156. package/dist/esm/types/icons/iconConfig.d.ts +2 -0
  157. package/dist/esm/types/icons/iconRegistry.d.ts +19 -0
  158. package/dist/esm/types/icons/index.d.ts +1 -0
  159. package/dist/esm/types/icons/material-icon/outline/ChevronDownIcon.d.ts +3 -0
  160. package/dist/esm/types/icons/material-icon/outline/CollapseContentIcon.d.ts +3 -0
  161. package/dist/esm/types/icons/material-icon/outline/ContentCopyIcon.d.ts +3 -0
  162. package/dist/esm/types/icons/material-icon/outline/ContentPasteIcon.d.ts +3 -0
  163. package/dist/esm/types/icons/material-icon/outline/DataTableIcon.d.ts +3 -0
  164. package/dist/esm/types/icons/material-icon/outline/ExpandCircleDownIcon.d.ts +3 -0
  165. package/dist/esm/types/icons/material-icon/outline/ExpandCircleRightIcon.d.ts +3 -0
  166. package/dist/esm/types/icons/material-icon/outline/ExpandCircleUpIcon.d.ts +3 -0
  167. package/dist/esm/types/icons/material-icon/outline/ExpandContentIcon.d.ts +3 -0
  168. package/dist/esm/types/icons/material-icon/outline/InterestsIcon.d.ts +3 -0
  169. package/dist/esm/types/icons/material-icon/outline/SaveIcon.d.ts +3 -0
  170. package/dist/esm/types/icons/material-icon/outline/TableChartIcon.d.ts +3 -0
  171. package/dist/esm/types/icons/material-icon/outline/index.d.ts +12 -0
  172. package/dist/esm/types/icons/material-icon/solid/ChevronDownIcon.d.ts +3 -0
  173. package/dist/esm/types/icons/material-icon/solid/CollapseContentIcon.d.ts +3 -0
  174. package/dist/esm/types/icons/material-icon/solid/ContentCopyIcon.d.ts +3 -0
  175. package/dist/esm/types/icons/material-icon/solid/ContentPasteIcon.d.ts +3 -0
  176. package/dist/esm/types/icons/material-icon/solid/DataTableIcon.d.ts +3 -0
  177. package/dist/esm/types/icons/material-icon/solid/ExpandCircleDownIcon.d.ts +3 -0
  178. package/dist/esm/types/icons/material-icon/solid/ExpandCircleRightIcon.d.ts +3 -0
  179. package/dist/esm/types/icons/material-icon/solid/ExpandCircleUpIcon.d.ts +3 -0
  180. package/dist/esm/types/icons/material-icon/solid/ExpandContentIcon.d.ts +3 -0
  181. package/dist/esm/types/icons/material-icon/solid/InterestsIcon.d.ts +3 -0
  182. package/dist/esm/types/icons/material-icon/solid/SaveIcon.d.ts +3 -0
  183. package/dist/esm/types/icons/material-icon/solid/TableChartIcon.d.ts +3 -0
  184. package/dist/esm/types/icons/material-icon/solid/index.d.ts +12 -0
  185. package/dist/esm/types/icons/materialIconConfig.d.ts +1 -0
  186. package/dist/esm/types/icons/type.d.ts +8 -0
  187. package/dist/esm/types/icons/utils.d.ts +1 -0
  188. package/dist/esm/types/index.d.ts +4 -0
  189. package/dist/icons/heroIconConfig.js +13 -0
  190. package/dist/icons/iconConfig.js +2 -0
  191. package/dist/icons/iconRegistry.js +47 -0
  192. package/dist/icons/index.js +1 -0
  193. package/dist/icons/material-icon/outline/ChevronDownIcon.js +3 -0
  194. package/dist/icons/material-icon/outline/CollapseContentIcon.js +3 -0
  195. package/dist/icons/material-icon/outline/ContentCopyIcon.js +3 -0
  196. package/dist/icons/material-icon/outline/ContentPasteIcon.js +3 -0
  197. package/dist/icons/material-icon/outline/DataTableIcon.js +3 -0
  198. package/dist/icons/material-icon/outline/ExpandCircleDownIcon.js +3 -0
  199. package/dist/icons/material-icon/outline/ExpandCircleRightIcon.js +3 -0
  200. package/dist/icons/material-icon/outline/ExpandCircleUpIcon.js +3 -0
  201. package/dist/icons/material-icon/outline/ExpandContentIcon.js +3 -0
  202. package/dist/icons/material-icon/outline/InterestsIcon.js +3 -0
  203. package/dist/icons/material-icon/outline/SaveIcon.js +3 -0
  204. package/dist/icons/material-icon/outline/TableChartIcon.js +3 -0
  205. package/dist/icons/material-icon/outline/index.js +12 -0
  206. package/dist/icons/material-icon/solid/ChevronDownIcon.js +3 -0
  207. package/dist/icons/material-icon/solid/CollapseContentIcon.js +3 -0
  208. package/dist/icons/material-icon/solid/ContentCopyIcon.js +3 -0
  209. package/dist/icons/material-icon/solid/ContentPasteIcon.js +3 -0
  210. package/dist/icons/material-icon/solid/DataTableIcon.js +3 -0
  211. package/dist/icons/material-icon/solid/ExpandCircleDownIcon.js +3 -0
  212. package/dist/icons/material-icon/solid/ExpandCircleRightIcon.js +3 -0
  213. package/dist/icons/material-icon/solid/ExpandCircleUpIcon.js +3 -0
  214. package/dist/icons/material-icon/solid/ExpandContentIcon.js +3 -0
  215. package/dist/icons/material-icon/solid/InterestsIcon.js +3 -0
  216. package/dist/icons/material-icon/solid/SaveIcon.js +3 -0
  217. package/dist/icons/material-icon/solid/TableChartIcon.js +3 -0
  218. package/dist/icons/material-icon/solid/index.js +12 -0
  219. package/dist/icons/materialIconConfig.js +13 -0
  220. package/dist/icons/type.js +1 -0
  221. package/dist/icons/utils.js +6 -0
  222. package/dist/index.d.ts +30 -4
  223. package/dist/index.js +4 -0
  224. package/dist/src/theme/global.css +187 -619
  225. package/dist/stories/ColorGroupPreview.js +6 -9
  226. package/dist/stories/ColorPreview.js +1 -2
  227. package/dist/theme/presets/colors.js +2 -1
  228. package/dist/utils/cn.js +1 -5
  229. package/dist/utils/datetime.js +12 -12
  230. package/package.json +3 -1
  231. package/src/components/ActionButton/ActionButton.stories.tsx +32 -13
  232. package/src/components/ActionButton/ActionButton.styles.ts +33 -8
  233. package/src/components/DataTable/DataTable.tsx +2 -2
  234. package/src/components/Icon/Icon.stories.tsx +450 -0
  235. package/src/components/Icon/Icon.styles.ts +26 -0
  236. package/src/components/Icon/Icon.tsx +67 -0
  237. package/src/components/Slider/Slider.stories.tsx +47 -0
  238. package/src/components/Slider/Slider.tsx +32 -0
  239. package/src/components/Switch/Switch.stories.tsx +46 -0
  240. package/src/components/Switch/Switch.tsx +32 -0
  241. package/src/components/Table/Table.tsx +2 -2
  242. package/src/components/Tabs/Tabs.tsx +99 -12
  243. package/src/icons/heroIconConfig.ts +23 -0
  244. package/src/icons/iconConfig.ts +2 -0
  245. package/src/icons/iconRegistry.ts +76 -0
  246. package/src/icons/index.ts +1 -0
  247. package/src/icons/material-icon/outline/ChevronDownIcon.tsx +22 -0
  248. package/src/icons/material-icon/outline/CollapseContentIcon.tsx +20 -0
  249. package/src/icons/material-icon/outline/ContentCopyIcon.tsx +20 -0
  250. package/src/icons/material-icon/outline/ContentPasteIcon.tsx +20 -0
  251. package/src/icons/material-icon/outline/DataTableIcon.tsx +20 -0
  252. package/src/icons/material-icon/outline/ExpandCircleDownIcon.tsx +20 -0
  253. package/src/icons/material-icon/outline/ExpandCircleRightIcon.tsx +20 -0
  254. package/src/icons/material-icon/outline/ExpandCircleUpIcon.tsx +20 -0
  255. package/src/icons/material-icon/outline/ExpandContentIcon.tsx +20 -0
  256. package/src/icons/material-icon/outline/InterestsIcon.tsx +20 -0
  257. package/src/icons/material-icon/outline/SaveIcon.tsx +20 -0
  258. package/src/icons/material-icon/outline/TableChartIcon.tsx +20 -0
  259. package/src/icons/material-icon/outline/index.ts +12 -0
  260. package/src/icons/material-icon/solid/ChevronDownIcon.tsx +22 -0
  261. package/src/icons/material-icon/solid/CollapseContentIcon.tsx +20 -0
  262. package/src/icons/material-icon/solid/ContentCopyIcon.tsx +20 -0
  263. package/src/icons/material-icon/solid/ContentPasteIcon.tsx +20 -0
  264. package/src/icons/material-icon/solid/DataTableIcon.tsx +20 -0
  265. package/src/icons/material-icon/solid/ExpandCircleDownIcon.tsx +20 -0
  266. package/src/icons/material-icon/solid/ExpandCircleRightIcon.tsx +20 -0
  267. package/src/icons/material-icon/solid/ExpandCircleUpIcon.tsx +20 -0
  268. package/src/icons/material-icon/solid/ExpandContentIcon.tsx +20 -0
  269. package/src/icons/material-icon/solid/InterestsIcon.tsx +20 -0
  270. package/src/icons/material-icon/solid/SaveIcon.tsx +20 -0
  271. package/src/icons/material-icon/solid/TableChartIcon.tsx +20 -0
  272. package/src/icons/material-icon/solid/index.ts +12 -0
  273. package/src/icons/materialIconConfig.tsx +23 -0
  274. package/src/icons/type.ts +11 -0
  275. package/src/icons/utils.ts +6 -0
  276. package/src/index.ts +5 -0
  277. package/src/theme/presets/colors.js +2 -1
  278. package/dist/cjs/types/components/ActionButton/ActionButton.styles copy.d.ts +0 -6
  279. package/dist/cjs/types/components/Button/Button.styles copy.d.ts +0 -7
  280. package/dist/components/ActionButton/ActionButton.styles copy.js +0 -90
  281. package/dist/components/Button/Button.styles copy.js +0 -210
  282. package/dist/esm/types/components/ActionButton/ActionButton.styles copy.d.ts +0 -6
  283. package/dist/esm/types/components/Button/Button.styles copy.d.ts +0 -7
  284. package/src/_theme/global copy.css +0 -761
  285. package/src/_theme/global.css +0 -39
  286. package/src/_theme/main-preset.js +0 -239
  287. package/src/_theme/plugins/utilities/typography.js +0 -81
  288. package/src/_theme/presets/colors copy 2.js +0 -319
  289. package/src/_theme/presets/colors copy.js +0 -229
  290. package/src/_theme/presets/colors.js +0 -94
  291. package/src/_theme/theme.d.ts +0 -69
  292. package/src/_theme/variables/base/button.css +0 -334
  293. package/src/_theme/variables/base/components copy.css +0 -19
  294. package/src/_theme/variables/default/colors.css +0 -292
  295. package/src/_theme/variables/default/typography.css +0 -178
  296. package/src/_theme/variables/xspector/colors.css +0 -468
  297. package/src/_theme/variables/xspector/typography.css +0 -178
  298. package/src/components/ActionButton/ActionButton.styles copy.ts +0 -95
  299. package/src/components/Button/Button.styles copy.ts +0 -214
@@ -1,15 +1,4 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
3
  import { useState } from "react";
15
4
  import { CalendarIcon } from "@heroicons/react/16/solid";
@@ -17,15 +6,10 @@ import { Calendar } from "../Calendar";
17
6
  import { Popover, PopoverContent, PopoverTrigger } from "../Popover/Popover";
18
7
  import { TextInput } from "../TextInput/TextInput";
19
8
  import { format } from "date-fns/format";
20
- var DatePicker = function (_a) {
21
- var date = _a.date, onSelect = _a.onSelect, textInputProps = _a.textInputProps;
22
- var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
23
- return (_jsx("div", { children: _jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("div", { className: "flex", children: _jsx(TextInput, __assign({ fullwidth: true, id: "2", readOnly: true, label: "Date", size: "md", value: date ? format(date, "dd MMM yyyy") : isOpen ? " " : "", hasClearIcon: false, endIcon: _jsx(CalendarIcon, { fill: "inherit" }) }, textInputProps)) }) }), _jsx(PopoverContent, { className: "w-auto p-0", children: _jsx(Calendar, { mode: "single", selected: date, onSelect: function () {
24
- var value = [];
25
- for (var _i = 0; _i < arguments.length; _i++) {
26
- value[_i] = arguments[_i];
27
- }
28
- onSelect === null || onSelect === void 0 ? void 0 : onSelect.apply(void 0, value);
9
+ const DatePicker = ({ date, onSelect, textInputProps, }) => {
10
+ const [isOpen, setIsOpen] = useState(false);
11
+ return (_jsx("div", { children: _jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("div", { className: "flex", children: _jsx(TextInput, Object.assign({ fullwidth: true, id: "2", readOnly: true, label: "Date", size: "md", value: date ? format(date, "dd MMM yyyy") : isOpen ? " " : "", hasClearIcon: false, endIcon: _jsx(CalendarIcon, { fill: "inherit" }) }, textInputProps)) }) }), _jsx(PopoverContent, { className: "w-auto p-0", children: _jsx(Calendar, { mode: "single", selected: date, onSelect: (...value) => {
12
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(...value);
29
13
  setIsOpen(false);
30
14
  } }) })] }) }));
31
15
  };
@@ -1,19 +1,8 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import React from "react";
14
3
  import DatePicker from "./DatePicker";
15
4
  // import { Popover, PopoverTrigger, PopoverContent } from "./Popover";
16
- var meta = {
5
+ const meta = {
17
6
  title: "Components/DatePicker",
18
7
  component: DatePicker,
19
8
  tags: ["autodocs"],
@@ -21,16 +10,16 @@ var meta = {
21
10
  layout: "fullscreen",
22
11
  },
23
12
  decorators: [
24
- function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
13
+ (Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
25
14
  ],
26
15
  };
27
16
  export default meta;
28
- export var Default = {
17
+ export const Default = {
29
18
  args: {},
30
- render: function (args) {
19
+ render: (args) => {
31
20
  console.log("args ", args);
32
- var props = __assign({}, args);
33
- var _a = React.useState(undefined), date = _a[0], setDate = _a[1];
21
+ const props = Object.assign({}, args);
22
+ const [date, setDate] = React.useState(undefined);
34
23
  return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(DatePicker, { date: date, onSelect: setDate }) }));
35
24
  },
36
25
  };
@@ -1,15 +1,4 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __rest = (this && this.__rest) || function (s, e) {
14
3
  var t = {};
15
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -26,38 +15,38 @@ import * as React from "react";
26
15
  import * as DialogPrimitive from "@radix-ui/react-dialog";
27
16
  import { XMarkIcon } from "@heroicons/react/16/solid";
28
17
  import { cn } from "@/utils/cn";
29
- var Dialog = DialogPrimitive.Root;
30
- var DialogTrigger = DialogPrimitive.Trigger;
31
- var DialogPortal = DialogPrimitive.Portal;
32
- var DialogClose = DialogPrimitive.Close;
33
- var DialogOverlay = React.forwardRef(function (_a, ref) {
34
- var className = _a.className, props = __rest(_a, ["className"]);
35
- return (_jsx(DialogPrimitive.Overlay, __assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-base-popup-curtain data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props)));
18
+ const Dialog = DialogPrimitive.Root;
19
+ const DialogTrigger = DialogPrimitive.Trigger;
20
+ const DialogPortal = DialogPrimitive.Portal;
21
+ const DialogClose = DialogPrimitive.Close;
22
+ const DialogOverlay = React.forwardRef((_a, ref) => {
23
+ var { className } = _a, props = __rest(_a, ["className"]);
24
+ return (_jsx(DialogPrimitive.Overlay, Object.assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-base-popup-curtain data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props)));
36
25
  });
37
26
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
38
- var DialogContent = React.forwardRef(function (_a, ref) {
39
- var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
40
- return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, __assign({ ref: ref, className: cn("fixed text-base-popup-foreground left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-base-popup bg-base-popup p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-md", className) }, props, { children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-primary data-[state=open]:text-primary-foreground", children: [_jsx(XMarkIcon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] }))] }));
27
+ const DialogContent = React.forwardRef((_a, ref) => {
28
+ var { className, children } = _a, props = __rest(_a, ["className", "children"]);
29
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, Object.assign({ ref: ref, className: cn("fixed text-base-popup-foreground left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-base-popup bg-base-popup p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-md", className) }, props, { children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-primary data-[state=open]:text-primary-foreground", children: [_jsx(XMarkIcon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] }))] }));
41
30
  });
42
31
  DialogContent.displayName = DialogPrimitive.Content.displayName;
43
- var DialogHeader = function (_a) {
44
- var className = _a.className, props = __rest(_a, ["className"]);
45
- return (_jsx("div", __assign({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props)));
32
+ const DialogHeader = (_a) => {
33
+ var { className } = _a, props = __rest(_a, ["className"]);
34
+ return (_jsx("div", Object.assign({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props)));
46
35
  };
47
36
  DialogHeader.displayName = "DialogHeader";
48
- var DialogFooter = function (_a) {
49
- var className = _a.className, props = __rest(_a, ["className"]);
50
- return (_jsx("div", __assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ", className) }, props)));
37
+ const DialogFooter = (_a) => {
38
+ var { className } = _a, props = __rest(_a, ["className"]);
39
+ return (_jsx("div", Object.assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ", className) }, props)));
51
40
  };
52
41
  DialogFooter.displayName = "DialogFooter";
53
- var DialogTitle = React.forwardRef(function (_a, ref) {
54
- var className = _a.className, props = __rest(_a, ["className"]);
55
- return (_jsx(DialogPrimitive.Title, __assign({ ref: ref, className: cn("typography-h5 tracking-tight ", className) }, props)));
42
+ const DialogTitle = React.forwardRef((_a, ref) => {
43
+ var { className } = _a, props = __rest(_a, ["className"]);
44
+ return (_jsx(DialogPrimitive.Title, Object.assign({ ref: ref, className: cn("typography-h5 tracking-tight ", className) }, props)));
56
45
  });
57
46
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
58
- var DialogDescription = React.forwardRef(function (_a, ref) {
59
- var className = _a.className, props = __rest(_a, ["className"]);
60
- return (_jsx(DialogPrimitive.Description, __assign({ ref: ref, className: cn("text-sm", className) }, props)));
47
+ const DialogDescription = React.forwardRef((_a, ref) => {
48
+ var { className } = _a, props = __rest(_a, ["className"]);
49
+ return (_jsx(DialogPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm", className) }, props)));
61
50
  });
62
51
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
63
52
  export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "./Dialog";
14
3
  import Button from "../Button/Button";
15
4
  import { Label } from "../Label/Label";
16
5
  import { Input } from "../Input/Input";
17
- var meta = {
6
+ const meta = {
18
7
  title: "Components/Dialog",
19
8
  component: Dialog,
20
9
  tags: ["autodocs"],
@@ -22,31 +11,31 @@ var meta = {
22
11
  layout: "fullscreen",
23
12
  },
24
13
  decorators: [
25
- function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
14
+ (Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
26
15
  ],
27
16
  };
28
17
  export default meta;
29
- export var Default = {
18
+ export const Default = {
30
19
  args: {
31
20
  // label: "Lorem Ipsum",
32
21
  // value: "Lorem Ipsum",
33
22
  // fullwidth: true,
34
23
  },
35
- render: function (args) {
24
+ render: (args) => {
36
25
  console.log("args ", args);
37
- var props = __assign({}, args);
26
+ const props = Object.assign({}, args);
38
27
  return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(Dialog, { children: [_jsx(DialogTrigger, { children: "Open" }), _jsx(DialogContent, { children: _jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Are you absolutely sure?" }), _jsx(DialogDescription, { children: "This action cannot be undone. This will permanently delete your account and remove your data from our servers." })] }) })] }) }));
39
28
  },
40
29
  };
41
- export var Demo = {
30
+ export const Demo = {
42
31
  args: {
43
32
  // label: "Lorem Ipsum",
44
33
  // value: "Lorem Ipsum",
45
34
  // fullwidth: true,
46
35
  },
47
- render: function (args) {
36
+ render: (args) => {
48
37
  console.log("args ", args);
49
- var props = __assign({}, args);
38
+ const props = Object.assign({}, args);
50
39
  return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Edit Profile" }) }), _jsxs(DialogContent, { className: "sm:max-w-[425px]", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Edit profile" }), _jsx(DialogDescription, { children: "Make changes to your profile here. Click save when you're done." })] }), _jsxs("div", { className: "grid gap-4 py-4", children: [_jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [_jsx(Label, { htmlFor: "name", className: "text-right", children: "Name" }), _jsx(Input, { id: "name", defaultValue: "Pedro Duarte", className: "col-span-3" })] }), _jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [_jsx(Label, { htmlFor: "username", className: "text-right", children: "Username" }), _jsx(Input, { id: "username", defaultValue: "@peduarte", className: "col-span-3" })] })] }), _jsx(DialogFooter, { children: _jsx(Button, { type: "submit", children: "Save changes" }) })] })] }) }));
51
40
  },
52
41
  };
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __rest = (this && this.__rest) || function (s, e) {
13
2
  var t = {};
14
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -25,56 +14,56 @@ import { Fragment, forwardRef, useCallback, useEffect, useMemo, useRef, useState
25
14
  import TextInput from "../TextInput/TextInput";
26
15
  import { customInputVariant, dropdownIconVariant, iconWrapperVariant, } from "./Dropdown.styles";
27
16
  import { ChevronDownIcon } from "@heroicons/react/16/solid";
28
- var Dropdown = forwardRef(function (_a, ref) {
29
- var id = _a.id, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, label = _a.label, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.rounded, rounded = _d === void 0 ? "normal" : _d, _e = _a.variant, variant = _e === void 0 ? "outline" : _e, helperText = _a.helperText, errorMessage = _a.errorMessage, _f = _a.fullwidth, fullwidth = _f === void 0 ? true : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.filterMode, filterMode = _j === void 0 ? false : _j, _k = _a.required, required = _k === void 0 ? true : _k, onChangeText = _a.onChangeText, onSelect = _a.onSelect, props = __rest(_a, ["id", "options", "value", "label", "size", "rounded", "variant", "helperText", "errorMessage", "fullwidth", "disabled", "error", "filterMode", "required", "onChangeText", "onSelect"]);
30
- var _id = id || "".concat(label, "-select");
31
- var _l = useState(false), isFocused = _l[0], setIsFocused = _l[1];
32
- var _m = useState(null), selectedOption = _m[0], setSelectedOption = _m[1];
33
- var _o = useState(""), textValue = _o[0], setTextValue = _o[1];
34
- var keyCode = useRef("");
35
- useEffect(function () {
17
+ const Dropdown = forwardRef((_a, ref) => {
18
+ var { id, options = [], value, label, size = "md", rounded = "normal", variant = "outline", helperText, errorMessage, fullwidth = true, disabled = false, error = false, filterMode = false, required = true, onChangeText, onSelect } = _a, props = __rest(_a, ["id", "options", "value", "label", "size", "rounded", "variant", "helperText", "errorMessage", "fullwidth", "disabled", "error", "filterMode", "required", "onChangeText", "onSelect"]);
19
+ const _id = id || `${label}-select`;
20
+ const [isFocused, setIsFocused] = useState(false);
21
+ const [selectedOption, setSelectedOption] = useState(null);
22
+ const [textValue, setTextValue] = useState("");
23
+ const keyCode = useRef("");
24
+ useEffect(() => {
36
25
  if (value && !selectedOption) {
37
26
  setSelectedOption(value);
38
27
  }
39
28
  }, [value, selectedOption]);
40
- var handleOnChangeText = useCallback(function (event) {
29
+ const handleOnChangeText = useCallback((event) => {
41
30
  onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(event);
42
31
  setTextValue(event.target.value);
43
32
  }, [onChangeText]);
44
- var handleOptionClick = useCallback(function (option) {
33
+ const handleOptionClick = useCallback((option) => {
45
34
  setSelectedOption(option);
46
35
  setTextValue(option.label);
47
36
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(option);
48
37
  }, [onSelect]);
49
- var optionsFiltered = useMemo(function () {
50
- return options.filter(function (option) {
38
+ const optionsFiltered = useMemo(() => {
39
+ return options.filter((option) => {
51
40
  var _a;
52
41
  return !filterMode ||
53
42
  ((_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(textValue === null || textValue === void 0 ? void 0 : textValue.toLowerCase()));
54
43
  });
55
44
  }, [options, filterMode, textValue]);
56
- var renderOptions = function () { return (_jsxs("ul", { className: "absolute mt-1 w-full bg-base-popup border border-base-popup text-base-popup-foreground rounded-md shadow-md z-10 max-h-60 overflow-y-auto", children: [optionsFiltered.map(function (option) {
45
+ const renderOptions = () => (_jsxs("ul", { className: "absolute mt-1 w-full bg-base-popup border border-base-popup text-base-popup-foreground rounded-md shadow-md z-10 max-h-60 overflow-y-auto", children: [optionsFiltered.map((option) => {
57
46
  if (option.renderLabel) {
58
47
  return (_jsx(Fragment, { children: option.renderLabel({
59
48
  value: option.value,
60
49
  label: option.label,
61
- handleOnClick: function () { return handleOptionClick(option); },
62
- className: "px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value ? " bg-gray-200" : ""),
50
+ handleOnClick: () => handleOptionClick(option),
51
+ className: `px-4 py-2 hover:bg-gray-100 cursor-pointer ${(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value ? " bg-gray-200" : ""}`,
63
52
  }) }, option.value));
64
53
  }
65
- return (_jsx("li", { onMouseDown: function () { return handleOptionClick(option); }, className: "px-4 py-2 hover:bg-primary-hover-bg cursor-pointer ".concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value
54
+ return (_jsx("li", { onMouseDown: () => handleOptionClick(option), className: `px-4 py-2 hover:bg-primary-hover-bg cursor-pointer ${(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value
66
55
  ? "bg-base-popup-highligh"
67
- : ""), children: option.label }, option.value));
68
- }), optionsFiltered.length === 0 && (_jsx("li", { className: "px-4 py-14 text-center text-input-text", children: "Not found" }))] })); };
69
- var handleOnFocus = useCallback(function (e) {
56
+ : ""}`, children: option.label }, option.value));
57
+ }), optionsFiltered.length === 0 && (_jsx("li", { className: "px-4 py-14 text-center text-input-text", children: "Not found" }))] }));
58
+ const handleOnFocus = useCallback((e) => {
70
59
  var _a;
71
60
  setIsFocused(true);
72
61
  (_a = props === null || props === void 0 ? void 0 : props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
73
62
  }, [props === null || props === void 0 ? void 0 : props.onFocus]);
74
- var clearMismatchValue = useCallback(function (e) {
75
- var matchSelectedValue = optionsFiltered.find(function (opt) { var _a, _b; return opt.value === ((_a = e.target) === null || _a === void 0 ? void 0 : _a.value) || opt.label === ((_b = e.target) === null || _b === void 0 ? void 0 : _b.value); });
76
- var isMatchSelectedValue = !!matchSelectedValue;
77
- var option = matchSelectedValue || {
63
+ const clearMismatchValue = useCallback((e) => {
64
+ const matchSelectedValue = optionsFiltered.find((opt) => { var _a, _b; return opt.value === ((_a = e.target) === null || _a === void 0 ? void 0 : _a.value) || opt.label === ((_b = e.target) === null || _b === void 0 ? void 0 : _b.value); });
65
+ const isMatchSelectedValue = !!matchSelectedValue;
66
+ let option = matchSelectedValue || {
78
67
  value: "",
79
68
  label: "",
80
69
  };
@@ -91,17 +80,17 @@ var Dropdown = forwardRef(function (_a, ref) {
91
80
  setTextValue(option.label);
92
81
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(option);
93
82
  }, [optionsFiltered, textValue]);
94
- var handleOnBlur = useCallback(function (e) {
83
+ const handleOnBlur = useCallback((e) => {
95
84
  var _a;
96
85
  setIsFocused(false);
97
86
  clearMismatchValue(e);
98
87
  (_a = props === null || props === void 0 ? void 0 : props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
99
88
  }, [props === null || props === void 0 ? void 0 : props.onBlur]);
100
- var handleOnKeyDown = useCallback(function (e) {
89
+ const handleOnKeyDown = useCallback((e) => {
101
90
  var _a;
102
91
  keyCode.current = e.code;
103
92
  (_a = props === null || props === void 0 ? void 0 : props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
104
93
  }, [props === null || props === void 0 ? void 0 : props.onKeyDown]);
105
- return (_jsxs("div", { className: "relative ".concat(fullwidth ? "w-full" : ""), children: [_jsx(TextInput, __assign({ hasClearIcon: false, endIcon: _jsx("div", { className: iconWrapperVariant({ size: size }), children: _jsx(ChevronDownIcon, { className: dropdownIconVariant({ size: size, isFocus: isFocused }) }) }) }, props, { ref: ref, readOnly: !filterMode, value: textValue, onChange: handleOnChangeText, label: label, placeholder: " ", type: "text", rounded: rounded, variant: variant, helperText: helperText, errorMessage: errorMessage, fullwidth: fullwidth, error: error, required: required, id: _id, disabled: disabled, size: size, className: customInputVariant({ size: size }), onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: handleOnKeyDown })), isFocused && renderOptions()] }));
94
+ return (_jsxs("div", { className: `relative ${fullwidth ? "w-full" : ""}`, children: [_jsx(TextInput, Object.assign({ hasClearIcon: false, endIcon: _jsx("div", { className: iconWrapperVariant({ size }), children: _jsx(ChevronDownIcon, { className: dropdownIconVariant({ size, isFocus: isFocused }) }) }) }, props, { ref: ref, readOnly: !filterMode, value: textValue, onChange: handleOnChangeText, label: label, placeholder: " ", type: "text", rounded: rounded, variant: variant, helperText: helperText, errorMessage: errorMessage, fullwidth: fullwidth, error: error, required: required, id: _id, disabled: disabled, size: size, className: customInputVariant({ size }), onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: handleOnKeyDown })), isFocused && renderOptions()] }));
106
95
  });
107
96
  export default Dropdown;
@@ -1,30 +1,10 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
- if (ar || !(i in from)) {
15
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
- ar[i] = from[i];
17
- }
18
- }
19
- return to.concat(ar || Array.prototype.slice.call(from));
20
- };
21
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
2
  import { useRef, useState } from "react";
23
3
  import Dropdown from "./Dropdown";
24
4
  import Button from "../Button/Button";
25
5
  import { cn } from "@/utils/cn";
26
6
  // More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
27
- var meta = {
7
+ const meta = {
28
8
  title: "Components/Dropdown",
29
9
  component: Dropdown,
30
10
  tags: ["autodocs"],
@@ -33,43 +13,44 @@ var meta = {
33
13
  layout: "fullscreen",
34
14
  },
35
15
  decorators: [
36
- function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
16
+ (Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
37
17
  ],
38
18
  };
39
19
  export default meta;
40
- var options = new Array(100).fill("").map(function (__, index) { return ({
41
- value: "option".concat(index + 1),
42
- label: "Option ".concat(index + 1),
43
- }); });
44
- export var Default = {
20
+ const options = new Array(100).fill("").map((__, index) => ({
21
+ value: `option${index + 1}`,
22
+ label: `Option ${index + 1}`,
23
+ }));
24
+ export const Default = {
45
25
  args: {
46
26
  label: "Choose an option:",
47
27
  fullwidth: true,
48
- options: options,
28
+ options,
49
29
  },
50
- render: function (args) {
30
+ render: (args) => {
51
31
  console.log("args ", args);
52
- var props = __assign({}, args);
53
- return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(Dropdown, __assign({ id: "1", size: "lg", options: options }, args)), _jsx(Dropdown, __assign({ id: "2", size: "md", options: options }, args)), _jsx(Dropdown, __assign({ id: "3", size: "sm", options: options }, args))] }));
32
+ const props = Object.assign({}, args);
33
+ return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(Dropdown, Object.assign({ id: "1", size: "lg", options: options }, args)), _jsx(Dropdown, Object.assign({ id: "2", size: "md", options: options }, args)), _jsx(Dropdown, Object.assign({ id: "3", size: "sm", options: options }, args))] }));
54
34
  },
55
35
  };
56
- var DropdownWithRef = function (props) {
57
- var inputRef = useRef(null);
58
- var _a = useState(customOptions), options = _a[0], setOptions = _a[1];
59
- var _b = useState({
36
+ const DropdownWithRef = (props) => {
37
+ const inputRef = useRef(null);
38
+ const [options, setOptions] = useState(customOptions);
39
+ const [value, setValue] = useState({
60
40
  label: "",
61
41
  value: "",
62
- }), value = _b[0], setValue = _b[1];
63
- var _c = useState(""), text = _c[0], setText = _c[1];
64
- return (_jsx(Dropdown, __assign({ id: "1", size: "lg" }, props, { value: value, options: options, ref: inputRef, labelClassName: "peer-focus:bg-red-500", onSelect: setValue, onChangeText: function (e) { return setText(e.target.value); }, onKeyDown: function (e) {
42
+ });
43
+ const [text, setText] = useState("");
44
+ return (_jsx(Dropdown, Object.assign({ id: "1", size: "lg" }, props, { value: value, options: options, ref: inputRef, labelClassName: "peer-focus:bg-red-500", onSelect: setValue, onChangeText: (e) => setText(e.target.value), onKeyDown: (e) => {
65
45
  var _a, _b;
66
46
  if (e.code === "Enter") {
67
- setOptions(function (options) { return __spreadArray(__spreadArray([], options, true), [
47
+ setOptions((options) => [
48
+ ...options,
68
49
  {
69
50
  label: text,
70
51
  value: text,
71
52
  },
72
- ], false); });
53
+ ]);
73
54
  setValue({
74
55
  label: text,
75
56
  value: text,
@@ -78,39 +59,39 @@ var DropdownWithRef = function (props) {
78
59
  }
79
60
  } })));
80
61
  };
81
- export var WithRef = {
62
+ export const WithRef = {
82
63
  args: {
83
64
  label: "Choose an option:",
84
65
  fullwidth: true,
85
- options: options,
66
+ options,
86
67
  filterMode: true,
87
68
  },
88
- render: function (args) {
69
+ render: (args) => {
89
70
  console.log("args ", args);
90
- var props = __assign({}, args);
91
- return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(DropdownWithRef, __assign({ id: "1", size: "lg", options: options }, args)) }));
71
+ const props = Object.assign({}, args);
72
+ return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(DropdownWithRef, Object.assign({ id: "1", size: "lg", options: options }, args)) }));
92
73
  },
93
74
  };
94
- var customOptions = new Array(100).fill("").map(function (__, index) { return ({
95
- value: "option".concat(index + 1),
96
- label: "Option ".concat(index + 1),
97
- renderLabel: function (config) {
98
- return (_jsxs("div", { className: cn(config, "w-full flex justify-between"), onMouseDown: config.handleOnClick, children: [_jsx("span", { children: "Test custom" }), _jsx(Button, { onMouseDown: function (e) {
75
+ const customOptions = new Array(100).fill("").map((__, index) => ({
76
+ value: `option${index + 1}`,
77
+ label: `Option ${index + 1}`,
78
+ renderLabel(config) {
79
+ return (_jsxs("div", { className: cn(config, "w-full flex justify-between"), onMouseDown: config.handleOnClick, children: [_jsx("span", { children: "Test custom" }), _jsx(Button, { onMouseDown: (e) => {
99
80
  // e.stopPropagation();
100
81
  alert("SSS");
101
82
  }, children: "Add action" })] }));
102
83
  },
103
- }); });
104
- export var CustomOption = {
84
+ }));
85
+ export const CustomOption = {
105
86
  args: {
106
87
  label: "Choose an option:",
107
88
  fullwidth: true,
108
89
  options: customOptions,
109
90
  filterMode: true,
110
91
  },
111
- render: function (args) {
92
+ render: (args) => {
112
93
  console.log("args ", args);
113
- var props = __assign({}, args);
114
- return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(DropdownWithRef, __assign({ id: "1", size: "lg", options: options }, args)) }));
94
+ const props = Object.assign({}, args);
95
+ return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(DropdownWithRef, Object.assign({ id: "1", size: "lg", options: options }, args)) }));
115
96
  },
116
97
  };
@@ -1,5 +1,5 @@
1
1
  import { cva } from "class-variance-authority";
2
- export var iconWrapperVariant = cva(["absolute inset-y-0 right-0 flex items-center justify-center"], {
2
+ export const iconWrapperVariant = cva(["absolute inset-y-0 right-0 flex items-center justify-center"], {
3
3
  variants: {
4
4
  size: {
5
5
  sm: "mr-2",
@@ -11,7 +11,7 @@ export var iconWrapperVariant = cva(["absolute inset-y-0 right-0 flex items-cent
11
11
  size: "md",
12
12
  },
13
13
  });
14
- export var dropdownIconVariant = cva(["transition-all"], {
14
+ export const dropdownIconVariant = cva(["transition-all"], {
15
15
  variants: {
16
16
  size: {
17
17
  sm: "size-[14px]",
@@ -33,7 +33,7 @@ export var dropdownIconVariant = cva(["transition-all"], {
33
33
  isFocus: false,
34
34
  },
35
35
  });
36
- export var customInputVariant = cva([], {
36
+ export const customInputVariant = cva([], {
37
37
  variants: {
38
38
  size: {
39
39
  sm: "pe-[30px]",