@lazar-ui/kit 0.5.2 → 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 (99) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/Actions-Cii4AnwJ.mjs +12 -0
  3. package/dist/Actions.css +1 -0
  4. package/dist/ActiveFilters-BJojmc-d.mjs +29 -0
  5. package/dist/ActiveFilters.css +1 -0
  6. package/dist/Button-BN85EtaZ.mjs +52 -0
  7. package/dist/Button.css +1 -1
  8. package/dist/Cell-BPBvEyeL.mjs +21 -0
  9. package/dist/Cell.css +1 -0
  10. package/dist/Content-1kg0isb_.mjs +12 -0
  11. package/dist/Content.css +1 -0
  12. package/dist/Context-BjkJbHVo.mjs +6 -0
  13. package/dist/Group-DyDpeqOP.mjs +16 -0
  14. package/dist/Group.css +1 -0
  15. package/dist/Header-Clhgyr0J.mjs +29 -0
  16. package/dist/Header.css +1 -0
  17. package/dist/Heading-CL47Fqe7.mjs +30 -0
  18. package/dist/Heading.css +1 -0
  19. package/dist/InputBase-BHZWQT9-.mjs +46 -0
  20. package/dist/Item-CBYGbEHN.mjs +47 -0
  21. package/dist/Item.css +1 -0
  22. package/dist/Panel-B-LZtrGB.mjs +11 -0
  23. package/dist/Row-BfI8268z.mjs +15 -0
  24. package/dist/Row.css +1 -0
  25. package/dist/Separator-FETQ3gHZ.mjs +9 -0
  26. package/dist/Separator.css +1 -0
  27. package/dist/Tab-BfpR10OT.mjs +38 -0
  28. package/dist/Tab.css +1 -0
  29. package/dist/Text-DQPy-DZ5.mjs +46 -0
  30. package/dist/Text.css +1 -0
  31. package/dist/Title-xHMuJWGl.mjs +12 -0
  32. package/dist/Title.css +1 -0
  33. package/dist/Toolbar-BJQy4qFI.mjs +11 -0
  34. package/dist/Toolbar.css +1 -0
  35. package/dist/Trigger-C_4De6l1.mjs +11 -0
  36. package/dist/accordion.css +1 -1
  37. package/dist/accordion.js +23 -62
  38. package/dist/actions.d.ts +13 -0
  39. package/dist/actions.js +4 -0
  40. package/dist/active-filters.d.ts +35 -0
  41. package/dist/active-filters.js +4 -0
  42. package/dist/button.js +1 -1
  43. package/dist/cell.d.ts +20 -0
  44. package/dist/cell.js +4 -0
  45. package/dist/content.d.ts +8 -0
  46. package/dist/content.js +4 -0
  47. package/dist/context.d.ts +17 -0
  48. package/dist/context.js +5 -0
  49. package/dist/dialog.css +1 -1
  50. package/dist/dialog.js +44 -62
  51. package/dist/drawer.css +1 -1
  52. package/dist/drawer.js +72 -93
  53. package/dist/enums-BnuDYTua.mjs +4 -0
  54. package/dist/enums-DUZMBQDd.mjs +7 -0
  55. package/dist/enums-DfSzOa3x.mjs +4 -0
  56. package/dist/enums-OoI2Qgqq.mjs +14 -0
  57. package/dist/getDecorationStyle-BCBONKEl.mjs +7 -0
  58. package/dist/group.d.ts +12 -0
  59. package/dist/group.js +4 -0
  60. package/dist/header.d.ts +21 -0
  61. package/dist/header.js +4 -0
  62. package/dist/heading.d.ts +55 -0
  63. package/dist/heading.js +7 -0
  64. package/dist/input-base.d.ts +29 -0
  65. package/dist/input-base.js +4 -0
  66. package/dist/input.js +86 -124
  67. package/dist/item.d.ts +42 -0
  68. package/dist/item.js +4 -0
  69. package/dist/menu.css +1 -1
  70. package/dist/menu.js +63 -81
  71. package/dist/panel.d.ts +9 -0
  72. package/dist/panel.js +4 -0
  73. package/dist/row.d.ts +12 -0
  74. package/dist/row.js +4 -0
  75. package/dist/separator.d.ts +1 -21
  76. package/dist/separator.js +2 -22
  77. package/dist/tab.d.ts +30 -0
  78. package/dist/tab.js +4 -0
  79. package/dist/table.css +1 -1
  80. package/dist/table.js +25 -74
  81. package/dist/tabs.css +1 -1
  82. package/dist/tabs.js +34 -73
  83. package/dist/text.d.ts +74 -0
  84. package/dist/text.js +8 -0
  85. package/dist/title.d.ts +8 -0
  86. package/dist/title.js +4 -0
  87. package/dist/toolbar.d.ts +20 -0
  88. package/dist/toolbar.js +4 -0
  89. package/dist/trigger.d.ts +8 -0
  90. package/dist/trigger.js +4 -0
  91. package/dist/typography.d.ts +90 -40
  92. package/dist/typography.js +4 -38
  93. package/dist/utils.d.ts +20 -0
  94. package/dist/utils.js +9 -7
  95. package/package.json +1 -1
  96. package/dist/Button-jq8mFP6t.mjs +0 -52
  97. package/dist/separator.css +0 -1
  98. package/dist/typography.css +0 -1
  99. /package/dist/{input.css → InputBase.css} +0 -0
