@pismo/marola 0.0.1-alpha.1 → 0.0.1-alpha.12
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 +17 -5
- package/dist/Button-B1umG8kJ.js +131 -0
- package/dist/ClickAwayListener-HI1G6ob9.js +107 -0
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Popup-DFJQc_jn.js +1249 -0
- package/dist/Portal-D__zvwbZ.js +73 -0
- package/dist/SelectButton-DWtqAiwt.js +45 -0
- package/dist/Tabs.module-jkH1Qjn7.js +22 -0
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/InputSearch.css +1 -0
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/PageHeader.css +1 -0
- package/dist/assets/Pagination.css +1 -0
- package/dist/assets/SelectButton.css +1 -0
- 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 -0
- package/dist/assets/Toggle.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/global.css +1 -0
- package/dist/combineHooksSlotProps-BHqhiBfc.js +81 -0
- package/dist/components/Advice/Advice.d.ts +16 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +29 -0
- package/dist/components/Button/Button.js +70 -0
- package/dist/components/Button/Button.stories.d.ts +60 -0
- package/dist/components/Button/Button.stories.js +41 -0
- package/dist/components/Checkbox/Checkbox.d.ts +19 -0
- package/dist/components/Checkbox/Checkbox.js +56 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +2 -9
- package/dist/components/Dialog/CloseIconButton.js +11 -10
- package/dist/components/Dialog/Dialog.d.ts +5 -4
- package/dist/components/Dialog/Dialog.js +420 -20077
- package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
- package/dist/components/Dialog/Dialog.stories.js +60 -0
- package/dist/components/Dialog/Title.js +22 -7
- package/dist/components/Icon/Icon.d.ts +18 -0
- package/dist/components/Icon/Icon.js +95 -0
- package/dist/components/IconButton/IconButton.d.ts +22 -0
- package/dist/components/IconButton/IconButton.js +68 -0
- 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/InputSearch/InputSearch.d.ts +11 -0
- package/dist/components/InputSearch/InputSearch.js +29 -0
- package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
- package/dist/components/InputSearch/InputSearch.stories.js +36 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +39 -0
- package/dist/components/PageHeader/PageHeader.d.ts +36 -0
- package/dist/components/PageHeader/PageHeader.js +51 -0
- 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 +36 -0
- package/dist/components/Pagination/Pagination.js +219 -0
- package/dist/components/Select/Select.d.ts +25 -0
- package/dist/components/Select/Select.js +860 -0
- package/dist/components/Select/Select.stories.d.ts +31 -0
- package/dist/components/Select/Select.stories.js +66 -0
- package/dist/components/Select/SelectButton.d.ts +13 -0
- package/dist/components/Select/SelectButton.js +8 -0
- 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 +623 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -0
- 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 -0
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -0
- package/dist/components/Tabs/Tab.d.ts +9 -0
- package/dist/components/Tabs/Tab.js +182 -0
- package/dist/components/Tabs/TabPanel.d.ts +8 -0
- package/dist/components/Tabs/TabPanel.js +119 -0
- package/dist/components/Tabs/Tabs.d.ts +11 -0
- package/dist/components/Tabs/Tabs.js +402 -0
- package/dist/components/Toggle/Toggle.d.ts +11 -0
- package/dist/components/Toggle/Toggle.js +252 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +21 -0
- package/dist/components/Toggle/Toggle.stories.js +33 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +127 -0
- package/dist/components/Typography/Typography.d.ts +15 -6
- package/dist/components/Typography/Typography.js +75 -67
- package/dist/components/Typography/Typography.stories.d.ts +31 -0
- package/dist/components/Typography/Typography.stories.js +31 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11358 -0
- package/dist/index-BJ8HbRCy.js +19585 -0
- package/dist/index-CqjC7P5Y.js +814 -0
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +19 -2
- package/dist/main.js +60 -15
- 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 +14 -7
- package/dist/useButton-Bc8IAgyk.js +106 -0
- package/dist/useCompoundItem-D1iRfg8D.js +84 -0
- package/dist/useControlled-CCMYYdCM.js +31 -0
- package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
- package/dist/useEventCallback-vAfOD-oT.js +45 -0
- package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
- package/dist/useList-ByMguSS_.js +437 -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 +53 -10
- package/dist/Button-REznN-RP.js +0 -1139
- package/dist/Dialog.module-BO0mdB7d.js +0 -15
- package/dist/assets/CallToActionButton.css +0 -1
- package/dist/assets/main.css +0 -1
- package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -23
- package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
- 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,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type SelectOptionProps = {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
value: string | number;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
};
|
|
11
|
+
type SelectProps = {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
placeholder?: string | number;
|
|
15
|
+
ariaLabelledby?: string;
|
|
16
|
+
onChange?: (value: number | string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const Option: (props: SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const Select: {
|
|
22
|
+
(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
Option: (props: SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
};
|
|
25
|
+
export { Select };
|