@pismo/marola 0.0.1-alpha.16 → 0.0.1-alpha.18

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 (93) hide show
  1. package/dist/{Button-B1umG8kJ.js → Button-2b1peDFT.js} +25 -26
  2. package/dist/{ClickAwayListener-HI1G6ob9.js → ClickAwayListener-BSW-Nd-y.js} +3 -3
  3. package/dist/{Popup-DFJQc_jn.js → Popup-B6ZSGIEI.js} +12 -13
  4. package/dist/{Portal-D__zvwbZ.js → Portal-DIeBsWdL.js} +2 -2
  5. package/dist/{SelectButton-DWZ2BRaX.js → SelectButton-pciwIWcj.js} +24 -22
  6. package/dist/assets/Chip.css +1 -1
  7. package/dist/assets/Input.css +1 -1
  8. package/dist/assets/PageHeader.css +1 -1
  9. package/dist/assets/Pagination.css +1 -1
  10. package/dist/assets/SelectButton.css +1 -1
  11. package/dist/assets/TextDisplay.css +1 -0
  12. package/dist/{combineHooksSlotProps-BHqhiBfc.js → combineHooksSlotProps-DVjg9PRh.js} +18 -19
  13. package/dist/components/Button/Button.js +1 -1
  14. package/dist/components/Checkbox/Checkbox.d.ts +15 -0
  15. package/dist/components/Checkbox/Checkbox.stories.d.ts +31 -0
  16. package/dist/components/Chip/Chip.js +1 -1
  17. package/dist/components/Dialog/CloseIconButton.js +1 -1
  18. package/dist/components/Dialog/Dialog.js +15 -16
  19. package/dist/components/Dialog/Dialog.stories.d.ts +3 -3
  20. package/dist/components/Icon/Icon.d.ts +10 -1
  21. package/dist/components/Icon/Icon.js +39 -25
  22. package/dist/components/Icon/Icon.stories.d.ts +16 -0
  23. package/dist/components/IconButton/Icon.stories.d.ts +15 -0
  24. package/dist/components/IconButton/IconButton.d.ts +14 -0
  25. package/dist/components/IconButton/IconButton.js +1 -1
  26. package/dist/components/Input/Input.js +38 -39
  27. package/dist/components/PageHeader/PageHeader.js +23 -23
  28. package/dist/components/Pagination/Pagination.d.ts +24 -5
  29. package/dist/components/Pagination/Pagination.js +119 -116
  30. package/dist/components/Pagination/Pagination.stories.d.ts +17 -0
  31. package/dist/components/Select/Select.js +137 -138
  32. package/dist/components/Select/SelectButton.js +1 -1
  33. package/dist/components/Skeleton/Skeleton.d.ts +10 -3
  34. package/dist/components/Skeleton/Skeleton.js +12 -15
  35. package/dist/components/Skeleton/Skeleton.stories.d.ts +14 -0
  36. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +14 -0
  37. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +16 -0
  38. package/dist/components/Snackbar/Snackbar.js +6 -7
  39. package/dist/components/Snackbar/Snackbar.stories.d.ts +3 -3
  40. package/dist/components/SortTooltip/SortTooltip.d.ts +3 -1
  41. package/dist/components/SortTooltip/SortTooltip.js +27 -16
  42. package/dist/components/Stepper/Stepper.d.ts +11 -1
  43. package/dist/components/Stepper/Stepper.stories.d.ts +16 -0
  44. package/dist/components/Table/Table.js +38 -40
  45. package/dist/components/Tabs/Tab.d.ts +5 -0
  46. package/dist/components/Tabs/Tab.js +9 -10
  47. package/dist/components/Tabs/Tab.stories.d.ts +15 -0
  48. package/dist/components/Tabs/TabPanel.d.ts +4 -0
  49. package/dist/components/Tabs/TabPanel.js +13 -14
  50. package/dist/components/Tabs/TabPanel.stories.d.ts +14 -0
  51. package/dist/components/Tabs/Tabs.d.ts +5 -1
  52. package/dist/components/Tabs/Tabs.js +36 -37
  53. package/dist/components/Tabs/Tabs.stories.d.ts +14 -0
  54. package/dist/components/TextDisplay/TextDisplay.d.ts +23 -0
  55. package/dist/components/TextDisplay/TextDisplay.js +37 -0
  56. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +13 -0
  57. package/dist/components/TextDisplay/textDisplay.test.d.ts +1 -0
  58. package/dist/components/Toggle/Toggle.js +7 -8
  59. package/dist/components/Tooltip/Tooltip.d.ts +18 -6
  60. package/dist/components/Tooltip/Tooltip.js +104 -92
  61. package/dist/components/Tooltip/Tooltip.stories.d.ts +33 -0
  62. package/dist/components/Typography/Typography.d.ts +2 -0
  63. package/dist/components/Typography/Typography.js +40 -29
  64. package/dist/components/Typography/Typography.stories.d.ts +1 -0
  65. package/dist/{index-CqjC7P5Y.js → index-CH45lKw7.js} +333 -307
  66. package/dist/{index-BJ8HbRCy.js → index-CjW42-M-.js} +5 -6
  67. package/dist/main.d.ts +5 -1
  68. package/dist/main.js +34 -32
  69. package/dist/marola.css +1 -0
  70. package/dist/{useButton-Bc8IAgyk.js → useButton-DNk3wrQp.js} +3 -4
  71. package/dist/{useEventCallback-vAfOD-oT.js → useEventCallback-xTG9piMa.js} +1 -1
  72. package/dist/{useList-ByMguSS_.js → useList-B0hog_3-.js} +48 -49
  73. package/package.json +2 -2
  74. package/dist/_commonjsHelpers-CT_km90n.js +0 -30
  75. package/dist/components/Advice/Advice.stories.js +0 -48
  76. package/dist/components/Button/Button.stories.js +0 -40
  77. package/dist/components/Chip/Chip.stories.js +0 -59
  78. package/dist/components/Chip/chip.test.js +0 -17303
  79. package/dist/components/Dialog/Dialog.stories.js +0 -59
  80. package/dist/components/Input/Input.stories.js +0 -106
  81. package/dist/components/InputSearch/InputSearch.stories.js +0 -73
  82. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +0 -38
  83. package/dist/components/PageHeader/PageHeader.stories.js +0 -49
  84. package/dist/components/Select/Select.stories.js +0 -89
  85. package/dist/components/Snackbar/Snackbar.stories.js +0 -62
  86. package/dist/components/Toggle/Toggle.stories.js +0 -33
  87. package/dist/components/Typography/Typography.stories.js +0 -30
  88. package/dist/components/Typography/typography.test.js +0 -234
  89. package/dist/magic-string.es-O_8lTkE3.js +0 -738
  90. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +0 -26
  91. package/dist/react.esm-DGd9_oKA.js +0 -11126
  92. package/dist/utils/styleStrings.test.js +0 -41
  93. package/dist/vi.Y_w82WR8-XVYrIxgm.js +0 -9861
