@stenajs-webui/core 19.0.3 → 19.0.5
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/dist/components/layout/box/Box.d.ts +0 -1
- package/dist/components/text/Text.d.ts +1 -0
- package/dist/index.es.js +251 -247
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +9 -18
- package/dist/index.js.map +1 -1
- package/dist/utils/BooleanOrNumberToNumber.d.ts +2 -0
- package/package.json +10 -3
package/dist/index.es.js
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
(function(){"use strict";try{var
|
|
2
|
-
import { cssColor as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { system as
|
|
8
|
-
import { pickBy as
|
|
9
|
-
import
|
|
10
|
-
import * as
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
margin: 0;
|
|
15
|
-
flex: none;
|
|
16
|
-
background-color: ${(e) => e.color};
|
|
17
|
-
height: ${(e) => e.vertical ? e.size || "100%" : e.width || "1px"};
|
|
18
|
-
width: ${(e) => e.vertical ? e.width || "1px" : e.size || "100%"};
|
|
19
|
-
`, Qe = p(
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._separatorLine_nzfcz_1{display:flex;border:0;margin:0;flex:none}._visuallyHidden_1gevf_1{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._text_1iisw_1{--swui-text-color: var(--swui-text-primary-color);--swui-text-color-caption: var(--lhds-color-ui-600);--swui-text-color-overline: var(--lhds-color-ui-600);--swui-text-font-family: var(--swui-font-primary);--swui-text-font-weight: var(--swui-font-weight-text);--current-color: var(--swui-text-color);--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium);--current-font-weight: var(--swui-text-font-weight);--current-letter-spacing: var(--swui-text-letter-spacing);font-size:var(--current-font-size);line-height:var(--current-line-height);color:var(--current-color);letter-spacing:var(--current-letter-spacing);font-family:var(--swui-text-font-family);font-weight:var(--current-font-weight)}._text_1iisw_1._bold_1iisw_27{--current-font-weight: var(--swui-font-weight-text-bold)}._text_1iisw_1._caption_1iisw_31{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small);--current-color: var(--swui-text-color-caption);--current-letter-spacing: 0;font-style:italic}._text_1iisw_1._overline_1iisw_39{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller);--current-color: var(--swui-text-color-overline);--current-font-weight: var(--swui-font-weight-text-bold);--current-letter-spacing: .1rem;text-transform:uppercase}._text_1iisw_1._large_1iisw_48{--current-font-size: var(--swui-font-size-large);--current-line-height: var(--swui-line-height-large)}._text_1iisw_1._medium_1iisw_53{--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium)}._text_1iisw_1._small_1iisw_58{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small)}._text_1iisw_1._smaller_1iisw_63{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller)}._heading_xn9xj_1{--swui-heading-text-color: var(--swui-text-primary-color);--swui-heading-font-family: var(--swui-font-primary);--swui-heading-font-weight: var(--swui-font-weight-text-bold);--swui-heading-line-height: var(--swui-line-height);font-size:var(--swui-heading-font-size);color:var(--swui-heading-text-color);letter-spacing:0;margin:0;line-height:var(--swui-heading-line-height);font-family:var(--swui-heading-font-family);font-weight:var(--swui-heading-font-weight)}._heading_xn9xj_1._h1_xn9xj_15{--swui-heading-font-size: 2.8rem}._heading_xn9xj_1._h2_xn9xj_19{--swui-heading-font-size: 2.4rem}._heading_xn9xj_1._h3_xn9xj_23{--swui-heading-font-size: 2rem}._heading_xn9xj_1._h4_xn9xj_27{--swui-heading-font-size: 1.8rem}._heading_xn9xj_1._h5_xn9xj_31{--swui-heading-font-size: 1.6rem}._heading_xn9xj_1._h6_xn9xj_35{--swui-heading-font-size: 1.4rem}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
|
+
import { cssColor as R } from "@stenajs-webui/theme";
|
|
3
|
+
import { jsx as i, Fragment as I } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef as h, useState as v, useCallback as p, useLayoutEffect as H, useRef as w, useEffect as l, useMemo as z } from "react";
|
|
5
|
+
import y from "@emotion/styled";
|
|
6
|
+
import F from "@emotion/is-prop-valid";
|
|
7
|
+
import { system as N, background as j, border as P, borderRight as V, borderLeft as A, borderTop as G, borderBottom as U, borderColor as q, borderRadius as W, borderStyle as B, borderWidth as K, boxShadow as J, flexbox as Q, overflow as X, position as Y, layout as Z, zIndex as ee, left as te, right as ne, top as re, bottom as oe } from "styled-system";
|
|
8
|
+
import { pickBy as se, debounce as ce } from "lodash";
|
|
9
|
+
import O from "classnames";
|
|
10
|
+
import * as ue from "react-dom";
|
|
11
|
+
const ie = "_separatorLine_nzfcz_1", ae = {
|
|
12
|
+
separatorLine: ie
|
|
13
|
+
}, Ze = h(
|
|
20
14
|
({
|
|
21
|
-
color: e =
|
|
15
|
+
color: e = R("--lhds-color-ui-300"),
|
|
22
16
|
size: t = "100%",
|
|
23
17
|
width: n = "1px",
|
|
24
18
|
vertical: r = !1
|
|
25
|
-
}, o) => /* @__PURE__ */
|
|
26
|
-
|
|
19
|
+
}, o) => /* @__PURE__ */ i(
|
|
20
|
+
"hr",
|
|
27
21
|
{
|
|
22
|
+
className: ae.separatorLine,
|
|
28
23
|
"aria-hidden": !0,
|
|
29
24
|
color: e,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
style: {
|
|
26
|
+
backgroundColor: e,
|
|
27
|
+
height: r ? t || "100%" : n || "1px",
|
|
28
|
+
width: r ? n || "1px" : t || "100%"
|
|
29
|
+
},
|
|
33
30
|
ref: o
|
|
34
31
|
}
|
|
35
32
|
)
|
|
36
|
-
),
|
|
33
|
+
), de = y.button`
|
|
37
34
|
display: inline-block;
|
|
38
35
|
user-select: none;
|
|
39
36
|
border: 0;
|
|
@@ -56,7 +53,7 @@ const ue = _.hr`
|
|
|
56
53
|
${({ width: e }) => e ? `width: ${e};` : ""}
|
|
57
54
|
${({ height: e }) => e ? `height: ${e};` : ""}
|
|
58
55
|
${({ borderRadius: e }) => e ? `border-radius: ${e};` : ""}
|
|
59
|
-
`,
|
|
56
|
+
`, et = h(
|
|
60
57
|
({
|
|
61
58
|
disableFocusHighlight: e,
|
|
62
59
|
onClick: t,
|
|
@@ -65,19 +62,19 @@ const ue = _.hr`
|
|
|
65
62
|
disableOpacityOnClick: o,
|
|
66
63
|
disablePointer: s,
|
|
67
64
|
opacityOnHover: c,
|
|
68
|
-
disabled:
|
|
65
|
+
disabled: a,
|
|
69
66
|
children: u,
|
|
70
67
|
background: d = "transparent",
|
|
71
|
-
hoverBackground:
|
|
72
|
-
focusBackground:
|
|
73
|
-
type:
|
|
74
|
-
...
|
|
75
|
-
}, k) => /* @__PURE__ */
|
|
76
|
-
|
|
68
|
+
hoverBackground: m,
|
|
69
|
+
focusBackground: f,
|
|
70
|
+
type: D = "button",
|
|
71
|
+
...L
|
|
72
|
+
}, k) => /* @__PURE__ */ i(
|
|
73
|
+
de,
|
|
77
74
|
{
|
|
78
75
|
opacityOnHover: c,
|
|
79
76
|
title: r,
|
|
80
|
-
disabled:
|
|
77
|
+
disabled: a,
|
|
81
78
|
disableOpacityOnClick: o,
|
|
82
79
|
onClick: t,
|
|
83
80
|
onDoubleClick: n,
|
|
@@ -85,19 +82,22 @@ const ue = _.hr`
|
|
|
85
82
|
pointer: !!(t || n) && !s,
|
|
86
83
|
ref: k,
|
|
87
84
|
background: d,
|
|
88
|
-
hoverBackground:
|
|
89
|
-
focusBackground:
|
|
90
|
-
type:
|
|
91
|
-
...
|
|
85
|
+
hoverBackground: m,
|
|
86
|
+
focusBackground: f,
|
|
87
|
+
type: D,
|
|
88
|
+
...L,
|
|
92
89
|
children: u
|
|
93
90
|
}
|
|
94
91
|
)
|
|
95
|
-
),
|
|
92
|
+
), _ = (e) => e == null ? 0 : typeof e == "boolean" ? e ? 1 : 0 : e, le = (e) => {
|
|
93
|
+
if (e !== 0)
|
|
94
|
+
return `calc(${e} * var(--swui-metrics-space))`;
|
|
95
|
+
}, S = (e) => le(_(e)), me = {
|
|
96
96
|
box: "var(--swui-shadow-box)",
|
|
97
97
|
popover: "var(--swui-shadow-popover)",
|
|
98
98
|
modal: "var(--swui-shadow-modal)",
|
|
99
99
|
bottom: "var(--swui-shadow-bottom)"
|
|
100
|
-
},
|
|
100
|
+
}, pe = [
|
|
101
101
|
"spacing",
|
|
102
102
|
"indent",
|
|
103
103
|
"gap",
|
|
@@ -105,58 +105,55 @@ const ue = _.hr`
|
|
|
105
105
|
"height",
|
|
106
106
|
"overflow",
|
|
107
107
|
"display"
|
|
108
|
-
],
|
|
108
|
+
], he = (e) => pe.includes(e), fe = N({
|
|
109
109
|
row: {
|
|
110
110
|
property: "flexDirection",
|
|
111
111
|
transform: (e) => e ? "row" : "column"
|
|
112
112
|
},
|
|
113
113
|
indent: {
|
|
114
|
+
// @ts-ignore
|
|
114
115
|
property: "--current-indent",
|
|
115
|
-
transform:
|
|
116
|
+
transform: _
|
|
116
117
|
},
|
|
117
118
|
spacing: {
|
|
119
|
+
// @ts-ignore
|
|
118
120
|
property: "--current-spacing",
|
|
119
|
-
transform:
|
|
121
|
+
transform: _
|
|
120
122
|
},
|
|
121
123
|
gap: {
|
|
124
|
+
// @ts-ignore
|
|
122
125
|
property: "--current-gap",
|
|
123
|
-
transform:
|
|
126
|
+
transform: _
|
|
124
127
|
},
|
|
125
128
|
columnGap: {
|
|
126
|
-
property: "
|
|
127
|
-
transform:
|
|
129
|
+
property: "columnGap",
|
|
130
|
+
transform: S
|
|
128
131
|
},
|
|
129
132
|
rowGap: {
|
|
130
|
-
property: "
|
|
131
|
-
transform:
|
|
133
|
+
property: "rowGap",
|
|
134
|
+
transform: S
|
|
132
135
|
},
|
|
133
136
|
shadow: {
|
|
134
137
|
property: "boxShadow",
|
|
135
|
-
transform: (e) =>
|
|
136
|
-
var t;
|
|
137
|
-
return (t = ae[e]) != null ? t : e;
|
|
138
|
-
}
|
|
138
|
+
transform: (e) => me[e] ?? e
|
|
139
139
|
}
|
|
140
|
-
}),
|
|
141
|
-
shouldForwardProp: (e) => typeof e == "string" ?
|
|
140
|
+
}), g = y("div", {
|
|
141
|
+
shouldForwardProp: (e) => typeof e == "string" ? he(e) ? !1 : F(e) : !1
|
|
142
142
|
})`
|
|
143
143
|
--current-spacing: 0;
|
|
144
144
|
--current-indent: 0;
|
|
145
145
|
--current-gap: 0;
|
|
146
|
-
--current-column-gap: 0;
|
|
147
|
-
--current-row-gap: 0;
|
|
148
146
|
box-sizing: border-box;
|
|
149
147
|
display: flex;
|
|
150
148
|
flex-direction: column;
|
|
151
|
-
${
|
|
149
|
+
${fe};
|
|
152
150
|
${j};
|
|
153
|
-
${N};
|
|
154
151
|
${P};
|
|
155
152
|
${V};
|
|
156
153
|
${A};
|
|
154
|
+
${G};
|
|
157
155
|
${U};
|
|
158
156
|
${q};
|
|
159
|
-
${G};
|
|
160
157
|
${W};
|
|
161
158
|
${B};
|
|
162
159
|
${K};
|
|
@@ -169,104 +166,106 @@ const ue = _.hr`
|
|
|
169
166
|
${te};
|
|
170
167
|
${ne};
|
|
171
168
|
${re};
|
|
169
|
+
${oe};
|
|
172
170
|
|
|
173
171
|
gap: calc(var(--current-gap) * var(--swui-metrics-space));
|
|
174
|
-
column-gap: calc(var(--current-column-gap) * var(--swui-metrics-space));
|
|
175
|
-
row-gap: calc(var(--current-row-gap) * var(--swui-metrics-space));
|
|
176
172
|
|
|
177
173
|
padding: calc(var(--current-spacing) * var(--swui-metrics-spacing))
|
|
178
174
|
calc(var(--current-indent) * var(--swui-metrics-indent));
|
|
175
|
+
|
|
179
176
|
:hover {
|
|
180
177
|
${({ hoverBackground: e }) => e ? `background: ${e};` : ""}
|
|
181
178
|
${({ hoverBorder: e }) => e ? `border: ${e};` : ""}
|
|
182
179
|
}
|
|
180
|
+
|
|
183
181
|
:focus {
|
|
184
182
|
${({ focusBackground: e }) => e ? `background: ${e};` : ""}
|
|
185
183
|
${({ focusBorder: e }) => e ? `border: ${e};` : ""}
|
|
186
184
|
}
|
|
185
|
+
|
|
187
186
|
:focus-within {
|
|
188
187
|
${({ focusWithinBackground: e }) => e ? `background: ${e};` : ""}
|
|
189
188
|
${({ focusWithinBorder: e }) => e ? `border: ${e};` : ""}
|
|
190
189
|
}
|
|
191
|
-
`,
|
|
192
|
-
return /* @__PURE__ */
|
|
193
|
-
}),
|
|
194
|
-
const { x: t, y: n, width: r, height: o, bottom: s, top: c, left:
|
|
190
|
+
`, tt = h(function(t, n) {
|
|
191
|
+
return /* @__PURE__ */ i(g, { ref: n, ...t });
|
|
192
|
+
}), ve = (e) => {
|
|
193
|
+
const { x: t, y: n, width: r, height: o, bottom: s, top: c, left: a, right: u } = e.getBoundingClientRect();
|
|
195
194
|
return {
|
|
196
195
|
width: r,
|
|
197
196
|
height: o,
|
|
198
197
|
top: c,
|
|
199
|
-
left:
|
|
198
|
+
left: a,
|
|
200
199
|
x: t,
|
|
201
200
|
y: n,
|
|
202
201
|
right: u,
|
|
203
202
|
bottom: s
|
|
204
203
|
};
|
|
205
|
-
},
|
|
206
|
-
const [n, r] =
|
|
204
|
+
}, we = (e, t) => e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height && e.bottom === t.bottom && e.top === t.top && e.left === t.left && e.right === t.right, be = (e, t) => {
|
|
205
|
+
const [n, r] = v(), o = p(() => {
|
|
207
206
|
window.requestAnimationFrame(() => {
|
|
208
207
|
if (e.current) {
|
|
209
|
-
const s =
|
|
210
|
-
(!n || !
|
|
208
|
+
const s = ve(e.current);
|
|
209
|
+
(!n || !we(n, s)) && t && t(s), r(s);
|
|
211
210
|
}
|
|
212
211
|
});
|
|
213
212
|
}, [e, n, r, t]);
|
|
214
|
-
return
|
|
213
|
+
return H(() => {
|
|
215
214
|
o();
|
|
216
215
|
}, [o]), {
|
|
217
216
|
dimensions: n
|
|
218
217
|
};
|
|
219
|
-
},
|
|
218
|
+
}, nt = h(
|
|
220
219
|
function({ onResize: t, ...n }, r) {
|
|
221
|
-
const o =
|
|
222
|
-
return
|
|
220
|
+
const o = w(null);
|
|
221
|
+
return be(r ?? o, t), /* @__PURE__ */ i(g, { ...n, ref: r });
|
|
223
222
|
}
|
|
224
|
-
),
|
|
225
|
-
return /* @__PURE__ */
|
|
226
|
-
}),
|
|
227
|
-
return /* @__PURE__ */
|
|
228
|
-
}),
|
|
223
|
+
), rt = h(function(t, n) {
|
|
224
|
+
return /* @__PURE__ */ i(g, { row: !0, ref: n, ...t });
|
|
225
|
+
}), ot = h(function({ num: t = 1, ...n }, r) {
|
|
226
|
+
return /* @__PURE__ */ i(g, { indent: t, ref: r, ...n });
|
|
227
|
+
}), st = h(
|
|
229
228
|
function({ num: t = 1, ...n }, r) {
|
|
230
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ i(g, { spacing: t, ref: r, ...n });
|
|
231
230
|
}
|
|
232
|
-
),
|
|
231
|
+
), ge = y.div`
|
|
233
232
|
--current-size: 1;
|
|
234
233
|
flex: none;
|
|
235
234
|
width: calc(var(--current-size) * var(--swui-metrics-space));
|
|
236
235
|
height: calc(var(--current-size) * var(--swui-metrics-space));
|
|
237
|
-
`,
|
|
236
|
+
`, ct = ({
|
|
238
237
|
half: e = !1,
|
|
239
238
|
horizontal: t = !1,
|
|
240
239
|
num: n = 1,
|
|
241
240
|
vertical: r = !1
|
|
242
241
|
}) => {
|
|
243
242
|
const o = n * (e ? 0.5 : 1);
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
-
|
|
243
|
+
return /* @__PURE__ */ i(
|
|
244
|
+
ge,
|
|
246
245
|
{
|
|
247
246
|
style: {
|
|
248
|
-
|
|
247
|
+
"--current-size": o,
|
|
249
248
|
height: t ? 1 : void 0,
|
|
250
249
|
width: r ? 1 : void 0
|
|
251
250
|
}
|
|
252
251
|
}
|
|
253
252
|
);
|
|
254
|
-
},
|
|
255
|
-
visuallyHidden:
|
|
256
|
-
},
|
|
253
|
+
}, ut = ({ children: e, nest: t, render: n }) => t ? /* @__PURE__ */ i(I, { children: n(e) }) : /* @__PURE__ */ i(I, { children: e }), xe = "_visuallyHidden_1gevf_1", _e = {
|
|
254
|
+
visuallyHidden: xe
|
|
255
|
+
}, $e = (e) => se(e, ye), ye = (e, t) => Ee(t), Ee = (e) => e.startsWith("data-") || e.startsWith("aria-"), it = ({
|
|
257
256
|
children: e,
|
|
258
257
|
...t
|
|
259
|
-
}) => /* @__PURE__ */
|
|
260
|
-
text:
|
|
261
|
-
standard:
|
|
262
|
-
bold:
|
|
263
|
-
caption:
|
|
264
|
-
overline:
|
|
265
|
-
large:
|
|
266
|
-
medium:
|
|
267
|
-
small:
|
|
268
|
-
smaller:
|
|
269
|
-
},
|
|
258
|
+
}) => /* @__PURE__ */ i("span", { className: _e.visuallyHidden, ...$e(t), children: e }), Ie = "_text_1iisw_1", Se = "_standard_1iisw_24", Ce = "_bold_1iisw_27", Te = "_caption_1iisw_31", Me = "_overline_1iisw_39", Oe = "_large_1iisw_48", De = "_medium_1iisw_53", Le = "_small_1iisw_58", ke = "_smaller_1iisw_63", $ = {
|
|
259
|
+
text: Ie,
|
|
260
|
+
standard: Se,
|
|
261
|
+
bold: Ce,
|
|
262
|
+
caption: Te,
|
|
263
|
+
overline: Me,
|
|
264
|
+
large: Oe,
|
|
265
|
+
medium: De,
|
|
266
|
+
small: Le,
|
|
267
|
+
smaller: ke
|
|
268
|
+
}, x = h(
|
|
270
269
|
({
|
|
271
270
|
children: e,
|
|
272
271
|
variant: t = "standard",
|
|
@@ -275,28 +274,36 @@ const ue = _.hr`
|
|
|
275
274
|
color: o,
|
|
276
275
|
userSelect: s,
|
|
277
276
|
whiteSpace: c,
|
|
278
|
-
wordBreak:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
wordBreak: a,
|
|
278
|
+
textAlign: u,
|
|
279
|
+
style: d,
|
|
280
|
+
...m
|
|
281
|
+
}, f) => /* @__PURE__ */ i(
|
|
282
282
|
"span",
|
|
283
283
|
{
|
|
284
|
-
className:
|
|
285
|
-
ref:
|
|
286
|
-
style: {
|
|
287
|
-
|
|
284
|
+
className: O($.text, $[t], $[n], r),
|
|
285
|
+
ref: f,
|
|
286
|
+
style: {
|
|
287
|
+
color: o,
|
|
288
|
+
userSelect: s,
|
|
289
|
+
whiteSpace: c,
|
|
290
|
+
wordBreak: a,
|
|
291
|
+
textAlign: u,
|
|
292
|
+
...d
|
|
293
|
+
},
|
|
294
|
+
...m,
|
|
288
295
|
children: e
|
|
289
296
|
}
|
|
290
297
|
)
|
|
291
|
-
),
|
|
292
|
-
heading:
|
|
293
|
-
h1:
|
|
294
|
-
h2:
|
|
295
|
-
h3:
|
|
296
|
-
h4:
|
|
297
|
-
h5:
|
|
298
|
-
h6:
|
|
299
|
-
},
|
|
298
|
+
), at = x, dt = (e) => /* @__PURE__ */ i(x, { size: "small", ...e }), lt = (e) => /* @__PURE__ */ i(x, { size: "smaller", ...e }), mt = (e) => /* @__PURE__ */ i(x, { size: "medium", ...e }), pt = (e) => /* @__PURE__ */ i(x, { size: "large", ...e }), Re = "_heading_xn9xj_1", He = "_h1_xn9xj_15", ze = "_h2_xn9xj_19", Fe = "_h3_xn9xj_23", Ne = "_h4_xn9xj_27", je = "_h5_xn9xj_31", Pe = "_h6_xn9xj_35", C = {
|
|
299
|
+
heading: Re,
|
|
300
|
+
h1: He,
|
|
301
|
+
h2: ze,
|
|
302
|
+
h3: Fe,
|
|
303
|
+
h4: Ne,
|
|
304
|
+
h5: je,
|
|
305
|
+
h6: Pe
|
|
306
|
+
}, Ve = h(
|
|
300
307
|
({
|
|
301
308
|
variant: e = "h3",
|
|
302
309
|
className: t,
|
|
@@ -305,48 +312,45 @@ const ue = _.hr`
|
|
|
305
312
|
wordBreak: o,
|
|
306
313
|
style: s,
|
|
307
314
|
children: c,
|
|
308
|
-
as:
|
|
315
|
+
as: a,
|
|
309
316
|
...u
|
|
310
|
-
}, d) =>
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
{
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
), lt = (e) => /* @__PURE__ */ a(je, { variant: "h2", ...e }), Ne = (e, t) => e === t, mt = (e, t, n = Ne) => {
|
|
324
|
-
const r = h(
|
|
317
|
+
}, d) => /* @__PURE__ */ i(
|
|
318
|
+
a ?? e,
|
|
319
|
+
{
|
|
320
|
+
className: O(C.heading, C[e], t),
|
|
321
|
+
style: { color: n, whiteSpace: r, wordBreak: o, ...s },
|
|
322
|
+
ref: d,
|
|
323
|
+
...u,
|
|
324
|
+
children: c
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
), ht = (e) => /* @__PURE__ */ i(Ve, { variant: "h2", ...e }), Ae = (e, t) => e === t, ft = (e, t, n = Ae) => {
|
|
328
|
+
const r = p(
|
|
325
329
|
(u) => {
|
|
326
330
|
e.some((d) => n(d, u)) || t([...e, u]);
|
|
327
331
|
},
|
|
328
332
|
[e, t, n]
|
|
329
|
-
), o =
|
|
333
|
+
), o = p(
|
|
330
334
|
(u) => {
|
|
331
335
|
t(
|
|
332
|
-
u.reduce((d,
|
|
336
|
+
u.reduce((d, m) => d.some((f) => n(f, m)) ? d : [...d, m], e)
|
|
333
337
|
);
|
|
334
338
|
},
|
|
335
339
|
[e, t, n]
|
|
336
|
-
), s =
|
|
340
|
+
), s = p(
|
|
337
341
|
(u) => {
|
|
338
|
-
const d = e.findIndex((
|
|
339
|
-
d >= 0 && t(e.filter((
|
|
342
|
+
const d = e.findIndex((m) => n(m, u));
|
|
343
|
+
d >= 0 && t(e.filter((m, f) => f !== d));
|
|
340
344
|
},
|
|
341
345
|
[e, t, n]
|
|
342
|
-
), c =
|
|
346
|
+
), c = p(
|
|
343
347
|
(u) => {
|
|
344
|
-
t(e.filter((d) => !u.some((
|
|
348
|
+
t(e.filter((d) => !u.some((m) => n(m, d))));
|
|
345
349
|
},
|
|
346
350
|
[e, t, n]
|
|
347
|
-
),
|
|
351
|
+
), a = p(
|
|
348
352
|
(u) => {
|
|
349
|
-
e.some((
|
|
353
|
+
e.some((m) => n(m, u)) ? s(u) : r(u);
|
|
350
354
|
},
|
|
351
355
|
[e, r, s, n]
|
|
352
356
|
);
|
|
@@ -355,20 +359,20 @@ const ue = _.hr`
|
|
|
355
359
|
addMultiple: o,
|
|
356
360
|
remove: s,
|
|
357
361
|
removeMultiple: c,
|
|
358
|
-
toggle:
|
|
362
|
+
toggle: a
|
|
359
363
|
};
|
|
360
364
|
}, E = (e) => {
|
|
361
|
-
const [t, n] =
|
|
365
|
+
const [t, n] = v(e), r = p(() => {
|
|
362
366
|
n(!0);
|
|
363
|
-
}, [n]), o =
|
|
367
|
+
}, [n]), o = p(() => {
|
|
364
368
|
n(!1);
|
|
365
|
-
}, [n]), s =
|
|
369
|
+
}, [n]), s = p(() => {
|
|
366
370
|
n((c) => !c);
|
|
367
371
|
}, [n]);
|
|
368
372
|
return [t, r, o, s];
|
|
369
|
-
},
|
|
370
|
-
const [n, r] =
|
|
371
|
-
return
|
|
373
|
+
}, vt = (e, t) => {
|
|
374
|
+
const [n, r] = v(e);
|
|
375
|
+
return l(() => {
|
|
372
376
|
const o = setTimeout(() => {
|
|
373
377
|
r(e);
|
|
374
378
|
}, t);
|
|
@@ -376,9 +380,9 @@ const ue = _.hr`
|
|
|
376
380
|
clearTimeout(o);
|
|
377
381
|
};
|
|
378
382
|
}, [e, t]), n;
|
|
379
|
-
},
|
|
380
|
-
const [n, r] =
|
|
381
|
-
return
|
|
383
|
+
}, wt = (e, t) => {
|
|
384
|
+
const [n, r] = v(e);
|
|
385
|
+
return l(() => {
|
|
382
386
|
e && r(!0);
|
|
383
387
|
const o = setTimeout(() => {
|
|
384
388
|
e || r(e);
|
|
@@ -388,20 +392,20 @@ const ue = _.hr`
|
|
|
388
392
|
};
|
|
389
393
|
}, [e, t]), n;
|
|
390
394
|
};
|
|
391
|
-
let
|
|
392
|
-
const
|
|
393
|
-
const [t, n] =
|
|
394
|
-
return
|
|
395
|
-
},
|
|
396
|
-
const r =
|
|
397
|
-
|
|
395
|
+
let Ge = 0;
|
|
396
|
+
const T = (e) => `webui-${e ? e + "-" : ""}${++Ge}`, bt = (e) => {
|
|
397
|
+
const [t, n] = v(() => T(e));
|
|
398
|
+
return l(() => n(T(e)), [e]), t;
|
|
399
|
+
}, b = (e, t, n) => {
|
|
400
|
+
const r = w();
|
|
401
|
+
l(() => {
|
|
398
402
|
r.current = n;
|
|
399
|
-
}, [n]),
|
|
403
|
+
}, [n]), l(() => {
|
|
400
404
|
if (!(e.current && e.current.addEventListener))
|
|
401
405
|
return;
|
|
402
|
-
const s = (
|
|
406
|
+
const s = (a) => {
|
|
403
407
|
if (r.current)
|
|
404
|
-
return r.current(
|
|
408
|
+
return r.current(a);
|
|
405
409
|
};
|
|
406
410
|
if (!e.current)
|
|
407
411
|
return;
|
|
@@ -410,42 +414,42 @@ const C = (e) => `webui-${e ? e + "-" : ""}${++Pe}`, wt = (e) => {
|
|
|
410
414
|
c && c.removeEventListener(t, s);
|
|
411
415
|
};
|
|
412
416
|
}, [t, e]);
|
|
413
|
-
},
|
|
417
|
+
}, gt = (e) => {
|
|
414
418
|
const [t, n, r] = E(!1);
|
|
415
|
-
|
|
416
|
-
document.activeElement ===
|
|
417
|
-
}, [e, r, n]),
|
|
418
|
-
const o =
|
|
419
|
+
l(() => {
|
|
420
|
+
document.activeElement === ue.findDOMNode(e.current) ? n() : r();
|
|
421
|
+
}, [e, r, n]), b(e, "focus", n), b(e, "blur", r);
|
|
422
|
+
const o = p(() => {
|
|
419
423
|
e.current && e.current.focus();
|
|
420
|
-
}, [e]), s =
|
|
424
|
+
}, [e]), s = p(() => {
|
|
421
425
|
e.current && e.current.blur();
|
|
422
426
|
}, [e]);
|
|
423
427
|
return { isInFocus: t, focus: o, blur: s };
|
|
424
|
-
},
|
|
428
|
+
}, xt = (e) => {
|
|
425
429
|
const [t, n, r] = E(!1);
|
|
426
|
-
return
|
|
427
|
-
},
|
|
430
|
+
return b(e, "mouseover", n), b(e, "mouseout", r), t;
|
|
431
|
+
}, _t = (e) => {
|
|
428
432
|
const [t, n, r] = E(!1);
|
|
429
|
-
return
|
|
430
|
-
},
|
|
431
|
-
const n =
|
|
433
|
+
return b(e, "mouseenter", n), b(e, "mouseleave", r), t;
|
|
434
|
+
}, $t = (e, t) => {
|
|
435
|
+
const n = w(() => {
|
|
432
436
|
});
|
|
433
|
-
|
|
437
|
+
l(() => {
|
|
434
438
|
n.current = t;
|
|
435
|
-
}, [t]),
|
|
439
|
+
}, [t]), l(() => {
|
|
436
440
|
const r = (o) => {
|
|
437
|
-
|
|
441
|
+
e.filter((c) => c.current).every((c) => c.current && !c.current.contains(o.target)) && n.current(o);
|
|
438
442
|
};
|
|
439
443
|
return document.addEventListener("mousedown", r), document.addEventListener("touchstart", r), () => {
|
|
440
444
|
document.removeEventListener("mousedown", r), document.removeEventListener("touchstart", r);
|
|
441
445
|
};
|
|
442
446
|
}, [...e]);
|
|
443
|
-
},
|
|
444
|
-
const r =
|
|
447
|
+
}, yt = (e, t, n) => {
|
|
448
|
+
const r = w(() => {
|
|
445
449
|
});
|
|
446
|
-
|
|
450
|
+
l(() => {
|
|
447
451
|
r.current = t;
|
|
448
|
-
}, [t]),
|
|
452
|
+
}, [t]), l(() => {
|
|
449
453
|
const o = (s) => {
|
|
450
454
|
!e.current || e.current.contains(s.target) || r.current(s);
|
|
451
455
|
};
|
|
@@ -453,21 +457,21 @@ const C = (e) => `webui-${e ? e + "-" : ""}${++Pe}`, wt = (e) => {
|
|
|
453
457
|
document.removeEventListener("mousedown", o, n), document.removeEventListener("touchstart", o, n);
|
|
454
458
|
};
|
|
455
459
|
}, [e, n]);
|
|
456
|
-
},
|
|
457
|
-
const n =
|
|
460
|
+
}, M = ["mousemove", "mousedown", "keydown", "touchstart", "scroll"], Et = (e, t) => {
|
|
461
|
+
const n = w(() => {
|
|
458
462
|
});
|
|
459
|
-
|
|
463
|
+
l(() => {
|
|
460
464
|
n.current = e;
|
|
461
|
-
}, [e]),
|
|
462
|
-
const r =
|
|
463
|
-
return
|
|
464
|
-
|
|
465
|
+
}, [e]), l(() => {
|
|
466
|
+
const r = ce(n.current, t);
|
|
467
|
+
return M.forEach((o) => window.addEventListener(o, r)), () => {
|
|
468
|
+
M.forEach(
|
|
465
469
|
(o) => window.removeEventListener(o, r)
|
|
466
470
|
);
|
|
467
471
|
};
|
|
468
472
|
}, [t]);
|
|
469
|
-
},
|
|
470
|
-
const [n, r] =
|
|
473
|
+
}, It = (e, t) => {
|
|
474
|
+
const [n, r] = v(!1), { rootMargin: o, root: s, threshold: c } = t || {}, a = z(() => new IntersectionObserver(
|
|
471
475
|
([u]) => r(u.isIntersecting),
|
|
472
476
|
{
|
|
473
477
|
rootMargin: o,
|
|
@@ -475,33 +479,33 @@ const C = (e) => `webui-${e ? e + "-" : ""}${++Pe}`, wt = (e) => {
|
|
|
475
479
|
threshold: c
|
|
476
480
|
}
|
|
477
481
|
), [r, o, s, c]);
|
|
478
|
-
return
|
|
479
|
-
|
|
480
|
-
}), [
|
|
481
|
-
},
|
|
482
|
-
const t =
|
|
483
|
-
return
|
|
484
|
-
|
|
482
|
+
return l(() => (e.current && a.observe(e.current), () => {
|
|
483
|
+
a.disconnect();
|
|
484
|
+
}), [a, e]), n;
|
|
485
|
+
}, St = (e) => {
|
|
486
|
+
const t = w(null);
|
|
487
|
+
return l(() => {
|
|
488
|
+
e && (typeof e == "function" ? e(t.current) : e.current = t.current);
|
|
485
489
|
}), t;
|
|
486
|
-
},
|
|
487
|
-
const [r, o] =
|
|
488
|
-
(
|
|
489
|
-
o(
|
|
490
|
+
}, Ct = (e, t, n = !0) => {
|
|
491
|
+
const [r, o] = v(e), s = w(), c = p(
|
|
492
|
+
(a, u = t) => {
|
|
493
|
+
o(a), n && clearTimeout(s.current), s.current = setTimeout(() => o(e), u);
|
|
490
494
|
},
|
|
491
495
|
[t, n, e]
|
|
492
496
|
);
|
|
493
|
-
return
|
|
497
|
+
return l(() => () => {
|
|
494
498
|
clearTimeout(s.current);
|
|
495
499
|
}, []), [r, c];
|
|
496
|
-
},
|
|
500
|
+
}, Tt = (e) => {
|
|
497
501
|
throw new Error(`Switch unhandled case: ${e}`);
|
|
498
|
-
},
|
|
502
|
+
}, Mt = (e, t) => t, Ot = (e) => Object.keys(e).filter((t) => e[t]), Dt = (e) => {
|
|
499
503
|
try {
|
|
500
504
|
const t = parseFloat(e);
|
|
501
505
|
return isNaN(t) || t == null ? void 0 : t;
|
|
502
506
|
} catch {
|
|
503
507
|
}
|
|
504
|
-
},
|
|
508
|
+
}, Lt = (e) => {
|
|
505
509
|
try {
|
|
506
510
|
const t = parseInt(e, 10);
|
|
507
511
|
return isNaN(t) || t == null ? void 0 : t;
|
|
@@ -509,48 +513,48 @@ const C = (e) => `webui-${e ? e + "-" : ""}${++Pe}`, wt = (e) => {
|
|
|
509
513
|
}
|
|
510
514
|
};
|
|
511
515
|
export {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
516
|
+
g as Box,
|
|
517
|
+
et as Clickable,
|
|
518
|
+
tt as Column,
|
|
519
|
+
ht as HeaderText,
|
|
520
|
+
Ve as Heading,
|
|
521
|
+
ot as Indent,
|
|
522
|
+
pt as LargeText,
|
|
523
|
+
ut as Nest,
|
|
524
|
+
nt as ResizeAwareBox,
|
|
525
|
+
rt as Row,
|
|
526
|
+
it as ScreenReaderOnlyText,
|
|
527
|
+
Ze as SeparatorLine,
|
|
528
|
+
dt as SmallText,
|
|
529
|
+
lt as SmallerText,
|
|
530
|
+
ct as Space,
|
|
531
|
+
st as Spacing,
|
|
532
|
+
mt as StandardText,
|
|
533
|
+
x as Text,
|
|
534
|
+
at as Txt,
|
|
535
|
+
_ as booleanOrNumberToNumber,
|
|
536
|
+
Mt as exhaustSwitchCase,
|
|
537
|
+
Tt as exhaustSwitchCaseElseThrow,
|
|
538
|
+
$e as getDataProps,
|
|
539
|
+
ve as getDimensionObject,
|
|
540
|
+
Dt as parseFloatElseUndefined,
|
|
541
|
+
Lt as parseIntElseUndefined,
|
|
542
|
+
Ot as truthyKeysAsList,
|
|
543
|
+
ft as useArraySet,
|
|
540
544
|
E as useBoolean,
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
545
|
+
vt as useDebounce,
|
|
546
|
+
wt as useDelayedFalse,
|
|
547
|
+
bt as useDomId,
|
|
548
|
+
be as useElementDimensions,
|
|
549
|
+
gt as useElementFocus,
|
|
550
|
+
b as useEventListener,
|
|
551
|
+
St as useForwardedRef,
|
|
552
|
+
_t as useMouseIsEntered,
|
|
553
|
+
xt as useMouseIsOver,
|
|
554
|
+
$t as useMultiOnClickOutside,
|
|
555
|
+
yt as useOnClickOutside,
|
|
556
|
+
Et as useOnNoMouseMovement,
|
|
557
|
+
It as useOnScreen,
|
|
558
|
+
Ct as useTimeoutState
|
|
555
559
|
};
|
|
556
560
|
//# sourceMappingURL=index.es.js.map
|