@quen-ui/components 0.0.14 → 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 (403) hide show
  1. package/README.md +2 -2
  2. package/dist/Accordion/Accordion.cjs.js +88 -0
  3. package/dist/Accordion/Accordion.d.ts +3 -0
  4. package/dist/Accordion/Accordion.es.js +89 -0
  5. package/dist/Accordion/AccordionGroup.cjs.js +82 -0
  6. package/dist/Accordion/AccordionGroup.d.ts +12 -0
  7. package/dist/Accordion/AccordionGroup.es.js +82 -0
  8. package/dist/Accordion/AccordionItem.cjs.js +71 -0
  9. package/dist/Accordion/AccordionItem.d.ts +3 -0
  10. package/dist/Accordion/AccordionItem.es.js +72 -0
  11. package/dist/Accordion/helpers.cjs.js +24 -0
  12. package/dist/Accordion/helpers.d.ts +25 -0
  13. package/dist/Accordion/helpers.es.js +24 -0
  14. package/dist/Accordion/index.cjs.js +7 -0
  15. package/dist/Accordion/index.d.ts +8 -0
  16. package/dist/Accordion/index.es.js +7 -0
  17. package/dist/Accordion/styles.cjs.js +97 -0
  18. package/dist/Accordion/styles.d.ts +23 -0
  19. package/dist/Accordion/styles.es.js +97 -0
  20. package/dist/Accordion/types.d.ts +142 -0
  21. package/dist/Accordion/useAccordionState.cjs.js +34 -0
  22. package/dist/Accordion/useAccordionState.d.ts +12 -0
  23. package/dist/Accordion/useAccordionState.es.js +34 -0
  24. package/dist/Alert/Alert.cjs.js +1 -1
  25. package/dist/Alert/Alert.es.js +1 -1
  26. package/dist/Alert/styles.cjs.js +14 -10
  27. package/dist/Alert/styles.es.js +14 -10
  28. package/dist/Avatar/styles.cjs.js +16 -11
  29. package/dist/Avatar/styles.es.js +16 -11
  30. package/dist/Badge/styles.cjs.js +7 -7
  31. package/dist/Badge/styles.es.js +7 -7
  32. package/dist/Breadcrumbs/BreadcrumbItem.cjs.js +6 -6
  33. package/dist/Breadcrumbs/BreadcrumbItem.es.js +6 -6
  34. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +2 -3
  35. package/dist/Breadcrumbs/Breadcrumbs.es.js +2 -3
  36. package/dist/Breadcrumbs/styles.cjs.js +15 -15
  37. package/dist/Breadcrumbs/styles.es.js +15 -15
  38. package/dist/Button/Button.cjs.js +3 -3
  39. package/dist/Button/Button.es.js +6 -6
  40. package/dist/Button/index.d.ts +1 -1
  41. package/dist/Button/styles.cjs.js +49 -54
  42. package/dist/Button/styles.es.js +50 -55
  43. package/dist/Button/types.d.ts +2 -3
  44. package/dist/Calendar/Calendar.cjs.js +200 -0
  45. package/dist/Calendar/Calendar.d.ts +4 -0
  46. package/dist/Calendar/Calendar.es.js +201 -0
  47. package/dist/Calendar/DaysLevel.cjs.js +93 -0
  48. package/dist/Calendar/DaysLevel.d.ts +3 -0
  49. package/dist/Calendar/DaysLevel.es.js +94 -0
  50. package/dist/Calendar/MonthLevel.cjs.js +23 -0
  51. package/dist/Calendar/MonthLevel.d.ts +3 -0
  52. package/dist/Calendar/MonthLevel.es.js +24 -0
  53. package/dist/Calendar/YearsLevel.cjs.js +24 -0
  54. package/dist/Calendar/YearsLevel.d.ts +3 -0
  55. package/dist/Calendar/YearsLevel.es.js +25 -0
  56. package/dist/Calendar/helpers.cjs.js +60 -0
  57. package/dist/Calendar/helpers.d.ts +9 -0
  58. package/dist/Calendar/helpers.es.js +60 -0
  59. package/dist/Calendar/index.d.ts +2 -0
  60. package/dist/Calendar/styles.cjs.js +116 -0
  61. package/dist/Calendar/styles.d.ts +16 -0
  62. package/dist/Calendar/styles.es.js +116 -0
  63. package/dist/Calendar/types.d.ts +115 -0
  64. package/dist/Card/Card.cjs.js +4 -2
  65. package/dist/Card/Card.d.ts +1 -1
  66. package/dist/Card/Card.es.js +4 -2
  67. package/dist/Card/styles.cjs.js +2 -2
  68. package/dist/Card/styles.es.js +2 -2
  69. package/dist/Card/types.d.ts +2 -0
  70. package/dist/Checkbox/Checkbox.cjs.js +1 -1
  71. package/dist/Checkbox/Checkbox.es.js +1 -1
  72. package/dist/Checkbox/CheckboxGroup.cjs.js +22 -25
  73. package/dist/Checkbox/CheckboxGroup.es.js +22 -25
  74. package/dist/Checkbox/styles.cjs.js +24 -23
  75. package/dist/Checkbox/styles.es.js +24 -23
  76. package/dist/ColorPicker/ColorPicker.cjs.js +404 -0
  77. package/dist/ColorPicker/ColorPicker.d.ts +3 -0
  78. package/dist/ColorPicker/ColorPicker.es.js +405 -0
  79. package/dist/ColorPicker/InputColor.cjs.js +94 -0
  80. package/dist/ColorPicker/InputColor.d.ts +3 -0
  81. package/dist/ColorPicker/InputColor.es.js +95 -0
  82. package/dist/ColorPicker/InputsColor.cjs.js +177 -0
  83. package/dist/ColorPicker/InputsColor.d.ts +3 -0
  84. package/dist/ColorPicker/InputsColor.es.js +178 -0
  85. package/dist/ColorPicker/helpers.cjs.js +32 -0
  86. package/dist/ColorPicker/helpers.d.ts +4 -0
  87. package/dist/ColorPicker/helpers.es.js +32 -0
  88. package/dist/ColorPicker/index.cjs.js +7 -0
  89. package/dist/ColorPicker/index.d.ts +8 -0
  90. package/dist/ColorPicker/index.es.js +7 -0
  91. package/dist/ColorPicker/styles.cjs.js +234 -0
  92. package/dist/ColorPicker/styles.d.ts +43 -0
  93. package/dist/ColorPicker/styles.es.js +234 -0
  94. package/dist/ColorPicker/types.d.ts +56 -0
  95. package/dist/Divider/styles.cjs.js +12 -10
  96. package/dist/Divider/styles.es.js +12 -10
  97. package/dist/Drawer/Drawer.cjs.js +5 -1
  98. package/dist/Drawer/Drawer.es.js +5 -1
  99. package/dist/Drawer/styles.cjs.js +4 -5
  100. package/dist/Drawer/styles.es.js +4 -5
  101. package/dist/Dropdown/Dropdown.cjs.js +31 -2
  102. package/dist/Dropdown/Dropdown.d.ts +2 -2
  103. package/dist/Dropdown/Dropdown.es.js +32 -3
  104. package/dist/Dropdown/DropdownItem.cjs.js +4 -5
  105. package/dist/Dropdown/DropdownItem.es.js +4 -5
  106. package/dist/Dropdown/DropdownList.cjs.js +3 -2
  107. package/dist/Dropdown/DropdownList.es.js +6 -5
  108. package/dist/Dropdown/DropdownPortal.cjs.js +8 -5
  109. package/dist/Dropdown/DropdownPortal.d.ts +5 -3
  110. package/dist/Dropdown/DropdownPortal.es.js +9 -6
  111. package/dist/Dropdown/helpers.cjs.js +1 -1
  112. package/dist/Dropdown/helpers.es.js +1 -1
  113. package/dist/Dropdown/styles.cjs.js +28 -27
  114. package/dist/Dropdown/styles.d.ts +2 -0
  115. package/dist/Dropdown/styles.es.js +28 -27
  116. package/dist/EmptyState/EmptyState.cjs.js +51 -0
  117. package/dist/EmptyState/EmptyState.d.ts +3 -0
  118. package/dist/EmptyState/EmptyState.es.js +52 -0
  119. package/dist/EmptyState/index.d.ts +2 -0
  120. package/dist/EmptyState/types.d.ts +10 -0
  121. package/dist/Flex/Flex.d.ts +1 -1
  122. package/dist/Flex/types.d.ts +1 -0
  123. package/dist/Form/Field.cjs.js +175 -0
  124. package/dist/Form/Field.d.ts +3 -0
  125. package/dist/Form/Field.es.js +176 -0
  126. package/dist/Form/FieldArray.cjs.js +24 -0
  127. package/dist/Form/FieldArray.d.ts +3 -0
  128. package/dist/Form/FieldArray.es.js +25 -0
  129. package/dist/Form/Form.cjs.js +69 -0
  130. package/dist/Form/Form.d.ts +3 -0
  131. package/dist/Form/Form.es.js +69 -0
  132. package/dist/Form/defaultValidateMessages.cjs.js +51 -0
  133. package/dist/Form/defaultValidateMessages.d.ts +47 -0
  134. package/dist/Form/defaultValidateMessages.es.js +51 -0
  135. package/dist/Form/helpers.cjs.js +8 -0
  136. package/dist/Form/helpers.d.ts +1 -0
  137. package/dist/Form/helpers.es.js +8 -0
  138. package/dist/Form/index.cjs.js +13 -0
  139. package/dist/Form/index.d.ts +14 -0
  140. package/dist/Form/index.es.js +13 -0
  141. package/dist/Form/types.d.ts +147 -0
  142. package/dist/Form/useForm.cjs.js +230 -0
  143. package/dist/Form/useForm.d.ts +2 -0
  144. package/dist/Form/useForm.es.js +230 -0
  145. package/dist/Form/useWatch.cjs.js +14 -0
  146. package/dist/Form/useWatch.d.ts +3 -0
  147. package/dist/Form/useWatch.es.js +14 -0
  148. package/dist/Highlight/Highlight.cjs.js +113 -0
  149. package/dist/Highlight/Highlight.d.ts +3 -0
  150. package/dist/Highlight/Highlight.es.js +114 -0
  151. package/dist/Highlight/helpers.cjs.js +147 -0
  152. package/dist/Highlight/helpers.d.ts +27 -0
  153. package/dist/Highlight/helpers.es.js +147 -0
  154. package/dist/Highlight/index.d.ts +2 -0
  155. package/dist/Highlight/styles.cjs.js +11 -0
  156. package/dist/Highlight/styles.d.ts +4 -0
  157. package/dist/Highlight/styles.es.js +11 -0
  158. package/dist/Highlight/types.d.ts +53 -0
  159. package/dist/Image/styles.cjs.js +4 -5
  160. package/dist/Image/styles.es.js +4 -5
  161. package/dist/InputBase/InputBase.cjs.js +32 -0
  162. package/dist/InputBase/InputBase.d.ts +4 -0
  163. package/dist/InputBase/InputBase.es.js +33 -0
  164. package/dist/InputBase/index.d.ts +2 -0
  165. package/dist/InputBase/styles.cjs.js +61 -0
  166. package/dist/InputBase/styles.d.ts +7 -0
  167. package/dist/InputBase/styles.es.js +61 -0
  168. package/dist/InputBase/types.d.ts +25 -0
  169. package/dist/InputDate/InputDate.cjs.js +344 -0
  170. package/dist/InputDate/InputDate.d.ts +4 -0
  171. package/dist/InputDate/InputDate.es.js +345 -0
  172. package/dist/InputDate/helpers.cjs.js +78 -0
  173. package/dist/InputDate/helpers.d.ts +5 -0
  174. package/dist/InputDate/helpers.es.js +78 -0
  175. package/dist/InputDate/index.d.ts +2 -0
  176. package/dist/InputDate/styles.cjs.js +35 -0
  177. package/dist/InputDate/styles.d.ts +5 -0
  178. package/dist/InputDate/styles.es.js +35 -0
  179. package/dist/InputDate/types.d.ts +23 -0
  180. package/dist/InputNumber/InputNumber.cjs.js +70 -73
  181. package/dist/InputNumber/InputNumber.d.ts +1 -1
  182. package/dist/InputNumber/InputNumber.es.js +72 -75
  183. package/dist/InputNumber/styles.cjs.js +20 -60
  184. package/dist/InputNumber/styles.d.ts +4 -8
  185. package/dist/InputNumber/styles.es.js +21 -61
  186. package/dist/InputNumber/types.d.ts +2 -18
  187. package/dist/Layout/Header.cjs.js +27 -23
  188. package/dist/Layout/Header.d.ts +1 -1
  189. package/dist/Layout/Header.es.js +28 -24
  190. package/dist/Layout/Sidebar.cjs.js +24 -25
  191. package/dist/Layout/Sidebar.d.ts +1 -1
  192. package/dist/Layout/Sidebar.es.js +25 -26
  193. package/dist/Layout/index.d.ts +2 -2
  194. package/dist/Layout/styles.cjs.js +16 -52
  195. package/dist/Layout/styles.d.ts +2 -15
  196. package/dist/Layout/styles.es.js +16 -52
  197. package/dist/Layout/types.d.ts +7 -22
  198. package/dist/Loader/styles.cjs.js +5 -4
  199. package/dist/Loader/styles.es.js +5 -4
  200. package/dist/LoadingOverlay/LoadingOverlay.cjs.js +22 -0
  201. package/dist/LoadingOverlay/LoadingOverlay.d.ts +3 -0
  202. package/dist/LoadingOverlay/LoadingOverlay.es.js +23 -0
  203. package/dist/LoadingOverlay/index.d.ts +2 -0
  204. package/dist/LoadingOverlay/styles.cjs.js +28 -0
  205. package/dist/LoadingOverlay/styles.d.ts +5 -0
  206. package/dist/LoadingOverlay/styles.es.js +28 -0
  207. package/dist/LoadingOverlay/types.d.ts +16 -0
  208. package/dist/Menu/Menu.cjs.js +42 -0
  209. package/dist/Menu/Menu.d.ts +3 -0
  210. package/dist/Menu/Menu.es.js +43 -0
  211. package/dist/Menu/MenuItem.cjs.js +112 -0
  212. package/dist/Menu/MenuItem.d.ts +3 -0
  213. package/dist/Menu/MenuItem.es.js +113 -0
  214. package/dist/Menu/helpers.cjs.js +20 -0
  215. package/dist/Menu/helpers.d.ts +17 -0
  216. package/dist/Menu/helpers.es.js +20 -0
  217. package/dist/Menu/index.d.ts +2 -0
  218. package/dist/Menu/styles.cjs.js +98 -0
  219. package/dist/Menu/styles.d.ts +16 -0
  220. package/dist/Menu/styles.es.js +98 -0
  221. package/dist/Menu/types.d.ts +85 -0
  222. package/dist/Modal/Modal.cjs.js +15 -5
  223. package/dist/Modal/Modal.d.ts +1 -1
  224. package/dist/Modal/Modal.es.js +16 -6
  225. package/dist/Modal/styles.cjs.js +39 -9
  226. package/dist/Modal/styles.d.ts +4 -0
  227. package/dist/Modal/styles.es.js +40 -10
  228. package/dist/Modal/types.d.ts +2 -0
  229. package/dist/Notification/Notification.cjs.js +3 -3
  230. package/dist/Notification/Notification.es.js +3 -3
  231. package/dist/Notification/NotificationInstance.cjs.js +8 -15
  232. package/dist/Notification/NotificationInstance.es.js +8 -15
  233. package/dist/Notification/NotificationsStore.cjs.js +2 -7
  234. package/dist/Notification/NotificationsStore.es.js +2 -7
  235. package/dist/Notification/styles.cjs.js +6 -6
  236. package/dist/Notification/styles.es.js +6 -6
  237. package/dist/Pagination/Pagination.cjs.js +114 -0
  238. package/dist/Pagination/Pagination.d.ts +3 -0
  239. package/dist/Pagination/Pagination.es.js +115 -0
  240. package/dist/Pagination/index.d.ts +2 -0
  241. package/dist/Pagination/styles.cjs.js +54 -0
  242. package/dist/Pagination/styles.d.ts +2 -0
  243. package/dist/Pagination/styles.es.js +54 -0
  244. package/dist/Pagination/types.d.ts +49 -0
  245. package/dist/Progress/Progress.cjs.js +1 -1
  246. package/dist/Progress/Progress.es.js +1 -1
  247. package/dist/Progress/styles.cjs.js +5 -50
  248. package/dist/Progress/styles.es.js +5 -50
  249. package/dist/Progress/types.d.ts +1 -0
  250. package/dist/RadioButton/RadioButton.cjs.js +1 -1
  251. package/dist/RadioButton/RadioButton.es.js +1 -1
  252. package/dist/RadioButton/RadioButtonGroup.cjs.js +19 -22
  253. package/dist/RadioButton/RadioButtonGroup.es.js +19 -22
  254. package/dist/RadioButton/styles.cjs.js +11 -13
  255. package/dist/RadioButton/styles.es.js +11 -13
  256. package/dist/RichTextEditor/RichTextEditor.cjs.js +289 -0
  257. package/dist/RichTextEditor/RichTextEditor.d.ts +4 -0
  258. package/dist/RichTextEditor/RichTextEditor.es.js +290 -0
  259. package/dist/RichTextEditor/RichTextEditorColorControl.cjs.js +38 -0
  260. package/dist/RichTextEditor/RichTextEditorColorControl.d.ts +3 -0
  261. package/dist/RichTextEditor/RichTextEditorColorControl.es.js +39 -0
  262. package/dist/RichTextEditor/RichTextEditorTableControl.cjs.js +62 -0
  263. package/dist/RichTextEditor/RichTextEditorTableControl.d.ts +3 -0
  264. package/dist/RichTextEditor/RichTextEditorTableControl.es.js +63 -0
  265. package/dist/RichTextEditor/helpers.cjs.js +151 -0
  266. package/dist/RichTextEditor/helpers.d.ts +10 -0
  267. package/dist/RichTextEditor/helpers.es.js +151 -0
  268. package/dist/RichTextEditor/index.d.ts +2 -0
  269. package/dist/RichTextEditor/plugins.cjs.js +548 -0
  270. package/dist/RichTextEditor/plugins.d.ts +2 -0
  271. package/dist/RichTextEditor/plugins.es.js +548 -0
  272. package/dist/RichTextEditor/styles.cjs.js +60 -0
  273. package/dist/RichTextEditor/styles.d.ts +7 -0
  274. package/dist/RichTextEditor/styles.es.js +60 -0
  275. package/dist/RichTextEditor/types.d.ts +79 -0
  276. package/dist/Select/Select.cjs.js +30 -18
  277. package/dist/Select/Select.es.js +30 -18
  278. package/dist/Select/helpers.cjs.js +1 -1
  279. package/dist/Select/helpers.d.ts +24 -24
  280. package/dist/Select/helpers.es.js +1 -1
  281. package/dist/Select/styles.cjs.js +91 -118
  282. package/dist/Select/styles.d.ts +4 -5
  283. package/dist/Select/styles.es.js +91 -118
  284. package/dist/Select/types.d.ts +3 -23
  285. package/dist/Select/useSelect.cjs.js +8 -14
  286. package/dist/Select/useSelect.d.ts +20 -20
  287. package/dist/Select/useSelect.es.js +8 -14
  288. package/dist/Skeleton/Skeleton.cjs.js +35 -0
  289. package/dist/Skeleton/Skeleton.d.ts +3 -0
  290. package/dist/Skeleton/Skeleton.es.js +36 -0
  291. package/dist/Skeleton/SkeletonAvatar.cjs.js +17 -0
  292. package/dist/Skeleton/SkeletonAvatar.d.ts +3 -0
  293. package/dist/Skeleton/SkeletonAvatar.es.js +18 -0
  294. package/dist/Skeleton/SkeletonButton.cjs.js +21 -0
  295. package/dist/Skeleton/SkeletonButton.d.ts +3 -0
  296. package/dist/Skeleton/SkeletonButton.es.js +22 -0
  297. package/dist/Skeleton/SkeletonCard.cjs.js +15 -0
  298. package/dist/Skeleton/SkeletonCard.d.ts +3 -0
  299. package/dist/Skeleton/SkeletonCard.es.js +16 -0
  300. package/dist/Skeleton/SkeletonLayout.cjs.js +60 -0
  301. package/dist/Skeleton/SkeletonLayout.d.ts +3 -0
  302. package/dist/Skeleton/SkeletonLayout.es.js +61 -0
  303. package/dist/Skeleton/SkeletonList.cjs.js +39 -0
  304. package/dist/Skeleton/SkeletonList.d.ts +3 -0
  305. package/dist/Skeleton/SkeletonList.es.js +40 -0
  306. package/dist/Skeleton/SkeletonTextBlock.cjs.js +7 -0
  307. package/dist/Skeleton/SkeletonTextBlock.d.ts +5 -0
  308. package/dist/Skeleton/SkeletonTextBlock.es.js +8 -0
  309. package/dist/Skeleton/index.cjs.js +17 -0
  310. package/dist/Skeleton/index.d.ts +18 -0
  311. package/dist/Skeleton/index.es.js +17 -0
  312. package/dist/Skeleton/styles.cjs.js +59 -0
  313. package/dist/Skeleton/styles.d.ts +3 -0
  314. package/dist/Skeleton/styles.es.js +59 -0
  315. package/dist/Skeleton/types.d.ts +74 -0
  316. package/dist/Slider/Slider.cjs.js +282 -0
  317. package/dist/Slider/Slider.d.ts +3 -0
  318. package/dist/Slider/Slider.es.js +283 -0
  319. package/dist/Slider/index.d.ts +2 -0
  320. package/dist/Slider/styles.cjs.js +156 -0
  321. package/dist/Slider/styles.d.ts +35 -0
  322. package/dist/Slider/styles.es.js +156 -0
  323. package/dist/Slider/types.d.ts +53 -0
  324. package/dist/Spoiler/Spoiler.cjs.js +62 -0
  325. package/dist/Spoiler/Spoiler.d.ts +3 -0
  326. package/dist/Spoiler/Spoiler.es.js +63 -0
  327. package/dist/Spoiler/index.d.ts +2 -0
  328. package/dist/Spoiler/styles.cjs.js +15 -0
  329. package/dist/Spoiler/styles.d.ts +4 -0
  330. package/dist/Spoiler/styles.es.js +15 -0
  331. package/dist/Spoiler/types.d.ts +23 -0
  332. package/dist/Switch/Switch.cjs.js +32 -6
  333. package/dist/Switch/Switch.d.ts +2 -2
  334. package/dist/Switch/Switch.es.js +33 -7
  335. package/dist/Switch/styles.cjs.js +24 -7
  336. package/dist/Switch/styles.d.ts +4 -0
  337. package/dist/Switch/styles.es.js +24 -7
  338. package/dist/Switch/types.d.ts +3 -0
  339. package/dist/Tabs/Tab.cjs.js +8 -8
  340. package/dist/Tabs/Tab.es.js +8 -8
  341. package/dist/Tabs/TabPanel.cjs.js +3 -3
  342. package/dist/Tabs/TabPanel.es.js +3 -3
  343. package/dist/Tabs/Tabs.cjs.js +5 -4
  344. package/dist/Tabs/Tabs.d.ts +1 -1
  345. package/dist/Tabs/Tabs.es.js +5 -4
  346. package/dist/Tabs/TabsList.cjs.js +25 -1
  347. package/dist/Tabs/TabsList.d.ts +2 -2
  348. package/dist/Tabs/TabsList.es.js +25 -1
  349. package/dist/Tabs/styles.cjs.js +104 -34
  350. package/dist/Tabs/styles.d.ts +2 -0
  351. package/dist/Tabs/styles.es.js +104 -34
  352. package/dist/Tabs/types.d.ts +7 -3
  353. package/dist/Tag/Tag.cjs.js +4 -1
  354. package/dist/Tag/Tag.d.ts +1 -1
  355. package/dist/Tag/Tag.es.js +4 -1
  356. package/dist/Tag/styles.cjs.js +14 -9
  357. package/dist/Tag/styles.d.ts +2 -0
  358. package/dist/Tag/styles.es.js +14 -9
  359. package/dist/Tag/types.d.ts +6 -0
  360. package/dist/TextField/TextField.cjs.js +57 -56
  361. package/dist/TextField/TextField.d.ts +1 -1
  362. package/dist/TextField/TextField.es.js +58 -57
  363. package/dist/TextField/styles.cjs.js +9 -50
  364. package/dist/TextField/styles.d.ts +3 -8
  365. package/dist/TextField/styles.es.js +10 -51
  366. package/dist/TextField/types.d.ts +2 -20
  367. package/dist/Textarea/Textarea.cjs.js +57 -56
  368. package/dist/Textarea/Textarea.d.ts +1 -1
  369. package/dist/Textarea/Textarea.es.js +58 -57
  370. package/dist/Textarea/styles.cjs.js +10 -62
  371. package/dist/Textarea/styles.d.ts +3 -8
  372. package/dist/Textarea/styles.es.js +12 -64
  373. package/dist/Textarea/types.d.ts +2 -21
  374. package/dist/Tooltip/Tooltip.cjs.js +3 -1
  375. package/dist/Tooltip/Tooltip.d.ts +1 -1
  376. package/dist/Tooltip/Tooltip.es.js +3 -1
  377. package/dist/Tooltip/types.d.ts +3 -0
  378. package/dist/assets/box.svg.cjs.js +21 -0
  379. package/dist/assets/box.svg.es.js +5 -0
  380. package/dist/index.cjs.js +30 -0
  381. package/dist/index.d.ts +17 -2
  382. package/dist/index.es.js +30 -0
  383. package/dist/message/Message.cjs.js +42 -0
  384. package/dist/message/Message.d.ts +3 -0
  385. package/dist/message/Message.es.js +43 -0
  386. package/dist/message/MessageContext.cjs.js +101 -0
  387. package/dist/message/MessageContext.d.ts +4 -0
  388. package/dist/message/MessageContext.es.js +101 -0
  389. package/dist/message/index.cjs.js +8 -0
  390. package/dist/message/index.d.ts +6 -0
  391. package/dist/message/index.es.js +8 -0
  392. package/dist/message/styles.cjs.js +79 -0
  393. package/dist/message/styles.d.ts +11 -0
  394. package/dist/message/styles.es.js +79 -0
  395. package/dist/message/types.d.ts +42 -0
  396. package/dist/typography/Text/Text.es.js +3 -3
  397. package/dist/typography/Title/Title.cjs.js +2 -0
  398. package/dist/typography/Title/Title.d.ts +1 -1
  399. package/dist/typography/Title/Title.es.js +2 -0
  400. package/dist/typography/Title/styles.cjs.js +3 -0
  401. package/dist/typography/Title/styles.es.js +3 -0
  402. package/dist/typography/Title/types.d.ts +1 -0
  403. package/package.json +17 -13
