@espressif/dashboard-ui-components 1.14.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.claude/rules/dashboard-ui-consumption.md +33 -0
  2. package/CHANGELOG.md +37 -0
  3. package/dist/common/index.d.ts +3 -3
  4. package/dist/common/my-account-menu/my-account-menu.js +3 -3
  5. package/dist/components/async-multi-select/async-multi-select.js +4 -8
  6. package/dist/components/async-multi-select/index.d.ts +5 -1
  7. package/dist/components/breadcrumb/index.d.ts +4 -1
  8. package/dist/components/cards/index.d.ts +1 -1
  9. package/dist/components/cards/section-card.js +2 -2
  10. package/dist/components/carousel/carousel.js +8 -4
  11. package/dist/components/carousel/index.d.ts +8 -0
  12. package/dist/components/combobox/index.d.ts +3 -1
  13. package/dist/components/coverflow/coverflow.js +3 -2
  14. package/dist/components/coverflow/index.d.ts +2 -0
  15. package/dist/components/data-table/data-table.js +8 -4
  16. package/dist/components/data-table/index.d.ts +5 -1
  17. package/dist/components/date-range-picker/date-range-picker.js +5 -5
  18. package/dist/components/date-range-picker/index.d.ts +9 -1
  19. package/dist/components/dialog/index.d.ts +3 -1
  20. package/dist/components/facet-filters/active-filters.js +2 -1
  21. package/dist/components/facet-filters/filter-group.js +2 -1
  22. package/dist/components/facet-filters/index.d.ts +4 -0
  23. package/dist/components/file-upload/file-upload.js +2 -2
  24. package/dist/components/file-upload/index.d.ts +2 -0
  25. package/dist/components/index.d.ts +5 -5
  26. package/dist/components/key-value-manager/index.d.ts +8 -0
  27. package/dist/components/key-value-manager/key-value-manager-table.js +4 -4
  28. package/dist/components/key-value-manager/key-value-manager.js +5 -1
  29. package/dist/components/key-value-manager/key-value-manager.props.js +5 -1
  30. package/dist/components/list-details/index.d.ts +1 -1
  31. package/dist/components/nav-bar/index.d.ts +19 -2
  32. package/dist/components/nav-bar/nav-bar-mobile-menu.js +4 -3
  33. package/dist/components/nav-bar/nav-bar.js +10 -7
  34. package/dist/components/sheet/index.d.ts +3 -1
  35. package/dist/components/sidebar/index.d.ts +13 -6
  36. package/dist/components/sidebar/sidebar.js +4 -2
  37. package/dist/components/simple-paginated-list/index.d.ts +11 -2
  38. package/dist/components/simple-paginated-list/simple-paginated-list.js +3 -3
  39. package/dist/components/stat-card/index.d.ts +2 -0
  40. package/dist/components/stat-card/stat-card.js +2 -2
  41. package/dist/components/tag/index.d.ts +2 -0
  42. package/dist/components/tag/tag.js +2 -2
  43. package/dist/components/tag-input/index.d.ts +5 -0
  44. package/dist/components/tag-input/tag-input.js +5 -3
  45. package/dist/components/transfer-list/index.d.ts +22 -2
  46. package/dist/components/transfer-list/transfer-list.js +30 -8
  47. package/dist/components/user-type-badge/index.d.ts +2 -0
  48. package/dist/components/user-type-badge/user-type-badge.js +3 -2
  49. package/dist/core/animate-ui/components/radix/dialog.js +2 -2
  50. package/dist/core/animate-ui/components/radix/sheet.js +3 -3
  51. package/dist/core/animate-ui/components/radix/sidebar.js +4 -4
  52. package/dist/core/breadcrumb.js +2 -2
  53. package/dist/core/combobox/combobox.js +2 -2
  54. package/dist/index.d.ts +7 -7
  55. package/dist/layouts/index.d.ts +81 -35
  56. package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +8 -2
  57. package/dist/layouts/shared/account-menu-props.js +3 -2
  58. package/dist/layouts/workspace-layout/account-menu/account-menu.js +19 -8
  59. package/dist/layouts/workspace-layout/breadcrumbs/workspace-breadcrumbs.js +14 -11
  60. package/dist/layouts/workspace-layout/header/header.js +3 -3
  61. package/dist/layouts/workspace-layout/workspace-layout.js +13 -5
  62. package/dist/{my-account-menu.props-C7DK71WC.d.ts → my-account-menu.props-V3kFdvCZ.d.ts} +2 -0
  63. package/dist/{section-card-DqQeQkzU.d.ts → section-card-Bs3sKQtv.d.ts} +6 -1
  64. package/dist/{types-CkXflqg7.d.ts → types-CoZOfz4S.d.ts} +12 -1
  65. package/package.json +1 -1
