@koide-labs/ui 0.1.2 → 0.1.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/{InternalBackdrop-BSMKU-hc.js → InternalBackdrop-DDLgWc7D.js} +1 -1
- package/dist/accordion.css +1 -1
- package/dist/alert-dialog.css +1 -1
- package/dist/anchor.css +1 -1
- package/dist/avatar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/button.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/code.css +1 -1
- package/dist/collapse.css +1 -1
- package/dist/command.css +1 -1
- package/dist/components/accordion/accordion.js +54 -54
- package/dist/components/alert-dialog/alert-dialog.js +6 -6
- package/dist/components/anchor/anchor.js +7 -7
- package/dist/components/avatar/avatar.js +13 -13
- package/dist/components/badge/badge.js +17 -17
- package/dist/components/button/button.js +12 -12
- package/dist/components/checkbox/checkbox.js +15 -15
- package/dist/components/code/code.js +32 -32
- package/dist/components/collapse/collapse.js +5 -5
- package/dist/components/command/command.js +4 -4
- package/dist/components/context-menu/context-menu.js +13 -13
- package/dist/components/dialog/dialog.js +2 -2
- package/dist/components/heading/heading.js +9 -9
- package/dist/components/icon/icon.js +7 -7
- package/dist/components/icon-button/icon-button.js +24 -24
- package/dist/components/inline-code/inline-code.js +7 -7
- package/dist/components/input/input.js +1 -1
- package/dist/components/meter/meter.js +10 -10
- package/dist/components/multiline-input/multiline-input.js +1 -1
- package/dist/components/number-input/number-input.js +60 -60
- package/dist/components/password-input/password-input.js +6 -6
- package/dist/components/pill/pill.js +15 -15
- package/dist/components/popover/popover.js +31 -31
- package/dist/components/preview-card/preview-card.js +5 -5
- package/dist/components/radio-group/radio-group.js +109 -109
- package/dist/components/search-bar/search-bar.js +10 -10
- package/dist/components/select/select.js +8 -8
- package/dist/components/separator/index.js +1 -1
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/slider/slider.js +114 -114
- package/dist/components/spinner/spinner.js +4 -4
- package/dist/components/stacked-avatars/stacked-avatars.js +37 -37
- package/dist/components/status-banner/status-banner.js +22 -22
- package/dist/components/surface/surface.js +17 -17
- package/dist/components/switch/switch.js +28 -28
- package/dist/components/tabs/tabs.js +116 -116
- package/dist/components/text/text.js +16 -16
- package/dist/components/timestamp/timestamp.js +2 -2
- package/dist/components/toaster/toaster.js +145 -145
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.js +2 -2
- package/dist/components/view/view.js +40 -40
- package/dist/context-menu.css +1 -1
- package/dist/dialog.css +1 -1
- package/dist/{dialog.module-Pi1eHwli.js → dialog.module-CRiRBcbM.js} +66 -66
- package/dist/{getDisabledMountTransitionStyles-E2x-_lte.js → getDisabledMountTransitionStyles-CyEI2117.js} +1 -1
- package/dist/heading.css +1 -1
- package/dist/icon-button.css +1 -1
- package/dist/icon.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/index2.css +1 -1
- package/dist/inline-code.css +1 -1
- package/dist/input.css +1 -1
- package/dist/input.module-CYcyDtrO.js +8 -0
- package/dist/integrations/react-markdown/index.js +26 -26
- package/dist/integrations/twemoji/index.js +1 -1
- package/dist/meter.css +1 -1
- package/dist/number-input.css +1 -1
- package/dist/password-input.css +1 -1
- package/dist/pill.css +1 -1
- package/dist/popover.css +1 -1
- package/dist/preview-card.css +1 -1
- package/dist/radio-group.css +1 -1
- package/dist/{safePolygon-DnkzOIur.js → safePolygon-lAEp2rci.js} +1 -1
- package/dist/search-bar.css +1 -1
- package/dist/select.css +1 -1
- package/dist/{separator-wNYojB9q.js → separator-Or-BDQYZ.js} +13 -13
- package/dist/separator.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/spinner.css +1 -1
- package/dist/stacked-avatars.css +1 -1
- package/dist/status-banner.css +1 -1
- package/dist/styles/core.css +1 -1
- package/dist/surface.css +1 -1
- package/dist/switch.css +1 -1
- package/dist/tabs.css +1 -1
- package/dist/text.css +1 -1
- package/dist/timestamp.css +1 -1
- package/dist/toaster.css +1 -1
- package/dist/{tooltip-DZkByWDR.js → tooltip-JPnUwFFR.js} +6 -6
- package/dist/tooltip.css +1 -1
- package/dist/transitions.css +1 -1
- package/dist/{transitions.module-D9mMAtfI.js → transitions.module-SSNmQfsR.js} +43 -43
- package/dist/{useRole-BD3OL1rr.js → useRole-D1k7CnHQ.js} +1 -1
- package/dist/{useSyncedFloatingRootContext-BB1vwkV-.js → useSyncedFloatingRootContext-CaohymZI.js} +1 -1
- package/dist/{useTypeahead-BiL5IAVb.js → useTypeahead-CSZtonjF.js} +2 -2
- package/dist/view.css +1 -1
- package/dist/view.module-j3ylJCCE.js +6 -0
- package/dist/view2.css +1 -1
- package/package.json +2 -1
- package/dist/components/dialog/dialog.types.js +0 -1
- package/dist/components/icon/icon.types.js +0 -1
- package/dist/components/surface/surface.types.js +0 -1
- package/dist/components/view/view.types.js +0 -1
- package/dist/input.module-zw1dlr1_.js +0 -8
- package/dist/view.module-DlwuNdUj.js +0 -6
|
@@ -5,7 +5,7 @@ import { Text as x } from "../text/text.js";
|
|
|
5
5
|
import * as i from "react";
|
|
6
6
|
import { f as T } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
7
7
|
import { f as E } from "../../formatNumber-1UNwjeqf.js";
|
|
8
|
-
import { u
|
|
8
|
+
import { u } from "../../useRenderElement-DngNDu_P.js";
|
|
9
9
|
import { u as P } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
10
10
|
import { u as j } from "../../useBaseUiId-B7WyxtIE.js";
|
|
11
11
|
import { v as B } from "../../valueToPercent-DaP9qN4u.js";
|
|
@@ -33,9 +33,9 @@ const V = /* @__PURE__ */ i.forwardRef(function(e, r) {
|
|
|
33
33
|
render: W,
|
|
34
34
|
className: q,
|
|
35
35
|
...I
|
|
36
|
-
} = e, [b, v] = i.useState(),
|
|
36
|
+
} = e, [b, v] = i.useState(), d = S(o, s, c);
|
|
37
37
|
let p = `${o}%`;
|
|
38
|
-
m ? p = m(
|
|
38
|
+
m ? p = m(d, o) : c && (p = d);
|
|
39
39
|
const k = {
|
|
40
40
|
"aria-labelledby": b,
|
|
41
41
|
"aria-valuemax": n,
|
|
@@ -44,12 +44,12 @@ const V = /* @__PURE__ */ i.forwardRef(function(e, r) {
|
|
|
44
44
|
"aria-valuetext": p,
|
|
45
45
|
role: "meter"
|
|
46
46
|
}, D = i.useMemo(() => ({
|
|
47
|
-
formattedValue:
|
|
47
|
+
formattedValue: d,
|
|
48
48
|
max: n,
|
|
49
49
|
min: a,
|
|
50
50
|
setLabelId: v,
|
|
51
51
|
value: o
|
|
52
|
-
}), [
|
|
52
|
+
}), [d, n, a, v, o]), O = u("div", e, {
|
|
53
53
|
ref: r,
|
|
54
54
|
props: [k, I]
|
|
55
55
|
});
|
|
@@ -65,7 +65,7 @@ const h = /* @__PURE__ */ i.forwardRef(function(e, r) {
|
|
|
65
65
|
className: m,
|
|
66
66
|
...s
|
|
67
67
|
} = e;
|
|
68
|
-
return
|
|
68
|
+
return u("div", e, {
|
|
69
69
|
ref: r,
|
|
70
70
|
props: s
|
|
71
71
|
});
|
|
@@ -77,7 +77,7 @@ const w = /* @__PURE__ */ i.forwardRef(function(e, r) {
|
|
|
77
77
|
className: m,
|
|
78
78
|
...s
|
|
79
79
|
} = e, n = N(), a = B(n.value, n.min, n.max);
|
|
80
|
-
return
|
|
80
|
+
return u("div", e, {
|
|
81
81
|
ref: r,
|
|
82
82
|
props: [{
|
|
83
83
|
style: {
|
|
@@ -99,7 +99,7 @@ const R = /* @__PURE__ */ i.forwardRef(function(e, r) {
|
|
|
99
99
|
value: a,
|
|
100
100
|
formattedValue: o
|
|
101
101
|
} = N();
|
|
102
|
-
return
|
|
102
|
+
return u("span", e, {
|
|
103
103
|
ref: r,
|
|
104
104
|
props: [{
|
|
105
105
|
"aria-hidden": !0,
|
|
@@ -117,7 +117,7 @@ const y = /* @__PURE__ */ i.forwardRef(function(e, r) {
|
|
|
117
117
|
} = e, a = j(s), {
|
|
118
118
|
setLabelId: o
|
|
119
119
|
} = N();
|
|
120
|
-
return P(() => (o(a), () => o(void 0)), [a, o]),
|
|
120
|
+
return P(() => (o(a), () => o(void 0)), [a, o]), u("span", e, {
|
|
121
121
|
ref: r,
|
|
122
122
|
props: [{
|
|
123
123
|
id: a
|
|
@@ -125,7 +125,7 @@ const y = /* @__PURE__ */ i.forwardRef(function(e, r) {
|
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
process.env.NODE_ENV !== "production" && (y.displayName = "MeterLabel");
|
|
128
|
-
const U = "
|
|
128
|
+
const U = "_meter_scpmw_3", $ = "_meter__value_scpmw_9", A = "_meter__track_scpmw_15", F = "_meter__indicator_scpmw_22", f = {
|
|
129
129
|
meter: U,
|
|
130
130
|
meter__value: $,
|
|
131
131
|
meter__track: A,
|
|
@@ -2,7 +2,7 @@ import { jsx as T } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as R } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { useRef as W, useEffect as Y } from "react";
|
|
4
4
|
import { mergeRefs as B } from "../../-utils.js";
|
|
5
|
-
import { s as b } from "../../input.module-
|
|
5
|
+
import { s as b } from "../../input.module-CYcyDtrO.js";
|
|
6
6
|
import { View as X } from "../view/view.js";
|
|
7
7
|
var c = /* @__PURE__ */ new Map();
|
|
8
8
|
function j(t) {
|
|
@@ -6,7 +6,7 @@ import { Text as kt } from "../text/text.js";
|
|
|
6
6
|
import { Input as Wt } from "../input/input.js";
|
|
7
7
|
import { View as Ht } from "../view/view.js";
|
|
8
8
|
import { IconButton as tt } from "../icon-button/icon-button.js";
|
|
9
|
-
import { S as Gt } from "../../separator-
|
|
9
|
+
import { S as Gt } from "../../separator-Or-BDQYZ.js";
|
|
10
10
|
import { u as Bt } from "../../useControlled-Du4sJyMj.js";
|
|
11
11
|
import { u as de } from "../../useStableCallback-DKZHlUAT.js";
|
|
12
12
|
import { T as $t, u as Ke } from "../../useTimeout-BNni6aw5.js";
|
|
@@ -106,7 +106,7 @@ function Se(n, r, t) {
|
|
|
106
106
|
} = Je(p, t), R = ke(p, t).formatToParts(1).filter((c) => c.type === "unit").map((c) => Le(c.value)), K = R.length ? new RegExp(R.join("|"), "g") : null;
|
|
107
107
|
let G = null;
|
|
108
108
|
m && (new RegExp("\\p{Zs}", "u").test(m) ? G = new RegExp("\\p{Zs}", "gu") : m === "'" || m === "’" ? G = /['’]/g : G = new RegExp(Le(m), "g"));
|
|
109
|
-
let
|
|
109
|
+
let F = [
|
|
110
110
|
{
|
|
111
111
|
regex: m ? G : null,
|
|
112
112
|
replacement: ""
|
|
@@ -167,10 +167,10 @@ function Se(n, r, t) {
|
|
|
167
167
|
regex: W,
|
|
168
168
|
replacement: x
|
|
169
169
|
}) => W ? c.replace(W, x) : c, s);
|
|
170
|
-
const O =
|
|
171
|
-
if (O !== -1 && (
|
|
170
|
+
const O = F.lastIndexOf(".");
|
|
171
|
+
if (O !== -1 && (F = `${F.slice(0, O).replace(/\./g, "")}.${F.slice(O + 1).replace(/\./g, "")}`), /^[-+]?Infinity$/i.test(s) || /[∞]/.test(s))
|
|
172
172
|
return null;
|
|
173
|
-
const q = (a ? "-" : "") +
|
|
173
|
+
const q = (a ? "-" : "") + F;
|
|
174
174
|
let V = parseFloat(q);
|
|
175
175
|
const g = t?.style, d = g === "unit" && t?.unit === "percent", k = Nn.test(n) || g === "percent";
|
|
176
176
|
return Sn.test(n) ? V /= 1e3 : !d && k && (V /= 100), Number.isNaN(V) ? null : V;
|
|
@@ -183,7 +183,7 @@ function Vn(n) {
|
|
|
183
183
|
minimumFractionDigits: t
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function wn(n, r) {
|
|
187
187
|
if (!Number.isFinite(n))
|
|
188
188
|
return n;
|
|
189
189
|
const t = Math.min(Math.max(r, 0), 20);
|
|
@@ -193,9 +193,9 @@ function $e(n, r) {
|
|
|
193
193
|
const {
|
|
194
194
|
maximumFractionDigits: t
|
|
195
195
|
} = Vn(r);
|
|
196
|
-
return
|
|
196
|
+
return wn(n, t);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Fn(n, r, t, s = "directional") {
|
|
199
199
|
if (t === 0)
|
|
200
200
|
return n;
|
|
201
201
|
const a = Math.abs(t), f = Math.sign(t), S = a * Dn * f, p = s === "nearest" ? t : a, m = (n - r + S) / p;
|
|
@@ -219,7 +219,7 @@ function Mn(n, {
|
|
|
219
219
|
return $e(m, f);
|
|
220
220
|
let _ = a;
|
|
221
221
|
!p && t !== Number.MIN_SAFE_INTEGER && (_ = t);
|
|
222
|
-
const b =
|
|
222
|
+
const b = Fn(m, _, r, p ? "nearest" : "directional");
|
|
223
223
|
return $e(b, f);
|
|
224
224
|
}
|
|
225
225
|
return $e(m, f);
|
|
@@ -238,7 +238,7 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
238
238
|
name: K,
|
|
239
239
|
defaultValue: G,
|
|
240
240
|
value: h,
|
|
241
|
-
onValueChange:
|
|
241
|
+
onValueChange: F,
|
|
242
242
|
onValueCommitted: O,
|
|
243
243
|
allowWheelScrub: q = !1,
|
|
244
244
|
snapOnStep: V = !1,
|
|
@@ -269,21 +269,21 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
269
269
|
Ge(() => {
|
|
270
270
|
z(l !== null);
|
|
271
271
|
}, [z, l]);
|
|
272
|
-
const te = ln(), ie = nt(g), re = o.useRef(!1), ue = de((
|
|
273
|
-
re.current = !1, O?.(
|
|
274
|
-
}), fe = Ke(), ge = fn(), he = Ke(), Ve = o.useRef(!1),
|
|
275
|
-
}), [D, le] = o.useState(() => h !== void 0 ? lt(l, d, g) : Te(l, d, g)), [
|
|
272
|
+
const te = ln(), ie = nt(g), re = o.useRef(!1), ue = de((w, E) => {
|
|
273
|
+
re.current = !1, O?.(w, E);
|
|
274
|
+
}), fe = Ke(), ge = fn(), he = Ke(), Ve = o.useRef(!1), we = o.useRef(0), me = o.useRef(!0), Ee = o.useRef(null), pe = o.useRef(() => {
|
|
275
|
+
}), [D, le] = o.useState(() => h !== void 0 ? lt(l, d, g) : Te(l, d, g)), [Fe, Ft] = o.useState("numeric"), Qe = de(() => {
|
|
276
276
|
const {
|
|
277
|
-
decimal:
|
|
277
|
+
decimal: w,
|
|
278
278
|
group: E,
|
|
279
279
|
currency: B,
|
|
280
280
|
literal: $
|
|
281
281
|
} = Je(d, g), C = /* @__PURE__ */ new Set();
|
|
282
|
-
_n.forEach((ne) => C.add(ne)),
|
|
282
|
+
_n.forEach((ne) => C.add(ne)), w && C.add(w), E && (C.add(E), ct.test(E) && C.add(" "));
|
|
283
283
|
const ae = A === "percent" || A === "unit" && g?.unit === "percent", Ie = A === "percent" || A === "unit" && g?.unit === "permille";
|
|
284
284
|
return ae && ht.forEach((ne) => C.add(ne)), Ie && Et.forEach((ne) => C.add(ne)), A === "currency" && B && C.add(B), $ && (Array.from($).forEach((ne) => C.add(ne)), ct.test($) && C.add(" ")), xn.forEach((ne) => C.add(ne)), y < 0 && yn.forEach((ne) => C.add(ne)), C;
|
|
285
|
-
}), be = de((
|
|
286
|
-
const B = E.event, $ = E.direction, C = Mn(
|
|
285
|
+
}), be = de((w) => w?.altKey ? S : w?.shiftKey ? m : p), Me = de((w, E) => {
|
|
286
|
+
const B = E.event, $ = E.direction, C = Mn(w, {
|
|
287
287
|
step: $ ? be(B) * $ : void 0,
|
|
288
288
|
format: ie.current,
|
|
289
289
|
minWithDefault: y,
|
|
@@ -292,25 +292,25 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
292
292
|
snapOnStep: V,
|
|
293
293
|
small: B?.altKey ?? !1
|
|
294
294
|
});
|
|
295
|
-
if (C !== l ||
|
|
296
|
-
if (Ee.current = C,
|
|
295
|
+
if (C !== l || w !== l || me.current === !1) {
|
|
296
|
+
if (Ee.current = C, F?.(C, E), E.isCanceled)
|
|
297
297
|
return;
|
|
298
298
|
J(C), x(C !== H.initialValue), re.current = !0;
|
|
299
299
|
}
|
|
300
300
|
me.current && le(Te(C, d, g)), te();
|
|
301
|
-
}), Ce = de((
|
|
301
|
+
}), Ce = de((w, {
|
|
302
302
|
direction: E,
|
|
303
303
|
currentValue: B,
|
|
304
304
|
event: $,
|
|
305
305
|
reason: C
|
|
306
306
|
}) => {
|
|
307
|
-
const ae = B ?? oe.current, Ie = typeof ae == "number" ? ae +
|
|
307
|
+
const ae = B ?? oe.current, Ie = typeof ae == "number" ? ae + w * E : Math.max(0, a ?? 0);
|
|
308
308
|
Me(Ie, ce(C, $, void 0, {
|
|
309
309
|
direction: E
|
|
310
310
|
}));
|
|
311
311
|
}), Re = de(() => {
|
|
312
|
-
he.clear(), fe.clear(), ge.clear(), pe.current(),
|
|
313
|
-
}), et = de((
|
|
312
|
+
he.clear(), fe.clear(), ge.clear(), pe.current(), we.current = 0;
|
|
313
|
+
}), et = de((w, E) => {
|
|
314
314
|
if (Re(), !e.current)
|
|
315
315
|
return;
|
|
316
316
|
const B = We(e.current);
|
|
@@ -322,16 +322,16 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
322
322
|
}, B.addEventListener("pointerup", (ae) => {
|
|
323
323
|
Ve.current = !1, Re();
|
|
324
324
|
const Ie = Ee.current ?? oe.current;
|
|
325
|
-
ue(Ie, _e(
|
|
325
|
+
ue(Ie, _e(w ? "increment" : "decrement", ae));
|
|
326
326
|
}, {
|
|
327
327
|
once: !0
|
|
328
328
|
});
|
|
329
329
|
function C() {
|
|
330
330
|
const ae = be(E) ?? Pe;
|
|
331
331
|
Ce(ae, {
|
|
332
|
-
direction:
|
|
332
|
+
direction: w ? 1 : -1,
|
|
333
333
|
event: E,
|
|
334
|
-
reason:
|
|
334
|
+
reason: w ? "increment-press" : "decrement-press"
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
337
|
C(), fe.start(An, () => {
|
|
@@ -347,7 +347,7 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
347
347
|
if (!Xt)
|
|
348
348
|
return;
|
|
349
349
|
let E = "text";
|
|
350
|
-
y >= 0 && (E = "decimal"),
|
|
350
|
+
y >= 0 && (E = "decimal"), Ft(E);
|
|
351
351
|
}, [y, A]), o.useEffect(() => () => Re(), [Re]), o.useEffect(function() {
|
|
352
352
|
const E = e.current;
|
|
353
353
|
if (I || R || !q || !E)
|
|
@@ -399,11 +399,11 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
399
399
|
hasPendingCommitRef: re,
|
|
400
400
|
isPressedRef: Ve,
|
|
401
401
|
intentionalTouchCheckTimeout: he,
|
|
402
|
-
movesAfterTouchRef:
|
|
402
|
+
movesAfterTouchRef: we,
|
|
403
403
|
name: X,
|
|
404
404
|
required: _,
|
|
405
405
|
invalid: v,
|
|
406
|
-
inputMode:
|
|
406
|
+
inputMode: Fe,
|
|
407
407
|
getAllowedNonNumericKeys: Qe,
|
|
408
408
|
min: a,
|
|
409
409
|
max: f,
|
|
@@ -413,7 +413,7 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
413
413
|
setIsScrubbing: N,
|
|
414
414
|
state: He,
|
|
415
415
|
onValueCommitted: ue
|
|
416
|
-
}), [e, D, l, et, Re, y, L, I, R, T, Me, Ce, be, ie, oe, he, X, _, v,
|
|
416
|
+
}), [e, D, l, et, Re, y, L, I, R, T, Me, Ce, be, ie, oe, he, X, _, v, Fe, Qe, a, f, le, d, M, He, ue]), Lt = xe("div", r, {
|
|
417
417
|
ref: t,
|
|
418
418
|
state: He,
|
|
419
419
|
props: W,
|
|
@@ -423,10 +423,10 @@ const It = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
423
423
|
value: Mt,
|
|
424
424
|
children: [Lt, /* @__PURE__ */ se("input", {
|
|
425
425
|
...ee.getInputValidationProps({
|
|
426
|
-
onChange(
|
|
427
|
-
if (
|
|
426
|
+
onChange(w) {
|
|
427
|
+
if (w.nativeEvent.defaultPrevented)
|
|
428
428
|
return;
|
|
429
|
-
const E =
|
|
429
|
+
const E = w.currentTarget.valueAsNumber, B = Number.isNaN(E) ? null : E, $ = ce(on, w.nativeEvent);
|
|
430
430
|
x(B !== H.initialValue), Me(B, $), i() && ee.commit(B);
|
|
431
431
|
}
|
|
432
432
|
}),
|
|
@@ -483,7 +483,7 @@ function vt(n) {
|
|
|
483
483
|
locale: K,
|
|
484
484
|
maxWithDefault: G,
|
|
485
485
|
minWithDefault: h,
|
|
486
|
-
movesAfterTouchRef:
|
|
486
|
+
movesAfterTouchRef: F,
|
|
487
487
|
readOnly: O,
|
|
488
488
|
setValue: q,
|
|
489
489
|
startAutoChange: V,
|
|
@@ -543,8 +543,8 @@ function vt(n) {
|
|
|
543
543
|
x: i.clientX,
|
|
544
544
|
y: i.clientY
|
|
545
545
|
}, U(i.nativeEvent), i.pointerType !== "touch" ? (i.preventDefault(), p.current?.focus(), V(b, i)) : _.start(vn, () => {
|
|
546
|
-
const M =
|
|
547
|
-
|
|
546
|
+
const M = F.current;
|
|
547
|
+
F.current = 0, R.current && M != null && M < Tn ? (V(b, i), H.current = !0) : (H.current = !1, g());
|
|
548
548
|
}));
|
|
549
549
|
},
|
|
550
550
|
onPointerUp(i) {
|
|
@@ -553,7 +553,7 @@ function vt(n) {
|
|
|
553
553
|
onPointerMove(i) {
|
|
554
554
|
if (t || O || (b ? v : z) || i.pointerType !== "touch" || !R.current)
|
|
555
555
|
return;
|
|
556
|
-
|
|
556
|
+
F.current != null && (F.current += 1);
|
|
557
557
|
const {
|
|
558
558
|
x: X,
|
|
559
559
|
y: M
|
|
@@ -587,7 +587,7 @@ const Tt = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
587
587
|
id: K,
|
|
588
588
|
incrementValue: G,
|
|
589
589
|
inputRef: h,
|
|
590
|
-
inputValue:
|
|
590
|
+
inputValue: F,
|
|
591
591
|
intentionalTouchCheckTimeout: O,
|
|
592
592
|
isPressedRef: q,
|
|
593
593
|
locale: V,
|
|
@@ -611,7 +611,7 @@ const Tt = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
611
611
|
minWithDefault: d,
|
|
612
612
|
maxWithDefault: g,
|
|
613
613
|
value: j,
|
|
614
|
-
inputValue:
|
|
614
|
+
inputValue: F,
|
|
615
615
|
disabled: U,
|
|
616
616
|
readOnly: Y,
|
|
617
617
|
id: K,
|
|
@@ -660,7 +660,7 @@ const Pt = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
660
660
|
id: K,
|
|
661
661
|
incrementValue: G,
|
|
662
662
|
inputRef: h,
|
|
663
|
-
inputValue:
|
|
663
|
+
inputValue: F,
|
|
664
664
|
intentionalTouchCheckTimeout: O,
|
|
665
665
|
isPressedRef: q,
|
|
666
666
|
maxWithDefault: V,
|
|
@@ -684,7 +684,7 @@ const Pt = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
684
684
|
minWithDefault: g,
|
|
685
685
|
maxWithDefault: V,
|
|
686
686
|
value: H,
|
|
687
|
-
inputValue:
|
|
687
|
+
inputValue: F,
|
|
688
688
|
disabled: U,
|
|
689
689
|
readOnly: k,
|
|
690
690
|
id: K,
|
|
@@ -736,7 +736,7 @@ const Ln = {
|
|
|
736
736
|
incrementValue: K,
|
|
737
737
|
inputMode: G,
|
|
738
738
|
inputValue: h,
|
|
739
|
-
max:
|
|
739
|
+
max: F,
|
|
740
740
|
min: O,
|
|
741
741
|
name: q,
|
|
742
742
|
readOnly: V,
|
|
@@ -869,16 +869,16 @@ const Ln = {
|
|
|
869
869
|
}
|
|
870
870
|
[J, l, oe].forEach((D) => {
|
|
871
871
|
if (e.key === D) {
|
|
872
|
-
const le = h.indexOf(D),
|
|
873
|
-
P = !h.includes(D) || re ||
|
|
872
|
+
const le = h.indexOf(D), Fe = ue(le);
|
|
873
|
+
P = !h.includes(D) || re || Fe;
|
|
874
874
|
}
|
|
875
875
|
});
|
|
876
|
-
const fe = e.key >= "0" && e.key <= "9", ge = je.test(e.key), he = ze.test(e.key), Ve = at.test(e.key),
|
|
876
|
+
const fe = e.key >= "0" && e.key <= "9", ge = je.test(e.key), he = ze.test(e.key), Ve = at.test(e.key), we = On.has(e.key);
|
|
877
877
|
if (
|
|
878
878
|
// Allow composition events (e.g., pinyin)
|
|
879
879
|
// event.nativeEvent.isComposing does not work in Safari:
|
|
880
880
|
// https://bugs.webkit.org/show_bug.cgi?id=165004
|
|
881
|
-
e.which === 229 || e.altKey || e.ctrlKey || e.metaKey || P || fe || ge || Ve || he ||
|
|
881
|
+
e.which === 229 || e.altKey || e.ctrlKey || e.metaKey || P || fe || ge || Ve || he || we
|
|
882
882
|
)
|
|
883
883
|
return;
|
|
884
884
|
const me = Se(h, c, m.current), Ee = b(e) ?? Pe;
|
|
@@ -894,7 +894,7 @@ const Ln = {
|
|
|
894
894
|
currentValue: me,
|
|
895
895
|
event: u,
|
|
896
896
|
reason: Ae
|
|
897
|
-
}), H(j.current ?? v.current, pe)) : e.key === "Home" && O != null ? (d(O, ce(Ae, u)), H(j.current ?? v.current, pe)) : e.key === "End" &&
|
|
897
|
+
}), H(j.current ?? v.current, pe)) : e.key === "Home" && O != null ? (d(O, ce(Ae, u)), H(j.current ?? v.current, pe)) : e.key === "End" && F != null && (d(F, ce(Ae, u)), H(j.current ?? v.current, pe));
|
|
898
898
|
},
|
|
899
899
|
onPaste(e) {
|
|
900
900
|
if (e.defaultPrevented || V || p)
|
|
@@ -944,7 +944,7 @@ function kn(n, r) {
|
|
|
944
944
|
t.removeEventListener("resize", s);
|
|
945
945
|
};
|
|
946
946
|
}
|
|
947
|
-
const
|
|
947
|
+
const wt = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
948
948
|
const {
|
|
949
949
|
render: s,
|
|
950
950
|
className: a,
|
|
@@ -959,7 +959,7 @@ const Ft = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
959
959
|
readOnly: K,
|
|
960
960
|
inputRef: G,
|
|
961
961
|
incrementValue: h,
|
|
962
|
-
getStepAmount:
|
|
962
|
+
getStepAmount: F,
|
|
963
963
|
onValueCommitted: O,
|
|
964
964
|
lastChangedValueRef: q,
|
|
965
965
|
valueRef: V
|
|
@@ -1027,7 +1027,7 @@ const Ft = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
1027
1027
|
} = e;
|
|
1028
1028
|
if (y += f === "vertical" ? T : u, Math.abs(y) >= S) {
|
|
1029
1029
|
y = 0;
|
|
1030
|
-
const P = f === "vertical" ? -T : u, J =
|
|
1030
|
+
const P = f === "vertical" ? -T : u, J = F(e) ?? Pe, l = P * J;
|
|
1031
1031
|
l !== 0 && h(Math.abs(l), {
|
|
1032
1032
|
direction: l >= 0 ? 1 : -1,
|
|
1033
1033
|
event: e,
|
|
@@ -1039,7 +1039,7 @@ const Ft = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
1039
1039
|
return A.addEventListener("pointerup", L, !0), A.addEventListener("pointermove", Z, !0), () => {
|
|
1040
1040
|
W.clear(), A.removeEventListener("pointerup", L, !0), A.removeEventListener("pointermove", Z, !0);
|
|
1041
1041
|
};
|
|
1042
|
-
}, [R, K, h, v,
|
|
1042
|
+
}, [R, K, h, v, F, G, i, ee, f, S, q, O, V, W]), o.useEffect(function() {
|
|
1043
1043
|
const y = g.current;
|
|
1044
1044
|
if (!y || R || K)
|
|
1045
1045
|
return;
|
|
@@ -1093,14 +1093,14 @@ const Ft = /* @__PURE__ */ o.forwardRef(function(r, t) {
|
|
|
1093
1093
|
children: X
|
|
1094
1094
|
});
|
|
1095
1095
|
});
|
|
1096
|
-
process.env.NODE_ENV !== "production" && (
|
|
1096
|
+
process.env.NODE_ENV !== "production" && (wt.displayName = "NumberFieldScrubArea");
|
|
1097
1097
|
const Ne = {
|
|
1098
|
-
"number-input__root": "_number-
|
|
1099
|
-
"number-input": "_number-
|
|
1100
|
-
"number-input__scrub-area": "_number-input__scrub-
|
|
1101
|
-
"number-input__group": "_number-
|
|
1102
|
-
"number-input__controls": "_number-
|
|
1103
|
-
"number-input__separator": "_number-
|
|
1098
|
+
"number-input__root": "_number-input__root_w22lt_3",
|
|
1099
|
+
"number-input": "_number-input_w22lt_3",
|
|
1100
|
+
"number-input__scrub-area": "_number-input__scrub-area_w22lt_21",
|
|
1101
|
+
"number-input__group": "_number-input__group_w22lt_26",
|
|
1102
|
+
"number-input__controls": "_number-input__controls_w22lt_30",
|
|
1103
|
+
"number-input__separator": "_number-input__separator_w22lt_41"
|
|
1104
1104
|
};
|
|
1105
1105
|
function pr({
|
|
1106
1106
|
label: n,
|
|
@@ -1118,7 +1118,7 @@ function pr({
|
|
|
1118
1118
|
id: f,
|
|
1119
1119
|
className: Ne["number-input__root"],
|
|
1120
1120
|
children: [
|
|
1121
|
-
n ? /* @__PURE__ */ se(
|
|
1121
|
+
n ? /* @__PURE__ */ se(wt, { className: Ne["number-input__scrub-area"], children: /* @__PURE__ */ se("label", { htmlFor: f, children: /* @__PURE__ */ se(kt, { color: "dimmer", children: n }) }) }) : null,
|
|
1122
1122
|
/* @__PURE__ */ Ue(At, { className: Ne["number-input__group"], children: [
|
|
1123
1123
|
/* @__PURE__ */ se(
|
|
1124
1124
|
Wt,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as n, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as i } from "react";
|
|
3
|
-
import { View as
|
|
4
|
-
import { Input as
|
|
3
|
+
import { View as _ } from "../view/view.js";
|
|
4
|
+
import { Input as a } from "../input/input.js";
|
|
5
5
|
import { IconButton as u } from "../icon-button/icon-button.js";
|
|
6
6
|
import '../../password-input.css';const t = {
|
|
7
|
-
"password-input__root": "_password-
|
|
8
|
-
"password-input__eye": "_password-
|
|
7
|
+
"password-input__root": "_password-input__root_1eu2u_3",
|
|
8
|
+
"password-input__eye": "_password-input__eye_1eu2u_7"
|
|
9
9
|
};
|
|
10
10
|
function y(e) {
|
|
11
11
|
const [o, r] = i(!1);
|
|
12
|
-
return /* @__PURE__ */ n(
|
|
13
|
-
/* @__PURE__ */ s(
|
|
12
|
+
return /* @__PURE__ */ n(_, { className: t["password-input__root"], children: [
|
|
13
|
+
/* @__PURE__ */ s(a, { type: o ? "text" : "password", ...e }),
|
|
14
14
|
/* @__PURE__ */ s(
|
|
15
15
|
u,
|
|
16
16
|
{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c } from "../../clsx-OuTLNxxd.js";
|
|
3
|
-
import { textify as
|
|
4
|
-
import { View as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../pill.css';const f = "
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { textify as s } from "../../-utils.js";
|
|
4
|
+
import { View as e } from "../view/view.js";
|
|
5
|
+
import { Icon as p } from "../icon/icon.js";
|
|
6
|
+
import '../../pill.css';const f = "_pill_17k7p_3", a = "_pill_icon_left_17k7p_18", x = "_pill_icon_right_17k7p_22", _ = {
|
|
7
7
|
pill: f,
|
|
8
8
|
pill_icon_left: a,
|
|
9
9
|
pill_icon_right: x
|
|
@@ -11,24 +11,24 @@ import '../../pill.css';const f = "_pill_1eq5m_2", a = "_pill_icon_left_1eq5m_17
|
|
|
11
11
|
function y({
|
|
12
12
|
leftIcon: l,
|
|
13
13
|
rightIcon: i,
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
14
|
+
className: t,
|
|
15
|
+
children: n,
|
|
16
16
|
...r
|
|
17
17
|
}) {
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
18
|
+
return /* @__PURE__ */ c(
|
|
19
|
+
e,
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
21
|
+
className: m(
|
|
22
22
|
_.pill,
|
|
23
23
|
l && _.pill_icon_left,
|
|
24
24
|
i && _.pill_icon_right,
|
|
25
|
-
|
|
25
|
+
t
|
|
26
26
|
),
|
|
27
27
|
...r,
|
|
28
28
|
children: [
|
|
29
|
-
l ? /* @__PURE__ */ o(
|
|
30
|
-
|
|
31
|
-
i ? /* @__PURE__ */ o(
|
|
29
|
+
l ? /* @__PURE__ */ o(p, { name: l }) : null,
|
|
30
|
+
s(n, { color: "inherit" }),
|
|
31
|
+
i ? /* @__PURE__ */ o(p, { name: i }) : null
|
|
32
32
|
]
|
|
33
33
|
}
|
|
34
34
|
);
|