@pismo/marola 0.0.1-alpha.4 → 0.0.1-alpha.6

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 (95) hide show
  1. package/README.md +17 -5
  2. package/dist/{Button-C3Qm852g.js → Button-W6tM-_IT.js} +6 -5
  3. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  4. package/dist/{ListContext-D6-YwtZn.js → ListContext-Dj2Va7Iv.js} +2 -2
  5. package/dist/Portal-P3fPvS3-.js +19695 -0
  6. package/dist/{Tabs.module-_kSbSyth.js → Tabs.module-BA-PC7fA.js} +16 -16
  7. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  8. package/dist/assets/Advice.css +1 -0
  9. package/dist/assets/Button.css +1 -0
  10. package/dist/assets/Checkbox.css +1 -0
  11. package/dist/assets/Dialog.css +1 -1
  12. package/dist/assets/IconButton.css +1 -0
  13. package/dist/assets/LoadingSpinner.css +1 -1
  14. package/dist/assets/PageHeader.css +1 -0
  15. package/dist/assets/Pagination.css +1 -0
  16. package/dist/assets/Skeleton.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/Tooltip.css +1 -0
  22. package/dist/assets/Typography.css +1 -1
  23. package/dist/assets/global.css +1 -0
  24. package/dist/components/Advice/Advice.d.ts +13 -0
  25. package/dist/components/Advice/Advice.js +25 -0
  26. package/dist/components/Button/Button.d.ts +21 -0
  27. package/dist/components/Button/Button.js +70 -0
  28. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  29. package/dist/components/Checkbox/Checkbox.js +48 -0
  30. package/dist/components/Dialog/Actions.js +1 -1
  31. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  32. package/dist/components/Dialog/Backdrop.js +2 -9
  33. package/dist/components/Dialog/CloseIconButton.js +12 -124
  34. package/dist/components/Dialog/Dialog.d.ts +2 -2
  35. package/dist/components/Dialog/Dialog.js +418 -20077
  36. package/dist/components/Dialog/Title.js +22 -7
  37. package/dist/components/Icon/Icon.d.ts +7 -0
  38. package/dist/components/Icon/Icon.js +9 -0
  39. package/dist/components/IconButton/IconButton.d.ts +22 -0
  40. package/dist/components/IconButton/IconButton.js +68 -0
  41. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  42. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  43. package/dist/components/PageHeader/PageHeader.js +51 -0
  44. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  45. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  46. package/dist/components/Pagination/Pagination.d.ts +36 -0
  47. package/dist/components/Pagination/Pagination.js +219 -0
  48. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  49. package/dist/components/Skeleton/Skeleton.js +26 -0
  50. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  51. package/dist/components/SortTooltip/SortTooltip.js +67 -0
  52. package/dist/components/Stepper/Stepper.d.ts +16 -0
  53. package/dist/components/Stepper/Stepper.js +33 -0
  54. package/dist/components/Table/Table.d.ts +39 -0
  55. package/dist/components/Table/Table.js +122 -0
  56. package/dist/components/Table/TableContext.d.ts +19 -0
  57. package/dist/components/Table/TableContext.js +21 -0
  58. package/dist/components/Tabs/Tab.d.ts +1 -1
  59. package/dist/components/Tabs/Tab.js +42 -37
  60. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  61. package/dist/components/Tabs/TabPanel.js +20 -21
  62. package/dist/components/Tabs/Tabs.d.ts +1 -1
  63. package/dist/components/Tabs/Tabs.js +185 -214
  64. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  65. package/dist/components/Tooltip/Tooltip.js +1463 -0
  66. package/dist/components/Typography/Typography.d.ts +14 -5
  67. package/dist/components/Typography/Typography.js +76 -68
  68. package/dist/components/Typography/Typography.stories.d.ts +18 -0
  69. package/dist/components/Typography/Typography.stories.js +30 -0
  70. package/dist/components/Typography/typography.test.d.ts +1 -0
  71. package/dist/components/Typography/typography.test.js +11360 -0
  72. package/dist/{index-BZ1lkM_M.js → index-D2P7y2mE.js} +303 -327
  73. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  74. package/dist/main.d.ts +5 -1
  75. package/dist/main.js +30 -21
  76. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  77. package/dist/react-CGNQ6M5x.js +117 -0
  78. package/dist/test-utils/assertStyles.d.ts +1 -0
  79. package/dist/test-utils/assertStyles.js +11 -0
  80. package/dist/types/helpers.d.ts +14 -7
  81. package/dist/{useButton-CbmjmH5z.js → useButton-JpyBo5M4.js} +17 -16
  82. package/dist/{useCompoundItem-B7wfGDHQ.js → useCompoundItem-CTYi5M_E.js} +1 -1
  83. package/dist/useControlled-CCMYYdCM.js +31 -0
  84. package/dist/utils/styleStrings.d.ts +6 -0
  85. package/dist/utils/styleStrings.js +10 -0
  86. package/dist/utils/styleStrings.test.d.ts +1 -0
  87. package/dist/utils/styleStrings.test.js +41 -0
  88. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  89. package/package.json +47 -7
  90. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  91. package/dist/assets/CallToActionButton.css +0 -1
  92. package/dist/assets/main.css +0 -1
  93. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -21
  94. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  95. package/src/playground/Playground.tsx +0 -20
