@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.
Files changed (70) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/Actions-Cii4AnwJ.mjs +12 -0
  3. package/dist/Actions.css +1 -1
  4. package/dist/Content-1kg0isb_.mjs +12 -0
  5. package/dist/Content.css +1 -1
  6. package/dist/Context-BjkJbHVo.mjs +6 -0
  7. package/dist/Item-CBYGbEHN.mjs +47 -0
  8. package/dist/Item.css +1 -1
  9. package/dist/Panel-B-LZtrGB.mjs +11 -0
  10. package/dist/{Row-C-3TXoDz.mjs → Row-BfI8268z.mjs} +1 -1
  11. package/dist/Separator-FETQ3gHZ.mjs +9 -0
  12. package/dist/Separator.css +1 -0
  13. package/dist/{Tab-CR0KvVaA.mjs → Tab-BfpR10OT.mjs} +10 -11
  14. package/dist/Text-DQPy-DZ5.mjs +46 -0
  15. package/dist/Title-xHMuJWGl.mjs +12 -0
  16. package/dist/accordion.css +1 -1
  17. package/dist/accordion.js +23 -62
  18. package/dist/actions.d.ts +7 -7
  19. package/dist/actions.js +1 -1
  20. package/dist/breadcrumbs.js +1 -1
  21. package/dist/checkbox.css +1 -0
  22. package/dist/checkbox.d.ts +35 -10
  23. package/dist/checkbox.js +40 -2
  24. package/dist/content.d.ts +2 -2
  25. package/dist/content.js +1 -1
  26. package/dist/context.d.ts +7 -34
  27. package/dist/context.js +3 -5
  28. package/dist/dialog.css +1 -1
  29. package/dist/dialog.js +45 -56
  30. package/dist/drawer.js +2 -2
  31. package/dist/empty-state.css +1 -1
  32. package/dist/empty-state.js +48 -29
  33. package/dist/enums-DfSzOa3x.mjs +4 -0
  34. package/dist/enums-OoI2Qgqq.mjs +14 -0
  35. package/dist/{getComponentSlots-DD4iju8N.mjs → getComponentSlots-DwAYUFNk.mjs} +1 -1
  36. package/dist/getDecorationStyle-BCBONKEl.mjs +7 -0
  37. package/dist/isValidReactNode-CmYwTWCE.mjs +18 -0
  38. package/dist/item.d.ts +35 -9
  39. package/dist/item.js +1 -1
  40. package/dist/menu.css +1 -1
  41. package/dist/menu.js +83 -44
  42. package/dist/pagination.js +60 -48
  43. package/dist/panel.js +1 -1
  44. package/dist/radio.css +1 -1
  45. package/dist/radio.js +98 -42
  46. package/dist/row.js +1 -1
  47. package/dist/separator.d.ts +1 -21
  48. package/dist/separator.js +2 -22
  49. package/dist/tab.js +1 -1
  50. package/dist/table.js +2 -2
  51. package/dist/tabs.js +34 -31
  52. package/dist/text.js +1 -1
  53. package/dist/title.js +1 -1
  54. package/dist/typography.js +1 -1
  55. package/dist/utils.d.ts +75 -2
  56. package/dist/utils.js +17 -14
  57. package/package.json +1 -1
  58. package/dist/Actions-CEIXfLKN.mjs +0 -26
  59. package/dist/Checkbox-Chfzm1Z9.mjs +0 -46
  60. package/dist/Checkbox.css +0 -1
  61. package/dist/Content-ru2X8iBx.mjs +0 -13
  62. package/dist/Item-JbyvZy05.mjs +0 -66
  63. package/dist/Panel-Q06TIYep.mjs +0 -12
  64. package/dist/Provider-CBfZpO45.mjs +0 -12
  65. package/dist/Text-DiOqZt8E.mjs +0 -49
  66. package/dist/Title-aOeFD24v.mjs +0 -13
  67. package/dist/enums-CiPhZomh.mjs +0 -6
  68. package/dist/isValidReactNode-D1buElhX.mjs +0 -17
  69. package/dist/separator.css +0 -1
  70. 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 { E as s, T as I } from "./Title-aOeFD24v.mjs";