@@ -0,0 +1,43 @@
1
+ import { TQuenSize } from '../types/size';
2
+ import { TColorValue } from './types';
3
+ export declare const ColorPickerWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
+ size: TQuenSize;
5
+ }>> & string;
6
+ export declare const ColorPickerPanel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
7
+ size: TQuenSize;
8
+ }>> & string;
9
+ export declare const ColorPickerSaturationWrapStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
+ export declare const ColorPickerSaturationGradientStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
11
+ color: string;
12
+ }>> & string;
13
+ export declare const ColorPickerThumbStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
14
+ left?: number;
15
+ top?: number;
16
+ size: TQuenSize;
17
+ }>> & string;
18
+ export declare const ColorPickerSliderStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
19
+ size: TQuenSize;
20
+ }>> & string;
21
+ export declare const ColorPickerSliderTrackStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
22
+ bg: string;
23
+ }>> & string;
24
+ export declare const ColorPickerSliderHueTrackStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
25
+ export declare const ColorPickerSliderThumbStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
26
+ left?: number;
27
+ size: TQuenSize;
28
+ }>> & string;
29
+ export declare const ColorPickerPresetStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
30
+ color: string;
31
+ active?: boolean;
32
+ size: TQuenSize;
33
+ }>> & string;
34
+ export declare const ColorPickerPreviewSwatchStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
+ color: string;
36
+ size: TQuenSize;
37
+ isAlpha?: boolean;
38
+ hiddenInputs?: boolean;
39
+ }>> & string;
40
+ export declare const ColorPickerSwatchInputStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
41
+ color: TColorValue;
42
+ size: TQuenSize;
43
+ }>> & string;
@@ -0,0 +1,234 @@
1
+ import styled from "styled-components";
2
+ import { math, toColorString } from "polished";
3
+ const getSizeWrapper = (size) => {
4
+ switch (size) {
5
+ case "l":
6
+ return "26.25rem";
7
+ case "s":
8
+ return "15rem";
9
+ case "xs":
10
+ return "11.25rem";
11
+ case "m":
12
+ default:
13
+ return "20rem";
14
+ }
15
+ };
16
+ const getSizeThumb = (size) => {
17
+ switch (size) {
18
+ case "xs":
19
+ return "0.625rem";
20
+ case "s":
21
+ return "0.75rem";
22
+ case "l":
23
+ return "1.5rem";
24
+ case "m":
25
+ default:
26
+ return "1rem";
27
+ }
28
+ };
29
+ const getSizePreset = (size) => {
30
+ switch (size) {
31
+ case "xs":
32
+ return "1.375rem";
33
+ case "s":
34
+ return "1.625rem";
35
+ case "l":
36
+ return "2.5rem";
37
+ case "m":
38
+ default:
39
+ return "2rem";
40
+ }
41
+ };
42
+ const getSizeSlider = (size) => {
43
+ switch (size) {
44
+ case "xs":
45
+ return "0.75rem";
46
+ case "s":
47
+ return "1rem";
48
+ case "l":
49
+ return "1.5rem";
50
+ case "m":
51
+ default:
52
+ return "1.25rem";
53
+ }
54
+ };
55
+ const getHeightPreview = (size, hideInputs, isAlpha) => {
56
+ if (isAlpha === false && !hideInputs) {
57
+ return math(
58
+ `${getSizeSlider(size)} * 2 + 0.75rem + 0.875rem`
59
+ );
60
+ }
61
+ if (!isAlpha && hideInputs) {
62
+ return math(
63
+ `${getSizeSlider(size)} + 0.25rem`
64
+ );
65
+ }
66
+ return math(
67
+ `${getSizeSlider(size)} * 2 + 0.75rem`
68
+ );
69
+ };
70
+ const getSizeSwatchInput = (size) => {
71
+ switch (size) {
72
+ case "m":
73
+ default:
74
+ return math(`2.5rem - 0.75rem`);
75
+ }
76
+ };
77
+ const ColorPickerWrapper = styled.div`
78
+ width: ${({ size }) => getSizeWrapper(size)};
79
+ user-select: none;
80
+ `;
81
+ const ColorPickerPanel = styled.div.withConfig({
82
+ shouldForwardProp: (prop) => !["size"].includes(prop)
83
+ })`
84
+ background: ${({ theme }) => theme.components.ColorPicker.background};
85
+ border-radius: ${({ theme }) => theme.components.ColorPicker.radius};
86
+ padding: ${({ theme, size }) => theme.components.ColorPicker.padding[size]};
87
+ border: 1px solid ${({ theme }) => theme.components.ColorPicker.borderColor};
88
+ display: flex;
89
+ flex-direction: column;
90
+ gap: 0.75rem;
91
+ `;
92
+ const ColorPickerSaturationWrapStyled = styled.div`
93
+ position: relative;
94
+ width: 100%;
95
+ padding-top: 56%;
96
+ border-radius: 6px;
97
+ overflow: hidden;
98
+ touch-action: none;
99
+ `;
100
+ const ColorPickerSaturationGradientStyled = styled.div.withConfig({
101
+ shouldForwardProp: (prop) => !["color"].includes(prop)
102
+ })`
103
+ position: absolute;
104
+ inset: 0;
105
+ background: ${({ color }) => `linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0)), linear-gradient(to right, #fff, ${color})`};
106
+ `;
107
+ const ColorPickerThumbStyled = styled.div.withConfig({
108
+ shouldForwardProp: (prop) => !["left", "top", "size"].includes(prop)
109
+ })`
110
+ position: absolute;
111
+ border-radius: 50%;
112
+ border: 2px solid ${({ theme }) => theme.components.ColorPicker.borderColor};
113
+ width: ${({ size }) => getSizeThumb(size)};
114
+ height: ${({ size }) => getSizeThumb(size)};
115
+ left: ${({ left }) => left}%;
116
+ top: ${({ top }) => top}%;
117
+ transform: translate(-50%, -50%);
118
+ `;
119
+ const ColorPickerSliderStyled = styled.div.withConfig({
120
+ shouldForwardProp: (prop) => !["size"].includes(prop)
121
+ })`
122
+ position: relative;
123
+ height: ${({ size }) => getSizeSlider(size)};
124
+ border-radius: 6px;
125
+ cursor: pointer;
126
+ background-image: conic-gradient(
127
+ rgba(0, 0, 0, 0.6) 25%,
128
+ transparent 25% 50%,
129
+ rgba(0, 0, 0, 0.6) 50% 75%,
130
+ transparent 75% 100%
131
+ );
132
+ background-size: 8px 8px;
133
+ `;
134
+ const ColorPickerSliderTrackStyled = styled.div.withConfig({
135
+ shouldForwardProp: (prop) => !["bg"].includes(prop)
136
+ })`
137
+ width: 100%;
138
+ height: 100%;
139
+ border-radius: inherit;
140
+ background: ${({ bg }) => bg};
141
+ `;
142
+ const ColorPickerSliderHueTrackStyled = styled.div`
143
+ width: 100%;
144
+ height: 100%;
145
+ border-radius: inherit;
146
+ background: linear-gradient(
147
+ to right,
148
+ #f00 0%,
149
+ #ff0 17%,
150
+ #0f0 34%,
151
+ #0ff 50%,
152
+ #00f 67%,
153
+ #f0f 83%,
154
+ #f00 100%
155
+ );
156
+ `;
157
+ const ColorPickerSliderThumbStyled = styled.div.withConfig({
158
+ shouldForwardProp: (prop) => !["left", "size"].includes(prop)
159
+ })`
160
+ position: absolute;
161
+ top: 50%;
162
+ transform: translate(-50%, -50%);
163
+ width: ${({ size }) => getSizeSlider(size)};
164
+ height: ${({ size }) => getSizeSlider(size)};
165
+ border-radius: 50%;
166
+ border: 2px solid ${({ theme }) => theme.components.ColorPicker.borderColor};
167
+ left: ${({ left }) => left ?? 0}%;
168
+ `;
169
+ const ColorPickerPresetStyled = styled.button.withConfig({
170
+ shouldForwardProp: (prop) => !["color", "active", "size"].includes(prop)
171
+ })`
172
+ width: ${({ size }) => getSizePreset(size)};
173
+ height: ${({ size }) => getSizePreset(size)};
174
+ border-radius: ${({ theme }) => theme.components.ColorPicker.radius};
175
+ border: ${({ active, theme }) => active ? `2px solid ${theme.components.ColorPicker.borderColor}` : "none"};
176
+ background: ${({ color }) => color};
177
+ cursor: pointer;
178
+ `;
179
+ const ColorPickerPreviewSwatchStyled = styled.div.withConfig({
180
+ shouldForwardProp: (prop) => !["color", "size", "isAlpha", "hiddenInputs"].includes(prop)
181
+ })`
182
+ min-width: ${({ size }) => size === "xs" ? "100%" : math(`${getSizeSlider(size)} * 2`)};
183
+ height: ${({ size, isAlpha, hiddenInputs }) => getHeightPreview(size, hiddenInputs, isAlpha)};
184
+ border-radius: ${({ theme }) => theme.components.ColorPicker.radius};
185
+ border: 1px solid ${({ theme }) => theme.components.ColorPicker.borderColor};
186
+ background-image: conic-gradient(
187
+ rgba(0, 0, 0, 0.6) 25%,
188
+ transparent 25% 50%,
189
+ rgba(0, 0, 0, 0.6) 50% 75%,
190
+ transparent 75% 100%
191
+ );
192
+ background-size: ${({ size }) => size === "xs" ? "8px 8px" : "50% 50%"};
193
+
194
+ .quen-ui__color-picker__preview-swatch__inner {
195
+ width: 100%;
196
+ height: 100%;
197
+ background: ${({ color }) => color};
198
+ }
199
+ `;
200
+ const ColorPickerSwatchInputStyled = styled.div.withConfig({
201
+ shouldForwardProp: (prop) => !["size", "color"].includes(prop)
202
+ })`
203
+ border: 1px solid ${({ theme }) => theme.components.ColorPicker.borderColor};
204
+ background-image: conic-gradient(
205
+ rgba(0, 0, 0, 0.6) 25%,
206
+ transparent 25% 50%,
207
+ rgba(0, 0, 0, 0.6) 50% 75%,
208
+ transparent 75% 100%
209
+ );
210
+ background-size: 8px 8px;
211
+ width: ${({ size }) => getSizeSwatchInput(size)};
212
+ height: ${({ size }) => getSizeSwatchInput(size)};
213
+
214
+ .quen-ui__color-picker__swatch-input__inner {
215
+ background: ${({ color }) => typeof color === "string" || !color ? color : toColorString(color)};
216
+ width: 100%;
217
+ height: 100%;
218
+ display: block;
219
+ }
220
+ `;
221
+ export {
222
+ ColorPickerPanel,
223
+ ColorPickerPresetStyled,
224
+ ColorPickerPreviewSwatchStyled,
225
+ ColorPickerSaturationGradientStyled,
226
+ ColorPickerSaturationWrapStyled,
227
+ ColorPickerSliderHueTrackStyled,
228
+ ColorPickerSliderStyled,
229
+ ColorPickerSliderThumbStyled,
230
+ ColorPickerSliderTrackStyled,
231
+ ColorPickerSwatchInputStyled,
232
+ ColorPickerThumbStyled,
233
+ ColorPickerWrapper
234
+ };
@@ -0,0 +1,56 @@
1
+ import { CSSProperties } from 'react';
2
+ import { HslColor, HslaColor, RgbColor, RgbaColor } from 'polished/lib/types/color';
3
+ import { TQuenSize } from '../types/size';
4
+ import { ITextFieldProps } from '../TextField';
5
+ export type TColorFormat = "hex" | "hexa" | "rgb" | "rgba" | "hsl" | "hsla";
6
+ export type TRgbColor = RgbColor | RgbaColor;
7
+ export type THslColor = HslColor | HslaColor;
8
+ export type TColorValue = string | TRgbColor | THslColor;
9
+ export interface IBaseColorPickerProps {
10
+ /** Controlled color value */
11
+ value?: TColorValue;
12
+ /** Uncontrolled initial color value */
13
+ defaultValue?: TColorValue;
14
+ /** Triggered continuously as user interacts */
15
+ onChange?: (color: TColorValue) => void;
16
+ /** Triggered when user stops dragging / completes selection */
17
+ onChangeComplete?: (color: TColorValue) => void;
18
+ /** Output color format */
19
+ format?: TColorFormat;
20
+ /** Disables color picker interactions */
21
+ disabled?: boolean;
22
+ /** Size of component */
23
+ size?: TQuenSize;
24
+ /** Custom class */
25
+ className?: string;
26
+ /** Inline styles */
27
+ style?: CSSProperties;
28
+ }
29
+ export interface IColorPickerProps extends IBaseColorPickerProps {
30
+ /** Pre-defined selectable colors */
31
+ presets?: Array<TColorValue>;
32
+ /** Hides the color format input fields */
33
+ hideInputs?: boolean;
34
+ /** Hides the preset swatches section */
35
+ hidePresets?: boolean;
36
+ }
37
+ export interface IInputsColorProps {
38
+ format: TColorFormat;
39
+ onChangeHex: (color: string) => void;
40
+ onBlur: () => void;
41
+ size: TQuenSize;
42
+ onChangeRGB: (color: TRgbColor) => void;
43
+ hsl: THslColor;
44
+ onChangeHSL: (color: THslColor) => void;
45
+ disabled?: boolean;
46
+ }
47
+ export type TInputColorProps = Pick<IColorPickerProps, "format" | "onChange" | "presets" | "hidePresets"> & Omit<ITextFieldProps, "onChange" | "leftContent"> & {
48
+ /** Controlled popover state */
49
+ open?: boolean;
50
+ /** Uncontrolled popover initial state */
51
+ defaultOpen?: boolean;
52
+ /** Triggered when the dropdown is opened/closed */
53
+ onOpenChange?: (open: boolean) => void;
54
+ /** Displays a small color preview square in the input */
55
+ showSwatch?: boolean;
56
+ };
@@ -17,11 +17,11 @@ const getDirectionStyles = ({
17
17
  }
18
18
 
19
19
  &::after {
20
- border-radius: 0 0.25rem 0.25rem 0;
20
+ border-radius: ${({ theme }) => `0 ${theme.components.Divider.radius} ${theme.components.Divider.radius} 0`};
21
21
  }
22
22
 
23
23
  &::before {
24
- border-radius: 0.25rem 0 0 0.25rem;
24
+ border-radius: ${({ theme }) => `${theme.components.Divider.radius} 0 0 ${theme.components.Divider.radius}`};
25
25
  }
26
26
  `;
27
27
  }
