@linyao.tw/ui 1.0.0 → 1.2.0
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/README.md +9 -1
- package/dist/components/date-time/calendar.js +8 -6
- package/dist/components/date-time/calendar.js.map +1 -1
- package/dist/components/date-time/date-field.js +10 -8
- package/dist/components/date-time/date-field.js.map +1 -1
- package/dist/components/date-time/date-picker.js +8 -6
- package/dist/components/date-time/date-picker.js.map +1 -1
- package/dist/components/date-time/date-range-picker.js +8 -6
- package/dist/components/date-time/date-range-picker.js.map +1 -1
- package/dist/components/date-time/index.js +1 -1
- package/dist/components/date-time/shared.d.ts +0 -1
- package/dist/components/date-time/shared.js +7 -9
- package/dist/components/date-time/shared.js.map +1 -1
- package/dist/components/date-time/time-field.js +8 -6
- package/dist/components/date-time/time-field.js.map +1 -1
- package/dist/components/feedback/alert.js +35 -34
- package/dist/components/feedback/alert.js.map +1 -1
- package/dist/components/feedback/banner.js +15 -14
- package/dist/components/feedback/banner.js.map +1 -1
- package/dist/components/feedback/empty-state.d.ts +2 -1
- package/dist/components/feedback/empty-state.js +31 -31
- package/dist/components/feedback/empty-state.js.map +1 -1
- package/dist/components/feedback/feedback.types.d.ts +0 -1
- package/dist/components/feedback/feedback.types.js +3 -5
- package/dist/components/feedback/feedback.types.js.map +1 -1
- package/dist/components/feedback/index.d.ts +8 -8
- package/dist/components/feedback/meter.js +21 -21
- package/dist/components/feedback/meter.js.map +1 -1
- package/dist/components/feedback/progress.js +21 -21
- package/dist/components/feedback/progress.js.map +1 -1
- package/dist/components/feedback/skeleton.js +11 -11
- package/dist/components/feedback/skeleton.js.map +1 -1
- package/dist/components/feedback/spinner.js +25 -25
- package/dist/components/feedback/spinner.js.map +1 -1
- package/dist/components/feedback/toast.js +23 -21
- package/dist/components/feedback/toast.js.map +1 -1
- package/dist/components/forms/{CodeField.d.ts → code-field.d.ts} +1 -1
- package/dist/components/forms/code-field.js +66 -0
- package/dist/components/forms/code-field.js.map +1 -0
- package/dist/components/forms/{FileUpload.d.ts → file-upload.d.ts} +1 -1
- package/dist/components/forms/{FileUpload.js → file-upload.js} +128 -111
- package/dist/components/forms/file-upload.js.map +1 -0
- package/dist/components/forms/index.d.ts +6 -6
- package/dist/components/forms/{Input.js → input.js} +4 -3
- package/dist/components/forms/input.js.map +1 -0
- package/dist/components/forms/internal.d.ts +0 -2
- package/dist/components/forms/internal.js +22 -25
- package/dist/components/forms/internal.js.map +1 -1
- package/dist/components/forms/number-field.js +74 -0
- package/dist/components/forms/number-field.js.map +1 -0
- package/dist/components/forms/otp-field.js +58 -0
- package/dist/components/forms/otp-field.js.map +1 -0
- package/dist/components/forms/{TextField.d.ts → text-field.d.ts} +5 -0
- package/dist/components/forms/text-field.js +201 -0
- package/dist/components/forms/text-field.js.map +1 -0
- package/dist/components/foundations/{Avatar.js → avatar.js} +13 -10
- package/dist/components/foundations/avatar.js.map +1 -0
- package/dist/components/foundations/{Badge.d.ts → badge.d.ts} +1 -1
- package/dist/components/foundations/{Badge.js → badge.js} +4 -3
- package/dist/components/foundations/badge.js.map +1 -0
- package/dist/components/foundations/{Button.js → button.js} +4 -3
- package/dist/components/foundations/button.js.map +1 -0
- package/dist/components/foundations/{Card.d.ts → card.d.ts} +9 -2
- package/dist/components/foundations/{Card.js → card.js} +6 -5
- package/dist/components/foundations/card.js.map +1 -0
- package/dist/components/foundations/{IconButton.d.ts → icon-button.d.ts} +2 -8
- package/dist/components/foundations/{IconButton.js → icon-button.js} +5 -4
- package/dist/components/foundations/icon-button.js.map +1 -0
- package/dist/components/foundations/index.d.ts +9 -9
- package/dist/components/foundations/{Link.d.ts → link.d.ts} +1 -1
- package/dist/components/foundations/link.js +47 -0
- package/dist/components/foundations/link.js.map +1 -0
- package/dist/components/foundations/{ListCell.d.ts → list-cell.d.ts} +1 -8
- package/dist/components/foundations/{ListCell.js → list-cell.js} +4 -3
- package/dist/components/foundations/list-cell.js.map +1 -0
- package/dist/components/foundations/{SectionHeading.d.ts → section-heading.d.ts} +5 -2
- package/dist/components/foundations/{SectionHeading.js → section-heading.js} +4 -3
- package/dist/components/foundations/section-heading.js.map +1 -0
- package/dist/components/foundations/{Separator.js → separator.js} +4 -3
- package/dist/components/foundations/separator.js.map +1 -0
- package/dist/components/navigation-data/breadcrumb-pagination.js +89 -81
- package/dist/components/navigation-data/breadcrumb-pagination.js.map +1 -1
- package/dist/components/navigation-data/command-palette.d.ts +26 -0
- package/dist/components/navigation-data/command-palette.js +101 -72
- package/dist/components/navigation-data/command-palette.js.map +1 -1
- package/dist/components/navigation-data/header-tab-bar.js +50 -46
- package/dist/components/navigation-data/header-tab-bar.js.map +1 -1
- package/dist/components/navigation-data/index.d.ts +7 -7
- package/dist/components/navigation-data/menubar-toolbar.js +2 -1
- package/dist/components/navigation-data/menubar-toolbar.js.map +1 -1
- package/dist/components/navigation-data/navigation-menu.js +2 -1
- package/dist/components/navigation-data/navigation-menu.js.map +1 -1
- package/dist/components/navigation-data/scroll-area.js +2 -1
- package/dist/components/navigation-data/scroll-area.js.map +1 -1
- package/dist/components/navigation-data/table-collection.d.ts +12 -3
- package/dist/components/navigation-data/table-collection.js +12 -9
- package/dist/components/navigation-data/table-collection.js.map +1 -1
- package/dist/components/overlays/dialog.d.ts +23 -3
- package/dist/components/overlays/dialog.js +138 -130
- package/dist/components/overlays/dialog.js.map +1 -1
- package/dist/components/overlays/disclosure.js +2 -1
- package/dist/components/overlays/disclosure.js.map +1 -1
- package/dist/components/overlays/drawer.d.ts +9 -2
- package/dist/components/overlays/drawer.js +158 -151
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/floating.js +116 -113
- package/dist/components/overlays/floating.js.map +1 -1
- package/dist/components/overlays/index.d.ts +4 -4
- package/dist/components/selection/combobox.js +94 -93
- package/dist/components/selection/combobox.js.map +1 -1
- package/dist/components/selection/controls.d.ts +4 -1
- package/dist/components/selection/controls.js +141 -118
- package/dist/components/selection/controls.js.map +1 -1
- package/dist/components/selection/menu.js +121 -121
- package/dist/components/selection/menu.js.map +1 -1
- package/dist/components/selection/select.js +108 -107
- package/dist/components/selection/select.js.map +1 -1
- package/dist/fonts.css +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +39 -33
- package/dist/internal/accessible-name.d.ts +12 -0
- package/dist/internal/class-names.d.ts +12 -0
- package/dist/{components/selection/classnames.js → internal/class-names.js} +4 -3
- package/dist/internal/class-names.js.map +1 -0
- package/dist/internal/index.d.ts +3 -0
- package/dist/{components/foundations/shared.d.ts → internal/render.d.ts} +2 -1
- package/dist/intl/index.d.ts +3 -0
- package/dist/intl/linyao-provider.d.ts +38 -0
- package/dist/intl/linyao-provider.js +27 -0
- package/dist/intl/linyao-provider.js.map +1 -0
- package/dist/intl/messages.d.ts +48 -0
- package/dist/intl/messages.js +81 -0
- package/dist/intl/messages.js.map +1 -0
- package/dist/intl/provider.d.ts +18 -0
- package/dist/intl/provider.js +31 -0
- package/dist/intl/provider.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -4
- package/dist/components/feedback/feedback.module.js +0 -42
- package/dist/components/feedback/feedback.module.js.map +0 -1
- package/dist/components/forms/CodeField.js +0 -63
- package/dist/components/forms/CodeField.js.map +0 -1
- package/dist/components/forms/FileUpload.js.map +0 -1
- package/dist/components/forms/Input.js.map +0 -1
- package/dist/components/forms/NumberField.js +0 -71
- package/dist/components/forms/NumberField.js.map +0 -1
- package/dist/components/forms/OTPField.js +0 -54
- package/dist/components/forms/OTPField.js.map +0 -1
- package/dist/components/forms/TextField.js +0 -199
- package/dist/components/forms/TextField.js.map +0 -1
- package/dist/components/foundations/Avatar.js.map +0 -1
- package/dist/components/foundations/Badge.js.map +0 -1
- package/dist/components/foundations/Button.js.map +0 -1
- package/dist/components/foundations/Card.js.map +0 -1
- package/dist/components/foundations/IconButton.js.map +0 -1
- package/dist/components/foundations/Link.js +0 -40
- package/dist/components/foundations/Link.js.map +0 -1
- package/dist/components/foundations/ListCell.js.map +0 -1
- package/dist/components/foundations/SectionHeading.js.map +0 -1
- package/dist/components/foundations/Separator.js.map +0 -1
- package/dist/components/foundations/shared.js +0 -8
- package/dist/components/foundations/shared.js.map +0 -1
- package/dist/components/navigation-data/utils.d.ts +0 -2
- package/dist/components/navigation-data/utils.js +0 -11
- package/dist/components/navigation-data/utils.js.map +0 -1
- package/dist/components/overlays/class-names.d.ts +0 -6
- package/dist/components/overlays/class-names.js +0 -11
- package/dist/components/overlays/class-names.js.map +0 -1
- package/dist/components/selection/classnames.d.ts +0 -4
- package/dist/components/selection/classnames.js.map +0 -1
- package/dist/components/selection/selection.module.js +0 -51
- package/dist/components/selection/selection.module.js.map +0 -1
- /package/dist/components/forms/{Input.d.ts → input.d.ts} +0 -0
- /package/dist/components/forms/{NumberField.d.ts → number-field.d.ts} +0 -0
- /package/dist/components/forms/{OTPField.d.ts → otp-field.d.ts} +0 -0
- /package/dist/components/foundations/{Avatar.d.ts → avatar.d.ts} +0 -0
- /package/dist/components/foundations/{Button.d.ts → button.d.ts} +0 -0
- /package/dist/components/foundations/{Separator.d.ts → separator.d.ts} +0 -0
|
@@ -1,171 +1,194 @@
|
|
|
1
|
-
|
|
2
|
-
import { cx as
|
|
3
|
-
import { forwardRef as r,
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { MinusIcon as
|
|
6
|
-
import { CheckIcon as
|
|
7
|
-
import { Checkbox as
|
|
8
|
-
import { CheckboxGroup as
|
|
9
|
-
import { Radio as
|
|
10
|
-
import { RadioGroup as
|
|
11
|
-
import { Slider as
|
|
12
|
-
import { Switch as
|
|
13
|
-
import { Toggle as
|
|
14
|
-
import { ToggleGroup as
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e, withStateClassName as t } from "../../internal/class-names.js";
|
|
3
|
+
import { forwardRef as n, useCallback as r, useId as i, useState as a } from "react";
|
|
4
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { MinusIcon as l } from "@phosphor-icons/react/dist/csr/Minus";
|
|
6
|
+
import { CheckIcon as u } from "@phosphor-icons/react/dist/csr/Check";
|
|
7
|
+
import { Checkbox as d } from "@base-ui/react/checkbox";
|
|
8
|
+
import { CheckboxGroup as f } from "@base-ui/react/checkbox-group";
|
|
9
|
+
import { Radio as p } from "@base-ui/react/radio";
|
|
10
|
+
import { RadioGroup as m } from "@base-ui/react/radio-group";
|
|
11
|
+
import { Slider as h } from "@base-ui/react/slider";
|
|
12
|
+
import { Switch as g } from "@base-ui/react/switch";
|
|
13
|
+
import { Toggle as _ } from "@base-ui/react/toggle";
|
|
14
|
+
import { ToggleGroup as v } from "@base-ui/react/toggle-group";
|
|
15
15
|
//#region src/components/selection/controls.tsx
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function y({ indeterminate: e = !1 }) {
|
|
17
|
+
return s(e ? l : u, {
|
|
18
18
|
"aria-hidden": "true",
|
|
19
19
|
weight: "bold"
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
...
|
|
25
|
-
className:
|
|
26
|
-
indeterminate:
|
|
27
|
-
ref:
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
className:
|
|
22
|
+
var b = n(function({ children: e, className: n, indicator: r, indeterminate: i, ...a }, o) {
|
|
23
|
+
return /* @__PURE__ */ c(d.Root, {
|
|
24
|
+
...a,
|
|
25
|
+
className: t("lyds-checkbox", n),
|
|
26
|
+
indeterminate: i,
|
|
27
|
+
ref: o,
|
|
28
|
+
children: [/* @__PURE__ */ s(d.Indicator, {
|
|
29
|
+
className: "lyds-checkbox__indicator",
|
|
30
30
|
keepMounted: !0,
|
|
31
|
-
children:
|
|
32
|
-
}),
|
|
31
|
+
children: r ?? /* @__PURE__ */ s(y, { indeterminate: i ?? !1 })
|
|
32
|
+
}), e]
|
|
33
33
|
});
|
|
34
|
-
}),
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
...
|
|
37
|
-
className:
|
|
38
|
-
ref:
|
|
34
|
+
}), x = n(function({ className: e, ...n }, r) {
|
|
35
|
+
return /* @__PURE__ */ s(f, {
|
|
36
|
+
...n,
|
|
37
|
+
className: t("lyds-choice-group", e),
|
|
38
|
+
ref: r
|
|
39
39
|
});
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
});
|
|
41
|
+
function S(e) {
|
|
42
|
+
let t = i();
|
|
43
|
+
return {
|
|
44
|
+
titleId: `${t}-title`,
|
|
45
|
+
descriptionId: e ? `${t}-description` : void 0
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
var C = n(function({ description: t, label: n, wrapperClassName: r, ...i }, a) {
|
|
49
|
+
let { titleId: o, descriptionId: l } = S(t);
|
|
50
|
+
return /* @__PURE__ */ c("label", {
|
|
51
|
+
className: e("lyds-choice", r),
|
|
52
|
+
children: [/* @__PURE__ */ s(b, {
|
|
53
|
+
...i,
|
|
54
|
+
ref: a,
|
|
55
|
+
"aria-labelledby": i["aria-labelledby"] ?? o,
|
|
56
|
+
"aria-describedby": i["aria-describedby"] ?? l
|
|
57
|
+
}), /* @__PURE__ */ c("span", {
|
|
58
|
+
className: "lyds-choice__copy",
|
|
59
|
+
children: [/* @__PURE__ */ s("span", {
|
|
60
|
+
className: "lyds-choice__title",
|
|
61
|
+
id: o,
|
|
53
62
|
children: n
|
|
63
|
+
}), t ? /* @__PURE__ */ s("span", {
|
|
64
|
+
className: "lyds-choice__description",
|
|
65
|
+
id: l,
|
|
66
|
+
children: t
|
|
54
67
|
}) : null]
|
|
55
68
|
})]
|
|
56
69
|
});
|
|
57
|
-
}),
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
...
|
|
60
|
-
className:
|
|
61
|
-
ref:
|
|
70
|
+
}), w = n(function({ className: e, ...n }, r) {
|
|
71
|
+
return /* @__PURE__ */ s(m, {
|
|
72
|
+
...n,
|
|
73
|
+
className: t("lyds-choice-group", e),
|
|
74
|
+
ref: r
|
|
62
75
|
});
|
|
63
|
-
}),
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
...
|
|
66
|
-
className:
|
|
67
|
-
ref:
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
-
className:
|
|
76
|
+
}), T = n(function({ children: e, className: n, ...r }, i) {
|
|
77
|
+
return /* @__PURE__ */ c(p.Root, {
|
|
78
|
+
...r,
|
|
79
|
+
className: t("lyds-radio", n),
|
|
80
|
+
ref: i,
|
|
81
|
+
children: [/* @__PURE__ */ s(p.Indicator, {
|
|
82
|
+
className: "lyds-radio__indicator",
|
|
70
83
|
keepMounted: !0
|
|
71
|
-
}),
|
|
84
|
+
}), e]
|
|
72
85
|
});
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
className:
|
|
86
|
+
}), E = n(function({ description: t, label: n, wrapperClassName: r, ...i }, a) {
|
|
87
|
+
let { titleId: o, descriptionId: l } = S(t);
|
|
88
|
+
return /* @__PURE__ */ c("label", {
|
|
89
|
+
className: e("lyds-choice", r),
|
|
90
|
+
children: [/* @__PURE__ */ s(T, {
|
|
91
|
+
...i,
|
|
92
|
+
ref: a,
|
|
93
|
+
"aria-labelledby": i["aria-labelledby"] ?? o,
|
|
94
|
+
"aria-describedby": i["aria-describedby"] ?? l
|
|
95
|
+
}), /* @__PURE__ */ c("span", {
|
|
96
|
+
className: "lyds-choice__copy",
|
|
97
|
+
children: [/* @__PURE__ */ s("span", {
|
|
98
|
+
className: "lyds-choice__title",
|
|
99
|
+
id: o,
|
|
86
100
|
children: n
|
|
101
|
+
}), t ? /* @__PURE__ */ s("span", {
|
|
102
|
+
className: "lyds-choice__description",
|
|
103
|
+
id: l,
|
|
104
|
+
children: t
|
|
87
105
|
}) : null]
|
|
88
106
|
})]
|
|
89
107
|
});
|
|
90
|
-
}),
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
...
|
|
93
|
-
className:
|
|
94
|
-
ref:
|
|
108
|
+
}), D = n(function({ children: e, className: n, ...r }, i) {
|
|
109
|
+
return /* @__PURE__ */ c(g.Root, {
|
|
110
|
+
...r,
|
|
111
|
+
className: t("lyds-switch", n),
|
|
112
|
+
ref: i,
|
|
95
113
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ s("span", {
|
|
97
115
|
"aria-hidden": "true",
|
|
98
|
-
className:
|
|
116
|
+
className: "lyds-switch__signal"
|
|
99
117
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
118
|
+
/* @__PURE__ */ s(g.Thumb, { className: "lyds-switch__thumb" }),
|
|
119
|
+
e
|
|
102
120
|
]
|
|
103
121
|
});
|
|
104
122
|
});
|
|
105
|
-
function
|
|
123
|
+
function O(e) {
|
|
106
124
|
return Array.isArray(e) ? Math.max(e.length, 1) : 1;
|
|
107
125
|
}
|
|
108
|
-
var
|
|
109
|
-
let g =
|
|
110
|
-
|
|
126
|
+
var k = n(function({ "aria-describedby": e, "aria-label": n, "aria-labelledby": i, className: a, defaultValue: o, getAriaLabel: l, getAriaValueText: u, showValue: d = !1, value: f, ...p }, m) {
|
|
127
|
+
let g = O(f ?? o), _ = n ? (e) => g === 1 ? n : `${n} ${e + 1}` : void 0, v = r((t) => {
|
|
128
|
+
t && (e ? t.setAttribute("aria-describedby", e) : t.removeAttribute("aria-describedby"), i && !l && t.setAttribute("aria-labelledby", i));
|
|
129
|
+
}, [
|
|
130
|
+
e,
|
|
131
|
+
i,
|
|
132
|
+
l
|
|
133
|
+
]);
|
|
134
|
+
return /* @__PURE__ */ c(h.Root, {
|
|
111
135
|
...p,
|
|
112
|
-
"aria-label":
|
|
136
|
+
"aria-label": n,
|
|
113
137
|
"aria-labelledby": i,
|
|
114
|
-
className:
|
|
115
|
-
defaultValue:
|
|
116
|
-
ref:
|
|
138
|
+
className: t("lyds-slider", a),
|
|
139
|
+
defaultValue: o,
|
|
140
|
+
ref: m,
|
|
117
141
|
value: f,
|
|
118
|
-
children: [d ? /* @__PURE__ */
|
|
119
|
-
className:
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
className:
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
-
className:
|
|
142
|
+
children: [d ? /* @__PURE__ */ s(h.Value, { className: "lyds-slider__value" }) : null, /* @__PURE__ */ s(h.Control, {
|
|
143
|
+
className: "lyds-slider__control",
|
|
144
|
+
children: /* @__PURE__ */ c(h.Track, {
|
|
145
|
+
className: "lyds-slider__track",
|
|
146
|
+
children: [/* @__PURE__ */ s(h.Indicator, { className: "lyds-slider__indicator" }), Array.from({ length: g }, (e, t) => /* @__PURE__ */ s(h.Thumb, {
|
|
147
|
+
className: "lyds-slider__thumb",
|
|
124
148
|
getAriaLabel: l ?? _,
|
|
125
149
|
getAriaValueText: u,
|
|
126
|
-
inputRef:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
index: r
|
|
130
|
-
}, r))]
|
|
150
|
+
inputRef: v,
|
|
151
|
+
index: t
|
|
152
|
+
}, t))]
|
|
131
153
|
})
|
|
132
154
|
})]
|
|
133
155
|
});
|
|
134
|
-
}),
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
...i,
|
|
137
|
-
className: (i) => t(e.toggle, r === "quiet" && e.toggleQuiet, typeof n == "function" ? n(i) : n),
|
|
138
|
-
ref: a
|
|
139
|
-
});
|
|
140
|
-
}), k = r(function({ className: t, ...r }, i) {
|
|
141
|
-
return /* @__PURE__ */ o(_, {
|
|
156
|
+
}), A = n(function({ className: t, variant: n = "standard", ...r }, i) {
|
|
157
|
+
return /* @__PURE__ */ s(_, {
|
|
142
158
|
...r,
|
|
143
|
-
className:
|
|
159
|
+
className: (r) => e("lyds-toggle", n === "quiet" && "lyds-toggle--quiet", typeof t == "function" ? t(r) : t),
|
|
144
160
|
ref: i
|
|
145
161
|
});
|
|
146
|
-
}),
|
|
147
|
-
|
|
148
|
-
|
|
162
|
+
}), j = n(function({ className: e, ...n }, r) {
|
|
163
|
+
return /* @__PURE__ */ s(v, {
|
|
164
|
+
...n,
|
|
165
|
+
className: t("lyds-toggle-group", e),
|
|
166
|
+
ref: r
|
|
167
|
+
});
|
|
168
|
+
}), M = n(function({ allowEmpty: e = !1, "aria-label": n, "aria-labelledby": r, className: i, defaultValue: l = null, disabled: u = !1, name: d, onValueChange: f, size: p = "md", value: m, ...h }, g) {
|
|
169
|
+
let _ = m !== void 0, [y, b] = a(l), x = _ ? m : y;
|
|
170
|
+
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(v, {
|
|
149
171
|
...h,
|
|
150
|
-
"aria-label":
|
|
151
|
-
|
|
172
|
+
"aria-label": n,
|
|
173
|
+
"aria-labelledby": r,
|
|
174
|
+
className: t("lyds-segmented-control", i),
|
|
152
175
|
"data-size": p,
|
|
153
176
|
disabled: u,
|
|
154
177
|
multiple: !1,
|
|
155
|
-
onValueChange: (
|
|
156
|
-
let r =
|
|
157
|
-
(
|
|
178
|
+
onValueChange: (t, n) => {
|
|
179
|
+
let r = t[0] ?? null;
|
|
180
|
+
(e || r !== null) && (f?.(r, n), !n.isCanceled && (_ || b(r)));
|
|
158
181
|
},
|
|
159
182
|
ref: g,
|
|
160
183
|
value: x === null ? [] : [x]
|
|
161
|
-
}), d ? /* @__PURE__ */
|
|
184
|
+
}), d ? /* @__PURE__ */ s("input", {
|
|
162
185
|
disabled: u,
|
|
163
186
|
name: d,
|
|
164
187
|
type: "hidden",
|
|
165
188
|
value: x ?? ""
|
|
166
189
|
}) : null] });
|
|
167
|
-
}),
|
|
190
|
+
}), N = A;
|
|
168
191
|
//#endregion
|
|
169
|
-
export {
|
|
192
|
+
export { b as Checkbox, x as CheckboxGroup, C as CheckboxItem, T as Radio, w as RadioGroup, E as RadioItem, M as SegmentedControl, N as SegmentedControlItem, k as Slider, D as Switch, A as Toggle, j as ToggleGroup };
|
|
170
193
|
|
|
171
194
|
//# sourceMappingURL=controls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.js","names":[],"sources":["../../../src/components/selection/controls.tsx"],"sourcesContent":["import { Checkbox as BaseCheckbox, type CheckboxRootProps } from \"@base-ui/react/checkbox\";\nimport { CheckboxGroup as BaseCheckboxGroup, type CheckboxGroupProps as BaseCheckboxGroupProps } from \"@base-ui/react/checkbox-group\";\nimport { Radio as BaseRadio, type RadioRootProps } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup, type RadioGroupProps as BaseRadioGroupProps } from \"@base-ui/react/radio-group\";\nimport { Slider as BaseSlider, type SliderRootProps } from \"@base-ui/react/slider\";\nimport { Switch as BaseSwitch, type SwitchRootProps } from \"@base-ui/react/switch\";\nimport { Toggle as BaseToggle, type ToggleProps as BaseToggleProps } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup, type ToggleGroupProps as BaseToggleGroupProps } from \"@base-ui/react/toggle-group\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { MinusIcon } from \"@phosphor-icons/react/dist/csr/Minus\";\nimport { forwardRef, useState, type ForwardedRef, type JSX, type ReactNode, type RefAttributes } from \"react\";\n\nimport { cx, mergeStateClassName } from \"./classnames\";\nimport styles from \"./selection.module.css\";\n\nfunction CheckGlyph({ indeterminate = false }: { indeterminate?: boolean }) {\n\treturn indeterminate ? <MinusIcon aria-hidden=\"true\" weight=\"bold\" /> : <CheckIcon aria-hidden=\"true\" weight=\"bold\" />;\n}\n\nexport interface CheckboxProps extends CheckboxRootProps {\n\tindicator?: ReactNode;\n}\n\nexport const Checkbox = forwardRef<HTMLElement, CheckboxProps>(function Checkbox({ children, className, indicator, indeterminate, ...props }, ref) {\n\treturn (\n\t\t<BaseCheckbox.Root {...props} className={mergeStateClassName(styles.checkbox, className)} indeterminate={indeterminate} ref={ref}>\n\t\t\t<BaseCheckbox.Indicator className={styles.checkboxIndicator} keepMounted>\n\t\t\t\t{indicator ?? <CheckGlyph indeterminate={indeterminate ?? false} />}\n\t\t\t</BaseCheckbox.Indicator>\n\t\t\t{children}\n\t\t</BaseCheckbox.Root>\n\t);\n});\n\nexport type CheckboxGroupProps = BaseCheckboxGroupProps;\n\nexport const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(function CheckboxGroup({ className, ...props }, ref) {\n\treturn <BaseCheckboxGroup {...props} className={mergeStateClassName(styles.choiceGroup, className)} ref={ref} />;\n});\n\nexport interface CheckboxItemProps extends CheckboxProps {\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\twrapperClassName?: string;\n}\n\nexport const CheckboxItem = forwardRef<HTMLElement, CheckboxItemProps>(function CheckboxItem({ description, label, wrapperClassName, ...props }, ref) {\n\treturn (\n\t\t<label className={cx(styles.choiceLabel, wrapperClassName)}>\n\t\t\t<Checkbox {...props} ref={ref} />\n\t\t\t<span className={styles.choiceCopy}>\n\t\t\t\t<span className={styles.choiceTitle}>{label}</span>\n\t\t\t\t{description ? <span className={styles.choiceDescription}>{description}</span> : null}\n\t\t\t</span>\n\t\t</label>\n\t);\n});\n\nexport type RadioGroupProps<Value = string> = BaseRadioGroupProps<Value>;\n\ntype RadioGroupComponent = <Value = string>(props: RadioGroupProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const RadioGroup = forwardRef(function RadioGroup<Value = string>({ className, ...props }: RadioGroupProps<Value>, ref: ForwardedRef<HTMLDivElement>) {\n\treturn <BaseRadioGroup {...props} className={mergeStateClassName(styles.choiceGroup, className)} ref={ref} />;\n}) as RadioGroupComponent;\n\nexport type RadioProps<Value = string> = RadioRootProps<Value>;\n\ntype RadioComponent = <Value = string>(props: RadioProps<Value> & RefAttributes<HTMLElement>) => JSX.Element;\n\nexport const Radio = forwardRef(function Radio<Value = string>({ children, className, ...props }: RadioProps<Value>, ref: ForwardedRef<HTMLElement>) {\n\treturn (\n\t\t<BaseRadio.Root {...props} className={mergeStateClassName(styles.radio, className)} ref={ref}>\n\t\t\t<BaseRadio.Indicator className={styles.radioIndicator} keepMounted />\n\t\t\t{children}\n\t\t</BaseRadio.Root>\n\t);\n}) as RadioComponent;\n\nexport interface RadioItemProps<Value = string> extends RadioProps<Value> {\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\twrapperClassName?: string;\n}\n\ntype RadioItemComponent = <Value = string>(props: RadioItemProps<Value> & RefAttributes<HTMLElement>) => JSX.Element;\n\nexport const RadioItem = forwardRef(function RadioItem<Value = string>({ description, label, wrapperClassName, ...props }: RadioItemProps<Value>, ref: ForwardedRef<HTMLElement>) {\n\treturn (\n\t\t<label className={cx(styles.choiceLabel, wrapperClassName)}>\n\t\t\t<Radio {...props} ref={ref} />\n\t\t\t<span className={styles.choiceCopy}>\n\t\t\t\t<span className={styles.choiceTitle}>{label}</span>\n\t\t\t\t{description ? <span className={styles.choiceDescription}>{description}</span> : null}\n\t\t\t</span>\n\t\t</label>\n\t);\n}) as RadioItemComponent;\n\nexport interface SwitchProps extends SwitchRootProps {\n\tchildren?: ReactNode;\n}\n\nexport const Switch = forwardRef<HTMLElement, SwitchProps>(function Switch({ children, className, ...props }, ref) {\n\treturn (\n\t\t<BaseSwitch.Root {...props} className={mergeStateClassName(styles.switch, className)} ref={ref}>\n\t\t\t<span aria-hidden=\"true\" className={styles.switchSignal} />\n\t\t\t<BaseSwitch.Thumb className={styles.switchThumb} />\n\t\t\t{children}\n\t\t</BaseSwitch.Root>\n\t);\n});\n\nexport interface SliderProps<Value extends number | readonly number[] = number> extends SliderRootProps<Value> {\n\tgetAriaLabel?: (index: number) => string;\n\tgetAriaValueText?: (formattedValue: string, value: number, index: number) => string;\n\tshowValue?: boolean;\n}\n\ntype SliderComponent = <Value extends number | readonly number[] = number>(props: SliderProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nfunction getThumbCount(value: number | readonly number[] | undefined): number {\n\treturn Array.isArray(value) ? Math.max(value.length, 1) : 1;\n}\n\nexport const Slider = forwardRef(function Slider<Value extends number | readonly number[] = number>(\n\t{\n\t\t\"aria-describedby\": ariaDescribedby,\n\t\t\"aria-label\": ariaLabel,\n\t\t\"aria-labelledby\": ariaLabelledby,\n\t\tclassName,\n\t\tdefaultValue,\n\t\tgetAriaLabel,\n\t\tgetAriaValueText,\n\t\tshowValue = false,\n\t\tvalue,\n\t\t...props\n\t}: SliderProps<Value>,\n\tref: ForwardedRef<HTMLDivElement>\n) {\n\tconst thumbCount = getThumbCount(value ?? defaultValue);\n\tconst fallbackThumbLabel = ariaLabel ? (index: number) => (thumbCount === 1 ? ariaLabel : `${ariaLabel} ${index + 1}`) : undefined;\n\n\treturn (\n\t\t<BaseSlider.Root {...props} aria-label={ariaLabel} aria-labelledby={ariaLabelledby} className={mergeStateClassName(styles.slider, className)} defaultValue={defaultValue} ref={ref} value={value}>\n\t\t\t{showValue ? <BaseSlider.Value className={styles.sliderValue} /> : null}\n\t\t\t<BaseSlider.Control className={styles.sliderControl}>\n\t\t\t\t<BaseSlider.Track className={styles.sliderTrack}>\n\t\t\t\t\t<BaseSlider.Indicator className={styles.sliderIndicator} />\n\t\t\t\t\t{Array.from({ length: thumbCount }, (_, index) => (\n\t\t\t\t\t\t<BaseSlider.Thumb\n\t\t\t\t\t\t\tclassName={styles.sliderThumb}\n\t\t\t\t\t\t\tgetAriaLabel={getAriaLabel ?? fallbackThumbLabel}\n\t\t\t\t\t\t\tgetAriaValueText={getAriaValueText}\n\t\t\t\t\t\t\tinputRef={input => {\n\t\t\t\t\t\t\t\tif (!input) return;\n\t\t\t\t\t\t\t\tif (ariaDescribedby) input.setAttribute(\"aria-describedby\", ariaDescribedby);\n\t\t\t\t\t\t\t\tif (ariaLabelledby && !getAriaLabel) input.setAttribute(\"aria-labelledby\", ariaLabelledby);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</BaseSlider.Track>\n\t\t\t</BaseSlider.Control>\n\t\t</BaseSlider.Root>\n\t);\n}) as SliderComponent;\n\nexport interface ToggleProps<Value extends string = string> extends BaseToggleProps<Value> {\n\tvariant?: \"standard\" | \"quiet\";\n}\n\ntype ToggleComponent = <Value extends string = string>(props: ToggleProps<Value> & RefAttributes<HTMLButtonElement>) => JSX.Element;\n\nexport const Toggle = forwardRef(function Toggle<Value extends string = string>({ className, variant = \"standard\", ...props }: ToggleProps<Value>, ref: ForwardedRef<HTMLButtonElement>) {\n\treturn <BaseToggle {...props} className={state => cx(styles.toggle, variant === \"quiet\" && styles.toggleQuiet, typeof className === \"function\" ? className(state) : className)} ref={ref} />;\n}) as ToggleComponent;\n\nexport type ToggleGroupProps<Value extends string = string> = BaseToggleGroupProps<Value>;\n\ntype ToggleGroupComponent = <Value extends string = string>(props: ToggleGroupProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const ToggleGroup = forwardRef(function ToggleGroup<Value extends string = string>({ className, ...props }: ToggleGroupProps<Value>, ref: ForwardedRef<HTMLDivElement>) {\n\treturn <BaseToggleGroup {...props} className={mergeStateClassName(styles.toggleGroup, className)} ref={ref} />;\n}) as ToggleGroupComponent;\n\nexport interface SegmentedControlProps<Value extends string = string> extends Omit<BaseToggleGroupProps<Value>, \"aria-readonly\" | \"defaultValue\" | \"multiple\" | \"onValueChange\" | \"value\"> {\n\tallowEmpty?: boolean;\n\tdefaultValue?: Value | null;\n\tname?: string;\n\tonValueChange?: (value: Value | null, details: BaseToggleGroup.ChangeEventDetails) => void;\n\tsize?: \"sm\" | \"md\";\n\tvalue?: Value | null;\n}\n\ntype SegmentedControlComponent = <Value extends string = string>(props: SegmentedControlProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const SegmentedControl = forwardRef(function SegmentedControl<Value extends string = string>(\n\t{ allowEmpty = false, \"aria-label\": ariaLabel, className, defaultValue = null, disabled = false, name, onValueChange, size = \"md\", value, ...props }: SegmentedControlProps<Value>,\n\tref: ForwardedRef<HTMLDivElement>\n) {\n\tconst controlled = value !== undefined;\n\tconst [internalValue, setInternalValue] = useState<Value | null>(defaultValue);\n\tconst currentValue = controlled ? value : internalValue;\n\n\treturn (\n\t\t<>\n\t\t\t<BaseToggleGroup\n\t\t\t\t{...props}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tclassName={mergeStateClassName(styles.segmentedControl, className)}\n\t\t\t\tdata-size={size}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tmultiple={false}\n\t\t\t\tonValueChange={(nextValues, details) => {\n\t\t\t\t\tconst nextValue = nextValues[0] ?? null;\n\t\t\t\t\tif (!allowEmpty && nextValue === null) return;\n\t\t\t\t\tonValueChange?.(nextValue, details);\n\t\t\t\t\tif (details.isCanceled) return;\n\t\t\t\t\tif (!controlled) setInternalValue(nextValue);\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\tvalue={currentValue === null ? [] : [currentValue]}\n\t\t\t/>\n\t\t\t{name ? <input disabled={disabled} name={name} type=\"hidden\" value={currentValue ?? \"\"} /> : null}\n\t\t</>\n\t);\n}) as SegmentedControlComponent;\n\nexport const SegmentedControlItem = Toggle;\n"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,EAAW,EAAE,mBAAgB,MAAsC;CAC3E,OAAuB,EAAhB,IAAiB,IAAiD,GAAlD;EAAW,eAAY;EAAO,QAAO;CAAQ,CAAiD;AACtH;AAMA,IAAa,IAAW,EAAuC,SAAkB,EAAE,aAAU,cAAW,cAAW,kBAAe,GAAG,KAAS,GAAK;CAClJ,OACC,kBAAC,EAAa,MAAd;EAAmB,GAAI;EAAO,WAAW,EAAoB,EAAO,UAAU,CAAS;EAAkB;EAAoB;EAA7H,UAAA,CACC,kBAAC,E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AAW;EACD;EACV,UAAU;EACV,gBAAgB,GAAY,MAAY;GACvC,IAAM,IAAY,EAAW,MAAM;GAC/B,CAAC,KAAc,MAAc,UACjC,IAAgB,GAAW,CAAO,GAC9B,GAAQ,eACP,KAAY,EAAiB,CAAS;EAC5C;EACK;EACL,OAAO,MAAiB,OAAO,CAAC,IAAI,CAAC,CAAY;CACjD,CAAA,GACA,IAAO,kBAAC,SAAD;EAAiB;EAAgB;EAAM,MAAK;EAAS,OAAO,KAAgB;CAAK,CAAA,IAAI,IAC5F,EAAA,CAAA;AAEJ,CAAC,GAEY,IAAuB"}
|
|
1
|
+
{"version":3,"file":"controls.js","names":[],"sources":["../../../src/components/selection/controls.tsx"],"sourcesContent":["import { Checkbox as BaseCheckbox, type CheckboxRootProps } from \"@base-ui/react/checkbox\";\nimport { CheckboxGroup as BaseCheckboxGroup, type CheckboxGroupProps as BaseCheckboxGroupProps } from \"@base-ui/react/checkbox-group\";\nimport { Radio as BaseRadio, type RadioRootProps } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup, type RadioGroupProps as BaseRadioGroupProps } from \"@base-ui/react/radio-group\";\nimport { Slider as BaseSlider, type SliderRootProps } from \"@base-ui/react/slider\";\nimport { Switch as BaseSwitch, type SwitchRootProps } from \"@base-ui/react/switch\";\nimport { Toggle as BaseToggle, type ToggleProps as BaseToggleProps } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup, type ToggleGroupProps as BaseToggleGroupProps } from \"@base-ui/react/toggle-group\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { MinusIcon } from \"@phosphor-icons/react/dist/csr/Minus\";\nimport { forwardRef, useCallback, useId, useState, type ForwardedRef, type JSX, type ReactNode, type RefAttributes } from \"react\";\n\nimport { cx, withStateClassName, type AccessibleName } from \"@/internal\";\n\nfunction CheckGlyph({ indeterminate = false }: { indeterminate?: boolean }) {\n\treturn indeterminate ? <MinusIcon aria-hidden=\"true\" weight=\"bold\" /> : <CheckIcon aria-hidden=\"true\" weight=\"bold\" />;\n}\n\nexport interface CheckboxProps extends CheckboxRootProps {\n\tindicator?: ReactNode;\n}\n\nexport const Checkbox = forwardRef<HTMLElement, CheckboxProps>(function Checkbox({ children, className, indicator, indeterminate, ...props }, ref) {\n\treturn (\n\t\t<BaseCheckbox.Root {...props} className={withStateClassName(\"lyds-checkbox\", className)} indeterminate={indeterminate} ref={ref}>\n\t\t\t<BaseCheckbox.Indicator className={\"lyds-checkbox__indicator\"} keepMounted>\n\t\t\t\t{indicator ?? <CheckGlyph indeterminate={indeterminate ?? false} />}\n\t\t\t</BaseCheckbox.Indicator>\n\t\t\t{children}\n\t\t</BaseCheckbox.Root>\n\t);\n});\n\nexport type CheckboxGroupProps = BaseCheckboxGroupProps;\n\nexport const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(function CheckboxGroup({ className, ...props }, ref) {\n\treturn <BaseCheckboxGroup {...props} className={withStateClassName(\"lyds-choice-group\", className)} ref={ref} />;\n});\n\n/**\n * The wrapping <label> makes the whole row a hit target, but it also makes every word inside it\n * part of the control's accessible name — including the description. Naming the control from the\n * title and describing it from the description keeps the row clickable without reading the\n * supporting copy out as part of the name. The visible title always wins over an `aria-label`,\n * which is what WCAG 2.5.3 asks for; pass `aria-labelledby` to point somewhere else entirely.\n */\nfunction useChoiceCopyIds(description: ReactNode) {\n\tconst id = useId();\n\treturn { titleId: `${id}-title`, descriptionId: description ? `${id}-description` : undefined };\n}\n\nexport interface CheckboxItemProps extends CheckboxProps {\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\twrapperClassName?: string;\n}\n\nexport const CheckboxItem = forwardRef<HTMLElement, CheckboxItemProps>(function CheckboxItem({ description, label, wrapperClassName, ...props }, ref) {\n\tconst { titleId, descriptionId } = useChoiceCopyIds(description);\n\n\treturn (\n\t\t<label className={cx(\"lyds-choice\", wrapperClassName)}>\n\t\t\t<Checkbox {...props} ref={ref} aria-labelledby={props[\"aria-labelledby\"] ?? titleId} aria-describedby={props[\"aria-describedby\"] ?? descriptionId} />\n\t\t\t<span className={\"lyds-choice__copy\"}>\n\t\t\t\t<span className={\"lyds-choice__title\"} id={titleId}>\n\t\t\t\t\t{label}\n\t\t\t\t</span>\n\t\t\t\t{description ? (\n\t\t\t\t\t<span className={\"lyds-choice__description\"} id={descriptionId}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</span>\n\t\t\t\t) : null}\n\t\t\t</span>\n\t\t</label>\n\t);\n});\n\nexport type RadioGroupProps<Value = string> = BaseRadioGroupProps<Value>;\n\ntype RadioGroupComponent = <Value = string>(props: RadioGroupProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const RadioGroup = forwardRef(function RadioGroup<Value = string>({ className, ...props }: RadioGroupProps<Value>, ref: ForwardedRef<HTMLDivElement>) {\n\treturn <BaseRadioGroup {...props} className={withStateClassName(\"lyds-choice-group\", className)} ref={ref} />;\n}) as RadioGroupComponent;\n\nexport type RadioProps<Value = string> = RadioRootProps<Value>;\n\ntype RadioComponent = <Value = string>(props: RadioProps<Value> & RefAttributes<HTMLElement>) => JSX.Element;\n\nexport const Radio = forwardRef(function Radio<Value = string>({ children, className, ...props }: RadioProps<Value>, ref: ForwardedRef<HTMLElement>) {\n\treturn (\n\t\t<BaseRadio.Root {...props} className={withStateClassName(\"lyds-radio\", className)} ref={ref}>\n\t\t\t<BaseRadio.Indicator className={\"lyds-radio__indicator\"} keepMounted />\n\t\t\t{children}\n\t\t</BaseRadio.Root>\n\t);\n}) as RadioComponent;\n\nexport interface RadioItemProps<Value = string> extends RadioProps<Value> {\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\twrapperClassName?: string;\n}\n\ntype RadioItemComponent = <Value = string>(props: RadioItemProps<Value> & RefAttributes<HTMLElement>) => JSX.Element;\n\nexport const RadioItem = forwardRef(function RadioItem<Value = string>({ description, label, wrapperClassName, ...props }: RadioItemProps<Value>, ref: ForwardedRef<HTMLElement>) {\n\tconst { titleId, descriptionId } = useChoiceCopyIds(description);\n\n\treturn (\n\t\t<label className={cx(\"lyds-choice\", wrapperClassName)}>\n\t\t\t<Radio {...props} ref={ref} aria-labelledby={props[\"aria-labelledby\"] ?? titleId} aria-describedby={props[\"aria-describedby\"] ?? descriptionId} />\n\t\t\t<span className={\"lyds-choice__copy\"}>\n\t\t\t\t<span className={\"lyds-choice__title\"} id={titleId}>\n\t\t\t\t\t{label}\n\t\t\t\t</span>\n\t\t\t\t{description ? (\n\t\t\t\t\t<span className={\"lyds-choice__description\"} id={descriptionId}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</span>\n\t\t\t\t) : null}\n\t\t\t</span>\n\t\t</label>\n\t);\n}) as RadioItemComponent;\n\nexport interface SwitchProps extends SwitchRootProps {\n\tchildren?: ReactNode;\n}\n\nexport const Switch = forwardRef<HTMLElement, SwitchProps>(function Switch({ children, className, ...props }, ref) {\n\treturn (\n\t\t<BaseSwitch.Root {...props} className={withStateClassName(\"lyds-switch\", className)} ref={ref}>\n\t\t\t<span aria-hidden=\"true\" className={\"lyds-switch__signal\"} />\n\t\t\t<BaseSwitch.Thumb className={\"lyds-switch__thumb\"} />\n\t\t\t{children}\n\t\t</BaseSwitch.Root>\n\t);\n});\n\nexport interface SliderProps<Value extends number | readonly number[] = number> extends SliderRootProps<Value> {\n\tgetAriaLabel?: (index: number) => string;\n\tgetAriaValueText?: (formattedValue: string, value: number, index: number) => string;\n\tshowValue?: boolean;\n}\n\ntype SliderComponent = <Value extends number | readonly number[] = number>(props: SliderProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nfunction getThumbCount(value: number | readonly number[] | undefined): number {\n\treturn Array.isArray(value) ? Math.max(value.length, 1) : 1;\n}\n\nexport const Slider = forwardRef(function Slider<Value extends number | readonly number[] = number>(\n\t{\n\t\t\"aria-describedby\": ariaDescribedby,\n\t\t\"aria-label\": ariaLabel,\n\t\t\"aria-labelledby\": ariaLabelledby,\n\t\tclassName,\n\t\tdefaultValue,\n\t\tgetAriaLabel,\n\t\tgetAriaValueText,\n\t\tshowValue = false,\n\t\tvalue,\n\t\t...props\n\t}: SliderProps<Value>,\n\tref: ForwardedRef<HTMLDivElement>\n) {\n\tconst thumbCount = getThumbCount(value ?? defaultValue);\n\tconst fallbackThumbLabel = ariaLabel ? (index: number) => (thumbCount === 1 ? ariaLabel : `${ariaLabel} ${index + 1}`) : undefined;\n\t// Base UI owns the thumb inputs, so these two relationships have to be applied to the nodes it\n\t// renders. An inline callback would detach and reattach on every render; aria-labelledby is only\n\t// ever added because Base UI sets its own, while aria-describedby is ours to clear.\n\tconst applyThumbDescription = useCallback(\n\t\t(input: HTMLInputElement | null) => {\n\t\t\tif (!input) return;\n\t\t\tif (ariaDescribedby) input.setAttribute(\"aria-describedby\", ariaDescribedby);\n\t\t\telse input.removeAttribute(\"aria-describedby\");\n\t\t\tif (ariaLabelledby && !getAriaLabel) input.setAttribute(\"aria-labelledby\", ariaLabelledby);\n\t\t},\n\t\t[ariaDescribedby, ariaLabelledby, getAriaLabel]\n\t);\n\n\treturn (\n\t\t<BaseSlider.Root {...props} aria-label={ariaLabel} aria-labelledby={ariaLabelledby} className={withStateClassName(\"lyds-slider\", className)} defaultValue={defaultValue} ref={ref} value={value}>\n\t\t\t{showValue ? <BaseSlider.Value className={\"lyds-slider__value\"} /> : null}\n\t\t\t<BaseSlider.Control className={\"lyds-slider__control\"}>\n\t\t\t\t<BaseSlider.Track className={\"lyds-slider__track\"}>\n\t\t\t\t\t<BaseSlider.Indicator className={\"lyds-slider__indicator\"} />\n\t\t\t\t\t{Array.from({ length: thumbCount }, (_, index) => (\n\t\t\t\t\t\t<BaseSlider.Thumb\n\t\t\t\t\t\t\tclassName={\"lyds-slider__thumb\"}\n\t\t\t\t\t\t\tgetAriaLabel={getAriaLabel ?? fallbackThumbLabel}\n\t\t\t\t\t\t\tgetAriaValueText={getAriaValueText}\n\t\t\t\t\t\t\tinputRef={applyThumbDescription}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</BaseSlider.Track>\n\t\t\t</BaseSlider.Control>\n\t\t</BaseSlider.Root>\n\t);\n}) as SliderComponent;\n\nexport interface ToggleProps<Value extends string = string> extends BaseToggleProps<Value> {\n\tvariant?: \"standard\" | \"quiet\";\n}\n\ntype ToggleComponent = <Value extends string = string>(props: ToggleProps<Value> & RefAttributes<HTMLButtonElement>) => JSX.Element;\n\nexport const Toggle = forwardRef(function Toggle<Value extends string = string>({ className, variant = \"standard\", ...props }: ToggleProps<Value>, ref: ForwardedRef<HTMLButtonElement>) {\n\treturn <BaseToggle {...props} className={state => cx(\"lyds-toggle\", variant === \"quiet\" && \"lyds-toggle--quiet\", typeof className === \"function\" ? className(state) : className)} ref={ref} />;\n}) as ToggleComponent;\n\nexport type ToggleGroupProps<Value extends string = string> = BaseToggleGroupProps<Value>;\n\ntype ToggleGroupComponent = <Value extends string = string>(props: ToggleGroupProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const ToggleGroup = forwardRef(function ToggleGroup<Value extends string = string>({ className, ...props }: ToggleGroupProps<Value>, ref: ForwardedRef<HTMLDivElement>) {\n\treturn <BaseToggleGroup {...props} className={withStateClassName(\"lyds-toggle-group\", className)} ref={ref} />;\n}) as ToggleGroupComponent;\n\ninterface SegmentedControlOwnProps<Value extends string = string> extends Omit<\n\tBaseToggleGroupProps<Value>,\n\t\"aria-label\" | \"aria-labelledby\" | \"aria-readonly\" | \"defaultValue\" | \"multiple\" | \"onValueChange\" | \"value\"\n> {\n\tallowEmpty?: boolean;\n\tdefaultValue?: Value | null;\n\tname?: string;\n\tonValueChange?: (value: Value | null, details: BaseToggleGroup.ChangeEventDetails) => void;\n\tsize?: \"sm\" | \"md\";\n\tvalue?: Value | null;\n}\n\n/** The segments name themselves; the group they belong to does not, so it has to be told. */\nexport type SegmentedControlProps<Value extends string = string> = SegmentedControlOwnProps<Value> & AccessibleName;\n\ntype SegmentedControlComponent = <Value extends string = string>(props: SegmentedControlProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const SegmentedControl = forwardRef(function SegmentedControl<Value extends string = string>(\n\t{\n\t\tallowEmpty = false,\n\t\t\"aria-label\": ariaLabel,\n\t\t\"aria-labelledby\": ariaLabelledby,\n\t\tclassName,\n\t\tdefaultValue = null,\n\t\tdisabled = false,\n\t\tname,\n\t\tonValueChange,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\t...props\n\t}: SegmentedControlProps<Value>,\n\tref: ForwardedRef<HTMLDivElement>\n) {\n\tconst controlled = value !== undefined;\n\tconst [internalValue, setInternalValue] = useState<Value | null>(defaultValue);\n\tconst currentValue = controlled ? value : internalValue;\n\n\treturn (\n\t\t<>\n\t\t\t<BaseToggleGroup\n\t\t\t\t{...props}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\tclassName={withStateClassName(\"lyds-segmented-control\", className)}\n\t\t\t\tdata-size={size}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tmultiple={false}\n\t\t\t\tonValueChange={(nextValues, details) => {\n\t\t\t\t\tconst nextValue = nextValues[0] ?? null;\n\t\t\t\t\tif (!allowEmpty && nextValue === null) return;\n\t\t\t\t\tonValueChange?.(nextValue, details);\n\t\t\t\t\tif (details.isCanceled) return;\n\t\t\t\t\tif (!controlled) setInternalValue(nextValue);\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\tvalue={currentValue === null ? [] : [currentValue]}\n\t\t\t/>\n\t\t\t{name ? <input disabled={disabled} name={name} type=\"hidden\" value={currentValue ?? \"\"} /> : null}\n\t\t</>\n\t);\n}) as SegmentedControlComponent;\n\nexport const SegmentedControlItem = Toggle;\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAS,EAAW,EAAE,mBAAgB,MAAsC;CAC3E,OAAuB,EAAhB,IAAiB,IAAiD,GAAlD;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