3
- import { useRef as u, useMemo as L } from "react";
4
- import A from "clsx";
5
- import { useDialog as b, useModalOverlay as x, Overlay as M, UNSAFE_PortalProvider as P } from "react-aria";
6
- import { useOverlayTriggerState as R } from "react-stately";
7
- import { I as X } from "./Icon-DUCBChX2.mjs";
8
- import { u as $ } from "./useLocale-CJh-krrY.mjs";
9
- import { g as k } from "./getComponentSlots-DD4iju8N.mjs";
10
- import { g as w } from "./getVariantClassName-DoCNtwBw.mjs";
11
- import './dialog.css';const F = "_root_1fxwu_1", K = {
12
- root: F
13
- }, g = (t) => {
14
- const { children: a } = t;
15
- return /* @__PURE__ */ o("div", { className: K.root, children: a });
16
- };
17
- g.displayName = s.ACTIONS;
18
- const U = "_root_jagsa_1", V = {
19
- root: U
20
- }, p = (t) => {
21
- const { children: a } = t;
22
- return /* @__PURE__ */ o("div", { className: V.root, children: a });
23
- };
24
- p.displayName = s.CONTENT;
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
- n
29
+ a
41
30
  ), {
42
- [s.ACTIONS]: d,
43
- [s.CONTENT]: m,
44
- [s.TITLE]: j
45
- } = L(() => k(a, q), [a]), O = (E) => {
46
- E.preventDefault(), c.close();
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 (!i)
37
+ if (!l)
49
38
  return null;
50
- const D = A(e.dialog, w("size", T, e));
51
- return /* @__PURE__ */ o(M, { portalContainer: v, children: /* @__PURE__ */ o("div", { className: e.underlay, ...S, children: /* @__PURE__ */ o("div", { className: e.modal, ...z, ref: n, children: /* @__PURE__ */ o(P, { getContainer: () => n.current, children: /* @__PURE__ */ _("div", { className: D, ...y, ref: r, children: [
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
- j,
54
- /* @__PURE__ */ o("button", { "aria-label": h.Dialog.close, className: e.close, onClick: O, children: /* @__PURE__ */ o(X, { name: "x", size: 16 }) })
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
- m && /* @__PURE__ */ o("div", { children: m }),
57
- d && /* @__PURE__ */ o("div", { className: e.actions, children: d })
45
+ d && /* @__PURE__ */ o("div", { children: d }),
46
+ m && /* @__PURE__ */ o("div", { className: e.actions, children: m })
58
47
  ] }) }) }) }) });
59
48
  };