@@ -35,10 +35,10 @@ const getDirectionStyles = ({
35
35
  }
36
36
 
37
37
  &::after {
38
- border-radius: 0 0 0.25rem 0.25rem;
38
+ border-radius: ${({ theme }) => `0 0 ${theme.components.Divider.radius} ${theme.components.Divider.radius}`};
39
39
  }
40
40
  &::before {
41
- border-radius: 0.25rem 0.25rem 0 0;
41
+ border-radius: ${({ theme }) => `${theme.components.Divider.radius} ${theme.components.Divider.radius} 0 0`};
42
42
  }
43
43
  `;
44
44
  };
@@ -82,31 +82,33 @@ const getBackground = ({
82
82
  switch (view) {
83
83
  case "disabled":
84
84
  return styled.css`
85
- background-color: ${theme.colors.gray[9]};
85
+ background-color: ${theme.components.Divider.disabledBackground};
86
86
  `;
87
87
  case "danger":
88
88
  return styled.css`
89
- background-color: ${theme.colors.red[9]};
89
+ background-color: ${theme.components.Divider.dangerBackground};
90
90
  `;
91
91
  case "success":
92
92
  return styled.css`
93
- background-color: ${theme.colors.green[9]};
93
+ background-color: ${theme.components.Divider.successBackground};
94
94
  `;
95
95
  case "warning":
96
96
  return styled.css`
97
- background-color: ${theme.colors.orange[9]};
97
+ background-color: ${theme.components.Divider.warningBackground};
98
98
  `;
99
99
  case "primary":
100
100
  default:
101
101
  return styled.css`
102
- background-color: ${theme.colors.grayViolet[9]};
102
+ background-color: ${theme.components.Divider.primaryBackground};
103
103
  `;
104
104
  }
105
105
  }};
106
106
  }
107
107
  `;
108
108
  };
