@pismo/marola 0.0.1-alpha.5 → 0.0.1-alpha.7

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 (108) hide show
  1. package/README.md +13 -2
  2. package/dist/{Button-D--uN90N.js → Button-B1umG8kJ.js} +3 -3
  3. package/dist/ClickAwayListener-BKznXF1d.js +106 -0
  4. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  5. package/dist/Portal-BcdMtRGF.js +73 -0
  6. package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
  7. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  8. package/dist/assets/Advice.css +1 -0
  9. package/dist/assets/Button.css +1 -1
  10. package/dist/assets/Checkbox.css +1 -0
  11. package/dist/assets/Dialog.css +1 -1
  12. package/dist/assets/IconButton.css +1 -1
  13. package/dist/assets/Input.css +1 -0
  14. package/dist/assets/Pagination.css +1 -1
  15. package/dist/assets/Skeleton.css +1 -0
  16. package/dist/assets/Snackbar.css +1 -0
  17. package/dist/assets/SortTooltip.css +1 -0
  18. package/dist/assets/Stepper.css +1 -0
  19. package/dist/assets/Table.css +1 -0
  20. package/dist/assets/Tabs.css +1 -1
  21. package/dist/assets/Toggle.css +1 -0
  22. package/dist/assets/Tooltip.css +1 -0
  23. package/dist/assets/Typography.css +1 -1
  24. package/dist/assets/{main.css → global.css} +1 -1
  25. package/dist/components/Advice/Advice.d.ts +16 -0
  26. package/dist/components/Advice/Advice.js +25 -0
  27. package/dist/components/Button/Button.d.ts +9 -1
  28. package/dist/components/Button/Button.js +54 -38
  29. package/dist/components/Button/Button.stories.d.ts +60 -0
  30. package/dist/components/Button/Button.stories.js +40 -0
  31. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  32. package/dist/components/Checkbox/Checkbox.js +48 -0
  33. package/dist/components/Dialog/Actions.js +1 -1
  34. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  35. package/dist/components/Dialog/Backdrop.js +1 -1
  36. package/dist/components/Dialog/CloseIconButton.js +12 -124
  37. package/dist/components/Dialog/Dialog.d.ts +3 -2
  38. package/dist/components/Dialog/Dialog.js +418 -20072
  39. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  40. package/dist/components/Dialog/Dialog.stories.js +59 -0
  41. package/dist/components/Dialog/Title.js +1 -1
  42. package/dist/components/Icon/Icon.d.ts +18 -0
  43. package/dist/components/Icon/Icon.js +95 -0
  44. package/dist/components/IconButton/IconButton.d.ts +3 -3
  45. package/dist/components/IconButton/IconButton.js +54 -65
  46. package/dist/components/Input/Input.d.ts +44 -0
  47. package/dist/components/Input/Input.js +497 -0
  48. package/dist/components/Input/Input.stories.d.ts +43 -0
  49. package/dist/components/Input/Input.stories.js +106 -0
  50. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  51. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  52. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
  53. package/dist/components/PageHeader/PageHeader.d.ts +25 -15
  54. package/dist/components/PageHeader/PageHeader.js +32 -50
  55. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  56. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  57. package/dist/components/Pagination/Pagination.d.ts +1 -1
  58. package/dist/components/Pagination/Pagination.js +47 -47
  59. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  60. package/dist/components/Skeleton/Skeleton.js +26 -0
  61. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  62. package/dist/components/Snackbar/Snackbar.js +622 -0
  63. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  64. package/dist/components/SortTooltip/SortTooltip.js +67 -1
  65. package/dist/components/Stepper/Stepper.d.ts +16 -0
  66. package/dist/components/Stepper/Stepper.js +33 -0
  67. package/dist/components/Table/Table.d.ts +39 -0
  68. package/dist/components/Table/Table.js +122 -1
  69. package/dist/components/Table/TableContext.d.ts +19 -0
  70. package/dist/components/Table/TableContext.js +21 -1
  71. package/dist/components/Tabs/Tab.d.ts +1 -1
  72. package/dist/components/Tabs/Tab.js +5 -5
  73. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  74. package/dist/components/Tabs/TabPanel.js +4 -4
  75. package/dist/components/Tabs/Tabs.d.ts +1 -1
  76. package/dist/components/Tabs/Tabs.js +3 -3
  77. package/dist/components/Toggle/Toggle.d.ts +14 -0
  78. package/dist/components/Toggle/Toggle.js +256 -0
  79. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  80. package/dist/components/Tooltip/Tooltip.js +1366 -1
  81. package/dist/components/Typography/Typography.d.ts +14 -5
  82. package/dist/components/Typography/Typography.js +76 -59
  83. package/dist/components/Typography/Typography.stories.d.ts +31 -0
  84. package/dist/components/Typography/Typography.stories.js +30 -0
  85. package/dist/components/Typography/typography.test.d.ts +1 -0
  86. package/dist/components/Typography/typography.test.js +11357 -0
  87. package/dist/index-BNWbc5Kh.js +19628 -0
  88. package/dist/{index-BvA1HyDs.js → index-CqjC7P5Y.js} +91 -95
  89. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  90. package/dist/main.d.ts +16 -7
  91. package/dist/main.js +50 -28
  92. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  93. package/dist/test-utils/assertStyles.d.ts +1 -0
  94. package/dist/test-utils/assertStyles.js +11 -0
  95. package/dist/types/helpers.d.ts +8 -0
  96. package/dist/useButton-Bc8IAgyk.js +106 -0
  97. package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
  98. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  99. package/dist/useTimeout-DxF9kiZL.js +36 -0
  100. package/dist/utils/styleStrings.d.ts +6 -0
  101. package/dist/utils/styleStrings.js +10 -0
  102. package/dist/utils/styleStrings.test.d.ts +1 -0
  103. package/dist/utils/styleStrings.test.js +41 -0
  104. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  105. package/package.json +30 -9
  106. package/dist/Dialog.module-BKWFakxu.js +0 -15
  107. package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
  108. package/dist/useButton-abQpo0za.js +0 -187
