@mediaradar/design-components 0.25.0 → 0.26.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/dist/index.d.cts CHANGED
@@ -1884,12 +1884,19 @@ interface PagerProps {
1884
1884
  onPage: (p: number) => void;
1885
1885
  /** Disables every control, e.g. while the list loads the next page. */
1886
1886
  disabled?: boolean;
1887
+ /**
1888
+ * The navigation landmark's name. Give each pager its own when a page has
1889
+ * more than one ("Exports pages", "Accounts pages"), so a screen reader's
1890
+ * landmark list can tell them apart.
1891
+ */
1892
+ label?: string;
1887
1893
  }
1888
1894
  /**
1889
1895
  * @pattern Pager
1890
1896
  * @description Compact prev/next pager with a windowed page-number list —
1891
1897
  * shows every page up to 7 total, otherwise 1 … current±1 … last with
1892
- * ellipsis gaps. Shared by My Exports and Account Matcher. `disabled`
1898
+ * ellipsis gaps, each number formatted for the locale ("14,433"). Shared by
1899
+ * My Exports and Account Matcher. `disabled`
1893
1900
  * disables every control while the list loads.
1894
1901
  * @use in a card or a compact list, with the range ("Showing 1–10 of 48") on
1895
1902
  * the left if the reader needs it.
@@ -1897,15 +1904,18 @@ interface PagerProps {
1897
1904
  * first/last steps, the range readout and the rows-per-page select.
1898
1905
  * @tokens rounded-control, text-text-secondary, bg-brand-primaryAction, text-brand-onprimary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
1899
1906
  * @dependencies lucide-react
1900
- * @a11y Page controls are buttons with their own aria-labels, and the current
1901
- * page is marked with aria-current. Don't relabel them with visible text
1902
- * alone -- the labels are what a screen reader announces.
1907
+ * @a11y Renders its own <nav aria-label="Pagination"> landmark, like
1908
+ * TablePagination, so don't wrap it in another <nav>. Pass `label` to name it
1909
+ * when a page has more than one pager. Page controls are buttons with their
1910
+ * own aria-labels, and the current page is marked with aria-current. Don't
1911
+ * relabel them with visible text alone -- the labels are what a screen reader
1912
+ * announces.
1903
1913
  * @usage
1904
1914
  * ```tsx
1905
1915
  * <Pager page={page} totalPages={totalPages} onPage={setPage} />
1906
1916
  * ```
1907
1917
  */
1908
- declare function Pager({ page, totalPages, onPage, disabled }: PagerProps): react.JSX.Element;
1918
+ declare function Pager({ page, totalPages, onPage, disabled, label }: PagerProps): react.JSX.Element;
1909
1919
 
1910
1920
  declare const SIZES$1: {
1911
1921
  /** Matches a 15px lucide icon exactly, so a workspace name in a menu row
@@ -2077,7 +2087,8 @@ declare function Tag({ children, className }: TagProps): react.JSX.Element;
2077
2087
  * page — disabled controls stay in the layout so the row never reflows.
2078
2088
  * Changing the per-page count reports it and leaves the host to reset to page
2079
2089
  * 1. With one page of results the pager still renders, so the bar's height
2080
- * and the range readout don't come and go as filters narrow. `disabled`
2090
+ * and the range readout don't come and go as filters narrow. Page numbers
2091
+ * are formatted for the locale ("14,433"), like the range readout. `disabled`
2081
2092
  * disables every control (select and page buttons) while the table loads,
2082
2093
  * so a click can't request a second page on top of the first; the range
2083
2094
  * readout stays.
package/dist/index.d.ts CHANGED
@@ -1884,12 +1884,19 @@ interface PagerProps {
1884
1884
  onPage: (p: number) => void;
1885
1885
  /** Disables every control, e.g. while the list loads the next page. */
1886
1886
  disabled?: boolean;
1887
+ /**
1888
+ * The navigation landmark's name. Give each pager its own when a page has
1889
+ * more than one ("Exports pages", "Accounts pages"), so a screen reader's
1890
+ * landmark list can tell them apart.
1891
+ */
1892
+ label?: string;
1887
1893
  }
