@lazar-ui/kit 0.5.2 → 0.6.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/CHANGELOG.md +18 -0
- package/dist/Actions-CEIXfLKN.mjs +26 -0
- package/dist/Actions.css +1 -0
- package/dist/ActiveFilters-BJojmc-d.mjs +29 -0
- package/dist/ActiveFilters.css +1 -0
- package/dist/Button-BN85EtaZ.mjs +52 -0
- package/dist/Button.css +1 -1
- package/dist/Cell-BPBvEyeL.mjs +21 -0
- package/dist/Cell.css +1 -0
- package/dist/Checkbox-Chfzm1Z9.mjs +46 -0
- package/dist/Checkbox.css +1 -0
- package/dist/Content-ru2X8iBx.mjs +13 -0
- package/dist/Content.css +1 -0
- package/dist/Group-DyDpeqOP.mjs +16 -0
- package/dist/Group.css +1 -0
- package/dist/Header-Clhgyr0J.mjs +29 -0
- package/dist/Header.css +1 -0
- package/dist/Heading-CL47Fqe7.mjs +30 -0
- package/dist/Heading.css +1 -0
- package/dist/InputBase-BHZWQT9-.mjs +46 -0
- package/dist/Item-JbyvZy05.mjs +66 -0
- package/dist/Item.css +1 -0
- package/dist/Panel-Q06TIYep.mjs +12 -0
- package/dist/Provider-CBfZpO45.mjs +12 -0
- package/dist/Row-C-3TXoDz.mjs +15 -0
- package/dist/Row.css +1 -0
- package/dist/Tab-CR0KvVaA.mjs +39 -0
- package/dist/Tab.css +1 -0
- package/dist/Text-DiOqZt8E.mjs +49 -0
- package/dist/Text.css +1 -0
- package/dist/Title-aOeFD24v.mjs +13 -0
- package/dist/Title.css +1 -0
- package/dist/Toolbar-BJQy4qFI.mjs +11 -0
- package/dist/Toolbar.css +1 -0
- package/dist/Trigger-C_4De6l1.mjs +11 -0
- package/dist/accordion.js +1 -1
- package/dist/actions.d.ts +13 -0
- package/dist/actions.js +4 -0
- package/dist/active-filters.d.ts +35 -0
- package/dist/active-filters.js +4 -0
- package/dist/breadcrumbs.js +1 -1
- package/dist/button.js +1 -1
- package/dist/cell.d.ts +20 -0
- package/dist/cell.js +4 -0
- package/dist/checkbox.d.ts +10 -35
- package/dist/checkbox.js +2 -40
- package/dist/content.d.ts +8 -0
- package/dist/content.js +4 -0
- package/dist/context.d.ts +44 -0
- package/dist/context.js +7 -0
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +37 -44
- package/dist/drawer.css +1 -1
- package/dist/drawer.js +72 -93
- package/dist/empty-state.css +1 -1
- package/dist/empty-state.js +29 -48
- package/dist/enums-BnuDYTua.mjs +4 -0
- package/dist/enums-CiPhZomh.mjs +6 -0
- package/dist/enums-DUZMBQDd.mjs +7 -0
- package/dist/{getComponentSlots-DwAYUFNk.mjs → getComponentSlots-DD4iju8N.mjs} +1 -1
- package/dist/group.d.ts +12 -0
- package/dist/group.js +4 -0
- package/dist/header.d.ts +21 -0
- package/dist/header.js +4 -0
- package/dist/heading.d.ts +55 -0
- package/dist/heading.js +7 -0
- package/dist/input-base.d.ts +29 -0
- package/dist/input-base.js +4 -0
- package/dist/input.js +86 -124
- package/dist/isValidReactNode-D1buElhX.mjs +17 -0
- package/dist/item.d.ts +16 -0
- package/dist/item.js +4 -0
- package/dist/menu.css +1 -1
- package/dist/menu.js +46 -103
- package/dist/pagination.js +48 -60
- package/dist/panel.d.ts +9 -0
- package/dist/panel.js +4 -0
- package/dist/radio.css +1 -1
- package/dist/radio.js +42 -98
- package/dist/row.d.ts +12 -0
- package/dist/row.js +4 -0
- package/dist/tab.d.ts +30 -0
- package/dist/tab.js +4 -0
- package/dist/table.css +1 -1
- package/dist/table.js +25 -74
- package/dist/tabs.css +1 -1
- package/dist/tabs.js +30 -72
- package/dist/text.d.ts +74 -0
- package/dist/text.js +8 -0
- package/dist/title.d.ts +8 -0
- package/dist/title.js +4 -0
- package/dist/toolbar.d.ts +20 -0
- package/dist/toolbar.js +4 -0
- package/dist/trigger.d.ts +8 -0
- package/dist/trigger.js +4 -0
- package/dist/typography.d.ts +90 -40
- package/dist/typography.js +4 -38
- package/dist/useTabsContext-DdF09jQq.mjs +11 -0
- package/dist/utils.d.ts +2 -55
- package/dist/utils.js +14 -15
- package/package.json +1 -1
- package/dist/Button-jq8mFP6t.mjs +0 -52
- package/dist/checkbox.css +0 -1
- package/dist/isValidReactNode-CmYwTWCE.mjs +0 -18
- package/dist/typography.css +0 -1
- /package/dist/{input.css → InputBase.css} +0 -0
package/dist/input.js
CHANGED
|
@@ -1,59 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { g as S } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
1
|
+
import { I as f, D as m, s as S } from "./InputBase-BHZWQT9-.mjs";
|
|
2
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { useState as I, useCallback as d } from "react";
|
|
5
4
|
import { I as Y } from "./Icon-DUCBChX2.mjs";
|
|
6
|
-
import { u as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
INPUT_NUMBER: "InputNumber",
|
|
12
|
-
INPUT_PASSWORD: "InputPassword",
|
|
13
|
-
INPUT_PHONE: "InputPhone"
|
|
14
|
-
}, E = "_root_8a405_17", U = "_invalid_8a405_36", C = "_disabled_8a405_42", B = "_sizeSm_8a405_56", L = "_sizeMd_8a405_60", k = "_sizeLg_8a405_64", x = "_control_8a405_68", O = "_before_8a405_100", $ = "_after_8a405_101", H = "_togglePassword_8a405_109", p = {
|
|
15
|
-
root: E,
|
|
16
|
-
invalid: U,
|
|
17
|
-
disabled: C,
|
|
18
|
-
sizeSm: B,
|
|
19
|
-
sizeMd: L,
|
|
20
|
-
sizeLg: k,
|
|
21
|
-
control: x,
|
|
22
|
-
before: O,
|
|
23
|
-
after: $,
|
|
24
|
-
togglePassword: H
|
|
25
|
-
}, f = (s) => {
|
|
26
|
-
const { ref: e, invalid: t = !1, size: o = "md", before: r, after: n, className: a, onChange: l, onBlur: c, onFocus: u, ...d } = s, g = z(
|
|
27
|
-
p.root,
|
|
28
|
-
S("size", o, p),
|
|
29
|
-
{
|
|
30
|
-
[p.disabled]: d.disabled === !0,
|
|
31
|
-
[p.invalid]: t
|
|
32
|
-
},
|
|
33
|
-
a
|
|
34
|
-
), I = (h) => {
|
|
35
|
-
l?.(h.target.value);
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */ v("div", { className: g, children: [
|
|
38
|
-
r && /* @__PURE__ */ i("span", { className: p.before, children: r }),
|
|
39
|
-
/* @__PURE__ */ i("input", { ref: e, className: p.control, onChange: I, onBlur: c, onFocus: u, ...d }),
|
|
40
|
-
n && /* @__PURE__ */ i("span", { className: p.after, children: n })
|
|
41
|
-
] });
|
|
42
|
-
};
|
|
43
|
-
f.displayName = m.INPUT;
|
|
44
|
-
const R = 8;
|
|
45
|
-
function j(s, e) {
|
|
46
|
-
const t = s.replace(/\D/g, "").slice(0, R);
|
|
47
|
-
if (!t)
|
|
5
|
+
import { u as B } from "./useLocale-CJh-krrY.mjs";
|
|
6
|
+
const _ = 8;
|
|
7
|
+
function k(t, e) {
|
|
8
|
+
const s = t.replace(/\D/g, "").slice(0, _);
|
|
9
|
+
if (!s)
|
|
48
10
|
return "";
|
|
49
|
-
const o = e.replace(/[A-Z]/g, "").charAt(0),
|
|
11
|
+
const o = e.replace(/[A-Z]/g, "").charAt(0), a = v(e);
|
|
50
12
|
let n = "";
|
|
51
|
-
for (let
|
|
52
|
-
|
|
13
|
+
for (let r = 0; r < s.length; r++)
|
|
14
|
+
a.has(r) && (n += o), n += s[r];
|
|
53
15
|
return n;
|
|
54
16
|
}
|
|
55
|
-
function
|
|
56
|
-
switch (
|
|
17
|
+
function v(t) {
|
|
18
|
+
switch (t) {
|
|
57
19
|
case "DD/MM/YYYY":
|
|
58
20
|
case "MM/DD/YYYY":
|
|
59
21
|
case "DD.MM.YYYY":
|
|
@@ -65,147 +27,147 @@ function F(s) {
|
|
|
65
27
|
return /* @__PURE__ */ new Set([2, 4]);
|
|
66
28
|
}
|
|
67
29
|
}
|
|
68
|
-
function
|
|
69
|
-
const e =
|
|
30
|
+
function E(t) {
|
|
31
|
+
const e = t.replace(/\D/g, "").slice(0, 11);
|
|
70
32
|
if (!e)
|
|
71
33
|
return "";
|
|
72
|
-
let
|
|
73
|
-
return e.length > 1 && (
|
|
34
|
+
let s = "+7";
|
|
35
|
+
return e.length > 1 && (s += ` (${e.slice(1, 4)}`), e.length >= 4 && (s += `) ${e.slice(4, 7)}`), e.length >= 7 && (s += `-${e.slice(7, 9)}`), e.length >= 9 && (s += `-${e.slice(9, 11)}`), s;
|
|
74
36
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
37
|
+
const T = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
38
|
+
function C(t, e) {
|
|
77
39
|
const o = e.replace(/[A-Z]/g, "").charAt(0);
|
|
78
40
|
if (!o)
|
|
79
41
|
return !1;
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
42
|
+
const a = t.split(o);
|
|
43
|
+
if (a.length !== 3)
|
|
82
44
|
return !1;
|
|
83
|
-
const [n,
|
|
84
|
-
if (!n || !
|
|
45
|
+
const [n, r, l] = a;
|
|
46
|
+
if (!n || !r || !l)
|
|
85
47
|
return !1;
|
|
86
|
-
let
|
|
48
|
+
let i = 0, c = 0, p = 0;
|
|
87
49
|
switch (e) {
|
|
88
50
|
case "DD/MM/YYYY":
|
|
89
51
|
case "DD.MM.YYYY":
|
|
90
|
-
|
|
52
|
+
i = parseInt(n, 10), c = parseInt(r, 10), p = parseInt(l, 10);
|
|
91
53
|
break;
|
|
92
54
|
case "MM/DD/YYYY":
|
|
93
55
|
case "MM.DD.YYYY":
|
|
94
|
-
|
|
56
|
+
c = parseInt(n, 10), i = parseInt(r, 10), p = parseInt(l, 10);
|
|
95
57
|
break;
|
|
96
58
|
case "YYYY-MM-DD":
|
|
97
|
-
|
|
59
|
+
i = parseInt(l, 10), c = parseInt(r, 10), p = parseInt(n, 10);
|
|
98
60
|
break;
|
|
99
61
|
default:
|
|
100
62
|
return !1;
|
|
101
63
|
}
|
|
102
|
-
if (
|
|
64
|
+
if (c < 1 || c > 12 || p < 1)
|
|
103
65
|
return !1;
|
|
104
|
-
const
|
|
105
|
-
return
|
|
66
|
+
const D = c === 2 && x(p) ? 29 : T[c] ?? 0;
|
|
67
|
+
return i >= 1 && i <= D;
|
|
106
68
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
69
|
+
function x(t) {
|
|
70
|
+
return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0;
|
|
109
71
|
}
|
|
110
|
-
function
|
|
111
|
-
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
72
|
+
function L(t) {
|
|
73
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t);
|
|
112
74
|
}
|
|
113
|
-
const
|
|
114
|
-
const { ref: e, format:
|
|
115
|
-
(
|
|
116
|
-
const
|
|
117
|
-
n?.(
|
|
75
|
+
const g = (t) => {
|
|
76
|
+
const { ref: e, format: s, before: o, value: a, onChange: n, onBlur: r, invalid: l, ...i } = t, [c, p] = I(!1), M = d(
|
|
77
|
+
(h) => {
|
|
78
|
+
const A = k(h, s);
|
|
79
|
+
n?.(A);
|
|
118
80
|
},
|
|
119
|
-
[
|
|
120
|
-
),
|
|
121
|
-
(
|
|
122
|
-
|
|
81
|
+
[s, n]
|
|
82
|
+
), D = d(
|
|
83
|
+
(h) => {
|
|
84
|
+
p(!0), r?.(h);
|
|
123
85
|
},
|
|
124
|
-
[
|
|
125
|
-
),
|
|
126
|
-
return /* @__PURE__ */
|
|
86
|
+
[r]
|
|
87
|
+
), P = l || c && typeof a == "string" && a.length > 0 && !C(a, s);
|
|
88
|
+
return /* @__PURE__ */ u(
|
|
127
89
|
f,
|
|
128
90
|
{
|
|
129
91
|
ref: e,
|
|
130
92
|
type: "text",
|
|
131
93
|
inputMode: "numeric",
|
|
132
|
-
before: o ?? /* @__PURE__ */
|
|
94
|
+
before: o ?? /* @__PURE__ */ u(Y, { name: "calendar", size: 16 }),
|
|
133
95
|
maxLength: 10,
|
|
134
|
-
value:
|
|
135
|
-
onChange:
|
|
136
|
-
onBlur:
|
|
137
|
-
invalid:
|
|
138
|
-
...
|
|
96
|
+
value: a,
|
|
97
|
+
onChange: M,
|
|
98
|
+
onBlur: D,
|
|
99
|
+
invalid: P,
|
|
100
|
+
...i
|
|
139
101
|
}
|
|
140
102
|
);
|
|
141
103
|
};
|
|
142
|
-
|
|
143
|
-
const b = (
|
|
144
|
-
const { ref: e, before:
|
|
145
|
-
(
|
|
146
|
-
l(!0), o?.(
|
|
104
|
+
g.displayName = m.INPUT_DATE;
|
|
105
|
+
const b = (t) => {
|
|
106
|
+
const { ref: e, before: s, onBlur: o, invalid: a, ...n } = t, [r, l] = I(!1), i = d(
|
|
107
|
+
(p) => {
|
|
108
|
+
l(!0), o?.(p);
|
|
147
109
|
},
|
|
148
110
|
[o]
|
|
149
|
-
),
|
|
150
|
-
return /* @__PURE__ */
|
|
111
|
+
), c = a || r && n.value != null && !L(n.value);
|
|
112
|
+
return /* @__PURE__ */ u(
|
|
151
113
|
f,
|
|
152
114
|
{
|
|
153
115
|
ref: e,
|
|
154
116
|
type: "email",
|
|
155
|
-
before:
|
|
156
|
-
invalid:
|
|
157
|
-
onBlur:
|
|
117
|
+
before: s ?? /* @__PURE__ */ u(Y, { name: "mail", size: 16 }),
|
|
118
|
+
invalid: c,
|
|
119
|
+
onBlur: i,
|
|
158
120
|
...n
|
|
159
121
|
}
|
|
160
122
|
);
|
|
161
123
|
};
|
|
162
124
|
b.displayName = m.INPUT_EMAIL;
|
|
163
|
-
const
|
|
164
|
-
const { ref: e, ...
|
|
165
|
-
return /* @__PURE__ */
|
|
125
|
+
const w = (t) => {
|
|
126
|
+
const { ref: e, ...s } = t;
|
|
127
|
+
return /* @__PURE__ */ u(f, { ref: e, type: "number", inputMode: "numeric", ...s });
|
|
166
128
|
};
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
const { ref: e, after:
|
|
170
|
-
return /* @__PURE__ */
|
|
129
|
+
w.displayName = m.INPUT_NUMBER;
|
|
130
|
+
const y = (t) => {
|
|
131
|
+
const { ref: e, after: s, ...o } = t, a = B(), [n, r] = I(!1), l = d(() => r((i) => !i), []);
|
|
132
|
+
return /* @__PURE__ */ u(
|
|
171
133
|
f,
|
|
172
134
|
{
|
|
173
135
|
ref: e,
|
|
174
136
|
type: n ? "text" : "password",
|
|
175
|
-
after:
|
|
137
|
+
after: s ?? /* @__PURE__ */ u(
|
|
176
138
|
"button",
|
|
177
139
|
{
|
|
178
140
|
type: "button",
|
|
179
|
-
className:
|
|
141
|
+
className: S.togglePassword,
|
|
180
142
|
onClick: l,
|
|
181
143
|
tabIndex: -1,
|
|
182
|
-
"aria-label": n ?
|
|
183
|
-
children: n ? /* @__PURE__ */
|
|
144
|
+
"aria-label": n ? a.Input.Password.passwordHide : a.Input.Password.passwordShow,
|
|
145
|
+
children: n ? /* @__PURE__ */ u(Y, { name: "eye-off", size: 16 }) : /* @__PURE__ */ u(Y, { name: "eye", size: 16 })
|
|
184
146
|
}
|
|
185
147
|
),
|
|
186
148
|
...o
|
|
187
149
|
}
|
|
188
150
|
);
|
|
189
151
|
};
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
const { ref: e, before:
|
|
193
|
-
(
|
|
194
|
-
const l =
|
|
152
|
+
y.displayName = m.INPUT_PASSWORD;
|
|
153
|
+
const N = (t) => {
|
|
154
|
+
const { ref: e, before: s, onChange: o, ...a } = t, n = d(
|
|
155
|
+
(r) => {
|
|
156
|
+
const l = E(r);
|
|
195
157
|
o?.(l);
|
|
196
158
|
},
|
|
197
159
|
[o]
|
|
198
160
|
);
|
|
199
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ u(f, { ref: e, type: "tel", before: s ?? /* @__PURE__ */ u(Y, { name: "phone", size: 16 }), onChange: n, ...a });
|
|
200
162
|
};
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
Date:
|
|
163
|
+
N.displayName = m.INPUT_PHONE;
|
|
164
|
+
const j = Object.assign(f, {
|
|
165
|
+
Date: g,
|
|
204
166
|
Email: b,
|
|
205
|
-
Number:
|
|
206
|
-
Password:
|
|
207
|
-
Phone:
|
|
167
|
+
Number: w,
|
|
168
|
+
Password: y,
|
|
169
|
+
Phone: N
|
|
208
170
|
});
|
|
209
171
|
export {
|
|
210
|
-
|
|
172
|
+
j as Input
|
|
211
173
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isValidElement as y } from "react";
|
|
2
|
+
const c = (t) => t.type ? typeof t.type == "string" ? t.type : "displayName" in t.type ? t.type.displayName : t.type.name : "", r = (t, i) => t === i, n = (t, i, o = !0) => {
|
|
3
|
+
const s = Array.isArray(t);
|
|
4
|
+
let a = !1;
|
|
5
|
+
if (y(i)) {
|
|
6
|
+
const e = c(i);
|
|
7
|
+
s ? a = t.some((p) => r(p, e)) : a = r(t, e);
|
|
8
|
+
}
|
|
9
|
+
if (!a && o) {
|
|
10
|
+
let e = t;
|
|
11
|
+
s && (e = t.join(", ")), console.warn("Invalid React node. Node should be an instance of %s", e);
|
|
12
|
+
}
|
|
13
|
+
return a;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
n as i
|
|
17
|
+
};
|
package/dist/item.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare interface IItemProps extends TNativeInputProps, default_2.PropsWithChildren {
|
|
4
|
+
/** The value of the radio button. Required for group integration. */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Description text displayed below the option label. */
|
|
7
|
+
description?: default_2.ReactNode;
|
|
8
|
+
/** Ref to the native input element. */
|
|
9
|
+
ref?: default_2.Ref<HTMLInputElement>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare const Item: default_2.FC<IItemProps>;
|
|
13
|
+
|
|
14
|
+
declare type TNativeInputProps = Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'type' | 'name' | 'checked' | 'size' | 'className'>;
|
|
15
|
+
|
|
16
|
+
export { }
|
package/dist/item.js
ADDED
package/dist/menu.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._root_5s7ps_1{align-items:center;border-radius:var(--dropdown-item-radius);cursor:pointer;display:flex;font-size:var(--dropdown-item-font-size);gap:var(--dropdown-item-gap);outline:none;padding:var(--dropdown-item-padding-y) var(--dropdown-item-padding-x);transition:background-color .1s ease;-webkit-user-select:none;user-select:none}._root_5s7ps_1:hover{background:var(--lui-color-background-secondary)}._root_5s7ps_1:focus-visible{background:var(--lui-color-background-secondary)}._root_5s7ps_1._disabled_5s7ps_19{color:var(--lui-color-text-disabled);cursor:not-allowed}._root_5s7ps_1._disabled_5s7ps_19:hover{background:transparent}._root_5s7ps_1._danger_5s7ps_26{color:var(--lui-color-background-error)}._root_5s7ps_1._danger_5s7ps_26:hover{background:color-mix(in sRGB,var(--lui-color-background-error) 8%,transparent)}._icon_5s7ps_33{align-items:center;color:var(--lui-color-text-tertiary);display:inline-flex;flex-shrink:0;height:var(--dropdown-item-icon-size);justify-content:center;width:var(--dropdown-item-icon-size)}._label_5s7ps_43{flex:1;overflow:hidden;text-overflow:ellipsis}._root_16pgq_1{background:var(--lui-color-border-primary);border:none;height:1px;margin:var(--dropdown-separator-margin)}
|
package/dist/menu.js
CHANGED
|
@@ -1,117 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { i as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
var r = ((e) => (e.CHECKBOX = `${c}.Checkbox`, e.CONTENT = `${c}.Content`, e.GROUP = `${c}.Group`, e.ITEM = `${c}.Item`, e.SEPARATOR = `${c}.Separator`, e.TRIGGER = `${c}.Trigger`, e))(r || {});
|
|
16
|
-
const G = "_root_15rud_1", P = "_disabled_15rud_19", M = "_checkbox_15rud_27", v = "_checked_15rud_38", B = "_label_15rud_44", _ = {
|
|
17
|
-
root: G,
|
|
18
|
-
disabled: P,
|
|
19
|
-
checkbox: M,
|
|
20
|
-
checked: v,
|
|
21
|
-
label: B
|
|
22
|
-
}, T = (e) => {
|
|
23
|
-
const { checked: o, children: n, disabled: s = !1, onCheckedChange: a } = e, { close: l } = g(), d = p(
|
|
24
|
-
_.root,
|
|
25
|
-
s && _.disabled
|
|
26
|
-
);
|
|
27
|
-
return /* @__PURE__ */ h(
|
|
28
|
-
"div",
|
|
29
|
-
{
|
|
30
|
-
"aria-checked": o,
|
|
31
|
-
"aria-disabled": s,
|
|
32
|
-
className: d,
|
|
33
|
-
onClick: () => {
|
|
34
|
-
s || (a && a(!o), l());
|
|
35
|
-
},
|
|
36
|
-
role: "menuitemcheckbox",
|
|
37
|
-
tabIndex: s ? -1 : 0,
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ t("span", { className: p(_.checkbox, o && _.checked), children: o && /* @__PURE__ */ t(u, { name: "check", size: 12, strokeWidth: 3 }) }),
|
|
40
|
-
/* @__PURE__ */ t("span", { className: _.label, children: n })
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
T.displayName = r.CHECKBOX;
|
|
46
|
-
const L = "_root_1h0xj_14", U = {
|
|
47
|
-
root: L
|
|
48
|
-
}, x = (e) => {
|
|
49
|
-
const { children: o } = e;
|
|
50
|
-
return /* @__PURE__ */ t(k.Content, { padding: !1, children: /* @__PURE__ */ t("div", { className: U.root, children: o }) });
|
|
1
|
+
import { u, C as f } from "./Checkbox-Chfzm1Z9.mjs";
|
|
2
|
+
import { C as N } from "./Content-ru2X8iBx.mjs";
|
|
3
|
+
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
4
|
+
import E from "react";
|
|
5
|
+
import { Popover as h } from "./popover.js";
|
|
6
|
+
import { i as T } from "./isValidReactNode-D1buElhX.mjs";
|
|
7
|
+
import { E as i, D as g, a as A } from "./enums-DUZMBQDd.mjs";
|
|
8
|
+
import { G as x } from "./Group-DyDpeqOP.mjs";
|
|
9
|
+
import I from "clsx";
|
|
10
|
+
import { I as M } from "./Icon-DUCBChX2.mjs";
|
|
11
|
+
import { T as P } from "./Trigger-C_4De6l1.mjs";
|
|
12
|
+
import './menu.css';const S = [i.TRIGGER, i.CONTENT], p = (c) => {
|
|
13
|
+
const { children: l, open: m, onOpenChange: o, placement: r = g } = c, t = (a) => T(S, a) ? a : null;
|
|
14
|
+
return /* @__PURE__ */ s(h, { open: m, onOpenChange: o, placement: r, children: E.Children.map(l, t) });
|
|
51
15
|
};
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ t("div", { className: b.label, children: n }),
|
|
65
|
-
o
|
|
66
|
-
] });
|
|
67
|
-
};
|
|
68
|
-
$.displayName = r.GROUP;
|
|
69
|
-
const z = "_root_5s7ps_1", D = "_disabled_5s7ps_19", H = "_danger_5s7ps_26", K = "_icon_5s7ps_33", X = "_label_5s7ps_43", m = {
|
|
70
|
-
root: z,
|
|
71
|
-
disabled: D,
|
|
72
|
-
danger: H,
|
|
73
|
-
icon: K,
|
|
74
|
-
label: X
|
|
75
|
-
}, R = (e) => {
|
|
76
|
-
const { children: o, danger: n = !1, disabled: s = !1, icon: a, onAction: l } = e, { close: d } = g(), C = p(
|
|
77
|
-
m.root,
|
|
78
|
-
n && m.danger,
|
|
79
|
-
s && m.disabled
|
|
16
|
+
p.displayName = A;
|
|
17
|
+
const R = "_root_5s7ps_1", k = "_disabled_5s7ps_19", y = "_danger_5s7ps_26", G = "_icon_5s7ps_33", O = "_label_5s7ps_43", n = {
|
|
18
|
+
root: R,
|
|
19
|
+
disabled: k,
|
|
20
|
+
danger: y,
|
|
21
|
+
icon: G,
|
|
22
|
+
label: O
|
|
23
|
+
}, d = (c) => {
|
|
24
|
+
const { children: l, danger: m = !1, disabled: o = !1, icon: r, onAction: t } = c, { close: a } = u(), _ = I(
|
|
25
|
+
n.root,
|
|
26
|
+
m && n.danger,
|
|
27
|
+
o && n.disabled
|
|
80
28
|
);
|
|
81
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ b(
|
|
82
30
|
"div",
|
|
83
31
|
{
|
|
84
|
-
"aria-disabled":
|
|
85
|
-
className:
|
|
32
|
+
"aria-disabled": o,
|
|
33
|
+
className: _,
|
|
86
34
|
onClick: () => {
|
|
87
|
-
|
|
35
|
+
o || (t && t(), a());
|
|
88
36
|
},
|
|
89
37
|
role: "menuitem",
|
|
90
|
-
tabIndex:
|
|
38
|
+
tabIndex: o ? -1 : 0,
|
|
91
39
|
children: [
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
40
|
+
r && /* @__PURE__ */ s("span", { className: n.icon, children: /* @__PURE__ */ s(M, { name: r, size: 16 }) }),
|
|
41
|
+
/* @__PURE__ */ s("span", { className: n.label, children: l })
|
|
94
42
|
]
|
|
95
43
|
}
|
|
96
44
|
);
|
|
97
45
|
};
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
root:
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
i.Content = x;
|
|
111
|
-
i.Group = $;
|
|
112
|
-
i.Item = R;
|
|
113
|
-
i.Separator = E;
|
|
114
|
-
i.Trigger = I;
|
|
46
|
+
d.displayName = i.ITEM;
|
|
47
|
+
const L = "_root_16pgq_1", v = {
|
|
48
|
+
root: L
|
|
49
|
+
}, C = () => /* @__PURE__ */ s("hr", { className: v.root });
|
|
50
|
+
C.displayName = i.SEPARATOR;
|
|
51
|
+
const e = p;
|
|
52
|
+
e.Checkbox = f;
|
|
53
|
+
e.Content = N;
|
|
54
|
+
e.Group = x;
|
|
55
|
+
e.Item = d;
|
|
56
|
+
e.Separator = C;
|
|
57
|
+
e.Trigger = P;
|
|
115
58
|
export {
|
|
116
|
-
|
|
59
|
+
e as Menu
|
|
117
60
|
};
|
package/dist/pagination.js
CHANGED
|
@@ -1,75 +1,63 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as L, useContext as
|
|
3
|
-
import
|
|
4
|
-
import { u as
|
|
5
|
-
import { g as
|
|
6
|
-
import { I as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as n, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as L, useContext as y, useMemo as M, useCallback as S } from "react";
|
|
3
|
+
import v from "clsx";
|
|
4
|
+
import { u as P } from "./useLocale-CJh-krrY.mjs";
|
|
5
|
+
import { g as h } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
6
|
+
import { I as x } from "./Icon-DUCBChX2.mjs";
|
|
7
|
+
import { getPageRange as I } from "./utils.js";
|
|
8
|
+
import './pagination.css';const f = L(null), $ = f.Provider, w = () => {
|
|
9
|
+
const a = y(f);
|
|
10
|
+
if (!a)
|
|
10
11
|
throw new Error("Pagination sub-component must be used within a Pagination");
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
button:
|
|
14
|
-
active:
|
|
12
|
+
return a;
|
|
13
|
+
}, j = "_button_nl5gc_14", k = "_active_nl5gc_40", A = "_prevNext_nl5gc_44", D = "_sizeSm_nl5gc_49", E = "_sizeMd_nl5gc_55", R = "_sizeLg_nl5gc_61", d = {
|
|
14
|
+
button: j,
|
|
15
|
+
active: k,
|
|
15
16
|
prevNext: A,
|
|
16
|
-
sizeSm:
|
|
17
|
-
sizeMd:
|
|
18
|
-
sizeLg:
|
|
19
|
-
},
|
|
20
|
-
const { page: e, type:
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
[
|
|
25
|
-
[
|
|
17
|
+
sizeSm: D,
|
|
18
|
+
sizeMd: E,
|
|
19
|
+
sizeLg: R
|
|
20
|
+
}, b = (a) => {
|
|
21
|
+
const { page: e, type: i = "page", children: t } = a, { currentPage: g, totalPages: p, disabled: o, onChange: u, size: z } = w(), l = P(), c = e === g, s = o || e < 1 || e > p || c;
|
|
22
|
+
let r, _;
|
|
23
|
+
i === "prev" ? (r = l.Pagination.prev, _ = t ?? /* @__PURE__ */ n(x, { name: "chevron-left", size: 14 })) : i === "next" ? (r = l.Pagination.next, _ = t ?? /* @__PURE__ */ n(x, { name: "chevron-right", size: 14 })) : (r = l.Pagination.Item.page.replace("{page}", String(e)), _ = t ?? e);
|
|
24
|
+
const C = v(d.button, h("size", z, d), {
|
|
25
|
+
[d.active]: c,
|
|
26
|
+
[d.prevNext]: i !== "page"
|
|
26
27
|
});
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ n(
|
|
28
29
|
"button",
|
|
29
30
|
{
|
|
30
|
-
"aria-current":
|
|
31
|
-
"aria-label":
|
|
32
|
-
className:
|
|
33
|
-
disabled:
|
|
34
|
-
onClick: () =>
|
|
31
|
+
"aria-current": c ? "page" : void 0,
|
|
32
|
+
"aria-label": r,
|
|
33
|
+
className: C,
|
|
34
|
+
disabled: s,
|
|
35
|
+
onClick: () => u(e),
|
|
35
36
|
type: "button",
|
|
36
|
-
children:
|
|
37
|
+
children: _
|
|
37
38
|
}
|
|
38
39
|
);
|
|
39
|
-
},
|
|
40
|
-
if (e <= 7)
|
|
41
|
-
return b(1, e);
|
|
42
|
-
const l = Math.max(n - 1, 1), r = Math.min(n + 1, e), s = l > 2, p = r < e - 1;
|
|
43
|
-
if (!s && p) {
|
|
44
|
-
const i = Math.min(r + 1, e);
|
|
45
|
-
return [...b(1, i), "ellipsis", e];
|
|
46
|
-
}
|
|
47
|
-
if (s && !p) {
|
|
48
|
-
const i = Math.max(l - 1, 1);
|
|
49
|
-
return [1, "ellipsis", ...b(i, e)];
|
|
50
|
-
}
|
|
51
|
-
return [1, "ellipsis", ...b(l, r), "ellipsis", e];
|
|
52
|
-
}, Y = "_root_60eox_6", q = "_disabled_60eox_13", F = "_ellipsis_60eox_18", G = "_sizeSm_60eox_27", H = "_sizeMd_60eox_33", J = "_sizeLg_60eox_39", h = {
|
|
40
|
+
}, V = "Pagination", Y = "_root_60eox_6", q = "_disabled_60eox_13", B = "_ellipsis_60eox_18", F = "_sizeSm_60eox_27", G = "_sizeMd_60eox_33", H = "_sizeLg_60eox_39", m = {
|
|
53
41
|
root: Y,
|
|
54
42
|
disabled: q,
|
|
55
|
-
ellipsis:
|
|
56
|
-
sizeSm:
|
|
57
|
-
sizeMd:
|
|
58
|
-
sizeLg:
|
|
59
|
-
},
|
|
60
|
-
const { disabled: e = !1, onChange:
|
|
61
|
-
(
|
|
62
|
-
e ||
|
|
43
|
+
ellipsis: B,
|
|
44
|
+
sizeSm: F,
|
|
45
|
+
sizeMd: G,
|
|
46
|
+
sizeLg: H
|
|
47
|
+
}, J = (a) => {
|
|
48
|
+
const { disabled: e = !1, onChange: i, page: t, showPrevNext: g = !0, size: p = "md", totalPages: o } = a, u = P(), z = M(() => I(t, o), [t, o]), l = S(
|
|
49
|
+
(s) => {
|
|
50
|
+
e || s < 1 || s > o || i?.(s);
|
|
63
51
|
},
|
|
64
|
-
[e,
|
|
65
|
-
),
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
[e, i, o]
|
|
53
|
+
), c = v(m.root, h("size", p, m), { [m.disabled]: e });
|
|
54
|
+
return /* @__PURE__ */ n($, { value: { currentPage: t, disabled: e, onChange: l, size: p, totalPages: o }, children: /* @__PURE__ */ N("nav", { "aria-label": u.Pagination.label, className: c, children: [
|
|
55
|
+
g && /* @__PURE__ */ n(b, { page: t - 1, type: "prev" }),
|
|
56
|
+
z.map((s, r) => s === "ellipsis" ? /* @__PURE__ */ n("span", { "aria-hidden": "true", className: m.ellipsis, children: "…" }, `ellipsis-${r}`) : /* @__PURE__ */ n(b, { page: s, type: "page" }, s)),
|
|
57
|
+
g && /* @__PURE__ */ n(b, { page: t + 1, type: "next" })
|
|
70
58
|
] }) });
|
|
71
59
|
};
|
|
72
|
-
|
|
60
|
+
J.displayName = V;
|
|
73
61
|
export {
|
|
74
|
-
|
|
62
|
+
J as Pagination
|
|
75
63
|
};
|