@lazar-ui/kit 0.6.0 → 0.6.2
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 +21 -0
- package/dist/accordion.js +1 -1
- package/dist/breadcrumbs.js +1 -1
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.d.ts +35 -10
- package/dist/checkbox.js +40 -2
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +44 -37
- package/dist/drawer.css +1 -1
- package/dist/drawer.js +93 -72
- package/dist/empty-state.css +1 -1
- package/dist/empty-state.js +48 -29
- package/dist/{getComponentSlots-DD4iju8N.mjs → getComponentSlots-DwAYUFNk.mjs} +1 -1
- package/dist/getDecorationStyle-BCBONKEl.mjs +7 -0
- package/dist/heading.js +31 -5
- package/dist/input.js +124 -86
- package/dist/isValidReactNode-CmYwTWCE.mjs +18 -0
- package/dist/menu.css +1 -1
- package/dist/menu.js +103 -46
- package/dist/pagination.js +60 -48
- package/dist/radio.css +1 -1
- package/dist/radio.js +98 -42
- package/dist/table.css +1 -1
- package/dist/table.js +74 -25
- package/dist/tabs.css +1 -1
- package/dist/tabs.js +72 -30
- package/dist/text.js +48 -6
- package/dist/utils.d.ts +75 -2
- package/dist/utils.js +17 -14
- package/package.json +1 -1
- package/dist/Actions-CEIXfLKN.mjs +0 -26
- package/dist/Actions.css +0 -1
- package/dist/ActiveFilters-BJojmc-d.mjs +0 -29
- package/dist/ActiveFilters.css +0 -1
- package/dist/Cell-BPBvEyeL.mjs +0 -21
- package/dist/Cell.css +0 -1
- package/dist/Checkbox-Chfzm1Z9.mjs +0 -46
- package/dist/Checkbox.css +0 -1
- package/dist/Content-ru2X8iBx.mjs +0 -13
- package/dist/Content.css +0 -1
- package/dist/Group-DyDpeqOP.mjs +0 -16
- package/dist/Group.css +0 -1
- package/dist/Header-Clhgyr0J.mjs +0 -29
- package/dist/Header.css +0 -1
- package/dist/Heading-CL47Fqe7.mjs +0 -30
- package/dist/InputBase-BHZWQT9-.mjs +0 -46
- package/dist/Item-JbyvZy05.mjs +0 -66
- package/dist/Item.css +0 -1
- package/dist/Panel-Q06TIYep.mjs +0 -12
- package/dist/Provider-CBfZpO45.mjs +0 -12
- package/dist/Row-C-3TXoDz.mjs +0 -15
- package/dist/Row.css +0 -1
- package/dist/Tab-CR0KvVaA.mjs +0 -39
- package/dist/Tab.css +0 -1
- package/dist/Text-DiOqZt8E.mjs +0 -49
- package/dist/Title-aOeFD24v.mjs +0 -13
- package/dist/Title.css +0 -1
- package/dist/Toolbar-BJQy4qFI.mjs +0 -11
- package/dist/Toolbar.css +0 -1
- package/dist/Trigger-C_4De6l1.mjs +0 -11
- package/dist/actions.d.ts +0 -13
- package/dist/actions.js +0 -4
- package/dist/active-filters.d.ts +0 -35
- package/dist/active-filters.js +0 -4
- package/dist/cell.d.ts +0 -20
- package/dist/cell.js +0 -4
- package/dist/content.d.ts +0 -8
- package/dist/content.js +0 -4
- package/dist/context.d.ts +0 -44
- package/dist/context.js +0 -7
- package/dist/enums-BnuDYTua.mjs +0 -4
- package/dist/enums-CiPhZomh.mjs +0 -6
- package/dist/enums-DUZMBQDd.mjs +0 -7
- package/dist/group.d.ts +0 -12
- package/dist/group.js +0 -4
- package/dist/header.d.ts +0 -21
- package/dist/header.js +0 -4
- package/dist/input-base.d.ts +0 -29
- package/dist/input-base.js +0 -4
- package/dist/isValidReactNode-D1buElhX.mjs +0 -17
- package/dist/item.d.ts +0 -16
- package/dist/item.js +0 -4
- package/dist/panel.d.ts +0 -9
- package/dist/panel.js +0 -4
- package/dist/row.d.ts +0 -12
- package/dist/row.js +0 -4
- package/dist/tab.d.ts +0 -30
- package/dist/tab.js +0 -4
- package/dist/title.d.ts +0 -8
- package/dist/title.js +0 -4
- package/dist/toolbar.d.ts +0 -20
- package/dist/toolbar.js +0 -4
- package/dist/trigger.d.ts +0 -8
- package/dist/trigger.js +0 -4
- package/dist/typography.d.ts +0 -126
- package/dist/typography.js +0 -6
- package/dist/useTabsContext-DdF09jQq.mjs +0 -11
- /package/dist/{Heading.css → heading.css} +0 -0
- /package/dist/{InputBase.css → input.css} +0 -0
- /package/dist/{Text.css → text.css} +0 -0
package/dist/heading.js
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import m from "clsx";
|
|
3
|
+
import { g as s } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
4
|
+
import './heading.css';const d = "Heading", y = "_root_aa627_1", z = "_truncate_aa627_5", D = "_sizeXs_aa627_11", u = "_sizeSm_aa627_17", S = "_sizeMd_aa627_23", p = "_sizeLg_aa627_30", A = "_colorPrimary_aa627_37", M = "_colorSecondary_aa627_41", N = "_colorTertiary_aa627_45", L = "_colorDisabled_aa627_49", R = "_colorBrand_aa627_53", r = {
|
|
5
|
+
root: y,
|
|
6
|
+
truncate: z,
|
|
7
|
+
sizeXs: D,
|
|
8
|
+
sizeSm: u,
|
|
9
|
+
sizeMd: S,
|
|
10
|
+
sizeLg: p,
|
|
11
|
+
colorPrimary: A,
|
|
12
|
+
colorSecondary: M,
|
|
13
|
+
colorTertiary: N,
|
|
14
|
+
colorDisabled: L,
|
|
15
|
+
colorBrand: R
|
|
16
|
+
}, b = (o) => {
|
|
17
|
+
const { as: t = "h2", children: c, color: a, ref: e, size: _ = "sm", truncate: n = !1 } = o, l = m(
|
|
18
|
+
r.root,
|
|
19
|
+
s("size", _, r),
|
|
20
|
+
a && s("color", a, r),
|
|
21
|
+
{
|
|
22
|
+
[r.truncate]: n
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
return /* @__PURE__ */ i(t, { className: l, ref: e, children: c });
|
|
26
|
+
};
|
|
27
|
+
b.displayName = d;
|
|
28
|
+
var f = /* @__PURE__ */ ((o) => (o.XS = "xs", o.SM = "sm", o.MD = "md", o.LG = "lg", o))(f || {}), B = /* @__PURE__ */ ((o) => (o.PRIMARY = "primary", o.SECONDARY = "secondary", o.TERTIARY = "tertiary", o.DISABLED = "disabled", o.BRAND = "brand", o))(B || {});
|
|
3
29
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
30
|
+
B as EHeadingColor,
|
|
31
|
+
f as EHeadingSize,
|
|
32
|
+
b as Heading
|
|
7
33
|
};
|
package/dist/input.js
CHANGED
|
@@ -1,21 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as v, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import z from "clsx";
|
|
3
|
+
import { useState as N, useCallback as _ } from "react";
|
|
4
|
+
import { g as S } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
4
5
|
import { I as Y } from "./Icon-DUCBChX2.mjs";
|
|
5
|
-
import { u as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { u as A } from "./useLocale-CJh-krrY.mjs";
|
|
7
|
+
import './input.css';const m = {
|
|
8
|
+
INPUT: "Input",
|
|
9
|
+
INPUT_DATE: "InputDate",
|
|
10
|
+
INPUT_EMAIL: "InputEmail",
|
|
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)
|
|
10
48
|
return "";
|
|
11
|
-
const o = e.replace(/[A-Z]/g, "").charAt(0),
|
|
49
|
+
const o = e.replace(/[A-Z]/g, "").charAt(0), r = F(e);
|
|
12
50
|
let n = "";
|
|
13
|
-
for (let
|
|
14
|
-
|
|
51
|
+
for (let a = 0; a < t.length; a++)
|
|
52
|
+
r.has(a) && (n += o), n += t[a];
|
|
15
53
|
return n;
|
|
16
54
|
}
|
|
17
|
-
function
|
|
18
|
-
switch (
|
|
55
|
+
function F(s) {
|
|
56
|
+
switch (s) {
|
|
19
57
|
case "DD/MM/YYYY":
|
|
20
58
|
case "MM/DD/YYYY":
|
|
21
59
|
case "DD.MM.YYYY":
|
|
@@ -27,147 +65,147 @@ function v(t) {
|
|
|
27
65
|
return /* @__PURE__ */ new Set([2, 4]);
|
|
28
66
|
}
|
|
29
67
|
}
|
|
30
|
-
function
|
|
31
|
-
const e =
|
|
68
|
+
function V(s) {
|
|
69
|
+
const e = s.replace(/\D/g, "").slice(0, 11);
|
|
32
70
|
if (!e)
|
|
33
71
|
return "";
|
|
34
|
-
let
|
|
35
|
-
return e.length > 1 && (
|
|
72
|
+
let t = "+7";
|
|
73
|
+
return e.length > 1 && (t += ` (${e.slice(1, 4)}`), e.length >= 4 && (t += `) ${e.slice(4, 7)}`), e.length >= 7 && (t += `-${e.slice(7, 9)}`), e.length >= 9 && (t += `-${e.slice(9, 11)}`), t;
|
|
36
74
|
}
|
|
37
|
-
const
|
|
38
|
-
function
|
|
75
|
+
const W = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
76
|
+
function Z(s, e) {
|
|
39
77
|
const o = e.replace(/[A-Z]/g, "").charAt(0);
|
|
40
78
|
if (!o)
|
|
41
79
|
return !1;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
80
|
+
const r = s.split(o);
|
|
81
|
+
if (r.length !== 3)
|
|
44
82
|
return !1;
|
|
45
|
-
const [n,
|
|
46
|
-
if (!n || !
|
|
83
|
+
const [n, a, l] = r;
|
|
84
|
+
if (!n || !a || !l)
|
|
47
85
|
return !1;
|
|
48
|
-
let
|
|
86
|
+
let c = 0, u = 0, d = 0;
|
|
49
87
|
switch (e) {
|
|
50
88
|
case "DD/MM/YYYY":
|
|
51
89
|
case "DD.MM.YYYY":
|
|
52
|
-
|
|
90
|
+
c = parseInt(n, 10), u = parseInt(a, 10), d = parseInt(l, 10);
|
|
53
91
|
break;
|
|
54
92
|
case "MM/DD/YYYY":
|
|
55
93
|
case "MM.DD.YYYY":
|
|
56
|
-
|
|
94
|
+
u = parseInt(n, 10), c = parseInt(a, 10), d = parseInt(l, 10);
|
|
57
95
|
break;
|
|
58
96
|
case "YYYY-MM-DD":
|
|
59
|
-
|
|
97
|
+
c = parseInt(l, 10), u = parseInt(a, 10), d = parseInt(n, 10);
|
|
60
98
|
break;
|
|
61
99
|
default:
|
|
62
100
|
return !1;
|
|
63
101
|
}
|
|
64
|
-
if (
|
|
102
|
+
if (u < 1 || u > 12 || d < 1)
|
|
65
103
|
return !1;
|
|
66
|
-
const
|
|
67
|
-
return
|
|
104
|
+
const I = u === 2 && G(d) ? 29 : W[u] ?? 0;
|
|
105
|
+
return c >= 1 && c <= I;
|
|
68
106
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
107
|
+
function G(s) {
|
|
108
|
+
return s % 4 === 0 && s % 100 !== 0 || s % 400 === 0;
|
|
71
109
|
}
|
|
72
|
-
function
|
|
73
|
-
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
110
|
+
function X(s) {
|
|
111
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);
|
|
74
112
|
}
|
|
75
|
-
const
|
|
76
|
-
const { ref: e, format:
|
|
77
|
-
(
|
|
78
|
-
const
|
|
79
|
-
n?.(
|
|
113
|
+
const M = (s) => {
|
|
114
|
+
const { ref: e, format: t, before: o, value: r, onChange: n, onBlur: a, invalid: l, ...c } = s, [u, d] = N(!1), g = _(
|
|
115
|
+
(D) => {
|
|
116
|
+
const T = j(D, t);
|
|
117
|
+
n?.(T);
|
|
80
118
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
83
|
-
(
|
|
84
|
-
|
|
119
|
+
[t, n]
|
|
120
|
+
), I = _(
|
|
121
|
+
(D) => {
|
|
122
|
+
d(!0), a?.(D);
|
|
85
123
|
},
|
|
86
|
-
[
|
|
87
|
-
),
|
|
88
|
-
return /* @__PURE__ */
|
|
124
|
+
[a]
|
|
125
|
+
), h = l || u && typeof r == "string" && r.length > 0 && !Z(r, t);
|
|
126
|
+
return /* @__PURE__ */ i(
|
|
89
127
|
f,
|
|
90
128
|
{
|
|
91
129
|
ref: e,
|
|
92
130
|
type: "text",
|
|
93
131
|
inputMode: "numeric",
|
|
94
|
-
before: o ?? /* @__PURE__ */
|
|
132
|
+
before: o ?? /* @__PURE__ */ i(Y, { name: "calendar", size: 16 }),
|
|
95
133
|
maxLength: 10,
|
|
96
|
-
value:
|
|
97
|
-
onChange:
|
|
98
|
-
onBlur:
|
|
99
|
-
invalid:
|
|
100
|
-
...
|
|
134
|
+
value: r,
|
|
135
|
+
onChange: g,
|
|
136
|
+
onBlur: I,
|
|
137
|
+
invalid: h,
|
|
138
|
+
...c
|
|
101
139
|
}
|
|
102
140
|
);
|
|
103
141
|
};
|
|
104
|
-
|
|
105
|
-
const b = (
|
|
106
|
-
const { ref: e, before:
|
|
107
|
-
(
|
|
108
|
-
l(!0), o?.(
|
|
142
|
+
M.displayName = m.INPUT_DATE;
|
|
143
|
+
const b = (s) => {
|
|
144
|
+
const { ref: e, before: t, onBlur: o, invalid: r, ...n } = s, [a, l] = N(!1), c = _(
|
|
145
|
+
(d) => {
|
|
146
|
+
l(!0), o?.(d);
|
|
109
147
|
},
|
|
110
148
|
[o]
|
|
111
|
-
),
|
|
112
|
-
return /* @__PURE__ */
|
|
149
|
+
), u = r || a && n.value != null && !X(n.value);
|
|
150
|
+
return /* @__PURE__ */ i(
|
|
113
151
|
f,
|
|
114
152
|
{
|
|
115
153
|
ref: e,
|
|
116
154
|
type: "email",
|
|
117
|
-
before:
|
|
118
|
-
invalid:
|
|
119
|
-
onBlur:
|
|
155
|
+
before: t ?? /* @__PURE__ */ i(Y, { name: "mail", size: 16 }),
|
|
156
|
+
invalid: u,
|
|
157
|
+
onBlur: c,
|
|
120
158
|
...n
|
|
121
159
|
}
|
|
122
160
|
);
|
|
123
161
|
};
|
|
124
162
|
b.displayName = m.INPUT_EMAIL;
|
|
125
|
-
const
|
|
126
|
-
const { ref: e, ...
|
|
127
|
-
return /* @__PURE__ */
|
|
163
|
+
const P = (s) => {
|
|
164
|
+
const { ref: e, ...t } = s;
|
|
165
|
+
return /* @__PURE__ */ i(f, { ref: e, type: "number", inputMode: "numeric", ...t });
|
|
128
166
|
};
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
const { ref: e, after:
|
|
132
|
-
return /* @__PURE__ */
|
|
167
|
+
P.displayName = m.INPUT_NUMBER;
|
|
168
|
+
const w = (s) => {
|
|
169
|
+
const { ref: e, after: t, ...o } = s, r = A(), [n, a] = N(!1), l = _(() => a((c) => !c), []);
|
|
170
|
+
return /* @__PURE__ */ i(
|
|
133
171
|
f,
|
|
134
172
|
{
|
|
135
173
|
ref: e,
|
|
136
174
|
type: n ? "text" : "password",
|
|
137
|
-
after:
|
|
175
|
+
after: t ?? /* @__PURE__ */ i(
|
|
138
176
|
"button",
|
|
139
177
|
{
|
|
140
178
|
type: "button",
|
|
141
|
-
className:
|
|
179
|
+
className: p.togglePassword,
|
|
142
180
|
onClick: l,
|
|
143
181
|
tabIndex: -1,
|
|
144
|
-
"aria-label": n ?
|
|
145
|
-
children: n ? /* @__PURE__ */
|
|
182
|
+
"aria-label": n ? r.Input.Password.passwordHide : r.Input.Password.passwordShow,
|
|
183
|
+
children: n ? /* @__PURE__ */ i(Y, { name: "eye-off", size: 16 }) : /* @__PURE__ */ i(Y, { name: "eye", size: 16 })
|
|
146
184
|
}
|
|
147
185
|
),
|
|
148
186
|
...o
|
|
149
187
|
}
|
|
150
188
|
);
|
|
151
189
|
};
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
const { ref: e, before:
|
|
155
|
-
(
|
|
156
|
-
const l =
|
|
190
|
+
w.displayName = m.INPUT_PASSWORD;
|
|
191
|
+
const y = (s) => {
|
|
192
|
+
const { ref: e, before: t, onChange: o, ...r } = s, n = _(
|
|
193
|
+
(a) => {
|
|
194
|
+
const l = V(a);
|
|
157
195
|
o?.(l);
|
|
158
196
|
},
|
|
159
197
|
[o]
|
|
160
198
|
);
|
|
161
|
-
return /* @__PURE__ */
|
|
199
|
+
return /* @__PURE__ */ i(f, { ref: e, type: "tel", before: t ?? /* @__PURE__ */ i(Y, { name: "phone", size: 16 }), onChange: n, ...r });
|
|
162
200
|
};
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
Date:
|
|
201
|
+
y.displayName = m.INPUT_PHONE;
|
|
202
|
+
const te = Object.assign(f, {
|
|
203
|
+
Date: M,
|
|
166
204
|
Email: b,
|
|
167
|
-
Number:
|
|
168
|
-
Password:
|
|
169
|
-
Phone:
|
|
205
|
+
Number: P,
|
|
206
|
+
Password: w,
|
|
207
|
+
Phone: y
|
|
170
208
|
});
|
|
171
209
|
export {
|
|
172
|
-
|
|
210
|
+
te as Input
|
|
173
211
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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, e) => t === e, n = (t, e, o = !0) => {
|
|
3
|
+
const s = Array.isArray(t);
|
|
4
|
+
let i = !1;
|
|
5
|
+
if (y(e)) {
|
|
6
|
+
const a = c(e);
|
|
7
|
+
s ? i = t.some((p) => r(p, a)) : i = r(t, a);
|
|
8
|
+
}
|
|
9
|
+
if (!i && o) {
|
|
10
|
+
let a = t;
|
|
11
|
+
s && (a = t.join(", ")), console.warn("Invalid React node. Node should be an instance of %s", a);
|
|
12
|
+
}
|
|
13
|
+
return i;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
c as g,
|
|
17
|
+
n as i
|
|
18
|
+
};
|
package/dist/menu.css
CHANGED
|
@@ -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)}
|
|
1
|
+
._root_15rud_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_15rud_1:hover{background:var(--lui-color-background-secondary)}._root_15rud_1:focus-visible{background:var(--lui-color-background-secondary)}._root_15rud_1._disabled_15rud_19{color:var(--lui-color-text-disabled);cursor:not-allowed}._root_15rud_1._disabled_15rud_19:hover{background:transparent}._checkbox_15rud_27{align-items:center;border:1.5px solid var(--lui-color-border-primary);border-radius:var(--lui-radius-1);display:inline-flex;flex-shrink:0;height:16px;justify-content:center;transition:all .1s ease;width:16px}._checkbox_15rud_27._checked_15rud_38{background:var(--lui-color-background-brand);border-color:var(--lui-color-background-brand);color:var(--lui-color-text-on-brand)}._label_15rud_44{flex:1;overflow:hidden;text-overflow:ellipsis}:root{--dropdown-min-width: 160px;--dropdown-item-padding-x: var(--lui-space-3);--dropdown-item-padding-y: var(--lui-space-2);--dropdown-item-gap: var(--lui-space-2);--dropdown-item-radius: var(--lui-radius-1);--dropdown-item-font-size: var(--lui-font-size-sm);--dropdown-item-icon-size: 16px;--dropdown-separator-margin: var(--lui-space-1) var(--lui-space-2);--dropdown-group-label-padding: var(--lui-space-2) var(--lui-space-3);--dropdown-group-label-font-size: var(--lui-font-size-xs)}._root_1h0xj_14{min-width:var(--dropdown-min-width);padding:var(--lui-space-1)}._root_dtqrm_1{padding-bottom:var(--lui-space-1);padding-top:var(--lui-space-1)}._root_dtqrm_1+._root_dtqrm_1{border-top:1px solid var(--lui-color-border-primary)}._label_dtqrm_9{color:var(--lui-color-text-tertiary);font-size:var(--dropdown-group-label-font-size);font-weight:var(--lui-font-weight-medium);padding:var(--dropdown-group-label-padding);text-transform:uppercase}._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,60 +1,117 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { i as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import p from "clsx";
|
|
3
|
+
import { I as u } from "./Icon-DUCBChX2.mjs";
|
|
4
|
+
import { usePopoverContext as N, Popover as k } from "./popover.js";
|
|
5
|
+
import O from "react";
|
|
6
|
+
import { i as y } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
7
|
+
import './menu.css';const g = () => {
|
|
8
|
+
const { state: e } = N();
|
|
9
|
+
return {
|
|
10
|
+
close: () => {
|
|
11
|
+
e.close();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}, c = "Menu", A = "bottom start";
|
|
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 }) });
|
|
15
51
|
};
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
52
|
+
x.displayName = r.CONTENT;
|
|
53
|
+
const j = [r.TRIGGER, r.CONTENT], f = (e) => {
|
|
54
|
+
const { children: o, open: n, onOpenChange: s, placement: a = A } = e, l = (d) => y(j, d) ? d : null;
|
|
55
|
+
return /* @__PURE__ */ t(k, { open: n, onOpenChange: s, placement: a, children: O.Children.map(o, l) });
|
|
56
|
+
};
|
|
57
|
+
f.displayName = c;
|
|
58
|
+
const q = "_root_dtqrm_1", S = "_label_dtqrm_9", b = {
|
|
59
|
+
root: q,
|
|
60
|
+
label: S
|
|
61
|
+
}, $ = (e) => {
|
|
62
|
+
const { children: o, label: n } = e;
|
|
63
|
+
return /* @__PURE__ */ h("div", { className: b.root, role: "group", children: [
|
|
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
|
|
28
80
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ h(
|
|
30
82
|
"div",
|
|
31
83
|
{
|
|
32
|
-
"aria-disabled":
|
|
33
|
-
className:
|
|
84
|
+
"aria-disabled": s,
|
|
85
|
+
className: C,
|
|
34
86
|
onClick: () => {
|
|
35
|
-
|
|
87
|
+
s || (l && l(), d());
|
|
36
88
|
},
|
|
37
89
|
role: "menuitem",
|
|
38
|
-
tabIndex:
|
|
90
|
+
tabIndex: s ? -1 : 0,
|
|
39
91
|
children: [
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */
|
|
92
|
+
a && /* @__PURE__ */ t("span", { className: m.icon, children: /* @__PURE__ */ t(u, { name: a, size: 16 }) }),
|
|
93
|
+
/* @__PURE__ */ t("span", { className: m.label, children: o })
|
|
42
94
|
]
|
|
43
95
|
}
|
|
44
96
|
);
|
|
45
97
|
};
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
root:
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
e
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
98
|
+
R.displayName = r.ITEM;
|
|
99
|
+
const F = "_root_16pgq_1", V = {
|
|
100
|
+
root: F
|
|
101
|
+
}, E = () => /* @__PURE__ */ t("hr", { className: V.root });
|
|
102
|
+
E.displayName = r.SEPARATOR;
|
|
103
|
+
const I = (e) => {
|
|
104
|
+
const { children: o } = e, { triggerRef: n, state: s } = N();
|
|
105
|
+
return /* @__PURE__ */ t("span", { "aria-expanded": s.isOpen, "aria-haspopup": "true", onClick: () => s.toggle(), ref: n, children: o });
|
|
106
|
+
};
|
|
107
|
+
I.displayName = r.TRIGGER;
|
|
108
|
+
const i = f;
|
|
109
|
+
i.Checkbox = T;
|
|
110
|
+
i.Content = x;
|
|
111
|
+
i.Group = $;
|
|
112
|
+
i.Item = R;
|
|
113
|
+
i.Separator = E;
|
|
114
|
+
i.Trigger = I;
|
|
58
115
|
export {
|
|
59
|
-
|
|
116
|
+
i as Menu
|
|
60
117
|
};
|