@espressif/dashboard-ui-components 1.14.0 → 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 +34 -0
- package/.cursor/rules/dashboard-ui-consumption.mdc +1 -0
- package/CHANGELOG.md +88 -1
- package/README.md +18 -2
- 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/avatar/avatar.js +1 -1
- package/dist/components/bottom-sheet/_hooks/use-sheet-drag.js +1 -1
- package/dist/components/breadcrumb/index.d.ts +4 -1
- package/dist/components/button/button.js +2 -2
- package/dist/components/button/flash-button.js +4 -4
- 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/horizontal-stepper/horizontal-stepper.js +2 -2
- 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/animate-ui/components/radix/toggle-group.js +4 -4
- package/dist/core/animate-ui/primitives/animate/tooltip.js +3 -0
- package/dist/core/breadcrumb.js +2 -2
- package/dist/core/button/craft-button.js +4 -4
- 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/dist/utils/color.js +10 -1
- package/dist/utils/index.d.ts +6 -1
- package/dist/utils/variant.js +38 -38
- package/package.json +4 -2
- package/src/styles/colors.css +23 -2
|
@@ -63,6 +63,14 @@ interface DateRangePickerProps extends Pick<StyleAxisProps, "radius"> {
|
|
|
63
63
|
clearLabel?: string;
|
|
64
64
|
/** Fires when the "Clear" menu item is selected. The consumer resets its selection. */
|
|
65
65
|
onClear?: () => void;
|
|
66
|
+
/** Label of the custom range's start-date field (i18n). Default "Start date". */
|
|
67
|
+
startDateLabel?: string;
|
|
68
|
+
/** Label of the custom range's end-date field (i18n). Default "End date". */
|
|
69
|
+
endDateLabel?: string;
|
|
70
|
+
/** The custom range's cancel button (i18n). Default "Cancel". */
|
|
71
|
+
cancelLabel?: string;
|
|
72
|
+
/** The custom range's apply button (i18n). Default "Apply". */
|
|
73
|
+
applyLabel?: string;
|
|
66
74
|
/** Custom trigger element. Overrides the default Input trigger entirely. */
|
|
67
75
|
trigger?: React__default.ReactNode;
|
|
68
76
|
placeholder?: string;
|
|
@@ -92,7 +100,7 @@ interface DateRangePickerProps extends Pick<StyleAxisProps, "radius"> {
|
|
|
92
100
|
className?: string;
|
|
93
101
|
}
|
|
94
102
|
|
|
95
|
-
declare function DateRangePicker({ presets, presetLabels, allowCustom, lockEndToToday, disableFutureDates, dateFormat, onChange, onPresetChange, onDraftChange, selectedPresetId, selectedStartDate, selectedEndDate, clearable, clearLabel, onClear, trigger, placeholder, label, size, hideIcon, disabled, required, rounded, radius, popoverRadius, popoverElevation, error, errorContent, startHelperContent, endHelperContent, hintContent, align, side, className, }: DateRangePickerProps): React.JSX.Element;
|
|
103
|
+
declare function DateRangePicker({ presets, presetLabels, allowCustom, lockEndToToday, disableFutureDates, dateFormat, onChange, onPresetChange, onDraftChange, selectedPresetId, selectedStartDate, selectedEndDate, clearable, clearLabel, onClear, startDateLabel, endDateLabel, cancelLabel, applyLabel, trigger, placeholder, label, size, hideIcon, disabled, required, rounded, radius, popoverRadius, popoverElevation, error, errorContent, startHelperContent, endHelperContent, hintContent, align, side, className, }: DateRangePickerProps): React.JSX.Element;
|
|
96
104
|
declare namespace DateRangePicker {
|
|
97
105
|
var displayName: string;
|
|
98
106
|
}
|
|
@@ -24,8 +24,10 @@ declare function DialogClose(props: DialogCloseProps): React.JSX.Element;
|
|
|
24
24
|
type DialogContentProps = DialogContentProps$1 & Pick<StyleAxisProps, 'radius' | 'elevation'> & DensityProps & {
|
|
25
25
|
showCloseButton?: boolean;
|
|
26
26
|
closeButtonClassName?: string;
|
|
27
|
+
/** The close button's accessible name, for an app in another language. Default "Close". */
|
|
28
|
+
closeLabel?: string;
|
|
27
29
|
};
|
|
28
|
-
declare function DialogContent({ className, children, showCloseButton, closeButtonClassName, radius, elevation, density, style, ...props }: DialogContentProps): React.JSX.Element;
|
|
30
|
+
declare function DialogContent({ className, children, showCloseButton, closeButtonClassName, closeLabel, radius, elevation, density, style, ...props }: DialogContentProps): React.JSX.Element;
|
|
29
31
|
type DialogHeaderProps = DialogHeaderProps$1;
|
|
30
32
|
declare function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element;
|
|
31
33
|
type DialogFooterProps = DialogFooterProps$1;
|
|
@@ -15,7 +15,8 @@ function ActiveFilters({ tags, clearLabel, onClearAll }) {
|
|
|
15
15
|
color: "silver",
|
|
16
16
|
size: "sm",
|
|
17
17
|
rounded: true,
|
|
18
|
-
onDelete: tag.onDelete
|
|
18
|
+
onDelete: tag.onDelete,
|
|
19
|
+
deleteLabel: tag.deleteLabel
|
|
19
20
|
}, tag.key)), /* @__PURE__ */ jsx(Button, {
|
|
20
21
|
variant: "ghost",
|
|
21
22
|
color: "error",
|
|
@@ -48,7 +48,8 @@ function FilterGroup({ group, selected, onToggle, order, animate, labels }) {
|
|
|
48
48
|
onSearch: view.setFind,
|
|
49
49
|
onClear: () => view.setFind(""),
|
|
50
50
|
placeholder: labels.searchGroupPlaceholder(lower),
|
|
51
|
-
"aria-label": labels.searchGroupPlaceholder(lower)
|
|
51
|
+
"aria-label": labels.searchGroupPlaceholder(lower),
|
|
52
|
+
clearLabel: labels.clearSearch
|
|
52
53
|
}),
|
|
53
54
|
/* @__PURE__ */ jsx("ul", {
|
|
54
55
|
className: "m-0 flex list-none flex-col gap-1 p-0",
|
|
@@ -25,12 +25,16 @@ interface FacetFiltersLabels {
|
|
|
25
25
|
showMore: (count: number) => string;
|
|
26
26
|
showLess: string;
|
|
27
27
|
noOptions: string;
|
|
28
|
+
/** The clear button in a group's search field. Default "Clear search". */
|
|
29
|
+
clearSearch?: string;
|
|
28
30
|
}
|
|
29
31
|
/** One removable tag above the results. */
|
|
30
32
|
interface ActiveFilterTag {
|
|
31
33
|
key: string;
|
|
32
34
|
label: string;
|
|
33
35
|
onDelete: () => void;
|
|
36
|
+
/** Accessible name of the tag's remove button. Default `Remove <label>`. */
|
|
37
|
+
deleteLabel?: string;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
interface FiltersPanelProps {
|
|
@@ -64,7 +64,7 @@ function mergeFiles(existing, incoming, multiple) {
|
|
|
64
64
|
}
|
|
65
65
|
return next;
|
|
66
66
|
}
|
|
67
|
-
var FileUpload = React$1.forwardRef(function FileUpload({ className, title = "Drag & drop files here", description, browseLabel = "Browse files", multiple = false, disabled = false, onChange, onFilesChange, files: filesProp, hideDropzoneOnFileSelect = false, layout = "stacked", id, radius, ...inputPropsRest }, ref) {
|
|
67
|
+
var FileUpload = React$1.forwardRef(function FileUpload({ className, title = "Drag & drop files here", description, browseLabel = "Browse files", removeFileLabel = (fileName) => `Remove ${fileName}`, multiple = false, disabled = false, onChange, onFilesChange, files: filesProp, hideDropzoneOnFileSelect = false, layout = "stacked", id, radius, ...inputPropsRest }, ref) {
|
|
68
68
|
const { partStyle } = useStyleAxes({ radius }, ["radius"]);
|
|
69
69
|
const autoId = React$1.useId();
|
|
70
70
|
const inputId = id ?? autoId;
|
|
@@ -307,7 +307,7 @@ var FileUpload = React$1.forwardRef(function FileUpload({ className, title = "Dr
|
|
|
307
307
|
fullWidth: false,
|
|
308
308
|
className: "size-9 shrink-0 p-0",
|
|
309
309
|
disabled,
|
|
310
|
-
"aria-label":
|
|
310
|
+
"aria-label": removeFileLabel(file.name),
|
|
311
311
|
onClick: () => removeAt(index),
|
|
312
312
|
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
313
313
|
})
|
|
@@ -10,6 +10,8 @@ interface FileUploadProps extends Omit<React.ComponentPropsWithoutRef<"input">,
|
|
|
10
10
|
description?: string;
|
|
11
11
|
/** Label for the browse control */
|
|
12
12
|
browseLabel?: string;
|
|
13
|
+
/** Accessible name of a listed file's remove button. Default `` name => `Remove ${name}` ``. */
|
|
14
|
+
removeFileLabel?: (fileName: string) => string;
|
|
13
15
|
/**
|
|
14
16
|
* Controlled file list. When provided (including `[]`), the parent owns the list;
|
|
15
17
|
* update via `onFilesChange` (e.g. react-hook-form `Controller`). When omitted, the
|
|
@@ -56,7 +56,7 @@ function sized(icon, className) {
|
|
|
56
56
|
function HorizontalStepper({ steps, color = "primary", size = "default", tone = "default", animateIn, ariaLabel = "Progress", align = "center", semantics = "image", className }) {
|
|
57
57
|
const s = sizes[size];
|
|
58
58
|
const t = tones[tone];
|
|
59
|
-
const fill = resolveColor(color, "
|
|
59
|
+
const fill = resolveColor(color, "solid");
|
|
60
60
|
const onFill = resolveColor(color, "fg");
|
|
61
61
|
const animate = animateIn === "media-card-reveal";
|
|
62
62
|
const start = align === "start";
|
|
@@ -94,7 +94,7 @@ function HorizontalStepper({ steps, color = "primary", size = "default", tone =
|
|
|
94
94
|
/* @__PURE__ */ jsx("span", {
|
|
95
95
|
"data-status": step.status,
|
|
96
96
|
"aria-hidden": asList ? true : void 0,
|
|
97
|
-
className: cn("relative z-10 flex shrink-0 items-center justify-center rounded-full border-2", s.node, stale && "border-transparent bg-warning text-warning-foreground", failed && "border-transparent bg-error text-error-foreground", !stale && !failed && (reached ? cn("border-transparent", fill.className, onFill.className) : t.upcoming), animate && cn(NODE_POP, NODE_DELAYS[Math.min(index, NODE_DELAYS.length - 1)])),
|
|
97
|
+
className: cn("relative z-10 flex shrink-0 items-center justify-center rounded-full border-2", s.node, stale && "border-transparent bg-warning-solid text-warning-foreground", failed && "border-transparent bg-error text-error-foreground", !stale && !failed && (reached ? cn("border-transparent", fill.className, onFill.className) : t.upcoming), animate && cn(NODE_POP, NODE_DELAYS[Math.min(index, NODE_DELAYS.length - 1)])),
|
|
98
98
|
style: reached && !stale && !failed && (fill.style || onFill.style) ? {
|
|
99
99
|
...fill.style,
|
|
100
100
|
...onFill.style
|
|
@@ -11,11 +11,11 @@ export { List } from './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 './list-details/index.js';
|
|
13
13
|
export { Menu, MenuProps } from './menu/index.js';
|
|
14
|
-
export { NavBar, NavBarMenuItem, NavBarPosition, NavBarProps } from './nav-bar/index.js';
|
|
14
|
+
export { NavBar, NavBarLabels, NavBarMenuItem, NavBarPosition, NavBarProps } from './nav-bar/index.js';
|
|
15
15
|
export { Tooltip, TooltipProps } from './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 './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 './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 './dropdown-menu/index.js';
|
|
21
21
|
export { ScrollArea, ScrollAreaOrientation, ScrollAreaProps, ScrollBar } from './scroll-area/index.js';
|
|
@@ -117,7 +117,7 @@ export { StatusBadge, statusBadgeSizeVariants } from './status-badge/index.js';
|
|
|
117
117
|
export { S as StatusBadgeIcon, a as StatusBadgeProps } from '../status-badge.props-BVe8CmQZ.js';
|
|
118
118
|
export { Tag, TagProps } from './tag/index.js';
|
|
119
119
|
export { TagInput, TagInputProps } from './tag-input/index.js';
|
|
120
|
-
export { TransferItem, TransferList, TransferListProps } from './transfer-list/index.js';
|
|
120
|
+
export { TransferItem, TransferList, TransferListLabels, TransferListProps } from './transfer-list/index.js';
|
|
121
121
|
export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from './dialog/index.js';
|
|
122
122
|
export { Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverGroupProps, PopoverProps, PopoverTrigger } from './popover/index.js';
|
|
123
123
|
export { ConfirmationDialog, ConfirmationDialogProps } from './confirmation-dialog/index.js';
|
|
@@ -132,7 +132,7 @@ export { DynamicList, DynamicListEntry, DynamicListMetaEntry, DynamicListMetaTyp
|
|
|
132
132
|
export { KeyValueManager, KeyValueManagerFieldMeta, KeyValueManagerItem, KeyValueManagerLabels, KeyValueManagerProps } from './key-value-manager/index.js';
|
|
133
133
|
export { RequirementList, RequirementListItem, RequirementListProps, RequirementListSize } from './requirement-list/index.js';
|
|
134
134
|
export { SimpleList, SimpleListAvatarSize, SimpleListIconStyle, SimpleListItem, SimpleListItemDirection, SimpleListProps } from './simple-list/index.js';
|
|
135
|
-
export { SimplePaginatedList, SimplePaginatedListItem, SimplePaginatedListProps, SimplePaginatedListSize } from './simple-paginated-list/index.js';
|
|
135
|
+
export { SimplePaginatedList, SimplePaginatedListItem, SimplePaginatedListLabels, SimplePaginatedListProps, SimplePaginatedListSize } from './simple-paginated-list/index.js';
|
|
136
136
|
export { Alert } from './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 './toast/index.js';
|
|
@@ -147,7 +147,7 @@ export { CircularProgress, CircularProgressProps } from './circular-progress/ind
|
|
|
147
147
|
export { ProgressBar, ProgressBarProps, ProgressBarSegment } from './progress-bar/index.js';
|
|
148
148
|
export { FullSizeError, FullSizeErrorProps, InlineError, InlineErrorProps } from './error-display/index.js';
|
|
149
149
|
export { AnimatedCard, AnimatedCardProps, AnimatedCardType, BasicDetailsCard, BasicDetailsCardProps, CollapsibleCard, CollapsibleCardProps, NoDataCard, NoDataCardProps, SimpleCard, SimpleCardProps, animatedCardAnimations, animatedCardTypeKeys } from './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 './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 './simple-clickable-card/index.js';
|
|
@@ -43,6 +43,14 @@ interface KeyValueManagerLabels {
|
|
|
43
43
|
emptySearch?: string;
|
|
44
44
|
/** Placeholder of a field that has `options`. Default: `"Select"`. */
|
|
45
45
|
selectPlaceholder?: string;
|
|
46
|
+
/** Accessible name of the search box's clear button. Default: `"Clear search"`. */
|
|
47
|
+
clearSearch?: string;
|
|
48
|
+
/** Accessible name of the table's previous-page arrow. Default: `"Previous page"`. */
|
|
49
|
+
previousPage?: string;
|
|
50
|
+
/** Accessible name of the table's next-page arrow. Default: `"Next page"`. */
|
|
51
|
+
nextPage?: string;
|
|
52
|
+
/** Accessible name of a row's delete button. Default: `` key => `Delete ${key}` ``. */
|
|
53
|
+
deleteItem?: (key: string) => string;
|
|
46
54
|
}
|
|
47
55
|
interface KeyValueManagerProps {
|
|
48
56
|
items: KeyValueManagerItem[];
|
|
@@ -32,7 +32,7 @@ var slideVariants = {
|
|
|
32
32
|
opacity: 1
|
|
33
33
|
})
|
|
34
34
|
};
|
|
35
|
-
function KeyValueManagerTable({ rows, itemsPerPage = 10, hasSearchQuery, onDelete, keyLabel, valueLabel, actionLabel, emptyItems, emptySearch }) {
|
|
35
|
+
function KeyValueManagerTable({ rows, itemsPerPage = 10, hasSearchQuery, onDelete, keyLabel, valueLabel, actionLabel, emptyItems, emptySearch, previousPage, nextPage, deleteItem }) {
|
|
36
36
|
const [page, setPage] = useState(0);
|
|
37
37
|
const [direction, setDirection] = useState(1);
|
|
38
38
|
const pageSize = Math.max(1, itemsPerPage);
|
|
@@ -65,7 +65,7 @@ function KeyValueManagerTable({ rows, itemsPerPage = 10, hasSearchQuery, onDelet
|
|
|
65
65
|
color: "error",
|
|
66
66
|
size: "icon",
|
|
67
67
|
fullWidth: false,
|
|
68
|
-
"aria-label":
|
|
68
|
+
"aria-label": deleteItem(item.key),
|
|
69
69
|
className,
|
|
70
70
|
onClick: () => onDelete(sourceIndex),
|
|
71
71
|
children: /* @__PURE__ */ jsx(Trash2, {
|
|
@@ -161,7 +161,7 @@ function KeyValueManagerTable({ rows, itemsPerPage = 10, hasSearchQuery, onDelet
|
|
|
161
161
|
color: "primary",
|
|
162
162
|
size: "icon",
|
|
163
163
|
fullWidth: false,
|
|
164
|
-
"aria-label":
|
|
164
|
+
"aria-label": previousPage,
|
|
165
165
|
disabled: noRows || !hasPrev,
|
|
166
166
|
onClick: goPrev,
|
|
167
167
|
children: /* @__PURE__ */ jsx(ChevronLeft, {
|
|
@@ -174,7 +174,7 @@ function KeyValueManagerTable({ rows, itemsPerPage = 10, hasSearchQuery, onDelet
|
|
|
174
174
|
color: "primary",
|
|
175
175
|
size: "icon",
|
|
176
176
|
fullWidth: false,
|
|
177
|
-
"aria-label":
|
|
177
|
+
"aria-label": nextPage,
|
|
178
178
|
disabled: noRows || !hasNext,
|
|
179
179
|
onClick: goNext,
|
|
180
180
|
children: /* @__PURE__ */ jsx(ChevronRight, {
|
|
@@ -67,6 +67,7 @@ function KeyValueManager({ items, meta, onUpdate, maxAllowed, itemsPerPage = 10,
|
|
|
67
67
|
/* @__PURE__ */ jsx(SearchBox, {
|
|
68
68
|
className: cn("min-w-0 flex-1", !searchExpanded && "max-sm:hidden"),
|
|
69
69
|
placeholder: labels.search,
|
|
70
|
+
clearLabel: labels.clearSearch,
|
|
70
71
|
onSearch: setSearchQuery,
|
|
71
72
|
onClear: () => setSearchQuery(""),
|
|
72
73
|
onValueChange: setSearchQuery
|
|
@@ -103,7 +104,10 @@ function KeyValueManager({ items, meta, onUpdate, maxAllowed, itemsPerPage = 10,
|
|
|
103
104
|
valueLabel: labels.valueLabel,
|
|
104
105
|
actionLabel: labels.actionLabel,
|
|
105
106
|
emptyItems: labels.emptyItems,
|
|
106
|
-
emptySearch: labels.emptySearch
|
|
107
|
+
emptySearch: labels.emptySearch,
|
|
108
|
+
previousPage: labels.previousPage,
|
|
109
|
+
nextPage: labels.nextPage,
|
|
110
|
+
deleteItem: labels.deleteItem
|
|
107
111
|
})]
|
|
108
112
|
});
|
|
109
113
|
}
|
|
@@ -10,7 +10,11 @@ var STATIC_DEFAULT_LABELS = {
|
|
|
10
10
|
actionLabel: "Action",
|
|
11
11
|
emptyItems: "No items",
|
|
12
12
|
emptySearch: "No matches",
|
|
13
|
-
selectPlaceholder: "Select"
|
|
13
|
+
selectPlaceholder: "Select",
|
|
14
|
+
clearSearch: "Clear search",
|
|
15
|
+
previousPage: "Previous page",
|
|
16
|
+
nextPage: "Next page",
|
|
17
|
+
deleteItem: (key) => `Delete ${key}`
|
|
14
18
|
};
|
|
15
19
|
({ ...STATIC_DEFAULT_LABELS }), `${STATIC_DEFAULT_LABELS.keyLabel.toLowerCase()}${STATIC_DEFAULT_LABELS.valueLabel.toLowerCase()}`;
|
|
16
20
|
function resolveKeyValueManagerLabels(labels) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
|
|
4
|
-
import { c as SectionCardVariant, b as SectionCardSize } from '../../section-card-
|
|
4
|
+
import { c as SectionCardVariant, b as SectionCardSize } from '../../section-card-Bs3sKQtv.js';
|
|
5
5
|
import { C as Color } from '../../index-BQANnKs9.js';
|
|
6
6
|
import '../../variant-DjdaxfIA.js';
|
|
7
7
|
|
|
@@ -33,6 +33,21 @@ interface NavBarMenuItem {
|
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
}
|
|
35
35
|
type NavBarPosition = 'sticky' | 'fixed' | 'static';
|
|
36
|
+
/** The bar's accessible names (screen readers). Each defaults to the English given. */
|
|
37
|
+
interface NavBarLabels {
|
|
38
|
+
/** The bar's own landmark, and its row of items. Default "Main navigation". */
|
|
39
|
+
navigation?: string;
|
|
40
|
+
/** The phone's menu button. Default "Open menu". */
|
|
41
|
+
openMenu?: string;
|
|
42
|
+
/** The "More" overflow button's full name. Default "More navigation items". */
|
|
43
|
+
moreItems?: string;
|
|
44
|
+
/** The phone menu's list of items. Default "Mobile navigation". */
|
|
45
|
+
mobileNavigation?: string;
|
|
46
|
+
/** The phone menu's way back from an item's details. Default "Back to menu". */
|
|
47
|
+
back?: string;
|
|
48
|
+
/** The phone menu's close button. Default "Close". */
|
|
49
|
+
close?: string;
|
|
50
|
+
}
|
|
36
51
|
interface NavBarProps {
|
|
37
52
|
/** Logo element rendered on the left side of the navbar. */
|
|
38
53
|
logo?: ReactNode;
|
|
@@ -93,6 +108,8 @@ interface NavBarProps {
|
|
|
93
108
|
morphScrollContainer?: RefObject<HTMLElement | null>;
|
|
94
109
|
/** Label for the "More" overflow trigger button. Default `"More"`. */
|
|
95
110
|
moreLabel?: string;
|
|
111
|
+
/** The bar's accessible names, for an app in another language. English by default. */
|
|
112
|
+
labels?: NavBarLabels;
|
|
96
113
|
/**
|
|
97
114
|
* Router-aware Link component for internal navigation. Receives `to`,
|
|
98
115
|
* `className`, `children`, plus any additional HTML anchor attributes.
|
|
@@ -143,6 +160,6 @@ interface NavBarProps {
|
|
|
143
160
|
itemsClassName?: string;
|
|
144
161
|
}
|
|
145
162
|
|
|
146
|
-
declare function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActiveId, onActiveChange, openDetailsId: openDetailsIdProp, onDetailsPanelChange, openDetailsOn, position, height, morphOnScroll, morphScrollThreshold, morphScrollContainer, moreLabel, linkComponent, color, mobileMenuTitle, mobileMenuTrigger, className, topClassName, topBackground, itemsClassName, }: NavBarProps): React.JSX.Element;
|
|
163
|
+
declare function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActiveId, onActiveChange, openDetailsId: openDetailsIdProp, onDetailsPanelChange, openDetailsOn, position, height, morphOnScroll, morphScrollThreshold, morphScrollContainer, moreLabel, labels, linkComponent, color, mobileMenuTitle, mobileMenuTrigger, className, topClassName, topBackground, itemsClassName, }: NavBarProps): React.JSX.Element;
|
|
147
164
|
|
|
148
|
-
export { NavBar, type NavBarMenuItem, type NavBarPosition, type NavBarProps };
|
|
165
|
+
export { NavBar, type NavBarLabels, type NavBarMenuItem, type NavBarPosition, type NavBarProps };
|
|
@@ -5,7 +5,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { AnimatePresence, motion } from "motion/react";
|
|
6
6
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
7
7
|
//#region src/components/nav-bar/nav-bar-mobile-menu.tsx
|
|
8
|
-
function NavBarMobileMenu({ items, activeId, onItemClick, open, onOpenChange, linkComponent, title, colorClasses }) {
|
|
8
|
+
function NavBarMobileMenu({ items, activeId, onItemClick, open, onOpenChange, linkComponent, title, colorClasses, labels }) {
|
|
9
9
|
const [detailsId, setDetailsId] = React$1.useState(null);
|
|
10
10
|
const detailsItem = detailsId ? items.find((item) => item.id === detailsId) : void 0;
|
|
11
11
|
const listRef = React$1.useRef(null);
|
|
@@ -42,6 +42,7 @@ function NavBarMobileMenu({ items, activeId, onItemClick, open, onOpenChange, li
|
|
|
42
42
|
side: "left",
|
|
43
43
|
className: "w-[min(20rem,calc(100vw-3rem))] p-0",
|
|
44
44
|
showCloseButton: true,
|
|
45
|
+
closeLabel: labels?.close,
|
|
45
46
|
children: [title && /* @__PURE__ */ jsx(SheetHeader, {
|
|
46
47
|
className: "px-4 pt-4 pb-2",
|
|
47
48
|
children: /* @__PURE__ */ jsx(SheetTitle, { children: title })
|
|
@@ -58,7 +59,7 @@ function NavBarMobileMenu({ items, activeId, onItemClick, open, onOpenChange, li
|
|
|
58
59
|
transition: SLIDE_TRANSITION,
|
|
59
60
|
children: /* @__PURE__ */ jsx("nav", {
|
|
60
61
|
className: "flex flex-col py-2",
|
|
61
|
-
"aria-label": "Mobile navigation",
|
|
62
|
+
"aria-label": labels?.mobileNavigation ?? "Mobile navigation",
|
|
62
63
|
children: items.map((item) => /* @__PURE__ */ jsx("div", {
|
|
63
64
|
"data-mobile-nav-item-id": item.id,
|
|
64
65
|
children: /* @__PURE__ */ jsx(MobileMenuItemTrigger, {
|
|
@@ -87,7 +88,7 @@ function NavBarMobileMenu({ items, activeId, onItemClick, open, onOpenChange, li
|
|
|
87
88
|
type: "button",
|
|
88
89
|
onClick: () => setDetailsId(null),
|
|
89
90
|
className: cn("inline-flex items-center justify-center size-8 shrink-0 cursor-pointer", "rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))]", "text-foreground/60 hover:text-foreground hover:bg-foreground/5 transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
|
|
90
|
-
"aria-label": "Back to menu",
|
|
91
|
+
"aria-label": labels?.back ?? "Back to menu",
|
|
91
92
|
children: /* @__PURE__ */ jsx(ChevronLeft, {
|
|
92
93
|
className: "size-4",
|
|
93
94
|
"aria-hidden": "true"
|
|
@@ -76,7 +76,7 @@ function resolveNavColor(color) {
|
|
|
76
76
|
}
|
|
77
77
|
var PILL_PANEL_RADIUS = 24;
|
|
78
78
|
var TRANSLUCENT_BACKGROUND = "backdrop-blur-md supports-[backdrop-filter]:bg-background/80";
|
|
79
|
-
function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActiveId, onActiveChange, openDetailsId: openDetailsIdProp, onDetailsPanelChange, openDetailsOn = "click", position = "sticky", height, morphOnScroll = false, morphScrollThreshold = 50, morphScrollContainer, moreLabel = "More", linkComponent, color = "primary", mobileMenuTitle, mobileMenuTrigger, className, topClassName, topBackground = "translucent", itemsClassName }) {
|
|
79
|
+
function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActiveId, onActiveChange, openDetailsId: openDetailsIdProp, onDetailsPanelChange, openDetailsOn = "click", position = "sticky", height, morphOnScroll = false, morphScrollThreshold = 50, morphScrollContainer, moreLabel = "More", labels, linkComponent, color = "primary", mobileMenuTitle, mobileMenuTrigger, className, topClassName, topBackground = "translucent", itemsClassName }) {
|
|
80
80
|
const isMobile = useIsMobile();
|
|
81
81
|
const resolvedColor = resolveNavColor(color);
|
|
82
82
|
const navRef = React$1.useRef(null);
|
|
@@ -263,7 +263,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
263
263
|
if (isMobile) return /* @__PURE__ */ jsxs("nav", {
|
|
264
264
|
ref: navRef,
|
|
265
265
|
className: cn("relative z-50 w-full border-b border-header-border text-foreground", background, position === "sticky" && "sticky top-0", position === "fixed" && "fixed top-0 left-0", className, atTopClassName),
|
|
266
|
-
"aria-label": "Main navigation",
|
|
266
|
+
"aria-label": labels?.navigation ?? "Main navigation",
|
|
267
267
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
268
268
|
className: "flex items-center gap-3 px-4",
|
|
269
269
|
style: { height: resolvedHeight },
|
|
@@ -278,7 +278,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
278
278
|
onClick: () => setMobileMenuOpen(true),
|
|
279
279
|
children: [/* @__PURE__ */ jsx(Menu, { className: "!size-5" }), /* @__PURE__ */ jsx("span", {
|
|
280
280
|
className: "sr-only",
|
|
281
|
-
children: "Open menu"
|
|
281
|
+
children: labels?.openMenu ?? "Open menu"
|
|
282
282
|
})]
|
|
283
283
|
}),
|
|
284
284
|
logo && /* @__PURE__ */ jsx("div", {
|
|
@@ -298,6 +298,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
298
298
|
onOpenChange: setMobileMenuOpen,
|
|
299
299
|
linkComponent,
|
|
300
300
|
title: mobileMenuTitle,
|
|
301
|
+
labels,
|
|
301
302
|
colorClasses: {
|
|
302
303
|
textClass: resolvedColor.textClass,
|
|
303
304
|
bgClass: resolvedColor.bgClass,
|
|
@@ -312,7 +313,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
312
313
|
className: navClasses,
|
|
313
314
|
"data-details-open": panelVisible ? "" : void 0,
|
|
314
315
|
...morphAnimateProps,
|
|
315
|
-
"aria-label": "Main navigation",
|
|
316
|
+
"aria-label": labels?.navigation ?? "Main navigation",
|
|
316
317
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
317
318
|
className: cn("flex items-center gap-4 mx-auto w-full py-2 transition-[padding] duration-300", isScrolled && morphOnScroll ? "px-4 md:px-6 lg:px-8" : "px-4 lg:px-6"),
|
|
318
319
|
style: { minHeight: resolvedHeight },
|
|
@@ -347,6 +348,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
347
348
|
"aria-hidden": "true",
|
|
348
349
|
children: /* @__PURE__ */ jsx(MoreButton, {
|
|
349
350
|
label: moreLabel,
|
|
351
|
+
ariaLabel: labels?.moreItems,
|
|
350
352
|
hasActiveOverflowItem: false
|
|
351
353
|
})
|
|
352
354
|
}),
|
|
@@ -355,7 +357,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
355
357
|
children: /* @__PURE__ */ jsx("ul", {
|
|
356
358
|
className: cn("flex items-center gap-1 list-none m-0 p-0", measuring && "opacity-0"),
|
|
357
359
|
role: "menubar",
|
|
358
|
-
"aria-label": "Main navigation",
|
|
360
|
+
"aria-label": labels?.navigation ?? "Main navigation",
|
|
359
361
|
children: items.filter((item) => visibleIds.includes(item.id)).map((item) => {
|
|
360
362
|
const hoverLink = hoverDetails && Boolean(item.details && item.href);
|
|
361
363
|
return /* @__PURE__ */ jsx("li", {
|
|
@@ -384,6 +386,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
384
386
|
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
385
387
|
asChild: true,
|
|
386
388
|
children: /* @__PURE__ */ jsx(MoreButton, {
|
|
389
|
+
ariaLabel: labels?.moreItems,
|
|
387
390
|
label: moreLabel,
|
|
388
391
|
hasActiveOverflowItem,
|
|
389
392
|
isDetailsOpen: isOverflowDetailsOpen,
|
|
@@ -462,7 +465,7 @@ function useDetailsDirection(items, openId) {
|
|
|
462
465
|
}
|
|
463
466
|
return state.direction;
|
|
464
467
|
}
|
|
465
|
-
var MoreButton = React$1.forwardRef(function MoreButton({ label, hasActiveOverflowItem, isDetailsOpen = false, resolvedColor, ...props }, ref) {
|
|
468
|
+
var MoreButton = React$1.forwardRef(function MoreButton({ label, ariaLabel = "More navigation items", hasActiveOverflowItem, isDetailsOpen = false, resolvedColor, ...props }, ref) {
|
|
466
469
|
const highlighted = hasActiveOverflowItem || isDetailsOpen;
|
|
467
470
|
return /* @__PURE__ */ jsxs("button", {
|
|
468
471
|
ref,
|
|
@@ -472,7 +475,7 @@ var MoreButton = React$1.forwardRef(function MoreButton({ label, hasActiveOverfl
|
|
|
472
475
|
...resolvedColor.textStyle,
|
|
473
476
|
...resolvedColor.bgStyle
|
|
474
477
|
} : void 0,
|
|
475
|
-
"aria-label":
|
|
478
|
+
"aria-label": ariaLabel,
|
|
476
479
|
...props,
|
|
477
480
|
children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx(ChevronDown, { className: cn("size-3.5 transition-transform duration-200", isDetailsOpen && "rotate-180") })]
|
|
478
481
|
});
|
|
@@ -27,8 +27,10 @@ type SheetCloseProps = SheetCloseProps$1;
|
|
|
27
27
|
declare function SheetClose(props: SheetCloseProps): React.JSX.Element;
|
|
28
28
|
type SheetContentProps = SheetContentProps$1 & Pick<StyleAxisProps, 'radius' | 'elevation'> & DensityProps & {
|
|
29
29
|
showCloseButton?: boolean;
|
|
30
|
+
/** The close button's accessible name, for an app in another language. Default "Close". */
|
|
31
|
+
closeLabel?: string;
|
|
30
32
|
};
|
|
31
|
-
declare function SheetContent({ className, children, side, showCloseButton, onEscapeKeyDown, onPointerDownOutside, radius, elevation, density, style, ...props }: SheetContentProps): React.JSX.Element;
|
|
33
|
+
declare function SheetContent({ className, children, side, showCloseButton, closeLabel, onEscapeKeyDown, onPointerDownOutside, radius, elevation, density, style, ...props }: SheetContentProps): React.JSX.Element;
|
|
32
34
|
type SheetHeaderProps = SheetHeaderProps$1;
|
|
33
35
|
declare function SheetHeader({ className, ...props }: SheetHeaderProps): React.JSX.Element;
|
|
34
36
|
type SheetFooterProps = SheetFooterProps$1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export { S as SidebarEndActionConfig, a as SidebarGroupConfig, b as SidebarItemConfig, c as
|
|
2
|
+
import { f as SidebarProps$1 } from '../../types-CoZOfz4S.js';
|
|
3
|
+
export { S as SidebarEndActionConfig, a as SidebarGroupConfig, b as SidebarItemConfig, c as SidebarLabels, d as SidebarLinkComponentProps, e as SidebarNavEntry, g as SidebarTopLevelLinkConfig, i as isSidebarGroup } from '../../types-CoZOfz4S.js';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
import { Transition } from 'motion/react';
|
|
@@ -13,7 +13,7 @@ import '../../index-BQANnKs9.js';
|
|
|
13
13
|
import '@radix-ui/react-separator';
|
|
14
14
|
import '../../slot-DGErA9zi.js';
|
|
15
15
|
|
|
16
|
-
declare function Sidebar$1({ items, currentPath, header, headerHeight, footer, linkComponent: LinkComponent, collapsible, variant, focusActiveGroup, density, flyoutRadius, flyoutElevation, beforeContent, headerClassName, className, mobileClassName, id, onClick, }: SidebarProps$1): React.JSX.Element;
|
|
16
|
+
declare function Sidebar$1({ items, currentPath, header, headerHeight, footer, linkComponent: LinkComponent, collapsible, variant, focusActiveGroup, density, flyoutRadius, flyoutElevation, beforeContent, headerClassName, className, mobileClassName, id, onClick, labels, }: SidebarProps$1): React.JSX.Element;
|
|
17
17
|
|
|
18
18
|
type SidebarContextProps = {
|
|
19
19
|
state: 'expanded' | 'collapsed';
|
|
@@ -40,10 +40,17 @@ type SidebarProps = React.ComponentProps<'div'> & {
|
|
|
40
40
|
mobileClassName?: string;
|
|
41
41
|
animateOnHover?: boolean;
|
|
42
42
|
transition?: Transition;
|
|
43
|
+
/** Screen-reader title of the mobile sheet. Default "Sidebar". */
|
|
44
|
+
mobileTitle?: string;
|
|
45
|
+
/** Screen-reader description of the mobile sheet. Default "Displays the mobile sidebar.". */
|
|
46
|
+
mobileDescription?: string;
|
|
43
47
|
};
|
|
44
|
-
declare function Sidebar({ side, variant, collapsible, className, children, animateOnHover, containerClassName, mobileClassName, transition, ...props }: SidebarProps): React.JSX.Element;
|
|
45
|
-
type SidebarTriggerProps = React.ComponentProps<typeof Button
|
|
46
|
-
|
|
48
|
+
declare function Sidebar({ side, variant, collapsible, className, children, animateOnHover, containerClassName, mobileClassName, transition, mobileTitle, mobileDescription, ...props }: SidebarProps): React.JSX.Element;
|
|
49
|
+
type SidebarTriggerProps = React.ComponentProps<typeof Button> & {
|
|
50
|
+
/** Screen-reader name of the button. Default "Toggle Sidebar". */
|
|
51
|
+
label?: string;
|
|
52
|
+
};
|
|
53
|
+
declare function SidebarTrigger({ className, onClick, label, ...props }: SidebarTriggerProps): React.JSX.Element;
|
|
47
54
|
type SidebarRailProps = React.ComponentProps<'button'>;
|
|
48
55
|
declare function SidebarRail({ className, ...props }: SidebarRailProps): React.JSX.Element;
|
|
49
56
|
type SidebarInsetProps = React.ComponentProps<'main'>;
|
|
@@ -196,7 +196,7 @@ function TopLevelLinkRow({ item, isCollapsed, isMobile, renderMenuItem }) {
|
|
|
196
196
|
})
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
function Sidebar({ items, currentPath, header, headerHeight, footer, linkComponent: LinkComponent, collapsible = "icon", variant = "sidebar", focusActiveGroup = false, density, flyoutRadius, flyoutElevation, beforeContent, headerClassName, className, mobileClassName, id, onClick }) {
|
|
199
|
+
function Sidebar({ items, currentPath, header, headerHeight, footer, linkComponent: LinkComponent, collapsible = "icon", variant = "sidebar", focusActiveGroup = false, density, flyoutRadius, flyoutElevation, beforeContent, headerClassName, className, mobileClassName, id, onClick, labels }) {
|
|
200
200
|
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
201
201
|
const isCollapsed = state === "collapsed";
|
|
202
202
|
/** On mobile the sidebar is a sheet overlaying the page: navigating away should dismiss it. */
|
|
@@ -322,6 +322,8 @@ function Sidebar({ items, currentPath, header, headerHeight, footer, linkCompone
|
|
|
322
322
|
variant,
|
|
323
323
|
style: densityStyle(density),
|
|
324
324
|
mobileClassName,
|
|
325
|
+
mobileTitle: labels?.mobileTitle,
|
|
326
|
+
mobileDescription: labels?.mobileDescription,
|
|
325
327
|
...!isMobile && {
|
|
326
328
|
className,
|
|
327
329
|
id,
|
|
@@ -341,7 +343,7 @@ function Sidebar({ items, currentPath, header, headerHeight, footer, linkCompone
|
|
|
341
343
|
onClick: () => setOpenMobile(false),
|
|
342
344
|
children: [/* @__PURE__ */ jsx(X, { className: "size-5" }), /* @__PURE__ */ jsx("span", {
|
|
343
345
|
className: "sr-only",
|
|
344
|
-
children: "Close sidebar"
|
|
346
|
+
children: labels?.close ?? "Close sidebar"
|
|
345
347
|
})]
|
|
346
348
|
})]
|
|
347
349
|
}),
|
|
@@ -8,13 +8,22 @@ interface SimplePaginatedListItem {
|
|
|
8
8
|
action?: ReactNode;
|
|
9
9
|
}
|
|
10
10
|
type SimplePaginatedListSize = "sm" | "default" | "lg";
|
|
11
|
+
/** The list's own words, for an app in another language. English by default. */
|
|
12
|
+
interface SimplePaginatedListLabels {
|
|
13
|
+
/** The previous-page arrow. Default "Previous page". */
|
|
14
|
+
previousPage?: string;
|
|
15
|
+
/** The next-page arrow. Default "Next page". */
|
|
16
|
+
nextPage?: string;
|
|
17
|
+
}
|
|
11
18
|
interface SimplePaginatedListProps {
|
|
12
19
|
items: SimplePaginatedListItem[];
|
|
13
20
|
itemsPerPage?: number;
|
|
14
21
|
size?: SimplePaginatedListSize;
|
|
15
22
|
className?: string;
|
|
23
|
+
/** Screen-reader names of the page arrows, for an app in another language. */
|
|
24
|
+
labels?: SimplePaginatedListLabels;
|
|
16
25
|
}
|
|
17
26
|
|
|
18
|
-
declare function SimplePaginatedList({ items, itemsPerPage, size, className, }: SimplePaginatedListProps): React.JSX.Element;
|
|
27
|
+
declare function SimplePaginatedList({ items, itemsPerPage, size, className, labels, }: SimplePaginatedListProps): React.JSX.Element;
|
|
19
28
|
|
|
20
|
-
export { SimplePaginatedList, type SimplePaginatedListItem, type SimplePaginatedListProps, type SimplePaginatedListSize };
|
|
29
|
+
export { SimplePaginatedList, type SimplePaginatedListItem, type SimplePaginatedListLabels, type SimplePaginatedListProps, type SimplePaginatedListSize };
|
|
@@ -90,7 +90,7 @@ function ListRow({ item, showBorder, styles }) {
|
|
|
90
90
|
]
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
function SimplePaginatedList({ items, itemsPerPage = 3, size = "default", className }) {
|
|
93
|
+
function SimplePaginatedList({ items, itemsPerPage = 3, size = "default", className, labels }) {
|
|
94
94
|
const [page, setPage] = useState(0);
|
|
95
95
|
const [direction, setDirection] = useState(1);
|
|
96
96
|
const pageSize = Math.max(1, itemsPerPage);
|
|
@@ -147,7 +147,7 @@ function SimplePaginatedList({ items, itemsPerPage = 3, size = "default", classN
|
|
|
147
147
|
color: "primary",
|
|
148
148
|
size: "icon",
|
|
149
149
|
fullWidth: false,
|
|
150
|
-
"aria-label": "Previous page",
|
|
150
|
+
"aria-label": labels?.previousPage ?? "Previous page",
|
|
151
151
|
disabled: noItems || !hasPrev,
|
|
152
152
|
onClick: goPrev,
|
|
153
153
|
children: /* @__PURE__ */ jsx(ChevronLeft, {
|
|
@@ -160,7 +160,7 @@ function SimplePaginatedList({ items, itemsPerPage = 3, size = "default", classN
|
|
|
160
160
|
color: "primary",
|
|
161
161
|
size: "icon",
|
|
162
162
|
fullWidth: false,
|
|
163
|
-
"aria-label": "Next page",
|
|
163
|
+
"aria-label": labels?.nextPage ?? "Next page",
|
|
164
164
|
disabled: noItems || !hasNext,
|
|
165
165
|
onClick: goNext,
|
|
166
166
|
children: /* @__PURE__ */ jsx(ChevronRight, {
|
|
@@ -21,6 +21,8 @@ interface StatCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, P
|
|
|
21
21
|
previousValue?: number;
|
|
22
22
|
previousValueComparisonTip?: string | ReactNode;
|
|
23
23
|
infoContent?: string | ReactNode;
|
|
24
|
+
/** `aria-label` on the info trigger shown with `infoContent`. Default "More information". */
|
|
25
|
+
infoIconLabel?: string;
|
|
24
26
|
valueType?: StatCardValueType;
|
|
25
27
|
surface?: StatCardSurface;
|
|
26
28
|
/**
|
|
@@ -113,7 +113,7 @@ function getTrend(value, previousValue) {
|
|
|
113
113
|
label: `${Math.abs(percent).toLocaleString(void 0, { maximumFractionDigits: 1 })}%`
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
var StatCard = React$1.forwardRef(({ color, size = "default", loading = false, icon, heading, value, previousValue, previousValueComparisonTip, infoContent, valueType = "number", surface: surfaceKind = "tinted", visual, caption, className, style, radius, ...divProps }, ref) => {
|
|
116
|
+
var StatCard = React$1.forwardRef(({ color, size = "default", loading = false, icon, heading, value, previousValue, previousValueComparisonTip, infoContent, infoIconLabel = "More information", valueType = "number", surface: surfaceKind = "tinted", visual, caption, className, style, radius, ...divProps }, ref) => {
|
|
117
117
|
const { partStyle } = useStyleAxes({ radius }, ["radius"]);
|
|
118
118
|
const s = SIZE_STYLES[size];
|
|
119
119
|
const statColor = resolveStatColor(color, value, previousValue);
|
|
@@ -198,7 +198,7 @@ var StatCard = React$1.forwardRef(({ color, size = "default", loading = false, i
|
|
|
198
198
|
asChild: true,
|
|
199
199
|
children: /* @__PURE__ */ jsx("button", {
|
|
200
200
|
type: "button",
|
|
201
|
-
"aria-label":
|
|
201
|
+
"aria-label": infoIconLabel,
|
|
202
202
|
className: cn("inline-flex shrink-0 items-center justify-center rounded-full outline-none transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background", s.info, presetInfoClass),
|
|
203
203
|
style: infoButtonStyle,
|
|
204
204
|
children: /* @__PURE__ */ jsx(Info, { "aria-hidden": true })
|
|
@@ -24,6 +24,8 @@ interface TagProps extends HTMLAttributes<HTMLDivElement>, Pick<StyleAxisProps,
|
|
|
24
24
|
/** When true, render the tag, name chip, and delete action with fully rounded corners. Same as `radius="full"`; `radius` wins when both are set. */
|
|
25
25
|
rounded?: boolean;
|
|
26
26
|
onDelete?: () => void;
|
|
27
|
+
/** Accessible name of the delete button. Default `Remove <name>: <value>` (or `Remove <value>`). */
|
|
28
|
+
deleteLabel?: string;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLDivElement>>;
|