@plumile/ui 0.1.63 → 0.1.65
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/empty-state/EmptyState.css.js +8 -0
- package/lib/esm/atomic/molecules/empty-state/EmptyState.css.js.map +1 -0
- package/lib/esm/atomic/molecules/empty-state/EmptyState.js +35 -0
- package/lib/esm/atomic/molecules/empty-state/EmptyState.js.map +1 -0
- package/lib/esm/atomic/molecules/markdown/components/MarkdownFootnoteReference.css.js +0 -1
- package/lib/esm/atomic/molecules/markdown/components/MarkdownLink.css.js +1 -0
- package/lib/esm/atomic/molecules/profile_dropdown/ProfileDropdown.js +119 -0
- package/lib/esm/atomic/molecules/profile_dropdown/ProfileDropdown.js.map +1 -0
- package/lib/esm/atomic/molecules/profile_dropdown/profileDropdown.css.js +8 -0
- package/lib/esm/atomic/molecules/profile_dropdown/profileDropdown.css.js.map +1 -0
- 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/navigationSidebar.css.js +49 -0
- package/lib/esm/atomic/organisms/sidebar/navigationSidebar.css.js.map +1 -0
- package/lib/esm/components/agent/AgentMarkdownCard.css.js +8 -0
- package/lib/esm/components/agent/AgentMarkdownCard.css.js.map +1 -0
- package/lib/esm/components/agent/AgentMarkdownCard.js +19 -0
- package/lib/esm/components/agent/AgentMarkdownCard.js.map +1 -0
- package/lib/esm/components/organization_layout/OrganizationLayout.js +16 -0
- package/lib/esm/components/organization_layout/OrganizationLayout.js.map +1 -0
- package/lib/esm/index.js +91 -84
- package/lib/esm/style.css +1 -1
- package/lib/types/atomic/molecules/empty-state/EmptyState.css.d.ts +6 -0
- package/lib/types/atomic/molecules/empty-state/EmptyState.css.d.ts.map +1 -0
- package/lib/types/atomic/molecules/empty-state/EmptyState.d.ts +11 -0
- package/lib/types/atomic/molecules/empty-state/EmptyState.d.ts.map +1 -0
- package/lib/types/atomic/molecules/profile_dropdown/ProfileDropdown.d.ts +24 -0
- package/lib/types/atomic/molecules/profile_dropdown/ProfileDropdown.d.ts.map +1 -0
- package/lib/types/atomic/molecules/profile_dropdown/profileDropdown.css.d.ts +14 -0
- package/lib/types/atomic/molecules/profile_dropdown/profileDropdown.css.d.ts.map +1 -0
- 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/navigationSidebar.css.d.ts +70 -0
- package/lib/types/atomic/organisms/sidebar/navigationSidebar.css.d.ts.map +1 -0
- package/lib/types/components/agent/AgentMarkdownCard.css.d.ts +4 -0
- package/lib/types/components/agent/AgentMarkdownCard.css.d.ts.map +1 -0
- package/lib/types/components/agent/AgentMarkdownCard.d.ts +9 -0
- package/lib/types/components/agent/AgentMarkdownCard.d.ts.map +1 -0
- package/lib/types/components/organization_layout/OrganizationLayout.d.ts +15 -0
- package/lib/types/components/organization_layout/OrganizationLayout.d.ts.map +1 -0
- package/lib/types/index.d.ts +7 -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,8 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
//#region src/atomic/molecules/empty-state/EmptyState.css.ts
|
|
4
|
+
var e = "_1lrdacm0 txvbqbu6f txvbqb9io txvbqbai6 txvbqbco txvbqbdnx txvbqbao6 txvbqbt5x", t = "_1lrdacm1 txvbqb9o", n = "_1lrdacm2 txvbqbfbo txvbqb9f txvbqbamo txvbqbv8p", r = "_1lrdacm3 txvbqbfbo txvbqb8x txvbqbv8r txvbqbjef", i = "_1lrdacm4 txvbqb9io txvbqbajx txvbqbao6 txvbqbdnx";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { i as actions, e as content, r as description, t as icon, n as title };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=EmptyState.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.css.js","names":[],"sources":["../../../../../src/atomic/molecules/empty-state/EmptyState.css.ts"],"sourcesContent":["import { sprinkles } from '../../../theme/sprinkles.css.js';\n\nexport const content = sprinkles({\n width: 'full',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 2,\n textAlign: 'center',\n});\n\nexport const icon = sprinkles({\n fontSize: 'xl',\n});\n\nexport const title = sprinkles({\n margin: 0,\n fontSize: 'lg',\n fontWeight: 'semibold',\n color: 'text',\n});\n\nexport const description = sprinkles({\n margin: 0,\n fontSize: 'sm',\n color: 'textSecondary',\n maxWidth: 'md',\n});\n\nexport const actions = sprinkles({\n display: 'flex',\n flexWrap: 'wrap',\n gap: 2,\n justifyContent: 'center',\n});\n"],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Card as e } from "../card/Card.js";
|
|
2
|
+
import { actions as t, content as n, description as r, icon as i, title as a } from "./EmptyState.css.js";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
//#region src/atomic/molecules/empty-state/EmptyState.tsx
|
|
5
|
+
var c = ({ title: c, description: l, icon: u, actions: d, className: f }) => {
|
|
6
|
+
let p = null;
|
|
7
|
+
u != null && (p = /* @__PURE__ */ o("div", {
|
|
8
|
+
className: i,
|
|
9
|
+
children: u
|
|
10
|
+
}));
|
|
11
|
+
let m = null;
|
|
12
|
+
return d != null && (m = /* @__PURE__ */ o("div", {
|
|
13
|
+
className: t,
|
|
14
|
+
children: d
|
|
15
|
+
})), /* @__PURE__ */ s(e, {
|
|
16
|
+
className: f,
|
|
17
|
+
contentClassName: n,
|
|
18
|
+
children: [
|
|
19
|
+
p,
|
|
20
|
+
/* @__PURE__ */ o("h2", {
|
|
21
|
+
className: a,
|
|
22
|
+
children: c
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ o("p", {
|
|
25
|
+
className: r,
|
|
26
|
+
children: l
|
|
27
|
+
}),
|
|
28
|
+
m
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { c as EmptyState, c as default };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../../../src/atomic/molecules/empty-state/EmptyState.tsx"],"sourcesContent":["import { type JSX, type ReactNode } from 'react';\n\nimport { Card } from '../card/Card.js';\nimport * as styles from './EmptyState.css.js';\n\ntype Props = {\n title: string;\n description: ReactNode;\n icon?: ReactNode;\n actions?: ReactNode;\n className?: string;\n};\n\nexport const EmptyState = ({\n title,\n description,\n icon,\n actions,\n className,\n}: Props): JSX.Element => {\n let iconElement: JSX.Element | null = null;\n if (icon != null) {\n iconElement = <div className={styles.icon}>{icon}</div>;\n }\n\n let actionsElement: JSX.Element | null = null;\n if (actions != null) {\n actionsElement = <div className={styles.actions}>{actions}</div>;\n }\n\n return (\n <Card className={className} contentClassName={styles.content}>\n {iconElement}\n <h2 className={styles.title}>{title}</h2>\n <p className={styles.description}>{description}</p>\n {actionsElement}\n </Card>\n );\n};\n\nexport default EmptyState;\n"],"mappings":";;;;AAaA,IAAa,KAAc,EACzB,OAAA,GACA,aAAA,GACA,MAAA,GACA,SAAA,GACA,mBACwB;CACxB,IAAI,IAAkC;AACtC,CAAI,KAAQ,SACV,IAAc,kBAAC,OAAD;EAAK,WAAW;YAAc;EAAW,CAAA;CAGzD,IAAI,IAAqC;AAKzC,QAJI,KAAW,SACb,IAAiB,kBAAC,OAAD;EAAK,WAAW;YAAiB;EAAc,CAAA,GAIhE,kBAAC,GAAD;EAAiB;EAAW,kBAAkB;YAA9C;GACG;GACD,kBAAC,MAAD;IAAI,WAAW;cAAe;IAAW,CAAA;GACzC,kBAAC,KAAD;IAAG,WAAW;cAAqB;IAAgB,CAAA;GAClD;GACI"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
+
/* empty css */
|
|
2
3
|
/* empty css */
|
|
3
4
|
//#region src/atomic/molecules/markdown/components/MarkdownLink.css.ts
|
|
4
5
|
var e = "xtwkbg1 xtwkbg0 txvbqb3d txvbqb6b txvbqb78 txvbqb6x txvbqb7m txvbqbut6", t = "xtwkbg3 xtwkbg1 xtwkbg0 txvbqb3d txvbqb6b txvbqb78 txvbqb6x txvbqb7m txvbqbut6 xtwkbg2 txvbqbco txvbqb9jf txvbqbanx", n = "xtwkbg5 xtwkbg4 txvbqb9jf", r = "xtwkbg7 xtwkbg6 txvbqbf txvbqb3b";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { cx as e } from "../../../theme/tools.js";
|
|
2
|
+
import { ChevronDownSvg as t } from "../../../icons/ChevronDownSvg.js";
|
|
3
|
+
import { ProfileDropdownLogoutSvg as n } from "../../../icons/ProfileDropdownLogoutSvg.js";
|
|
4
|
+
import { ProfileDropdownOrganizationSvg as r } from "../../../icons/ProfileDropdownOrganizationSvg.js";
|
|
5
|
+
import { avatar as i, chevron as a, chevronOpen as o, container as s, dropdown as c, menuIcon as l, menuItem as u, menuLabel as d, organizationName as f, selectButton as p, selectContent as m, selectText as h, userName as g } from "./profileDropdown.css.js";
|
|
6
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
|
+
import { useEffect as y, useRef as b, useState as x } from "react";
|
|
8
|
+
import { Link as S } from "@plumile/router";
|
|
9
|
+
//#region src/atomic/molecules/profile_dropdown/ProfileDropdown.tsx
|
|
10
|
+
var C = {
|
|
11
|
+
menuAriaLabel: "User menu",
|
|
12
|
+
profileSecurity: "Profile & Security",
|
|
13
|
+
switchOrganizations: "Switch Organizations",
|
|
14
|
+
signOut: "Sign Out"
|
|
15
|
+
}, w = (w) => {
|
|
16
|
+
let [T, E] = x(!1), D = b(null), { viewer: O, organization: k, labels: A = C } = w, j = () => {
|
|
17
|
+
E((e) => !e);
|
|
18
|
+
}, M = () => {
|
|
19
|
+
E(!1);
|
|
20
|
+
};
|
|
21
|
+
y(() => {
|
|
22
|
+
let e = (e) => {
|
|
23
|
+
D.current != null && !D.current.contains(e.target) && E(!1);
|
|
24
|
+
};
|
|
25
|
+
return document.addEventListener("mousedown", e), () => {
|
|
26
|
+
document.removeEventListener("mousedown", e);
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
let N = [O.firstName, O.lastName].filter((e) => e.trim().length > 0).join(" "), P = null;
|
|
30
|
+
return T && (P = /* @__PURE__ */ v("div", {
|
|
31
|
+
className: c,
|
|
32
|
+
role: "menu",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ v(S, {
|
|
35
|
+
to: w.profilePath,
|
|
36
|
+
className: u,
|
|
37
|
+
onClick: M,
|
|
38
|
+
children: [/* @__PURE__ */ _("span", {
|
|
39
|
+
className: l,
|
|
40
|
+
children: /* @__PURE__ */ _(r, {
|
|
41
|
+
width: 16,
|
|
42
|
+
height: 16
|
|
43
|
+
})
|
|
44
|
+
}), /* @__PURE__ */ _("span", {
|
|
45
|
+
className: d,
|
|
46
|
+
children: A.profileSecurity
|
|
47
|
+
})]
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ v(S, {
|
|
50
|
+
to: k.switchPath,
|
|
51
|
+
className: u,
|
|
52
|
+
onClick: M,
|
|
53
|
+
children: [/* @__PURE__ */ _("span", {
|
|
54
|
+
className: l,
|
|
55
|
+
children: /* @__PURE__ */ _(r, {
|
|
56
|
+
width: 16,
|
|
57
|
+
height: 16
|
|
58
|
+
})
|
|
59
|
+
}), /* @__PURE__ */ _("span", {
|
|
60
|
+
className: d,
|
|
61
|
+
children: A.switchOrganizations
|
|
62
|
+
})]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ v("button", {
|
|
65
|
+
className: u,
|
|
66
|
+
onClick: () => {
|
|
67
|
+
w.onSignOut?.(), M();
|
|
68
|
+
},
|
|
69
|
+
type: "button",
|
|
70
|
+
role: "menuitem",
|
|
71
|
+
children: [/* @__PURE__ */ _("span", {
|
|
72
|
+
className: l,
|
|
73
|
+
children: /* @__PURE__ */ _(n, {
|
|
74
|
+
width: 16,
|
|
75
|
+
height: 16
|
|
76
|
+
})
|
|
77
|
+
}), /* @__PURE__ */ _("span", {
|
|
78
|
+
className: d,
|
|
79
|
+
children: A.signOut
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})), /* @__PURE__ */ v("div", {
|
|
84
|
+
className: e(s, w.className),
|
|
85
|
+
ref: D,
|
|
86
|
+
children: [/* @__PURE__ */ v("button", {
|
|
87
|
+
className: p,
|
|
88
|
+
onClick: j,
|
|
89
|
+
"aria-expanded": T,
|
|
90
|
+
"aria-haspopup": "menu",
|
|
91
|
+
"aria-label": A.menuAriaLabel,
|
|
92
|
+
type: "button",
|
|
93
|
+
children: [/* @__PURE__ */ v("span", {
|
|
94
|
+
className: m,
|
|
95
|
+
children: [/* @__PURE__ */ _("span", {
|
|
96
|
+
className: i,
|
|
97
|
+
children: O.initials
|
|
98
|
+
}), /* @__PURE__ */ v("span", {
|
|
99
|
+
className: h,
|
|
100
|
+
children: [/* @__PURE__ */ _("span", {
|
|
101
|
+
className: g,
|
|
102
|
+
children: N
|
|
103
|
+
}), /* @__PURE__ */ _("span", {
|
|
104
|
+
className: f,
|
|
105
|
+
children: k.name
|
|
106
|
+
})]
|
|
107
|
+
})]
|
|
108
|
+
}), /* @__PURE__ */ _(t, {
|
|
109
|
+
width: 16,
|
|
110
|
+
height: 16,
|
|
111
|
+
className: e(a, { [o]: T })
|
|
112
|
+
})]
|
|
113
|
+
}), P]
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
//#endregion
|
|
117
|
+
export { w as ProfileDropdown, w as default };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=ProfileDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileDropdown.js","names":[],"sources":["../../../../../src/atomic/molecules/profile_dropdown/ProfileDropdown.tsx"],"sourcesContent":["import { useEffect, useRef, useState, type JSX } from 'react';\nimport { Link } from '@plumile/router';\n\nimport { ChevronDownSvg } from '../../../icons/ChevronDownSvg.js';\nimport { ProfileDropdownLogoutSvg } from '../../../icons/ProfileDropdownLogoutSvg.js';\nimport { ProfileDropdownOrganizationSvg } from '../../../icons/ProfileDropdownOrganizationSvg.js';\nimport { cx } from '../../../theme/tools.js';\nimport * as classes from './profileDropdown.css.js';\n\ntype Props = {\n viewer: {\n firstName: string;\n lastName: string;\n initials: string;\n };\n profilePath: string;\n organization: {\n name: string;\n switchPath: string;\n };\n labels?: {\n menuAriaLabel: string;\n profileSecurity: string;\n switchOrganizations: string;\n signOut: string;\n };\n className?: string;\n onSignOut?: () => void;\n};\n\nconst DEFAULT_LABELS = {\n menuAriaLabel: 'User menu',\n profileSecurity: 'Profile & Security',\n switchOrganizations: 'Switch Organizations',\n signOut: 'Sign Out',\n};\n\nexport const ProfileDropdown = (props: Props): JSX.Element | null => {\n const [isOpen, setIsOpen] = useState(false);\n const dropdownRef = useRef<HTMLDivElement>(null);\n\n const { viewer, organization, labels = DEFAULT_LABELS } = props;\n\n const toggleDropdown = (): void => {\n setIsOpen((prev) => {\n return !prev;\n });\n };\n\n const closeDropdown = (): void => {\n setIsOpen(false);\n };\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent): void => {\n if (\n dropdownRef.current != null &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsOpen(false);\n }\n };\n\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, []);\n\n const displayNameParts = [viewer.firstName, viewer.lastName].filter(\n (part) => {\n return part.trim().length > 0;\n },\n );\n const userDisplayName = displayNameParts.join(' ');\n\n let dropdownMenu: JSX.Element | null = null;\n if (isOpen) {\n dropdownMenu = (\n <div className={classes.dropdown} role=\"menu\">\n <Link\n to={props.profilePath}\n className={classes.menuItem}\n onClick={closeDropdown}\n >\n <span className={classes.menuIcon}>\n <ProfileDropdownOrganizationSvg width={16} height={16} />\n </span>\n <span className={classes.menuLabel}>{labels.profileSecurity}</span>\n </Link>\n <Link\n to={organization.switchPath}\n className={classes.menuItem}\n onClick={closeDropdown}\n >\n <span className={classes.menuIcon}>\n <ProfileDropdownOrganizationSvg width={16} height={16} />\n </span>\n <span className={classes.menuLabel}>\n {labels.switchOrganizations}\n </span>\n </Link>\n\n <button\n className={classes.menuItem}\n onClick={() => {\n props.onSignOut?.();\n closeDropdown();\n }}\n type=\"button\"\n role=\"menuitem\"\n >\n <span className={classes.menuIcon}>\n <ProfileDropdownLogoutSvg width={16} height={16} />\n </span>\n <span className={classes.menuLabel}>{labels.signOut}</span>\n </button>\n </div>\n );\n }\n\n return (\n <div className={cx(classes.container, props.className)} ref={dropdownRef}>\n <button\n className={classes.selectButton}\n onClick={toggleDropdown}\n aria-expanded={isOpen}\n aria-haspopup=\"menu\"\n aria-label={labels.menuAriaLabel}\n type=\"button\"\n >\n <span className={classes.selectContent}>\n <span className={classes.avatar}>{viewer.initials}</span>\n <span className={classes.selectText}>\n <span className={classes.userName}>{userDisplayName}</span>\n <span className={classes.organizationName}>\n {organization.name}\n </span>\n </span>\n </span>\n <ChevronDownSvg\n width={16}\n height={16}\n className={cx(classes.chevron, {\n [classes.chevronOpen]: isOpen,\n })}\n />\n </button>\n\n {dropdownMenu}\n </div>\n );\n};\n\nexport default ProfileDropdown;\n"],"mappings":";;;;;;;;;AA8BA,IAAM,IAAiB;CACrB,eAAe;CACf,iBAAiB;CACjB,qBAAqB;CACrB,SAAS;CACV,EAEY,KAAmB,MAAqC;CACnE,IAAM,CAAC,GAAQ,KAAa,EAAS,GAAM,EACrC,IAAc,EAAuB,KAAK,E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B,EAAO;KAAe,CAAA,CACpD;;GACL;MAKR,kBAAC,OAAD;EAAK,WAAW,EAAG,GAAmB,EAAM,UAAU;EAAE,KAAK;YAA7D,CACE,kBAAC,UAAD;GACE,WAAW;GACX,SAAS;GACT,iBAAe;GACf,iBAAc;GACd,cAAY,EAAO;GACnB,MAAK;aANP,CAQE,kBAAC,QAAD;IAAM,WAAW;cAAjB,CACE,kBAAC,QAAD;KAAM,WAAW;eAAiB,EAAO;KAAgB,CAAA,EACzD,kBAAC,QAAD;KAAM,WAAW;eAAjB,CACE,kBAAC,QAAD;MAAM,WAAW;gBAAmB;MAAuB,CAAA,EAC3D,kBAAC,QAAD;MAAM,WAAW;gBACd,EAAa;MACT,CAAA,CACF;OACF;OACP,kBAAC,GAAD;IACE,OAAO;IACP,QAAQ;IACR,WAAW,EAAG,GAAiB,GAC5B,IAAsB,GACxB,CAAC;IACF,CAAA,CACK;MAER,EACG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
//#region src/atomic/molecules/profile_dropdown/profileDropdown.css.ts
|
|
4
|
+
var e = "_1vukrf60 txvbqbpsf txvbqbu6f", t = "_1vukrf61 txvbqbnv6 txvbqboif txvbqbp5f txvbqblx6 txvbqb9io txvbqbco txvbqbdoo txvbqbu6f txvbqb1rx txvbqbv4h txvbqbv txvbqbt5o txvbqb1co txvbqb1qf txvbqbwo", n = "_1vukrf62 txvbqb9io txvbqbco txvbqbaof txvbqb9mx txvbqbk4x", r = "_1vukrf63 txvbqb9io txvbqbco txvbqbdnx txvbqbtx6 txvbqbc6o txvbqb1sx txvbqbuy6 txvbqbv9z txvbqb8o txvbqbamo txvbqb66", i = "_1vukrf64 txvbqb9io txvbqbai6 txvbqbk4x", a = "_1vukrf65 txvbqbps6 txvbqbthf txvbqbdpf txvbqbiio txvbqbuso txvbqbkgo txvbqbv4h txvbqb1ro txvbqb1co txvbqb1qf txvbqb106 txvbqbuux txvbqbl9x txvbqb8s6", o = "_1vukrf66 txvbqb8x txvbqbamo txvbqbv53 txvbqbuw6 txvbqbl6f txvbqbt6f", s = "_1vukrf67 txvbqb8o txvbqbamo txvbqbv53 txvbqbvar txvbqbuw6 txvbqbl6f txvbqbt6f", c = "_1vukrf69 _1vukrf68 txvbqbnv6 txvbqboif txvbqbp5f txvbqblx6 txvbqb77 txvbqb6x txvbqb7k txvbqb9io txvbqbco txvbqbu6f txvbqb12f txvbqb1px txvbqbuzj txvbqb1rf txvbqbv txvbqbt5o txvbqb3b txvbqbva3 txvbqb8x txvbqbamo", l = "_1vukrf6a txvbqb9io txvbqbco txvbqbdnx txvbqbha6 txvbqbv4z", u = "_1vukrf6b txvbqb9mx txvbqbuw6", d = "_1vukrf6c txvbqbv9p txvbqb7g txvbqb6x txvbqb7k", f = "_1vukrf6d txvbqb2w";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { r as avatar, d as chevron, f as chevronOpen, e as container, a as dropdown, l as menuIcon, c as menuItem, u as menuLabel, s as organizationName, t as selectButton, n as selectContent, i as selectText, o as userName };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=profileDropdown.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileDropdown.css.js","names":[],"sources":["../../../../../src/atomic/molecules/profile_dropdown/profileDropdown.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { sprinkles } from '../../../theme/sprinkles.css.js';\nimport { vars } from '../../../theme/themeContract.js';\n\nexport const container = sprinkles({\n position: 'relative',\n width: 'full',\n});\n\nexport const selectButton = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: 'full',\n paddingY: 2,\n paddingX: 3,\n borderRadius: 'xl',\n backgroundColor: 'brandWhite',\n cursor: 'pointer',\n textAlign: 'left',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'borderSubtle',\n});\n\nexport const selectContent = sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 3,\n flex: 1,\n minWidth: 0,\n});\n\nexport const avatar = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 8,\n height: 8,\n borderRadius: '1/2',\n backgroundImage: 'brandDiagonal',\n color: 'brandWhite',\n fontSize: 'xs',\n fontWeight: 'semibold',\n textTransform: 'uppercase',\n});\n\nexport const selectText = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n});\n\nexport const dropdown = sprinkles({\n position: 'absolute',\n top: 'full',\n left: 0,\n marginTop: 1.5,\n width: 'max',\n minWidth: 'full',\n backgroundColor: 'brandWhite',\n borderRadius: 'lg',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'brandPrimaryRed',\n zIndex: 30,\n padding: 2,\n boxShadow: 'profileDropdownShadow',\n});\n\nexport const userName = sprinkles({\n fontSize: 'sm',\n fontWeight: 'semibold',\n color: 'black',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n});\n\nexport const organizationName = sprinkles({\n fontSize: 'xs',\n fontWeight: 'semibold',\n color: 'black',\n opacity: 50,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n});\n\nexport const menuItem = style([\n sprinkles({\n transitionProperty: 'default',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n display: 'flex',\n alignItems: 'center',\n width: 'full',\n paddingY: 2,\n paddingX: 3,\n borderWidth: 0,\n borderStyle: 'none',\n backgroundColor: 'transparent',\n borderRadius: 'md',\n cursor: 'pointer',\n textAlign: 'left',\n textDecoration: 'none',\n color: 'brandDarkGray',\n fontSize: 'sm',\n fontWeight: 'semibold',\n }),\n {\n selectors: {\n '& + &': {\n marginTop: vars.spacing[1],\n },\n },\n ':hover': {\n backgroundColor: vars.colors.brandLightGray,\n color: vars.colors.brandPrimaryRed,\n textDecoration: 'none',\n },\n ':focus-visible': {\n outline: 'none',\n boxShadow: `0 0 0 2px ${vars.colors.brandPrimaryRed}`,\n },\n },\n]);\n\nexport const menuIcon = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 3,\n color: 'current',\n});\n\nexport const menuLabel = sprinkles({\n flex: 1,\n whiteSpace: 'nowrap',\n});\n\nexport const chevron = sprinkles({\n color: 'brandPrimaryRed',\n transitionProperty: 'transform',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n});\n\nexport const chevronOpen = sprinkles({\n rotate: 180,\n});\n"],"mappings":""}
|
|
@@ -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":";;;;;;;;;AAqDA,IAAM,KAAsB,EAC1B,OACA,eACA,kBAKiB;CACjB,IAAI,IAEA;AAKJ,QAJI,MACF,IAAsB,aAItB,kBAAC,OAAD;EACM;EACJ,eAAa,CAAC;EACd,WAAW,EACT,GACA,EAA8B,EAAE,OAAO,GAAqB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I,KAAwB,KAAkB,SAC5C,IACE,kBAAC,GAAD;IAAoB,IAAI;IAA4B;cACjD,EAAW,KAAK,MAAU;KACzB,IAAI,IAA8B;AAClC,KAAI,EAAM,QAAQ,SAChB,IACE,kBAAC,QAAD;MAAM,WAAW;gBAAmB,EAAM;MAAY,CAAA;KAI1D,IAAI,IAIA;AAKJ,YAJI,EAAa,EAAM,GAAG,KACxB,IAAa,WAIb,kBAAC,OAAD;MAAqB,WAAW;gBAC9B,kBAAC,GAAD;OACE,IAAI,EAAM;OACV,WAAW,EAAuB,EAAE,OAAO,GAAY,CAAC;OACxD,cAAY,EAAM;iBAHpB,CAKG,GACD,kBAAC,QAAD;QAAM,WAAW;kBAAoB,EAAM;QAAa,CAAA,CACnD;;MACH,EATI,EAAM,IASV;MAER;IACiB,CAAA,GAKvB,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;IAAK,WAAW;cAAhB,CACG,GACA,EACG;OACL,EACG,EAAA,EANI,EAAK,IAMT;IAER;EACe,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,8 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
//#region src/components/agent/AgentMarkdownCard.css.ts
|
|
4
|
+
var e = "_1dmt4ev0 txvbqb9io txvbqbunx txvbqbai6 txvbqbao6", t = "_1dmt4ev1 txvbqbfbo txvbqb9f txvbqbamo", n = "_1dmt4ev2 txvbqb8x txvbqb1o txvbqbfbo";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as container, n as emptyMessage, t as title };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=AgentMarkdownCard.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentMarkdownCard.css.js","names":[],"sources":["../../../../src/components/agent/AgentMarkdownCard.css.ts"],"sourcesContent":["import { sprinkles } from '../../theme/sprinkles.css.js';\n\nexport const container = sprinkles({\n display: 'flex',\n width: '4/5',\n flexDirection: 'column',\n gap: 2,\n});\n\nexport const title = sprinkles({\n margin: 0,\n fontSize: 'lg',\n fontWeight: 'semibold',\n});\n\nexport const emptyMessage = sprinkles({\n fontSize: 'sm',\n fontStyle: 'italic',\n margin: 0,\n});\n"],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MarkdownRenderer as e } from "../../atomic/molecules/markdown/MarkdownRenderer.js";
|
|
2
|
+
import { sanitizeAgentMarkdown as t } from "../../shared/agentText.js";
|
|
3
|
+
import { container as n, emptyMessage as r } from "./AgentMarkdownCard.css.js";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/agent/AgentMarkdownCard.tsx
|
|
6
|
+
var a = ({ content: a, emptyMessage: o }) => {
|
|
7
|
+
let s = t(a), c;
|
|
8
|
+
return c = s == null ? /* @__PURE__ */ i("p", {
|
|
9
|
+
className: r,
|
|
10
|
+
children: o
|
|
11
|
+
}) : /* @__PURE__ */ i(e, { content: s }), /* @__PURE__ */ i("div", {
|
|
12
|
+
className: n,
|
|
13
|
+
children: c
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { a as AgentMarkdownCard, a as default };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=AgentMarkdownCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentMarkdownCard.js","names":[],"sources":["../../../../src/components/agent/AgentMarkdownCard.tsx"],"sourcesContent":["import { type JSX } from 'react';\n\nimport { MarkdownRenderer } from '../../atomic/molecules/markdown/MarkdownRenderer.js';\nimport { sanitizeAgentMarkdown } from '../../shared/agentText.js';\nimport * as styles from './AgentMarkdownCard.css.js';\n\ntype Props = {\n title: string;\n content: string;\n emptyMessage: string;\n};\n\nexport const AgentMarkdownCard = ({\n content,\n emptyMessage,\n}: Props): JSX.Element => {\n const sanitizedContent = sanitizeAgentMarkdown(content);\n\n let body: JSX.Element;\n\n if (sanitizedContent != null) {\n body = <MarkdownRenderer content={sanitizedContent} />;\n } else {\n body = <p className={styles.emptyMessage}>{emptyMessage}</p>;\n }\n\n return <div className={styles.container}>{body}</div>;\n};\n\nexport default AgentMarkdownCard;\n"],"mappings":";;;;;AAYA,IAAa,KAAqB,EAChC,YACA,cAAA,QACwB;CACxB,IAAM,IAAmB,EAAsB,EAAQ,EAEnD;AAQJ,QANA,AACE,IADE,KAAoB,OAGf,kBAAC,KAAD;EAAG,WAAW;YAAsB;EAAiB,CAAA,GAFrD,kBAAC,GAAD,EAAkB,SAAS,GAAoB,CAAA,EAKjD,kBAAC,OAAD;EAAK,WAAW;YAAmB;EAAW,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PageShell as e } from "../layout/PageShell.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/organization_layout/OrganizationLayout.tsx
|
|
4
|
+
var n = ({ actions: n, breadcrumb: r, breadcrumbItems: i, children: a, contentClassName: o, sidebar: s, sidePanel: c }) => /* @__PURE__ */ t(e, {
|
|
5
|
+
sidebar: s,
|
|
6
|
+
breadcrumb: i,
|
|
7
|
+
breadcrumbSlot: r,
|
|
8
|
+
actions: n,
|
|
9
|
+
sidePanel: c,
|
|
10
|
+
contentClassName: o,
|
|
11
|
+
children: a
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as OrganizationLayout, n as default };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=OrganizationLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationLayout.js","names":[],"sources":["../../../../src/components/organization_layout/OrganizationLayout.tsx"],"sourcesContent":["import { type JSX, type ReactNode } from 'react';\n\nimport {\n PageShell,\n type BreadcrumbItem,\n type PageShellActions,\n} from '../layout/PageShell.js';\n\ntype Props = {\n children: ReactNode;\n sidebar: ReactNode;\n breadcrumbItems?: BreadcrumbItem[];\n breadcrumb?: ReactNode;\n actions?: PageShellActions;\n sidePanel?: ReactNode;\n contentClassName?: string;\n};\n\nconst OrganizationLayout = ({\n actions,\n breadcrumb,\n breadcrumbItems,\n children,\n contentClassName,\n sidebar,\n sidePanel,\n}: Props): JSX.Element => {\n return (\n <PageShell\n sidebar={sidebar}\n breadcrumb={breadcrumbItems}\n breadcrumbSlot={breadcrumb}\n actions={actions}\n sidePanel={sidePanel}\n contentClassName={contentClassName}\n >\n {children}\n </PageShell>\n );\n};\n\nexport { OrganizationLayout };\nexport default OrganizationLayout;\n"],"mappings":";;;AAkBA,IAAM,KAAsB,EAC1B,YACA,eACA,oBACA,aACA,qBACA,YACA,mBAGE,kBAAC,GAAD;CACW;CACT,YAAY;CACZ,gBAAgB;CACP;CACE;CACO;CAEjB;CACS,CAAA"}
|