armtek-uikit-react 1.0.256 → 1.0.259

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 (73) hide show
  1. package/assets/Accordion.scss +113 -123
  2. package/assets/Adornment.scss +22 -22
  3. package/assets/Alert.scss +56 -56
  4. package/assets/Avatar.scss +105 -111
  5. package/assets/AvatarGroup.scss +47 -47
  6. package/assets/BackDrop.scss +27 -27
  7. package/assets/Badge.scss +96 -96
  8. package/assets/Button.scss +750 -750
  9. package/assets/ButtonGroup.scss +37 -37
  10. package/assets/ButtonIcon.scss +32 -32
  11. package/assets/Card.scss +13 -13
  12. package/assets/Checkbox.scss +313 -313
  13. package/assets/Chip.scss +294 -313
  14. package/assets/DateField.scss +2 -2
  15. package/assets/DatePicker.scss +72 -72
  16. package/assets/Dropdown.scss +42 -42
  17. package/assets/FormControls.scss +14 -14
  18. package/assets/HelperText.scss +11 -11
  19. package/assets/Icon.scss +30 -30
  20. package/assets/Interval.scss +34 -34
  21. package/assets/Link.scss +96 -96
  22. package/assets/ListItem.scss +75 -73
  23. package/assets/Loader.scss +56 -56
  24. package/assets/Logo.scss +28 -28
  25. package/assets/Modal.scss +97 -97
  26. package/assets/Pagination.scss +3 -3
  27. package/assets/Paper.scss +19 -22
  28. package/assets/Period.scss +8 -8
  29. package/assets/Popper.scss +2 -2
  30. package/assets/Rating.scss +26 -26
  31. package/assets/Select.scss +85 -85
  32. package/assets/Skeleton.scss +25 -25
  33. package/assets/Slider.scss +5 -5
  34. package/assets/Stack.scss +27 -27
  35. package/assets/Status.scss +51 -69
  36. package/assets/StepItem.scss +89 -89
  37. package/assets/StepItemIcon.scss +47 -47
  38. package/assets/Stepper.scss +30 -30
  39. package/assets/Switch.scss +67 -67
  40. package/assets/Table.scss +37 -52
  41. package/assets/TextArea.scss +17 -17
  42. package/assets/TextField.scss +197 -197
  43. package/assets/Tooltip.scss +17 -17
  44. package/assets/classes.scss +422 -422
  45. package/assets/fonts.scss +24 -24
  46. package/assets/global.scss +221 -222
  47. package/assets/styles.min.css +1 -1
  48. package/assets/styles.min.css.map +1 -1
  49. package/assets/styles.scss +46 -46
  50. package/assets/variables.scss +13 -13
  51. package/lib/hooks/useEnhancedEffect.js +6 -6
  52. package/lib/hooks/useTimeout.js +2 -2
  53. package/package.json +1 -1
  54. package/ui/Avatar/Avatar.d.ts +0 -1
  55. package/ui/Avatar/Avatar.js +1 -2
  56. package/ui/Button/Button.d.ts +1 -1
  57. package/ui/ButtonIcon/ButtonIcon.d.ts +1 -1
  58. package/ui/Chip/Chip.d.ts +3 -2
  59. package/ui/Chip/Chip.js +20 -2
  60. package/ui/Form/DateField/DateField.js +0 -4
  61. package/ui/Form/DatePicker/styles.css +802 -802
  62. package/ui/Form/FormControls/FormControls.js +1 -1
  63. package/ui/Form/FormControls/const.d.ts +0 -1
  64. package/ui/Form/FormControls/const.js +2 -3
  65. package/ui/Form/Period/Period.d.ts +1 -12
  66. package/ui/Form/Period/Period.js +4 -16
  67. package/ui/Form/Select/Select.d.ts +2 -2
  68. package/ui/Form/Select/Select.js +4 -8
  69. package/ui/Form/Select/SelectSummary.d.ts +3 -3
  70. package/ui/Form/TimeField/TimeField.d.ts +1 -1
  71. package/ui/Modal/Modal.js +0 -1
  72. package/ui/Slider/style.scss +346 -346
  73. package/ui/Table/Table.js +1 -4
@@ -18,7 +18,7 @@ const FormControls = props => {
18
18
  ...divProps
19
19
  } = props;
20
20
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
21
- className: (0, _clsx.default)(_const.FORM_CONTROLS_CLASSNAME),
21
+ className: _const.FORM_CONTROLS_CLASSNAME,
22
22
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
23
23
  ...divProps,
24
24
  className: (0, _clsx.default)(className, 'arm-form-controls__stack'),
