@plumile/ui 0.1.117 → 0.1.120
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/README.md +2 -0
- package/lib/esm/admin/organisms/admin_sidebar/AdminSidebar.js +2 -1
- package/lib/esm/admin/organisms/admin_sidebar/AdminSidebar.js.map +1 -1
- package/lib/esm/atomic/molecules/markdown/components/MarkdownDelete.css.js +0 -1
- package/lib/esm/atomic/molecules/markdown/components/MarkdownFootnoteReference.css.js +1 -0
- package/lib/esm/backoffice/molecules/sidebar_nav_item/SidebarNavItem.js +90 -94
- package/lib/esm/backoffice/molecules/sidebar_nav_item/SidebarNavItem.js.map +1 -1
- package/lib/esm/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.js +2 -2
- package/lib/esm/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.js.map +1 -1
- package/lib/esm/backoffice/molecules/sidebar_nav_section/SidebarNavSection.js +159 -62
- package/lib/esm/backoffice/molecules/sidebar_nav_section/SidebarNavSection.js.map +1 -1
- package/lib/esm/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.js +2 -2
- package/lib/esm/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.js.map +1 -1
- package/lib/esm/i18n/locales/en/ui.js +12 -6
- package/lib/esm/i18n/locales/en/ui.js.map +1 -1
- package/lib/esm/i18n/locales/fr/ui.js +12 -6
- package/lib/esm/i18n/locales/fr/ui.js.map +1 -1
- package/lib/esm/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +46 -0
- package/lib/esm/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +1 -0
- package/lib/esm/node_modules/@dnd-kit/core/dist/core.esm.js +1966 -0
- package/lib/esm/node_modules/@dnd-kit/core/dist/core.esm.js.map +1 -0
- package/lib/esm/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +348 -0
- package/lib/esm/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +1 -0
- package/lib/esm/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +157 -0
- package/lib/esm/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +1 -0
- package/lib/esm/style.css +1 -1
- package/lib/types/admin/organisms/admin_sidebar/AdminSidebar.d.ts +2 -1
- package/lib/types/admin/organisms/admin_sidebar/AdminSidebar.d.ts.map +1 -1
- package/lib/types/backoffice/molecules/sidebar_nav_item/SidebarNavItem.d.ts +4 -7
- package/lib/types/backoffice/molecules/sidebar_nav_item/SidebarNavItem.d.ts.map +1 -1
- package/lib/types/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.d.ts +1 -0
- package/lib/types/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.d.ts.map +1 -1
- package/lib/types/backoffice/molecules/sidebar_nav_section/SidebarNavSection.d.ts +6 -1
- package/lib/types/backoffice/molecules/sidebar_nav_section/SidebarNavSection.d.ts.map +1 -1
- package/lib/types/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.d.ts +6 -0
- package/lib/types/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.d.ts.map +1 -1
- package/lib/types/i18n/resources.d.ts +8 -0
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/i18n/locales/en/ui.json +4 -0
- package/src/i18n/locales/fr/ui.json +4 -0
package/README.md
CHANGED
|
@@ -80,6 +80,8 @@ flat mental model.
|
|
|
80
80
|
- badges, spinners, tags, skeletons
|
|
81
81
|
- filter bars and drawers
|
|
82
82
|
- backoffice data-table wrappers and list/detail visual helpers
|
|
83
|
+
- `AdminSidebar` and `SidebarNavSection`, including optional sortable sections
|
|
84
|
+
for backoffice navigation groups
|
|
83
85
|
|
|
84
86
|
For the complete export list, see [`src/index.ts`](./src/index.ts).
|
|
85
87
|
|
|
@@ -49,7 +49,8 @@ var p = ({ header: p, search: m, footer: h, sections: g, isCollapsed: _, default
|
|
|
49
49
|
defaultCollapsed: e.defaultCollapsed,
|
|
50
50
|
isCollapsed: e.isCollapsed,
|
|
51
51
|
onCollapsedChange: e.onCollapsedChange,
|
|
52
|
-
collapsed: O
|
|
52
|
+
collapsed: O,
|
|
53
|
+
reorder: e.reorder
|
|
53
54
|
}, e.id))
|
|
54
55
|
}),
|
|
55
56
|
j
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminSidebar.js","names":[],"sources":["../../../../../src/admin/organisms/admin_sidebar/AdminSidebar.tsx"],"sourcesContent":["import { useCallback, useState, type JSX, type ReactNode } from 'react';\nimport type { RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { SidebarCollapseToggle } from '../../../backoffice/molecules/sidebar_collapse_toggle/SidebarCollapseToggle.js';\nimport {\n SidebarNavSection,\n type SidebarNavSectionItem,\n} from '../../../backoffice/molecules/sidebar_nav_section/SidebarNavSection.js';\n\nimport * as styles from './adminSidebar.css.js';\nimport { cx } from '../../../theme/tools.js';\n\nexport type AdminSidebarSection = {\n id: string;\n title?: ReactNode;\n icon?: ReactNode;\n items: readonly SidebarNavSectionItem[];\n collapsible?: boolean;\n defaultCollapsed?: boolean;\n isCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n};\n\nexport type AdminSidebarProps = {\n header?: ReactNode;\n search?: ReactNode;\n footer?: ReactNode;\n sections: readonly AdminSidebarSection[];\n isCollapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n collapseToggleLabel?: ReactNode;\n expandToggleLabel?: ReactNode;\n collapseShortcut?: readonly string[] | string;\n navigationAriaLabel?: string;\n hideCollapseToggle?: boolean;\n className?: string;\n};\n\nexport const AdminSidebar = ({\n header,\n search,\n footer,\n sections,\n isCollapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n collapseToggleLabel,\n expandToggleLabel,\n collapseShortcut,\n navigationAriaLabel = 'Admin navigation',\n hideCollapseToggle = false,\n className,\n}: AdminSidebarProps): JSX.Element => {\n const [uncontrolledCollapsed, setUncontrolledCollapsed] =\n useState(defaultCollapsed);\n\n const collapsed = isCollapsed ?? uncontrolledCollapsed;\n\n const handleToggleCollapsed = useCallback(() => {\n const next = !collapsed;\n if (isCollapsed == null) {\n setUncontrolledCollapsed(next);\n }\n onCollapsedChange?.(next);\n }, [collapsed, isCollapsed, onCollapsedChange]);\n\n let widthKey: NonNullable<\n NonNullable<RecipeVariants<typeof styles.widthRecipe>>['state']\n > = 'expanded';\n if (collapsed) {\n widthKey = 'collapsed';\n }\n\n let footerNode: JSX.Element | null = null;\n if (footer != null) {\n footerNode = <div className={styles.footer}>{footer}</div>;\n }\n\n return (\n <aside\n className={cx(\n styles.container,\n styles.widthRecipe({ state: widthKey }),\n className,\n )}\n >\n <div className={styles.inner}>\n <div className={styles.header}>\n {header}\n {!hideCollapseToggle && (\n <SidebarCollapseToggle\n isCollapsed={collapsed}\n onToggle={handleToggleCollapsed}\n label={collapseToggleLabel}\n expandLabel={expandToggleLabel}\n shortcut={collapseShortcut}\n />\n )}\n </div>\n\n {search != null && <div className={styles.search}>{search}</div>}\n <nav className={styles.sections} aria-label={navigationAriaLabel}>\n {sections.map((section) => {\n return (\n <SidebarNavSection\n key={section.id}\n title={section.title}\n icon={section.icon}\n items={section.items}\n collapsible={section.collapsible}\n defaultCollapsed={section.defaultCollapsed}\n isCollapsed={section.isCollapsed}\n onCollapsedChange={section.onCollapsedChange}\n collapsed={collapsed}\n />\n );\n })}\n </nav>\n\n {footerNode}\n </div>\n </aside>\n );\n};\n\nexport default AdminSidebar;\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"AdminSidebar.js","names":[],"sources":["../../../../../src/admin/organisms/admin_sidebar/AdminSidebar.tsx"],"sourcesContent":["import { useCallback, useState, type JSX, type ReactNode } from 'react';\nimport type { RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { SidebarCollapseToggle } from '../../../backoffice/molecules/sidebar_collapse_toggle/SidebarCollapseToggle.js';\nimport {\n SidebarNavSection,\n type SidebarNavSectionItem,\n type SidebarNavSectionReorder,\n} from '../../../backoffice/molecules/sidebar_nav_section/SidebarNavSection.js';\n\nimport * as styles from './adminSidebar.css.js';\nimport { cx } from '../../../theme/tools.js';\n\nexport type AdminSidebarSection = {\n id: string;\n title?: ReactNode;\n icon?: ReactNode;\n items: readonly SidebarNavSectionItem[];\n collapsible?: boolean;\n defaultCollapsed?: boolean;\n isCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n reorder?: SidebarNavSectionReorder;\n};\n\nexport type AdminSidebarProps = {\n header?: ReactNode;\n search?: ReactNode;\n footer?: ReactNode;\n sections: readonly AdminSidebarSection[];\n isCollapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n collapseToggleLabel?: ReactNode;\n expandToggleLabel?: ReactNode;\n collapseShortcut?: readonly string[] | string;\n navigationAriaLabel?: string;\n hideCollapseToggle?: boolean;\n className?: string;\n};\n\nexport const AdminSidebar = ({\n header,\n search,\n footer,\n sections,\n isCollapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n collapseToggleLabel,\n expandToggleLabel,\n collapseShortcut,\n navigationAriaLabel = 'Admin navigation',\n hideCollapseToggle = false,\n className,\n}: AdminSidebarProps): JSX.Element => {\n const [uncontrolledCollapsed, setUncontrolledCollapsed] =\n useState(defaultCollapsed);\n\n const collapsed = isCollapsed ?? uncontrolledCollapsed;\n\n const handleToggleCollapsed = useCallback(() => {\n const next = !collapsed;\n if (isCollapsed == null) {\n setUncontrolledCollapsed(next);\n }\n onCollapsedChange?.(next);\n }, [collapsed, isCollapsed, onCollapsedChange]);\n\n let widthKey: NonNullable<\n NonNullable<RecipeVariants<typeof styles.widthRecipe>>['state']\n > = 'expanded';\n if (collapsed) {\n widthKey = 'collapsed';\n }\n\n let footerNode: JSX.Element | null = null;\n if (footer != null) {\n footerNode = <div className={styles.footer}>{footer}</div>;\n }\n\n return (\n <aside\n className={cx(\n styles.container,\n styles.widthRecipe({ state: widthKey }),\n className,\n )}\n >\n <div className={styles.inner}>\n <div className={styles.header}>\n {header}\n {!hideCollapseToggle && (\n <SidebarCollapseToggle\n isCollapsed={collapsed}\n onToggle={handleToggleCollapsed}\n label={collapseToggleLabel}\n expandLabel={expandToggleLabel}\n shortcut={collapseShortcut}\n />\n )}\n </div>\n\n {search != null && <div className={styles.search}>{search}</div>}\n <nav className={styles.sections} aria-label={navigationAriaLabel}>\n {sections.map((section) => {\n return (\n <SidebarNavSection\n key={section.id}\n title={section.title}\n icon={section.icon}\n items={section.items}\n collapsible={section.collapsible}\n defaultCollapsed={section.defaultCollapsed}\n isCollapsed={section.isCollapsed}\n onCollapsedChange={section.onCollapsedChange}\n collapsed={collapsed}\n reorder={section.reorder}\n />\n );\n })}\n </nav>\n\n {footerNode}\n </div>\n </aside>\n );\n};\n\nexport default AdminSidebar;\n"],"mappings":";;;;;;;AAyCA,IAAa,KAAgB,EAC3B,QAAA,GACA,QAAA,GACA,QAAA,GACA,UAAA,GACA,gBACA,sBAAmB,IACnB,sBACA,wBACA,sBACA,qBACA,yBAAsB,oBACtB,wBAAqB,IACrB,mBACoC;CACpC,IAAM,CAAC,GAAuB,KAC5B,EAAS,EAAiB,EAEtB,IAAY,KAAe,GAE3B,IAAwB,QAAkB;EAC9C,IAAM,IAAO,CAAC;EAId,AAHI,KACF,EAAyB,EAAK,EAEhC,IAAoB,EAAK;IACxB;EAAC;EAAW;EAAa;EAAkB,CAAC,EAE3C,IAEA;CACJ,AAAI,MACF,IAAW;CAGb,IAAI,IAAiC;CAKrC,OAJI,KAAU,SACZ,IAAa,kBAAC,OAAD;EAAK,WAAW;YAAgB;EAAa,CAAA,GAI1D,kBAAC,SAAD;EACE,WAAW,EACT,GACA,EAAmB,EAAE,OAAO,GAAU,CAAC,EACvC,EACD;YAED,kBAAC,OAAD;GAAK,WAAW;aAAhB;IACE,kBAAC,OAAD;KAAK,WAAW;eAAhB,CACG,GACA,CAAC,KACA,kBAAC,GAAD;MACE,aAAa;MACb,UAAU;MACV,OAAO;MACP,aAAa;MACb,UAAU;MACV,CAAA,CAEA;;IAEL,KAAU,QAAQ,kBAAC,OAAD;KAAK,WAAW;eAAgB;KAAa,CAAA;IAChE,kBAAC,OAAD;KAAK,WAAW;KAAiB,cAAY;eAC1C,EAAS,KAAK,MAEX,kBAAC,GAAD;MAEE,OAAO,EAAQ;MACf,MAAM,EAAQ;MACd,OAAO,EAAQ;MACf,aAAa,EAAQ;MACrB,kBAAkB,EAAQ;MAC1B,aAAa,EAAQ;MACrB,mBAAmB,EAAQ;MAChB;MACX,SAAS,EAAQ;MACjB,EAVK,EAAQ,GAUb,CAEJ;KACE,CAAA;IAEL;IACG;;EACA,CAAA"}
|
|
@@ -1,123 +1,119 @@
|
|
|
1
1
|
import { cx as e } from "../../../theme/tools.js";
|
|
2
|
-
import { actionSlot as t, actions as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import
|
|
2
|
+
import { actionSlot as t, actions as ee, actionsVisible as te, badge as ne, badgeCollapsed as n, dragHandle as r, icon as i, iconNested as a, item as o, itemActive as s, itemCollapsed as re, itemDisabled as ie, itemDragging as ae, itemNested as oe, label as se, labelCollapsed as ce, link as c } from "./sidebarNavItem.css.js";
|
|
3
|
+
import { useCallback as le, useEffect as ue, useRef as l, useState as u } from "react";
|
|
4
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import m from "@plumile/router/routing/Link.js";
|
|
6
6
|
//#region src/backoffice/molecules/sidebar_nav_item/SidebarNavItem.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
className: e(i, { [
|
|
19
|
-
children:
|
|
7
|
+
var h = m, g = ({ label: m, href: g, icon: _, badge: v, isActive: y = !1, disabled: b = !1, onClick: de, collapsed: x = !1, nested: S = !1, ariaLabel: fe, className: C, actionSlot: w, dragHandleSlot: T, dragHandleLabel: E, dragHandleProps: D, isDragging: O = !1 }) => {
|
|
8
|
+
let k = l(null), A = l(null), [j, M] = u(!1), [N, P] = u(!1), F = [o];
|
|
9
|
+
x && F.push(re), S && !x && F.push(oe), y && F.push(s), b && F.push(ie), O && F.push(ae), C != null && F.push(C);
|
|
10
|
+
let I = e(...F), L = fe;
|
|
11
|
+
L == null && typeof m == "string" && (L = m);
|
|
12
|
+
let R, z;
|
|
13
|
+
x && (R = L, z = L);
|
|
14
|
+
let B;
|
|
15
|
+
y && (B = "page");
|
|
16
|
+
let V = null;
|
|
17
|
+
_ != null && (V = /* @__PURE__ */ f("span", {
|
|
18
|
+
className: e(i, { [a]: S && !x }),
|
|
19
|
+
children: _
|
|
20
20
|
}));
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
let
|
|
24
|
-
if (
|
|
21
|
+
let H = null;
|
|
22
|
+
x && (H = ce);
|
|
23
|
+
let pe = e(se, H), U = null;
|
|
24
|
+
if (v != null) {
|
|
25
25
|
let t = null;
|
|
26
|
-
|
|
27
|
-
className: e(
|
|
28
|
-
children:
|
|
26
|
+
x && (t = n), U = /* @__PURE__ */ f("span", {
|
|
27
|
+
className: e(ne, t),
|
|
28
|
+
children: v
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
className:
|
|
35
|
-
children:
|
|
31
|
+
let W = /* @__PURE__ */ p(d, { children: [
|
|
32
|
+
V,
|
|
33
|
+
/* @__PURE__ */ f("span", {
|
|
34
|
+
className: pe,
|
|
35
|
+
children: m
|
|
36
36
|
}),
|
|
37
|
-
|
|
38
|
-
] }),
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
37
|
+
U
|
|
38
|
+
] }), G = () => {
|
|
39
|
+
de?.();
|
|
40
|
+
}, K = !x && !b && !O && (w != null || T != null), q = le(() => {
|
|
41
|
+
A.current != null && (clearTimeout(A.current), A.current = null);
|
|
42
42
|
}, []);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}), [
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
ue(() => (K || (M(!1), P(!1), q()), () => {
|
|
44
|
+
q();
|
|
45
|
+
}), [q, K]);
|
|
46
|
+
let me = () => {
|
|
47
|
+
K && (q(), A.current = setTimeout(() => {
|
|
48
|
+
M(!0);
|
|
49
49
|
}, 150));
|
|
50
|
+
}, he = () => {
|
|
51
|
+
q(), M(!1);
|
|
50
52
|
}, ge = () => {
|
|
51
|
-
|
|
52
|
-
}, _e = () => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (!q) {
|
|
56
|
-
F(!1);
|
|
53
|
+
K && P(!0);
|
|
54
|
+
}, _e = (e) => {
|
|
55
|
+
if (!K) {
|
|
56
|
+
P(!1);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
let t = e.relatedTarget;
|
|
60
|
-
t != null &&
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
className:
|
|
60
|
+
t != null && k.current?.contains(t) || P(!1);
|
|
61
|
+
}, J;
|
|
62
|
+
J = b ? /* @__PURE__ */ f("span", {
|
|
63
|
+
className: c,
|
|
64
64
|
"aria-disabled": "true",
|
|
65
|
-
"aria-label":
|
|
66
|
-
title:
|
|
67
|
-
children:
|
|
68
|
-
}) :
|
|
65
|
+
"aria-label": R,
|
|
66
|
+
title: z,
|
|
67
|
+
children: W
|
|
68
|
+
}) : g == null ? /* @__PURE__ */ f("button", {
|
|
69
69
|
type: "button",
|
|
70
|
-
className:
|
|
71
|
-
onClick:
|
|
72
|
-
"aria-current":
|
|
73
|
-
"aria-label":
|
|
74
|
-
title:
|
|
75
|
-
children:
|
|
76
|
-
}) : /* @__PURE__ */
|
|
77
|
-
to:
|
|
78
|
-
className:
|
|
79
|
-
"aria-current":
|
|
80
|
-
"aria-label":
|
|
81
|
-
title:
|
|
82
|
-
onClick:
|
|
83
|
-
children:
|
|
70
|
+
className: c,
|
|
71
|
+
onClick: G,
|
|
72
|
+
"aria-current": B,
|
|
73
|
+
"aria-label": R,
|
|
74
|
+
title: z,
|
|
75
|
+
children: W
|
|
76
|
+
}) : /* @__PURE__ */ f(h, {
|
|
77
|
+
to: g,
|
|
78
|
+
className: c,
|
|
79
|
+
"aria-current": B,
|
|
80
|
+
"aria-label": R,
|
|
81
|
+
title: z,
|
|
82
|
+
onClick: G,
|
|
83
|
+
children: W
|
|
84
84
|
});
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
let
|
|
88
|
-
|
|
85
|
+
let Y = K && (j || N), X;
|
|
86
|
+
Y && (X = te);
|
|
87
|
+
let ve = e(ee, X), Z = null;
|
|
88
|
+
T != null && !x && (Z = /* @__PURE__ */ f("button", {
|
|
89
|
+
...D,
|
|
89
90
|
type: "button",
|
|
90
|
-
className:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"aria-label": O,
|
|
95
|
-
title: O,
|
|
96
|
-
children: D
|
|
91
|
+
className: e(r, D?.className),
|
|
92
|
+
"aria-label": E,
|
|
93
|
+
title: E,
|
|
94
|
+
children: T
|
|
97
95
|
}));
|
|
98
96
|
let Q = null;
|
|
99
|
-
|
|
97
|
+
w != null && !x && (Q = /* @__PURE__ */ f("span", {
|
|
100
98
|
className: t,
|
|
101
|
-
children:
|
|
99
|
+
children: w
|
|
102
100
|
}));
|
|
103
101
|
let $ = null;
|
|
104
|
-
return
|
|
105
|
-
className:
|
|
102
|
+
return K && ($ = /* @__PURE__ */ p("span", {
|
|
103
|
+
className: ve,
|
|
106
104
|
children: [Z, Q]
|
|
107
|
-
})), /* @__PURE__ */
|
|
108
|
-
className:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
onBlurCapture: ve,
|
|
115
|
-
ref: A,
|
|
105
|
+
})), /* @__PURE__ */ p("div", {
|
|
106
|
+
className: I,
|
|
107
|
+
onMouseEnter: me,
|
|
108
|
+
onMouseLeave: he,
|
|
109
|
+
onFocusCapture: ge,
|
|
110
|
+
onBlurCapture: _e,
|
|
111
|
+
ref: k,
|
|
116
112
|
role: "listitem",
|
|
117
|
-
children: [
|
|
113
|
+
children: [J, $]
|
|
118
114
|
});
|
|
119
115
|
};
|
|
120
116
|
//#endregion
|
|
121
|
-
export {
|
|
117
|
+
export { g as SidebarNavItem, g as default };
|
|
122
118
|
|
|
123
119
|
//# sourceMappingURL=SidebarNavItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarNavItem.js","names":[],"sources":["../../../../../src/backoffice/molecules/sidebar_nav_item/SidebarNavItem.tsx"],"sourcesContent":["import Link from '@plumile/router/routing/Link.js';\nimport {\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type DragEvent,\n type FocusEvent,\n type JSX,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport * as styles from './sidebarNavItem.css.js';\nimport { cx } from '../../../theme/tools.js';\n\ntype RouterLinkProps = ComponentPropsWithoutRef<typeof Link> &\n AnchorHTMLAttributes<HTMLAnchorElement>;\nconst RouterLink = Link as unknown as (props: RouterLinkProps) => JSX.Element;\n\nexport type SidebarNavItemProps = {\n label: ReactNode;\n href?: string;\n icon?: ReactNode;\n badge?: ReactNode;\n isActive?: boolean;\n disabled?: boolean;\n onClick?: () => void;\n onDragStart?: (event: DragEvent) => void;\n onDragOver?: (event: DragEvent) => void;\n onDrop?: (event: DragEvent) => void;\n onDragEnd?: (event: DragEvent) => void;\n collapsed?: boolean;\n nested?: boolean;\n ariaLabel?: string;\n className?: string;\n actionSlot?: ReactNode;\n dragHandleSlot?: ReactNode;\n dragHandleLabel?: string;\n draggable?: boolean;\n};\n\nexport const SidebarNavItem = ({\n label,\n href,\n icon,\n badge,\n isActive = false,\n disabled = false,\n onClick,\n onDragStart,\n onDragOver,\n onDrop,\n onDragEnd,\n collapsed = false,\n nested = false,\n ariaLabel,\n className,\n actionSlot,\n dragHandleSlot,\n dragHandleLabel,\n draggable = false,\n}: SidebarNavItemProps): JSX.Element => {\n const itemRef = useRef<HTMLDivElement | null>(null);\n const hoverTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [isHoverIntent, setIsHoverIntent] = useState(false);\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n\n const itemClassNames: (string | null | undefined)[] = [styles.item];\n if (collapsed) {\n itemClassNames.push(styles.itemCollapsed);\n }\n if (nested && !collapsed) {\n itemClassNames.push(styles.itemNested);\n }\n if (isActive) {\n itemClassNames.push(styles.itemActive);\n }\n if (disabled) {\n itemClassNames.push(styles.itemDisabled);\n }\n if (className != null) {\n itemClassNames.push(className);\n }\n const itemClassName = cx(...itemClassNames);\n\n let resolvedAriaLabel: string | undefined = ariaLabel;\n if (resolvedAriaLabel == null && typeof label === 'string') {\n resolvedAriaLabel = label;\n }\n\n let collapsedAriaLabel: string | undefined;\n let collapsedTitle: string | undefined;\n if (collapsed) {\n collapsedAriaLabel = resolvedAriaLabel;\n collapsedTitle = resolvedAriaLabel;\n }\n\n let ariaCurrent: 'page' | undefined;\n if (isActive) {\n ariaCurrent = 'page';\n }\n\n let iconNode: JSX.Element | null = null;\n if (icon != null) {\n iconNode = (\n <span\n className={cx(styles.icon, {\n [styles.iconNested]: nested && !collapsed,\n })}\n >\n {icon}\n </span>\n );\n }\n\n let labelExtraClass: string | null = null;\n if (collapsed) {\n labelExtraClass = styles.labelCollapsed;\n }\n const labelClassName = cx(styles.label, labelExtraClass);\n\n let badgeNode: JSX.Element | null = null;\n if (badge != null) {\n let badgeExtraClass: string | null = null;\n if (collapsed) {\n badgeExtraClass = styles.badgeCollapsed;\n }\n badgeNode = (\n <span className={cx(styles.badge, badgeExtraClass)}>{badge}</span>\n );\n }\n\n const content = (\n <>\n {iconNode}\n <span className={labelClassName}>{label}</span>\n {badgeNode}\n </>\n );\n\n const handleClick = (): void => {\n if (onClick != null) {\n onClick();\n }\n };\n\n const shouldRenderActions =\n !collapsed && !disabled && (actionSlot != null || dragHandleSlot != null);\n\n const clearHoverTimeout = useCallback((): void => {\n if (hoverTimeoutRef.current != null) {\n clearTimeout(hoverTimeoutRef.current);\n hoverTimeoutRef.current = null;\n }\n }, []);\n\n useEffect(() => {\n if (!shouldRenderActions) {\n setIsHoverIntent(false);\n setIsFocusWithin(false);\n clearHoverTimeout();\n }\n\n return () => {\n clearHoverTimeout();\n };\n }, [clearHoverTimeout, shouldRenderActions]);\n\n const handleMouseEnter = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n clearHoverTimeout();\n hoverTimeoutRef.current = setTimeout(() => {\n setIsHoverIntent(true);\n }, 150);\n };\n\n const handleMouseLeave = (): void => {\n clearHoverTimeout();\n setIsHoverIntent(false);\n };\n\n const handleFocusCapture = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n setIsFocusWithin(true);\n };\n\n const handleBlurCapture = (event: FocusEvent<HTMLDivElement>): void => {\n if (!shouldRenderActions) {\n setIsFocusWithin(false);\n return;\n }\n const nextTarget = event.relatedTarget as Node | null;\n if (nextTarget != null && itemRef.current?.contains(nextTarget)) {\n return;\n }\n setIsFocusWithin(false);\n };\n\n let mainNode: JSX.Element;\n if (disabled) {\n mainNode = (\n <span\n className={styles.link}\n aria-disabled=\"true\"\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </span>\n );\n } else if (href != null) {\n mainNode = (\n <RouterLink\n to={href}\n className={styles.link}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n onClick={handleClick}\n >\n {content}\n </RouterLink>\n );\n } else {\n mainNode = (\n <button\n type=\"button\"\n className={styles.link}\n onClick={handleClick}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </button>\n );\n }\n\n const isActionsVisible =\n shouldRenderActions && (isHoverIntent || isFocusWithin);\n let actionsVisibilityClass: string | undefined;\n if (isActionsVisible) {\n actionsVisibilityClass = styles.actionsVisible;\n }\n const actionsClassName = cx(styles.actions, actionsVisibilityClass);\n\n let dragHandleNode: JSX.Element | null = null;\n if (dragHandleSlot != null && !collapsed) {\n dragHandleNode = (\n <button\n type=\"button\"\n className={styles.dragHandle}\n draggable={draggable}\n onDragStart={onDragStart}\n onDragEnd={onDragEnd}\n aria-label={dragHandleLabel}\n title={dragHandleLabel}\n >\n {dragHandleSlot}\n </button>\n );\n }\n\n let actionNode: JSX.Element | null = null;\n if (actionSlot != null && !collapsed) {\n actionNode = <span className={styles.actionSlot}>{actionSlot}</span>;\n }\n\n let actionsNode: JSX.Element | null = null;\n if (shouldRenderActions) {\n actionsNode = (\n <span className={actionsClassName}>\n {dragHandleNode}\n {actionNode}\n </span>\n );\n }\n\n return (\n <div\n className={itemClassName}\n onDragOver={onDragOver}\n onDrop={onDrop}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocusCapture={handleFocusCapture}\n onBlurCapture={handleBlurCapture}\n ref={itemRef}\n role=\"listitem\"\n >\n {mainNode}\n {actionsNode}\n </div>\n );\n};\n\nexport default SidebarNavItem;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"SidebarNavItem.js","names":[],"sources":["../../../../../src/backoffice/molecules/sidebar_nav_item/SidebarNavItem.tsx"],"sourcesContent":["import Link from '@plumile/router/routing/Link.js';\nimport {\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type ComponentPropsWithoutRef,\n type FocusEvent,\n type JSX,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport * as styles from './sidebarNavItem.css.js';\nimport { cx } from '../../../theme/tools.js';\n\ntype RouterLinkProps = ComponentPropsWithoutRef<typeof Link> &\n AnchorHTMLAttributes<HTMLAnchorElement>;\nconst RouterLink = Link as unknown as (props: RouterLinkProps) => JSX.Element;\n\nexport type SidebarNavItemProps = {\n label: ReactNode;\n href?: string;\n icon?: ReactNode;\n badge?: ReactNode;\n isActive?: boolean;\n disabled?: boolean;\n onClick?: () => void;\n collapsed?: boolean;\n nested?: boolean;\n ariaLabel?: string;\n className?: string;\n actionSlot?: ReactNode;\n dragHandleSlot?: ReactNode;\n dragHandleLabel?: string;\n dragHandleProps?: ButtonHTMLAttributes<HTMLButtonElement>;\n isDragging?: boolean;\n};\n\nexport const SidebarNavItem = ({\n label,\n href,\n icon,\n badge,\n isActive = false,\n disabled = false,\n onClick,\n collapsed = false,\n nested = false,\n ariaLabel,\n className,\n actionSlot,\n dragHandleSlot,\n dragHandleLabel,\n dragHandleProps,\n isDragging = false,\n}: SidebarNavItemProps): JSX.Element => {\n const itemRef = useRef<HTMLDivElement | null>(null);\n const hoverTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [isHoverIntent, setIsHoverIntent] = useState(false);\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n\n const itemClassNames: (string | null | undefined)[] = [styles.item];\n if (collapsed) {\n itemClassNames.push(styles.itemCollapsed);\n }\n if (nested && !collapsed) {\n itemClassNames.push(styles.itemNested);\n }\n if (isActive) {\n itemClassNames.push(styles.itemActive);\n }\n if (disabled) {\n itemClassNames.push(styles.itemDisabled);\n }\n if (isDragging) {\n itemClassNames.push(styles.itemDragging);\n }\n if (className != null) {\n itemClassNames.push(className);\n }\n const itemClassName = cx(...itemClassNames);\n\n let resolvedAriaLabel: string | undefined = ariaLabel;\n if (resolvedAriaLabel == null && typeof label === 'string') {\n resolvedAriaLabel = label;\n }\n\n let collapsedAriaLabel: string | undefined;\n let collapsedTitle: string | undefined;\n if (collapsed) {\n collapsedAriaLabel = resolvedAriaLabel;\n collapsedTitle = resolvedAriaLabel;\n }\n\n let ariaCurrent: 'page' | undefined;\n if (isActive) {\n ariaCurrent = 'page';\n }\n\n let iconNode: JSX.Element | null = null;\n if (icon != null) {\n iconNode = (\n <span\n className={cx(styles.icon, {\n [styles.iconNested]: nested && !collapsed,\n })}\n >\n {icon}\n </span>\n );\n }\n\n let labelExtraClass: string | null = null;\n if (collapsed) {\n labelExtraClass = styles.labelCollapsed;\n }\n const labelClassName = cx(styles.label, labelExtraClass);\n\n let badgeNode: JSX.Element | null = null;\n if (badge != null) {\n let badgeExtraClass: string | null = null;\n if (collapsed) {\n badgeExtraClass = styles.badgeCollapsed;\n }\n badgeNode = (\n <span className={cx(styles.badge, badgeExtraClass)}>{badge}</span>\n );\n }\n\n const content = (\n <>\n {iconNode}\n <span className={labelClassName}>{label}</span>\n {badgeNode}\n </>\n );\n\n const handleClick = (): void => {\n if (onClick != null) {\n onClick();\n }\n };\n\n const shouldRenderActions =\n !collapsed &&\n !disabled &&\n !isDragging &&\n (actionSlot != null || dragHandleSlot != null);\n\n const clearHoverTimeout = useCallback((): void => {\n if (hoverTimeoutRef.current != null) {\n clearTimeout(hoverTimeoutRef.current);\n hoverTimeoutRef.current = null;\n }\n }, []);\n\n useEffect(() => {\n if (!shouldRenderActions) {\n setIsHoverIntent(false);\n setIsFocusWithin(false);\n clearHoverTimeout();\n }\n\n return () => {\n clearHoverTimeout();\n };\n }, [clearHoverTimeout, shouldRenderActions]);\n\n const handleMouseEnter = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n clearHoverTimeout();\n hoverTimeoutRef.current = setTimeout(() => {\n setIsHoverIntent(true);\n }, 150);\n };\n\n const handleMouseLeave = (): void => {\n clearHoverTimeout();\n setIsHoverIntent(false);\n };\n\n const handleFocusCapture = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n setIsFocusWithin(true);\n };\n\n const handleBlurCapture = (event: FocusEvent<HTMLDivElement>): void => {\n if (!shouldRenderActions) {\n setIsFocusWithin(false);\n return;\n }\n const nextTarget = event.relatedTarget as Node | null;\n if (nextTarget != null && itemRef.current?.contains(nextTarget)) {\n return;\n }\n setIsFocusWithin(false);\n };\n\n let mainNode: JSX.Element;\n if (disabled) {\n mainNode = (\n <span\n className={styles.link}\n aria-disabled=\"true\"\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </span>\n );\n } else if (href != null) {\n mainNode = (\n <RouterLink\n to={href}\n className={styles.link}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n onClick={handleClick}\n >\n {content}\n </RouterLink>\n );\n } else {\n mainNode = (\n <button\n type=\"button\"\n className={styles.link}\n onClick={handleClick}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </button>\n );\n }\n\n const isActionsVisible =\n shouldRenderActions && (isHoverIntent || isFocusWithin);\n let actionsVisibilityClass: string | undefined;\n if (isActionsVisible) {\n actionsVisibilityClass = styles.actionsVisible;\n }\n const actionsClassName = cx(styles.actions, actionsVisibilityClass);\n\n let dragHandleNode: JSX.Element | null = null;\n if (dragHandleSlot != null && !collapsed) {\n dragHandleNode = (\n <button\n {...dragHandleProps}\n type=\"button\"\n className={cx(styles.dragHandle, dragHandleProps?.className)}\n aria-label={dragHandleLabel}\n title={dragHandleLabel}\n >\n {dragHandleSlot}\n </button>\n );\n }\n\n let actionNode: JSX.Element | null = null;\n if (actionSlot != null && !collapsed) {\n actionNode = <span className={styles.actionSlot}>{actionSlot}</span>;\n }\n\n let actionsNode: JSX.Element | null = null;\n if (shouldRenderActions) {\n actionsNode = (\n <span className={actionsClassName}>\n {dragHandleNode}\n {actionNode}\n </span>\n );\n }\n\n return (\n <div\n className={itemClassName}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocusCapture={handleFocusCapture}\n onBlurCapture={handleBlurCapture}\n ref={itemRef}\n role=\"listitem\"\n >\n {mainNode}\n {actionsNode}\n </div>\n );\n};\n\nexport default SidebarNavItem;\n"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
/* empty css */
|
|
3
3
|
//#region src/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.ts
|
|
4
|
-
var e = "_1nm2b9q0 txvbqb9jg txvbqbcp txvbqbany txvbqb7d txvbqb6x txvbqb7k txvbqbaj7 txvbqbvbl txvbqbtvp txvbqb2k", t = "_1nm2b9q1 txvbqbvcf txvbqbtvy txvbqb2l", n = "_1nm2b9q4 _1nm2b9q2 txvbqbnw7 txvbqbojg txvbqbpry txvbqbmjp txvbqb9ip txvbqbcp txvbqbao7 txvbqb1rp txvbqb8y txvbqb77 txvbqb6x txvbqb7k txvbqbv txvbqbva1 _1nm2b9q3 txvbqbw41 txvbqbwm4", r = "_1nm2b9q5 txvbqbnvy txvbqboj7 txvbqbdoy", i = "_1nm2b9q6 txvbqbnvy txvbqboj7 txvbqbpry txvbqbmjp txvbqb1rg", a = "_1nm2b9q7 txvbqbamp txvbqbv3t txvbqbv9z txvbqb8t7", o = "_1nm2b9q9 _1nm2b9q8 txvbqbva3 txvbqbr", s = "_1nm2b9qa txvbqb9ip txvbqbcp txvbqbao7 txvbqb9my txvbqbk5y txvbqb3b txvbqbv0t txvbqb12g txvbqb1py txvbqblag txvbqbt6p txvbqbv67 txvbqb1p",
|
|
4
|
+
var e = "_1nm2b9q0 txvbqb9jg txvbqbcp txvbqbany txvbqb7d txvbqb6x txvbqb7k txvbqbaj7 txvbqbvbl txvbqbtvp txvbqb2k", t = "_1nm2b9q1 txvbqbvcf txvbqbtvy txvbqb2l", n = "_1nm2b9q4 _1nm2b9q2 txvbqbnw7 txvbqbojg txvbqbpry txvbqbmjp txvbqb9ip txvbqbcp txvbqbao7 txvbqb1rp txvbqb8y txvbqb77 txvbqb6x txvbqb7k txvbqbv txvbqbva1 _1nm2b9q3 txvbqbw41 txvbqbwm4", r = "_1nm2b9q5 txvbqbnvy txvbqboj7 txvbqbdoy", i = "_1nm2b9q6 txvbqbnvy txvbqboj7 txvbqbpry txvbqbmjp txvbqb1rg", a = "_1nm2b9q7 txvbqbamp txvbqbv3t txvbqbv9z txvbqb8t7", o = "_1nm2b9q9 _1nm2b9q8 txvbqbva3 txvbqbr", s = "_1nm2b9qa txvbqbvc1 txvbqbj", c = "_1nm2b9qb txvbqb9ip txvbqbcp txvbqbao7 txvbqb9my txvbqbk5y txvbqb3b txvbqbv0t txvbqb12g txvbqb1py txvbqblag txvbqbt6p txvbqbv67 txvbqb1p", l = "_1nm2b9qc txvbqb9jg txvbqbcp", u = "_1nm2b9qf _1nm2b9qd txvbqb9jg txvbqbcp txvbqbdoy txvbqbtxp txvbqbc6p txvbqb1rg txvbqb12g txvbqb1py txvbqblag txvbqbv0t txvbqbva1 txvbqbi _1nm2b9qe txvbqbw41 txvbqbwm4", d = "_1nm2b9qg txvbqb9jg txvbqbcp txvbqbdoy txvbqbtxp txvbqbc6p txvbqbaj7 txvbqbv67", f = "_1nm2b9qh txvbqbtxg txvbqbc6g", p = "_1nm2b9qi txvbqb9my txvbqbk5y", m = "_1nm2b9qj txvbqb9hy", h = "_1nm2b9qk txvbqb9jg txvbqbcp txvbqbdoy txvbqbaj7", g = "_1nm2b9ql txvbqb9hy";
|
|
5
5
|
//#endregion
|
|
6
|
-
export {
|
|
6
|
+
export { l as actionSlot, e as actions, t as actionsVisible, h as badge, g as badgeCollapsed, u as dragHandle, d as icon, f as iconNested, n as item, a as itemActive, r as itemCollapsed, o as itemDisabled, s as itemDragging, i as itemNested, p as label, m as labelCollapsed, c as link };
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=sidebarNavItem.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebarNavItem.css.js","names":[],"sources":["../../../../../src/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { sprinkles, stateSprinkles } from '../../../theme/sprinkles.css.js';\nimport { vars } from '../../../theme/themeContract.js';\n\nconst inlineFlex = 'inline-flex';\n\nexport const actions = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n gap: 1,\n transitionProperty: 'opacity',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n flexShrink: 0,\n opacity: 0,\n visibility: 'hidden',\n pointerEvents: 'none',\n});\n\nexport const actionsVisible = sprinkles({\n opacity: 100,\n visibility: 'visible',\n pointerEvents: 'auto',\n});\n\nexport const item = style([\n sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n paddingY: 1.5,\n paddingX: 3,\n borderRadius: 'lg',\n fontSize: 'sm',\n transitionProperty: 'default',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n cursor: 'pointer',\n color: 'textSecondary',\n }),\n stateSprinkles({\n backgroundColor: {\n hover: 'surfaceMuted',\n },\n color: {\n hover: 'text',\n },\n }),\n {\n selectors: {\n '&:has(:focus-visible)': {\n outline: `2px solid ${vars.colors.primary}`,\n outlineOffset: '2px',\n },\n },\n },\n]);\n\nexport const itemCollapsed = sprinkles({\n justifyContent: 'center',\n paddingX: 2,\n});\n\nexport const itemNested = sprinkles({\n paddingX: 2,\n paddingY: 1.5,\n borderRadius: 'md',\n});\n\nexport const itemActive = sprinkles({\n fontWeight: 'semibold',\n backgroundColor: 'primaryLight',\n color: 'text',\n boxShadow: 'primaryLightRing',\n});\n\nexport const itemDisabled = style([\n sprinkles({\n color: 'textMuted',\n cursor: 'not-allowed',\n }),\n {\n selectors: {\n '&:hover': {\n backgroundColor: 'transparent',\n },\n },\n },\n]);\n\nexport const link = sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n flex: 1,\n minWidth: 0,\n textDecoration: 'none',\n backgroundColor: 'transparent',\n borderWidth: 0,\n borderStyle: 'none',\n padding: 0,\n textAlign: 'left',\n color: 'inherit',\n font: 'inherit',\n});\n\nexport const actionSlot = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n});\n\nexport const dragHandle = style([\n sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n justifyContent: 'center',\n width: 6,\n height: 6,\n borderRadius: 'md',\n borderWidth: 0,\n borderStyle: 'none',\n padding: 0,\n backgroundColor: 'transparent',\n color: 'textSecondary',\n cursor: 'grab',\n }),\n stateSprinkles({\n backgroundColor: {\n hover: 'surfaceMuted',\n },\n color: {\n hover: 'text',\n },\n }),\n {\n selectors: {\n '&:active': {\n cursor: 'grabbing',\n },\n '&:focus-visible': {\n outline: `2px solid ${vars.colors.primary}`,\n outlineOffset: '2px',\n },\n },\n },\n]);\n\nexport const icon = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n justifyContent: 'center',\n width: 6,\n height: 6,\n flexShrink: 0,\n color: 'inherit',\n});\n\nexport const iconNested = sprinkles({\n width: 5,\n height: 5,\n});\n\nexport const label = sprinkles({\n flex: 1,\n minWidth: 0,\n});\n\nexport const labelCollapsed = sprinkles({\n display: 'none',\n});\n\nexport const badge = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n});\n\nexport const badgeCollapsed = sprinkles({\n display: 'none',\n});\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"sidebarNavItem.css.js","names":[],"sources":["../../../../../src/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { sprinkles, stateSprinkles } from '../../../theme/sprinkles.css.js';\nimport { vars } from '../../../theme/themeContract.js';\n\nconst inlineFlex = 'inline-flex';\n\nexport const actions = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n gap: 1,\n transitionProperty: 'opacity',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n flexShrink: 0,\n opacity: 0,\n visibility: 'hidden',\n pointerEvents: 'none',\n});\n\nexport const actionsVisible = sprinkles({\n opacity: 100,\n visibility: 'visible',\n pointerEvents: 'auto',\n});\n\nexport const item = style([\n sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n paddingY: 1.5,\n paddingX: 3,\n borderRadius: 'lg',\n fontSize: 'sm',\n transitionProperty: 'default',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n cursor: 'pointer',\n color: 'textSecondary',\n }),\n stateSprinkles({\n backgroundColor: {\n hover: 'surfaceMuted',\n },\n color: {\n hover: 'text',\n },\n }),\n {\n selectors: {\n '&:has(:focus-visible)': {\n outline: `2px solid ${vars.colors.primary}`,\n outlineOffset: '2px',\n },\n },\n },\n]);\n\nexport const itemCollapsed = sprinkles({\n justifyContent: 'center',\n paddingX: 2,\n});\n\nexport const itemNested = sprinkles({\n paddingX: 2,\n paddingY: 1.5,\n borderRadius: 'md',\n});\n\nexport const itemActive = sprinkles({\n fontWeight: 'semibold',\n backgroundColor: 'primaryLight',\n color: 'text',\n boxShadow: 'primaryLightRing',\n});\n\nexport const itemDisabled = style([\n sprinkles({\n color: 'textMuted',\n cursor: 'not-allowed',\n }),\n {\n selectors: {\n '&:hover': {\n backgroundColor: 'transparent',\n },\n },\n },\n]);\n\nexport const itemDragging = sprinkles({\n opacity: 50,\n cursor: 'grabbing',\n});\n\nexport const link = sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n flex: 1,\n minWidth: 0,\n textDecoration: 'none',\n backgroundColor: 'transparent',\n borderWidth: 0,\n borderStyle: 'none',\n padding: 0,\n textAlign: 'left',\n color: 'inherit',\n font: 'inherit',\n});\n\nexport const actionSlot = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n});\n\nexport const dragHandle = style([\n sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n justifyContent: 'center',\n width: 6,\n height: 6,\n borderRadius: 'md',\n borderWidth: 0,\n borderStyle: 'none',\n padding: 0,\n backgroundColor: 'transparent',\n color: 'textSecondary',\n cursor: 'grab',\n }),\n stateSprinkles({\n backgroundColor: {\n hover: 'surfaceMuted',\n },\n color: {\n hover: 'text',\n },\n }),\n {\n selectors: {\n '&:active': {\n cursor: 'grabbing',\n },\n '&:focus-visible': {\n outline: `2px solid ${vars.colors.primary}`,\n outlineOffset: '2px',\n },\n },\n },\n]);\n\nexport const icon = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n justifyContent: 'center',\n width: 6,\n height: 6,\n flexShrink: 0,\n color: 'inherit',\n});\n\nexport const iconNested = sprinkles({\n width: 5,\n height: 5,\n});\n\nexport const label = sprinkles({\n flex: 1,\n minWidth: 0,\n});\n\nexport const labelCollapsed = sprinkles({\n display: 'none',\n});\n\nexport const badge = sprinkles({\n display: inlineFlex,\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n});\n\nexport const badgeCollapsed = sprinkles({\n display: 'none',\n});\n"],"mappings":""}
|
|
@@ -1,91 +1,188 @@
|
|
|
1
1
|
import { cx as e } from "../../../theme/tools.js";
|
|
2
2
|
import { ChevronDownSvg as t } from "../../../icons/ChevronDownSvg.js";
|
|
3
3
|
import { SidebarNavItem as n } from "../sidebar_nav_item/SidebarNavItem.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { CSS as r } from "../../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
|
|
5
|
+
import { DndContext as i, DragOverlay as a, KeyboardSensor as o, PointerSensor as s, TouchSensor as c, closestCenter as ee, useSensor as l, useSensors as u } from "../../../node_modules/@dnd-kit/core/dist/core.esm.js";
|
|
6
|
+
import { SortableContext as d, sortableKeyboardCoordinates as f, useSortable as p, verticalListSortingStrategy as m } from "../../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
|
|
7
|
+
import { header as h, headerButton as g, headerButtonSidebarCollapsed as _, headerSidebarCollapsed as te, items as v, itemsNested as y, section as ne, sortableItem as b, sortableItemDragging as x, title as re, titleContent as S, titleIcon as ie, titleSidebarCollapsed as ae, toggleIcon as oe, toggleIconCollapsed as se } from "./sidebarNavSection.css.js";
|
|
8
|
+
import { useCallback as C, useId as w, useMemo as T, useState as E } from "react";
|
|
9
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
10
|
+
import { useTranslation as ce } from "react-i18next";
|
|
7
11
|
//#region src/backoffice/molecules/sidebar_nav_section/SidebarNavSection.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
var le = ({ item: t, isNested: i, sidebarCollapsed: a, dragHandleLabel: o, insertionPlacement: s }) => {
|
|
13
|
+
let { id: c, data: ee, ...l } = t, { attributes: u, listeners: d, setNodeRef: f, transform: m, transition: h, isDragging: g } = p({
|
|
14
|
+
id: c,
|
|
15
|
+
disabled: a
|
|
16
|
+
});
|
|
17
|
+
return /* @__PURE__ */ O("div", {
|
|
18
|
+
ref: f,
|
|
19
|
+
style: {
|
|
20
|
+
transform: r.Transform.toString(m),
|
|
21
|
+
transition: h
|
|
22
|
+
},
|
|
23
|
+
className: e(b, { [x]: g }),
|
|
24
|
+
children: [
|
|
25
|
+
s === "before" && /* @__PURE__ */ D("span", {
|
|
26
|
+
className: "_1rp5mg6k _1rp5mg6j txvbqbijg txvbqbglp txvbqb9i7 txvbqb1t7 txvbqbv3r",
|
|
27
|
+
"aria-hidden": "true"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ D(n, {
|
|
30
|
+
...l,
|
|
31
|
+
collapsed: a,
|
|
32
|
+
nested: i,
|
|
33
|
+
dragHandleLabel: l.dragHandleLabel ?? o,
|
|
34
|
+
dragHandleProps: {
|
|
35
|
+
...u,
|
|
36
|
+
...d
|
|
37
|
+
},
|
|
38
|
+
isDragging: g
|
|
39
|
+
}),
|
|
40
|
+
s === "after" && /* @__PURE__ */ D("span", {
|
|
41
|
+
className: "_1rp5mg6k _1rp5mg6j txvbqbijg txvbqbglp txvbqb9i7 txvbqb1t7 txvbqbv3r",
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}, k = ({ title: r, icon: p, items: b, collapsible: x = !1, isCollapsed: k, defaultCollapsed: ue = !1, onCollapsedChange: A, collapsed: j = !1, reorder: M, className: de }) => {
|
|
47
|
+
let [fe, pe] = E(ue), N = w(), P = w(), { t: F } = ce("ui", { useSuspense: !1 }), [I, L] = E(null), [R, z] = E(null), B = k ?? fe, V = x, me = C(() => {
|
|
48
|
+
if (!V) return;
|
|
49
|
+
let e = !B;
|
|
50
|
+
k ?? pe(e), A?.(e);
|
|
13
51
|
}, [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
]),
|
|
19
|
-
typeof
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
className:
|
|
52
|
+
V,
|
|
53
|
+
B,
|
|
54
|
+
k,
|
|
55
|
+
A
|
|
56
|
+
]), H;
|
|
57
|
+
typeof r == "string" && (H = r);
|
|
58
|
+
let U = e(re, { [ae]: j }), he = e(oe, { [se]: B }), W;
|
|
59
|
+
j && (W = H);
|
|
60
|
+
let G = null;
|
|
61
|
+
p != null && (G = /* @__PURE__ */ D("span", {
|
|
62
|
+
className: ie,
|
|
25
63
|
"aria-hidden": "true",
|
|
26
|
-
children:
|
|
64
|
+
children: p
|
|
27
65
|
}));
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
|
|
66
|
+
let ge = M?.enabled === !0 && b.length > 1, K = T(() => b.map((e) => e.id), [b]), _e = u(l(s, { activationConstraint: { distance: 4 } }), l(c, { activationConstraint: {
|
|
67
|
+
delay: 180,
|
|
68
|
+
tolerance: 5
|
|
69
|
+
} }), l(o, { coordinateGetter: f })), q = C(() => {
|
|
70
|
+
L(null), z(null);
|
|
71
|
+
}, []), ve = C((e) => {
|
|
72
|
+
L(e.active.id), z(e.active.id);
|
|
73
|
+
}, []), ye = C((e) => {
|
|
74
|
+
let t = b.find((t) => t.id === String(e.active.id)) ?? null, n = null;
|
|
75
|
+
e.over != null && (n = b.find((t) => t.id === String(e.over?.id)) ?? null);
|
|
76
|
+
let r = t?.data?.id ?? String(e.active.id), i = null;
|
|
77
|
+
n != null && (i = n.data?.id ?? String(e.over?.id)), q(), !(i == null || r === i) && M?.onReorder(r, i);
|
|
78
|
+
}, [
|
|
79
|
+
b,
|
|
80
|
+
M,
|
|
81
|
+
q
|
|
82
|
+
]), J = T(() => I == null ? null : b.find((e) => e.id === String(I)) ?? null, [I, b]), Y = null, X = "before";
|
|
83
|
+
if (I != null && R != null && I !== R) {
|
|
84
|
+
let e = K.indexOf(String(I)), t = K.indexOf(String(R));
|
|
85
|
+
e !== -1 && t !== -1 && (Y = String(R), e < t && (X = "after"));
|
|
86
|
+
}
|
|
87
|
+
let be = F("navigation.sidebar.reorder.handle"), xe = F("navigation.sidebar.reorder.instructions"), Z = null;
|
|
88
|
+
r != null && (Z = V ? /* @__PURE__ */ O("button", {
|
|
89
|
+
id: P,
|
|
31
90
|
type: "button",
|
|
32
|
-
className: e(
|
|
33
|
-
onClick:
|
|
34
|
-
"aria-expanded": !
|
|
35
|
-
"aria-controls":
|
|
36
|
-
"aria-label":
|
|
37
|
-
title:
|
|
38
|
-
children: [/* @__PURE__ */
|
|
39
|
-
className:
|
|
40
|
-
children: [
|
|
41
|
-
className:
|
|
42
|
-
children:
|
|
91
|
+
className: e(g, { [_]: j }),
|
|
92
|
+
onClick: me,
|
|
93
|
+
"aria-expanded": !B,
|
|
94
|
+
"aria-controls": N,
|
|
95
|
+
"aria-label": W,
|
|
96
|
+
title: W,
|
|
97
|
+
children: [/* @__PURE__ */ O("span", {
|
|
98
|
+
className: S,
|
|
99
|
+
children: [G, /* @__PURE__ */ D("span", {
|
|
100
|
+
className: U,
|
|
101
|
+
children: r
|
|
43
102
|
})]
|
|
44
|
-
}), !
|
|
45
|
-
className:
|
|
103
|
+
}), !j && /* @__PURE__ */ D("span", {
|
|
104
|
+
className: he,
|
|
46
105
|
"aria-hidden": "true",
|
|
47
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ D(t, {
|
|
48
107
|
width: 18,
|
|
49
108
|
height: 18
|
|
50
109
|
})
|
|
51
110
|
})]
|
|
52
|
-
}) : /* @__PURE__ */
|
|
53
|
-
className: e(
|
|
54
|
-
title:
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
className:
|
|
57
|
-
id:
|
|
58
|
-
children: [
|
|
59
|
-
className:
|
|
60
|
-
children:
|
|
111
|
+
}) : /* @__PURE__ */ D("div", {
|
|
112
|
+
className: e(h, { [te]: j }),
|
|
113
|
+
title: W,
|
|
114
|
+
children: /* @__PURE__ */ O("div", {
|
|
115
|
+
className: S,
|
|
116
|
+
id: P,
|
|
117
|
+
children: [G, /* @__PURE__ */ D("span", {
|
|
118
|
+
className: U,
|
|
119
|
+
children: r
|
|
61
120
|
})]
|
|
62
121
|
})
|
|
63
122
|
}));
|
|
64
|
-
let
|
|
65
|
-
if (!
|
|
66
|
-
let t =
|
|
67
|
-
|
|
68
|
-
className: e(
|
|
69
|
-
id:
|
|
123
|
+
let Q = null;
|
|
124
|
+
if (!B) {
|
|
125
|
+
let t = r != null && !j;
|
|
126
|
+
Q = /* @__PURE__ */ D("div", {
|
|
127
|
+
className: e(v, { [y]: t }),
|
|
128
|
+
id: N,
|
|
70
129
|
role: "list",
|
|
71
|
-
children:
|
|
130
|
+
children: b.map((e) => {
|
|
72
131
|
let { id: r, data: i, ...a } = e;
|
|
73
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ D(n, {
|
|
74
133
|
...a,
|
|
75
|
-
collapsed:
|
|
134
|
+
collapsed: j,
|
|
76
135
|
nested: t
|
|
77
136
|
}, r);
|
|
78
137
|
})
|
|
79
|
-
})
|
|
138
|
+
}), ge && !j && (Q = /* @__PURE__ */ O(i, {
|
|
139
|
+
accessibility: { screenReaderInstructions: { draggable: xe } },
|
|
140
|
+
collisionDetection: ee,
|
|
141
|
+
sensors: _e,
|
|
142
|
+
onDragStart: ve,
|
|
143
|
+
onDragOver: (e) => {
|
|
144
|
+
z(e.over?.id ?? null);
|
|
145
|
+
},
|
|
146
|
+
onDragCancel: q,
|
|
147
|
+
onDragEnd: ye,
|
|
148
|
+
children: [/* @__PURE__ */ D(d, {
|
|
149
|
+
items: K,
|
|
150
|
+
strategy: m,
|
|
151
|
+
children: /* @__PURE__ */ D("div", {
|
|
152
|
+
className: e(v, { [y]: t }),
|
|
153
|
+
id: N,
|
|
154
|
+
role: "list",
|
|
155
|
+
children: b.map((e) => {
|
|
156
|
+
let n;
|
|
157
|
+
return e.id === Y && (n = X), /* @__PURE__ */ D(le, {
|
|
158
|
+
item: e,
|
|
159
|
+
isNested: t,
|
|
160
|
+
sidebarCollapsed: j,
|
|
161
|
+
dragHandleLabel: be,
|
|
162
|
+
insertionPlacement: n
|
|
163
|
+
}, e.id);
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
}), /* @__PURE__ */ D(a, { children: J != null && /* @__PURE__ */ O("div", {
|
|
167
|
+
className: "_1rp5mg6m _1rp5mg6l txvbqbnw7 txvbqbojg txvbqbpry txvbqbmjp txvbqb9ip txvbqbcp txvbqbao7 txvbqb1rp txvbqb8y txvbqbamp txvbqbv41 txvbqbv9z txvbqb1cp txvbqbwg txvbqb8q7",
|
|
168
|
+
children: [J.icon != null && /* @__PURE__ */ D("span", {
|
|
169
|
+
className: "_1rp5mg6n txvbqb9jg txvbqbcp txvbqbdoy txvbqbtxp txvbqbc6p txvbqbaj7",
|
|
170
|
+
children: J.icon
|
|
171
|
+
}), /* @__PURE__ */ D("span", {
|
|
172
|
+
className: "_1rp5mg6p _1rp5mg6o txvbqbk5y",
|
|
173
|
+
children: J.label
|
|
174
|
+
})]
|
|
175
|
+
}) })]
|
|
176
|
+
}));
|
|
80
177
|
}
|
|
81
|
-
let
|
|
82
|
-
return
|
|
83
|
-
className: e(
|
|
84
|
-
"aria-labelledby":
|
|
85
|
-
children: [
|
|
178
|
+
let $;
|
|
179
|
+
return r != null && ($ = P), /* @__PURE__ */ O("section", {
|
|
180
|
+
className: e(ne, de),
|
|
181
|
+
"aria-labelledby": $,
|
|
182
|
+
children: [Z, Q]
|
|
86
183
|
});
|
|
87
184
|
};
|
|
88
185
|
//#endregion
|
|
89
|
-
export {
|
|
186
|
+
export { k as SidebarNavSection, k as default };
|
|
90
187
|
|
|
91
188
|
//# sourceMappingURL=SidebarNavSection.js.map
|