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