@quen-ui/components 0.0.13

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 (337) hide show
  1. package/README.md +43 -0
  2. package/dist/Alert/Alert.cjs.js +54 -0
  3. package/dist/Alert/Alert.d.ts +4 -0
  4. package/dist/Alert/Alert.es.js +55 -0
  5. package/dist/Alert/index.d.ts +2 -0
  6. package/dist/Alert/styles.cjs.js +90 -0
  7. package/dist/Alert/styles.d.ts +10 -0
  8. package/dist/Alert/styles.es.js +90 -0
  9. package/dist/Alert/types.d.ts +25 -0
  10. package/dist/Avatar/Avatar.cjs.js +65 -0
  11. package/dist/Avatar/Avatar.d.ts +4 -0
  12. package/dist/Avatar/Avatar.es.js +66 -0
  13. package/dist/Avatar/AvatarIcon.svg.cjs.js +21 -0
  14. package/dist/Avatar/AvatarIcon.svg.es.js +5 -0
  15. package/dist/Avatar/helpers.cjs.js +18 -0
  16. package/dist/Avatar/helpers.d.ts +1 -0
  17. package/dist/Avatar/helpers.es.js +18 -0
  18. package/dist/Avatar/index.d.ts +2 -0
  19. package/dist/Avatar/styles.cjs.js +31 -0
  20. package/dist/Avatar/styles.d.ts +9 -0
  21. package/dist/Avatar/styles.es.js +31 -0
  22. package/dist/Avatar/types.d.ts +31 -0
  23. package/dist/Badge/Badge.cjs.js +53 -0
  24. package/dist/Badge/Badge.d.ts +4 -0
  25. package/dist/Badge/Badge.es.js +54 -0
  26. package/dist/Badge/index.d.ts +3 -0
  27. package/dist/Badge/styles.cjs.js +70 -0
  28. package/dist/Badge/styles.d.ts +7 -0
  29. package/dist/Badge/styles.es.js +70 -0
  30. package/dist/Badge/types.cjs.js +10 -0
  31. package/dist/Badge/types.d.ts +22 -0
  32. package/dist/Badge/types.es.js +10 -0
  33. package/dist/Breadcrumbs/BreadcrumbItem.cjs.js +42 -0
  34. package/dist/Breadcrumbs/BreadcrumbItem.d.ts +4 -0
  35. package/dist/Breadcrumbs/BreadcrumbItem.es.js +43 -0
  36. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +48 -0
  37. package/dist/Breadcrumbs/Breadcrumbs.d.ts +4 -0
  38. package/dist/Breadcrumbs/Breadcrumbs.es.js +49 -0
  39. package/dist/Breadcrumbs/helpers.cjs.js +18 -0
  40. package/dist/Breadcrumbs/helpers.d.ts +16 -0
  41. package/dist/Breadcrumbs/helpers.es.js +18 -0
  42. package/dist/Breadcrumbs/index.d.ts +2 -0
  43. package/dist/Breadcrumbs/styles.cjs.js +50 -0
  44. package/dist/Breadcrumbs/styles.d.ts +4 -0
  45. package/dist/Breadcrumbs/styles.es.js +50 -0
  46. package/dist/Breadcrumbs/types.d.ts +56 -0
  47. package/dist/Button/Button.cjs.js +66 -0
  48. package/dist/Button/Button.d.ts +4 -0
  49. package/dist/Button/Button.es.js +67 -0
  50. package/dist/Button/index.d.ts +2 -0
  51. package/dist/Button/styles.cjs.js +177 -0
  52. package/dist/Button/styles.d.ts +7 -0
  53. package/dist/Button/styles.es.js +177 -0
  54. package/dist/Button/types.d.ts +38 -0
  55. package/dist/Card/Card.cjs.js +38 -0
  56. package/dist/Card/Card.d.ts +3 -0
  57. package/dist/Card/Card.es.js +39 -0
  58. package/dist/Card/index.d.ts +2 -0
  59. package/dist/Card/styles.cjs.js +55 -0
  60. package/dist/Card/styles.d.ts +11 -0
  61. package/dist/Card/styles.es.js +55 -0
  62. package/dist/Card/types.d.ts +26 -0
  63. package/dist/Checkbox/Checkbox.cjs.js +39 -0
  64. package/dist/Checkbox/Checkbox.d.ts +4 -0
  65. package/dist/Checkbox/Checkbox.es.js +40 -0
  66. package/dist/Checkbox/CheckboxGroup.cjs.js +82 -0
  67. package/dist/Checkbox/CheckboxGroup.d.ts +4 -0
  68. package/dist/Checkbox/CheckboxGroup.es.js +83 -0
  69. package/dist/Checkbox/helpers.cjs.js +14 -0
  70. package/dist/Checkbox/helpers.d.ts +18 -0
  71. package/dist/Checkbox/helpers.es.js +14 -0
  72. package/dist/Checkbox/index.cjs.js +7 -0
  73. package/dist/Checkbox/index.d.ts +8 -0
  74. package/dist/Checkbox/index.es.js +7 -0
  75. package/dist/Checkbox/styles.cjs.js +147 -0
  76. package/dist/Checkbox/styles.d.ts +13 -0
  77. package/dist/Checkbox/styles.es.js +147 -0
  78. package/dist/Checkbox/types.d.ts +67 -0
  79. package/dist/Divider/Divider.cjs.js +27 -0
  80. package/dist/Divider/Divider.d.ts +4 -0
  81. package/dist/Divider/Divider.es.js +28 -0
  82. package/dist/Divider/index.d.ts +2 -0
  83. package/dist/Divider/styles.cjs.js +121 -0
  84. package/dist/Divider/styles.d.ts +3 -0
  85. package/dist/Divider/styles.es.js +121 -0
  86. package/dist/Divider/types.d.ts +17 -0
  87. package/dist/Drawer/Drawer.cjs.js +67 -0
  88. package/dist/Drawer/Drawer.d.ts +4 -0
  89. package/dist/Drawer/Drawer.es.js +68 -0
  90. package/dist/Drawer/index.d.ts +2 -0
  91. package/dist/Drawer/styles.cjs.js +85 -0
  92. package/dist/Drawer/styles.d.ts +18 -0
  93. package/dist/Drawer/styles.es.js +85 -0
  94. package/dist/Drawer/types.d.ts +24 -0
  95. package/dist/Dropdown/Dropdown.cjs.js +65 -0
  96. package/dist/Dropdown/Dropdown.d.ts +4 -0
  97. package/dist/Dropdown/Dropdown.es.js +66 -0
  98. package/dist/Dropdown/DropdownItem.cjs.js +32 -0
  99. package/dist/Dropdown/DropdownItem.d.ts +4 -0
  100. package/dist/Dropdown/DropdownItem.es.js +33 -0
  101. package/dist/Dropdown/DropdownList.cjs.js +85 -0
  102. package/dist/Dropdown/DropdownList.d.ts +6 -0
  103. package/dist/Dropdown/DropdownList.es.js +86 -0
  104. package/dist/Dropdown/DropdownPortal.cjs.js +41 -0
  105. package/dist/Dropdown/DropdownPortal.d.ts +4 -0
  106. package/dist/Dropdown/DropdownPortal.es.js +42 -0
  107. package/dist/Dropdown/helpers.cjs.js +112 -0
  108. package/dist/Dropdown/helpers.d.ts +35 -0
  109. package/dist/Dropdown/helpers.es.js +112 -0
  110. package/dist/Dropdown/index.d.ts +2 -0
  111. package/dist/Dropdown/styles.cjs.js +150 -0
  112. package/dist/Dropdown/styles.d.ts +33 -0
  113. package/dist/Dropdown/styles.es.js +150 -0
  114. package/dist/Dropdown/types.d.ts +81 -0
  115. package/dist/Flex/Flex.cjs.js +10 -0
  116. package/dist/Flex/Flex.d.ts +4 -0
  117. package/dist/Flex/Flex.es.js +11 -0
  118. package/dist/Flex/index.d.ts +2 -0
  119. package/dist/Flex/styles.cjs.js +32 -0
  120. package/dist/Flex/styles.d.ts +2 -0
  121. package/dist/Flex/styles.es.js +32 -0
  122. package/dist/Flex/types.d.ts +23 -0
  123. package/dist/Image/Image.cjs.js +79 -0
  124. package/dist/Image/Image.d.ts +4 -0
  125. package/dist/Image/Image.es.js +80 -0
  126. package/dist/Image/index.d.ts +2 -0
  127. package/dist/Image/styles.cjs.js +87 -0
  128. package/dist/Image/styles.d.ts +13 -0
  129. package/dist/Image/styles.es.js +87 -0
  130. package/dist/Image/types.d.ts +20 -0
  131. package/dist/InputNumber/InputNumber.cjs.js +145 -0
  132. package/dist/InputNumber/InputNumber.d.ts +4 -0
  133. package/dist/InputNumber/InputNumber.es.js +146 -0
  134. package/dist/InputNumber/index.d.ts +2 -0
  135. package/dist/InputNumber/styles.cjs.js +136 -0
  136. package/dist/InputNumber/styles.d.ts +21 -0
  137. package/dist/InputNumber/styles.es.js +136 -0
  138. package/dist/InputNumber/types.d.ts +61 -0
  139. package/dist/Layout/Content.cjs.js +7 -0
  140. package/dist/Layout/Content.d.ts +4 -0
  141. package/dist/Layout/Content.es.js +8 -0
  142. package/dist/Layout/Footer.cjs.js +7 -0
  143. package/dist/Layout/Footer.d.ts +4 -0
  144. package/dist/Layout/Footer.es.js +8 -0
  145. package/dist/Layout/Header.cjs.js +47 -0
  146. package/dist/Layout/Header.d.ts +4 -0
  147. package/dist/Layout/Header.es.js +48 -0
  148. package/dist/Layout/Layout.cjs.js +49 -0
  149. package/dist/Layout/Layout.d.ts +5 -0
  150. package/dist/Layout/Layout.es.js +49 -0
  151. package/dist/Layout/Sidebar.cjs.js +57 -0
  152. package/dist/Layout/Sidebar.d.ts +4 -0
  153. package/dist/Layout/Sidebar.es.js +58 -0
  154. package/dist/Layout/index.cjs.js +13 -0
  155. package/dist/Layout/index.d.ts +14 -0
  156. package/dist/Layout/index.es.js +13 -0
  157. package/dist/Layout/styles.cjs.js +150 -0
  158. package/dist/Layout/styles.d.ts +32 -0
  159. package/dist/Layout/styles.es.js +150 -0
  160. package/dist/Layout/types.d.ts +75 -0
  161. package/dist/Loader/Loader.cjs.js +34 -0
  162. package/dist/Loader/Loader.d.ts +4 -0
  163. package/dist/Loader/Loader.es.js +35 -0
  164. package/dist/Loader/index.d.ts +2 -0
  165. package/dist/Loader/loaders/Bars.cjs.js +12 -0
  166. package/dist/Loader/loaders/Bars.d.ts +6 -0
  167. package/dist/Loader/loaders/Bars.es.js +13 -0
  168. package/dist/Loader/loaders/Dots.cjs.js +12 -0
  169. package/dist/Loader/loaders/Dots.d.ts +6 -0
  170. package/dist/Loader/loaders/Dots.es.js +13 -0
  171. package/dist/Loader/loaders/Oval.cjs.js +8 -0
  172. package/dist/Loader/loaders/Oval.d.ts +6 -0
  173. package/dist/Loader/loaders/Oval.es.js +9 -0
  174. package/dist/Loader/styles.cjs.js +95 -0
  175. package/dist/Loader/styles.d.ts +9 -0
  176. package/dist/Loader/styles.es.js +95 -0
  177. package/dist/Loader/types.d.ts +11 -0
  178. package/dist/Modal/Modal.cjs.js +67 -0
  179. package/dist/Modal/Modal.d.ts +4 -0
  180. package/dist/Modal/Modal.es.js +68 -0
  181. package/dist/Modal/index.d.ts +2 -0
  182. package/dist/Modal/styles.cjs.js +52 -0
  183. package/dist/Modal/styles.d.ts +14 -0
  184. package/dist/Modal/styles.es.js +52 -0
  185. package/dist/Modal/types.d.ts +31 -0
  186. package/dist/Notification/Notification.cjs.js +73 -0
  187. package/dist/Notification/Notification.d.ts +4 -0
  188. package/dist/Notification/Notification.es.js +74 -0
  189. package/dist/Notification/NotificationInstance.cjs.js +244 -0
  190. package/dist/Notification/NotificationInstance.d.ts +8 -0
  191. package/dist/Notification/NotificationInstance.es.js +244 -0
  192. package/dist/Notification/NotificationsStore.cjs.js +30 -0
  193. package/dist/Notification/NotificationsStore.d.ts +13 -0
  194. package/dist/Notification/NotificationsStore.es.js +31 -0
  195. package/dist/Notification/index.d.ts +3 -0
  196. package/dist/Notification/styles.cjs.js +90 -0
  197. package/dist/Notification/styles.d.ts +8 -0
  198. package/dist/Notification/styles.es.js +90 -0
  199. package/dist/Notification/types.cjs.js +9 -0
  200. package/dist/Notification/types.d.ts +41 -0
  201. package/dist/Notification/types.es.js +9 -0
  202. package/dist/Progress/Progress.cjs.js +43 -0
  203. package/dist/Progress/Progress.d.ts +4 -0
  204. package/dist/Progress/Progress.es.js +44 -0
  205. package/dist/Progress/index.d.ts +2 -0
  206. package/dist/Progress/styles.cjs.js +82 -0
  207. package/dist/Progress/styles.d.ts +13 -0
  208. package/dist/Progress/styles.es.js +82 -0
  209. package/dist/Progress/types.d.ts +20 -0
  210. package/dist/RadioButton/RadioButton.cjs.js +45 -0
  211. package/dist/RadioButton/RadioButton.d.ts +4 -0
  212. package/dist/RadioButton/RadioButton.es.js +46 -0
  213. package/dist/RadioButton/RadioButtonGroup.cjs.js +68 -0
  214. package/dist/RadioButton/RadioButtonGroup.d.ts +4 -0
  215. package/dist/RadioButton/RadioButtonGroup.es.js +69 -0
  216. package/dist/RadioButton/helpers.cjs.js +14 -0
  217. package/dist/RadioButton/helpers.d.ts +18 -0
  218. package/dist/RadioButton/helpers.es.js +14 -0
  219. package/dist/RadioButton/index.cjs.js +7 -0
  220. package/dist/RadioButton/index.d.ts +8 -0
  221. package/dist/RadioButton/index.es.js +7 -0
  222. package/dist/RadioButton/styles.cjs.js +84 -0
  223. package/dist/RadioButton/styles.d.ts +12 -0
  224. package/dist/RadioButton/styles.es.js +84 -0
  225. package/dist/RadioButton/types.d.ts +65 -0
  226. package/dist/Select/Select.cjs.js +114 -0
  227. package/dist/Select/Select.d.ts +4 -0
  228. package/dist/Select/Select.es.js +115 -0
  229. package/dist/Select/helpers.cjs.js +16 -0
  230. package/dist/Select/helpers.d.ts +138 -0
  231. package/dist/Select/helpers.es.js +16 -0
  232. package/dist/Select/index.d.ts +2 -0
  233. package/dist/Select/styles.cjs.js +415 -0
  234. package/dist/Select/styles.d.ts +9 -0
  235. package/dist/Select/styles.es.js +415 -0
  236. package/dist/Select/types.d.ts +116 -0
  237. package/dist/Select/useSelect.cjs.js +72 -0
  238. package/dist/Select/useSelect.d.ts +150 -0
  239. package/dist/Select/useSelect.es.js +72 -0
  240. package/dist/Switch/Switch.cjs.js +53 -0
  241. package/dist/Switch/Switch.d.ts +4 -0
  242. package/dist/Switch/Switch.es.js +54 -0
  243. package/dist/Switch/index.d.ts +2 -0
  244. package/dist/Switch/styles.cjs.js +78 -0
  245. package/dist/Switch/styles.d.ts +7 -0
  246. package/dist/Switch/styles.es.js +78 -0
  247. package/dist/Switch/types.d.ts +25 -0
  248. package/dist/Tabs/Tab.cjs.js +42 -0
  249. package/dist/Tabs/Tab.d.ts +4 -0
  250. package/dist/Tabs/Tab.es.js +43 -0
  251. package/dist/Tabs/TabPanel.cjs.js +14 -0
  252. package/dist/Tabs/TabPanel.d.ts +4 -0
  253. package/dist/Tabs/TabPanel.es.js +15 -0
  254. package/dist/Tabs/Tabs.cjs.js +21 -0
  255. package/dist/Tabs/Tabs.d.ts +5 -0
  256. package/dist/Tabs/Tabs.es.js +21 -0
  257. package/dist/Tabs/TabsList.cjs.js +12 -0
  258. package/dist/Tabs/TabsList.d.ts +4 -0
  259. package/dist/Tabs/TabsList.es.js +13 -0
  260. package/dist/Tabs/index.cjs.js +10 -0
  261. package/dist/Tabs/index.d.ts +12 -0
  262. package/dist/Tabs/index.es.js +11 -0
  263. package/dist/Tabs/styles.cjs.js +74 -0
  264. package/dist/Tabs/styles.d.ts +9 -0
  265. package/dist/Tabs/styles.es.js +74 -0
  266. package/dist/Tabs/types.d.ts +51 -0
  267. package/dist/Tag/Tag.cjs.js +39 -0
  268. package/dist/Tag/Tag.d.ts +4 -0
  269. package/dist/Tag/Tag.es.js +40 -0
  270. package/dist/Tag/index.d.ts +2 -0
  271. package/dist/Tag/styles.cjs.js +51 -0
  272. package/dist/Tag/styles.d.ts +6 -0
  273. package/dist/Tag/styles.es.js +51 -0
  274. package/dist/Tag/types.d.ts +18 -0
  275. package/dist/TextField/TextField.cjs.js +100 -0
  276. package/dist/TextField/TextField.d.ts +4 -0
  277. package/dist/TextField/TextField.es.js +101 -0
  278. package/dist/TextField/index.d.ts +2 -0
  279. package/dist/TextField/styles.cjs.js +65 -0
  280. package/dist/TextField/styles.d.ts +9 -0
  281. package/dist/TextField/styles.es.js +65 -0
  282. package/dist/TextField/types.d.ts +41 -0
  283. package/dist/Textarea/Textarea.cjs.js +103 -0
  284. package/dist/Textarea/Textarea.d.ts +4 -0
  285. package/dist/Textarea/Textarea.es.js +104 -0
  286. package/dist/Textarea/index.d.ts +2 -0
  287. package/dist/Textarea/styles.cjs.js +80 -0
  288. package/dist/Textarea/styles.d.ts +9 -0
  289. package/dist/Textarea/styles.es.js +80 -0
  290. package/dist/Textarea/types.d.ts +47 -0
  291. package/dist/Tooltip/Tooltip.cjs.js +69 -0
  292. package/dist/Tooltip/Tooltip.d.ts +4 -0
  293. package/dist/Tooltip/Tooltip.es.js +70 -0
  294. package/dist/Tooltip/index.d.ts +2 -0
  295. package/dist/Tooltip/styles.cjs.js +232 -0
  296. package/dist/Tooltip/styles.d.ts +13 -0
  297. package/dist/Tooltip/styles.es.js +232 -0
  298. package/dist/Tooltip/types.d.ts +22 -0
  299. package/dist/assets/icon-arrow-bottom.svg.cjs.js +21 -0
  300. package/dist/assets/icon-arrow-bottom.svg.es.js +5 -0
  301. package/dist/assets/icon-close.svg.cjs.js +21 -0
  302. package/dist/assets/icon-close.svg.es.js +5 -0
  303. package/dist/assets/icon-error.svg.cjs.js +21 -0
  304. package/dist/assets/icon-error.svg.es.js +5 -0
  305. package/dist/assets/icon-info.svg.cjs.js +21 -0
  306. package/dist/assets/icon-info.svg.es.js +5 -0
  307. package/dist/assets/icon-lines.svg.cjs.js +21 -0
  308. package/dist/assets/icon-lines.svg.es.js +5 -0
  309. package/dist/assets/icon-success.svg.cjs.js +21 -0
  310. package/dist/assets/icon-success.svg.es.js +5 -0
  311. package/dist/assets/icon-warning.svg.cjs.js +21 -0
  312. package/dist/assets/icon-warning.svg.es.js +5 -0
  313. package/dist/constants/index.d.ts +1 -0
  314. package/dist/index.cjs.js +63 -0
  315. package/dist/index.d.ts +50 -0
  316. package/dist/index.es.js +63 -0
  317. package/dist/types/propsWithAttributes.d.ts +2 -0
  318. package/dist/types/size.d.ts +2 -0
  319. package/dist/typography/Text/Text.cjs.js +31 -0
  320. package/dist/typography/Text/Text.d.ts +4 -0
  321. package/dist/typography/Text/Text.es.js +32 -0
  322. package/dist/typography/Text/__stories__/Text.stories.d.ts +9 -0
  323. package/dist/typography/Text/index.d.ts +2 -0
  324. package/dist/typography/Text/styles.cjs.js +69 -0
  325. package/dist/typography/Text/styles.d.ts +2 -0
  326. package/dist/typography/Text/styles.es.js +69 -0
  327. package/dist/typography/Text/types.d.ts +22 -0
  328. package/dist/typography/Title/Title.cjs.js +26 -0
  329. package/dist/typography/Title/Title.d.ts +4 -0
  330. package/dist/typography/Title/Title.es.js +27 -0
  331. package/dist/typography/Title/__stories__/Title.stories.d.ts +9 -0
  332. package/dist/typography/Title/index.d.ts +2 -0
  333. package/dist/typography/Title/styles.cjs.js +75 -0
  334. package/dist/typography/Title/styles.d.ts +2 -0
  335. package/dist/typography/Title/styles.es.js +75 -0
  336. package/dist/typography/Title/types.d.ts +22 -0
  337. package/package.json +67 -0