60
- N.displayName = Y;
61
- const l = N;
62
- l.Actions = g;
63
- l.Content = p;
64
- l.Title = I;
49
+ g.displayName = U;
50
+ const i = g;
51
+ i.Actions = O;
52
+ i.Content = L;
53
+ i.Title = K;
65
54
  export {
66
- l as Dialog,
67
- l as default
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-D1buElhX.mjs";
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-DD4iju8N.mjs";
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
@@ -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}
@@ -1,34 +1,53 @@
1
- import { E as o, D as _, A as S } from "./Actions-CEIXfLKN.mjs";
2
- import { jsx as t, jsxs as C } from "react/jsx-runtime";
3
- import T from "clsx";
4
- import { I as f } from "./Icon-DUCBChX2.mjs";
5
- import { g as x } from "./getComponentSlots-DD4iju8N.mjs";
6
- import './empty-state.css';const E = "_content_laixm_1", h = {
7
- content: E
8
- }, a = (s) => {
9
- const { children: c } = s;
10
- return /* @__PURE__ */ t("div", { className: h.content, children: c });
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
- a.displayName = o.CONTENT;
13
- const y = "_root_1fqx3_5", A = "_icon_1fqx3_14", I = "_title_1fqx3_20", O = "_description_1fqx3_28", n = {
14
- root: y,
15
- icon: A,
16
- title: I,
17
- description: O
18
- }, q = [o.ACTIONS, o.CONTENT], m = (s) => {
19
- const { children: c, description: e, icon: i, title: r } = s, p = T(n.root), { [o.ACTIONS]: d, [o.CONTENT]: N } = x(c, q);
20
- return /* @__PURE__ */ C("div", { className: p, children: [
21
- i && /* @__PURE__ */ t("div", { className: n.icon, children: /* @__PURE__ */ t(f, { name: i, size: 48 }) }),
22
- r && /* @__PURE__ */ t("h3", { className: n.title, children: r }),
23
- e && /* @__PURE__ */ t("p", { className: n.description, children: e }),
24
- N,
25
- d
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
- m.displayName = _;
29
- const l = m;
30
- l.Actions = S;
31
- l.Content = a;
47
+ N.displayName = l;
48
+ const _ = N;
49
+ _.Actions = p;
50
+ _.Content = d;
32
51
  export {
33
- l as EmptyState
52
+ _ as EmptyState
34
53
  };
@@ -0,0 +1,4 @@
1
+ var a = /* @__PURE__ */ ((T) => (T.ACTIONS = "Dialog.Actions", T.CONTENT = "Dialog.Content", T.TITLE = "Dialog.Title", T))(a || {});
2
+ export {
3
+ a as E
4
+ };
@@ -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
+ };
@@ -1,5 +1,5 @@
1
1
  import i from "react";
2
- import { i as n } from "./isValidReactNode-D1buElhX.mjs";
2
+ import { i as n } from "./isValidReactNode-CmYwTWCE.mjs";
3
3
  const c = (f, o) => {
4
4
  const e = { children: [] };
5
5
  return o.forEach((r) => {
@@ -0,0 +1,7 @@
1
+ function n(t) {
2
+ const e = [];
3
+ return t.underline && e.push("underline"), t.underline === "dotted" && e.push("dotted"), t.strikethrough && e.push("line-through"), e.length > 0 ? { textDecoration: e.join(" ") } : void 0;
4
+ }
5
+ export {
6
+ n as g
7
+ };
@@ -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 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>;
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
@@ -1,4 +1,4 @@
1
- import { I as o } from "./Item-JbyvZy05.mjs";
1
+ import { I as o } from "./Item-CBYGbEHN.mjs";
2
2
  export {
3
3
  o as Item
4
4
  };
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_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 { 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";
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 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) });
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
- 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
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__ */ b(
72
+ return /* @__PURE__ */ h(
30
73
  "div",
31
74
  {
32
- "aria-disabled": o,
75
+ "aria-disabled": e,
33
76
  className: _,
34
77
  onClick: () => {
35
- o || (t && t(), a());
78
+ e || (a && a(), c());
36
79
  },
37
80
  role: "menuitem",
38
- tabIndex: o ? -1 : 0,
81
+ tabIndex: e ? -1 : 0,
39
82
  children: [
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 })
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
- 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;
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
- e as Menu
98
+ r as Menu
60
99
  };
@@ -1,63 +1,75 @@
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)
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 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,
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: 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"
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__ */ n(
27
+ return /* @__PURE__ */ c(
29
28
  "button",
30
29
  {
31
- "aria-current": c ? "page" : void 0,
32
- "aria-label": r,
33
- className: C,
34
- disabled: s,
35
- onClick: () => u(e),
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
- }, 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 = {
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: 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);
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, 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" })
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
- J.displayName = V;
72
+ K.displayName = D;
61
73
  export {
62
- J as Pagination
74
+ K as Pagination
63
75
  };
package/dist/panel.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as o } from "./Panel-Q06TIYep.mjs";
1
+ import { P as o } from "./Panel-B-LZtrGB.mjs";
2
2
  export {
3
3
  o as Panel
4
4
  };