@ozen-ui/kit 0.40.0 → 0.42.0

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/README.md +1 -1
  2. package/__inner__/cjs/components/Autocomplete/helper.d.ts +2 -0
  3. package/__inner__/cjs/components/Autocomplete/types.d.ts +2 -2
  4. package/__inner__/cjs/components/FieldControl/FieldControl.css +25 -19
  5. package/__inner__/cjs/components/FieldLabel/FieldLabel.css +6 -6
  6. package/__inner__/cjs/components/Fieldset/Fieldset.css +1 -1
  7. package/__inner__/cjs/components/FilePicker/FilePicker.css +38 -98
  8. package/__inner__/cjs/components/FilePicker/FilePicker.d.ts +71 -1
  9. package/__inner__/cjs/components/FilePicker/FilePicker.js +26 -25
  10. package/__inner__/cjs/components/FilePicker/types.d.ts +19 -7
  11. package/__inner__/cjs/components/IconButtonNext/IconButton.css +1 -0
  12. package/__inner__/cjs/components/Input/Input.css +2 -2
  13. package/__inner__/cjs/components/Input/Input.js +2 -2
  14. package/__inner__/cjs/components/Input/types.d.ts +3 -0
  15. package/__inner__/cjs/components/InputNumber/InputNumber.css +2 -2
  16. package/__inner__/cjs/components/InputNumber/InputNumber.js +2 -2
  17. package/__inner__/cjs/components/InputNumber/types.d.ts +4 -1
  18. package/__inner__/cjs/components/Pagination/Pagination.css +9 -9
  19. package/__inner__/cjs/components/Pagination/Pagination.d.ts +2 -2
  20. package/__inner__/cjs/components/Pagination/Pagination.js +21 -11
  21. package/__inner__/cjs/components/Pagination/components/PaginationItem/PaginationItem.css +19 -13
  22. package/__inner__/cjs/components/Pagination/components/PaginationItem/PaginationItem.js +7 -6
  23. package/__inner__/cjs/components/Pagination/constants.d.ts +4 -0
  24. package/__inner__/cjs/components/Pagination/constants.js +5 -1
  25. package/__inner__/cjs/components/Pagination/helpers/getItemAriaLabel/getItemAriaLabel.js +4 -4
  26. package/__inner__/cjs/components/Pagination/types.d.ts +6 -3
  27. package/__inner__/cjs/components/Select/Select.css +2 -2
  28. package/__inner__/cjs/components/Select/Select.js +2 -2
  29. package/__inner__/cjs/components/Select/components/SelectInput/SelectInput.js +2 -2
  30. package/__inner__/cjs/components/Select/components/SelectInput/types.d.ts +5 -1
  31. package/__inner__/cjs/components/Select/types.d.ts +2 -2
  32. package/__inner__/cjs/components/Textarea/Textarea.css +2 -2
  33. package/__inner__/cjs/components/Textarea/Textarea.js +2 -2
  34. package/__inner__/cjs/components/Textarea/components/TextareaConsumer.js +2 -2
  35. package/__inner__/cjs/components/Textarea/types.d.ts +4 -1
  36. package/__inner__/cjs/locale/locale.js +58 -0
  37. package/__inner__/esm/components/Autocomplete/Autocomplete.js +2 -2
  38. package/__inner__/esm/components/Autocomplete/helper.d.ts +2 -0
  39. package/__inner__/esm/components/Autocomplete/types.d.ts +2 -2
  40. package/__inner__/esm/components/FieldControl/FieldControl.css +25 -19
  41. package/__inner__/esm/components/FieldLabel/FieldLabel.css +6 -6
  42. package/__inner__/esm/components/Fieldset/Fieldset.css +1 -1
  43. package/__inner__/esm/components/FilePicker/FilePicker.css +38 -98
  44. package/__inner__/esm/components/FilePicker/FilePicker.d.ts +71 -1
  45. package/__inner__/esm/components/FilePicker/FilePicker.js +28 -27
  46. package/__inner__/esm/components/FilePicker/types.d.ts +19 -7
  47. package/__inner__/esm/components/IconButtonNext/IconButton.css +1 -0
  48. package/__inner__/esm/components/Input/Input.css +2 -2
  49. package/__inner__/esm/components/Input/Input.js +2 -2
  50. package/__inner__/esm/components/Input/types.d.ts +3 -0
  51. package/__inner__/esm/components/InputNumber/InputNumber.css +2 -2
  52. package/__inner__/esm/components/InputNumber/InputNumber.js +5 -5
  53. package/__inner__/esm/components/InputNumber/types.d.ts +4 -1
  54. package/__inner__/esm/components/Pagination/Pagination.css +9 -9
  55. package/__inner__/esm/components/Pagination/Pagination.d.ts +2 -2
  56. package/__inner__/esm/components/Pagination/Pagination.js +23 -13
  57. package/__inner__/esm/components/Pagination/components/PaginationItem/PaginationItem.css +19 -13
  58. package/__inner__/esm/components/Pagination/components/PaginationItem/PaginationItem.js +8 -7
  59. package/__inner__/esm/components/Pagination/constants.d.ts +4 -0
  60. package/__inner__/esm/components/Pagination/constants.js +4 -0
  61. package/__inner__/esm/components/Pagination/helpers/getItemAriaLabel/getItemAriaLabel.js +4 -4
  62. package/__inner__/esm/components/Pagination/types.d.ts +6 -3
  63. package/__inner__/esm/components/Select/Select.css +2 -2
  64. package/__inner__/esm/components/Select/Select.js +3 -3
  65. package/__inner__/esm/components/Select/components/SelectInput/SelectInput.js +2 -2
  66. package/__inner__/esm/components/Select/components/SelectInput/types.d.ts +5 -1
  67. package/__inner__/esm/components/Select/types.d.ts +2 -2
  68. package/__inner__/esm/components/Textarea/Textarea.css +2 -2
  69. package/__inner__/esm/components/Textarea/Textarea.js +2 -2
  70. package/__inner__/esm/components/Textarea/components/TextareaConsumer.js +2 -2
  71. package/__inner__/esm/components/Textarea/types.d.ts +4 -1
  72. package/__inner__/esm/locale/locale.js +58 -0
  73. package/package.json +4 -4
