@egov3/system-design 1.2.58 → 1.2.61

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.
@@ -2,7 +2,7 @@
2
2
  import type { StoryObj } from "@storybook/react";
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: import("../components/Button").IButtonProps) => import("react").JSX.Element;
5
+ component: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, dataTestid, }: import("../components/Button").IButtonProps) => import("react").JSX.Element;
6
6
  parameters: {
7
7
  layout: string;
8
8
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  export interface IButtonProps {
3
3
  ariaLabel?: string;
4
4
  onClick?: () => void;
@@ -6,8 +6,9 @@ export interface IButtonProps {
6
6
  className?: string;
7
7
  isRounded?: boolean;
8
8
  disabled?: boolean;
9
- variant?: 'default' | 'tinted' | 'secondary';
10
- size?: 'mini' | 'small' | 'medium' | 'large';
9
+ variant?: "default" | "tinted" | "secondary";
10
+ size?: "mini" | "small" | "medium" | "large";
11
11
  style?: React.CSSProperties;
12
+ dataTestid?: string;
12
13
  }
13
- export declare const Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: IButtonProps) => React.JSX.Element;
14
+ export declare const Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, dataTestid, }: IButtonProps) => React.JSX.Element;
@@ -17,5 +17,6 @@ export interface IInputFieldProps extends React.DetailedHTMLProps<React.InputHTM
17
17
  focused?: boolean;
18
18
  setFocused?: (val: boolean) => void;
19
19
  readOnly?: boolean;
20
+ dataTestid?: string;
20
21
  }
21
22
  export declare const InputField: React.ForwardRefExoticComponent<Omit<IInputFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -3,7 +3,7 @@ import { Button } from "./Button";
3
3
  import "../styles/colors.css";
4
4
  export declare const Components: {
5
5
  Accordion: ({ open, setOpen, children, title, }: import("./Accordion").IAccordionProps) => import("react").JSX.Element;
6
- Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: import("./Button").IButtonProps) => import("react").JSX.Element;
6
+ Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, dataTestid, }: import("./Button").IButtonProps) => import("react").JSX.Element;
7
7
  CustomRadioButton: ({ label, name, checked, onChange, value, }: import("./RadioGroup").ICustomRadioButtonProps) => import("react").JSX.Element;
8
8
  InputField: import("react").ForwardRefExoticComponent<Omit<import("./InputField").IInputFieldProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
9
9
  Modal: ({ open, setOpen, children, headerTitle, variant, }: import("./Modal").IModalProps) => import("react").JSX.Element | null;
@@ -47,6 +47,7 @@ interface IInputFieldProps extends React__default.DetailedHTMLProps<React__defau
47
47
  focused?: boolean;
48
48
  setFocused?: (val: boolean) => void;
49
49
  readOnly?: boolean;
50
+ dataTestid?: string;
50
51
  }
51
52
 
