@db-ux/react-core-components 4.9.1 → 4.10.0-esm-f121fc3
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 +9 -2
- package/README.md +97 -35
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.js +102 -86
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/model.d.ts +1 -1
- package/dist/components/accordion/model.js +4 -2
- package/dist/components/accordion-item/accordion-item.d.ts +3 -2
- package/dist/components/accordion-item/accordion-item.js +89 -56
- package/dist/components/accordion-item/index.d.ts +1 -1
- package/dist/components/accordion-item/model.d.ts +5 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.js +72 -32
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/badge/model.d.ts +1 -1
- package/dist/components/badge/model.js +12 -1
- package/dist/components/brand/brand.d.ts +1 -1
- package/dist/components/brand/brand.js +60 -13
- package/dist/components/brand/index.d.ts +1 -1
- package/dist/components/brand/model.d.ts +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +75 -21
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/model.d.ts +1 -1
- package/dist/components/button/model.js +13 -2
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/card/card.js +65 -15
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/model.d.ts +1 -1
- package/dist/components/card/model.js +8 -2
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +163 -157
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/model.d.ts +1 -1
- package/dist/components/custom-button/custom-button.d.ts +1 -1
- package/dist/components/custom-button/custom-button.js +65 -10
- package/dist/components/custom-button/index.d.ts +1 -1
- package/dist/components/custom-button/model.d.ts +2 -2
- package/dist/components/custom-select/custom-select.d.ts +1 -1
- package/dist/components/custom-select/custom-select.js +509 -727
- package/dist/components/custom-select/index.d.ts +1 -1
- package/dist/components/custom-select/model.d.ts +3 -3
- package/dist/components/custom-select/model.js +8 -1
- package/dist/components/custom-select-dropdown/custom-select-dropdown.d.ts +1 -1
- package/dist/components/custom-select-dropdown/custom-select-dropdown.js +62 -11
- package/dist/components/custom-select-dropdown/index.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/components/custom-select-form-field/custom-select-form-field.js +57 -10
- package/dist/components/custom-select-form-field/index.d.ts +1 -1
- package/dist/components/custom-select-form-field/model.d.ts +1 -1
- package/dist/components/custom-select-list/custom-select-list.d.ts +1 -1
- package/dist/components/custom-select-list/custom-select-list.js +60 -11
- package/dist/components/custom-select-list/index.d.ts +1 -1
- package/dist/components/custom-select-list/model.d.ts +1 -1
- package/dist/components/custom-select-list-item/custom-select-list-item.d.ts +2 -2
- package/dist/components/custom-select-list-item/custom-select-list-item.js +89 -32
- package/dist/components/custom-select-list-item/index.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/components/divider/divider.js +60 -10
- package/dist/components/divider/index.d.ts +1 -1
- package/dist/components/divider/model.d.ts +1 -1
- package/dist/components/divider/model.js +4 -2
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.js +118 -97
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/model.d.ts +1 -1
- package/dist/components/drawer/model.js +14 -4
- package/dist/components/header/header.d.ts +1 -1
- package/dist/components/header/header.js +143 -65
- package/dist/components/header/index.d.ts +1 -1
- package/dist/components/header/model.d.ts +1 -1
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icon.js +61 -12
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/model.d.ts +1 -1
- package/dist/components/icon/model.js +11 -1
- package/dist/components/infotext/index.d.ts +1 -1
- package/dist/components/infotext/infotext.d.ts +1 -1
- package/dist/components/infotext/infotext.js +62 -12
- package/dist/components/infotext/model.d.ts +1 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/input.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/index.d.ts +1 -1
- package/dist/components/link/link.d.ts +1 -1
- 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/index.d.ts +1 -1
- package/dist/components/navigation/model.d.ts +1 -1
- package/dist/components/navigation/navigation.d.ts +1 -1
- package/dist/components/navigation/navigation.js +57 -11
- package/dist/components/navigation-item/index.d.ts +1 -1
- package/dist/components/navigation-item/model.d.ts +6 -2
- package/dist/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/components/navigation-item/navigation-item.js +117 -81
- package/dist/components/notification/index.d.ts +1 -1
- package/dist/components/notification/model.d.ts +1 -1
- package/dist/components/notification/model.js +12 -3
- package/dist/components/notification/notification.d.ts +2 -2
- package/dist/components/notification/notification.js +100 -32
- package/dist/components/page/index.d.ts +1 -1
- package/dist/components/page/model.d.ts +1 -1
- package/dist/components/page/model.js +4 -2
- package/dist/components/page/page.d.ts +1 -1
- package/dist/components/page/page.js +74 -46
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/model.d.ts +1 -1
- package/dist/components/popover/popover.d.ts +1 -1
- package/dist/components/popover/popover.js +126 -125
- package/dist/components/radio/index.d.ts +1 -1
- package/dist/components/radio/model.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +124 -85
- package/dist/components/section/index.d.ts +1 -1
- package/dist/components/section/model.d.ts +1 -1
- package/dist/components/section/section.d.ts +1 -1
- package/dist/components/section/section.js +59 -10
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/model.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.js +188 -191
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/model.d.ts +1 -1
- package/dist/components/stack/model.js +14 -4
- package/dist/components/stack/stack.d.ts +1 -1
- package/dist/components/stack/stack.js +63 -10
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/model.d.ts +1 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +182 -150
- package/dist/components/tab-item/index.d.ts +1 -1
- package/dist/components/tab-item/model.d.ts +1 -1
- package/dist/components/tab-item/tab-item.d.ts +1 -1
- package/dist/components/tab-item/tab-item.js +105 -76
- package/dist/components/tab-list/index.d.ts +1 -1
- package/dist/components/tab-list/model.d.ts +1 -1
- package/dist/components/tab-list/tab-list.d.ts +1 -1
- package/dist/components/tab-list/tab-list.js +60 -11
- package/dist/components/tab-panel/index.d.ts +1 -1
- package/dist/components/tab-panel/model.d.ts +1 -1
- package/dist/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist/components/tab-panel/tab-panel.js +59 -13
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/model.d.ts +1 -1
- package/dist/components/tabs/model.js +4 -2
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.js +191 -178
- package/dist/components/tag/index.d.ts +1 -1
- package/dist/components/tag/model.d.ts +1 -1
- package/dist/components/tag/model.js +4 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/tag/tag.js +91 -32
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/textarea/model.d.ts +1 -1
- package/dist/components/textarea/model.js +13 -2
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/textarea.js +165 -150
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/model.d.ts +1 -1
- package/dist/components/tooltip/model.js +4 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.js +119 -115
- package/dist/index.d.ts +26 -26
- 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.d.ts +1 -1
- package/dist/utils/index.js +49 -167
- package/dist/utils/navigation.js +68 -135
- package/dist/utils/react.js +10 -15
- package/package.json +13 -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,159 +1,165 @@
|
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
2
|
+
import { filterPassingProps as e, getRootProps as t } from "../../utils/react.js";
|
|
3
|
+
import { cls as n, delay as r, getBoolean as i, getHideProp as a, hasVoiceOver as o, stringPropVisible as s } from "../../utils/index.js";
|
|
4
|
+
import { DEFAULT_INVALID_MESSAGE_ID_SUFFIX as c, DEFAULT_MESSAGE_ID_SUFFIX as l, DEFAULT_VALID_MESSAGE_ID_SUFFIX as u } from "../../shared/constants.js";
|
|
5
|
+
import { addCheckedResetEventListener as d } from "../../utils/form-components.js";
|
|
6
|
+
import f from "../infotext/infotext.js";
|
|
7
|
+
import { forwardRef as p, useEffect as m, useId as h, useRef as g, useState as _ } from "react";
|
|
8
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/checkbox/checkbox.tsx
|
|
10
|
+
function x(p, x) {
|
|
11
|
+
let S = h(), C = x || g(x), [w, T] = _(() => !1), [E, D] = _(() => void 0), [O, k] = _(() => void 0), [A, j] = _(() => void 0), [M, N] = _(() => void 0), [P, F] = _(() => void 0), [I, L] = _(() => void 0), [R, z] = _(() => ""), [B, V] = _(() => void 0);
|
|
12
|
+
function H() {
|
|
13
|
+
return !!(p.validMessage ?? p.validation === "valid");
|
|
14
|
+
}
|
|
15
|
+
function U() {
|
|
16
|
+
!C.current?.validity.valid || p.validation === "invalid" ? (L(M), F(p.invalidMessage || C.current?.validationMessage || "TODO: Add an invalidMessage"), o() && (z(P), r(() => z(""), 1e3))) : H() && C.current?.validity.valid && p.required ? (L(A), o() && (z(p.validMessage ?? "TODO: Add a validMessage"), r(() => z(""), 1e3))) : s(p.message, p.showMessage) ? L(O) : L(void 0);
|
|
17
|
+
}
|
|
18
|
+
function W(e, t) {
|
|
19
|
+
p.onChange && p.onChange(e), U();
|
|
20
|
+
}
|
|
21
|
+
function G(e) {
|
|
22
|
+
p.onBlur && p.onBlur(e);
|
|
23
|
+
}
|
|
24
|
+
function K(e) {
|
|
25
|
+
p.onFocus && p.onFocus(e);
|
|
26
|
+
}
|
|
27
|
+
function q() {
|
|
28
|
+
let e = p.id ?? p.propOverrides?.id ?? `checkbox-${S}`;
|
|
29
|
+
D(e), k(e + l), j(e + u), N(e + c);
|
|
30
|
+
}
|
|
31
|
+
return m(() => {
|
|
32
|
+
T(!0), q(), F(p.invalidMessage || "TODO: Add an invalidMessage");
|
|
33
|
+
}, []), m(() => {
|
|
34
|
+
(p.id ?? p.propOverrides?.id) && q();
|
|
35
|
+
}, [p.id, p.propOverrides?.id]), m(() => {
|
|
36
|
+
F(p.invalidMessage || C.current?.validationMessage || "TODO: Add an invalidMessage");
|
|
37
|
+
}, [C.current, p.invalidMessage]), m(() => {
|
|
38
|
+
if (E) {
|
|
39
|
+
let e = E + l;
|
|
40
|
+
k(e), j(E + u), N(E + c), s(p.message, p.showMessage) && L(e), U();
|
|
41
|
+
}
|
|
42
|
+
}, [E]), m(() => {
|
|
43
|
+
C.current && p.indeterminate !== void 0 && (C.current.indeterminate = !!i(p.indeterminate));
|
|
44
|
+
}, [
|
|
45
|
+
w,
|
|
46
|
+
C.current,
|
|
47
|
+
p.indeterminate
|
|
48
|
+
]), m(() => {
|
|
49
|
+
w && C.current && (p.checked != null && (C.current.checked = !!i(p.checked)), T(!1));
|
|
50
|
+
}, [
|
|
51
|
+
w,
|
|
52
|
+
C.current,
|
|
53
|
+
p.checked
|
|
54
|
+
]), m(() => {
|
|
55
|
+
if (C.current) {
|
|
56
|
+
let e = p.defaultChecked, t = B;
|
|
57
|
+
t || (t = new AbortController(), V(t)), d(C.current, {
|
|
58
|
+
checked: p.checked,
|
|
59
|
+
defaultChecked: e
|
|
60
|
+
}, (e) => {
|
|
61
|
+
W(e, !0);
|
|
62
|
+
}, t.signal);
|
|
63
|
+
}
|
|
64
|
+
}, [C.current]), m(() => () => {
|
|
65
|
+
B?.abort();
|
|
66
|
+
}, []), /* @__PURE__ */ b("div", {
|
|
67
|
+
...t(p, [
|
|
68
|
+
"data-icon-variant",
|
|
69
|
+
"data-icon-variant-before",
|
|
70
|
+
"data-icon-variant-after",
|
|
71
|
+
"data-icon-weight",
|
|
72
|
+
"data-icon-weight-before",
|
|
73
|
+
"data-icon-weight-after",
|
|
74
|
+
"data-interactive",
|
|
75
|
+
"data-force-mobile",
|
|
76
|
+
"data-color",
|
|
77
|
+
"data-container-color",
|
|
78
|
+
"data-bg-color",
|
|
79
|
+
"data-on-bg-color",
|
|
80
|
+
"data-color-scheme",
|
|
81
|
+
"data-font-size",
|
|
82
|
+
"data-headline-size",
|
|
83
|
+
"data-divider",
|
|
84
|
+
"data-focus",
|
|
85
|
+
"data-font",
|
|
86
|
+
"data-density"
|
|
87
|
+
]),
|
|
88
|
+
className: n("db-checkbox", p.className),
|
|
89
|
+
"data-size": p.size,
|
|
90
|
+
"data-hide-asterisk": a(p.showRequiredAsterisk),
|
|
91
|
+
"data-hide-label": a(p.showLabel),
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ b("label", {
|
|
94
|
+
htmlFor: E,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ y("input", {
|
|
97
|
+
type: "checkbox",
|
|
98
|
+
"aria-invalid": p.validation === "invalid",
|
|
99
|
+
"data-custom-validity": p.validation,
|
|
100
|
+
ref: C,
|
|
101
|
+
...e(p, [
|
|
102
|
+
"data-icon-variant",
|
|
103
|
+
"data-icon-variant-before",
|
|
104
|
+
"data-icon-variant-after",
|
|
105
|
+
"data-icon-weight",
|
|
106
|
+
"data-icon-weight-before",
|
|
107
|
+
"data-icon-weight-after",
|
|
108
|
+
"data-interactive",
|
|
109
|
+
"data-force-mobile",
|
|
110
|
+
"data-color",
|
|
111
|
+
"data-container-color",
|
|
112
|
+
"data-bg-color",
|
|
113
|
+
"data-on-bg-color",
|
|
114
|
+
"data-color-scheme",
|
|
115
|
+
"data-font-size",
|
|
116
|
+
"data-headline-size",
|
|
117
|
+
"data-divider",
|
|
118
|
+
"data-focus",
|
|
119
|
+
"data-font",
|
|
120
|
+
"data-density"
|
|
121
|
+
]),
|
|
122
|
+
id: E,
|
|
123
|
+
name: p.name,
|
|
124
|
+
checked: i(p.checked, "checked"),
|
|
125
|
+
disabled: i(p.disabled, "disabled"),
|
|
126
|
+
value: p.value,
|
|
127
|
+
required: i(p.required, "required"),
|
|
128
|
+
onChange: (e) => W(e),
|
|
129
|
+
onBlur: (e) => G(e),
|
|
130
|
+
onFocus: (e) => K(e),
|
|
131
|
+
"aria-describedby": p.ariaDescribedBy ?? I
|
|
132
|
+
}),
|
|
133
|
+
p.label ? /* @__PURE__ */ y(v, { children: p.label }) : null,
|
|
134
|
+
p.children
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
s(p.message, p.showMessage) ? /* @__PURE__ */ y(f, {
|
|
138
|
+
size: "small",
|
|
139
|
+
icon: p.messageIcon,
|
|
140
|
+
id: O,
|
|
141
|
+
children: p.message
|
|
142
|
+
}) : null,
|
|
143
|
+
H() ? /* @__PURE__ */ y(f, {
|
|
144
|
+
size: "small",
|
|
145
|
+
semantic: "successful",
|
|
146
|
+
id: A,
|
|
147
|
+
children: p.validMessage || "TODO: Add a validMessage"
|
|
148
|
+
}) : null,
|
|
149
|
+
/* @__PURE__ */ y(f, {
|
|
150
|
+
size: "small",
|
|
151
|
+
semantic: "critical",
|
|
152
|
+
id: M,
|
|
153
|
+
children: P
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ y("span", {
|
|
156
|
+
"data-visually-hidden": "true",
|
|
157
|
+
role: "status",
|
|
158
|
+
children: R
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
});
|
|
157
162
|
}
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
var S = p(x);
|
|
164
|
+
//#endregion
|
|
165
|
+
export { S as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DBCheckbox } from './checkbox';
|
|
1
|
+
export { default as DBCheckbox } from './checkbox.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChangeEventProps, ChangeEventState, FocusEventProps, FocusEventState, FormCheckProps, FormMessageProps, FormProps, FormState, FromValidState, GlobalProps, GlobalState, InitializedState, SizeProps } from '../../shared/model';
|
|
1
|
+
import type { ChangeEventProps, ChangeEventState, FocusEventProps, FocusEventState, FormCheckProps, FormMessageProps, FormProps, FormState, FromValidState, GlobalProps, GlobalState, InitializedState, SizeProps } from '../../shared/model.js';
|
|
2
2
|
export type DBCheckboxDefaultProps = {
|
|
3
3
|
/**
|
|
4
4
|
* Define an [indeterminate](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#indeterminate) state of a checkbox
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBCustomButton: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, keyof import("
|
|
2
|
+
declare const DBCustomButton: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, keyof import("../../index.js").GlobalProps | "variant" | "size" | "wrap" | "icon" | "showIcon" | "width" | "showIconLeading" | "showIconTrailing" | "iconLeading" | "iconTrailing" | "noText"> & import("../../index.js").DBButtonSharedProps & import("../../index.js").GlobalProps & import("../../index.js").IconProps & import("../../index.js").WidthProps & import("../../index.js").SizeProps & import("../../index.js").ShowIconProps & import("../../index.js").ShowIconLeadingProps & import("../../index.js").ShowIconTrailingProps & import("../../index.js").IconLeadingProps & import("../../index.js").IconTrailingProps & import("../../index.js").NoTextProps & import("../../index.js").WrapProps & React.RefAttributes<HTMLDivElement>>;
|
|
3
3
|
export default DBCustomButton;
|
|
@@ -1,12 +1,67 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { filterPassingProps as e, getRootProps as t } from "../../utils/react.js";
|
|
3
|
+
import { cls as n, getBooleanAsString as r } from "../../utils/index.js";
|
|
4
|
+
import { forwardRef as i, useRef as a } from "react";
|
|
5
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/custom-button/custom-button.tsx
|
|
7
|
+
function s(i, s) {
|
|
8
|
+
return /* @__PURE__ */ o("div", {
|
|
9
|
+
ref: s || a(s),
|
|
10
|
+
...e(i, [
|
|
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: i.id ?? i.propOverrides?.id,
|
|
32
|
+
...t(i, [
|
|
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-custom-button", i.className),
|
|
54
|
+
"data-icon": i.iconLeading ?? i.icon,
|
|
55
|
+
"data-show-icon": r(i.showIconLeading ?? i.showIcon),
|
|
56
|
+
"data-icon-trailing": i.iconTrailing,
|
|
57
|
+
"data-show-icon-trailing": r(i.showIconTrailing),
|
|
58
|
+
"data-size": i.size,
|
|
59
|
+
"data-width": i.width,
|
|
60
|
+
"data-variant": i.variant,
|
|
61
|
+
"data-no-text": r(i.noText),
|
|
62
|
+
children: i.children
|
|
63
|
+
});
|
|
10
64
|
}
|
|
11
|
-
|
|
12
|
-
|
|
65
|
+
var c = i(s);
|
|
66
|
+
//#endregion
|
|
67
|
+
export { c as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DBCustomButton } from './custom-button';
|
|
1
|
+
export { default as DBCustomButton } from './custom-button.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, NoTextProps, ShowIconLeadingProps, ShowIconProps, ShowIconTrailingProps, SizeProps, WidthProps, WrapProps } from '../../shared/model';
|
|
2
|
-
import type { DBButtonSharedProps } from '../button/model';
|
|
1
|
+
import type { GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, NoTextProps, ShowIconLeadingProps, ShowIconProps, ShowIconTrailingProps, SizeProps, WidthProps, WrapProps } from '../../shared/model.js';
|
|
2
|
+
import type { DBButtonSharedProps } from '../button/model.js';
|
|
3
3
|
export type DBCustomButtonDefaultProps = {};
|
|
4
4
|
export type DBCustomButtonProps = DBCustomButtonDefaultProps & DBButtonSharedProps & GlobalProps & IconProps & WidthProps & SizeProps & ShowIconProps & ShowIconLeadingProps & ShowIconTrailingProps & IconLeadingProps & IconTrailingProps & NoTextProps & WrapProps;
|
|
5
5
|
export type DBCustomButtonDefaultState = {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBCustomSelect: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../../shared/model").GlobalProps | "icon" | "showIcon" | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").BaseFormProps | keyof import("../../shared/model").RequiredProps | "showLabel" | keyof import("../../shared/model").FormMessageProps | keyof import("./model").DBCustomSelectDefaultProps | keyof import("./model").DBCustomSelectEvents> & import("../../shared/model").GlobalProps & import("../../shared/model").CustomFormProps & import("../../shared/model").BaseFormProps & import("../../shared/model").RequiredProps & import("../../shared/model").FormMessageProps & import("./model").DBCustomSelectDefaultProps & import("./model").DBCustomSelectEvents & import("../../shared/model").IconProps & import("../../shared/model").ShowIconProps & import("../../shared/model").ShowLabelProps & React.RefAttributes<any>>;
|
|
2
|
+
declare const DBCustomSelect: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../../shared/model.js").GlobalProps | "icon" | "showIcon" | keyof import("../../shared/model.js").CustomFormProps | keyof import("../../shared/model.js").BaseFormProps | keyof import("../../shared/model.js").RequiredProps | "showLabel" | keyof import("../../shared/model.js").FormMessageProps | keyof import("./model.js").DBCustomSelectDefaultProps | keyof import("./model.js").DBCustomSelectEvents> & import("../../shared/model.js").GlobalProps & import("../../shared/model.js").CustomFormProps & import("../../shared/model.js").BaseFormProps & import("../../shared/model.js").RequiredProps & import("../../shared/model.js").FormMessageProps & import("./model.js").DBCustomSelectDefaultProps & import("./model.js").DBCustomSelectEvents & import("../../shared/model.js").IconProps & import("../../shared/model.js").ShowIconProps & import("../../shared/model.js").ShowLabelProps & React.RefAttributes<any>>;
|
|
3
3
|
export default DBCustomSelect;
|