@@ -12,10 +12,10 @@ export var Textarea = forwardRef(function (inProps, ref) {
12
12
  props: inProps,
13
13
  name: 'Textarea',
14
14
  });
15
- var _a = props.size, size = _a === void 0 ? TEXTAREA_DEFAULT_SIZE : _a, autoFocus = props.autoFocus, maxLength = props.maxLength, expand = props.expand, placeholder = props.placeholder, id = props.id, name = props.name, error = props.error, fullWidth = props.fullWidth, cols = props.cols, rows = props.rows, className = props.className, label = props.label, hint = props.hint, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, required = props.required, disabled = props.disabled, textareaProps = props.textareaProps, labelProps = props.labelProps, labelRef = props.labelRef, textareaRef = props.textareaRef, other = __rest(props, ["size", "autoFocus", "maxLength", "expand", "placeholder", "id", "name", "error", "fullWidth", "cols", "rows", "className", "label", "hint", "value", "defaultValue", "onChange", "required", "disabled", "textareaProps", "labelProps", "labelRef", "textareaRef"]);
15
+ var _a = props.size, size = _a === void 0 ? TEXTAREA_DEFAULT_SIZE : _a, autoFocus = props.autoFocus, maxLength = props.maxLength, expand = props.expand, placeholder = props.placeholder, id = props.id, name = props.name, error = props.error, fullWidth = props.fullWidth, cols = props.cols, rows = props.rows, className = props.className, label = props.label, hint = props.hint, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, required = props.required, disabled = props.disabled, textareaProps = props.textareaProps, labelProps = props.labelProps, hintProps = props.hintProps, labelRef = props.labelRef, textareaRef = props.textareaRef, other = __rest(props, ["size", "autoFocus", "maxLength", "expand", "placeholder", "id", "name", "error", "fullWidth", "cols", "rows", "className", "label", "hint", "value", "defaultValue", "onChange", "required", "disabled", "textareaProps", "labelProps", "hintProps", "labelRef", "textareaRef"]);
16
16
  return (React.createElement(FieldControl, __assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { className: cnTextarea({
17
17
  expand: expand,
18
18
  }, [className]), ref: ref }),
19
- React.createElement(TextareaConsumer, { autoFocus: autoFocus, maxLength: maxLength, placeholder: placeholder, id: id, name: name, cols: cols, expand: expand, rows: rows, label: label, hint: hint, value: value, defaultValue: defaultValue, onChange: onChange, textareaRef: textareaRef, textareaProps: textareaProps, labelRef: labelRef, labelProps: labelProps })));
19
+ React.createElement(TextareaConsumer, { autoFocus: autoFocus, maxLength: maxLength, placeholder: placeholder, id: id, name: name, cols: cols, expand: expand, rows: rows, label: label, hint: hint, value: value, defaultValue: defaultValue, onChange: onChange, textareaRef: textareaRef, textareaProps: textareaProps, labelRef: labelRef, labelProps: labelProps, hintProps: hintProps })));
20
20
  });
