@arthurzakharov/ui-kit 1.5.3 → 1.5.5
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/animations/fade-grow/fade-grow.component.d.ts +2 -0
- package/dist/animations/{animation-fade-grow/animation-fade-grow.component.js → fade-grow/fade-grow.component.js} +9 -9
- package/dist/animations/fade-grow/index.d.ts +1 -0
- package/dist/animations/fade-grow/index.js +4 -0
- package/dist/animations/fade-scale/fade-scale.component.d.ts +2 -0
- package/dist/animations/{animation-fade-scale/animation-fade-scale.component.js → fade-scale/fade-scale.component.js} +10 -10
- package/dist/animations/fade-scale/index.d.ts +1 -0
- package/dist/animations/fade-scale/index.js +4 -0
- package/dist/animations/fade-slide/fade-slide.component.d.ts +6 -0
- package/dist/animations/{animation-fade-slide/animation-fade-slide.component.js → fade-slide/fade-slide.component.js} +8 -8
- package/dist/animations/fade-slide/index.d.ts +1 -0
- package/dist/animations/fade-slide/index.js +4 -0
- package/dist/animations/rotate/index.d.ts +1 -0
- package/dist/animations/rotate/index.js +4 -0
- package/dist/animations/{animation-rotate/animation-rotate.component.d.ts → rotate/rotate.component.d.ts} +2 -2
- package/dist/animations/{animation-rotate/animation-rotate.component.js → rotate/rotate.component.js} +6 -6
- package/dist/animations/utils/default-props.d.ts +1 -1
- package/dist/assets/box-5bAcfszB.css +1 -0
- package/dist/assets/button-card-B-nlEbJU.css +1 -0
- package/dist/assets/button-radio-CPeNePW2.css +1 -0
- package/dist/assets/button-text-BKSERdhL.css +1 -0
- package/dist/assets/caption-B28SGRY1.css +1 -0
- package/dist/assets/card-image-LY9zvE8g.css +1 -0
- package/dist/assets/card-text-sR2uSJyo.css +1 -0
- package/dist/assets/checkbox-BzL5bg8o.css +1 -0
- package/dist/assets/choice-j496CvVc.css +1 -0
- package/dist/assets/dropdown-DLhCAHEx.css +1 -0
- package/dist/assets/error-message-CQHYhXbt.css +1 -0
- package/dist/assets/hidden-input-DHJQHUKd.css +1 -0
- package/dist/assets/input-D66hMzHc.css +1 -0
- package/dist/assets/label-BKXQlPJi.css +1 -0
- package/dist/assets/{main-DlyWXITA.css → main-Dz2hrn4n.css} +1 -1
- package/dist/assets/radio-VoXwCoAp.css +1 -0
- package/dist/assets/radio-label-CZHWBUUt.css +1 -0
- package/dist/assets/signature-D9gYlpze.css +1 -0
- package/dist/assets/status-ZxxbM9u1.css +1 -0
- package/dist/assets/text-area-Dgc2jHSx.css +1 -0
- package/dist/assets/text-field-Bp4Ra0yN.css +1 -0
- package/dist/components/accordion-table/accordion-table.component.js +18 -18
- package/dist/components/bottom-bar/bottom-bar.component.d.ts +1 -1
- package/dist/components/bottom-bar/bottom-bar.component.js +25 -27
- package/dist/components/dialog/dialog.component.js +19108 -60
- package/dist/components/dialog-article/dialog-article.component.d.ts +0 -4
- package/dist/components/dialog-article/dialog-article.component.js +20 -20
- package/dist/components/main-attachment/main-attachment.component.js +7 -7
- package/dist/components/payment/components/glass/glass.component.js +2 -2
- package/dist/components/sidebar/sidebar.component.d.ts +1 -1
- package/dist/components/sidebar/sidebar.component.js +14 -14
- package/dist/components/signature/signature.component.d.ts +1 -1
- package/dist/components/signature/signature.component.js +848 -783
- package/dist/components/text/text.component.d.ts +2 -2
- package/dist/components/user-panel/user-panel.component.js +13 -13
- package/dist/controls/box/box.component.d.ts +10 -0
- package/dist/controls/box/box.component.js +40 -0
- package/dist/controls/box/index.d.ts +1 -0
- package/dist/controls/box/index.js +4 -0
- package/dist/controls/{control-button/control-button.component.d.ts → button/button.component.d.ts} +5 -4
- package/dist/controls/button/button.component.js +82 -0
- package/dist/controls/button/index.d.ts +1 -0
- package/dist/controls/button/index.js +4 -0
- package/dist/controls/{control-button-card/control-button-card.component.d.ts → button-card/button-card.component.d.ts} +5 -4
- package/dist/controls/button-card/button-card.component.js +79 -0
- package/dist/controls/button-card/index.d.ts +1 -0
- package/dist/controls/button-card/index.js +4 -0
- package/dist/controls/button-radio/button-radio.component.d.ts +20 -0
- package/dist/controls/button-radio/button-radio.component.js +83 -0
- package/dist/controls/button-radio/index.d.ts +1 -0
- package/dist/controls/button-radio/index.js +4 -0
- package/dist/controls/{control-button-text/control-button-text.component.d.ts → button-text/button-text.component.d.ts} +4 -4
- package/dist/controls/button-text/button-text.component.js +87 -0
- package/dist/controls/button-text/index.d.ts +1 -0
- package/dist/controls/button-text/index.js +4 -0
- package/dist/controls/caption/caption.component.d.ts +10 -0
- package/dist/controls/caption/caption.component.js +48 -0
- package/dist/controls/caption/index.d.ts +1 -0
- package/dist/controls/caption/index.js +4 -0
- package/dist/controls/card-image/card-image.component.d.ts +10 -0
- package/dist/controls/card-image/card-image.component.js +81 -0
- package/dist/controls/card-image/index.d.ts +1 -0
- package/dist/controls/card-image/index.js +4 -0
- package/dist/controls/card-text/card-text.component.d.ts +9 -0
- package/dist/controls/card-text/card-text.component.js +75 -0
- package/dist/controls/card-text/index.d.ts +1 -0
- package/dist/controls/card-text/index.js +4 -0
- package/dist/controls/checkbox/checkbox.component.d.ts +10 -0
- package/dist/controls/checkbox/checkbox.component.js +103 -0
- package/dist/controls/checkbox/index.d.ts +1 -0
- package/dist/controls/checkbox/index.js +4 -0
- package/dist/controls/choice/choice.component.d.ts +12 -0
- package/dist/controls/choice/choice.component.js +67 -0
- package/dist/controls/choice/index.d.ts +1 -0
- package/dist/controls/choice/index.js +4 -0
- package/dist/controls/{control-dropdown/control-dropdown.component.d.ts → dropdown/dropdown.component.d.ts} +3 -3
- package/dist/controls/dropdown/dropdown.component.js +127 -0
- package/dist/controls/dropdown/index.d.ts +1 -0
- package/dist/controls/dropdown/index.js +4 -0
- package/dist/controls/error-message/error-message.component.d.ts +5 -0
- package/dist/controls/error-message/error-message.component.js +22 -0
- package/dist/controls/error-message/index.d.ts +1 -0
- package/dist/controls/error-message/index.js +4 -0
- package/dist/controls/hidden-input/hidden-input.component.d.ts +15 -0
- package/dist/controls/hidden-input/hidden-input.component.js +38 -0
- package/dist/controls/hidden-input/index.d.ts +1 -0
- package/dist/controls/hidden-input/index.js +4 -0
- package/dist/controls/hooks/index.d.ts +1 -0
- package/dist/controls/hooks/index.js +3 -1
- package/dist/controls/hooks/use-choice/use-choice.hook.d.ts +2 -2
- package/dist/controls/hooks/use-control-interaction/index.d.ts +1 -0
- package/dist/controls/hooks/use-control-interaction/index.js +4 -0
- package/dist/controls/hooks/use-control-interaction/use-control-interaction.hook.d.ts +7 -0
- package/dist/controls/hooks/use-control-interaction/use-control-interaction.hook.js +25 -0
- package/dist/controls/index.d.ts +22 -0
- package/dist/controls/index.js +50 -0
- package/dist/controls/input/index.d.ts +1 -0
- package/dist/controls/input/index.js +4 -0
- package/dist/controls/input/input.component.d.ts +9 -0
- package/dist/controls/input/input.component.js +143 -0
- package/dist/controls/input/input.utils.d.ts +10 -0
- package/dist/controls/input/input.utils.js +24 -0
- package/dist/controls/label/index.d.ts +1 -0
- package/dist/controls/label/index.js +4 -0
- package/dist/controls/label/label.component.d.ts +8 -0
- package/dist/controls/label/label.component.js +33 -0
- package/dist/controls/radio/index.d.ts +1 -0
- package/dist/controls/radio/index.js +4 -0
- package/dist/controls/radio/radio.component.d.ts +12 -0
- package/dist/controls/radio/radio.component.js +109 -0
- package/dist/controls/radio-label/index.d.ts +1 -0
- package/dist/controls/radio-label/index.js +4 -0
- package/dist/controls/radio-label/radio-label.component.d.ts +19 -0
- package/dist/controls/radio-label/radio-label.component.js +49 -0
- package/dist/controls/status/index.d.ts +1 -0
- package/dist/controls/status/index.js +4 -0
- package/dist/controls/status/status.component.d.ts +6 -0
- package/dist/controls/status/status.component.js +36 -0
- package/dist/controls/text-area/index.d.ts +1 -0
- package/dist/controls/text-area/index.js +4 -0
- package/dist/controls/text-area/text-area.component.d.ts +8 -0
- package/dist/controls/text-area/text-area.component.js +62 -0
- package/dist/controls/text-field/index.d.ts +1 -0
- package/dist/controls/text-field/index.js +4 -0
- package/dist/controls/text-field/text-field.component.d.ts +10 -0
- package/dist/controls/text-field/text-field.component.js +100 -0
- package/dist/controls/utils/functions/functions.util.d.ts +0 -1
- package/dist/controls/utils/functions/functions.util.js +3 -14
- package/dist/controls/utils/functions/index.js +3 -4
- package/dist/controls/utils/index.js +3 -4
- package/dist/controls/utils/types.d.ts +8 -5
- package/dist/{index-PfP8s0Qf.js → index-CPvYWadf.js} +1 -1
- package/dist/main.d.ts +25 -24
- package/dist/main.js +101 -99
- package/dist/{proxy-Cx6n7mT2.js → proxy-CmTphuYR.js} +1762 -1717
- package/dist/utils/converter/index.d.ts +1 -0
- package/dist/utils/converter/index.js +4 -0
- package/dist/utils/functions/functions.util.js +10 -10
- package/dist/utils/story/grey-box/grey-box.component.d.ts +9 -0
- package/dist/utils/story/grey-box/grey-box.component.js +24 -0
- package/dist/utils/story/grey-box/index.d.ts +1 -0
- package/dist/utils/story/grey-box/index.js +4 -0
- package/dist/utils/story/size-box/index.d.ts +1 -0
- package/dist/utils/story/size-box/index.js +4 -0
- package/dist/utils/story/size-box/size-box.component.d.ts +6 -0
- package/dist/utils/story/size-box/size-box.component.js +5 -0
- package/package.json +10 -18
- package/dist/_commonjsHelpers-CqEciG1_.js +0 -31
- package/dist/animations/animation-fade-grow/animation-fade-grow.component.d.ts +0 -2
- package/dist/animations/animation-fade-grow/index.d.ts +0 -1
- package/dist/animations/animation-fade-grow/index.js +0 -4
- package/dist/animations/animation-fade-scale/animation-fade-scale.component.d.ts +0 -2
- package/dist/animations/animation-fade-scale/index.d.ts +0 -1
- package/dist/animations/animation-fade-scale/index.js +0 -4
- package/dist/animations/animation-fade-slide/animation-fade-slide.component.d.ts +0 -6
- package/dist/animations/animation-fade-slide/index.d.ts +0 -1
- package/dist/animations/animation-fade-slide/index.js +0 -4
- package/dist/animations/animation-rotate/index.d.ts +0 -1
- package/dist/animations/animation-rotate/index.js +0 -4
- package/dist/assets/control-box-Dx-QKPgf.css +0 -1
- package/dist/assets/control-button-card-Cb8_vJbQ.css +0 -1
- package/dist/assets/control-button-radio-BodzD0rU.css +0 -1
- package/dist/assets/control-button-text-BbE_5ebO.css +0 -1
- package/dist/assets/control-card-image-BYT3bzTE.css +0 -1
- package/dist/assets/control-card-text-Cvv3bL2p.css +0 -1
- package/dist/assets/control-checkbox-uLtXjmYN.css +0 -1
- package/dist/assets/control-choice-BAHN-VTm.css +0 -1
- package/dist/assets/control-dropdown-DaS5KsvG.css +0 -1
- package/dist/assets/control-error-message-CKgqmo1U.css +0 -1
- package/dist/assets/control-hidden-input-BhMdNmnP.css +0 -1
- package/dist/assets/control-input-nR0XQHHp.css +0 -1
- package/dist/assets/control-label-C8pjaWEU.css +0 -1
- package/dist/assets/control-radio-Bo1rvcg2.css +0 -1
- package/dist/assets/control-radio-label-CgZ-FNj0.css +0 -1
- package/dist/assets/control-radio-text-S7MEO4a2.css +0 -1
- package/dist/assets/control-status-DPNvkGlM.css +0 -1
- package/dist/assets/control-text-n-qi7e2Y.css +0 -1
- package/dist/assets/control-textarea-B6gWlJs3.css +0 -1
- package/dist/assets/signature-EuXLu4YT.css +0 -1
- package/dist/controls/control-box/control-box.component.d.ts +0 -14
- package/dist/controls/control-box/control-box.component.js +0 -33
- package/dist/controls/control-box/index.d.ts +0 -2
- package/dist/controls/control-box/index.js +0 -4
- package/dist/controls/control-button/control-button.component.js +0 -84
- package/dist/controls/control-button/index.d.ts +0 -2
- package/dist/controls/control-button/index.js +0 -4
- package/dist/controls/control-button-card/control-button-card.component.js +0 -65
- package/dist/controls/control-button-card/index.d.ts +0 -2
- package/dist/controls/control-button-card/index.js +0 -4
- package/dist/controls/control-button-radio/control-button-radio.component.d.ts +0 -19
- package/dist/controls/control-button-radio/control-button-radio.component.js +0 -69
- package/dist/controls/control-button-radio/index.d.ts +0 -2
- package/dist/controls/control-button-radio/index.js +0 -4
- package/dist/controls/control-button-text/control-button-text.component.js +0 -87
- package/dist/controls/control-button-text/index.d.ts +0 -2
- package/dist/controls/control-button-text/index.js +0 -4
- package/dist/controls/control-card-image/control-card-image.component.d.ts +0 -8
- package/dist/controls/control-card-image/control-card-image.component.js +0 -53
- package/dist/controls/control-card-image/index.d.ts +0 -2
- package/dist/controls/control-card-image/index.js +0 -4
- package/dist/controls/control-card-text/control-card-text.component.d.ts +0 -7
- package/dist/controls/control-card-text/control-card-text.component.js +0 -48
- package/dist/controls/control-card-text/index.d.ts +0 -2
- package/dist/controls/control-card-text/index.js +0 -4
- package/dist/controls/control-checkbox/control-checkbox.component.d.ts +0 -11
- package/dist/controls/control-checkbox/control-checkbox.component.js +0 -97
- package/dist/controls/control-checkbox/index.d.ts +0 -2
- package/dist/controls/control-checkbox/index.js +0 -4
- package/dist/controls/control-choice/control-choice.component.d.ts +0 -12
- package/dist/controls/control-choice/control-choice.component.js +0 -64
- package/dist/controls/control-choice/index.d.ts +0 -2
- package/dist/controls/control-choice/index.js +0 -4
- package/dist/controls/control-dropdown/control-dropdown.component.js +0 -106
- package/dist/controls/control-dropdown/index.d.ts +0 -2
- package/dist/controls/control-dropdown/index.js +0 -4
- package/dist/controls/control-error-message/control-error-message.component.d.ts +0 -7
- package/dist/controls/control-error-message/control-error-message.component.js +0 -16
- package/dist/controls/control-error-message/index.d.ts +0 -1
- package/dist/controls/control-error-message/index.js +0 -4
- package/dist/controls/control-hidden-input/control-hidden-input.component.d.ts +0 -15
- package/dist/controls/control-hidden-input/control-hidden-input.component.js +0 -41
- package/dist/controls/control-hidden-input/index.d.ts +0 -2
- package/dist/controls/control-hidden-input/index.js +0 -4
- package/dist/controls/control-input/control-input.component.d.ts +0 -11
- package/dist/controls/control-input/control-input.component.js +0 -973
- package/dist/controls/control-input/index.d.ts +0 -2
- package/dist/controls/control-input/index.js +0 -4
- package/dist/controls/control-label/control-label.component.d.ts +0 -13
- package/dist/controls/control-label/control-label.component.js +0 -25
- package/dist/controls/control-label/index.d.ts +0 -1
- package/dist/controls/control-label/index.js +0 -4
- package/dist/controls/control-radio/control-radio.component.d.ts +0 -14
- package/dist/controls/control-radio/control-radio.component.js +0 -79
- package/dist/controls/control-radio/index.d.ts +0 -2
- package/dist/controls/control-radio/index.js +0 -4
- package/dist/controls/control-radio-label/control-radio-label.component.d.ts +0 -22
- package/dist/controls/control-radio-label/control-radio-label.component.js +0 -39
- package/dist/controls/control-radio-label/index.d.ts +0 -1
- package/dist/controls/control-radio-label/index.js +0 -4
- package/dist/controls/control-radio-text/control-radio-text.component.d.ts +0 -10
- package/dist/controls/control-radio-text/control-radio-text.component.js +0 -45
- package/dist/controls/control-radio-text/index.d.ts +0 -2
- package/dist/controls/control-radio-text/index.js +0 -4
- package/dist/controls/control-status/control-status.component.d.ts +0 -11
- package/dist/controls/control-status/control-status.component.js +0 -42
- package/dist/controls/control-status/index.d.ts +0 -1
- package/dist/controls/control-status/index.js +0 -4
- package/dist/controls/control-text/control-text.component.d.ts +0 -11
- package/dist/controls/control-text/control-text.component.js +0 -70
- package/dist/controls/control-text/index.d.ts +0 -2
- package/dist/controls/control-text/index.js +0 -4
- package/dist/controls/control-textarea/control-textarea.component.d.ts +0 -15
- package/dist/controls/control-textarea/control-textarea.component.js +0 -63
- package/dist/controls/control-textarea/index.d.ts +0 -1
- package/dist/controls/control-textarea/index.js +0 -4
- package/dist/index-D3EuHLHH.js +0 -19053
- /package/dist/animations/{hook → hooks}/index.d.ts +0 -0
- /package/dist/animations/{hook → hooks}/index.js +0 -0
- /package/dist/animations/{hook → hooks}/use-animation-lifecycle/index.d.ts +0 -0
- /package/dist/animations/{hook → hooks}/use-animation-lifecycle/index.js +0 -0
- /package/dist/animations/{hook → hooks}/use-animation-lifecycle/use-animation-lifecycle.hook.d.ts +0 -0
- /package/dist/animations/{hook → hooks}/use-animation-lifecycle/use-animation-lifecycle.hook.js +0 -0
- /package/dist/assets/{control-button-Tzg6F5Dp.css → button-Tzg6F5Dp.css} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ControlChoiceType, ChoiceValue, InputChangeSource, Interactive } from '../../utils
|
|
1
|
+
import { ControlChoiceType, ChoiceValue, InputChangeSource, Interactive } from '../../utils';
|
|
2
2
|
export declare const useChoice: (value: ChoiceValue, id: string, cb: Interactive<ChoiceValue>["onChange"]) => {
|
|
3
3
|
type: ControlChoiceType;
|
|
4
|
-
onChoiceChange: (newValue: string, source
|
|
4
|
+
onChoiceChange: (newValue: string, source: InputChangeSource) => void;
|
|
5
5
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-control-interaction.hook';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputChangeSource, Interactive } from '../../utils';
|
|
2
|
+
export declare const useControlInteraction: <V>({ id, disabled, onChange, onFocus, onBlur, }: Pick<Interactive<V>, "id" | "disabled" | "onChange" | "onFocus" | "onBlur">) => {
|
|
3
|
+
focused: boolean;
|
|
4
|
+
emitChange: (value: V, source: InputChangeSource) => void;
|
|
5
|
+
handleFocus: () => void;
|
|
6
|
+
handleBlur: () => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useBoolean as f } from "usehooks-ts";
|
|
2
|
+
const C = ({
|
|
3
|
+
id: e,
|
|
4
|
+
disabled: n = !1,
|
|
5
|
+
onChange: t,
|
|
6
|
+
onFocus: o,
|
|
7
|
+
onBlur: r
|
|
8
|
+
}) => {
|
|
9
|
+
const { value: u, setTrue: s, setFalse: l } = f(!1);
|
|
10
|
+
return {
|
|
11
|
+
focused: u,
|
|
12
|
+
emitChange: (a, c) => {
|
|
13
|
+
n || t(a, e, c);
|
|
14
|
+
},
|
|
15
|
+
handleFocus: () => {
|
|
16
|
+
n || (s(), o?.(e));
|
|
17
|
+
},
|
|
18
|
+
handleBlur: () => {
|
|
19
|
+
n || (l(), r?.(e));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
C as useControlInteraction
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './box';
|
|
2
|
+
export * from './button';
|
|
3
|
+
export * from './button-card';
|
|
4
|
+
export * from './button-radio';
|
|
5
|
+
export * from './button-text';
|
|
6
|
+
export * from './caption';
|
|
7
|
+
export * from './card-image';
|
|
8
|
+
export * from './card-text';
|
|
9
|
+
export * from './checkbox';
|
|
10
|
+
export * from './choice';
|
|
11
|
+
export * from './dropdown';
|
|
12
|
+
export * from './error-message';
|
|
13
|
+
export * from './hidden-input';
|
|
14
|
+
export * from './input';
|
|
15
|
+
export * from './label';
|
|
16
|
+
export * from './radio';
|
|
17
|
+
export * from './radio-label';
|
|
18
|
+
export * from './status';
|
|
19
|
+
export * from './text-area';
|
|
20
|
+
export * from './text-field';
|
|
21
|
+
export * from './hooks';
|
|
22
|
+
export * from './utils';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Box as t } from "./box/box.component.js";
|
|
2
|
+
import { Button as x } from "./button/button.component.js";
|
|
3
|
+
import { ButtonCard as m } from "./button-card/button-card.component.js";
|
|
4
|
+
import { ButtonRadio as a } from "./button-radio/button-radio.component.js";
|
|
5
|
+
import { ButtonText as d } from "./button-text/button-text.component.js";
|
|
6
|
+
import { Caption as u } from "./caption/caption.component.js";
|
|
7
|
+
import { CardImage as c } from "./card-image/card-image.component.js";
|
|
8
|
+
import { CardText as l } from "./card-text/card-text.component.js";
|
|
9
|
+
import { Checkbox as I } from "./checkbox/checkbox.component.js";
|
|
10
|
+
import { Choice as T } from "./choice/choice.component.js";
|
|
11
|
+
import { Dropdown as g } from "./dropdown/dropdown.component.js";
|
|
12
|
+
import { ErrorMessage as R } from "./error-message/error-message.component.js";
|
|
13
|
+
import { HiddenInput as L } from "./hidden-input/hidden-input.component.js";
|
|
14
|
+
import { Input as A } from "./input/input.component.js";
|
|
15
|
+
import { Label as E } from "./label/label.component.js";
|
|
16
|
+
import { Radio as M } from "./radio/radio.component.js";
|
|
17
|
+
import { RadioLabel as S } from "./radio-label/radio-label.component.js";
|
|
18
|
+
import { Status as q } from "./status/status.component.js";
|
|
19
|
+
import { TextArea as y } from "./text-area/text-area.component.js";
|
|
20
|
+
import { TextField as G } from "./text-field/text-field.component.js";
|
|
21
|
+
import { useChoice as K } from "./hooks/use-choice/use-choice.hook.js";
|
|
22
|
+
import { useControlInteraction as P } from "./hooks/use-control-interaction/use-control-interaction.hook.js";
|
|
23
|
+
import { clickHasNode as U, containsHtml as V, getChoiceId as W } from "./utils/functions/functions.util.js";
|
|
24
|
+
export {
|
|
25
|
+
t as Box,
|
|
26
|
+
x as Button,
|
|
27
|
+
m as ButtonCard,
|
|
28
|
+
a as ButtonRadio,
|
|
29
|
+
d as ButtonText,
|
|
30
|
+
u as Caption,
|
|
31
|
+
c as CardImage,
|
|
32
|
+
l as CardText,
|
|
33
|
+
I as Checkbox,
|
|
34
|
+
T as Choice,
|
|
35
|
+
g as Dropdown,
|
|
36
|
+
R as ErrorMessage,
|
|
37
|
+
L as HiddenInput,
|
|
38
|
+
A as Input,
|
|
39
|
+
E as Label,
|
|
40
|
+
M as Radio,
|
|
41
|
+
S as RadioLabel,
|
|
42
|
+
q as Status,
|
|
43
|
+
y as TextArea,
|
|
44
|
+
G as TextField,
|
|
45
|
+
U as clickHasNode,
|
|
46
|
+
V as containsHtml,
|
|
47
|
+
W as getChoiceId,
|
|
48
|
+
K as useChoice,
|
|
49
|
+
P as useControlInteraction
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input, type InputProps } from './input.component';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Interactive } from '../utils';
|
|
2
|
+
import { Base } from '../../utils/types';
|
|
3
|
+
export interface InputProps extends Base, Interactive<string> {
|
|
4
|
+
mask?: string;
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
onAnimationStart?: (id: string) => void;
|
|
7
|
+
onAnimationEnd?: (id: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Input: ({ id, value, disabled, onChange, onFocus, onBlur, maxLength, mask, onAnimationStart, onAnimationEnd, ...base }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx as M } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as d, useState as O, useLayoutEffect as Q, useCallback as R, useEffect as W } from "react";
|
|
3
|
+
import K from "clsx";
|
|
4
|
+
import { compareStrings as X, isDigit as Y, getFirstNotEnteredCharIndex as v, replaceCharByIndex as b, getNextChar as T, isSeparator as P, getPreviousChar as Z, applyMask as k } from "./input.utils.js";
|
|
5
|
+
import { useControlInteraction as tt } from "../hooks/use-control-interaction/use-control-interaction.hook.js";
|
|
6
|
+
import { baseProps as h } from "../../utils/functions/functions.util.js";
|
|
7
|
+
import '../../assets/input-D66hMzHc.css';const et = "_Input_gfvsr_1", nt = "_Placeholder_gfvsr_45", w = {
|
|
8
|
+
Input: et,
|
|
9
|
+
Placeholder: nt
|
|
10
|
+
}, it = ({
|
|
11
|
+
// Interactive props
|
|
12
|
+
id: u,
|
|
13
|
+
value: y = "",
|
|
14
|
+
disabled: g = !1,
|
|
15
|
+
onChange: $,
|
|
16
|
+
onFocus: L,
|
|
17
|
+
onBlur: j,
|
|
18
|
+
// Input props
|
|
19
|
+
maxLength: U,
|
|
20
|
+
mask: n = "",
|
|
21
|
+
onAnimationStart: q,
|
|
22
|
+
onAnimationEnd: z,
|
|
23
|
+
// Base props
|
|
24
|
+
...s
|
|
25
|
+
}) => {
|
|
26
|
+
const { emitChange: C, handleFocus: S, handleBlur: E } = tt({
|
|
27
|
+
id: u,
|
|
28
|
+
disabled: g,
|
|
29
|
+
onChange: $,
|
|
30
|
+
onFocus: L,
|
|
31
|
+
onBlur: j
|
|
32
|
+
}), o = d(null), D = d(!1), a = d(null), N = d(!0), [r, I] = O(y || n), i = (t) => {
|
|
33
|
+
const c = Math.max(0, t);
|
|
34
|
+
if (a.current = c, !o.current) return;
|
|
35
|
+
const e = Math.min(c, o.current.value.length);
|
|
36
|
+
o.current.setSelectionRange(e, e);
|
|
37
|
+
};
|
|
38
|
+
Q(() => {
|
|
39
|
+
if (!n || !o.current || a.current === null) return;
|
|
40
|
+
const t = Math.min(a.current, o.current.value.length);
|
|
41
|
+
o.current.setSelectionRange(t, t), a.current = null;
|
|
42
|
+
}, [r, n]);
|
|
43
|
+
const F = () => {
|
|
44
|
+
const t = o.current?.value || "", c = v(t, n);
|
|
45
|
+
c !== t.length && i(c);
|
|
46
|
+
}, G = R(() => {
|
|
47
|
+
const t = o.current?.value || "", c = X(r, t);
|
|
48
|
+
if (!Y(c)) return;
|
|
49
|
+
const e = o.current?.selectionEnd || 0, m = v(t, n) === t.length, l = b(r, e - 1, c), f = v(l, n);
|
|
50
|
+
if (m) {
|
|
51
|
+
const p = t.slice(0, e - 1), x = t.slice(e - 1, e), B = t.slice(e), J = b(p + B, e - 1, x), _ = T(p + B, e) || "";
|
|
52
|
+
I(J), i(P(_, n) && _ ? e + 1 : e);
|
|
53
|
+
} else
|
|
54
|
+
I(l), i(f);
|
|
55
|
+
}, [r, n]), H = R(
|
|
56
|
+
(t) => {
|
|
57
|
+
if ([
|
|
58
|
+
"Digit1",
|
|
59
|
+
"Digit2",
|
|
60
|
+
"Digit3",
|
|
61
|
+
"Digit4",
|
|
62
|
+
"Digit5",
|
|
63
|
+
"Digit6",
|
|
64
|
+
"Digit7",
|
|
65
|
+
"Digit8",
|
|
66
|
+
"Digit9",
|
|
67
|
+
"Digit0",
|
|
68
|
+
"Backspace",
|
|
69
|
+
"ArrowLeft",
|
|
70
|
+
"ArrowRight",
|
|
71
|
+
"Tab"
|
|
72
|
+
].includes(t.code) || t.preventDefault(), t.code === "Backspace") {
|
|
73
|
+
t.preventDefault();
|
|
74
|
+
const e = o.current?.selectionEnd || 0;
|
|
75
|
+
if (e) {
|
|
76
|
+
const A = Z(r, e), m = T(r, e - 1), l = P(A, n), f = P(m, n), p = e - (l || f ? 2 : 1), x = k(r, n, e - (f ? 2 : 1));
|
|
77
|
+
I(x), i(p);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
[r, n]
|
|
82
|
+
);
|
|
83
|
+
W(() => {
|
|
84
|
+
if (n) {
|
|
85
|
+
if (N.current) {
|
|
86
|
+
N.current = !1;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
C(r !== n ? r : "", "keyboard");
|
|
90
|
+
}
|
|
91
|
+
}, [r, n, C]);
|
|
92
|
+
const V = (t) => {
|
|
93
|
+
t.includes("autofill-start") && q?.(u), t.includes("autofill-end") && z?.(u);
|
|
94
|
+
};
|
|
95
|
+
return n ? /* @__PURE__ */ M(
|
|
96
|
+
"input",
|
|
97
|
+
{
|
|
98
|
+
ref: o,
|
|
99
|
+
"data-testid": h(s, "data-testid", "input"),
|
|
100
|
+
"aria-label": `${u}-date-input`,
|
|
101
|
+
disabled: g,
|
|
102
|
+
type: "text",
|
|
103
|
+
id: u,
|
|
104
|
+
name: u,
|
|
105
|
+
value: r,
|
|
106
|
+
className: K(w.Input, h(s, "className"), { [w.Placeholder]: r === n }),
|
|
107
|
+
onAnimationStart: (t) => V(t.animationName),
|
|
108
|
+
onKeyDown: H,
|
|
109
|
+
onChange: G,
|
|
110
|
+
onPointerDown: (t) => {
|
|
111
|
+
t.preventDefault(), D.current = !0, t.currentTarget.focus(), F();
|
|
112
|
+
},
|
|
113
|
+
onFocus: () => {
|
|
114
|
+
if (S(), D.current) {
|
|
115
|
+
D.current = !1;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
F();
|
|
119
|
+
},
|
|
120
|
+
onBlur: () => E()
|
|
121
|
+
}
|
|
122
|
+
) : /* @__PURE__ */ M(
|
|
123
|
+
"input",
|
|
124
|
+
{
|
|
125
|
+
"data-testid": h(s, "data-testid", "input"),
|
|
126
|
+
"aria-label": `${u}-text-input`,
|
|
127
|
+
disabled: g,
|
|
128
|
+
maxLength: U,
|
|
129
|
+
type: "text",
|
|
130
|
+
id: u,
|
|
131
|
+
name: u,
|
|
132
|
+
value: y,
|
|
133
|
+
className: K(w.Input, h(s, "className")),
|
|
134
|
+
onChange: (t) => C(t.target.value, "keyboard"),
|
|
135
|
+
onAnimationStart: (t) => V(t.animationName),
|
|
136
|
+
onFocus: S,
|
|
137
|
+
onBlur: () => E()
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
it as Input
|
|
143
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const isDigit: (char: string) => boolean;
|
|
2
|
+
export declare const isSeparator: (char: string, mask: string) => boolean;
|
|
3
|
+
export declare const getRegExp: (str: string) => RegExp;
|
|
4
|
+
export declare const getSeparatorRegExp: (mask: string) => RegExp;
|
|
5
|
+
export declare const getFirstNotEnteredCharIndex: (str: string, mask: string) => number;
|
|
6
|
+
export declare const getPreviousChar: (str: string, position: number) => string;
|
|
7
|
+
export declare const getNextChar: (str: string, position: number) => string;
|
|
8
|
+
export declare const applyMask: (str: string, mask: string, index: number) => string;
|
|
9
|
+
export declare const replaceCharByIndex: (str: string, index: number, newChar: string) => string;
|
|
10
|
+
export declare const compareStrings: (a: string, b: string) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const a = (e) => /\d/.test(e), o = (e, t) => !!e.match(g(t)), c = (e) => new RegExp(`[${[...new Set(e.match(/[A-Za-z]/g))].join("")}]`), g = (e) => {
|
|
2
|
+
const t = [...new Set(e.replace(/[A-Z]/g, ""))].join("").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3
|
+
return new RegExp(`[${t}]`);
|
|
4
|
+
}, s = (e, t) => e.match(c(t))?.index ?? e.length, h = (e, t) => t > 1 ? e[t - 2] : "", l = (e, t) => t > 1 ? e[t] : "", p = (e, t, n) => n < 0 || n >= e.length ? e : e.slice(0, n) + t[n] + e.slice(n + 1), i = (e, t, n) => t < 0 || t >= e.length ? e : e.slice(0, t) + n + e.slice(t + 1), u = (e, t) => {
|
|
5
|
+
if (e <= t)
|
|
6
|
+
return "";
|
|
7
|
+
const n = Math.min(e.length, t.length);
|
|
8
|
+
for (let r = 0; r < n; r += 1)
|
|
9
|
+
if (e[r] !== t[r])
|
|
10
|
+
return t[r] || "";
|
|
11
|
+
return t[n] || "";
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
p as applyMask,
|
|
15
|
+
u as compareStrings,
|
|
16
|
+
s as getFirstNotEnteredCharIndex,
|
|
17
|
+
l as getNextChar,
|
|
18
|
+
h as getPreviousChar,
|
|
19
|
+
c as getRegExp,
|
|
20
|
+
g as getSeparatorRegExp,
|
|
21
|
+
a as isDigit,
|
|
22
|
+
o as isSeparator,
|
|
23
|
+
i as replaceCharByIndex
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Label, type LabelProps } from './label.component';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ControlLabelPosition, State } from '../utils';
|
|
2
|
+
import { Base } from '../../utils/types';
|
|
3
|
+
export interface LabelProps extends Base {
|
|
4
|
+
text: string;
|
|
5
|
+
state?: State;
|
|
6
|
+
position?: ControlLabelPosition;
|
|
7
|
+
}
|
|
8
|
+
export declare const Label: ({ text, state, position, ...base }: LabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import _ from "clsx";
|
|
3
|
+
import { Content as a } from "../../utils/content/content.component.js";
|
|
4
|
+
import { baseProps as t } from "../../utils/functions/functions.util.js";
|
|
5
|
+
import '../../assets/label-BKXQlPJi.css';const i = "_Label_85kr5_1", d = "_Idle_85kr5_7", m = "_Active_85kr5_12", n = "_Success_85kr5_21", e = {
|
|
6
|
+
Label: i,
|
|
7
|
+
Idle: d,
|
|
8
|
+
Active: m,
|
|
9
|
+
Error: "_Error_85kr5_17",
|
|
10
|
+
Success: n
|
|
11
|
+
}, v = ({
|
|
12
|
+
// Label props
|
|
13
|
+
text: o,
|
|
14
|
+
state: r = "idle",
|
|
15
|
+
position: c = "idle",
|
|
16
|
+
// Base props
|
|
17
|
+
...s
|
|
18
|
+
}) => /* @__PURE__ */ l(
|
|
19
|
+
a,
|
|
20
|
+
{
|
|
21
|
+
"data-testid": t(s, "data-testid", "label"),
|
|
22
|
+
className: _(e.Label, t(s, "className"), {
|
|
23
|
+
[e.Idle]: c === "idle",
|
|
24
|
+
[e.Active]: c === "active",
|
|
25
|
+
[e.Error]: r === "error",
|
|
26
|
+
[e.Success]: r === "success"
|
|
27
|
+
}),
|
|
28
|
+
children: o
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
export {
|
|
32
|
+
v as Label
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Radio, type RadioProps } from './radio.component';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChoiceProps } from '../choice';
|
|
2
|
+
import { CaptionProps } from '../caption';
|
|
3
|
+
import { Interactive, RadioChoice } from '../utils';
|
|
4
|
+
import { Base } from '../../utils/types';
|
|
5
|
+
export interface RadioProps extends Base, Interactive<string> {
|
|
6
|
+
orientation?: 'horizontal' | 'vertical';
|
|
7
|
+
choices: RadioChoice[];
|
|
8
|
+
iconSize?: ChoiceProps['size'];
|
|
9
|
+
textSize?: CaptionProps['size'];
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Radio: ({ id, value, disabled, state, onChange, onFocus, onBlur, choices, orientation, iconSize, textSize, message, ...base }: RadioProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import _ from "clsx";
|
|
3
|
+
import { FadeSlide as k } from "../../animations/fade-slide/fade-slide.component.js";
|
|
4
|
+
import { Choice as I } from "../choice/choice.component.js";
|
|
5
|
+
import { Caption as V } from "../caption/caption.component.js";
|
|
6
|
+
import { ErrorMessage as y } from "../error-message/error-message.component.js";
|
|
7
|
+
import { HiddenInput as F } from "../hidden-input/hidden-input.component.js";
|
|
8
|
+
import { useControlInteraction as j } from "../hooks/use-control-interaction/use-control-interaction.hook.js";
|
|
9
|
+
import { RadioLabel as B } from "../radio-label/radio-label.component.js";
|
|
10
|
+
import { getChoiceId as $ } from "../utils/functions/functions.util.js";
|
|
11
|
+
import { baseProps as p } from "../../utils/functions/functions.util.js";
|
|
12
|
+
import '../../assets/radio-VoXwCoAp.css';const P = "_Radio_rt0wk_1", S = "_Content_rt0wk_6", q = "_Horizontal_rt0wk_10", A = "_Vertical_rt0wk_15", D = "_Label_rt0wk_20", G = "_ErrorMessage_rt0wk_33", o = {
|
|
13
|
+
Radio: P,
|
|
14
|
+
Content: S,
|
|
15
|
+
Horizontal: q,
|
|
16
|
+
Vertical: A,
|
|
17
|
+
Label: D,
|
|
18
|
+
ErrorMessage: G
|
|
19
|
+
}, tr = ({
|
|
20
|
+
// Interactive props
|
|
21
|
+
id: e,
|
|
22
|
+
value: f = "",
|
|
23
|
+
disabled: a = !1,
|
|
24
|
+
state: s = "idle",
|
|
25
|
+
onChange: u,
|
|
26
|
+
onFocus: C,
|
|
27
|
+
onBlur: g,
|
|
28
|
+
// Radio props
|
|
29
|
+
choices: h,
|
|
30
|
+
orientation: l = "horizontal",
|
|
31
|
+
iconSize: v = "md",
|
|
32
|
+
textSize: z = "body",
|
|
33
|
+
message: m = "",
|
|
34
|
+
// Base props
|
|
35
|
+
...d
|
|
36
|
+
}) => {
|
|
37
|
+
const { emitChange: w, handleFocus: x, handleBlur: E } = j({
|
|
38
|
+
id: e,
|
|
39
|
+
disabled: a,
|
|
40
|
+
onChange: u,
|
|
41
|
+
onFocus: C,
|
|
42
|
+
onBlur: g
|
|
43
|
+
});
|
|
44
|
+
return /* @__PURE__ */ c(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
"data-testid": p(d, "data-testid", "radio"),
|
|
48
|
+
className: _(o.Radio, p(d, "className")),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ r(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: _(o.Content, {
|
|
54
|
+
[o.Horizontal]: l === "horizontal",
|
|
55
|
+
[o.Vertical]: l === "vertical"
|
|
56
|
+
}),
|
|
57
|
+
children: h.map((t, M, R) => {
|
|
58
|
+
const i = $(e, t.value, M);
|
|
59
|
+
return /* @__PURE__ */ r(
|
|
60
|
+
B,
|
|
61
|
+
{
|
|
62
|
+
id: i,
|
|
63
|
+
value: f,
|
|
64
|
+
state: s,
|
|
65
|
+
choice: t,
|
|
66
|
+
choices: R,
|
|
67
|
+
children: ({ focused: b, hovered: H, checked: n, state: L }) => /* @__PURE__ */ c("div", { className: o.Label, children: [
|
|
68
|
+
/* @__PURE__ */ r(
|
|
69
|
+
I,
|
|
70
|
+
{
|
|
71
|
+
type: "radio",
|
|
72
|
+
size: v,
|
|
73
|
+
state: L,
|
|
74
|
+
checked: n,
|
|
75
|
+
focused: b,
|
|
76
|
+
hovered: H,
|
|
77
|
+
disabled: a
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ r(
|
|
81
|
+
F,
|
|
82
|
+
{
|
|
83
|
+
type: "radio",
|
|
84
|
+
id: i,
|
|
85
|
+
value: t.value,
|
|
86
|
+
name: e,
|
|
87
|
+
checked: n,
|
|
88
|
+
disabled: a,
|
|
89
|
+
onChange: (J, N) => w(t.value, N),
|
|
90
|
+
onFocus: x,
|
|
91
|
+
onBlur: E
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ r(V, { text: t.label, size: z, checked: n })
|
|
95
|
+
] })
|
|
96
|
+
},
|
|
97
|
+
i
|
|
98
|
+
);
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ r(k, { name: "message", condition: s === "error" && !!m, children: /* @__PURE__ */ r(y, { text: m, className: o.ErrorMessage }) })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
tr as Radio
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioLabel, type RadioLabelProps } from './radio-label.component';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChoiceValue, RadioChoice, State } from '../utils';
|
|
3
|
+
import { Base } from '../../utils/types';
|
|
4
|
+
type RadioLabelChildProps = {
|
|
5
|
+
focused: boolean;
|
|
6
|
+
hovered: boolean;
|
|
7
|
+
checked: boolean;
|
|
8
|
+
state?: State;
|
|
9
|
+
};
|
|
10
|
+
export interface RadioLabelProps<T> extends Base {
|
|
11
|
+
id: string;
|
|
12
|
+
value: T;
|
|
13
|
+
choice: RadioChoice;
|
|
14
|
+
choices?: RadioChoice[];
|
|
15
|
+
state?: State;
|
|
16
|
+
children: (props: RadioLabelChildProps) => ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const RadioLabel: <T extends ChoiceValue>({ id, value, choice, choices, state, children, ...base }: RadioLabelProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { useToggle as a } from "usehooks-ts";
|
|
3
|
+
import g from "clsx";
|
|
4
|
+
import { baseProps as l } from "../../utils/functions/functions.util.js";
|
|
5
|
+
import '../../assets/radio-label-CZHWBUUt.css';const p = "_RadioLabel_1q9rv_1", L = {
|
|
6
|
+
RadioLabel: p
|
|
7
|
+
}, F = ({
|
|
8
|
+
// RadioLabel props
|
|
9
|
+
id: d,
|
|
10
|
+
value: e,
|
|
11
|
+
choice: r,
|
|
12
|
+
choices: i = [],
|
|
13
|
+
state: n = "idle",
|
|
14
|
+
children: c,
|
|
15
|
+
// Base props
|
|
16
|
+
...o
|
|
17
|
+
}) => {
|
|
18
|
+
const [u, s] = a(!1), [m, t] = a(!1);
|
|
19
|
+
return /* @__PURE__ */ b(
|
|
20
|
+
"label",
|
|
21
|
+
{
|
|
22
|
+
"data-testid": l(o, "data-testid", "radio-label"),
|
|
23
|
+
htmlFor: d,
|
|
24
|
+
className: g(L.RadioLabel, l(o, "className")),
|
|
25
|
+
onFocus: () => s(),
|
|
26
|
+
onBlur: () => s(),
|
|
27
|
+
onMouseEnter: () => t(),
|
|
28
|
+
onMouseLeave: () => t(),
|
|
29
|
+
children: c({
|
|
30
|
+
focused: u,
|
|
31
|
+
hovered: m,
|
|
32
|
+
checked: typeof e == "string" ? e === r.value : e.includes(r.value),
|
|
33
|
+
state: (() => {
|
|
34
|
+
switch (n) {
|
|
35
|
+
case "success":
|
|
36
|
+
return "idle";
|
|
37
|
+
case "error":
|
|
38
|
+
return i.some((f) => f.value === e) ? e === r.value ? "error" : "idle" : "error";
|
|
39
|
+
case "idle":
|
|
40
|
+
return "idle";
|
|
41
|
+
}
|
|
42
|
+
})()
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
F as RadioLabel
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Status, type StatusProps } from './status.component';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Circle as o, X as a, Check as _ } from "lucide-react";
|
|
3
|
+
import i from "clsx";
|
|
4
|
+
import { baseProps as t } from "../../utils/functions/functions.util.js";
|
|
5
|
+
import '../../assets/status-ZxxbM9u1.css';const m = "_Status_rlg1f_1", C = "_Idle_rlg1f_6", d = "_Circle_rlg1f_6", f = "_Success_rlg1f_12", u = "_Check_rlg1f_34", n = "_X_rlg1f_35", s = {
|
|
6
|
+
Status: m,
|
|
7
|
+
Idle: C,
|
|
8
|
+
Circle: d,
|
|
9
|
+
Success: f,
|
|
10
|
+
Error: "_Error_rlg1f_18",
|
|
11
|
+
Check: u,
|
|
12
|
+
X: n
|
|
13
|
+
}, p = ({
|
|
14
|
+
// Status props
|
|
15
|
+
state: c,
|
|
16
|
+
// Base props
|
|
17
|
+
...e
|
|
18
|
+
}) => /* @__PURE__ */ l(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-testid": t(e, "data-testid", "status"),
|
|
22
|
+
className: i(s.Status, t(e, "className"), {
|
|
23
|
+
[s.Idle]: c === "idle",
|
|
24
|
+
[s.Success]: c === "success",
|
|
25
|
+
[s.Error]: c === "error"
|
|
26
|
+
}),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ r(o, { className: s.Circle }),
|
|
29
|
+
/* @__PURE__ */ r(a, { className: s.X }),
|
|
30
|
+
/* @__PURE__ */ r(_, { className: s.Check })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
export {
|
|
35
|
+
p as Status
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextArea, type TextAreaProps } from './text-area.component';
|