@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 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
import '../../assets/SortTooltip.css';
|
|
2
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { c as w } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { Tooltip as g } from "../Tooltip/Tooltip.js";
|
|
5
|
+
import * as t from "react";
|
|
6
|
+
const H = (e) => /* @__PURE__ */ t.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ t.createElement("path", { d: "M4.73768 14.6906C4.35893 15.105 3.64205 15.105 3.26299 14.6906L0.541112 11.6878C0.167987 11.28 0.195487 10.6469 0.602643 10.2731C1.00952 9.89969 1.64233 9.92812 2.01577 10.3348L3.00017 11.4406V2.00094C3.00017 1.44781 3.44799 1 4.00017 1C4.55236 1 5.00017 1.44781 5.00017 2.00094V11.4384L6.01267 10.3325C6.3708 9.94219 7.00236 9.88281 7.4258 10.2708C7.83299 10.6443 7.86018 11.2777 7.48733 11.6855L4.73768 14.6906Z", fill: "#1897F3" }), /* @__PURE__ */ t.createElement("path", { opacity: 0.4, d: "M14.0001 13H12.4141L14.7073 10.7069C14.9934 10.4208 15.0788 9.99098 14.9241 9.61691C14.7693 9.24285 14.4032 9.00004 13.972 9.00004H9.97196C9.44696 9.00004 9.00008 9.44691 9.00008 10C9.00008 10.5532 9.4479 11 10.0001 11H11.586L9.2929 13.2932C9.00677 13.5793 8.92133 14.0091 9.07608 14.3832C9.23083 14.7572 9.59696 15 9.97196 15H13.9438C14.5532 15 15.0001 14.5532 15.0001 14C15.0001 13.4469 14.5532 13 14.0001 13ZM15.3938 6.54066L12.8941 1.53754C12.5554 0.855977 11.4441 0.855977 11.1054 1.53754L8.60633 6.54066C8.35927 7.03785 8.55946 7.64191 9.05352 7.89035C9.54946 8.13791 10.1485 7.93651 10.3951 7.44035L10.6186 6.99066H13.3821L13.6056 7.44035C13.7986 7.82879 14.3547 8.18629 14.9472 7.89035C15.4407 7.64379 15.6407 7.03754 15.3938 6.54066ZM11.4938 5.23129L12.0001 4.20941L12.507 5.2291H11.4938V5.23129Z", fill: "#1897F3" })), u = (e) => /* @__PURE__ */ t.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ t.createElement("path", { d: "M0.512792 11.6594C0.139667 11.2516 0.167167 10.6184 0.574323 10.2447C0.766229 10.0688 1.00839 9.98175 1.24964 9.98175C1.52063 9.98175 1.79026 10.0912 1.98745 10.3064L2.99998 11.4406V2.00094C2.99998 1.44781 3.44779 1 3.99998 1C4.55217 1 4.99998 1.44781 4.99998 2.00094V11.4384L6.01248 10.3325C6.38748 9.92812 7.01873 9.89687 7.42498 10.2719C7.83216 10.6453 7.85935 11.2787 7.48651 11.6866L4.76463 14.6894C4.38588 15.1037 3.66901 15.1037 3.28995 14.6894L0.512792 11.6594Z", fill: "#1897F3" }), /* @__PURE__ */ t.createElement("path", { opacity: 0.4, d: "M10.0002 3H11.5862L9.29303 5.29313C9.00691 5.57925 8.92147 6.00906 9.07622 6.38313C9.23097 6.75719 9.59591 7 9.99997 7H13.9718C14.5533 6.97188 15.0002 6.55313 15.0002 6C15.0002 5.44688 14.5524 5 14.0002 5H12.4143L14.7074 2.70688C14.9935 2.42075 15.079 1.99094 14.9242 1.61688C14.7695 1.24281 14.4033 1 13.9721 1H10.0002C9.44709 1 9.00022 1.44719 9.00022 2C9.00022 2.55281 9.44709 3 10.0002 3ZM15.394 13.5406L12.8943 8.5375C12.5555 7.85594 11.4443 7.85594 11.1055 8.5375L8.60584 13.5406C8.35878 14.0378 8.55897 14.6419 9.05303 14.8903C9.54897 15.1379 10.148 14.9365 10.3946 14.4403L10.6182 13.9906H13.3816L13.6052 14.4403C13.7981 14.8288 14.3542 15.1863 14.9467 14.8903C15.4408 14.6438 15.6408 14.0375 15.394 13.5406ZM11.494 12.2313L12.0002 11.2094L12.5071 12.2291H11.494V12.2313Z", fill: "#1897F3" })), l = {
|
|
7
|
+
"sort-tooltip": "_sort-tooltip_11a3z_1",
|
|
8
|
+
"button--selected": "_button--selected_11a3z_21"
|
|
9
|
+
}, f = {
|
|
10
|
+
pt: {
|
|
11
|
+
asc: "Ascendente",
|
|
12
|
+
desc: "Descendente"
|
|
13
|
+
},
|
|
14
|
+
en: {
|
|
15
|
+
asc: "Sort ascending",
|
|
16
|
+
desc: "Sort descending"
|
|
17
|
+
}
|
|
18
|
+
}, x = ({ show: e, onSort: C, sortType: i, onClose: n, t: r, language: a, className: d, ...L }) => {
|
|
19
|
+
const p = w(l["sort-tooltip"], d), m = r || f[a || "en"], c = (h) => m[h];
|
|
20
|
+
return /* @__PURE__ */ o(
|
|
21
|
+
g,
|
|
22
|
+
{
|
|
23
|
+
className: p,
|
|
24
|
+
onClose: n,
|
|
25
|
+
show: e,
|
|
26
|
+
theme: "white",
|
|
27
|
+
padding: "normal",
|
|
28
|
+
position: "bottom-start",
|
|
29
|
+
disableHoverListener: !0,
|
|
30
|
+
...L,
|
|
31
|
+
children: /* @__PURE__ */ s("ul", { children: [
|
|
32
|
+
/* @__PURE__ */ o("li", { children: /* @__PURE__ */ s(
|
|
33
|
+
"button",
|
|
34
|
+
{
|
|
35
|
+
type: "button",
|
|
36
|
+
onClick: () => {
|
|
37
|
+
n(), C("ASC");
|
|
38
|
+
},
|
|
39
|
+
className: i === "ASC" ? l["button--selected"] : "",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ o(H, {}),
|
|
42
|
+
c`asc`
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
) }),
|
|
46
|
+
/* @__PURE__ */ o("li", { children: /* @__PURE__ */ s(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: () => {
|
|
51
|
+
n(), C("DESC");
|
|
52
|
+
},
|
|
53
|
+
className: i === "DESC" ? l["button--selected"] : "",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ o(u, {}),
|
|
56
|
+
c`desc`
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
) })
|
|
60
|
+
] })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
x as SortTooltip,
|
|
66
|
+
f as sortTooltipDefaultTranslations
|
|
67
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type StepperProps = {
|
|
4
|
+
steps: Array<ReactNode>;
|
|
5
|
+
currentStep: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
classNameItem?: string;
|
|
8
|
+
classNameCounter?: string;
|
|
9
|
+
classNameName?: string;
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
'data-testid-item'?: string;
|
|
12
|
+
'data-testid-counter'?: string;
|
|
13
|
+
'data-testid-name'?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const Stepper: ({ currentStep, steps, classNameItem, classNameCounter, classNameName, ...rest }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export { Stepper };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import '../../assets/Stepper.css';
|
|
2
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
3
|
+
import { c as s } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
const v = "_stepper_1q540_1", q = "_item_1q540_6", u = "_counter_1q540_33", N = "_name_1q540_49", t = {
|
|
5
|
+
stepper: v,
|
|
6
|
+
item: q,
|
|
7
|
+
counter: u,
|
|
8
|
+
name: N,
|
|
9
|
+
"item--completed": "_item--completed_1q540_58",
|
|
10
|
+
"item--active": "_item--active_1q540_80"
|
|
11
|
+
}, j = ({ currentStep: c = 0, steps: m, classNameItem: d, classNameCounter: o, classNameName: n, ...e }) => /* @__PURE__ */ i("div", { className: s(t.stepper, e.className), "data-testid": e["data-testid"], children: m.map((_, a) => {
|
|
12
|
+
const p = a < c, r = a === c;
|
|
13
|
+
return /* @__PURE__ */ l(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: s(
|
|
17
|
+
t.item,
|
|
18
|
+
p && t["item--completed"],
|
|
19
|
+
r && t["item--active"],
|
|
20
|
+
d
|
|
21
|
+
),
|
|
22
|
+
"data-testid": e["data-testid-item"],
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ i("div", { className: s(t.counter, o), "data-testid": e["data-testid-counter"], children: a + 1 }),
|
|
25
|
+
/* @__PURE__ */ i("div", { className: s(t.name, n), "data-testid": e["data-testid-name"], children: _ })
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
a
|
|
29
|
+
);
|
|
30
|
+
}) });
|
|
31
|
+
export {
|
|
32
|
+
j as Stepper
|
|
33
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TableTranslations } from './TableContext';
|
|
2
|
+
import { SortType } from '../SortTooltip/SortTooltip';
|
|
3
|
+
import { PaginationProps } from '../Pagination/Pagination';
|
|
4
|
+
|
|
5
|
+
type ChildrenProps = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
};
|
|
10
|
+
type TableTheme = 'white' | 'transparent';
|
|
11
|
+
type TableProps = ChildrenProps & {
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
paginationProps?: PaginationProps;
|
|
14
|
+
theme?: TableTheme;
|
|
15
|
+
language?: string;
|
|
16
|
+
translations?: TableTranslations;
|
|
17
|
+
};
|
|
18
|
+
declare const Table: {
|
|
19
|
+
({ children, theme, fullWidth, className, paginationProps, language, translations, ...rest }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
THead: ({ children, ...rest }: ChildrenProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
TBody: ({ children, ...rest }: ChildrenProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
Tr: ({ children, onClick, disabled, className, ...rest }: RowOrCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
Td: ({ children, onClick, disabled, className, align, ...rest }: RowOrCellProps & CellProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
Th: ({ children, onSort, sortType, className, classNameTooltip, align, ...rest }: ThProps & CellProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
type Alignment = 'left' | 'right' | 'center';
|
|
27
|
+
type CellProps = {
|
|
28
|
+
align?: Alignment;
|
|
29
|
+
};
|
|
30
|
+
type RowOrCellProps = ChildrenProps & {
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
onClick?: () => void;
|
|
33
|
+
};
|
|
34
|
+
type ThProps = ChildrenProps & {
|
|
35
|
+
onSort?: (order: SortType) => void;
|
|
36
|
+
sortType?: SortType;
|
|
37
|
+
classNameTooltip?: string;
|
|
38
|
+
};
|
|
39
|
+
export default Table;
|
|
@@ -1 +1,122 @@
|
|
|
1
|
-
|
|
1
|
+
import '../../assets/Table.css';
|
|
2
|
+
import { jsxs as w, jsx as r, Fragment as T } from "react/jsx-runtime";
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { useState as u } from "react";
|
|
5
|
+
import { c as h } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
import { paginationDefaultTranslations as b, Pagination as g } from "../Pagination/Pagination.js";
|
|
7
|
+
import { sortTooltipDefaultTranslations as f, SortTooltip as q } from "../SortTooltip/SortTooltip.js";
|
|
8
|
+
import { TableProvider as N, useTable as C } from "./TableContext.js";
|
|
9
|
+
const L = (l) => /* @__PURE__ */ c.createElement("svg", { width: 7, height: 10, viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ c.createElement("g", { clipPath: "url(#clip0_2291_2457)" }, /* @__PURE__ */ c.createElement("path", { d: "M6.41658 3.93794C6.26731 3.93794 6.11798 3.88301 6.00423 3.77314L3.49991 1.35923L0.995768 3.77271C0.767904 3.99243 0.398763 3.99243 0.170898 3.77271C-0.0569661 3.55298 -0.0569661 3.19702 0.170898 2.97729L3.08756 0.164795C3.31543 -0.0549316 3.68457 -0.0549316 3.91243 0.164795L6.8291 2.97729C7.05697 3.19702 7.05697 3.55298 6.8291 3.77271C6.71553 3.88345 6.56605 3.93794 6.41658 3.93794Z", fill: "#1897F3" }), /* @__PURE__ */ c.createElement("path", { opacity: 0.4, d: "M6.41663 5.38022C6.26737 5.38022 6.11804 5.43516 6.00429 5.54502L3.49997 7.95894L0.99528 5.5437C0.767415 5.32397 0.398275 5.32397 0.17041 5.5437C-0.0574544 5.76343 -0.0574544 6.11938 0.17041 6.33911L3.08708 9.15161C3.31494 9.37134 3.68408 9.37134 3.91195 9.15161L6.82861 6.33911C7.05648 6.11938 7.05648 5.76343 6.82861 5.5437C6.71559 5.43472 6.56611 5.38022 6.41663 5.38022Z", fill: "#1897F3" })), /* @__PURE__ */ c.createElement("defs", null, /* @__PURE__ */ c.createElement("clipPath", { id: "clip0_2291_2457" }, /* @__PURE__ */ c.createElement("rect", { width: 7, height: 10, fill: "white" })))), E = "_table_xe8qp_1", v = "_th__wrapper_xe8qp_40", y = "_tr_xe8qp_58", P = "_td_xe8qp_62", t = {
|
|
10
|
+
table: E,
|
|
11
|
+
"table--full-width": "_table--full-width_xe8qp_5",
|
|
12
|
+
"table--white-theme": "_table--white-theme_xe8qp_8",
|
|
13
|
+
"table--transparent-theme": "_table--transparent-theme_xe8qp_11",
|
|
14
|
+
"cell--left-alignment": "_cell--left-alignment_xe8qp_14",
|
|
15
|
+
"cell--center-alignment": "_cell--center-alignment_xe8qp_18",
|
|
16
|
+
"cell--right-alignment": "_cell--right-alignment_xe8qp_22",
|
|
17
|
+
th__wrapper: v,
|
|
18
|
+
"th__wrapper--pressed": "_th__wrapper--pressed_xe8qp_43",
|
|
19
|
+
"th__wrapper--clickable": "_th__wrapper--clickable_xe8qp_47",
|
|
20
|
+
"th__sort-icon-container": "_th__sort-icon-container_xe8qp_50",
|
|
21
|
+
"tr__row-or-cell--disabled": "_tr__row-or-cell--disabled_xe8qp_58",
|
|
22
|
+
tr: y,
|
|
23
|
+
td: P,
|
|
24
|
+
"tr__row-or-cell--clickable": "_tr__row-or-cell--clickable_xe8qp_67",
|
|
25
|
+
"td__row-or-cell--clickable": "_td__row-or-cell--clickable_xe8qp_68",
|
|
26
|
+
"td__row-or-cell--disabled": "_td__row-or-cell--disabled_xe8qp_72",
|
|
27
|
+
"td-wrapper": "_td-wrapper_xe8qp_76"
|
|
28
|
+
}, B = {
|
|
29
|
+
pt: {
|
|
30
|
+
...b.pt,
|
|
31
|
+
...f.pt
|
|
32
|
+
},
|
|
33
|
+
en: {
|
|
34
|
+
...b.en,
|
|
35
|
+
...f.en
|
|
36
|
+
},
|
|
37
|
+
// example to add a new language translation
|
|
38
|
+
es: {
|
|
39
|
+
asc: "Orden ascendente",
|
|
40
|
+
desc: "Orden descendiente",
|
|
41
|
+
next: "Próximo",
|
|
42
|
+
previous: "Anterior",
|
|
43
|
+
showing: "Mostrando",
|
|
44
|
+
of: "de",
|
|
45
|
+
results: "resultados"
|
|
46
|
+
}
|
|
47
|
+
}, d = ({
|
|
48
|
+
children: l,
|
|
49
|
+
theme: e = "white",
|
|
50
|
+
fullWidth: a = !0,
|
|
51
|
+
className: n,
|
|
52
|
+
paginationProps: _,
|
|
53
|
+
language: s,
|
|
54
|
+
translations: o,
|
|
55
|
+
...m
|
|
56
|
+
}) => {
|
|
57
|
+
const p = h(
|
|
58
|
+
t.table,
|
|
59
|
+
a ? t["table--full-width"] : "",
|
|
60
|
+
t[`table--${e}-theme`],
|
|
61
|
+
n
|
|
62
|
+
), i = s && B[s] || o;
|
|
63
|
+
return /* @__PURE__ */ w(N, { initialTranslations: i, children: [
|
|
64
|
+
/* @__PURE__ */ r("table", { ...m, className: p, children: l }),
|
|
65
|
+
_ && /* @__PURE__ */ r(g, { ..._, t: i })
|
|
66
|
+
] });
|
|
67
|
+
}, F = ({ children: l, ...e }) => /* @__PURE__ */ r("thead", { ...e, children: l }), M = ({ children: l, ...e }) => /* @__PURE__ */ r("tbody", { ...e, children: l }), O = ({ children: l, onClick: e, disabled: a, className: n, ..._ }) => {
|
|
68
|
+
const s = h(
|
|
69
|
+
t.tr,
|
|
70
|
+
e && !a ? t["tr__row-or-cell--clickable"] : a ? t["tr__row-or-cell--disabled"] : "",
|
|
71
|
+
n
|
|
72
|
+
);
|
|
73
|
+
return /* @__PURE__ */ r("tr", { ..._, className: s, onClick: () => !a && (e == null ? void 0 : e()), children: l });
|
|
74
|
+
}, $ = ({ children: l, onClick: e, disabled: a, className: n, align: _ = "left", ...s }) => {
|
|
75
|
+
const o = h(
|
|
76
|
+
t.td,
|
|
77
|
+
e && !a ? t["td__row-or-cell--clickable"] : a ? t["td__row-or-cell--disabled"] : "",
|
|
78
|
+
t[`cell--${_}-alignment`],
|
|
79
|
+
n
|
|
80
|
+
);
|
|
81
|
+
return /* @__PURE__ */ r("td", { ...s, className: o, onClick: () => !a && (e == null ? void 0 : e()), children: /* @__PURE__ */ r("span", { className: t["td-wrapper"], children: l }) });
|
|
82
|
+
}, j = ({
|
|
83
|
+
children: l,
|
|
84
|
+
onSort: e,
|
|
85
|
+
sortType: a,
|
|
86
|
+
className: n,
|
|
87
|
+
classNameTooltip: _,
|
|
88
|
+
align: s = "left",
|
|
89
|
+
...o
|
|
90
|
+
}) => {
|
|
91
|
+
const { translations: m } = C(), [p, i] = u(!1), x = h(
|
|
92
|
+
t.th__wrapper,
|
|
93
|
+
p ? t["th__wrapper--pressed"] : "",
|
|
94
|
+
e ? t["th__wrapper--clickable"] : "",
|
|
95
|
+
n
|
|
96
|
+
);
|
|
97
|
+
return /* @__PURE__ */ r("th", { ...o, className: t[`cell--${s}-alignment`], children: /* @__PURE__ */ w("span", { className: x, onClick: e && (() => i(!p)), children: [
|
|
98
|
+
/* @__PURE__ */ r("span", { children: l }),
|
|
99
|
+
e && /* @__PURE__ */ w(T, { children: [
|
|
100
|
+
/* @__PURE__ */ r("span", { className: t["th__sort-icon-container"], children: /* @__PURE__ */ r(L, {}) }),
|
|
101
|
+
/* @__PURE__ */ r(
|
|
102
|
+
q,
|
|
103
|
+
{
|
|
104
|
+
onClose: () => i(!1),
|
|
105
|
+
onSort: e,
|
|
106
|
+
show: p,
|
|
107
|
+
sortType: a,
|
|
108
|
+
className: _,
|
|
109
|
+
t: m
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] })
|
|
113
|
+
] }) });
|
|
114
|
+
};
|
|
115
|
+
d.THead = F;
|
|
116
|
+
d.TBody = M;
|
|
117
|
+
d.Tr = O;
|
|
118
|
+
d.Td = $;
|
|
119
|
+
d.Th = j;
|
|
120
|
+
export {
|
|
121
|
+
d as default
|
|
122
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SortTranslationsByKeys } from '../SortTooltip/SortTooltip';
|
|
2
|
+
import { PaginationTranslations } from '../Pagination/Pagination';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
export type TableTranslationsKeys = keyof PaginationTranslations | keyof SortTranslationsByKeys;
|
|
6
|
+
export type TableTranslations = {
|
|
7
|
+
[key in TableTranslationsKeys]?: string;
|
|
8
|
+
};
|
|
9
|
+
type ITableContext = {
|
|
10
|
+
translations?: TableTranslations;
|
|
11
|
+
setTranslations: (translation: TableTranslations) => void;
|
|
12
|
+
};
|
|
13
|
+
type TableProviderProps = {
|
|
14
|
+
initialTranslations?: TableTranslations;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
declare const TableProvider: ({ initialTranslations, children }: TableProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const useTable: () => Partial<ITableContext>;
|
|
19
|
+
export { TableProvider };
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as n, useState as u, useEffect as x, useContext as a } from "react";
|
|
3
|
+
const o = n({}), b = ({ initialTranslations: e, children: r }) => {
|
|
4
|
+
const [s, t] = u(e);
|
|
5
|
+
return x(() => {
|
|
6
|
+
t(e);
|
|
7
|
+
}, [e]), /* @__PURE__ */ c(
|
|
8
|
+
o.Provider,
|
|
9
|
+
{
|
|
10
|
+
value: {
|
|
11
|
+
translations: s,
|
|
12
|
+
setTranslations: t
|
|
13
|
+
},
|
|
14
|
+
children: r
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}, p = () => a(o);
|
|
18
|
+
export {
|
|
19
|
+
b as TableProvider,
|
|
20
|
+
p as useTable
|
|
21
|
+
};
|
|
@@ -6,4 +6,4 @@ export interface TabProps {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
dataTestId?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import(
|
|
9
|
+
export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,12 +2,12 @@ import { jsx as I } from "react/jsx-runtime";
|
|
|
2
2
|
import * as f from "react";
|
|
3
3
|
import { forwardRef as S, useContext as U, useMemo as j } from "react";
|
|
4
4
|
import { c as D } from "../../clsx-DB4S2d7J.js";
|
|
5
|
-
import { u as $, T as A, s as y } from "../../Tabs.module-
|
|
6
|
-
import { a as p, _ as B } from "../../objectWithoutPropertiesLoose-
|
|
7
|
-
import {
|
|
8
|
-
import { u as K, a as Q } from "../../useCompoundItem-
|
|
5
|
+
import { u as $, T as A, s as y } from "../../Tabs.module-BA-PC7fA.js";
|
|
6
|
+
import { a as p, _ as B } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
7
|
+
import { e as O, g as W, a as q, u as N, b as z, P as o, c as G, d as J } from "../../index-CqjC7P5Y.js";
|
|
8
|
+
import { u as K, a as Q } from "../../useCompoundItem-CTYi5M_E.js";
|
|
9
9
|
import { L as X, a as E } from "../../ListContext-Dj2Va7Iv.js";
|
|
10
|
-
import { u as Y } from "../../useButton-
|
|
10
|
+
import { u as Y } from "../../useButton-Bc8IAgyk.js";
|
|
11
11
|
function Z(n) {
|
|
12
12
|
const {
|
|
13
13
|
handlePointerOverEvents: t = !1,
|
|
@@ -5,4 +5,4 @@ export interface TabPanelProps {
|
|
|
5
5
|
value: string | number;
|
|
6
6
|
dataTestId?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const TabPanel: import('react').ForwardRefExoticComponent<TabPanelProps & import(
|
|
8
|
+
export declare const TabPanel: import('react').ForwardRefExoticComponent<TabPanelProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as T } from "react/jsx-runtime";
|
|
2
2
|
import * as P from "react";
|
|
3
3
|
import { forwardRef as v } from "react";
|
|
4
|
-
import { u as y, s as x } from "../../Tabs.module-
|
|
5
|
-
import { a as b, _ as C } from "../../objectWithoutPropertiesLoose-
|
|
6
|
-
import { g as N, a as _,
|
|
7
|
-
import { u as S, a as U } from "../../useCompoundItem-
|
|
4
|
+
import { u as y, s as x } from "../../Tabs.module-BA-PC7fA.js";
|
|
5
|
+
import { a as b, _ as C } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
6
|
+
import { g as N, a as _, u as w, b as O, P as o, c as E, d as I } from "../../index-CqjC7P5Y.js";
|
|
7
|
+
import { u as S, a as U } from "../../useCompoundItem-CTYi5M_E.js";
|
|
8
8
|
const h = "TabPanel";
|
|
9
9
|
function j(t) {
|
|
10
10
|
return N(h, t);
|
|
@@ -6,4 +6,4 @@ export interface TabsProps {
|
|
|
6
6
|
dataTestId?: string;
|
|
7
7
|
onChange?: (tabValue: number | string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
|
|
8
8
|
}
|
|
9
|
-
export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import(
|
|
9
|
+
export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { forwardRef as xe, useState as Ve } from "react";
|
|
4
|
-
import { a as Q, C as Z, T as Te, u as Ie, s as Se } from "../../Tabs.module-
|
|
5
|
-
import { a as b, _ as ee } from "../../objectWithoutPropertiesLoose-
|
|
6
|
-
import {
|
|
4
|
+
import { a as Q, C as Z, T as Te, u as Ie, s as Se } from "../../Tabs.module-BA-PC7fA.js";
|
|
5
|
+
import { a as b, _ as ee } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
6
|
+
import { u as Re, e as we, g as te, a as ne, b as oe, P as v, c as le, d as se } from "../../index-CqjC7P5Y.js";
|
|
7
7
|
import { u as Pe } from "../../useControlled-CCMYYdCM.js";
|
|
8
8
|
import { a as S, L as ye } from "../../ListContext-Dj2Va7Iv.js";
|
|
9
9
|
function J(t, e, l = (n, o) => n === o) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type ToggleProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
'data-testid'?: string;
|
|
8
|
+
classNameWrapper?: string;
|
|
9
|
+
classNameLabel?: string;
|
|
10
|
+
classNameInput?: string;
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const Toggle: ({ onChange, label, disabled, checked, autoFocus, classNameWrapper, classNameLabel, classNameInput, "data-testid": dataTestId, }: ToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|