109
- const DividerStyled = styled.div`
109
+ const DividerStyled = styled.div.withConfig({
110
+ shouldForwardProp: (prop) => !["direction", "view"].includes(prop)
111
+ })`
110
112
  display: flex;
111
113
  align-items: center;
112
114
  ${({ children }) => Boolean(children) && "gap: 0.5rem"};
@@ -15,11 +15,11 @@ const getDirectionStyles = ({
15
15
  }
16
16
 
17
17
  &::after {
18
- border-radius: 0 0.25rem 0.25rem 0;
18
+ border-radius: ${({ theme }) => `0 ${theme.components.Divider.radius} ${theme.components.Divider.radius} 0`};
19
19
  }
20
20
 
21
21
  &::before {
22
- border-radius: 0.25rem 0 0 0.25rem;
22
+ border-radius: ${({ theme }) => `${theme.components.Divider.radius} 0 0 ${theme.components.Divider.radius}`};
23
23
  }
24
24
  `;
25
25
  }
@@ -33,10 +33,10 @@ const getDirectionStyles = ({
33
33
  }
34
34
 
35
35
  &::after {
36
- border-radius: 0 0 0.25rem 0.25rem;
36
+ border-radius: ${({ theme }) => `0 0 ${theme.components.Divider.radius} ${theme.components.Divider.radius}`};
37
37
  }
38
38
  &::before {
39
- border-radius: 0.25rem 0.25rem 0 0;
39
+ border-radius: ${({ theme }) => `${theme.components.Divider.radius} ${theme.components.Divider.radius} 0 0`};
40
40
  }
41
41
  `;
42
42
  };
