zaravand-ui 6.0.0 → 7.0.1
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/README.md +45 -45
- package/dist/components/Accordion/Accordion.cjs +1 -1
- package/dist/components/Accordion/Accordion.interface.d.cts +8 -0
- package/dist/components/Accordion/Accordion.interface.d.ts +8 -0
- package/dist/components/Accordion/Accordion.js +226 -148
- package/dist/components/Accordion/Accordion.variant.cjs +1 -1
- package/dist/components/Accordion/Accordion.variant.js +2 -2
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.js +32 -32
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.interface.d.cts +0 -1
- package/dist/components/Button/Button.interface.d.ts +0 -1
- package/dist/components/Button/Button.js +41 -42
- package/dist/components/Button/Button.variant.cjs +1 -1
- package/dist/components/Button/Button.variant.d.cts +0 -1
- package/dist/components/Button/Button.variant.d.ts +0 -1
- package/dist/components/Button/Button.variant.js +2 -4
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.interface.d.cts +11 -0
- package/dist/components/Checkbox/Checkbox.interface.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.js +66 -43
- package/dist/components/Checkbox/Checkbox.variant.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.variant.d.cts +9 -4
- package/dist/components/Checkbox/Checkbox.variant.d.ts +9 -4
- package/dist/components/Checkbox/Checkbox.variant.js +20 -16
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.interface.d.cts +0 -1
- package/dist/components/DatePicker/DatePicker.interface.d.ts +0 -1
- package/dist/components/DatePicker/DatePicker.js +511 -407
- package/dist/components/DatePicker/DatePicker.utils.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.utils.js +101 -82
- package/dist/components/DatePicker/DatePicker.variant.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.variant.d.cts +1 -3
- package/dist/components/DatePicker/DatePicker.variant.d.ts +1 -3
- package/dist/components/DatePicker/DatePicker.variant.js +14 -16
- package/dist/components/DatePicker/DatePickerMonthSlider.cjs +1 -0
- package/dist/components/DatePicker/DatePickerMonthSlider.d.cts +25 -0
- package/dist/components/DatePicker/DatePickerMonthSlider.d.ts +25 -0
- package/dist/components/DatePicker/DatePickerMonthSlider.js +98 -0
- package/dist/components/DatePicker/DatePickerWheel.cjs +1 -0
- package/dist/components/DatePicker/DatePickerWheel.d.cts +30 -0
- package/dist/components/DatePicker/DatePickerWheel.d.ts +30 -0
- package/dist/components/DatePicker/DatePickerWheel.js +156 -0
- package/dist/components/Dialog/Dialog.cjs +1 -1
- package/dist/components/Dialog/Dialog.interface.d.cts +5 -0
- package/dist/components/Dialog/Dialog.interface.d.ts +5 -0
- package/dist/components/Dialog/Dialog.js +57 -49
- package/dist/components/Dialog/Dialog.variant.cjs +1 -1
- package/dist/components/Dialog/Dialog.variant.js +1 -1
- package/dist/components/Dialog/DialogDragHandle.cjs +1 -0
- package/dist/components/Dialog/DialogDragHandle.d.cts +11 -0
- package/dist/components/Dialog/DialogDragHandle.d.ts +11 -0
- package/dist/components/Dialog/DialogDragHandle.js +55 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +38 -37
- package/dist/components/Input/Input.variant.cjs +1 -1
- package/dist/components/Input/Input.variant.d.cts +1 -3
- package/dist/components/Input/Input.variant.d.ts +1 -3
- package/dist/components/Input/Input.variant.js +9 -8
- package/dist/components/Pagination/Pagination.cjs +1 -1
- package/dist/components/Pagination/Pagination.js +90 -73
- package/dist/components/Pagination/Pagination.variant.cjs +1 -1
- package/dist/components/Pagination/Pagination.variant.d.cts +3 -1
- package/dist/components/Pagination/Pagination.variant.d.ts +3 -1
- package/dist/components/Pagination/Pagination.variant.js +12 -6
- package/dist/components/RadioGroup/RadioGroup.cjs +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +44 -41
- package/dist/components/RadioGroup/RadioGroup.variant.cjs +1 -1
- package/dist/components/RadioGroup/RadioGroup.variant.d.cts +3 -2
- package/dist/components/RadioGroup/RadioGroup.variant.d.ts +3 -2
- package/dist/components/RadioGroup/RadioGroup.variant.js +11 -21
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.d.cts +1 -3
- package/dist/components/Select/Select.d.ts +1 -3
- package/dist/components/Select/Select.interface.d.cts +0 -1
- package/dist/components/Select/Select.interface.d.ts +0 -1
- package/dist/components/Select/Select.js +620 -401
- package/dist/components/Select/Select.variant.cjs +1 -1
- package/dist/components/Select/Select.variant.d.cts +5 -5
- package/dist/components/Select/Select.variant.d.ts +5 -5
- package/dist/components/Select/Select.variant.js +10 -12
- package/dist/components/Sheet/Sheet.variant.cjs +1 -1
- package/dist/components/Sheet/Sheet.variant.js +6 -6
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.interface.d.cts +12 -3
- package/dist/components/Switch/Switch.interface.d.ts +12 -3
- package/dist/components/Switch/Switch.js +57 -37
- package/dist/components/Switch/Switch.variant.cjs +1 -1
- package/dist/components/Switch/Switch.variant.d.cts +9 -5
- package/dist/components/Switch/Switch.variant.d.ts +9 -5
- package/dist/components/Switch/Switch.variant.js +22 -15
- package/dist/components/Table/Table.cjs +1 -1
- package/dist/components/Table/Table.interface.d.cts +9 -0
- package/dist/components/Table/Table.interface.d.ts +9 -0
- package/dist/components/Table/Table.js +462 -271
- package/dist/components/Table/TableSkeletonRows.cjs +1 -1
- package/dist/components/Table/TableSkeletonRows.js +26 -21
- package/dist/components/Table/TableSortToggle.cjs +1 -1
- package/dist/components/Table/TableSortToggle.d.cts +1 -1
- package/dist/components/Table/TableSortToggle.d.ts +1 -1
- package/dist/components/Table/TableSortToggle.js +23 -22
- package/dist/components/Table/hooks/useTableCardLabels.cjs +1 -0
- package/dist/components/Table/hooks/useTableCardLabels.d.cts +9 -0
- package/dist/components/Table/hooks/useTableCardLabels.d.ts +9 -0
- package/dist/components/Table/hooks/useTableCardLabels.js +34 -0
- package/dist/components/Table/hooks/useTableSort.cjs +1 -1
- package/dist/components/Table/hooks/useTableSort.d.cts +2 -0
- package/dist/components/Table/hooks/useTableSort.d.ts +2 -0
- package/dist/components/Table/hooks/useTableSort.js +8 -1
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.js +90 -63
- package/dist/components/Tabs/Tabs.variant.cjs +1 -1
- package/dist/components/Tabs/Tabs.variant.d.cts +2 -2
- package/dist/components/Tabs/Tabs.variant.d.ts +2 -2
- package/dist/components/Tabs/Tabs.variant.js +52 -29
- package/dist/components/Textarea/Textarea.cjs +1 -1
- package/dist/components/Textarea/Textarea.js +19 -18
- package/dist/components/Textarea/Textarea.variant.cjs +1 -1
- package/dist/components/Textarea/Textarea.variant.js +5 -5
- package/dist/components/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.interface.d.cts +0 -1
- package/dist/components/TimePicker/TimePicker.interface.d.ts +0 -1
- package/dist/components/TimePicker/TimePicker.js +121 -83
- package/dist/components/TimePicker/TimePicker.variant.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.variant.d.cts +1 -3
- package/dist/components/TimePicker/TimePicker.variant.d.ts +1 -3
- package/dist/components/TimePicker/TimePicker.variant.js +9 -11
- package/dist/components/TimePicker/TimePickerPanel.cjs +1 -1
- package/dist/components/TimePicker/TimePickerPanel.js +3 -4
- package/dist/components/TimePicker/TimePickerWheel.cjs +1 -0
- package/dist/components/TimePicker/TimePickerWheel.d.cts +27 -0
- package/dist/components/TimePicker/TimePickerWheel.d.ts +27 -0
- package/dist/components/TimePicker/TimePickerWheel.js +205 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.d.cts +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js +56 -34
- package/dist/components/Toast/Toast.variant.cjs +1 -1
- package/dist/components/Toast/Toast.variant.d.cts +1 -1
- package/dist/components/Toast/Toast.variant.d.ts +1 -1
- package/dist/components/Toast/Toast.variant.js +1 -1
- package/dist/components/Toast/ToastHost.cjs +1 -1
- package/dist/components/Toast/ToastHost.js +42 -41
- package/dist/components/Toast/function/toastHaptics.cjs +1 -0
- package/dist/components/Toast/function/toastHaptics.d.cts +11 -0
- package/dist/components/Toast/function/toastHaptics.d.ts +11 -0
- package/dist/components/Toast/function/toastHaptics.js +6 -0
- package/dist/components/Uploader/Uploader.cjs +2 -2
- package/dist/components/Uploader/Uploader.js +328 -158
- package/dist/components/Uploader/Uploader.variant.cjs +1 -1
- package/dist/components/Uploader/Uploader.variant.d.cts +1 -3
- package/dist/components/Uploader/Uploader.variant.d.ts +1 -3
- package/dist/components/Uploader/Uploader.variant.js +2 -5
- package/dist/components/shared/ActionSheet.cjs +1 -0
- package/dist/components/shared/ActionSheet.d.cts +26 -0
- package/dist/components/shared/ActionSheet.d.ts +26 -0
- package/dist/components/shared/ActionSheet.js +51 -0
- package/dist/components/shared/FieldClearButton.cjs +1 -1
- package/dist/components/shared/FieldClearButton.d.cts +2 -1
- package/dist/components/shared/FieldClearButton.d.ts +2 -1
- package/dist/components/shared/FieldClearButton.js +11 -10
- package/dist/components/shared/FieldLabel.cjs +1 -1
- package/dist/components/shared/FieldLabel.js +6 -6
- package/dist/components/shared/IconActionButton.cjs +1 -1
- package/dist/components/shared/IconActionButton.d.cts +6 -1
- package/dist/components/shared/IconActionButton.d.ts +6 -1
- package/dist/components/shared/IconActionButton.js +9 -11
- package/dist/components/shared/WheelColumn.cjs +1 -0
- package/dist/components/shared/WheelColumn.d.cts +29 -0
- package/dist/components/shared/WheelColumn.d.ts +29 -0
- package/dist/components/shared/WheelColumn.js +116 -0
- package/dist/components/shared/haptics.cjs +1 -0
- package/dist/components/shared/haptics.d.cts +6 -0
- package/dist/components/shared/haptics.d.ts +6 -0
- package/dist/components/shared/haptics.js +8 -0
- package/dist/components/shared/responsiveScale.cjs +1 -1
- package/dist/components/shared/responsiveScale.d.cts +7 -1
- package/dist/components/shared/responsiveScale.d.ts +7 -1
- package/dist/components/shared/responsiveScale.js +2 -6
- package/dist/components/shared/useStickyToolbar.cjs +1 -0
- package/dist/components/shared/useStickyToolbar.d.cts +17 -0
- package/dist/components/shared/useStickyToolbar.d.ts +17 -0
- package/dist/components/shared/useStickyToolbar.js +39 -0
- package/dist/components/shared/useWheelSize.cjs +1 -0
- package/dist/components/shared/useWheelSize.d.cts +10 -0
- package/dist/components/shared/useWheelSize.d.ts +10 -0
- package/dist/components/shared/useWheelSize.js +14 -0
- package/dist/components/shared/viewport.cjs +1 -0
- package/dist/components/shared/viewport.d.cts +17 -0
- package/dist/components/shared/viewport.d.ts +17 -0
- package/dist/components/shared/viewport.js +32 -0
- package/dist/config/messages.cjs +1 -1
- package/dist/config/messages.d.cts +14 -0
- package/dist/config/messages.d.ts +14 -0
- package/dist/config/messages.js +26 -8
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +16 -16
- package/package.json +2 -1
|
@@ -2,35 +2,36 @@
|
|
|
2
2
|
import { useZuiConfig as e } from "../../config/useZuiConfig.js";
|
|
3
3
|
import { convertToEnglishDigits as t } from "../../services/convertToEnglishDigits/convertToEnglishDigits.js";
|
|
4
4
|
import { cn as n, mergeRefs as ee } from "../../lib/utils.js";
|
|
5
|
+
import r from "../Tooltip/Tooltip.js";
|
|
6
|
+
import { CLEAR_ICON_CLASS as i } from "../shared/FieldClearButton.js";
|
|
5
7
|
import { FieldLabel as te, RequiredMark as ne } from "../shared/FieldLabel.js";
|
|
6
8
|
import { useInvalidState as re } from "../shared/useInvalidState.js";
|
|
7
|
-
import ie from "
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { Eye as l, EyeOff as u, Search as d, X as f } from "lucide-react";
|
|
9
|
+
import { applyInputChange as a, resolveAsciiValue as o, resolveDisplayValue as s, resolveInputTypeStrategy as ie } from "./Input.formatting.js";
|
|
10
|
+
import { inputVariants as ae } from "./Input.variant.js";
|
|
11
|
+
import * as c from "react";
|
|
12
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
13
|
+
import { Eye as oe, EyeOff as d, Search as f, X as p } from "lucide-react";
|
|
13
14
|
//#region src/components/Input/Input.tsx
|
|
14
|
-
function
|
|
15
|
+
function m(e) {
|
|
15
16
|
return e == null ? !1 : typeof e == "string" || Array.isArray(e) ? e.length > 0 : typeof e == "number";
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function h() {
|
|
18
19
|
let e = new Intl.DateTimeFormat("en-US-u-ca-persian", { year: "numeric" }).format(/* @__PURE__ */ new Date());
|
|
19
20
|
return Number.parseInt(e, 10);
|
|
20
21
|
}
|
|
21
|
-
var
|
|
22
|
-
let { messages: F, digits: I, dir: L } = e(), [R, z] =
|
|
22
|
+
var g = c.forwardRef(function({ className: g, wrapperClassName: _, type: v = "text", title: y, required: b = !1, showRequiredMessage: x = !1, characterLimit: se, placeholder: ce, onChange: S, onBlur: C, onFocus: le, onInvalid: ue, id: de, name: fe, disabled: w = !1, readOnly: T = !1, autoComplete: E, "aria-label": D, value: O, defaultValue: k, maxLength: A, inputMode: j, onMouseUp: M, ...N }, P) {
|
|
23
|
+
let { messages: F, digits: I, dir: L } = e(), [R, z] = c.useState(!1), { isInvalid: B, setIsInvalid: V, handleInvalid: pe } = re(ue), [H, U] = c.useState(() => o(k, v)), me = c.useId(), W = de ?? me, G = c.useRef(null), he = c.useMemo(() => ee(G, P), [P]), K = ie(v), q = v === "search", J = v === "password", Y = v === "year", X = I === "persian" && !(J && !R), ge = J ? R ? "text" : "password" : q ? "search" : "text", Z = O !== void 0, Q = Z ? m(O) : H.length > 0, _e = Z ? s(o(O, v), v, X) : void 0, ve = k === void 0 ? void 0 : s(o(k, v), v, X), $ = c.useMemo(() => {
|
|
23
24
|
if (!Y) return null;
|
|
24
|
-
let e =
|
|
25
|
+
let e = h();
|
|
25
26
|
return {
|
|
26
27
|
min: e - 100,
|
|
27
28
|
max: e + 50
|
|
28
29
|
};
|
|
29
30
|
}, [Y]);
|
|
30
|
-
|
|
31
|
+
c.useEffect(() => {
|
|
31
32
|
let e = G.current;
|
|
32
33
|
if (Z || !e) return;
|
|
33
|
-
let t =
|
|
34
|
+
let t = s(H, v, X);
|
|
34
35
|
e.value !== t && (e.value = t);
|
|
35
36
|
}, [
|
|
36
37
|
Z,
|
|
@@ -38,8 +39,8 @@ var h = o.forwardRef(function({ className: h, wrapperClassName: g, size: _ = "de
|
|
|
38
39
|
X,
|
|
39
40
|
v
|
|
40
41
|
]);
|
|
41
|
-
let ye =
|
|
42
|
-
let t = e.target, n =
|
|
42
|
+
let ye = c.useCallback((e) => {
|
|
43
|
+
let t = e.target, n = a(v, t.value, t.selectionStart, t.selectionEnd, X);
|
|
43
44
|
t.value = n.asciiValue, n.asciiSelection && t.setSelectionRange(...n.asciiSelection), Z || U(n.asciiValue), V(!1), S?.(e), n.displayValue !== null && (t.value = n.displayValue, n.displaySelection && t.setSelectionRange(...n.displaySelection));
|
|
44
45
|
}, [
|
|
45
46
|
Z,
|
|
@@ -47,14 +48,14 @@ var h = o.forwardRef(function({ className: h, wrapperClassName: g, size: _ = "de
|
|
|
47
48
|
V,
|
|
48
49
|
X,
|
|
49
50
|
v
|
|
50
|
-
]), be =
|
|
51
|
+
]), be = c.useCallback((e) => {
|
|
51
52
|
M?.(e);
|
|
52
53
|
let t = e.currentTarget;
|
|
53
54
|
if (!K.isFormatted || e.defaultPrevented || e.detail > 1 || t.value.length === 0 || t.selectionStart !== t.selectionEnd) return;
|
|
54
55
|
let n = t.value.length;
|
|
55
56
|
t.setSelectionRange(n, n);
|
|
56
|
-
}, [M, K.isFormatted]), xe =
|
|
57
|
-
if (Z || U(
|
|
57
|
+
}, [M, K.isFormatted]), xe = c.useCallback((e) => {
|
|
58
|
+
if (Z || U(o(e.target.value, v)), $) {
|
|
58
59
|
let n = t({ value: e.target.value });
|
|
59
60
|
if (n.length === 4) {
|
|
60
61
|
let e = Number.parseInt(n, 10);
|
|
@@ -68,30 +69,30 @@ var h = o.forwardRef(function({ className: h, wrapperClassName: g, size: _ = "de
|
|
|
68
69
|
V,
|
|
69
70
|
v,
|
|
70
71
|
$
|
|
71
|
-
]), Se =
|
|
72
|
+
]), Se = c.useCallback(() => {
|
|
72
73
|
let e = G.current;
|
|
73
74
|
if (!e) return;
|
|
74
75
|
let t = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
75
76
|
t ? t.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus();
|
|
76
|
-
}, []), Ce = n(
|
|
77
|
-
return /* @__PURE__ */
|
|
77
|
+
}, []), Ce = n(ae(), K.isCentered ? "zui:text-center" : "zui:text-start", q ? "zui-input-search-cancel zui:ps-10 zui:pe-10" : J ? "zui:pe-16" : "zui:pe-10");
|
|
78
|
+
return /* @__PURE__ */ u("div", {
|
|
78
79
|
"data-slot": "input-field",
|
|
79
80
|
dir: L,
|
|
80
|
-
className: n("zui:w-full zui:space-y-1.5 zui:text-start",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
81
|
+
className: n("zui:w-full zui:space-y-1.5 zui:text-start", _),
|
|
82
|
+
children: [/* @__PURE__ */ l(te, {
|
|
82
83
|
title: y,
|
|
83
84
|
htmlFor: W,
|
|
84
85
|
required: b,
|
|
85
86
|
showRequiredMessage: x
|
|
86
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ u("div", {
|
|
87
88
|
className: "zui:relative",
|
|
88
89
|
children: [
|
|
89
|
-
!y && b && !x ? /* @__PURE__ */
|
|
90
|
-
q ? /* @__PURE__ */
|
|
90
|
+
!y && b && !x ? /* @__PURE__ */ l(ne, {}) : null,
|
|
91
|
+
q ? /* @__PURE__ */ l(f, {
|
|
91
92
|
className: "zui:pointer-events-none zui:absolute zui:start-3 zui:top-1/2 zui:size-4 zui:-translate-y-1/2 zui:text-[var(--zui-color-text)]",
|
|
92
93
|
"aria-hidden": "true"
|
|
93
94
|
}) : null,
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ l("input", {
|
|
95
96
|
...N,
|
|
96
97
|
ref: he,
|
|
97
98
|
id: W,
|
|
@@ -115,32 +116,32 @@ var h = o.forwardRef(function({ className: h, wrapperClassName: g, size: _ = "de
|
|
|
115
116
|
onInvalid: pe,
|
|
116
117
|
value: _e,
|
|
117
118
|
defaultValue: ve,
|
|
118
|
-
className: n(Ce,
|
|
119
|
+
className: n(Ce, g)
|
|
119
120
|
}),
|
|
120
|
-
Q && !w ? /* @__PURE__ */
|
|
121
|
+
Q && !w ? /* @__PURE__ */ l(r, {
|
|
121
122
|
text: F.common.clear,
|
|
122
123
|
position: "top",
|
|
123
124
|
disabled: T,
|
|
124
|
-
trigger: /* @__PURE__ */
|
|
125
|
+
trigger: /* @__PURE__ */ l("button", {
|
|
125
126
|
type: "button",
|
|
126
127
|
onClick: Se,
|
|
127
128
|
disabled: T,
|
|
128
129
|
tabIndex: -1,
|
|
129
|
-
className: n("zui:group/clear-input zui:absolute zui:top-1/2 zui:inline-flex zui:-translate-y-1/2 zui:items-center zui:justify-center zui:cursor-pointer zui:border-0 zui:bg-transparent zui:p-0 zui:leading-none zui:text-[var(--zui-color-text)] zui:outline-none zui:transition-opacity zui:duration-200 zui:ease-out zui:hover:opacity-80 zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:opacity-50", J ? "zui:end-9" : "zui:end-3"),
|
|
130
|
+
className: n("zui:group/clear-input zui:absolute zui:top-1/2 zui:inline-flex zui:-translate-y-1/2 zui:items-center zui:justify-center zui:cursor-pointer zui:border-0 zui:bg-transparent zui:p-0 zui:leading-none zui:text-[var(--zui-color-text)] zui:outline-none zui:transition-opacity zui:duration-200 zui:ease-out zui:hover:opacity-80 zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:opacity-50", J ? "zui:end-9 zui:mobile:end-10" : "zui:end-3"),
|
|
130
131
|
"aria-label": F.common.clear,
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
-
className:
|
|
132
|
+
children: /* @__PURE__ */ l(p, {
|
|
133
|
+
className: `${i} zui:text-[var(--zui-color-text)] zui:transition-transform zui:duration-200 zui:ease-out zui:group-hover/clear-input:scale-110`,
|
|
133
134
|
"aria-hidden": "true"
|
|
134
135
|
})
|
|
135
136
|
})
|
|
136
137
|
}) : null,
|
|
137
|
-
J ? /* @__PURE__ */
|
|
138
|
+
J ? /* @__PURE__ */ l("button", {
|
|
138
139
|
type: "button",
|
|
139
140
|
onClick: () => z((e) => !e),
|
|
140
141
|
className: "zui:absolute zui:end-3 zui:top-1/2 zui:-translate-y-1/2 zui:cursor-pointer zui:text-[var(--zui-color-text)] zui:transition-opacity zui:hover:opacity-80 zui:focus-visible:outline-none",
|
|
141
142
|
"aria-label": R ? F.input.hidePassword : F.input.showPassword,
|
|
142
|
-
children:
|
|
143
|
-
className:
|
|
143
|
+
children: l(R ? d : oe, {
|
|
144
|
+
className: i,
|
|
144
145
|
"aria-hidden": "true"
|
|
145
146
|
})
|
|
146
147
|
}) : null
|
|
@@ -149,4 +150,4 @@ var h = o.forwardRef(function({ className: h, wrapperClassName: g, size: _ = "de
|
|
|
149
150
|
});
|
|
150
151
|
});
|
|
151
152
|
//#endregion
|
|
152
|
-
export {
|
|
153
|
+
export { g as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../shared/responsiveScale.cjs`),t=require(`../shared/fieldStyles.cjs`);var n=(0,require(`class-variance-authority`).cva)([`zui:file:text-[var(--zui-color-text)] zui:placeholder:text-[var(--zui-theme-text-muted)] zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:flex zui:w-full zui:min-w-0 zui-radius-xs zui:border zui:border-[var(--zui-color-border)] zui:bg-transparent ${e.CONTROL_PADDING_X} zui:py-2 zui:text-base zui:text-[var(--zui-color-text)] zui:outline-none zui:file:inline-flex zui:file:h-7 zui:file:border-0 zui:file:bg-transparent zui:file:text-sm zui:file:font-medium zui:data-[has-value=true]:border-[var(--zui-theme-action-primary)] zui:[&:not(:focus):not(:focus-visible):not([data-has-value=true])]:border-[var(--zui-color-border)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:bg-[var(--zui-color-muted-surface)] zui:disabled:opacity-50 zui:md:text-sm`,t.fieldInteractionClassName].join(` `)
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../shared/responsiveScale.cjs`),t=require(`../shared/fieldStyles.cjs`);var n=(0,require(`class-variance-authority`).cva)([`zui:file:text-[var(--zui-color-text)] zui:placeholder:text-[var(--zui-theme-text-muted)] zui:mobile:placeholder:text-sm zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:flex zui:w-full zui:min-w-0 zui-radius-xs zui:border zui:border-[var(--zui-color-border)] zui:bg-transparent ${e.CONTROL_PADDING_X} zui:py-2 zui:text-base ${e.FIELD_TEXT_MOBILE} zui:text-[var(--zui-color-text)] zui:outline-none zui:file:inline-flex zui:file:h-7 zui:file:border-0 zui:file:bg-transparent zui:file:text-sm zui:file:font-medium zui:data-[has-value=true]:border-[var(--zui-theme-action-primary)] zui:[&:not(:focus):not(:focus-visible):not([data-has-value=true])]:border-[var(--zui-color-border)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:bg-[var(--zui-color-muted-surface)] zui:disabled:opacity-50 zui:md:text-sm`,t.fieldInteractionClassName,e.CONTROL_HEIGHT_DEFAULT].join(` `));exports.inputVariants=n;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const inputVariants: (props?: (
|
|
2
|
-
size?: "sm" | "default" | "lg" | null | undefined;
|
|
3
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
1
|
+
declare const inputVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
2
|
export { inputVariants };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const inputVariants: (props?: (
|
|
2
|
-
size?: "sm" | "default" | "lg" | null | undefined;
|
|
3
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
1
|
+
declare const inputVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
2
|
export { inputVariants };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fieldInteractionClassName as
|
|
3
|
-
import { cva as
|
|
1
|
+
import { CONTROL_HEIGHT_DEFAULT as e, CONTROL_PADDING_X as t, FIELD_TEXT_MOBILE as n } from "../shared/responsiveScale.js";
|
|
2
|
+
import { fieldInteractionClassName as r } from "../shared/fieldStyles.js";
|
|
3
|
+
import { cva as i } from "class-variance-authority";
|
|
4
4
|
//#region src/components/Input/Input.variant.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
var a = i([
|
|
6
|
+
`zui:file:text-[var(--zui-color-text)] zui:placeholder:text-[var(--zui-theme-text-muted)] zui:mobile:placeholder:text-sm zui:selection:bg-[var(--zui-theme-action-primary)] zui:selection:text-[var(--zui-theme-text-inverse)] zui:flex zui:w-full zui:min-w-0 zui-radius-xs zui:border zui:border-[var(--zui-color-border)] zui:bg-transparent ${t} zui:py-2 zui:text-base ${n} zui:text-[var(--zui-color-text)] zui:outline-none zui:file:inline-flex zui:file:h-7 zui:file:border-0 zui:file:bg-transparent zui:file:text-sm zui:file:font-medium zui:data-[has-value=true]:border-[var(--zui-theme-action-primary)] zui:[&:not(:focus):not(:focus-visible):not([data-has-value=true])]:border-[var(--zui-color-border)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:bg-[var(--zui-color-muted-surface)] zui:disabled:opacity-50 zui:md:text-sm`,
|
|
7
|
+
r,
|
|
8
|
+
e
|
|
9
|
+
].join(" "));
|
|
9
10
|
//#endregion
|
|
10
|
-
export {
|
|
11
|
+
export { a as inputVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/useZuiConfig.cjs`),n=require(`../../services/localizeDigits/localizeDigits.cjs`),r=require(`../../lib/utils.cjs`),i=require(`../shared/useControllableState.cjs`),a=require(`./Pagination.variant.cjs`);let
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/useZuiConfig.cjs`),n=require(`../../services/localizeDigits/localizeDigits.cjs`),r=require(`../../lib/utils.cjs`),i=require(`../shared/useControllableState.cjs`),a=require(`../shared/viewport.cjs`),o=require(`./Pagination.variant.cjs`);let s=require(`react`);s=e.__toESM(s,1);let c=require(`react/jsx-runtime`),l=require(`lucide-react`);function u(e,t){if(typeof e!=`number`||!Number.isFinite(e))return t;let n=Math.floor(e);return n>=1?n:t}function d(e,t){return Math.min(Math.max(e,1),t)}function f({currentPage:e,totalPages:t,siblingCount:n}){if(t<=1)return[1];if(t<=n*2+5)return Array.from({length:t},(e,t)=>t+1);let r=Math.max(e-n,2),i=Math.min(e+n,t-1),a=r>2,o=i<t-1,s=[1];if(a)s.push(`ellipsis`);else for(let e=2;e<r;e+=1)s.push(e);for(let e=r;e<=i;e+=1)s.push(e);if(o)s.push(`ellipsis`);else for(let e=i+1;e<t;e+=1)s.push(e);return s.push(t),s}var p=4;function m(e,t){if(t<=p)return Array.from({length:t},(e,t)=>t+1);let n=new Set([1,t,e]);e===1?n.add(2):e===t&&n.add(t-1);let r=Array.from(n).sort((e,t)=>e-t),i=[];return r.forEach((e,t)=>{let n=r[t-1];n!==void 0&&e-n-1>0&&i.push(`ellipsis`),i.push(e)}),i}function h({totalPages:e=1,page:p,defaultPage:h=1,siblingCount:g=1,showControls:_=!0,previousLabel:v,nextLabel:y,dir:b,className:x,onPageChange:S},C){let{messages:w,digits:T,dir:E}=t.useZuiConfig(),D=a.useIsMobileViewport(),O=b??E,k=v??w.pagination.previous,A=y??w.pagination.next,j=e=>n.localizeDigits(String(e),T),M=u(e,1),N=d(u(h,1),M),[P,F]=i.useControllableState({value:p===void 0?void 0:u(p,1),defaultValue:N,onChange:S}),I=d(P,M),L=Math.max(0,Math.floor(g)),R=s.useMemo(()=>D?m(I,M):f({currentPage:I,totalPages:M,siblingCount:L}),[I,D,L,M]),z=s.useCallback(e=>{let t=d(e,M);t!==I&&F(t)},[I,F,M]),B=I>1,V=I<M,H=O===`rtl`?l.ChevronRight:l.ChevronLeft,U=O===`rtl`?l.ChevronLeft:l.ChevronRight;return(0,c.jsx)(`nav`,{ref:C,role:`navigation`,"aria-label":w.pagination.ariaLabel,dir:O,"data-slot":`pagination`,className:r.cn(o.paginationVariants(),x),children:(0,c.jsxs)(`ul`,{"data-slot":`pagination-content`,className:o.paginationContentVariants(),children:[_?(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants(),children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`pagination-previous`,"aria-label":k,disabled:!B,onClick:()=>z(I-1),className:r.cn(o.paginationLinkVariants({size:`default`}),o.paginationPreviousVariants()),children:[(0,c.jsx)(H,{className:`zui:size-4`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`zui:hidden zui:desktop:inline`,children:k})]})}):null,R.map((e,t)=>{if(e===`ellipsis`)return(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants({kind:`ellipsis`}),children:(0,c.jsxs)(`span`,{"data-slot":`pagination-ellipsis`,"aria-hidden":`true`,className:o.paginationEllipsisVariants(),children:[(0,c.jsx)(l.MoreHorizontal,{className:`zui:size-4`}),(0,c.jsx)(`span`,{className:`zui:sr-only`,children:w.pagination.morePages})]})},`ellipsis-${t}`);let n=e===I;return(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants(),children:(0,c.jsx)(`button`,{type:`button`,"data-slot":`pagination-link`,"aria-label":w.pagination.page(j(e)),"aria-current":n?`page`:void 0,onClick:()=>z(e),className:o.paginationLinkVariants({size:`icon`,active:n}),children:j(e)})},`page-${e}`)}),_?(0,c.jsx)(`li`,{"data-slot":`pagination-item`,className:o.paginationItemVariants(),children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`pagination-next`,"aria-label":A,disabled:!V,onClick:()=>z(I+1),className:r.cn(o.paginationLinkVariants({size:`default`}),o.paginationNextVariants()),children:[(0,c.jsx)(`span`,{className:`zui:hidden zui:desktop:inline`,children:A}),(0,c.jsx)(U,{className:`zui:size-4`,"aria-hidden":`true`})]})}):null]})})}var g=s.forwardRef(h);g.displayName=`Pagination`,exports.default=g;
|
|
@@ -3,20 +3,21 @@ import { useZuiConfig as e } from "../../config/useZuiConfig.js";
|
|
|
3
3
|
import { localizeDigits as t } from "../../services/localizeDigits/localizeDigits.js";
|
|
4
4
|
import { cn as n } from "../../lib/utils.js";
|
|
5
5
|
import { useControllableState as r } from "../shared/useControllableState.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
6
|
+
import { useIsMobileViewport as i } from "../shared/viewport.js";
|
|
7
|
+
import { paginationContentVariants as a, paginationEllipsisVariants as o, paginationItemVariants as s, paginationLinkVariants as c, paginationNextVariants as l, paginationPreviousVariants as u, paginationVariants as d } from "./Pagination.variant.js";
|
|
8
|
+
import * as f from "react";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import { ChevronLeft as h, ChevronRight as g, MoreHorizontal as _ } from "lucide-react";
|
|
10
11
|
//#region src/components/Pagination/Pagination.tsx
|
|
11
|
-
function
|
|
12
|
+
function v(e, t) {
|
|
12
13
|
if (typeof e != "number" || !Number.isFinite(e)) return t;
|
|
13
14
|
let n = Math.floor(e);
|
|
14
15
|
return n >= 1 ? n : t;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function y(e, t) {
|
|
17
18
|
return Math.min(Math.max(e, 1), t);
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function b({ currentPage: e, totalPages: t, siblingCount: n }) {
|
|
20
21
|
if (t <= 1) return [1];
|
|
21
22
|
if (t <= n * 2 + 5) return Array.from({ length: t }, (e, t) => t + 1);
|
|
22
23
|
let r = Math.max(e - n, 2), i = Math.min(e + n, t - 1), a = r > 2, o = i < t - 1, s = [1];
|
|
@@ -27,103 +28,119 @@ function y({ currentPage: e, totalPages: t, siblingCount: n }) {
|
|
|
27
28
|
else for (let e = i + 1; e < t; e += 1) s.push(e);
|
|
28
29
|
return s.push(t), s;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
var x = 4;
|
|
32
|
+
function S(e, t) {
|
|
33
|
+
if (t <= x) return Array.from({ length: t }, (e, t) => t + 1);
|
|
34
|
+
let n = new Set([
|
|
35
|
+
1,
|
|
36
|
+
t,
|
|
37
|
+
e
|
|
38
|
+
]);
|
|
39
|
+
e === 1 ? n.add(2) : e === t && n.add(t - 1);
|
|
40
|
+
let r = Array.from(n).sort((e, t) => e - t), i = [];
|
|
41
|
+
return r.forEach((e, t) => {
|
|
42
|
+
let n = r[t - 1];
|
|
43
|
+
n !== void 0 && e - n - 1 > 0 && i.push("ellipsis"), i.push(e);
|
|
44
|
+
}), i;
|
|
45
|
+
}
|
|
46
|
+
function C({ totalPages: x = 1, page: C, defaultPage: w = 1, siblingCount: T = 1, showControls: E = !0, previousLabel: D, nextLabel: O, dir: k, className: A, onPageChange: j }, M) {
|
|
47
|
+
let { messages: N, digits: P, dir: F } = e(), I = i(), L = k ?? F, R = D ?? N.pagination.previous, z = O ?? N.pagination.next, B = (e) => t(String(e), P), V = v(x, 1), H = y(v(w, 1), V), [U, W] = r({
|
|
48
|
+
value: C === void 0 ? void 0 : v(C, 1),
|
|
49
|
+
defaultValue: H,
|
|
50
|
+
onChange: j
|
|
51
|
+
}), G = y(U, V), K = Math.max(0, Math.floor(T)), q = f.useMemo(() => I ? S(G, V) : b({
|
|
52
|
+
currentPage: G,
|
|
53
|
+
totalPages: V,
|
|
54
|
+
siblingCount: K
|
|
39
55
|
}), [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
t
|
|
56
|
+
G,
|
|
57
|
+
I,
|
|
58
|
+
K,
|
|
59
|
+
V
|
|
60
|
+
]), J = f.useCallback((e) => {
|
|
61
|
+
let t = y(e, V);
|
|
62
|
+
t !== G && W(t);
|
|
46
63
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]),
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
ref:
|
|
64
|
+
G,
|
|
65
|
+
W,
|
|
66
|
+
V
|
|
67
|
+
]), Y = G > 1, X = G < V, Z = L === "rtl" ? g : h, Q = L === "rtl" ? h : g;
|
|
68
|
+
return /* @__PURE__ */ p("nav", {
|
|
69
|
+
ref: M,
|
|
53
70
|
role: "navigation",
|
|
54
|
-
"aria-label":
|
|
55
|
-
dir:
|
|
71
|
+
"aria-label": N.pagination.ariaLabel,
|
|
72
|
+
dir: L,
|
|
56
73
|
"data-slot": "pagination",
|
|
57
|
-
className: n(
|
|
58
|
-
children: /* @__PURE__ */
|
|
74
|
+
className: n(d(), A),
|
|
75
|
+
children: /* @__PURE__ */ m("ul", {
|
|
59
76
|
"data-slot": "pagination-content",
|
|
60
|
-
className:
|
|
77
|
+
className: a(),
|
|
61
78
|
children: [
|
|
62
|
-
|
|
79
|
+
E ? /* @__PURE__ */ p("li", {
|
|
63
80
|
"data-slot": "pagination-item",
|
|
64
|
-
className:
|
|
65
|
-
children: /* @__PURE__ */
|
|
81
|
+
className: s(),
|
|
82
|
+
children: /* @__PURE__ */ m("button", {
|
|
66
83
|
type: "button",
|
|
67
84
|
"data-slot": "pagination-previous",
|
|
68
|
-
"aria-label":
|
|
69
|
-
disabled: !
|
|
70
|
-
onClick: () => G
|
|
71
|
-
className: n(
|
|
72
|
-
children: [/* @__PURE__ */
|
|
85
|
+
"aria-label": R,
|
|
86
|
+
disabled: !Y,
|
|
87
|
+
onClick: () => J(G - 1),
|
|
88
|
+
className: n(c({ size: "default" }), u()),
|
|
89
|
+
children: [/* @__PURE__ */ p(Z, {
|
|
73
90
|
className: "zui:size-4",
|
|
74
91
|
"aria-hidden": "true"
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
-
className: "zui:hidden zui:
|
|
77
|
-
children:
|
|
92
|
+
}), /* @__PURE__ */ p("span", {
|
|
93
|
+
className: "zui:hidden zui:desktop:inline",
|
|
94
|
+
children: R
|
|
78
95
|
})]
|
|
79
96
|
})
|
|
80
97
|
}) : null,
|
|
81
|
-
|
|
82
|
-
if (e === "ellipsis") return /* @__PURE__ */
|
|
98
|
+
q.map((e, t) => {
|
|
99
|
+
if (e === "ellipsis") return /* @__PURE__ */ p("li", {
|
|
83
100
|
"data-slot": "pagination-item",
|
|
84
|
-
className:
|
|
85
|
-
children: /* @__PURE__ */
|
|
101
|
+
className: s({ kind: "ellipsis" }),
|
|
102
|
+
children: /* @__PURE__ */ m("span", {
|
|
86
103
|
"data-slot": "pagination-ellipsis",
|
|
87
104
|
"aria-hidden": "true",
|
|
88
|
-
className:
|
|
89
|
-
children: [/* @__PURE__ */
|
|
105
|
+
className: o(),
|
|
106
|
+
children: [/* @__PURE__ */ p(_, { className: "zui:size-4" }), /* @__PURE__ */ p("span", {
|
|
90
107
|
className: "zui:sr-only",
|
|
91
|
-
children:
|
|
108
|
+
children: N.pagination.morePages
|
|
92
109
|
})]
|
|
93
110
|
})
|
|
94
111
|
}, `ellipsis-${t}`);
|
|
95
|
-
let n = e ===
|
|
96
|
-
return /* @__PURE__ */
|
|
112
|
+
let n = e === G;
|
|
113
|
+
return /* @__PURE__ */ p("li", {
|
|
97
114
|
"data-slot": "pagination-item",
|
|
98
|
-
className:
|
|
99
|
-
children: /* @__PURE__ */
|
|
115
|
+
className: s(),
|
|
116
|
+
children: /* @__PURE__ */ p("button", {
|
|
100
117
|
type: "button",
|
|
101
118
|
"data-slot": "pagination-link",
|
|
102
|
-
"aria-label":
|
|
119
|
+
"aria-label": N.pagination.page(B(e)),
|
|
103
120
|
"aria-current": n ? "page" : void 0,
|
|
104
|
-
onClick: () =>
|
|
105
|
-
className:
|
|
121
|
+
onClick: () => J(e),
|
|
122
|
+
className: c({
|
|
106
123
|
size: "icon",
|
|
107
124
|
active: n
|
|
108
125
|
}),
|
|
109
|
-
children:
|
|
126
|
+
children: B(e)
|
|
110
127
|
})
|
|
111
128
|
}, `page-${e}`);
|
|
112
129
|
}),
|
|
113
|
-
|
|
130
|
+
E ? /* @__PURE__ */ p("li", {
|
|
114
131
|
"data-slot": "pagination-item",
|
|
115
|
-
className:
|
|
116
|
-
children: /* @__PURE__ */
|
|
132
|
+
className: s(),
|
|
133
|
+
children: /* @__PURE__ */ m("button", {
|
|
117
134
|
type: "button",
|
|
118
135
|
"data-slot": "pagination-next",
|
|
119
|
-
"aria-label":
|
|
120
|
-
disabled: !
|
|
121
|
-
onClick: () => G
|
|
122
|
-
className: n(
|
|
123
|
-
children: [/* @__PURE__ */
|
|
124
|
-
className: "zui:hidden zui:
|
|
125
|
-
children:
|
|
126
|
-
}), /* @__PURE__ */
|
|
136
|
+
"aria-label": z,
|
|
137
|
+
disabled: !X,
|
|
138
|
+
onClick: () => J(G + 1),
|
|
139
|
+
className: n(c({ size: "default" }), l()),
|
|
140
|
+
children: [/* @__PURE__ */ p("span", {
|
|
141
|
+
className: "zui:hidden zui:desktop:inline",
|
|
142
|
+
children: z
|
|
143
|
+
}), /* @__PURE__ */ p(Q, {
|
|
127
144
|
className: "zui:size-4",
|
|
128
145
|
"aria-hidden": "true"
|
|
129
146
|
})]
|
|
@@ -133,7 +150,7 @@ function b({ totalPages: b = 1, page: x, defaultPage: S = 1, siblingCount: C = 1
|
|
|
133
150
|
})
|
|
134
151
|
});
|
|
135
152
|
}
|
|
136
|
-
var
|
|
137
|
-
|
|
153
|
+
var w = f.forwardRef(C);
|
|
154
|
+
w.displayName = "Pagination";
|
|
138
155
|
//#endregion
|
|
139
|
-
export {
|
|
156
|
+
export { w as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`class-variance-authority`);var t=(0,e.cva)(`zui:mx-auto zui:flex zui:w-full zui:justify-center`),n=(0,e.cva)(`zui:flex zui:flex-row zui:flex-wrap zui:items-center zui:justify-center zui:gap-1`),r=(0,e.cva)(
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`class-variance-authority`);var t=(0,e.cva)(`zui:mx-auto zui:flex zui:w-full zui:justify-center`),n=(0,e.cva)(`zui:flex zui:flex-row zui:flex-wrap zui:items-center zui:justify-center zui:gap-1 zui:mobile:w-full zui:mobile:flex-nowrap zui:mobile:gap-0.5`),r=(0,e.cva)(``,{variants:{kind:{button:`zui:mobile:min-w-9 zui:mobile:flex-[0_1_calc(var(--zui-scale,10px)*5.184)]`,ellipsis:`zui:mobile:shrink-0`}},defaultVariants:{kind:`button`}}),i=(0,e.cva)(`zui:inline-flex zui:cursor-pointer zui:items-center zui:justify-center zui:gap-1 zui:whitespace-nowrap zui-radius-xs zui:border zui:text-sm zui:mobile:text-base zui:font-medium zui:outline-none zui:select-none zui:transition-all zui:duration-300 zui:ease-out zui:focus-visible:ring-[3px] zui:focus-visible:ring-[var(--zui-theme-action-secondary)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:opacity-45`,{variants:{size:{default:`zui:h-9 zui:min-w-9 zui:px-3 zui:mobile:h-[calc(var(--zui-scale,10px)*5.184)] zui:mobile:w-full zui:mobile:px-0`,icon:`zui:h-9 zui:w-9 zui:mobile:h-[calc(var(--zui-scale,10px)*5.184)] zui:mobile:w-full`},active:{true:`zui:border-[var(--zui-theme-action-primary)] zui:bg-[color-mix(in_srgb,var(--zui-theme-action-primary)_12%,transparent)] zui:font-semibold zui:text-[var(--zui-theme-action-primary)] zui:hover:border-[var(--zui-theme-action-primary-hover)] zui:hover:text-[var(--zui-theme-action-primary-hover)]`,false:`zui:border-[var(--zui-theme-control-border)] zui:bg-[var(--zui-theme-control-bg)] zui:text-[var(--zui-theme-text-primary)] zui:hover:border-[var(--zui-theme-control-hover-border)] zui:hover:bg-[var(--zui-theme-control-hover-bg)]`}},defaultVariants:{size:`icon`,active:!1}}),a=(0,e.cva)(`zui:gap-1.5 zui:desktop:pe-2.5 zui:desktop:ps-3`),o=(0,e.cva)(`zui:gap-1.5 zui:desktop:pe-3 zui:desktop:ps-2.5`),s=(0,e.cva)(`zui:flex zui:size-9 zui:mobile:h-[calc(var(--zui-scale,10px)*5.184)] zui:mobile:w-[calc(var(--zui-scale,10px)*2.2)] zui:items-center zui:justify-center zui:text-[var(--zui-theme-text-muted)]`);exports.paginationContentVariants=n,exports.paginationEllipsisVariants=s,exports.paginationItemVariants=r,exports.paginationLinkVariants=i,exports.paginationNextVariants=o,exports.paginationPreviousVariants=a,exports.paginationVariants=t;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const paginationVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
2
|
declare const paginationContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
-
declare const paginationItemVariants: (props?:
|
|
3
|
+
declare const paginationItemVariants: (props?: ({
|
|
4
|
+
kind?: "button" | "ellipsis" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
6
|
declare const paginationLinkVariants: (props?: ({
|
|
5
7
|
size?: "default" | "icon" | null | undefined;
|
|
6
8
|
active?: boolean | null | undefined;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const paginationVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
2
|
declare const paginationContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
-
declare const paginationItemVariants: (props?:
|
|
3
|
+
declare const paginationItemVariants: (props?: ({
|
|
4
|
+
kind?: "button" | "ellipsis" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
6
|
declare const paginationLinkVariants: (props?: ({
|
|
5
7
|
size?: "default" | "icon" | null | undefined;
|
|
6
8
|
active?: boolean | null | undefined;
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { cva as e } from "class-variance-authority";
|
|
2
2
|
//#region src/components/Pagination/Pagination.variant.ts
|
|
3
|
-
var t = e("zui:mx-auto zui:flex zui:w-full zui:justify-center"), n = e("zui:flex zui:flex-row zui:flex-wrap zui:items-center zui:justify-center zui:gap-1
|
|
3
|
+
var t = e("zui:mx-auto zui:flex zui:w-full zui:justify-center"), n = e("zui:flex zui:flex-row zui:flex-wrap zui:items-center zui:justify-center zui:gap-1 zui:mobile:w-full zui:mobile:flex-nowrap zui:mobile:gap-0.5"), r = e("", {
|
|
4
|
+
variants: { kind: {
|
|
5
|
+
button: "zui:mobile:min-w-9 zui:mobile:flex-[0_1_calc(var(--zui-scale,10px)*5.184)]",
|
|
6
|
+
ellipsis: "zui:mobile:shrink-0"
|
|
7
|
+
} },
|
|
8
|
+
defaultVariants: { kind: "button" }
|
|
9
|
+
}), i = e("zui:inline-flex zui:cursor-pointer zui:items-center zui:justify-center zui:gap-1 zui:whitespace-nowrap zui-radius-xs zui:border zui:text-sm zui:mobile:text-base zui:font-medium zui:outline-none zui:select-none zui:transition-all zui:duration-300 zui:ease-out zui:focus-visible:ring-[3px] zui:focus-visible:ring-[var(--zui-theme-action-secondary)] zui:disabled:pointer-events-none zui:disabled:cursor-not-allowed zui:disabled:opacity-45", {
|
|
4
10
|
variants: {
|
|
5
11
|
size: {
|
|
6
|
-
default: "zui:h-9 zui:min-w-9 zui:px-3",
|
|
7
|
-
icon: "zui:
|
|
12
|
+
default: "zui:h-9 zui:min-w-9 zui:px-3 zui:mobile:h-[calc(var(--zui-scale,10px)*5.184)] zui:mobile:w-full zui:mobile:px-0",
|
|
13
|
+
icon: "zui:h-9 zui:w-9 zui:mobile:h-[calc(var(--zui-scale,10px)*5.184)] zui:mobile:w-full"
|
|
8
14
|
},
|
|
9
15
|
active: {
|
|
10
|
-
true: "zui:border-[var(--zui-theme-action-primary)] zui:text-[var(--zui-theme-action-primary)] zui:hover:border-[var(--zui-theme-action-primary-hover)] zui:hover:text-[var(--zui-theme-action-primary-hover)]",
|
|
11
|
-
false: ""
|
|
16
|
+
true: "zui:border-[var(--zui-theme-action-primary)] zui:bg-[color-mix(in_srgb,var(--zui-theme-action-primary)_12%,transparent)] zui:font-semibold zui:text-[var(--zui-theme-action-primary)] zui:hover:border-[var(--zui-theme-action-primary-hover)] zui:hover:text-[var(--zui-theme-action-primary-hover)]",
|
|
17
|
+
false: "zui:border-[var(--zui-theme-control-border)] zui:bg-[var(--zui-theme-control-bg)] zui:text-[var(--zui-theme-text-primary)] zui:hover:border-[var(--zui-theme-control-hover-border)] zui:hover:bg-[var(--zui-theme-control-hover-bg)]"
|
|
12
18
|
}
|
|
13
19
|
},
|
|
14
20
|
defaultVariants: {
|
|
15
21
|
size: "icon",
|
|
16
22
|
active: !1
|
|
17
23
|
}
|
|
18
|
-
}), a = e("zui:gap-1.5 zui:pe-2.5 zui:ps-3"), o = e("zui:gap-1.5 zui:pe-3 zui:ps-2.5"), s = e("zui:flex zui:size-9 zui:items-center zui:justify-center zui:text-[var(--zui-theme-text-muted)]");
|
|
24
|
+
}), a = e("zui:gap-1.5 zui:desktop:pe-2.5 zui:desktop:ps-3"), o = e("zui:gap-1.5 zui:desktop:pe-3 zui:desktop:ps-2.5"), s = e("zui:flex zui:size-9 zui:mobile:h-[calc(var(--zui-scale,10px)*5.184)] zui:mobile:w-[calc(var(--zui-scale,10px)*2.2)] zui:items-center zui:justify-center zui:text-[var(--zui-theme-text-muted)]");
|
|
19
25
|
//#endregion
|
|
20
26
|
export { n as paginationContentVariants, s as paginationEllipsisVariants, r as paginationItemVariants, i as paginationLinkVariants, o as paginationNextVariants, a as paginationPreviousVariants, t as paginationVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/useZuiConfig.cjs`),n=require(`../../lib/utils.cjs`),r=require(`../shared/FieldLabel.cjs`),i=require(`../shared/useInvalidState.cjs`),a=require(`./RadioGroup.variant.cjs`);let o=require(`react`);o=e.__toESM(o,1);let s=require(`react/jsx-runtime`),c=require(`@radix-ui/react-radio-group`);c=e.__toESM(c,1);var l=o.forwardRef(function({value:e,defaultValue:l,onValueChange:u,name:d,required:f=!1,id:p,title:m,children:h,"aria-label":g,className:_,orientation:v=`vertical`,gap:y=`default`,dir:b,disabled:x=!1,onInvalid:S},C){let{dir:w}=t.useZuiConfig(),T=b??w,{isInvalid:E,setIsInvalid:D,handleInvalid:O}=i.useInvalidState(S),k=o.useId(),A=m?`${p??k}-title`:void 0,j=o.useCallback(e=>{D(!1),u?.(e)},[u,D]);return(0,s.jsxs)(`div`,{"data-slot":`radio-group-field`,dir:T,className:`zui:w-full zui:space-y-1.5 zui:text-start`,children:[(0,s.jsx)(r.FieldLabel,{title:m,id:A,required:f}),(0,s.jsxs)(`div`,{className:`zui:relative`,children:[!m&&f?(0,s.jsx)(r.RequiredMark,{}):null,(0,s.jsx)(c.Root,{ref:C,id:p,"data-slot":`radio-group`,"aria-label":g,"aria-labelledby":g?void 0:A,"aria-invalid":E||void 0,"aria-required":f||void 0,"aria-disabled":x||void 0,dir:T,className:n.cn(E?`zui:[&_[data-slot=radio-group-item]]:border-[var(--zui-theme-status-danger)] zui:[&_[data-slot=radio-group-option]]:border-[var(--zui-theme-status-danger)]`:void 0,a.radioGroupVariants({orientation:v,gap:y,disabled:x,className:_})),value:e,defaultValue:l,onValueChange:j,onInvalid:O,name:d,required:f,disabled:x,children:h})]})]})}),u=o.forwardRef(function({className:e,
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/useZuiConfig.cjs`),n=require(`../../lib/utils.cjs`),r=require(`../shared/FieldLabel.cjs`),i=require(`../shared/useInvalidState.cjs`),a=require(`./RadioGroup.variant.cjs`);let o=require(`react`);o=e.__toESM(o,1);let s=require(`react/jsx-runtime`),c=require(`@radix-ui/react-radio-group`);c=e.__toESM(c,1);var l=o.forwardRef(function({value:e,defaultValue:l,onValueChange:u,name:d,required:f=!1,id:p,title:m,children:h,"aria-label":g,className:_,orientation:v=`vertical`,gap:y=`default`,dir:b,disabled:x=!1,onInvalid:S},C){let{dir:w}=t.useZuiConfig(),T=b??w,{isInvalid:E,setIsInvalid:D,handleInvalid:O}=i.useInvalidState(S),k=o.useId(),A=m?`${p??k}-title`:void 0,j=o.useCallback(e=>{D(!1),u?.(e)},[u,D]);return(0,s.jsxs)(`div`,{"data-slot":`radio-group-field`,dir:T,className:`zui:w-full zui:space-y-1.5 zui:text-start`,children:[(0,s.jsx)(r.FieldLabel,{title:m,id:A,required:f}),(0,s.jsxs)(`div`,{className:`zui:relative`,children:[!m&&f?(0,s.jsx)(r.RequiredMark,{}):null,(0,s.jsx)(c.Root,{ref:C,id:p,"data-slot":`radio-group`,"aria-label":g,"aria-labelledby":g?void 0:A,"aria-invalid":E||void 0,"aria-required":f||void 0,"aria-disabled":x||void 0,dir:T,className:n.cn(E?`zui:[&_[data-slot=radio-group-item]]:border-[var(--zui-theme-status-danger)] zui:[&_[data-slot=radio-group-option]]:border-[var(--zui-theme-status-danger)]`:void 0,a.radioGroupVariants({orientation:v,gap:y,disabled:x,className:_})),value:e,defaultValue:l,onValueChange:j,onInvalid:O,name:d,required:f,disabled:x,children:h})]})]})}),u=o.forwardRef(function({className:e,disabled:r=!1,label:i,description:l,id:u,direction:d,optionClassName:f,labelClassName:p,descriptionClassName:m,indicatorClassName:h,value:g,onFocus:_,onBlur:v},y){let{dir:b}=t.useZuiConfig(),x=d??b,S=o.useId(),C=u??S,w=(0,s.jsx)(`span`,{"data-slot":`radio-group-control`,className:`zui:relative zui:inline-flex zui:shrink-0 zui:[&>input]:inset-0! zui:[&>input]:transform-none!`,children:(0,s.jsx)(c.Item,{ref:y,id:C,"data-slot":`radio-group-item`,"aria-disabled":r||void 0,className:n.cn(a.radioGroupItemVariants({disabled:r,className:e})),disabled:r,value:g,onFocus:_,onBlur:v,children:(0,s.jsx)(c.Indicator,{"data-slot":`radio-group-indicator`,className:n.cn(a.radioGroupIndicatorVariants(),h),children:(0,s.jsx)(`span`,{className:n.cn(`zui:block zui-radius-full zui:bg-[var(--zui-theme-action-primary)]`,a.radioGroupDotClassName)})})})});return!i&&!l?w:(0,s.jsxs)(`label`,{htmlFor:C,"data-slot":`radio-group-option`,dir:x??void 0,className:n.cn(a.radioGroupOptionVariants({direction:x,disabled:r,className:f})),children:[w,(0,s.jsxs)(`span`,{className:`zui:min-w-0 zui:flex-1`,children:[i?(0,s.jsx)(`span`,{className:n.cn(a.radioGroupLabelVariants({disabled:r}),p),children:i}):null,l?(0,s.jsx)(`span`,{className:n.cn(a.radioGroupDescriptionVariants(),m),children:l}):null]})]})});exports.RadioGroupItem=u,exports.default=l;
|