armtek-uikit-react 1.0.2 → 1.0.4

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 (278) hide show
  1. package/lib/Adornment/package.json +7 -0
  2. package/lib/Alert/package.json +7 -0
  3. package/lib/Avatar/package.json +7 -0
  4. package/lib/AvatarGroup/package.json +6 -0
  5. package/lib/Badge/package.json +7 -0
  6. package/lib/Button/package.json +7 -7
  7. package/lib/ButtonGroup/package.json +6 -0
  8. package/lib/ButtonIcon/package.json +6 -0
  9. package/lib/Card/package.json +7 -0
  10. package/lib/Checkbox/package.json +6 -0
  11. package/lib/Chip/package.json +7 -0
  12. package/lib/DateField/package.json +6 -0
  13. package/lib/DatePicker/package.json +6 -0
  14. package/lib/DateService/package.json +6 -0
  15. package/lib/HelperText/package.json +6 -0
  16. package/lib/Interval/package.json +6 -0
  17. package/lib/IntervalSlide/package.json +6 -0
  18. package/lib/ListItem/package.json +6 -0
  19. package/lib/Loader/package.json +7 -0
  20. package/lib/Logo/package.json +7 -0
  21. package/lib/Password/package.json +6 -0
  22. package/lib/Period/package.json +6 -0
  23. package/lib/PeriodSelect/package.json +6 -0
  24. package/lib/Radio/package.json +6 -0
  25. package/lib/Rating/package.json +6 -0
  26. package/lib/RcSlider/package.json +6 -0
  27. package/lib/Select/package.json +6 -0
  28. package/lib/Slider/package.json +7 -0
  29. package/lib/Status/package.json +7 -0
  30. package/lib/StepItem/package.json +6 -0
  31. package/lib/StepItemIcon/package.json +6 -0
  32. package/lib/Stepper/package.json +7 -0
  33. package/lib/Switch/package.json +6 -0
  34. package/lib/TextArea/package.json +6 -0
  35. package/lib/TextField/package.json +6 -0
  36. package/lib/TimeField/package.json +6 -0
  37. package/lib/TimePicker/package.json +6 -0
  38. package/lib/Tooltip/package.json +7 -0
  39. package/lib/cjs/Adornment/Adornment.d.ts +7 -0
  40. package/lib/cjs/Adornment/Adornment.js +47 -0
  41. package/lib/cjs/Adornment/Adornment.module.scss +18 -0
  42. package/lib/cjs/Alert/Alert.d.ts +10 -0
  43. package/lib/cjs/Alert/Alert.js +46 -0
  44. package/lib/cjs/Alert/Alert.module.scss +38 -0
  45. package/lib/cjs/Avatar/Avatar.d.ts +13 -0
  46. package/lib/cjs/Avatar/Avatar.js +50 -0
  47. package/lib/cjs/Avatar/Avatar.module.scss +82 -0
  48. package/lib/cjs/Avatar/AvatarGroup.d.ts +8 -0
  49. package/lib/cjs/Avatar/AvatarGroup.js +34 -0
  50. package/lib/cjs/Avatar/AvatarGroup.module.scss +48 -0
  51. package/lib/cjs/Badge/Badge.d.ts +11 -0
  52. package/lib/cjs/Badge/Badge.js +34 -0
  53. package/lib/cjs/Badge/Badge.module.scss +83 -0
  54. package/lib/cjs/Button/Button.css +3 -0
  55. package/lib/cjs/{ui/Button → Button}/Button.d.ts +1 -1
  56. package/lib/cjs/{ui/Button → Button}/Button.js +4 -5
  57. package/lib/cjs/{ui/Button → Button}/Button.module.scss +1 -1
  58. package/lib/cjs/Card/Card.d.ts +4 -0
  59. package/lib/cjs/Card/Card.js +19 -0
  60. package/lib/cjs/Card/Card.module.scss +7 -0
  61. package/lib/cjs/Chip/Chip.d.ts +13 -0
  62. package/lib/cjs/Chip/Chip.js +41 -0
  63. package/lib/cjs/Chip/Chip.module.scss +96 -0
  64. package/lib/cjs/Form/Checkbox/Checkbox.d.ts +12 -0
  65. package/lib/cjs/Form/Checkbox/Checkbox.js +53 -0
  66. package/lib/cjs/Form/Checkbox/Checkbox.module.scss +297 -0
  67. package/lib/cjs/Form/Checkbox/Radio.d.ts +3 -0
  68. package/lib/cjs/Form/Checkbox/Radio.js +21 -0
  69. package/lib/cjs/Form/DateField/DateField.d.ts +26 -0
  70. package/lib/cjs/Form/DateField/DateField.js +71 -0
  71. package/lib/cjs/Form/DateField/DateField.module.scss +1 -0
  72. package/lib/cjs/Form/DateField/TimeField.d.ts +3 -0
  73. package/lib/cjs/Form/DateField/TimeField.js +19 -0
  74. package/lib/cjs/Form/DatePicker/DatePicker.d.ts +7 -0
  75. package/lib/cjs/Form/DatePicker/DatePicker.js +49 -0
  76. package/lib/cjs/Form/DatePicker/DatePicker.module.scss +7 -0
  77. package/lib/cjs/Form/DatePicker/PeriodSelect.d.ts +2 -0
  78. package/lib/cjs/Form/DatePicker/PeriodSelect.js +29 -0
  79. package/lib/cjs/Form/DatePicker/TimePicker.d.ts +2 -0
  80. package/lib/cjs/Form/DatePicker/TimePicker.js +28 -0
  81. package/lib/cjs/Form/DatePicker/styles.css +766 -0
  82. package/lib/cjs/Form/Interval/Interval.d.ts +21 -0
  83. package/lib/cjs/Form/Interval/Interval.js +98 -0
  84. package/lib/cjs/Form/Interval/Interval.module.scss +35 -0
  85. package/lib/cjs/Form/Interval/IntervalSlide.d.ts +4 -0
  86. package/lib/cjs/Form/Interval/IntervalSlide.js +48 -0
  87. package/lib/cjs/Form/Password/Password.d.ts +12 -0
  88. package/lib/cjs/Form/Password/Password.js +46 -0
  89. package/lib/cjs/Form/Password/Password.module.scss +2 -0
  90. package/lib/cjs/Form/Period/Period.d.ts +15 -0
  91. package/lib/cjs/Form/Period/Period.js +69 -0
  92. package/lib/cjs/Form/Period/Period.module.scss +10 -0
  93. package/lib/cjs/Form/Rating/Rating.d.ts +10 -0
  94. package/lib/cjs/Form/Rating/Rating.js +54 -0
  95. package/lib/cjs/Form/Rating/Rating.module.scss +19 -0
  96. package/lib/cjs/Form/Select/Select.d.ts +23 -0
  97. package/lib/cjs/Form/Select/Select.js +139 -0
  98. package/lib/cjs/Form/Select/Select.module.scss +26 -0
  99. package/lib/cjs/Form/Switch/Switch.d.ts +7 -0
  100. package/lib/cjs/Form/Switch/Switch.js +30 -0
  101. package/lib/cjs/Form/Switch/Switch.module.scss +69 -0
  102. package/lib/cjs/Form/TextArea/TextArea.d.ts +4 -0
  103. package/lib/cjs/Form/TextArea/TextArea.js +46 -0
  104. package/lib/cjs/Form/TextArea/TextArea.module.scss +15 -0
  105. package/lib/cjs/Form/TextField/TextField.d.ts +40 -0
  106. package/lib/cjs/Form/TextField/TextField.js +152 -0
  107. package/lib/cjs/Form/TextField/TextField.module.scss +160 -0
  108. package/lib/cjs/List/ListItem.d.ts +10 -0
  109. package/lib/cjs/List/ListItem.js +60 -0
  110. package/lib/cjs/List/ListItem.module.scss +34 -0
  111. package/lib/cjs/Loader/Loader.d.ts +6 -0
  112. package/lib/cjs/Loader/Loader.js +120 -0
  113. package/lib/cjs/Loader/Loader.module.scss +37 -0
  114. package/lib/cjs/Logo/Logo.d.ts +12 -0
  115. package/lib/cjs/Logo/Logo.js +102 -0
  116. package/lib/cjs/Logo/Logo.module.scss +29 -0
  117. package/lib/cjs/Slider/RcSlider.d.ts +2 -0
  118. package/lib/cjs/Slider/RcSlider.js +9 -0
  119. package/lib/cjs/Slider/Slider.d.ts +8 -0
  120. package/lib/cjs/Slider/Slider.js +34 -0
  121. package/lib/cjs/Slider/Slider.module.scss +6 -0
  122. package/lib/cjs/Slider/style.css +281 -0
  123. package/lib/cjs/Status/Status.d.ts +10 -0
  124. package/lib/cjs/Status/Status.js +31 -0
  125. package/lib/cjs/Status/Status.module.scss +45 -0
  126. package/lib/cjs/Stepper/StepItem.d.ts +14 -0
  127. package/lib/cjs/Stepper/StepItem.js +56 -0
  128. package/lib/cjs/Stepper/StepItem.module.scss +67 -0
  129. package/lib/cjs/Stepper/StepItemIcon.d.ts +11 -0
  130. package/lib/cjs/Stepper/StepItemIcon.js +40 -0
  131. package/lib/cjs/Stepper/StepItemIcon.module.scss +47 -0
  132. package/lib/cjs/Stepper/Stepper.d.ts +11 -0
  133. package/lib/cjs/Stepper/Stepper.js +45 -0
  134. package/lib/cjs/Stepper/Stepper.module.scss +34 -0
  135. package/lib/cjs/Tooltip/Tooltip.d.ts +7 -0
  136. package/lib/cjs/Tooltip/Tooltip.js +32 -0
  137. package/lib/cjs/Tooltip/Tooltip.module.scss +18 -0
  138. package/lib/cjs/Typography/HelperText/HelperText.d.ts +6 -0
  139. package/lib/cjs/Typography/HelperText/HelperText.js +28 -0
  140. package/lib/cjs/Typography/HelperText/HelperText.module.scss +10 -0
  141. package/lib/cjs/assets/fonts.scss +0 -18
  142. package/lib/cjs/assets/global.css +36 -0
  143. package/lib/cjs/assets/styles.scss +0 -10
  144. package/lib/cjs/index.d.ts +29 -29
  145. package/lib/cjs/index.js +30 -2
  146. package/lib/dist/armtek-uikit-react-index.js +293 -293
  147. package/lib/dist/armtek-uikit-react-index.min.js +1 -1
  148. package/lib/esm/Adornment/Adornment.d.ts +7 -0
  149. package/lib/esm/Adornment/Adornment.js +40 -0
  150. package/lib/esm/Adornment/Adornment.module.scss +18 -0
  151. package/lib/esm/Alert/Alert.d.ts +10 -0
  152. package/lib/esm/Alert/Alert.js +41 -0
  153. package/lib/esm/Alert/Alert.module.scss +38 -0
  154. package/lib/esm/Avatar/Avatar.d.ts +13 -0
  155. package/lib/esm/Avatar/Avatar.js +45 -0
  156. package/lib/esm/Avatar/Avatar.module.scss +82 -0
  157. package/lib/esm/Avatar/AvatarGroup.d.ts +8 -0
  158. package/lib/esm/Avatar/AvatarGroup.js +29 -0
  159. package/lib/esm/Avatar/AvatarGroup.module.scss +48 -0
  160. package/lib/esm/Badge/Badge.d.ts +11 -0
  161. package/lib/esm/Badge/Badge.js +29 -0
  162. package/lib/esm/Badge/Badge.module.scss +83 -0
  163. package/lib/esm/Button/Button.css +3 -0
  164. package/lib/esm/{ui/Button → Button}/Button.d.ts +1 -1
  165. package/lib/esm/{ui/Button → Button}/Button.js +5 -5
  166. package/lib/esm/{ui/Button → Button}/Button.module.scss +1 -1
  167. package/lib/esm/Card/Card.d.ts +4 -0
  168. package/lib/esm/Card/Card.js +13 -0
  169. package/lib/esm/Card/Card.module.scss +7 -0
  170. package/lib/esm/Chip/Chip.d.ts +13 -0
  171. package/lib/esm/Chip/Chip.js +36 -0
  172. package/lib/esm/Chip/Chip.module.scss +96 -0
  173. package/lib/esm/Form/Checkbox/Checkbox.d.ts +12 -0
  174. package/lib/esm/Form/Checkbox/Checkbox.js +49 -0
  175. package/lib/esm/Form/Checkbox/Checkbox.module.scss +297 -0
  176. package/lib/esm/Form/Checkbox/Radio.d.ts +3 -0
  177. package/lib/esm/Form/Checkbox/Radio.js +15 -0
  178. package/lib/esm/Form/DateField/DateField.d.ts +26 -0
  179. package/lib/esm/Form/DateField/DateField.js +66 -0
  180. package/lib/esm/Form/DateField/DateField.module.scss +1 -0
  181. package/lib/esm/Form/DateField/TimeField.d.ts +3 -0
  182. package/lib/esm/Form/DateField/TimeField.js +13 -0
  183. package/lib/esm/Form/DatePicker/DatePicker.d.ts +7 -0
  184. package/lib/esm/Form/DatePicker/DatePicker.js +41 -0
  185. package/lib/esm/Form/DatePicker/DatePicker.module.scss +7 -0
  186. package/lib/esm/Form/DatePicker/PeriodSelect.d.ts +2 -0
  187. package/lib/esm/Form/DatePicker/PeriodSelect.js +24 -0
  188. package/lib/esm/Form/DatePicker/TimePicker.d.ts +2 -0
  189. package/lib/esm/Form/DatePicker/TimePicker.js +23 -0
  190. package/lib/esm/Form/DatePicker/styles.css +766 -0
  191. package/lib/esm/Form/Interval/Interval.d.ts +21 -0
  192. package/lib/esm/Form/Interval/Interval.js +94 -0
  193. package/lib/esm/Form/Interval/Interval.module.scss +35 -0
  194. package/lib/esm/Form/Interval/IntervalSlide.d.ts +4 -0
  195. package/lib/esm/Form/Interval/IntervalSlide.js +44 -0
  196. package/lib/esm/Form/Password/Password.d.ts +12 -0
  197. package/lib/esm/Form/Password/Password.js +41 -0
  198. package/lib/esm/Form/Password/Password.module.scss +2 -0
  199. package/lib/esm/Form/Period/Period.d.ts +15 -0
  200. package/lib/esm/Form/Period/Period.js +65 -0
  201. package/lib/esm/Form/Period/Period.module.scss +10 -0
  202. package/lib/esm/Form/Rating/Rating.d.ts +10 -0
  203. package/lib/esm/Form/Rating/Rating.js +50 -0
  204. package/lib/esm/Form/Rating/Rating.module.scss +19 -0
  205. package/lib/esm/Form/Select/Select.d.ts +23 -0
  206. package/lib/esm/Form/Select/Select.js +135 -0
  207. package/lib/esm/Form/Select/Select.module.scss +26 -0
  208. package/lib/esm/Form/Switch/Switch.d.ts +7 -0
  209. package/lib/esm/Form/Switch/Switch.js +25 -0
  210. package/lib/esm/Form/Switch/Switch.module.scss +69 -0
  211. package/lib/esm/Form/TextArea/TextArea.d.ts +4 -0
  212. package/lib/esm/Form/TextArea/TextArea.js +41 -0
  213. package/lib/esm/Form/TextArea/TextArea.module.scss +15 -0
  214. package/lib/esm/Form/TextField/TextField.d.ts +40 -0
  215. package/lib/esm/Form/TextField/TextField.js +147 -0
  216. package/lib/esm/Form/TextField/TextField.module.scss +160 -0
  217. package/lib/esm/List/ListItem.d.ts +10 -0
  218. package/lib/esm/List/ListItem.js +53 -0
  219. package/lib/esm/List/ListItem.module.scss +34 -0
  220. package/lib/esm/Loader/Loader.d.ts +6 -0
  221. package/lib/esm/Loader/Loader.js +115 -0
  222. package/lib/esm/Loader/Loader.module.scss +37 -0
  223. package/lib/esm/Logo/Logo.d.ts +12 -0
  224. package/lib/esm/Logo/Logo.js +97 -0
  225. package/lib/esm/Logo/Logo.module.scss +29 -0
  226. package/lib/esm/Slider/RcSlider.d.ts +2 -0
  227. package/lib/esm/Slider/RcSlider.js +2 -0
  228. package/lib/esm/Slider/Slider.d.ts +8 -0
  229. package/lib/esm/Slider/Slider.js +29 -0
  230. package/lib/esm/Slider/Slider.module.scss +6 -0
  231. package/lib/esm/Slider/style.css +281 -0
  232. package/lib/esm/Status/Status.d.ts +10 -0
  233. package/lib/esm/Status/Status.js +26 -0
  234. package/lib/esm/Status/Status.module.scss +45 -0
  235. package/lib/esm/Stepper/StepItem.d.ts +14 -0
  236. package/lib/esm/Stepper/StepItem.js +51 -0
  237. package/lib/esm/Stepper/StepItem.module.scss +67 -0
  238. package/lib/esm/Stepper/StepItemIcon.d.ts +11 -0
  239. package/lib/esm/Stepper/StepItemIcon.js +34 -0
  240. package/lib/esm/Stepper/StepItemIcon.module.scss +47 -0
  241. package/lib/esm/Stepper/Stepper.d.ts +11 -0
  242. package/lib/esm/Stepper/Stepper.js +40 -0
  243. package/lib/esm/Stepper/Stepper.module.scss +34 -0
  244. package/lib/esm/Tooltip/Tooltip.d.ts +7 -0
  245. package/lib/esm/Tooltip/Tooltip.js +28 -0
  246. package/lib/esm/Tooltip/Tooltip.module.scss +18 -0
  247. package/lib/esm/Typography/HelperText/HelperText.d.ts +6 -0
  248. package/lib/esm/Typography/HelperText/HelperText.js +22 -0
  249. package/lib/esm/Typography/HelperText/HelperText.module.scss +10 -0
  250. package/lib/esm/assets/fonts.scss +0 -18
  251. package/lib/esm/assets/global.css +36 -0
  252. package/lib/esm/assets/styles.scss +0 -10
  253. package/lib/esm/index.d.ts +29 -29
  254. package/lib/esm/index.js +15 -1
  255. package/lib/helpers/package.json +6 -0
  256. package/lib/theme/package.json +6 -0
  257. package/lib/useClickOutside/package.json +6 -0
  258. package/package.json +6 -2
  259. package/lib/cjs/assets/index.d.ts +0 -16
  260. package/lib/cjs/ui/Button/style.css +0 -299
  261. package/lib/esm/assets/index.d.ts +0 -16
  262. package/lib/esm/ui/Button/style.css +0 -299
  263. /package/lib/cjs/{ui/Button → Button}/ButtonGroup.d.ts +0 -0
  264. /package/lib/cjs/{ui/Button → Button}/ButtonGroup.js +0 -0
  265. /package/lib/cjs/{ui/Button → Button}/ButtonIcon.d.ts +0 -0
  266. /package/lib/cjs/{ui/Button → Button}/ButtonIcon.js +0 -0
  267. /package/lib/cjs/{shared/hooks → hooks}/useClickOutside.d.ts +0 -0
  268. /package/lib/cjs/{shared/hooks → hooks}/useClickOutside.js +0 -0
  269. /package/lib/cjs/{shared/services → services}/DateService.d.ts +0 -0
  270. /package/lib/cjs/{shared/services → services}/DateService.js +0 -0
  271. /package/lib/esm/{ui/Button → Button}/ButtonGroup.d.ts +0 -0
  272. /package/lib/esm/{ui/Button → Button}/ButtonGroup.js +0 -0
  273. /package/lib/esm/{ui/Button → Button}/ButtonIcon.d.ts +0 -0
  274. /package/lib/esm/{ui/Button → Button}/ButtonIcon.js +0 -0
  275. /package/lib/esm/{shared/hooks → hooks}/useClickOutside.d.ts +0 -0
  276. /package/lib/esm/{shared/hooks → hooks}/useClickOutside.js +0 -0
  277. /package/lib/esm/{shared/services → services}/DateService.d.ts +0 -0
  278. /package/lib/esm/{shared/services → services}/DateService.js +0 -0
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { TextFieldProps } from '../TextField/TextField';
3
+ export type IntervalProps = {
4
+ min: number;
5
+ max: number;
6
+ value?: [number, number];
7
+ onChange?: (value: [number, number]) => void;
8
+ labelStart?: string;
9
+ labelEnd?: string;
10
+ defaultValue?: [number, number];
11
+ } & Omit<TextFieldProps, 'onChange' | 'value'>;
12
+ declare const Interval: import("react").ForwardRefExoticComponent<{
13
+ min: number;
14
+ max: number;
15
+ value?: [number, number] | undefined;
16
+ onChange?: ((value: [number, number]) => void) | undefined;
17
+ labelStart?: string | undefined;
18
+ labelEnd?: string | undefined;
19
+ defaultValue?: [number, number] | undefined;
20
+ } & Omit<TextFieldProps, "value" | "onChange"> & import("react").RefAttributes<unknown>>;
21
+ export default Interval;
@@ -0,0 +1,94 @@
1
+ "use client";
2
+
3
+ import { forwardRef, useState } from 'react';
4
+ import css from './Interval.module.scss';
5
+ import { TextFieldContainer, TextFieldInput } from '../TextField/TextField';
6
+ import HelperText from '../../Typography/HelperText/HelperText';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
10
+ const Interval = /*#__PURE__*/forwardRef((props, ref) => {
11
+ let {
12
+ value,
13
+ defaultValue,
14
+ labelStart,
15
+ labelEnd,
16
+ onChange,
17
+ helperText,
18
+ error,
19
+ disabled,
20
+ min = 0,
21
+ max = 0,
22
+ ...inputProps
23
+ } = props;
24
+ let [focused, setFocused] = useState(false);
25
+ let [currentMin, setCurrentMin] = useState(min);
26
+ let [currentMax, setCurrentMax] = useState(max);
27
+ const handleFocus = () => {
28
+ setFocused(true);
29
+ };
30
+ const handleBlur = () => {
31
+ setFocused(false);
32
+ };
33
+ const handleMin = e => {
34
+ let val = parseInt(e.target.value);
35
+ val = val < min ? min : val;
36
+ setCurrentMin(val);
37
+ if (onChange) onChange([val, max]);
38
+ };
39
+ const handleMax = e => {
40
+ let val = parseInt(e.target.value);
41
+ val = val > max ? max : val;
42
+ setCurrentMax(val);
43
+ if (onChange) onChange([min, val]);
44
+ };
45
+ let realMin = currentMin;
46
+ let realMax = currentMax;
47
+ if (value !== undefined && Array.isArray(value) && value.length === 2) {
48
+ realMin = value[0];
49
+ realMax = value[1];
50
+ }
51
+ return /*#__PURE__*/_jsxs(_Fragment, {
52
+ children: [/*#__PURE__*/_jsx(TextFieldContainer, {
53
+ focused: focused,
54
+ error: error,
55
+ disabled: disabled,
56
+ size: inputProps.size,
57
+ variant: inputProps.variant,
58
+ children: /*#__PURE__*/_jsxs("div", {
59
+ className: css.interval,
60
+ children: [/*#__PURE__*/_jsx("div", {
61
+ className: css.interval__item,
62
+ children: /*#__PURE__*/_jsx(TextFieldInput, {
63
+ ...inputProps,
64
+ value: realMin,
65
+ label: labelStart,
66
+ type: 'number',
67
+ onFocus: handleFocus,
68
+ onBlur: handleBlur,
69
+ focused: true,
70
+ onChange: handleMin
71
+ })
72
+ }), /*#__PURE__*/_jsx("div", {
73
+ className: css.interval__item,
74
+ children: /*#__PURE__*/_jsx(TextFieldInput, {
75
+ ...inputProps,
76
+ value: realMax,
77
+ label: labelEnd,
78
+ type: 'number',
79
+ onFocus: handleFocus,
80
+ onBlur: handleBlur,
81
+ className: css.interval__end,
82
+ focused: true,
83
+ onChange: handleMax
84
+ })
85
+ })]
86
+ })
87
+ }), helperText && /*#__PURE__*/_jsx(HelperText, {
88
+ className: css.interval__helperText,
89
+ error: error,
90
+ children: helperText
91
+ })]
92
+ });
93
+ });
94
+ export default Interval;
@@ -0,0 +1,35 @@
1
+ @import "../../assets/styles";
2
+
3
+ .interval{
4
+ @include flex();
5
+ width: 100%;
6
+ & input{
7
+ -moz-appearance: textfield;
8
+ &::-webkit-outer-spin-button,
9
+ &::-webkit-inner-spin-button {
10
+ -webkit-appearance: none;
11
+ margin: 0;
12
+ }
13
+ }
14
+ }
15
+ .interval__end{
16
+ text-align: right;
17
+ & + span{
18
+ text-align: right;
19
+ padding-left: 0;
20
+ padding-right: 12px;
21
+ }
22
+ }
23
+ .interval__item{
24
+ max-width: 50%;
25
+ flex: 0 0 50%;
26
+ }
27
+
28
+ .interval__helperText{
29
+ margin-top: calc($size-step / 2);
30
+ }
31
+
32
+ .intervalslide__slider{
33
+ padding: 0 calc($size-step * 2);
34
+ margin-top: -7px;
35
+ }
@@ -0,0 +1,4 @@
1
+ import { IntervalProps } from './Interval';
2
+ type PropsType = IntervalProps;
3
+ declare const IntervalSlide: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
4
+ export default IntervalSlide;
@@ -0,0 +1,44 @@
1
+ "use client";
2
+
3
+ import Interval from './Interval';
4
+ import css from './Interval.module.scss';
5
+ import { useState } from 'react';
6
+ import Slider from '../../Slider/Slider';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
10
+ const IntervalSlide = props => {
11
+ let {
12
+ onChange,
13
+ ...restProps
14
+ } = props;
15
+ let [value, setValue] = useState([props.min, props.max]);
16
+ const handleChange = value => {
17
+ setValue(value);
18
+ if (onChange) onChange(value);
19
+ };
20
+ const handleSlide = value => {
21
+ if (Array.isArray(value)) handleChange(value);
22
+ };
23
+ return /*#__PURE__*/_jsx(_Fragment, {
24
+ children: /*#__PURE__*/_jsxs("div", {
25
+ children: [/*#__PURE__*/_jsx(Interval, {
26
+ value: value,
27
+ ...restProps,
28
+ onChange: setValue
29
+ }), /*#__PURE__*/_jsx("div", {
30
+ className: css.intervalslide__slider,
31
+ children: /*#__PURE__*/_jsx(Slider, {
32
+ range: true,
33
+ min: props.min,
34
+ max: props.max,
35
+ disabled: props.disabled,
36
+ value: restProps.value || value,
37
+ size: props.size,
38
+ onChange: handleSlide
39
+ })
40
+ })]
41
+ })
42
+ });
43
+ };
44
+ export default IntervalSlide;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ declare const Password: import("react").ForwardRefExoticComponent<{
3
+ label?: string | undefined;
4
+ size?: "small" | "large" | undefined;
5
+ variant?: import("../../shared/types/theme").VariantType | undefined;
6
+ error?: boolean | undefined;
7
+ success?: boolean | undefined;
8
+ helperText?: string | undefined;
9
+ endAdornment?: import("react").ReactNode;
10
+ multiline?: boolean | undefined;
11
+ } & Omit<import("react").InputHTMLAttributes<any>, "size"> & import("react").RefAttributes<unknown>>;
12
+ export default Password;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+
3
+ import TextField from '../TextField/TextField';
4
+ import { forwardRef, useRef, useState } from 'react';
5
+ import ButtonIcon from '../../Button/ButtonIcon';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { Fragment as _Fragment } from "react/jsx-runtime";
8
+ const Password = /*#__PURE__*/forwardRef((props, ref) => {
9
+ let {
10
+ onChange,
11
+ ...restProps
12
+ } = props;
13
+ let [value, setValue] = useState('');
14
+ let [isPassword, setIsPassword] = useState(true);
15
+ const inputRef = useRef(ref);
16
+ const handleChange = e => {
17
+ setValue(e.target.value);
18
+ if (onChange) onChange(e);
19
+ };
20
+ const handleClick = () => {
21
+ setIsPassword(prev => !prev);
22
+ };
23
+ return /*#__PURE__*/_jsx(_Fragment, {
24
+ children: /*#__PURE__*/_jsx(TextField, {
25
+ value: value,
26
+ ref: inputRef,
27
+ ...restProps,
28
+ type: isPassword ? 'password' : 'text',
29
+ onChange: handleChange,
30
+ endAdornment: /*#__PURE__*/_jsx(ButtonIcon, {
31
+ size: 'medium',
32
+ variant: 'transparent',
33
+ color: 'neutral',
34
+ onClick: handleClick,
35
+ className: 'material_icon',
36
+ children: isPassword ? 'visibility_off' : 'visibility'
37
+ })
38
+ })
39
+ });
40
+ });
41
+ export default Password;
@@ -0,0 +1,2 @@
1
+ @import "../../assets/styles";
2
+
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ declare const Period: import("react").ForwardRefExoticComponent<{
3
+ format?: string | undefined;
4
+ onChange?: ((value: [Date | null, Date | null]) => void) | undefined;
5
+ } & {
6
+ label?: string | undefined;
7
+ size?: "small" | "large" | undefined;
8
+ variant?: import("../../shared/types/theme").VariantType | undefined;
9
+ error?: boolean | undefined;
10
+ success?: boolean | undefined;
11
+ helperText?: string | undefined;
12
+ endAdornment?: import("react").ReactNode;
13
+ multiline?: boolean | undefined;
14
+ } & Omit<import("react").InputHTMLAttributes<any>, "size"> & import("react").RefAttributes<unknown>>;
15
+ export default Period;
@@ -0,0 +1,65 @@
1
+ "use client";
2
+
3
+ import TextField from '../TextField/TextField';
4
+ import { forwardRef, useState } from 'react';
5
+ import css from './Period.module.scss';
6
+ import ButtonIcon from '../../Button/ButtonIcon';
7
+ import Card from '../../Card/Card';
8
+ import DatePicker from '../DatePicker/DatePicker';
9
+ import { DateService } from '../../services/DateService';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { Fragment as _Fragment } from "react/jsx-runtime";
13
+ const Period = /*#__PURE__*/forwardRef((props, ref) => {
14
+ let {
15
+ onChange,
16
+ format = 'DD.MM.YYYY',
17
+ onInput,
18
+ ...restProps
19
+ } = props;
20
+ let [active, setActive] = useState(false);
21
+ let [value, setValue] = useState([new Date(), null]);
22
+ const handleClick = () => {
23
+ setActive(true);
24
+ };
25
+ const handleChange = date => {
26
+ setValue(date);
27
+ if (date[0] && date[1]) setActive(false);
28
+ if (onChange) onChange(date);
29
+ };
30
+ let displayValue = '';
31
+ if (value[0] && value[1]) displayValue = `${DateService(value[0]).format('DD.MM.YYYY')} - ${DateService(value[1]).format('DD.MM.YYYY')}`;
32
+ return /*#__PURE__*/_jsx(_Fragment, {
33
+ children: /*#__PURE__*/_jsxs("div", {
34
+ className: css.dateField,
35
+ children: [/*#__PURE__*/_jsx(TextField, {
36
+ ref: ref,
37
+ placeholder: 'дд.мм.гггг - дд.мм.гггг',
38
+ ...restProps,
39
+ value: displayValue,
40
+ onFocus: handleClick,
41
+ endAdornment: /*#__PURE__*/_jsx(ButtonIcon, {
42
+ size: 'medium',
43
+ variant: 'transparent',
44
+ color: 'neutral',
45
+ onClick: handleClick,
46
+ className: 'material_icon',
47
+ children: "calendar_today"
48
+ })
49
+ }), active && /*#__PURE__*/_jsx(Card, {
50
+ className: css.dateField__picker,
51
+ children: /*#__PURE__*/_jsx(DatePicker, {
52
+ onChange: handleChange,
53
+ selectsRange: true,
54
+ onBlur: () => {
55
+ setActive(false);
56
+ },
57
+ selected: value[0],
58
+ startDate: value[0],
59
+ endDate: value[1]
60
+ })
61
+ })]
62
+ })
63
+ });
64
+ });
65
+ export default Period;
@@ -0,0 +1,10 @@
1
+ @import "../../assets/styles";
2
+
3
+ .dateField{
4
+ position: relative;
5
+ }
6
+ .dateField__picker{
7
+ position: absolute;
8
+ top: 100%;
9
+ right: 0;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { SizeType } from '../../shared/types/theme';
3
+ type PropsType = {
4
+ size?: Exclude<SizeType, 'extraLarge'>;
5
+ value?: number;
6
+ defaultValue?: number;
7
+ onChange?: (value: number) => void;
8
+ } & Omit<InputHTMLAttributes<any>, 'value' | 'onChange' | 'defaultValue' | 'size'>;
9
+ declare const Rating: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
10
+ export default Rating;
@@ -0,0 +1,50 @@
1
+ "use client";
2
+
3
+ import css from './Rating.module.scss';
4
+ import { useState } from 'react';
5
+ import clsx from 'clsx';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
+ const Rating = props => {
10
+ let {
11
+ size = 'large',
12
+ onChange,
13
+ ...restProps
14
+ } = props;
15
+ let [value, setValue] = useState(props.defaultValue || 0);
16
+ let [hovered, setHovered] = useState(0);
17
+ let realValue = props.value !== undefined ? props.value : value;
18
+ const handleClick = index => () => {
19
+ setValue(index);
20
+ if (onChange) onChange(index);
21
+ };
22
+ const handleMouseEnter = index => () => {
23
+ setHovered(index);
24
+ };
25
+ const handleLeaveRating = () => {
26
+ setHovered(realValue);
27
+ };
28
+ return /*#__PURE__*/_jsx(_Fragment, {
29
+ children: /*#__PURE__*/_jsxs("div", {
30
+ className: css.rating,
31
+ onMouseLeave: handleLeaveRating,
32
+ children: [/*#__PURE__*/_jsx("input", {
33
+ value: value,
34
+ ...restProps,
35
+ type: "hidden"
36
+ }), [...Array(5)].map((_, index) => {
37
+ return /*#__PURE__*/_jsx("div", {
38
+ onClick: handleClick(index + 1),
39
+ onMouseEnter: handleMouseEnter(index + 1),
40
+ className: clsx('material_icon', {
41
+ ['material_icon_solid']: index + 1 <= hovered || index + 1 <= realValue,
42
+ [css.rating__item_disabled]: !!restProps.disabled
43
+ }, css.rating__item, css['rating_' + size]),
44
+ children: "star"
45
+ }, index);
46
+ })]
47
+ })
48
+ });
49
+ };
50
+ export default Rating;
@@ -0,0 +1,19 @@
1
+ @import "../../assets/styles";
2
+
3
+ .rating{
4
+ @include flex();
5
+ }
6
+ .rating__item{
7
+ cursor: pointer;
8
+ color: #F7B519;
9
+ font-size: 30px;
10
+ }
11
+ .rating_medium{
12
+ font-size: 24px;
13
+ }
14
+ .rating_small{
15
+ font-size: 18px;
16
+ }
17
+ .rating__item_disabled{
18
+ color: $color-gray-400;
19
+ }
@@ -0,0 +1,23 @@
1
+ import { OptionType } from '../../shared/types/theme';
2
+ import { TextFieldProps } from '../TextField/TextField';
3
+ type SelectBaseProps = {
4
+ options: OptionType[];
5
+ inline?: boolean;
6
+ };
7
+ type SelectSingleProps = {
8
+ multiple?: false;
9
+ value?: string;
10
+ defaultValue?: string;
11
+ onChange?: (option: string) => void;
12
+ };
13
+ type SelectMultipleProps = {
14
+ multiple?: true;
15
+ value?: string[];
16
+ defaultValue?: string[];
17
+ onChange?: (option: string[]) => void;
18
+ };
19
+ type SelectProps = SelectMultipleProps | SelectSingleProps;
20
+ type SelectPropsType = SelectBaseProps & SelectProps & Omit<TextFieldProps, 'value' | 'defaultValue' | 'onChange'>;
21
+ export declare const getOptionValue: (option: OptionType) => string;
22
+ declare function Select(props: SelectPropsType): import("react/jsx-runtime").JSX.Element;
23
+ export default Select;
@@ -0,0 +1,135 @@
1
+ "use client";
2
+
3
+ import TextField from '../TextField/TextField';
4
+ import { forwardRef, useRef, useState } from 'react';
5
+ import css from './Select.module.scss';
6
+ import ButtonIcon from '../../Button/ButtonIcon';
7
+ import clsx from 'clsx';
8
+ import ListItem from '../../List/ListItem';
9
+ import useClickOutside from '../../hooks/useClickOutside';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ export const getOptionValue = option => option.value || option.text;
14
+ function Select(props) {
15
+ var _options$find;
16
+ let {
17
+ options,
18
+ endAdornment,
19
+ className,
20
+ inline,
21
+ multiple = false,
22
+ value,
23
+ defaultValue,
24
+ onChange,
25
+ ...inputProps
26
+ } = props;
27
+ let [active, setActive] = useState(false);
28
+ let [selected, setSelected] = useState(defaultValue || (multiple ? [] : ''));
29
+ let selectRef = useRef(null);
30
+ let optRef = useClickOutside(() => setActive(false));
31
+ const handleActive = flag => {
32
+ setActive(prev => flag !== undefined ? flag : !prev);
33
+ };
34
+ const handleSelect = option => {
35
+ let v = getOptionValue(option);
36
+ let mSelected = selected;
37
+ let newValueS = v;
38
+ let newValueM = mSelected.includes(v) ? mSelected.filter(item => item !== v) : mSelected.concat(v);
39
+ setSelected(multiple ? newValueM : newValueS);
40
+ if (onChange) onChange(multiple ? newValueM : newValueS);
41
+ if (!multiple) setActive(false);
42
+
43
+ // if(selectRef.current)
44
+ // selectRef.current.dispatchEvent(new Event('change', { bubbles: true }))
45
+ };
46
+
47
+ // const handleChange = (e: ChangeEvent<HTMLSelectElement>) => {
48
+ // let option = options.find(item => getOptionValue(item) === e.target.value)
49
+ // if( option )
50
+ // {
51
+ // let v = getOptionValue(option)
52
+ // setSelected(!multiple ? v : prev => prev?.concat(v) || [v])
53
+ // if( !multiple )
54
+ // setActive(false)
55
+ // }
56
+ // }
57
+
58
+ let selectEndAdornment = /*#__PURE__*/_jsxs(_Fragment, {
59
+ children: [endAdornment, /*#__PURE__*/_jsx(ButtonIcon, {
60
+ onClick: () => handleActive,
61
+ size: 'small',
62
+ variant: 'transparent',
63
+ className: 'material_icon',
64
+ children: "arrow_drop_down"
65
+ })]
66
+ });
67
+ let selectProps = {};
68
+ // if( value !== undefined )
69
+ // {
70
+ // selectProps.value = value
71
+ // selectProps.onChange = handleChange
72
+ // }
73
+
74
+ let realValue = value !== undefined ? value : selected;
75
+ let selectedText = multiple ? options.filter(item => realValue == null ? void 0 : realValue.includes(getOptionValue(item))).map(item => item.text).join(', ') : ((_options$find = options.find(item => getOptionValue(item) === realValue)) == null ? void 0 : _options$find.text) || '';
76
+ return /*#__PURE__*/_jsx(_Fragment, {
77
+ children: /*#__PURE__*/_jsxs("div", {
78
+ className: css.select,
79
+ children: [/*#__PURE__*/_jsxs("div", {
80
+ className: css.select__input_wrapper,
81
+ children: [/*#__PURE__*/_jsx("select", {
82
+ multiple: multiple,
83
+ ref: selectRef,
84
+ ...selectProps,
85
+ style: {
86
+ display: 'none'
87
+ },
88
+ children: options.map(item => /*#__PURE__*/_jsx("option", {
89
+ children: item.text
90
+ }, item.text))
91
+ }), /*#__PURE__*/_jsx(TextField, {
92
+ ...inputProps,
93
+ value: selectedText,
94
+ onClick: () => setActive(true),
95
+ className: clsx(css.select__input, className),
96
+ endAdornment: selectEndAdornment
97
+ })]
98
+ }), active && /*#__PURE__*/_jsx(SelectOptions, {
99
+ ref: optRef,
100
+ options: options,
101
+ multiple: multiple,
102
+ value: realValue,
103
+ inline: inline,
104
+ onClick: handleSelect
105
+ })]
106
+ })
107
+ });
108
+ }
109
+ const SelectOptions = /*#__PURE__*/forwardRef((props, ref) => {
110
+ let {
111
+ options,
112
+ value,
113
+ multiple,
114
+ inline,
115
+ onClick
116
+ } = props;
117
+ return /*#__PURE__*/_jsx(_Fragment, {
118
+ children: /*#__PURE__*/_jsx("div", {
119
+ ref: ref,
120
+ className: clsx(css.options, {
121
+ [css.options_inline]: !!inline
122
+ }),
123
+ children: options.map((item, index) => {
124
+ let optValue = getOptionValue(item);
125
+ let active = multiple === true && value ? value.includes(optValue) : optValue === value;
126
+ return /*#__PURE__*/_jsx(ListItem, {
127
+ active: active,
128
+ onClick: () => onClick(item),
129
+ children: item.text
130
+ }, index);
131
+ })
132
+ })
133
+ });
134
+ });
135
+ export default Select;
@@ -0,0 +1,26 @@
1
+ @import "../../assets/styles";
2
+
3
+ .select{
4
+ position: relative;
5
+ }
6
+ .select__input_wrapper{
7
+
8
+ }
9
+ .select__input{
10
+ cursor: pointer;
11
+ & * {
12
+ cursor: pointer;
13
+ }
14
+ }
15
+ .options{
16
+ padding: $size-step 0;
17
+ border-radius: $radius;
18
+ box-shadow: $box-shadow;
19
+ position: absolute;
20
+ left:0;
21
+ top:100%;
22
+ width:100%;
23
+ }
24
+ .options_inline{
25
+ position: static;
26
+ }
@@ -0,0 +1,7 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { SizeType } from '../../shared/types/theme';
3
+ type SwitchProps = {
4
+ size?: Exclude<SizeType, 'extraLarge' | 'medium'>;
5
+ } & Omit<InputHTMLAttributes<any>, 'size'>;
6
+ declare const Switch: (props: SwitchProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default Switch;
@@ -0,0 +1,25 @@
1
+ import css from './Switch.module.scss';
2
+ import clsx from 'clsx';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { Fragment as _Fragment } from "react/jsx-runtime";
6
+ const Switch = props => {
7
+ let {
8
+ onChange,
9
+ size,
10
+ ...restProps
11
+ } = props;
12
+ return /*#__PURE__*/_jsx(_Fragment, {
13
+ children: /*#__PURE__*/_jsxs("label", {
14
+ className: clsx(css.switch, css['switch_' + props.size]),
15
+ children: [/*#__PURE__*/_jsx("input", {
16
+ className: css.switch__input,
17
+ ...restProps,
18
+ type: "checkbox"
19
+ }), /*#__PURE__*/_jsx("span", {
20
+ className: css.switch__slider
21
+ })]
22
+ })
23
+ });
24
+ };
25
+ export default Switch;