@pismo/marola 0.0.1-alpha.1 → 0.0.1-alpha.11

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 (124) hide show
  1. package/README.md +17 -5
  2. package/dist/Button-B1umG8kJ.js +131 -0
  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/Tab-CRwnhsj5.js +254 -0
  7. package/dist/Tabs.module-yYcTJnj6.js +103 -0
  8. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  9. package/dist/assets/Advice.css +1 -0
  10. package/dist/assets/Button.css +1 -0
  11. package/dist/assets/Checkbox.css +1 -0
  12. package/dist/assets/Dialog.css +1 -1
  13. package/dist/assets/IconButton.css +1 -0
  14. package/dist/assets/Input.css +1 -0
  15. package/dist/assets/InputSearch.css +1 -0
  16. package/dist/assets/LoadingSpinner.css +1 -1
  17. package/dist/assets/PageHeader.css +1 -0
  18. package/dist/assets/Pagination.css +1 -0
  19. package/dist/assets/Skeleton.css +1 -0
  20. package/dist/assets/Snackbar.css +1 -0
  21. package/dist/assets/SortTooltip.css +1 -0
  22. package/dist/assets/Stepper.css +1 -0
  23. package/dist/assets/Table.css +1 -0
  24. package/dist/assets/Tabs.css +1 -0
  25. package/dist/assets/Toggle.css +1 -0
  26. package/dist/assets/Tooltip.css +1 -0
  27. package/dist/assets/Typography.css +1 -1
  28. package/dist/assets/global.css +1 -0
  29. package/dist/components/Advice/Advice.d.ts +16 -0
  30. package/dist/components/Advice/Advice.js +25 -0
  31. package/dist/components/Button/Button.d.ts +29 -0
  32. package/dist/components/Button/Button.js +70 -0
  33. package/dist/components/Button/Button.stories.d.ts +60 -0
  34. package/dist/components/Button/Button.stories.js +40 -0
  35. package/dist/components/Checkbox/Checkbox.d.ts +19 -0
  36. package/dist/components/Checkbox/Checkbox.js +56 -0
  37. package/dist/components/Dialog/Actions.js +1 -1
  38. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  39. package/dist/components/Dialog/Backdrop.js +2 -9
  40. package/dist/components/Dialog/CloseIconButton.js +11 -10
  41. package/dist/components/Dialog/Dialog.d.ts +5 -4
  42. package/dist/components/Dialog/Dialog.js +419 -20077
  43. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  44. package/dist/components/Dialog/Dialog.stories.js +59 -0
  45. package/dist/components/Dialog/Title.js +22 -7
  46. package/dist/components/Icon/Icon.d.ts +18 -0
  47. package/dist/components/Icon/Icon.js +95 -0
  48. package/dist/components/IconButton/IconButton.d.ts +22 -0
  49. package/dist/components/IconButton/IconButton.js +68 -0
  50. package/dist/components/Input/Input.d.ts +44 -0
  51. package/dist/components/Input/Input.js +497 -0
  52. package/dist/components/Input/Input.stories.d.ts +43 -0
  53. package/dist/components/Input/Input.stories.js +106 -0
  54. package/dist/components/InputSearch/InputSearch.d.ts +11 -0
  55. package/dist/components/InputSearch/InputSearch.js +29 -0
  56. package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
  57. package/dist/components/InputSearch/InputSearch.stories.js +36 -0
  58. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  59. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  60. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  61. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
  62. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  63. package/dist/components/PageHeader/PageHeader.js +51 -0
  64. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  65. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  66. package/dist/components/Pagination/Pagination.d.ts +36 -0
  67. package/dist/components/Pagination/Pagination.js +219 -0
  68. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  69. package/dist/components/Skeleton/Skeleton.js +26 -0
  70. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  71. package/dist/components/Snackbar/Snackbar.js +622 -0
  72. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  73. package/dist/components/SortTooltip/SortTooltip.js +67 -0
  74. package/dist/components/Stepper/Stepper.d.ts +16 -0
  75. package/dist/components/Stepper/Stepper.js +33 -0
  76. package/dist/components/Table/Table.d.ts +39 -0
  77. package/dist/components/Table/Table.js +122 -0
  78. package/dist/components/Table/TableContext.d.ts +19 -0
  79. package/dist/components/Table/TableContext.js +21 -0
  80. package/dist/components/Tabs/Tab.d.ts +9 -0
  81. package/dist/components/Tabs/Tab.js +8 -0
  82. package/dist/components/Tabs/TabPanel.d.ts +8 -0
  83. package/dist/components/Tabs/TabPanel.js +118 -0
  84. package/dist/components/Tabs/Tabs.d.ts +11 -0
  85. package/dist/components/Tabs/Tabs.js +827 -0
  86. package/dist/components/Toggle/Toggle.d.ts +11 -0
  87. package/dist/components/Toggle/Toggle.js +252 -0
  88. package/dist/components/Toggle/Toggle.stories.d.ts +21 -0
  89. package/dist/components/Toggle/Toggle.stories.js +33 -0
  90. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  91. package/dist/components/Tooltip/Tooltip.js +1366 -0
  92. package/dist/components/Typography/Typography.d.ts +15 -6
  93. package/dist/components/Typography/Typography.js +75 -67
  94. package/dist/components/Typography/Typography.stories.d.ts +31 -0
  95. package/dist/components/Typography/Typography.stories.js +30 -0
  96. package/dist/components/Typography/typography.test.d.ts +1 -0
  97. package/dist/components/Typography/typography.test.js +11357 -0
  98. package/dist/index-BNWbc5Kh.js +19628 -0
  99. package/dist/index-CqjC7P5Y.js +814 -0
  100. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  101. package/dist/main.d.ts +18 -2
  102. package/dist/main.js +57 -15
  103. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  104. package/dist/test-utils/assertStyles.d.ts +1 -0
  105. package/dist/test-utils/assertStyles.js +11 -0
  106. package/dist/types/helpers.d.ts +14 -7
  107. package/dist/useButton-Bc8IAgyk.js +106 -0
  108. package/dist/useControlled-CCMYYdCM.js +31 -0
  109. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  110. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  111. package/dist/useTimeout-DxF9kiZL.js +36 -0
  112. package/dist/utils/styleStrings.d.ts +6 -0
  113. package/dist/utils/styleStrings.js +10 -0
  114. package/dist/utils/styleStrings.test.d.ts +1 -0
  115. package/dist/utils/styleStrings.test.js +41 -0
  116. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  117. package/package.json +53 -10
  118. package/dist/Button-REznN-RP.js +0 -1139
  119. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  120. package/dist/assets/CallToActionButton.css +0 -1
  121. package/dist/assets/main.css +0 -1
  122. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -23
  123. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  124. package/src/playground/Playground.tsx +0 -58