@@ -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,26 @@
1
+ export type SortType = 'ASC' | 'DESC';
2
+ type SortCommonProps = {
3
+ className?: string;
4
+ 'data-testid'?: string;
5
+ };
6
+ export type SortTranslationsByKeys = {
7
+ asc: string;
8
+ desc: string;
9
+ };
10
+ type SortLanguages = 'pt' | 'en';
11
+ type SortTranslations = {
12
+ t?: SortTranslationsByKeys;
13
+ language?: SortLanguages;
14
+ };
15
+ type SortTooltipProps = {
16
+ onSort: (order: SortType) => void;
17
+ onClose: () => void;
18
+ sortType?: SortType;
19
+ show?: boolean;
20
+ anchorRef?: HTMLElement | null | undefined;
21
+ } & SortCommonProps & SortTranslations;
22
+ export declare const defaultTranslations: {
23
+ [key in SortLanguages]: SortTranslationsByKeys;
24
+ };
25
+ declare const SortTooltip: ({ show, onSort, sortType, onClose, t, language, className, ...rest }: SortTooltipProps) => import("react/jsx-runtime").JSX.Element;
26
+ export { SortTooltip };
@@ -0,0 +1,67 @@
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: c, onClose: n, t: r, language: a, className: d, ...L }) => {
19
+ const m = w(l["sort-tooltip"], d), p = r || f[a || "en"], i = (h) => p[h];
20
+ return /* @__PURE__ */ o(
21
+ g,
22
+ {
23
+ className: m,
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: c === "ASC" ? l["button--selected"] : "",
40
+ children: [
41
+ /* @__PURE__ */ o(H, {}),
42
+ i`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: c === "DESC" ? l["button--selected"] : "",
54
+ children: [
55
+ /* @__PURE__ */ o(u, {}),
56
+ i`desc`
57
+ ]
58
+ }
59
+ ) })
60
+ ] })
61
+ }
62
+ );
63
+ };
64
+ export {
65
+ x as SortTooltip,
66
+ f as defaultTranslations
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;
@@ -0,0 +1,122 @@
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 { defaultTranslations as b, Pagination as q } from "../Pagination/Pagination.js";
7
+ import { defaultTranslations as f, SortTooltip as g } 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
+ }, $ = {
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 && $[s] || o;
63
+ return /* @__PURE__ */ w(N, { initialTranslations: i, children: [
64
+ /* @__PURE__ */ r("table", { ...m, className: p, children: l }),
65
+ _ && /* @__PURE__ */ r(q, { ..._, t: i })
66
+ ] });
67
+ }, B = ({ children: l, ...e }) => /* @__PURE__ */ r("thead", { ...e, children: l }), F = ({ children: l, ...e }) => /* @__PURE__ */ r("tbody", { ...e, children: l }), M = ({ 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
+ }, O = ({ 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
+ g,
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 = B;
116
+ d.TBody = F;
117
+ d.Tr = M;
118
+ d.Td = O;
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 };
@@ -0,0 +1,21 @@
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("react").RefAttributes<HTMLButtonElement>>;
9
+ export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,12 +1,13 @@
1
1
  import { jsx as I } from "react/jsx-runtime";
2
- import { a as S, T as U, s as y } from "../../Tabs.module-_kSbSyth.js";
3
2
  import * as f from "react";
4
- import { forwardRef as j, useContext as D, useMemo as $ } from "react";
5
- import { c as A } from "../../clsx-DB4S2d7J.js";
6
- import { e as O, _ as p, g as B, a as W, u as N, b as q, c as z, P as o, d as G, f as J } from "../../index-BZ1lkM_M.js";
7
- import { u as K, a as Q } from "../../useCompoundItem-B7wfGDHQ.js";
8
- import { a as X, L as E } from "../../ListContext-D6-YwtZn.js";
9
- import { u as Y } from "../../useButton-CbmjmH5z.js";
3
+ import { forwardRef as S, useContext as U, useMemo as j } from "react";
4
+ import { c as D } from "../../clsx-DB4S2d7J.js";
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, d as N, u as z, P as o, c as G, b as J } from "../../index-D2P7y2mE.js";
8
+ import { u as K, a as Q } from "../../useCompoundItem-CTYi5M_E.js";
9
+ import { L as X, a as E } from "../../ListContext-Dj2Va7Iv.js";
10
+ import { u as Y } from "../../useButton-JpyBo5M4.js";
10
11
  function Z(n) {
11
12
  const {
12
13
  handlePointerOverEvents: t = !1,
@@ -22,8 +23,8 @@ function Z(n) {
22
23
  selected: b,
23
24
  focusable: m
24
25
  } = i(e), h = f.useCallback((l) => (r) => {
25
- var u;
26
- if ((u = l.onClick) == null || u.call(l, r), !r.defaultPrevented) {
26
+ var d;
27
+ if ((d = l.onClick) == null || d.call(l, r), !r.defaultPrevented) {
27
28
  if (process.env.NODE_ENV !== "production" && e === void 0)
28
29
  throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
29
30
  `));
@@ -34,8 +35,8 @@ function Z(n) {
34
35
  });
35
36
  }
