@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,193 +1,190 @@
|
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
stringPropVisible(props.message, props.showMessage) ? (React.createElement(DBInfotext, { size: "small", icon: props.messageIcon, id: _messageId }, props.message)) : null,
|
|
188
|
-
hasValidState() ? (React.createElement(DBInfotext, { size: "small", semantic: "successful", id: _validMessageId }, props.validMessage || DEFAULT_VALID_MESSAGE)) : null,
|
|
189
|
-
React.createElement(DBInfotext, { size: "small", semantic: "critical", id: _invalidMessageId }, _invalidMessage),
|
|
190
|
-
React.createElement("span", { "data-visually-hidden": "true", role: "status" }, _voiceOverFallback)));
|
|
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, getOptionKey as s, hasVoiceOver as c, stringPropVisible as l } from "../../utils/index.js";
|
|
4
|
+
import { DEFAULT_INVALID_MESSAGE_ID_SUFFIX as u, DEFAULT_MESSAGE_ID_SUFFIX as d, DEFAULT_PLACEHOLDER_ID_SUFFIX as f, DEFAULT_VALID_MESSAGE_ID_SUFFIX as p } from "../../shared/constants.js";
|
|
5
|
+
import { addValueResetEventListener as m } from "../../utils/form-components.js";
|
|
6
|
+
import h from "../infotext/infotext.js";
|
|
7
|
+
import { forwardRef as g, useEffect as _, useId as ee, useRef as v, useState as y } from "react";
|
|
8
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/select/select.tsx
|
|
10
|
+
function C(g, C) {
|
|
11
|
+
let w = ee(), T = C || v(C), [E, D] = y(() => void 0), [O, k] = y(() => void 0), [A, j] = y(() => void 0), [M, N] = y(() => void 0), [P, F] = y(() => void 0), [I, L] = y(() => ""), [R, z] = y(() => void 0), [te, B] = y(() => ""), [V, H] = y(() => !1), [ne, U] = y(() => ""), [W, G] = y(() => void 0);
|
|
12
|
+
function K() {
|
|
13
|
+
return !!(g.validMessage ?? g.validation === "valid");
|
|
14
|
+
}
|
|
15
|
+
function q() {
|
|
16
|
+
!T.current?.validity.valid || g.validation === "invalid" ? (z(M), F(g.invalidMessage || T.current?.validationMessage || "TODO: Add an invalidMessage"), c() && (U(P), r(() => U(""), 1e3))) : K() && T.current?.validity.valid && g.required ? (z(A), c() && (U(g.validMessage ?? "TODO: Add a validMessage"), r(() => U(""), 1e3))) : l(g.message, g.showMessage) ? z(O) : g.placeholder ? z(I) : z(void 0);
|
|
17
|
+
}
|
|
18
|
+
function J(e) {
|
|
19
|
+
g.onClick && g.onClick(e);
|
|
20
|
+
}
|
|
21
|
+
function Y(e, t) {
|
|
22
|
+
g.onInput && g.onInput(e), q();
|
|
23
|
+
}
|
|
24
|
+
function X(e, t) {
|
|
25
|
+
g.onChange && g.onChange(e), q();
|
|
26
|
+
}
|
|
27
|
+
function Z(e) {
|
|
28
|
+
g.onBlur && g.onBlur(e);
|
|
29
|
+
}
|
|
30
|
+
function re(e) {
|
|
31
|
+
g.onFocus && g.onFocus(e);
|
|
32
|
+
}
|
|
33
|
+
function Q(e) {
|
|
34
|
+
return e.label ?? e.value?.toString();
|
|
35
|
+
}
|
|
36
|
+
function ie() {
|
|
37
|
+
return g.variant === "floating" || g.placeholder ? g.showEmptyOption === void 0 ? !g.required : g.showEmptyOption : !1;
|
|
38
|
+
}
|
|
39
|
+
function $() {
|
|
40
|
+
let e = g.id ?? g.propOverrides?.id ?? `select-${w}`;
|
|
41
|
+
D(e), k(e + d), j(e + p), N(e + u), L(e + f);
|
|
42
|
+
}
|
|
43
|
+
return _(() => {
|
|
44
|
+
H(!0), $(), F(g.invalidMessage || "TODO: Add an invalidMessage");
|
|
45
|
+
}, []), _(() => {
|
|
46
|
+
(g.id ?? g.propOverrides?.id) && $();
|
|
47
|
+
}, [g.id, g.propOverrides?.id]), _(() => {
|
|
48
|
+
F(g.invalidMessage || T.current?.validationMessage || "TODO: Add an invalidMessage");
|
|
49
|
+
}, [T.current, g.invalidMessage]), _(() => {
|
|
50
|
+
if (E && V) {
|
|
51
|
+
let e = E + d, t = E + f;
|
|
52
|
+
k(e), j(E + p), N(E + u), L(t), l(g.message, g.showMessage) ? z(e) : g.placeholder ? z(t) : z(void 0), q(), H(!1);
|
|
53
|
+
}
|
|
54
|
+
}, [E, V]), _(() => {
|
|
55
|
+
B(g.value);
|
|
56
|
+
}, [g.value]), _(() => {
|
|
57
|
+
if (T.current) {
|
|
58
|
+
let e = g.defaultValue, t = W;
|
|
59
|
+
t || (t = new AbortController(), G(t)), m(T.current, {
|
|
60
|
+
value: g.value,
|
|
61
|
+
defaultValue: e
|
|
62
|
+
}, (e) => {
|
|
63
|
+
X(e, !0), Y(e, !0);
|
|
64
|
+
}, t.signal);
|
|
65
|
+
}
|
|
66
|
+
}, [T.current]), _(() => () => {
|
|
67
|
+
W?.abort();
|
|
68
|
+
}, []), /* @__PURE__ */ S("div", {
|
|
69
|
+
...t(g, [
|
|
70
|
+
"data-icon-variant",
|
|
71
|
+
"data-icon-variant-before",
|
|
72
|
+
"data-icon-variant-after",
|
|
73
|
+
"data-icon-weight",
|
|
74
|
+
"data-icon-weight-before",
|
|
75
|
+
"data-icon-weight-after",
|
|
76
|
+
"data-interactive",
|
|
77
|
+
"data-force-mobile",
|
|
78
|
+
"data-color",
|
|
79
|
+
"data-container-color",
|
|
80
|
+
"data-bg-color",
|
|
81
|
+
"data-on-bg-color",
|
|
82
|
+
"data-color-scheme",
|
|
83
|
+
"data-font-size",
|
|
84
|
+
"data-headline-size",
|
|
85
|
+
"data-divider",
|
|
86
|
+
"data-focus",
|
|
87
|
+
"data-font",
|
|
88
|
+
"data-density"
|
|
89
|
+
]),
|
|
90
|
+
className: n("db-select", g.className),
|
|
91
|
+
"data-variant": g.variant,
|
|
92
|
+
"data-hide-label": o(g.showLabel),
|
|
93
|
+
"data-hide-asterisk": o(g.showRequiredAsterisk),
|
|
94
|
+
"data-icon": g.icon,
|
|
95
|
+
"data-show-icon": a(g.showIcon),
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ x("label", {
|
|
98
|
+
htmlFor: E,
|
|
99
|
+
children: g.label ?? "LABEL SHOULD BE SET"
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ S("select", {
|
|
102
|
+
"aria-invalid": g.validation === "invalid",
|
|
103
|
+
"data-custom-validity": g.validation,
|
|
104
|
+
ref: T,
|
|
105
|
+
...e(g, [
|
|
106
|
+
"data-icon-variant",
|
|
107
|
+
"data-icon-variant-before",
|
|
108
|
+
"data-icon-variant-after",
|
|
109
|
+
"data-icon-weight",
|
|
110
|
+
"data-icon-weight-before",
|
|
111
|
+
"data-icon-weight-after",
|
|
112
|
+
"data-interactive",
|
|
113
|
+
"data-force-mobile",
|
|
114
|
+
"data-color",
|
|
115
|
+
"data-container-color",
|
|
116
|
+
"data-bg-color",
|
|
117
|
+
"data-on-bg-color",
|
|
118
|
+
"data-color-scheme",
|
|
119
|
+
"data-font-size",
|
|
120
|
+
"data-headline-size",
|
|
121
|
+
"data-divider",
|
|
122
|
+
"data-focus",
|
|
123
|
+
"data-font",
|
|
124
|
+
"data-density"
|
|
125
|
+
]),
|
|
126
|
+
required: i(g.required, "required"),
|
|
127
|
+
disabled: i(g.disabled, "disabled"),
|
|
128
|
+
id: E,
|
|
129
|
+
name: g.name,
|
|
130
|
+
size: g.size,
|
|
131
|
+
value: g.value,
|
|
132
|
+
autoComplete: g.autocomplete,
|
|
133
|
+
multiple: g.multiple,
|
|
134
|
+
onInput: (e) => Y(e),
|
|
135
|
+
onClick: (e) => J(e),
|
|
136
|
+
onChange: (e) => X(e),
|
|
137
|
+
onBlur: (e) => Z(e),
|
|
138
|
+
onFocus: (e) => re(e),
|
|
139
|
+
"aria-describedby": g.ariaDescribedBy ?? R,
|
|
140
|
+
children: [g.variant === "floating" || g.placeholder ? /* @__PURE__ */ x("option", {
|
|
141
|
+
className: "placeholder",
|
|
142
|
+
value: "",
|
|
143
|
+
"data-show-empty-option": a(ie())
|
|
144
|
+
}) : null, g.options?.length ? /* @__PURE__ */ x(b, { children: g.options?.map((e) => e.options ? /* @__PURE__ */ x("optgroup", {
|
|
145
|
+
label: Q(e),
|
|
146
|
+
children: e.options?.map((e) => /* @__PURE__ */ x("option", {
|
|
147
|
+
value: e.value,
|
|
148
|
+
disabled: e.disabled,
|
|
149
|
+
children: Q(e)
|
|
150
|
+
}, s(e, "select-optgroup-option-")))
|
|
151
|
+
}, s(e, "select-optgroup-")) : /* @__PURE__ */ x("option", {
|
|
152
|
+
value: e.value,
|
|
153
|
+
disabled: e.disabled,
|
|
154
|
+
children: Q(e)
|
|
155
|
+
}, s(e, "select-option-"))) }) : /* @__PURE__ */ x(b, { children: g.children })]
|
|
156
|
+
}),
|
|
157
|
+
g.placeholder ? /* @__PURE__ */ x("span", {
|
|
158
|
+
className: "db-select-placeholder",
|
|
159
|
+
id: I,
|
|
160
|
+
children: g.placeholder
|
|
161
|
+
}) : null,
|
|
162
|
+
l(g.message, g.showMessage) ? /* @__PURE__ */ x(h, {
|
|
163
|
+
size: "small",
|
|
164
|
+
icon: g.messageIcon,
|
|
165
|
+
id: O,
|
|
166
|
+
children: g.message
|
|
167
|
+
}) : null,
|
|
168
|
+
K() ? /* @__PURE__ */ x(h, {
|
|
169
|
+
size: "small",
|
|
170
|
+
semantic: "successful",
|
|
171
|
+
id: A,
|
|
172
|
+
children: g.validMessage || "TODO: Add a validMessage"
|
|
173
|
+
}) : null,
|
|
174
|
+
/* @__PURE__ */ x(h, {
|
|
175
|
+
size: "small",
|
|
176
|
+
semantic: "critical",
|
|
177
|
+
id: M,
|
|
178
|
+
children: P
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ x("span", {
|
|
181
|
+
"data-visually-hidden": "true",
|
|
182
|
+
role: "status",
|
|
183
|
+
children: ne
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
});
|
|
191
187
|
}
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
var w = g(C);
|
|
189
|
+
//#endregion
|
|
190
|
+
export { w as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DBStack } from './stack';
|
|
1
|
+
export { default as DBStack } from './stack.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GapSpacingProps, GlobalProps, GlobalState } from '../../shared/model';
|
|
1
|
+
import type { GapSpacingProps, GlobalProps, GlobalState } from '../../shared/model.js';
|
|
2
2
|
export declare const StackVariantList: readonly ["simple", "divider"];
|
|
3
3
|
export type StackVariantType = (typeof StackVariantList)[number];
|
|
4
4
|
export declare const StackDirectionList: readonly ["row", "column"];
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/components/stack/model.ts
|
|
2
|
+
var e = ["simple", "divider"], t = ["row", "column"], n = [
|
|
3
|
+
"stretch",
|
|
4
|
+
"start",
|
|
5
|
+
"end",
|
|
6
|
+
"center"
|
|
7
|
+
], r = [
|
|
8
|
+
"space-between",
|
|
9
|
+
"start",
|
|
10
|
+
"end",
|
|
11
|
+
"center"
|
|
12
|
+
];
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as StackAlignmentList, t as StackDirectionList, r as StackJustifyContentList, e as StackVariantList };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBStack: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("
|
|
2
|
+
declare const DBStack: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../../index.js").GlobalProps | "gap" | keyof import("./model.js").DBStackDefaultProps> & import("./model.js").DBStackDefaultProps & import("../../index.js").GlobalProps & import("../../index.js").GapSpacingProps & React.RefAttributes<any>>;
|
|
3
3
|
export default DBStack;
|
|
@@ -1,12 +1,65 @@
|
|
|
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/stack/stack.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-stack", i.className),
|
|
54
|
+
"data-gap": i.gap,
|
|
55
|
+
"data-variant": i.variant,
|
|
56
|
+
"data-direction": i.direction,
|
|
57
|
+
"data-alignment": i.alignment,
|
|
58
|
+
"data-justify-content": i.justifyContent,
|
|
59
|
+
"data-wrap": r(i.wrap),
|
|
60
|
+
children: i.children
|
|
61
|
+
});
|
|
10
62
|
}
|
|
11
|
-
|
|
12
|
-
|
|
63
|
+
var c = i(s);
|
|
64
|
+
//#endregion
|
|
65
|
+
export { c as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DBSwitch } from './switch';
|
|
1
|
+
export { default as DBSwitch } from './switch.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChangeEventProps, ChangeEventState, FocusEventProps, FocusEventState, FormCheckProps, FormMessageProps, FormProps, FormState, FromValidState, GeneralKeyboardEvent, GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, LabelVariantHorizontalType, SizeProps } from '../../shared/model';
|
|
1
|
+
import type { ChangeEventProps, ChangeEventState, FocusEventProps, FocusEventState, FormCheckProps, FormMessageProps, FormProps, FormState, FromValidState, GeneralKeyboardEvent, GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, LabelVariantHorizontalType, SizeProps } from '../../shared/model.js';
|
|
2
2
|
export type DBSwitchDefaultProps = {
|
|
3
3
|
/**
|
|
4
4
|
* Add additional icons to indicate active/inactive state.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBSwitch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, keyof import("../../shared/model").GlobalProps | "value" | "size" | "icon" | "iconLeading" | "iconTrailing" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").BaseFormProps | keyof import("../../shared/model").RequiredProps | "showLabel" | "checked" | "placeholder" | "message" | "validMessage" | "invalidMessage" | "messageIcon" | "autocomplete" | "showMessage" | keyof import("./model").DBSwitchDefaultProps> & import("../../shared/model").GlobalProps & import("../../shared/model").ChangeEventProps<HTMLInputElement> & import("../../shared/model").FocusEventProps<HTMLInputElement> & import("../../shared/model").CustomFormProps & import("../../shared/model").BaseFormProps & import("../../shared/model").RequiredProps & import("../../shared/model").ShowLabelProps & import("../../shared/model").ValueProps & import("../../shared/model").FormCheckProps & Omit<import("../../shared/model").FormMessageProps, "variant"> & import("../../shared/model").SizeProps & import("../../shared/model").IconProps & import("../../shared/model").IconTrailingProps & import("../../shared/model").IconLeadingProps & import("./model").DBSwitchDefaultProps & React.RefAttributes<any>>;
|
|
2
|
+
declare const DBSwitch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, keyof import("../../shared/model.js").GlobalProps | "value" | "size" | "icon" | "iconLeading" | "iconTrailing" | keyof import("../../shared/model.js").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model.js").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model.js").CustomFormProps | keyof import("../../shared/model.js").BaseFormProps | keyof import("../../shared/model.js").RequiredProps | "showLabel" | "checked" | "placeholder" | "message" | "validMessage" | "invalidMessage" | "messageIcon" | "autocomplete" | "showMessage" | keyof import("./model").DBSwitchDefaultProps> & import("../../shared/model.js").GlobalProps & import("../../shared/model.js").ChangeEventProps<HTMLInputElement> & import("../../shared/model.js").FocusEventProps<HTMLInputElement> & import("../../shared/model.js").CustomFormProps & import("../../shared/model.js").BaseFormProps & import("../../shared/model.js").RequiredProps & import("../../shared/model.js").ShowLabelProps & import("../../shared/model.js").ValueProps & import("../../shared/model.js").FormCheckProps & Omit<import("../../shared/model.js").FormMessageProps, "variant"> & import("../../shared/model.js").SizeProps & import("../../shared/model.js").IconProps & import("../../shared/model.js").IconTrailingProps & import("../../shared/model.js").IconLeadingProps & import("./model").DBSwitchDefaultProps & React.RefAttributes<any>>;
|
|
3
3
|
export default DBSwitch;
|