@lazar-ui/kit 0.6.0 → 0.6.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/CHANGELOG.md +6 -0
- package/dist/Actions-Cii4AnwJ.mjs +12 -0
- package/dist/Actions.css +1 -1
- package/dist/Content-1kg0isb_.mjs +12 -0
- package/dist/Content.css +1 -1
- package/dist/Context-BjkJbHVo.mjs +6 -0
- package/dist/Item-CBYGbEHN.mjs +47 -0
- package/dist/Item.css +1 -1
- package/dist/Panel-B-LZtrGB.mjs +11 -0
- package/dist/{Row-C-3TXoDz.mjs → Row-BfI8268z.mjs} +1 -1
- package/dist/Separator-FETQ3gHZ.mjs +9 -0
- package/dist/Separator.css +1 -0
- package/dist/{Tab-CR0KvVaA.mjs → Tab-BfpR10OT.mjs} +10 -11
- package/dist/Text-DQPy-DZ5.mjs +46 -0
- package/dist/Title-xHMuJWGl.mjs +12 -0
- package/dist/accordion.css +1 -1
- package/dist/accordion.js +23 -62
- package/dist/actions.d.ts +7 -7
- package/dist/actions.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/content.d.ts +2 -2
- package/dist/content.js +1 -1
- package/dist/context.d.ts +7 -34
- package/dist/context.js +3 -5
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +45 -56
- package/dist/drawer.js +2 -2
- package/dist/empty-state.css +1 -1
- package/dist/empty-state.js +48 -29
- package/dist/enums-DfSzOa3x.mjs +4 -0
- package/dist/enums-OoI2Qgqq.mjs +14 -0
- package/dist/{getComponentSlots-DD4iju8N.mjs → getComponentSlots-DwAYUFNk.mjs} +1 -1
- package/dist/getDecorationStyle-BCBONKEl.mjs +7 -0
- package/dist/isValidReactNode-CmYwTWCE.mjs +18 -0
- package/dist/item.d.ts +35 -9
- package/dist/item.js +1 -1
- package/dist/menu.css +1 -1
- package/dist/menu.js +83 -44
- package/dist/pagination.js +60 -48
- package/dist/panel.js +1 -1
- package/dist/radio.css +1 -1
- package/dist/radio.js +98 -42
- package/dist/row.js +1 -1
- package/dist/separator.d.ts +1 -21
- package/dist/separator.js +2 -22
- package/dist/tab.js +1 -1
- package/dist/table.js +2 -2
- package/dist/tabs.js +34 -31
- package/dist/text.js +1 -1
- package/dist/title.js +1 -1
- package/dist/typography.js +1 -1
- 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/Checkbox-Chfzm1Z9.mjs +0 -46
- package/dist/Checkbox.css +0 -1
- package/dist/Content-ru2X8iBx.mjs +0 -13
- package/dist/Item-JbyvZy05.mjs +0 -66
- package/dist/Panel-Q06TIYep.mjs +0 -12
- package/dist/Provider-CBfZpO45.mjs +0 -12
- package/dist/Text-DiOqZt8E.mjs +0 -49
- package/dist/Title-aOeFD24v.mjs +0 -13
- package/dist/enums-CiPhZomh.mjs +0 -6
- package/dist/isValidReactNode-D1buElhX.mjs +0 -17
- package/dist/separator.css +0 -1
- package/dist/useTabsContext-DdF09jQq.mjs +0 -11
package/dist/dialog.js
CHANGED
|
@@ -1,68 +1,57 @@
|
|
|
1
|
+
import { A as O } from "./Actions-Cii4AnwJ.mjs";
|
|
2
|
+
import { C as L } from "./Content-1kg0isb_.mjs";
|
|
1
3
|
import { jsx as o, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { g as
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
p
|
|
25
|
-
const Y = "Dialog", q = [s.ACTIONS, s.CONTENT, s.TITLE], B = "_underlay_100vj_25", G = "_modal_100vj_34", H = "_dialog_100vj_41", J = "_sizeXs_100vj_51", Q = "_sizeSm_100vj_54", W = "_sizeMd_100vj_57", Z = "_sizeLg_100vj_60", oo = "_header_100vj_64", so = "_close_100vj_71", eo = "_actions_100vj_79", e = {
|
|
26
|
-
underlay: B,
|
|
27
|
-
modal: G,
|
|
28
|
-
dialog: H,
|
|
29
|
-
sizeXs: J,
|
|
30
|
-
sizeSm: Q,
|
|
31
|
-
sizeMd: W,
|
|
32
|
-
sizeLg: Z,
|
|
33
|
-
header: oo,
|
|
34
|
-
close: so,
|
|
35
|
-
actions: eo
|
|
36
|
-
}, N = (t) => {
|
|
37
|
-
const { children: a, container: v, open: i, modal: f = !0, onOpenChange: C, size: T = "md" } = t, h = $(), r = u(null), n = u(null), { dialogProps: y } = b(t, r), c = R({ isOpen: i, onOpenChange: C }), { modalProps: z, underlayProps: S } = x(
|
|
4
|
+
import { useRef as p, useMemo as A } from "react";
|
|
5
|
+
import E from "clsx";
|
|
6
|
+
import { useDialog as I, useModalOverlay as b, Overlay as M, UNSAFE_PortalProvider as P } from "react-aria";
|
|
7
|
+
import { useOverlayTriggerState as x } from "react-stately";
|
|
8
|
+
import { I as R } from "./Icon-DUCBChX2.mjs";
|
|
9
|
+
import { u as X } from "./useLocale-CJh-krrY.mjs";
|
|
10
|
+
import { g as k } from "./getComponentSlots-DwAYUFNk.mjs";
|
|
11
|
+
import { g as F } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
12
|
+
import { E as s } from "./enums-DfSzOa3x.mjs";
|
|
13
|
+
import { T as K } from "./Title-xHMuJWGl.mjs";
|
|
14
|
+
import './dialog.css';const U = "Dialog", V = [s.ACTIONS, s.CONTENT, s.TITLE], Y = "_underlay_100vj_25", q = "_modal_100vj_34", w = "_dialog_100vj_41", B = "_sizeXs_100vj_51", G = "_sizeSm_100vj_54", H = "_sizeMd_100vj_57", J = "_sizeLg_100vj_60", Q = "_header_100vj_64", W = "_close_100vj_71", Z = "_actions_100vj_79", e = {
|
|
15
|
+
underlay: Y,
|
|
16
|
+
modal: q,
|
|
17
|
+
dialog: w,
|
|
18
|
+
sizeXs: B,
|
|
19
|
+
sizeSm: G,
|
|
20
|
+
sizeMd: H,
|
|
21
|
+
sizeLg: J,
|
|
22
|
+
header: Q,
|
|
23
|
+
close: W,
|
|
24
|
+
actions: Z
|
|
25
|
+
}, g = (n) => {
|
|
26
|
+
const { children: t, container: u, open: l, modal: f = !0, onOpenChange: v, size: C = "md" } = n, N = X(), r = p(null), a = p(null), { dialogProps: h } = I(n, r), c = x({ isOpen: l, onOpenChange: v }), { modalProps: T, underlayProps: z } = b(
|
|
38
27
|
{ isDismissable: !f, isKeyboardDismissDisabled: !1 },
|
|
39
28
|
c,
|
|
40
|
-
|
|
29
|
+
a
|
|
41
30
|
), {
|
|
42
|
-
[s.ACTIONS]:
|
|
43
|
-
[s.CONTENT]:
|
|
44
|
-
[s.TITLE]:
|
|
45
|
-
} =
|
|
46
|
-
|
|
31
|
+
[s.ACTIONS]: m,
|
|
32
|
+
[s.CONTENT]: d,
|
|
33
|
+
[s.TITLE]: S
|
|
34
|
+
} = A(() => k(t, V), [t]), j = (D) => {
|
|
35
|
+
D.preventDefault(), c.close();
|
|
47
36
|
};
|
|
48
|
-
if (!
|
|
37
|
+
if (!l)
|
|
49
38
|
return null;
|
|
50
|
-
const
|
|
51
|
-
return /* @__PURE__ */ o(M, { portalContainer:
|
|
39
|
+
const y = E(e.dialog, F("size", C, e));
|
|
40
|
+
return /* @__PURE__ */ o(M, { portalContainer: u, children: /* @__PURE__ */ o("div", { className: e.underlay, ...z, children: /* @__PURE__ */ o("div", { className: e.modal, ...T, ref: a, children: /* @__PURE__ */ o(P, { getContainer: () => a.current, children: /* @__PURE__ */ _("div", { className: y, ...h, ref: r, children: [
|
|
52
41
|
/* @__PURE__ */ _("div", { className: e.header, children: [
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */ o("button", { "aria-label":
|
|
42
|
+
S,
|
|
43
|
+
/* @__PURE__ */ o("button", { "aria-label": N.Dialog.close, className: e.close, onClick: j, children: /* @__PURE__ */ o(R, { name: "x", size: 16 }) })
|
|
55
44
|
] }),
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
d && /* @__PURE__ */ o("div", { children: d }),
|
|
46
|
+
m && /* @__PURE__ */ o("div", { className: e.actions, children: m })
|
|
58
47
|
] }) }) }) }) });
|
|
59
48
|
};
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
g.displayName = U;
|
|
50
|
+
const i = g;
|
|
51
|
+
i.Actions = O;
|
|
52
|
+
i.Content = L;
|
|
53
|
+
i.Title = K;
|
|
65
54
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
i as Dialog,
|
|
56
|
+
i as default
|
|
68
57
|
};
|
package/dist/drawer.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as e, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import L, { cloneElement as P, useRef as u, useState as T, useEffect as b, useMemo as x } from "react";
|
|
3
|
-
import { i as H } from "./isValidReactNode-
|
|
3
|
+
import { i as H } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
4
4
|
import "lodash/camelCase";
|
|
5
5
|
import { E as t, D as B, H as F } from "./Header-Clhgyr0J.mjs";
|
|
6
6
|
import j from "clsx";
|
|
7
7
|
import { useDialog as V, useModalOverlay as $, Overlay as U, UNSAFE_PortalProvider as K } from "react-aria";
|
|
8
8
|
import { useOverlayTriggerState as Y } from "react-stately";
|
|
9
|
-
import { g as G } from "./getComponentSlots-
|
|
9
|
+
import { g as G } from "./getComponentSlots-DwAYUFNk.mjs";
|
|
10
10
|
import { g as h } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
11
11
|
import './drawer.css';const J = "_root_1m4yu_1", Q = {
|
|
12
12
|
root: J
|
package/dist/empty-state.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._content_laixm_1{width:100%}:root{--empty-state-icon-size: 48px}._root_1fqx3_5{align-items:center;display:flex;flex-direction:column;gap:var(--lui-space-2);padding:var(--lui-space-10) var(--lui-space-5);text-align:center}._icon_1fqx3_14{font-size:var(--empty-state-icon-size);line-height:1;margin-bottom:var(--lui-space-2)}._title_1fqx3_20{color:var(--lui-color-text-primary);font-size:var(--lui-font-size-lg);font-weight:var(--lui-font-weight-semibold);line-height:var(--line-height-lg);margin:0}._description_1fqx3_28{color:var(--lui-color-text-secondary);font-size:var(--lui-font-size-sm);line-height:var(--line-height-sm);margin:0;max-width:400px}
|
|
1
|
+
._actions_dl9xv_1{align-items:center;display:flex;gap:var(--lui-space-2);margin-top:var(--lui-space-2)}._content_laixm_1{width:100%}:root{--empty-state-icon-size: 48px}._root_1fqx3_5{align-items:center;display:flex;flex-direction:column;gap:var(--lui-space-2);padding:var(--lui-space-10) var(--lui-space-5);text-align:center}._icon_1fqx3_14{font-size:var(--empty-state-icon-size);line-height:1;margin-bottom:var(--lui-space-2)}._title_1fqx3_20{color:var(--lui-color-text-primary);font-size:var(--lui-font-size-lg);font-weight:var(--lui-font-weight-semibold);line-height:var(--line-height-lg);margin:0}._description_1fqx3_28{color:var(--lui-color-text-secondary);font-size:var(--lui-font-size-sm);line-height:var(--line-height-sm);margin:0;max-width:400px}
|
package/dist/empty-state.js
CHANGED
|
@@ -1,34 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import S, { cloneElement as T } from "react";
|
|
3
|
+
import { i as f } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
4
|
+
import "lodash/camelCase";
|
|
5
|
+
import A from "clsx";
|
|
6
|
+
import { I as x } from "./Icon-DUCBChX2.mjs";
|
|
7
|
+
import { g as u } from "./getComponentSlots-DwAYUFNk.mjs";
|
|
8
|
+
import './empty-state.css';const l = "EmptyState";
|
|
9
|
+
var o = ((t) => (t.ACTIONS = `${l}.Actions`, t.CONTENT = `${l}.Content`, t))(o || {});
|
|
10
|
+
const v = "_actions_dl9xv_1", E = {
|
|
11
|
+
actions: v
|
|
12
|
+
}, p = ({ children: t }) => {
|
|
13
|
+
const s = S.Children.toArray(t), i = s.map((n, c) => {
|
|
14
|
+
if (!f("Button", n))
|
|
15
|
+
return n;
|
|
16
|
+
const r = n.props.variant;
|
|
17
|
+
return T(n, {
|
|
18
|
+
key: c,
|
|
19
|
+
...r ? {} : { variant: r ?? (c === 0 ? "primary" : "secondary") }
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
return s.length === 0 ? null : /* @__PURE__ */ e("div", { className: E.actions, children: i });
|
|
11
23
|
};
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
p.displayName = o.ACTIONS;
|
|
25
|
+
const O = "_content_laixm_1", h = {
|
|
26
|
+
content: O
|
|
27
|
+
}, d = (t) => {
|
|
28
|
+
const { children: s } = t;
|
|
29
|
+
return /* @__PURE__ */ e("div", { className: h.content, children: s });
|
|
30
|
+
};
|
|
31
|
+
d.displayName = o.CONTENT;
|
|
32
|
+
const I = "_root_1fqx3_5", g = "_icon_1fqx3_14", q = "_title_1fqx3_20", $ = "_description_1fqx3_28", a = {
|
|
33
|
+
root: I,
|
|
34
|
+
icon: g,
|
|
35
|
+
title: q,
|
|
36
|
+
description: $
|
|
37
|
+
}, L = [o.ACTIONS, o.CONTENT], N = (t) => {
|
|
38
|
+
const { children: s, description: i, icon: n, title: c } = t, r = A(a.root), { [o.ACTIONS]: m, [o.CONTENT]: y } = u(s, L);
|
|
39
|
+
return /* @__PURE__ */ C("div", { className: r, children: [
|
|
40
|
+
n && /* @__PURE__ */ e("div", { className: a.icon, children: /* @__PURE__ */ e(x, { name: n, size: 48 }) }),
|
|
41
|
+
c && /* @__PURE__ */ e("h3", { className: a.title, children: c }),
|
|
42
|
+
i && /* @__PURE__ */ e("p", { className: a.description, children: i }),
|
|
43
|
+
y,
|
|
44
|
+
m
|
|
26
45
|
] });
|
|
27
46
|
};
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
N.displayName = l;
|
|
48
|
+
const _ = N;
|
|
49
|
+
_.Actions = p;
|
|
50
|
+
_.Content = d;
|
|
32
51
|
export {
|
|
33
|
-
|
|
52
|
+
_ as EmptyState
|
|
34
53
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext as s, useContext as n } from "react";
|
|
2
|
+
const o = s(null), T = () => {
|
|
3
|
+
const t = n(o);
|
|
4
|
+
if (!t)
|
|
5
|
+
throw new Error("useTabsContext should be used inside Tabs component");
|
|
6
|
+
return t;
|
|
7
|
+
}, e = "Tabs";
|
|
8
|
+
var r = ((t) => (t.PANEL = `${e}.Panel`, t.TAB = `${e}.Tab`, t))(r || {}), a = /* @__PURE__ */ ((t) => (t.BUTTONS = "buttons", t.DEFAULT = "default", t))(a || {});
|
|
9
|
+
export {
|
|
10
|
+
o as C,
|
|
11
|
+
r as E,
|
|
12
|
+
a,
|
|
13
|
+
T as u
|
|
14
|
+
};
|
|
@@ -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/item.d.ts
CHANGED
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
|
+
import { IconName } from 'lucide-react/dynamic';
|
|
2
3
|
|
|
3
|
-
export declare interface IItemProps extends
|
|
4
|
-
/**
|
|
5
|
-
value
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
4
|
+
export declare interface IItemProps extends default_2.PropsWithChildren {
|
|
5
|
+
/** Unique value for accordion control mode. */
|
|
6
|
+
value?: string;
|
|
7
|
+
/** Icon name displayed before the title. */
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
/** Controlled open state. */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** Callback when open state changes. */
|
|
12
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
13
|
+
/** Item title text. */
|
|
14
|
+
title: string;
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Accordion item. Must be a direct child of `<Accordion>`.
|
|
19
|
+
*
|
|
20
|
+
* Can be used standalone without a `value` prop (multi-select, each item manages
|
|
21
|
+
* its own open state independently) or with a `value` prop for single-select mode
|
|
22
|
+
* controlled by the parent Accordion via `defaultValue` or `value` + `onValueChange`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Standalone without `value` (multi-select)
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <Accordion.Item title="Settings" icon="settings">
|
|
28
|
+
* Settings content
|
|
29
|
+
* </Accordion.Item>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With `value` for single-select
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Accordion.Item value="settings" title="Settings">
|
|
36
|
+
* Settings content
|
|
37
|
+
* </Accordion.Item>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
12
40
|
export declare const Item: default_2.FC<IItemProps>;
|
|
13
41
|
|
|
14
|
-
declare type TNativeInputProps = Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'type' | 'name' | 'checked' | 'size' | 'className'>;
|
|
15
|
-
|
|
16
42
|
export { }
|
package/dist/item.js
CHANGED
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}
|
|
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_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}
|
package/dist/menu.js
CHANGED
|
@@ -1,60 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import E from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { G as
|
|
9
|
-
import
|
|
10
|
-
import { I as M } from "./Icon-DUCBChX2.mjs";
|
|
1
|
+
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import p from "clsx";
|
|
3
|
+
import { I as C } from "./Icon-DUCBChX2.mjs";
|
|
4
|
+
import { usePopoverContext as E, Popover as b } from "./popover.js";
|
|
5
|
+
import { E as m, D as T, a as g } from "./enums-DUZMBQDd.mjs";
|
|
6
|
+
import I from "react";
|
|
7
|
+
import { i as M } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
8
|
+
import { G as y } from "./Group-DyDpeqOP.mjs";
|
|
9
|
+
import { S as A } from "./Separator-FETQ3gHZ.mjs";
|
|
11
10
|
import { T as P } from "./Trigger-C_4De6l1.mjs";
|
|
12
|
-
import './menu.css';const
|
|
13
|
-
const {
|
|
14
|
-
return
|
|
11
|
+
import './menu.css';const u = () => {
|
|
12
|
+
const { state: s } = E();
|
|
13
|
+
return {
|
|
14
|
+
close: () => {
|
|
15
|
+
s.close();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}, S = "_root_15rud_1", v = "_disabled_15rud_19", O = "_checkbox_15rud_27", $ = "_checked_15rud_38", G = "_label_15rud_44", d = {
|
|
19
|
+
root: S,
|
|
20
|
+
disabled: v,
|
|
21
|
+
checkbox: O,
|
|
22
|
+
checked: $,
|
|
23
|
+
label: G
|
|
24
|
+
}, k = (s) => {
|
|
25
|
+
const { checked: o, children: l, disabled: e = !1, onCheckedChange: t } = s, { close: a } = u(), c = p(
|
|
26
|
+
d.root,
|
|
27
|
+
e && d.disabled
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ h(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
"aria-checked": o,
|
|
33
|
+
"aria-disabled": e,
|
|
34
|
+
className: c,
|
|
35
|
+
onClick: () => {
|
|
36
|
+
e || (t && t(!o), a());
|
|
37
|
+
},
|
|
38
|
+
role: "menuitemcheckbox",
|
|
39
|
+
tabIndex: e ? -1 : 0,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ n("span", { className: p(d.checkbox, o && d.checked), children: o && /* @__PURE__ */ n(C, { name: "check", size: 12, strokeWidth: 3 }) }),
|
|
42
|
+
/* @__PURE__ */ n("span", { className: d.label, children: l })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
15
46
|
};
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
root:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
47
|
+
k.displayName = m.CHECKBOX;
|
|
48
|
+
const L = "_root_1h0xj_14", R = {
|
|
49
|
+
root: L
|
|
50
|
+
}, N = (s) => {
|
|
51
|
+
const { children: o } = s;
|
|
52
|
+
return /* @__PURE__ */ n(b.Content, { padding: !1, children: /* @__PURE__ */ n("div", { className: R.root, children: o }) });
|
|
53
|
+
};
|
|
54
|
+
N.displayName = m.CONTENT;
|
|
55
|
+
const j = [m.TRIGGER, m.CONTENT], f = (s) => {
|
|
56
|
+
const { children: o, open: l, onOpenChange: e, placement: t = T } = s, a = (c) => M(j, c) ? c : null;
|
|
57
|
+
return /* @__PURE__ */ n(b, { open: l, onOpenChange: e, placement: t, children: I.Children.map(o, a) });
|
|
58
|
+
};
|
|
59
|
+
f.displayName = g;
|
|
60
|
+
const B = "_root_5s7ps_1", D = "_disabled_5s7ps_19", z = "_danger_5s7ps_26", U = "_icon_5s7ps_33", F = "_label_5s7ps_43", i = {
|
|
61
|
+
root: B,
|
|
62
|
+
disabled: D,
|
|
63
|
+
danger: z,
|
|
64
|
+
icon: U,
|
|
65
|
+
label: F
|
|
66
|
+
}, x = (s) => {
|
|
67
|
+
const { children: o, danger: l = !1, disabled: e = !1, icon: t, onAction: a } = s, { close: c } = u(), _ = p(
|
|
68
|
+
i.root,
|
|
69
|
+
l && i.danger,
|
|
70
|
+
e && i.disabled
|
|
28
71
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ h(
|
|
30
73
|
"div",
|
|
31
74
|
{
|
|
32
|
-
"aria-disabled":
|
|
75
|
+
"aria-disabled": e,
|
|
33
76
|
className: _,
|
|
34
77
|
onClick: () => {
|
|
35
|
-
|
|
78
|
+
e || (a && a(), c());
|
|
36
79
|
},
|
|
37
80
|
role: "menuitem",
|
|
38
|
-
tabIndex:
|
|
81
|
+
tabIndex: e ? -1 : 0,
|
|
39
82
|
children: [
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */
|
|
83
|
+
t && /* @__PURE__ */ n("span", { className: i.icon, children: /* @__PURE__ */ n(C, { name: t, size: 16 }) }),
|
|
84
|
+
/* @__PURE__ */ n("span", { className: i.label, children: o })
|
|
42
85
|
]
|
|
43
86
|
}
|
|
44
87
|
);
|
|
45
88
|
};
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
e.Group = x;
|
|
55
|
-
e.Item = d;
|
|
56
|
-
e.Separator = C;
|
|
57
|
-
e.Trigger = P;
|
|
89
|
+
x.displayName = m.ITEM;
|
|
90
|
+
const r = f;
|
|
91
|
+
r.Checkbox = k;
|
|
92
|
+
r.Content = N;
|
|
93
|
+
r.Group = y;
|
|
94
|
+
r.Item = x;
|
|
95
|
+
r.Separator = A;
|
|
96
|
+
r.Trigger = P;
|
|
58
97
|
export {
|
|
59
|
-
|
|
98
|
+
r as Menu
|
|
60
99
|
};
|
package/dist/pagination.js
CHANGED
|
@@ -1,63 +1,75 @@
|
|
|
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
|
-
|
|
10
|
-
if (!a)
|
|
1
|
+
import { jsx as c, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as L, useContext as S, useMemo as y, useCallback as R } from "react";
|
|
3
|
+
import f from "clsx";
|
|
4
|
+
import { u as v } from "./useLocale-CJh-krrY.mjs";
|
|
5
|
+
import { g as C } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
6
|
+
import { I as z } from "./Icon-DUCBChX2.mjs";
|
|
7
|
+
import './pagination.css';const P = L(null), I = P.Provider, w = () => {
|
|
8
|
+
const n = S(P);
|
|
9
|
+
if (!n)
|
|
11
10
|
throw new Error("Pagination sub-component must be used within a Pagination");
|
|
12
|
-
return
|
|
13
|
-
},
|
|
14
|
-
button:
|
|
15
|
-
active:
|
|
11
|
+
return n;
|
|
12
|
+
}, $ = "_button_nl5gc_14", E = "_active_nl5gc_40", A = "_prevNext_nl5gc_44", j = "_sizeSm_nl5gc_49", k = "_sizeMd_nl5gc_55", B = "_sizeLg_nl5gc_61", _ = {
|
|
13
|
+
button: $,
|
|
14
|
+
active: E,
|
|
16
15
|
prevNext: A,
|
|
17
|
-
sizeSm:
|
|
18
|
-
sizeMd:
|
|
19
|
-
sizeLg:
|
|
20
|
-
},
|
|
21
|
-
const { page: e, type:
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
[
|
|
26
|
-
[
|
|
16
|
+
sizeSm: j,
|
|
17
|
+
sizeMd: k,
|
|
18
|
+
sizeLg: B
|
|
19
|
+
}, x = (n) => {
|
|
20
|
+
const { page: e, type: a = "page", children: t } = n, { currentPage: l, totalPages: r, disabled: s, onChange: p, size: u } = w(), i = v(), g = e === l, o = s || e < 1 || e > r || g;
|
|
21
|
+
let d, m;
|
|
22
|
+
a === "prev" ? (d = i.Pagination.prev, m = t ?? /* @__PURE__ */ c(z, { name: "chevron-left", size: 14 })) : a === "next" ? (d = i.Pagination.next, m = t ?? /* @__PURE__ */ c(z, { name: "chevron-right", size: 14 })) : (d = i.Pagination.Item.page.replace("{page}", String(e)), m = t ?? e);
|
|
23
|
+
const M = f(_.button, C("size", u, _), {
|
|
24
|
+
[_.active]: g,
|
|
25
|
+
[_.prevNext]: a !== "page"
|
|
27
26
|
});
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ c(
|
|
29
28
|
"button",
|
|
30
29
|
{
|
|
31
|
-
"aria-current":
|
|
32
|
-
"aria-label":
|
|
33
|
-
className:
|
|
34
|
-
disabled:
|
|
35
|
-
onClick: () =>
|
|
30
|
+
"aria-current": g ? "page" : void 0,
|
|
31
|
+
"aria-label": d,
|
|
32
|
+
className: M,
|
|
33
|
+
disabled: o,
|
|
34
|
+
onClick: () => p(e),
|
|
36
35
|
type: "button",
|
|
37
|
-
children:
|
|
36
|
+
children: m
|
|
38
37
|
}
|
|
39
38
|
);
|
|
40
|
-
},
|
|
39
|
+
}, D = "Pagination", b = (n, e) => Array.from({ length: e - n + 1 }, (a, t) => n + t), V = (n, e) => {
|
|
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 = {
|
|
41
53
|
root: Y,
|
|
42
54
|
disabled: q,
|
|
43
|
-
ellipsis:
|
|
44
|
-
sizeSm:
|
|
45
|
-
sizeMd:
|
|
46
|
-
sizeLg:
|
|
47
|
-
},
|
|
48
|
-
const { disabled: e = !1, onChange:
|
|
49
|
-
(
|
|
50
|
-
e ||
|
|
55
|
+
ellipsis: F,
|
|
56
|
+
sizeSm: G,
|
|
57
|
+
sizeMd: H,
|
|
58
|
+
sizeLg: J
|
|
59
|
+
}, K = (n) => {
|
|
60
|
+
const { disabled: e = !1, onChange: a, page: t, showPrevNext: l = !0, size: r = "md", totalPages: s } = n, p = v(), u = y(() => V(t, s), [t, s]), i = R(
|
|
61
|
+
(o) => {
|
|
62
|
+
e || o < 1 || o > s || a?.(o);
|
|
51
63
|
},
|
|
52
|
-
[e,
|
|
53
|
-
),
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
[e, a, s]
|
|
65
|
+
), g = f(h.root, C("size", r, h), { [h.disabled]: e });
|
|
66
|
+
return /* @__PURE__ */ c(I, { value: { currentPage: t, disabled: e, onChange: i, size: r, totalPages: s }, children: /* @__PURE__ */ N("nav", { "aria-label": p.Pagination.label, className: g, children: [
|
|
67
|
+
l && /* @__PURE__ */ c(x, { page: t - 1, type: "prev" }),
|
|
68
|
+
u.map((o, d) => o === "ellipsis" ? /* @__PURE__ */ c("span", { "aria-hidden": "true", className: h.ellipsis, children: "…" }, `ellipsis-${d}`) : /* @__PURE__ */ c(x, { page: o, type: "page" }, o)),
|
|
69
|
+
l && /* @__PURE__ */ c(x, { page: t + 1, type: "next" })
|
|
58
70
|
] }) });
|
|
59
71
|
};
|
|
60
|
-
|
|
72
|
+
K.displayName = D;
|
|
61
73
|
export {
|
|
62
|
-
|
|
74
|
+
K as Pagination
|
|
63
75
|
};
|
package/dist/panel.js
CHANGED