@clubmed/trident-ui 1.0.0-beta.2 → 1.0.0-beta.21
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +155 -0
- package/atoms/Icons/Iconics.d.ts +1 -1
- package/atoms/Icons/fonts/Utilities.js +0 -6
- package/atoms/Icons/svg/SvgIcon.js +12 -12
- package/atoms/Icons/svg/Utilities.js +0 -8
- package/atoms/Icons/svg-use/SvgUseIcon.js +12 -12
- package/atoms/Icons/svg-use/Utilities.js +58 -68
- package/fonts/Actions/tui-actions.css +6 -6
- package/fonts/Actions/tui-actions.eot +0 -0
- package/fonts/Actions/tui-actions.less +6 -6
- package/fonts/Actions/tui-actions.module.less +6 -6
- package/fonts/Actions/tui-actions.scss +6 -6
- package/fonts/Actions/tui-actions.styl +6 -6
- package/fonts/Actions/tui-actions.ttf +0 -0
- package/fonts/Actions/tui-actions.woff +0 -0
- package/fonts/Actions/tui-actions.woff2 +0 -0
- package/fonts/Activities/tui-activities.css +6 -6
- package/fonts/Activities/tui-activities.eot +0 -0
- package/fonts/Activities/tui-activities.less +6 -6
- package/fonts/Activities/tui-activities.module.less +6 -6
- package/fonts/Activities/tui-activities.scss +6 -6
- package/fonts/Activities/tui-activities.styl +6 -6
- package/fonts/Activities/tui-activities.ttf +0 -0
- package/fonts/Activities/tui-activities.woff +0 -0
- package/fonts/Activities/tui-activities.woff2 +0 -0
- package/fonts/Brand/tui-brand.css +6 -6
- package/fonts/Brand/tui-brand.eot +0 -0
- package/fonts/Brand/tui-brand.less +6 -6
- package/fonts/Brand/tui-brand.module.less +6 -6
- package/fonts/Brand/tui-brand.scss +6 -6
- package/fonts/Brand/tui-brand.styl +6 -6
- package/fonts/Brand/tui-brand.ttf +0 -0
- package/fonts/Brand/tui-brand.woff +0 -0
- package/fonts/Brand/tui-brand.woff2 +0 -0
- package/fonts/Covid/tui-covid.css +6 -6
- package/fonts/Covid/tui-covid.eot +0 -0
- package/fonts/Covid/tui-covid.less +6 -6
- package/fonts/Covid/tui-covid.module.less +6 -6
- package/fonts/Covid/tui-covid.scss +6 -6
- package/fonts/Covid/tui-covid.styl +6 -6
- package/fonts/Covid/tui-covid.ttf +0 -0
- package/fonts/Covid/tui-covid.woff +0 -0
- package/fonts/Covid/tui-covid.woff2 +0 -0
- package/fonts/Food/tui-food.css +6 -6
- package/fonts/Food/tui-food.eot +0 -0
- package/fonts/Food/tui-food.less +6 -6
- package/fonts/Food/tui-food.module.less +6 -6
- package/fonts/Food/tui-food.scss +6 -6
- package/fonts/Food/tui-food.styl +6 -6
- package/fonts/Food/tui-food.ttf +0 -0
- package/fonts/Food/tui-food.woff +0 -0
- package/fonts/Food/tui-food.woff2 +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
- package/fonts/Places/tui-places.css +6 -6
- package/fonts/Places/tui-places.eot +0 -0
- package/fonts/Places/tui-places.less +6 -6
- package/fonts/Places/tui-places.module.less +6 -6
- package/fonts/Places/tui-places.scss +6 -6
- package/fonts/Places/tui-places.styl +6 -6
- package/fonts/Places/tui-places.ttf +0 -0
- package/fonts/Places/tui-places.woff +0 -0
- package/fonts/Places/tui-places.woff2 +0 -0
- package/fonts/Room/tui-room.css +6 -6
- package/fonts/Room/tui-room.eot +0 -0
- package/fonts/Room/tui-room.less +6 -6
- package/fonts/Room/tui-room.module.less +6 -6
- package/fonts/Room/tui-room.scss +6 -6
- package/fonts/Room/tui-room.styl +6 -6
- package/fonts/Room/tui-room.ttf +0 -0
- package/fonts/Room/tui-room.woff +0 -0
- package/fonts/Room/tui-room.woff2 +0 -0
- package/fonts/Services/tui-services.css +6 -6
- package/fonts/Services/tui-services.eot +0 -0
- package/fonts/Services/tui-services.less +6 -6
- package/fonts/Services/tui-services.module.less +6 -6
- package/fonts/Services/tui-services.scss +6 -6
- package/fonts/Services/tui-services.styl +6 -6
- package/fonts/Services/tui-services.ttf +0 -0
- package/fonts/Services/tui-services.woff +0 -0
- package/fonts/Services/tui-services.woff2 +0 -0
- package/fonts/Socials/tui-socials.css +6 -6
- package/fonts/Socials/tui-socials.eot +0 -0
- package/fonts/Socials/tui-socials.less +6 -6
- package/fonts/Socials/tui-socials.module.less +6 -6
- package/fonts/Socials/tui-socials.scss +6 -6
- package/fonts/Socials/tui-socials.styl +6 -6
- package/fonts/Socials/tui-socials.ttf +0 -0
- package/fonts/Socials/tui-socials.woff +0 -0
- package/fonts/Socials/tui-socials.woff2 +0 -0
- package/fonts/Transports/tui-transports.css +6 -6
- package/fonts/Transports/tui-transports.eot +0 -0
- package/fonts/Transports/tui-transports.less +6 -6
- package/fonts/Transports/tui-transports.module.less +6 -6
- package/fonts/Transports/tui-transports.scss +6 -6
- package/fonts/Transports/tui-transports.styl +6 -6
- package/fonts/Transports/tui-transports.ttf +0 -0
- package/fonts/Transports/tui-transports.woff +0 -0
- package/fonts/Transports/tui-transports.woff2 +0 -0
- package/fonts/Utilities/tui-utilities.css +36 -38
- package/fonts/Utilities/tui-utilities.eot +0 -0
- package/fonts/Utilities/tui-utilities.less +36 -38
- package/fonts/Utilities/tui-utilities.module.less +36 -38
- package/fonts/Utilities/tui-utilities.scss +66 -70
- package/fonts/Utilities/tui-utilities.styl +36 -38
- package/fonts/Utilities/tui-utilities.svg +30 -36
- package/fonts/Utilities/tui-utilities.symbol.svg +0 -4
- package/fonts/Utilities/tui-utilities.ttf +0 -0
- package/fonts/Utilities/tui-utilities.woff +0 -0
- package/fonts/Utilities/tui-utilities.woff2 +0 -0
- package/hooks/useKeyboardControls.d.ts +1 -1
- package/hooks/useKeyboardControls.js +31 -27
- package/molecules/Backdrop.js +13 -12
- package/molecules/Breadcrumb.d.ts +9 -5
- package/molecules/Breadcrumb.js +20 -15
- package/molecules/Buttons/ButtonAnchor.d.ts +2 -1
- package/molecules/Buttons/ButtonAnchor.js +17 -16
- package/molecules/Forms/Checkboxes/Checkbox.d.ts +3 -12
- package/molecules/Forms/Checkboxes/Checkbox.js +90 -60
- package/molecules/Forms/Checkboxes/Checkboxes.d.ts +1 -1
- package/molecules/Forms/Checkboxes/Checkboxes.js +33 -34
- package/molecules/Forms/DateField.d.ts +1 -17
- package/molecules/Forms/DateField.js +99 -97
- package/molecules/Forms/Filter.d.ts +1 -1
- package/molecules/Forms/Filter.js +38 -38
- package/molecules/Forms/FormControl.d.ts +3 -2
- package/molecules/Forms/FormControl.js +30 -23
- package/molecules/Forms/FormLabel.d.ts +4 -17
- package/molecules/Forms/FormLabel.js +24 -19
- package/molecules/Forms/NumberField.d.ts +4 -4
- package/molecules/Forms/NumberField.js +75 -72
- package/molecules/Forms/Password/Password.d.ts +1 -0
- package/molecules/Forms/Password/Password.js +77 -52
- package/molecules/Forms/Password/ValidationMessage.js +1 -1
- package/molecules/Forms/Radios/Radio.d.ts +1 -1
- package/molecules/Forms/Radios/Radio.js +31 -31
- package/molecules/Forms/Radios/RadioGroup.d.ts +1 -1
- package/molecules/Forms/Radios/RadioGroup.js +28 -29
- package/molecules/Forms/Range.d.ts +2 -2
- package/molecules/Forms/Range.js +181 -183
- package/molecules/Forms/Select.d.ts +10 -0
- package/molecules/Forms/Select.js +102 -0
- package/molecules/Forms/Switch.d.ts +1 -1
- package/molecules/Forms/Switch.js +28 -28
- package/molecules/Forms/TextField.d.ts +0 -4
- package/molecules/Forms/TextField.js +52 -52
- package/molecules/Link.d.ts +5 -1
- package/molecules/Link.js +17 -16
- package/molecules/Popin.d.ts +12 -4
- package/molecules/Popin.js +38 -34
- package/molecules/Tabs/TabsHeading.js +73 -74
- package/molecules/Tabs/context/TabControl.js +21 -21
- package/package.json +1 -1
- package/styles/globals.css +8 -0
- package/EyeClosed-vWGtzMgE.js +0 -5
- package/EyeOpened-CsQwqVMl.js +0 -5
- package/assets/icons/Utilities/EyeClosed.svg +0 -12
- package/assets/icons/Utilities/EyeOpened.svg +0 -11
@@ -1,114 +1,117 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { c as
|
3
|
-
import {
|
1
|
+
import { jsx as o, jsxs as v } from "react/jsx-runtime";
|
2
|
+
import { c as C } from "../../index-Cu0xwYjD.js";
|
3
|
+
import { useId as y } from "react";
|
4
|
+
import { useValue as I } from "../../hooks/useValue.js";
|
4
5
|
import { Button as N } from "../Buttons/Button.js";
|
5
|
-
import { FormControl as
|
6
|
-
const
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
19
|
-
|
20
|
-
|
21
|
-
defaultValue: i,
|
6
|
+
import { FormControl as w } from "./FormControl.js";
|
7
|
+
const F = { width: "28px", height: "28px" };
|
8
|
+
function V(m) {
|
9
|
+
const e = y(), {
|
10
|
+
id: n = e,
|
11
|
+
name: r = n,
|
12
|
+
value: c = 0,
|
13
|
+
onChange: d,
|
14
|
+
min: t = 0,
|
15
|
+
max: l = 10,
|
16
|
+
disabled: i = !1,
|
17
|
+
dataTestId: u = "NumberField",
|
18
|
+
...f
|
19
|
+
} = m, { value: a, setValue: s } = I({
|
20
|
+
name: r,
|
21
|
+
defaultValue: c,
|
22
22
|
formatter: Number,
|
23
|
-
onChange:
|
23
|
+
onChange: d
|
24
24
|
});
|
25
25
|
return {
|
26
|
-
...
|
27
|
-
id:
|
28
|
-
min:
|
26
|
+
...f,
|
27
|
+
id: n,
|
28
|
+
min: t,
|
29
29
|
max: l,
|
30
|
-
name:
|
31
|
-
value:
|
32
|
-
dataTestId:
|
33
|
-
disabled:
|
34
|
-
handleChange: (
|
35
|
-
const
|
36
|
-
|
30
|
+
name: r,
|
31
|
+
value: a,
|
32
|
+
dataTestId: u,
|
33
|
+
disabled: i,
|
34
|
+
handleChange: (g) => {
|
35
|
+
const h = Number(g.target.value);
|
36
|
+
h >= t && h <= l && s(Number(h));
|
37
37
|
},
|
38
38
|
increase: () => {
|
39
|
-
|
39
|
+
a < l && s(a + 1);
|
40
40
|
},
|
41
41
|
decrease: () => {
|
42
|
-
|
42
|
+
a > t && s(a - 1);
|
43
43
|
}
|
44
44
|
};
|
45
45
|
}
|
46
|
-
const
|
46
|
+
const k = (m) => {
|
47
47
|
const {
|
48
48
|
disabled: e,
|
49
|
-
min:
|
50
|
-
max:
|
51
|
-
label:
|
52
|
-
description:
|
53
|
-
id:
|
54
|
-
dataTestId:
|
55
|
-
value:
|
56
|
-
handleChange:
|
57
|
-
increase:
|
58
|
-
decrease:
|
59
|
-
errorMessage:
|
49
|
+
min: n,
|
50
|
+
max: r,
|
51
|
+
label: c,
|
52
|
+
description: d,
|
53
|
+
id: t,
|
54
|
+
dataTestId: l,
|
55
|
+
value: i,
|
56
|
+
handleChange: u,
|
57
|
+
increase: f,
|
58
|
+
decrease: a,
|
59
|
+
errorMessage: s,
|
60
60
|
validationStatus: p,
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
required: b,
|
62
|
+
...x
|
63
|
+
} = V(m);
|
64
|
+
return /* @__PURE__ */ o(
|
65
|
+
w,
|
65
66
|
{
|
66
|
-
id:
|
67
|
-
label:
|
68
|
-
description:
|
67
|
+
id: t,
|
68
|
+
label: c,
|
69
|
+
description: d,
|
69
70
|
className: "flex items-center justify-between",
|
70
71
|
dataName: "NumberField",
|
71
|
-
dataTestId:
|
72
|
-
errorMessage:
|
72
|
+
dataTestId: l,
|
73
|
+
errorMessage: s,
|
73
74
|
validationStatus: p,
|
74
75
|
disabled: e,
|
76
|
+
required: b,
|
75
77
|
layout: "vertical",
|
76
|
-
children: /* @__PURE__ */
|
77
|
-
/* @__PURE__ */
|
78
|
+
children: /* @__PURE__ */ v("div", { className: "flex items-center gap-x-8", children: [
|
79
|
+
/* @__PURE__ */ o(
|
78
80
|
N,
|
79
81
|
{
|
80
82
|
theme: "yellow",
|
81
|
-
onClick:
|
83
|
+
onClick: a,
|
82
84
|
variant: "icon",
|
83
|
-
disabled:
|
85
|
+
disabled: i <= n || e,
|
84
86
|
icon: "MinusDefault",
|
85
87
|
label: "MINUS"
|
86
88
|
}
|
87
89
|
),
|
88
|
-
/* @__PURE__ */
|
90
|
+
/* @__PURE__ */ o(
|
89
91
|
"input",
|
90
92
|
{
|
91
|
-
...
|
92
|
-
className:
|
93
|
+
...x,
|
94
|
+
className: C("text-b2 text-center font-normal outline-none", {
|
93
95
|
"bg-pearl text-grey": e
|
94
96
|
}),
|
95
|
-
style:
|
97
|
+
style: F,
|
96
98
|
type: "number",
|
97
|
-
id:
|
98
|
-
onChange:
|
99
|
+
id: t,
|
100
|
+
onChange: u,
|
99
101
|
disabled: e,
|
100
|
-
|
101
|
-
|
102
|
-
|
102
|
+
required: b,
|
103
|
+
value: i,
|
104
|
+
min: n,
|
105
|
+
max: r
|
103
106
|
}
|
104
107
|
),
|
105
|
-
/* @__PURE__ */
|
108
|
+
/* @__PURE__ */ o(
|
106
109
|
N,
|
107
110
|
{
|
108
111
|
theme: "yellow",
|
109
|
-
onClick:
|
112
|
+
onClick: f,
|
110
113
|
variant: "icon",
|
111
|
-
disabled:
|
114
|
+
disabled: i >= r || e,
|
112
115
|
icon: "PlusDefault",
|
113
116
|
label: "PLUS"
|
114
117
|
}
|
@@ -118,6 +121,6 @@ const P = (s) => {
|
|
118
121
|
);
|
119
122
|
};
|
120
123
|
export {
|
121
|
-
|
122
|
-
|
124
|
+
k as NumberField,
|
125
|
+
V as useNumberField
|
123
126
|
};
|
@@ -2,5 +2,6 @@ import { FormControlProps } from '../FormControl';
|
|
2
2
|
import { ValidationMessage } from './ValidationMessage';
|
3
3
|
export interface PasswordProps<Value> extends FormControlProps<Value> {
|
4
4
|
validationMessages?: ValidationMessage[];
|
5
|
+
withoutFieldValidation?: boolean;
|
5
6
|
}
|
6
7
|
export declare function Password<Value = string>(props: PasswordProps<Value>): import("react/jsx-runtime").JSX.Element;
|
@@ -1,73 +1,98 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { useState as
|
4
|
-
import { useValue as
|
5
|
-
import { FormControl as
|
6
|
-
import { Icon as
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
2
|
+
import { c as m } from "../../../index-Cu0xwYjD.js";
|
3
|
+
import { useId as M, useState as P, useEffect as S } from "react";
|
4
|
+
import { useValue as T } from "../../../hooks/useValue.js";
|
5
|
+
import { FormControl as D } from "../FormControl.js";
|
6
|
+
import { Icon as n } from "../../../atoms/Icons/Icon.js";
|
7
7
|
import "../../../atoms/Icons/contexts/IconsContext.js";
|
8
|
-
import { ValidationMessage as
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
8
|
+
import { ValidationMessage as F } from "./ValidationMessage.js";
|
9
|
+
function K(f) {
|
10
|
+
const b = M(), {
|
11
|
+
id: r = b,
|
12
|
+
name: o = r,
|
13
|
+
label: x,
|
14
|
+
value: g,
|
15
|
+
disabled: d = !1,
|
16
|
+
required: c = !1,
|
17
|
+
validationStatus: e = "default",
|
18
|
+
errorMessage: h,
|
19
|
+
validationMessages: p = [],
|
20
|
+
withoutFieldValidation: s = !1,
|
21
|
+
className: v,
|
22
|
+
onChange: w,
|
23
|
+
dataTestId: y = "Password",
|
24
|
+
...N
|
25
|
+
} = f, { value: C, setValue: V } = T({
|
26
|
+
name: o,
|
27
|
+
initialValue: g,
|
28
|
+
onChange: w
|
29
|
+
}), [t, u] = P("password");
|
30
|
+
S(() => u(t), [t]);
|
31
|
+
const k = () => u(t === "password" ? "text" : "password");
|
32
|
+
return /* @__PURE__ */ i(
|
33
|
+
D,
|
31
34
|
{
|
32
|
-
id:
|
33
|
-
label:
|
35
|
+
id: r,
|
36
|
+
label: x,
|
34
37
|
dataName: "Password",
|
35
|
-
dataTestId:
|
36
|
-
disabled:
|
38
|
+
dataTestId: y,
|
39
|
+
disabled: d,
|
40
|
+
required: c,
|
41
|
+
validationStatus: s ? "default" : e,
|
42
|
+
errorMessage: h,
|
37
43
|
children: [
|
38
|
-
/* @__PURE__ */
|
44
|
+
/* @__PURE__ */ i("div", { className: "relative", children: [
|
39
45
|
/* @__PURE__ */ a(
|
40
46
|
"input",
|
41
47
|
{
|
42
|
-
...
|
43
|
-
id:
|
44
|
-
name:
|
45
|
-
type:
|
46
|
-
value:
|
47
|
-
disabled:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
...N,
|
49
|
+
id: r,
|
50
|
+
name: o,
|
51
|
+
type: t,
|
52
|
+
value: C,
|
53
|
+
disabled: d,
|
54
|
+
required: c,
|
55
|
+
onChange: (l) => V(l.target.value),
|
56
|
+
className: m(
|
57
|
+
"text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black",
|
58
|
+
{
|
59
|
+
"border-lightGrey focus:border-black active:border-black pe-[52px]": s || e === "default",
|
60
|
+
"pe-[84px]": !s && (e === "error" || e === "success"),
|
61
|
+
"border-red": !s && e === "error",
|
62
|
+
"border-green": !s && e === "success"
|
63
|
+
},
|
64
|
+
v
|
52
65
|
),
|
53
|
-
"aria-label":
|
66
|
+
"aria-label": o
|
54
67
|
}
|
55
68
|
),
|
56
69
|
/* @__PURE__ */ a(
|
57
|
-
"
|
70
|
+
"div",
|
58
71
|
{
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
children: /* @__PURE__ */
|
72
|
+
className: m(
|
73
|
+
"pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12"
|
74
|
+
),
|
75
|
+
children: /* @__PURE__ */ i("span", { className: "ms-auto flex gap-x-8", children: [
|
76
|
+
!s && e === "error" && /* @__PURE__ */ a(n, { name: "CrossDefault", color: "red", width: "24px" }),
|
77
|
+
!s && e === "success" && /* @__PURE__ */ a(n, { name: "CheckDefault", color: "green", width: "24px" }),
|
78
|
+
/* @__PURE__ */ a(
|
79
|
+
"button",
|
80
|
+
{
|
81
|
+
type: "button",
|
82
|
+
className: "pointer-events-auto size-24 inline-flex",
|
83
|
+
onClick: k,
|
84
|
+
children: /* @__PURE__ */ a(n, { name: t === "password" ? "Invisible" : "Visible", width: "24px", type: "svg" })
|
85
|
+
}
|
86
|
+
)
|
87
|
+
] })
|
63
88
|
}
|
64
89
|
)
|
65
90
|
] }),
|
66
|
-
|
91
|
+
p.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: p.map(({ label: l, status: I }, j) => /* @__PURE__ */ a(F, { label: l, status: I }, j)) })
|
67
92
|
]
|
68
93
|
}
|
69
94
|
);
|
70
95
|
}
|
71
96
|
export {
|
72
|
-
|
97
|
+
K as Password
|
73
98
|
};
|
@@ -20,7 +20,7 @@ function x({ label: r, status: c }) {
|
|
20
20
|
const { iconName: i, iconColor: o } = a[c];
|
21
21
|
return /* @__PURE__ */ n("div", { className: "flex gap-[6px] px-20 items-center", children: [
|
22
22
|
/* @__PURE__ */ e(t, { name: i, width: "30px", color: o }),
|
23
|
-
/* @__PURE__ */ e("span", { className: s("text-
|
23
|
+
/* @__PURE__ */ e("span", { className: s("text-b3", `text-${o}`), children: r })
|
24
24
|
] });
|
25
25
|
}
|
26
26
|
export {
|
@@ -12,4 +12,4 @@ export interface RadioProps<Value = string> extends Omit<InputHTMLAttributes<HTM
|
|
12
12
|
size?: number;
|
13
13
|
onChange?: (name: string, value: Value | null) => void;
|
14
14
|
}
|
15
|
-
export declare function Radio<Value = string>(
|
15
|
+
export declare function Radio<Value = string>(props: RadioProps<Value>): import("react/jsx-runtime").JSX.Element;
|
@@ -1,57 +1,57 @@
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { c as
|
2
|
+
import { c as b } from "../../../index-Cu0xwYjD.js";
|
3
|
+
import { useId as k } from "react";
|
3
4
|
import { useValue as w } from "../../../hooks/useValue.js";
|
4
5
|
import "../../../controls-l0sNRNKZ.js";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}
|
20
|
-
|
21
|
-
name: r,
|
6
|
+
function R(d) {
|
7
|
+
const n = k(), {
|
8
|
+
id: o = n,
|
9
|
+
name: l = o,
|
10
|
+
className: m,
|
11
|
+
dataTestId: h,
|
12
|
+
disabled: a,
|
13
|
+
checked: f = !1,
|
14
|
+
value: i,
|
15
|
+
size: t = 24,
|
16
|
+
tabIndex: p = 0,
|
17
|
+
children: u,
|
18
|
+
onChange: s,
|
19
|
+
...v
|
20
|
+
} = d, { value: r, setValue: x } = w({
|
21
|
+
name: l,
|
22
22
|
initialValue: f,
|
23
|
-
onChange(
|
24
|
-
|
23
|
+
onChange(g, y) {
|
24
|
+
s == null || s(g, i !== void 0 ? i : y);
|
25
25
|
}
|
26
26
|
});
|
27
27
|
return /* @__PURE__ */ c(
|
28
28
|
"label",
|
29
29
|
{
|
30
|
-
className:
|
31
|
-
"text-grey":
|
30
|
+
className: b(m, "relative flex items-center gap-8", {
|
31
|
+
"text-grey": a
|
32
32
|
}),
|
33
33
|
children: [
|
34
34
|
/* @__PURE__ */ c("span", { className: "relative", children: [
|
35
35
|
/* @__PURE__ */ e(
|
36
36
|
"input",
|
37
37
|
{
|
38
|
-
...
|
39
|
-
name:
|
40
|
-
"data-testid":
|
38
|
+
...v,
|
39
|
+
name: l,
|
40
|
+
"data-testid": h,
|
41
41
|
type: "radio",
|
42
|
-
tabIndex:
|
42
|
+
tabIndex: p,
|
43
43
|
onChange: () => {
|
44
|
-
!
|
44
|
+
!a && x(!r);
|
45
45
|
},
|
46
|
-
defaultChecked:
|
46
|
+
defaultChecked: r,
|
47
47
|
"data-name": "Radio",
|
48
|
-
disabled:
|
48
|
+
disabled: a,
|
49
49
|
value: i
|
50
50
|
}
|
51
51
|
),
|
52
|
-
/* @__PURE__ */ e("span", { style: { height:
|
52
|
+
/* @__PURE__ */ e("span", { style: { height: t, width: t }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", width: t * 2 / 3, className: "overflow-visible", children: /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "8px", style: { fill: "hsl(var(--color-saffron))" } }) }) })
|
53
53
|
] }),
|
54
|
-
|
54
|
+
u
|
55
55
|
]
|
56
56
|
}
|
57
57
|
);
|
@@ -2,4 +2,4 @@ import { HTMLAttributes } from 'react';
|
|
2
2
|
import { FormControlProps } from '../FormControl.js';
|
3
3
|
export interface RadioGroupProps<Value = string> extends Pick<FormControlProps<Value>, 'id' | 'name' | 'value' | 'onChange' | 'disabled' | 'readOnly' | 'tabIndex' | 'description' | 'validationStatus' | 'errorMessage'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
4
4
|
}
|
5
|
-
export declare function RadioGroup<Value = string>(
|
5
|
+
export declare function RadioGroup<Value = string>(props: RadioGroupProps<Value>): import("react/jsx-runtime").JSX.Element;
|
@@ -1,39 +1,38 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { Children as
|
3
|
-
import { useValue as
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
2
|
+
import { useId as x, Children as I, isValidElement as b, cloneElement as C } from "react";
|
3
|
+
import { useValue as h } from "../../../hooks/useValue.js";
|
4
4
|
import { c as E } from "../../../index-Cu0xwYjD.js";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
const { value: c, setValue: f } = C({
|
5
|
+
function G(l) {
|
6
|
+
const s = x(), {
|
7
|
+
id: a = s,
|
8
|
+
name: r = a,
|
9
|
+
children: t,
|
10
|
+
value: i,
|
11
|
+
defaultValue: m,
|
12
|
+
onChange: u,
|
13
|
+
disabled: d,
|
14
|
+
readOnly: p,
|
15
|
+
tabIndex: c = 0,
|
16
|
+
...n
|
17
|
+
} = l, { value: f, setValue: V } = h({
|
19
18
|
name: r,
|
20
|
-
initialValue:
|
21
|
-
defaultValue:
|
22
|
-
onChange:
|
19
|
+
initialValue: i,
|
20
|
+
defaultValue: m,
|
21
|
+
onChange: u
|
23
22
|
});
|
24
|
-
return /* @__PURE__ */
|
23
|
+
return /* @__PURE__ */ v("div", { ...n, className: E("flex gap-12", n.className), role: "radiogroup", children: I.map(t, (e, o) => b(e) ? C(e, {
|
25
24
|
...e.props,
|
26
25
|
name: r,
|
27
|
-
id: `${
|
28
|
-
disabled:
|
29
|
-
readOnly:
|
30
|
-
tabIndex:
|
31
|
-
checked:
|
32
|
-
onChange(
|
33
|
-
|
26
|
+
id: `${a}-${o}`,
|
27
|
+
disabled: d,
|
28
|
+
readOnly: p,
|
29
|
+
tabIndex: c + o + 1,
|
30
|
+
checked: f === e.props.value,
|
31
|
+
onChange(N, g) {
|
32
|
+
V(g);
|
34
33
|
}
|
35
34
|
}) : e) });
|
36
35
|
}
|
37
36
|
export {
|
38
|
-
|
37
|
+
G as RadioGroup
|
39
38
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
2
2
|
import './range.css';
|
3
3
|
interface RangeProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
4
4
|
/**
|
@@ -37,5 +37,5 @@ interface RangeProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChan
|
|
37
37
|
label: string;
|
38
38
|
}[];
|
39
39
|
}
|
40
|
-
export declare const Range:
|
40
|
+
export declare const Range: (props: RangeProps) => import("react/jsx-runtime").JSX.Element;
|
41
41
|
export {};
|