21
21
  Textarea.displayName = 'Textarea';
@@ -9,7 +9,7 @@ import { Fieldset } from '../../Fieldset';
9
9
  import { cnTextarea } from '../../Textarea';
10
10
  import { TextareaCounter } from './index';
11
11
  export var TextareaConsumer = function (_a) {
12
- var labelProps = _a.labelProps, labelRef = _a.labelRef, maxLength = _a.maxLength, label = _a.label, id = _a.id, name = _a.name, cols = _a.cols, rows = _a.rows, disabled = _a.disabled, valueProp = _a.value, required = _a.required, defaultValue = _a.defaultValue, placeholder = _a.placeholder, autoFocus = _a.autoFocus, textareaProps = _a.textareaProps, onChange = _a.onChange, textareaRef = _a.textareaRef, expand = _a.expand, hint = _a.hint;
12
+ var labelProps = _a.labelProps, hintProps = _a.hintProps, labelRef = _a.labelRef, maxLength = _a.maxLength, label = _a.label, id = _a.id, name = _a.name, cols = _a.cols, rows = _a.rows, disabled = _a.disabled, valueProp = _a.value, required = _a.required, defaultValue = _a.defaultValue, placeholder = _a.placeholder, autoFocus = _a.autoFocus, textareaProps = _a.textareaProps, onChange = _a.onChange, textareaRef = _a.textareaRef, expand = _a.expand, hint = _a.hint;
13
13
  var fieldRef = useRef(null);
14
14
  var context = useFieldControl();
15
15
  var _b = __read(context, 1), value = _b[0].value;
@@ -26,7 +26,7 @@ export var TextareaConsumer = function (_a) {
26
26
  React.createElement(FieldLabel, __assign({}, labelProps, { className: cnTextarea('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref) }), label),
27
27
  React.createElement(FieldInput, __assign({ as: "textarea", id: id, name: name, cols: cols, rows: rows, disabled: disabled, value: valueProp, required: required, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder, autoFocus: autoFocus, onChange: onChange }, textareaProps, { className: cnTextarea('Field', {}, [textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.className]), ref: useMultiRef([textareaRef || (textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.ref), fieldRef]) })),
28
28
  React.createElement(Fieldset, null)),
29
- React.createElement(FieldHint, null,
29
+ React.createElement(FieldHint, __assign({}, hintProps),
30
30
  hint,
31
31
  maxLength && React.createElement(TextareaCounter, { maxLength: maxLength }))));
32
32
  };
@@ -1,6 +1,7 @@
1
- import type { Ref, ComponentPropsWithRef } from 'react';
1
+ import type { ComponentPropsWithRef, Ref } from 'react';
2
2
  import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
3
3
  import type { FIELD_CONTROL_DEFAULT_TAG } from '../FieldControl';
4
+ import type { FieldHintProps } from '../FieldHint';
4
5
  import type { FieldLabelProps } from '../FieldLabel';
5
6
  export type TextareaSizeVariant = FormElementSizeVariant;
6
7
  export declare const textareaExpandVariant: readonly ["autoSize", "verticalResize"];
@@ -61,6 +62,8 @@ export type TextareaProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFA
61
62
  };
62
63
  /** Свойства FieldLabel */
63
64
  labelProps?: FieldLabelProps;
65
+ /** Cвойства FieldHint */
66
+ hintProps?: Omit<FieldHintProps, 'children'>;
64
67
  /** data-атрибут для тестирования */
65
68
  'data-testid'?: string;
66
69
  } & TextareaPropsDeprecated;
@@ -1,3 +1,4 @@
1
+ import { NEXT, PAGE, PREVIOUS } from '../components/Pagination/constants';
1
2
  export var ruRU = {
2
3
  defaultProps: {
3
4
  Autocomplete: {
@@ -28,6 +29,25 @@ export var ruRU = {
28
29
  incrementButtonText: 'Увеличить',
29
30
  decrementButtonText: 'Уменьшить',
30
31
  },
32
+ Pagination: {
33
+ 'aria-label': 'Навигация по страницам',
34
+ getItemAriaLabel: function (_a) {
35
+ var page = _a.page, type = _a.type, selected = _a.selected;
36
+ if (type === NEXT) {
37
+ return 'Перейти на следующую страницу';
38
+ }
39
+ if (type === PREVIOUS) {
40
+ return 'Перейти на предыдущую страницу';
41
+ }
42
+ if (selected) {
43
+ return "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 ".concat(page);
44
+ }
45
+ if (type === PAGE) {
46
+ return "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 ".concat(page);
47
+ }
48
+ return '';
49
+ },
50
+ },
31
51
  },
32
52
  };
33
53
  export var kkKZ = {
@@ -60,6 +80,25 @@ export var kkKZ = {
60
80
  incrementButtonText: 'Үлкейту',
61
81
  decrementButtonText: 'Азайту',
62
82
  },
83
+ Pagination: {
84
+ 'aria-label': 'Беттерді шарлау',
85
+ getItemAriaLabel: function (_a) {
86
+ var page = _a.page, type = _a.type, selected = _a.selected;
87
+ if (type === NEXT) {
88
+ return 'Келесі бетке өтіңіз';
89
+ }
90
+ if (type === PREVIOUS) {
91
+ return 'Алдыңғы бетке өтіңіз';
92
+ }
93
+ if (selected) {
94
+ return "".concat(page, " \u0431\u0435\u0442");
95
+ }
96
+ if (type === PAGE) {
97
+ return "".concat(page, "-\u0431\u0435\u0442\u043A\u0435 \u04E9\u0442\u0456\u04A3\u0456\u0437");
98
+ }
99
+ return '';
100
+ },
101
+ },
63
102
  },
64
103
  };
65
104
  export var enUS = {
@@ -92,5 +131,24 @@ export var enUS = {
92
131
  incrementButtonText: 'Increment',
93
132
  decrementButtonText: 'Decrement',
94
133
  },
134
+ Pagination: {
135
+ 'aria-label': 'Pagination navigation',
136
+ getItemAriaLabel: function (_a) {
137
+ var page = _a.page, type = _a.type, selected = _a.selected;
138
+ if (type === NEXT) {
139
+ return 'Go to next page';
140
+ }
141
+ if (type === PREVIOUS) {
142
+ return 'Go to previous page';
143
+ }
144
+ if (selected) {
145
+ return "Page ".concat(page);
146
+ }
147
+ if (type === PAGE) {
148
+ return "Go to page ".concat(page);
149
+ }
150
+ return '';
151
+ },
152
+ },
95
153
  },
96
154
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozen-ui/kit",
3
- "version": "0.40.0",
3
+ "version": "0.42.0",
4
4
  "description": "React component library",
5
5
  "files": [
6
6
  "*"
@@ -27,9 +27,9 @@
27
27
  "react-popper": "^2.3.0",
28
28
  "react-transition-group": "^4.4.5",
29
29
  "tslib": "^2.6.2",
30
- "@ozen-ui/fonts": "0.40.0",
31
- "@ozen-ui/icons": "0.40.0",
32
- "@ozen-ui/logger": "0.40.0"
30
+ "@ozen-ui/fonts": "0.42.0",
31
+ "@ozen-ui/logger": "0.42.0",
32
+ "@ozen-ui/icons": "0.42.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=17.0.2 <19.0.0",