@mediaradar/design-components 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1884,6 +1884,12 @@ 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
|
|
@@ -1897,15 +1903,18 @@ interface PagerProps {
|
|
|
1897
1903
|
* first/last steps, the range readout and the rows-per-page select.
|
|
1898
1904
|
* @tokens rounded-control, text-text-secondary, bg-brand-primaryAction, text-brand-onprimary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
|
|
1899
1905
|
* @dependencies lucide-react
|
|
1900
|
-
* @a11y
|
|
1901
|
-
*
|
|
1902
|
-
*
|
|
1906
|
+
* @a11y Renders its own <nav aria-label="Pagination"> landmark, like
|
|
1907
|
+
* TablePagination, so don't wrap it in another <nav>. Pass `label` to name it
|
|
1908
|
+
* when a page has more than one pager. Page controls are buttons with their
|
|
1909
|
+
* own aria-labels, and the current page is marked with aria-current. Don't
|
|
1910
|
+
* relabel them with visible text alone -- the labels are what a screen reader
|
|
1911
|
+
* announces.
|
|
1903
1912
|
* @usage
|
|
1904
1913
|
* ```tsx
|
|
1905
1914
|
* <Pager page={page} totalPages={totalPages} onPage={setPage} />
|
|
1906
1915
|
* ```
|
|
1907
1916
|
*/
|
|
1908
|
-
declare function Pager({ page, totalPages, onPage, disabled }: PagerProps): react.JSX.Element;
|
|
1917
|
+
declare function Pager({ page, totalPages, onPage, disabled, label }: PagerProps): react.JSX.Element;
|
|
1909
1918
|
|
|
1910
1919
|
declare const SIZES$1: {
|
|
1911
1920
|
/** Matches a 15px lucide icon exactly, so a workspace name in a menu row
|
package/dist/index.d.ts
CHANGED
|
@@ -1884,6 +1884,12 @@ 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
|
|
@@ -1897,15 +1903,18 @@ interface PagerProps {
|
|
|
1897
1903
|
* first/last steps, the range readout and the rows-per-page select.
|
|
1898
1904
|
* @tokens rounded-control, text-text-secondary, bg-brand-primaryAction, text-brand-onprimary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
|
|
1899
1905
|
* @dependencies lucide-react
|
|
1900
|
-
* @a11y
|
|
1901
|
-
*
|
|
1902
|
-
*
|
|
1906
|
+
* @a11y Renders its own <nav aria-label="Pagination"> landmark, like
|
|
1907
|
+
* TablePagination, so don't wrap it in another <nav>. Pass `label` to name it
|
|
1908
|
+
* when a page has more than one pager. Page controls are buttons with their
|
|
1909
|
+
* own aria-labels, and the current page is marked with aria-current. Don't
|
|
1910
|
+
* relabel them with visible text alone -- the labels are what a screen reader
|
|
1911
|
+
* announces.
|
|
1903
1912
|
* @usage
|
|
1904
1913
|
* ```tsx
|
|
1905
1914
|
* <Pager page={page} totalPages={totalPages} onPage={setPage} />
|
|
1906
1915
|
* ```
|
|
1907
1916
|
*/
|
|
1908
|
-
declare function Pager({ page, totalPages, onPage, disabled }: PagerProps): react.JSX.Element;
|
|
1917
|
+
declare function Pager({ page, totalPages, onPage, disabled, label }: PagerProps): react.JSX.Element;
|
|
1909
1918
|
|
|
1910
1919
|
declare const SIZES$1: {
|
|
1911
1920
|
/** Matches a 15px lucide icon exactly, so a workspace name in a menu row
|
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("
|
|
3222
|
+
return /* @__PURE__ */ jsxs30("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
|
|
3223
3223
|
/* @__PURE__ */ jsx32(
|
|
3224
3224
|
"button",
|
|
3225
3225
|
{
|