@@ -0,0 +1,415 @@
1
+ import styled, { css, createGlobalStyle } from "styled-components";
2
+ const SelectWrapper = styled.div.withConfig({
3
+ shouldForwardProp: (prop) => !["size", "error", "zIndex"].includes(prop)
4
+ })`
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 0.5rem;
8
+
9
+ .text-field__required {
10
+ color: ${({ theme }) => theme.colors.red[9]};
11
+ }
12
+
13
+ .text-field__error-message {
14
+ color: ${({ theme }) => theme.colors.red[9]};
15
+ }
16
+
17
+ .rc-select {
18
+ display: flex;
19
+ align-items: center;
20
+ font-size: 12px;
21
+ min-width: 100px;
22
+ position: relative;
23
+ cursor: pointer;
24
+ }
25
+
26
+ .rc-select-focused .rc-select-selector {
27
+ border-bottom: 2px solid ${({ theme }) => theme.colors[theme.primaryColor][9]}!important;
28
+ }
29
+
30
+ .icon-arrow {
31
+ color: ${({ theme }) => theme.colors.gray[9]};
32
+ }
33
+
34
+ .rc-select-open {
35
+ .icon-arrow {
36
+ transform: rotateX(180deg);
37
+ transition: all 0.2s ease-in-out;
38
+ }
39
+ }
40
+
41
+ .rc-select-disabled > .rc-select-selector {
42
+ background: ${({ theme }) => theme.colors.gray[2]};
43
+ cursor: not-allowed ;
44
+
45
+ input {
46
+ cursor: not-allowed;
47
+ }
48
+
49
+ &:hover {
50
+ border-bottom: 1px solid ${({ theme }) => theme.colors.gray[5]};
51
+ }
52
+ }
53
+
54
+ .rc-select-selector {
55
+ width: 100%;
56
+ flex: 0 0 100%;
57
+ border-radius: ${({ theme }) => theme.control.radius};
58
+ border: 1px solid ${({ theme }) => theme.colors.gray[3]};
59
+ border-bottom: 1px solid ${({ theme }) => theme.colors.gray[5]};
60
+ min-height: ${({ size, theme }) => theme.control.height[size]};
61
+ align-items: center;
62
+
63
+ &:hover {
64
+ border-bottom: 1px solid ${({ theme }) => theme.colors.gray[8]};
65
+ }
66
+ }
67
+
68
+ ${({ error, theme }) => error && css`
69
+ .rc-select-selector {
70
+ border-bottom: 2px solid ${theme.colors.red[9]} !important;
71
+ }
72
+ `};
73
+
74
+ .rc-select-arrow {
75
+ position: relative;
76
+ z-index: 10;
77
+ right: 22px;
78
+ }
79
+
80
+ .rc-select-selection-search-input {
81
+ height: 100%;
82
+ background-color: transparent;
83
+ border: none;
84
+ width: 100%;
85
+ }
86
+
87
+ .rc-select-single .rc-select-selector .rc-select-selection-item,
88
+ .rc-select-single .rc-select-selector .rc-select-selection-placeholder {
89
+ position: absolute;
90
+ left: 3px;
91
+ pointer-events: none;
92
+ font-weight: normal;
93
+ top: ${({ size }) => {
94
+ if (size === "l") {
95
+ return "-3px";
96
+ } else if (size === "m") {
97
+ return "-2px";
98
+ } else if (size === "s") {
99
+ return "0px";
100
+ } else if (size === "xs") {
101
+ return "1px";
102
+ }
103
+ }};
104
+ }
105
+
106
+ .rc-select-single .rc-select-selector {
107
+ display: flex;
108
+ position: relative;
109
+ }
110
+
111
+ .rc-select-single .rc-select-selector .rc-select-selection-search {
112
+ width: 100%;
113
+ position: relative;
114
+ }
115
+ .rc-select-single .rc-select-selector .rc-select-selection-search-input {
116
+ width: 100%;
117
+ }
118
+
119
+ .rc-select-single .rc-select-selector .rc-select-selection-wrap {
120
+ width: calc(100% - 10px);
121
+ position: relative;
122
+ height: 100%;
123
+ }
124
+
125
+ .rc-select-single:not(.rc-select-customize-input)
126
+ .rc-select-selector
127
+ .rc-select-selection-search-input {
128
+ border: none;
129
+ outline: none;
130
+ width: 100%;
131
+ }
132
+
133
+ .rc-select .rc-select-selection-search-input {
134
+ appearance: none;
135
+ }
136
+ .rc-select .rc-select-selection-search-input::-webkit-search-cancel-button {
137
+ display: none;
138
+ appearance: none;
139
+ }
140
+
141
+ .rc-select-allow-clear .rc-select-clear {
142
+ color: ${({ theme }) => theme.colors.gray[9]};
143
+ cursor: pointer;
144
+ position: absolute;
145
+ right: 2.625rem;
146
+ }
147
+
148
+ .rc-select-clear-icon {
149
+ width: ${({ size }) => {
150
+ if (size === "l") {
151
+ return "1.5rem";
152
+ } else if (size === "m") {
153
+ return "1.25rem";
154
+ } else if (size === "s") {
155
+ return "1rem";
156
+ } else if (size === "xs") {
157
+ return "0.875rem";
158
+ }
159
+ }};
160
+ }
161
+
162
+ .rc-select-selection-search-input {
163
+ font-size: ${({ theme, size }) => theme.fonts.text.size[size]};
164
+ font-weight: ${({ theme }) => theme.fonts.text.weight};
165
+ line-height: ${({ theme, size }) => theme.fonts.text.lineHeight[size]};
166
+ }
167
+
168
+ .rc-select-multiple .rc-select-selector {
169
+ display: flex;
170
+ padding: 1px;
171
+ }
172
+
173
+ .rc-select-selection-item {
174
+ svg {
175
+ width: 16px;
176
+ height: 16px;
177
+ }
178
+
179
+ .quen-ui__text {
180
+ display: flex;
181
+ align-items: center;
182
+ gap: 4px;
183
+ }
184
+ }
185
+
186
+ .rc-select-multiple .rc-select-selector .rc-select-selection-item {
187
+ flex: none;
188
+ border-radius: 4px;
189
+ margin-right: 2px;
190
+ padding: 0 8px;
191
+ }
192
+
193
+ .rc-select-multiple .rc-select-selector .rc-select-selection-item-disabled {
194
+ cursor: not-allowed;
195
+ opacity: 0.5;
196
+ }
197
+ .rc-select-multiple .rc-select-selector .rc-select-selection-overflow {
198
+ display: flex;
199
+ flex-wrap: wrap;
200
+ gap: 8px;
201
+ }
202
+ .rc-select-multiple .rc-select-selector .rc-select-selection-overflow-item {
203
+ flex: none;
204
+ max-width: 100%;
205
+ }
206
+ .rc-select-multiple .rc-select-selector .rc-select-selection-search {
207
+ position: relative;
208
+ max-width: 100%;
209
+ }
210
+ .rc-select-multiple .rc-select-selector .rc-select-selection-search-input,
211
+ .rc-select-multiple .rc-select-selector .rc-select-selection-search-mirror {
212
+ padding: 1px;
213
+ font-family: system-ui;
214
+ }
215
+
216
+ .rc-select-multiple .rc-select-selector .rc-select-selection-search-mirror {
217
+ position: absolute;
218
+ z-index: 999;
219
+ white-space: nowrap;
220
+ left: 0;
221
+ top: 0;
222
+ visibility: hidden;
223
+ }
224
+
225
+ .rc-select-multiple .rc-select-selector .rc-select-selection-search-input {
226
+ border: none;
227
+ outline: none;
228
+ width: 100%;
229
+ }
230
+ .rc-select-allow-clear.rc-select-multiple .rc-select-selector {
231
+ padding-right: 20px;
232
+ }
233
+
234
+ .rc-select-multiple .rc-select-selector .rc-select-selection-placeholder {
235
+ position: absolute;
236
+ left: 3px;
237
+ pointer-events: none;
238
+ font-weight: normal;
239
+ top: ${({ size }) => {
240
+ if (size === "l") {
241
+ return "10px";
242
+ } else if (size === "m") {
243
+ return "8px";
244
+ } else if (size === "s") {
245
+ return "7px";
246
+ } else if (size === "xs") {
247
+ return "2px";
248
+ }
249
+ }};
250
+ }
251
+ `;
252
+ const SelectDropDownStyles = createGlobalStyle`
253
+ .rc-select-dropdown {
254
+ min-height: 100px;
255
+ position: absolute;
256
+ background: ${({ theme }) => theme.colors.grayViolet[5]};
257
+ border: 1px solid ${({ theme }) => theme.colors.grayViolet[9]};
258
+ border-radius: ${({ theme }) => theme.control.radius};
259
+
260
+ ${({ zIndex }) => zIndex && css`
261
+ z-index: ${zIndex};
262
+ `}
263
+ }
264
+
265
+ .rc-select-item-option-content {
266
+ display: flex;
267
+ align-items: center;
268
+ gap: 4px;
269
+ color: ${({ theme }) => theme.textColor};
270
+ svg {
271
+ width: 16px;
272
+ height: 16px;
273
+ }
274
+ }
275
+
276
+ .rc-select-dropdown-hidden {
277
+ display: none;
278
+ }
279
+
280
+ .rc-select-dropdown-slide-up-enter,
281
+ .rc-select-dropdown-slide-up-appear {
282
+ animation-duration: 0.3s;
283
+ animation-fill-mode: both;
284
+ transform-origin: 0 0;
285
+ opacity: 0;
286
+ animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
287
+ animation-play-state: paused;
288
+ }
289
+ .rc-select-dropdown-slide-up-leave {
290
+ animation-duration: 0.3s;
291
+ animation-fill-mode: both;
292
+ transform-origin: 0 0;
293
+ opacity: 1;
294
+ animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
295
+ animation-play-state: paused;
296
+ }
297
+
298
+ .rc-select-dropdown-slide-up-enter.rc-select-dropdown-slide-up-enter-active.rc-select-dropdown-placement-bottomLeft,
299
+ .rc-select-dropdown-slide-up-appear.rc-select-dropdown-slide-up-appear-active.rc-select-dropdown-placement-bottomLeft,
300
+ .rc-select-dropdown-slide-up-enter.rc-select-dropdown-slide-up-enter-active.rc-select-dropdown-placement-bottomRight,
301
+ .rc-select-dropdown-slide-up-appear.rc-select-dropdown-slide-up-appear-active.rc-select-dropdown-placement-bottomRight {
302
+ animation-name: rcSelectDropdownSlideUpIn;
303
+ animation-play-state: running;
304
+ }
305
+ .rc-select-dropdown-slide-up-leave.rc-select-dropdown-slide-up-leave-active.rc-select-dropdown-placement-bottomLeft,
306
+ .rc-select-dropdown-slide-up-leave.rc-select-dropdown-slide-up-leave-active.rc-select-dropdown-placement-bottomRight {
307
+ animation-name: rcSelectDropdownSlideUpOut;
308
+ animation-play-state: running;
309
+ }
310
+ .rc-select-dropdown-slide-up-enter.rc-select-dropdown-slide-up-enter-active.rc-select-dropdown-placement-topLeft,
311
+ .rc-select-dropdown-slide-up-appear.rc-select-dropdown-slide-up-appear-active.rc-select-dropdown-placement-topLeft,
312
+ .rc-select-dropdown-slide-up-enter.rc-select-dropdown-slide-up-enter-active.rc-select-dropdown-placement-topRight,
313
+ .rc-select-dropdown-slide-up-appear.rc-select-dropdown-slide-up-appear-active.rc-select-dropdown-placement-topRight {
314
+ animation-name: rcSelectDropdownSlideDownIn;
315
+ animation-play-state: running;
316
+ }
317
+ .rc-select-dropdown-slide-up-leave.rc-select-dropdown-slide-up-leave-active.rc-select-dropdown-placement-topLeft,
318
+ .rc-select-dropdown-slide-up-leave.rc-select-dropdown-slide-up-leave-active.rc-select-dropdown-placement-topRight {
319
+ animation-name: rcSelectDropdownSlideDownOut;
320
+ animation-play-state: running;
321
+ }
322
+
323
+ @keyframes rcSelectDropdownSlideUpIn {
324
+ 0% {
325
+ opacity: 0;
326
+ transform-origin: 0% 0%;
327
+ transform: scaleY(0);
328
+ }
329
+ 100% {
330
+ opacity: 1;
331
+ transform-origin: 0% 0%;
332
+ transform: scaleY(1);
333
+ }
334
+ }
335
+ @keyframes rcSelectDropdownSlideUpOut {
336
+ 0% {
337
+ opacity: 1;
338
+ transform-origin: 0% 0%;
339
+ transform: scaleY(1);
340
+ }
341
+ 100% {
342
+ opacity: 0;
343
+ transform-origin: 0% 0%;
344
+ transform: scaleY(0);
345
+ }
346
+ }
347
+ @keyframes rcSelectDropdownSlideDownIn {
348
+ 0% {
349
+ transform: scaleY(0);
350
+ transform-origin: 100% 100%;
351
+ opacity: 0;
352
+ }
353
+ 100% {
354
+ transform: scaleY(1);
355
+ transform-origin: 100% 100%;
356
+ opacity: 1;
357
+ }
358
+ }
359
+ @keyframes rcSelectDropdownSlideDownOut {
360
+ 0% {
361
+ transform: scaleY(1);
362
+ transform-origin: 100% 100%;
363
+ opacity: 1;
364
+ }
365
+ 100% {
366
+ transform: scaleY(0);
367
+ transform-origin: 100% 100%;
368
+ opacity: 0;
369
+ }
370
+ }
371
+
372
+ .rc-select-item {
373
+ cursor: pointer;
374
+ font-size: 16px;
375
+ line-height: 1.5;
376
+ padding: 4px 16px;
377
+ }
378
+
379
+ .rc-select-item-option {
380
+ position: relative;
381
+ }
382
+
383
+ .rc-select-item-option .rc-select-item-option-state {
384
+ position: absolute;
385
+ right: 0;
386
+ top: 4px;
387
+ pointer-events: none;
388
+ }
389
+ .rc-select-item-option-active {
390
+ background: ${({ theme }) => theme.colors.grayViolet[7]};
391
+ border-left: 2px solid
392
+ ${({ theme }) => theme.colors.violet[7]};
393
+ }
394
+ .rc-select-item-option-disabled {
395
+ background: ${({ theme }) => theme.colors.grayViolet[3]};
396
+ cursor: not-allowed;
397
+ .quen-ui__select-option {
398
+ color: ${({ theme }) => theme.colors.gray[3]};
399
+ }
400
+ }
401
+ .rc-select-item-empty {
402
+ text-align: center;
403
+ color: ${({ theme }) => theme.textColor};
404
+ }
405
+
406
+ .rc-select-item-option-selected {
407
+ background: ${({ theme }) => theme.colors.grayViolet[9]};
408
+ border-left: 2px solid
409
+ ${({ theme }) => theme.colors.violet[7]};
410
+ }
411
+ `;
412
+ export {
413
+ SelectDropDownStyles,
414
+ SelectWrapper
415
+ };
@@ -0,0 +1,116 @@
1
+ import { TQuenSize } from '../types/size';
2
+ import { default as React, CSSProperties } from 'react';
3
+ export interface ISelectDefaultItem {
4
+ label: string;
5
+ value: string;
6
+ groupId?: string | number;
7
+ disabled?: boolean;
8
+ icon?: React.ReactNode;
9
+ }
10
+ export type TSelectSingleValue = string;
11
+ export type TSingleSelectItemOnChange<ITEM> = (value: ITEM | null) => void;
12
+ export type TSingleSelectValueOnChange = (value: TSelectSingleValue | null) => void;
13
+ export type TMultiSelectItemOnChange<ITEM> = (value: ITEM[] | null) => void;
14
+ export type TMultiSelectValueOnChange = (value: TSelectSingleValue[] | null) => void;
15
+ type TSingleSelectOnChange<ITEM = ISelectDefaultItem> = {
16
+ /** Selection change handler */
17
+ onChange?: TSingleSelectItemOnChange<ITEM>;
18
+ /** Return format for onChange */
19
+ onChangeReturnValue: "item";
20
+ /** Current selection (controlled) */
21
+ value?: ITEM | null;
22
+ } | {
23
+ /** Selection change handler */
24
+ onChange?: TSingleSelectValueOnChange;
25
+ /** Return format for onChange */
26
+ onChangeReturnValue?: "value";
27
+ /** Current selection (controlled) */
28
+ value?: TSelectSingleValue | null;
29
+ };
30
+ /** Selection change handler */
31
+ type TMultiSelectOnChange<ITEM = ISelectDefaultItem> = {
32
+ /** Selection change handler */ onChange?: TMultiSelectItemOnChange<ITEM>;
33
+ /** Return format for onChange */
34
+ onChangeReturnValue?: "item";
35
+ /** Current selection (controlled) */
36
+ value?: ITEM[];
37
+ } | {
38
+ /** Selection change handler */ onChange?: TMultiSelectValueOnChange;
39
+ /** Return format for onChange */
40
+ onChangeReturnValue?: "value";
41
+ /** Current selection (controlled) */
42
+ value?: TSelectSingleValue[];
43
+ };
44
+ export type TSelectGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
45
+ export type TSelectGetItemValue<ITEM> = (item: ITEM | null) => TSelectSingleValue | null;
46
+ export type TSelectGetItemLabel<ITEM> = (item: ITEM) => string;
47
+ export type TSelectGetItemIcon<ITEM> = (item: ITEM) => React.ReactNode;
48
+ export type TSingleSelectProps<ITEM> = TSingleSelectOnChange<ITEM> & {
49
+ /** Enables multi-selection */
50
+ multi?: undefined | false;
51
+ };
52
+ export type TMultiSelectProps<ITEM> = TMultiSelectOnChange<ITEM> & {
53
+ /** Enables multi-selection */
54
+ multi: true;
55
+ };
56
+ export type TSelectProps<ITEM = ISelectDefaultItem> = (TSingleSelectProps<ITEM> | TMultiSelectProps<ITEM>) & TSelectBaseProps<ITEM>;
57
+ type TSelectBaseProps<ITEM> = {
58
+ /** Input size */
59
+ size?: TQuenSize;
60
+ /** Disables interaction */
61
+ disabled?: boolean;
62
+ /** Field label */
63
+ label?: string;
64
+ /** Marks as required */
65
+ required?: boolean;
66
+ /** Error state/message */
67
+ error?: string | boolean;
68
+ /** Placeholder text */
69
+ placeholder?: string;
70
+ /** Left-side adornment */
71
+ leftContent?: React.ReactNode;
72
+ /** Right-side adornment */
73
+ rightContent?: React.ReactNode;
74
+ /** Name select */
75
+ name?: string;
76
+ /** Container class */
77
+ className?: string;
78
+ /** Data source for options */
79
+ items: ITEM[];
80
+ /** Called when blur */
81
+ onBlur?: React.FocusEventHandler;
82
+ /** Called when focus */
83
+ onFocus?: React.FocusEventHandler;
84
+ /** Called when clear */
85
+ onClear?: () => void;
86
+ /** Shows clear button */
87
+ clearable?: boolean;
88
+ /** Determines disabled state */
89
+ getItemDisabled?: TSelectGetItemDisabled<ITEM>;
90
+ /** Extracts option value */
91
+ getItemValue?: TSelectGetItemValue<ITEM>;
92
+ /** Extracts display text */
93
+ getItemLabel?: TSelectGetItemLabel<ITEM>;
94
+ /** Extracts display icon */
95
+ getItemIcon?: TSelectGetItemIcon<ITEM>;
96
+ /** Inline styles */
97
+ style?: CSSProperties;
98
+ /** Default empty message */
99
+ messageNoData?: string;
100
+ /** Custom "no options" UI */
101
+ notFoundContent?: React.ReactNode;
102
+ /** Initial open state */
103
+ defaultOpen?: boolean;
104
+ /** Controlled open state */
105
+ open?: boolean;
106
+ /** Shows loading indicator */
107
+ loading?: boolean;
108
+ /** Get focus by default */
109
+ autoFocus?: boolean;
110
+ id?: string;
111
+ /** Whether show search input in single mode */
112
+ showSearch?: boolean;
113
+ zIndex?: number;
114
+ [key: string]: any;
115
+ };
116
+ export {};
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ function getDefaultCurrentValue(getItemValue, value) {
5
+ if (typeof value === "undefined") {
6
+ return null;
7
+ }
8
+ if (typeof value === "string") {
9
+ return value || null;
10
+ }
11
+ if (value === null) {
12
+ return null;
13
+ }
14
+ if (Array.isArray(value)) {
15
+ return value.map((v) => {
16
+ if (typeof v === "string" || typeof value === "number") {
17
+ return v;
18
+ }
19
+ return getItemValue(v);
20
+ });
21
+ }
22
+ return getItemValue(value);
23
+ }
24
+ function useSelect(props) {
25
+ const [searchValue, setSearchValue] = React.useState("");
26
+ const [currentValue, setCurrentValue] = React.useState(getDefaultCurrentValue(props.getItemValue, props.value));
27
+ const items = React.useMemo(() => {
28
+ var _a;
29
+ return ((_a = props.items) == null ? void 0 : _a.filter((item) => {
30
+ var _a2;
31
+ return (_a2 = props.getItemLabel) == null ? void 0 : _a2.call(props, item).toLowerCase().includes(searchValue.toLowerCase());
32
+ })) ?? [];
33
+ }, [props.items, searchValue]);
34
+ function handleChange(value) {
35
+ var _a, _b, _c, _d;
36
+ if (props.multi && Array.isArray(value)) {
37
+ const multiProps = props;
38
+ if (props.onChangeReturnValue === "value") {
39
+ (_a = props.onChange) == null ? void 0 : _a.call(props, value);
40
+ }
41
+ if (props.onChangeReturnValue === "item") {
42
+ const items2 = value.map(
43
+ (v) => props.items.find((i) => props.getItemValue(i) === v)
44
+ );
45
+ (_b = multiProps.onChange) == null ? void 0 : _b.call(multiProps, items2);
46
+ }
47
+ setCurrentValue(value || null);
48
+ } else {
49
+ const singleProps = props;
50
+ const item = props.items.find((i) => {
51
+ var _a2;
52
+ return ((_a2 = props.getItemValue) == null ? void 0 : _a2.call(props, i)) === value;
53
+ }) ?? null;
54
+ if (props.onChangeReturnValue === "item") {
55
+ (_c = singleProps.onChange) == null ? void 0 : _c.call(singleProps, item || null);
56
+ } else {
57
+ (_d = singleProps.onChange) == null ? void 0 : _d.call(singleProps, value);
58
+ }
59
+ setCurrentValue(value || null);
60
+ }
61
+ setSearchValue("");
62
+ }
63
+ return {
64
+ ...props,
65
+ items,
66
+ handleChange,
67
+ searchValue,
68
+ currentValue,
69
+ size: props.size || "m"
70
+ };
71
+ }
72
+ exports.useSelect = useSelect;