@@ -1,25 +1,25 @@
1
1
  import '../../assets/PageHeader.css';
2
2
  import { jsxs as a, jsx as t } from "react/jsx-runtime";
3
- import { c as r } from "../../clsx-DB4S2d7J.js";
3
+ import { c as n } from "../../clsx-DB4S2d7J.js";
4
4
  import * as _ from "react";
5
- const z = (n) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", "data-waves-icon": "fa/solid/arrow-left", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
5
+ const w = (c) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", "data-waves-icon": "fa/solid/arrow-left", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
6
6
  fill: "currentcolor",
7
7
  color: "currentcolor",
8
8
  width: "1em",
9
9
  height: "1em"
10
- }, ...n }, /* @__PURE__ */ _.createElement("path", { d: "M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z" })), b = "_title_157kz_45", k = "_subtitle_157kz_46", e = {
11
- "page-header": "_page-header_157kz_1",
12
- "page-header__top-content": "_page-header__top-content_157kz_9",
13
- "page-header__main-content": "_page-header__main-content_157kz_12",
14
- "page-header__bottom-content": "_page-header__bottom-content_157kz_12",
15
- "page-header__main-left-content": "_page-header__main-left-content_157kz_39",
10
+ }, ...c }, /* @__PURE__ */ _.createElement("path", { d: "M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z" })), b = "_title_fxc86_47", N = "_subtitle_fxc86_48", e = {
11
+ "page-header": "_page-header_fxc86_1",
12
+ "page-header__top-content": "_page-header__top-content_fxc86_10",
13
+ "page-header__main-content": "_page-header__main-content_fxc86_13",
14
+ "page-header__bottom-content": "_page-header__bottom-content_fxc86_13",
15
+ "page-header__main-left-content": "_page-header__main-left-content_fxc86_41",
16
16
  title: b,
17
- subtitle: k,
18
- "page-header__main-right-content": "_page-header__main-right-content_157kz_63"
19
- }, C = ({
20
- title: n,
17
+ subtitle: N,
18
+ "page-header__main-right-content": "_page-header__main-right-content_fxc86_65"
19
+ }, H = ({
20
+ title: c,
21
21
  subtitle: d,
22
- backLinkText: c,
22
+ backLinkText: r,
23
23
  onBackLinkClick: s,
24
24
  rightChildren: i,
25
25
  bottomChildren: o,
@@ -29,23 +29,23 @@ const z = (n) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.
29
29
  classNameSubtitle: p,
30
30
  "data-testid-wrapper": g,
31
31
  "data-testid-backLink": f,
32
- "data-testid-title": u,
33
- "data-testid-subtitle": v,
34
- ...w
35
- }) => /* @__PURE__ */ a("div", { className: r([e["page-header"], l]), "data-testid": g, ...w, children: [
36
- c && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("button", { type: "button", onClick: s, className: h, "data-testid": f, children: [
37
- /* @__PURE__ */ t(z, { fontSize: 16 }),
38
- c
32
+ "data-testid-title": x,
33
+ "data-testid-subtitle": u,
34
+ ...v
35
+ }) => /* @__PURE__ */ a("div", { className: n([e["page-header"], l]), "data-testid": g, ...v, children: [
36
+ r && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("button", { type: "button", onClick: s, className: h, "data-testid": f, children: [
37
+ /* @__PURE__ */ t(w, { fontSize: 16 }),
38
+ r
39
39
  ] }) }),
40
40
  /* @__PURE__ */ a("div", { className: e["page-header__main-content"], children: [
41
41
  /* @__PURE__ */ a("div", { className: e["page-header__main-left-content"], children: [
42
- /* @__PURE__ */ t("h1", { className: r(e.title, m), "data-testid": u, children: n }),
43
- /* @__PURE__ */ t("h2", { className: r(e.subtitle, p), "data-testid": v, children: d })
42
+ /* @__PURE__ */ t("h1", { className: n(e.title, m), "data-testid": x, children: c }),
43
+ /* @__PURE__ */ t("h2", { className: n(e.subtitle, p), "data-testid": u, children: d })
44
44
  ] }),
45
45
  i && /* @__PURE__ */ t("div", { className: e["page-header__main-right-content"], children: i })
46
46
  ] }),
47
47
  o && /* @__PURE__ */ t("div", { className: e["page-header__bottom-content"], children: o })
48
48
  ] });
49
49
  export {
50
- C as PageHeader
50
+ H as PageHeader
51
51
  };
@@ -1,36 +1,55 @@
1
1
  export type PaginationParams = {
2
+ /** Total number of items to paginate */
2
3
  totalItems: number;
4
+ /** Number of items to show per page */
3
5
  perPage: number;
6
+ /** Current page */
4
7
  currentPage: number;
5
8
  };
6
9
  export type PaginationTranslations = {
10
+ /** Translation text for `showing` */
7
11
  showing: string;
12
+ /** Translation text for `of` */
8
13
  of: string;
14
+ /** Translation text for `result` */
9
15
  results: string;
16
+ /** Translation text for `previous` */
10
17
  previous: string;
18
+ /** Translation text for `next` */
11
19
  next: string;
12
20
  };
13
21
  type PaginationLanguages = 'pt' | 'en';
14
22
  type PaginationCommonProps = {
23
+ /** CSS classes to be applied on the container element */
15
24
  className?: string;
16
- 'data-testid'?: string;
25
+ /** CSS classes to be applied on the per page element */
17
26
  classNamePerPage?: string;
18
- 'data-testid__per-page'?: string;
27
+ /** CSS classes to be applied on the pages navigation element */
19
28
  classNamePagesNav?: string;
20
- 'data-testid__pages-nav'?: string;
29
+ /** Id to be applied as `data-testid` on the container element */
30
+ 'data-testid'?: string;
31
+ /** Id to be applied as `data-testid` on per page element */
32
+ 'data-testid-per-page'?: string;
33
+ /** Id to be applied as `data-testid` on the pages navigation element */
34
+ 'data-testid-pages-nav'?: string;
21
35
  };
22
36
  export type PaginationProps = {
37
+ /** Array of options to be rendered as per page options. */
23
38
  perPageOptions?: (number | {
24
39
  value: number;
25
40
  label: string;
26
41
  })[] | undefined;
42
+ /** Callback called when page changes. */
27
43
  onPageChange: (page: number) => void;
28
- onRowsPerPageChange: (perPage: number | string) => void;
44
+ /** Callback called when items per page changes. */
45
+ onRowsPerPageChange: (perPage: number) => void;
46
+ /** Language to be used for texts. */
29
47
  language?: PaginationLanguages;
48
+ /** Custom translation object to be used for texts. */
30
49
  t?: PaginationTranslations;
31
50
  } & PaginationParams & PaginationCommonProps;
32
51
  export declare const paginationDefaultTranslations: {
33
52
  [key in PaginationLanguages]: PaginationTranslations;
34
53
  };
35
- export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const Pagination: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
36
55
  export {};
@@ -1,112 +1,114 @@
1
1
  import '../../assets/Pagination.css';
2
- import { jsxs as x, jsx as i, Fragment as M } from "react/jsx-runtime";
3
- import { c as C } from "../../clsx-DB4S2d7J.js";
4
- import { _ as O, a as S } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
5
- import { u as A } from "../../useControlled-CCMYYdCM.js";
6
- const E = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
7
- function $(e = {}) {
2
+ import { jsxs as m, jsx as o, Fragment as M } from "react/jsx-runtime";
3
+ import { c as p } from "../../clsx-DB4S2d7J.js";
4
+ import { Select as k } from "../Select/Select.js";
5
+ import { _ as A, b as E } from "../../index-CH45lKw7.js";
6
+ import { u as $ } from "../../useControlled-CCMYYdCM.js";
7
+ const R = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
8
+ function T(g = {}) {
8
9
  const {
9
10
  boundaryCount: a = 1,
10
- componentName: _ = "usePagination",
11
+ componentName: e = "usePagination",
11
12
  count: s = 1,
12
- defaultPage: b = 1,
13
- disabled: h = !1,
14
- hideNextButton: c = !1,
15
- hidePrevButton: m = !1,
16
- onChange: t,
17
- page: o,
18
- showFirstButton: p = !1,
19
- showLastButton: f = !1,
20
- siblingCount: u = 1
21
- } = e, d = O(e, E), [r, k] = A({
22
- controlled: o,
23
- default: b,
24
- name: _,
13
+ defaultPage: v = 1,
14
+ disabled: _ = !1,
15
+ hideNextButton: f = !1,
16
+ hidePrevButton: u = !1,
17
+ onChange: h,
18
+ page: n,
19
+ showFirstButton: r = !1,
20
+ showLastButton: x = !1,
21
+ siblingCount: d = 1
22
+ } = g, b = A(g, R), [i, S] = $({
23
+ controlled: n,
24
+ default: v,
25
+ name: e,
25
26
  state: "page"
26
- }), N = (n, l) => {
27
- o || k(l), t && t(n, l);
28
- }, v = (n, l) => {
29
- const F = l - n + 1;
27
+ }), N = (t, c) => {
28
+ n || S(c), h && h(t, c);
29
+ }, C = (t, c) => {
30
+ const F = c - t + 1;
30
31
  return Array.from({
31
32
  length: F
32
- }, (W, I) => n + I);
33
- }, j = v(1, Math.min(a, s)), P = v(Math.max(s - a + 1, a + 1), s), w = Math.max(
33
+ }, (z, I) => t + I);
34
+ }, L = C(1, Math.min(a, s)), P = C(Math.max(s - a + 1, a + 1), s), y = Math.max(
34
35
  Math.min(
35
36
  // Natural start
36
- r - u,
37
+ i - d,
37
38
  // Lower boundary when page is high
38
- s - a - u * 2 - 1
39
+ s - a - d * 2 - 1
39
40
  ),
40
41
  // Greater than startPages
41
42
  a + 2
42
43
  ), B = Math.min(
43
44
  Math.max(
44
45
  // Natural end
45
- r + u,
46
+ i + d,
46
47
  // Upper boundary when page is low
47
- a + u * 2 + 2
48
+ a + d * 2 + 2
48
49
  ),
49
50
  // Less than endPages
50
51
  P.length > 0 ? P[0] - 2 : s - 1
51
- ), L = [
52
- ...p ? ["first"] : [],
53
- ...m ? [] : ["previous"],
54
- ...j,
52
+ ), j = [
53
+ ...r ? ["first"] : [],
54
+ ...u ? [] : ["previous"],
55
+ ...L,
55
56
  // Start ellipsis
56
57
  // eslint-disable-next-line no-nested-ternary
57
- ...w > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
58
+ ...y > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
58
59
  // Sibling pages
59
- ...v(w, B),
60
+ ...C(y, B),
60
61
  // End ellipsis
61
62
  // eslint-disable-next-line no-nested-ternary
62
63
  ...B < s - a - 1 ? ["end-ellipsis"] : s - a > a ? [s - a] : [],
63
64
  ...P,
64
- ...c ? [] : ["next"],
65
- ...f ? ["last"] : []
66
- ], y = (n) => {
67
- switch (n) {
65
+ ...f ? [] : ["next"],
66
+ ...x ? ["last"] : []
67
+ ], w = (t) => {
68
+ switch (t) {
68
69
  case "first":
69
70
  return 1;
70
71
  case "previous":
71
- return r - 1;
72
+ return i - 1;
72
73
  case "next":
73
- return r + 1;
74
+ return i + 1;
74
75
  case "last":
75
76
  return s;
76
77
  default:
77
78
  return null;
78
79
  }
79
- }, D = L.map((n) => typeof n == "number" ? {
80
- onClick: (l) => {
81
- N(l, n);
80
+ }, D = j.map((t) => typeof t == "number" ? {
81
+ onClick: (c) => {
82
+ N(c, t);
82
83
  },
83
84
  type: "page",
84
- page: n,
85
- selected: n === r,
86
- disabled: h,
87
- "aria-current": n === r ? "true" : void 0
85
+ page: t,
86
+ selected: t === i,
87
+ disabled: _,
88
+ "aria-current": t === i ? "true" : void 0
88
89
  } : {
89
- onClick: (l) => {
90
- N(l, y(n));
90
+ onClick: (c) => {
91
+ N(c, w(t));
91
92
  },
92
- type: n,
93
- page: y(n),
93
+ type: t,
94
+ page: w(t),
94
95
  selected: !1,
95
- disabled: h || n.indexOf("ellipsis") === -1 && (n === "next" || n === "last" ? r >= s : r <= 1)
96
+ disabled: _ || t.indexOf("ellipsis") === -1 && (t === "next" || t === "last" ? i >= s : i <= 1)
96
97
  });
97
- return S({
98
+ return E({
98
99
  items: D
99
- }, d);
100
+ }, b);
100
101
  }
101
- const R = "_pagination_9gf1w_1", g = {
102
- pagination: R,
103
- "per-page-container": "_per-page-container_9gf1w_8",
104
- "pages-navigator-container": "_pages-navigator-container_9gf1w_20",
105
- "pages-navigator-container__label": "_pages-navigator-container__label_9gf1w_31",
106
- "page-number__btn": "_page-number__btn_9gf1w_31",
107
- "pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-btn_9gf1w_44",
108
- "page-number__btn--selected": "_page-number__btn--selected_9gf1w_69"
109
- }, T = {
102
+ const W = "_pagination_n3y7g_1", l = {
103
+ pagination: W,
104
+ "per-page-container": "_per-page-container_n3y7g_8",
105
+ "per-page-container__select": "_per-page-container__select_n3y7g_17",
106
+ "pages-navigator-container": "_pages-navigator-container_n3y7g_22",
107
+ "pages-navigator-container__label": "_pages-navigator-container__label_n3y7g_37",
108
+ "page-number__btn": "_page-number__btn_n3y7g_37",
109
+ "pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-btn_n3y7g_50",
110
+ "page-number__btn--selected": "_page-number__btn--selected_n3y7g_75"
111
+ }, q = {
110
112
  pt: {
111
113
  showing: "Exibindo",
112
114
  of: "de",
@@ -121,90 +123,91 @@ const R = "_pagination_9gf1w_1", g = {
121
123
  previous: "Previous",
122
124
  next: "Next"
123
125
  }
124
- }, J = (e) => {
125
- const a = e.perPageOptions || [5, 10, 25, 50, 100], _ = Math.ceil(e.totalItems / e.perPage), s = e.currentPage <= 1, b = e.currentPage >= _, h = e.t || T[e.language || "en"], c = (t) => h[t], { items: m } = $({
126
- count: _,
126
+ }, U = ({ perPageOptions: g = [5, 10, 25, 50, 100], language: a = "en", ...e }) => {
127
+ const s = Math.ceil(e.totalItems / e.perPage), v = e.currentPage <= 1, _ = e.currentPage >= s, f = e.t || q[a], u = (n) => f[n], { items: h } = T({
128
+ count: s,
127
129
  hideNextButton: !0,
128
130
  hidePrevButton: !0,
129
131
  page: e.currentPage,
130
- onChange: (t, o) => e.onPageChange(o),
131
132
  siblingCount: 1,
132
- boundaryCount: 2
133
+ boundaryCount: 2,
134
+ onChange: (n, r) => e.onPageChange(r)
133
135
  });
134
- return /* @__PURE__ */ x("div", { className: C(g.pagination, e.className), "data-testid": e["data-testid"], children: [
135
- /* @__PURE__ */ i(
136
+ return /* @__PURE__ */ m("div", { className: p(l.pagination, e.className), "data-testid": e["data-testid"], children: [
137
+ /* @__PURE__ */ o(
136
138
  "div",
137
139
  {
138
- className: C(g["per-page-container"], e.classNamePerPage),
139
- "data-testid": e["data-testid__per-page"],
140
- children: a && /* @__PURE__ */ x(M, { children: [
141
- c`showing`,
142
- /* @__PURE__ */ i(
143
- "select",
140
+ className: p(l["per-page-container"], e.classNamePerPage),
141
+ "data-testid": e["data-testid-per-page"],
142
+ children: g && /* @__PURE__ */ m(M, { children: [
143
+ /* @__PURE__ */ o("span", { children: u`showing` }),
144
+ /* @__PURE__ */ o(
145
+ k,
144
146
  {
145
- value: e.perPage,
146
- name: "per-page-select",
147
- id: "per-page-select",
148
- onChange: (t) => e.onRowsPerPageChange(t.target.value),
149
- children: a.map((t) => {
150
- const o = typeof t == "number";
151
- return /* @__PURE__ */ i(
152
- "option",
147
+ className: l["per-page-container__select"],
148
+ value: String(e.perPage),
149
+ onChange: (n) => e.onRowsPerPageChange(Number(n)),
150
+ children: g == null ? void 0 : g.map((n) => {
151
+ const r = typeof n == "number";
152
+ return /* @__PURE__ */ o(
153
+ k.Option,
153
154
  {
154
- value: o ? t : t.value,
155
- children: o ? t : t.label
155
+ value: String(r ? n : n.value),
156
+ children: r ? n : n.label
156
157
  },
157
- `per-page__${o ? t : t.value}`
158
+ `per-page__${r ? n : n.value}`
158
159
  );
159
160
  })
160
161
  }
161
162
  ),
162
- c`of`,
163
- " ",
164
- /* @__PURE__ */ i("strong", { children: e.totalItems }),
165
- " ",
166
- c`results`
163
+ /* @__PURE__ */ m("span", { children: [
164
+ u`of`,
165
+ " ",
166
+ /* @__PURE__ */ o("strong", { children: e.totalItems }),
167
+ " ",
168
+ u`results`
169
+ ] })
167
170
  ] })
168
171
  }
169
172
  ),
170
- /* @__PURE__ */ x(
173
+ /* @__PURE__ */ m(
171
174
  "div",
172
175
  {
173
- className: C(g["pages-navigator-container"], e.classNamePagesNav),
174
- "data-testid": e["data-testid__per-page"],
176
+ className: p(l["pages-navigator-container"], e.classNamePagesNav),
177
+ "data-testid": e["data-testid-pages-nav"],
175
178
  children: [
176
- /* @__PURE__ */ i(
179
+ /* @__PURE__ */ o(
177
180
  "button",
178
181
  {
179
- className: g["pages-navigator-container__previous-next-btn"],
180
- disabled: s,
182
+ className: l["pages-navigator-container__previous-next-btn"],
183
+ disabled: v,
181
184
  onClick: () => e.onPageChange(e.currentPage - 1),
182
185
  type: "button",
183
- children: c`previous`
186
+ children: u`previous`
184
187
  },
185
188
  "page__previous"
186
189
  ),
187
- m.map(({ page: t, type: o, selected: p, ...f }, u) => {
188
- let d = /* @__PURE__ */ i(M, {});
189
- return o === "start-ellipsis" || o === "end-ellipsis" ? d = /* @__PURE__ */ i("span", { className: g["pages-navigator-container__label"], children: "..." }) : o === "page" ? d = /* @__PURE__ */ i(
190
+ /* @__PURE__ */ o("ul", { children: h.map(({ page: n, type: r, selected: x, ...d }, b) => {
191
+ let i = /* @__PURE__ */ o(M, {});
192
+ return r === "start-ellipsis" || r === "end-ellipsis" ? i = /* @__PURE__ */ o("span", { className: l["pages-navigator-container__label"], children: "..." }) : r === "page" ? i = /* @__PURE__ */ o(
190
193
  "button",
191
194
  {
192
- className: [g["page-number__btn"], p ? g["page-number__btn--selected"] : ""].join(" ").trim(),
193
- onClick: () => e.onPageChange(t || 0),
195
+ className: p(l["page-number__btn"], x && l["page-number__btn--selected"]),
196
+ onClick: () => e.onPageChange(n || 0),
194
197
  type: "button",
195
- children: t
198
+ children: n
196
199
  },
197
- `page__${u}`
198
- ) : d = /* @__PURE__ */ i("button", { type: "button", ...f, children: o }), /* @__PURE__ */ i("li", { children: d }, u);
199
- }),
200
- /* @__PURE__ */ i(
200
+ `page__${b}`
201
+ ) : i = /* @__PURE__ */ o("button", { type: "button", ...d, children: r }), /* @__PURE__ */ o("li", { children: i }, b);
202
+ }) }),
203
+ /* @__PURE__ */ o(
201
204
  "button",
202
205
  {
203
- className: g["pages-navigator-container__previous-next-btn"],
204
- disabled: b,
206
+ className: l["pages-navigator-container__previous-next-btn"],
207
+ disabled: _,
205
208
  onClick: () => e.onPageChange(e.currentPage + 1),
206
209
  type: "button",
207
- children: c`next`
210
+ children: u`next`
208
211
  },
209
212
  "page__next"
210
213
  )
@@ -214,6 +217,6 @@ const R = "_pagination_9gf1w_1", g = {
214
217
  ] });
215
218
  };
216
219
  export {
217
- J as Pagination,
218
- T as paginationDefaultTranslations
220
+ U as Pagination,
221
+ q as paginationDefaultTranslations
219
222
  };
@@ -0,0 +1,17 @@
1
+ import { PaginationProps } from '../../main';
2
+ import { StoryObj } from '@storybook/react';
3
+
4
+ declare const meta: {
5
+ title: string;
6
+ component: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
7
+ tags: string[];
8
+ parameters: {
9
+ layout: string;
10
+ };
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+ export declare const Simple: Story;
15
+ export declare const WithCustomPerPageOptions: Story;
16
+ export declare const WithLanguage: Story;
17
+ export declare const WithCustomTexts: Story;