@db-ux/react-core-components 4.9.1 → 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 +9 -1
- package/README.md +97 -35
- package/dist/components/accordion/accordion.js +102 -86
- 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 +4 -0
- package/dist/components/badge/badge.js +72 -32
- package/dist/components/badge/model.js +12 -1
- package/dist/components/brand/brand.js +60 -13
- package/dist/components/button/button.js +75 -21
- package/dist/components/button/model.js +13 -2
- package/dist/components/card/card.js +65 -15
- package/dist/components/card/model.js +8 -2
- package/dist/components/checkbox/checkbox.js +163 -157
- package/dist/components/custom-button/custom-button.js +65 -10
- package/dist/components/custom-select/custom-select.js +509 -727
- 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.js +8 -1
- package/dist/components/custom-select-form-field/custom-select-form-field.js +57 -10
- package/dist/components/custom-select-list/custom-select-list.js +60 -11
- package/dist/components/custom-select-list-item/custom-select-list-item.js +89 -32
- package/dist/components/custom-select-list-item/model.js +4 -1
- package/dist/components/divider/divider.js +60 -10
- package/dist/components/divider/model.js +4 -2
- package/dist/components/drawer/drawer.js +118 -97
- package/dist/components/drawer/model.js +14 -4
- package/dist/components/header/header.js +143 -65
- package/dist/components/icon/icon.js +61 -12
- package/dist/components/icon/model.js +11 -1
- package/dist/components/infotext/infotext.js +62 -12
- package/dist/components/input/input.js +198 -167
- package/dist/components/input/model.js +21 -5
- package/dist/components/link/link.js +70 -12
- package/dist/components/link/model.js +8 -3
- package/dist/components/navigation/navigation.js +57 -11
- package/dist/components/navigation-item/model.d.ts +4 -0
- package/dist/components/navigation-item/navigation-item.js +117 -81
- package/dist/components/notification/model.js +12 -3
- package/dist/components/notification/notification.js +100 -32
- package/dist/components/page/model.js +4 -2
- package/dist/components/page/page.js +74 -46
- package/dist/components/popover/popover.js +126 -125
- package/dist/components/radio/radio.js +124 -85
- package/dist/components/section/section.js +59 -10
- package/dist/components/select/select.js +188 -191
- package/dist/components/stack/model.js +14 -4
- package/dist/components/stack/stack.js +63 -10
- package/dist/components/switch/switch.js +182 -150
- package/dist/components/tab-item/tab-item.js +105 -76
- package/dist/components/tab-list/tab-list.js +60 -11
- package/dist/components/tab-panel/tab-panel.js +59 -13
- package/dist/components/tabs/model.js +4 -2
- package/dist/components/tabs/tabs.js +191 -178
- package/dist/components/tag/model.js +4 -1
- package/dist/components/tag/tag.js +91 -32
- package/dist/components/textarea/model.js +13 -2
- package/dist/components/textarea/textarea.js +165 -150
- 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,169 +1,200 @@
|
|
|
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
|
-
|
|
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, getInputValue as s, getNumber as c, getStep as l, hasVoiceOver as u, isArrayOfStrings as d, isIOSSafari as f, stringPropVisible as p } from "../../utils/index.js";
|
|
4
|
+
import { DEFAULT_DATALIST_ID_SUFFIX as ee, DEFAULT_INVALID_MESSAGE_ID_SUFFIX as m, DEFAULT_MESSAGE_ID_SUFFIX as h, DEFAULT_VALID_MESSAGE_ID_SUFFIX as g } from "../../shared/constants.js";
|
|
5
|
+
import { addValueResetEventListener as _ } from "../../utils/form-components.js";
|
|
6
|
+
import v from "../infotext/infotext.js";
|
|
7
|
+
import { forwardRef as y, useEffect as b, useId as x, useRef as S, useState as C } from "react";
|
|
8
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/input/input.tsx
|
|
10
|
+
function E(y, E) {
|
|
11
|
+
let D = x(), O = E || S(E), [k, A] = C(() => void 0), [j, M] = C(() => void 0), [N, P] = C(() => void 0), [F, I] = C(() => void 0), [L, R] = C(() => void 0), [z, B] = C(() => void 0), [V, H] = C(() => void 0), [te, U] = C(() => ""), [W, G] = C(() => ""), [K, q] = C(() => void 0);
|
|
12
|
+
function J() {
|
|
13
|
+
return !!(y.validMessage ?? y.validation === "valid");
|
|
14
|
+
}
|
|
15
|
+
function Y() {
|
|
16
|
+
!O.current?.validity.valid || y.validation === "invalid" ? (H(F), R(y.invalidMessage || O.current?.validationMessage || "TODO: Add an invalidMessage"), u() && (G(L), r(() => G(""), 1e3))) : J() && O.current?.validity.valid && (y.required || y.minLength || y.maxLength || y.pattern) ? (H(N), u() && (G(y.validMessage ?? "TODO: Add a validMessage"), r(() => G(""), 1e3))) : p(y.message, y.showMessage) ? H(j) : H(void 0);
|
|
17
|
+
}
|
|
18
|
+
function X(e, t) {
|
|
19
|
+
y.onInput && y.onInput(e), Y();
|
|
20
|
+
}
|
|
21
|
+
function Z(e, t) {
|
|
22
|
+
y.onChange && y.onChange(e), Y();
|
|
23
|
+
}
|
|
24
|
+
function Q(e) {
|
|
25
|
+
y.onBlur && y.onBlur(e);
|
|
26
|
+
}
|
|
27
|
+
function ne(e) {
|
|
28
|
+
y.onFocus && y.onFocus(e);
|
|
29
|
+
}
|
|
30
|
+
function re() {
|
|
31
|
+
let e = y.dataList;
|
|
32
|
+
return Array.from((d(e) ? e?.map((e) => ({
|
|
33
|
+
value: e,
|
|
34
|
+
label: void 0
|
|
35
|
+
})) : e) || []);
|
|
36
|
+
}
|
|
37
|
+
function $() {
|
|
38
|
+
let e = y.id ?? y.propOverrides?.id ?? `input-${D}`;
|
|
39
|
+
A(e), M(e + h), P(e + g), I(e + m), B(e + ee);
|
|
40
|
+
}
|
|
41
|
+
return b(() => {
|
|
42
|
+
$(), R(y.invalidMessage || "TODO: Add an invalidMessage");
|
|
43
|
+
}, []), b(() => {
|
|
44
|
+
(y.id ?? y.propOverrides?.id) && $();
|
|
45
|
+
}, [y.id, y.propOverrides?.id]), b(() => {
|
|
46
|
+
R(y.invalidMessage || O.current?.validationMessage || "TODO: Add an invalidMessage");
|
|
47
|
+
}, [O.current, y.invalidMessage]), b(() => {
|
|
48
|
+
if (k) {
|
|
49
|
+
let e = k + h;
|
|
50
|
+
M(e), P(k + g), I(k + m), B(y.dataListId ?? k + "-datalist"), p(y.message, y.showMessage) && H(e), Y();
|
|
51
|
+
}
|
|
52
|
+
}, [k]), b(() => {
|
|
53
|
+
U(y.value);
|
|
54
|
+
}, [y.value]), b(() => {
|
|
55
|
+
if (O.current) {
|
|
56
|
+
let e = y.defaultValue, t = K;
|
|
57
|
+
t || (t = new AbortController(), q(t)), _(O.current, {
|
|
58
|
+
value: y.value,
|
|
59
|
+
defaultValue: e
|
|
60
|
+
}, (e) => {
|
|
61
|
+
Z(e, !0), X(e, !0);
|
|
62
|
+
}, t.signal);
|
|
63
|
+
}
|
|
64
|
+
}, [O.current]), b(() => () => {
|
|
65
|
+
K?.abort();
|
|
66
|
+
}, []), /* @__PURE__ */ T("div", {
|
|
67
|
+
...t(y, [
|
|
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-input", y.className),
|
|
89
|
+
"data-variant": y.variant,
|
|
90
|
+
"data-hide-label": o(y.showLabel),
|
|
91
|
+
"data-show-icon": a(y.showIconLeading ?? y.showIcon),
|
|
92
|
+
"data-icon": y.iconLeading ?? y.icon,
|
|
93
|
+
"data-icon-trailing": y.iconTrailing,
|
|
94
|
+
"data-hide-asterisk": o(y.showRequiredAsterisk),
|
|
95
|
+
"data-show-icon-trailing": a(y.showIconTrailing),
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ w("label", {
|
|
98
|
+
htmlFor: k,
|
|
99
|
+
children: y.label ?? "LABEL SHOULD BE SET"
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ w("input", {
|
|
102
|
+
"aria-invalid": y.validation === "invalid",
|
|
103
|
+
"data-custom-validity": y.validation,
|
|
104
|
+
"data-field-sizing": y.fieldSizing,
|
|
105
|
+
ref: O,
|
|
106
|
+
...e(y, [
|
|
107
|
+
"data-icon-variant",
|
|
108
|
+
"data-icon-variant-before",
|
|
109
|
+
"data-icon-variant-after",
|
|
110
|
+
"data-icon-weight",
|
|
111
|
+
"data-icon-weight-before",
|
|
112
|
+
"data-icon-weight-after",
|
|
113
|
+
"data-interactive",
|
|
114
|
+
"data-force-mobile",
|
|
115
|
+
"data-color",
|
|
116
|
+
"data-container-color",
|
|
117
|
+
"data-bg-color",
|
|
118
|
+
"data-on-bg-color",
|
|
119
|
+
"data-color-scheme",
|
|
120
|
+
"data-font-size",
|
|
121
|
+
"data-headline-size",
|
|
122
|
+
"data-divider",
|
|
123
|
+
"data-focus",
|
|
124
|
+
"data-font",
|
|
125
|
+
"data-density"
|
|
126
|
+
]),
|
|
127
|
+
id: k,
|
|
128
|
+
name: y.name,
|
|
129
|
+
type: y.type || "text",
|
|
130
|
+
multiple: i(y.multiple, "multiple"),
|
|
131
|
+
accept: y.accept,
|
|
132
|
+
placeholder: y.placeholder ?? " ",
|
|
133
|
+
disabled: i(y.disabled, "disabled"),
|
|
134
|
+
required: i(y.required, "required"),
|
|
135
|
+
step: l(y.step),
|
|
136
|
+
value: y.value,
|
|
137
|
+
maxLength: c(y.maxLength, y.maxlength),
|
|
138
|
+
minLength: c(y.minLength, y.minlength),
|
|
139
|
+
max: s(y.max, y.type),
|
|
140
|
+
min: s(y.min, y.type),
|
|
141
|
+
readOnly: i(y.readOnly, "readOnly") || i(y.readonly, "readonly"),
|
|
142
|
+
form: y.form,
|
|
143
|
+
pattern: y.pattern,
|
|
144
|
+
size: y.size,
|
|
145
|
+
autoComplete: y.autocomplete,
|
|
146
|
+
autoFocus: i(y.autofocus, "autofocus"),
|
|
147
|
+
enterKeyHint: y.enterkeyhint,
|
|
148
|
+
inputMode: y.inputmode,
|
|
149
|
+
onInput: (e) => X(e),
|
|
150
|
+
onChange: (e) => Z(e),
|
|
151
|
+
onBlur: (e) => Q(e),
|
|
152
|
+
onFocus: (e) => ne(e),
|
|
153
|
+
list: y.dataList && z,
|
|
154
|
+
"aria-describedby": y.ariaDescribedBy ?? V,
|
|
155
|
+
role: [
|
|
156
|
+
"datetime-local",
|
|
157
|
+
"date",
|
|
158
|
+
"time",
|
|
159
|
+
"week",
|
|
160
|
+
"month",
|
|
161
|
+
"color"
|
|
162
|
+
].includes(y.type ?? "") && f() ? "textbox" : void 0
|
|
163
|
+
}),
|
|
164
|
+
y.dataList ? /* @__PURE__ */ w("datalist", {
|
|
165
|
+
id: z,
|
|
166
|
+
children: re()?.map((e) => /* @__PURE__ */ w("option", {
|
|
167
|
+
value: e.value,
|
|
168
|
+
children: e.label
|
|
169
|
+
}, z + "-option-" + e.value))
|
|
170
|
+
}) : null,
|
|
171
|
+
y.children,
|
|
172
|
+
p(y.message, y.showMessage) ? /* @__PURE__ */ w(v, {
|
|
173
|
+
size: y.messageSize || "small",
|
|
174
|
+
icon: y.messageIcon,
|
|
175
|
+
id: j,
|
|
176
|
+
children: y.message
|
|
177
|
+
}) : null,
|
|
178
|
+
J() ? /* @__PURE__ */ w(v, {
|
|
179
|
+
semantic: "successful",
|
|
180
|
+
id: N,
|
|
181
|
+
size: y.validMessageSize || "small",
|
|
182
|
+
children: y.validMessage || "TODO: Add a validMessage"
|
|
183
|
+
}) : null,
|
|
184
|
+
/* @__PURE__ */ w(v, {
|
|
185
|
+
semantic: "critical",
|
|
186
|
+
id: F,
|
|
187
|
+
size: y.invalidMessageSize || "small",
|
|
188
|
+
children: L
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ w("span", {
|
|
191
|
+
"data-visually-hidden": "true",
|
|
192
|
+
role: "status",
|
|
193
|
+
children: W
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
});
|
|
167
197
|
}
|
|
168
|
-
|
|
169
|
-
|
|
198
|
+
var D = y(E);
|
|
199
|
+
//#endregion
|
|
200
|
+
export { D as default };
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region src/components/input/model.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"color",
|
|
4
|
+
"date",
|
|
5
|
+
"datetime-local",
|
|
6
|
+
"email",
|
|
7
|
+
"file",
|
|
8
|
+
"hidden",
|
|
9
|
+
"month",
|
|
10
|
+
"number",
|
|
11
|
+
"password",
|
|
12
|
+
"range",
|
|
13
|
+
"search",
|
|
14
|
+
"tel",
|
|
15
|
+
"text",
|
|
16
|
+
"time",
|
|
17
|
+
"url",
|
|
18
|
+
"week"
|
|
19
|
+
];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as InputTypeList };
|
|
@@ -1,14 +1,72 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/link/link.tsx
|
|
7
|
+
function l(i, l) {
|
|
8
|
+
return /* @__PURE__ */ c("a", {
|
|
9
|
+
ref: l || a(l),
|
|
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-link", i.className),
|
|
54
|
+
href: i.href,
|
|
55
|
+
target: i.target,
|
|
56
|
+
rel: i.rel,
|
|
57
|
+
role: i.role,
|
|
58
|
+
referrerPolicy: i.referrerpolicy ?? i.referrerPolicy,
|
|
59
|
+
hrefLang: i.hreflang,
|
|
60
|
+
"aria-disabled": r(i.disabled),
|
|
61
|
+
tabIndex: i.disabled ? -1 : 0,
|
|
62
|
+
"data-size": i.size,
|
|
63
|
+
"data-show-icon-trailing": r(i.showIcon ?? !0),
|
|
64
|
+
"data-variant": i.variant,
|
|
65
|
+
"data-content": i.content || "internal",
|
|
66
|
+
"data-wrap": r(i.wrap),
|
|
67
|
+
children: [i.text ? /* @__PURE__ */ s(o, { children: i.text }) : null, i.children]
|
|
68
|
+
});
|
|
12
69
|
}
|
|
13
|
-
|
|
14
|
-
|
|
70
|
+
var u = i(l);
|
|
71
|
+
//#endregion
|
|
72
|
+
export { u as default };
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/components/link/model.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"adaptive",
|
|
4
|
+
"brand",
|
|
5
|
+
"inline"
|
|
6
|
+
], t = ["medium", "small"], n = ["external", "internal"];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as LinkContentList, t as LinkSizeList, e as LinkVariantList };
|
|
@@ -1,13 +1,59 @@
|
|
|
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/navigation/navigation.tsx
|
|
7
|
+
function o(r, o) {
|
|
8
|
+
return /* @__PURE__ */ a("nav", {
|
|
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-navigation", r.className),
|
|
54
|
+
children: /* @__PURE__ */ a("menu", { children: r.children })
|
|
55
|
+
});
|
|
11
56
|
}
|
|
12
|
-
|
|
13
|
-
|
|
57
|
+
var s = r(o);
|
|
58
|
+
//#endregion
|
|
59
|
+
export { s as default };
|
|
@@ -17,6 +17,10 @@ export type DBNavigationItemDefaultProps = {
|
|
|
17
17
|
* This is for mobile navigation only, if it is set the sub-navigation is a static overlay
|
|
18
18
|
*/
|
|
19
19
|
subNavigationExpanded?: boolean | string;
|
|
20
|
+
/**
|
|
21
|
+
* Force hide sub-navigation - for web component output
|
|
22
|
+
*/
|
|
23
|
+
hideSubNavigation?: boolean | string;
|
|
20
24
|
};
|
|
21
25
|
export type DBNavigationItemProps = DBNavigationItemDefaultProps & GlobalProps & ClickEventProps<HTMLButtonElement> & IconProps & WidthProps & WrapProps & NavigationBackButtonProps & ShowIconProps & TextProps;
|
|
22
26
|
export type DBNavigationItemDefaultState = {
|