@plumile/ui 0.1.62 → 0.1.64
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/lib/esm/atomic/molecules/markdown/components/MarkdownArticleContainer.css.js +1 -0
- package/lib/esm/atomic/molecules/markdown/components/MarkdownDelete.css.js +0 -1
- package/lib/esm/atomic/organisms/sidebar/NavigationSidebar.js +191 -0
- package/lib/esm/atomic/organisms/sidebar/NavigationSidebar.js.map +1 -0
- package/lib/esm/atomic/organisms/sidebar/Sidebar.js +2 -0
- package/lib/esm/atomic/organisms/sidebar/SidebarContainer.js +29 -0
- package/lib/esm/atomic/organisms/sidebar/SidebarContainer.js.map +1 -0
- package/lib/esm/atomic/organisms/sidebar/icons.js +67 -0
- package/lib/esm/atomic/organisms/sidebar/icons.js.map +1 -0
- package/lib/esm/atomic/organisms/sidebar/navigationSidebar.css.js +49 -0
- package/lib/esm/atomic/organisms/sidebar/navigationSidebar.css.js.map +1 -0
- package/lib/esm/atomic/organisms/sidebar/sidebar.css.js +17 -0
- package/lib/esm/atomic/organisms/sidebar/sidebar.css.js.map +1 -0
- package/lib/esm/atomic/organisms/sidebar/useSidebarShell.js +0 -0
- package/lib/esm/backoffice/molecules/confirm_dialog/ConfirmDialog.js +62 -0
- package/lib/esm/backoffice/molecules/confirm_dialog/ConfirmDialog.js.map +1 -0
- package/lib/esm/backoffice/molecules/confirm_dialog/confirmDialog.css.js +8 -0
- package/lib/esm/backoffice/molecules/confirm_dialog/confirmDialog.css.js.map +1 -0
- package/lib/esm/backoffice/molecules/global_search_input/GlobalSearchInput.js +4 -4
- package/lib/esm/backoffice/molecules/sidebar_collapse_toggle/SidebarCollapseToggle.js +6 -6
- package/lib/esm/backoffice/organisms/audit_timeline/AuditTimeline.js +52 -0
- package/lib/esm/backoffice/organisms/audit_timeline/AuditTimeline.js.map +1 -0
- package/lib/esm/backoffice/organisms/audit_timeline/auditTimeline.css.js +8 -0
- package/lib/esm/backoffice/organisms/audit_timeline/auditTimeline.css.js.map +1 -0
- package/lib/esm/backoffice/templates/settings_template/SettingsTemplate.js +18 -0
- package/lib/esm/backoffice/templates/settings_template/SettingsTemplate.js.map +1 -0
- package/lib/esm/backoffice/templates/settings_template/settingsTemplate.css.js +8 -0
- package/lib/esm/backoffice/templates/settings_template/settingsTemplate.css.js.map +1 -0
- package/lib/esm/backoffice/templates/split_view_template/SplitViewTemplate.js +18 -0
- package/lib/esm/backoffice/templates/split_view_template/SplitViewTemplate.js.map +1 -0
- package/lib/esm/backoffice/templates/split_view_template/splitViewTemplate.css.js +8 -0
- package/lib/esm/backoffice/templates/split_view_template/splitViewTemplate.css.js.map +1 -0
- package/lib/esm/index.js +102 -94
- package/lib/esm/style.css +1 -1
- package/lib/types/atomic/organisms/sidebar/NavigationSidebar.d.ts +37 -0
- package/lib/types/atomic/organisms/sidebar/NavigationSidebar.d.ts.map +1 -0
- package/lib/types/atomic/organisms/sidebar/Sidebar.d.ts +3 -0
- package/lib/types/atomic/organisms/sidebar/Sidebar.d.ts.map +1 -0
- package/lib/types/atomic/organisms/sidebar/SidebarContainer.d.ts +11 -0
- package/lib/types/atomic/organisms/sidebar/SidebarContainer.d.ts.map +1 -0
- package/lib/types/atomic/organisms/sidebar/icons.d.ts +19 -0
- package/lib/types/atomic/organisms/sidebar/icons.d.ts.map +1 -0
- package/lib/types/atomic/organisms/sidebar/navigationSidebar.css.d.ts +70 -0
- package/lib/types/atomic/organisms/sidebar/navigationSidebar.css.d.ts.map +1 -0
- package/lib/types/atomic/organisms/sidebar/sidebar.css.d.ts +26 -0
- package/lib/types/atomic/organisms/sidebar/sidebar.css.d.ts.map +1 -0
- package/lib/types/atomic/organisms/sidebar/useSidebarShell.d.ts +2 -0
- package/lib/types/atomic/organisms/sidebar/useSidebarShell.d.ts.map +1 -0
- package/lib/types/backoffice/molecules/confirm_dialog/ConfirmDialog.d.ts +15 -0
- package/lib/types/backoffice/molecules/confirm_dialog/ConfirmDialog.d.ts.map +1 -0
- package/lib/types/backoffice/molecules/confirm_dialog/confirmDialog.css.d.ts +3 -0
- package/lib/types/backoffice/molecules/confirm_dialog/confirmDialog.css.d.ts.map +1 -0
- package/lib/types/backoffice/organisms/audit_timeline/AuditTimeline.d.ts +17 -0
- package/lib/types/backoffice/organisms/audit_timeline/AuditTimeline.d.ts.map +1 -0
- package/lib/types/backoffice/organisms/audit_timeline/auditTimeline.css.d.ts +12 -0
- package/lib/types/backoffice/organisms/audit_timeline/auditTimeline.css.d.ts.map +1 -0
- package/lib/types/backoffice/templates/settings_template/SettingsTemplate.d.ts +11 -0
- package/lib/types/backoffice/templates/settings_template/SettingsTemplate.d.ts.map +1 -0
- package/lib/types/backoffice/templates/settings_template/settingsTemplate.css.d.ts +4 -0
- package/lib/types/backoffice/templates/settings_template/settingsTemplate.css.d.ts.map +1 -0
- package/lib/types/backoffice/templates/split_view_template/SplitViewTemplate.d.ts +11 -0
- package/lib/types/backoffice/templates/split_view_template/SplitViewTemplate.d.ts.map +1 -0
- package/lib/types/backoffice/templates/split_view_template/splitViewTemplate.css.d.ts +3 -0
- package/lib/types/backoffice/templates/split_view_template/splitViewTemplate.css.d.ts.map +1 -0
- package/lib/types/index.d.ts +8 -0
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/i18n/locales/en/ui.json +7 -0
- package/src/i18n/locales/fr/ui.json +7 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { cx as e } from "../../../theme/tools.js";
|
|
2
|
+
import { useUiTranslation as t } from "../../../i18n/useUiTranslation.js";
|
|
3
|
+
import { SidebarContainer as n } from "./SidebarContainer.js";
|
|
4
|
+
import { ChevronLeftIcon as r, ChevronRightIcon as i } from "./icons.js";
|
|
5
|
+
import { childIcon as a, childLabel as o, childLinkRecipe as s, collapseButton as c, collapseButtonLabel as l, collapseButtonStateRecipe as u, collapsibleContent as d, collapsibleItem as f, collapsibleSection as p, collapsibleStateRecipe as m, iconBaseLayer as h, iconHiddenOnHover as g, iconVisibleOnHover as _, iconWrapper as v, itemWrapper as y, label as b, navButton as x, navGapRecipe as ee, navLinkRecipe as S, navWithTrailingAction as C, trailingActionButton as w, trailingActionIconHidden as T, trailingActionIconVisible as E, trailingActionIconWrapper as D, trailingIconWrapper as te } from "./navigationSidebar.css.js";
|
|
6
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback as j, useMemo as M, useState as N } from "react";
|
|
8
|
+
import { Link as P, useLocation as F } from "@plumile/router";
|
|
9
|
+
//#region src/atomic/organisms/sidebar/NavigationSidebar.tsx
|
|
10
|
+
var I = ({ id: t, isExpanded: n, children: r }) => {
|
|
11
|
+
let i = "collapsed";
|
|
12
|
+
return n && (i = "expanded"), /* @__PURE__ */ k("div", {
|
|
13
|
+
id: t,
|
|
14
|
+
"aria-hidden": !n,
|
|
15
|
+
className: e(p, m({ state: i })),
|
|
16
|
+
children: /* @__PURE__ */ k("div", {
|
|
17
|
+
className: d,
|
|
18
|
+
children: r
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}, L = ({ items: d, headerSlot: p, isCollapsed: m, onCollapsedChange: L, showCollapseToggle: R = !0 }) => {
|
|
22
|
+
let { t: z } = t(), [B, V] = N(!1), [H, U] = N({}), W = m != null, G = m ?? B, { pathname: K } = F(), q = (e, t) => t === !0 ? K === e : K === e ? !0 : K.startsWith(`${e}/`), J = j((e, t) => {
|
|
23
|
+
U((n) => ({
|
|
24
|
+
...n,
|
|
25
|
+
[e]: t
|
|
26
|
+
}));
|
|
27
|
+
}, []), Y = j(() => {
|
|
28
|
+
let e = !G;
|
|
29
|
+
W || V(e), L?.(e);
|
|
30
|
+
}, [
|
|
31
|
+
G,
|
|
32
|
+
W,
|
|
33
|
+
L
|
|
34
|
+
]), X;
|
|
35
|
+
G || (X = p ?? void 0);
|
|
36
|
+
let Z = M(() => {
|
|
37
|
+
if (!R) return null;
|
|
38
|
+
let t = r, n = z("navigation.sidebar.actions.collapseAriaLabel");
|
|
39
|
+
G && (t = i, n = z("navigation.sidebar.actions.expandAriaLabel"));
|
|
40
|
+
let a = "expanded";
|
|
41
|
+
G && (a = "collapsed");
|
|
42
|
+
let o = null;
|
|
43
|
+
return G || (o = /* @__PURE__ */ k("span", {
|
|
44
|
+
className: l,
|
|
45
|
+
children: z("navigation.sidebar.actions.collapse")
|
|
46
|
+
})), /* @__PURE__ */ A("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
onClick: Y,
|
|
49
|
+
className: e(c, u({ state: a })),
|
|
50
|
+
"aria-label": n,
|
|
51
|
+
children: [/* @__PURE__ */ k(t, { size: 20 }), o]
|
|
52
|
+
});
|
|
53
|
+
}, [
|
|
54
|
+
Y,
|
|
55
|
+
G,
|
|
56
|
+
R,
|
|
57
|
+
z
|
|
58
|
+
]);
|
|
59
|
+
return /* @__PURE__ */ k(n, {
|
|
60
|
+
headerSlot: X,
|
|
61
|
+
footerSlot: Z,
|
|
62
|
+
isCollapsed: G,
|
|
63
|
+
showDefaultHeaderAction: !1,
|
|
64
|
+
children: d.map((t) => {
|
|
65
|
+
let n = t.childItems ?? null, r = n != null && n.length > 0, i = H[t.key] ?? t.defaultExpanded ?? !1, c = !i, l, u = !G && r;
|
|
66
|
+
u && (l = `navigation-sidebar-${t.key}-children`), r && n.some((e) => q(e.to)) && (i = !0);
|
|
67
|
+
let d = null;
|
|
68
|
+
!G && t.trailingAction != null && (d = t.trailingAction);
|
|
69
|
+
let p = d != null, m = t.hoverIcon !== void 0 && t.hoverIcon !== null, j = t.trailingIcon !== void 0 && t.trailingIcon !== null, M = t.trailingHoverIcon !== void 0 && t.trailingHoverIcon !== null, N = !G && !p && (j || M), F;
|
|
70
|
+
G && (F = t.label);
|
|
71
|
+
let L = "expanded";
|
|
72
|
+
G && (L = "collapsed");
|
|
73
|
+
let R = ee({ state: L }), z;
|
|
74
|
+
p && (z = C);
|
|
75
|
+
let B = null;
|
|
76
|
+
G || (B = /* @__PURE__ */ k("span", {
|
|
77
|
+
className: b,
|
|
78
|
+
children: t.label
|
|
79
|
+
}));
|
|
80
|
+
let V = null;
|
|
81
|
+
m && (V = /* @__PURE__ */ k("span", {
|
|
82
|
+
className: _,
|
|
83
|
+
children: t.hoverIcon
|
|
84
|
+
}));
|
|
85
|
+
let U = /* @__PURE__ */ A("span", {
|
|
86
|
+
className: v,
|
|
87
|
+
children: [/* @__PURE__ */ k("span", {
|
|
88
|
+
className: e(h, { [g]: m }),
|
|
89
|
+
children: t.icon
|
|
90
|
+
}), V]
|
|
91
|
+
}), W = null;
|
|
92
|
+
if (N) {
|
|
93
|
+
let n = null;
|
|
94
|
+
j && (n = /* @__PURE__ */ k("span", {
|
|
95
|
+
className: e(h, { [g]: M }),
|
|
96
|
+
children: t.trailingIcon
|
|
97
|
+
}));
|
|
98
|
+
let r = null;
|
|
99
|
+
M && (r = /* @__PURE__ */ k("span", {
|
|
100
|
+
className: _,
|
|
101
|
+
children: t.trailingHoverIcon
|
|
102
|
+
})), W = /* @__PURE__ */ A("span", {
|
|
103
|
+
className: te,
|
|
104
|
+
children: [n, r]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
let K = /* @__PURE__ */ A(O, { children: [
|
|
108
|
+
U,
|
|
109
|
+
B,
|
|
110
|
+
W
|
|
111
|
+
] }), Y = () => {
|
|
112
|
+
!r || G || J(t.key, c);
|
|
113
|
+
}, X;
|
|
114
|
+
if (r) X = e(x, R, z);
|
|
115
|
+
else {
|
|
116
|
+
let n = "default";
|
|
117
|
+
q(t.to, t.exact) && (n = "active"), X = e(S({ state: n }), R, z);
|
|
118
|
+
}
|
|
119
|
+
let Z;
|
|
120
|
+
Z = r ? /* @__PURE__ */ k("button", {
|
|
121
|
+
type: "button",
|
|
122
|
+
className: X,
|
|
123
|
+
"aria-expanded": i,
|
|
124
|
+
"aria-controls": l,
|
|
125
|
+
"aria-label": F,
|
|
126
|
+
onClick: Y,
|
|
127
|
+
children: K
|
|
128
|
+
}) : /* @__PURE__ */ k(P, {
|
|
129
|
+
to: t.to,
|
|
130
|
+
className: X,
|
|
131
|
+
exact: t.exact,
|
|
132
|
+
"aria-label": F,
|
|
133
|
+
children: K
|
|
134
|
+
});
|
|
135
|
+
let Q = null;
|
|
136
|
+
if (d != null) {
|
|
137
|
+
let e = (e) => {
|
|
138
|
+
e.preventDefault(), e.stopPropagation(), d.onClick();
|
|
139
|
+
}, t = d.hoverIcon, n = t != null, r = null;
|
|
140
|
+
n && (r = /* @__PURE__ */ k("span", {
|
|
141
|
+
className: E,
|
|
142
|
+
children: t
|
|
143
|
+
})), Q = /* @__PURE__ */ k("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
"aria-label": d.label,
|
|
146
|
+
onClick: e,
|
|
147
|
+
className: w,
|
|
148
|
+
children: /* @__PURE__ */ A("span", {
|
|
149
|
+
className: D,
|
|
150
|
+
children: [/* @__PURE__ */ k("span", {
|
|
151
|
+
className: T,
|
|
152
|
+
children: d.icon
|
|
153
|
+
}), r]
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
let $ = null;
|
|
158
|
+
return u && l != null && ($ = /* @__PURE__ */ k(I, {
|
|
159
|
+
id: l,
|
|
160
|
+
isExpanded: i,
|
|
161
|
+
children: n.map((e) => {
|
|
162
|
+
let t = null;
|
|
163
|
+
e.icon != null && (t = /* @__PURE__ */ k("span", {
|
|
164
|
+
className: a,
|
|
165
|
+
children: e.icon
|
|
166
|
+
}));
|
|
167
|
+
let n = "default";
|
|
168
|
+
return q(e.to) && (n = "active"), /* @__PURE__ */ k("div", {
|
|
169
|
+
className: f,
|
|
170
|
+
children: /* @__PURE__ */ A(P, {
|
|
171
|
+
to: e.to,
|
|
172
|
+
className: s({ state: n }),
|
|
173
|
+
"aria-label": e.label,
|
|
174
|
+
children: [t, /* @__PURE__ */ k("span", {
|
|
175
|
+
className: o,
|
|
176
|
+
children: e.label
|
|
177
|
+
})]
|
|
178
|
+
})
|
|
179
|
+
}, e.key);
|
|
180
|
+
})
|
|
181
|
+
})), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A("div", {
|
|
182
|
+
className: y,
|
|
183
|
+
children: [Z, Q]
|
|
184
|
+
}), $] }, t.key);
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
//#endregion
|
|
189
|
+
export { L as NavigationSidebar };
|
|
190
|
+
|
|
191
|
+
//# sourceMappingURL=NavigationSidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationSidebar.js","names":[],"sources":["../../../../../src/atomic/organisms/sidebar/NavigationSidebar.tsx"],"sourcesContent":["import {\n type JSX,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport { Link, useLocation } from '@plumile/router';\nimport type { RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { useUiTranslation } from '../../../i18n/useUiTranslation.js';\nimport { cx } from '../../../theme/tools.js';\nimport { ChevronLeftIcon, ChevronRightIcon } from './icons.js';\nimport * as styles from './navigationSidebar.css.js';\nimport { SidebarContainer } from './SidebarContainer.js';\n\ntype SidebarItemTrailingAction = {\n icon: ReactNode;\n hoverIcon?: ReactNode;\n label: string;\n onClick: () => void;\n};\n\ntype SidebarItem = {\n key: string;\n to: string;\n label: string;\n icon: ReactNode;\n exact?: boolean;\n hoverIcon?: ReactNode;\n trailingIcon?: ReactNode;\n trailingHoverIcon?: ReactNode;\n trailingAction?: SidebarItemTrailingAction;\n childItems?: SidebarChildItem[];\n defaultExpanded?: boolean;\n};\n\ntype SidebarChildItem = {\n key: string;\n to: string;\n label: string;\n icon?: ReactNode;\n};\n\ntype NavigationSidebarProps = {\n items: SidebarItem[];\n headerSlot?: ReactNode;\n isCollapsed?: boolean;\n onCollapsedChange?: (nextCollapsed: boolean) => void;\n showCollapseToggle?: boolean;\n};\n\nconst CollapsibleSection = ({\n id,\n isExpanded,\n children,\n}: {\n id: string;\n isExpanded: boolean;\n children: ReactNode;\n}): JSX.Element => {\n let collapsibleStateKey: NonNullable<\n NonNullable<RecipeVariants<typeof styles.collapsibleStateRecipe>>['state']\n > = 'collapsed';\n if (isExpanded) {\n collapsibleStateKey = 'expanded';\n }\n\n return (\n <div\n id={id}\n aria-hidden={!isExpanded}\n className={cx(\n styles.collapsibleSection,\n styles.collapsibleStateRecipe({ state: collapsibleStateKey }),\n )}\n >\n <div className={styles.collapsibleContent}>{children}</div>\n </div>\n );\n};\n\nconst NavigationSidebar = ({\n items,\n headerSlot,\n isCollapsed: isCollapsedProp,\n onCollapsedChange,\n showCollapseToggle = true,\n}: NavigationSidebarProps): JSX.Element => {\n const { t } = useUiTranslation();\n const [internalCollapsed, setInternalCollapsed] = useState(false);\n const [expandedState, setExpandedState] = useState<Record<string, boolean>>(\n {},\n );\n const isControlled = isCollapsedProp != null;\n const isCollapsed = isCollapsedProp ?? internalCollapsed;\n const { pathname } = useLocation();\n\n const isPathActive = (target: string, exact?: boolean): boolean => {\n if (exact === true) {\n return pathname === target;\n }\n if (pathname === target) {\n return true;\n }\n return pathname.startsWith(`${target}/`);\n };\n\n const handleToggle = useCallback((key: string, nextState: boolean) => {\n setExpandedState((prev) => {\n return {\n ...prev,\n [key]: nextState,\n };\n });\n }, []);\n\n const handleCollapseToggle = useCallback(() => {\n const nextState = !isCollapsed;\n if (!isControlled) {\n setInternalCollapsed(nextState);\n }\n onCollapsedChange?.(nextState);\n }, [isCollapsed, isControlled, onCollapsedChange]);\n\n let headerContent: ReactNode | undefined;\n if (!isCollapsed) {\n headerContent = headerSlot ?? undefined;\n }\n\n const collapseButton = useMemo(() => {\n if (!showCollapseToggle) {\n return null;\n }\n\n let CollapseIcon = ChevronLeftIcon;\n let buttonLabel = t('navigation.sidebar.actions.collapseAriaLabel');\n if (isCollapsed) {\n CollapseIcon = ChevronRightIcon;\n buttonLabel = t('navigation.sidebar.actions.expandAriaLabel');\n }\n\n let collapseState: NonNullable<\n NonNullable<\n RecipeVariants<typeof styles.collapseButtonStateRecipe>\n >['state']\n > = 'expanded';\n if (isCollapsed) {\n collapseState = 'collapsed';\n }\n\n let collapseLabel: JSX.Element | null = null;\n if (!isCollapsed) {\n collapseLabel = (\n <span className={styles.collapseButtonLabel}>\n {t('navigation.sidebar.actions.collapse')}\n </span>\n );\n }\n\n return (\n <button\n type=\"button\"\n onClick={handleCollapseToggle}\n className={cx(\n styles.collapseButton,\n styles.collapseButtonStateRecipe({ state: collapseState }),\n )}\n aria-label={buttonLabel}\n >\n <CollapseIcon size={20} />\n {collapseLabel}\n </button>\n );\n }, [handleCollapseToggle, isCollapsed, showCollapseToggle, t]);\n\n return (\n <SidebarContainer\n headerSlot={headerContent}\n footerSlot={collapseButton}\n isCollapsed={isCollapsed}\n showDefaultHeaderAction={false}\n >\n {items.map((item) => {\n const childItems = item.childItems ?? null;\n const hasChildren = childItems != null && childItems.length > 0;\n const storedExpanded = expandedState[item.key];\n let isExpanded = storedExpanded ?? item.defaultExpanded ?? false;\n const nextExpanded = !isExpanded;\n let childSectionId: string | undefined;\n const shouldRenderChildren = !isCollapsed && hasChildren;\n if (shouldRenderChildren) {\n childSectionId = `navigation-sidebar-${item.key}-children`;\n }\n\n if (hasChildren) {\n const hasActiveChild = childItems.some((child) => {\n return isPathActive(child.to);\n });\n\n if (hasActiveChild) {\n isExpanded = true;\n }\n }\n\n let trailingAction: SidebarItemTrailingAction | null = null;\n if (!isCollapsed && item.trailingAction != null) {\n trailingAction = item.trailingAction;\n }\n const showTrailingAction = trailingAction != null;\n const hasHoverIcon =\n item.hoverIcon !== undefined && item.hoverIcon !== null;\n const hasTrailingIcon =\n item.trailingIcon !== undefined && item.trailingIcon !== null;\n const hasTrailingHoverIcon =\n item.trailingHoverIcon !== undefined &&\n item.trailingHoverIcon !== null;\n const showTrailing =\n !isCollapsed &&\n !showTrailingAction &&\n (hasTrailingIcon || hasTrailingHoverIcon);\n\n let itemAriaLabel: string | undefined;\n if (isCollapsed) {\n itemAriaLabel = item.label;\n }\n\n let gapState: NonNullable<\n NonNullable<RecipeVariants<typeof styles.navGapRecipe>>['state']\n > = 'expanded';\n if (isCollapsed) {\n gapState = 'collapsed';\n }\n const gapClassName = styles.navGapRecipe({ state: gapState });\n\n let paddingClassName: string | undefined;\n if (showTrailingAction) {\n paddingClassName = styles.navWithTrailingAction;\n }\n\n let labelNode: JSX.Element | null = null;\n if (!isCollapsed) {\n labelNode = <span className={styles.label}>{item.label}</span>;\n }\n\n let hoverLayer: JSX.Element | null = null;\n if (hasHoverIcon) {\n hoverLayer = (\n <span className={styles.iconVisibleOnHover}>{item.hoverIcon}</span>\n );\n }\n\n const leadingIcon = (\n <span className={styles.iconWrapper}>\n <span\n className={cx(styles.iconBaseLayer, {\n [styles.iconHiddenOnHover]: hasHoverIcon,\n })}\n >\n {item.icon}\n </span>\n {hoverLayer}\n </span>\n );\n\n let trailingIcons: JSX.Element | null = null;\n if (showTrailing) {\n let trailingBaseLayer: JSX.Element | null = null;\n if (hasTrailingIcon) {\n trailingBaseLayer = (\n <span\n className={cx(styles.iconBaseLayer, {\n [styles.iconHiddenOnHover]: hasTrailingHoverIcon,\n })}\n >\n {item.trailingIcon}\n </span>\n );\n }\n\n let trailingHoverLayer: JSX.Element | null = null;\n if (hasTrailingHoverIcon) {\n trailingHoverLayer = (\n <span className={styles.iconVisibleOnHover}>\n {item.trailingHoverIcon}\n </span>\n );\n }\n\n trailingIcons = (\n <span className={styles.trailingIconWrapper}>\n {trailingBaseLayer}\n {trailingHoverLayer}\n </span>\n );\n }\n\n const commonContent = (\n <>\n {leadingIcon}\n {labelNode}\n {trailingIcons}\n </>\n );\n\n const handleClick = (): void => {\n if (!hasChildren || isCollapsed) {\n return;\n }\n handleToggle(item.key, nextExpanded);\n };\n\n let interactiveClassName: string;\n if (hasChildren) {\n interactiveClassName = cx(\n styles.navButton,\n gapClassName,\n paddingClassName,\n );\n } else {\n let navState: NonNullable<\n NonNullable<RecipeVariants<typeof styles.navLinkRecipe>>['state']\n > = 'default';\n if (isPathActive(item.to, item.exact)) {\n navState = 'active';\n }\n interactiveClassName = cx(\n styles.navLinkRecipe({ state: navState }),\n gapClassName,\n paddingClassName,\n );\n }\n\n let itemNode: JSX.Element;\n if (hasChildren) {\n itemNode = (\n <button\n type=\"button\"\n className={interactiveClassName}\n aria-expanded={isExpanded}\n aria-controls={childSectionId}\n aria-label={itemAriaLabel}\n onClick={handleClick}\n >\n {commonContent}\n </button>\n );\n } else {\n itemNode = (\n <Link\n to={item.to}\n className={interactiveClassName}\n exact={item.exact}\n aria-label={itemAriaLabel}\n >\n {commonContent}\n </Link>\n );\n }\n\n let trailingActionNode: JSX.Element | null = null;\n if (trailingAction != null) {\n const handleTrailingClick = (\n event: MouseEvent<HTMLButtonElement>,\n ): void => {\n event.preventDefault();\n event.stopPropagation();\n trailingAction.onClick();\n };\n\n const trailingHoverIcon = trailingAction.hoverIcon;\n const showTrailingHoverIcon =\n trailingHoverIcon !== undefined && trailingHoverIcon !== null;\n let trailingHoverContent: JSX.Element | null = null;\n if (showTrailingHoverIcon) {\n trailingHoverContent = (\n <span className={styles.trailingActionIconVisible}>\n {trailingHoverIcon}\n </span>\n );\n }\n\n trailingActionNode = (\n <button\n type=\"button\"\n aria-label={trailingAction.label}\n onClick={handleTrailingClick}\n className={styles.trailingActionButton}\n >\n <span className={styles.trailingActionIconWrapper}>\n <span className={styles.trailingActionIconHidden}>\n {trailingAction.icon}\n </span>\n {trailingHoverContent}\n </span>\n </button>\n );\n }\n\n let childList: JSX.Element | null = null;\n if (shouldRenderChildren && childSectionId != null) {\n childList = (\n <CollapsibleSection id={childSectionId} isExpanded={isExpanded}>\n {childItems.map((child) => {\n let leading: JSX.Element | null = null;\n if (child.icon != null) {\n leading = (\n <span className={styles.childIcon}>{child.icon}</span>\n );\n }\n\n let childState: NonNullable<\n NonNullable<\n RecipeVariants<typeof styles.childLinkRecipe>\n >['state']\n > = 'default';\n if (isPathActive(child.to)) {\n childState = 'active';\n }\n\n return (\n <div key={child.key} className={styles.collapsibleItem}>\n <Link\n to={child.to}\n className={styles.childLinkRecipe({ state: childState })}\n aria-label={child.label}\n >\n {leading}\n <span className={styles.childLabel}>{child.label}</span>\n </Link>\n </div>\n );\n })}\n </CollapsibleSection>\n );\n }\n\n return (\n <div key={item.key}>\n <div className={styles.itemWrapper}>\n {itemNode}\n {trailingActionNode}\n </div>\n {childList}\n </div>\n );\n })}\n </SidebarContainer>\n );\n};\n\nexport { NavigationSidebar };\nexport type {\n NavigationSidebarProps,\n SidebarChildItem,\n SidebarItem,\n SidebarItemTrailingAction,\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cx as e } from "../../../theme/tools.js";
|
|
2
|
+
import { content as t, nav as n, navCollapsed as r, sidebar as i, sidebarWidthRecipe as a } from "./sidebar.css.js";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
//#region src/atomic/organisms/sidebar/SidebarContainer.tsx
|
|
5
|
+
var c = ({ children: c, headerSlot: l, footerSlot: u, hideHeader: d = !1, isCollapsed: f = !1 }) => {
|
|
6
|
+
let p = null;
|
|
7
|
+
f || (p = l);
|
|
8
|
+
let m = !d && p != null, h = "expanded";
|
|
9
|
+
return f && (h = "collapsed"), /* @__PURE__ */ s("aside", {
|
|
10
|
+
className: e(i, a({ state: h })),
|
|
11
|
+
children: [/* @__PURE__ */ s("div", {
|
|
12
|
+
className: t,
|
|
13
|
+
children: [m && /* @__PURE__ */ o("div", {
|
|
14
|
+
className: "_1cyd4aw6 txvbqb9io txvbqbu6f txvbqbdof txvbqbao6 txvbqbfzo",
|
|
15
|
+
children: p
|
|
16
|
+
}), /* @__PURE__ */ o("nav", {
|
|
17
|
+
className: e(n, { [r]: f }),
|
|
18
|
+
children: c
|
|
19
|
+
})]
|
|
20
|
+
}), u != null && /* @__PURE__ */ o("div", {
|
|
21
|
+
className: e("_1cyd4aw9 txvbqbhxo", { "_1cyd4awa txvbqb9io txvbqbdnx": f }),
|
|
22
|
+
children: u
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { c as SidebarContainer };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=SidebarContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarContainer.js","names":[],"sources":["../../../../../src/atomic/organisms/sidebar/SidebarContainer.tsx"],"sourcesContent":["import { type JSX, type ReactNode } from 'react';\nimport type { RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { cx } from '../../../theme/tools.js';\nimport * as styles from './sidebar.css.js';\n\nexport type SidebarContainerProps = {\n children: ReactNode;\n headerSlot?: ReactNode;\n footerSlot?: ReactNode;\n hideHeader?: boolean;\n isCollapsed?: boolean;\n showDefaultHeaderAction?: boolean;\n};\n\nexport const SidebarContainer = ({\n children,\n headerSlot,\n footerSlot,\n hideHeader = false,\n isCollapsed = false,\n}: SidebarContainerProps): JSX.Element => {\n let headerAction: ReactNode | null = null;\n if (!isCollapsed) {\n headerAction = headerSlot;\n }\n\n const shouldRenderHeader = !hideHeader && headerAction != null;\n\n let widthState: NonNullable<\n NonNullable<RecipeVariants<typeof styles.sidebarWidthRecipe>>['state']\n > = 'expanded';\n if (isCollapsed) {\n widthState = 'collapsed';\n }\n\n return (\n <aside\n className={cx(\n styles.sidebar,\n styles.sidebarWidthRecipe({ state: widthState }),\n )}\n >\n <div className={styles.content}>\n {shouldRenderHeader && (\n <div className={styles.headerActions}>{headerAction}</div>\n )}\n <nav\n className={cx(styles.nav, {\n [styles.navCollapsed]: isCollapsed,\n })}\n >\n {children}\n </nav>\n </div>\n {footerSlot != null && (\n <div\n className={cx(styles.footer, {\n [styles.footerCollapsed]: isCollapsed,\n })}\n >\n {footerSlot}\n </div>\n )}\n </aside>\n );\n};\n"],"mappings":";;;;AAeA,IAAa,KAAoB,EAC/B,aACA,eACA,eACA,gBAAa,IACb,iBAAc,SAC0B;CACxC,IAAI,IAAiC;AACrC,CAAK,MACH,IAAe;CAGjB,IAAM,IAAqB,CAAC,KAAc,KAAgB,MAEtD,IAEA;AAKJ,QAJI,MACF,IAAa,cAIb,kBAAC,SAAD;EACE,WAAW,EACT,GACA,EAA0B,EAAE,OAAO,GAAY,CAAC,CACjD;YAJH,CAME,kBAAC,OAAD;GAAK,WAAW;aAAhB,CACG,KACC,kBAAC,OAAD;IAAK,WAAW;cAAuB;IAAmB,CAAA,EAE5D,kBAAC,OAAD;IACE,WAAW,EAAG,GAAY,GACvB,IAAsB,GACxB,CAAC;IAED;IACG,CAAA,CACF;MACL,KAAc,QACb,kBAAC,OAAD;GACE,WAAW,EAAG,uBAAe,EAC1B,iCAAyB,GAC3B,CAAC;aAED;GACG,CAAA,CAEF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ChevronDownSvg as e } from "../../../icons/ChevronDownSvg.js";
|
|
2
|
+
import { SidebarHomeSvg as t } from "../../../icons/SidebarHomeSvg.js";
|
|
3
|
+
import { ChevronLeftSvg as n } from "../../../icons/ChevronLeftSvg.js";
|
|
4
|
+
import { ChevronRightSvg as r } from "../../../icons/ChevronRightSvg.js";
|
|
5
|
+
import { GlobeSvg as i } from "../../../icons/GlobeSvg.js";
|
|
6
|
+
import { ProjectsFolderSvg as a } from "../../../icons/ProjectsFolderSvg.js";
|
|
7
|
+
import { SidebarInitiativesSvg as o } from "../../../icons/SidebarInitiativesSvg.js";
|
|
8
|
+
import { SidebarPlusSvg as s } from "../../../icons/SidebarPlusSvg.js";
|
|
9
|
+
import { SidebarSearchSvg as c } from "../../../icons/SidebarSearchSvg.js";
|
|
10
|
+
import { SidebarSettingsSvg as l } from "../../../icons/SidebarSettingsSvg.js";
|
|
11
|
+
import { SidebarTasksSvg as u } from "../../../icons/SidebarTasksSvg.js";
|
|
12
|
+
import { SidebarTeamSvg as d } from "../../../icons/SidebarTeamSvg.js";
|
|
13
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
14
|
+
//#region src/atomic/organisms/sidebar/icons.tsx
|
|
15
|
+
var p = ({ size: e = 24, className: n }) => /* @__PURE__ */ f(t, {
|
|
16
|
+
width: e,
|
|
17
|
+
height: e,
|
|
18
|
+
className: n
|
|
19
|
+
}), m = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(u, {
|
|
20
|
+
width: e,
|
|
21
|
+
height: e,
|
|
22
|
+
className: t
|
|
23
|
+
}), h = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(o, {
|
|
24
|
+
width: e,
|
|
25
|
+
height: e,
|
|
26
|
+
className: t
|
|
27
|
+
}), g = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(d, {
|
|
28
|
+
width: e,
|
|
29
|
+
height: e,
|
|
30
|
+
className: t
|
|
31
|
+
}), _ = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(i, {
|
|
32
|
+
width: e,
|
|
33
|
+
height: e,
|
|
34
|
+
className: t
|
|
35
|
+
}), v = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(l, {
|
|
36
|
+
width: e,
|
|
37
|
+
height: e,
|
|
38
|
+
className: t
|
|
39
|
+
}), y = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(a, {
|
|
40
|
+
width: e,
|
|
41
|
+
height: e,
|
|
42
|
+
className: t
|
|
43
|
+
}), b = ({ size: t = 24, className: n }) => /* @__PURE__ */ f(e, {
|
|
44
|
+
width: t,
|
|
45
|
+
height: t,
|
|
46
|
+
className: n
|
|
47
|
+
}), x = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(r, {
|
|
48
|
+
width: e,
|
|
49
|
+
height: e,
|
|
50
|
+
className: t
|
|
51
|
+
}), S = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(n, {
|
|
52
|
+
width: e,
|
|
53
|
+
height: e,
|
|
54
|
+
className: t
|
|
55
|
+
}), C = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(c, {
|
|
56
|
+
width: e,
|
|
57
|
+
height: e,
|
|
58
|
+
className: t
|
|
59
|
+
}), w = ({ size: e = 24, className: t }) => /* @__PURE__ */ f(s, {
|
|
60
|
+
width: e,
|
|
61
|
+
height: e,
|
|
62
|
+
className: t
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { b as ChevronDownIcon, S as ChevronLeftIcon, x as ChevronRightIcon, _ as DocumentationIcon, p as HomeIcon, h as InitiativesIcon, w as PlusIcon, y as ProjectsIcon, C as SearchIcon, v as SettingsIcon, m as TasksIcon, g as TeamIcon };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","names":[],"sources":["../../../../../src/atomic/organisms/sidebar/icons.tsx"],"sourcesContent":["import { type JSX } from 'react';\n\nimport { ChevronDownSvg } from '../../../icons/ChevronDownSvg.js';\nimport { ChevronLeftSvg } from '../../../icons/ChevronLeftSvg.js';\nimport { ChevronRightSvg } from '../../../icons/ChevronRightSvg.js';\nimport { GlobeSvg } from '../../../icons/GlobeSvg.js';\nimport { ProjectsFolderSvg } from '../../../icons/ProjectsFolderSvg.js';\nimport { SidebarHomeSvg } from '../../../icons/SidebarHomeSvg.js';\nimport { SidebarInitiativesSvg } from '../../../icons/SidebarInitiativesSvg.js';\nimport { SidebarPlusSvg } from '../../../icons/SidebarPlusSvg.js';\nimport { SidebarSearchSvg } from '../../../icons/SidebarSearchSvg.js';\nimport { SidebarSettingsSvg } from '../../../icons/SidebarSettingsSvg.js';\nimport { SidebarTasksSvg } from '../../../icons/SidebarTasksSvg.js';\nimport { SidebarTeamSvg } from '../../../icons/SidebarTeamSvg.js';\n\ntype Props = {\n size?: number;\n className?: string;\n};\n\nexport const HomeIcon = ({ size = 24, className }: Props): JSX.Element => {\n return <SidebarHomeSvg width={size} height={size} className={className} />;\n};\n\nexport const TasksIcon = ({ size = 24, className }: Props): JSX.Element => {\n return <SidebarTasksSvg width={size} height={size} className={className} />;\n};\n\nexport const InitiativesIcon = ({\n size = 24,\n className,\n}: Props): JSX.Element => {\n return (\n <SidebarInitiativesSvg width={size} height={size} className={className} />\n );\n};\n\nexport const TeamIcon = ({ size = 24, className }: Props): JSX.Element => {\n return <SidebarTeamSvg width={size} height={size} className={className} />;\n};\n\nexport const DocumentationIcon = ({\n size = 24,\n className,\n}: Props): JSX.Element => {\n return <GlobeSvg width={size} height={size} className={className} />;\n};\n\nexport const SettingsIcon = ({ size = 24, className }: Props): JSX.Element => {\n return (\n <SidebarSettingsSvg width={size} height={size} className={className} />\n );\n};\n\nexport const ProjectsIcon = ({ size = 24, className }: Props): JSX.Element => {\n return <ProjectsFolderSvg width={size} height={size} className={className} />;\n};\n\nexport const ChevronDownIcon = ({\n size = 24,\n className,\n}: Props): JSX.Element => {\n return <ChevronDownSvg width={size} height={size} className={className} />;\n};\n\nexport const ChevronRightIcon = ({\n size = 24,\n className,\n}: Props): JSX.Element => {\n return <ChevronRightSvg width={size} height={size} className={className} />;\n};\n\nexport const ChevronLeftIcon = ({\n size = 24,\n className,\n}: Props): JSX.Element => {\n return <ChevronLeftSvg width={size} height={size} className={className} />;\n};\n\nexport const SearchIcon = ({ size = 24, className }: Props): JSX.Element => {\n return <SidebarSearchSvg width={size} height={size} className={className} />;\n};\n\nexport const PlusIcon = ({ size = 24, className }: Props): JSX.Element => {\n return <SidebarPlusSvg width={size} height={size} className={className} />;\n};\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAa,KAAY,EAAE,UAAO,IAAI,mBAC7B,kBAAC,GAAD;CAAgB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAG/D,KAAa,EAAE,UAAO,IAAI,mBAC9B,kBAAC,GAAD;CAAiB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAGhE,KAAmB,EAC9B,UAAO,IACP,mBAGE,kBAAC,GAAD;CAAuB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAIjE,KAAY,EAAE,UAAO,IAAI,mBAC7B,kBAAC,GAAD;CAAgB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAG/D,KAAqB,EAChC,UAAO,IACP,mBAEO,kBAAC,GAAD;CAAU,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAGzD,KAAgB,EAAE,UAAO,IAAI,mBAEtC,kBAAC,GAAD;CAAoB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAI9D,KAAgB,EAAE,UAAO,IAAI,mBACjC,kBAAC,GAAD;CAAmB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAGlE,KAAmB,EAC9B,UAAO,IACP,mBAEO,kBAAC,GAAD;CAAgB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAG/D,KAAoB,EAC/B,UAAO,IACP,mBAEO,kBAAC,GAAD;CAAiB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAGhE,KAAmB,EAC9B,UAAO,IACP,mBAEO,kBAAC,GAAD;CAAgB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAG/D,KAAc,EAAE,UAAO,IAAI,mBAC/B,kBAAC,GAAD;CAAkB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA,EAGjE,KAAY,EAAE,UAAO,IAAI,mBAC7B,kBAAC,GAAD;CAAgB,OAAO;CAAM,QAAQ;CAAiB;CAAa,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
4
|
+
//#region src/atomic/organisms/sidebar/navigationSidebar.css.ts
|
|
5
|
+
var t = "w6b4r71 w6b4r70 txvbqb9io txvbqbco txvbqbdnx txvbqb1ro txvbqb1co txvbqb1qf txvbqb106 txvbqbv9p txvbqbv4h txvbqbc76 txvbqb77 txvbqb6z txvbqb7k", n = e({
|
|
6
|
+
defaultClassName: "w6b4r72",
|
|
7
|
+
variantClassNames: { state: {
|
|
8
|
+
collapsed: "w6b4r73",
|
|
9
|
+
expanded: "w6b4r74"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { state: "expanded" },
|
|
12
|
+
compoundVariants: []
|
|
13
|
+
}), r = "w6b4r75 txvbqbgmo txvbqb8x txvbqbamf", i = "w6b4r76 txvbqb9ix txvbqb7b txvbqb70 txvbqb7m", a = e({
|
|
14
|
+
defaultClassName: "w6b4r77",
|
|
15
|
+
variantClassNames: { state: {
|
|
16
|
+
expanded: "w6b4r78",
|
|
17
|
+
collapsed: "w6b4r79"
|
|
18
|
+
} },
|
|
19
|
+
defaultVariants: { state: "collapsed" },
|
|
20
|
+
compoundVariants: []
|
|
21
|
+
}), o = "w6b4r7a txvbqbhwx txvbqbgnf txvbqb6gf txvbqb1qf txvbqb106 txvbqbnv6 txvbqbl6f", s = "w6b4r7b", c = "w6b4r7c txvbqbpsf", l = "w6b4r7g w6b4r7e w6b4r7d txvbqbnv6 txvbqboif txvbqbp5f txvbqblx6 txvbqb9io txvbqbco txvbqbdof txvbqbu6f txvbqb1ro txvbqb8x txvbqbf3x txvbqbt5o txvbqbuzj txvbqb77 txvbqb6z txvbqb7k w6b4r7f txvbqbamx txvbqbva3", u = e({
|
|
22
|
+
defaultClassName: "w6b4r7l w6b4r7i w6b4r7e w6b4r7d txvbqbnv6 txvbqboif txvbqbp5f txvbqblx6 txvbqb9io txvbqbco txvbqbdof txvbqbu6f txvbqb1ro txvbqb8x txvbqbf3x txvbqbt5o txvbqbuzj txvbqb77 txvbqb6z txvbqb7k w6b4r7h txvbqbamo txvbqb3b",
|
|
23
|
+
variantClassNames: { state: {
|
|
24
|
+
default: "w6b4r7m w6b4r7j txvbqbva3",
|
|
25
|
+
active: "w6b4r7n w6b4r7k txvbqbuy6 txvbqbv9z txvbqb106 txvbqb1rx"
|
|
26
|
+
} },
|
|
27
|
+
defaultVariants: { state: "default" },
|
|
28
|
+
compoundVariants: []
|
|
29
|
+
}), d = e({
|
|
30
|
+
defaultClassName: "w6b4r7q",
|
|
31
|
+
variantClassNames: { state: {
|
|
32
|
+
collapsed: "w6b4r7r w6b4r7o txvbqb8uo",
|
|
33
|
+
expanded: "w6b4r7s w6b4r7p txvbqb8vf"
|
|
34
|
+
} },
|
|
35
|
+
defaultVariants: { state: "expanded" },
|
|
36
|
+
compoundVariants: []
|
|
37
|
+
}), f = "w6b4r7t txvbqboko", p = "w6b4r7u txvbqb9mx txvbqbk4x txvbqbuw6 txvbqbl6f txvbqbt6f txvbqb7d txvbqb6z txvbqb7k", m = "w6b4r7v txvbqbpsf txvbqb9io txvbqbco txvbqbdnx txvbqbtwf txvbqbc5x txvbqbaj6", h = "w6b4r7w txvbqb7d txvbqb6z txvbqb7k", g = "w6b4r7x w6b4r7w txvbqb7d txvbqb6z txvbqb7k", _ = "w6b4r7z w6b4r7w txvbqb7d txvbqb6z txvbqb7k w6b4r7y txvbqbvab", v = "w6b4r710 txvbqbpsf txvbqbgwf txvbqb9io txvbqbco txvbqbdnx txvbqbtwf txvbqbc5x", y = "w6b4r712 w6b4r711 txvbqbps6 txvbqbtu6 txvbqbptx txvbqb9io txvbqbco txvbqbdnx txvbqbtx6 txvbqbc6o txvbqb1rf txvbqbv4h txvbqbv9p txvbqbvab txvbqb77 txvbqb6z txvbqb7k", b = "w6b4r713 txvbqbpsf txvbqb9io txvbqbco txvbqbdnx txvbqbtw6 txvbqbc5o", x = "w6b4r715 w6b4r714 txvbqb7d txvbqb6z txvbqb7k", S = "w6b4r717 w6b4r716 txvbqbvab txvbqb7d txvbqb6z txvbqb7k", C = e({
|
|
38
|
+
defaultClassName: "w6b4r71c w6b4r719 w6b4r718 txvbqbnv6 txvbqboif txvbqbp5f txvbqblx6 txvbqb9io txvbqbco txvbqbao6 txvbqb1ro txvbqb8x txvbqbamf txvbqbf3x txvbqb3b txvbqb78 txvbqb6z txvbqb7k",
|
|
39
|
+
variantClassNames: { state: {
|
|
40
|
+
default: "w6b4r71d w6b4r71a txvbqbva3",
|
|
41
|
+
active: "w6b4r71e w6b4r71b txvbqbv49 txvbqbv9z txvbqbamo"
|
|
42
|
+
} },
|
|
43
|
+
defaultVariants: { state: "default" },
|
|
44
|
+
compoundVariants: []
|
|
45
|
+
}), w = "w6b4r71f txvbqb9io txvbqbco txvbqbdnx txvbqbtw6 txvbqbc5o txvbqbaj6 txvbqbv9p", T = "w6b4r71g txvbqb9mx txvbqbk4x txvbqbuw6 txvbqbl6f txvbqbt6f";
|
|
46
|
+
//#endregion
|
|
47
|
+
export { w as childIcon, T as childLabel, C as childLinkRecipe, t as collapseButton, r as collapseButtonLabel, n as collapseButtonStateRecipe, o as collapsibleContent, s as collapsibleItem, i as collapsibleSection, a as collapsibleStateRecipe, h as iconBaseLayer, g as iconHiddenOnHover, _ as iconVisibleOnHover, m as iconWrapper, c as itemWrapper, p as label, l as navButton, d as navGapRecipe, u as navLinkRecipe, f as navWithTrailingAction, y as trailingActionButton, x as trailingActionIconHidden, S as trailingActionIconVisible, b as trailingActionIconWrapper, v as trailingIconWrapper };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=navigationSidebar.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigationSidebar.css.js","names":[],"sources":["../../../../../src/atomic/organisms/sidebar/navigationSidebar.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { sprinkles } from '../../../theme/sprinkles.css.js';\nimport { vars } from '../../../theme/themeContract.js';\n\nexport const collapseButton = style([\n sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 'lg',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'brandPrimaryRed',\n color: 'brandPrimaryRed',\n backgroundColor: 'brandWhite',\n height: 10,\n transitionProperty: 'default',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n }),\n {\n selectors: {\n '&:hover': {\n backgroundColor: vars.colors.brandSecondaryOrange,\n color: vars.colors.brandWhite,\n boxShadow: vars.boxShadow.brandGlow,\n },\n '&:focus-visible': {\n outline: 'none',\n boxShadow: `0 0 0 2px ${vars.colors.brandSecondaryOrange}`,\n },\n },\n },\n]);\n\nexport const collapseButtonStateRecipe = recipe({\n variants: {\n state: {\n collapsed: {\n width: vars.spacing[10],\n paddingInline: 0,\n },\n expanded: {\n paddingInline: vars.spacing[3],\n width: 'auto',\n },\n },\n },\n defaultVariants: {\n state: 'expanded',\n },\n});\n\nexport type CollapseButtonStateVariants = RecipeVariants<\n typeof collapseButtonStateRecipe\n>;\n\nexport const collapseButtonLabel = sprinkles({\n marginLeft: 2,\n fontSize: 'sm',\n fontWeight: 'medium',\n});\n\nexport const collapsibleSection = sprinkles({\n display: 'grid',\n transitionProperty: 'gridTemplateRowsOpacity',\n transitionDuration: 300,\n transitionTimingFunction: 'ease-in-out',\n});\n\nexport const collapsibleStateRecipe = recipe({\n variants: {\n state: {\n expanded: {\n gridTemplateRows: '1fr',\n opacity: 1,\n },\n collapsed: {\n gridTemplateRows: '0fr',\n opacity: 0,\n pointerEvents: 'none',\n },\n },\n },\n defaultVariants: {\n state: 'collapsed',\n },\n});\n\nexport type CollapsibleStateVariants = RecipeVariants<\n typeof collapsibleStateRecipe\n>;\n\nexport const collapsibleContent = sprinkles({\n marginTop: 1,\n marginLeft: 5,\n borderLeftWidth: 2,\n borderStyle: 'solid',\n borderColor: 'brandPrimaryRed',\n paddingLeft: 3,\n overflow: 'hidden',\n});\n\nexport const collapsibleItem = style({\n selectors: {\n '&:not(:first-child)': {\n marginTop: vars.spacing[1],\n },\n },\n});\n\nexport const itemWrapper = sprinkles({\n position: 'relative',\n});\n\nconst interactiveBase = style([\n sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n width: 'full',\n borderRadius: 'lg',\n paddingY: 2,\n paddingX: 3,\n fontSize: 'sm',\n lineHeight: 1.2,\n textAlign: 'left',\n backgroundColor: 'transparent',\n transitionProperty: 'default',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n }),\n {\n selectors: {\n '&:hover': {\n backgroundColor: vars.colors.brandLightGray,\n borderColor: vars.colors.brandSecondaryOrange,\n },\n '&:focus-visible': {\n outline: 'none',\n },\n },\n },\n]);\n\nexport const navButton = style([\n interactiveBase,\n sprinkles({ fontWeight: 'bold', color: 'brandDarkGray' }),\n]);\n\nconst navLinkBase = style([\n interactiveBase,\n sprinkles({ fontWeight: 'semibold', textDecoration: 'none' }),\n]);\n\nexport const navLinkRecipe = recipe({\n base: navLinkBase,\n variants: {\n state: {\n default: sprinkles({\n color: 'brandDarkGray',\n }),\n active: sprinkles({\n backgroundImage: 'brandDiagonal',\n color: 'brandWhite',\n borderColor: 'brandPrimaryRed',\n borderRadius: 'xl',\n }),\n },\n },\n defaultVariants: {\n state: 'default',\n },\n});\n\nexport type NavLinkVariants = RecipeVariants<typeof navLinkRecipe>;\n\nexport const navGapRecipe = recipe({\n variants: {\n state: {\n collapsed: sprinkles({ columnGap: 0 }),\n expanded: sprinkles({ columnGap: 3 }),\n },\n },\n defaultVariants: {\n state: 'expanded',\n },\n});\n\nexport type NavGapVariants = RecipeVariants<typeof navGapRecipe>;\n\nexport const navWithTrailingAction = sprinkles({\n paddingRight: 12,\n});\n\nexport const label = sprinkles({\n flex: 1,\n minWidth: 0,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n transitionProperty: 'opacity',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n});\n\nexport const iconWrapper = sprinkles({\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 5,\n height: 5,\n flexShrink: 0,\n});\n\nconst fadingLayer = sprinkles({\n transitionProperty: 'opacity',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n});\n\nexport const iconBaseLayer = fadingLayer;\n\nexport const iconHiddenOnHover = style([\n fadingLayer,\n {\n selectors: {\n [`${itemWrapper}:hover &`]: { opacity: 0 },\n [`${itemWrapper}:focus-visible &`]: { opacity: 0 },\n [`${itemWrapper}:focus-within &`]: { opacity: 0 },\n },\n },\n]);\n\nexport const iconVisibleOnHover = style([\n fadingLayer,\n sprinkles({ opacity: 0 }),\n {\n selectors: {\n [`${itemWrapper}:hover &`]: { opacity: 1 },\n [`${itemWrapper}:focus-visible &`]: { opacity: 1 },\n [`${itemWrapper}:focus-within &`]: { opacity: 1 },\n },\n },\n]);\n\nexport const trailingIconWrapper = sprinkles({\n position: 'relative',\n marginLeft: 'auto',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 5,\n height: 5,\n});\n\nexport const trailingActionButton = style([\n sprinkles({\n position: 'absolute',\n top: '1/2',\n right: 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 8,\n height: 8,\n borderRadius: 'md',\n backgroundColor: 'brandWhite',\n color: 'brandPrimaryRed',\n opacity: 0,\n transitionProperty: 'default',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n }),\n {\n transform: 'translateY(-50%)',\n selectors: {\n [`${itemWrapper}:hover &`]: { opacity: 1 },\n [`${itemWrapper}:focus-within &`]: { opacity: 1 },\n '&:hover': {\n backgroundColor: vars.colors.brandSecondaryOrange,\n color: vars.colors.brandWhite,\n },\n '&:focus-visible': {\n outline: 'none',\n boxShadow: `0 0 0 2px ${vars.colors.brandSecondaryOrange}`,\n opacity: 1,\n },\n },\n },\n]);\n\nexport const trailingActionIconWrapper = sprinkles({\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 4,\n height: 4,\n});\n\nexport const trailingActionIconHidden = style([\n sprinkles({\n transitionProperty: 'opacity',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n }),\n {\n selectors: {\n [`${trailingActionButton}:hover &`]: { opacity: 0 },\n [`${trailingActionButton}:focus-visible &`]: { opacity: 0 },\n },\n },\n]);\n\nexport const trailingActionIconVisible = style([\n sprinkles({\n opacity: 0,\n transitionProperty: 'opacity',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n }),\n {\n selectors: {\n [`${trailingActionButton}:hover &`]: { opacity: 1 },\n [`${trailingActionButton}:focus-visible &`]: { opacity: 1 },\n },\n },\n]);\n\nconst childLinkBase = style([\n sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n borderRadius: 'lg',\n paddingY: 2,\n paddingX: 3,\n fontSize: 'sm',\n fontWeight: 'medium',\n lineHeight: 1.2,\n textDecoration: 'none',\n transitionProperty: 'colors',\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n }),\n {\n selectors: {\n '&:hover': {\n backgroundColor: vars.colors.brandLightGray,\n color: vars.colors.brandDarkGray,\n },\n },\n },\n]);\n\nexport const childLinkRecipe = recipe({\n base: childLinkBase,\n variants: {\n state: {\n default: sprinkles({\n color: 'brandDarkGray',\n }),\n active: sprinkles({\n backgroundColor: 'brandSecondaryOrange',\n color: 'brandWhite',\n fontWeight: 'semibold',\n }),\n },\n },\n defaultVariants: {\n state: 'default',\n },\n});\n\nexport type ChildLinkVariants = RecipeVariants<typeof childLinkRecipe>;\n\nexport const childIcon = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 4,\n height: 4,\n flexShrink: 0,\n color: 'brandPrimaryRed',\n});\n\nexport const childLabel = sprinkles({\n flex: 1,\n minWidth: 0,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n});\n"],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
4
|
+
//#region src/atomic/organisms/sidebar/sidebar.css.ts
|
|
5
|
+
var t = "_1cyd4aw0 txvbqb9io txvbqbcw6 txvbqbai6 txvbqbl6f txvbqbla6 txvbqb7h txvbqb70 txvbqb7m", n = e({
|
|
6
|
+
defaultClassName: "_1cyd4aw1",
|
|
7
|
+
variantClassNames: { state: {
|
|
8
|
+
collapsed: "_1cyd4aw2",
|
|
9
|
+
expanded: "_1cyd4aw3"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { state: "expanded" },
|
|
12
|
+
compoundVariants: []
|
|
13
|
+
}), r = "_1cyd4aw4 txvbqb9io txvbqb9mx txvbqbai6", i = "_1cyd4aw5 txvbqb9io txvbqbco txvbqbdof txvbqbao6 txvbqbfzo txvbqbhwo txvbqbl9x txvbqb1rx txvbqbuy6 txvbqb1co txvbqb1qf txvbqb106 txvbqb7d txvbqb70 txvbqb7m", a = "_1cyd4aw6 txvbqb9io txvbqbu6f txvbqbdof txvbqbao6 txvbqbfzo", o = "_1cyd4aw7 txvbqb9io txvbqb9mx txvbqbai6 txvbqbao6 txvbqb79 txvbqb70 txvbqb7m txvbqbp5x", s = "_1cyd4aw8 txvbqbanx", c = "_1cyd4aw9 txvbqbhxo", l = "_1cyd4awa txvbqb9io txvbqbdnx", u = "_1cyd4awc _1cyd4awb txvbqbnv6 txvbqboif txvbqbp5f txvbqblx6 txvbqb1rf txvbqb8x txvbqbamf txvbqbv9z txvbqbuy6 txvbqb1co txvbqb1qf txvbqb106 txvbqb77 txvbqb6x txvbqb7k", d = "_1cyd4awf _1cyd4awd txvbqbnv6 txvbqboif txvbqbp5f txvbqblx6 txvbqb9io txvbqbco txvbqbaof txvbqb1ro txvbqb8x txvbqbf3x txvbqb3b txvbqbuzj txvbqbva3 txvbqb77 txvbqb6x txvbqb7k _1cyd4awe txvbqbamo", f = "_1cyd4awg txvbqbuy6 txvbqbv9z txvbqb1rx", p = "_1cyd4awh txvbqb9io txvbqbco txvbqbdnx txvbqbtwf txvbqbc5x txvbqbv4x txvbqbamo txvbqb78 txvbqb6x txvbqb7k", m = "_1cyd4awi txvbqb9mx txvbqbk4x txvbqbuw6 txvbqbl6f txvbqbt6f";
|
|
14
|
+
//#endregion
|
|
15
|
+
export { r as content, u as defaultHeaderButton, c as footer, l as footerCollapsed, a as headerActions, i as headerRow, m as linkLabel, o as nav, s as navCollapsed, p as organizationIcon, d as organizationLink, f as organizationLinkActive, t as sidebar, n as sidebarWidthRecipe };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=sidebar.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.css.js","names":[],"sources":["../../../../../src/atomic/organisms/sidebar/sidebar.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { sprinkles } from '../../../theme/sprinkles.css.js';\nimport { vars } from '../../../theme/themeContract.js';\n\nconst EASE_IN_OUT = 'ease-in-out';\n\nexport const sidebar = sprinkles({\n display: 'flex',\n height: 'screen',\n flexDirection: 'column',\n overflow: 'hidden',\n padding: 3,\n transitionProperty: 'width',\n transitionDuration: 300,\n transitionTimingFunction: EASE_IN_OUT,\n});\n\nexport const sidebarWidthRecipe = recipe({\n variants: {\n state: {\n collapsed: { width: vars.width[16] },\n expanded: { width: vars.width[60] },\n },\n },\n defaultVariants: {\n state: 'expanded',\n },\n});\n\nexport type SidebarWidthVariants = RecipeVariants<typeof sidebarWidthRecipe>;\n\nexport const content = sprinkles({\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n});\n\nexport const headerRow = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: 2,\n marginBottom: 3,\n marginTop: 0,\n padding: 2,\n borderRadius: 'xl',\n backgroundImage: 'brandDiagonal',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'brandPrimaryRed',\n transitionProperty: 'opacity',\n transitionDuration: 300,\n transitionTimingFunction: EASE_IN_OUT,\n});\n\nexport const headerActions = sprinkles({\n display: 'flex',\n width: 'full',\n justifyContent: 'flex-start',\n gap: 2,\n marginBottom: 3,\n});\n\nexport const nav = sprinkles({\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n gap: 2,\n transitionProperty: 'gap',\n transitionDuration: 300,\n transitionTimingFunction: EASE_IN_OUT,\n paddingTop: 4,\n});\n\nexport const navCollapsed = sprinkles({\n gap: 1,\n});\n\nexport const footer = sprinkles({\n marginTop: 4,\n});\n\nexport const footerCollapsed = sprinkles({\n display: 'flex',\n justifyContent: 'center',\n});\n\nexport const defaultHeaderButton = style([\n sprinkles({\n borderRadius: 'md',\n paddingY: 2,\n paddingX: 3,\n fontSize: 'sm',\n fontWeight: 'medium',\n color: 'brandWhite',\n backgroundImage: 'brandDiagonal',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'brandPrimaryRed',\n transitionProperty: 'default',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n }),\n {\n boxShadow: `0 10px 20px color-mix(in srgb, ${vars.colors.black} 8%, transparent)`,\n selectors: {\n '&:hover': {\n boxShadow: `0 12px 24px color-mix(in srgb, ${vars.colors.black} 12%, transparent)`,\n transform: 'translateY(-1px)',\n },\n '&:focus-visible': {\n outline: 'none',\n boxShadow: `0 0 0 2px ${vars.colors.brandSecondaryOrange}`,\n },\n },\n },\n]);\n\nconst navigationLinkBase = sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 3,\n borderRadius: 'lg',\n paddingY: 2,\n paddingX: 3,\n fontSize: 'sm',\n lineHeight: 1.2,\n textDecoration: 'none',\n backgroundColor: 'transparent',\n color: 'brandDarkGray',\n transitionProperty: 'default',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n});\n\nexport const organizationLink = style([\n navigationLinkBase,\n sprinkles({ fontWeight: 'semibold' }),\n {\n selectors: {\n '&:hover': {\n backgroundColor: vars.colors.brandLightGray,\n borderColor: vars.colors.brandSecondaryOrange,\n },\n },\n },\n]);\n\nexport const organizationLinkActive = sprinkles({\n backgroundImage: 'brandDiagonal',\n color: 'brandWhite',\n borderRadius: 'xl',\n});\n\nexport const organizationIcon = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 5,\n height: 5,\n color: 'inherit',\n fontWeight: 'semibold',\n transitionProperty: 'colors',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n});\n\nexport const linkLabel = sprinkles({\n flex: 1,\n minWidth: 0,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n});\n"],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Button as e } from "../../../atomic/atoms/button/Button.js";
|
|
2
|
+
import { ErrorMessage as t } from "../../../atomic/atoms/error_message/ErrorMessage.js";
|
|
3
|
+
import { Modal as n } from "../../../atomic/atoms/modal/Modal.js";
|
|
4
|
+
import { body as r, footer as i } from "./confirmDialog.css.js";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { useCallback as s, useState as c } from "react";
|
|
7
|
+
//#region src/backoffice/molecules/confirm_dialog/ConfirmDialog.tsx
|
|
8
|
+
var l = ({ isOpen: l, title: u, children: d, confirmLabel: f = "Confirm", cancelLabel: p = "Cancel", confirmTone: m = "default", onClose: h, onConfirm: g, closeOnConfirm: _ = !0 }) => {
|
|
9
|
+
let [v, y] = c(!1), [b, x] = c(null), S = s(() => {
|
|
10
|
+
v || (x(null), h());
|
|
11
|
+
}, [v, h]), C = s(async () => {
|
|
12
|
+
if (!v) {
|
|
13
|
+
x(null), y(!0);
|
|
14
|
+
try {
|
|
15
|
+
await g(), _ && h();
|
|
16
|
+
} catch (e) {
|
|
17
|
+
let t = "An unexpected error occurred.";
|
|
18
|
+
e instanceof Error && (t = e.message), x(t);
|
|
19
|
+
} finally {
|
|
20
|
+
y(!1);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}, [
|
|
24
|
+
_,
|
|
25
|
+
v,
|
|
26
|
+
h,
|
|
27
|
+
g
|
|
28
|
+
]), w = "primary";
|
|
29
|
+
m === "danger" && (w = "danger");
|
|
30
|
+
let T = /* @__PURE__ */ o("div", {
|
|
31
|
+
className: i,
|
|
32
|
+
children: [/* @__PURE__ */ a(e, {
|
|
33
|
+
type: "button",
|
|
34
|
+
variant: "secondary",
|
|
35
|
+
onClick: S,
|
|
36
|
+
disabled: v,
|
|
37
|
+
children: p
|
|
38
|
+
}), /* @__PURE__ */ a(e, {
|
|
39
|
+
type: "button",
|
|
40
|
+
variant: w,
|
|
41
|
+
onClick: () => {
|
|
42
|
+
C().catch(() => {});
|
|
43
|
+
},
|
|
44
|
+
isLoading: v,
|
|
45
|
+
children: f
|
|
46
|
+
})]
|
|
47
|
+
}), E = null;
|
|
48
|
+
return b != null && (E = /* @__PURE__ */ a(t, { children: b })), /* @__PURE__ */ a(n, {
|
|
49
|
+
isOpen: l,
|
|
50
|
+
onClose: S,
|
|
51
|
+
title: u,
|
|
52
|
+
footer: T,
|
|
53
|
+
children: /* @__PURE__ */ o("div", {
|
|
54
|
+
className: r,
|
|
55
|
+
children: [E, d]
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { l as ConfirmDialog, l as default };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=ConfirmDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../../../src/backoffice/molecules/confirm_dialog/ConfirmDialog.tsx"],"sourcesContent":["import { useCallback, useState, type JSX, type ReactNode } from 'react';\n\nimport { Button } from '../../../atomic/atoms/button/Button.js';\nimport { ErrorMessage } from '../../../atomic/atoms/error_message/ErrorMessage.js';\nimport { Modal } from '../../../atomic/atoms/modal/Modal.js';\n\nimport * as styles from './confirmDialog.css.js';\n\nexport type ConfirmDialogProps = {\n isOpen: boolean;\n title: string;\n children: ReactNode;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmTone?: 'default' | 'danger';\n onClose: () => void;\n onConfirm: () => Promise<void> | void;\n closeOnConfirm?: boolean;\n};\n\nexport const ConfirmDialog = ({\n isOpen,\n title,\n children,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n confirmTone = 'default',\n onClose,\n onConfirm,\n closeOnConfirm = true,\n}: ConfirmDialogProps): JSX.Element | null => {\n const [isConfirming, setIsConfirming] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleClose = useCallback(() => {\n if (isConfirming) {\n return;\n }\n setError(null);\n onClose();\n }, [isConfirming, onClose]);\n\n const handleConfirm = useCallback(async () => {\n if (isConfirming) {\n return;\n }\n setError(null);\n setIsConfirming(true);\n try {\n await onConfirm();\n if (closeOnConfirm) {\n onClose();\n }\n } catch (err) {\n let message = 'An unexpected error occurred.';\n if (err instanceof Error) {\n message = err.message;\n }\n setError(message);\n } finally {\n setIsConfirming(false);\n }\n }, [closeOnConfirm, isConfirming, onClose, onConfirm]);\n\n let confirmVariant: 'primary' | 'danger' = 'primary';\n if (confirmTone === 'danger') {\n confirmVariant = 'danger';\n }\n\n const handleConfirmClick = () => {\n handleConfirm().catch(() => {});\n };\n\n const footer = (\n <div className={styles.footer}>\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={handleClose}\n disabled={isConfirming}\n >\n {cancelLabel}\n </Button>\n <Button\n type=\"button\"\n variant={confirmVariant}\n onClick={handleConfirmClick}\n isLoading={isConfirming}\n >\n {confirmLabel}\n </Button>\n </div>\n );\n\n let errorNode: JSX.Element | null = null;\n if (error != null) {\n errorNode = <ErrorMessage>{error}</ErrorMessage>;\n }\n\n return (\n <Modal isOpen={isOpen} onClose={handleClose} title={title} footer={footer}>\n <div className={styles.body}>\n {errorNode}\n {children}\n </div>\n </Modal>\n );\n};\n\nexport default ConfirmDialog;\n"],"mappings":";;;;;;;AAoBA,IAAa,KAAiB,EAC5B,WACA,UACA,aACA,kBAAe,WACf,iBAAc,UACd,iBAAc,WACd,YACA,cACA,oBAAiB,SAC2B;CAC5C,IAAM,CAAC,GAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,IAAc,QAAkB;AAChC,QAGJ,EAAS,KAAK,EACd,GAAS;IACR,CAAC,GAAc,EAAQ,CAAC,EAErB,IAAgB,EAAY,YAAY;AACxC,UAIJ;GADA,EAAS,KAAK,EACd,EAAgB,GAAK;AACrB,OAAI;AAEF,IADA,MAAM,GAAW,EACb,KACF,GAAS;YAEJ,GAAK;IACZ,IAAI,IAAU;AAId,IAHI,aAAe,UACjB,IAAU,EAAI,UAEhB,EAAS,EAAQ;aACT;AACR,MAAgB,GAAM;;;IAEvB;EAAC;EAAgB;EAAc;EAAS;EAAU,CAAC,EAElD,IAAuC;AAC3C,CAAI,MAAgB,aAClB,IAAiB;CAOnB,IAAM,IACJ,kBAAC,OAAD;EAAK,WAAW;YAAhB,CACE,kBAAC,GAAD;GACE,MAAK;GACL,SAAQ;GACR,SAAS;GACT,UAAU;aAET;GACM,CAAA,EACT,kBAAC,GAAD;GACE,MAAK;GACL,SAAS;GACT,eAjB2B;AAC/B,OAAe,CAAC,YAAY,GAAG;;GAiB3B,WAAW;aAEV;GACM,CAAA,CACL;KAGJ,IAAgC;AAKpC,QAJI,KAAS,SACX,IAAY,kBAAC,GAAD,EAAA,UAAe,GAAqB,CAAA,GAIhD,kBAAC,GAAD;EAAe;EAAQ,SAAS;EAAoB;EAAe,QAAA;YACjE,kBAAC,OAAD;GAAK,WAAW;aAAhB,CACG,GACA,EACG;;EACA,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
//#region src/backoffice/molecules/confirm_dialog/confirmDialog.css.ts
|
|
4
|
+
var e = "_1lxq4iv0 txvbqb9io txvbqbai6 txvbqbaof", t = "_1lxq4iv1 txvbqb9io txvbqbdo6 txvbqbaof";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as body, t as footer };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=confirmDialog.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmDialog.css.js","names":[],"sources":["../../../../../src/backoffice/molecules/confirm_dialog/confirmDialog.css.ts"],"sourcesContent":["import { sprinkles } from '../../../theme/sprinkles.css.js';\n\nexport const body = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n gap: 3,\n});\n\nexport const footer = sprinkles({\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 3,\n});\n"],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Input as e } from "../../../atomic/atoms/input/Input.js";
|
|
2
2
|
import { ModalCloseSvg as t } from "../../../icons/ModalCloseSvg.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { SidebarSearchSvg as n } from "../../../icons/SidebarSearchSvg.js";
|
|
4
|
+
import { ShortcutHint as r } from "../../atoms/shortcut_hint/ShortcutHint.js";
|
|
5
5
|
import { clearButton as i, container as a } from "./globalSearchInput.css.js";
|
|
6
6
|
import "../../../index.js";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
@@ -22,7 +22,7 @@ var c = ({ value: c, onChange: l, placeholder: u = "Search…", ariaLabel: d, cl
|
|
|
22
22
|
})
|
|
23
23
|
}));
|
|
24
24
|
let y = null;
|
|
25
|
-
p != null && (y = /* @__PURE__ */ o(
|
|
25
|
+
p != null && (y = /* @__PURE__ */ o(r, { keys: p }));
|
|
26
26
|
let b = /* @__PURE__ */ s("span", {
|
|
27
27
|
className: a,
|
|
28
28
|
children: [
|
|
@@ -41,7 +41,7 @@ var c = ({ value: c, onChange: l, placeholder: u = "Search…", ariaLabel: d, cl
|
|
|
41
41
|
"aria-label": _,
|
|
42
42
|
size: "small",
|
|
43
43
|
fullWidth: !0,
|
|
44
|
-
leftIcon: /* @__PURE__ */ o(
|
|
44
|
+
leftIcon: /* @__PURE__ */ o(n, {
|
|
45
45
|
width: 18,
|
|
46
46
|
height: 18,
|
|
47
47
|
"aria-hidden": "true"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { cx as e } from "../../../theme/tools.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ChevronLeftSvg as t } from "../../../icons/ChevronLeftSvg.js";
|
|
3
|
+
import { ChevronRightSvg as n } from "../../../icons/ChevronRightSvg.js";
|
|
4
|
+
import { ShortcutHint as r } from "../../atoms/shortcut_hint/ShortcutHint.js";
|
|
5
5
|
import { button as i, icon as a, label as o } from "./sidebarCollapseToggle.css.js";
|
|
6
6
|
import "../../../index.js";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
//#region src/backoffice/molecules/sidebar_collapse_toggle/SidebarCollapseToggle.tsx
|
|
9
9
|
var l = ({ isCollapsed: l, onToggle: u, label: d = "Collapse", shortcut: f, className: p }) => {
|
|
10
|
-
let m =
|
|
11
|
-
l && (m =
|
|
10
|
+
let m = t, h = d;
|
|
11
|
+
l && (m = n, h = "Expand");
|
|
12
12
|
let g = null;
|
|
13
|
-
return f != null && (g = /* @__PURE__ */ s(
|
|
13
|
+
return f != null && (g = /* @__PURE__ */ s(r, { keys: f })), /* @__PURE__ */ c("button", {
|
|
14
14
|
type: "button",
|
|
15
15
|
className: e(i, p),
|
|
16
16
|
onClick: u,
|