@espressif/dashboard-ui-components 1.14.1 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/rules/dashboard-ui-consumption.md +48 -0
- package/CHANGELOG.md +82 -0
- package/dist/bottom-sheet.props-CFpM7Gvx.d.ts +26 -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/bottom-sheet/index.d.ts +3 -25
- 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/filters-bar/filters-bar-sheet.js +73 -0
- package/dist/components/filters-bar/filters-bar.js +51 -28
- package/dist/components/filters-bar/index.d.ts +35 -8
- package/dist/components/index.d.ts +8 -7
- 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 +10 -0
- package/dist/components/stat-card/stat-card.js +60 -48
- 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 +10 -9
- 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
|
@@ -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';
|
|
@@ -34,7 +34,8 @@ export { ViewMode, ViewToggle, ViewToggleLabels, ViewToggleProps } from './compo
|
|
|
34
34
|
export { Toolbar, ToolbarButton, ToolbarButtonProps, ToolbarProps } from './components/toolbar/index.js';
|
|
35
35
|
export { AnchoredPanel, AnchoredPanelProps } from './components/anchored-panel/index.js';
|
|
36
36
|
export { FloatingWindow, FloatingWindowPosition, FloatingWindowProps } from './components/floating-window/index.js';
|
|
37
|
-
export { BottomSheet,
|
|
37
|
+
export { BottomSheet, SheetRest, settleSheet } from './components/bottom-sheet/index.js';
|
|
38
|
+
export { B as BottomSheetLabels, a as BottomSheetProps } from './bottom-sheet.props-CFpM7Gvx.js';
|
|
38
39
|
export { NoticeStrip, NoticeStripProps, NoticeTone } from './components/notice-strip/index.js';
|
|
39
40
|
export { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleContentProps, TraceCollapsibleProps, TraceCollapsibleTrigger, TraceCollapsibleTriggerProps, TraceDescription, TraceDescriptionProps, TraceIcon, TraceIconProps, TraceLine, TraceLineProps, TraceProps, TraceStatus, TraceTitle, TraceTitleProps } from './components/trace/index.js';
|
|
40
41
|
export { Readout, ReadoutProps, ReadoutSegment } from './components/readout/index.js';
|
|
@@ -96,7 +97,7 @@ export { useIsMobile } from './components/use-mobile/index.js';
|
|
|
96
97
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './components/table/index.js';
|
|
97
98
|
export { Link, LinkColor, LinkProps } from './components/link/index.js';
|
|
98
99
|
export { SearchBox, SearchBoxProps } from './components/search-box/index.js';
|
|
99
|
-
export { FiltersBar, FiltersBarProps } from './components/filters-bar/index.js';
|
|
100
|
+
export { FiltersBar, FiltersBarLabels, FiltersBarProps } from './components/filters-bar/index.js';
|
|
100
101
|
export { AdvancedSearchBox, AdvancedSearchBoxProps, SearchMeta } from './components/advanced-search-box/index.js';
|
|
101
102
|
export { TogglableItem, TogglableItemsList, TogglableItemsListProps } from './components/togglable-items-list/index.js';
|
|
102
103
|
export { DEFAULT_PAGE_SIZE_OPTIONS, Pagination, PaginationProps } from './components/pagination/index.js';
|
|
@@ -117,7 +118,7 @@ export { StatusBadge, statusBadgeSizeVariants } from './components/status-badge/
|
|
|
117
118
|
export { S as StatusBadgeIcon, a as StatusBadgeProps } from './status-badge.props-BVe8CmQZ.js';
|
|
118
119
|
export { Tag, TagProps } from './components/tag/index.js';
|
|
119
120
|
export { TagInput, TagInputProps } from './components/tag-input/index.js';
|
|
120
|
-
export { TransferItem, TransferList, TransferListProps } from './components/transfer-list/index.js';
|
|
121
|
+
export { TransferItem, TransferList, TransferListLabels, TransferListProps } from './components/transfer-list/index.js';
|
|
121
122
|
export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from './components/dialog/index.js';
|
|
122
123
|
export { Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverGroupProps, PopoverProps, PopoverTrigger } from './components/popover/index.js';
|
|
123
124
|
export { ConfirmationDialog, ConfirmationDialogProps } from './components/confirmation-dialog/index.js';
|
|
@@ -132,7 +133,7 @@ export { DynamicList, DynamicListEntry, DynamicListMetaEntry, DynamicListMetaTyp
|
|
|
132
133
|
export { KeyValueManager, KeyValueManagerFieldMeta, KeyValueManagerItem, KeyValueManagerLabels, KeyValueManagerProps } from './components/key-value-manager/index.js';
|
|
133
134
|
export { RequirementList, RequirementListItem, RequirementListProps, RequirementListSize } from './components/requirement-list/index.js';
|
|
134
135
|
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';
|
|
136
|
+
export { SimplePaginatedList, SimplePaginatedListItem, SimplePaginatedListLabels, SimplePaginatedListProps, SimplePaginatedListSize } from './components/simple-paginated-list/index.js';
|
|
136
137
|
export { Alert } from './components/alert/index.js';
|
|
137
138
|
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
139
|
export { Toast, ToastColor, ToastId, ToastInput, ToastOptions, ToastProps, ToastToasterProps, ToastType, ToastVariant, Toaster, toast } from './components/toast/index.js';
|
|
@@ -147,7 +148,7 @@ export { CircularProgress, CircularProgressProps } from './components/circular-p
|
|
|
147
148
|
export { ProgressBar, ProgressBarProps, ProgressBarSegment } from './components/progress-bar/index.js';
|
|
148
149
|
export { FullSizeError, FullSizeErrorProps, InlineError, InlineErrorProps } from './components/error-display/index.js';
|
|
149
150
|
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-
|
|
151
|
+
export { S as SectionCard, a as SectionCardProps, b as SectionCardSize, c as SectionCardVariant } from './section-card-Bs3sKQtv.js';
|
|
151
152
|
export { IconTextActionCard } from './components/icon-text-action-card/index.js';
|
|
152
153
|
export { I as IconTextActionCardActionsPlacement, a as IconTextActionCardProps, b as IconTextActionCardVariant } from './icon-text-action-card.props-BU7yFi2Q.js';
|
|
153
154
|
export { SimpleClickableCard } from './components/simple-clickable-card/index.js';
|
|
@@ -161,8 +162,8 @@ export { ContentContainer, ContentContainerMaxWidth, ContentContainerProps } fro
|
|
|
161
162
|
export { PageContainer, PageContainerSkeleton, PageContainerSkeletonProps } from './components/page-container/index.js';
|
|
162
163
|
export { G as GoBackLinkData, P as PageContainerMaxWidth, a as PageContainerProps } from './page-container.props-JutTvKFq.js';
|
|
163
164
|
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';
|
|
165
|
+
export { A as AppLogoProps, L as LogoAsset, a as LogoAssetConfig, b as LogoVariantSet, M as MyAccountMenuProps } from './my-account-menu.props-V3kFdvCZ.js';
|
|
166
|
+
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
167
|
export { c as cn } from './cn-Cbsgs0XP.js';
|
|
167
168
|
export { u as useControlledState } from './use-controlled-state-BL9NoHu8.js';
|
|
168
169
|
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 };
|
|
@@ -27,6 +27,11 @@ interface SectionCardProps extends Pick<StyleAxisProps, "radius" | "elevation">
|
|
|
27
27
|
* card can be expanded. Ignored when `allowCollapse` is `false`.
|
|
28
28
|
*/
|
|
29
29
|
hideCollapseIcon?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Accessible name of the collapsible header. Default `Toggle <primaryText>`
|
|
32
|
+
* when `primaryText` is a string, "Toggle section" otherwise.
|
|
33
|
+
*/
|
|
34
|
+
toggleLabel?: string;
|
|
30
35
|
defaultOpen?: boolean;
|
|
31
36
|
/**
|
|
32
37
|
* Controlled open state of the collapsible section. When set, the card
|
|
@@ -79,6 +84,6 @@ interface SectionCardProps extends Pick<StyleAxisProps, "radius" | "elevation">
|
|
|
79
84
|
*/
|
|
80
85
|
expandOnHover?: boolean;
|
|
81
86
|
}
|
|
82
|
-
declare function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText, actions, allowCollapse: allowCollapseProp, hideCollapseIcon, defaultOpen, open: controlledOpen, size, variant, color, children, className, style, fillHeight: fillHeightProp, onOpenChange, expandOnHover, radius, elevation, }: SectionCardProps): React.JSX.Element;
|
|
87
|
+
declare function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText, actions, allowCollapse: allowCollapseProp, hideCollapseIcon, toggleLabel: toggleLabelProp, defaultOpen, open: controlledOpen, size, variant, color, children, className, style, fillHeight: fillHeightProp, onOpenChange, expandOnHover, radius, elevation, }: SectionCardProps): React.JSX.Element;
|
|
83
88
|
|
|
84
89
|
export { SectionCard as S, type SectionCardProps as a, type SectionCardSize as b, type SectionCardVariant as c };
|
|
@@ -62,6 +62,15 @@ type SidebarLinkComponentProps = {
|
|
|
62
62
|
children: React.ReactNode;
|
|
63
63
|
className?: string;
|
|
64
64
|
};
|
|
65
|
+
/** The Sidebar's own words, for an app in another language. English by default. */
|
|
66
|
+
interface SidebarLabels {
|
|
67
|
+
/** The close button in the mobile sheet. Default "Close sidebar". */
|
|
68
|
+
close?: string;
|
|
69
|
+
/** Screen-reader title of the mobile sheet. Default "Sidebar". */
|
|
70
|
+
mobileTitle?: string;
|
|
71
|
+
/** Screen-reader description of the mobile sheet. Default "Displays the mobile sidebar.". */
|
|
72
|
+
mobileDescription?: string;
|
|
73
|
+
}
|
|
65
74
|
/**
|
|
66
75
|
* Props for the reusable Sidebar component
|
|
67
76
|
*/
|
|
@@ -122,6 +131,8 @@ type SidebarProps = DensityProps & {
|
|
|
122
131
|
* inside it, interactive rows included; check `event.target`. Ignored on mobile.
|
|
123
132
|
*/
|
|
124
133
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
134
|
+
/** The sidebar's own words (mobile close button and sheet title), for an app in another language. */
|
|
135
|
+
labels?: SidebarLabels;
|
|
125
136
|
};
|
|
126
137
|
|
|
127
|
-
export { type SidebarEndActionConfig as S, type SidebarGroupConfig as a, type SidebarItemConfig as b, type
|
|
138
|
+
export { type SidebarEndActionConfig as S, type SidebarGroupConfig as a, type SidebarItemConfig as b, type SidebarLabels as c, type SidebarLinkComponentProps as d, type SidebarNavEntry as e, type SidebarProps as f, type SidebarTopLevelLinkConfig as g, isSidebarGroup as i };
|
package/package.json
CHANGED