@tedi-design-system/react 18.0.0-rc.3 → 18.0.0-rc.5

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 (96) hide show
  1. package/bundle-stats.html +1 -1
  2. package/external/@floating-ui/core/dist/floating-ui.core.cjs.js +1 -1
  3. package/external/@floating-ui/core/dist/floating-ui.core.es.js +275 -271
  4. package/external/@floating-ui/dom/dist/floating-ui.dom.cjs.js +1 -1
  5. package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +189 -188
  6. package/external/@floating-ui/react/dist/floating-ui.react.cjs.js +1 -1
  7. package/external/@floating-ui/react/dist/floating-ui.react.es.js +1419 -1538
  8. package/external/@floating-ui/react/dist/floating-ui.react.utils.cjs.js +1 -1
  9. package/external/@floating-ui/react/dist/floating-ui.react.utils.es.js +348 -81
  10. package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js +1 -1
  11. package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +113 -93
  12. package/external/@floating-ui/utils/dist/floating-ui.utils.cjs.js +1 -1
  13. package/external/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js +1 -1
  14. package/external/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +97 -97
  15. package/external/@floating-ui/utils/dist/floating-ui.utils.es.js +66 -68
  16. package/external/lodash-es/_baseUnset.cjs.js +1 -1
  17. package/external/lodash-es/_baseUnset.es.js +12 -19
  18. package/external/tabbable/dist/index.esm.cjs.js +1 -1
  19. package/external/tabbable/dist/index.esm.es.js +72 -63
  20. package/index.css +1 -1
  21. package/package.json +4 -4
  22. package/src/community/components/modal/modal-closer.d.ts +6 -0
  23. package/src/community/components/modal/modal-provider.d.ts +6 -0
  24. package/src/community/components/modal/modal-trigger.d.ts +6 -0
  25. package/src/community/components/modal/modal.d.ts +6 -0
  26. package/src/tedi/components/buttons/button-group/button-group.cjs.js +1 -1
  27. package/src/tedi/components/buttons/button-group/button-group.es.js +4 -4
  28. package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
  29. package/src/tedi/components/buttons/collapse/collapse.d.ts +15 -0
  30. package/src/tedi/components/buttons/collapse/collapse.es.js +55 -54
  31. package/src/tedi/components/content/table/index.d.ts +6 -0
  32. package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.cjs.js +1 -0
  33. package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.d.ts +15 -0
  34. package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.es.js +37 -0
  35. package/src/tedi/components/content/table/table-context.cjs.js +1 -0
  36. package/src/tedi/components/content/table/table-context.d.ts +3 -0
  37. package/src/tedi/components/content/table/table-context.es.js +11 -0
  38. package/src/tedi/components/content/table/table-header-button/table-header-button.cjs.js +1 -0
  39. package/src/tedi/components/content/table/table-header-button/table-header-button.d.ts +51 -0
  40. package/src/tedi/components/content/table/table-header-button/table-header-button.es.js +42 -0
  41. package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.cjs.js +1 -0
  42. package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.es.js +7 -0
  43. package/src/tedi/components/content/table/table-toolbar/table-toolbar.cjs.js +1 -0
  44. package/src/tedi/components/content/table/table-toolbar/table-toolbar.d.ts +21 -0
  45. package/src/tedi/components/content/table/table-toolbar/table-toolbar.es.js +9 -0
  46. package/src/tedi/components/content/table/table.cjs.js +1 -0
  47. package/src/tedi/components/content/table/table.d.ts +519 -0
  48. package/src/tedi/components/content/table/table.es.js +856 -0
  49. package/src/tedi/components/content/table/table.module.scss.cjs.js +1 -0
  50. package/src/tedi/components/content/table/table.module.scss.es.js +54 -0
  51. package/src/tedi/components/content/table/use-table-persistence.cjs.js +1 -0
  52. package/src/tedi/components/content/table/use-table-persistence.d.ts +13 -0
  53. package/src/tedi/components/content/table/use-table-persistence.es.js +53 -0
  54. package/src/tedi/components/form/time-field/time-field.es.js +3 -3
  55. package/src/tedi/components/navigation/pagination/pagination.cjs.js +1 -1
  56. package/src/tedi/components/navigation/pagination/pagination.d.ts +7 -0
  57. package/src/tedi/components/navigation/pagination/pagination.es.js +132 -91
  58. package/src/tedi/components/navigation/pagination/pagination.module.scss.cjs.js +1 -1
  59. package/src/tedi/components/navigation/pagination/pagination.module.scss.es.js +7 -1
  60. package/src/tedi/components/navigation/pagination/pagination.types.d.ts +100 -0
  61. package/src/tedi/components/overlays/modal/index.d.ts +8 -0
  62. package/src/tedi/components/overlays/modal/modal-body/modal-body.cjs.js +1 -0
  63. package/src/tedi/components/overlays/modal/modal-body/modal-body.d.ts +22 -0
  64. package/src/tedi/components/overlays/modal/modal-body/modal-body.es.js +21 -0
  65. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.cjs.js +1 -0
  66. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.d.ts +15 -0
  67. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.es.js +16 -0
  68. package/src/tedi/components/overlays/modal/modal-content/modal-content.cjs.js +1 -0
  69. package/src/tedi/components/overlays/modal/modal-content/modal-content.d.ts +108 -0
  70. package/src/tedi/components/overlays/modal/modal-content/modal-content.es.js +81 -0
  71. package/src/tedi/components/overlays/modal/modal-context.cjs.js +1 -0
  72. package/src/tedi/components/overlays/modal/modal-context.d.ts +59 -0
  73. package/src/tedi/components/overlays/modal/modal-context.es.js +15 -0
  74. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.cjs.js +1 -0
  75. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.d.ts +22 -0
  76. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.es.js +25 -0
  77. package/src/tedi/components/overlays/modal/modal-header/modal-header.cjs.js +1 -0
  78. package/src/tedi/components/overlays/modal/modal-header/modal-header.d.ts +58 -0
  79. package/src/tedi/components/overlays/modal/modal-header/modal-header.es.js +25 -0
  80. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.cjs.js +1 -0
  81. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.d.ts +13 -0
  82. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.es.js +14 -0
  83. package/src/tedi/components/overlays/modal/modal.cjs.js +1 -0
  84. package/src/tedi/components/overlays/modal/modal.d.ts +68 -0
  85. package/src/tedi/components/overlays/modal/modal.es.js +76 -0
  86. package/src/tedi/components/overlays/modal/modal.module.scss.cjs.js +1 -0
  87. package/src/tedi/components/overlays/modal/modal.module.scss.es.js +36 -0
  88. package/src/tedi/components/overlays/tooltip/tooltip.cjs.js +1 -1
  89. package/src/tedi/components/overlays/tooltip/tooltip.es.js +14 -6
  90. package/src/tedi/helpers/hooks/use-sidenav-state.d.ts +1 -1
  91. package/src/tedi/index.d.ts +2 -0
  92. package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
  93. package/src/tedi/providers/label-provider/labels-map.d.ts +132 -6
  94. package/src/tedi/providers/label-provider/labels-map.es.js +146 -11
  95. package/tedi.cjs.js +1 -1
  96. package/tedi.es.js +203 -171
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-table":"tedi-table-f4707778","tedi-table__toolbar":"tedi-table__toolbar-7ccf8a04","tedi-table__scroll":"tedi-table__scroll-a9c9ce5f","tedi-table__table":"tedi-table__table-0c156cdb","tedi-table__caption":"tedi-table__caption-378edbc2","tedi-table__head":"tedi-table__head-549b3a97","tedi-table__header-cell":"tedi-table__header-cell-31f2955e","tedi-table__row":"tedi-table__row-bcd5867d","tedi-table__cell":"tedi-table__cell-95d3876c","tedi-table__cell--align-left":"tedi-table__cell--align-left-2fbf07e9","tedi-table__cell--align-center":"tedi-table__cell--align-center-7aae1b56","tedi-table__cell--align-right":"tedi-table__cell--align-right-ec62c9b8","tedi-table__cell--valign-top":"tedi-table__cell--valign-top-af74bcaa","tedi-table__cell--valign-middle":"tedi-table__cell--valign-middle-86b5d5c3","tedi-table__cell--valign-bottom":"tedi-table__cell--valign-bottom-17cd68db","tedi-table__cell--placeholder":"tedi-table__cell--placeholder-c015ed76","tedi-table--small":"tedi-table--small-63dad8b3","tedi-table__foot":"tedi-table__foot-81a5fd8a","tedi-table__cell--footer":"tedi-table__cell--footer-6db3119e","tedi-table__row--selected":"tedi-table__row--selected-4e592b36","tedi-table__row--dragging":"tedi-table__row--dragging-a5ef9418","tedi-table__row--drag-over":"tedi-table__row--drag-over-6d93e8b7","tedi-table__row--drag-preview":"tedi-table__row--drag-preview-47e2dd99","tedi-table__header-cell--dragging":"tedi-table__header-cell--dragging-06a46b18","tedi-table__header-cell--drag-over":"tedi-table__header-cell--drag-over-f252af8e","tedi-table__cell--drag-over":"tedi-table__cell--drag-over-cbc1dbfb","tedi-table__header-cell--drag-preview":"tedi-table__header-cell--drag-preview-9bb286ec","tedi-table__row--picked-up":"tedi-table__row--picked-up-d3b1dea5","tedi-table__header-cell--picked-up":"tedi-table__header-cell--picked-up-15995295","tedi-table__drag-handle--picked-up":"tedi-table__drag-handle--picked-up-f844be33","tedi-table__sr-only":"tedi-table__sr-only-63bcee78","tedi-table__header-cell-inner":"tedi-table__header-cell-inner-56364d8d","tedi-table__cell--drag-handle":"tedi-table__cell--drag-handle-d53d19c1","tedi-table__drag-handle":"tedi-table__drag-handle-9672fabe","tedi-table__row--clickable":"tedi-table__row--clickable-05139b72","tedi-table__row--sub-component":"tedi-table__row--sub-component-effed53b","tedi-table__row--sub-row":"tedi-table__row--sub-row-3d164bb0","tedi-table__cell--sub-component":"tedi-table__cell--sub-component-39f49de2","tedi-table__row--filter":"tedi-table__row--filter-549a00f2","tedi-table--striped":"tedi-table--striped-213db29e","tedi-table__body":"tedi-table__body-622a274c","tedi-table--row-hover":"tedi-table--row-hover-399b73a2","tedi-table__row--active":"tedi-table__row--active-3d6fa5fc","tedi-table--vertical-borders":"tedi-table--vertical-borders-7daec7da","tedi-table--borderless":"tedi-table--borderless-32051e6f","tedi-table--has-pagination":"tedi-table--has-pagination-1eb2a663","tedi-table__pagination":"tedi-table__pagination-2bb8beb7","tedi-table--sticky-first-column":"tedi-table--sticky-first-column-0b93c772","tedi-table--sticky-header":"tedi-table--sticky-header-d8ee7437"};exports.default=e;
@@ -0,0 +1,54 @@
1
+ const e = {
2
+ "tedi-table": "tedi-table-f4707778",
3
+ "tedi-table__toolbar": "tedi-table__toolbar-7ccf8a04",
4
+ "tedi-table__scroll": "tedi-table__scroll-a9c9ce5f",
5
+ "tedi-table__table": "tedi-table__table-0c156cdb",
6
+ "tedi-table__caption": "tedi-table__caption-378edbc2",
7
+ "tedi-table__head": "tedi-table__head-549b3a97",
8
+ "tedi-table__header-cell": "tedi-table__header-cell-31f2955e",
9
+ "tedi-table__row": "tedi-table__row-bcd5867d",
10
+ "tedi-table__cell": "tedi-table__cell-95d3876c",
11
+ "tedi-table__cell--align-left": "tedi-table__cell--align-left-2fbf07e9",
12
+ "tedi-table__cell--align-center": "tedi-table__cell--align-center-7aae1b56",
13
+ "tedi-table__cell--align-right": "tedi-table__cell--align-right-ec62c9b8",
14
+ "tedi-table__cell--valign-top": "tedi-table__cell--valign-top-af74bcaa",
15
+ "tedi-table__cell--valign-middle": "tedi-table__cell--valign-middle-86b5d5c3",
16
+ "tedi-table__cell--valign-bottom": "tedi-table__cell--valign-bottom-17cd68db",
17
+ "tedi-table__cell--placeholder": "tedi-table__cell--placeholder-c015ed76",
18
+ "tedi-table--small": "tedi-table--small-63dad8b3",
19
+ "tedi-table__foot": "tedi-table__foot-81a5fd8a",
20
+ "tedi-table__cell--footer": "tedi-table__cell--footer-6db3119e",
21
+ "tedi-table__row--selected": "tedi-table__row--selected-4e592b36",
22
+ "tedi-table__row--dragging": "tedi-table__row--dragging-a5ef9418",
23
+ "tedi-table__row--drag-over": "tedi-table__row--drag-over-6d93e8b7",
24
+ "tedi-table__row--drag-preview": "tedi-table__row--drag-preview-47e2dd99",
25
+ "tedi-table__header-cell--dragging": "tedi-table__header-cell--dragging-06a46b18",
26
+ "tedi-table__header-cell--drag-over": "tedi-table__header-cell--drag-over-f252af8e",
27
+ "tedi-table__cell--drag-over": "tedi-table__cell--drag-over-cbc1dbfb",
28
+ "tedi-table__header-cell--drag-preview": "tedi-table__header-cell--drag-preview-9bb286ec",
29
+ "tedi-table__row--picked-up": "tedi-table__row--picked-up-d3b1dea5",
30
+ "tedi-table__header-cell--picked-up": "tedi-table__header-cell--picked-up-15995295",
31
+ "tedi-table__drag-handle--picked-up": "tedi-table__drag-handle--picked-up-f844be33",
32
+ "tedi-table__sr-only": "tedi-table__sr-only-63bcee78",
33
+ "tedi-table__header-cell-inner": "tedi-table__header-cell-inner-56364d8d",
34
+ "tedi-table__cell--drag-handle": "tedi-table__cell--drag-handle-d53d19c1",
35
+ "tedi-table__drag-handle": "tedi-table__drag-handle-9672fabe",
36
+ "tedi-table__row--clickable": "tedi-table__row--clickable-05139b72",
37
+ "tedi-table__row--sub-component": "tedi-table__row--sub-component-effed53b",
38
+ "tedi-table__row--sub-row": "tedi-table__row--sub-row-3d164bb0",
39
+ "tedi-table__cell--sub-component": "tedi-table__cell--sub-component-39f49de2",
40
+ "tedi-table__row--filter": "tedi-table__row--filter-549a00f2",
41
+ "tedi-table--striped": "tedi-table--striped-213db29e",
42
+ "tedi-table__body": "tedi-table__body-622a274c",
43
+ "tedi-table--row-hover": "tedi-table--row-hover-399b73a2",
44
+ "tedi-table__row--active": "tedi-table__row--active-3d6fa5fc",
45
+ "tedi-table--vertical-borders": "tedi-table--vertical-borders-7daec7da",
46
+ "tedi-table--borderless": "tedi-table--borderless-32051e6f",
47
+ "tedi-table--has-pagination": "tedi-table--has-pagination-1eb2a663",
48
+ "tedi-table__pagination": "tedi-table__pagination-2bb8beb7",
49
+ "tedi-table--sticky-first-column": "tedi-table--sticky-first-column-0b93c772",
50
+ "tedi-table--sticky-header": "tedi-table--sticky-header-d8ee7437"
51
+ };
52
+ export {
53
+ e as default
54
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),E=["columnVisibility","columnOrder"];function b(e){if(!e)return null;if(e.storage)return e.storage;if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function D(e,t){const n=b(e);if(!n||!e)return t;try{const o=n.getItem(e.key);if(!o)return t;const c=JSON.parse(o),u=e.include??E,i={};for(const s of u)c[s]!==void 0&&(i[s]=c[s]);return{...t,...i}}catch{return t}}function J(e){const{persist:t,controlled:n,defaultState:o,onStateChange:c}=e,[u,i]=r.useState(()=>D(t,o??{})),s=r.useMemo(()=>({...u,...n}),[u,n]),S=r.useRef(n);S.current=n;const l=r.useRef(c);l.current=c;const m=r.useRef(t);m.current=t;const N=r.useCallback(a=>{i(d=>{var P;const w=S.current,h={...d,...w},R=typeof a=="function"?a(h):a,k={...d,...R},g={...d,...w,...R},f=m.current,I=b(f);if(I&&f)try{const v=f.include??E,T={};for(const y of v)g[y]!==void 0&&(T[y]=g[y]);I.setItem(f.key,JSON.stringify(T))}catch{}return(P=l.current)==null||P.call(l,g),k})},[]);return[s,N]}exports.useTablePersistence=J;
@@ -0,0 +1,13 @@
1
+ import { TablePersistOptions, TableState } from './table';
2
+ /**
3
+ * Owns the Table's internal state and (optionally) syncs it to a Storage backend.
4
+ * The hook always returns a fully-merged TableState so callers never have to
5
+ * reason about `undefined` slices.
6
+ */
7
+ export type TableStatePatch = Partial<TableState> | ((prev: TableState) => Partial<TableState>);
8
+ export declare function useTablePersistence(options: {
9
+ persist?: TablePersistOptions;
10
+ controlled?: Partial<TableState>;
11
+ defaultState?: Partial<TableState>;
12
+ onStateChange?: (state: TableState) => void;
13
+ }): [TableState, (next: TableStatePatch) => void];
@@ -0,0 +1,53 @@
1
+ import { useState as J, useMemo as _, useRef as y, useCallback as p } from "react";
2
+ const R = ["columnVisibility", "columnOrder"];
3
+ function T(t) {
4
+ if (!t) return null;
5
+ if (t.storage) return t.storage;
6
+ if (typeof window > "u") return null;
7
+ try {
8
+ return window.localStorage;
9
+ } catch {
10
+ return null;
11
+ }
12
+ }
13
+ function v(t, e) {
14
+ const n = T(t);
15
+ if (!n || !t) return e;
16
+ try {
17
+ const o = n.getItem(t.key);
18
+ if (!o) return e;
19
+ const r = JSON.parse(o), s = t.include ?? R, u = {};
20
+ for (const c of s)
21
+ r[c] !== void 0 && (u[c] = r[c]);
22
+ return { ...e, ...u };
23
+ } catch {
24
+ return e;
25
+ }
26
+ }
27
+ function C(t) {
28
+ const { persist: e, controlled: n, defaultState: o, onStateChange: r } = t, [s, u] = J(() => v(e, o ?? {})), c = _(() => ({ ...s, ...n }), [s, n]), S = y(n);
29
+ S.current = n;
30
+ const i = y(r);
31
+ i.current = r;
32
+ const m = y(e);
33
+ m.current = e;
34
+ const h = p((f) => {
35
+ u((d) => {
36
+ var N;
37
+ const w = S.current, k = { ...d, ...w }, I = typeof f == "function" ? f(k) : f, x = { ...d, ...I }, a = { ...d, ...w, ...I }, l = m.current, E = T(l);
38
+ if (E && l)
39
+ try {
40
+ const D = l.include ?? R, P = {};
41
+ for (const g of D)
42
+ a[g] !== void 0 && (P[g] = a[g]);
43
+ E.setItem(l.key, JSON.stringify(P));
44
+ } catch {
45
+ }
46
+ return (N = i.current) == null || N.call(i, a), x;
47
+ });
48
+ }, []);
49
+ return [c, h];
50
+ }
51
+ export {
52
+ C as useTablePersistence
53
+ };
@@ -5,7 +5,7 @@ import ce, { useState as V, useEffect as E } from "react";
5
5
  import { TextField as U } from "../textfield/textfield.es.js";
6
6
  import { TimePicker as de } from "../time-picker/time-picker.es.js";
7
7
  import l from "./time-field.module.scss.es.js";
8
- import { TIMEPICKER_OFFSET as fe, normalizeTime as ue } from "./time-field-helpers.es.js";
8
+ import { normalizeTime as fe, TIMEPICKER_OFFSET as ue } from "./time-field-helpers.es.js";
9
9
  import { autoUpdate as me } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
10
10
  import { offset as pe, flip as ge, shift as he } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
11
11
  import { useBreakpointProps as ke } from "../../../helpers/hooks/use-breakpoint-props.es.js";
@@ -33,7 +33,7 @@ const ve = (k) => {
33
33
  open: x,
34
34
  onOpenChange: _,
35
35
  placement: F ? "bottom-start" : "bottom-end",
36
- middleware: [pe(fe), ge(), he()],
36
+ middleware: [pe(ue), ge(), he()],
37
37
  whileElementsMounted: me
38
38
  }), { refs: b, context: m, x: J, y: L, strategy: Q } = H, W = ne(m), X = oe(m), Y = re(m, { role: "listbox" }), y = a && F && !d && !o, R = le([...y ? [W] : [], X, Y]), p = (e) => {
39
39
  const n = e.trim();
@@ -42,7 +42,7 @@ const ve = (k) => {
42
42
  var g;
43
43
  const n = e.target.value ?? "";
44
44
  (g = t == null ? void 0 : t.onBlur) == null || g.call(t, e);
45
- const r = ue(n);
45
+ const r = fe(n);
46
46
  r !== null && r !== n && p(r);
47
47
  };
48
48
  E(() => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("../../../../../external/classnames/index.cjs.js"),s=require("react"),U=require("../../base/icon/icon.cjs.js"),y=require("../../base/typography/text/text.cjs.js"),N=require("../../buttons/button/button.cjs.js"),D=require("../../form/select/select.cjs.js"),a=require("./pagination.module.scss.cjs.js"),E=require("./use-pagination.cjs.js"),F=require("../../../providers/label-provider/use-labels.cjs.js"),m=s.forwardRef((S,j)=>{const{pageCount:u,page:f,defaultPage:z=1,onPageChange:d,totalItems:h,pageSize:b,pageSizeOptions:l,onPageSizeChange:c,boundaryCount:L=1,siblingCount:q=1,labels:v,className:A}=S,{getLabel:i}=F.useLabels(),n=s.useMemo(()=>({ariaLabel:i("pagination.title"),previous:i("pagination.prev-page"),next:i("pagination.next-page"),pageAriaLabel:e=>i("pagination.page",e,!1),currentPageAriaLabel:e=>i("pagination.page",e,!0),results:e=>i("pagination.results",e),pageSize:i("pagination.page-size"),...v}),[i,v]),[C,P]=s.useState(z),_=f??C,w=E.usePagination({page:_,pageCount:u,boundaryCount:L,siblingCount:q}),x=s.useCallback(e=>{e===_||e<1||e>u||(f===void 0&&P(e),d==null||d(e))},[_,d,f,u]),k=s.useId(),p=s.useMemo(()=>Array.isArray(l)?l.map(e=>({value:String(e),label:String(e)})):[],[l]),M=s.useMemo(()=>b===void 0?p[0]??null:p.find(e=>e.value===String(b))??null,[b,p]),I=s.useCallback(e=>{const r=Array.isArray(e)?e[0]:e;r&&"value"in r&&(c==null||c(Number(r.value)))},[c]),O=g.default(a.default["tedi-pagination"],A),R=h!==void 0,T=Array.isArray(l)&&l.length>0;return t.jsxs("div",{ref:j,className:O,"data-name":"tedi-pagination",children:[t.jsx("div",{className:a.default["tedi-pagination__slot-start"],children:R&&t.jsx(y.Text,{className:a.default["tedi-pagination__results"],color:"secondary",modifiers:"small",children:n.results(h)})}),t.jsx("div",{className:a.default["tedi-pagination__slot-center"],children:u>1&&t.jsx("nav",{"aria-label":n.ariaLabel,className:a.default["tedi-pagination__nav"],children:t.jsx("ul",{className:a.default["tedi-pagination__list"],children:w.map((e,r)=>{if(e.type==="ellipsis")return t.jsx("li",{className:g.default(a.default["tedi-pagination__item"],a.default["tedi-pagination__item--ellipsis"]),"aria-hidden":"true",children:"…"},`ellipsis-${r}`);if(e.type==="previous"||e.type==="next"){if(e.disabled)return null;const B=e.type==="previous"?n.previous:n.next,$=e.type==="previous"?"arrow_back":"arrow_forward";return t.jsx("li",{className:a.default["tedi-pagination__item"],children:t.jsx(N.Button,{type:"button",className:g.default(a.default["tedi-pagination__button"],a.default["tedi-pagination__button--nav"]),"aria-label":B,onClick:()=>e.page!==null&&x(e.page),noStyle:!0,children:t.jsx(U.Icon,{name:$,size:18,color:"brand"})})},e.type)}const o=e.page;return t.jsx("li",{className:a.default["tedi-pagination__item"],children:t.jsx(N.Button,{type:"button",className:g.default(a.default["tedi-pagination__button"],{[a.default["tedi-pagination__button--selected"]]:e.selected}),"aria-label":e.selected?n.currentPageAriaLabel(o):n.pageAriaLabel(o),"aria-current":e.selected?"page":void 0,onClick:()=>x(o),noStyle:!0,children:o})},o)})})})}),t.jsx("div",{className:a.default["tedi-pagination__slot-end"],children:T&&t.jsxs("div",{className:a.default["tedi-pagination__page-size"],children:[t.jsx(y.Text,{className:a.default["tedi-pagination__page-size-label"],color:"secondary",modifiers:"small",element:"span",children:n.pageSize}),t.jsx(D.Select,{id:`tedi-pagination-page-size-${k}`,className:a.default["tedi-pagination__select"],label:n.pageSize,hideLabel:!0,size:"small",options:p,value:M,onChange:I,isSearchable:!1,isClearable:!1})]})})]})});m.displayName="Pagination";exports.Pagination=m;exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),_=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),W=require("../../base/icon/icon.cjs.js"),A=require("../../base/typography/text/text.cjs.js"),C=require("../../buttons/button/button.cjs.js"),L=require("../../form/select/select.cjs.js"),a=require("./pagination.module.scss.cjs.js"),X=require("./use-pagination.cjs.js"),P=require("../../../helpers/hooks/use-breakpoint.cjs.js"),Y=require("../../../providers/label-provider/use-labels.cjs.js"),N=n.forwardRef((q,k)=>{const{pageCount:s,page:h,defaultPage:w=1,onPageChange:p,totalItems:j,pageSize:v,pageSizeOptions:c,onPageSizeChange:g,boundaryCount:M=1,siblingCount:I=1,labels:x,className:B}=q,{getLabel:o}=Y.useLabels(),l=n.useMemo(()=>({ariaLabel:o("pagination.title"),previous:o("pagination.prev-page"),next:o("pagination.next-page"),pageAriaLabel:e=>o("pagination.page",e,!1),currentPageAriaLabel:e=>o("pagination.page",e,!0),results:e=>o("pagination.results",e),pageSize:o("pagination.page-size"),pageStatus:(e,i)=>o("pagination.page-status",e,i),...x}),[o,x]),[O,$]=n.useState(w),r=h??O,b=X.usePagination({page:r,pageCount:s,boundaryCount:M,siblingCount:I}),m=n.useCallback(e=>{e===r||e<1||e>s||(h===void 0&&$(e),p==null||p(e))},[r,p,h,s]),y=n.useId(),f=n.useMemo(()=>Array.isArray(c)?c.map(e=>({value:String(e),label:String(e)})):[],[c]),R=n.useMemo(()=>v===void 0?f[0]??null:f.find(e=>e.value===String(v))??null,[v,f]),J=n.useCallback(e=>{const i=Array.isArray(e)?e[0]:e;i&&"value"in i&&(g==null||g(Number(i.value)))},[g]),T=_.default(a.default["tedi-pagination"],B),K=P.useBreakpoint(),S=P.isBreakpointBelow(K,"md"),U=j!==void 0,D=!S&&Array.isArray(c)&&c.length>0,E=b[0],F=b[b.length-1],G=b.slice(1,-1),z=e=>{const i=e.type==="previous"?l.previous:l.next,u=e.type==="previous"?"arrow_back":"arrow_forward";return t.jsx(C.Button,{type:"button",className:_.default(a.default["tedi-pagination__button"],a.default["tedi-pagination__button--nav"],a.default[`tedi-pagination__button--nav-${e.type}`]),"aria-label":i,disabled:e.disabled,onClick:()=>e.page!==null&&m(e.page),noStyle:!0,children:t.jsx(W.Icon,{name:u,size:18,color:"brand"})})},H=n.useMemo(()=>Array.from({length:s},(e,i)=>{const u=i+1;return{value:String(u),label:String(u)}}),[s]),Q=n.useMemo(()=>({value:String(r),label:`${r} / ${s}`}),[r,s]),V=n.useCallback(e=>{const i=Array.isArray(e)?e[0]:e;i&&"value"in i&&m(Number(i.value))},[m]);return t.jsxs("div",{ref:k,className:T,"data-name":"tedi-pagination",children:[t.jsx("span",{className:"visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",children:s>1?l.pageStatus(r,s):""}),t.jsx("div",{className:a.default["tedi-pagination__slot-start"],role:"status","aria-live":"polite","aria-atomic":"true",children:U&&t.jsx(A.Text,{className:a.default["tedi-pagination__results"],color:"secondary",modifiers:"small",children:l.results(j)})}),t.jsx("div",{className:a.default["tedi-pagination__slot-center"],children:s>1&&t.jsxs("nav",{"aria-label":l.ariaLabel,className:a.default["tedi-pagination__nav"],children:[z(E),!S&&t.jsx("ul",{className:a.default["tedi-pagination__list"],children:G.map((e,i)=>{const u=`slot-${i}`;if(e.type==="ellipsis")return t.jsx("li",{className:_.default(a.default["tedi-pagination__item"],a.default["tedi-pagination__item--ellipsis"]),"aria-hidden":"true",children:"…"},u);const d=e.page;return t.jsx("li",{className:a.default["tedi-pagination__item"],children:t.jsx(C.Button,{type:"button",className:_.default(a.default["tedi-pagination__button"],{[a.default["tedi-pagination__button--selected"]]:e.selected}),"aria-label":e.selected?l.currentPageAriaLabel(d):l.pageAriaLabel(d),"aria-current":e.selected?"page":void 0,onClick:()=>m(d),noStyle:!0,children:t.jsx("span",{className:a.default["tedi-pagination__button-label"],children:d},d)})},u)})}),S&&t.jsx("div",{className:a.default["tedi-pagination__page-jump"],children:t.jsx(L.Select,{id:`tedi-pagination-jump-${y}`,className:a.default["tedi-pagination__page-jump-select"],label:l.ariaLabel,hideLabel:!0,size:"small",options:H,value:Q,onChange:V,isSearchable:!1,isClearable:!1})}),z(F)]})}),t.jsx("div",{className:a.default["tedi-pagination__slot-end"],children:D&&t.jsxs("div",{className:a.default["tedi-pagination__page-size"],children:[t.jsx(A.Text,{className:a.default["tedi-pagination__page-size-label"],color:"secondary",modifiers:"small",element:"span",children:l.pageSize}),t.jsx(L.Select,{id:`tedi-pagination-page-size-${y}`,className:a.default["tedi-pagination__select"],label:l.pageSize,hideLabel:!0,size:"small",options:f,value:R,onChange:J,isSearchable:!1,isClearable:!1})]})})]})});N.displayName="Pagination";exports.Pagination=N;exports.default=N;
