@pismo/marola 0.0.1-alpha.18 → 0.0.1-alpha.2

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 (145) hide show
  1. package/README.md +5 -17
  2. package/dist/Button-REznN-RP.js +1139 -0
  3. package/dist/Dialog.module-BO0mdB7d.js +15 -0
  4. package/dist/assets/CallToActionButton.css +1 -0
  5. package/dist/assets/Dialog.css +1 -1
  6. package/dist/assets/LoadingSpinner.css +1 -1
  7. package/dist/assets/Typography.css +1 -1
  8. package/dist/assets/main.css +1 -0
  9. package/dist/components/CallToActionButton/CallToActionButton.d.ts +23 -0
  10. package/dist/components/CallToActionButton/CallToActionButton.js +57 -0
  11. package/dist/components/Dialog/Actions.js +1 -1
  12. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  13. package/dist/components/Dialog/Backdrop.js +9 -2
  14. package/dist/components/Dialog/CloseIconButton.js +10 -11
  15. package/dist/components/Dialog/Dialog.d.ts +4 -5
  16. package/dist/components/Dialog/Dialog.js +20103 -445
  17. package/dist/components/Dialog/Title.js +7 -22
  18. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
  19. package/dist/components/LoadingSpinner/LoadingSpinner.js +13 -12
  20. package/dist/components/Typography/Typography.d.ts +6 -17
  21. package/dist/components/Typography/Typography.js +64 -85
  22. package/dist/main.d.ts +3 -25
  23. package/dist/main.js +15 -62
  24. package/dist/types/helpers.d.ts +7 -14
  25. package/package.json +9 -51
  26. package/src/playground/Playground.tsx +58 -0
  27. package/dist/Button-2b1peDFT.js +0 -130
  28. package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
  29. package/dist/Dialog.module-B8COssqi.js +0 -15
  30. package/dist/Popup-B6ZSGIEI.js +0 -1248
  31. package/dist/Portal-DIeBsWdL.js +0 -73
  32. package/dist/SelectButton-pciwIWcj.js +0 -46
  33. package/dist/Tabs.module-jkH1Qjn7.js +0 -22
  34. package/dist/assets/Advice.css +0 -1
  35. package/dist/assets/Button.css +0 -1
  36. package/dist/assets/Checkbox.css +0 -1
  37. package/dist/assets/Chip.css +0 -1
  38. package/dist/assets/IconButton.css +0 -1
  39. package/dist/assets/Input.css +0 -1
  40. package/dist/assets/InputSearch.css +0 -1
  41. package/dist/assets/PageHeader.css +0 -1
  42. package/dist/assets/Pagination.css +0 -1
  43. package/dist/assets/SelectButton.css +0 -1
  44. package/dist/assets/Skeleton.css +0 -1
  45. package/dist/assets/Snackbar.css +0 -1
  46. package/dist/assets/SortTooltip.css +0 -1
  47. package/dist/assets/Stepper.css +0 -1
  48. package/dist/assets/Table.css +0 -1
  49. package/dist/assets/Tabs.css +0 -1
  50. package/dist/assets/TextDisplay.css +0 -1
  51. package/dist/assets/Toggle.css +0 -1
  52. package/dist/assets/Tooltip.css +0 -1
  53. package/dist/combineHooksSlotProps-DVjg9PRh.js +0 -80
  54. package/dist/components/Advice/Advice.d.ts +0 -28
  55. package/dist/components/Advice/Advice.js +0 -25
  56. package/dist/components/Advice/Advice.stories.d.ts +0 -16
  57. package/dist/components/Button/Button.d.ts +0 -32
  58. package/dist/components/Button/Button.js +0 -94
  59. package/dist/components/Button/Button.stories.d.ts +0 -62
  60. package/dist/components/Checkbox/Checkbox.d.ts +0 -34
  61. package/dist/components/Checkbox/Checkbox.js +0 -56
  62. package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
  63. package/dist/components/Chip/Chip.d.ts +0 -37
  64. package/dist/components/Chip/Chip.js +0 -143
  65. package/dist/components/Chip/Chip.stories.d.ts +0 -40
  66. package/dist/components/Chip/chip.test.d.ts +0 -1
  67. package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
  68. package/dist/components/Icon/Icon.d.ts +0 -27
  69. package/dist/components/Icon/Icon.js +0 -116
  70. package/dist/components/Icon/Icon.stories.d.ts +0 -16
  71. package/dist/components/IconButton/Icon.stories.d.ts +0 -15
  72. package/dist/components/IconButton/IconButton.d.ts +0 -36
  73. package/dist/components/IconButton/IconButton.js +0 -70
  74. package/dist/components/Input/Input.d.ts +0 -44
  75. package/dist/components/Input/Input.js +0 -496
  76. package/dist/components/Input/Input.stories.d.ts +0 -43
  77. package/dist/components/InputSearch/InputSearch.d.ts +0 -9
  78. package/dist/components/InputSearch/InputSearch.js +0 -34
  79. package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -39
  80. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -14
  81. package/dist/components/PageHeader/PageHeader.d.ts +0 -36
  82. package/dist/components/PageHeader/PageHeader.js +0 -51
  83. package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -43
  84. package/dist/components/Pagination/Pagination.d.ts +0 -55
  85. package/dist/components/Pagination/Pagination.js +0 -222
  86. package/dist/components/Pagination/Pagination.stories.d.ts +0 -17
  87. package/dist/components/Select/Select.d.ts +0 -26
  88. package/dist/components/Select/Select.js +0 -857
  89. package/dist/components/Select/Select.stories.d.ts +0 -22
  90. package/dist/components/Select/SelectButton.d.ts +0 -12
  91. package/dist/components/Select/SelectButton.js +0 -8
  92. package/dist/components/Skeleton/Skeleton.d.ts +0 -25
  93. package/dist/components/Skeleton/Skeleton.js +0 -23
  94. package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -14
  95. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -14
  96. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -16
  97. package/dist/components/Snackbar/Snackbar.d.ts +0 -25
  98. package/dist/components/Snackbar/Snackbar.js +0 -622
  99. package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -318
  100. package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
  101. package/dist/components/SortTooltip/SortTooltip.js +0 -78
  102. package/dist/components/Stepper/Stepper.d.ts +0 -26
  103. package/dist/components/Stepper/Stepper.js +0 -33
  104. package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
  105. package/dist/components/Table/Table.d.ts +0 -39
  106. package/dist/components/Table/Table.js +0 -120
  107. package/dist/components/Table/TableContext.d.ts +0 -19
  108. package/dist/components/Table/TableContext.js +0 -21
  109. package/dist/components/Tabs/Tab.d.ts +0 -14
  110. package/dist/components/Tabs/Tab.js +0 -181
  111. package/dist/components/Tabs/Tab.stories.d.ts +0 -15
  112. package/dist/components/Tabs/TabPanel.d.ts +0 -12
  113. package/dist/components/Tabs/TabPanel.js +0 -118
  114. package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
  115. package/dist/components/Tabs/Tabs.d.ts +0 -15
  116. package/dist/components/Tabs/Tabs.js +0 -401
  117. package/dist/components/Tabs/Tabs.stories.d.ts +0 -14
  118. package/dist/components/TextDisplay/TextDisplay.d.ts +0 -23
  119. package/dist/components/TextDisplay/TextDisplay.js +0 -37
  120. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -13
  121. package/dist/components/TextDisplay/textDisplay.test.d.ts +0 -1
  122. package/dist/components/Toggle/Toggle.d.ts +0 -11
  123. package/dist/components/Toggle/Toggle.js +0 -251
  124. package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
  125. package/dist/components/Tooltip/Tooltip.d.ts +0 -29
  126. package/dist/components/Tooltip/Tooltip.js +0 -139
  127. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -33
  128. package/dist/components/Typography/Typography.stories.d.ts +0 -32
  129. package/dist/components/Typography/typography.test.d.ts +0 -1
  130. package/dist/index-CH45lKw7.js +0 -840
  131. package/dist/index-CjW42-M-.js +0 -19584
  132. package/dist/marola.css +0 -1
  133. package/dist/test-utils/assertStyles.d.ts +0 -1
  134. package/dist/test-utils/assertStyles.js +0 -11
  135. package/dist/useButton-DNk3wrQp.js +0 -105
  136. package/dist/useCompoundItem-D1iRfg8D.js +0 -84
  137. package/dist/useControlled-CCMYYdCM.js +0 -31
  138. package/dist/useEnhancedEffect-CJGo-L3B.js +0 -5
  139. package/dist/useEventCallback-xTG9piMa.js +0 -45
  140. package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
  141. package/dist/useList-B0hog_3-.js +0 -436
  142. package/dist/useTimeout-DxF9kiZL.js +0 -36
  143. package/dist/utils/styleStrings.d.ts +0 -6
  144. package/dist/utils/styleStrings.js +0 -10
  145. package/dist/utils/styleStrings.test.d.ts +0 -1
