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

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 (176) hide show
  1. package/README.md +5 -17
  2. package/dist/{Button-2b1peDFT.js → Button-C3Qm852g.js} +23 -23
  3. package/dist/Dialog.module-BO0mdB7d.js +15 -0
  4. package/dist/ListContext-D6-YwtZn.js +18 -0
  5. package/dist/Tabs.module-_kSbSyth.js +66 -0
  6. package/dist/assets/CallToActionButton.css +1 -0
  7. package/dist/assets/Dialog.css +1 -1
  8. package/dist/assets/LoadingSpinner.css +1 -1
  9. package/dist/assets/Tabs.css +1 -1
  10. package/dist/assets/Typography.css +1 -1
  11. package/dist/assets/main.css +1 -0
  12. package/dist/components/CallToActionButton/CallToActionButton.d.ts +21 -0
  13. package/dist/components/CallToActionButton/CallToActionButton.js +57 -0
  14. package/dist/components/Dialog/Actions.js +1 -1
  15. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  16. package/dist/components/Dialog/Backdrop.js +9 -2
  17. package/dist/components/Dialog/CloseIconButton.js +124 -12
  18. package/dist/components/Dialog/Dialog.d.ts +5 -6
  19. package/dist/components/Dialog/Dialog.js +20103 -445
  20. package/dist/components/Dialog/{DialogTitle.d.ts → Title.d.ts} +3 -3
  21. package/dist/components/Dialog/Title.js +14 -0
  22. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
  23. package/dist/components/LoadingSpinner/LoadingSpinner.js +13 -12
  24. package/dist/components/Tabs/Tab.d.ts +1 -6
  25. package/dist/components/Tabs/Tab.js +173 -118
  26. package/dist/components/Tabs/TabPanel.d.ts +1 -5
  27. package/dist/components/Tabs/TabPanel.js +10 -8
  28. package/dist/components/Tabs/Tabs.d.ts +2 -8
  29. package/dist/components/Tabs/Tabs.js +701 -250
  30. package/dist/components/Typography/Typography.d.ts +6 -17
  31. package/dist/components/Typography/Typography.js +64 -55
  32. package/dist/{index-CH45lKw7.js → index-BZ1lkM_M.js} +159 -162
  33. package/dist/main.d.ts +5 -27
  34. package/dist/main.js +21 -75
  35. package/dist/types/helpers.d.ts +7 -14
  36. package/dist/useButton-CbmjmH5z.js +186 -0
  37. package/dist/useCompoundItem-B7wfGDHQ.js +41 -0
  38. package/package.json +9 -50
  39. package/src/playground/Playground.tsx +20 -0
  40. package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
  41. package/dist/Dialog.module-DFEmFdYT.js +0 -30
  42. package/dist/Group-B3p31ftp.js +0 -26
  43. package/dist/Popup-B6ZSGIEI.js +0 -1248
  44. package/dist/Portal-DIeBsWdL.js +0 -73
  45. package/dist/SelectButton-C8JQKaf4.js +0 -61
  46. package/dist/Tabs.module-jkH1Qjn7.js +0 -22
  47. package/dist/Toggle-BCgIItCc.js +0 -142
  48. package/dist/assets/Advice.css +0 -1
  49. package/dist/assets/Button.css +0 -1
  50. package/dist/assets/Checkbox.css +0 -1
  51. package/dist/assets/EllipsisTooltip.css +0 -1
  52. package/dist/assets/Group.css +0 -1
  53. package/dist/assets/IconButton.css +0 -1
  54. package/dist/assets/Input.css +0 -1
  55. package/dist/assets/InputSearch.css +0 -1
  56. package/dist/assets/PageHeader.css +0 -1
  57. package/dist/assets/Pagination.css +0 -1
  58. package/dist/assets/SelectButton.css +0 -1
  59. package/dist/assets/Skeleton.css +0 -1
  60. package/dist/assets/Snackbar.css +0 -1
  61. package/dist/assets/SortTooltip.css +0 -1
  62. package/dist/assets/Stepper.css +0 -1
  63. package/dist/assets/Table.css +0 -1
  64. package/dist/assets/TextDisplay.css +0 -1
  65. package/dist/assets/Toggle.css +0 -1
  66. package/dist/assets/Toggle2.css +0 -1
  67. package/dist/assets/Tooltip.css +0 -1
  68. package/dist/combineHooksSlotProps-DVjg9PRh.js +0 -80
  69. package/dist/components/Advice/Advice.d.ts +0 -30
  70. package/dist/components/Advice/Advice.js +0 -47
  71. package/dist/components/Advice/Advice.stories.d.ts +0 -18
  72. package/dist/components/Button/Button.d.ts +0 -32
  73. package/dist/components/Button/Button.js +0 -65
  74. package/dist/components/Button/Button.stories.d.ts +0 -62
  75. package/dist/components/Checkbox/Checkbox.d.ts +0 -34
  76. package/dist/components/Checkbox/Checkbox.js +0 -71
  77. package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
  78. package/dist/components/Chip/Chip.d.ts +0 -39
  79. package/dist/components/Chip/Chip.js +0 -19
  80. package/dist/components/Chip/Chip.stories.d.ts +0 -42
  81. package/dist/components/Chip/chip.test.d.ts +0 -1
  82. package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
  83. package/dist/components/Dialog/DialogTitle.js +0 -29
  84. package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -7
  85. package/dist/components/EllipsisTooltip/EllipsisTooltip.js +0 -23
  86. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +0 -31
  87. package/dist/components/Icon/Icon.d.ts +0 -11
  88. package/dist/components/Icon/Icon.js +0 -127
  89. package/dist/components/Icon/Icon.stories.d.ts +0 -15
  90. package/dist/components/Icon/types.d.ts +0 -5
  91. package/dist/components/Icon/types.js +0 -1
  92. package/dist/components/IconButton/Icon.stories.d.ts +0 -15
  93. package/dist/components/IconButton/IconButton.d.ts +0 -38
  94. package/dist/components/IconButton/IconButton.js +0 -63
  95. package/dist/components/Input/Input.d.ts +0 -44
  96. package/dist/components/Input/Input.js +0 -508
  97. package/dist/components/Input/Input.stories.d.ts +0 -43
  98. package/dist/components/InputSearch/InputSearch.d.ts +0 -9
  99. package/dist/components/InputSearch/InputSearch.js +0 -34
  100. package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -39
  101. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -14
  102. package/dist/components/PageHeader/PageHeader.d.ts +0 -66
  103. package/dist/components/PageHeader/PageHeader.js +0 -87
  104. package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -14
  105. package/dist/components/Pagination/Pagination.d.ts +0 -55
  106. package/dist/components/Pagination/Pagination.js +0 -237
  107. package/dist/components/Pagination/Pagination.stories.d.ts +0 -17
  108. package/dist/components/Select/Select.d.ts +0 -26
  109. package/dist/components/Select/Select.js +0 -857
  110. package/dist/components/Select/Select.stories.d.ts +0 -22
  111. package/dist/components/Select/SelectButton.d.ts +0 -12
  112. package/dist/components/Select/SelectButton.js +0 -8
  113. package/dist/components/Skeleton/Skeleton.d.ts +0 -25
  114. package/dist/components/Skeleton/Skeleton.js +0 -23
  115. package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -14
  116. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -14
  117. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -16
  118. package/dist/components/Snackbar/Snackbar.d.ts +0 -27
  119. package/dist/components/Snackbar/Snackbar.js +0 -639
  120. package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -319
  121. package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
  122. package/dist/components/SortTooltip/SortTooltip.js +0 -93
  123. package/dist/components/Stepper/Stepper.d.ts +0 -26
  124. package/dist/components/Stepper/Stepper.js +0 -48
  125. package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
  126. package/dist/components/Table/Table.d.ts +0 -56
  127. package/dist/components/Table/Table.js +0 -137
  128. package/dist/components/Table/Table.stories.d.ts +0 -29
  129. package/dist/components/Table/TableContext.d.ts +0 -19
  130. package/dist/components/Table/TableContext.js +0 -21
  131. package/dist/components/Table/_Table.TBody.stories.d.ts +0 -14
  132. package/dist/components/Table/_Table.THead.stories.d.ts +0 -14
  133. package/dist/components/Table/_Table.Td.stories.d.ts +0 -16
  134. package/dist/components/Table/_Table.Th.stories.d.ts +0 -15
  135. package/dist/components/Table/_Table.Tr.stories.d.ts +0 -15
  136. package/dist/components/Tabs/Tab.stories.d.ts +0 -15
  137. package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
  138. package/dist/components/Tabs/Tabs.stories.d.ts +0 -14
  139. package/dist/components/TextDisplay/TextDisplay.d.ts +0 -23
  140. package/dist/components/TextDisplay/TextDisplay.js +0 -37
  141. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -13
  142. package/dist/components/TextDisplay/textDisplay.test.d.ts +0 -1
  143. package/dist/components/Toggle/Toggle.d.ts +0 -11
  144. package/dist/components/Toggle/Toggle.js +0 -266
  145. package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
  146. package/dist/components/ToggleGroup/Group.d.ts +0 -18
  147. package/dist/components/ToggleGroup/Group.js +0 -7
  148. package/dist/components/ToggleGroup/Group.test.d.ts +0 -1
  149. package/dist/components/ToggleGroup/Toggle.d.ts +0 -15
  150. package/dist/components/ToggleGroup/Toggle.js +0 -17
  151. package/dist/components/ToggleGroup/Toggle.test.d.ts +0 -1
  152. package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -2
  153. package/dist/components/ToggleGroup/ToggleGroup.js +0 -6
  154. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -25
  155. package/dist/components/Tooltip/Tooltip.d.ts +0 -33
  156. package/dist/components/Tooltip/Tooltip.js +0 -141
  157. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -35
  158. package/dist/components/Typography/Typography.stories.d.ts +0 -32
  159. package/dist/components/Typography/typography.test.d.ts +0 -1
  160. package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -11
  161. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +0 -50
  162. package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +0 -21
  163. package/dist/index-CjW42-M-.js +0 -19584
  164. package/dist/marola.css +0 -1
  165. package/dist/test-utils/assertStyles.d.ts +0 -1
  166. package/dist/test-utils/assertStyles.js +0 -11
  167. package/dist/useButton-DNk3wrQp.js +0 -105
  168. package/dist/useCompoundItem-D1iRfg8D.js +0 -84
  169. package/dist/useControlled-CCMYYdCM.js +0 -31
  170. package/dist/useEventCallback-xTG9piMa.js +0 -45
  171. package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
  172. package/dist/useList-B0hog_3-.js +0 -436
  173. package/dist/useTimeout-DxF9kiZL.js +0 -36
  174. package/dist/utils/styleStrings.d.ts +0 -6
  175. package/dist/utils/styleStrings.js +0 -10
  176. package/dist/utils/styleStrings.test.d.ts +0 -1
