@tedi-design-system/react 19.2.0-rc.6 → 19.2.0-rc.8
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/bundle-stats.html +1 -1
- package/component.manifest.json +8 -8
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/map-components/map-layer/map-layer.cjs.js +1 -1
- package/src/community/components/map-components/map-layer/map-layer.es.js +1 -1
- package/src/tedi/components/content/label/label.cjs.js +1 -1
- package/src/tedi/components/content/label/label.d.ts +22 -0
- package/src/tedi/components/content/label/label.es.js +30 -28
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group-context.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group-context.d.ts +20 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group-context.es.js +5 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.d.ts +72 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.es.js +124 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.module.scss.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.module.scss.es.js +13 -0
- package/src/tedi/components/form/checkbox/checkbox.cjs.js +1 -1
- package/src/tedi/components/form/checkbox/checkbox.d.ts +8 -2
- package/src/tedi/components/form/checkbox/checkbox.es.js +146 -108
- package/src/tedi/components/form/checkbox/checkbox.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/checkbox/checkbox.module.scss.es.js +11 -3
- package/src/tedi/components/form/checkbox/index.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/index.d.ts +11 -0
- package/src/tedi/components/form/checkbox/index.es.js +7 -0
- package/src/tedi/components/form/choice-group/choice-group.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/choice-group.d.ts +11 -0
- package/src/tedi/components/form/choice-group/choice-group.es.js +80 -69
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.es.js +15 -15
- package/src/tedi/components/form/choice-input.types.d.ts +46 -8
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +5 -0
- package/src/tedi/components/form/date-field/date-field.es.js +187 -184
- package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -1
- package/src/tedi/components/form/date-time-field/date-time-field.d.ts +5 -0
- package/src/tedi/components/form/date-time-field/date-time-field.es.js +103 -101
- package/src/tedi/components/form/form-label/form-label.cjs.js +1 -1
- package/src/tedi/components/form/form-label/form-label.d.ts +9 -0
- package/src/tedi/components/form/form-label/form-label.es.js +15 -14
- package/src/tedi/components/form/multi-value-field/multi-value-field.cjs.js +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.d.ts +7 -0
- package/src/tedi/components/form/multi-value-field/multi-value-field.es.js +41 -40
- package/src/tedi/components/form/number-field/number-field.cjs.js +1 -1
- package/src/tedi/components/form/number-field/number-field.es.js +54 -43
- package/src/tedi/components/form/radio/index.cjs.js +1 -0
- package/src/tedi/components/form/radio/index.d.ts +11 -0
- package/src/tedi/components/form/radio/index.es.js +7 -0
- package/src/tedi/components/form/radio/radio-group/radio-group-context.cjs.js +1 -0
- package/src/tedi/components/form/radio/radio-group/radio-group-context.d.ts +21 -0
- package/src/tedi/components/form/radio/radio-group/radio-group-context.es.js +5 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.cjs.js +1 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.d.ts +56 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.es.js +78 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.module.scss.cjs.js +1 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.module.scss.es.js +13 -0
- package/src/tedi/components/form/radio/radio.cjs.js +1 -1
- package/src/tedi/components/form/radio/radio.d.ts +7 -2
- package/src/tedi/components/form/radio/radio.es.js +117 -77
- package/src/tedi/components/form/radio/radio.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/radio/radio.module.scss.es.js +11 -3
- package/src/tedi/components/form/select/select.cjs.js +1 -1
- package/src/tedi/components/form/select/select.es.js +79 -77
- package/src/tedi/components/form/slider/slider.cjs.js +1 -1
- package/src/tedi/components/form/slider/slider.d.ts +7 -0
- package/src/tedi/components/form/slider/slider.es.js +48 -47
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.es.js +72 -61
- package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
- package/src/tedi/components/form/time-field/time-field.d.ts +5 -0
- package/src/tedi/components/form/time-field/time-field.es.js +87 -85
- package/src/tedi/components/form/toggle/toggle.cjs.js +1 -1
- package/src/tedi/components/form/toggle/toggle.d.ts +7 -0
- package/src/tedi/components/form/toggle/toggle.es.js +26 -24
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.d.ts +12 -0
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.es.js +57 -27
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.d.ts +17 -0
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.es.js +65 -51
- package/src/tedi/index.d.ts +2 -2
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +14 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +25 -11
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +298 -294
|
@@ -1,125 +1,163 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import d from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import r from "react";
|
|
4
4
|
import { Icon as C } from "../../base/icon/icon.es.js";
|
|
5
|
-
import { FeedbackText as
|
|
6
|
-
import { FormLabel as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
5
|
+
import { FeedbackText as E } from "../feedback-text/feedback-text.es.js";
|
|
6
|
+
import { FormLabel as ae } from "../form-label/form-label.es.js";
|
|
7
|
+
import c from "./checkbox.module.scss.es.js";
|
|
8
|
+
import { CheckboxGroupContext as de } from "./checkbox-group/checkbox-group-context.es.js";
|
|
9
|
+
import { useBreakpointProps as te } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
10
|
+
import { Row as re } from "../../layout/grid/row.es.js";
|
|
11
|
+
import { Col as D } from "../../layout/grid/col.es.js";
|
|
12
|
+
const oe = (y) => {
|
|
13
|
+
const e = r.useContext(de), { getCurrentBreakpointProps: F } = te(y.defaultServerBreakpoint), {
|
|
14
|
+
id: G,
|
|
15
|
+
label: m,
|
|
16
|
+
value: n,
|
|
17
|
+
className: I,
|
|
18
|
+
onChange: s,
|
|
19
|
+
hideLabel: P = !1,
|
|
20
|
+
helper: t,
|
|
21
|
+
checked: k,
|
|
22
|
+
defaultChecked: M,
|
|
23
|
+
indeterminate: l,
|
|
24
|
+
hover: S,
|
|
25
|
+
name: T,
|
|
26
|
+
tooltip: z,
|
|
27
|
+
description: _,
|
|
28
|
+
icon: p,
|
|
29
|
+
labelProps: H,
|
|
30
|
+
size: U,
|
|
31
|
+
variant: A,
|
|
32
|
+
cardVariant: J,
|
|
33
|
+
disabled: K,
|
|
34
|
+
invalid: w,
|
|
35
|
+
required: O,
|
|
36
|
+
...B
|
|
37
|
+
} = F(y), h = U ?? (e == null ? void 0 : e.size) ?? "default", $ = A ?? (e == null ? void 0 : e.variant) ?? "default", Q = J ?? (e == null ? void 0 : e.cardVariant) ?? "primary";
|
|
38
|
+
$ === "card" && z && console.warn('Checkbox: `tooltip` is not supported with `variant="card"` and will be ignored. Use `description`.');
|
|
39
|
+
const f = K ?? (e == null ? void 0 : e.disabled) ?? !1, W = w ?? (e == null ? void 0 : e.invalid), L = O, X = r.useId(), b = G ?? X, Y = T ?? (e == null ? void 0 : e.name), [R, Z] = r.useState(M || !1), u = r.useRef(null), N = e !== null, v = r.useMemo(() => l ? "mixed" : N ? !!(e != null && e.values.includes(n)) : s && typeof k < "u" ? k : R, [l, N, e, n, s, k, R]);
|
|
40
|
+
r.useEffect(() => {
|
|
41
|
+
u.current && (u.current.indeterminate = !!l);
|
|
42
|
+
}, [l, v]);
|
|
43
|
+
const g = (i) => {
|
|
44
|
+
N ? e == null || e.onToggle(n, i.target.checked) : typeof k > "u" && Z(i == null ? void 0 : i.target.checked), s == null || s(n, i == null ? void 0 : i.target.checked);
|
|
45
|
+
}, x = t ? t.id ?? `${b}-helper` : void 0, ee = x, V = /* @__PURE__ */ a(
|
|
46
|
+
"input",
|
|
47
|
+
{
|
|
48
|
+
ref: u,
|
|
49
|
+
id: b,
|
|
50
|
+
value: n,
|
|
51
|
+
name: Y,
|
|
52
|
+
type: "checkbox",
|
|
53
|
+
disabled: f,
|
|
54
|
+
checked: v !== "mixed" ? v : !1,
|
|
55
|
+
required: L,
|
|
56
|
+
"aria-invalid": w || void 0,
|
|
57
|
+
onChange: g,
|
|
58
|
+
className: c["tedi-checkbox__input"],
|
|
59
|
+
"aria-describedby": ee
|
|
60
|
+
}
|
|
61
|
+
), j = (i) => /* @__PURE__ */ o(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
className: d(
|
|
66
|
+
c["tedi-checkbox__indicator"],
|
|
67
|
+
{
|
|
68
|
+
[c["tedi-checkbox__indicator--hover"]]: S,
|
|
69
|
+
[c["tedi-checkbox__indicator--indeterminate"]]: l,
|
|
70
|
+
[c[`tedi-checkbox__indicator--size-${h}`]]: h,
|
|
71
|
+
[c["tedi-checkbox__indicator--invalid"]]: W
|
|
72
|
+
},
|
|
73
|
+
i
|
|
74
|
+
),
|
|
75
|
+
"data-testid": "checkbox-indicator",
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ a(
|
|
78
|
+
C,
|
|
79
|
+
{
|
|
80
|
+
size: h === "default" ? 16 : 18,
|
|
81
|
+
name: "remove",
|
|
82
|
+
className: d(c["tedi-checkbox__icon"], c["tedi-checkbox__icon--indeterminate"])
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ a(
|
|
86
|
+
C,
|
|
87
|
+
{
|
|
88
|
+
size: h === "default" ? 16 : 18,
|
|
89
|
+
name: "check",
|
|
90
|
+
className: d(c["tedi-checkbox__icon"], c["tedi-checkbox__icon--check"])
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
if ($ === "card") {
|
|
97
|
+
const i = `${b}-label`, q = _ ? `${b}-description` : void 0, ie = [q, x].filter(Boolean).join(" ") || void 0;
|
|
98
|
+
return /* @__PURE__ */ o(
|
|
99
|
+
"label",
|
|
100
|
+
{
|
|
101
|
+
"data-name": "check",
|
|
102
|
+
className: d(
|
|
103
|
+
c["tedi-checkbox"],
|
|
104
|
+
c["tedi-checkbox--card"],
|
|
105
|
+
c[`tedi-checkbox--card-${Q}`],
|
|
106
|
+
{ [c["tedi-checkbox--card-with-icon"]]: !!p },
|
|
107
|
+
{ [c["tedi-checkbox--disabled"]]: f },
|
|
108
|
+
I
|
|
109
|
+
),
|
|
110
|
+
...B,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ o("span", { className: c["tedi-checkbox__card-control"], children: [
|
|
113
|
+
r.cloneElement(V, {
|
|
114
|
+
"aria-labelledby": m ? i : void 0,
|
|
115
|
+
"aria-describedby": ie
|
|
116
|
+
}),
|
|
117
|
+
j(),
|
|
118
|
+
p && /* @__PURE__ */ a(C, { name: p, size: h === "default" ? 18 : 24, className: c["tedi-checkbox__card-icon"] }),
|
|
119
|
+
/* @__PURE__ */ a("span", { id: i, className: d(c["tedi-checkbox__card-label"], { "sr-only": P }), children: m })
|
|
120
|
+
] }),
|
|
121
|
+
_ && /* @__PURE__ */ a("span", { id: q, className: c["tedi-checkbox__card-description"], children: _ }),
|
|
122
|
+
t && /* @__PURE__ */ a(E, { id: x, ...t, className: d(c["tedi-checkbox__helper"], t.className) })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
const ce = d(c["tedi-checkbox__label"], { [c["tedi-checkbox--disabled"]]: f });
|
|
128
|
+
return /* @__PURE__ */ o(
|
|
38
129
|
"div",
|
|
39
130
|
{
|
|
40
|
-
className:
|
|
131
|
+
className: d(c["tedi-checkbox"], { [c["tedi-checkbox--disabled"]]: f }),
|
|
41
132
|
"data-name": "check",
|
|
42
|
-
...
|
|
133
|
+
...B,
|
|
43
134
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
ref: f,
|
|
50
|
-
id: o,
|
|
51
|
-
value: b,
|
|
52
|
-
name: j,
|
|
53
|
-
type: "checkbox",
|
|
54
|
-
disabled: h,
|
|
55
|
-
checked: r ? !1 : B,
|
|
56
|
-
onChange: E,
|
|
57
|
-
className: e["tedi-checkbox__input"],
|
|
58
|
-
"aria-describedby": [N, F].filter(Boolean).join(" "),
|
|
59
|
-
required: p,
|
|
60
|
-
"aria-invalid": u || void 0
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
/* @__PURE__ */ s(
|
|
64
|
-
"div",
|
|
65
|
-
{
|
|
66
|
-
"aria-hidden": "true",
|
|
67
|
-
onClick: () => {
|
|
68
|
-
var c;
|
|
69
|
-
return (c = x.current) == null ? void 0 : c.click();
|
|
70
|
-
},
|
|
71
|
-
className: t(
|
|
72
|
-
e["tedi-checkbox__indicator"],
|
|
73
|
-
{
|
|
74
|
-
[e["tedi-checkbox__indicator--hover"]]: I,
|
|
75
|
-
[e["tedi-checkbox__indicator--indeterminate"]]: r,
|
|
76
|
-
[e[`tedi-checkbox__indicator--size-${l}`]]: l,
|
|
77
|
-
[e["tedi-checkbox__indicator--invalid"]]: u
|
|
78
|
-
},
|
|
79
|
-
g
|
|
80
|
-
),
|
|
81
|
-
"data-testid": "checkbox-indicator",
|
|
82
|
-
children: [
|
|
83
|
-
/* @__PURE__ */ i(
|
|
84
|
-
C,
|
|
85
|
-
{
|
|
86
|
-
size: l === "default" ? 16 : 18,
|
|
87
|
-
name: "remove",
|
|
88
|
-
className: t(e["tedi-checkbox__icon"], e["tedi-checkbox__icon--indeterminate"])
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ i(
|
|
92
|
-
C,
|
|
93
|
-
{
|
|
94
|
-
size: l === "default" ? 16 : 18,
|
|
95
|
-
name: "check",
|
|
96
|
-
className: t(e["tedi-checkbox__icon"], e["tedi-checkbox__icon--check"])
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
)
|
|
135
|
+
/* @__PURE__ */ o(re, { gutter: 0, children: [
|
|
136
|
+
/* @__PURE__ */ a(D, { width: "auto", children: /* @__PURE__ */ o("div", { className: c["tedi-checkbox__outer-indicator-wrapper"], children: [
|
|
137
|
+
V,
|
|
138
|
+
j(I)
|
|
102
139
|
] }) }),
|
|
103
|
-
|
|
104
|
-
|
|
140
|
+
m && /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(
|
|
141
|
+
ae,
|
|
105
142
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
id: o,
|
|
143
|
+
className: ce,
|
|
144
|
+
id: b,
|
|
109
145
|
"data-testid": "checkbox-label",
|
|
110
|
-
hideLabel:
|
|
111
|
-
label:
|
|
112
|
-
tooltip:
|
|
113
|
-
required:
|
|
146
|
+
hideLabel: P,
|
|
147
|
+
label: m,
|
|
148
|
+
tooltip: z,
|
|
149
|
+
required: L,
|
|
150
|
+
labelProps: H
|
|
114
151
|
}
|
|
115
152
|
) })
|
|
116
153
|
] }),
|
|
117
|
-
|
|
154
|
+
t && /* @__PURE__ */ a(E, { id: x, ...t, className: d(c["tedi-checkbox__helper"], t.className) })
|
|
118
155
|
]
|
|
119
156
|
}
|
|
120
157
|
);
|
|
121
158
|
};
|
|
159
|
+
oe.displayName = "Checkbox";
|
|
122
160
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
161
|
+
oe as Checkbox,
|
|
162
|
+
oe as default
|
|
125
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c={"tedi-checkbox":"tedi-checkbox-0294a114","tedi-checkbox--disabled":"tedi-checkbox--disabled-e22bbaf4","tedi-checkbox__input":"tedi-checkbox__input-2ecab369","tedi-checkbox__outer-indicator-wrapper":"tedi-checkbox__outer-indicator-wrapper-5c85e0ab","tedi-checkbox__helper":"tedi-checkbox__helper-ab2b492c","tedi-checkbox__icon":"tedi-checkbox__icon-281ccd2f","tedi-checkbox__indicator":"tedi-checkbox__indicator-3ae3e79f","tedi-checkbox__icon--check":"tedi-checkbox__icon--check-048f3d53","tedi-checkbox__indicator--indeterminate":"tedi-checkbox__indicator--indeterminate-909c7897","tedi-checkbox__icon--indeterminate":"tedi-checkbox__icon--indeterminate-3e893b59","tedi-checkbox__tooltip-icon":"tedi-checkbox__tooltip-icon-46223bb7","tedi-checkbox__indicator--size-default":"tedi-checkbox__indicator--size-default-00511279","tedi-checkbox__indicator--size-large":"tedi-checkbox__indicator--size-large-b64ce54c","tedi-checkbox__indicator--invalid":"tedi-checkbox__indicator--invalid-019a355d","tedi-checkbox__indicator--hover":"tedi-checkbox__indicator--hover-436b8cb1","tedi-checkbox--card":"tedi-checkbox--card-d1faeb0e","tedi-checkbox__card-control":"tedi-checkbox__card-control-ea88c4f4","tedi-checkbox__card-label":"tedi-checkbox__card-label-4c136337","tedi-checkbox__card-icon":"tedi-checkbox__card-icon-a4d72e5a","tedi-checkbox__card-description":"tedi-checkbox__card-description-fa672631","tedi-checkbox--card-with-icon":"tedi-checkbox--card-with-icon-2636b953","tedi-checkbox--card-primary":"tedi-checkbox--card-primary-b7da557f","tedi-checkbox--card-secondary":"tedi-checkbox--card-secondary-179169ca"};exports.default=c;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = {
|
|
2
2
|
"tedi-checkbox": "tedi-checkbox-0294a114",
|
|
3
3
|
"tedi-checkbox--disabled": "tedi-checkbox--disabled-e22bbaf4",
|
|
4
4
|
"tedi-checkbox__input": "tedi-checkbox__input-2ecab369",
|
|
@@ -12,9 +12,17 @@ const e = {
|
|
|
12
12
|
"tedi-checkbox__tooltip-icon": "tedi-checkbox__tooltip-icon-46223bb7",
|
|
13
13
|
"tedi-checkbox__indicator--size-default": "tedi-checkbox__indicator--size-default-00511279",
|
|
14
14
|
"tedi-checkbox__indicator--size-large": "tedi-checkbox__indicator--size-large-b64ce54c",
|
|
15
|
+
"tedi-checkbox__indicator--invalid": "tedi-checkbox__indicator--invalid-019a355d",
|
|
15
16
|
"tedi-checkbox__indicator--hover": "tedi-checkbox__indicator--hover-436b8cb1",
|
|
16
|
-
"tedi-
|
|
17
|
+
"tedi-checkbox--card": "tedi-checkbox--card-d1faeb0e",
|
|
18
|
+
"tedi-checkbox__card-control": "tedi-checkbox__card-control-ea88c4f4",
|
|
19
|
+
"tedi-checkbox__card-label": "tedi-checkbox__card-label-4c136337",
|
|
20
|
+
"tedi-checkbox__card-icon": "tedi-checkbox__card-icon-a4d72e5a",
|
|
21
|
+
"tedi-checkbox__card-description": "tedi-checkbox__card-description-fa672631",
|
|
22
|
+
"tedi-checkbox--card-with-icon": "tedi-checkbox--card-with-icon-2636b953",
|
|
23
|
+
"tedi-checkbox--card-primary": "tedi-checkbox--card-primary-b7da557f",
|
|
24
|
+
"tedi-checkbox--card-secondary": "tedi-checkbox--card-secondary-179169ca"
|
|
17
25
|
};
|
|
18
26
|
export {
|
|
19
|
-
|
|
27
|
+
c as default
|
|
20
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./checkbox.cjs.js"),e=require("./checkbox-group/checkbox-group.cjs.js"),c=Object.assign(o.Checkbox,{Group:e.CheckboxGroup});exports.CheckboxGroup=e.CheckboxGroup;exports.Checkbox=c;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CheckboxProps } from './checkbox';
|
|
2
|
+
import { default as CheckboxGroup } from './checkbox-group/checkbox-group';
|
|
3
|
+
declare const Checkbox: {
|
|
4
|
+
(props: CheckboxProps): JSX.Element;
|
|
5
|
+
displayName?: string;
|
|
6
|
+
Group: typeof CheckboxGroup;
|
|
7
|
+
};
|
|
8
|
+
export { Checkbox, CheckboxGroup };
|
|
9
|
+
export type { CheckboxBaseProps, CheckboxProps } from './checkbox';
|
|
10
|
+
export type { CheckboxGroupProps } from './checkbox-group/checkbox-group';
|
|
11
|
+
export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),N=require("../../../../../external/classnames/index.cjs.js"),f=require("react"),ee=require("../feedback-text/feedback-text.cjs.js"),te=require("../form-label/form-label.cjs.js"),re=require("../checkbox/checkbox.cjs.js"),q=require("./choice-group.module.scss.cjs.js"),oe=require("./choice-group-context.cjs.js"),P=require("./components/choice-group-item/choice-group-item.cjs.js"),ne=require("../../../providers/label-provider/use-labels.cjs.js"),j=require("../../../helpers/hooks/use-breakpoint.cjs.js"),ie=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),F=require("../../layout/grid/row.cjs.js"),ae=require("../../layout/grid/col.cjs.js"),B=h=>{const{getLabel:m}=ne.useLabels(),I=j.default(h.defaultServerBreakpoint),{getCurrentBreakpointProps:R}=ie.useBreakpointProps(h.defaultServerBreakpoint),{id:u,className:T,label:S,required:G,helper:a,items:o,variant:g="default",direction:k=g==="default"||j.isBreakpointBelow(I,"md")?"column":"row",rowProps:p,name:w,inputType:n="radio",value:L,defaultValue:M,onChange:d,hideLabel:H,labelProps:E,indeterminateCheck:s,indeterminateCheckProps:b={},color:$,layout:v="separated",showIndicator:O,...W}=R(h),{...X}=b,Y=(b==null?void 0:b.indented)??!0,y=(a==null?void 0:a.id)??`${u}-helper`,A=s&&n==="checkbox",[z,_]=f.useState(()=>{if(M)return M;if(n==="radio"){const e=o.find(l=>l.defaultChecked);return e?e.value:null}return n==="checkbox"?o.filter(e=>e.defaultChecked).map(e=>e.value):null}),C=(e=h.value)=>!!d&&typeof e<"u",r=C(L)?L:z,x=f.useMemo(()=>(r==null?void 0:r.length)===0,[r==null?void 0:r.length]),c=f.useMemo(()=>{var e;return(r==null?void 0:r.length)===((e=o==null?void 0:o.filter(l=>!l.disabled))==null?void 0:e.length)},[r==null?void 0:r.length,o]),D=f.useMemo(()=>!x&&!c,[c,x]),J=f.useMemo(()=>{const e=c?"all":x?"none":"some";return typeof s=="string"?s:typeof s=="function"?s(e):s?m(e==="all"?"table.filter.remove-all":"table.filter.select-all"):""},[m,s,c,x]),K={name:w,inputType:n,onChange:(e,l)=>{let t=r;n==="checkbox"&&t?t=l?Array.isArray(t)?[...t,e]:[e]:Array.isArray(t)?t.filter(Z=>Z!==e):t:t=e,C()||_(Array.isArray(t)?[...t]:t),d==null||d(t)},currentValue:r},Q=N.default(q.default["tedi-choice-group"],T),U=N.default(q.default["tedi-choice-group__inner"],p==null?void 0:p.className,{[q.default["tedi-choice-group__inner--indented"]]:A&&Y}),V=()=>{var l;const e=c?[]:(l=o==null?void 0:o.filter(t=>!t.disabled))==null?void 0:l.map(t=>t.value);C()||_([...e]),d==null||d(e)};return i.jsx(oe.ChoiceGroupContext.Provider,{value:K,children:i.jsxs("fieldset",{...W,className:Q,id:u,name:w,"aria-describedby":a&&n!=="radio"?y:void 0,children:[S&&i.jsx(te.FormLabel,{id:u,label:S,required:G,hideLabel:H,renderWithoutLabel:!0,labelProps:E}),i.jsx(F.Row,{children:i.jsx(ae.Col,{children:o!=null&&o.length?i.jsxs(i.Fragment,{children:[A&&i.jsx(re.Checkbox,{id:`${u}-indeterminate`,value:"indeterminate",name:"indeterminate",...X,label:J,indeterminate:D,checked:c,onChange:V}),i.jsx(F.Row,{direction:k,gutterX:v==="segmented"?0:2,gutterY:v==="segmented"?0:1,gap:g==="default"&&(j.isBreakpointBelow(I,"md")||k==="row")?1:0,...p,className:U,role:n==="radio"?"radiogroup":void 0,"aria-labelledby":n==="radio"?u:void 0,"aria-describedby":n==="radio"&&a?y:void 0,"aria-required":n==="radio"&&G?!0:void 0,"aria-invalid":n==="radio"&&(a==null?void 0:a.type)==="error"?!0:void 0,children:o.map(e=>i.jsx(P.ChoiceGroupItem,{...e,color:$,variant:g,type:n,layout:v,showIndicator:O,direction:k},e.id))})]}):i.jsx("p",{children:m("table.filter.no-options")})})}),a&&i.jsx(ee.FeedbackText,{...a,id:y})]})})};B.Item=P.ChoiceGroupItem;exports.ChoiceGroup=B;exports.default=B;
|
|
@@ -28,8 +28,19 @@ interface ChoiceGroupAllProps extends Omit<FormLabelProps, 'id' | 'label'> {
|
|
|
28
28
|
indented?: boolean;
|
|
29
29
|
} & Partial<Omit<CheckboxProps, 'indeterminate' | 'checked' | 'onChange' | 'defaultChecked' | 'label'>>;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use the compound `Radio.Group` / `Checkbox.Group` (with composable
|
|
33
|
+
* `Radio` / `Checkbox` children, including `variant="card"`) instead. `ChoiceGroup`
|
|
34
|
+
* remains for backwards compatibility and will be removed in a future major version.
|
|
35
|
+
*/
|
|
31
36
|
export interface ChoiceGroupProps extends BreakpointSupport<ChoiceGroupAllProps> {
|
|
32
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use the compound `Radio.Group` / `Checkbox.Group` instead — e.g.
|
|
40
|
+
* `<Radio.Group label="…"><Radio value="a" label="A" /></Radio.Group>`, with
|
|
41
|
+
* `variant="card"` for the card layout. `ChoiceGroup` stays for backwards
|
|
42
|
+
* compatibility and will be removed in a future major version.
|
|
43
|
+
*/
|
|
33
44
|
export declare const ChoiceGroup: {
|
|
34
45
|
(props: ChoiceGroupProps): React.ReactElement;
|
|
35
46
|
Item: (props: ExtendedChoiceGroupItemProps) => React.ReactElement;
|
|
@@ -1,107 +1,118 @@
|
|
|
1
|
-
import { jsx as a, jsxs as F, Fragment as
|
|
1
|
+
import { jsx as a, jsxs as F, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import G from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import
|
|
4
|
-
import { FeedbackText as
|
|
5
|
-
import { FormLabel as
|
|
6
|
-
import { Checkbox as
|
|
7
|
-
import
|
|
8
|
-
import { ChoiceGroupContext as
|
|
3
|
+
import g, { useState as te } from "react";
|
|
4
|
+
import { FeedbackText as re } from "../feedback-text/feedback-text.es.js";
|
|
5
|
+
import { FormLabel as oe } from "../form-label/form-label.es.js";
|
|
6
|
+
import { Checkbox as ie } from "../checkbox/checkbox.es.js";
|
|
7
|
+
import I from "./choice-group.module.scss.es.js";
|
|
8
|
+
import { ChoiceGroupContext as ne } from "./choice-group-context.es.js";
|
|
9
9
|
import { ChoiceGroupItem as q } from "./components/choice-group-item/choice-group-item.es.js";
|
|
10
|
-
import { useLabels as
|
|
11
|
-
import
|
|
10
|
+
import { useLabels as ae } from "../../../providers/label-provider/use-labels.es.js";
|
|
11
|
+
import de, { isBreakpointBelow as H } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
12
12
|
import { useBreakpointProps as le } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
13
|
import { Row as j } from "../../layout/grid/row.es.js";
|
|
14
|
-
import { Col as
|
|
15
|
-
const
|
|
16
|
-
const { getLabel: f } =
|
|
17
|
-
id:
|
|
18
|
-
className:
|
|
19
|
-
label:
|
|
14
|
+
import { Col as se } from "../../layout/grid/col.es.js";
|
|
15
|
+
const ce = (u) => {
|
|
16
|
+
const { getLabel: f } = ae(), B = de(u.defaultServerBreakpoint), { getCurrentBreakpointProps: E } = le(u.defaultServerBreakpoint), {
|
|
17
|
+
id: m,
|
|
18
|
+
className: P,
|
|
19
|
+
label: S,
|
|
20
20
|
required: A,
|
|
21
21
|
helper: n,
|
|
22
22
|
items: o,
|
|
23
|
-
variant:
|
|
24
|
-
direction:
|
|
25
|
-
rowProps:
|
|
23
|
+
variant: y = "default",
|
|
24
|
+
direction: k = y === "default" || H(B, "md") ? "column" : "row",
|
|
25
|
+
rowProps: p,
|
|
26
26
|
name: L,
|
|
27
27
|
inputType: i = "radio",
|
|
28
28
|
value: M,
|
|
29
29
|
defaultValue: N,
|
|
30
|
-
onChange:
|
|
31
|
-
hideLabel:
|
|
30
|
+
onChange: l,
|
|
31
|
+
hideLabel: R,
|
|
32
|
+
labelProps: T,
|
|
32
33
|
indeterminateCheck: s,
|
|
33
|
-
indeterminateCheckProps:
|
|
34
|
+
indeterminateCheckProps: h = {},
|
|
34
35
|
color: $,
|
|
35
|
-
layout:
|
|
36
|
-
showIndicator:
|
|
37
|
-
...
|
|
38
|
-
} = E(u), { ...
|
|
36
|
+
layout: v = "separated",
|
|
37
|
+
showIndicator: W,
|
|
38
|
+
...X
|
|
39
|
+
} = E(u), { ...Y } = h, z = (h == null ? void 0 : h.indented) ?? !0, C = (n == null ? void 0 : n.id) ?? `${m}-helper`, _ = s && i === "checkbox", [D, w] = te(() => {
|
|
39
40
|
if (N) return N;
|
|
40
41
|
if (i === "radio") {
|
|
41
|
-
const e = o.find((
|
|
42
|
+
const e = o.find((d) => d.defaultChecked);
|
|
42
43
|
return e ? e.value : null;
|
|
43
44
|
}
|
|
44
45
|
return i === "checkbox" ? o.filter((e) => e.defaultChecked).map((e) => e.value) : null;
|
|
45
|
-
}),
|
|
46
|
+
}), x = (e = u.value) => !!l && typeof e < "u", r = x(M) ? M : D, b = g.useMemo(() => (r == null ? void 0 : r.length) === 0, [r == null ? void 0 : r.length]), c = g.useMemo(
|
|
46
47
|
() => {
|
|
47
48
|
var e;
|
|
48
|
-
return (r == null ? void 0 : r.length) === ((e = o == null ? void 0 : o.filter((
|
|
49
|
+
return (r == null ? void 0 : r.length) === ((e = o == null ? void 0 : o.filter((d) => !d.disabled)) == null ? void 0 : e.length);
|
|
49
50
|
},
|
|
50
51
|
[r == null ? void 0 : r.length, o]
|
|
51
|
-
),
|
|
52
|
-
const e =
|
|
52
|
+
), J = g.useMemo(() => !b && !c, [c, b]), K = g.useMemo(() => {
|
|
53
|
+
const e = c ? "all" : b ? "none" : "some";
|
|
53
54
|
return typeof s == "string" ? s : typeof s == "function" ? s(e) : s ? f(e === "all" ? "table.filter.remove-all" : "table.filter.select-all") : "";
|
|
54
|
-
}, [f, s,
|
|
55
|
+
}, [f, s, c, b]), O = {
|
|
55
56
|
name: L,
|
|
56
57
|
inputType: i,
|
|
57
|
-
onChange: (e,
|
|
58
|
+
onChange: (e, d) => {
|
|
58
59
|
let t = r;
|
|
59
|
-
i === "checkbox" && t ? t =
|
|
60
|
+
i === "checkbox" && t ? t = d ? Array.isArray(t) ? [...t, e] : [e] : Array.isArray(t) ? t.filter((Z) => Z !== e) : t : t = e, x() || w(Array.isArray(t) ? [...t] : t), l == null || l(t);
|
|
60
61
|
},
|
|
61
62
|
currentValue: r
|
|
62
|
-
},
|
|
63
|
-
[
|
|
64
|
-
}),
|
|
65
|
-
var
|
|
66
|
-
const e =
|
|
67
|
-
|
|
63
|
+
}, Q = G(I["tedi-choice-group"], P), U = G(I["tedi-choice-group__inner"], p == null ? void 0 : p.className, {
|
|
64
|
+
[I["tedi-choice-group__inner--indented"]]: _ && z
|
|
65
|
+
}), V = () => {
|
|
66
|
+
var d;
|
|
67
|
+
const e = c ? [] : (d = o == null ? void 0 : o.filter((t) => !t.disabled)) == null ? void 0 : d.map((t) => t.value);
|
|
68
|
+
x() || w([...e]), l == null || l(e);
|
|
68
69
|
};
|
|
69
|
-
return /* @__PURE__ */ a(
|
|
70
|
+
return /* @__PURE__ */ a(ne.Provider, { value: O, children: /* @__PURE__ */ F(
|
|
70
71
|
"fieldset",
|
|
71
72
|
{
|
|
72
|
-
...
|
|
73
|
-
className:
|
|
74
|
-
id:
|
|
73
|
+
...X,
|
|
74
|
+
className: Q,
|
|
75
|
+
id: m,
|
|
75
76
|
name: L,
|
|
76
|
-
"aria-describedby": n && i !== "radio" ?
|
|
77
|
+
"aria-describedby": n && i !== "radio" ? C : void 0,
|
|
77
78
|
children: [
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
S && /* @__PURE__ */ a(
|
|
80
|
+
oe,
|
|
81
|
+
{
|
|
82
|
+
id: m,
|
|
83
|
+
label: S,
|
|
84
|
+
required: A,
|
|
85
|
+
hideLabel: R,
|
|
86
|
+
renderWithoutLabel: !0,
|
|
87
|
+
labelProps: T
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ a(j, { children: /* @__PURE__ */ a(se, { children: o != null && o.length ? /* @__PURE__ */ F(ee, { children: [
|
|
80
91
|
_ && /* @__PURE__ */ a(
|
|
81
|
-
|
|
92
|
+
ie,
|
|
82
93
|
{
|
|
83
|
-
id: `${
|
|
94
|
+
id: `${m}-indeterminate`,
|
|
84
95
|
value: "indeterminate",
|
|
85
96
|
name: "indeterminate",
|
|
86
|
-
...
|
|
87
|
-
label:
|
|
88
|
-
indeterminate:
|
|
89
|
-
checked:
|
|
90
|
-
onChange:
|
|
97
|
+
...Y,
|
|
98
|
+
label: K,
|
|
99
|
+
indeterminate: J,
|
|
100
|
+
checked: c,
|
|
101
|
+
onChange: V
|
|
91
102
|
}
|
|
92
103
|
),
|
|
93
104
|
/* @__PURE__ */ a(
|
|
94
105
|
j,
|
|
95
106
|
{
|
|
96
|
-
direction:
|
|
97
|
-
gutterX:
|
|
98
|
-
gutterY:
|
|
99
|
-
gap:
|
|
100
|
-
...
|
|
101
|
-
className:
|
|
107
|
+
direction: k,
|
|
108
|
+
gutterX: v === "segmented" ? 0 : 2,
|
|
109
|
+
gutterY: v === "segmented" ? 0 : 1,
|
|
110
|
+
gap: y === "default" && (H(B, "md") || k === "row") ? 1 : 0,
|
|
111
|
+
...p,
|
|
112
|
+
className: U,
|
|
102
113
|
role: i === "radio" ? "radiogroup" : void 0,
|
|
103
|
-
"aria-labelledby": i === "radio" ?
|
|
104
|
-
"aria-describedby": i === "radio" && n ?
|
|
114
|
+
"aria-labelledby": i === "radio" ? m : void 0,
|
|
115
|
+
"aria-describedby": i === "radio" && n ? C : void 0,
|
|
105
116
|
"aria-required": i === "radio" && A ? !0 : void 0,
|
|
106
117
|
"aria-invalid": i === "radio" && (n == null ? void 0 : n.type) === "error" ? !0 : void 0,
|
|
107
118
|
children: o.map((e) => /* @__PURE__ */ a(
|
|
@@ -109,24 +120,24 @@ const se = (u) => {
|
|
|
109
120
|
{
|
|
110
121
|
...e,
|
|
111
122
|
color: $,
|
|
112
|
-
variant:
|
|
123
|
+
variant: y,
|
|
113
124
|
type: i,
|
|
114
|
-
layout:
|
|
115
|
-
showIndicator:
|
|
116
|
-
direction:
|
|
125
|
+
layout: v,
|
|
126
|
+
showIndicator: W,
|
|
127
|
+
direction: k
|
|
117
128
|
},
|
|
118
129
|
e.id
|
|
119
130
|
))
|
|
120
131
|
}
|
|
121
132
|
)
|
|
122
133
|
] }) : /* @__PURE__ */ a("p", { children: f("table.filter.no-options") }) }) }),
|
|
123
|
-
n && /* @__PURE__ */ a(
|
|
134
|
+
n && /* @__PURE__ */ a(re, { ...n, id: C })
|
|
124
135
|
]
|
|
125
136
|
}
|
|
126
137
|
) });
|
|
127
138
|
};
|
|
128
|
-
|
|
139
|
+
ce.Item = q;
|
|
129
140
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
141
|
+
ce as ChoiceGroup,
|
|
142
|
+
ce as default
|
|
132
143
|
};
|
package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("../../../../../../../external/classnames/index.cjs.js"),R=require("react"),S=require("../../../checkbox/checkbox.cjs.js"),A=require("../../../feedback-text/feedback-text.cjs.js"),H=require("../../../radio/radio.cjs.js"),L=require("../../choice-group-context.cjs.js"),e=require("./choice-group-item.module.scss.cjs.js"),O=require("../../../../../helpers/hooks/use-breakpoint-props.cjs.js"),V=require("../../../../layout/grid/col.cjs.js"),v=u=>{const{getCurrentBreakpointProps:_}=O.useBreakpointProps(u.defaultServerBreakpoint),{id:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("../../../../../../../external/classnames/index.cjs.js"),R=require("react"),S=require("../../../checkbox/checkbox.cjs.js"),A=require("../../../feedback-text/feedback-text.cjs.js"),H=require("../../../radio/radio.cjs.js"),L=require("../../choice-group-context.cjs.js"),e=require("./choice-group-item.module.scss.cjs.js"),O=require("../../../../../helpers/hooks/use-breakpoint-props.cjs.js"),V=require("../../../../layout/grid/col.cjs.js"),v=u=>{const{getCurrentBreakpointProps:_}=O.useBreakpointProps(u.defaultServerBreakpoint),{id:i,label:C,value:a,className:q,direction:h,disabled:d,colProps:N=h==="column"?{width:12}:{width:"auto"},onChange:m,hideLabel:$,helper:o,tooltip:B,type:p="radio",variant:l="default",color:G="primary",layout:I,showIndicator:k,justifyContent:x="start"}=_(u),{currentValue:r,name:b,onChange:f,inputType:P}=R.useContext(L.ChoiceGroupContext),s=Array.isArray(r)?r.includes(a):a===r,M=r===void 0?u.defaultChecked:s,y=(c,g)=>{f==null||f(c,g),m==null||m(c,g)},T=n.default(e.default[`tedi-choice-group-item--${I==="separated"?"separated":"segmented"}`],h&&e.default[`tedi-choice-group-item--${h}`]),w=n.default(e.default["tedi-choice-group-item"],e.default[`tedi-choice-group-item--${l}`],e.default[`tedi-choice-group-item--${l}-${G}`],k&&e.default["tedi-choice-group-item--indicator"],p&&e.default[`tedi-choice-group-item--${p}`],{[e.default["tedi-choice-group-item--disabled"]]:d},{[e.default["tedi-choice-group-item--checked"]]:s},{[`justify-content-${x}`]:x}),E=p==="radio"?H.Radio:S.Checkbox,F=c=>{var j;d||l!=="card"||c.target.closest("input, label")||i&&((j=document.getElementById(i))==null||j.click())};return t.jsx(V.Col,{...N,className:T,children:t.jsx("div",{className:w,onClick:F,"aria-disabled":d||void 0,children:l==="default"||k?t.jsx(E,{id:i,label:C,value:a,name:b,className:n.default(e.default["tedi-choice-group-item__indicator"],q),disabled:d,checked:s,defaultChecked:M,onChange:y,hideLabel:$,helper:o?{...o,className:n.default(e.default["tedi-choice-group-item__feedback-text"],o.className)}:void 0,tooltip:B,"data-testid":"choice-group-item-indicator"}):t.jsxs(t.Fragment,{children:[t.jsx("input",{id:i,value:a,name:b,type:P,disabled:d,checked:s,defaultChecked:r===void 0?u.defaultChecked:void 0,onChange:c=>{y(a,c.target.checked)},className:"visually-hidden"}),t.jsxs("label",{htmlFor:i,className:e.default["tedi-choice-group-item__label"],children:[C,o&&t.jsx(A.FeedbackText,{...o,id:o.id??`${i}-helper`,className:e.default["tedi-choice-group-item__feedback-text"]})]})]})})})};exports.ChoiceGroupItem=v;exports.default=v;
|