@@ -1,120 +0,0 @@
1
- import '../../assets/Table.css';
2
- import { jsxs as x, jsx as r } from "react/jsx-runtime";
3
- import * as n from "react";
4
- import { useState as v } from "react";
5
- import { c as h } from "../../clsx-DB4S2d7J.js";
6
- import { paginationDefaultTranslations as m, Pagination as T } from "../Pagination/Pagination.js";
7
- import { sortTooltipDefaultTranslations as w, SortTooltip as u } from "../SortTooltip/SortTooltip.js";
8
- import { TableProvider as g, useTable as N } from "./TableContext.js";
9
- const C = (l) => /* @__PURE__ */ n.createElement("svg", { width: 7, height: 10, viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ n.createElement("g", { clipPath: "url(#clip0_2291_2457)" }, /* @__PURE__ */ n.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__ */ n.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__ */ n.createElement("defs", null, /* @__PURE__ */ n.createElement("clipPath", { id: "clip0_2291_2457" }, /* @__PURE__ */ n.createElement("rect", { width: 7, height: 10, fill: "white" })))), L = "_table_olvxb_1", E = "_th__wrapper_olvxb_40", y = "_tr_olvxb_58", P = "_td_olvxb_62", t = {
10
- table: L,
11
- "table--full-width": "_table--full-width_olvxb_5",
12
- "table--white-theme": "_table--white-theme_olvxb_8",
13
- "table--transparent-theme": "_table--transparent-theme_olvxb_11",
14
- "cell--left-alignment": "_cell--left-alignment_olvxb_14",
15
- "cell--center-alignment": "_cell--center-alignment_olvxb_18",
16
- "cell--right-alignment": "_cell--right-alignment_olvxb_22",
17
- th__wrapper: E,
18
- "th__wrapper--pressed": "_th__wrapper--pressed_olvxb_43",
19
- "th__wrapper--clickable": "_th__wrapper--clickable_olvxb_47",
20
- "th__sort-icon-container": "_th__sort-icon-container_olvxb_50",
21
- "tr__row-or-cell--disabled": "_tr__row-or-cell--disabled_olvxb_58",
22
- tr: y,
23
- td: P,
24
- "tr__row-or-cell--clickable": "_tr__row-or-cell--clickable_olvxb_67",
25
- "td__row-or-cell--clickable": "_td__row-or-cell--clickable_olvxb_68",
26
- "td__row-or-cell--disabled": "_td__row-or-cell--disabled_olvxb_72",
27
- "td-wrapper": "_td-wrapper_olvxb_76"
28
- }, B = {
29
- pt: {
30
- ...m.pt,
31
- ...w.pt
32
- },
33
- en: {
34
- ...m.en,
35
- ...w.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: s,
52
- paginationProps: o,
53
- language: _,
54
- translations: c,
55
- ...b
56
- }) => {
57
- const i = h(
58
- t.table,
59
- a ? t["table--full-width"] : "",
60
- t[`table--${e}-theme`],
61
- s
62
- ), p = _ && B[_] || c;
63
- return /* @__PURE__ */ x(g, { initialTranslations: p, children: [
64
- /* @__PURE__ */ r("table", { ...b, className: i, children: l }),
65
- o && /* @__PURE__ */ r(T, { ...o, t: p })
66
- ] });
67
- }, D = ({ 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: s, ...o }) => {
68
- const _ = h(
69
- t.tr,
70
- e && !a ? t["tr__row-or-cell--clickable"] : a ? t["tr__row-or-cell--disabled"] : "",
71
- s
72
- );
73
- return /* @__PURE__ */ r("tr", { ...o, className: _, onClick: () => !a && (e == null ? void 0 : e()), children: l });
74
- }, $ = ({ children: l, onClick: e, disabled: a, className: s, align: o = "left", ..._ }) => {
75
- const c = h(
76
- t.td,
77
- e && !a ? t["td__row-or-cell--clickable"] : a ? t["td__row-or-cell--disabled"] : "",
78
- t[`cell--${o}-alignment`],
79
- s
80
- );
81
- return /* @__PURE__ */ r("td", { ..._, className: c, 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: s,
87
- classNameTooltip: o,
88
- align: _ = "left",
89
- ...c
90
- }) => {
91
- const { translations: b } = N(), [i, p] = v(!1), f = h(
92
- t.th__wrapper,
93
- i ? t["th__wrapper--pressed"] : "",
94
- e ? t["th__wrapper--clickable"] : "",
95
- s
96
- );
97
- return /* @__PURE__ */ r("th", { ...c, className: t[`cell--${_}-alignment`], children: /* @__PURE__ */ r("span", { className: f, onClick: e && (() => p(!i)), children: e ? /* @__PURE__ */ x(
98
- u,
99
- {
100
- onClose: () => p(!1),
101
- onSort: e,
102
- show: i,
103
- sortType: a,
104
- className: o,
105
- t: b,
106
- children: [
107
- /* @__PURE__ */ r("span", { children: l }),
108
- /* @__PURE__ */ r("span", { className: t["th__sort-icon-container"], children: /* @__PURE__ */ r(C, {}) })
109
- ]
110
- }
111
- ) : /* @__PURE__ */ r("span", { children: l }) }) });
112
- };
113
- d.THead = D;
114
- d.TBody = M;
115
- d.Tr = O;
116
- d.Td = $;
117
- d.Th = j;
118
- export {
119
- d as Table
120
- };
@@ -1,19 +0,0 @@
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,21 +0,0 @@
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
- };
@@ -1,14 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- export interface TabProps {
4
- /** The value to be showing in the tab */
5
- children: ReactNode;
6
- /** The value that corresponds to the panel to show.
7
- * e.g. value="1" when this tab is clicked it will show the panel which also has value="1! */
8
- value: string | number;
9
- /** Disable clicking the tab */
10
- disabled?: boolean;
11
- /** data test id */
12
- dataTestId?: string;
13
- }
14
- export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,181 +0,0 @@
1
- import { jsx as N } from "react/jsx-runtime";
2
- import * as b from "react";
3
- import { forwardRef as H, useContext as U, useMemo as j } from "react";
4
- import { c as k } from "../../clsx-DB4S2d7J.js";
5
- import { u as B, T as D, s as y } from "../../Tabs.module-jkH1Qjn7.js";
6
- import { g as L, a as W, u as O, f as $, b as d, _ as q, c as z, P as e, d as A, e as G } from "../../index-CH45lKw7.js";
7
- import { u as J, c as K } from "../../combineHooksSlotProps-DVjg9PRh.js";
8
- import { u as Q, a as X } from "../../useCompoundItem-D1iRfg8D.js";
9
- import { u as Y } from "../../useButton-DNk3wrQp.js";
10
- const E = "Tab";
11
- function Z(o) {
12
- return L(E, o);
13
- }
14
- W(E, ["root", "selected", "disabled"]);
15
- function ee(o) {
16
- return o.size;
17
- }
18
- function te(o) {
19
- const {
20
- value: t,
21
- rootRef: s,
22
- disabled: n = !1,
23
- id: c
24
- } = o, a = b.useRef(null), r = Q(c), {
25
- value: f,
26
- selectionFollowsFocus: p,
27
- getTabPanelId: m
28
- } = B(), P = b.useMemo(() => ({
29
- disabled: n,
30
- ref: a,
31
- id: r
32
- }), [n, a, r]), {
33
- id: l,
34
- index: R,
35
- totalItemCount: g
36
- } = X(t ?? ee, P), {
37
- getRootProps: h,
38
- highlighted: T,
39
- selected: i
40
- } = J({
41
- item: l
42
- }), {
43
- getRootProps: C,
44
- rootRef: u,
45
- active: v,
46
- focusVisible: I,
47
- setFocusVisible: V
48
- } = Y({
49
- disabled: n,
50
- focusableWhenDisabled: !p,
51
- type: "button"
52
- }), _ = O(a, s, u), M = l !== void 0 ? m(l) : void 0;
53
- return {
54
- getRootProps: (x = {}) => {
55
- const S = $(x), w = K(h, C);
56
- return d({}, x, w(S), {
57
- role: "tab",
58
- "aria-controls": M,
59
- "aria-selected": i,
60
- id: r,
61
- ref: _
62
- });
63
- },
64
- active: v,
65
- focusVisible: I,
66
- highlighted: T,
67
- index: R,
68
- rootRef: _,
69
- // the `selected` state isn't set on the server (it relies on effects to be calculated),
70
- // so we fall back to checking the `value` prop with the selectedValue from the TabsContext
71
- selected: i || l === f,
72
- setFocusVisible: V,
73
- totalTabsCount: g
74
- };
75
- }
76
- const oe = ["action", "children", "disabled", "onChange", "onClick", "onFocus", "slotProps", "slots", "value"], se = (o) => {
77
- const {
78
- selected: t,
79
- disabled: s
80
- } = o;
81
- return A({
82
- root: ["root", t && "selected", s && "disabled"]
83
- }, G(Z));
84
- }, F = /* @__PURE__ */ b.forwardRef(function(t, s) {
85
- var n;
86
- const {
87
- children: c,
88
- disabled: a = !1,
89
- slotProps: r = {},
90
- slots: f = {},
91
- value: p
92
- } = t, m = q(t, oe), P = b.useRef(), l = O(P, s), {
93
- active: R,
94
- highlighted: g,
95
- selected: h,
96
- getRootProps: T
97
- } = te(d({}, t, {
98
- rootRef: l,
99
- value: p
100
- })), i = d({}, t, {
101
- active: R,
102
- disabled: a,
103
- highlighted: g,
104
- selected: h
105
- }), C = se(i), u = (n = f.root) != null ? n : "button", v = z({
106
- elementType: u,
107
- getSlotProps: T,
108
- externalSlotProps: r.root,
109
- externalForwardedProps: m,
110
- additionalProps: {
111
- ref: s
112
- },
113
- ownerState: i,
114
- className: C.root
115
- });
116
- return /* @__PURE__ */ N(u, d({}, v, {
117
- children: c
118
- }));
119
- });
120
- process.env.NODE_ENV !== "production" && (F.propTypes = {
121
- // ┌────────────────────────────── Warning ──────────────────────────────┐
122
- // │ These PropTypes are generated from the TypeScript type definitions. │
123
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
124
- // └─────────────────────────────────────────────────────────────────────┘
125
- /**
126
- * A ref for imperative actions. It currently only supports `focusVisible()` action.
127
- */
128
- action: e.oneOfType([e.func, e.shape({
129
- current: e.shape({
130
- focusVisible: e.func.isRequired
131
- })
132
- })]),
133
- /**
134
- * @ignore
135
- */
136
- children: e.node,
137
- /**
138
- * If `true`, the component is disabled.
139
- * @default false
140
- */
141
- disabled: e.bool,
142
- /**
143
- * Callback invoked when new value is being set.
144
- */
145
- onChange: e.func,
146
- /**
147
- * The props used for each slot inside the Tab.
148
- * @default {}
149
- */
150
- slotProps: e.shape({
151
- root: e.oneOfType([e.func, e.object])
152
- }),
153
- /**
154
- * The components used for each slot inside the Tab.
155
- * Either a string to use a HTML element or a component.
156
- * @default {}
157
- */
158
- slots: e.shape({
159
- root: e.elementType
160
- }),
161
- /**
162
- * You can provide your own value. Otherwise, it falls back to the child position index.
163
- */
164
- value: e.oneOfType([e.number, e.string])
165
- });
166
- const fe = H(
167
- ({ children: o, value: t, disabled: s, dataTestId: n }, c) => {
168
- const a = U(D), r = j(
169
- () => k(
170
- y.tabs__tab,
171
- t === (a == null ? void 0 : a.value) && y["tabs__tab--selected"],
172
- s && y["tabs__tab--disabled"]
173
- ),
174
- [t, a, s]
175
- );
176
- return /* @__PURE__ */ N(F, { className: r, disabled: s, value: t, "data-testid": n, ref: c, children: o });
177
- }
178
- );
179
- export {
180
- fe as Tab
181
- };
@@ -1,15 +0,0 @@
1
- import { TabProps } from './Tabs.tsx';
2
- import { StoryObj } from '@storybook/react';
3
-
4
- declare const meta: {
5
- title: string;
6
- component: import('react').ForwardRefExoticComponent<TabProps & import('react').RefAttributes<HTMLButtonElement>>;
7
- tags: string[];
8
- parameters: {
9
- layout: string;
10
- };
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof meta>;
14
- export declare const Simple: Story;
15
- export declare const Disabled: Story;
@@ -1,12 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- export interface TabPanelProps {
4
- /** The content to be displayed when the corresponding tab is selected */
5
- children: ReactNode;
6
- /** The value that identifies which tab is selected.
7
- * e.g. value="1" when the tab button with the value="1" is selected this content will show */
8
- value: string | number;
9
- /** Test id */
10
- dataTestId?: string;
11
- }
12
- export declare const TabPanel: import('react').ForwardRefExoticComponent<TabPanelProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,118 +0,0 @@
1
- import { jsx as T } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { forwardRef as v } from "react";
4
- import { u as y, s as x } from "../../Tabs.module-jkH1Qjn7.js";
5
- import { g as C, a as N, u as _, b, _ as w, c as O, P as o, d as E, e as I } from "../../index-CH45lKw7.js";
6
- import { u as S, a as U } from "../../useCompoundItem-D1iRfg8D.js";
7
- const h = "TabPanel";
8
- function j(t) {
9
- return C(h, t);
10
- }
11
- N(h, ["root", "hidden"]);
12
- function M(t) {
13
- return t.size;
14
- }
15
- function V(t) {
16
- const {
17
- value: e,
18
- id: s,
19
- rootRef: n
20
- } = t, i = y();
21
- if (i === null)
22
- throw new Error("No TabContext provided");
23
- const {
24
- value: f,
25
- getTabId: P
26
- } = i, a = S(s), r = m.useRef(null), c = _(r, n), u = m.useMemo(() => ({
27
- id: a,
28
- ref: r
29
- }), [a]), {
30
- id: l
31
- } = U(e ?? M, u), d = l !== f, p = l !== void 0 ? P(l) : void 0;
32
- return {
33
- hidden: d,
34
- getRootProps: (g = {}) => b({
35
- "aria-labelledby": p ?? void 0,
36
- hidden: d,
37
- id: a ?? void 0
38
- }, g, {
39
- ref: c
40
- }),
41
- rootRef: c
42
- };
43
- }
44
- const F = ["children", "value", "slotProps", "slots"], $ = (t) => {
45
- const {
46
- hidden: e
47
- } = t;
48
- return E({
49
- root: ["root", e && "hidden"]
50
- }, I(j));
51
- }, R = /* @__PURE__ */ m.forwardRef(function(e, s) {
52
- var n;
53
- const {
54
- children: i,
55
- slotProps: f = {},
56
- slots: P = {}
57
- } = e, a = w(e, F), {
58
- hidden: r,
59
- getRootProps: c
60
- } = V(e), u = b({}, e, {
61
- hidden: r
62
- }), l = $(u), d = (n = P.root) != null ? n : "div", p = O({
63
- elementType: d,
64
- getSlotProps: c,
65
- externalSlotProps: f.root,
66
- externalForwardedProps: a,
67
- additionalProps: {
68
- role: "tabpanel",
69
- ref: s
70
- },
71
- ownerState: u,
72
- className: l.root
73
- });
74
- return /* @__PURE__ */ T(d, b({}, p, {
75
- children: !r && i
76
- }));
77
- });
78
- process.env.NODE_ENV !== "production" && (R.propTypes = {
79
- // ┌────────────────────────────── Warning ──────────────────────────────┐
80
- // │ These PropTypes are generated from the TypeScript type definitions. │
81
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
82
- // └─────────────────────────────────────────────────────────────────────┘
83
- /**
84
- * The content of the component.
85
- */
86
- children: o.node,
87
- /**
88
- * @ignore
89
- */
90
- className: o.string,
91
- /**
92
- * The props used for each slot inside the TabPanel.
93
- * @default {}
94
- */
95
- slotProps: o.shape({
96
- root: o.oneOfType([o.func, o.object])
97
- }),
98
- /**
99
- * The components used for each slot inside the TabPanel.
100
- * Either a string to use a HTML element or a component.
101
- * @default {}
102
- */
103
- slots: o.shape({
104
- root: o.elementType
105
- }),
106
- /**
107
- * The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected.
108
- * If not provided, it will fall back to the index of the panel.
109
- * It is recommended to explicitly provide it, as it's required for the tab panel to be rendered on the server.
110
- */
111
- value: o.oneOfType([o.number, o.string])
112
- });
113
- const W = v(
114
- ({ children: t, value: e, dataTestId: s }, n) => /* @__PURE__ */ T(R, { className: x["tabs__tab-panel"], value: e, "data-testid": s, ref: n, children: t })
115
- );
116
- export {
117
- W as TabPanel
118
- };
@@ -1,14 +0,0 @@
1
- import { TabPanelProps } from './Tabs.tsx';
2
- import { StoryObj } from '@storybook/react';
3
-
4
- declare const meta: {
5
- title: string;
6
- component: import('react').ForwardRefExoticComponent<TabPanelProps & import('react').RefAttributes<HTMLDivElement>>;
7
- tags: string[];
8
- parameters: {
9
- layout: string;
10
- };
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof meta>;
14
- export declare const Simple: Story;
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- export interface TabsProps {
4
- /** Should contain `Tab` and `TabPanel` components to be rendered */
5
- children?: ReactNode;
6
- /** Selected tab */
7
- value?: number | string;
8
- /** Callback triggered when the user has selected a tab */
9
- onChange?: (tabValue: number | string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
10
- /** Test id */
11
- dataTestId?: string;
12
- }
13
- export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import('react').RefAttributes<HTMLDivElement>>;
14
- export * from './Tab';
15
- export * from './TabPanel';