@@ -1,2 +1 @@
1
1
  export declare const FORM_CONTROLS_CLASSNAME = "arm-form-controls";
2
- export declare const FORM_CONTROLS_SKIP_REPLACE_CLASSNAME = "_skip_replace";
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.FORM_CONTROLS_SKIP_REPLACE_CLASSNAME = exports.FORM_CONTROLS_CLASSNAME = void 0;
5
- const FORM_CONTROLS_CLASSNAME = exports.FORM_CONTROLS_CLASSNAME = 'arm-form-controls';
6
- const FORM_CONTROLS_SKIP_REPLACE_CLASSNAME = exports.FORM_CONTROLS_SKIP_REPLACE_CLASSNAME = '_skip_replace';
4
+ exports.FORM_CONTROLS_CLASSNAME = void 0;
5
+ const FORM_CONTROLS_CLASSNAME = exports.FORM_CONTROLS_CLASSNAME = 'arm-form-controls';
@@ -6,17 +6,6 @@ export type PeriodChangeEvent = (Event & {
6
6
  name: string;
7
7
  };
8
8
  });
9
- export type PeriodProps = {
10
- onChange?: (e: PeriodChangeEvent) => void;
11
- value?: [Date | null, Date | null];
12
- defaultValue?: [Date | null, Date | null];
13
- disableSameDate?: boolean;
14
- minDate?: Date | null;
15
- maxDate?: Date | null;
16
- showMonthDropdown?: boolean;
17
- showYearDropdown?: boolean;
18
- datePickerProps?: DatePickerProps;
19
- } & Omit<TextFieldProps, 'value' | 'onChange' | 'defaultValue'>;
20
9
  export declare function getPeriodDisplay(date1: Date | null | undefined, date2: Date | null | undefined): string;
21
10
  declare const Period: import("react").ForwardRefExoticComponent<{
22
11
  onChange?: (e: PeriodChangeEvent) => void;
@@ -28,5 +17,5 @@ declare const Period: import("react").ForwardRefExoticComponent<{
28
17
  showMonthDropdown?: boolean;
29
18
  showYearDropdown?: boolean;
30
19
  datePickerProps?: DatePickerProps;
31
- } & Omit<TextFieldProps, "onChange" | "defaultValue" | "value"> & import("react").RefAttributes<unknown>>;
20
+ } & Omit<TextFieldProps, "defaultValue" | "onChange" | "value"> & import("react").RefAttributes<unknown>>;
32
21
  export default Period;
@@ -114,22 +114,9 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
114
114
  }
115
115
  }
116
116
  }
117
- if (startDateValid && endDateValid && startDateValid.getTime() <= endDateValid.getTime()) {
117
+ if (startDateValid && endDateValid) {
118
118
  handleSelect([startDateValid, endDateValid]);
119
- }
120
- // else
121
- // {
122
- // handleSelect([null, null])
123
- // }
124
- };
125
- const handleBlur = e => {
126
- setActive(false);
127
- const value = e.target.value;
128
- const valueParts = value.split(DELIMITER);
129
- const startDateValid = valueParts[0] ? validateDate(valueParts[0], minDate, maxDate) : null;
130
- const endDateValid = valueParts[1] ? validateDate(valueParts[1], minDate, maxDate) : null;
131
- if (!startDateValid || !endDateValid || startDateValid && endDateValid && endDateValid.getTime() < startDateValid.getTime()) {
132
- setTextValue('');
119
+ } else {
133
120
  handleSelect([null, null]);
134
121
  }
135
122
  };
@@ -160,8 +147,9 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
160
147
  placeholder: 'дд.мм.гггг - дд.мм.гггг',
161
148
  ...restProps,
162
149
  disabled: disabled,
150
+ id: 'period',
163
151
  value: textValue,
164
- onBlur: handleBlur,
152
+ onBlur: () => setActive(false),
165
153
  onChange: handleChange,
166
154
  onFocus: () => setActive(false),
167
155
  autoComplete: 'off',
@@ -1,5 +1,5 @@
1
1
  import { TextFieldProps } from '../TextField/TextField';
