@quen-ui/components 0.0.14

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 +71 -0
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ const styles = require("./styles.cjs.js");
5
+ const Text = require("../typography/Text/Text.cjs.js");
6
+ const Button = require("../Button/Button.cjs.js");
7
+ const iconClose = require("../assets/icon-close.svg.cjs.js");
8
+ const Flex = require("../Flex/Flex.cjs.js");
9
+ const InputNumber = ({
10
+ label,
11
+ size = "m",
12
+ required,
13
+ disabled,
14
+ error,
15
+ min,
16
+ max,
17
+ className,
18
+ classNameInput,
19
+ onBlur,
20
+ onFocus,
21
+ defaultValue,
22
+ id,
23
+ name,
24
+ placeholder,
25
+ step,
26
+ allowNegative = true,
27
+ decimalSeparator,
28
+ rightContent,
29
+ value,
30
+ onChange,
31
+ parser,
32
+ formatter,
33
+ leftContent,
34
+ isAutoFocus,
35
+ clearable,
36
+ onClear,
37
+ ...props
38
+ }) => {
39
+ const [focus, setFocus] = React.useState(false);
40
+ const inputRef = React.useRef(null);
41
+ const rightContentRef = React.useRef(null);
42
+ const [widthRightContent, setWidthRightContent] = React.useState(0);
43
+ const _min = React.useMemo(() => {
44
+ if (!allowNegative || (min ?? 0) > 0) {
45
+ return min || 0;
46
+ }
47
+ return min;
48
+ }, [min, allowNegative]);
49
+ React.useLayoutEffect(() => {
50
+ const element = rightContentRef.current;
51
+ if (!element) return;
52
+ setWidthRightContent(element.clientWidth ?? 0);
53
+ const observer = new ResizeObserver((entries) => {
54
+ var _a;
55
+ const width = ((_a = entries[0]) == null ? void 0 : _a.contentRect.width) ?? 0;
56
+ setWidthRightContent(width);
57
+ });
58
+ observer.observe(element);
59
+ return () => observer.disconnect();
60
+ }, [rightContent, clearable]);
61
+ const handleClick = () => {
62
+ var _a;
63
+ setFocus(true);
64
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
65
+ };
66
+ const handleBlur = (event) => {
67
+ setFocus(false);
68
+ onBlur == null ? void 0 : onBlur(event);
69
+ };
70
+ const handleFocus = (event) => {
71
+ setFocus(true);
72
+ onFocus == null ? void 0 : onFocus(event);
73
+ };
74
+ const handleClearClick = (event) => {
75
+ event.stopPropagation();
76
+ onChange == null ? void 0 : onChange(null);
77
+ onClear == null ? void 0 : onClear(event);
78
+ };
79
+ return /* @__PURE__ */ jsxRuntime.jsxs(styles.InputNumberWrapper, { className, ...props, children: [
80
+ label && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size, as: "label", htmlFor: id, children: [
81
+ label,
82
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "quen-ui--input-number__required", children: "*" })
83
+ ] }),
84
+ /* @__PURE__ */ jsxRuntime.jsxs(
85
+ styles.InputNumberContainer,
86
+ {
87
+ size,
88
+ focus,
89
+ disabled,
90
+ onClick: handleClick,
91
+ error,
92
+ children: [
93
+ leftContent,
94
+ /* @__PURE__ */ jsxRuntime.jsx(
95
+ styles.InputNumberStyled,
96
+ {
97
+ "data-testid": "input",
98
+ widthRight: widthRightContent,
99
+ ref: inputRef,
100
+ onChange,
101
+ value,
102
+ parser,
103
+ formatter,
104
+ decimalSeparator,
105
+ autoFocus: isAutoFocus,
106
+ placeholder,
107
+ name,
108
+ id,
109
+ defaultValue,
110
+ disabled,
111
+ className: classNameInput,
112
+ min: _min,
113
+ max,
114
+ onClick: handleClick,
115
+ onBlur: handleBlur,
116
+ onFocus: handleFocus,
117
+ keyboard: true,
118
+ step,
119
+ required,
120
+ changeOnWheel: true,
121
+ upHandler: "+",
122
+ downHandler: "-",
123
+ addonAfter: clearable || rightContent ? /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "xs", align: "center", ref: rightContentRef, children: [
124
+ clearable && /* @__PURE__ */ jsxRuntime.jsx(
125
+ Button,
126
+ {
127
+ "data-testid": "clearable-button",
128
+ view: "icon",
129
+ size: "xs",
130
+ onClick: handleClearClick,
131
+ disabled,
132
+ children: /* @__PURE__ */ jsxRuntime.jsx(iconClose, { width: 16, height: 16 })
133
+ }
134
+ ),
135
+ rightContent
136
+ ] }) : void 0
137
+ }
138
+ )
139
+ ]
140
+ }
141
+ ),
142
+ typeof error === "string" && /* @__PURE__ */ jsxRuntime.jsx(Text, { className: "quen-ui--input-number__error-message", size: "xs", children: error })
143
+ ] });
144
+ };
145
+ module.exports = InputNumber;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { IInputNumberProps } from './types';
3
+ declare const InputNumber: ({ label, size, required, disabled, error, min, max, className, classNameInput, onBlur, onFocus, defaultValue, id, name, placeholder, step, allowNegative, decimalSeparator, rightContent, value, onChange, parser, formatter, leftContent, isAutoFocus, clearable, onClear, ...props }: IInputNumberProps) => React.ReactElement;
4
+ export default InputNumber;
@@ -0,0 +1,146 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useRef, useMemo, useLayoutEffect } from "react";
3
+ import { InputNumberWrapper, InputNumberContainer, InputNumberStyled } from "./styles.es.js";
4
+ import Text from "../typography/Text/Text.es.js";
5
+ import Button from "../Button/Button.es.js";
6
+ import SvgIconClose from "../assets/icon-close.svg.es.js";
7
+ import Flex from "../Flex/Flex.es.js";
8
+ const InputNumber = ({
9
+ label,
10
+ size = "m",
11
+ required,
12
+ disabled,
13
+ error,
14
+ min,
15
+ max,
16
+ className,
17
+ classNameInput,
18
+ onBlur,
19
+ onFocus,
20
+ defaultValue,
21
+ id,
22
+ name,
23
+ placeholder,
24
+ step,
25
+ allowNegative = true,
26
+ decimalSeparator,
27
+ rightContent,
28
+ value,
29
+ onChange,
30
+ parser,
31
+ formatter,
32
+ leftContent,
33
+ isAutoFocus,
34
+ clearable,
35
+ onClear,
36
+ ...props
37
+ }) => {
38
+ const [focus, setFocus] = useState(false);
39
+ const inputRef = useRef(null);
40
+ const rightContentRef = useRef(null);
41
+ const [widthRightContent, setWidthRightContent] = useState(0);
42
+ const _min = useMemo(() => {
43
+ if (!allowNegative || (min ?? 0) > 0) {
44
+ return min || 0;
45
+ }
46
+ return min;
47
+ }, [min, allowNegative]);
48
+ useLayoutEffect(() => {
49
+ const element = rightContentRef.current;
50
+ if (!element) return;
51
+ setWidthRightContent(element.clientWidth ?? 0);
52
+ const observer = new ResizeObserver((entries) => {
53
+ var _a;
54
+ const width = ((_a = entries[0]) == null ? void 0 : _a.contentRect.width) ?? 0;
55
+ setWidthRightContent(width);
56
+ });
57
+ observer.observe(element);
58
+ return () => observer.disconnect();
59
+ }, [rightContent, clearable]);
60
+ const handleClick = () => {
61
+ var _a;
62
+ setFocus(true);
63
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
64
+ };
65
+ const handleBlur = (event) => {
66
+ setFocus(false);
67
+ onBlur == null ? void 0 : onBlur(event);
68
+ };
69
+ const handleFocus = (event) => {
70
+ setFocus(true);
71
+ onFocus == null ? void 0 : onFocus(event);
72
+ };
73
+ const handleClearClick = (event) => {
74
+ event.stopPropagation();
75
+ onChange == null ? void 0 : onChange(null);
76
+ onClear == null ? void 0 : onClear(event);
77
+ };
78
+ return /* @__PURE__ */ jsxs(InputNumberWrapper, { className, ...props, children: [
79
+ label && /* @__PURE__ */ jsxs(Text, { size, as: "label", htmlFor: id, children: [
80
+ label,
81
+ required && /* @__PURE__ */ jsx("span", { className: "quen-ui--input-number__required", children: "*" })
82
+ ] }),
83
+ /* @__PURE__ */ jsxs(
84
+ InputNumberContainer,
85
+ {
86
+ size,
87
+ focus,
88
+ disabled,
89
+ onClick: handleClick,
90
+ error,
91
+ children: [
92
+ leftContent,
93
+ /* @__PURE__ */ jsx(
94
+ InputNumberStyled,
95
+ {
96
+ "data-testid": "input",
97
+ widthRight: widthRightContent,
98
+ ref: inputRef,
99
+ onChange,
100
+ value,
101
+ parser,
102
+ formatter,
103
+ decimalSeparator,
104
+ autoFocus: isAutoFocus,
105
+ placeholder,
106
+ name,
107
+ id,
108
+ defaultValue,
109
+ disabled,
110
+ className: classNameInput,
111
+ min: _min,
112
+ max,
113
+ onClick: handleClick,
114
+ onBlur: handleBlur,
115
+ onFocus: handleFocus,
116
+ keyboard: true,
117
+ step,
118
+ required,
119
+ changeOnWheel: true,
120
+ upHandler: "+",
121
+ downHandler: "-",
122
+ addonAfter: clearable || rightContent ? /* @__PURE__ */ jsxs(Flex, { gap: "xs", align: "center", ref: rightContentRef, children: [
123
+ clearable && /* @__PURE__ */ jsx(
124
+ Button,
125
+ {
126
+ "data-testid": "clearable-button",
127
+ view: "icon",
128
+ size: "xs",
129
+ onClick: handleClearClick,
130
+ disabled,
131
+ children: /* @__PURE__ */ jsx(SvgIconClose, { width: 16, height: 16 })
132
+ }
133
+ ),
134
+ rightContent
135
+ ] }) : void 0
136
+ }
137
+ )
138
+ ]
139
+ }
140
+ ),
141
+ typeof error === "string" && /* @__PURE__ */ jsx(Text, { className: "quen-ui--input-number__error-message", size: "xs", children: error })
142
+ ] });
143
+ };
144
+ export {
145
+ InputNumber as default
146
+ };
@@ -0,0 +1,2 @@
1
+ export { default as InputNumber } from './InputNumber';
2
+ export type { IInputNumberProps } from './types';
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const styled = require("styled-components");
4
+ const RcInputNumber = require("rc-input-number");
5
+ const polished = require("polished");
6
+ const InputNumberWrapper = styled.div`
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 0.5rem;
10
+ width: max-content;
11
+
12
+ .quen-ui--input-number__required {
13
+ color: ${({ theme }) => theme.colors.red[9]};
14
+ }
15
+
16
+ .quen-ui--input-number__error-message {
17
+ color: ${({ theme }) => theme.colors.red[9]};
18
+ }
19
+ `;
20
+ const InputNumberContainer = styled.div.withConfig({
21
+ shouldForwardProp: (prop) => !["size", "focus", "error", "disabled"].includes(prop)
22
+ })`
23
+ height: ${({ size, theme }) => theme.control.height[size]};
24
+ border-radius: ${({ theme }) => theme.control.radius};
25
+ border: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.grayViolet[9]}`};
26
+ border-bottom: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.gray[5]}`};
27
+ display: flex;
28
+ align-items: center;
29
+ padding-left: 0.75rem;
30
+ gap: 0.5rem;
31
+
32
+ svg {
33
+ color: ${({ theme }) => theme.colors.gray[9]};
34
+ }
35
+
36
+ .rc-input-number-handler {
37
+ height: ${({ size, theme }) => polished.math(`${theme.control.height[size]} / 2`)};
38
+ }
39
+
40
+ input {
41
+ background: transparent;
42
+ font-size: ${({ theme, size }) => theme.fonts.text.size[size]};
43
+ line-height: ${({ theme, size }) => theme.fonts.text.lineHeight[size]};
44
+ }
45
+
46
+ &:hover {
47
+ ${({ theme, focus }) => !focus && styled.css`
48
+ border-bottom: ${theme.control.borderWidth} solid
49
+ ${theme.colors[theme.primaryColor][9]};
50
+ `}
51
+ }
52
+
53
+ ${({ focus }) => focus && styled.css`
54
+ border-bottom: ${({ theme }) => `${polished.math(`${theme.control.borderWidth} * 2`)} solid ${theme.colors[theme.primaryColor][9]}`};
55
+ `};
56
+
57
+ ${({ error, theme }) => error && styled.css`
58
+ border-bottom: ${polished.math(`${theme.control.borderWidth} * 2`)} solid
59
+ ${theme.colors.red[9]};
60
+ `};
61
+
62
+ ${({ disabled, theme }) => disabled && styled.css`
63
+ background: ${theme.colors.gray[2]};
64
+ border-bottom: ${theme.control.borderWidth} solid
65
+ ${theme.colors.gray[4]}!important;
66
+ input {
67
+ background: ${theme.colors.gray[2]};
68
+ pointer-events: none;
69
+ color: ${theme.colors.gray[4]};
70
+ }
71
+ `};
72
+ `;
73
+ const InputNumberStyled = styled(RcInputNumber).withConfig({
74
+ shouldForwardProp: (prop) => !["widthRight"].includes(prop)
75
+ })`
76
+ color: ${({ theme }) => theme.colors.gray[9]};
77
+ &,
78
+ .rc-input-number {
79
+ display: flex;
80
+ flex-direction: row-reverse;
81
+ align-items: center;
82
+ justify-content: space-between;
83
+ height: 100%;
84
+ }
85
+
86
+ .rc-input-number-wrapper.rc-input-number-group:has(
87
+ .rc-input-number-group-addon
88
+ ) {
89
+ display: flex;
90
+
91
+ .rc-input-number-handler-wrap {
92
+ position: relative;
93
+ right: ${({ widthRight }) => `-${widthRight - 1}px`};
94
+ }
95
+
96
+ .rc-input-number-group-addon {
97
+ position: relative;
98
+ right: 30px;
99
+ display: flex;
100
+ align-items: center;
101
+ }
102
+ }
103
+
104
+ .rc-input-number-input {
105
+ box-sizing: border-box;
106
+ outline: none;
107
+ border: none;
108
+ color: ${({ theme }) => theme.colors.gray[9]};
109
+ }
110
+
111
+ .rc-input-number-handler-wrap {
112
+ display: flex;
113
+ flex-direction: column;
114
+ align-items: center;
115
+ border-left: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.gray[3]}`};
116
+ height: 100%;
117
+ justify-content: center;
118
+ }
119
+
120
+ .rc-input-number-handler {
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ width: 100%;
125
+ cursor: pointer;
126
+ padding-left: 2px;
127
+ padding-right: 2px;
128
+ }
129
+
130
+ .rc-input-number-handler-up {
131
+ border-bottom: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.gray[3]}`};
132
+ }
133
+ `;
134
+ exports.InputNumberContainer = InputNumberContainer;
135
+ exports.InputNumberStyled = InputNumberStyled;
136
+ exports.InputNumberWrapper = InputNumberWrapper;
@@ -0,0 +1,21 @@
1
+ import { TQuenSize } from '../types/size';
2
+ export declare const InputNumberWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const InputNumberContainer: 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
+ focus: boolean;
6
+ error?: string | boolean;
7
+ disabled?: boolean;
8
+ }>> & string;
9
+ export declare const InputNumberStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('rc-input-number').InputNumberProps<import('rc-input-number').ValueType> & {
10
+ children?: React.ReactNode;
11
+ } & {
12
+ ref?: React.Ref<HTMLInputElement>;
13
+ }, {
14
+ widthRight: number;
15
+ }>> & string & Omit<(<T extends import('rc-input-number').ValueType = import('rc-input-number').ValueType>(props: import('rc-input-number').InputNumberProps<T> & {
16
+ children?: React.ReactNode;
17
+ } & {
18
+ ref?: React.Ref<HTMLInputElement>;
19
+ }) => React.ReactElement) & {
20
+ displayName?: string;
21
+ }, keyof import('react').Component<any, {}, any>>;
@@ -0,0 +1,136 @@
1
+ import styled, { css } from "styled-components";
2
+ import RcInputNumber from "rc-input-number";
3
+ import { math } from "polished";
4
+ const InputNumberWrapper = styled.div`
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 0.5rem;
8
+ width: max-content;
9
+
10
+ .quen-ui--input-number__required {
11
+ color: ${({ theme }) => theme.colors.red[9]};
12
+ }
13
+
14
+ .quen-ui--input-number__error-message {
15
+ color: ${({ theme }) => theme.colors.red[9]};
16
+ }
17
+ `;
18
+ const InputNumberContainer = styled.div.withConfig({
19
+ shouldForwardProp: (prop) => !["size", "focus", "error", "disabled"].includes(prop)
20
+ })`
21
+ height: ${({ size, theme }) => theme.control.height[size]};
22
+ border-radius: ${({ theme }) => theme.control.radius};
23
+ border: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.grayViolet[9]}`};
24
+ border-bottom: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.gray[5]}`};
25
+ display: flex;
26
+ align-items: center;
27
+ padding-left: 0.75rem;
28
+ gap: 0.5rem;
29
+
30
+ svg {
31
+ color: ${({ theme }) => theme.colors.gray[9]};
32
+ }
33
+
34
+ .rc-input-number-handler {
35
+ height: ${({ size, theme }) => math(`${theme.control.height[size]} / 2`)};
36
+ }
37
+
38
+ input {
39
+ background: transparent;
40
+ font-size: ${({ theme, size }) => theme.fonts.text.size[size]};
41
+ line-height: ${({ theme, size }) => theme.fonts.text.lineHeight[size]};
42
+ }
43
+
44
+ &:hover {
45
+ ${({ theme, focus }) => !focus && css`
46
+ border-bottom: ${theme.control.borderWidth} solid
47
+ ${theme.colors[theme.primaryColor][9]};
48
+ `}
49
+ }
50
+
51
+ ${({ focus }) => focus && css`
52
+ border-bottom: ${({ theme }) => `${math(`${theme.control.borderWidth} * 2`)} solid ${theme.colors[theme.primaryColor][9]}`};
53
+ `};
54
+
55
+ ${({ error, theme }) => error && css`
56
+ border-bottom: ${math(`${theme.control.borderWidth} * 2`)} solid
57
+ ${theme.colors.red[9]};
58
+ `};
59
+
60
+ ${({ disabled, theme }) => disabled && css`
61
+ background: ${theme.colors.gray[2]};
62
+ border-bottom: ${theme.control.borderWidth} solid
63
+ ${theme.colors.gray[4]}!important;
64
+ input {
65
+ background: ${theme.colors.gray[2]};
66
+ pointer-events: none;
67
+ color: ${theme.colors.gray[4]};
68
+ }
69
+ `};
70
+ `;
71
+ const InputNumberStyled = styled(RcInputNumber).withConfig({
72
+ shouldForwardProp: (prop) => !["widthRight"].includes(prop)
73
+ })`
74
+ color: ${({ theme }) => theme.colors.gray[9]};
75
+ &,
76
+ .rc-input-number {
77
+ display: flex;
78
+ flex-direction: row-reverse;
79
+ align-items: center;
80
+ justify-content: space-between;
81
+ height: 100%;
82
+ }
83
+
84
+ .rc-input-number-wrapper.rc-input-number-group:has(
85
+ .rc-input-number-group-addon
86
+ ) {
87
+ display: flex;
88
+
89
+ .rc-input-number-handler-wrap {
90
+ position: relative;
91
+ right: ${({ widthRight }) => `-${widthRight - 1}px`};
92
+ }
93
+
94
+ .rc-input-number-group-addon {
95
+ position: relative;
96
+ right: 30px;
97
+ display: flex;
98
+ align-items: center;
99
+ }
100
+ }
101
+
102
+ .rc-input-number-input {
103
+ box-sizing: border-box;
104
+ outline: none;
105
+ border: none;
106
+ color: ${({ theme }) => theme.colors.gray[9]};
107
+ }
108
+
109
+ .rc-input-number-handler-wrap {
110
+ display: flex;
111
+ flex-direction: column;
112
+ align-items: center;
113
+ border-left: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.gray[3]}`};
114
+ height: 100%;
115
+ justify-content: center;
116
+ }
117
+
118
+ .rc-input-number-handler {
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ width: 100%;
123
+ cursor: pointer;
124
+ padding-left: 2px;
125
+ padding-right: 2px;
126
+ }
127
+
128
+ .rc-input-number-handler-up {
129
+ border-bottom: ${({ theme }) => `${theme.control.borderWidth} solid ${theme.colors.gray[3]}`};
130
+ }
131
+ `;
132
+ export {
133
+ InputNumberContainer,
134
+ InputNumberStyled,
135
+ InputNumberWrapper
136
+ };
@@ -0,0 +1,61 @@
1
+ import { default as React } from 'react';
2
+ import { InputNumberProps } from 'rc-input-number';
3
+ import { TQuenSize } from '../types/size';
4
+ export type TInputNumberFormatter = InputNumberProps["formatter"];
5
+ export type TInputNumberParser = InputNumberProps["parser"];
6
+ export interface IInputNumberProps {
7
+ /** Initial uncontrolled value */
8
+ defaultValue?: number;
9
+ /** Controlled input value */
10
+ value?: number | null;
11
+ /** Decimal separator character */
12
+ decimalSeparator?: string;
13
+ /** Placeholder text */
14
+ placeholder?: string;
15
+ /** Disable input interaction */
16
+ disabled?: boolean;
17
+ /** Maximum allowed value */
18
+ max?: number;
19
+ /** Minimum allowed value */
20
+ min?: number;
21
+ /** Control input size */
22
+ size?: TQuenSize;
23
+ /** Increment/decrement step value */
24
+ step?: number;
25
+ /** Allow negative values */
26
+ allowNegative?: boolean;
27
+ /** Value change handler */
28
+ onChange?: (value: number | string | null) => void;
29
+ /** Input label text */
30
+ label?: string;
31
+ /** Mark as required field */
32
+ required?: boolean;
33
+ /** Error message or error state flag */
34
+ error?: string | boolean;
35
+ /** Left adornment (icon/prefix) */
36
+ leftContent?: React.ReactNode;
37
+ /** Right adornment (icon/suffix) */
38
+ rightContent?: React.ReactNode;
39
+ /** DOM ID for label association */
40
+ id?: string;
41
+ /** Form input name */
42
+ name?: string;
43
+ /** Container class name */
44
+ className?: string;
45
+ /** Blur event handler */
46
+ onBlur?: React.FocusEventHandler;
47
+ /** Focus event handler */
48
+ onFocus?: React.FocusEventHandler;
49
+ /** Input element class name */
50
+ classNameInput?: string;
51
+ /** Show clear button */
52
+ clearable?: boolean;
53
+ /** Auto-focus on mount */
54
+ isAutoFocus?: boolean;
55
+ /** Value display formatter (value: number) => strin */
56
+ formatter?: TInputNumberFormatter;
57
+ /** Input parser (displayValue: string) => number */
58
+ parser?: TInputNumberParser;
59
+ onClear?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
60
+ [key: string]: any;
61
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const styles = require("./styles.cjs.js");
4
+ const Content = ({ children, className }) => {
5
+ return /* @__PURE__ */ jsxRuntime.jsx(styles.ContentStyled, { className, children });
6
+ };
7
+ module.exports = Content;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ILayoutContentProps } from './types';
3
+ declare const Content: ({ children, className }: ILayoutContentProps) => React.ReactElement;
4
+ export default Content;
@@ -0,0 +1,8 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ContentStyled } from "./styles.es.js";
3
+ const Content = ({ children, className }) => {
4
+ return /* @__PURE__ */ jsx(ContentStyled, { className, children });
5
+ };
6
+ export {
7
+ Content as default
8
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const styles = require("./styles.cjs.js");
4
+ const Footer = ({ children }) => {
5
+ return /* @__PURE__ */ jsxRuntime.jsx(styles.FooterStyled, { children });
6
+ };
7
+ module.exports = Footer;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ILayoutFooterProps } from './types';
3
+ declare const Footer: ({ children }: ILayoutFooterProps) => React.ReactElement;
4
+ export default Footer;