@egov3/system-design 1.0.29 → 1.0.31
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/Accordion/index.d.ts +8 -0
- package/dist/cjs/components/Button/index.d.ts +13 -1
- package/dist/cjs/components/InputField/index.d.ts +19 -0
- package/dist/cjs/components/RadioGroup/index.d.ts +18 -0
- package/dist/cjs/components/RadioToggle/index.d.ts +6 -0
- package/dist/cjs/components/index.d.ts +7 -2
- package/dist/cjs/index.d.ts +12 -1
- package/dist/cjs/index.js +163 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/svg/ClearIcon.d.ts +4 -0
- package/dist/cjs/svg/index.d.ts +2 -0
- package/dist/cjs/utils/ClassNamesFn.d.ts +1 -0
- package/dist/esm/components/Accordion/index.d.ts +8 -0
- package/dist/esm/components/Button/index.d.ts +13 -1
- package/dist/esm/components/InputField/index.d.ts +19 -0
- package/dist/esm/components/RadioGroup/index.d.ts +18 -0
- package/dist/esm/components/RadioToggle/index.d.ts +6 -0
- package/dist/esm/components/index.d.ts +7 -2
- package/dist/esm/index.d.ts +65 -4
- package/dist/esm/index.js +163 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/svg/ClearIcon.d.ts +4 -0
- package/dist/esm/svg/index.d.ts +2 -0
- package/dist/esm/utils/ClassNamesFn.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/components/Button/Button.d.ts +0 -6
- package/dist/cjs/components/Button/Button.stories.d.ts +0 -6
- package/dist/cjs/components/Button/Button.test.d.ts +0 -1
- package/dist/esm/components/Button/Button.d.ts +0 -6
- package/dist/esm/components/Button/Button.stories.d.ts +0 -6
- package/dist/esm/components/Button/Button.test.d.ts +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { Dispatch } from "react";
|
|
2
|
+
export interface IAccordionProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
setOpen: Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
title: React.JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export declare const Accordion: ({ open, setOpen, children, title, }: IAccordionProps) => React.JSX.Element;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IButtonProps {
|
|
3
|
+
ariaLabel?: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
isRounded?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
variant?: 'default' | 'tinted' | 'secondary';
|
|
10
|
+
size?: 'mini' | 'small' | 'medium' | 'large';
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
export declare const Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: IButtonProps) => React.JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { HTMLInputTypeAttribute } from "react";
|
|
2
|
+
export type TOtpType = "OTP" | "TEXT";
|
|
3
|
+
export interface IInputFieldProps {
|
|
4
|
+
onFocus?: () => void;
|
|
5
|
+
onBlur?: () => void;
|
|
6
|
+
onEnterPress?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
7
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
value?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
isClearable?: boolean;
|
|
13
|
+
inputLeftIcon?: JSX.Element;
|
|
14
|
+
type?: HTMLInputTypeAttribute;
|
|
15
|
+
id: string;
|
|
16
|
+
labelText?: string;
|
|
17
|
+
ariaLabel: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const InputField: ({ onFocus, onBlur, onChange, onEnterPress, value, inputLeftIcon, placeholder, className, style, isClearable, type, id, labelText, ariaLabel, }: IInputFieldProps) => React.ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface RadioGroupItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ICustomRadioButtonProps {
|
|
7
|
+
label: string;
|
|
8
|
+
name: string;
|
|
9
|
+
checked: boolean;
|
|
10
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IRadioGroupProps {
|
|
14
|
+
RadioGroupItems: RadioGroupItem[];
|
|
15
|
+
invokeCustomOnChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const CustomRadioButton: ({ label, name, checked, onChange, value, }: ICustomRadioButtonProps) => React.JSX.Element;
|
|
18
|
+
export declare const RadioGroup: ({ RadioGroupItems, invokeCustomOnChange, }: IRadioGroupProps) => React.JSX.Element;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
3
|
-
Button: (
|
|
2
|
+
export declare const Сomponents: {
|
|
3
|
+
Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: import("./Button").IButtonProps) => import("react").JSX.Element;
|
|
4
|
+
InputField: ({ onFocus, onBlur, onChange, onEnterPress, value, inputLeftIcon, placeholder, className, style, isClearable, type, id, labelText, ariaLabel, }: import("./InputField").IInputFieldProps) => import("react").ReactNode;
|
|
5
|
+
RadioGroup: ({ RadioGroupItems, invokeCustomOnChange, }: import("./RadioGroup").IRadioGroupProps) => import("react").JSX.Element;
|
|
6
|
+
CustomRadioButton: ({ label, name, checked, onChange, value, }: import("./RadioGroup").ICustomRadioButtonProps) => import("react").JSX.Element;
|
|
7
|
+
Accordion: ({ open, setOpen, children, title, }: import("./Accordion").IAccordionProps) => import("react").JSX.Element;
|
|
8
|
+
RadioToggle: ({ lock, setLock }: import("./RadioToggle").IRadioToggleProps) => import("react").JSX.Element;
|
|
4
9
|
};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const SystemDesign: {
|
|
3
|
+
Сomponents: {
|
|
4
|
+
Button: ({ onClick, children, style, className, isRounded, disabled, variant, size, ariaLabel, }: import("./components/Button").IButtonProps) => import("react").JSX.Element;
|
|
5
|
+
InputField: ({ onFocus, onBlur, onChange, onEnterPress, value, inputLeftIcon, placeholder, className, style, isClearable, type, id, labelText, ariaLabel, }: import("./components/InputField").IInputFieldProps) => import("react").ReactNode;
|
|
6
|
+
RadioGroup: ({ RadioGroupItems, invokeCustomOnChange, }: import("./components/RadioGroup").IRadioGroupProps) => import("react").JSX.Element;
|
|
7
|
+
CustomRadioButton: ({ label, name, checked, onChange, value, }: import("./components/RadioGroup").ICustomRadioButtonProps) => import("react").JSX.Element;
|
|
8
|
+
Accordion: ({ open, setOpen, children, title, }: import("./components/Accordion").IAccordionProps) => import("react").JSX.Element;
|
|
9
|
+
RadioToggle: ({ lock, setLock }: import("./components/RadioToggle").IRadioToggleProps) => import("react").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default SystemDesign;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var react = {exports: {}};
|
|
6
4
|
|
|
7
5
|
var react_production_min = {};
|
|
@@ -2783,6 +2781,14 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
2783
2781
|
|
|
2784
2782
|
var React = react.exports;
|
|
2785
2783
|
|
|
2784
|
+
var ClassNamesFn = function () {
|
|
2785
|
+
var args = [];
|
|
2786
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2787
|
+
args[_i] = arguments[_i];
|
|
2788
|
+
}
|
|
2789
|
+
return args.filter(function (item) { return !!item; }).join(" ");
|
|
2790
|
+
};
|
|
2791
|
+
|
|
2786
2792
|
function styleInject(css, ref) {
|
|
2787
2793
|
if ( ref === void 0 ) ref = {};
|
|
2788
2794
|
var insertAt = ref.insertAt;
|
|
@@ -2810,16 +2816,165 @@ function styleInject(css, ref) {
|
|
|
2810
2816
|
}
|
|
2811
2817
|
}
|
|
2812
2818
|
|
|
2813
|
-
var css_248z = "
|
|
2819
|
+
var css_248z$4 = "/* Headings/Heading 1 */\n/* Headings/Heading 3 */\n/* Subtitles/Subtitle 3 */\n/* Body/Body 1, Medium */\n/* Body/Body 1, Regular */\n/* Body/Body 2, Medium */\n/* Body/Body 2, Regular */\n/* Body/Body 3, Regular */\n/* Caption/Caption 1, Medium */\n/* Caption/Caption 1, Regular */\n/* Caption/Caption 1, Semibold */\n/* Caption/Caption 2, Medium */\n/* Caption/Caption 2, Regular */\n.Accordion-module_accordionBtn__LQdRX {\n padding: 12px 16px;\n border-radius: inherit;\n width: 100%;\n text-align: left;\n display: flex;\n justify-content: space-between;\n cursor: pointer;\n}\n\n.Accordion-module_accordionContent__sarnp {\n max-height: 1000px;\n overflow: hidden;\n transition: all 0.3s ease-in-out;\n}\n\n.Accordion-module_accordionContent--hidden__6kNQ2 {\n max-height: 0;\n}";
|
|
2820
|
+
var styles$4 = {"accordionBtn":"Accordion-module_accordionBtn__LQdRX","accordionContent":"Accordion-module_accordionContent__sarnp","accordionContent--hidden":"Accordion-module_accordionContent--hidden__6kNQ2"};
|
|
2821
|
+
styleInject(css_248z$4);
|
|
2822
|
+
|
|
2823
|
+
var Accordion = function (_a) {
|
|
2824
|
+
var open = _a.open, setOpen = _a.setOpen, children = _a.children, title = _a.title;
|
|
2825
|
+
return (React.createElement(React.Fragment, null,
|
|
2826
|
+
React.createElement("button", { "data-testid": "Accordion_BUTTON", className: styles$4.accordionBtn, onClick: function () {
|
|
2827
|
+
setOpen(!open);
|
|
2828
|
+
} },
|
|
2829
|
+
title,
|
|
2830
|
+
React.createElement("svg", { "data-testid": "Accordion_DIRECTION", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", style: {
|
|
2831
|
+
transform: !open ? "rotate(0.5turn)" : "none",
|
|
2832
|
+
} },
|
|
2833
|
+
React.createElement("path", { d: "M15.8346 7.5L10.0013 13.3333L4.16797 7.5", stroke: "#758393" }))),
|
|
2834
|
+
React.createElement("div", { "data-testid": "Accordion_CONTENT", className: ClassNamesFn(styles$4.accordionContent, !open && styles$4["accordionContent--hidden"]) }, children)));
|
|
2835
|
+
};
|
|
2836
|
+
|
|
2837
|
+
var css_248z$3 = "/* Headings/Heading 1 */\n/* Headings/Heading 3 */\n/* Subtitles/Subtitle 3 */\n/* Body/Body 1, Medium */\n/* Body/Body 1, Regular */\n/* Body/Body 2, Medium */\n/* Body/Body 2, Regular */\n/* Body/Body 3, Regular */\n/* Caption/Caption 1, Medium */\n/* Caption/Caption 1, Regular */\n/* Caption/Caption 1, Semibold */\n/* Caption/Caption 2, Medium */\n/* Caption/Caption 2, Regular */\n.button-module_button__WDVlB {\n border: none;\n transition: background-color 0.2s ease;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\n\n.button-module_btn-default__upnYC {\n color: #fff;\n background-color: #0581da;\n}\n\n.button-module_btn-default--disabled__tlBX8 {\n color: #929daa;\n background-color: #c5ccd3;\n}\n\n.button-module_btn-tinted__hE7vU {\n color: #0581da;\n background-color: #e1f0fb;\n}\n\n.button-module_btn-tinted--disabled__KYbnK {\n color: #9bcdf0;\n background-color: #e1f0fb;\n}\n\n.button-module_btn-secondary__C8isQ {\n color: #000;\n background-color: #e3e7eb;\n}\n\n.button-module_btn-secondary--disabled__2Y-Q3 {\n color: #758393;\n background-color: #e3e7eb;\n}\n\n.button-module_btn-default__upnYC:hover {\n background-color: #1a9cfa;\n}\n\n.button-module_btn-tinted__hE7vU:hover {\n background-color: #b2d9f5;\n}\n\n.button-module_btn-secondary__C8isQ:hover {\n background-color: #c5ccd3;\n}\n\n.button-module_btn--mini__7zJ2M {\n gap: 4px;\n padding: 6px 12px;\n font-family: Inter;\n font-size: 10px;\n font-style: normal;\n font-weight: 500;\n line-height: 12px; /* 120% */\n}\n\n.button-module_btn--small__IGPOx {\n gap: 8px;\n padding: 8px 16px;\n font-family: Inter;\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px; /* 133.333% */\n}\n\n.button-module_btn--medium__WaM0q {\n gap: 8px;\n padding: 8px 20px;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px; /* 142.857% */\n}\n\n.button-module_btn--large__qrwDc {\n gap: 8px;\n padding: 14px 24px;\n font-family: Inter;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n}\n\n.button-module_btn-square--mini__Ak5mN {\n border-radius: 4px;\n}\n\n.button-module_btn-square--small__O58ux {\n border-radius: 6px;\n}\n\n.button-module_btn-square--medium__xNiKL {\n border-radius: 10px;\n}\n\n.button-module_btn-square--large__9JUii {\n border-radius: 12px;\n}\n\n.button-module_btn-rounded--mini__7ZTyL {\n border-radius: 32px;\n}\n\n.button-module_btn-rounded--small__KJhsk {\n border-radius: 32px;\n}\n\n.button-module_btn-rounded--medium__wT5Uc {\n border-radius: 32px;\n}\n\n.button-module_btn-rounded--large__46yFD {\n border-radius: 40px;\n}";
|
|
2838
|
+
var styles$3 = {"button":"button-module_button__WDVlB","btn-default":"button-module_btn-default__upnYC","btn-default--disabled":"button-module_btn-default--disabled__tlBX8","btn-tinted":"button-module_btn-tinted__hE7vU","btn-tinted--disabled":"button-module_btn-tinted--disabled__KYbnK","btn-secondary":"button-module_btn-secondary__C8isQ","btn-secondary--disabled":"button-module_btn-secondary--disabled__2Y-Q3","btn--mini":"button-module_btn--mini__7zJ2M","btn--small":"button-module_btn--small__IGPOx","btn--medium":"button-module_btn--medium__WaM0q","btn--large":"button-module_btn--large__qrwDc","btn-square--mini":"button-module_btn-square--mini__Ak5mN","btn-square--small":"button-module_btn-square--small__O58ux","btn-square--medium":"button-module_btn-square--medium__xNiKL","btn-square--large":"button-module_btn-square--large__9JUii","btn-rounded--mini":"button-module_btn-rounded--mini__7ZTyL","btn-rounded--small":"button-module_btn-rounded--small__KJhsk","btn-rounded--medium":"button-module_btn-rounded--medium__wT5Uc","btn-rounded--large":"button-module_btn-rounded--large__46yFD"};
|
|
2839
|
+
styleInject(css_248z$3);
|
|
2840
|
+
|
|
2841
|
+
var Button = function (_a) {
|
|
2842
|
+
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;
|
|
2843
|
+
return (React.createElement("button", { "data-testid": "Button_MAIN", "aria-label": ariaLabel, disabled: disabled, "aria-disabled": disabled, onClick: onClick, className: ClassNamesFn(styles$3["btn--".concat(size)], isRounded
|
|
2844
|
+
? styles$3["btn-rounded--".concat(size)]
|
|
2845
|
+
: styles$3["btn-square--".concat(size)], disabled ? styles$3["btn-".concat(variant, "--disabled")] : styles$3["btn-".concat(variant)], styles$3.button, className), style: style }, children));
|
|
2846
|
+
};
|
|
2847
|
+
|
|
2848
|
+
var css_248z$2 = "/* Headings/Heading 1 */\n/* Headings/Heading 3 */\n/* Subtitles/Subtitle 3 */\n/* Body/Body 1, Medium */\n/* Body/Body 1, Regular */\n/* Body/Body 2, Medium */\n/* Body/Body 2, Regular */\n/* Body/Body 3, Regular */\n/* Caption/Caption 1, Medium */\n/* Caption/Caption 1, Regular */\n/* Caption/Caption 1, Semibold */\n/* Caption/Caption 2, Medium */\n/* Caption/Caption 2, Regular */\n.InputField-module_inputContainer__J1gSu {\n display: flex;\n align-items: center;\n background-color: #f0f2f4;\n border-radius: 8px;\n padding: 12px 16px;\n}\n\n.InputField-module_inputContainerLabeled__63H-X {\n display: block;\n background-color: #f0f2f4;\n border-radius: 8px;\n padding: 12px 16px;\n}\n.InputField-module_inputContainerLabeled__63H-X label {\n color: #758393;\n}\n\n.InputField-module_input__y6Hs- {\n width: 100%;\n border: none;\n background-color: #f0f2f4;\n}\n.InputField-module_input__y6Hs-:active, .InputField-module_input__y6Hs-:focus {\n outline: none;\n}\n.InputField-module_input__y6Hs-::placeholder {\n color: #929daa;\n}\n.InputField-module_input__y6Hs-::-webkit-inner-spin-button, .InputField-module_input__y6Hs-::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.InputField-module_clearIcon__WFQKa {\n cursor: pointer;\n}\n\n.InputField-module_input--onfocus__F5PRb {\n background-color: #e3e7eb;\n}\n.InputField-module_input--onfocus__F5PRb .InputField-module_input__y6Hs- {\n background-color: #e3e7eb;\n}\n\n.InputField-module_input-text__Cg-9A {\n font-family: Inter;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px; /* 150% */\n}";
|
|
2849
|
+
var styles$2 = {"inputContainer":"InputField-module_inputContainer__J1gSu","inputContainerLabeled":"InputField-module_inputContainerLabeled__63H-X","input":"InputField-module_input__y6Hs-","clearIcon":"InputField-module_clearIcon__WFQKa","input--onfocus":"InputField-module_input--onfocus__F5PRb","input-text":"InputField-module_input-text__Cg-9A"};
|
|
2850
|
+
styleInject(css_248z$2);
|
|
2851
|
+
|
|
2852
|
+
/******************************************************************************
|
|
2853
|
+
Copyright (c) Microsoft Corporation.
|
|
2854
|
+
|
|
2855
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
2856
|
+
purpose with or without fee is hereby granted.
|
|
2857
|
+
|
|
2858
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2859
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2860
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2861
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2862
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2863
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2864
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
2865
|
+
***************************************************************************** */
|
|
2866
|
+
|
|
2867
|
+
var __assign = function() {
|
|
2868
|
+
__assign = Object.assign || function __assign(t) {
|
|
2869
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2870
|
+
s = arguments[i];
|
|
2871
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2872
|
+
}
|
|
2873
|
+
return t;
|
|
2874
|
+
};
|
|
2875
|
+
return __assign.apply(this, arguments);
|
|
2876
|
+
};
|
|
2877
|
+
|
|
2878
|
+
function __rest(s, e) {
|
|
2879
|
+
var t = {};
|
|
2880
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2881
|
+
t[p] = s[p];
|
|
2882
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2883
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2884
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2885
|
+
t[p[i]] = s[p[i]];
|
|
2886
|
+
}
|
|
2887
|
+
return t;
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2890
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2891
|
+
var e = new Error(message);
|
|
2892
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2893
|
+
};
|
|
2894
|
+
|
|
2895
|
+
var ClearIcon = function (_a) {
|
|
2896
|
+
var _b = _a.fill, fill = _b === void 0 ? "none" : _b, _c = _a.pathFill, pathFill = _c === void 0 ? "#fff" : _c, _d = _a.width, width = _d === void 0 ? 20 : _d, _e = _a.height, height = _e === void 0 ? 20 : _e, props = __rest(_a, ["fill", "pathFill", "width", "height"]);
|
|
2897
|
+
return (React.createElement("svg", __assign({ "data-testid": "Icons_CLEAR", xmlns: "http://www.w3.org/2000/svg", width: width, height: height, fill: fill, viewBox: "0 0 20 20" }, props),
|
|
2898
|
+
React.createElement("path", { fill: pathFill, fillRule: "evenodd", d: "M10 18.333a8.333 8.333 0 100-16.666 8.333 8.333 0 000 16.666zM7.5 6.027L6.027 7.5l2.5 2.5-2.5 2.5L7.5 13.973l2.5-2.5 2.5 2.5 1.473-1.473-2.5-2.5 2.5-2.5L12.5 6.027l-2.5 2.5-2.5-2.5z", clipRule: "evenodd" })));
|
|
2899
|
+
};
|
|
2900
|
+
|
|
2901
|
+
var InputField = function (_a) {
|
|
2902
|
+
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;
|
|
2903
|
+
var _j = react.exports.useState(false), focused = _j[0], setFocused = _j[1];
|
|
2904
|
+
return (React.createElement("div", { "data-testid": "InputField_MAIN", className: ClassNamesFn(styles$2[labelText.length ? "inputContainerLabeled" : "inputContainer"], className, focused ? styles$2["input--onfocus"] : undefined, styles$2["input-".concat(type === null || type === void 0 ? void 0 : type.toLocaleLowerCase())]), style: style },
|
|
2905
|
+
labelText.length > 0 && (React.createElement("label", { htmlFor: id, "data-testid": "InputField_LABEL" }, labelText)),
|
|
2906
|
+
inputLeftIcon,
|
|
2907
|
+
React.createElement("input", { "data-testid": "InputField_INPUT", "aria-label": ariaLabel, id: id, type: type, className: styles$2.input, placeholder: placeholder, "aria-placeholder": placeholder, onFocus: function () {
|
|
2908
|
+
setFocused(true);
|
|
2909
|
+
if (onFocus) {
|
|
2910
|
+
onFocus();
|
|
2911
|
+
}
|
|
2912
|
+
}, onBlur: function () {
|
|
2913
|
+
setFocused(false);
|
|
2914
|
+
if (onBlur) {
|
|
2915
|
+
onBlur();
|
|
2916
|
+
}
|
|
2917
|
+
}, onChange: onChange, onKeyDown: function (event) {
|
|
2918
|
+
if (onEnterPress && event.key === "Enter") {
|
|
2919
|
+
onEnterPress(event);
|
|
2920
|
+
}
|
|
2921
|
+
}, value: value, readOnly: !onChange }),
|
|
2922
|
+
isClearable && value && (React.createElement(ClearIcon, { fill: "red", pathFill: "#758393", className: styles$2.clearIcon, onClick: function () {
|
|
2923
|
+
if (onChange) {
|
|
2924
|
+
onChange({
|
|
2925
|
+
target: { value: "" },
|
|
2926
|
+
});
|
|
2927
|
+
}
|
|
2928
|
+
} }))));
|
|
2929
|
+
};
|
|
2930
|
+
|
|
2931
|
+
var css_248z$1 = "/* Headings/Heading 1 */\n/* Headings/Heading 3 */\n/* Subtitles/Subtitle 3 */\n/* Body/Body 1, Medium */\n/* Body/Body 1, Regular */\n/* Body/Body 2, Medium */\n/* Body/Body 2, Regular */\n/* Body/Body 3, Regular */\n/* Caption/Caption 1, Medium */\n/* Caption/Caption 1, Regular */\n/* Caption/Caption 1, Semibold */\n/* Caption/Caption 2, Medium */\n/* Caption/Caption 2, Regular */\n.RadioGroup-module_radio__cmSnZ {\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n\n.RadioGroup-module_radio__cmSnZ input {\n display: none;\n}\n\n.RadioGroup-module_radioBtn__HSuIE {\n position: relative;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 2px solid #c5ccd3;\n margin: 10px;\n transition: background 0.3s;\n}\n\n.RadioGroup-module_radioBtn__HSuIE::after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n height: 10px;\n width: 10px;\n background: #0581da;\n border-radius: 50%;\n transform: scale(0) translate(-50%, -50%);\n transition: transform 0.3s;\n}\n\ninput:checked + .RadioGroup-module_radioBtn__HSuIE::after {\n transform: scale(1) translate(-50%, -50%);\n}\n\ninput:checked + .RadioGroup-module_radioBtn__HSuIE {\n border: 2px solid #0581da;\n}\n\n.RadioGroup-module_radioBtnText__Kx9T1 {\n padding-left: 10px;\n width: fit-content;\n font-family: Inter;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px; /* 142.857% */\n}";
|
|
2932
|
+
var styles$1 = {"radio":"RadioGroup-module_radio__cmSnZ","radioBtn":"RadioGroup-module_radioBtn__HSuIE","radioBtnText":"RadioGroup-module_radioBtnText__Kx9T1"};
|
|
2933
|
+
styleInject(css_248z$1);
|
|
2934
|
+
|
|
2935
|
+
var CustomRadioButton = function (_a) {
|
|
2936
|
+
var label = _a.label, name = _a.name, checked = _a.checked, onChange = _a.onChange, value = _a.value;
|
|
2937
|
+
return (React.createElement("label", { "data-testid": "RadioGroupItem_LABEL", className: styles$1.radio },
|
|
2938
|
+
React.createElement("input", { "data-testid": "RadioGroupItem_INPUT", value: value, type: "radio", name: name, checked: checked, onChange: onChange }),
|
|
2939
|
+
React.createElement("span", { "data-testid": "RadioGroupItem_RADIO", className: styles$1.radioBtn }),
|
|
2940
|
+
React.createElement("span", { "data-testid": "RadioGroupItem_TEXT", className: styles$1.radioBtnText }, label)));
|
|
2941
|
+
};
|
|
2942
|
+
var RadioGroup = function (_a) {
|
|
2943
|
+
var RadioGroupItems = _a.RadioGroupItems, invokeCustomOnChange = _a.invokeCustomOnChange;
|
|
2944
|
+
var _b = react.exports.useState(""), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
2945
|
+
var handleChange = function (event) {
|
|
2946
|
+
setSelectedOption(event.target.value);
|
|
2947
|
+
invokeCustomOnChange(event);
|
|
2948
|
+
};
|
|
2949
|
+
return (React.createElement("fieldset", { "data-testid": "RadioGroup_FIELDSET" }, RadioGroupItems.map(function (item) { return (React.createElement(CustomRadioButton, { key: item.label, label: item.label, name: "radio", checked: selectedOption === item.value, onChange: handleChange, value: item.value })); })));
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
var css_248z = "/* Headings/Heading 1 */\n/* Headings/Heading 3 */\n/* Subtitles/Subtitle 3 */\n/* Body/Body 1, Medium */\n/* Body/Body 1, Regular */\n/* Body/Body 2, Medium */\n/* Body/Body 2, Regular */\n/* Body/Body 3, Regular */\n/* Caption/Caption 1, Medium */\n/* Caption/Caption 1, Regular */\n/* Caption/Caption 1, Semibold */\n/* Caption/Caption 2, Medium */\n/* Caption/Caption 2, Regular */\n.RadioToggle-module_wrap__Z7gAu {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding: 4px;\n width: 32px;\n height: 16px;\n border-radius: 40px;\n background: #c1dc19;\n}\n\n.RadioToggle-module_wrapLock__T8rZ0 {\n justify-content: flex-start;\n background: #e3e7eb;\n}\n\n.RadioToggle-module_round__Fki8X {\n width: 16px;\n height: 16px;\n background: #fff;\n border-radius: 100px;\n}";
|
|
2953
|
+
var styles = {"wrap":"RadioToggle-module_wrap__Z7gAu","wrapLock":"RadioToggle-module_wrapLock__T8rZ0","round":"RadioToggle-module_round__Fki8X"};
|
|
2814
2954
|
styleInject(css_248z);
|
|
2815
2955
|
|
|
2816
|
-
|
|
2817
|
-
|
|
2956
|
+
// import { Dispatch, SetStateAction } from "react";
|
|
2957
|
+
var RadioToggle = function (_a) {
|
|
2958
|
+
var lock = _a.lock, setLock = _a.setLock;
|
|
2959
|
+
return (React.createElement("button", { "data-testid": "RadioToggle_BUTTON", "aria-pressed": lock, "aria-label": "\u041A\u043D\u043E\u043F\u043A\u0430 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F", onClick: function () {
|
|
2960
|
+
setLock(!lock);
|
|
2961
|
+
} },
|
|
2962
|
+
React.createElement("div", { "data-testid": "RadioToggle_WRAP", className: ClassNamesFn(styles.wrap, lock && styles.wrapLock) },
|
|
2963
|
+
React.createElement("div", { "data-testid": "RadioToggle_ROUND", className: styles.round }))));
|
|
2964
|
+
};
|
|
2965
|
+
|
|
2966
|
+
var Сomponents = {
|
|
2967
|
+
Button: Button,
|
|
2968
|
+
InputField: InputField,
|
|
2969
|
+
RadioGroup: RadioGroup,
|
|
2970
|
+
CustomRadioButton: CustomRadioButton,
|
|
2971
|
+
Accordion: Accordion,
|
|
2972
|
+
RadioToggle: RadioToggle,
|
|
2818
2973
|
};
|
|
2819
2974
|
|
|
2820
|
-
var
|
|
2821
|
-
|
|
2975
|
+
var SystemDesign = {
|
|
2976
|
+
Сomponents: Сomponents
|
|
2822
2977
|
};
|
|
2823
2978
|
|
|
2824
|
-
exports
|
|
2979
|
+
module.exports = SystemDesign;
|
|
2825
2980
|
//# sourceMappingURL=index.js.map
|