2
- import { MouseEvent, ReactNode } from 'react';
2
+ import { MouseEvent, KeyboardEvent, ReactNode } from 'react';
3
3
  export type OptionType = {
4
4
  text: string;
5
5
  value: string;
@@ -42,7 +42,7 @@ export type SelectOptionsType<T extends boolean> = {
42
42
  value?: T extends true ? string[] : string;
43
43
  inline?: boolean;
44
44
  multiple?: T;
45
- onClick: (e: MouseEvent, option: OptionType) => void;
45
+ onClick: (e: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>, option: OptionType) => void;
46
46
  listStyle?: 'checkbox' | 'default';
47
47
  onSelectAll?: (e: MouseEvent) => void;
48
48
  onClear?: (e: MouseEvent) => void;
@@ -59,19 +59,12 @@ function Select(props, ref) {
59
59
  return inputRef.current;
60
60
  }, []);
61
61
  const handleOpen = () => {
62
- if (open !== undefined) return;
63
62
  if (!inputProps.disabled) {
64
63
  setActive(true);
65
64
  // if( e.target instanceof HTMLDivElement )
66
65
  // setAnchorEl(e.currentTarget)
67
66
  }
68
67
  };
69
- function handleClose() {
70
- if (onClose) onClose();else {
71
- if (open !== undefined) return;
72
- setActive(false);
73
- }
74
- }
75
68
  const handleSelect = (e, option) => {
76
69
  if (e.target.classList.contains(_const.CHECKBOX_LABEL_CLASSNAME)) {
77
70
  e.stopPropagation();
@@ -97,7 +90,7 @@ function Select(props, ref) {
97
90
  if (search && !multiple) {
98
91
  setQ(options.find(item => getOptionValue(item) === newValueS).text);
99
92
  }
100
- if (!multiple) handleClose();
93
+ if (!multiple) setActive(false);
101
94
  };
102
95
  const handleSearch = e => {
103
96
  setQ(e.target.value);
@@ -155,6 +148,9 @@ function Select(props, ref) {
155
148
  if (!!search) options = options.filter(item => item.text.toLowerCase().includes(q.toLowerCase()));
156
149
  let valueArr = realValue ? Array.isArray(realValue) ? realValue : [realValue] : [];
157
150
  let selectedOptions = options.filter(item => valueArr.includes(getOptionValue(item)));
151
+ function handleClose() {
152
+ if (onClose) onClose();else setActive(false);
153
+ }
158
154
  let displayClear = clear && (multiple ? realValue && realValue.length > 0 : !!realValue);
159
155
  let selectEndAdornment = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
160
156
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Adornment.default, {
@@ -1,7 +1,7 @@
1
- import { MouseEvent } from 'react';
1
+ import { MouseEvent, KeyboardEvent } from 'react';
2
2
  import { OptionType } from '../../../ui/Form/Select/Select';
3
3
  export type SelectSummaryProps = {
4
- onClose: (e: MouseEvent, option: OptionType) => void;
4
+ onClose: (e: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>, option: OptionType) => void;
5
5
  options: OptionType[];
6
6
  value: string[];
7
7
  } & Omit<SelectSummaryControlsProps, 'countSelected' | 'countTotal'>;
@@ -9,7 +9,7 @@ export declare const SelectSummary: (props: SelectSummaryProps) => import("react
9
9
  type SelectSummaryChipsProps = {
10
10
  options: OptionType[];
11
11
  disabled?: boolean;
12
- onDelete: (e: MouseEvent, option: OptionType) => void;
12
+ onDelete: (e: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>, option: OptionType) => void;
13
13
  };
14
14
  export declare const SelectSummaryChips: (props: SelectSummaryChipsProps) => import("react/jsx-runtime").JSX.Element;
15
15
  type SelectSummaryControlsProps = {
@@ -9,10 +9,10 @@ declare const TimeField: import("react").ForwardRefExoticComponent<{
9
9
  showMonthYearPicker?: boolean;
10
10
  showYearPicker?: boolean;
11
11
  } & {
12
+ error?: boolean | undefined;
12
13
  label?: string | undefined;
13
14
  className?: string | undefined | undefined;
14
15
  placeholder?: string | undefined | undefined;
15
- error?: boolean | undefined;
16
16
  helperText?: import("react").ReactNode;
17
17
  } & Omit<import("react-datepicker").DatePickerProps, keyof {
18
18
  onClick?: (e: import("react").MouseEvent) => void;
package/ui/Modal/Modal.js CHANGED
@@ -19,7 +19,6 @@ function replaceControlsIfExists(container, props) {
19
19
  if (!body) return;
20
20
  const controls = body.querySelectorAll(`.${_const.FORM_CONTROLS_CLASSNAME}`);
21
21
  if (controls.length !== 1) return;
22
- if (controls[0].querySelector(`.${_const.FORM_CONTROLS_SKIP_REPLACE_CLASSNAME}`)) return;
23
22
  const footer = document.createElement("div");
24
23
  footer.classList.add(_const2.MODAL_FOOTER_CLASSNAME);
25
24
  if ((_props$classes = props.classes) != null && _props$classes['Arm-Modal__footer']) footer.classList.add((_props$classes2 = props.classes) == null ? void 0 : _props$classes2['Arm-Modal__footer']);