@@ -80,31 +80,33 @@ const getBackground = ({
80
80
  switch (view) {
81
81
  case "disabled":
82
82
  return css`
83
- background-color: ${theme.colors.gray[9]};
83
+ background-color: ${theme.components.Divider.disabledBackground};
84
84
  `;
85
85
  case "danger":
86
86
  return css`
87
- background-color: ${theme.colors.red[9]};
87
+ background-color: ${theme.components.Divider.dangerBackground};
88
88
  `;
89
89
  case "success":
90
90
  return css`
91
- background-color: ${theme.colors.green[9]};
91
+ background-color: ${theme.components.Divider.successBackground};
92
92
  `;
93
93
  case "warning":
94
94
  return css`
95
- background-color: ${theme.colors.orange[9]};
95
+ background-color: ${theme.components.Divider.warningBackground};
96
96
  `;
97
97
  case "primary":
98
98
  default:
99
99
  return css`
100
- background-color: ${theme.colors.grayViolet[9]};
100
+ background-color: ${theme.components.Divider.primaryBackground};
101
101
  `;
102
102
  }
103
103
  }};
104
104
  }
105
105
  `;
106
106
  };
107
- const DividerStyled = styled.div`
107
+ const DividerStyled = styled.div.withConfig({
108
+ shouldForwardProp: (prop) => !["direction", "view"].includes(prop)
109
+ })`
108
110
  display: flex;
109
111
  align-items: center;
110
112
  ${({ children }) => Boolean(children) && "gap: 0.5rem"};
@@ -28,7 +28,11 @@ const Drawer = ({
28
28
  initialEntered: open
29
29
  });
30
30
  const refWrapper = React.useRef(null);
31
- hooks.useOnClickOutside(refWrapper, () => !noCloseOnClickOutside && (onClose == null ? void 0 : onClose()));
31
+ hooks.useOnClickOutside(refWrapper, () => {
32
+ if (open && !noCloseOnClickOutside) {
33
+ onClose?.();
34
+ }
35
+ });
32
36
  React.useEffect(() => {
33
37
  toggle(open);
34
38
  }, [open]);
@@ -27,7 +27,11 @@ const Drawer = ({
27
27
  initialEntered: open
28
28
  });
29
29
  const refWrapper = useRef(null);
30
- useOnClickOutside(refWrapper, () => !noCloseOnClickOutside && (onClose == null ? void 0 : onClose()));
30
+ useOnClickOutside(refWrapper, () => {
31
+ if (open && !noCloseOnClickOutside) {
32
+ onClose?.();
33
+ }
34
+ });
31
35
  useEffect(() => {
32
36
  toggle(open);
33
37
  }, [open]);
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const styled = require("styled-components");
4
- const polished = require("polished");
5
4
  const DrawerWrapper = styled.div`