@@ -1,8 +1,8 @@
1
1
  import '../../assets/Pagination.css';
2
- import { jsxs as P, jsx as i, Fragment as M } from "react/jsx-runtime";
2
+ import { jsxs as x, jsx as i, Fragment as M } from "react/jsx-runtime";
3
3
  import { c as C } from "../../clsx-DB4S2d7J.js";
4
- import { _ as S, a as A } from "../../objectWithoutPropertiesLoose-ClNcje2_.js";
5
- import { u as D } from "../../useControlled-CCMYYdCM.js";
4
+ import { _ as O, a as S } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
5
+ import { u as A } from "../../useControlled-CCMYYdCM.js";
6
6
  const E = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
7
7
  function $(e = {}) {
8
8
  const {
@@ -11,14 +11,14 @@ function $(e = {}) {
11
11
  count: s = 1,
12
12
  defaultPage: b = 1,
13
13
  disabled: h = !1,
14
- hideNextButton: g = !1,
14
+ hideNextButton: c = !1,
15
15
  hidePrevButton: m = !1,
16
16
  onChange: t,
17
17
  page: o,
18
18
  showFirstButton: p = !1,
19
- showLastButton: x = !1,
19
+ showLastButton: f = !1,
20
20
  siblingCount: u = 1
21
- } = e, d = S(e, E), [r, k] = D({
21
+ } = e, d = O(e, E), [r, k] = A({
22
22
  controlled: o,
23
23
  default: b,
24
24
  name: _,
@@ -26,11 +26,11 @@ function $(e = {}) {
26
26
  }), N = (n, l) => {
27
27
  o || k(l), t && t(n, l);
28
28
  }, v = (n, l) => {
29
- const I = l - n + 1;
29
+ const F = l - n + 1;
30
30
  return Array.from({
31
- length: I
32
- }, (W, O) => n + O);
33
- }, j = v(1, Math.min(a, s)), f = v(Math.max(s - a + 1, a + 1), s), y = Math.max(
31
+ 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(
34
34
  Math.min(
35
35
  // Natural start
36
36
  r - u,
@@ -47,23 +47,23 @@ function $(e = {}) {
47
47
  a + u * 2 + 2
48
48
  ),
49
49
  // Less than endPages
50
- f.length > 0 ? f[0] - 2 : s - 1
50
+ P.length > 0 ? P[0] - 2 : s - 1
51
51
  ), L = [
52
52
  ...p ? ["first"] : [],
53
53
  ...m ? [] : ["previous"],
54
54
  ...j,
55
55
  // Start ellipsis
56
56
  // eslint-disable-next-line no-nested-ternary
57
- ...y > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
57
+ ...w > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
58
58
  // Sibling pages
59
- ...v(y, B),
59
+ ...v(w, B),
60
60
  // End ellipsis
61
61
  // eslint-disable-next-line no-nested-ternary
62
62
  ...B < s - a - 1 ? ["end-ellipsis"] : s - a > a ? [s - a] : [],
63
- ...f,
64
- ...g ? [] : ["next"],
65
- ...x ? ["last"] : []
66
- ], w = (n) => {
63
+ ...P,
64
+ ...c ? [] : ["next"],
65
+ ...f ? ["last"] : []
66
+ ], y = (n) => {
67
67
  switch (n) {
68
68
  case "first":
69
69
  return 1;
@@ -76,7 +76,7 @@ function $(e = {}) {
76
76
  default:
77
77
  return null;
78
78
  }
79
- }, F = L.map((n) => typeof n == "number" ? {
79
+ }, D = L.map((n) => typeof n == "number" ? {
80
80
  onClick: (l) => {
81
81
  N(l, n);
82
82
  },
@@ -87,25 +87,25 @@ function $(e = {}) {
87
87
  "aria-current": n === r ? "true" : void 0
88
88
  } : {
89
89
  onClick: (l) => {
90
- N(l, w(n));
90
+ N(l, y(n));
91
91
  },
92
92
  type: n,
93
- page: w(n),
93
+ page: y(n),
94
94
  selected: !1,
95
95
  disabled: h || n.indexOf("ellipsis") === -1 && (n === "next" || n === "last" ? r >= s : r <= 1)
96
96
  });
97
- return A({
98
- items: F
97
+ return S({
98
+ items: D
99
99
  }, d);
100
100
  }
101
- const R = "_pagination_1exye_1", c = {
101
+ const R = "_pagination_9gf1w_1", g = {
102
102
  pagination: R,
103
- "per-page-container": "_per-page-container_1exye_8",
104
- "pages-navigator-container": "_pages-navigator-container_1exye_20",
105
- "pages-navigator-container__label": "_pages-navigator-container__label_1exye_31",
106
- "page-number__btn": "_page-number__btn_1exye_31",
107
- "pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-btn_1exye_44",
108
- "page-number__btn--selected": "_page-number__btn--selected_1exye_69"
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
109
  }, T = {
110
110
  pt: {
111
111
  showing: "Exibindo",
@@ -122,7 +122,7 @@ const R = "_pagination_1exye_1", c = {
122
122
  next: "Next"
123
123
  }
124
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"], g = (t) => h[t], { items: m } = $({
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
126
  count: _,
127
127
  hideNextButton: !0,
128
128
  hidePrevButton: !0,
@@ -131,14 +131,14 @@ const R = "_pagination_1exye_1", c = {
131
131
  siblingCount: 1,
132
132
  boundaryCount: 2
133
133
  });
134
- return /* @__PURE__ */ P("div", { className: C(c.pagination, e.className), "data-testid": e["data-testid"], children: [
134
+ return /* @__PURE__ */ x("div", { className: C(g.pagination, e.className), "data-testid": e["data-testid"], children: [
135
135
  /* @__PURE__ */ i(
136
136
  "div",
137
137
  {
138
- className: C(c["per-page-container"], e.classNamePerPage),
138
+ className: C(g["per-page-container"], e.classNamePerPage),
139
139
  "data-testid": e["data-testid__per-page"],
140
- children: a && /* @__PURE__ */ P(M, { children: [
141
- g`showing`,
140
+ children: a && /* @__PURE__ */ x(M, { children: [
141
+ c`showing`,
142
142
  /* @__PURE__ */ i(
143
143
  "select",
144
144
  {
@@ -159,52 +159,52 @@ const R = "_pagination_1exye_1", c = {
159
159
  })
160
160
  }
161
161
  ),
162
- g`of`,
162
+ c`of`,
163
163
  " ",
164
164
  /* @__PURE__ */ i("strong", { children: e.totalItems }),
165
165
  " ",
166
- g`results`
166
+ c`results`
167
167
  ] })
168
168
  }
169
169
  ),
170
- /* @__PURE__ */ P(
170
+ /* @__PURE__ */ x(
171
171
  "div",
172
172
  {
173
- className: C(c["pages-navigator-container"], e.classNamePagesNav),
173
+ className: C(g["pages-navigator-container"], e.classNamePagesNav),
174
174
  "data-testid": e["data-testid__per-page"],
175
175
  children: [
176
176
  /* @__PURE__ */ i(
177
177
  "button",
178
178
  {
179
- className: c["pages-navigator-container__previous-next-btn"],
179
+ className: g["pages-navigator-container__previous-next-btn"],
180
180
  disabled: s,
181
181
  onClick: () => e.onPageChange(e.currentPage - 1),
182
182
  type: "button",
183
- children: g`previous`
183
+ children: c`previous`
184
184
  },
185
185
  "page__previous"
186
186
  ),
187
- m.map(({ page: t, type: o, selected: p, ...x }, u) => {
187
+ m.map(({ page: t, type: o, selected: p, ...f }, u) => {
188
188
  let d = /* @__PURE__ */ i(M, {});
189
- return o === "start-ellipsis" || o === "end-ellipsis" ? d = /* @__PURE__ */ i("span", { className: c["pages-navigator-container__label"], children: "..." }) : o === "page" ? d = /* @__PURE__ */ i(
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
190
  "button",
191
191
  {
192
- className: [c["page-number__btn"], p ? c["page-number__btn--selected"] : ""].join(" ").trim(),
192
+ className: [g["page-number__btn"], p ? g["page-number__btn--selected"] : ""].join(" ").trim(),
193
193
  onClick: () => e.onPageChange(t || 0),
194
194
  type: "button",
195
195
  children: t
196
196
  },
197
197
  `page__${u}`
198
- ) : d = /* @__PURE__ */ i("button", { type: "button", ...x, children: o }), /* @__PURE__ */ i("li", { children: d }, u);
198
+ ) : d = /* @__PURE__ */ i("button", { type: "button", ...f, children: o }), /* @__PURE__ */ i("li", { children: d }, u);
199
199
  }),
200
200
  /* @__PURE__ */ i(
201
201
  "button",
202
202
  {
203
- className: c["pages-navigator-container__previous-next-btn"],
203
+ className: g["pages-navigator-container__previous-next-btn"],
204
204
  disabled: b,
205
205
  onClick: () => e.onPageChange(e.currentPage + 1),
206
206
  type: "button",
207
- children: g`next`
207
+ children: c`next`
208
208
  },
209
209
  "page__next"
210
210
  )
@@ -215,5 +215,5 @@ const R = "_pagination_1exye_1", c = {
215
215
  };
216
216
  export {
217
217
  J as Pagination,
218
- T as defaultTranslations
218
+ T as paginationDefaultTranslations
219
219
  };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ type SkeletonProps = {
3
+ style?: React.CSSProperties | undefined;
4
+ className?: string;
5
+ 'data-testid'?: string;
6
+ };
7
+ declare const Skeleton: (props: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
8
+ type SkeletonCircleProps = SkeletonProps & {
9
+ size?: string | number;
10
+ };
11
+ declare const SkeletonCircle: ({ size, ...props }: SkeletonCircleProps) => import("react/jsx-runtime").JSX.Element;
12
+ type SkeletonTableProps = SkeletonProps & {
13
+ columns?: number;
14
+ rows?: number;
15
+ autoWidth?: boolean;
16
+ };
17
+ declare const SkeletonTable: ({ columns, rows, autoWidth, ...props }: SkeletonTableProps) => import("react/jsx-runtime").JSX.Element;
18
+ export { Skeleton, SkeletonCircle, SkeletonTable };
@@ -0,0 +1,26 @@
1
+ import '../../assets/Skeleton.css';
2
+ import { jsx as l, jsxs as w } from "react/jsx-runtime";
3
+ import { c as a } from "../../clsx-DB4S2d7J.js";
4
+ const N = "_skeleton_1lho5_1", p = "_skeletonLoading_1lho5_1", s = {
5
+ skeleton: N,
6
+ "skeleton--table-type": "_skeleton--table-type_1lho5_1",
7
+ skeletonLoading: p,
8
+ "skeleton--circle-type": "_skeleton--circle-type_1lho5_15"
9
+ }, i = (e) => {
10
+ const t = a(s.skeleton, s["skeleton--normal-type"], e.className);
11
+ return /* @__PURE__ */ l("div", { style: {}, ...e, className: t });
12
+ }, C = ({ size: e = "4rem", ...t }) => {
13
+ const n = a(s.skeleton, s["skeleton--circle-type"], t.className);
14
+ return /* @__PURE__ */ l("div", { ...t, style: { width: e, height: e }, className: n });
15
+ }, h = (e = 30) => `${Math.floor(Math.random() * (100 - e + 1) + e)}%`, $ = ({ columns: e = 5, rows: t = 5, autoWidth: n = !0, ...r }) => {
16
+ const k = a(s.skeleton, s["skeleton--table-type"], r.className), c = `${100 / e}%`, d = /* @__PURE__ */ l("tr", { children: new Array(e).fill(null).map((y, o) => /* @__PURE__ */ l("th", { style: { width: c }, children: /* @__PURE__ */ l(i, { style: { width: n ? h(50) : "100%" } }) }, `row-columns-${o}`)) }), m = new Array(t).fill(null).map((y, o) => /* @__PURE__ */ l("tr", { children: new Array(e).fill(null).map((b, _) => /* @__PURE__ */ l("td", { style: { width: c }, children: /* @__PURE__ */ l(i, { style: { width: n ? h() : "100%" } }) }, `row-${o}-cell-${_}`)) }, `row-${o}`));
17
+ return /* @__PURE__ */ w("table", { ...r, className: k, children: [
18
+ /* @__PURE__ */ l("thead", { children: d }),
19
+ /* @__PURE__ */ l("tbody", { children: m })
20
+ ] });
21
+ };
22
+ export {
23
+ i as Skeleton,
24
+ C as SkeletonCircle,
25
+ $ as SkeletonTable
26
+ };
@@ -0,0 +1,13 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+
3
+ type SnackbarProps = InputHTMLAttributes<HTMLInputElement> & {
4
+ open?: boolean;
5
+ 'data-testid'?: string;
6
+ classNameWrapper?: string;
7
+ color?: 'success' | 'error' | 'attention';
8
+ snackbarMessage: string;
9
+ autoHideDuration?: number | 5000;
10
+ onClose?: () => void;
11
+ };
12
+ export declare const Snackbar: ({ snackbarMessage, color, autoHideDuration, open, onClose, classNameWrapper, "data-testid": dataTestId, }: SnackbarProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};