1888
1894
  /**
1889
1895
  * @pattern Pager
1890
1896
  * @description Compact prev/next pager with a windowed page-number list —
1891
1897
  * shows every page up to 7 total, otherwise 1 … current±1 … last with
1892
- * ellipsis gaps. Shared by My Exports and Account Matcher. `disabled`
1898
+ * ellipsis gaps, each number formatted for the locale ("14,433"). Shared by
1899
+ * My Exports and Account Matcher. `disabled`
1893
1900
  * disables every control while the list loads.
1894
1901
  * @use in a card or a compact list, with the range ("Showing 1–10 of 48") on
1895
1902
  * the left if the reader needs it.
@@ -1897,15 +1904,18 @@ interface PagerProps {
1897
1904
  * first/last steps, the range readout and the rows-per-page select.
1898
1905
  * @tokens rounded-control, text-text-secondary, bg-brand-primaryAction, text-brand-onprimary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
1899
1906
  * @dependencies lucide-react
1900
- * @a11y Page controls are buttons with their own aria-labels, and the current
1901
- * page is marked with aria-current. Don't relabel them with visible text
1902
- * alone -- the labels are what a screen reader announces.
1907
+ * @a11y Renders its own <nav aria-label="Pagination"> landmark, like
1908
+ * TablePagination, so don't wrap it in another <nav>. Pass `label` to name it
1909
+ * when a page has more than one pager. Page controls are buttons with their
1910
+ * own aria-labels, and the current page is marked with aria-current. Don't
1911
+ * relabel them with visible text alone -- the labels are what a screen reader
1912
+ * announces.
1903
1913
  * @usage
1904
1914
  * ```tsx
1905
1915
  * <Pager page={page} totalPages={totalPages} onPage={setPage} />
1906
1916
  * ```
1907
1917
  */
1908
- declare function Pager({ page, totalPages, onPage, disabled }: PagerProps): react.JSX.Element;
1918
+ declare function Pager({ page, totalPages, onPage, disabled, label }: PagerProps): react.JSX.Element;
1909
1919
 
1910
1920
  declare const SIZES$1: {
1911
1921
  /** Matches a 15px lucide icon exactly, so a workspace name in a menu row
@@ -2077,7 +2087,8 @@ declare function Tag({ children, className }: TagProps): react.JSX.Element;
2077
2087
  * page — disabled controls stay in the layout so the row never reflows.
2078
2088
  * Changing the per-page count reports it and leaves the host to reset to page
2079
2089
  * 1. With one page of results the pager still renders, so the bar's height
2080
- * and the range readout don't come and go as filters narrow. `disabled`
2090
+ * and the range readout don't come and go as filters narrow. Page numbers
2091
+ * are formatted for the locale ("14,433"), like the range readout. `disabled`
2081
2092
  * disables every control (select and page buttons) while the table loads,
2082
2093
  * so a click can't request a second page on top of the first; the range
2083
2094
  * readout stays.
package/dist/index.js CHANGED
@@ -3217,9 +3217,9 @@ function pageWindow(current, total) {
3217
3217
  }
3218
3218
  return out;
3219
3219
  }
3220
- function Pager({ page, totalPages, onPage, disabled = false }) {
3220
+ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination" }) {
3221
3221
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors disabled:pointer-events-none disabled:opacity-30";
3222
- return /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1", children: [
3222
+ return /* @__PURE__ */ jsxs30("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
3223
3223
  /* @__PURE__ */ jsx32(
3224
3224
  "button",
3225
3225
  {
@@ -3243,7 +3243,7 @@ function Pager({ page, totalPages, onPage, disabled = false }) {
3243
3243
  btn,
3244
3244
  p === page ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3245
3245
  ),
3246
- children: p
3246
+ children: p.toLocaleString()
3247
3247
  },
3248
3248
  p
3249
3249
  )
@@ -3487,7 +3487,7 @@ function TablePagination({
3487
3487
  off,
3488
3488
  p === current ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3489
3489
  ),
3490
- children: p
3490
+ children: p.toLocaleString()
3491
3491
  },
3492
3492
  p
3493
3493
  )