6
5
  position: fixed;
7
6
  top: 0;
@@ -9,7 +8,7 @@ const DrawerWrapper = styled.div`
9
8
  right: 0;
10
9
  bottom: 0;
11
10
  z-index: ${({ zIndex }) => zIndex || 1e3};
12
- background: ${({ theme }) => polished.rgba(theme.colors.grayViolet[2], 0.7)};
11
+ background: ${({ theme }) => theme.components.Drawer.overlayBackground};
13
12
  `;
14
13
  const sizes = {
15
14
  xs: "240px",
@@ -58,16 +57,16 @@ const DrawerStyled = styled.div`
58
57
  max-height: 100vh;
59
58
  position: fixed;
60
59
  outline: 0;
61
- background: ${({ theme }) => theme.colors.grayViolet[2]};
60
+ background: ${({ theme }) => theme.components.Drawer.background};
62
61
 
63
62
  ${({ status }) => (status === "preEnter" || status === "exiting") && ` opacity: 0;
64
63
  transform: scale(0.5);
65
64
  `};
66
-
65
+
67
66
  display: flex;
68
67
  flex-direction: column;
69
68
  gap: ${({ theme }) => theme.space.xs};
70
-
69
+
71
70
  .quen-ui-drawer--content {
72
71
  padding: 0.5rem;
73
72
  overflow: auto;
@@ -1,5 +1,4 @@
1
1
  import styled, { css } from "styled-components";
2
- import { rgba } from "polished";
3
2
  const DrawerWrapper = styled.div`
4
3
  position: fixed;
5
4
  top: 0;
@@ -7,7 +6,7 @@ const DrawerWrapper = styled.div`
7
6
  right: 0;
8
7
  bottom: 0;
9
8
  z-index: ${({ zIndex }) => zIndex || 1e3};
10
- background: ${({ theme }) => rgba(theme.colors.grayViolet[2], 0.7)};
9
+ background: ${({ theme }) => theme.components.Drawer.overlayBackground};
11
10
  `;
12
11
  const sizes = {
13
12
  xs: "240px",
@@ -56,16 +55,16 @@ const DrawerStyled = styled.div`
56
55
  max-height: 100vh;
57
56
  position: fixed;
58
57
  outline: 0;
59
- background: ${({ theme }) => theme.colors.grayViolet[2]};
58
+ background: ${({ theme }) => theme.components.Drawer.background};
60
59
 
61
60
  ${({ status }) => (status === "preEnter" || status === "exiting") && ` opacity: 0;
62
61
  transform: scale(0.5);
63
62
  `};
64
-
63
+
65
64
  display: flex;
66
65
  flex-direction: column;
67
66
  gap: ${({ theme }) => theme.space.xs};
68
-
67
+
69
68
  .quen-ui-drawer--content {
70
69
  padding: 0.5rem;
71
70
  overflow: auto;
@@ -3,6 +3,7 @@ const jsxRuntime = require("react/jsx-runtime");
3
3
  const React = require("react");
4
4
  const reactDom = require("react-dom");
5
5
  const reactTransitionState = require("react-transition-state");
6
+ const hooks = require("@quen-ui/hooks");
6
7
  const styles = require("./styles.cjs.js");
7
8
  const DropdownPortal = require("./DropdownPortal.cjs.js");
8
9
  const helpers = require("./helpers.cjs.js");
@@ -12,20 +13,37 @@ const Dropdown = ({
12
13
  direction = "bottom",
13
14
  width,
14
15
  anchorRef,
16
+ onClickClose,
15
17
  ...props
16
18
  }) => {
17
19
  const [anchorRect, setAnchorRect] = React.useState(helpers.DEFAULT_RECT_ELEMENT);
20
+ const dropdownRef = React.useRef(null);
18
21
  const [containerDropdown, setContainerDropdown] = React.useState(null);
19
22
  const [state, toggle] = reactTransitionState.useTransitionState({
20
23
  timeout: 500,
21
24
  unmountOnExit: true,
22
25
  initialEntered: open
23
26
  });
27
+ hooks.useOnClickOutside(
28
+ anchorRef,
29
+ () => {
30
+ if (typeof open === "undefined") {
31
+ toggle(false);
32
+ onClickClose?.();
33
+ }
34
+ },
35
+ {
36
+ excludeRef: dropdownRef
37
+ }
38
+ );
24
39
  const calculateAnchorRect = () => {
25
40
  if (anchorRef && anchorRef.current) {
26
41
  setAnchorRect(helpers.calculateRectElement(anchorRef.current));
27
42
  }
28
43
  };
44
+ const handleClickAnchorRef = () => {
45
+ toggle();
46
+ };
29
47
  React.useEffect(() => {
30
48
  window.addEventListener("resize", calculateAnchorRect);
31
49
  window.addEventListener("scroll", calculateAnchorRect, true);
@@ -35,7 +53,17 @@ const Dropdown = ({
35
53
  };
36
54
  }, [anchorRect]);
37
55
  React.useEffect(() => {
38
- toggle(open);
56
+ if (typeof open === "undefined") {
57
+ anchorRef.current?.addEventListener("click", handleClickAnchorRef);
58
+ }
59
+ return () => {
60
+ anchorRef.current?.removeEventListener("click", handleClickAnchorRef);
61
+ };
62
+ }, [anchorRef]);
63
+ React.useEffect(() => {
64
+ if (typeof open !== "undefined") {
65
+ toggle(open);
66
+ }
39
67
  }, [open]);
40
68
  React.useLayoutEffect(() => {
41
69
  calculateAnchorRect();
@@ -56,7 +84,8 @@ const Dropdown = ({
56
84
  transitionStatus: state.status,
57
85
  anchorRef,
58
86
  anchorRect,
59
- width: width || "max-content"
87
+ width: width || "max-content",
88
+ ref: dropdownRef
60
89
  }
61
90
  ),
62
91
  containerDropdown
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { IDropdownProps } from './types';
3
- declare const Dropdown: <ITEM>({ disabled, open, direction, width, anchorRef, ...props }: IDropdownProps<ITEM>) => React.ReactNode;
3
+ declare const Dropdown: <ITEM>({ disabled, open, direction, width, anchorRef, onClickClose, ...props }: IDropdownProps<ITEM>) => ReactNode;
4
4
  export default Dropdown;