@@ -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": `Delete ${item.key}`,
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": "Previous page",
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": "Next page",
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-DqQeQkzU.js';
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": "More navigation items",
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 { e as SidebarProps$1 } from '../../types-CkXflqg7.js';
3
- export { S as SidebarEndActionConfig, a as SidebarGroupConfig, b as SidebarItemConfig, c as SidebarLinkComponentProps, d as SidebarNavEntry, f as SidebarTopLevelLinkConfig, i as isSidebarGroup } from '../../types-CkXflqg7.js';
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
- declare function SidebarTrigger({ className, onClick, ...props }: SidebarTriggerProps): React.JSX.Element;
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": "More information",
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>>;
@@ -133,7 +133,7 @@ var deleteButtonVariantClasses = {
133
133
  gradient: "bg-error/10 text-error hover:bg-error/15 hover:text-error",
134
134
  solid: "bg-error/20 text-error-foreground hover:bg-error/30 hover:text-error-foreground"
135
135
  };
136
- var Tag$1 = React$1.forwardRef(({ name, value, nameTooltip, valueTooltip, showFullName = false, showFullValue = false, size = "default", color = "secondary", variant = "soft", rounded = false, onDelete, className, radius, ...rest }, ref) => {
136
+ var Tag$1 = React$1.forwardRef(({ name, value, nameTooltip, valueTooltip, showFullName = false, showFullValue = false, size = "default", color = "secondary", variant = "soft", rounded = false, onDelete, deleteLabel, className, radius, ...rest }, ref) => {
137
137
  const { partStyle } = useStyleAxes({ radius }, ["radius"]);
138
138
  const fullRound = rounded && radius === void 0;
139
139
  const nameTip = nameTooltip ?? name;
@@ -174,7 +174,7 @@ var Tag$1 = React$1.forwardRef(({ name, value, nameTooltip, valueTooltip, showFu
174
174
  }),
175
175
  onDelete ? /* @__PURE__ */ jsx("button", {
176
176
  type: "button",
177
- "aria-label": `Remove ${removeLabel}`,
177
+ "aria-label": deleteLabel ?? `Remove ${removeLabel}`,
178
178
  style: partStyle,
179
179
  className: cn(buttonVariants({
180
180
  variant: "ghost",
@@ -24,6 +24,11 @@ interface TagInputProps extends Omit<ComponentProps<"input">, "size" | "value" |
24
24
  allowDuplicates?: boolean;
25
25
  /** @default 10 */
26
26
  maxTagDisplayLength?: number;
27
+ /**
28
+ * Accessible name of a tag's remove button, given the tag's full text.
29
+ * Default `` tag => `Remove ${tag}` `` (a `name:value` tag reads `Remove name: value`).
30
+ */
31
+ removeTagLabel?: (tag: string) => string;
27
32
  /**
28
33
  * When true, each tag string is split on the first `:` into `Tag` `name` and `value`.
29
34
  * Use together with a validator that only allows `name:value` shaped tags.
@@ -28,7 +28,7 @@ function parseNameValueTag(tag) {
28
28
  value: tag.slice(i + 1)
29
29
  };
30
30
  }
31
- var TagInput = React$1.forwardRef(({ tags, onTagsChange, label, required, size, rounded, startHelperContent, endHelperContent, hintContent, error, errorContent, validatorRegex, onInvalidTag, allowDuplicates = false, maxTagDisplayLength = 10, nameValueTags = false, className, id, disabled, readOnly, placeholder, onKeyDown, onBlur, radius, border, ...restInputProps }, ref) => {
31
+ var TagInput = React$1.forwardRef(({ tags, onTagsChange, label, required, size, rounded, startHelperContent, endHelperContent, hintContent, error, errorContent, validatorRegex, onInvalidTag, allowDuplicates = false, maxTagDisplayLength = 10, removeTagLabel, nameValueTags = false, className, id, disabled, readOnly, placeholder, onKeyDown, onBlur, radius, border, ...restInputProps }, ref) => {
32
32
  const axes = useStyleAxes({
33
33
  radius,
34
34
  border
@@ -119,13 +119,15 @@ var TagInput = React$1.forwardRef(({ tags, onTagsChange, label, required, size,
119
119
  value: truncateDisplay(parsed.value, maxTagDisplayLength),
120
120
  valueTooltip: parsed.value,
121
121
  size: effectiveSize,
122
- onDelete: disabled || readOnly ? void 0 : () => removeAt(index)
122
+ onDelete: disabled || readOnly ? void 0 : () => removeAt(index),
123
+ deleteLabel: removeTagLabel?.(tag)
123
124
  }, `${tag}-${index}`);
124
125
  return /* @__PURE__ */ jsx(Tag, {
125
126
  value: truncateDisplay(tag, maxTagDisplayLength),
126
127
  valueTooltip: tag,
127
128
  size: effectiveSize,
128
- onDelete: disabled || readOnly ? void 0 : () => removeAt(index)
129
+ onDelete: disabled || readOnly ? void 0 : () => removeAt(index),
130
+ deleteLabel: removeTagLabel?.(tag)
129
131
  }, `${tag}-${index}`);
130
132
  }), /* @__PURE__ */ jsx("input", {
131
133
  ref,
@@ -6,6 +6,24 @@ interface TransferItem {
6
6
  label: string;
7
7
  disabled?: boolean;
8
8
  }
9
+ /**
10
+ * The transfer list's own words, for an app in another language. English by
11
+ * default. The functions receive the panel's title (`sourceTitle` / `targetTitle`).
12
+ */
13
+ interface TransferListLabels {
14
+ /** A panel's checkbox that selects every item. Default `` title => `Select all in ${title}` ``. */
15
+ selectAll?: (title: string) => string;
16
+ /** A panel's search button. Default `` title => `Search ${title}` ``. */
17
+ search?: (title: string) => string;
18
+ /** Placeholder of a panel's search box. Default `` title => `Search ${title.toLowerCase()}...` ``. */
19
+ searchPlaceholder?: (title: string) => string;
20
+ /** The button that closes a panel's search. Default "Cancel search". */
21
+ cancelSearch?: string;
22
+ /** The search box's clear button. Default "Clear search". */
23
+ clearSearch?: string;
24
+ /** The move buttons between the panels. Default `` title => `Move selected to ${title}` ``. */
25
+ moveTo?: (title: string) => string;
26
+ }
9
27
  interface TransferListProps<T> {
10
28
  sourceItems: T[];
11
29
  targetItems: T[];
@@ -29,8 +47,10 @@ interface TransferListProps<T> {
29
47
  isItemDisabled?: (item: T) => boolean;
30
48
  /** Defaults to "Transfer list" */
31
49
  ariaLabel?: string;
50
+ /** The list's other words (search, select all, move), for an app in another language. */
51
+ labels?: TransferListLabels;
32
52
  }
33
53
 
34
- declare function TransferList<T>({ sourceItems, targetItems, getItemId, getItemLabel, onChange, renderItem, searchable, disabled, sourceTitle, targetTitle, className, name, form, isItemDisabled, ariaLabel, maxHeight, }: TransferListProps<T>): React.JSX.Element;
54
+ declare function TransferList<T>({ sourceItems, targetItems, getItemId, getItemLabel, onChange, renderItem, searchable, disabled, sourceTitle, targetTitle, className, name, form, isItemDisabled, ariaLabel, maxHeight, labels: labelsProp, }: TransferListProps<T>): React.JSX.Element;
35
55
 
36
- export { type TransferItem, TransferList, type TransferListProps };
56
+ export { type TransferItem, TransferList, type TransferListLabels, type TransferListProps };
@@ -87,6 +87,24 @@ function filterItemsByQuery(items, query, getLabel) {
87
87
  if (q === "") return items;
88
88
  return items.filter((item) => getLabel(item).toLowerCase().includes(q));
89
89
  }
90
+ var DEFAULT_LABELS = {
91
+ selectAll: (title) => `Select all in ${title}`,
92
+ search: (title) => `Search ${title}`,
93
+ searchPlaceholder: (title) => `Search ${title.toLowerCase()}...`,
94
+ cancelSearch: "Cancel search",
95
+ clearSearch: "Clear search",
96
+ moveTo: (title) => `Move selected to ${title}`
97
+ };
98
+ function resolveLabels(labels) {
99
+ return {
100
+ selectAll: labels?.selectAll ?? DEFAULT_LABELS.selectAll,
101
+ search: labels?.search ?? DEFAULT_LABELS.search,
102
+ searchPlaceholder: labels?.searchPlaceholder ?? DEFAULT_LABELS.searchPlaceholder,
103
+ cancelSearch: labels?.cancelSearch ?? DEFAULT_LABELS.cancelSearch,
104
+ clearSearch: labels?.clearSearch ?? DEFAULT_LABELS.clearSearch,
105
+ moveTo: labels?.moveTo ?? DEFAULT_LABELS.moveTo
106
+ };
107
+ }
90
108
  function TransferListItems({ filteredItems, items, selectedIds, getItemId, getItemLabel, isItemDisabled, renderItem, disabled, rowVariants, onChecked }) {
91
109
  if (filteredItems.length === 0) return /* @__PURE__ */ jsx("p", {
92
110
  className: "px-1 py-2 type-body text-muted-foreground",
@@ -120,7 +138,7 @@ function TransferListItems({ filteredItems, items, selectedIds, getItemId, getIt
120
138
  })
121
139
  });
122
140
  }
123
- function TransferListPanel({ title, titleId, items, selectedIds, onSelectionChange, getItemId, getItemLabel, isItemDisabled, renderItem, searchable, disabled, side, maxHeight }) {
141
+ function TransferListPanel({ labels, title, titleId, items, selectedIds, onSelectionChange, getItemId, getItemLabel, isItemDisabled, renderItem, searchable, disabled, side, maxHeight }) {
124
142
  const [searchQuery, setSearchQuery] = useState("");
125
143
  const [isSearchOpen, setIsSearchOpen] = useState(false);
126
144
  const searchContainerRef = useRef(null);
@@ -187,7 +205,7 @@ function TransferListPanel({ title, titleId, items, selectedIds, onSelectionChan
187
205
  checked: selectAllChecked,
188
206
  disabled: disabled || selectableFilteredIds.length === 0,
189
207
  onCheckedChange: handleSelectAll,
190
- "aria-label": `Select all in ${title}`
208
+ "aria-label": labels.selectAll(title)
191
209
  }), /* @__PURE__ */ jsx("div", {
192
210
  className: "relative min-w-0 flex-1",
193
211
  children: /* @__PURE__ */ jsx(AnimatePresence, {
@@ -213,7 +231,8 @@ function TransferListPanel({ title, titleId, items, selectedIds, onSelectionChan
213
231
  children: /* @__PURE__ */ jsx(SearchBox, {
214
232
  size: "sm",
215
233
  className: "w-full",
216
- placeholder: `Search ${title.toLowerCase()}...`,
234
+ placeholder: labels.searchPlaceholder(title),
235
+ clearLabel: labels.clearSearch,
217
236
  onSearch: setSearchQuery,
218
237
  onClear: () => setSearchQuery(""),
219
238
  onValueChange: setSearchQuery
@@ -245,7 +264,7 @@ function TransferListPanel({ title, titleId, items, selectedIds, onSelectionChan
245
264
  size: "icon",
246
265
  color: "mist",
247
266
  disabled,
248
- "aria-label": `Search ${title}`,
267
+ "aria-label": labels.search(title),
249
268
  onClick: handleOpenSearch,
250
269
  children: /* @__PURE__ */ jsx(Search, { "aria-hidden": true })
251
270
  })
@@ -268,7 +287,7 @@ function TransferListPanel({ title, titleId, items, selectedIds, onSelectionChan
268
287
  variant: "ghost",
269
288
  size: "icon",
270
289
  color: "error",
271
- "aria-label": "Cancel search",
290
+ "aria-label": labels.cancelSearch,
272
291
  onClick: handleCloseSearch,
273
292
  children: /* @__PURE__ */ jsx(X, { "aria-hidden": true })
274
293
  })
@@ -288,7 +307,8 @@ function TransferListPanel({ title, titleId, items, selectedIds, onSelectionChan
288
307
  })
289
308
  });
290
309
  }
291
- function TransferList({ sourceItems, targetItems, getItemId, getItemLabel, onChange, renderItem, searchable = true, disabled = false, sourceTitle, targetTitle, className, name, form, isItemDisabled, ariaLabel = "Transfer list", maxHeight }) {
310
+ function TransferList({ sourceItems, targetItems, getItemId, getItemLabel, onChange, renderItem, searchable = true, disabled = false, sourceTitle, targetTitle, className, name, form, isItemDisabled, ariaLabel = "Transfer list", maxHeight, labels: labelsProp }) {
311
+ const labels = resolveLabels(labelsProp);
292
312
  const resolveId = getItemId ?? ((item) => item.id);
293
313
  const resolveLabel = getItemLabel ?? ((item) => item.label);
294
314
  const resolveDisabled = isItemDisabled ?? ((item) => Boolean(item.disabled));
@@ -344,6 +364,7 @@ function TransferList({ sourceItems, targetItems, getItemId, getItemLabel, onCha
344
364
  value: hiddenFieldValues
345
365
  }),
346
366
  /* @__PURE__ */ jsx(TransferListPanel, {
367
+ labels,
347
368
  title: sourceTitle,
348
369
  titleId: sourceTitleId,
349
370
  items: sourceItems,
@@ -365,7 +386,7 @@ function TransferList({ sourceItems, targetItems, getItemId, getItemLabel, onCha
365
386
  variant: "default",
366
387
  size: "icon",
367
388
  disabled: !canMoveToTarget,
368
- "aria-label": `Move selected to ${targetTitle}`,
389
+ "aria-label": labels.moveTo(targetTitle),
369
390
  onClick: handleMoveToTarget,
370
391
  children: /* @__PURE__ */ jsx(ChevronsRight, {
371
392
  className: "max-md:rotate-90",
@@ -377,7 +398,7 @@ function TransferList({ sourceItems, targetItems, getItemId, getItemLabel, onCha
377
398
  size: "icon",
378
399
  color: "error",
379
400
  disabled: !canMoveToSource,
380
- "aria-label": `Move selected to ${sourceTitle}`,
401
+ "aria-label": labels.moveTo(sourceTitle),
381
402
  onClick: handleMoveToSource,
382
403
  children: /* @__PURE__ */ jsx(ChevronsLeft, {
383
404
  className: "max-md:rotate-90",
@@ -386,6 +407,7 @@ function TransferList({ sourceItems, targetItems, getItemId, getItemLabel, onCha
386
407
  })]
387
408
  }),
388
409
  /* @__PURE__ */ jsx(TransferListPanel, {
410
+ labels,
389
411
  title: targetTitle,
390
412
  titleId: targetTitleId,
391
413
  items: targetItems,
@@ -29,6 +29,8 @@ declare const userTypeBadgeUserTypes: UserType[];
29
29
  interface UserTypeBadgeProps extends HTMLAttributes<HTMLDivElement>, Pick<StyleAxisProps, "radius"> {
30
30
  userType: UserType;
31
31
  size?: Size;
32
+ /** The badge's text, for an app in another language. Default "Admin" / "Super admin". */
33
+ label?: string;
32
34
  }
33
35
 
34
36
  declare const userTypeBadgeSizeVariants: (props?: ({