@@ -41,6 +41,13 @@ export interface PaginationLabels {
41
41
  * @default 'Show per page'
42
42
  */
43
43
  pageSize: string;
44
+ /**
45
+ * Builds the message announced to screen readers (via a visually-hidden
46
+ * `aria-live="polite"` region) whenever the current page changes. Lets SR
47
+ * users know that the page transition happened without sighted feedback.
48
+ * @default (page, pageCount) => `Page ${page} of ${pageCount}`
49
+ */
50
+ pageStatus: (page: number, pageCount: number) => string;
44
51
  }
45
52
  export interface PaginationProps {
46
53
  /**
@@ -1,123 +1,164 @@
1
- import { jsxs as v, jsx as i } from "react/jsx-runtime";
2
- import g from "../../../../../external/classnames/index.es.js";
3
- import { forwardRef as D, useMemo as b, useState as E, useCallback as y, useId as F } from "react";
4
- import { Icon as G } from "../../base/icon/icon.es.js";
5
- import { Text as S } from "../../base/typography/text/text.es.js";
6
- import { Button as z } from "../../buttons/button/button.es.js";
7
- import { Select as H } from "../../form/select/select.es.js";
1
+ import { jsxs as y, jsx as i } from "react/jsx-runtime";
2
+ import h from "../../../../../external/classnames/index.es.js";
3
+ import { forwardRef as W, useMemo as d, useState as X, useCallback as S, useId as Y } from "react";
4
+ import { Icon as Z } from "../../base/icon/icon.es.js";
5
+ import { Text as P } from "../../base/typography/text/text.es.js";
6
+ import { Button as w } from "../../buttons/button/button.es.js";
7
+ import { Select as k } from "../../form/select/select.es.js";
8
8
  import a from "./pagination.module.scss.es.js";
9
- import { usePagination as J } from "./use-pagination.es.js";
10
- import { useLabels as K } from "../../../providers/label-provider/use-labels.es.js";
11
- const Q = D((A, L) => {
9
+ import { usePagination as ee } from "./use-pagination.es.js";
10
+ import { useBreakpoint as ae, isBreakpointBelow as ie } from "../../../helpers/hooks/use-breakpoint.es.js";
11
+ import { useLabels as te } from "../../../providers/label-provider/use-labels.es.js";
12
+ const ne = W((I, $) => {
12
13
  const {
13
- pageCount: o,
14
- page: u,
15
- defaultPage: C = 1,
16
- onPageChange: p,
17
- totalItems: f,
18
- pageSize: m,
19
- pageSizeOptions: s,
20
- onPageSizeChange: c,
21
- boundaryCount: P = 1,
22
- siblingCount: w = 1,
23
- labels: h,
24
- className: k
25
- } = A, { getLabel: t } = K(), n = b(
14
+ pageCount: n,
15
+ page: f,
16
+ defaultPage: j = 1,
17
+ onPageChange: g,
18
+ totalItems: z,
19
+ pageSize: v,
20
+ pageSizeOptions: p,
21
+ onPageSizeChange: u,
22
+ boundaryCount: O = 1,
23
+ siblingCount: x = 1,
24
+ labels: A,
25
+ className: B
26
+ } = I, { getLabel: l } = te(), s = d(
26
27
  () => ({
27
- ariaLabel: t("pagination.title"),
28
- previous: t("pagination.prev-page"),
29
- next: t("pagination.next-page"),
30
- pageAriaLabel: (e) => t("pagination.page", e, !1),
31
- currentPageAriaLabel: (e) => t("pagination.page", e, !0),
32
- results: (e) => t("pagination.results", e),
33
- pageSize: t("pagination.page-size"),
34
- ...h
28
+ ariaLabel: l("pagination.title"),
29
+ previous: l("pagination.prev-page"),
30
+ next: l("pagination.next-page"),
31
+ pageAriaLabel: (e) => l("pagination.page", e, !1),
32
+ currentPageAriaLabel: (e) => l("pagination.page", e, !0),
33
+ results: (e) => l("pagination.results", e),
34
+ pageSize: l("pagination.page-size"),
35
+ pageStatus: (e, t) => l("pagination.page-status", e, t),
36
+ ...A
35
37
  }),
36
- [t, h]
37
- ), [x, I] = E(C), _ = u ?? x, O = J({ page: _, pageCount: o, boundaryCount: P, siblingCount: w }), N = y(
38
+ [l, A]
39
+ ), [J, M] = X(j), o = f ?? J, m = ee({ page: o, pageCount: n, boundaryCount: O, siblingCount: x }), b = S(
38
40
  (e) => {
39
- e === _ || e < 1 || e > o || (u === void 0 && I(e), p == null || p(e));
41
+ e === o || e < 1 || e > n || (f === void 0 && M(e), g == null || g(e));
40
42
  },
41
- [_, p, u, o]
42
- ), j = F(), d = b(
43
- () => Array.isArray(s) ? s.map((e) => ({
43
+ [o, g, f, n]
44
+ ), C = Y(), _ = d(
45
+ () => Array.isArray(p) ? p.map((e) => ({
44
46
  value: String(e),
45
47
  label: String(e)
46
48
  })) : [],
47
- [s]
48
- ), R = b(() => m === void 0 ? d[0] ?? null : d.find((e) => e.value === String(m)) ?? null, [m, d]), $ = y(
49
+ [p]
50
+ ), R = d(() => v === void 0 ? _[0] ?? null : _.find((e) => e.value === String(v)) ?? null, [v, _]), K = S(
49
51
  (e) => {
50
- const l = Array.isArray(e) ? e[0] : e;
51
- l && "value" in l && (c == null || c(Number(l.value)));
52
+ const t = Array.isArray(e) ? e[0] : e;
53
+ t && "value" in t && (u == null || u(Number(t.value)));
52
54
  },
53
- [c]
54
- ), B = g(a["tedi-pagination"], k), M = f !== void 0, T = Array.isArray(s) && s.length > 0;
55
- return /* @__PURE__ */ v("div", { ref: L, className: B, "data-name": "tedi-pagination", children: [
56
- /* @__PURE__ */ i("div", { className: a["tedi-pagination__slot-start"], children: M && /* @__PURE__ */ i(S, { className: a["tedi-pagination__results"], color: "secondary", modifiers: "small", children: n.results(f) }) }),
57
- /* @__PURE__ */ i("div", { className: a["tedi-pagination__slot-center"], children: o > 1 && /* @__PURE__ */ i("nav", { "aria-label": n.ariaLabel, className: a["tedi-pagination__nav"], children: /* @__PURE__ */ i("ul", { className: a["tedi-pagination__list"], children: O.map((e, l) => {
58
- if (e.type === "ellipsis")
59
- return /* @__PURE__ */ i(
60
- "li",
61
- {
62
- className: g(a["tedi-pagination__item"], a["tedi-pagination__item--ellipsis"]),
63
- "aria-hidden": "true",
64
- children: "…"
65
- },
66
- `ellipsis-${l}`
67
- );
68
- if (e.type === "previous" || e.type === "next") {
69
- if (e.disabled) return null;
70
- const U = e.type === "previous" ? n.previous : n.next, q = e.type === "previous" ? "arrow_back" : "arrow_forward";
55
+ [u]
56
+ ), T = h(a["tedi-pagination"], B), U = ae(), N = ie(U, "md"), q = z !== void 0, D = !N && Array.isArray(p) && p.length > 0, E = m[0], F = m[m.length - 1], G = m.slice(1, -1), L = (e) => {
57
+ const t = e.type === "previous" ? s.previous : s.next, r = e.type === "previous" ? "arrow_back" : "arrow_forward";
58
+ return /* @__PURE__ */ i(
59
+ w,
60
+ {
61
+ type: "button",
62
+ className: h(
63
+ a["tedi-pagination__button"],
64
+ a["tedi-pagination__button--nav"],
65
+ a[`tedi-pagination__button--nav-${e.type}`]
66
+ ),
67
+ "aria-label": t,
68
+ disabled: e.disabled,
69
+ onClick: () => e.page !== null && b(e.page),
70
+ noStyle: !0,
71
+ children: /* @__PURE__ */ i(Z, { name: r, size: 18, color: "brand" })
72
+ }
73
+ );
74
+ }, H = d(
75
+ () => Array.from({ length: n }, (e, t) => {
76
+ const r = t + 1;
77
+ return { value: String(r), label: String(r) };
78
+ }),
79
+ [n]
80
+ ), Q = d(
81
+ () => ({ value: String(o), label: `${o} / ${n}` }),
82
+ [o, n]
83
+ ), V = S(
84
+ (e) => {
85
+ const t = Array.isArray(e) ? e[0] : e;
86
+ t && "value" in t && b(Number(t.value));
87
+ },
88
+ [b]
89
+ );
90
+ return /* @__PURE__ */ y("div", { ref: $, className: T, "data-name": "tedi-pagination", children: [
91
+ /* @__PURE__ */ i("span", { className: "visually-hidden", role: "status", "aria-live": "polite", "aria-atomic": "true", children: n > 1 ? s.pageStatus(o, n) : "" }),
92
+ /* @__PURE__ */ i("div", { className: a["tedi-pagination__slot-start"], role: "status", "aria-live": "polite", "aria-atomic": "true", children: q && /* @__PURE__ */ i(P, { className: a["tedi-pagination__results"], color: "secondary", modifiers: "small", children: s.results(z) }) }),
93
+ /* @__PURE__ */ i("div", { className: a["tedi-pagination__slot-center"], children: n > 1 && /* @__PURE__ */ y("nav", { "aria-label": s.ariaLabel, className: a["tedi-pagination__nav"], children: [
94
+ L(E),
95
+ !N && /* @__PURE__ */ i("ul", { className: a["tedi-pagination__list"], children: G.map((e, t) => {
96
+ const r = `slot-${t}`;
97
+ if (e.type === "ellipsis")
98
+ return /* @__PURE__ */ i(
99
+ "li",
100
+ {
101
+ className: h(a["tedi-pagination__item"], a["tedi-pagination__item--ellipsis"]),
102
+ "aria-hidden": "true",
103
+ children: "…"
104
+ },
105
+ r
106
+ );
107
+ const c = e.page;
71
108
  return /* @__PURE__ */ i("li", { className: a["tedi-pagination__item"], children: /* @__PURE__ */ i(
72
- z,
109
+ w,
73
110
  {
74
111
  type: "button",
75
- className: g(a["tedi-pagination__button"], a["tedi-pagination__button--nav"]),
76
- "aria-label": U,
77
- onClick: () => e.page !== null && N(e.page),
112
+ className: h(a["tedi-pagination__button"], {
113
+ [a["tedi-pagination__button--selected"]]: e.selected
114
+ }),
115
+ "aria-label": e.selected ? s.currentPageAriaLabel(c) : s.pageAriaLabel(c),
116
+ "aria-current": e.selected ? "page" : void 0,
117
+ onClick: () => b(c),
78
118
  noStyle: !0,
79
- children: /* @__PURE__ */ i(G, { name: q, size: 18, color: "brand" })
119
+ children: /* @__PURE__ */ i("span", { className: a["tedi-pagination__button-label"], children: c }, c)
80
120
  }
81
- ) }, e.type);
82
- }
83
- const r = e.page;
84
- return /* @__PURE__ */ i("li", { className: a["tedi-pagination__item"], children: /* @__PURE__ */ i(
85
- z,
121
+ ) }, r);
122
+ }) }),
123
+ N && /* @__PURE__ */ i("div", { className: a["tedi-pagination__page-jump"], children: /* @__PURE__ */ i(
124
+ k,
86
125
  {
87
- type: "button",
88
- className: g(a["tedi-pagination__button"], {
89
- [a["tedi-pagination__button--selected"]]: e.selected
90
- }),
91
- "aria-label": e.selected ? n.currentPageAriaLabel(r) : n.pageAriaLabel(r),
92
- "aria-current": e.selected ? "page" : void 0,
93
- onClick: () => N(r),
94
- noStyle: !0,
95
- children: r
126
+ id: `tedi-pagination-jump-${C}`,
127
+ className: a["tedi-pagination__page-jump-select"],
128
+ label: s.ariaLabel,
129
+ hideLabel: !0,
130
+ size: "small",
131
+ options: H,
132
+ value: Q,
133
+ onChange: V,
134
+ isSearchable: !1,
135
+ isClearable: !1
96
136
  }
97
- ) }, r);
98
- }) }) }) }),
99
- /* @__PURE__ */ i("div", { className: a["tedi-pagination__slot-end"], children: T && /* @__PURE__ */ v("div", { className: a["tedi-pagination__page-size"], children: [
137
+ ) }),
138
+ L(F)
139
+ ] }) }),
140
+ /* @__PURE__ */ i("div", { className: a["tedi-pagination__slot-end"], children: D && /* @__PURE__ */ y("div", { className: a["tedi-pagination__page-size"], children: [
100
141
  /* @__PURE__ */ i(
101
- S,
142
+ P,
102
143
  {
103
144
  className: a["tedi-pagination__page-size-label"],
104
145
  color: "secondary",
105
146
  modifiers: "small",
106
147
  element: "span",
107
- children: n.pageSize
148
+ children: s.pageSize
108
149
  }
109
150
  ),
110
151
  /* @__PURE__ */ i(
111
- H,
152
+ k,
112
153
  {
113
- id: `tedi-pagination-page-size-${j}`,
154
+ id: `tedi-pagination-page-size-${C}`,
114
155
  className: a["tedi-pagination__select"],
115
- label: n.pageSize,
156
+ label: s.pageSize,
116
157
  hideLabel: !0,
117
158
  size: "small",
118
- options: d,
159
+ options: _,
119
160
  value: R,
120
- onChange: $,
161
+ onChange: K,
121
162
  isSearchable: !1,
122
163
  isClearable: !1
123
164
  }
@@ -125,8 +166,8 @@ const Q = D((A, L) => {
125
166
  ] }) })
126
167
  ] });
127
168
  });
128
- Q.displayName = "Pagination";
169
+ ne.displayName = "Pagination";
129
170
  export {
130
- Q as Pagination,
131
- Q as default
171
+ ne as Pagination,
172
+ ne as default
132
173
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i={"tedi-pagination":"tedi-pagination-96c6fc62","tedi-pagination__slot-start":"tedi-pagination__slot-start-846e7900","tedi-pagination__slot-center":"tedi-pagination__slot-center-e489623b","tedi-pagination__slot-end":"tedi-pagination__slot-end-3f4f5848","tedi-pagination__results":"tedi-pagination__results-29d9108c","tedi-pagination__nav":"tedi-pagination__nav-5f414114","tedi-pagination__list":"tedi-pagination__list-03467ce1","tedi-pagination__item":"tedi-pagination__item-46985c58","tedi-pagination__item--ellipsis":"tedi-pagination__item--ellipsis-85f798f5","tedi-pagination__button":"tedi-pagination__button-d06c27d4","tedi-pagination__button--selected":"tedi-pagination__button--selected-cb151c7f","tedi-pagination__button--nav":"tedi-pagination__button--nav-2f74eea2","tedi-pagination__page-size":"tedi-pagination__page-size-d1fa6f9d","tedi-pagination__page-size-label":"tedi-pagination__page-size-label-3dc2d141","tedi-pagination__select":"tedi-pagination__select-435e167e"};exports.default=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i={"tedi-pagination":"tedi-pagination-96c6fc62","tedi-pagination__slot-start":"tedi-pagination__slot-start-846e7900","tedi-pagination__slot-center":"tedi-pagination__slot-center-e489623b","tedi-pagination__slot-end":"tedi-pagination__slot-end-3f4f5848","tedi-pagination__results":"tedi-pagination__results-29d9108c","tedi-pagination__nav":"tedi-pagination__nav-5f414114","tedi-pagination__list":"tedi-pagination__list-03467ce1","tedi-pagination__page-jump":"tedi-pagination__page-jump-db0a15d9","tedi-pagination__page-jump-select":"tedi-pagination__page-jump-select-29430dd4","tedi-pagination__item":"tedi-pagination__item-46985c58","tedi-pagination__item--ellipsis":"tedi-pagination__item--ellipsis-85f798f5","tedi-pagination__button":"tedi-pagination__button-d06c27d4","tedi-pagination__button--selected":"tedi-pagination__button--selected-cb151c7f","tedi-pagination__button--nav":"tedi-pagination__button--nav-2f74eea2","tedi-pagination__button--nav-previous":"tedi-pagination__button--nav-previous-1e74ca69","tedi-pagination__button--nav-next":"tedi-pagination__button--nav-next-80e53bed","tedi-pagination__page-size":"tedi-pagination__page-size-d1fa6f9d","tedi-pagination__page-size-label":"tedi-pagination__page-size-label-3dc2d141","tedi-pagination__select":"tedi-pagination__select-435e167e","tedi-pagination__button-label":"tedi-pagination__button-label-e70ad8bf","tedi-pagination-label-in":"tedi-pagination-label-in-d1e2074e"};exports.default=i;
@@ -6,14 +6,20 @@ const i = {
6
6
  "tedi-pagination__results": "tedi-pagination__results-29d9108c",
7
7
  "tedi-pagination__nav": "tedi-pagination__nav-5f414114",
8
8
  "tedi-pagination__list": "tedi-pagination__list-03467ce1",
9
+ "tedi-pagination__page-jump": "tedi-pagination__page-jump-db0a15d9",
10
+ "tedi-pagination__page-jump-select": "tedi-pagination__page-jump-select-29430dd4",
9
11
  "tedi-pagination__item": "tedi-pagination__item-46985c58",
10
12
  "tedi-pagination__item--ellipsis": "tedi-pagination__item--ellipsis-85f798f5",
11
13
  "tedi-pagination__button": "tedi-pagination__button-d06c27d4",
12
14
  "tedi-pagination__button--selected": "tedi-pagination__button--selected-cb151c7f",
13
15
  "tedi-pagination__button--nav": "tedi-pagination__button--nav-2f74eea2",
16
+ "tedi-pagination__button--nav-previous": "tedi-pagination__button--nav-previous-1e74ca69",
17
+ "tedi-pagination__button--nav-next": "tedi-pagination__button--nav-next-80e53bed",
14
18
  "tedi-pagination__page-size": "tedi-pagination__page-size-d1fa6f9d",
15
19
  "tedi-pagination__page-size-label": "tedi-pagination__page-size-label-3dc2d141",
16
- "tedi-pagination__select": "tedi-pagination__select-435e167e"
20
+ "tedi-pagination__select": "tedi-pagination__select-435e167e",
21
+ "tedi-pagination__button-label": "tedi-pagination__button-label-e70ad8bf",
22
+ "tedi-pagination-label-in": "tedi-pagination-label-in-d1e2074e"
17
23
  };
18
24
  export {
19
25
  i as default
@@ -0,0 +1,100 @@
1
+ export type PaginationItemType = 'page' | 'previous' | 'next' | 'ellipsis';
2
+ export interface PaginationItem {
3
+ type: PaginationItemType;
4
+ page: number | null;
5
+ selected: boolean;
6
+ disabled: boolean;
7
+ }
8
+ export interface PaginationLabels {
9
+ /**
10
+ * Accessible label for the nav wrapper.
11
+ * @default 'Pagination'
12
+ */
13
+ ariaLabel: string;
14
+ /**
15
+ * Previous button label (icon-only, used as aria-label).
16
+ * @default 'Previous page'
17
+ */
18
+ previous: string;
19
+ /**
20
+ * Next button label (icon-only, used as aria-label).
21
+ * @default 'Next page'
22
+ */
23
+ next: string;
24
+ /**
25
+ * Function that builds the aria-label for a numeric page button.
26
+ * @default (page) => `Go to page ${page}`
27
+ */
28
+ pageAriaLabel: (page: number) => string;
29
+ /**
30
+ * Function that builds the aria-label for the currently active page.
31
+ * @default (page) => `Current page, page ${page}`
32
+ */
33
+ currentPageAriaLabel: (page: number) => string;
34
+ /**
35
+ * Rendered to the left of the pagination nav when `totalItems` is set.
36
+ * @default (count) => `${count} results`
37
+ */
38
+ results: (count: number) => string;
39
+ /**
40
+ * Prefix label for the page-size select.
41
+ * @default 'Show per page'
42
+ */
43
+ pageSize: string;
44
+ }
45
+ export interface PaginationProps {
46
+ /**
47
+ * Total number of pages.
48
+ */
49
+ pageCount: number;
50
+ /**
51
+ * Controlled current page (1-based). Pair with `onPageChange`.
52
+ */
53
+ page?: number;
54
+ /**
55
+ * Initial page for uncontrolled mode (1-based).
56
+ * @default 1
57
+ */
58
+ defaultPage?: number;
59
+ /**
60
+ * Fires whenever the user navigates to a different page.
61
+ */
62
+ onPageChange?: (page: number) => void;
63
+ /**
64
+ * Total number of items across all pages. Renders a "{count} results" label
65
+ * to the left of the nav when set.
66
+ */
67
+ totalItems?: number;
68
+ /**
69
+ * Current page size. Shown in the page-size select when
70
+ * `pageSizeOptions` is provided.
71
+ */
72
+ pageSize?: number;
73
+ /**
74
+ * Options for the page-size select. Omit to hide the select.
75
+ */
76
+ pageSizeOptions?: number[];
77
+ /**
78
+ * Fires when the user picks a different page size.
79
+ */
80
+ onPageSizeChange?: (pageSize: number) => void;
81
+ /**
82
+ * Number of pages always shown at the start and end of the range before
83
+ * ellipsis kicks in.
84
+ * @default 1
85
+ */
86
+ boundaryCount?: number;
87
+ /**
88
+ * Number of sibling pages shown on either side of the current page.
89
+ * @default 1
90
+ */
91
+ siblingCount?: number;
92
+ /**
93
+ * Override any of the default text labels / aria labels.
94
+ */
95
+ labels?: Partial<PaginationLabels>;
96
+ /**
97
+ * Additional class name on the root element.
98
+ */
99
+ className?: string;
100
+ }
@@ -0,0 +1,8 @@
1
+ export * from './modal';
2
+ export * from './modal-trigger/modal-trigger';
3
+ export * from './modal-content/modal-content';
4
+ export * from './modal-header/modal-header';
5
+ export * from './modal-body/modal-body';
6
+ export * from './modal-footer/modal-footer';
7
+ export * from './modal-closer/modal-closer';
8
+ export * from './modal-context';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("../../../../../../external/classnames/index.cjs.js"),d=require("../modal.module.scss.cjs.js"),e=({children:o,noScroll:l=!1,className:a})=>t.jsx("div",{className:s.default(d.default["tedi-modal__body"],{[d.default["tedi-modal__body--scroll-page"]]:l},a),children:o});e.displayName="Modal.Body";exports.ModalBody=e;exports.default=e;