@stenajs-webui/core 19.0.4 → 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 +222 -220
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +6 -14
- package/dist/index.js.map +1 -1
- 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
|
|
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
6
|
import F from "@emotion/is-prop-valid";
|
|
7
|
-
import { system as
|
|
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
8
|
import { pickBy as se, debounce as ce } from "lodash";
|
|
9
9
|
import O from "classnames";
|
|
10
10
|
import * as ue from "react-dom";
|
|
11
|
-
const ie =
|
|
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
|
-
`, Ye = p(
|
|
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 ie = _.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,42 +62,42 @@ const ie = _.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:
|
|
68
|
+
hoverBackground: m,
|
|
69
|
+
focusBackground: f,
|
|
73
70
|
type: D = "button",
|
|
74
|
-
...
|
|
75
|
-
},
|
|
76
|
-
|
|
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,
|
|
84
81
|
disableFocusHighlight: e,
|
|
85
82
|
pointer: !!(t || n) && !s,
|
|
86
|
-
ref:
|
|
83
|
+
ref: k,
|
|
87
84
|
background: d,
|
|
88
|
-
hoverBackground:
|
|
89
|
-
focusBackground:
|
|
85
|
+
hoverBackground: m,
|
|
86
|
+
focusBackground: f,
|
|
90
87
|
type: D,
|
|
91
|
-
...
|
|
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) => {
|
|
96
93
|
if (e !== 0)
|
|
97
94
|
return `calc(${e} * var(--swui-metrics-space))`;
|
|
98
|
-
}, S = (e) =>
|
|
95
|
+
}, S = (e) => le(_(e)), me = {
|
|
99
96
|
box: "var(--swui-shadow-box)",
|
|
100
97
|
popover: "var(--swui-shadow-popover)",
|
|
101
98
|
modal: "var(--swui-shadow-modal)",
|
|
102
99
|
bottom: "var(--swui-shadow-bottom)"
|
|
103
|
-
},
|
|
100
|
+
}, pe = [
|
|
104
101
|
"spacing",
|
|
105
102
|
"indent",
|
|
106
103
|
"gap",
|
|
@@ -108,22 +105,25 @@ const ie = _.hr`
|
|
|
108
105
|
"height",
|
|
109
106
|
"overflow",
|
|
110
107
|
"display"
|
|
111
|
-
], he = (e) =>
|
|
108
|
+
], he = (e) => pe.includes(e), fe = N({
|
|
112
109
|
row: {
|
|
113
110
|
property: "flexDirection",
|
|
114
111
|
transform: (e) => e ? "row" : "column"
|
|
115
112
|
},
|
|
116
113
|
indent: {
|
|
114
|
+
// @ts-ignore
|
|
117
115
|
property: "--current-indent",
|
|
118
|
-
transform:
|
|
116
|
+
transform: _
|
|
119
117
|
},
|
|
120
118
|
spacing: {
|
|
119
|
+
// @ts-ignore
|
|
121
120
|
property: "--current-spacing",
|
|
122
|
-
transform:
|
|
121
|
+
transform: _
|
|
123
122
|
},
|
|
124
123
|
gap: {
|
|
124
|
+
// @ts-ignore
|
|
125
125
|
property: "--current-gap",
|
|
126
|
-
transform:
|
|
126
|
+
transform: _
|
|
127
127
|
},
|
|
128
128
|
columnGap: {
|
|
129
129
|
property: "columnGap",
|
|
@@ -135,12 +135,9 @@ const ie = _.hr`
|
|
|
135
135
|
},
|
|
136
136
|
shadow: {
|
|
137
137
|
property: "boxShadow",
|
|
138
|
-
transform: (e) =>
|
|
139
|
-
var t;
|
|
140
|
-
return (t = le[e]) != null ? t : e;
|
|
141
|
-
}
|
|
138
|
+
transform: (e) => me[e] ?? e
|
|
142
139
|
}
|
|
143
|
-
}), g =
|
|
140
|
+
}), g = y("div", {
|
|
144
141
|
shouldForwardProp: (e) => typeof e == "string" ? he(e) ? !1 : F(e) : !1
|
|
145
142
|
})`
|
|
146
143
|
--current-spacing: 0;
|
|
@@ -149,8 +146,8 @@ const ie = _.hr`
|
|
|
149
146
|
box-sizing: border-box;
|
|
150
147
|
display: flex;
|
|
151
148
|
flex-direction: column;
|
|
152
|
-
${
|
|
153
|
-
${
|
|
149
|
+
${fe};
|
|
150
|
+
${j};
|
|
154
151
|
${P};
|
|
155
152
|
${V};
|
|
156
153
|
${A};
|
|
@@ -190,26 +187,26 @@ const ie = _.hr`
|
|
|
190
187
|
${({ focusWithinBackground: e }) => e ? `background: ${e};` : ""}
|
|
191
188
|
${({ focusWithinBorder: e }) => e ? `border: ${e};` : ""}
|
|
192
189
|
}
|
|
193
|
-
`,
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
-
}),
|
|
196
|
-
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();
|
|
197
194
|
return {
|
|
198
195
|
width: r,
|
|
199
196
|
height: o,
|
|
200
197
|
top: c,
|
|
201
|
-
left:
|
|
198
|
+
left: a,
|
|
202
199
|
x: t,
|
|
203
200
|
y: n,
|
|
204
201
|
right: u,
|
|
205
202
|
bottom: s
|
|
206
203
|
};
|
|
207
|
-
},
|
|
208
|
-
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(() => {
|
|
209
206
|
window.requestAnimationFrame(() => {
|
|
210
207
|
if (e.current) {
|
|
211
|
-
const s =
|
|
212
|
-
(!n || !
|
|
208
|
+
const s = ve(e.current);
|
|
209
|
+
(!n || !we(n, s)) && t && t(s), r(s);
|
|
213
210
|
}
|
|
214
211
|
});
|
|
215
212
|
}, [e, n, r, t]);
|
|
@@ -218,57 +215,57 @@ const ie = _.hr`
|
|
|
218
215
|
}, [o]), {
|
|
219
216
|
dimensions: n
|
|
220
217
|
};
|
|
221
|
-
},
|
|
218
|
+
}, nt = h(
|
|
222
219
|
function({ onResize: t, ...n }, r) {
|
|
223
|
-
const o =
|
|
224
|
-
return
|
|
220
|
+
const o = w(null);
|
|
221
|
+
return be(r ?? o, t), /* @__PURE__ */ i(g, { ...n, ref: r });
|
|
225
222
|
}
|
|
226
|
-
),
|
|
227
|
-
return /* @__PURE__ */
|
|
228
|
-
}),
|
|
229
|
-
return /* @__PURE__ */
|
|
230
|
-
}),
|
|
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(
|
|
231
228
|
function({ num: t = 1, ...n }, r) {
|
|
232
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ i(g, { spacing: t, ref: r, ...n });
|
|
233
230
|
}
|
|
234
|
-
),
|
|
231
|
+
), ge = y.div`
|
|
235
232
|
--current-size: 1;
|
|
236
233
|
flex: none;
|
|
237
234
|
width: calc(var(--current-size) * var(--swui-metrics-space));
|
|
238
235
|
height: calc(var(--current-size) * var(--swui-metrics-space));
|
|
239
|
-
`,
|
|
236
|
+
`, ct = ({
|
|
240
237
|
half: e = !1,
|
|
241
238
|
horizontal: t = !1,
|
|
242
239
|
num: n = 1,
|
|
243
240
|
vertical: r = !1
|
|
244
241
|
}) => {
|
|
245
242
|
const o = n * (e ? 0.5 : 1);
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
|
|
243
|
+
return /* @__PURE__ */ i(
|
|
244
|
+
ge,
|
|
248
245
|
{
|
|
249
246
|
style: {
|
|
250
|
-
|
|
247
|
+
"--current-size": o,
|
|
251
248
|
height: t ? 1 : void 0,
|
|
252
249
|
width: r ? 1 : void 0
|
|
253
250
|
}
|
|
254
251
|
}
|
|
255
252
|
);
|
|
256
|
-
},
|
|
257
|
-
visuallyHidden:
|
|
258
|
-
}, $e = (e) => se(e,
|
|
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 = ({
|
|
259
256
|
children: e,
|
|
260
257
|
...t
|
|
261
|
-
}) => /* @__PURE__ */
|
|
262
|
-
text:
|
|
263
|
-
standard:
|
|
264
|
-
bold:
|
|
265
|
-
caption:
|
|
266
|
-
overline:
|
|
267
|
-
large:
|
|
268
|
-
medium:
|
|
269
|
-
small:
|
|
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,
|
|
270
267
|
smaller: ke
|
|
271
|
-
}, x =
|
|
268
|
+
}, x = h(
|
|
272
269
|
({
|
|
273
270
|
children: e,
|
|
274
271
|
variant: t = "standard",
|
|
@@ -277,28 +274,36 @@ const ie = _.hr`
|
|
|
277
274
|
color: o,
|
|
278
275
|
userSelect: s,
|
|
279
276
|
whiteSpace: c,
|
|
280
|
-
wordBreak:
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
277
|
+
wordBreak: a,
|
|
278
|
+
textAlign: u,
|
|
279
|
+
style: d,
|
|
280
|
+
...m
|
|
281
|
+
}, f) => /* @__PURE__ */ i(
|
|
284
282
|
"span",
|
|
285
283
|
{
|
|
286
|
-
className: O(
|
|
287
|
-
ref:
|
|
288
|
-
style: {
|
|
289
|
-
|
|
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,
|
|
290
295
|
children: e
|
|
291
296
|
}
|
|
292
297
|
)
|
|
293
|
-
),
|
|
294
|
-
heading:
|
|
295
|
-
h1:
|
|
296
|
-
h2:
|
|
297
|
-
h3:
|
|
298
|
-
h4:
|
|
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,
|
|
299
304
|
h5: je,
|
|
300
|
-
h6:
|
|
301
|
-
},
|
|
305
|
+
h6: Pe
|
|
306
|
+
}, Ve = h(
|
|
302
307
|
({
|
|
303
308
|
variant: e = "h3",
|
|
304
309
|
className: t,
|
|
@@ -307,48 +312,45 @@ const ie = _.hr`
|
|
|
307
312
|
wordBreak: o,
|
|
308
313
|
style: s,
|
|
309
314
|
children: c,
|
|
310
|
-
as:
|
|
315
|
+
as: a,
|
|
311
316
|
...u
|
|
312
|
-
}, d) =>
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
{
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
), ht = (e) => /* @__PURE__ */ a(Pe, { variant: "h2", ...e }), Ve = (e, t) => e === t, pt = (e, t, n = Ve) => {
|
|
326
|
-
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(
|
|
327
329
|
(u) => {
|
|
328
330
|
e.some((d) => n(d, u)) || t([...e, u]);
|
|
329
331
|
},
|
|
330
332
|
[e, t, n]
|
|
331
|
-
), o =
|
|
333
|
+
), o = p(
|
|
332
334
|
(u) => {
|
|
333
335
|
t(
|
|
334
|
-
u.reduce((d,
|
|
336
|
+
u.reduce((d, m) => d.some((f) => n(f, m)) ? d : [...d, m], e)
|
|
335
337
|
);
|
|
336
338
|
},
|
|
337
339
|
[e, t, n]
|
|
338
|
-
), s =
|
|
340
|
+
), s = p(
|
|
339
341
|
(u) => {
|
|
340
|
-
const d = e.findIndex((
|
|
341
|
-
d >= 0 && t(e.filter((
|
|
342
|
+
const d = e.findIndex((m) => n(m, u));
|
|
343
|
+
d >= 0 && t(e.filter((m, f) => f !== d));
|
|
342
344
|
},
|
|
343
345
|
[e, t, n]
|
|
344
|
-
), c =
|
|
346
|
+
), c = p(
|
|
345
347
|
(u) => {
|
|
346
|
-
t(e.filter((d) => !u.some((
|
|
348
|
+
t(e.filter((d) => !u.some((m) => n(m, d))));
|
|
347
349
|
},
|
|
348
350
|
[e, t, n]
|
|
349
|
-
),
|
|
351
|
+
), a = p(
|
|
350
352
|
(u) => {
|
|
351
|
-
e.some((
|
|
353
|
+
e.some((m) => n(m, u)) ? s(u) : r(u);
|
|
352
354
|
},
|
|
353
355
|
[e, r, s, n]
|
|
354
356
|
);
|
|
@@ -357,20 +359,20 @@ const ie = _.hr`
|
|
|
357
359
|
addMultiple: o,
|
|
358
360
|
remove: s,
|
|
359
361
|
removeMultiple: c,
|
|
360
|
-
toggle:
|
|
362
|
+
toggle: a
|
|
361
363
|
};
|
|
362
364
|
}, E = (e) => {
|
|
363
|
-
const [t, n] =
|
|
365
|
+
const [t, n] = v(e), r = p(() => {
|
|
364
366
|
n(!0);
|
|
365
|
-
}, [n]), o =
|
|
367
|
+
}, [n]), o = p(() => {
|
|
366
368
|
n(!1);
|
|
367
|
-
}, [n]), s =
|
|
369
|
+
}, [n]), s = p(() => {
|
|
368
370
|
n((c) => !c);
|
|
369
371
|
}, [n]);
|
|
370
372
|
return [t, r, o, s];
|
|
371
|
-
},
|
|
372
|
-
const [n, r] =
|
|
373
|
-
return
|
|
373
|
+
}, vt = (e, t) => {
|
|
374
|
+
const [n, r] = v(e);
|
|
375
|
+
return l(() => {
|
|
374
376
|
const o = setTimeout(() => {
|
|
375
377
|
r(e);
|
|
376
378
|
}, t);
|
|
@@ -378,9 +380,9 @@ const ie = _.hr`
|
|
|
378
380
|
clearTimeout(o);
|
|
379
381
|
};
|
|
380
382
|
}, [e, t]), n;
|
|
381
|
-
},
|
|
382
|
-
const [n, r] =
|
|
383
|
-
return
|
|
383
|
+
}, wt = (e, t) => {
|
|
384
|
+
const [n, r] = v(e);
|
|
385
|
+
return l(() => {
|
|
384
386
|
e && r(!0);
|
|
385
387
|
const o = setTimeout(() => {
|
|
386
388
|
e || r(e);
|
|
@@ -390,20 +392,20 @@ const ie = _.hr`
|
|
|
390
392
|
};
|
|
391
393
|
}, [e, t]), n;
|
|
392
394
|
};
|
|
393
|
-
let
|
|
394
|
-
const T = (e) => `webui-${e ? e + "-" : ""}${++
|
|
395
|
-
const [t, n] =
|
|
396
|
-
return
|
|
397
|
-
},
|
|
398
|
-
const r =
|
|
399
|
-
|
|
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(() => {
|
|
400
402
|
r.current = n;
|
|
401
|
-
}, [n]),
|
|
403
|
+
}, [n]), l(() => {
|
|
402
404
|
if (!(e.current && e.current.addEventListener))
|
|
403
405
|
return;
|
|
404
|
-
const s = (
|
|
406
|
+
const s = (a) => {
|
|
405
407
|
if (r.current)
|
|
406
|
-
return r.current(
|
|
408
|
+
return r.current(a);
|
|
407
409
|
};
|
|
408
410
|
if (!e.current)
|
|
409
411
|
return;
|
|
@@ -412,42 +414,42 @@ const T = (e) => `webui-${e ? e + "-" : ""}${++Ae}`, wt = (e) => {
|
|
|
412
414
|
c && c.removeEventListener(t, s);
|
|
413
415
|
};
|
|
414
416
|
}, [t, e]);
|
|
415
|
-
},
|
|
417
|
+
}, gt = (e) => {
|
|
416
418
|
const [t, n, r] = E(!1);
|
|
417
|
-
|
|
419
|
+
l(() => {
|
|
418
420
|
document.activeElement === ue.findDOMNode(e.current) ? n() : r();
|
|
419
|
-
}, [e, r, n]),
|
|
420
|
-
const o =
|
|
421
|
+
}, [e, r, n]), b(e, "focus", n), b(e, "blur", r);
|
|
422
|
+
const o = p(() => {
|
|
421
423
|
e.current && e.current.focus();
|
|
422
|
-
}, [e]), s =
|
|
424
|
+
}, [e]), s = p(() => {
|
|
423
425
|
e.current && e.current.blur();
|
|
424
426
|
}, [e]);
|
|
425
427
|
return { isInFocus: t, focus: o, blur: s };
|
|
426
|
-
}, gt = (e) => {
|
|
427
|
-
const [t, n, r] = E(!1);
|
|
428
|
-
return w(e, "mouseover", n), w(e, "mouseout", r), t;
|
|
429
428
|
}, xt = (e) => {
|
|
430
429
|
const [t, n, r] = E(!1);
|
|
431
|
-
return
|
|
430
|
+
return b(e, "mouseover", n), b(e, "mouseout", r), t;
|
|
431
|
+
}, _t = (e) => {
|
|
432
|
+
const [t, n, r] = E(!1);
|
|
433
|
+
return b(e, "mouseenter", n), b(e, "mouseleave", r), t;
|
|
432
434
|
}, $t = (e, t) => {
|
|
433
|
-
const n =
|
|
435
|
+
const n = w(() => {
|
|
434
436
|
});
|
|
435
|
-
|
|
437
|
+
l(() => {
|
|
436
438
|
n.current = t;
|
|
437
|
-
}, [t]),
|
|
439
|
+
}, [t]), l(() => {
|
|
438
440
|
const r = (o) => {
|
|
439
|
-
|
|
441
|
+
e.filter((c) => c.current).every((c) => c.current && !c.current.contains(o.target)) && n.current(o);
|
|
440
442
|
};
|
|
441
443
|
return document.addEventListener("mousedown", r), document.addEventListener("touchstart", r), () => {
|
|
442
444
|
document.removeEventListener("mousedown", r), document.removeEventListener("touchstart", r);
|
|
443
445
|
};
|
|
444
446
|
}, [...e]);
|
|
445
|
-
},
|
|
446
|
-
const r =
|
|
447
|
+
}, yt = (e, t, n) => {
|
|
448
|
+
const r = w(() => {
|
|
447
449
|
});
|
|
448
|
-
|
|
450
|
+
l(() => {
|
|
449
451
|
r.current = t;
|
|
450
|
-
}, [t]),
|
|
452
|
+
}, [t]), l(() => {
|
|
451
453
|
const o = (s) => {
|
|
452
454
|
!e.current || e.current.contains(s.target) || r.current(s);
|
|
453
455
|
};
|
|
@@ -455,12 +457,12 @@ const T = (e) => `webui-${e ? e + "-" : ""}${++Ae}`, wt = (e) => {
|
|
|
455
457
|
document.removeEventListener("mousedown", o, n), document.removeEventListener("touchstart", o, n);
|
|
456
458
|
};
|
|
457
459
|
}, [e, n]);
|
|
458
|
-
}, M = ["mousemove", "mousedown", "keydown", "touchstart", "scroll"],
|
|
459
|
-
const n =
|
|
460
|
+
}, M = ["mousemove", "mousedown", "keydown", "touchstart", "scroll"], Et = (e, t) => {
|
|
461
|
+
const n = w(() => {
|
|
460
462
|
});
|
|
461
|
-
|
|
463
|
+
l(() => {
|
|
462
464
|
n.current = e;
|
|
463
|
-
}, [e]),
|
|
465
|
+
}, [e]), l(() => {
|
|
464
466
|
const r = ce(n.current, t);
|
|
465
467
|
return M.forEach((o) => window.addEventListener(o, r)), () => {
|
|
466
468
|
M.forEach(
|
|
@@ -468,8 +470,8 @@ const T = (e) => `webui-${e ? e + "-" : ""}${++Ae}`, wt = (e) => {
|
|
|
468
470
|
);
|
|
469
471
|
};
|
|
470
472
|
}, [t]);
|
|
471
|
-
},
|
|
472
|
-
const [n, r] =
|
|
473
|
+
}, It = (e, t) => {
|
|
474
|
+
const [n, r] = v(!1), { rootMargin: o, root: s, threshold: c } = t || {}, a = z(() => new IntersectionObserver(
|
|
473
475
|
([u]) => r(u.isIntersecting),
|
|
474
476
|
{
|
|
475
477
|
rootMargin: o,
|
|
@@ -477,33 +479,33 @@ const T = (e) => `webui-${e ? e + "-" : ""}${++Ae}`, wt = (e) => {
|
|
|
477
479
|
threshold: c
|
|
478
480
|
}
|
|
479
481
|
), [r, o, s, c]);
|
|
480
|
-
return
|
|
481
|
-
|
|
482
|
-
}), [
|
|
483
|
-
},
|
|
484
|
-
const t =
|
|
485
|
-
return
|
|
486
|
-
|
|
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);
|
|
487
489
|
}), t;
|
|
488
|
-
},
|
|
489
|
-
const [r, o] =
|
|
490
|
-
(
|
|
491
|
-
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);
|
|
492
494
|
},
|
|
493
495
|
[t, n, e]
|
|
494
496
|
);
|
|
495
|
-
return
|
|
497
|
+
return l(() => () => {
|
|
496
498
|
clearTimeout(s.current);
|
|
497
499
|
}, []), [r, c];
|
|
498
|
-
},
|
|
500
|
+
}, Tt = (e) => {
|
|
499
501
|
throw new Error(`Switch unhandled case: ${e}`);
|
|
500
|
-
},
|
|
502
|
+
}, Mt = (e, t) => t, Ot = (e) => Object.keys(e).filter((t) => e[t]), Dt = (e) => {
|
|
501
503
|
try {
|
|
502
504
|
const t = parseFloat(e);
|
|
503
505
|
return isNaN(t) || t == null ? void 0 : t;
|
|
504
506
|
} catch {
|
|
505
507
|
}
|
|
506
|
-
},
|
|
508
|
+
}, Lt = (e) => {
|
|
507
509
|
try {
|
|
508
510
|
const t = parseInt(e, 10);
|
|
509
511
|
return isNaN(t) || t == null ? void 0 : t;
|
|
@@ -512,47 +514,47 @@ const T = (e) => `webui-${e ? e + "-" : ""}${++Ae}`, wt = (e) => {
|
|
|
512
514
|
};
|
|
513
515
|
export {
|
|
514
516
|
g as Box,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
+
et as Clickable,
|
|
518
|
+
tt as Column,
|
|
517
519
|
ht as HeaderText,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
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,
|
|
531
533
|
x as Text,
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
534
|
+
at as Txt,
|
|
535
|
+
_ as booleanOrNumberToNumber,
|
|
536
|
+
Mt as exhaustSwitchCase,
|
|
537
|
+
Tt as exhaustSwitchCaseElseThrow,
|
|
536
538
|
$e as getDataProps,
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
539
|
+
ve as getDimensionObject,
|
|
540
|
+
Dt as parseFloatElseUndefined,
|
|
541
|
+
Lt as parseIntElseUndefined,
|
|
542
|
+
Ot as truthyKeysAsList,
|
|
543
|
+
ft as useArraySet,
|
|
542
544
|
E as useBoolean,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
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,
|
|
552
554
|
$t as useMultiOnClickOutside,
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
yt as useOnClickOutside,
|
|
556
|
+
Et as useOnNoMouseMovement,
|
|
557
|
+
It as useOnScreen,
|
|
558
|
+
Ct as useTimeoutState
|
|
557
559
|
};
|
|
558
560
|
//# sourceMappingURL=index.es.js.map
|