@@ -0,0 +1,219 @@
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 = {}) {
8
+ const {
9
+ boundaryCount: a = 1,
10
+ componentName: _ = "usePagination",
11
+ 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: _,
25
+ state: "page"
26
+ }), N = (n, l) => {
27
+ o || k(l), t && t(n, l);
28
+ }, v = (n, l) => {
29
+ const F = l - n + 1;
30
+ return Array.from({
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
+ Math.min(
35
+ // Natural start
36
+ r - u,
37
+ // Lower boundary when page is high
38
+ s - a - u * 2 - 1
39
+ ),
40
+ // Greater than startPages
41
+ a + 2
42
+ ), B = Math.min(
43
+ Math.max(
44
+ // Natural end
45
+ r + u,
46
+ // Upper boundary when page is low
47
+ a + u * 2 + 2
48
+ ),
49
+ // Less than endPages
50
+ P.length > 0 ? P[0] - 2 : s - 1
51
+ ), L = [
52
+ ...p ? ["first"] : [],
53
+ ...m ? [] : ["previous"],
54
+ ...j,
55
+ // Start ellipsis
56
+ // eslint-disable-next-line no-nested-ternary
57
+ ...w > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
58
+ // Sibling pages
59
+ ...v(w, B),
60
+ // End ellipsis
61
+ // eslint-disable-next-line no-nested-ternary
62
+ ...B < s - a - 1 ? ["end-ellipsis"] : s - a > a ? [s - a] : [],
63
+ ...P,
64
+ ...c ? [] : ["next"],
65
+ ...f ? ["last"] : []
66
+ ], y = (n) => {
67
+ switch (n) {
68
+ case "first":
69
+ return 1;
70
+ case "previous":
71
+ return r - 1;
72
+ case "next":
73
+ return r + 1;
74
+ case "last":
75
+ return s;
76
+ default:
77
+ return null;
78
+ }
79
+ }, D = L.map((n) => typeof n == "number" ? {
80
+ onClick: (l) => {
81
+ N(l, n);
82
+ },
83
+ type: "page",
84
+ page: n,
85
+ selected: n === r,
86
+ disabled: h,
87
+ "aria-current": n === r ? "true" : void 0
88
+ } : {
89
+ onClick: (l) => {
90
+ N(l, y(n));
91
+ },
92
+ type: n,
93
+ page: y(n),
94
+ selected: !1,
95
+ disabled: h || n.indexOf("ellipsis") === -1 && (n === "next" || n === "last" ? r >= s : r <= 1)
96
+ });
97
+ return S({
98
+ items: D
99
+ }, d);
100
+ }
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 = {
110
+ pt: {
111
+ showing: "Exibindo",
112
+ of: "de",
113
+ results: "resultados",
114
+ previous: "Anterior",
115
+ next: "Próximo"
116
+ },
117
+ en: {
118
+ showing: "Showing",
119
+ of: "of",
120
+ results: "results",
121
+ previous: "Previous",
122
+ next: "Next"
123
+ }
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: _,
127
+ hideNextButton: !0,
128
+ hidePrevButton: !0,
129
+ page: e.currentPage,
130
+ onChange: (t, o) => e.onPageChange(o),
131
+ siblingCount: 1,
132
+ boundaryCount: 2
133
+ });
134
+ return /* @__PURE__ */ x("div", { className: C(g.pagination, e.className), "data-testid": e["data-testid"], children: [
135
+ /* @__PURE__ */ i(
136
+ "div",
137
+ {
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",
144
+ {
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",
153
+ {
154
+ value: o ? t : t.value,
155
+ children: o ? t : t.label
156
+ },
157
+ `per-page__${o ? t : t.value}`
158
+ );
159
+ })
160
+ }
161
+ ),
162
+ c`of`,
163
+ " ",
164
+ /* @__PURE__ */ i("strong", { children: e.totalItems }),
165
+ " ",
166
+ c`results`
167
+ ] })
168
+ }
169
+ ),
170
+ /* @__PURE__ */ x(
171
+ "div",
172
+ {
173
+ className: C(g["pages-navigator-container"], e.classNamePagesNav),
174
+ "data-testid": e["data-testid__per-page"],
175
+ children: [
176
+ /* @__PURE__ */ i(
177
+ "button",
178
+ {
179
+ className: g["pages-navigator-container__previous-next-btn"],
180
+ disabled: s,
181
+ onClick: () => e.onPageChange(e.currentPage - 1),
182
+ type: "button",
183
+ children: c`previous`
184
+ },
185
+ "page__previous"
186
+ ),
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
+ "button",
191
+ {
192
+ className: [g["page-number__btn"], p ? g["page-number__btn--selected"] : ""].join(" ").trim(),
193
+ onClick: () => e.onPageChange(t || 0),
194
+ type: "button",
195
+ children: t
196
+ },
197
+ `page__${u}`
198
+ ) : d = /* @__PURE__ */ i("button", { type: "button", ...f, children: o }), /* @__PURE__ */ i("li", { children: d }, u);
199
+ }),
200
+ /* @__PURE__ */ i(
201
+ "button",
202
+ {
203
+ className: g["pages-navigator-container__previous-next-btn"],
204
+ disabled: b,
205
+ onClick: () => e.onPageChange(e.currentPage + 1),
206
+ type: "button",
207
+ children: c`next`
208
+ },
209
+ "page__next"
210
+ )
211
+ ]
212
+ }
213
+ )
214
+ ] });
215
+ };
216
+ export {
217
+ J as Pagination,
218
+ T as paginationDefaultTranslations
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;
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 {};