@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.
- package/CHANGELOG.md +24 -0
- package/dist/Actions-Cii4AnwJ.mjs +12 -0
- package/dist/Actions.css +1 -0
- package/dist/ActiveFilters-BJojmc-d.mjs +29 -0
- package/dist/ActiveFilters.css +1 -0
- package/dist/Button-BN85EtaZ.mjs +52 -0
- package/dist/Button.css +1 -1
- package/dist/Cell-BPBvEyeL.mjs +21 -0
- package/dist/Cell.css +1 -0
- package/dist/Content-1kg0isb_.mjs +12 -0
- package/dist/Content.css +1 -0
- package/dist/Context-BjkJbHVo.mjs +6 -0
- package/dist/Group-DyDpeqOP.mjs +16 -0
- package/dist/Group.css +1 -0
- package/dist/Header-Clhgyr0J.mjs +29 -0
- package/dist/Header.css +1 -0
- package/dist/Heading-CL47Fqe7.mjs +30 -0
- package/dist/Heading.css +1 -0
- package/dist/InputBase-BHZWQT9-.mjs +46 -0
- package/dist/Item-CBYGbEHN.mjs +47 -0
- package/dist/Item.css +1 -0
- package/dist/Panel-B-LZtrGB.mjs +11 -0
- package/dist/Row-BfI8268z.mjs +15 -0
- package/dist/Row.css +1 -0
- package/dist/Separator-FETQ3gHZ.mjs +9 -0
- package/dist/Separator.css +1 -0
- package/dist/Tab-BfpR10OT.mjs +38 -0
- package/dist/Tab.css +1 -0
- package/dist/Text-DQPy-DZ5.mjs +46 -0
- package/dist/Text.css +1 -0
- package/dist/Title-xHMuJWGl.mjs +12 -0
- package/dist/Title.css +1 -0
- package/dist/Toolbar-BJQy4qFI.mjs +11 -0
- package/dist/Toolbar.css +1 -0
- package/dist/Trigger-C_4De6l1.mjs +11 -0
- package/dist/accordion.css +1 -1
- package/dist/accordion.js +23 -62
- package/dist/actions.d.ts +13 -0
- package/dist/actions.js +4 -0
- package/dist/active-filters.d.ts +35 -0
- package/dist/active-filters.js +4 -0
- package/dist/button.js +1 -1
- package/dist/cell.d.ts +20 -0
- package/dist/cell.js +4 -0
- package/dist/content.d.ts +8 -0
- package/dist/content.js +4 -0
- package/dist/context.d.ts +17 -0
- package/dist/context.js +5 -0
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +44 -62
- package/dist/drawer.css +1 -1
- package/dist/drawer.js +72 -93
- package/dist/enums-BnuDYTua.mjs +4 -0
- package/dist/enums-DUZMBQDd.mjs +7 -0
- package/dist/enums-DfSzOa3x.mjs +4 -0
- package/dist/enums-OoI2Qgqq.mjs +14 -0
- package/dist/getDecorationStyle-BCBONKEl.mjs +7 -0
- package/dist/group.d.ts +12 -0
- package/dist/group.js +4 -0
- package/dist/header.d.ts +21 -0
- package/dist/header.js +4 -0
- package/dist/heading.d.ts +55 -0
- package/dist/heading.js +7 -0
- package/dist/input-base.d.ts +29 -0
- package/dist/input-base.js +4 -0
- package/dist/input.js +86 -124
- package/dist/item.d.ts +42 -0
- package/dist/item.js +4 -0
- package/dist/menu.css +1 -1
- package/dist/menu.js +63 -81
- package/dist/panel.d.ts +9 -0
- package/dist/panel.js +4 -0
- package/dist/row.d.ts +12 -0
- package/dist/row.js +4 -0
- package/dist/separator.d.ts +1 -21
- package/dist/separator.js +2 -22
- package/dist/tab.d.ts +30 -0
- package/dist/tab.js +4 -0
- package/dist/table.css +1 -1
- package/dist/table.js +25 -74
- package/dist/tabs.css +1 -1
- package/dist/tabs.js +34 -73
- package/dist/text.d.ts +74 -0
- package/dist/text.js +8 -0
- package/dist/title.d.ts +8 -0
- package/dist/title.js +4 -0
- package/dist/toolbar.d.ts +20 -0
- package/dist/toolbar.js +4 -0
- package/dist/trigger.d.ts +8 -0
- package/dist/trigger.js +4 -0
- package/dist/typography.d.ts +90 -40
- package/dist/typography.js +4 -38
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +9 -7
- package/package.json +1 -1
- package/dist/Button-jq8mFP6t.mjs +0 -52
- package/dist/separator.css +0 -1
- package/dist/typography.css +0 -1
- /package/dist/{input.css → InputBase.css} +0 -0
package/dist/accordion.js
CHANGED
|
@@ -1,66 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { i as
|
|
4
|
-
import
|
|
5
|
-
import { I as
|
|
6
|
-
import './accordion.css';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
[
|
|
20
|
-
),
|
|
21
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
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
|
-
|
|
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 { }
|
package/dist/actions.js
ADDED
|
@@ -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 { }
|
package/dist/button.js
CHANGED
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
package/dist/content.js
ADDED
|
@@ -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 { }
|
package/dist/context.js
ADDED
package/dist/dialog.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
|
5
|
-
import { useOverlayTriggerState as
|
|
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
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
u
|
|
25
|
-
|
|
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
|
-
|
|
29
|
+
a
|
|
41
30
|
), {
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
} = A(() => k(t,
|
|
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__ */
|
|
52
|
-
/* @__PURE__ */ _("div", { className:
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
|
|
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}
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { i as
|
|
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
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { g as
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
...
|
|
20
|
+
...r ? {} : { variant: r ?? (c === 0 ? "primary" : "secondary") }
|
|
23
21
|
});
|
|
24
22
|
});
|
|
25
|
-
return
|
|
23
|
+
return n.length === 0 ? null : /* @__PURE__ */ e("div", { className: Q.root, children: i });
|
|
26
24
|
};
|
|
27
|
-
v.displayName =
|
|
28
|
-
const
|
|
29
|
-
root:
|
|
30
|
-
},
|
|
31
|
-
const { children:
|
|
32
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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,
|
|
73
|
-
},
|
|
65
|
+
m.current = !1, g(!1);
|
|
66
|
+
}, _e);
|
|
74
67
|
return () => clearTimeout(d);
|
|
75
68
|
}
|
|
76
|
-
}, [
|
|
69
|
+
}, [r]);
|
|
77
70
|
const {
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
} =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{ [
|
|
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
|
|
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:
|
|
85
|
+
className: I,
|
|
93
86
|
role: "dialog",
|
|
94
|
-
...
|
|
87
|
+
...q,
|
|
95
88
|
ref: f,
|
|
96
89
|
children: [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
z,
|
|
91
|
+
C && /* @__PURE__ */ e("div", { className: o.content, children: C }),
|
|
92
|
+
w
|
|
100
93
|
]
|
|
101
94
|
}
|
|
102
95
|
) }) }) }) }) }) : null;
|
|
103
96
|
};
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
125
|
-
|
|
103
|
+
_ as Drawer,
|
|
104
|
+
_ as default
|
|
126
105
|
};
|
|
@@ -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,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
|
+
};
|