@egov3/system-design 1.2.60 → 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.
- package/dist/cjs/components/Button/index.d.ts +5 -4
- package/dist/cjs/components/InputField/index.d.ts +1 -0
- package/dist/cjs/components/index.d.ts +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stories/Button.stories.d.ts +1 -1
- package/dist/esm/components/Button/index.d.ts +5 -4
- package/dist/esm/components/InputField/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/index.d.ts +5 -3
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/Button.stories.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
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?:
|
|
10
|
-
size?:
|
|
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;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
declare const SystemDesign: {
|
|
3
3
|
Components: {
|
|
4
4
|
Accordion: ({ open, setOpen, children, title, }: import("./components/Accordion").IAccordionProps) => import("react").JSX.Element;
|
|
5
|
-
Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: import("./components/Button").IButtonProps) => import("react").JSX.Element;
|
|
5
|
+
Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, dataTestid, }: import("./components/Button").IButtonProps) => import("react").JSX.Element;
|
|
6
6
|
CustomRadioButton: ({ label, name, checked, onChange, value, }: import("./components/RadioGroup").ICustomRadioButtonProps) => import("react").JSX.Element;
|
|
7
7
|
InputField: import("react").ForwardRefExoticComponent<Omit<import("./components/InputField").IInputFieldProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
8
8
|
Modal: ({ open, setOpen, children, headerTitle, variant, }: import("./components/Modal").IModalProps) => import("react").JSX.Element | null;
|
package/dist/cjs/index.js
CHANGED
|
@@ -2849,8 +2849,8 @@ var btnTypography = {
|
|
|
2849
2849
|
large: typography.body1Medium,
|
|
2850
2850
|
};
|
|
2851
2851
|
var Button = function (_a) {
|
|
2852
|
-
var onClick = _a.onClick, children = _a.children, style = _a.style, _b = _a.className, className = _b === void 0 ?
|
|
2853
|
-
return (React.createElement("button", { "data-testid":
|
|
2852
|
+
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;
|
|
2853
|
+
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
|
|
2854
2854
|
? styles$5["btn-rounded--".concat(size)]
|
|
2855
2855
|
: 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));
|
|
2856
2856
|
};
|
|
@@ -2910,7 +2910,7 @@ var ClearIcon = function (_a) {
|
|
|
2910
2910
|
|
|
2911
2911
|
// InputField.tsx
|
|
2912
2912
|
var InputField = react.exports.forwardRef(function (_a, ref) {
|
|
2913
|
-
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;
|
|
2913
|
+
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;
|
|
2914
2914
|
var handleClear = function () {
|
|
2915
2915
|
if (onChange) {
|
|
2916
2916
|
onChange({
|
|
@@ -2933,7 +2933,7 @@ var InputField = react.exports.forwardRef(function (_a, ref) {
|
|
|
2933
2933
|
onEnterPress(event);
|
|
2934
2934
|
}
|
|
2935
2935
|
};
|
|
2936
|
-
return (React.createElement("div", { "data-testid":
|
|
2936
|
+
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 },
|
|
2937
2937
|
labelText.length > 0 && (React.createElement("label", { htmlFor: id, "data-testid": "InputField_LABEL" }, labelText)),
|
|
2938
2938
|
inputLeftIcon,
|
|
2939
2939
|
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 }),
|