package/dist/accordion.js CHANGED
@@ -1,66 +1,27 @@
1
- import { jsx as a, jsxs as h } from "react/jsx-runtime";
2
- import O, { createContext as T, useContext as E, useState as g, useCallback as v } from "react";
3
- import { i as y } from "./isValidReactNode-CmYwTWCE.mjs";
4
- import M from "clsx";
5
- import { I as P } from "./Icon-DUCBChX2.mjs";
6
- import './accordion.css';const f = T(null), S = () => E(f), N = "Accordion";
7
- var I = /* @__PURE__ */ ((r) => (r.ITEM = "Accordion.Item", r))(I || {});
8
- const b = "_root_grshw_5", $ = {
9
- root: b
10
- }, j = [I.ITEM], x = (r) => {
11
- const { children: m, defaultValue: u = null, onValueChange: s, value: o } = r, d = o !== void 0, [t, l] = g(u);
12
- let e;
13
- d ? e = o ?? null : e = t;
14
- const p = v(
15
- (n) => {
16
- let i;
17
- e === n ? i = null : i = n, d || l(i), s?.(i);
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import I, { useState as A, useCallback as V } from "react";
3
+ import { i as h } from "./isValidReactNode-CmYwTWCE.mjs";
4
+ import { C as v } from "./Context-BjkJbHVo.mjs";
5
+ import { D as E, I as N } from "./Item-CBYGbEHN.mjs";
6
+ import './accordion.css';var c = /* @__PURE__ */ ((t) => (t.ITEM = "Accordion.Item", t))(c || {});
7
+ const _ = "_root_grshw_5", T = {
8
+ root: _
9
+ }, g = [c.ITEM], i = (t) => {
10
+ const { children: u, defaultValue: d = null, onValueChange: l, value: a } = t, r = a !== void 0, [m, C] = A(d);
11
+ let o;
12
+ r ? o = a ?? null : o = m;
13
+ const p = V(
14
+ (e) => {
15
+ let n;
16
+ o === e ? n = null : n = e, r || C(n), l?.(n);
18
17
  },
19
- [e, d, s]
20
- ), _ = (n) => y(j, n) ? n : null;
21
- return /* @__PURE__ */ a(f.Provider, { value: { onItemToggle: p, openValue: e }, children: /* @__PURE__ */ a("div", { className: $.root, children: O.Children.map(m, _) }) });
18
+ [o, r, l]
19
+ ), f = (e) => h(g, e) ? e : null;
20
+ return /* @__PURE__ */ s(v.Provider, { value: { onItemToggle: p, openValue: o }, children: /* @__PURE__ */ s("div", { className: T.root, children: I.Children.map(u, f) }) });
22
21
  };
23
- x.displayName = N;
24
- const k = "_root_z83hn_7", B = "_trigger_z83hn_11", L = "_open_z83hn_27", R = "_title_z83hn_32", w = "_icon_z83hn_41", D = "_chevron_z83hn_46", U = "_content_z83hn_66", c = {
25
- root: k,
26
- trigger: B,
27
- open: L,
28
- title: R,
29
- icon: w,
30
- chevron: D,
31
- content: U
32
- }, A = (r) => {
33
- const { children: m, icon: u, onOpenChange: s, open: o, title: d, value: t } = r, l = S(), e = l && t !== void 0, [p, _] = g(!1);
34
- let n;
35
- e ? n = l.openValue === t : o !== void 0 ? n = o : n = p;
36
- const i = v(() => {
37
- if (e && t !== void 0) {
38
- l.onItemToggle(t);
39
- return;
40
- }
41
- if (o !== void 0) {
42
- s?.(!o);
43
- return;
44
- }
45
- _((z) => {
46
- const C = !z;
47
- return s?.(C), C;
48
- });
49
- }, [e, l, t, o, s]), V = M(c.root, { [c.open]: n });
50
- return /* @__PURE__ */ h("div", { className: V, children: [
51
- /* @__PURE__ */ h("button", { className: c.trigger, onClick: i, type: "button", children: [
52
- /* @__PURE__ */ h("span", { className: c.title, children: [
53
- u && /* @__PURE__ */ a("span", { className: c.icon, children: /* @__PURE__ */ a(P, { name: u, size: 16 }) }),
54
- d
55
- ] }),
56
- /* @__PURE__ */ a("span", { className: c.chevron })
57
- ] }),
58
- /* @__PURE__ */ a("div", { className: c.content, children: m })
59
- ] });
60
- };
61
- A.displayName = `${N}.Item`;
62
- const Y = x;
63
- Y.Item = A;
22
+ i.displayName = E;
23
+ const x = i;
24
+ x.Item = N;
64
25
  export {
65
- Y as Accordion
26
+ x as Accordion
66
27
  };
@@ -0,0 +1,13 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ /**
4
+ * Dialog Actions sub component.
5
+ *
6
+ * Used to render the actions of the dialog.
7
+ */
8
+ export declare const Actions: default_2.FC<IActionsProps>;
9
+
10
+ export declare interface IActionsProps extends default_2.PropsWithChildren {
11
+ }
12
+
13
+ export { }
@@ -0,0 +1,4 @@
1
+ import { A as s } from "./Actions-Cii4AnwJ.mjs";
2
+ export {
3
+ s as Actions
4
+ };
@@ -0,0 +1,35 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ /**
4
+ * Table.ActiveFilters — displays active filter chips with individual remove buttons
5
+ * and an optional "Clear all" button.
6
+ *
7
+ * Returns `null` when there are no active filters.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <Table.ActiveFilters
12
+ * filters={[
13
+ * { key: 'status', label: 'Status', value: 'Active' },
14
+ * { key: 'role', label: 'Role', value: 'Admin' },
15
+ * ]}
16
+ * onRemove={(key) => console.log('remove', key)}
17
+ * onClearAll={() => console.log('clear all')}
18
+ * />
19
+ * ```
20
+ */
21
+ export declare const ActiveFilters: default_2.FC<IActiveFiltersProps>;
22
+
23
+ export declare interface IActiveFiltersProps {
24
+ filters: IFilterItem[];
25
+ onRemove: (key: string) => void;
26
+ onClearAll?: () => void;
27
+ }
28
+
29
+ export declare interface IFilterItem {
30
+ key: string;
31
+ label: string;
32
+ value: string;
33
+ }
34
+
35
+ export { }
@@ -0,0 +1,4 @@
1
+ import { A as t } from "./ActiveFilters-BJojmc-d.mjs";
2
+ export {
3
+ t as ActiveFilters
4
+ };
package/dist/button.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as r } from "./Button-jq8mFP6t.mjs";
1
+ import { B as r } from "./Button-BN85EtaZ.mjs";
2
2
  export {
3
3
  r as Button
4
4
  };
package/dist/cell.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ /**
4
+ * Table cell. Must be used as a child of `<Table.Row>`.
5
+ * Supports text alignment and header styling via `as="th"`.
6
+ */
7
+ export declare const Cell: default_2.FC<IProps>;
8
+
9
+ declare interface IProps extends default_2.PropsWithChildren {
10
+ /** Text alignment. */
11
+ align?: 'left' | 'center' | 'right';
12
+ /** HTML tag: `'td'` (default) or `'th'`. */
13
+ as?: 'td' | 'th';
14
+ /** Tooltip text (native `title` attribute). */
15
+ title?: string;
16
+ /** Cell width. */
17
+ width?: string;
18
+ }
19
+
20
+ export { }
package/dist/cell.js ADDED
@@ -0,0 +1,4 @@
1
+ import { C as o } from "./Cell-BPBvEyeL.mjs";
2
+ export {
3
+ o as Cell
4
+ };
@@ -0,0 +1,8 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ export declare const Content: default_2.FC<IContentProps>;
4
+
5
+ export declare interface IContentProps extends default_2.PropsWithChildren {
6
+ }
7
+
8
+ export { }
@@ -0,0 +1,4 @@
1
+ import { C as e } from "./Content-1kg0isb_.mjs";
2
+ export {
3
+ e as Content
4
+ };
@@ -0,0 +1,17 @@
1
+ import { Context as Context_2 } from 'react';
2
+
3
+ export declare const Context: Context_2<IContext | null>;
4
+
5
+ /**
6
+ * Accordion Context.
7
+ */
8
+ export declare interface IContext {
9
+ /** Toggle handler for an item. */
10
+ onItemToggle: (value: string) => void;
11
+ /** Currently open item value. */
12
+ openValue: string | null;
13
+ }
14
+
15
+ export declare const useAccordionContext: () => IContext | null;
16
+
17
+ export { }
@@ -0,0 +1,5 @@
1
+ import { C as e, u as n } from "./Context-BjkJbHVo.mjs";
2
+ export {
3
+ e as Context,
4
+ n as useAccordionContext
5
+ };
package/dist/dialog.css CHANGED
@@ -1 +1 @@
1
- ._root_1fxwu_1{display:flex;gap:var(--dialog-actions-gap)}._root_jagsa_1{max-height:100%;overflow-y:auto}:root{--dialog-underlay: var(--lui-color-background-overlay);--dialog-bg: var(--lui-color-background-primary);--dialog-radius: var(--lui-radius-3);--dialog-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--dialog-padding: var(--lui-space-8);--dialog-gap: var(--lui-space-6);--dialog-header-gap: var(--lui-space-6);--dialog-header-min-height: calc(24px + var(--lui-space-6));--dialog-close-color: var(--lui-palette-gray-400);--dialog-close-padding: var(--lui-space-3);--dialog-actions-padding-top: var(--lui-space-10);--dialog-width-xs: 384px;--dialog-width-sm: 480px;--dialog-width-md: 560px;--dialog-width-lg: 640px;--dialog-title-font-size: var(--lui-font-size-md);--dialog-title-weight: var(--lui-font-weight-semibold);--dialog-title-color: var(--lui-color-text-primary);--dialog-title-font-family: var(--lui-font-family-body);--dialog-title-line-height: var(--line-height-md);--dialog-actions-gap: var(--lui-space-4)}._underlay_100vj_25{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--dialog-underlay);inset:0;padding:var(--lui-space-4);position:fixed;z-index:1000}._modal_100vj_34{align-items:center;display:flex;height:100%;justify-content:center}._dialog_100vj_41{background:var(--dialog-bg);border-radius:var(--dialog-radius);box-shadow:var(--dialog-shadow);display:flex;flex-direction:column;gap:var(--dialog-gap);padding:var(--dialog-padding);position:relative}._dialog_100vj_41._sizeXs_100vj_51{width:var(--dialog-width-xs)}._dialog_100vj_41._sizeSm_100vj_54{width:var(--dialog-width-sm)}._dialog_100vj_41._sizeMd_100vj_57{width:var(--dialog-width-md)}._dialog_100vj_41._sizeLg_100vj_60{width:var(--dialog-width-lg)}._header_100vj_64{align-items:center;display:flex;gap:var(--dialog-header-gap);min-height:var(--dialog-header-min-height)}._close_100vj_71{color:var(--dialog-close-color);padding:var(--dialog-close-padding);position:absolute;right:var(--lui-space-4);top:var(--lui-space-4)}._actions_100vj_79{padding-top:var(--dialog-actions-padding-top)}._root_1ae0y_1{color:var(--dialog-title-color);font-family:var(--dialog-title-font-family);font-size:var(--dialog-title-font-size);font-style:normal;font-weight:var(--dialog-title-weight);line-height:var(--dialog-title-line-height);max-height:100%}
1
+ :root{--dialog-underlay: var(--lui-color-background-overlay);--dialog-bg: var(--lui-color-background-primary);--dialog-radius: var(--lui-radius-3);--dialog-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--dialog-padding: var(--lui-space-8);--dialog-gap: var(--lui-space-6);--dialog-header-gap: var(--lui-space-6);--dialog-header-min-height: calc(24px + var(--lui-space-6));--dialog-close-color: var(--lui-palette-gray-400);--dialog-close-padding: var(--lui-space-3);--dialog-actions-padding-top: var(--lui-space-10);--dialog-width-xs: 384px;--dialog-width-sm: 480px;--dialog-width-md: 560px;--dialog-width-lg: 640px;--dialog-title-font-size: var(--lui-font-size-md);--dialog-title-weight: var(--lui-font-weight-semibold);--dialog-title-color: var(--lui-color-text-primary);--dialog-title-font-family: var(--lui-font-family-body);--dialog-title-line-height: var(--line-height-md);--dialog-actions-gap: var(--lui-space-4)}._underlay_100vj_25{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--dialog-underlay);inset:0;padding:var(--lui-space-4);position:fixed;z-index:1000}._modal_100vj_34{align-items:center;display:flex;height:100%;justify-content:center}._dialog_100vj_41{background:var(--dialog-bg);border-radius:var(--dialog-radius);box-shadow:var(--dialog-shadow);display:flex;flex-direction:column;gap:var(--dialog-gap);padding:var(--dialog-padding);position:relative}._dialog_100vj_41._sizeXs_100vj_51{width:var(--dialog-width-xs)}._dialog_100vj_41._sizeSm_100vj_54{width:var(--dialog-width-sm)}._dialog_100vj_41._sizeMd_100vj_57{width:var(--dialog-width-md)}._dialog_100vj_41._sizeLg_100vj_60{width:var(--dialog-width-lg)}._header_100vj_64{align-items:center;display:flex;gap:var(--dialog-header-gap);min-height:var(--dialog-header-min-height)}._close_100vj_71{color:var(--dialog-close-color);padding:var(--dialog-close-padding);position:absolute;right:var(--lui-space-4);top:var(--lui-space-4)}._actions_100vj_79{padding-top:var(--dialog-actions-padding-top)}
package/dist/dialog.js CHANGED
@@ -1,75 +1,57 @@
1
- import { jsx as s, jsxs as _ } from "react/jsx-runtime";
2
- import { useRef as N, useMemo as A } from "react";
1
+ import { A as O } from "./Actions-Cii4AnwJ.mjs";
2
+ import { C as L } from "./Content-1kg0isb_.mjs";
3
+ import { jsx as o, jsxs as _ } from "react/jsx-runtime";
4
+ import { useRef as p, useMemo as A } from "react";
3
5
  import E from "clsx";
