@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.
- package/README.md +13 -2
- package/dist/{Button-D--uN90N.js → Button-B1umG8kJ.js} +3 -3
- package/dist/ClickAwayListener-BKznXF1d.js +106 -0
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Portal-BcdMtRGF.js +73 -0
- package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Skeleton.css +1 -0
- package/dist/assets/Snackbar.css +1 -0
- package/dist/assets/SortTooltip.css +1 -0
- package/dist/assets/Stepper.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Toggle.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/{main.css → global.css} +1 -1
- package/dist/components/Advice/Advice.d.ts +16 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +9 -1
- package/dist/components/Button/Button.js +54 -38
- package/dist/components/Button/Button.stories.d.ts +60 -0
- package/dist/components/Button/Button.stories.js +40 -0
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/Checkbox/Checkbox.js +48 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +12 -124
- package/dist/components/Dialog/Dialog.d.ts +3 -2
- package/dist/components/Dialog/Dialog.js +418 -20072
- package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
- package/dist/components/Dialog/Dialog.stories.js +59 -0
- package/dist/components/Dialog/Title.js +1 -1
- package/dist/components/Icon/Icon.d.ts +18 -0
- package/dist/components/Icon/Icon.js +95 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/IconButton/IconButton.js +54 -65
- package/dist/components/Input/Input.d.ts +44 -0
- package/dist/components/Input/Input.js +497 -0
- package/dist/components/Input/Input.stories.d.ts +43 -0
- package/dist/components/Input/Input.stories.js +106 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
- package/dist/components/PageHeader/PageHeader.d.ts +25 -15
- package/dist/components/PageHeader/PageHeader.js +32 -50
- package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
- package/dist/components/PageHeader/PageHeader.stories.js +49 -0
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.js +47 -47
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.js +26 -0
- package/dist/components/Snackbar/Snackbar.d.ts +13 -0
- package/dist/components/Snackbar/Snackbar.js +622 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -1
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/Stepper.js +33 -0
- package/dist/components/Table/Table.d.ts +39 -0
- package/dist/components/Table/Table.js +122 -1
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -1
- package/dist/components/Tabs/Tab.d.ts +1 -1
- package/dist/components/Tabs/Tab.js +5 -5
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.js +4 -4
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Toggle/Toggle.d.ts +14 -0
- package/dist/components/Toggle/Toggle.js +256 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +1366 -1
- package/dist/components/Typography/Typography.d.ts +14 -5
- package/dist/components/Typography/Typography.js +76 -59
- package/dist/components/Typography/Typography.stories.d.ts +31 -0
- package/dist/components/Typography/Typography.stories.js +30 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11357 -0
- package/dist/index-BNWbc5Kh.js +19628 -0
- package/dist/{index-BvA1HyDs.js → index-CqjC7P5Y.js} +91 -95
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +16 -7
- package/dist/main.js +50 -28
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
- package/dist/test-utils/assertStyles.d.ts +1 -0
- package/dist/test-utils/assertStyles.js +11 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/useButton-Bc8IAgyk.js +106 -0
- package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
- package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
- package/dist/useTimeout-DxF9kiZL.js +36 -0
- package/dist/utils/styleStrings.d.ts +6 -0
- package/dist/utils/styleStrings.js +10 -0
- package/dist/utils/styleStrings.test.d.ts +1 -0
- package/dist/utils/styleStrings.test.js +41 -0
- package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
- package/package.json +30 -9
- package/dist/Dialog.module-BKWFakxu.js +0 -15
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
- package/dist/useButton-abQpo0za.js +0 -187
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../assets/Pagination.css';
|
|
2
|
-
import { jsxs as
|
|
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
|
|
5
|
-
import { u as
|
|
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:
|
|
14
|
+
hideNextButton: c = !1,
|
|
15
15
|
hidePrevButton: m = !1,
|
|
16
16
|
onChange: t,
|
|
17
17
|
page: o,
|
|
18
18
|
showFirstButton: p = !1,
|
|
19
|
-
showLastButton:
|
|
19
|
+
showLastButton: f = !1,
|
|
20
20
|
siblingCount: u = 1
|
|
21
|
-
} = e, 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
|
|
29
|
+
const F = l - n + 1;
|
|
30
30
|
return Array.from({
|
|
31
|
-
length:
|
|
32
|
-
}, (W,
|
|
33
|
-
}, j = v(1, Math.min(a, s)),
|
|
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
|
-
|
|
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
|
-
...
|
|
57
|
+
...w > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
|
|
58
58
|
// Sibling pages
|
|
59
|
-
...v(
|
|
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
|
-
...
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
-
],
|
|
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
|
-
},
|
|
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,
|
|
90
|
+
N(l, y(n));
|
|
91
91
|
},
|
|
92
92
|
type: n,
|
|
93
|
-
page:
|
|
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
|
|
98
|
-
items:
|
|
97
|
+
return S({
|
|
98
|
+
items: D
|
|
99
99
|
}, d);
|
|
100
100
|
}
|
|
101
|
-
const R = "
|
|
101
|
+
const R = "_pagination_9gf1w_1", g = {
|
|
102
102
|
pagination: R,
|
|
103
|
-
"per-page-container": "_per-page-
|
|
104
|
-
"pages-navigator-container": "_pages-navigator-
|
|
105
|
-
"pages-navigator-container__label": "_pages-navigator-
|
|
106
|
-
"page-number__btn": "_page-
|
|
107
|
-
"pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-
|
|
108
|
-
"page-number__btn--selected": "_page-number__btn--
|
|
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"],
|
|
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__ */
|
|
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(
|
|
138
|
+
className: C(g["per-page-container"], e.classNamePerPage),
|
|
139
139
|
"data-testid": e["data-testid__per-page"],
|
|
140
|
-
children: a && /* @__PURE__ */
|
|
141
|
-
|
|
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
|
-
|
|
162
|
+
c`of`,
|
|
163
163
|
" ",
|
|
164
164
|
/* @__PURE__ */ i("strong", { children: e.totalItems }),
|
|
165
165
|
" ",
|
|
166
|
-
|
|
166
|
+
c`results`
|
|
167
167
|
] })
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ x(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
173
|
-
className: C(
|
|
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:
|
|
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:
|
|
183
|
+
children: c`previous`
|
|
184
184
|
},
|
|
185
185
|
"page__previous"
|
|
186
186
|
),
|
|
187
|
-
m.map(({ page: t, type: o, selected: p, ...
|
|
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:
|
|
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: [
|
|
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", ...
|
|
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:
|
|
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:
|
|
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
|
|
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 {};
|