36
37
  }, [a, e]), P = f.useCallback((l) => (r) => {
37
- var u;
38
- if ((u = l.onMouseOver) == null || u.call(l, r), !r.defaultPrevented) {
38
+ var d;
39
+ if ((d = l.onMouseOver) == null || d.call(l, r), !r.defaultPrevented) {
39
40
  if (process.env.NODE_ENV !== "production" && e === void 0)
40
41
  throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
41
42
  `));
@@ -46,14 +47,14 @@ function Z(n) {
46
47
  });
47
48
  }
48
49
  }, [a, e]);
49
- let d;
50
- return m && (d = c ? 0 : -1), {
50
+ let u;
51
+ return m && (u = c ? 0 : -1), {
51
52
  getRootProps: (l = {}) => {
52
53
  const r = O(l);
53
54
  return p({}, l, {
54
55
  onClick: h(r),
55
56
  onPointerOver: t ? P(r) : void 0,
56
- tabIndex: d
57
+ tabIndex: u
57
58
  });
58
59
  },
59
60
  highlighted: c,
@@ -68,9 +69,9 @@ function ee(n, t) {
68
69
  }
69
70
  const w = "Tab";
70
71
  function te(n) {
71
- return B(w, n);
72
+ return W(w, n);
72
73
  }
73
- W(w, ["root", "selected", "disabled"]);
74
+ q(w, ["root", "selected", "disabled"]);
74
75
  function oe(n) {
75
76
  return n.size;
76
77
  }
@@ -84,20 +85,20 @@ function se(n) {
84
85
  value: b,
85
86
  selectionFollowsFocus: m,
86
87
  getTabPanelId: h
87
- } = S(), P = f.useMemo(() => ({
88
+ } = $(), P = f.useMemo(() => ({
88
89
  disabled: s,
89
90
  ref: i,
90
91
  id: c
91
92
  }), [s, i, c]), {
92
- id: d,
93
+ id: u,
93
94
  index: C,
94
95
  totalItemCount: l
95
96
  } = Q(t ?? oe, P), {
96
97
  getRootProps: r,
97
- highlighted: u,
98
+ highlighted: d,
98
99
  selected: g
99
100
  } = Z({
100
- item: d
101
+ item: u
101
102
  }), {
102
103
  getRootProps: v,
103
104
  rootRef: R,
@@ -108,7 +109,7 @@ function se(n) {
108
109
  disabled: s,
109
110
  focusableWhenDisabled: !m,
110
111
  type: "button"
111
- }), _ = N(i, e, R), H = d !== void 0 ? h(d) : void 0;
112
+ }), _ = N(i, e, R), H = u !== void 0 ? h(u) : void 0;
112
113
  return {
113
114
  getRootProps: (x = {}) => {
114
115
  const V = O(x), F = ee(r, v);
@@ -122,12 +123,12 @@ function se(n) {
122
123
  },
123
124
  active: T,
124
125
  focusVisible: L,
125
- highlighted: u,
126
+ highlighted: d,
126
127
  index: C,
127
128
  rootRef: _,
128
129
  // the `selected` state isn't set on the server (it relies on effects to be calculated),
129
130
  // so we fall back to checking the `value` prop with the selectedValue from the TabsContext
130
- selected: g || d === b,
131
+ selected: g || u === b,
131
132
  setFocusVisible: M,
132
133
  totalTabsCount: l
133
134
  };
@@ -148,13 +149,13 @@ const ne = ["action", "children", "disabled", "onChange", "onClick", "onFocus",
148
149
  slotProps: c = {},
149
150
  slots: b = {},
150
151
  value: m
151
- } = t, h = q(t, ne), P = f.useRef(), d = N(P, e), {
152
+ } = t, h = B(t, ne), P = f.useRef(), u = N(P, e), {
152
153
  active: C,
153
154
  highlighted: l,
154
155
  selected: r,
155
- getRootProps: u
156
+ getRootProps: d
156
157
  } = se(p({}, t, {
157
- rootRef: d,
158
+ rootRef: u,
158
159
  value: m
159
160
  })), g = p({}, t, {
160
161
  active: C,
@@ -163,7 +164,7 @@ const ne = ["action", "children", "disabled", "onChange", "onClick", "onFocus",
163
164
  selected: r
164
165
  }), v = re(g), R = (s = b.root) != null ? s : "button", T = z({
165
166
  elementType: R,
166
- getSlotProps: u,
167
+ getSlotProps: d,
167
168
  externalSlotProps: c.root,
168
169
  externalForwardedProps: h,
169
170
  additionalProps: {
@@ -222,15 +223,19 @@ process.env.NODE_ENV !== "production" && (k.propTypes = {
222
223
  */
223
224
  value: o.oneOfType([o.number, o.string])
224
225
  });
225
- const me = j(({
226
- children: n,
227
- value: t,
228
- disabled: e,
229
- dataTestId: s
230
- }, a) => {
231
- const i = D(U), c = $(() => A(y.tabs__tab, t === (i == null ? void 0 : i.value) && y["tabs__tab--selected"], e && y["tabs__tab--disabled"]), [t, i, e]);
232
- return /* @__PURE__ */ I(k, { className: c, disabled: e, value: t, "data-testid": s, ref: a, children: n });
233
- });
226
+ const he = S(
227
+ ({ children: n, value: t, disabled: e, dataTestId: s }, a) => {
228
+ const i = U(A), c = j(
229
+ () => D(
230
+ y.tabs__tab,
231
+ t === (i == null ? void 0 : i.value) && y["tabs__tab--selected"],
232
+ e && y["tabs__tab--disabled"]
233
+ ),
234
+ [t, i, e]
235
+ );
236
+ return /* @__PURE__ */ I(k, { className: c, disabled: e, value: t, "data-testid": s, ref: a, children: n });
237
+ }
238
+ );
234
239
  export {
235
- me as Tab
240
+ he as Tab
236
241
  };
@@ -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("react").RefAttributes<HTMLDivElement>>;
8
+ export declare const TabPanel: import('react').ForwardRefExoticComponent<TabPanelProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,14 +1,15 @@
1
1
  import { jsx as T } from "react/jsx-runtime";
2
- import { a as v, s as y } from "../../Tabs.module-_kSbSyth.js";
3
- import * as m from "react";
4
- import { forwardRef as x } from "react";
5
- import { g as C, a as N, u as _, _ as b, b as w, c as O, P as o, d as E, f as I } from "../../index-BZ1lkM_M.js";
6
- import { u as S, a as U } from "../../useCompoundItem-B7wfGDHQ.js";
2
+ import * as P from "react";
3
+ import { forwardRef as v } from "react";
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 _, d as w, u as O, P as o, c as E, b as I } from "../../index-D2P7y2mE.js";
7
+ import { u as S, a as U } from "../../useCompoundItem-CTYi5M_E.js";
7
8
  const h = "TabPanel";
8
9
  function j(t) {
9
- return C(h, t);
10
+ return N(h, t);
10
11
  }
11
- N(h, ["root", "hidden"]);
12
+ _(h, ["root", "hidden"]);
12
13
  function M(t) {
13
14
  return t.size;
14
15
  }
@@ -17,18 +18,18 @@ function V(t) {
17
18
  value: e,
18
19
  id: s,
19
20
  rootRef: n
20
- } = t, i = v();
21
+ } = t, i = y();
21
22
  if (i === null)
22
23
  throw new Error("No TabContext provided");
23
24
  const {
24
25
  value: f,
25
- getTabId: P
26
- } = i, a = S(s), r = m.useRef(null), c = _(r, n), u = m.useMemo(() => ({
26
+ getTabId: m
27
+ } = i, a = S(s), r = P.useRef(null), c = w(r, n), u = P.useMemo(() => ({
27
28
  id: a,
28
29
  ref: r
29
30
  }), [a]), {
30
31
  id: l
31
- } = U(e ?? M, u), d = l !== f, p = l !== void 0 ? P(l) : void 0;
32
+ } = U(e ?? M, u), d = l !== f, p = l !== void 0 ? m(l) : void 0;
32
33
  return {
33
34
  hidden: d,
34
35
  getRootProps: (g = {}) => b({
@@ -48,18 +49,18 @@ const F = ["children", "value", "slotProps", "slots"], $ = (t) => {
48
49
  return E({
49
50
  root: ["root", e && "hidden"]
50
51
  }, I(j));
51
- }, R = /* @__PURE__ */ m.forwardRef(function(e, s) {
52
+ }, R = /* @__PURE__ */ P.forwardRef(function(e, s) {
52
53
  var n;
53
54
  const {
54
55
  children: i,
55
56
  slotProps: f = {},
56
- slots: P = {}
57
- } = e, a = w(e, F), {
57
+ slots: m = {}
58
+ } = e, a = C(e, F), {
58
59
  hidden: r,
59
60
  getRootProps: c
60
61
  } = V(e), u = b({}, e, {
61
62
  hidden: r
62
- }), l = $(u), d = (n = P.root) != null ? n : "div", p = O({
63
+ }), l = $(u), d = (n = m.root) != null ? n : "div", p = O({
63
64
  elementType: d,
64
65
  getSlotProps: c,
65
66
  externalSlotProps: f.root,
@@ -110,11 +111,9 @@ process.env.NODE_ENV !== "production" && (R.propTypes = {
110
111
  */
111
112
  value: o.oneOfType([o.number, o.string])
112
113
  });
113
- const W = x(({
114
- children: t,
115
- value: e,
116
- dataTestId: s
117
- }, n) => /* @__PURE__ */ T(R, { className: y["tabs__tab-panel"], value: e, "data-testid": s, ref: n, children: t }));
114
+ const q = v(
115
+ ({ children: t, value: e, dataTestId: s }, n) => /* @__PURE__ */ T(R, { className: x["tabs__tab-panel"], value: e, "data-testid": s, ref: n, children: t })
116
+ );
118
117
  export {
119
- W as TabPanel
118
+ q as TabPanel
120
119
  };