@pismo/marola 0.0.1-alpha.17 → 0.0.1-alpha.19

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 (69) hide show
  1. package/dist/{Button-CSuug0jG.js → Button-2b1peDFT.js} +25 -26
  2. package/dist/{ClickAwayListener-hSFuUJnv.js → ClickAwayListener-BSW-Nd-y.js} +3 -3
  3. package/dist/{Popup-DwaWJ3ye.js → Popup-B6ZSGIEI.js} +12 -13
  4. package/dist/{Portal-CGBQMhI6.js → Portal-DIeBsWdL.js} +2 -2
  5. package/dist/{SelectButton-DWZ2BRaX.js → SelectButton-pciwIWcj.js} +24 -22
  6. package/dist/assets/Pagination.css +1 -1
  7. package/dist/assets/SelectButton.css +1 -1
  8. package/dist/assets/TextDisplay.css +1 -0
  9. package/dist/{combineHooksSlotProps-D8j4htsd.js → combineHooksSlotProps-DVjg9PRh.js} +18 -19
  10. package/dist/components/Button/Button.js +1 -1
  11. package/dist/components/Checkbox/Checkbox.d.ts +15 -0
  12. package/dist/components/Checkbox/Checkbox.stories.d.ts +31 -0
  13. package/dist/components/Chip/Chip.js +1 -1
  14. package/dist/components/Dialog/CloseIconButton.js +1 -1
  15. package/dist/components/Dialog/Dialog.js +15 -16
  16. package/dist/components/Dialog/Dialog.stories.d.ts +3 -3
  17. package/dist/components/Icon/Icon.d.ts +10 -1
  18. package/dist/components/Icon/Icon.js +39 -25
  19. package/dist/components/Icon/Icon.stories.d.ts +16 -0
  20. package/dist/components/IconButton/Icon.stories.d.ts +15 -0
  21. package/dist/components/IconButton/IconButton.d.ts +14 -0
  22. package/dist/components/IconButton/IconButton.js +1 -1
  23. package/dist/components/Input/Input.js +25 -26
  24. package/dist/components/Pagination/Pagination.d.ts +24 -5
  25. package/dist/components/Pagination/Pagination.js +119 -116
  26. package/dist/components/Pagination/Pagination.stories.d.ts +17 -0
  27. package/dist/components/Select/Select.js +138 -139
  28. package/dist/components/Select/SelectButton.js +1 -1
  29. package/dist/components/Skeleton/Skeleton.d.ts +10 -3
  30. package/dist/components/Skeleton/Skeleton.js +12 -15
  31. package/dist/components/Skeleton/Skeleton.stories.d.ts +14 -0
  32. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +14 -0
  33. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +16 -0
  34. package/dist/components/Snackbar/Snackbar.js +6 -7
  35. package/dist/components/Snackbar/Snackbar.stories.d.ts +3 -3
  36. package/dist/components/SortTooltip/SortTooltip.d.ts +3 -1
  37. package/dist/components/SortTooltip/SortTooltip.js +27 -16
  38. package/dist/components/Stepper/Stepper.d.ts +11 -1
  39. package/dist/components/Stepper/Stepper.stories.d.ts +16 -0
  40. package/dist/components/Table/Table.js +38 -40
  41. package/dist/components/Tabs/Tab.d.ts +5 -0
  42. package/dist/components/Tabs/Tab.js +9 -10
  43. package/dist/components/Tabs/Tab.stories.d.ts +15 -0
  44. package/dist/components/Tabs/TabPanel.d.ts +4 -0
  45. package/dist/components/Tabs/TabPanel.js +13 -14
  46. package/dist/components/Tabs/TabPanel.stories.d.ts +14 -0
  47. package/dist/components/Tabs/Tabs.d.ts +5 -1
  48. package/dist/components/Tabs/Tabs.js +36 -37
  49. package/dist/components/Tabs/Tabs.stories.d.ts +14 -0
  50. package/dist/components/TextDisplay/TextDisplay.d.ts +23 -0
  51. package/dist/components/TextDisplay/TextDisplay.js +37 -0
  52. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +13 -0
  53. package/dist/components/TextDisplay/textDisplay.test.d.ts +1 -0
  54. package/dist/components/Toggle/Toggle.js +7 -8
  55. package/dist/components/Tooltip/Tooltip.d.ts +18 -6
  56. package/dist/components/Tooltip/Tooltip.js +104 -92
  57. package/dist/components/Tooltip/Tooltip.stories.d.ts +33 -0
  58. package/dist/components/Typography/Typography.d.ts +2 -0
  59. package/dist/components/Typography/Typography.js +40 -29
  60. package/dist/components/Typography/Typography.stories.d.ts +1 -0
  61. package/dist/{index-CtPvew6C.js → index-CH45lKw7.js} +310 -287
  62. package/dist/{index-BfeM9yWx.js → index-CjW42-M-.js} +5 -6
  63. package/dist/main.d.ts +1 -0
  64. package/dist/main.js +28 -26
  65. package/dist/{useButton-DSAvAfH_.js → useButton-DNk3wrQp.js} +3 -4
  66. package/dist/{useEventCallback-lXNMsMLa.js → useEventCallback-xTG9piMa.js} +1 -1
  67. package/dist/{useList-C5PBIv2I.js → useList-B0hog_3-.js} +48 -49
  68. package/package.json +1 -1
  69. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +0 -26
@@ -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;