@db-ux/react-core-components 4.9.0 → 4.10.0-esm-94516f3
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/CHANGELOG.md +17 -1
- package/README.md +97 -35
- package/dist/components/accordion/accordion.js +102 -86
- package/dist/components/accordion/model.d.ts +2 -2
- package/dist/components/accordion/model.js +4 -2
- package/dist/components/accordion-item/accordion-item.d.ts +2 -1
- package/dist/components/accordion-item/accordion-item.js +89 -56
- package/dist/components/accordion-item/model.d.ts +5 -1
- package/dist/components/badge/badge.js +72 -32
- package/dist/components/badge/model.d.ts +1 -1
- package/dist/components/badge/model.js +12 -1
- package/dist/components/brand/brand.js +60 -13
- package/dist/components/brand/model.d.ts +1 -1
- package/dist/components/button/button.js +75 -21
- package/dist/components/button/model.d.ts +1 -1
- package/dist/components/button/model.js +13 -2
- package/dist/components/card/card.js +65 -15
- package/dist/components/card/model.d.ts +1 -1
- package/dist/components/card/model.js +8 -2
- package/dist/components/checkbox/checkbox.js +163 -157
- package/dist/components/checkbox/model.d.ts +1 -1
- package/dist/components/custom-button/custom-button.js +65 -10
- package/dist/components/custom-button/model.d.ts +2 -2
- package/dist/components/custom-select/custom-select.js +509 -727
- package/dist/components/custom-select/model.d.ts +4 -4
- package/dist/components/custom-select/model.js +8 -1
- package/dist/components/custom-select-dropdown/custom-select-dropdown.js +62 -11
- package/dist/components/custom-select-dropdown/model.d.ts +1 -1
- package/dist/components/custom-select-dropdown/model.js +8 -1
- package/dist/components/custom-select-form-field/custom-select-form-field.js +57 -10
- package/dist/components/custom-select-form-field/model.d.ts +1 -1
- package/dist/components/custom-select-list/custom-select-list.js +60 -11
- package/dist/components/custom-select-list/model.d.ts +1 -1
- package/dist/components/custom-select-list-item/custom-select-list-item.js +89 -32
- package/dist/components/custom-select-list-item/model.d.ts +1 -1
- package/dist/components/custom-select-list-item/model.js +4 -1
- package/dist/components/divider/divider.js +60 -10
- package/dist/components/divider/model.d.ts +1 -1
- package/dist/components/divider/model.js +4 -2
- package/dist/components/drawer/drawer.js +118 -97
- package/dist/components/drawer/model.d.ts +1 -1
- package/dist/components/drawer/model.js +14 -4
- package/dist/components/header/header.js +143 -65
- package/dist/components/header/model.d.ts +1 -1
- package/dist/components/icon/icon.js +61 -12
- package/dist/components/icon/model.d.ts +1 -1
- package/dist/components/icon/model.js +11 -1
- package/dist/components/infotext/infotext.js +62 -12
- package/dist/components/infotext/model.d.ts +1 -1
- package/dist/components/input/input.js +198 -167
- package/dist/components/input/model.d.ts +1 -1
- package/dist/components/input/model.js +21 -5
- package/dist/components/link/link.js +70 -12
- package/dist/components/link/model.d.ts +1 -1
- package/dist/components/link/model.js +8 -3
- package/dist/components/navigation/model.d.ts +1 -1
- package/dist/components/navigation/navigation.js +57 -11
- package/dist/components/navigation-item/model.d.ts +6 -2
- package/dist/components/navigation-item/navigation-item.js +117 -81
- package/dist/components/notification/model.d.ts +1 -1
- package/dist/components/notification/model.js +12 -3
- package/dist/components/notification/notification.js +100 -32
- package/dist/components/page/model.d.ts +1 -1
- package/dist/components/page/model.js +4 -2
- package/dist/components/page/page.js +74 -46
- package/dist/components/popover/model.d.ts +1 -1
- package/dist/components/popover/popover.js +126 -125
- package/dist/components/radio/model.d.ts +1 -1
- package/dist/components/radio/radio.js +124 -85
- package/dist/components/section/model.d.ts +1 -1
- package/dist/components/section/section.js +59 -10
- package/dist/components/select/model.d.ts +1 -1
- package/dist/components/select/select.js +188 -191
- package/dist/components/stack/model.d.ts +1 -1
- package/dist/components/stack/model.js +14 -4
- package/dist/components/stack/stack.js +63 -10
- package/dist/components/switch/model.d.ts +1 -1
- package/dist/components/switch/switch.js +182 -150
- package/dist/components/tab-item/model.d.ts +1 -1
- package/dist/components/tab-item/tab-item.js +105 -76
- package/dist/components/tab-list/model.d.ts +1 -1
- package/dist/components/tab-list/tab-list.js +60 -11
- package/dist/components/tab-panel/model.d.ts +1 -1
- package/dist/components/tab-panel/tab-panel.js +59 -13
- package/dist/components/tabs/model.d.ts +3 -3
- package/dist/components/tabs/model.js +4 -2
- package/dist/components/tabs/tabs.js +191 -178
- package/dist/components/tag/model.d.ts +1 -1
- package/dist/components/tag/model.js +4 -1
- package/dist/components/tag/tag.js +91 -32
- package/dist/components/textarea/model.d.ts +1 -1
- package/dist/components/textarea/model.js +13 -2
- package/dist/components/textarea/textarea.js +165 -150
- package/dist/components/tooltip/model.d.ts +1 -1
- package/dist/components/tooltip/model.js +4 -1
- package/dist/components/tooltip/tooltip.js +119 -115
- package/dist/index.js +64 -81
- package/dist/shared/constants.js +32 -94
- package/dist/shared/figma.d.ts +12 -6
- package/dist/shared/model.js +73 -22
- package/dist/utils/document-click-listener.js +26 -29
- package/dist/utils/document-scroll-listener.js +30 -38
- package/dist/utils/floating-components.js +107 -358
- package/dist/utils/form-components.js +34 -60
- package/dist/utils/index.js +49 -167
- package/dist/utils/navigation.js +68 -135
- package/dist/utils/react.js +10 -15
- package/package.json +11 -8
- package/dist/components/accordion/index.js +0 -1
- package/dist/components/accordion-item/index.js +0 -1
- package/dist/components/accordion-item/model.js +0 -1
- package/dist/components/badge/index.js +0 -1
- package/dist/components/brand/index.js +0 -1
- package/dist/components/brand/model.js +0 -1
- package/dist/components/button/index.js +0 -1
- package/dist/components/card/index.js +0 -1
- package/dist/components/checkbox/index.js +0 -1
- package/dist/components/checkbox/model.js +0 -1
- package/dist/components/custom-button/index.js +0 -1
- package/dist/components/custom-button/model.js +0 -1
- package/dist/components/custom-select/index.js +0 -1
- package/dist/components/custom-select-dropdown/index.js +0 -1
- package/dist/components/custom-select-form-field/index.js +0 -1
- package/dist/components/custom-select-form-field/model.js +0 -1
- package/dist/components/custom-select-list/index.js +0 -1
- package/dist/components/custom-select-list/model.js +0 -1
- package/dist/components/custom-select-list-item/index.js +0 -1
- package/dist/components/divider/index.js +0 -1
- package/dist/components/drawer/index.js +0 -1
- package/dist/components/header/index.js +0 -1
- package/dist/components/header/model.js +0 -1
- package/dist/components/icon/index.js +0 -1
- package/dist/components/infotext/index.js +0 -1
- package/dist/components/infotext/model.js +0 -1
- package/dist/components/input/index.js +0 -1
- package/dist/components/link/index.js +0 -1
- package/dist/components/navigation/index.js +0 -1
- package/dist/components/navigation/model.js +0 -1
- package/dist/components/navigation-item/index.js +0 -1
- package/dist/components/navigation-item/model.js +0 -1
- package/dist/components/notification/index.js +0 -1
- package/dist/components/page/index.js +0 -1
- package/dist/components/popover/index.js +0 -1
- package/dist/components/popover/model.js +0 -1
- package/dist/components/radio/index.js +0 -1
- package/dist/components/radio/model.js +0 -1
- package/dist/components/section/index.js +0 -1
- package/dist/components/section/model.js +0 -1
- package/dist/components/select/index.js +0 -1
- package/dist/components/select/model.js +0 -1
- package/dist/components/stack/index.js +0 -1
- package/dist/components/switch/index.js +0 -1
- package/dist/components/switch/model.js +0 -1
- package/dist/components/tab-item/index.js +0 -1
- package/dist/components/tab-item/model.js +0 -1
- package/dist/components/tab-list/index.js +0 -1
- package/dist/components/tab-list/model.js +0 -1
- package/dist/components/tab-panel/index.js +0 -1
- package/dist/components/tab-panel/model.js +0 -1
- package/dist/components/tabs/index.js +0 -1
- package/dist/components/tag/index.js +0 -1
- package/dist/components/textarea/index.js +0 -1
- package/dist/components/tooltip/index.js +0 -1
- package/dist/shared/examples/index.js +0 -4
- package/dist/shared/figma.js +0 -1
- package/dist/shared/showcase/show-code-link.js +0 -51
|
@@ -1,152 +1,184 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
function
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
2
|
+
import { filterPassingProps as e, getRootProps as t } from "../../utils/react.js";
|
|
3
|
+
import { cls as n, delay as r, getBoolean as i, getBooleanAsString as a, getHideProp as o, hasVoiceOver as s, stringPropVisible as c } from "../../utils/index.js";
|
|
4
|
+
import { DEFAULT_INVALID_MESSAGE_ID_SUFFIX as l, DEFAULT_MESSAGE_ID_SUFFIX as u, DEFAULT_VALID_MESSAGE_ID_SUFFIX as d } from "../../shared/constants.js";
|
|
5
|
+
import { addCheckedResetEventListener as f } from "../../utils/form-components.js";
|
|
6
|
+
import p from "../infotext/infotext.js";
|
|
7
|
+
import { forwardRef as m, useEffect as h, useId as g, useRef as _, useState as v } from "react";
|
|
8
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/switch/switch.tsx
|
|
10
|
+
function S(m, S) {
|
|
11
|
+
let C = g(), w = S || _(S), [T, E] = v(() => void 0), [D, O] = v(() => void 0), [k, A] = v(() => void 0), [j, M] = v(() => void 0), [N, P] = v(() => void 0), [F, I] = v(() => void 0), [L, R] = v(() => ""), [z, B] = v(() => void 0);
|
|
12
|
+
function V() {
|
|
13
|
+
return !!(m.validMessage ?? m.validation === "valid");
|
|
14
|
+
}
|
|
15
|
+
function H() {
|
|
16
|
+
if (!w.current?.validity?.valid || m.validation === "invalid") {
|
|
17
|
+
I(j), P(m.invalidMessage || w.current?.validationMessage || "TODO: Add an invalidMessage"), s() && (R(N || "TODO: Add an invalidMessage"), r(() => {
|
|
18
|
+
R("");
|
|
19
|
+
}, 1e3));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (V() && w.current?.validity?.valid && m.required) {
|
|
23
|
+
I(k), s() && (R(m.validMessage ?? "TODO: Add a validMessage"), r(() => {
|
|
24
|
+
R("");
|
|
25
|
+
}, 1e3));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (c(m.message, m.showMessage)) {
|
|
29
|
+
I(D);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
I(void 0);
|
|
33
|
+
}
|
|
34
|
+
function U(e, t) {
|
|
35
|
+
m.onChange && m.onChange(e), H();
|
|
36
|
+
}
|
|
37
|
+
function W(e) {
|
|
38
|
+
m.onBlur && m.onBlur(e);
|
|
39
|
+
}
|
|
40
|
+
function G(e) {
|
|
41
|
+
m.onFocus && m.onFocus(e);
|
|
42
|
+
}
|
|
43
|
+
function K(e) {
|
|
44
|
+
e.key === "Enter" && (e.preventDefault(), m.disabled || w.current?.click());
|
|
45
|
+
}
|
|
46
|
+
function q() {
|
|
47
|
+
let e = m.id ?? m.propOverrides?.id ?? `switch-${C}`;
|
|
48
|
+
E(e), O(`${e}${u}`), A(`${e}${d}`), M(`${e}${l}`);
|
|
49
|
+
}
|
|
50
|
+
return h(() => {
|
|
51
|
+
q(), H(), P(m.invalidMessage || "TODO: Add an invalidMessage");
|
|
52
|
+
}, []), h(() => {
|
|
53
|
+
(m.id ?? m.propOverrides?.id) && q();
|
|
54
|
+
}, [m.id, m.propOverrides?.id]), h(() => {
|
|
55
|
+
H();
|
|
56
|
+
}, [
|
|
57
|
+
m.validation,
|
|
58
|
+
m.required,
|
|
59
|
+
m.message,
|
|
60
|
+
m.showMessage,
|
|
61
|
+
m.validMessage,
|
|
62
|
+
m.invalidMessage,
|
|
63
|
+
m.checked
|
|
64
|
+
]), h(() => {
|
|
65
|
+
P(m.invalidMessage || w.current?.validationMessage || "TODO: Add an invalidMessage");
|
|
66
|
+
}, [w.current, m.invalidMessage]), h(() => {
|
|
67
|
+
if (w.current) {
|
|
68
|
+
let e = m.defaultChecked, t = z;
|
|
69
|
+
t || (t = new AbortController(), B(t)), f(w.current, {
|
|
70
|
+
checked: m.checked,
|
|
71
|
+
defaultChecked: e
|
|
72
|
+
}, (e) => {
|
|
73
|
+
U(e, !0);
|
|
74
|
+
}, t.signal);
|
|
75
|
+
}
|
|
76
|
+
}, [w.current]), h(() => () => {
|
|
77
|
+
z?.abort();
|
|
78
|
+
}, []), /* @__PURE__ */ x("div", {
|
|
79
|
+
"data-visual-aid": a(m.visualAid),
|
|
80
|
+
"data-size": m.size,
|
|
81
|
+
"data-hide-label": o(m.showLabel),
|
|
82
|
+
"data-variant": m.variant,
|
|
83
|
+
"data-hide-asterisk": o(m.showRequiredAsterisk),
|
|
84
|
+
"data-custom-validity": m.validation,
|
|
85
|
+
...t(m, [
|
|
86
|
+
"data-icon-variant",
|
|
87
|
+
"data-icon-variant-before",
|
|
88
|
+
"data-icon-variant-after",
|
|
89
|
+
"data-icon-weight",
|
|
90
|
+
"data-icon-weight-before",
|
|
91
|
+
"data-icon-weight-after",
|
|
92
|
+
"data-interactive",
|
|
93
|
+
"data-force-mobile",
|
|
94
|
+
"data-color",
|
|
95
|
+
"data-container-color",
|
|
96
|
+
"data-bg-color",
|
|
97
|
+
"data-on-bg-color",
|
|
98
|
+
"data-color-scheme",
|
|
99
|
+
"data-font-size",
|
|
100
|
+
"data-headline-size",
|
|
101
|
+
"data-divider",
|
|
102
|
+
"data-focus",
|
|
103
|
+
"data-font",
|
|
104
|
+
"data-density"
|
|
105
|
+
]),
|
|
106
|
+
className: n("db-switch", m.className),
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ x("label", {
|
|
109
|
+
htmlFor: T,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ b("input", {
|
|
112
|
+
type: "checkbox",
|
|
113
|
+
role: "switch",
|
|
114
|
+
id: T,
|
|
115
|
+
ref: w,
|
|
116
|
+
...e(m, [
|
|
117
|
+
"data-icon-variant",
|
|
118
|
+
"data-icon-variant-before",
|
|
119
|
+
"data-icon-variant-after",
|
|
120
|
+
"data-icon-weight",
|
|
121
|
+
"data-icon-weight-before",
|
|
122
|
+
"data-icon-weight-after",
|
|
123
|
+
"data-interactive",
|
|
124
|
+
"data-force-mobile",
|
|
125
|
+
"data-color",
|
|
126
|
+
"data-container-color",
|
|
127
|
+
"data-bg-color",
|
|
128
|
+
"data-on-bg-color",
|
|
129
|
+
"data-color-scheme",
|
|
130
|
+
"data-font-size",
|
|
131
|
+
"data-headline-size",
|
|
132
|
+
"data-divider",
|
|
133
|
+
"data-focus",
|
|
134
|
+
"data-font",
|
|
135
|
+
"data-density"
|
|
136
|
+
]),
|
|
137
|
+
checked: i(m.checked, "checked"),
|
|
138
|
+
value: m.value,
|
|
139
|
+
disabled: i(m.disabled, "disabled"),
|
|
140
|
+
"aria-invalid": m.validation === "invalid" ? "true" : void 0,
|
|
141
|
+
"aria-describedby": F,
|
|
142
|
+
name: m.name,
|
|
143
|
+
required: i(m.required, "required"),
|
|
144
|
+
"data-aid-icon": m.iconLeading ?? m.icon,
|
|
145
|
+
"data-aid-icon-trailing": m.iconTrailing,
|
|
146
|
+
onChange: (e) => U(e),
|
|
147
|
+
onBlur: (e) => W(e),
|
|
148
|
+
onFocus: (e) => G(e),
|
|
149
|
+
onKeyDown: (e) => K(e)
|
|
150
|
+
}),
|
|
151
|
+
m.label ? /* @__PURE__ */ b(y, { children: m.label }) : null,
|
|
152
|
+
m.children
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
c(m.message, m.showMessage) ? /* @__PURE__ */ b(p, {
|
|
156
|
+
size: "small",
|
|
157
|
+
semantic: "adaptive",
|
|
158
|
+
id: D,
|
|
159
|
+
icon: m.messageIcon,
|
|
160
|
+
children: m.message
|
|
161
|
+
}) : null,
|
|
162
|
+
V() ? /* @__PURE__ */ b(p, {
|
|
163
|
+
size: "small",
|
|
164
|
+
semantic: "successful",
|
|
165
|
+
id: k,
|
|
166
|
+
children: m.validMessage ?? "TODO: Add a validMessage"
|
|
167
|
+
}) : null,
|
|
168
|
+
/* @__PURE__ */ b(p, {
|
|
169
|
+
size: "small",
|
|
170
|
+
semantic: "critical",
|
|
171
|
+
id: j,
|
|
172
|
+
children: N
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ b("span", {
|
|
175
|
+
"data-visually-hidden": "true",
|
|
176
|
+
role: "status",
|
|
177
|
+
children: L
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
150
181
|
}
|
|
151
|
-
|
|
152
|
-
|
|
182
|
+
var C = m(S);
|
|
183
|
+
//#endregion
|
|
184
|
+
export { C as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActiveProps, ChangeEventProps, ChangeEventState, GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, InitializedState, NameProps, NameState, ShowIconLeadingProps, ShowIconProps, ShowIconTrailingProps } from '../../shared/model';
|
|
1
|
+
import type { ActiveProps, ChangeEventProps, ChangeEventState, GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, InitializedState, NameProps, NameState, ShowIconLeadingProps, ShowIconProps, ShowIconTrailingProps } from '../../shared/model';
|
|
2
2
|
export type DBTabItemDefaultProps = {
|
|
3
3
|
/**
|
|
4
4
|
* To control the component
|
|
@@ -1,78 +1,107 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
2
|
+
import { filterPassingProps as e, getRootProps as t } from "../../utils/react.js";
|
|
3
|
+
import { cls as n, getBoolean as r, getBooleanAsString as i } from "../../utils/index.js";
|
|
4
|
+
import { forwardRef as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
5
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/tab-item/tab-item.tsx
|
|
7
|
+
function f(a, f) {
|
|
8
|
+
let p = f || s(f), [m, h] = c(() => !1), [g, _] = c(() => void 0), [v, y] = c(() => !1), [b, x] = c(() => !1), [S, C] = c(() => void 0);
|
|
9
|
+
function w(e) {
|
|
10
|
+
e.stopPropagation(), h(e.target === p.current);
|
|
11
|
+
}
|
|
12
|
+
function T() {
|
|
13
|
+
if (p.current) {
|
|
14
|
+
let e = p.current.setAttribute;
|
|
15
|
+
p.current.setAttribute = (t, n) => {
|
|
16
|
+
e.call(p.current, t, n), t === "name" && _(n);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function E(e) {
|
|
21
|
+
a.onChange && a.onChange(e);
|
|
22
|
+
}
|
|
23
|
+
return o(() => {
|
|
24
|
+
C(() => w), y(!0);
|
|
25
|
+
}, []), o(() => {
|
|
26
|
+
p.current && v && S && (T(), y(!1), b || (p.current.closest("[role=tablist]")?.addEventListener("change", S), x(!0)), (a.active || p.current.checked) && (h(!0), p.current.click()));
|
|
27
|
+
}, [
|
|
28
|
+
p.current,
|
|
29
|
+
v,
|
|
30
|
+
S
|
|
31
|
+
]), o(() => {
|
|
32
|
+
a.name && _(a.name);
|
|
33
|
+
}, [a.name]), o(() => () => {
|
|
34
|
+
b && p.current && S && (p.current.closest("[role=tablist]")?.removeEventListener("change", S), x(!1));
|
|
35
|
+
}, []), /* @__PURE__ */ u("li", {
|
|
36
|
+
role: "none",
|
|
37
|
+
...t(a, [
|
|
38
|
+
"data-icon-variant",
|
|
39
|
+
"data-icon-variant-before",
|
|
40
|
+
"data-icon-variant-after",
|
|
41
|
+
"data-icon-weight",
|
|
42
|
+
"data-icon-weight-before",
|
|
43
|
+
"data-icon-weight-after",
|
|
44
|
+
"data-interactive",
|
|
45
|
+
"data-force-mobile",
|
|
46
|
+
"data-color",
|
|
47
|
+
"data-container-color",
|
|
48
|
+
"data-bg-color",
|
|
49
|
+
"data-on-bg-color",
|
|
50
|
+
"data-color-scheme",
|
|
51
|
+
"data-font-size",
|
|
52
|
+
"data-headline-size",
|
|
53
|
+
"data-divider",
|
|
54
|
+
"data-focus",
|
|
55
|
+
"data-font",
|
|
56
|
+
"data-density"
|
|
57
|
+
]),
|
|
58
|
+
className: n("db-tab-item", a.className),
|
|
59
|
+
children: /* @__PURE__ */ d("label", {
|
|
60
|
+
htmlFor: a.id ?? a.propOverrides?.id,
|
|
61
|
+
"data-icon": a.iconLeading ?? a.icon,
|
|
62
|
+
"data-icon-trailing": a.iconTrailing,
|
|
63
|
+
"data-show-icon": i(a.showIconLeading ?? a.showIcon),
|
|
64
|
+
"data-show-icon-trailing": i(a.showIconTrailing),
|
|
65
|
+
"data-no-text": i(a.noText),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ u("input", {
|
|
68
|
+
type: "radio",
|
|
69
|
+
role: "tab",
|
|
70
|
+
disabled: r(a.disabled, "disabled"),
|
|
71
|
+
"aria-selected": m,
|
|
72
|
+
checked: r(a.checked, "checked"),
|
|
73
|
+
ref: p,
|
|
74
|
+
...e(a, [
|
|
75
|
+
"data-icon-variant",
|
|
76
|
+
"data-icon-variant-before",
|
|
77
|
+
"data-icon-variant-after",
|
|
78
|
+
"data-icon-weight",
|
|
79
|
+
"data-icon-weight-before",
|
|
80
|
+
"data-icon-weight-after",
|
|
81
|
+
"data-interactive",
|
|
82
|
+
"data-force-mobile",
|
|
83
|
+
"data-color",
|
|
84
|
+
"data-container-color",
|
|
85
|
+
"data-bg-color",
|
|
86
|
+
"data-on-bg-color",
|
|
87
|
+
"data-color-scheme",
|
|
88
|
+
"data-font-size",
|
|
89
|
+
"data-headline-size",
|
|
90
|
+
"data-divider",
|
|
91
|
+
"data-focus",
|
|
92
|
+
"data-font",
|
|
93
|
+
"data-density"
|
|
94
|
+
]),
|
|
95
|
+
name: g,
|
|
96
|
+
id: a.id ?? a.propOverrides?.id,
|
|
97
|
+
onInput: (e) => E(e)
|
|
98
|
+
}),
|
|
99
|
+
a.label ? /* @__PURE__ */ u(l, { children: a.label }) : null,
|
|
100
|
+
a.children
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
});
|
|
76
104
|
}
|
|
77
|
-
|
|
78
|
-
|
|
105
|
+
var p = a(f);
|
|
106
|
+
//#endregion
|
|
107
|
+
export { p as default };
|
|
@@ -1,13 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { filterPassingProps as e, getRootProps as t } from "../../utils/react.js";
|
|
3
|
+
import { cls as n } from "../../utils/index.js";
|
|
4
|
+
import { forwardRef as r, useRef as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/tab-list/tab-list.tsx
|
|
7
|
+
function o(r, o) {
|
|
8
|
+
return /* @__PURE__ */ a("div", {
|
|
9
|
+
ref: o || i(o),
|
|
10
|
+
...e(r, [
|
|
11
|
+
"data-icon-variant",
|
|
12
|
+
"data-icon-variant-before",
|
|
13
|
+
"data-icon-variant-after",
|
|
14
|
+
"data-icon-weight",
|
|
15
|
+
"data-icon-weight-before",
|
|
16
|
+
"data-icon-weight-after",
|
|
17
|
+
"data-interactive",
|
|
18
|
+
"data-force-mobile",
|
|
19
|
+
"data-color",
|
|
20
|
+
"data-container-color",
|
|
21
|
+
"data-bg-color",
|
|
22
|
+
"data-on-bg-color",
|
|
23
|
+
"data-color-scheme",
|
|
24
|
+
"data-font-size",
|
|
25
|
+
"data-headline-size",
|
|
26
|
+
"data-divider",
|
|
27
|
+
"data-focus",
|
|
28
|
+
"data-font",
|
|
29
|
+
"data-density"
|
|
30
|
+
]),
|
|
31
|
+
id: r.id ?? r.propOverrides?.id,
|
|
32
|
+
...t(r, [
|
|
33
|
+
"data-icon-variant",
|
|
34
|
+
"data-icon-variant-before",
|
|
35
|
+
"data-icon-variant-after",
|
|
36
|
+
"data-icon-weight",
|
|
37
|
+
"data-icon-weight-before",
|
|
38
|
+
"data-icon-weight-after",
|
|
39
|
+
"data-interactive",
|
|
40
|
+
"data-force-mobile",
|
|
41
|
+
"data-color",
|
|
42
|
+
"data-container-color",
|
|
43
|
+
"data-bg-color",
|
|
44
|
+
"data-on-bg-color",
|
|
45
|
+
"data-color-scheme",
|
|
46
|
+
"data-font-size",
|
|
47
|
+
"data-headline-size",
|
|
48
|
+
"data-divider",
|
|
49
|
+
"data-focus",
|
|
50
|
+
"data-font",
|
|
51
|
+
"data-density"
|
|
52
|
+
]),
|
|
53
|
+
className: n("db-tab-list", r.className),
|
|
54
|
+
children: /* @__PURE__ */ a("ul", {
|
|
55
|
+
role: "tablist",
|
|
56
|
+
children: r.children
|
|
57
|
+
})
|
|
58
|
+
});
|
|
11
59
|
}
|
|
12
|
-
|
|
13
|
-
|
|
60
|
+
var s = r(o);
|
|
61
|
+
//#endregion
|
|
62
|
+
export { s as default };
|