@@ -1,11 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
- export interface DialogTitleProps {
3
+ export interface TitleProps {
4
4
  /** title to be displayed */
5
5
  title?: ReactNode;
6
6
  /** subtitle to be displayed */
7
7
  subTitle?: ReactNode;
8
8
  }
9
9
  /** internal component only - used by the dialog */
10
- declare const DialogTitle: ({ title, subTitle }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;
11
- export default DialogTitle;
10
+ declare const Title: ({ title, subTitle }: TitleProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default Title;
@@ -0,0 +1,14 @@
1
+ import { jsxs as l, Fragment as s, jsx as e } from "react/jsx-runtime";
2
+ import { s as r } from "../../Dialog.module-BO0mdB7d.js";
3
+ import { Typography as a } from "../Typography/Typography.js";
4
+ const n = ({
5
+ title: i,
6
+ subTitle: t
7
+ }) => /* @__PURE__ */ l(s, { children: [
8
+ /* @__PURE__ */ e(a, { element: "h1", elementProps: { id: "alert-dialog-title" }, variant: "h4", className: r.dialog__title, children: i }),
9
+ /* @__PURE__ */ e("hr", { className: r.dialog__divider, "aria-hidden": !0 }),
10
+ t && /* @__PURE__ */ e(a, { element: "h2", elementProps: { id: "alert-dialog-description" }, variant: "h4", className: r.dialog__subtitle, children: t })
11
+ ] });
12
+ export {
13
+ n as default
14
+ };
@@ -1,7 +1,5 @@
1
1
  export interface LoadingSpinnerProps {
2
- /** Whether to invert colours or not */
3
2
  invert?: boolean;
4
- /** Space separated list of CSS classes to apply */
5
3
  classNames?: string;
6
4
  }
7
5
  export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,17 @@
1
1
  import '../../assets/LoadingSpinner.css';
2
- import { jsxs as e, jsx as s } from "react/jsx-runtime";
3
- import { useMemo as o } from "react";
2
+ import { jsxs as o, jsx as s } from "react/jsx-runtime";
3
+ import { useMemo as e } from "react";
4
4
  import { c as t } from "../../clsx-DB4S2d7J.js";
5
5
  const n = {
6
- "ls-ring": "_ls-ring_elvjz_1",
7
- "ls-ring--invert": "_ls-ring--invert_elvjz_34"
8
- }, a = ({ invert: i = !1, classNames: r }) => {
9
- const l = o(
10
- () => t([n["ls-ring"]], { [n["ls-ring--invert"]]: i }, r),
11
- [r, i]
12
- );
13
- return /* @__PURE__ */ e("div", { className: l, children: [
6
+ "ls-ring": "_ls-ring_19dsy_1",
7
+ "ls-ring--invert": "_ls-ring--invert_19dsy_34"
8
+ }, c = ({ invert: i = !1, classNames: r }) => {
9
+ const l = e(() => t(
10
+ [n["ls-ring"]],
11
+ { [n["ls-ring--invert"]]: i },
12
+ r
13
+ ), [r, i]);
14
+ return /* @__PURE__ */ o("div", { className: l, children: [
14
15
  /* @__PURE__ */ s("div", {}),
15
16
  /* @__PURE__ */ s("div", {}),
16
17
  /* @__PURE__ */ s("div", {}),
@@ -18,6 +19,6 @@ const n = {
18
19
  ] });
19
20
  };
20
21
  export {
21
- a as LoadingSpinner,
22
- a as default
22
+ c as LoadingSpinner,
23
+ c as default
23
24
  };
@@ -1,14 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
3
  export interface TabProps {
4
- /** The value to be showing in the tab */
5
4
  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
5
  value: string | number;
9
- /** Disable clicking the tab */
10
6
  disabled?: boolean;
11
- /** data test id */
12
7
  dataTestId?: string;
13
8
  }
14
- 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,123 +1,182 @@
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);
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
+ 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";
10
+ function Z(n) {
11
+ const {
12
+ handlePointerOverEvents: t = !1,
13
+ item: e
14
+ } = n, s = f.useContext(X);
15
+ if (!s)
16
+ throw new Error("useListItem must be used within a ListProvider");
17
+ const {
18
+ dispatch: a,
19
+ getItemState: i
20
+ } = s, {
21
+ highlighted: c,
22
+ selected: b,
23
+ focusable: m
24
+ } = i(e), h = f.useCallback((l) => (r) => {
25
+ var u;
26
+ if ((u = l.onClick) == null || u.call(l, r), !r.defaultPrevented) {
27
+ if (process.env.NODE_ENV !== "production" && e === void 0)
28
+ 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
+ a({
31
+ type: E.itemClick,
32
+ item: e,
33
+ event: r
34
+ });
35
+ }
36
+ }, [a, e]), P = f.useCallback((l) => (r) => {
37
+ var u;
38
+ if ((u = l.onMouseOver) == null || u.call(l, r), !r.defaultPrevented) {
39
+ if (process.env.NODE_ENV !== "production" && e === void 0)
40
+ 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
+ a({
43
+ type: E.itemHover,
44
+ item: e,
45
+ event: r
46
+ });
47
+ }
48
+ }, [a, e]);
49
+ let d;
50
+ return m && (d = c ? 0 : -1), {
51
+ getRootProps: (l = {}) => {
52
+ const r = O(l);
53
+ return p({}, l, {
54
+ onClick: h(r),
55
+ onPointerOver: t ? P(r) : void 0,
56
+ tabIndex: d
57
+ });
58
+ },
59
+ highlighted: c,
60
+ selected: b
61
+ };
62
+ }
63
+ function ee(n, t) {
64
+ return function(s = {}) {
65
+ const a = p({}, s, n(s));
66
+ return p({}, a, t(a));
67
+ };
13
68
  }
14
- W(E, ["root", "selected", "disabled"]);
15
- function ee(o) {
16
- return o.size;
69
+ const w = "Tab";
70
+ function te(n) {
71
+ return B(w, n);
17
72
  }
18
- function te(o) {
73
+ W(w, ["root", "selected", "disabled"]);
74
+ function oe(n) {
75
+ return n.size;
76
+ }
77
+ function se(n) {
19
78
  const {
20
79
  value: t,
21
- rootRef: s,
22
- disabled: n = !1,
80
+ rootRef: e,
81
+ disabled: s = !1,
82
+ id: a
83
+ } = n, i = f.useRef(null), c = K(a), {
84
+ value: b,
85
+ selectionFollowsFocus: m,
86
+ getTabPanelId: h
87
+ } = S(), P = f.useMemo(() => ({
88
+ disabled: s,
89
+ ref: i,
23
90
  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
91
+ }), [s, i, c]), {
92
+ id: d,
93
+ index: C,
94
+ totalItemCount: l
95
+ } = Q(t ?? oe, P), {
96
+ getRootProps: r,
97
+ highlighted: u,
98
+ selected: g
99
+ } = Z({
100
+ item: d
42
101
  }), {
43
- getRootProps: C,
44
- rootRef: u,
45
- active: v,
46
- focusVisible: I,
47
- setFocusVisible: V
102
+ getRootProps: v,
103
+ rootRef: R,
104
+ active: T,
105
+ focusVisible: L,
106
+ setFocusVisible: M
48
107
  } = Y({
49
- disabled: n,
50
- focusableWhenDisabled: !p,
108
+ disabled: s,
109
+ focusableWhenDisabled: !m,
51
110
  type: "button"
52
- }), _ = O(a, s, u), M = l !== void 0 ? m(l) : void 0;
111
+ }), _ = N(i, e, R), H = d !== void 0 ? h(d) : void 0;
53
112
  return {
54
113
  getRootProps: (x = {}) => {
55
- const S = $(x), w = K(h, C);
56
- return d({}, x, w(S), {
114
+ const V = O(x), F = ee(r, v);
115
+ return p({}, x, F(V), {
57
116
  role: "tab",
58
- "aria-controls": M,
59
- "aria-selected": i,
60
- id: r,
117
+ "aria-controls": H,
118
+ "aria-selected": g,
119
+ id: c,
61
120
  ref: _
62
121
  });
63
122
  },
64
- active: v,
65
- focusVisible: I,
66
- highlighted: T,
67
- index: R,
123
+ active: T,
124
+ focusVisible: L,
125
+ highlighted: u,
126
+ index: C,
68
127
  rootRef: _,
69
128
  // the `selected` state isn't set on the server (it relies on effects to be calculated),
70
129
  // 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
130
+ selected: g || d === b,
131
+ setFocusVisible: M,
132
+ totalTabsCount: l
74
133
  };
75
134
  }
76
- const oe = ["action", "children", "disabled", "onChange", "onClick", "onFocus", "slotProps", "slots", "value"], se = (o) => {
135
+ const ne = ["action", "children", "disabled", "onChange", "onClick", "onFocus", "slotProps", "slots", "value"], re = (n) => {
77
136
  const {
78
137
  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;
138
+ disabled: e
139
+ } = n;
140
+ return G({
141
+ root: ["root", t && "selected", e && "disabled"]
142
+ }, J(te));
143
+ }, k = /* @__PURE__ */ f.forwardRef(function(t, e) {
144
+ var s;
86
145
  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,
146
+ children: a,
147
+ disabled: i = !1,
148
+ slotProps: c = {},
149
+ slots: b = {},
150
+ value: m
151
+ } = t, h = q(t, ne), P = f.useRef(), d = N(P, e), {
152
+ active: C,
153
+ highlighted: l,
154
+ selected: r,
155
+ getRootProps: u
156
+ } = se(p({}, t, {
157
+ rootRef: d,
158
+ value: m
159
+ })), g = p({}, t, {
160
+ active: C,
161
+ disabled: i,
162
+ highlighted: l,
163
+ selected: r
164
+ }), v = re(g), R = (s = b.root) != null ? s : "button", T = z({
165
+ elementType: R,
166
+ getSlotProps: u,
167
+ externalSlotProps: c.root,
168
+ externalForwardedProps: h,
110
169
  additionalProps: {
111
- ref: s
170
+ ref: e
112
171
  },
113
- ownerState: i,
114
- className: C.root
172
+ ownerState: g,
173
+ className: v.root
115
174
  });
116
- return /* @__PURE__ */ N(u, d({}, v, {
117
- children: c
175
+ return /* @__PURE__ */ I(R, p({}, T, {
176
+ children: a
118
177
  }));
119
178
  });
120
- process.env.NODE_ENV !== "production" && (F.propTypes = {
179
+ process.env.NODE_ENV !== "production" && (k.propTypes = {
121
180
  // ┌────────────────────────────── Warning ──────────────────────────────┐
122
181
  // │ These PropTypes are generated from the TypeScript type definitions. │
123
182
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -125,57 +184,53 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
125
184
  /**
126
185
  * A ref for imperative actions. It currently only supports `focusVisible()` action.
127
186
  */
128
- action: e.oneOfType([e.func, e.shape({
129
- current: e.shape({
130
- focusVisible: e.func.isRequired
187
+ action: o.oneOfType([o.func, o.shape({
188
+ current: o.shape({
189
+ focusVisible: o.func.isRequired
131
190
  })
132
191
  })]),
133
192
  /**
134
193
  * @ignore
135
194
  */
136
- children: e.node,
195
+ children: o.node,
137
196
  /**
138
197
  * If `true`, the component is disabled.
139
198
  * @default false
140
199
  */
141
- disabled: e.bool,
200
+ disabled: o.bool,
142
201
  /**
143
202
  * Callback invoked when new value is being set.
144
203
  */
145
- onChange: e.func,
204
+ onChange: o.func,
146
205
  /**
147
206
  * The props used for each slot inside the Tab.
148
207
  * @default {}
149
208
  */
150
- slotProps: e.shape({
151
- root: e.oneOfType([e.func, e.object])
209
+ slotProps: o.shape({
210
+ root: o.oneOfType([o.func, o.object])
152
211
  }),
153
212
  /**
154
213
  * The components used for each slot inside the Tab.
155
214
  * Either a string to use a HTML element or a component.
156
215
  * @default {}
157
216
  */
158
- slots: e.shape({
159
- root: e.elementType
217
+ slots: o.shape({
218
+ root: o.elementType
160
219
  }),
161
220
  /**
162
221
  * You can provide your own value. Otherwise, it falls back to the child position index.
163
222
  */
164
- value: e.oneOfType([e.number, e.string])
223
+ value: o.oneOfType([o.number, o.string])
224
+ });
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 });
165
233
  });
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
234
  export {
180
- fe as Tab
235
+ me as Tab
181
236
  };
@@ -1,12 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
3
  export interface TabPanelProps {
4
- /** The content to be displayed when the corresponding tab is selected */
5
4
  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
5
  value: string | number;
9
- /** Test id */
10
6
  dataTestId?: string;
11
7
  }
12
- 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,9 +1,9 @@
1
1
  import { jsx as T } from "react/jsx-runtime";
2
+ import { a as v, s as y } from "../../Tabs.module-_kSbSyth.js";
2
3
  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";
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";
7
7
  const h = "TabPanel";
8
8
  function j(t) {
9
9
  return C(h, t);
@@ -17,7 +17,7 @@ function V(t) {
17
17
  value: e,
18
18
  id: s,
19
19
  rootRef: n
20
- } = t, i = y();
20
+ } = t, i = v();
21
21
  if (i === null)
22
22
  throw new Error("No TabContext provided");
23
23
  const {
@@ -110,9 +110,11 @@ process.env.NODE_ENV !== "production" && (R.propTypes = {
110
110
  */
111
111
  value: o.oneOfType([o.number, o.string])
112
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
- );
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 }));
116
118
  export {
117
119
  W as TabPanel
118
120
  };
@@ -1,15 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
3
  export interface TabsProps {
4
- /** Should contain `Tab` and `TabPanel` components to be rendered */
5
4
  children?: ReactNode;
6
- /** Selected tab */
7
5
  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
6
  dataTestId?: string;
7
+ onChange?: (tabValue: number | string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
12
8
  }
13
- export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import('react').RefAttributes<HTMLDivElement>>;
14
- export * from './Tab';
15
- export * from './TabPanel';
9
+ export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;