52
53
  interface RadioGroupItem {
@@ -74,9 +75,10 @@ interface IButtonProps {
74
75
  className?: string;
75
76
  isRounded?: boolean;
76
77
  disabled?: boolean;
77
- variant?: 'default' | 'tinted' | 'secondary';
78
- size?: 'mini' | 'small' | 'medium' | 'large';
78
+ variant?: "default" | "tinted" | "secondary";
79
+ size?: "mini" | "small" | "medium" | "large";
79
80
  style?: React__default.CSSProperties;
81
+ dataTestid?: string;
80
82
  }
81
83
 
82
84
  interface IAccordionProps {
@@ -89,7 +91,7 @@ interface IAccordionProps {
89
91
  declare const SystemDesign: {
90
92
  Components: {
91
93
  Accordion: ({ open, setOpen, children, title, }: IAccordionProps) => React.JSX.Element;
92
- Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: IButtonProps) => React.JSX.Element;
94
+ Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, dataTestid, }: IButtonProps) => React.JSX.Element;
93
95
  CustomRadioButton: ({ label, name, checked, onChange, value, }: ICustomRadioButtonProps) => React.JSX.Element;
94
96
  InputField: React.ForwardRefExoticComponent<Omit<IInputFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
95
97
  Modal: ({ open, setOpen, children, headerTitle, variant, }: IModalProps) => React.JSX.Element | null;
package/dist/esm/index.js CHANGED
@@ -2847,8 +2847,8 @@ var btnTypography = {
2847
2847
  large: typography.body1Medium,
2848
2848
  };
2849
2849
  var Button = function (_a) {
2850
- var onClick = _a.onClick, children = _a.children, style = _a.style, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.isRounded, isRounded = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.variant, variant = _e === void 0 ? 'default' : _e, _f = _a.size, size = _f === void 0 ? 'medium' : _f, _g = _a.ariaLabel, ariaLabel = _g === void 0 ? 'Кнопка' : _g;
2851
- return (React.createElement("button", { "data-testid": "Button_MAIN", "aria-label": ariaLabel, disabled: disabled, "aria-disabled": disabled, onClick: onClick, className: joinClasses(styles$5["btn--".concat(size)], btnTypography[size], isRounded
2850
+ var onClick = _a.onClick, children = _a.children, style = _a.style, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.isRounded, isRounded = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.variant, variant = _e === void 0 ? "default" : _e, _f = _a.size, size = _f === void 0 ? "medium" : _f, _g = _a.ariaLabel, ariaLabel = _g === void 0 ? "Кнопка" : _g, _h = _a.dataTestid, dataTestid = _h === void 0 ? "Button_MAIN" : _h;
2851
+ return (React.createElement("button", { "data-testid": dataTestid, "aria-label": ariaLabel, disabled: disabled, "aria-disabled": disabled, onClick: onClick, className: joinClasses(styles$5["btn--".concat(size)], btnTypography[size], isRounded
2852
2852
  ? styles$5["btn-rounded--".concat(size)]
2853
2853
  : styles$5["btn-square--".concat(size)], disabled ? styles$5["btn-".concat(variant, "--disabled")] : styles$5["btn-".concat(variant)], styles$5.button, className), style: style }, children));
2854
2854
  };
@@ -2908,7 +2908,7 @@ var ClearIcon = function (_a) {
2908
2908
 
2909
2909
  // InputField.tsx
2910
2910
  var InputField = react.exports.forwardRef(function (_a, ref) {
2911
- var onFocus = _a.onFocus, onBlur = _a.onBlur, onChange = _a.onChange, onEnterPress = _a.onEnterPress, _b = _a.value, value = _b === void 0 ? "" : _b, inputLeftIcon = _a.inputLeftIcon, _c = _a.placeholder, placeholder = _c === void 0 ? "" : _c, _d = _a.className, className = _d === void 0 ? "" : _d, style = _a.style, _e = _a.isClearable, isClearable = _e === void 0 ? false : _e, _f = _a.type, type = _f === void 0 ? "text" : _f, id = _a.id, _g = _a.labelText, labelText = _g === void 0 ? "" : _g, _h = _a.ariaLabel, ariaLabel = _h === void 0 ? "" : _h, _j = _a.focused, focused = _j === void 0 ? false : _j, _k = _a.setFocused, setFocused = _k === void 0 ? function () { } : _k, _l = _a.readOnly, readOnly = _l === void 0 ? false : _l;
2911
+ var onFocus = _a.onFocus, onBlur = _a.onBlur, onChange = _a.onChange, onEnterPress = _a.onEnterPress, _b = _a.value, value = _b === void 0 ? "" : _b, inputLeftIcon = _a.inputLeftIcon, _c = _a.placeholder, placeholder = _c === void 0 ? "" : _c, _d = _a.className, className = _d === void 0 ? "" : _d, style = _a.style, _e = _a.isClearable, isClearable = _e === void 0 ? false : _e, _f = _a.type, type = _f === void 0 ? "text" : _f, id = _a.id, _g = _a.labelText, labelText = _g === void 0 ? "" : _g, _h = _a.ariaLabel, ariaLabel = _h === void 0 ? "" : _h, _j = _a.focused, focused = _j === void 0 ? false : _j, _k = _a.setFocused, setFocused = _k === void 0 ? function () { } : _k, _l = _a.readOnly, readOnly = _l === void 0 ? false : _l, _m = _a.dataTestid, dataTestid = _m === void 0 ? "InputField_MAIN" : _m;
2912
2912
  var handleClear = function () {
2913
2913
  if (onChange) {
2914
2914
  onChange({
@@ -2931,7 +2931,7 @@ var InputField = react.exports.forwardRef(function (_a, ref) {
2931
2931
  onEnterPress(event);
2932
2932
  }
2933
2933
  };
2934
- return (React.createElement("div", { "data-testid": "InputField_MAIN", className: joinClasses(styles$4[labelText.length ? "inputContainerLabeled" : "inputContainer"], focused ? styles$4["input--onfocus"] : undefined, type === 'text' ? typography.body1Regular : undefined, styles$4["input-".concat(type === null || type === void 0 ? void 0 : type.toLocaleLowerCase())], className), style: style },
2934
+ return (React.createElement("div", { "data-testid": dataTestid, className: joinClasses(styles$4[labelText.length ? "inputContainerLabeled" : "inputContainer"], focused ? styles$4["input--onfocus"] : undefined, type === "text" ? typography.body1Regular : undefined, styles$4["input-".concat(type === null || type === void 0 ? void 0 : type.toLocaleLowerCase())], className), style: style },
2935
2935
  labelText.length > 0 && (React.createElement("label", { htmlFor: id, "data-testid": "InputField_LABEL" }, labelText)),
2936
2936
  inputLeftIcon,
2937
2937
  React.createElement("input", { ref: ref, "data-testid": "InputField_INPUT", "aria-label": ariaLabel, id: id, type: type, className: styles$4.input, placeholder: placeholder, "aria-placeholder": placeholder, onFocus: handleFocus, onBlur: handleBlur, onChange: onChange, onKeyDown: handleKeyDown, value: value, readOnly: readOnly }),