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