@wirecore/wirelayer-react 0.7.0 → 0.9.0
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/ContextMenu-GCeoPu8T.js +1523 -0
- package/dist/{Input-C8T3WLd5.js → Input-CtYSQznO.js} +41 -40
- package/dist/PasswordInput-CxZXGV2m.js +449 -0
- package/dist/Select-CGyqfOm3.js +256 -0
- package/dist/components/Alert/Alert.d.ts +3 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +3 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +9 -5
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Code/Code.d.ts +11 -0
- package/dist/components/Code/Code.d.ts.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +10 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +14 -4
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +12 -3
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +7 -2
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Menu/Menu.d.ts +27 -3
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/NativeSelect/NativeSelect.d.ts +14 -8
- package/dist/components/NativeSelect/NativeSelect.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +12 -4
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +7 -2
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/Progress/Progress.d.ts +15 -1
- package/dist/components/Progress/Progress.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroupItem.d.ts +3 -2
- package/dist/components/RadioGroup/RadioGroupItem.d.ts.map +1 -1
- package/dist/components/RadioGroup/context.d.ts +3 -0
- package/dist/components/RadioGroup/context.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +14 -5
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +20 -5
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.d.ts +3 -1
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +11 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +7 -2
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Wizard/Wizard.d.ts +11 -3
- package/dist/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/data-table.js +3 -3
- package/dist/form.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/media.d.ts +7 -0
- package/dist/hooks/media.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2111 -2026
- package/dist/pdf.js +2 -2
- package/dist/sources/Code.css +2 -0
- package/llms-full.txt +106 -28
- package/llms.txt +6 -4
- package/package.json +3 -3
- package/dist/ContextMenu-BD72S5n6.js +0 -1452
- package/dist/PasswordInput-SjO66gZB.js +0 -422
- package/dist/Select-7rfeNmJb.js +0 -242
|
@@ -46,70 +46,71 @@ function y({ classes: e, icon: n, iconProps: r, label: s, variant: c, color: u,
|
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/components/Input/Input.tsx
|
|
49
|
-
function b({ classes: i, size: a, invalid: o = !1, success: l = !1, loading: d = !1, clearable: y = !1, clearLabel: b, disabled: x = !1, leadingIcon: S, prefix: C, suffix: w,
|
|
50
|
-
let
|
|
49
|
+
function b({ classes: i, size: a, invalid: o = !1, success: l = !1, loading: d = !1, clearable: y = !1, clearLabel: b, disabled: x = !1, leadingIcon: S, prefix: C, suffix: w, mono: T = !1, className: E, style: D, onChange: O, ...k }) {
|
|
50
|
+
let A = t("input", s, i), j = e(), M = v(), N = n(), P = o || !!M?.invalid, F = !P && (l || N.success), I = x || !!M?.disabled, L = !!k.readOnly || !!M?.readOnly, R = A({
|
|
51
51
|
size: a,
|
|
52
|
-
invalid:
|
|
53
|
-
success:
|
|
54
|
-
disabled:
|
|
52
|
+
invalid: P,
|
|
53
|
+
success: F,
|
|
54
|
+
disabled: I,
|
|
55
55
|
hasIcon: !!S,
|
|
56
|
-
hasStatusIcon:
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
hasStatusIcon: P || F || d || y,
|
|
57
|
+
mono: T
|
|
58
|
+
}), [z, B] = m(() => String(k.defaultValue ?? "") !== ""), V = k.value === void 0 ? z : String(k.value ?? "") !== "", H = p(null), U = () => {
|
|
59
|
+
let e = H.current?.querySelector("input");
|
|
59
60
|
e && (c(e), e.focus());
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
C &&
|
|
63
|
-
w &&
|
|
64
|
-
|
|
61
|
+
}, W = f(), G = f(), K = [
|
|
62
|
+
M?.ariaDescribedby,
|
|
63
|
+
C && W,
|
|
64
|
+
w && G,
|
|
65
|
+
k["aria-describedby"]
|
|
65
66
|
].filter(Boolean).join(" ") || void 0;
|
|
66
67
|
return /* @__PURE__ */ g("div", {
|
|
67
|
-
ref:
|
|
68
|
-
className:
|
|
69
|
-
style:
|
|
70
|
-
"data-invalid":
|
|
71
|
-
"data-disabled":
|
|
68
|
+
ref: H,
|
|
69
|
+
className: R.base({ class: E }),
|
|
70
|
+
style: D,
|
|
71
|
+
"data-invalid": P || void 0,
|
|
72
|
+
"data-disabled": I || void 0,
|
|
72
73
|
children: [
|
|
73
74
|
C && /* @__PURE__ */ h("span", {
|
|
74
|
-
id:
|
|
75
|
-
className:
|
|
75
|
+
id: W,
|
|
76
|
+
className: R.prefix(),
|
|
76
77
|
children: C
|
|
77
78
|
}),
|
|
78
79
|
S && /* @__PURE__ */ h(S, {
|
|
79
|
-
className:
|
|
80
|
+
className: R.icon(),
|
|
80
81
|
"aria-hidden": "true"
|
|
81
82
|
}),
|
|
82
83
|
/* @__PURE__ */ h(_.Input, {
|
|
83
|
-
...
|
|
84
|
-
className:
|
|
85
|
-
disabled:
|
|
86
|
-
"aria-invalid":
|
|
87
|
-
"aria-describedby":
|
|
84
|
+
...k,
|
|
85
|
+
className: R.control(),
|
|
86
|
+
disabled: I || void 0,
|
|
87
|
+
"aria-invalid": P || void 0,
|
|
88
|
+
"aria-describedby": K,
|
|
88
89
|
"aria-busy": d || void 0,
|
|
89
90
|
onChange: (e) => {
|
|
90
|
-
|
|
91
|
+
B(e.currentTarget.value !== ""), O?.(e);
|
|
91
92
|
}
|
|
92
93
|
}),
|
|
93
|
-
(d || y ||
|
|
94
|
+
(d || y || F) && /* @__PURE__ */ h(r, {
|
|
94
95
|
loading: d,
|
|
95
|
-
clear: y &&
|
|
96
|
-
clearLabel: b ??
|
|
97
|
-
onClear:
|
|
98
|
-
success:
|
|
96
|
+
clear: y && V && !I && !L,
|
|
97
|
+
clearLabel: b ?? j.field.clear,
|
|
98
|
+
onClear: U,
|
|
99
|
+
success: F,
|
|
99
100
|
classes: {
|
|
100
|
-
spinner:
|
|
101
|
-
clear:
|
|
102
|
-
clearIcon:
|
|
103
|
-
statusIcon:
|
|
101
|
+
spinner: R.spinner(),
|
|
102
|
+
clear: R.clear(),
|
|
103
|
+
clearIcon: R.clearIcon(),
|
|
104
|
+
statusIcon: R.statusIcon()
|
|
104
105
|
}
|
|
105
106
|
}),
|
|
106
|
-
|
|
107
|
-
className:
|
|
107
|
+
P && /* @__PURE__ */ h(u, {
|
|
108
|
+
className: R.statusIcon(),
|
|
108
109
|
"aria-hidden": "true"
|
|
109
110
|
}),
|
|
110
111
|
w && /* @__PURE__ */ h("span", {
|
|
111
|
-
id:
|
|
112
|
-
className:
|
|
112
|
+
id: G,
|
|
113
|
+
className: R.suffix(),
|
|
113
114
|
children: w
|
|
114
115
|
})
|
|
115
116
|
]
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
+
import { r as n, t as r } from "./InputStatus-hVzkU_4q.js";
|
|
4
|
+
import { autoselectElement as i, checkPasswordRequirements as a, clampDialogOffset as o, closeTab as s, controlIds as c, dialog as l, dialogMoveForKey as u, dialogMoveKeys as d, passwordInput as f, passwordStrength as p, scrollEdges as m, setTextControlValue as h, tabs as g } from "@wirecore/wirelayer-recipes";
|
|
5
|
+
import { Check as _, ChevronLeft as v, ChevronRight as y, Circle as b, Eye as x, EyeOff as S, Maximize2 as ee, Minimize2 as te, X as C } from "lucide-react";
|
|
6
|
+
import { createContext as w, useContext as T, useEffect as E, useId as D, useLayoutEffect as O, useRef as k, useState as A } from "react";
|
|
7
|
+
import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
8
|
+
import { Portal as N } from "@ark-ui/react/portal";
|
|
9
|
+
import { useFieldContext as P } from "@ark-ui/react/field";
|
|
10
|
+
import { Tabs as F } from "@ark-ui/react/tabs";
|
|
11
|
+
import { Dialog as I, useDialogContext as ne } from "@ark-ui/react/dialog";
|
|
12
|
+
import { PasswordInput as L } from "@ark-ui/react/password-input";
|
|
13
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
14
|
+
var R = typeof document > "u" ? E : O, z = w(!1);
|
|
15
|
+
function B({ classes: e, value: n, defaultValue: r, onValueChange: i, label: a, orientation: o, activationMode: s, lazyMount: c, unmountOnExit: l, className: u, ...d }) {
|
|
16
|
+
let f = t("tabs", g, e)();
|
|
17
|
+
return /* @__PURE__ */ j(z, {
|
|
18
|
+
value: n === null,
|
|
19
|
+
children: /* @__PURE__ */ j(F.Root, {
|
|
20
|
+
...d,
|
|
21
|
+
className: f.base({ class: u }),
|
|
22
|
+
value: n,
|
|
23
|
+
defaultValue: r,
|
|
24
|
+
onValueChange: (e) => i?.(e.value),
|
|
25
|
+
orientation: o,
|
|
26
|
+
activationMode: s,
|
|
27
|
+
lazyMount: c,
|
|
28
|
+
unmountOnExit: l,
|
|
29
|
+
translations: a ? { listLabel: a } : void 0
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function V({ scrollable: e = !1, className: n, children: r, ...i }) {
|
|
34
|
+
let a = t("tabs", g)(), o = k(null), [s, c] = A({
|
|
35
|
+
start: !1,
|
|
36
|
+
end: !1
|
|
37
|
+
}), l = () => o.current && c(m(o.current));
|
|
38
|
+
E(() => {
|
|
39
|
+
if (!e || !o.current) return;
|
|
40
|
+
l();
|
|
41
|
+
let t = new ResizeObserver(l);
|
|
42
|
+
return t.observe(o.current), () => t.disconnect();
|
|
43
|
+
}, [e]);
|
|
44
|
+
let u = (e) => {
|
|
45
|
+
let t = o.current;
|
|
46
|
+
if (!t) return;
|
|
47
|
+
let n = getComputedStyle(t).direction === "rtl", r = t.clientWidth * .8 * (e ? 1 : -1) * (n ? -1 : 1), i = !matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
48
|
+
t.scrollBy({
|
|
49
|
+
left: r,
|
|
50
|
+
behavior: i ? "smooth" : "auto"
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
return e ? /* @__PURE__ */ M("div", {
|
|
54
|
+
className: a.scroller(),
|
|
55
|
+
children: [
|
|
56
|
+
s.start && /* @__PURE__ */ j("button", {
|
|
57
|
+
type: "button",
|
|
58
|
+
tabIndex: -1,
|
|
59
|
+
"aria-hidden": "true",
|
|
60
|
+
"data-side": "start",
|
|
61
|
+
className: a.scrollButton(),
|
|
62
|
+
onClick: () => u(!1),
|
|
63
|
+
children: /* @__PURE__ */ j(v, { className: a.scrollIcon() })
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ j(F.List, {
|
|
66
|
+
...i,
|
|
67
|
+
ref: o,
|
|
68
|
+
className: a.list({ class: [a.scrollList(), n] }),
|
|
69
|
+
onScroll: (e) => {
|
|
70
|
+
l(), i.onScroll?.(e);
|
|
71
|
+
},
|
|
72
|
+
children: r
|
|
73
|
+
}),
|
|
74
|
+
s.end && /* @__PURE__ */ j("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
tabIndex: -1,
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
"data-side": "end",
|
|
79
|
+
className: a.scrollButton(),
|
|
80
|
+
onClick: () => u(!0),
|
|
81
|
+
children: /* @__PURE__ */ j(y, { className: a.scrollIcon() })
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
}) : /* @__PURE__ */ j(F.List, {
|
|
85
|
+
...i,
|
|
86
|
+
className: a.list({ class: n }),
|
|
87
|
+
children: r
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function H({ classes: e, value: n, icon: r, disabled: i, closable: a = !1, onClose: o, controls: c, className: l, children: u, onKeyDown: d, ref: f, ...p }) {
|
|
91
|
+
let m = t("tabs", g, e)({ closable: a }), h = T(z), _ = k(null), [v, y] = A(!1);
|
|
92
|
+
R(() => {
|
|
93
|
+
let e = _.current;
|
|
94
|
+
y(!!e && e.closest("[role=tablist]")?.querySelector("[role=tab]:not([disabled])") === e);
|
|
95
|
+
});
|
|
96
|
+
let b = /* @__PURE__ */ M(F.Trigger, {
|
|
97
|
+
...p,
|
|
98
|
+
ref: (e) => {
|
|
99
|
+
if (_.current = e, typeof f == "function") return f(e);
|
|
100
|
+
f && (f.current = e);
|
|
101
|
+
},
|
|
102
|
+
...c === void 0 ? {} : { "aria-controls": c },
|
|
103
|
+
...h && v ? { tabIndex: 0 } : {},
|
|
104
|
+
className: m.trigger({ class: l }),
|
|
105
|
+
value: n,
|
|
106
|
+
disabled: i,
|
|
107
|
+
...a ? {
|
|
108
|
+
"aria-keyshortcuts": "Delete",
|
|
109
|
+
onKeyDown: (e) => {
|
|
110
|
+
d?.(e), !(e.key !== "Delete" || e.defaultPrevented || i) && (e.preventDefault(), s(e.currentTarget, () => o?.(n)));
|
|
111
|
+
}
|
|
112
|
+
} : { onKeyDown: d },
|
|
113
|
+
children: [r && /* @__PURE__ */ j(r, {
|
|
114
|
+
className: m.icon(),
|
|
115
|
+
"aria-hidden": "true"
|
|
116
|
+
}), u]
|
|
117
|
+
});
|
|
118
|
+
return a ? /* @__PURE__ */ M("span", {
|
|
119
|
+
role: "presentation",
|
|
120
|
+
className: m.tab(),
|
|
121
|
+
children: [b, /* @__PURE__ */ j("button", {
|
|
122
|
+
type: "button",
|
|
123
|
+
tabIndex: -1,
|
|
124
|
+
"aria-hidden": "true",
|
|
125
|
+
className: m.close(),
|
|
126
|
+
disabled: i,
|
|
127
|
+
onClick: (e) => {
|
|
128
|
+
let t = e.currentTarget.parentElement?.querySelector("[role=tab]");
|
|
129
|
+
t && s(t, () => o?.(n));
|
|
130
|
+
},
|
|
131
|
+
children: /* @__PURE__ */ j(C, { className: m.closeIcon() })
|
|
132
|
+
})]
|
|
133
|
+
}) : b;
|
|
134
|
+
}
|
|
135
|
+
function U({ classes: e, value: n, className: r, ...i }) {
|
|
136
|
+
let a = t("tabs", g, e)();
|
|
137
|
+
return /* @__PURE__ */ j(F.Content, {
|
|
138
|
+
...i,
|
|
139
|
+
className: a.content({ class: r }),
|
|
140
|
+
value: n
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/components/Dialog/Dialog.tsx
|
|
145
|
+
var W = w({ modal: !0 });
|
|
146
|
+
function G({ open: e, defaultOpen: t, onOpenChange: n, role: r = "dialog", modal: a = !0, closeOnEscape: o = !0, closeOnInteractOutside: s, children: c }) {
|
|
147
|
+
let l = k(null);
|
|
148
|
+
return /* @__PURE__ */ j(W.Provider, {
|
|
149
|
+
value: {
|
|
150
|
+
modal: a,
|
|
151
|
+
contentRef: l
|
|
152
|
+
},
|
|
153
|
+
children: /* @__PURE__ */ j(I.Root, {
|
|
154
|
+
open: e,
|
|
155
|
+
defaultOpen: t,
|
|
156
|
+
onOpenChange: (e) => n?.(e.open),
|
|
157
|
+
role: r,
|
|
158
|
+
modal: a,
|
|
159
|
+
closeOnEscape: o,
|
|
160
|
+
closeOnInteractOutside: s,
|
|
161
|
+
initialFocusEl: () => i(l.current) ?? (r === "alertdialog" ? l.current?.querySelector("[data-part=close-trigger]") : null) ?? null,
|
|
162
|
+
lazyMount: !0,
|
|
163
|
+
unmountOnExit: !0,
|
|
164
|
+
children: c
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function K({ children: e }) {
|
|
169
|
+
return /* @__PURE__ */ j(I.Trigger, {
|
|
170
|
+
asChild: !0,
|
|
171
|
+
children: e
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function q({ children: e }) {
|
|
175
|
+
return /* @__PURE__ */ j(I.CloseTrigger, {
|
|
176
|
+
asChild: !0,
|
|
177
|
+
children: e
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function J(e, t) {
|
|
181
|
+
let [n, r] = A({
|
|
182
|
+
x: 0,
|
|
183
|
+
y: 0
|
|
184
|
+
}), i = k(null), [a, s] = A(t);
|
|
185
|
+
a !== t && (s(t), t || r({
|
|
186
|
+
x: 0,
|
|
187
|
+
y: 0
|
|
188
|
+
}));
|
|
189
|
+
let c = (e, t, n) => {
|
|
190
|
+
let i = t.getBoundingClientRect(), a = {
|
|
191
|
+
x: i.x - n.x,
|
|
192
|
+
y: i.y - n.y,
|
|
193
|
+
width: i.width,
|
|
194
|
+
height: i.height
|
|
195
|
+
};
|
|
196
|
+
r(o(e, a, {
|
|
197
|
+
width: innerWidth,
|
|
198
|
+
height: innerHeight
|
|
199
|
+
}));
|
|
200
|
+
};
|
|
201
|
+
return {
|
|
202
|
+
header: {
|
|
203
|
+
onPointerDown(t) {
|
|
204
|
+
if (!e || t.button !== 0 || t.target.closest("button, a, input")) return;
|
|
205
|
+
let r = t.currentTarget.closest("[data-part=content]");
|
|
206
|
+
r && (i.current = {
|
|
207
|
+
id: t.pointerId,
|
|
208
|
+
x: t.clientX,
|
|
209
|
+
y: t.clientY,
|
|
210
|
+
origin: n,
|
|
211
|
+
content: r
|
|
212
|
+
}, t.currentTarget.setPointerCapture?.(t.pointerId), t.preventDefault());
|
|
213
|
+
},
|
|
214
|
+
onPointerMove(e) {
|
|
215
|
+
let t = i.current;
|
|
216
|
+
t && e.pointerId === t.id && c({
|
|
217
|
+
x: t.origin.x + e.clientX - t.x,
|
|
218
|
+
y: t.origin.y + e.clientY - t.y
|
|
219
|
+
}, t.content, n);
|
|
220
|
+
},
|
|
221
|
+
onPointerUp() {
|
|
222
|
+
i.current = null;
|
|
223
|
+
},
|
|
224
|
+
onPointerCancel() {
|
|
225
|
+
i.current = null;
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
onKeyDown: (t) => {
|
|
229
|
+
if (!e) return;
|
|
230
|
+
let r = u(t);
|
|
231
|
+
r && (t.preventDefault(), c({
|
|
232
|
+
x: n.x + r.x,
|
|
233
|
+
y: n.y + r.y
|
|
234
|
+
}, t.currentTarget, n));
|
|
235
|
+
},
|
|
236
|
+
style: e && (n.x || n.y) ? { translate: `${n.x}px ${n.y}px` } : void 0
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function Y({ classes: n, title: r, hideTitle: i, titlePosition: a = "body", description: o, icon: s, status: c, size: u, position: f, fullscreen: p, maximizable: m, maximized: h, defaultMaximized: g, onMaximizedChange: _, draggable: v, closable: y = !0, scrollBehavior: b, responsive: x = !0, closeLabel: S, maximizeLabel: w, restoreLabel: E, footer: D, portalTarget: O, className: k, style: P, onKeyDown: F, children: L, ref: R, ...z }) {
|
|
240
|
+
let B = t("dialog", l, n), V = e(), { modal: H, contentRef: U } = T(W), G = ne(), [K, q] = A(g ?? !1), Y = h ?? K, X = () => {
|
|
241
|
+
q(!Y), _?.(!Y);
|
|
242
|
+
}, Z = J(!!v && !Y && !p, G.open), Q = B({
|
|
243
|
+
status: c,
|
|
244
|
+
size: u,
|
|
245
|
+
position: f,
|
|
246
|
+
scrollBehavior: b,
|
|
247
|
+
fullscreen: p || Y,
|
|
248
|
+
responsive: x,
|
|
249
|
+
draggable: v && !Y,
|
|
250
|
+
maximizable: m,
|
|
251
|
+
hideTitle: i,
|
|
252
|
+
titleInHeader: a === "header"
|
|
253
|
+
}), $ = /* @__PURE__ */ j(I.Title, {
|
|
254
|
+
className: Q.title(),
|
|
255
|
+
children: r
|
|
256
|
+
}), re = Y ? te : ee;
|
|
257
|
+
return /* @__PURE__ */ M(N, {
|
|
258
|
+
...O ? { container: { current: O } } : {},
|
|
259
|
+
children: [H && /* @__PURE__ */ j(I.Backdrop, { className: Q.backdrop() }), /* @__PURE__ */ j(I.Positioner, {
|
|
260
|
+
className: Q.positioner(),
|
|
261
|
+
children: /* @__PURE__ */ M(I.Content, {
|
|
262
|
+
...z,
|
|
263
|
+
ref: (e) => {
|
|
264
|
+
if (U && (U.current = e), typeof R == "function") return R(e);
|
|
265
|
+
R && (R.current = e);
|
|
266
|
+
},
|
|
267
|
+
...v ? { "aria-keyshortcuts": d } : {},
|
|
268
|
+
className: Q.content({ class: k }),
|
|
269
|
+
style: Z.style ? {
|
|
270
|
+
...P,
|
|
271
|
+
...Z.style
|
|
272
|
+
} : P,
|
|
273
|
+
onKeyDown: (e) => {
|
|
274
|
+
F?.(e), v && Z.onKeyDown(e);
|
|
275
|
+
},
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ M("div", {
|
|
278
|
+
className: Q.header(),
|
|
279
|
+
...v ? Z.header : {},
|
|
280
|
+
children: [
|
|
281
|
+
s && /* @__PURE__ */ j("span", {
|
|
282
|
+
className: Q.iconBox(),
|
|
283
|
+
children: /* @__PURE__ */ j(s, {
|
|
284
|
+
className: Q.icon(),
|
|
285
|
+
"aria-hidden": "true"
|
|
286
|
+
})
|
|
287
|
+
}),
|
|
288
|
+
a === "header" && $,
|
|
289
|
+
m && /* @__PURE__ */ j("button", {
|
|
290
|
+
type: "button",
|
|
291
|
+
className: Q.maximize(),
|
|
292
|
+
"aria-label": Y ? E ?? V.dialog.restore : w ?? V.dialog.maximize,
|
|
293
|
+
onClick: X,
|
|
294
|
+
children: /* @__PURE__ */ j(re, {
|
|
295
|
+
className: Q.maximizeIcon(),
|
|
296
|
+
"aria-hidden": "true"
|
|
297
|
+
})
|
|
298
|
+
}),
|
|
299
|
+
y && /* @__PURE__ */ j(I.CloseTrigger, {
|
|
300
|
+
className: Q.close(),
|
|
301
|
+
"aria-label": S ?? V.common.close,
|
|
302
|
+
children: /* @__PURE__ */ j(C, {
|
|
303
|
+
className: Q.closeIcon(),
|
|
304
|
+
"aria-hidden": "true"
|
|
305
|
+
})
|
|
306
|
+
})
|
|
307
|
+
]
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ M("div", {
|
|
310
|
+
className: Q.body(),
|
|
311
|
+
children: [
|
|
312
|
+
a === "body" && $,
|
|
313
|
+
o && /* @__PURE__ */ j(I.Description, {
|
|
314
|
+
className: Q.description(),
|
|
315
|
+
children: o
|
|
316
|
+
}),
|
|
317
|
+
L
|
|
318
|
+
]
|
|
319
|
+
}),
|
|
320
|
+
D && /* @__PURE__ */ j("div", {
|
|
321
|
+
className: Q.footer(),
|
|
322
|
+
children: D
|
|
323
|
+
})
|
|
324
|
+
]
|
|
325
|
+
})
|
|
326
|
+
})]
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/components/PasswordInput/PasswordInput.tsx
|
|
331
|
+
function X({ classes: i, size: o, invalid: s, success: l, disabled: u, readOnly: d, required: m, name: g, defaultVisible: v, visible: y, onVisibleChange: ee, autoComplete: te = "current-password", strength: C = !1, requirements: w, loading: T = !1, clearable: E = !1, clearLabel: O, mono: N = !1, id: F, className: I, style: ne, ...R }) {
|
|
332
|
+
let z = t("passwordInput", f, i), B = e(), V = P(), H = n(), U = !(s || V?.invalid) && (!!l || H.success), W = z({
|
|
333
|
+
size: o,
|
|
334
|
+
success: U,
|
|
335
|
+
mono: N
|
|
336
|
+
}), G = D(), [K, q] = A(String(R.defaultValue ?? "")), J = R.value === void 0 ? K : String(R.value), Y = p(J), X = J ? B.passwordStrength.levels[Y] : "", Z = a(J, w ?? []), Q = C || w?.length ? [
|
|
337
|
+
V?.ariaDescribedby,
|
|
338
|
+
C && `${G}strength`,
|
|
339
|
+
w?.length && `${G}requirements`
|
|
340
|
+
].filter(Boolean).join(" ") : void 0, $ = k(null), re = () => {
|
|
341
|
+
let e = $.current?.querySelector("input");
|
|
342
|
+
e && (h(e), e.focus());
|
|
343
|
+
};
|
|
344
|
+
return /* @__PURE__ */ M(L.Root, {
|
|
345
|
+
className: W.base({ class: I }),
|
|
346
|
+
style: ne,
|
|
347
|
+
invalid: s,
|
|
348
|
+
disabled: u,
|
|
349
|
+
readOnly: d,
|
|
350
|
+
required: m,
|
|
351
|
+
name: g,
|
|
352
|
+
defaultVisible: v,
|
|
353
|
+
visible: y,
|
|
354
|
+
onVisibilityChange: (e) => ee?.(e.visible),
|
|
355
|
+
autoComplete: te,
|
|
356
|
+
translations: B.passwordInput,
|
|
357
|
+
...c(F, "input", { input: V?.ids.control }),
|
|
358
|
+
children: [
|
|
359
|
+
/* @__PURE__ */ M(L.Control, {
|
|
360
|
+
ref: $,
|
|
361
|
+
className: W.control(),
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ j(L.Input, {
|
|
364
|
+
...R,
|
|
365
|
+
"aria-describedby": Q,
|
|
366
|
+
"aria-busy": T || void 0,
|
|
367
|
+
className: W.input(),
|
|
368
|
+
onChange: (e) => {
|
|
369
|
+
q(e.target.value), R.onChange?.(e);
|
|
370
|
+
}
|
|
371
|
+
}),
|
|
372
|
+
(T || E || U) && /* @__PURE__ */ j(r, {
|
|
373
|
+
loading: T,
|
|
374
|
+
clear: E && !!J && !(u || V?.disabled) && !(d || V?.readOnly),
|
|
375
|
+
clearLabel: O ?? B.field.clear,
|
|
376
|
+
onClear: re,
|
|
377
|
+
success: U,
|
|
378
|
+
classes: {
|
|
379
|
+
spinner: W.spinner(),
|
|
380
|
+
clear: W.clear(),
|
|
381
|
+
clearIcon: W.clearIcon(),
|
|
382
|
+
statusIcon: W.statusIcon()
|
|
383
|
+
}
|
|
384
|
+
}),
|
|
385
|
+
/* @__PURE__ */ j(L.VisibilityTrigger, {
|
|
386
|
+
className: W.toggle(),
|
|
387
|
+
children: /* @__PURE__ */ j(L.Indicator, {
|
|
388
|
+
fallback: /* @__PURE__ */ j(x, {
|
|
389
|
+
className: W.toggleIcon(),
|
|
390
|
+
"aria-hidden": "true"
|
|
391
|
+
}),
|
|
392
|
+
children: /* @__PURE__ */ j(S, {
|
|
393
|
+
className: W.toggleIcon(),
|
|
394
|
+
"aria-hidden": "true"
|
|
395
|
+
})
|
|
396
|
+
})
|
|
397
|
+
})
|
|
398
|
+
]
|
|
399
|
+
}),
|
|
400
|
+
C && /* @__PURE__ */ M("div", {
|
|
401
|
+
className: W.strength(),
|
|
402
|
+
children: [/* @__PURE__ */ j("div", {
|
|
403
|
+
className: W.meter(),
|
|
404
|
+
"aria-hidden": "true",
|
|
405
|
+
children: [
|
|
406
|
+
1,
|
|
407
|
+
2,
|
|
408
|
+
3,
|
|
409
|
+
4
|
|
410
|
+
].map((e) => /* @__PURE__ */ j("span", {
|
|
411
|
+
className: W.bar(),
|
|
412
|
+
"data-level": Y,
|
|
413
|
+
"data-filled": e <= Y || void 0
|
|
414
|
+
}, e))
|
|
415
|
+
}), /* @__PURE__ */ j("span", {
|
|
416
|
+
id: `${G}strength`,
|
|
417
|
+
className: W.strengthText(),
|
|
418
|
+
"aria-live": "polite",
|
|
419
|
+
children: X && B.passwordStrength.label(X)
|
|
420
|
+
})]
|
|
421
|
+
}),
|
|
422
|
+
!!w?.length && /* @__PURE__ */ j("ul", {
|
|
423
|
+
id: `${G}requirements`,
|
|
424
|
+
className: W.requirements(),
|
|
425
|
+
"aria-label": B.passwordRequirements.label,
|
|
426
|
+
children: w.map((e, t) => /* @__PURE__ */ M("li", {
|
|
427
|
+
className: W.requirement(),
|
|
428
|
+
"data-met": Z[t] || void 0,
|
|
429
|
+
children: [
|
|
430
|
+
Z[t] ? /* @__PURE__ */ j(_, {
|
|
431
|
+
className: W.requirementIcon(),
|
|
432
|
+
"aria-hidden": "true"
|
|
433
|
+
}) : /* @__PURE__ */ j(b, {
|
|
434
|
+
className: W.requirementIcon(),
|
|
435
|
+
"aria-hidden": "true"
|
|
436
|
+
}),
|
|
437
|
+
e.label,
|
|
438
|
+
/* @__PURE__ */ j("span", {
|
|
439
|
+
className: W.requirementState(),
|
|
440
|
+
children: `: ${Z[t] ? B.passwordRequirements.met : B.passwordRequirements.unmet}`
|
|
441
|
+
})
|
|
442
|
+
]
|
|
443
|
+
}, e.label))
|
|
444
|
+
})
|
|
445
|
+
]
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
//#endregion
|
|
449
|
+
export { W as a, U as c, Y as i, V as l, G as n, K as o, q as r, B as s, X as t, H as u };
|