@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
|
@@ -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
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Button } from "../button/button.js";
|
|
2
|
+
import { Badge } from "../../core/badge.js";
|
|
3
|
+
import { BottomSheet } from "../bottom-sheet/bottom-sheet.js";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { SlidersHorizontal } from "lucide-react";
|
|
7
|
+
import { createPortal } from "react-dom";
|
|
8
|
+
//#region src/components/filters-bar/filters-bar-sheet.tsx
|
|
9
|
+
/** Matches `@xl` (36rem), where the bar starts showing its filters inline. */
|
|
10
|
+
var INLINE_FILTERS_MIN_WIDTH = 576;
|
|
11
|
+
/**
|
|
12
|
+
* The narrow bar's "Filters" button and the bottom sheet it opens, which holds
|
|
13
|
+
* the filters full width and, pinned to its bottom edge, the "Clear all" link.
|
|
14
|
+
*/
|
|
15
|
+
function FiltersBarSheet({ barRef, filters, activeFilterCount, onClearAll, labels }) {
|
|
16
|
+
const [open, setOpen] = React$1.useState(false);
|
|
17
|
+
React$1.useEffect(() => {
|
|
18
|
+
const bar = barRef.current;
|
|
19
|
+
if (!open || !bar || typeof ResizeObserver === "undefined") return;
|
|
20
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
21
|
+
if (entry && entry.contentRect.width >= INLINE_FILTERS_MIN_WIDTH) setOpen(false);
|
|
22
|
+
});
|
|
23
|
+
observer.observe(bar);
|
|
24
|
+
return () => observer.disconnect();
|
|
25
|
+
}, [open, barRef]);
|
|
26
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Button, {
|
|
27
|
+
type: "button",
|
|
28
|
+
variant: "outline",
|
|
29
|
+
color: "gray",
|
|
30
|
+
size: "sm",
|
|
31
|
+
fullWidth: false,
|
|
32
|
+
"aria-expanded": open,
|
|
33
|
+
"aria-haspopup": "dialog",
|
|
34
|
+
startIcon: /* @__PURE__ */ jsx(SlidersHorizontal, { "aria-hidden": true }),
|
|
35
|
+
className: "shrink-0 @xl:hidden",
|
|
36
|
+
onClick: () => setOpen(!open),
|
|
37
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: "sr-only",
|
|
39
|
+
children: labels.filters
|
|
40
|
+
}), activeFilterCount > 0 && /* @__PURE__ */ jsx(Badge, {
|
|
41
|
+
variant: "solid",
|
|
42
|
+
color: "primary",
|
|
43
|
+
radius: "full",
|
|
44
|
+
className: "font-mono",
|
|
45
|
+
children: activeFilterCount
|
|
46
|
+
})]
|
|
47
|
+
}), open && createPortal(/* @__PURE__ */ jsx(BottomSheet, {
|
|
48
|
+
title: labels.filters,
|
|
49
|
+
icon: /* @__PURE__ */ jsx(SlidersHorizontal, {}),
|
|
50
|
+
labels: labels.sheet,
|
|
51
|
+
onClose: () => setOpen(false),
|
|
52
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
53
|
+
className: "flex min-h-full flex-col",
|
|
54
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: "flex flex-col gap-3 p-4 *:w-full *:max-w-none! *:justify-start [&>*>:last-child]:ml-auto",
|
|
56
|
+
children: filters
|
|
57
|
+
}), onClearAll && /* @__PURE__ */ jsx("div", {
|
|
58
|
+
className: "sticky bottom-0 mt-auto border-t border-border bg-background p-4",
|
|
59
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
60
|
+
type: "button",
|
|
61
|
+
variant: "link",
|
|
62
|
+
color: "error",
|
|
63
|
+
size: "sm",
|
|
64
|
+
className: "justify-center font-normal",
|
|
65
|
+
onClick: onClearAll,
|
|
66
|
+
children: labels.clearAll
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
}), document.body)] });
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { FiltersBarSheet as default };
|
|
@@ -1,39 +1,62 @@
|
|
|
1
1
|
import { cn } from "../../utils/cn.js";
|
|
2
2
|
import { densityStyle } from "../../utils/style-axes.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
import FiltersBarSheet from "./filters-bar-sheet.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
3
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
//#region src/components/filters-bar/filters-bar.tsx
|
|
5
|
-
|
|
8
|
+
/**
|
|
9
|
+
* A list page's toolbar. The first row holds the search and the page actions;
|
|
10
|
+
* the filters and "Clear all" get rows of their own below it, so adding a
|
|
11
|
+
* filter never moves the search or the actions.
|
|
12
|
+
*/
|
|
13
|
+
function FiltersBar({ search, actions, filters, activeFilterCount = 0, onClearAll, labels, searchClassName, className, density }) {
|
|
14
|
+
const barRef = React$1.useRef(null);
|
|
6
15
|
const style = densityStyle(density);
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
const foldsIntoSheet = Boolean(filters && labels);
|
|
17
|
+
const clearAll = onClearAll && labels && /* @__PURE__ */ jsx(Button, {
|
|
18
|
+
type: "button",
|
|
19
|
+
variant: "link",
|
|
20
|
+
color: "error",
|
|
21
|
+
size: "sm",
|
|
22
|
+
fullWidth: false,
|
|
23
|
+
className: "font-normal",
|
|
24
|
+
onClick: onClearAll,
|
|
25
|
+
children: labels.clearAll
|
|
26
|
+
});
|
|
27
|
+
const firstRow = (search || actions || foldsIntoSheet) && /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "flex w-full flex-wrap items-center justify-between gap-3 md:gap-4",
|
|
29
|
+
children: [
|
|
30
|
+
search && /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: cn("min-w-48 flex-1", searchClassName ?? "max-w-md"),
|
|
32
|
+
children: search
|
|
33
|
+
}),
|
|
34
|
+
foldsIntoSheet && labels && /* @__PURE__ */ jsx(FiltersBarSheet, {
|
|
35
|
+
barRef,
|
|
36
|
+
filters,
|
|
37
|
+
activeFilterCount,
|
|
38
|
+
onClearAll,
|
|
39
|
+
labels
|
|
40
|
+
}),
|
|
41
|
+
actions && /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: "ml-auto flex shrink-0 items-center justify-end gap-2 md:gap-3",
|
|
43
|
+
children: actions
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
if (!filters) return /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: cn("w-full", className),
|
|
9
49
|
style,
|
|
10
|
-
children:
|
|
11
|
-
className: cn("min-w-0 flex-1", searchClassName ?? "max-w-md"),
|
|
12
|
-
children: search
|
|
13
|
-
}), actions && /* @__PURE__ */ jsx("div", {
|
|
14
|
-
className: "ml-auto flex shrink-0 items-center justify-end gap-2 md:gap-3",
|
|
15
|
-
children: actions
|
|
16
|
-
})]
|
|
50
|
+
children: firstRow
|
|
17
51
|
});
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
52
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
53
|
+
ref: barRef,
|
|
54
|
+
className: cn("@container flex w-full flex-col gap-3", className),
|
|
20
55
|
style,
|
|
21
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
22
|
-
className: "flex flex-
|
|
23
|
-
children: [
|
|
24
|
-
|
|
25
|
-
children: [search && /* @__PURE__ */ jsx("div", {
|
|
26
|
-
className: cn("min-w-0 flex-1 @3xl:order-1 @3xl:flex-none", searchClassName ?? "@3xl:w-xs"),
|
|
27
|
-
children: search
|
|
28
|
-
}), actions && /* @__PURE__ */ jsx("div", {
|
|
29
|
-
className: "ml-auto flex shrink-0 items-center justify-end gap-2 @3xl:order-3",
|
|
30
|
-
children: actions
|
|
31
|
-
})]
|
|
32
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
33
|
-
className: "-m-1 flex min-w-0 flex-nowrap items-center gap-2 overflow-x-auto p-1 [scrollbar-width:none] empty:hidden *:shrink-0 [&::-webkit-scrollbar]:hidden @3xl:order-2 @3xl:m-0 @3xl:flex-1 @3xl:flex-wrap @3xl:gap-x-5 @3xl:gap-y-3 @3xl:overflow-visible @3xl:p-0",
|
|
34
|
-
children: filters
|
|
35
|
-
})]
|
|
36
|
-
})
|
|
56
|
+
children: [firstRow, /* @__PURE__ */ jsxs("div", {
|
|
57
|
+
className: cn("-m-1 flex min-w-0 flex-nowrap items-center gap-2 overflow-x-auto p-1 [scrollbar-width:none] empty:hidden *:shrink-0 [&::-webkit-scrollbar]:hidden @xl:m-0 @xl:flex-wrap @xl:overflow-visible @xl:p-0", foldsIntoSheet && "@max-xl:hidden"),
|
|
58
|
+
children: [filters, clearAll]
|
|
59
|
+
})]
|
|
37
60
|
});
|
|
38
61
|
}
|
|
39
62
|
//#endregion
|
|
@@ -1,26 +1,53 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { B as BottomSheetLabels } from '../../bottom-sheet.props-CFpM7Gvx.js';
|
|
3
4
|
import { d as DensityProps } from '../../style-axes-DSQ2DGc5.js';
|
|
4
5
|
|
|
6
|
+
/** The bar's own words, in the page's language (no English defaults). */
|
|
7
|
+
interface FiltersBarLabels {
|
|
8
|
+
/** Names the button that opens the filters sheet on a narrow bar, and titles that sheet. */
|
|
9
|
+
filters: string;
|
|
10
|
+
/** The "Clear all" link shown after the filters while `onClearAll` is set. */
|
|
11
|
+
clearAll: string;
|
|
12
|
+
/** The filters sheet's own controls. */
|
|
13
|
+
sheet: BottomSheetLabels;
|
|
14
|
+
}
|
|
5
15
|
interface FiltersBarProps extends DensityProps {
|
|
6
16
|
/** Search box. Grows to fill the first row next to `actions`. */
|
|
7
17
|
search?: ReactNode;
|
|
8
|
-
/** Primary actions (create, scope menus). End-aligned and never shrunk. */
|
|
18
|
+
/** Primary actions (create, scope menus). End-aligned on the first row and never shrunk. */
|
|
9
19
|
actions?: ReactNode;
|
|
10
20
|
/**
|
|
11
|
-
* Filter controls
|
|
12
|
-
*
|
|
13
|
-
*
|
|
21
|
+
* Filter controls. They get a row of their own under the search and
|
|
22
|
+
* actions, and wrap onto further rows when they don't fit. Below a
|
|
23
|
+
* 576px-wide bar, with `labels`, they fold into a "Filters" button that opens
|
|
24
|
+
* a bottom sheet; without `labels` they scroll sideways instead. Omit for a
|
|
25
|
+
* single search + actions row.
|
|
14
26
|
*/
|
|
15
27
|
filters?: ReactNode;
|
|
28
|
+
/** How many filters are set, shown as a badge on the narrow bar's "Filters" button. */
|
|
29
|
+
activeFilterCount?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Clears every filter. While set (and with `labels`), the bar shows a
|
|
32
|
+
* "Clear all" link after the filters and in the filters sheet. Pass it only
|
|
33
|
+
* while something is set.
|
|
34
|
+
*/
|
|
35
|
+
onClearAll?: () => void;
|
|
36
|
+
/** Needed for the "Filters" button, its sheet and the "Clear all" link. */
|
|
37
|
+
labels?: FiltersBarLabels;
|
|
16
38
|
/**
|
|
17
|
-
* Replaces the search wrapper's default width
|
|
18
|
-
*
|
|
39
|
+
* Replaces the search wrapper's default width, `max-w-md`: a different
|
|
40
|
+
* maximum, or a fixed width that stops it growing.
|
|
19
41
|
*/
|
|
20
42
|
searchClassName?: string;
|
|
21
43
|
className?: string;
|
|
22
44
|
}
|
|
23
45
|
|
|
24
|
-
|
|
46
|
+
/**
|
|
47
|
+
* A list page's toolbar. The first row holds the search and the page actions;
|
|
48
|
+
* the filters and "Clear all" get rows of their own below it, so adding a
|
|
49
|
+
* filter never moves the search or the actions.
|
|
50
|
+
*/
|
|
51
|
+
declare function FiltersBar({ search, actions, filters, activeFilterCount, onClearAll, labels, searchClassName, className, density, }: FiltersBarProps): React.JSX.Element;
|
|
25
52
|
|
|
26
|
-
export { FiltersBar, type FiltersBarProps };
|
|
53
|
+
export { FiltersBar, type FiltersBarLabels, type FiltersBarProps };
|
|
@@ -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';
|
|
@@ -34,7 +34,8 @@ export { ViewMode, ViewToggle, ViewToggleLabels, ViewToggleProps } from './view-
|
|
|
34
34
|
export { Toolbar, ToolbarButton, ToolbarButtonProps, ToolbarProps } from './toolbar/index.js';
|
|
35
35
|
export { AnchoredPanel, AnchoredPanelProps } from './anchored-panel/index.js';
|
|
36
36
|
export { FloatingWindow, FloatingWindowPosition, FloatingWindowProps } from './floating-window/index.js';
|
|
37
|
-
export { BottomSheet,
|
|
37
|
+
export { BottomSheet, SheetRest, settleSheet } from './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 './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 './trace/index.js';
|
|
40
41
|
export { Readout, ReadoutProps, ReadoutSegment } from './readout/index.js';
|
|
@@ -96,7 +97,7 @@ export { useIsMobile } from './use-mobile/index.js';
|
|
|
96
97
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './table/index.js';
|
|
97
98
|
export { Link, LinkColor, LinkProps } from './link/index.js';
|
|
98
99
|
export { SearchBox, SearchBoxProps } from './search-box/index.js';
|
|
99
|
-
export { FiltersBar, FiltersBarProps } from './filters-bar/index.js';
|
|
100
|
+
export { FiltersBar, FiltersBarLabels, FiltersBarProps } from './filters-bar/index.js';
|
|
100
101
|
export { AdvancedSearchBox, AdvancedSearchBoxProps, SearchMeta } from './advanced-search-box/index.js';
|
|
101
102
|
export { TogglableItem, TogglableItemsList, TogglableItemsListProps } from './togglable-items-list/index.js';
|
|
102
103
|
export { DEFAULT_PAGE_SIZE_OPTIONS, Pagination, PaginationProps } from './pagination/index.js';
|
|
@@ -117,7 +118,7 @@ export { StatusBadge, statusBadgeSizeVariants } from './status-badge/index.js';
|
|
|
117
118
|
export { S as StatusBadgeIcon, a as StatusBadgeProps } from '../status-badge.props-BVe8CmQZ.js';
|
|
118
119
|
export { Tag, TagProps } from './tag/index.js';
|
|
119
120
|
export { TagInput, TagInputProps } from './tag-input/index.js';
|
|
120
|
-
export { TransferItem, TransferList, TransferListProps } from './transfer-list/index.js';
|
|
121
|
+
export { TransferItem, TransferList, TransferListLabels, TransferListProps } from './transfer-list/index.js';
|
|
121
122
|
export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from './dialog/index.js';
|
|
122
123
|
export { Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverGroupProps, PopoverProps, PopoverTrigger } from './popover/index.js';
|
|
123
124
|
export { ConfirmationDialog, ConfirmationDialogProps } from './confirmation-dialog/index.js';
|
|
@@ -132,7 +133,7 @@ export { DynamicList, DynamicListEntry, DynamicListMetaEntry, DynamicListMetaTyp
|
|
|
132
133
|
export { KeyValueManager, KeyValueManagerFieldMeta, KeyValueManagerItem, KeyValueManagerLabels, KeyValueManagerProps } from './key-value-manager/index.js';
|
|
133
134
|
export { RequirementList, RequirementListItem, RequirementListProps, RequirementListSize } from './requirement-list/index.js';
|
|
134
135
|
export { SimpleList, SimpleListAvatarSize, SimpleListIconStyle, SimpleListItem, SimpleListItemDirection, SimpleListProps } from './simple-list/index.js';
|
|
135
|
-
export { SimplePaginatedList, SimplePaginatedListItem, SimplePaginatedListProps, SimplePaginatedListSize } from './simple-paginated-list/index.js';
|
|
136
|
+
export { SimplePaginatedList, SimplePaginatedListItem, SimplePaginatedListLabels, SimplePaginatedListProps, SimplePaginatedListSize } from './simple-paginated-list/index.js';
|
|
136
137
|
export { Alert } from './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 './toast/index.js';
|
|
@@ -147,7 +148,7 @@ export { CircularProgress, CircularProgressProps } from './circular-progress/ind
|
|
|
147
148
|
export { ProgressBar, ProgressBarProps, ProgressBarSegment } from './progress-bar/index.js';
|
|
148
149
|
export { FullSizeError, FullSizeErrorProps, InlineError, InlineErrorProps } from './error-display/index.js';
|
|
149
150
|
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-
|
|
151
|
+
export { S as SectionCard, a as SectionCardProps, b as SectionCardSize, c as SectionCardVariant } from '../section-card-Bs3sKQtv.js';
|
|
151
152
|
export { IconTextActionCard } from './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 './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;
|