4
- import { useDialog as x, useModalOverlay as M, Overlay as P, UNSAFE_PortalProvider as $ } from "react-aria";
5
- import { useOverlayTriggerState as b } from "react-stately";
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";
6
8
  import { I as R } from "./Icon-DUCBChX2.mjs";
7
9
  import { u as X } from "./useLocale-CJh-krrY.mjs";
8
10
  import { g as k } from "./getComponentSlots-DwAYUFNk.mjs";
9
- import { g as w } from "./getVariantClassName-DoCNtwBw.mjs";
10
- import './dialog.css';var e = /* @__PURE__ */ ((o) => (o.ACTIONS = "Dialog.Actions", o.CONTENT = "Dialog.Content", o.TITLE = "Dialog.Title", o))(e || {});
11
- const F = "_root_1fxwu_1", K = {
12
- root: F
13
- }, g = (o) => {
14
- const { children: t } = o;
15
- return /* @__PURE__ */ s("div", { className: K.root, children: t });
16
- };
17
- g.displayName = e.ACTIONS;
18
- const U = "_root_jagsa_1", V = {
19
- root: U
20
- }, u = (o) => {
21
- const { children: t } = o;
22
- return /* @__PURE__ */ s("div", { className: V.root, children: t });
23
- };
24
- u.displayName = e.CONTENT;
25
- const Y = "Dialog", q = [e.ACTIONS, e.CONTENT, e.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", a = {
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
- }, T = (o) => {
37
- const { children: t, container: p, open: i, modal: C = !0, onOpenChange: f, size: h = "md" } = o, y = X(), r = N(null), n = N(null), { dialogProps: z } = x(o, r), c = b({ isOpen: i, onOpenChange: f }), { modalProps: D, underlayProps: O } = M(
38
- { isDismissable: !C, isKeyboardDismissDisabled: !1 },
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(
27
+ { isDismissable: !f, isKeyboardDismissDisabled: !1 },
39
28
  c,
40
- n
29
+ a
41
30
  ), {
42
- [e.ACTIONS]: d,
43
- [e.CONTENT]: m,
44
- [e.TITLE]: j
45
- } = A(() => k(t, q), [t]), I = (L) => {
46
- L.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 S = E(a.dialog, w("size", h, a));
51
- return /* @__PURE__ */ s(P, { portalContainer: p, children: /* @__PURE__ */ s("div", { className: a.underlay, ...O, children: /* @__PURE__ */ s("div", { className: a.modal, ...D, ref: n, children: /* @__PURE__ */ s($, { getContainer: () => n.current, children: /* @__PURE__ */ _("div", { className: S, ...z, ref: r, children: [
52
- /* @__PURE__ */ _("div", { className: a.header, children: [
53
- j,
54
- /* @__PURE__ */ s("button", { "aria-label": y.Dialog.close, className: a.close, onClick: I, children: /* @__PURE__ */ s(R, { name: "x", size: 16 }) })
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: [
41
+ /* @__PURE__ */ _("div", { className: e.header, children: [
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__ */ s("div", { children: m }),
57
- d && /* @__PURE__ */ s("div", { className: a.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
- T.displayName = Y;
61
- const to = "_root_1ae0y_1", ao = {
62
- root: to
63
- }, v = (o) => {
64
- const { children: t } = o;
65
- return /* @__PURE__ */ s("div", { className: ao.root, children: t });
66
- };
67
- v.displayName = e.TITLE;
68
- const l = T;
69
- l.Actions = g;
70
- l.Content = u;
71
- l.Title = v;
49
+ g.displayName = U;
50
+ const i = g;
51
+ i.Actions = O;
52
+ i.Content = L;
53
+ i.Title = K;
72
54
  export {
73
- l as Dialog,
74
- l as default
55
+ i as Dialog,
56
+ i as default
75
57
  };
package/dist/drawer.css CHANGED
@@ -1 +1 @@
1
- ._root_1m4yu_1{display:flex;gap:var(--lui-space-2)}._root_jagsa_1{max-height:100%;overflow-y:auto}:root{--drawer-underlay: var(--lui-color-background-overlay);--drawer-bg: var(--lui-color-background-primary);--drawer-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--drawer-padding: var(--lui-space-8);--drawer-gap: var(--lui-space-6);--drawer-header-gap: var(--lui-space-6);--drawer-header-min-height: calc(24px + var(--lui-space-6));--drawer-close-color: var(--lui-palette-gray-400);--drawer-close-padding: var(--lui-space-3);--drawer-width-sm: 384px;--drawer-width-md: 480px;--drawer-width-lg: 640px;--drawer-height-sm: 320px;--drawer-height-md: 480px;--drawer-height-lg: 640px;--drawer-title-font-size: var(--lui-font-size-md);--drawer-title-weight: var(--lui-font-weight-semibold);--drawer-title-color: var(--lui-color-text-primary);--drawer-title-font-family: var(--lui-font-family-body);--drawer-title-line-height: var(--line-height-md)}._underlay_qcy0k_24{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--drawer-underlay);inset:0;position:fixed;z-index:1000}._modal_qcy0k_32{display:flex;height:100%}._drawer_qcy0k_37{background:var(--drawer-bg);box-shadow:var(--drawer-shadow);display:flex;flex-direction:column;gap:var(--drawer-gap);padding:var(--drawer-padding);position:fixed;transition:transform .3s ease}._drawer_qcy0k_37._placementLeft_qcy0k_47{bottom:0;left:0;top:0;transform:translate(-100%)}._drawer_qcy0k_37._placementLeft_qcy0k_47._entered_qcy0k_53{transform:translate(0)}._drawer_qcy0k_37._placementRight_qcy0k_56{bottom:0;right:0;top:0;transform:translate(100%)}._drawer_qcy0k_37._placementRight_qcy0k_56._entered_qcy0k_53{transform:translate(0)}._drawer_qcy0k_37._placementTop_qcy0k_65{left:0;right:0;top:0;transform:translateY(-100%)}._drawer_qcy0k_37._placementTop_qcy0k_65._entered_qcy0k_53{transform:translateY(0)}._drawer_qcy0k_37._placementBottom_qcy0k_74{bottom:0;left:0;right:0;transform:translateY(100%)}._drawer_qcy0k_37._placementBottom_qcy0k_74._entered_qcy0k_53{transform:translateY(0)}._drawer_qcy0k_37._sizeSm_qcy0k_83{width:var(--drawer-width-sm)}._drawer_qcy0k_37._sizeSm_qcy0k_83._placementTop_qcy0k_65,._drawer_qcy0k_37._sizeSm_qcy0k_83._placementBottom_qcy0k_74{height:var(--drawer-height-sm);width:100%}._drawer_qcy0k_37._sizeMd_qcy0k_90{width:var(--drawer-width-md)}._drawer_qcy0k_37._sizeMd_qcy0k_90._placementTop_qcy0k_65,._drawer_qcy0k_37._sizeMd_qcy0k_90._placementBottom_qcy0k_74{height:var(--drawer-height-md);width:100%}._drawer_qcy0k_37._sizeLg_qcy0k_97{width:var(--drawer-width-lg)}._drawer_qcy0k_37._sizeLg_qcy0k_97._placementTop_qcy0k_65,._drawer_qcy0k_37._sizeLg_qcy0k_97._placementBottom_qcy0k_74{height:var(--drawer-height-lg);width:100%}._content_qcy0k_105{flex:1;overflow-y:auto}:root{--drawer-header-gap: var(--lui-space-6);--drawer-header-min-height: calc(24px + var(--lui-space-6));--drawer-close-color: var(--lui-palette-gray-400);--drawer-close-padding: var(--lui-space-3);--drawer-title-font-size: var(--lui-font-size-md);--drawer-title-weight: var(--lui-font-weight-semibold);--drawer-title-color: var(--lui-color-text-primary);--drawer-title-font-family: var(--lui-font-family-body);--drawer-title-line-height: var(--line-height-md)}._root_1mypq_13{align-items:center;display:flex;gap:var(--drawer-header-gap);min-height:var(--drawer-header-min-height);position:relative}._title_1mypq_21{color:var(--drawer-title-color);flex:1;font-family:var(--drawer-title-font-family);font-size:var(--drawer-title-font-size);font-style:normal;font-weight:var(--drawer-title-weight);line-height:var(--drawer-title-line-height)}._close_1mypq_31{color:var(--drawer-close-color);padding:var(--drawer-close-padding);position:absolute;right:0;top:50%;transform:translateY(-50%)}
1
+ ._root_1m4yu_1{display:flex;gap:var(--lui-space-2)}._root_jagsa_1{max-height:100%;overflow-y:auto}:root{--drawer-underlay: var(--lui-color-background-overlay);--drawer-bg: var(--lui-color-background-primary);--drawer-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--drawer-padding: var(--lui-space-8);--drawer-gap: var(--lui-space-6);--drawer-header-gap: var(--lui-space-6);--drawer-header-min-height: calc(24px + var(--lui-space-6));--drawer-close-color: var(--lui-palette-gray-400);--drawer-close-padding: var(--lui-space-3);--drawer-width-sm: 384px;--drawer-width-md: 480px;--drawer-width-lg: 640px;--drawer-height-sm: 320px;--drawer-height-md: 480px;--drawer-height-lg: 640px;--drawer-title-font-size: var(--lui-font-size-md);--drawer-title-weight: var(--lui-font-weight-semibold);--drawer-title-color: var(--lui-color-text-primary);--drawer-title-font-family: var(--lui-font-family-body);--drawer-title-line-height: var(--line-height-md)}._underlay_qcy0k_24{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--drawer-underlay);inset:0;position:fixed;z-index:1000}._modal_qcy0k_32{display:flex;height:100%}._drawer_qcy0k_37{background:var(--drawer-bg);box-shadow:var(--drawer-shadow);display:flex;flex-direction:column;gap:var(--drawer-gap);padding:var(--drawer-padding);position:fixed;transition:transform .3s ease}._drawer_qcy0k_37._placementLeft_qcy0k_47{bottom:0;left:0;top:0;transform:translate(-100%)}._drawer_qcy0k_37._placementLeft_qcy0k_47._entered_qcy0k_53{transform:translate(0)}._drawer_qcy0k_37._placementRight_qcy0k_56{bottom:0;right:0;top:0;transform:translate(100%)}._drawer_qcy0k_37._placementRight_qcy0k_56._entered_qcy0k_53{transform:translate(0)}._drawer_qcy0k_37._placementTop_qcy0k_65{left:0;right:0;top:0;transform:translateY(-100%)}._drawer_qcy0k_37._placementTop_qcy0k_65._entered_qcy0k_53{transform:translateY(0)}._drawer_qcy0k_37._placementBottom_qcy0k_74{bottom:0;left:0;right:0;transform:translateY(100%)}._drawer_qcy0k_37._placementBottom_qcy0k_74._entered_qcy0k_53{transform:translateY(0)}._drawer_qcy0k_37._sizeSm_qcy0k_83{width:var(--drawer-width-sm)}._drawer_qcy0k_37._sizeSm_qcy0k_83._placementTop_qcy0k_65,._drawer_qcy0k_37._sizeSm_qcy0k_83._placementBottom_qcy0k_74{height:var(--drawer-height-sm);width:100%}._drawer_qcy0k_37._sizeMd_qcy0k_90{width:var(--drawer-width-md)}._drawer_qcy0k_37._sizeMd_qcy0k_90._placementTop_qcy0k_65,._drawer_qcy0k_37._sizeMd_qcy0k_90._placementBottom_qcy0k_74{height:var(--drawer-height-md);width:100%}._drawer_qcy0k_37._sizeLg_qcy0k_97{width:var(--drawer-width-lg)}._drawer_qcy0k_37._sizeLg_qcy0k_97._placementTop_qcy0k_65,._drawer_qcy0k_37._sizeLg_qcy0k_97._placementBottom_qcy0k_74{height:var(--drawer-height-lg);width:100%}._content_qcy0k_105{flex:1;overflow-y:auto}
package/dist/drawer.js CHANGED
@@ -1,64 +1,57 @@
1
- import { jsx as t, jsxs as w } from "react/jsx-runtime";
2
- import H, { cloneElement as P, createContext as $, useContext as B, useRef as u, useState as h, useEffect as F, useMemo as j } from "react";
3
- import { i as V } from "./isValidReactNode-CmYwTWCE.mjs";
1
+ import { jsx as e, jsxs as M } from "react/jsx-runtime";
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-CmYwTWCE.mjs";
4
4
  import "lodash/camelCase";
5
- import U from "clsx";
6
- import { useDialog as K, useModalOverlay as Y, Overlay as G, UNSAFE_PortalProvider as J } from "react-aria";
7
- import { useOverlayTriggerState as Q } from "react-stately";
8
- import { g as W } from "./getComponentSlots-DwAYUFNk.mjs";
9
- import { g as T } from "./getVariantClassName-DoCNtwBw.mjs";
10
- import { I as X } from "./Icon-DUCBChX2.mjs";
11
- import { u as Z } from "./useLocale-CJh-krrY.mjs";
12
- import './drawer.css';var o = /* @__PURE__ */ ((e) => (e.ACTIONS = "Drawer.Actions", e.CONTENT = "Drawer.Content", e.HEADER = "Drawer.Header", e))(o || {});
13
- const ee = "_root_1m4yu_1", te = {
14
- root: ee
15
- }, v = ({ children: e }) => {
16
- const r = H.Children.toArray(e), l = r.map((s, c) => {
17
- if (!V("Button", s))
18
- return s;
19
- const n = s.props.variant;
20
- return P(s, {
5
+ import { E as t, D as B, H as F } from "./Header-Clhgyr0J.mjs";
6
+ import j from "clsx";
7
+ import { useDialog as V, useModalOverlay as $, Overlay as U, UNSAFE_PortalProvider as K } from "react-aria";
8
+ import { useOverlayTriggerState as Y } from "react-stately";
9
+ import { g as G } from "./getComponentSlots-DwAYUFNk.mjs";
10
+ import { g as h } from "./getVariantClassName-DoCNtwBw.mjs";
11
+ import './drawer.css';const J = "_root_1m4yu_1", Q = {
12
+ root: J
13
+ }, v = ({ children: s }) => {
14
+ const n = L.Children.toArray(s), i = n.map((a, c) => {
15
+ if (!H("Button", a))
16
+ return a;
17
+ const r = a.props.variant;
18
+ return P(a, {
21
19
  key: c,
22
- ...n ? {} : { variant: n ?? (c === 0 ? "primary" : "secondary") }
20
+ ...r ? {} : { variant: r ?? (c === 0 ? "primary" : "secondary") }
23
21
  });
24
22
  });
25
- return r.length === 0 ? null : /* @__PURE__ */ t("div", { className: te.root, children: l });
23
+ return n.length === 0 ? null : /* @__PURE__ */ e("div", { className: Q.root, children: i });
26
24
  };
27
- v.displayName = o.ACTIONS;
28
- const oe = "_root_jagsa_1", re = {
29
- root: oe
30
- }, q = (e) => {
31
- const { children: r } = e;
32
- return /* @__PURE__ */ t("div", { className: re.root, children: r });
25
+ v.displayName = t.ACTIONS;
26
+ const W = "_root_jagsa_1", X = {
27
+ root: W
28
+ }, D = (s) => {
29
+ const { children: n } = s;
30
+ return /* @__PURE__ */ e("div", { className: X.root, children: n });
33
31
  };
34
- q.displayName = o.CONTENT;
35
- const ne = "Drawer", se = [o.ACTIONS, o.CONTENT, o.HEADER], E = $(null), ae = () => {
36
- const e = B(E);
37
- if (!e)
38
- throw new Error("Drawer sub-components must be used within a Drawer component.");
39
- return e;
40
- }, ce = "_underlay_qcy0k_24", le = "_modal_qcy0k_32", ie = "_drawer_qcy0k_37", me = "_placementLeft_qcy0k_47", de = "_entered_qcy0k_53", ue = "_placementRight_qcy0k_56", _e = "_placementTop_qcy0k_65", pe = "_placementBottom_qcy0k_74", ye = "_sizeSm_qcy0k_83", fe = "_sizeMd_qcy0k_90", Ne = "_sizeLg_qcy0k_97", Ce = "_content_qcy0k_105", a = {
41
- underlay: ce,
42
- modal: le,
43
- drawer: ie,
44
- placementLeft: me,
45
- entered: de,
46
- placementRight: ue,
47
- placementTop: _e,
48
- placementBottom: pe,
49
- sizeSm: ye,
50
- sizeMd: fe,
51
- sizeLg: Ne,
52
- content: Ce
53
- }, De = 300, O = (e) => {
54
- const { children: r, container: l, dismissable: s = !0, onOpenChange: c, open: n, placement: y = "right", size: R = "md" } = e, f = u(null), i = u(null), { dialogProps: I } = K(e, f), N = Q({ isOpen: n, onOpenChange: c }), { modalProps: S, underlayProps: z } = Y(
55
- { isDismissable: s, isKeyboardDismissDisabled: !1 },
56
- N,
57
- i
58
- ), [C, D] = h(n || !1), [x, A] = h(!1), m = u(C);
59
- F(() => {
60
- if (n) {
61
- m.current = !0, D(!0);
32
+ D.displayName = t.CONTENT;
33
+ const Z = "Drawer", ee = [t.ACTIONS, t.CONTENT, t.HEADER], te = "_underlay_qcy0k_24", ne = "_modal_qcy0k_32", re = "_drawer_qcy0k_37", oe = "_placementLeft_qcy0k_47", se = "_entered_qcy0k_53", ae = "_placementRight_qcy0k_56", ce = "_placementTop_qcy0k_65", ie = "_placementBottom_qcy0k_74", le = "_sizeSm_qcy0k_83", me = "_sizeMd_qcy0k_90", de = "_sizeLg_qcy0k_97", ue = "_content_qcy0k_105", o = {
34
+ underlay: te,
35
+ modal: ne,
36
+ drawer: re,
37
+ placementLeft: oe,
38
+ entered: se,
39
+ placementRight: ae,
40
+ placementTop: ce,
41
+ placementBottom: ie,
42
+ sizeSm: le,
43
+ sizeMd: me,
44
+ sizeLg: de,
45
+ content: ue
46
+ }, _e = 300, E = (s) => {
47
+ const { children: n, container: i, dismissable: a = !0, onOpenChange: c, open: r, placement: p = "right", size: S = "md" } = s, f = u(null), l = u(null), { dialogProps: q } = V(s, f), y = Y({ isOpen: r, onOpenChange: c }), { modalProps: O, underlayProps: k } = $(
48
+ { isDismissable: a, isKeyboardDismissDisabled: !1 },
49
+ y,
50
+ l
51
+ ), [N, g] = T(r || !1), [R, A] = T(!1), m = u(N);
52
+ b(() => {
53
+ if (r) {
54
+ m.current = !0, g(!0);
62
55
  const d = requestAnimationFrame(() => {
63
56
  requestAnimationFrame(() => {
64
57
  A(!0);
@@ -69,58 +62,44 @@ const ne = "Drawer", se = [o.ACTIONS, o.CONTENT, o.HEADER], E = $(null), ae = ()
69
62
  if (m.current) {
70
63
  A(!1);
71
64
  const d = setTimeout(() => {
72
- m.current = !1, D(!1);
73
- }, De);
65
+ m.current = !1, g(!1);
66
+ }, _e);
74
67
  return () => clearTimeout(d);
75
68
  }
76
- }, [n]);
69
+ }, [r]);
77
70
  const {
78
- [o.ACTIONS]: L,
79
- [o.CONTENT]: g,
80
- [o.HEADER]: M
81
- } = j(() => W(r, se), [r]), b = U(
82
- a.drawer,
83
- T("size", R, a),
84
- T("placement", y, a),
85
- { [a.entered]: x }
71
+ [t.ACTIONS]: w,
72
+ [t.CONTENT]: C,
73
+ [t.HEADER]: z
74
+ } = x(() => G(n, ee), [n]), I = j(
75
+ o.drawer,
76
+ h("size", S, o),
77
+ h("placement", p, o),
78
+ { [o.entered]: R }
86
79
  );
87
- return C ? /* @__PURE__ */ t(G, { portalContainer: l, children: /* @__PURE__ */ t("div", { className: a.underlay, ...z, children: /* @__PURE__ */ t("div", { className: a.modal, ...S, ref: i, children: /* @__PURE__ */ t(J, { getContainer: () => i.current, children: /* @__PURE__ */ t(E.Provider, { value: { close: () => N.close() }, children: /* @__PURE__ */ w(
80
+ return N ? /* @__PURE__ */ e(U, { portalContainer: i, children: /* @__PURE__ */ e("div", { className: o.underlay, ...k, children: /* @__PURE__ */ e("div", { className: o.modal, ...O, ref: l, children: /* @__PURE__ */ e(K, { getContainer: () => l.current, children: /* @__PURE__ */ e(B.Provider, { value: { close: () => y.close() }, children: /* @__PURE__ */ M(
88
81
  "div",
89
82
  {
90
83
  "aria-label": "Drawer",
91
84
  "aria-modal": "true",
92
- className: b,
85
+ className: I,
93
86
  role: "dialog",
94
- ...I,
87
+ ...q,
95
88
  ref: f,
96
89
  children: [
97
- M,
98
- g && /* @__PURE__ */ t("div", { className: a.content, children: g }),
99
- L
90
+ z,
91
+ C && /* @__PURE__ */ e("div", { className: o.content, children: C }),
92
+ w
100
93
  ]
101
94
  }
102
95
  ) }) }) }) }) }) : null;
103
96
  };
104
- O.displayName = ne;
105
- const Ae = "_root_1mypq_13", ge = "_title_1mypq_21", he = "_close_1mypq_31", _ = {
106
- root: Ae,
107
- title: ge,
108
- close: he
109
- }, k = (e) => {
110
- const { children: r } = e, { close: l } = ae(), s = Z(), c = (n) => {
111
- n.preventDefault(), l();
112
- };
113
- return /* @__PURE__ */ w("div", { className: _.root, children: [
114
- /* @__PURE__ */ t("div", { className: _.title, children: r }),
115
- /* @__PURE__ */ t("button", { "aria-label": s.Drawer.Header.close, className: _.close, onClick: c, type: "button", children: /* @__PURE__ */ t(X, { name: "x", size: 16 }) })
116
- ] });
117
- };
118
- k.displayName = o.HEADER;
119
- const p = O;
120
- p.Actions = v;
121
- p.Content = q;
122
- p.Header = k;
97
+ E.displayName = Z;
98
+ const _ = E;
99
+ _.Actions = v;
100
+ _.Content = D;
101
+ _.Header = F;
123
102
  export {
124
- p as Drawer,
125
- p as default
103
+ _ as Drawer,
104
+ _ as default
126
105
  };
@@ -0,0 +1,4 @@
1
+ var l = /* @__PURE__ */ ((a) => (a.CELL = "Table.Cell", a.ROW = "Table.Row", a.TOOLBAR = "Table.Toolbar", a))(l || {});
2
+ export {
3
+ l as E
4
+ };
@@ -0,0 +1,7 @@
1
+ const a = "Menu", t = "bottom start";
2
+ var T = ((r) => (r.CHECKBOX = `${a}.Checkbox`, r.CONTENT = `${a}.Content`, r.GROUP = `${a}.Group`, r.ITEM = `${a}.Item`, r.SEPARATOR = `${a}.Separator`, r.TRIGGER = `${a}.Trigger`, r))(T || {});
3
+ export {
4
+ t as D,
5
+ T as E,
6
+ a
7
+ };
@@ -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
+ };
@@ -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
+ };