@espressif/dashboard-ui-components 1.14.1 → 1.15.0
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/.claude/rules/dashboard-ui-consumption.md +33 -0
- package/CHANGELOG.md +37 -0
- package/dist/common/index.d.ts +3 -3
- package/dist/common/my-account-menu/my-account-menu.js +3 -3
- package/dist/components/async-multi-select/async-multi-select.js +4 -8
- package/dist/components/async-multi-select/index.d.ts +5 -1
- package/dist/components/breadcrumb/index.d.ts +4 -1
- package/dist/components/cards/index.d.ts +1 -1
- package/dist/components/cards/section-card.js +2 -2
- package/dist/components/carousel/carousel.js +8 -4
- package/dist/components/carousel/index.d.ts +8 -0
- package/dist/components/combobox/index.d.ts +3 -1
- package/dist/components/coverflow/coverflow.js +3 -2
- package/dist/components/coverflow/index.d.ts +2 -0
- package/dist/components/data-table/data-table.js +8 -4
- package/dist/components/data-table/index.d.ts +5 -1
- package/dist/components/date-range-picker/date-range-picker.js +5 -5
- package/dist/components/date-range-picker/index.d.ts +9 -1
- package/dist/components/dialog/index.d.ts +3 -1
- package/dist/components/facet-filters/active-filters.js +2 -1
- package/dist/components/facet-filters/filter-group.js +2 -1
- package/dist/components/facet-filters/index.d.ts +4 -0
- package/dist/components/file-upload/file-upload.js +2 -2
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/index.d.ts +5 -5
- package/dist/components/key-value-manager/index.d.ts +8 -0
- package/dist/components/key-value-manager/key-value-manager-table.js +4 -4
- package/dist/components/key-value-manager/key-value-manager.js +5 -1
- package/dist/components/key-value-manager/key-value-manager.props.js +5 -1
- package/dist/components/list-details/index.d.ts +1 -1
- package/dist/components/nav-bar/index.d.ts +19 -2
- package/dist/components/nav-bar/nav-bar-mobile-menu.js +4 -3
- package/dist/components/nav-bar/nav-bar.js +10 -7
- package/dist/components/sheet/index.d.ts +3 -1
- package/dist/components/sidebar/index.d.ts +13 -6
- package/dist/components/sidebar/sidebar.js +4 -2
- package/dist/components/simple-paginated-list/index.d.ts +11 -2
- package/dist/components/simple-paginated-list/simple-paginated-list.js +3 -3
- package/dist/components/stat-card/index.d.ts +2 -0
- package/dist/components/stat-card/stat-card.js +2 -2
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/tag.js +2 -2
- package/dist/components/tag-input/index.d.ts +5 -0
- package/dist/components/tag-input/tag-input.js +5 -3
- package/dist/components/transfer-list/index.d.ts +22 -2
- package/dist/components/transfer-list/transfer-list.js +30 -8
- package/dist/components/user-type-badge/index.d.ts +2 -0
- package/dist/components/user-type-badge/user-type-badge.js +3 -2
- package/dist/core/animate-ui/components/radix/dialog.js +2 -2
- package/dist/core/animate-ui/components/radix/sheet.js +3 -3
- package/dist/core/animate-ui/components/radix/sidebar.js +4 -4
- package/dist/core/breadcrumb.js +2 -2
- package/dist/core/combobox/combobox.js +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/layouts/index.d.ts +81 -35
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +8 -2
- package/dist/layouts/shared/account-menu-props.js +3 -2
- package/dist/layouts/workspace-layout/account-menu/account-menu.js +19 -8
- package/dist/layouts/workspace-layout/breadcrumbs/workspace-breadcrumbs.js +14 -11
- package/dist/layouts/workspace-layout/header/header.js +3 -3
- package/dist/layouts/workspace-layout/workspace-layout.js +13 -5
- package/dist/{my-account-menu.props-C7DK71WC.d.ts → my-account-menu.props-V3kFdvCZ.d.ts} +2 -0
- package/dist/{section-card-DqQeQkzU.d.ts → section-card-Bs3sKQtv.d.ts} +6 -1
- package/dist/{types-CkXflqg7.d.ts → types-CoZOfz4S.d.ts} +12 -1
- package/package.json +1 -1
|
@@ -14,8 +14,9 @@ var userTypeBadgeSizeVariants = cva("inline-flex type-caption font-medium tracki
|
|
|
14
14
|
defaultVariants: { size: "default" }
|
|
15
15
|
});
|
|
16
16
|
var userTypeBadgeMetallicClasses = cn("relative isolate overflow-hidden border border-white/20", "shadow-[inset_0_1px_0_rgba(255,255,255,0.30),inset_0_-1px_0_rgba(0,0,0,0.22)]", "before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit]", "before:bg-[linear-gradient(135deg,rgba(255,255,255,0.24)_0%,rgba(255,255,255,0.04)_36%,rgba(0,0,0,0.16)_72%,rgba(255,255,255,0.12)_100%)]", "after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:border after:border-white/15", "after:bg-[linear-gradient(315deg,rgba(255,255,255,0.24)_0%,rgba(255,255,255,0.04)_36%,rgba(0,0,0,0.16)_72%,rgba(255,255,255,0.12)_100%)]", "after:opacity-0 after:transition-opacity after:duration-[1800ms] after:ease-in-out hover:after:opacity-100");
|
|
17
|
-
var UserTypeBadge = React$1.forwardRef(({ userType, size = "default", className, radius, ...props }, ref) => {
|
|
18
|
-
const { color, icon: Icon, label } = userTypeBadgeRegistry[userType];
|
|
17
|
+
var UserTypeBadge = React$1.forwardRef(({ userType, size = "default", className, radius, label: labelProp, ...props }, ref) => {
|
|
18
|
+
const { color, icon: Icon, label: defaultLabel } = userTypeBadgeRegistry[userType];
|
|
19
|
+
const label = labelProp ?? defaultLabel;
|
|
19
20
|
return /* @__PURE__ */ jsx("div", {
|
|
20
21
|
ref,
|
|
21
22
|
className: "inline-block",
|
|
@@ -20,7 +20,7 @@ function DialogOverlay({ className, ...props }) {
|
|
|
20
20
|
...props
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function DialogContent({ className, children, showCloseButton = true, closeButtonClassName, radius, elevation, density, style, ...props }) {
|
|
23
|
+
function DialogContent({ className, children, showCloseButton = true, closeButtonClassName, closeLabel = "Close", radius, elevation, density, style, ...props }) {
|
|
24
24
|
const axes = useStyleAxes({
|
|
25
25
|
radius,
|
|
26
26
|
elevation
|
|
@@ -41,7 +41,7 @@ function DialogContent({ className, children, showCloseButton = true, closeButto
|
|
|
41
41
|
className: cn("ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 z-50 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", closeButtonClassName),
|
|
42
42
|
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
43
43
|
className: "sr-only",
|
|
44
|
-
children:
|
|
44
|
+
children: closeLabel
|
|
45
45
|
})]
|
|
46
46
|
})]
|
|
47
47
|
})] });
|
|
@@ -35,7 +35,7 @@ function SheetOverlay({ className, ...props }) {
|
|
|
35
35
|
function SheetClose(props) {
|
|
36
36
|
return /* @__PURE__ */ jsx(SheetClose$1, { ...props });
|
|
37
37
|
}
|
|
38
|
-
function SheetContent({ className, children, side = "right", showCloseButton = true, onEscapeKeyDown, onPointerDownOutside, radius, elevation, density, style, ...props }) {
|
|
38
|
+
function SheetContent({ className, children, side = "right", showCloseButton = true, closeLabel = "Close", onEscapeKeyDown, onPointerDownOutside, radius, elevation, density, style, ...props }) {
|
|
39
39
|
const { partStyle } = useStyleAxes({
|
|
40
40
|
radius,
|
|
41
41
|
elevation
|
|
@@ -67,7 +67,7 @@ function SheetContent({ className, children, side = "right", showCloseButton = t
|
|
|
67
67
|
className: closeClassName,
|
|
68
68
|
children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
69
69
|
className: "sr-only",
|
|
70
|
-
children:
|
|
70
|
+
children: closeLabel
|
|
71
71
|
})]
|
|
72
72
|
})]
|
|
73
73
|
})
|
|
@@ -93,7 +93,7 @@ function SheetContent({ className, children, side = "right", showCloseButton = t
|
|
|
93
93
|
className: closeClassName,
|
|
94
94
|
children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
95
95
|
className: "sr-only",
|
|
96
|
-
children:
|
|
96
|
+
children: closeLabel
|
|
97
97
|
})]
|
|
98
98
|
})]
|
|
99
99
|
})] });
|
|
@@ -87,7 +87,7 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
87
87
|
type: "spring",
|
|
88
88
|
stiffness: 350,
|
|
89
89
|
damping: 35
|
|
90
|
-
}, ...props }) {
|
|
90
|
+
}, mobileTitle = "Sidebar", mobileDescription = "Displays the mobile sidebar.", ...props }) {
|
|
91
91
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
92
92
|
if (collapsible === "none") return /* @__PURE__ */ jsx(Highlight, {
|
|
93
93
|
enabled: animateOnHover,
|
|
@@ -116,7 +116,7 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
116
116
|
side,
|
|
117
117
|
children: [/* @__PURE__ */ jsxs(SheetHeader, {
|
|
118
118
|
className: "sr-only",
|
|
119
|
-
children: [/* @__PURE__ */ jsx(SheetTitle, { children:
|
|
119
|
+
children: [/* @__PURE__ */ jsx(SheetTitle, { children: mobileTitle }), /* @__PURE__ */ jsx(SheetDescription, { children: mobileDescription })]
|
|
120
120
|
}), /* @__PURE__ */ jsx(Highlight, {
|
|
121
121
|
enabled: animateOnHover,
|
|
122
122
|
hover: true,
|
|
@@ -163,7 +163,7 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
163
163
|
})]
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
function SidebarTrigger({ className, onClick, ...props }) {
|
|
166
|
+
function SidebarTrigger({ className, onClick, label = "Toggle Sidebar", ...props }) {
|
|
167
167
|
const { toggleSidebar } = useSidebar();
|
|
168
168
|
return /* @__PURE__ */ jsxs(Button, {
|
|
169
169
|
"data-sidebar": "trigger",
|
|
@@ -178,7 +178,7 @@ function SidebarTrigger({ className, onClick, ...props }) {
|
|
|
178
178
|
...props,
|
|
179
179
|
children: [/* @__PURE__ */ jsx(PanelLeftIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
180
180
|
className: "sr-only",
|
|
181
|
-
children:
|
|
181
|
+
children: label
|
|
182
182
|
})]
|
|
183
183
|
});
|
|
184
184
|
}
|
package/dist/core/breadcrumb.js
CHANGED
|
@@ -47,14 +47,14 @@ var BreadcrumbSeparator = ({ children, className, ...props }) => /* @__PURE__ */
|
|
|
47
47
|
children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
|
|
48
48
|
});
|
|
49
49
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
50
|
-
var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs("span", {
|
|
50
|
+
var BreadcrumbEllipsis = ({ className, moreLabel = "More", ...props }) => /* @__PURE__ */ jsxs("span", {
|
|
51
51
|
role: "presentation",
|
|
52
52
|
"aria-hidden": "true",
|
|
53
53
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
54
54
|
...props,
|
|
55
55
|
children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", {
|
|
56
56
|
className: "sr-only",
|
|
57
|
-
children:
|
|
57
|
+
children: moreLabel
|
|
58
58
|
})]
|
|
59
59
|
});
|
|
60
60
|
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
@@ -7,7 +7,7 @@ import * as React$1 from "react";
|
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Check, ChevronsUpDown } from "lucide-react";
|
|
9
9
|
//#region src/core/combobox/combobox.tsx
|
|
10
|
-
function AsyncCombobox({ value, onValueChange, options, onSearchChange, isLoading = false, placeholder = "Select...", emptyText = "No results.", searchPlaceholder = "Search...", label, required, disabled, className, clearable = false, hasMore = false, onLoadMore, radius, border }) {
|
|
10
|
+
function AsyncCombobox({ value, onValueChange, options, onSearchChange, isLoading = false, placeholder = "Select...", emptyText = "No results.", searchPlaceholder = "Search...", label, required, disabled, className, clearable = false, hasMore = false, onLoadMore, loadMoreLabel = "Load more", radius, border }) {
|
|
11
11
|
const axes = useStyleAxes({
|
|
12
12
|
radius,
|
|
13
13
|
border
|
|
@@ -78,7 +78,7 @@ function AsyncCombobox({ value, onValueChange, options, onSearchChange, isLoadin
|
|
|
78
78
|
type: "button",
|
|
79
79
|
className: "type-label text-primary hover:underline w-full text-center",
|
|
80
80
|
onClick: () => onLoadMore(),
|
|
81
|
-
children:
|
|
81
|
+
children: loadMoreLabel
|
|
82
82
|
})
|
|
83
83
|
})
|
|
84
84
|
] })]
|
package/dist/index.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ export { List } from './components/list/index.js';
|
|
|
11
11
|
export { L as LIST_CLASS_NAMES, a as ListGroup, b as ListItem, c as ListItemSize, d as ListItemVariant, e as ListLinkComponentProps, f as ListProps, g as ListRole } from './list.props-DP_xPTqU.js';
|
|
12
12
|
export { ListDetails, ListDetailsItem, ListDetailsLabels, ListDetailsMobileNavigation, ListDetailsProps, ListDetailsTitleListPanelColumnWidth } from './components/list-details/index.js';
|
|
13
13
|
export { Menu, MenuProps } from './components/menu/index.js';
|
|
14
|
-
export { NavBar, NavBarMenuItem, NavBarPosition, NavBarProps } from './components/nav-bar/index.js';
|
|
14
|
+
export { NavBar, NavBarLabels, NavBarMenuItem, NavBarPosition, NavBarProps } from './components/nav-bar/index.js';
|
|
15
15
|
export { Tooltip, TooltipProps } from './components/tooltip/index.js';
|
|
16
16
|
export { T as TooltipContent, a as TooltipContentProps, b as TooltipProvider, c as TooltipProviderProps, d as TooltipRoot, e as TooltipTrigger, f as TooltipTriggerProps } from './tooltip-C0bYa8a3.js';
|
|
17
17
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarPrimitive, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from './components/sidebar/index.js';
|
|
18
|
-
export { S as SidebarEndActionConfig, a as SidebarGroupConfig, b as SidebarItemConfig, c as
|
|
18
|
+
export { S as SidebarEndActionConfig, a as SidebarGroupConfig, b as SidebarItemConfig, c as SidebarLabels, d as SidebarLinkComponentProps, e as SidebarNavEntry, f as SidebarProps, g as SidebarTopLevelLinkConfig, i as isSidebarGroup } from './types-CoZOfz4S.js';
|
|
19
19
|
export { Sheet, SheetClose, SheetCloseProps, SheetContent, SheetContentProps, SheetDescription, SheetDescriptionProps, SheetFooter, SheetFooterProps, SheetHeader, SheetHeaderProps, SheetProps, SheetTitle, SheetTitleProps, SheetTrigger, SheetTriggerProps } from './components/sheet/index.js';
|
|
20
20
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps } from './components/dropdown-menu/index.js';
|
|
21
21
|
export { ScrollArea, ScrollAreaOrientation, ScrollAreaProps, ScrollBar } from './components/scroll-area/index.js';
|
|
@@ -117,7 +117,7 @@ export { StatusBadge, statusBadgeSizeVariants } from './components/status-badge/
|
|
|
117
117
|
export { S as StatusBadgeIcon, a as StatusBadgeProps } from './status-badge.props-BVe8CmQZ.js';
|
|
118
118
|
export { Tag, TagProps } from './components/tag/index.js';
|
|
119
119
|
export { TagInput, TagInputProps } from './components/tag-input/index.js';
|
|
120
|
-
export { TransferItem, TransferList, TransferListProps } from './components/transfer-list/index.js';
|
|
120
|
+
export { TransferItem, TransferList, TransferListLabels, TransferListProps } from './components/transfer-list/index.js';
|
|
121
121
|
export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from './components/dialog/index.js';
|
|
122
122
|
export { Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverGroupProps, PopoverProps, PopoverTrigger } from './components/popover/index.js';
|
|
123
123
|
export { ConfirmationDialog, ConfirmationDialogProps } from './components/confirmation-dialog/index.js';
|
|
@@ -132,7 +132,7 @@ export { DynamicList, DynamicListEntry, DynamicListMetaEntry, DynamicListMetaTyp
|
|
|
132
132
|
export { KeyValueManager, KeyValueManagerFieldMeta, KeyValueManagerItem, KeyValueManagerLabels, KeyValueManagerProps } from './components/key-value-manager/index.js';
|
|
133
133
|
export { RequirementList, RequirementListItem, RequirementListProps, RequirementListSize } from './components/requirement-list/index.js';
|
|
134
134
|
export { SimpleList, SimpleListAvatarSize, SimpleListIconStyle, SimpleListItem, SimpleListItemDirection, SimpleListProps } from './components/simple-list/index.js';
|
|
135
|
-
export { SimplePaginatedList, SimplePaginatedListItem, SimplePaginatedListProps, SimplePaginatedListSize } from './components/simple-paginated-list/index.js';
|
|
135
|
+
export { SimplePaginatedList, SimplePaginatedListItem, SimplePaginatedListLabels, SimplePaginatedListProps, SimplePaginatedListSize } from './components/simple-paginated-list/index.js';
|
|
136
136
|
export { Alert } from './components/alert/index.js';
|
|
137
137
|
export { A as AlertColor, a as AlertIconAvatarVariant, b as AlertProps, c as AlertSize, d as AlertType, e as AlertVariant } from './alert.props-BuLuWmXA.js';
|
|
138
138
|
export { Toast, ToastColor, ToastId, ToastInput, ToastOptions, ToastProps, ToastToasterProps, ToastType, ToastVariant, Toaster, toast } from './components/toast/index.js';
|
|
@@ -147,7 +147,7 @@ export { CircularProgress, CircularProgressProps } from './components/circular-p
|
|
|
147
147
|
export { ProgressBar, ProgressBarProps, ProgressBarSegment } from './components/progress-bar/index.js';
|
|
148
148
|
export { FullSizeError, FullSizeErrorProps, InlineError, InlineErrorProps } from './components/error-display/index.js';
|
|
149
149
|
export { AnimatedCard, AnimatedCardProps, AnimatedCardType, BasicDetailsCard, BasicDetailsCardProps, CollapsibleCard, CollapsibleCardProps, NoDataCard, NoDataCardProps, SimpleCard, SimpleCardProps, animatedCardAnimations, animatedCardTypeKeys } from './components/cards/index.js';
|
|
150
|
-
export { S as SectionCard, a as SectionCardProps, b as SectionCardSize, c as SectionCardVariant } from './section-card-
|
|
150
|
+
export { S as SectionCard, a as SectionCardProps, b as SectionCardSize, c as SectionCardVariant } from './section-card-Bs3sKQtv.js';
|
|
151
151
|
export { IconTextActionCard } from './components/icon-text-action-card/index.js';
|
|
152
152
|
export { I as IconTextActionCardActionsPlacement, a as IconTextActionCardProps, b as IconTextActionCardVariant } from './icon-text-action-card.props-BU7yFi2Q.js';
|
|
153
153
|
export { SimpleClickableCard } from './components/simple-clickable-card/index.js';
|
|
@@ -161,8 +161,8 @@ export { ContentContainer, ContentContainerMaxWidth, ContentContainerProps } fro
|
|
|
161
161
|
export { PageContainer, PageContainerSkeleton, PageContainerSkeletonProps } from './components/page-container/index.js';
|
|
162
162
|
export { G as GoBackLinkData, P as PageContainerMaxWidth, a as PageContainerProps } from './page-container.props-JutTvKFq.js';
|
|
163
163
|
export { AnimatedRainmakerLogo, AnimatedRainmakerLogoProps, AppLogo, CopyrightCard, CopyrightCardProps, FooterCard, MyAccountMenu, PageLoader, ProfileCard, ProfileCardProps } from './common/index.js';
|
|
164
|
-
export { A as AppLogoProps, L as LogoAsset, a as LogoAssetConfig, b as LogoVariantSet, M as MyAccountMenuProps } from './my-account-menu.props-
|
|
165
|
-
export { AccountMenu, AccountMenuProps, BreadcrumbItemConfig, EntryLayout, EntryLayoutProps, LanguageOption, MinimalWorkspaceLayout, MinimalWorkspaceLayoutLabels, MinimalWorkspaceLayoutProps, MinimalWorkspaceSidebarConfig, MinimalWorkspaceSidebarState, MinimalWorkspaceSidebarTrigger, MinimalWorkspaceSidebarTriggerProps, WorkspaceFooter, WorkspaceFooterConfig, WorkspaceFooterProps, WorkspaceHeader, WorkspaceHeaderConfig, WorkspaceHeaderProps, WorkspaceLayout, WorkspaceLayoutProps, WorkspaceSidebarConfig } from './layouts/index.js';
|
|
164
|
+
export { A as AppLogoProps, L as LogoAsset, a as LogoAssetConfig, b as LogoVariantSet, M as MyAccountMenuProps } from './my-account-menu.props-V3kFdvCZ.js';
|
|
165
|
+
export { AccountMenu, AccountMenuLabels, AccountMenuProps, BreadcrumbItemConfig, EntryLayout, EntryLayoutProps, LanguageOption, MinimalWorkspaceLayout, MinimalWorkspaceLayoutLabels, MinimalWorkspaceLayoutProps, MinimalWorkspaceSidebarConfig, MinimalWorkspaceSidebarState, MinimalWorkspaceSidebarTrigger, MinimalWorkspaceSidebarTriggerProps, WorkspaceFooter, WorkspaceFooterConfig, WorkspaceFooterProps, WorkspaceHeader, WorkspaceHeaderConfig, WorkspaceHeaderProps, WorkspaceLayout, WorkspaceLayoutLabels, WorkspaceLayoutProps, WorkspaceSidebarConfig } from './layouts/index.js';
|
|
166
166
|
export { c as cn } from './cn-Cbsgs0XP.js';
|
|
167
167
|
export { u as useControlledState } from './use-controlled-state-BL9NoHu8.js';
|
|
168
168
|
export { b as buttonVariants } from './button-BK-DIR_L.js';
|
package/dist/layouts/index.d.ts
CHANGED
|
@@ -1,16 +1,63 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode, ComponentType, ComponentProps } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
3
|
+
import { e as SidebarNavEntry, d as SidebarLinkComponentProps } from '../types-CoZOfz4S.js';
|
|
4
|
+
export { g as SidebarTopLevelLinkConfig, i as isSidebarGroup } from '../types-CoZOfz4S.js';
|
|
5
5
|
import { a as ListGroup } from '../list.props-DP_xPTqU.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { C as Color, A as AppName } from '../index-BQANnKs9.js';
|
|
7
|
+
import { M as MyAccountMenuProps, a as LogoAssetConfig } from '../my-account-menu.props-V3kFdvCZ.js';
|
|
8
8
|
import { B as Button } from '../button-BxJ7s6sR.js';
|
|
9
9
|
import '../style-axes-DSQ2DGc5.js';
|
|
10
10
|
import '../button-BK-DIR_L.js';
|
|
11
11
|
import 'class-variance-authority/types';
|
|
12
12
|
import 'class-variance-authority';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* The menu's own words, for an app shown in another language. Each one
|
|
16
|
+
* defaults to the English below; the language names are the app's own
|
|
17
|
+
* (`languages[].label`).
|
|
18
|
+
*/
|
|
19
|
+
interface AccountMenuLabels {
|
|
20
|
+
/** The menu button's accessible name. Default "My Account". */
|
|
21
|
+
menu?: string;
|
|
22
|
+
/** The theme submenu's entry. Default "Color theme". */
|
|
23
|
+
colorTheme?: string;
|
|
24
|
+
/** Default "Dark mode". */
|
|
25
|
+
darkMode?: string;
|
|
26
|
+
/** Default "Light mode". */
|
|
27
|
+
lightMode?: string;
|
|
28
|
+
/** The language submenu's entry. Default "Language". */
|
|
29
|
+
language?: string;
|
|
30
|
+
/** Default "Logout". */
|
|
31
|
+
logout?: string;
|
|
32
|
+
}
|
|
33
|
+
interface AccountMenuProps {
|
|
34
|
+
userName?: string;
|
|
35
|
+
userEmail?: string;
|
|
36
|
+
userProfilePictureUrl?: string;
|
|
37
|
+
/** The avatar's fill behind the initial (the trigger's and the profile card's); default `primary`. */
|
|
38
|
+
avatarColor?: Color;
|
|
39
|
+
avatarBadgeColor?: Color;
|
|
40
|
+
onLogoutClick?: () => void;
|
|
41
|
+
onProfileCardClick?: () => void;
|
|
42
|
+
onColorThemeChange?: (theme: "light" | "dark") => void;
|
|
43
|
+
colorTheme?: "light" | "dark";
|
|
44
|
+
onLanguageChange?: (language: string) => void;
|
|
45
|
+
languages?: {
|
|
46
|
+
code: string;
|
|
47
|
+
label: string;
|
|
48
|
+
}[];
|
|
49
|
+
currentLanguage?: string;
|
|
50
|
+
additionalItems?: ListGroup[];
|
|
51
|
+
/** The menu's own words (theme, language, log out); English by default. */
|
|
52
|
+
labels?: AccountMenuLabels;
|
|
53
|
+
/** See `MyAccountMenuProps.triggerVariant`; default `avatar`. */
|
|
54
|
+
triggerVariant?: MyAccountMenuProps["triggerVariant"];
|
|
55
|
+
/** Menu placement; default `bottom`. */
|
|
56
|
+
side?: MyAccountMenuProps["side"];
|
|
57
|
+
/** Menu alignment; default `end`. */
|
|
58
|
+
align?: MyAccountMenuProps["align"];
|
|
59
|
+
}
|
|
60
|
+
|
|
14
61
|
interface WorkspaceSidebarConfig {
|
|
15
62
|
/**
|
|
16
63
|
* Each entry is a {@link SidebarNavEntry}: a collapsible group (`items`) or a
|
|
@@ -69,6 +116,19 @@ interface LanguageOption {
|
|
|
69
116
|
code: string;
|
|
70
117
|
label: string;
|
|
71
118
|
}
|
|
119
|
+
/** The layout's own words, for an app in another language. English by default. */
|
|
120
|
+
interface WorkspaceLayoutLabels {
|
|
121
|
+
/** The header's sidebar toggle (desktop and mobile). Default "Toggle Sidebar". */
|
|
122
|
+
toggleSidebar?: string;
|
|
123
|
+
/** The close button in the mobile sidebar sheet. Default "Close sidebar". */
|
|
124
|
+
closeSidebar?: string;
|
|
125
|
+
/** Screen-reader title of the mobile sidebar sheet. Default "Sidebar". */
|
|
126
|
+
sidebarTitle?: string;
|
|
127
|
+
/** Screen-reader description of the mobile sidebar sheet. Default "Displays the mobile sidebar.". */
|
|
128
|
+
sidebarDescription?: string;
|
|
129
|
+
/** Name of the header's breadcrumb landmark. Default "breadcrumb". */
|
|
130
|
+
breadcrumbs?: string;
|
|
131
|
+
}
|
|
72
132
|
interface WorkspaceLayoutProps {
|
|
73
133
|
/**
|
|
74
134
|
* Internal preset key. When set, the sidebar/mobile logo defaults to
|
|
@@ -119,38 +179,16 @@ interface WorkspaceLayoutProps {
|
|
|
119
179
|
languages?: LanguageOption[];
|
|
120
180
|
currentLanguage?: string;
|
|
121
181
|
accountMenuItems?: ListGroup[];
|
|
182
|
+
/** The account menu's own words (theme, language, log out), for an app in another language. English by default. */
|
|
183
|
+
accountMenuLabels?: AccountMenuLabels;
|
|
184
|
+
/** The layout's own words (sidebar toggle, mobile sheet, breadcrumbs), for an app in another language. English by default. */
|
|
185
|
+
labels?: WorkspaceLayoutLabels;
|
|
122
186
|
hideBreadcrumbs?: boolean;
|
|
123
187
|
}
|
|
124
188
|
|
|
125
|
-
declare function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets, footerBranding, children, sidebarConfig, headerConfig, footerConfig, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, accountMenuItems, hideBreadcrumbs, }: WorkspaceLayoutProps): React.JSX.Element;
|
|
126
|
-
|
|
127
|
-
interface AccountMenuProps {
|
|
128
|
-
userName?: string;
|
|
129
|
-
userEmail?: string;
|
|
130
|
-
userProfilePictureUrl?: string;
|
|
131
|
-
/** The avatar's fill behind the initial (the trigger's and the profile card's); default `primary`. */
|
|
132
|
-
avatarColor?: Color;
|
|
133
|
-
avatarBadgeColor?: Color;
|
|
134
|
-
onLogoutClick?: () => void;
|
|
135
|
-
onProfileCardClick?: () => void;
|
|
136
|
-
onColorThemeChange?: (theme: "light" | "dark") => void;
|
|
137
|
-
colorTheme?: "light" | "dark";
|
|
138
|
-
onLanguageChange?: (language: string) => void;
|
|
139
|
-
languages?: {
|
|
140
|
-
code: string;
|
|
141
|
-
label: string;
|
|
142
|
-
}[];
|
|
143
|
-
currentLanguage?: string;
|
|
144
|
-
additionalItems?: ListGroup[];
|
|
145
|
-
/** See `MyAccountMenuProps.triggerVariant`; default `avatar`. */
|
|
146
|
-
triggerVariant?: MyAccountMenuProps["triggerVariant"];
|
|
147
|
-
/** Menu placement; default `bottom`. */
|
|
148
|
-
side?: MyAccountMenuProps["side"];
|
|
149
|
-
/** Menu alignment; default `end`. */
|
|
150
|
-
align?: MyAccountMenuProps["align"];
|
|
151
|
-
}
|
|
189
|
+
declare function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets, footerBranding, children, sidebarConfig, headerConfig, footerConfig, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, accountMenuItems, accountMenuLabels, labels, hideBreadcrumbs, }: WorkspaceLayoutProps): React.JSX.Element;
|
|
152
190
|
|
|
153
|
-
declare function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor, avatarBadgeColor, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, additionalItems, triggerVariant, side, align, }: AccountMenuProps): React.JSX.Element | null;
|
|
191
|
+
declare function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor, avatarBadgeColor, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, additionalItems, labels, triggerVariant, side, align, }: AccountMenuProps): React.JSX.Element | null;
|
|
154
192
|
|
|
155
193
|
interface HeaderProps {
|
|
156
194
|
leftContent?: ReactNode;
|
|
@@ -161,9 +199,11 @@ interface HeaderProps {
|
|
|
161
199
|
showSidebarTrigger?: boolean;
|
|
162
200
|
/** Logo element shown in the header on mobile (after the trigger). */
|
|
163
201
|
mobileLogo?: ReactNode;
|
|
202
|
+
/** Screen-reader name of the sidebar toggle. Default "Toggle Sidebar". */
|
|
203
|
+
toggleSidebarLabel?: string;
|
|
164
204
|
}
|
|
165
205
|
|
|
166
|
-
declare function Header({ leftContent, rightContent, endContent, showSidebarTrigger, mobileLogo, }: HeaderProps): React.JSX.Element;
|
|
206
|
+
declare function Header({ leftContent, rightContent, endContent, showSidebarTrigger, mobileLogo, toggleSidebarLabel, }: HeaderProps): React.JSX.Element;
|
|
167
207
|
|
|
168
208
|
interface FooterProps {
|
|
169
209
|
hidden?: boolean;
|
|
@@ -235,13 +275,19 @@ interface MinimalWorkspaceLayoutLabels {
|
|
|
235
275
|
* `hideWhenCollapsed` sidebar is showing. Default "Hide sidebar".
|
|
236
276
|
*/
|
|
237
277
|
hideSidebar?: string;
|
|
278
|
+
/** The close button in the mobile sidebar sheet. Default "Close sidebar". */
|
|
279
|
+
closeSidebar?: string;
|
|
280
|
+
/** Screen-reader title of the mobile sidebar sheet. Default "Sidebar". */
|
|
281
|
+
sidebarTitle?: string;
|
|
282
|
+
/** Screen-reader description of the mobile sidebar sheet. Default "Displays the mobile sidebar.". */
|
|
283
|
+
sidebarDescription?: string;
|
|
238
284
|
}
|
|
239
285
|
/**
|
|
240
286
|
* Same props as {@link WorkspaceLayoutProps}, minus the header bar and the
|
|
241
287
|
* status footer: switching is a rename of the component plus, optionally,
|
|
242
288
|
* `topRightContent`.
|
|
243
289
|
*/
|
|
244
|
-
interface MinimalWorkspaceLayoutProps extends Omit<WorkspaceLayoutProps, "sidebarConfig" | "headerConfig" | "footerConfig" | "hideBreadcrumbs"> {
|
|
290
|
+
interface MinimalWorkspaceLayoutProps extends Omit<WorkspaceLayoutProps, "sidebarConfig" | "headerConfig" | "footerConfig" | "hideBreadcrumbs" | "labels"> {
|
|
245
291
|
sidebarConfig: MinimalWorkspaceSidebarConfig;
|
|
246
292
|
/**
|
|
247
293
|
* Account details for the menu at the bottom of the sidebar. `rightContent`
|
|
@@ -328,4 +374,4 @@ interface EntryLayoutProps {
|
|
|
328
374
|
|
|
329
375
|
declare function EntryLayout({ appName, children, backgroundImageUrl, heading, darkMode, logo, logoAssets, customRightPanel, disableBackgroundImage, hideLogo, hideFooter, hideRightPanel, }: EntryLayoutProps): React.JSX.Element;
|
|
330
376
|
|
|
331
|
-
export { AccountMenu, type AccountMenuProps, type BreadcrumbItemConfig, EntryLayout, type EntryLayoutProps, type LanguageOption, MinimalWorkspaceLayout, type MinimalWorkspaceLayoutLabels, type MinimalWorkspaceLayoutProps, type MinimalWorkspaceSidebarConfig, type MinimalWorkspaceSidebarState, MinimalWorkspaceSidebarTrigger, type MinimalWorkspaceSidebarTriggerProps, SidebarNavEntry, Footer as WorkspaceFooter, type WorkspaceFooterConfig, type FooterProps as WorkspaceFooterProps, Header as WorkspaceHeader, type WorkspaceHeaderConfig, type HeaderProps as WorkspaceHeaderProps, WorkspaceLayout, type WorkspaceLayoutProps, type WorkspaceSidebarConfig };
|
|
377
|
+
export { AccountMenu, type AccountMenuLabels, type AccountMenuProps, type BreadcrumbItemConfig, EntryLayout, type EntryLayoutProps, type LanguageOption, MinimalWorkspaceLayout, type MinimalWorkspaceLayoutLabels, type MinimalWorkspaceLayoutProps, type MinimalWorkspaceSidebarConfig, type MinimalWorkspaceSidebarState, MinimalWorkspaceSidebarTrigger, type MinimalWorkspaceSidebarTriggerProps, SidebarNavEntry, Footer as WorkspaceFooter, type WorkspaceFooterConfig, type FooterProps as WorkspaceFooterProps, Header as WorkspaceHeader, type WorkspaceHeaderConfig, type HeaderProps as WorkspaceHeaderProps, WorkspaceLayout, type WorkspaceLayoutLabels, type WorkspaceLayoutProps, type WorkspaceSidebarConfig };
|
|
@@ -90,7 +90,7 @@ var hiddenGapClass = "data-[sidebar-mode=peek]:[&_[data-slot=sidebar-gap]]:w-0 d
|
|
|
90
90
|
* Mouse-only by design (the trigger and ⌘/Ctrl+B serve the keyboard).
|
|
91
91
|
*/
|
|
92
92
|
var edgeClass = cn("absolute inset-y-0 left-0 z-10 w-[var(--espd-minimal-workspace-layout-edge-hit-width,12px)] cursor-e-resize select-none", "before:absolute before:inset-y-0 before:left-0 before:w-[var(--espd-minimal-workspace-layout-edge-width,3px)] before:bg-[var(--espd-minimal-workspace-layout-edge-color,var(--color-primary))]", "before:opacity-0 before:transition-opacity before:duration-[var(--espd-duration-fast,150ms)] motion-reduce:before:transition-none hover:before:opacity-100");
|
|
93
|
-
function MinimalWorkspaceShell({ appName, logo, logoCollapsed, logoMobile, logoAssets, footerBranding, children, sidebarConfig, headerConfig, topRightContent, hideMobileTopBar = false, labels, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, accountMenuItems, hiddenSidebar }) {
|
|
93
|
+
function MinimalWorkspaceShell({ appName, logo, logoCollapsed, logoMobile, logoAssets, footerBranding, children, sidebarConfig, headerConfig, topRightContent, hideMobileTopBar = false, labels, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, accountMenuItems, accountMenuLabels, hiddenSidebar }) {
|
|
94
94
|
const { state, isMobile, setOpen } = useSidebar();
|
|
95
95
|
const sidebarId = useId();
|
|
96
96
|
const expandable = sidebarConfig.expandable ?? true;
|
|
@@ -218,7 +218,8 @@ function MinimalWorkspaceShell({ appName, logo, logoCollapsed, logoMobile, logoA
|
|
|
218
218
|
onLanguageChange,
|
|
219
219
|
languages,
|
|
220
220
|
currentLanguage,
|
|
221
|
-
accountMenuItems
|
|
221
|
+
accountMenuItems,
|
|
222
|
+
accountMenuLabels
|
|
222
223
|
}),
|
|
223
224
|
triggerVariant: "card",
|
|
224
225
|
side: collapsed ? "right" : "top",
|
|
@@ -251,6 +252,11 @@ function MinimalWorkspaceShell({ appName, logo, logoCollapsed, logoMobile, logoA
|
|
|
251
252
|
linkComponent: LinkComponent,
|
|
252
253
|
focusActiveGroup: sidebarConfig.focusActiveGroup,
|
|
253
254
|
collapsible: hide ? "offcanvas" : "icon",
|
|
255
|
+
labels: {
|
|
256
|
+
close: labels?.closeSidebar,
|
|
257
|
+
mobileTitle: labels?.sidebarTitle,
|
|
258
|
+
mobileDescription: labels?.sidebarDescription
|
|
259
|
+
},
|
|
254
260
|
header: /* @__PURE__ */ jsx(RailLogo, {
|
|
255
261
|
logo,
|
|
256
262
|
logoCollapsed,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/layouts/shared/account-menu-props.ts
|
|
2
2
|
/** Maps a layout's account-related props onto `AccountMenu`'s. */
|
|
3
|
-
function accountMenuProps({ headerConfig, accountMenuItems, ...rest }) {
|
|
3
|
+
function accountMenuProps({ headerConfig, accountMenuItems, accountMenuLabels, ...rest }) {
|
|
4
4
|
return {
|
|
5
5
|
userName: headerConfig?.userName,
|
|
6
6
|
userEmail: headerConfig?.userEmail,
|
|
@@ -14,7 +14,8 @@ function accountMenuProps({ headerConfig, accountMenuItems, ...rest }) {
|
|
|
14
14
|
onLanguageChange: rest.onLanguageChange,
|
|
15
15
|
languages: rest.languages,
|
|
16
16
|
currentLanguage: rest.currentLanguage,
|
|
17
|
-
additionalItems: accountMenuItems
|
|
17
|
+
additionalItems: accountMenuItems,
|
|
18
|
+
labels: accountMenuLabels
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
//#endregion
|
|
@@ -5,7 +5,12 @@ import { useMemo } from "react";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { Check, Globe, LogOut, Palette } from "lucide-react";
|
|
7
7
|
//#region src/layouts/workspace-layout/account-menu/account-menu.tsx
|
|
8
|
-
function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor, avatarBadgeColor, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, additionalItems, triggerVariant, side, align }) {
|
|
8
|
+
function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor, avatarBadgeColor, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, additionalItems, labels, triggerVariant, side, align }) {
|
|
9
|
+
const colorThemeLabel = labels?.colorTheme ?? "Color theme";
|
|
10
|
+
const darkModeLabel = labels?.darkMode ?? "Dark mode";
|
|
11
|
+
const lightModeLabel = labels?.lightMode ?? "Light mode";
|
|
12
|
+
const languageLabel = labels?.language ?? "Language";
|
|
13
|
+
const logoutLabel = labels?.logout ?? "Logout";
|
|
9
14
|
const menuItems = useMemo(() => {
|
|
10
15
|
const groups = [];
|
|
11
16
|
if (userName || userEmail) {
|
|
@@ -31,13 +36,13 @@ function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor,
|
|
|
31
36
|
const isDark = colorTheme === "dark";
|
|
32
37
|
const themeItems = [{
|
|
33
38
|
id: "theme-dark",
|
|
34
|
-
label:
|
|
39
|
+
label: darkModeLabel,
|
|
35
40
|
endIcon: isDark ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : void 0,
|
|
36
41
|
isSelected: isDark,
|
|
37
42
|
onClick: () => onColorThemeChange("dark")
|
|
38
43
|
}, {
|
|
39
44
|
id: "theme-light",
|
|
40
|
-
label:
|
|
45
|
+
label: lightModeLabel,
|
|
41
46
|
endIcon: !isDark ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : void 0,
|
|
42
47
|
isSelected: !isDark,
|
|
43
48
|
onClick: () => onColorThemeChange("light")
|
|
@@ -46,7 +51,7 @@ function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor,
|
|
|
46
51
|
id: "theme",
|
|
47
52
|
items: [{
|
|
48
53
|
id: "color-theme",
|
|
49
|
-
label:
|
|
54
|
+
label: colorThemeLabel,
|
|
50
55
|
startIcon: /* @__PURE__ */ jsx(Palette, { className: "h-4 w-4" }),
|
|
51
56
|
items: themeItems
|
|
52
57
|
}]
|
|
@@ -64,7 +69,7 @@ function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor,
|
|
|
64
69
|
id: "language",
|
|
65
70
|
items: [{
|
|
66
71
|
id: "language",
|
|
67
|
-
label:
|
|
72
|
+
label: languageLabel,
|
|
68
73
|
startIcon: /* @__PURE__ */ jsx(Globe, { className: "h-4 w-4" }),
|
|
69
74
|
items: langItems
|
|
70
75
|
}]
|
|
@@ -75,7 +80,7 @@ function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor,
|
|
|
75
80
|
id: "logout",
|
|
76
81
|
items: [{
|
|
77
82
|
id: "logout",
|
|
78
|
-
label:
|
|
83
|
+
label: logoutLabel,
|
|
79
84
|
startIcon: /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
|
|
80
85
|
color: "error",
|
|
81
86
|
onClick: onLogoutClick
|
|
@@ -94,7 +99,12 @@ function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor,
|
|
|
94
99
|
languages,
|
|
95
100
|
currentLanguage,
|
|
96
101
|
additionalItems,
|
|
97
|
-
onLogoutClick
|
|
102
|
+
onLogoutClick,
|
|
103
|
+
colorThemeLabel,
|
|
104
|
+
darkModeLabel,
|
|
105
|
+
lightModeLabel,
|
|
106
|
+
languageLabel,
|
|
107
|
+
logoutLabel
|
|
98
108
|
]);
|
|
99
109
|
if (menuItems.length === 0) return null;
|
|
100
110
|
return /* @__PURE__ */ jsx(MyAccountMenu, {
|
|
@@ -107,7 +117,8 @@ function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor,
|
|
|
107
117
|
minWidth: "220px",
|
|
108
118
|
triggerVariant,
|
|
109
119
|
side,
|
|
110
|
-
align
|
|
120
|
+
align,
|
|
121
|
+
triggerLabel: labels?.menu
|
|
111
122
|
});
|
|
112
123
|
}
|
|
113
124
|
//#endregion
|
|
@@ -3,20 +3,23 @@ import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbP
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/layouts/workspace-layout/breadcrumbs/workspace-breadcrumbs.tsx
|
|
6
|
-
function WorkspaceBreadcrumbs({ items, linkComponent: LinkComponent, collapseOnMobile = false }) {
|
|
6
|
+
function WorkspaceBreadcrumbs({ items, linkComponent: LinkComponent, collapseOnMobile = false, label = "breadcrumb" }) {
|
|
7
7
|
const { isMobile } = useSidebar();
|
|
8
8
|
if (items.length === 0) return null;
|
|
9
9
|
const visibleItems = collapseOnMobile && isMobile ? items.slice(-1) : items;
|
|
10
|
-
return /* @__PURE__ */ jsx(Breadcrumb, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
children: /* @__PURE__ */ jsx(
|
|
15
|
-
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
return /* @__PURE__ */ jsx(Breadcrumb, {
|
|
11
|
+
"aria-label": label,
|
|
12
|
+
children: /* @__PURE__ */ jsx(BreadcrumbList, { children: visibleItems.map((item, index) => {
|
|
13
|
+
const isLast = index === visibleItems.length - 1;
|
|
14
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(BreadcrumbItem, { children: item.path ? /* @__PURE__ */ jsx(BreadcrumbLink, {
|
|
15
|
+
asChild: true,
|
|
16
|
+
children: /* @__PURE__ */ jsx(LinkComponent, {
|
|
17
|
+
to: item.path,
|
|
18
|
+
children: item.label
|
|
19
|
+
})
|
|
20
|
+
}) : /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) }), !isLast && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})] }, item.path ?? index);
|
|
21
|
+
}) })
|
|
22
|
+
});
|
|
20
23
|
}
|
|
21
24
|
//#endregion
|
|
22
25
|
export { WorkspaceBreadcrumbs as default };
|
|
@@ -4,7 +4,7 @@ import { SidebarTrigger, useSidebar } from "../../../core/animate-ui/components/
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Menu } from "lucide-react";
|
|
6
6
|
//#region src/layouts/workspace-layout/header/header.tsx
|
|
7
|
-
function Header({ leftContent, rightContent, endContent, showSidebarTrigger = false, mobileLogo }) {
|
|
7
|
+
function Header({ leftContent, rightContent, endContent, showSidebarTrigger = false, mobileLogo, toggleSidebarLabel = "Toggle Sidebar" }) {
|
|
8
8
|
const { state, isMobile, toggleSidebar } = useSidebar();
|
|
9
9
|
const sidebarWidth = state === "collapsed" ? "calc(var(--espd-sidebar-width-collapsed) - 1px)" : "calc(var(--espd-sidebar-width) - 1px)";
|
|
10
10
|
return /* @__PURE__ */ jsx("header", {
|
|
@@ -26,9 +26,9 @@ function Header({ leftContent, rightContent, endContent, showSidebarTrigger = fa
|
|
|
26
26
|
onClick: toggleSidebar,
|
|
27
27
|
children: [/* @__PURE__ */ jsx(Menu, { className: "!size-6" }), /* @__PURE__ */ jsx("span", {
|
|
28
28
|
className: "sr-only",
|
|
29
|
-
children:
|
|
29
|
+
children: toggleSidebarLabel
|
|
30
30
|
})]
|
|
31
|
-
}) : /* @__PURE__ */ jsx(SidebarTrigger, {})
|
|
31
|
+
}) : /* @__PURE__ */ jsx(SidebarTrigger, { label: toggleSidebarLabel })
|
|
32
32
|
}),
|
|
33
33
|
isMobile && mobileLogo && /* @__PURE__ */ jsx("div", {
|
|
34
34
|
className: "mobile-logo shrink-0",
|
|
@@ -13,7 +13,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
var HEADER_HEIGHT = "var(--espd-shell-header-height, var(--espd-header-height))";
|
|
14
14
|
var FOOTER_HEIGHT = "var(--espd-workspace-layout-footer-height, var(--espd-footer-height))";
|
|
15
15
|
var HIDDEN_FOOTER_HEIGHT = "var(--espd-workspace-layout-hidden-footer-height, var(--espd-hidden-footer-height))";
|
|
16
|
-
function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets, footerBranding, children, sidebarConfig, headerConfig, footerConfig, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, accountMenuItems, hideBreadcrumbs }) {
|
|
16
|
+
function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets, footerBranding, children, sidebarConfig, headerConfig, footerConfig, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, accountMenuItems, accountMenuLabels, labels, hideBreadcrumbs }) {
|
|
17
17
|
const SidebarLinkComp = sidebarConfig.linkComponent;
|
|
18
18
|
const hideFooter = footerConfig?.hidden ?? false;
|
|
19
19
|
const darkMode = colorTheme === "dark";
|
|
@@ -30,7 +30,8 @@ function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets,
|
|
|
30
30
|
const headerLeftContent = breadcrumbItems.length > 0 ? /* @__PURE__ */ jsx(WorkspaceBreadcrumbs, {
|
|
31
31
|
items: breadcrumbItems,
|
|
32
32
|
linkComponent: SidebarLinkComp,
|
|
33
|
-
collapseOnMobile: headerConfig?.collapseBreadcrumbsOnMobile ?? false
|
|
33
|
+
collapseOnMobile: headerConfig?.collapseBreadcrumbsOnMobile ?? false,
|
|
34
|
+
label: labels?.breadcrumbs
|
|
34
35
|
}) : null;
|
|
35
36
|
const footerBrandingNode = resolveFooterBranding({
|
|
36
37
|
footerBranding,
|
|
@@ -51,7 +52,8 @@ function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets,
|
|
|
51
52
|
onLanguageChange,
|
|
52
53
|
languages,
|
|
53
54
|
currentLanguage,
|
|
54
|
-
accountMenuItems
|
|
55
|
+
accountMenuItems,
|
|
56
|
+
accountMenuLabels
|
|
55
57
|
}) });
|
|
56
58
|
return /* @__PURE__ */ jsxs(SidebarProvider, {
|
|
57
59
|
open: sidebarOpen,
|
|
@@ -74,7 +76,12 @@ function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets,
|
|
|
74
76
|
linkComponent: SidebarLinkComp,
|
|
75
77
|
collapsible: sidebarConfig.allowCollapsible ? "icon" : "none",
|
|
76
78
|
variant: sidebarConfig.variant,
|
|
77
|
-
focusActiveGroup: sidebarConfig.focusActiveGroup
|
|
79
|
+
focusActiveGroup: sidebarConfig.focusActiveGroup,
|
|
80
|
+
labels: {
|
|
81
|
+
close: labels?.closeSidebar,
|
|
82
|
+
mobileTitle: labels?.sidebarTitle,
|
|
83
|
+
mobileDescription: labels?.sidebarDescription
|
|
84
|
+
}
|
|
78
85
|
}), /* @__PURE__ */ jsxs(SidebarInset, {
|
|
79
86
|
className: "overflow-hidden h-dvh max-h-dvh",
|
|
80
87
|
children: [
|
|
@@ -83,7 +90,8 @@ function WorkspaceLayout({ appName, logo, logoCollapsed, logoMobile, logoAssets,
|
|
|
83
90
|
rightContent: headerConfig?.rightContent,
|
|
84
91
|
endContent: accountMenu,
|
|
85
92
|
showSidebarTrigger: sidebarConfig.allowCollapsible,
|
|
86
|
-
mobileLogo: mobileLogo$1
|
|
93
|
+
mobileLogo: mobileLogo$1,
|
|
94
|
+
toggleSidebarLabel: labels?.toggleSidebar
|
|
87
95
|
}),
|
|
88
96
|
/* @__PURE__ */ jsx("div", {
|
|
89
97
|
className: "flex flex-1 flex-col gap-4 bg-sidebar",
|
|
@@ -62,6 +62,8 @@ interface MyAccountMenuProps {
|
|
|
62
62
|
side?: "top" | "right" | "bottom" | "left";
|
|
63
63
|
/** Menu alignment; default `end`. */
|
|
64
64
|
align?: "start" | "center" | "end";
|
|
65
|
+
/** The trigger's accessible name, for an app in another language. Default "My Account". */
|
|
66
|
+
triggerLabel?: string;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
export type { AppLogoProps as A, LogoAsset as L, MyAccountMenuProps as M, LogoAssetConfig as a, LogoVariantSet as b };
|