asma-ui-core 3.34.0 → 3.36.0

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 (198) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/data-display/badge/StyledBadge.js +29 -24
  3. package/dist/components/data-display/chip/StyledChip.js +45 -60
  4. package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +32 -38
  5. package/dist/components/data-display/tooltip/StyledTooltip.js +50 -33
  6. package/dist/components/data-display/typography/StyledTypography.js +62 -4
  7. package/dist/components/feedback/dialog/StyledDialog.js +70 -50
  8. package/dist/components/feedback/dialog/StyledDialog.module.js +2 -9
  9. package/dist/components/feedback/dialog/StyledDialogActions.js +16 -16
  10. package/dist/components/feedback/dialog/StyledDialogContent.js +17 -14
  11. package/dist/components/feedback/dialog/StyledDialogTitle.js +18 -13
  12. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +56 -57
  13. package/dist/components/feedback/snack-bar/StyledAlert.js +72 -14
  14. package/dist/components/feedback/snack-bar/StyledSnackbar.js +34 -8
  15. package/dist/components/feedback/snack-bar/components/StyledDefaultSnackbar.js +33 -34
  16. package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +55 -58
  17. package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +12 -12
  18. package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +1 -1
  19. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +1 -1
  20. package/dist/components/inputs/field-styles.js +6 -0
  21. package/dist/components/inputs/input-field/StyledInputField.js +104 -81
  22. package/dist/components/inputs/input-field/StyledInputField.module.js +4 -0
  23. package/dist/components/inputs/radio-button/base-ui/RadioGroupContext.js +6 -0
  24. package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +40 -29
  25. package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +10 -10
  26. package/dist/components/inputs/radio-button/base-ui/StyledRadioGroup.js +35 -23
  27. package/dist/components/inputs/select/StyledSelect.js +124 -45
  28. package/dist/components/inputs/select/StyledSelectItem.js +19 -23
  29. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +181 -151
  30. package/dist/components/inputs/slider/StyledSlider.js +78 -52
  31. package/dist/components/inputs/slider/StyledSlider.module.js +10 -0
  32. package/dist/components/inputs/switch/base-ui/StyledSwitch.js +44 -39
  33. package/dist/components/miscellaneous/FormControlContext.js +6 -0
  34. package/dist/components/miscellaneous/StyledFormControl.js +39 -21
  35. package/dist/components/miscellaneous/StyledFormControlLabel.js +27 -16
  36. package/dist/components/miscellaneous/StyledFormGroup.js +16 -4
  37. package/dist/components/miscellaneous/StyledFormHelperText.js +12 -4
  38. package/dist/components/miscellaneous/StyledInputLabel.js +20 -4
  39. package/dist/components/mui-compat/Avatar.js +29 -0
  40. package/dist/components/mui-compat/ClickAwayListener.js +29 -0
  41. package/dist/components/mui-compat/Container.js +24 -0
  42. package/dist/components/mui-compat/Fade.js +29 -0
  43. package/dist/components/mui-compat/Fade.module.js +9 -0
  44. package/dist/components/mui-compat/FormLabel.js +22 -0
  45. package/dist/components/mui-compat/Paper.js +44 -0
  46. package/dist/components/mui-compat/Popper.js +35 -0
  47. package/dist/components/mui-compat/Skeleton.js +26 -0
  48. package/dist/components/mui-compat/Stack.js +24 -0
  49. package/dist/components/navigation/drawer/StyledDrawer.js +42 -4
  50. package/dist/components/navigation/listbox/Listbox.js +7 -7
  51. package/dist/components/navigation/menu/StyledMenu.js +28 -11
  52. package/dist/components/navigation/menu/StyledMenuItem.js +16 -18
  53. package/dist/components/navigation/menu/StyledMenuList.js +32 -4
  54. package/dist/components/navigation/tabs/StyledTab.js +25 -13
  55. package/dist/components/navigation/tabs/StyledTabs.js +112 -64
  56. package/dist/components/navigation/tabs/TabsContext.js +6 -0
  57. package/dist/components/utils/accordion/base-ui/AccordionContext.js +10 -0
  58. package/dist/components/utils/accordion/base-ui/StyledAccordion.js +28 -21
  59. package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +7 -7
  60. package/dist/components/utils/accordion/base-ui/StyledAccordionDetails.js +28 -14
  61. package/dist/components/utils/accordion/base-ui/StyledAccordionSummary.js +31 -27
  62. package/dist/components/utils/popover/StyledPopover.js +44 -15
  63. package/dist/datetime/components/date-picker/StyledDatePicker.js +6 -6
  64. package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +1 -1
  65. package/dist/datetime/components/date-picker/components/HelperTextWithTooltip.js +6 -6
  66. package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +11 -11
  67. package/dist/datetime/components/date-picker/components/StyledCalendarPickerFooter.js +13 -14
  68. package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectMonth.js +14 -14
  69. package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectYear.js +6 -6
  70. package/dist/datetime/components/date-picker/components/StyledDayPicker.js +4 -5
  71. package/dist/datetime/components/date-picker/hooks/useDatePickerMask.js +4 -4
  72. package/dist/datetime/components/time-picker/StyledTimePicker.js +25 -25
  73. package/dist/datetime/components/time-picker/TimePickerInput.js +15 -16
  74. package/dist/datetime/components/time-picker/TimePickerPopper.js +21 -19
  75. package/dist/datetime/helpers/cn.js +4 -5
  76. package/dist/helpers/arrays.js +4 -0
  77. package/dist/helpers/cn.js +4 -5
  78. package/dist/helpers/inputMask.js +45 -0
  79. package/dist/helpers/sx.js +46 -0
  80. package/dist/index.js +183 -175
  81. package/dist/src/api-surface.test.d.ts +1 -0
  82. package/dist/src/components/data-display/badge/StyledBadge.d.ts +26 -2
  83. package/dist/src/components/data-display/chip/StyledChip.d.ts +39 -5
  84. package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +11 -4
  85. package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +36 -2
  86. package/dist/src/components/data-display/typography/StyledTypography.d.ts +19 -1
  87. package/dist/src/components/feedback/dialog/StyledDialog.d.ts +50 -4
  88. package/dist/src/components/feedback/dialog/StyledDialogActions.d.ts +12 -2
  89. package/dist/src/components/feedback/dialog/StyledDialogContent.d.ts +12 -2
  90. package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +10 -2
  91. package/dist/src/components/feedback/snack-bar/SnackbarProvider.d.ts +1 -1
  92. package/dist/src/components/feedback/snack-bar/StyledAlert.d.ts +24 -2
  93. package/dist/src/components/feedback/snack-bar/StyledAlertSnackbar.d.ts +1 -1
  94. package/dist/src/components/feedback/snack-bar/StyledSnackbar.d.ts +21 -2
  95. package/dist/src/components/feedback/snack-bar/components/StyledDefaultSnackbar.d.ts +1 -1
  96. package/dist/src/components/feedback/snack-bar/components/StyledInfoSnackbar.d.ts +1 -1
  97. package/dist/src/components/feedback/snack-bar/components/types.d.ts +1 -1
  98. package/dist/src/components/inputs/checkbox/base-ui/StyledCheckbox.d.ts +9 -4
  99. package/dist/src/components/inputs/dynamic-select/types.d.ts +2 -2
  100. package/dist/src/components/inputs/field-styles.d.ts +22 -0
  101. package/dist/src/components/inputs/input-field/StyledInputField.d.ts +67 -11
  102. package/dist/src/components/inputs/input-field/index.d.ts +1 -1
  103. package/dist/src/components/inputs/radio-button/base-ui/RadioGroupContext.d.ts +10 -0
  104. package/dist/src/components/inputs/radio-button/base-ui/StyledRadio.d.ts +20 -5
  105. package/dist/src/components/inputs/radio-button/base-ui/StyledRadioGroup.d.ts +24 -7
  106. package/dist/src/components/inputs/select/StyledSelect.d.ts +39 -16
  107. package/dist/src/components/inputs/select/StyledSelectItem.d.ts +14 -2
  108. package/dist/src/components/inputs/select/index.d.ts +0 -1
  109. package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +88 -17
  110. package/dist/src/components/inputs/slider/StyledSlider.d.ts +55 -3
  111. package/dist/src/components/inputs/switch/base-ui/StyledSwitch.d.ts +20 -4
  112. package/dist/src/components/miscellaneous/FormControlContext.d.ts +14 -0
  113. package/dist/src/components/miscellaneous/StyledFormControl.d.ts +22 -2
  114. package/dist/src/components/miscellaneous/StyledFormControlLabel.d.ts +21 -2
  115. package/dist/src/components/miscellaneous/StyledFormGroup.d.ts +11 -2
  116. package/dist/src/components/miscellaneous/StyledFormHelperText.d.ts +12 -2
  117. package/dist/src/components/miscellaneous/StyledInputLabel.d.ts +20 -2
  118. package/dist/src/components/mui-compat/Avatar.d.ts +6 -0
  119. package/dist/src/components/mui-compat/ClickAwayListener.d.ts +19 -0
  120. package/dist/src/components/mui-compat/Container.d.ts +6 -0
  121. package/dist/src/components/mui-compat/Fade.d.ts +21 -0
  122. package/dist/src/components/mui-compat/FormLabel.d.ts +6 -0
  123. package/dist/src/components/mui-compat/Paper.d.ts +6 -0
  124. package/dist/src/components/mui-compat/Popper.d.ts +29 -0
  125. package/dist/src/components/mui-compat/Skeleton.d.ts +7 -0
  126. package/dist/src/components/mui-compat/Stack.d.ts +7 -0
  127. package/dist/src/components/mui-compat/index.d.ts +9 -0
  128. package/dist/src/components/mui-compat/types.d.ts +46 -0
  129. package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +28 -2
  130. package/dist/src/components/navigation/menu/StyledMenu.d.ts +33 -2
  131. package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +23 -2
  132. package/dist/src/components/navigation/menu/StyledMenuList.d.ts +16 -2
  133. package/dist/src/components/navigation/menu/index.d.ts +0 -1
  134. package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -3
  135. package/dist/src/components/navigation/tabs/StyledTabs.d.ts +16 -7
  136. package/dist/src/components/navigation/tabs/TabsContext.d.ts +11 -0
  137. package/dist/src/components/utils/accordion/base-ui/AccordionContext.d.ts +10 -0
  138. package/dist/src/components/utils/accordion/base-ui/StyledAccordion.d.ts +9 -3
  139. package/dist/src/components/utils/accordion/base-ui/StyledAccordionDetails.d.ts +5 -0
  140. package/dist/src/components/utils/accordion/base-ui/StyledAccordionSummary.d.ts +8 -4
  141. package/dist/src/components/utils/copy-wrapper/CopyWrapper.d.ts +1 -1
  142. package/dist/src/components/utils/filter-menu/StyledFilterMenu.d.ts +2 -2
  143. package/dist/src/components/utils/popover/StyledPopover.d.ts +32 -2
  144. package/dist/src/datetime/components/date-picker/components/StyledCalendarPicker.d.ts +1 -1
  145. package/dist/src/datetime/components/date-picker/components/StyledDayPicker.d.ts +1 -1
  146. package/dist/src/datetime/components/date-picker/hooks/useDatePickerMask.d.ts +1 -2
  147. package/dist/src/datetime/components/time-picker/TimePickerInput.d.ts +1 -1
  148. package/dist/src/datetime/components/time-picker/TimePickerPopper.d.ts +1 -1
  149. package/dist/src/datetime/components/time-picker/types.d.ts +1 -2
  150. package/dist/src/datetime/shared-components/StyledFormControl.d.ts +1 -2
  151. package/dist/src/datetime/shared-components/StyledInputField.d.ts +1 -12
  152. package/dist/src/datetime/shared-components/StyledSelect.d.ts +1 -16
  153. package/dist/src/datetime/shared-components/StyledSelectItem.d.ts +1 -2
  154. package/dist/src/datetime/shared-components/StyledTooltip.d.ts +1 -2
  155. package/dist/src/helpers/arrays.d.ts +2 -0
  156. package/dist/src/helpers/arrays.test.d.ts +1 -0
  157. package/dist/src/helpers/inputMask.d.ts +29 -0
  158. package/dist/src/helpers/inputMask.test.d.ts +1 -0
  159. package/dist/src/helpers/sx.d.ts +2 -0
  160. package/dist/src/helpers/sx.test.d.ts +1 -0
  161. package/dist/src/index.d.ts +1 -1
  162. package/dist/src/table/shared-components/StyledCheckbox.d.ts +7 -4
  163. package/dist/src/table/shared-components/StyledMenuItem.d.ts +18 -2
  164. package/dist/src/table/shared-components/menu-item/index.d.ts +13 -2
  165. package/dist/src/table/shared-components/tooltip/index.d.ts +5 -1
  166. package/dist/src/table/types.d.ts +1 -1
  167. package/dist/table/components/Fetching.js +4 -4
  168. package/dist/table/components/TableRow.js +7 -7
  169. package/dist/table/components/TableSkeleton.js +6 -6
  170. package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +24 -24
  171. package/dist/table/components/columns/action-column/components/RowActionMenu.js +26 -25
  172. package/dist/table/components/table-footer/TablePagination.js +27 -24
  173. package/dist/table/components/table-footer/TableRowCountSelect.js +30 -27
  174. package/dist/table/helpers/cn.js +4 -5
  175. package/dist/table/shared-components/StyledCheckbox.js +54 -55
  176. package/dist/table/shared-components/StyledCheckbox.module.js +10 -10
  177. package/dist/table/shared-components/StyledMenuItem.js +12 -18
  178. package/dist/table/shared-components/menu-item/index.js +13 -17
  179. package/dist/table/shared-components/tooltip/index.js +4 -23
  180. package/package.json +9 -16
  181. package/dist/components/feedback/dialog/StyledDialogActions.module.js +0 -8
  182. package/dist/components/feedback/dialog/StyledDialogContent.module.js +0 -4
  183. package/dist/components/feedback/dialog/StyledDialogTitle.module.js +0 -4
  184. package/dist/components/inputs/checkbox/StyledCheckbox.js +0 -20
  185. package/dist/components/inputs/radio-button/StyledRadio.js +0 -17
  186. package/dist/datetime/shared-components/ExpandIcon.js +0 -18
  187. package/dist/datetime/shared-components/StyledFormControl.js +0 -23
  188. package/dist/datetime/shared-components/StyledInputField.js +0 -47
  189. package/dist/datetime/shared-components/StyledSelect.js +0 -47
  190. package/dist/datetime/shared-components/StyledSelectItem.js +0 -13
  191. package/dist/datetime/shared-components/StyledTooltip.js +0 -32
  192. package/dist/src/components/inputs/checkbox/StyledCheckbox.d.ts +0 -4
  193. package/dist/src/components/inputs/radio-button/StyledRadio.d.ts +0 -4
  194. package/dist/src/components/inputs/radio-button/StyledRadioGroup.d.ts +0 -4
  195. package/dist/src/components/inputs/switch/StyledSwitch.d.ts +0 -5
  196. package/dist/src/components/utils/accordion/StyledAccordion.d.ts +0 -2
  197. package/dist/src/components/utils/accordion/StyledAccordionDetails.d.ts +0 -2
  198. package/dist/src/components/utils/accordion/StyledAccordionSummary.d.ts +0 -8
@@ -0,0 +1,35 @@
1
+ import { useState as P } from "react";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { FloatingPortal as y, autoUpdate as E, flip as F, shift as h, useFloating as w, useMergeRefs as M } from "@floating-ui/react";
4
+ var j = ({ open: e = !1, anchorEl: s, id: l, placement: a = "bottom", transition: f, disablePortal: d, className: m, style: c, children: t }) => {
5
+ const [o, n] = P(!0);
6
+ e && o && n(!1);
7
+ const { refs: p, floatingStyles: u, placement: g } = w({
8
+ open: e,
9
+ placement: a,
10
+ whileElementsMounted: E,
11
+ elements: { reference: s ?? void 0 },
12
+ middleware: [F({ padding: 8 }), h({ padding: 8 })]
13
+ }), x = M([p.setFloating]);
14
+ if (!(e || f && !o)) return null;
15
+ const v = typeof t == "function" ? t({
16
+ TransitionProps: {
17
+ in: e,
18
+ onExited: () => n(!0)
19
+ },
20
+ placement: g
21
+ }) : t, i = /* @__PURE__ */ r("div", {
22
+ ref: x,
23
+ id: l,
24
+ style: {
25
+ ...u,
26
+ ...c
27
+ },
28
+ className: m,
29
+ children: v
30
+ });
31
+ return d ? i : /* @__PURE__ */ r(y, { children: i });
32
+ };
33
+ export {
34
+ j as Popper
35
+ };
@@ -0,0 +1,26 @@
1
+ import { resolveSx as p } from "../../helpers/sx.js";
2
+ import u from "clsx";
3
+ import "react";
4
+ import { jsx as d } from "react/jsx-runtime";
5
+ var i = {
6
+ text: "rounded-[4px] origin-[0_55%] scale-y-[0.6] my-0",
7
+ circular: "rounded-full",
8
+ rectangular: "",
9
+ rounded: "rounded-[4px]"
10
+ }, b = ({ variant: e = "text", width: o, height: r, animation: t = "pulse", className: s, sx: l, style: a, children: n, classes: x, component: g, ...m }) => {
11
+ const c = {
12
+ width: o,
13
+ height: r ?? (e === "text" ? "auto" : void 0),
14
+ ...p(l),
15
+ ...a
16
+ };
17
+ return /* @__PURE__ */ d("span", {
18
+ className: u("block bg-[rgba(0,0,0,0.11)]", t !== !1 && "animate-pulse", i[e] ?? "", s),
19
+ style: c,
20
+ ...m,
21
+ children: n
22
+ });
23
+ };
24
+ export {
25
+ b as Skeleton
26
+ };
@@ -0,0 +1,24 @@
1
+ import { resolveSx as c } from "../../helpers/sx.js";
2
+ import n from "clsx";
3
+ import { Children as p, Fragment as u, createElement as i, isValidElement as w } from "react";
4
+ import { jsxs as y } from "react/jsx-runtime";
5
+ var S = {
6
+ row: "flex-row",
7
+ "row-reverse": "flex-row-reverse",
8
+ column: "flex-col",
9
+ "column-reverse": "flex-col-reverse"
10
+ }, C = (l, e) => p.toArray(l).map((r, o) => /* @__PURE__ */ y(u, { children: [o > 0 && e, r] }, o)), D = ({ direction: l = "column", spacing: e, divider: r, className: o, sx: s, style: f, component: a = "div", children: t, useFlexGap: E, ...x }) => {
11
+ const m = typeof e == "number" ? e * 8 : typeof e == "string" ? e : void 0, v = {
12
+ ...m !== void 0 ? { gap: m } : {},
13
+ ...c(s),
14
+ ...f
15
+ };
16
+ return i(a, {
17
+ className: n("flex", S[l] ?? "flex-col", o),
18
+ style: v,
19
+ ...x
20
+ }, r && w(r) ? C(t, r) : t);
21
+ };
22
+ export {
23
+ D as Stack
24
+ };
@@ -1,6 +1,44 @@
1
- import { Drawer as o } from "@mui/material";
2
- import { jsx as e } from "react/jsx-runtime";
3
- var a = (r) => /* @__PURE__ */ e(o, { ...r });
1
+ import { cn as s } from "../../../helpers/cn.js";
2
+ import { resolveSx as n } from "../../../helpers/sx.js";
3
+ import { useEffect as v } from "react";
4
+ import { jsx as f, jsxs as x } from "react/jsx-runtime";
5
+ import { FloatingPortal as p } from "@floating-ui/react";
6
+ var w = {
7
+ left: "inset-y-0 left-0 h-full",
8
+ right: "inset-y-0 right-0 h-full",
9
+ top: "inset-x-0 top-0 w-full",
10
+ bottom: "inset-x-0 bottom-0 w-full"
11
+ }, g = {
12
+ left: "-translate-x-full",
13
+ right: "translate-x-full",
14
+ top: "-translate-y-full",
15
+ bottom: "translate-y-full"
16
+ }, D = ({ open: t = !1, onClose: l, anchor: o = "left", variant: m = "temporary", hideBackdrop: d, className: u, sx: c, PaperProps: a, children: y }) => {
17
+ const e = m === "temporary";
18
+ return v(() => {
19
+ if (!t || !e) return;
20
+ const r = (i) => {
21
+ i.key === "Escape" && l?.(i, "escapeKeyDown");
22
+ };
23
+ return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
24
+ }, [
25
+ t,
26
+ e,
27
+ l
28
+ ]), /* @__PURE__ */ x(p, { children: [e && !d && t && /* @__PURE__ */ f("div", {
29
+ className: "fixed inset-0 z-[1200] bg-black/50",
30
+ onClick: (r) => l?.(r, "backdropClick")
31
+ }), /* @__PURE__ */ f("div", {
32
+ role: e ? "dialog" : void 0,
33
+ "aria-hidden": !t,
34
+ className: s("fixed z-[1200] overflow-auto bg-white shadow-lg transition-transform duration-300", w[o], !t && s(g[o], "pointer-events-none"), u, a?.className),
35
+ style: {
36
+ ...n(c),
37
+ ...n(a?.sx)
38
+ },
39
+ children: y
40
+ })] });
41
+ };
4
42
  export {
5
- a as StyledDrawer
43
+ D as StyledDrawer
6
44
  };
@@ -1,13 +1,13 @@
1
- import { createContext as p, useContext as x, useEffect as d, useMemo as b, useState as v } from "react";
2
- import { ClickAwayListener as m } from "@mui/material";
1
+ import { ClickAwayListener as p } from "../../mui-compat/ClickAwayListener.js";
2
+ import { createContext as x, useContext as d, useEffect as b, useMemo as v, useState as m } from "react";
3
3
  import { jsx as s } from "react/jsx-runtime";
4
- var a = p(null), l = () => {
5
- const t = x(a);
4
+ var a = x(null), l = () => {
5
+ const t = d(a);
6
6
  if (!t) throw new Error("Listbox.Button/Options/Option must be rendered inside <Listbox>");
7
7
  return t;
8
8
  }, f = (t, e) => typeof t == "function" ? t(e) : t;
9
9
  function L({ value: t, onChange: e, children: r }) {
10
- const [o, n] = v(!1), u = b(() => ({
10
+ const [o, n] = m(!1), u = v(() => ({
11
11
  open: o,
12
12
  select: (i) => {
13
13
  e(i), n(!1);
@@ -19,7 +19,7 @@ function L({ value: t, onChange: e, children: r }) {
19
19
  t,
20
20
  e
21
21
  ]);
22
- return d(() => {
22
+ return b(() => {
23
23
  if (!o) return;
24
24
  const i = (c) => {
25
25
  c.key === "Escape" && n(!1);
@@ -27,7 +27,7 @@ function L({ value: t, onChange: e, children: r }) {
27
27
  return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
28
28
  }, [o]), /* @__PURE__ */ s(a.Provider, {
29
29
  value: u,
30
- children: /* @__PURE__ */ s(m, {
30
+ children: /* @__PURE__ */ s(p, {
31
31
  onClickAway: () => n(!1),
32
32
  children: /* @__PURE__ */ s("div", {
33
33
  className: "relative w-full",
@@ -1,14 +1,31 @@
1
- import e from "clsx";
2
- import { Menu as r } from "@mui/material";
3
- import { jsx as a } from "react/jsx-runtime";
4
- var d = (s) => /* @__PURE__ */ a(r, {
5
- ...s,
6
- classes: {
7
- paper: e("border border-solid border-delta-300 shadow-[0px_2px_4px_0px_rgba(34,_33,_51,_0.15)]", s.classes?.paper),
8
- list: e("py-1", s.classes?.list),
9
- ...s.classes
10
- }
1
+ import { cn as y } from "../../../helpers/cn.js";
2
+ import { StyledPopover as S } from "../../utils/popover/StyledPopover.js";
3
+ import { StyledMenuList as f } from "./StyledMenuList.js";
4
+ import { jsx as p } from "react/jsx-runtime";
5
+ var u = {
6
+ border: "1px solid var(--colors-delta-300)",
7
+ boxShadow: "0px 2px 4px 0px rgba(34, 33, 51, 0.15)"
8
+ }, M = ({ open: a, anchorEl: o, onClose: t, anchorOrigin: l, transformOrigin: m, id: d, className: s, sx: x, classes: e, slotProps: r, autoFocus: i = !0, onClick: c, children: n }) => /* @__PURE__ */ p(S, {
9
+ open: a,
10
+ anchorEl: o,
11
+ onClose: t,
12
+ anchorOrigin: l,
13
+ transformOrigin: m,
14
+ id: d,
15
+ className: s,
16
+ sx: x,
17
+ slotProps: { paper: {
18
+ className: y("rounded", e?.paper, r?.paper?.className),
19
+ sx: [u, r?.paper?.sx],
20
+ style: r?.paper?.style
21
+ } },
22
+ children: /* @__PURE__ */ p(f, {
23
+ autoFocus: i,
24
+ className: e?.list,
25
+ onClick: c,
26
+ children: n
27
+ })
11
28
  });
12
29
  export {
13
- d as StyledMenu
30
+ M as StyledMenu
14
31
  };
@@ -1,22 +1,20 @@
1
- import o from "clsx";
2
- import { MenuItem as t } from "@mui/material";
3
- import { jsx as r } from "react/jsx-runtime";
4
- var m = (e) => /* @__PURE__ */ r(t, {
5
- ...e,
6
- classes: {
7
- selected: "bg-gama-50",
8
- root: o("px-3 py-2.5 hover:bg-delta-50", e.classes?.root),
9
- ...e.classes
1
+ import { cn as a } from "../../../helpers/cn.js";
2
+ import { resolveSx as s } from "../../../helpers/sx.js";
3
+ import { jsx as y } from "react/jsx-runtime";
4
+ var D = ({ children: n, onClick: o, disabled: e, selected: l, dense: i, className: m, classes: r, sx: d, "data-test": u, "data-testid": p, value: f }) => /* @__PURE__ */ y("li", {
5
+ role: "menuitem",
6
+ "aria-disabled": e ? !0 : void 0,
7
+ tabIndex: -1,
8
+ "data-test": u,
9
+ "data-testid": p,
10
+ onClick: e ? void 0 : o,
11
+ onKeyDown: (t) => {
12
+ e || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), o?.(t));
10
13
  },
11
- sx: {
12
- "&.Mui-disabled": {
13
- pointerEvents: "auto",
14
- cursor: "not-allowed",
15
- "&:hover": { backgroundColor: "transparent !important" }
16
- },
17
- ...e.sx
18
- }
14
+ className: a("flex items-center px-3 outline-none", i ? "py-1.5" : "py-2.5", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", l && a("bg-gama-50", r?.selected), r?.root, m),
15
+ style: s(d),
16
+ children: n
19
17
  });
20
18
  export {
21
- m as StyledMenuItem
19
+ D as StyledMenuItem
22
20
  };
@@ -1,6 +1,34 @@
1
- import { MenuList as t } from "@mui/material";
2
- import { jsx as o } from "react/jsx-runtime";
3
- var m = (r) => /* @__PURE__ */ o(t, { ...r });
1
+ import { cn as y } from "../../../helpers/cn.js";
2
+ import { useEffect as p, useRef as w } from "react";
3
+ import { jsx as h } from "react/jsx-runtime";
4
+ var i = (o) => o ? Array.from(o.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) : [], k = ({ children: o, className: s, autoFocus: f, disablePadding: u, onClick: m, onKeyDown: c }) => {
5
+ const t = w(null);
6
+ p(() => {
7
+ f && i(t.current)[0]?.focus();
8
+ }, [f]);
9
+ const a = (e) => {
10
+ if (c?.(e), ![
11
+ "ArrowDown",
12
+ "ArrowUp",
13
+ "Home",
14
+ "End"
15
+ ].includes(e.key)) return;
16
+ e.preventDefault();
17
+ const r = i(t.current);
18
+ if (r.length === 0) return;
19
+ const l = r.findIndex((d) => d === document.activeElement);
20
+ let n = l;
21
+ e.key === "ArrowDown" ? n = (l + 1) % r.length : e.key === "ArrowUp" ? n = (l - 1 + r.length) % r.length : e.key === "Home" ? n = 0 : e.key === "End" && (n = r.length - 1), r[n]?.focus();
22
+ };
23
+ return /* @__PURE__ */ h("ul", {
24
+ ref: t,
25
+ role: "menu",
26
+ className: y("m-0 list-none outline-none", u ? "py-0" : "py-1", s),
27
+ onClick: m,
28
+ onKeyDown: a,
29
+ children: o
30
+ });
31
+ };
4
32
  export {
5
- m as StyledMenuList
33
+ k as StyledMenuList
6
34
  };
@@ -1,15 +1,27 @@
1
- import { Tab as o } from "@mui/material";
2
- import { jsx as a } from "react/jsx-runtime";
3
- var e = (r) => /* @__PURE__ */ a(o, {
4
- ...r,
5
- sx: {
6
- textTransform: "none",
7
- letterSpacing: "normal",
8
- "&.MuiTab-textColorPrimary.Mui-selected": { color: "var(--colors-gama-500)" },
9
- "&.MuiTab-textColorPrimary": { color: "var(--colors-gray-600)" },
10
- "&.MuiTab-textColorPrimary.Mui-disabled": { color: "var(--colors-gray-300)" }
11
- }
12
- });
1
+ import { cn as l } from "../../../helpers/cn.js";
2
+ import { resolveSx as p } from "../../../helpers/sx.js";
3
+ import { useTabsContext as f } from "./TabsContext.js";
4
+ import { useCallback as x } from "react";
5
+ import { jsx as u } from "react/jsx-runtime";
6
+ var d = ({ value: n, label: i, disabled: r, className: s, sx: m, index: c }) => {
7
+ const e = f(), t = n !== void 0 ? n : c, o = e ? e.value === t : !1;
8
+ return /* @__PURE__ */ u("button", {
9
+ ref: x((a) => {
10
+ e?.register(t, a);
11
+ }, [e, t]),
12
+ type: "button",
13
+ role: "tab",
14
+ "aria-selected": o,
15
+ "aria-disabled": r ? !0 : void 0,
16
+ disabled: r,
17
+ tabIndex: o ? 0 : -1,
18
+ "data-tab-value": typeof t == "string" || typeof t == "number" ? String(t) : void 0,
19
+ onClick: (a) => !r && e?.onSelect(a, t),
20
+ className: l("inline-flex min-h-12 shrink-0 items-center justify-center whitespace-nowrap px-4 py-3 text-sm font-medium normal-case tracking-normal transition-colors", e?.size === "small" && "min-h-9 px-3 py-2", o ? "text-gama-500" : "text-gray-600", r && "text-gray-300", !r && "cursor-pointer hover:text-gama-500", s),
21
+ style: p(m),
22
+ children: i
23
+ });
24
+ };
13
25
  export {
14
- e as StyledTab
26
+ d as StyledTab
15
27
  };
@@ -1,68 +1,116 @@
1
- import { cn as s } from "../../../helpers/cn.js";
2
- import { Tabs as e } from "@mui/material";
3
- import { jsx as l } from "react/jsx-runtime";
4
- function n(r) {
5
- return Array.isArray(r);
6
- }
7
- function d(r) {
8
- return r != null && !Array.isArray(r);
9
- }
10
- var c = {
11
- "& .MuiTabs-scroller": { borderBottom: "1px solid var(--colors-delta-200)" },
12
- "& .MuiTabs-scrollButtons": {
13
- border: "1px solid var(--colors-delta-500)",
14
- width: 40,
15
- height: 40,
16
- borderRadius: "10%",
17
- display: "none",
18
- justifyContent: "center",
19
- alignItems: "center",
20
- alignSelf: "center",
21
- "& svg": {
22
- fontSize: 24,
23
- color: "var(--colors-delta-700)"
24
- },
25
- "&:hover": { backgroundColor: "var(--colors-gama-50)" },
26
- "&:first-of-type": { marginRight: "8px" },
27
- "&:last-of-type": { marginLeft: "8px" },
28
- transition: "opacity 0.3s ease, transform 0.3s ease",
29
- opacity: 0,
30
- transform: "scale(0)"
31
- },
32
- "& .MuiTabs-scrollButtons.Mui-disabled": { display: "none" },
33
- "& .MuiTabs-scrollButtons:not(.Mui-disabled)": {
34
- display: "flex",
35
- opacity: 1,
36
- transform: "scale(1)"
37
- }
38
- }, p = {
39
- minHeight: 36,
40
- "& .MuiTab-root": {
41
- height: 36,
42
- minHeight: 36,
43
- paddingLeft: "12px",
44
- paddingRight: "12px",
45
- paddingTop: "8px",
46
- paddingBottom: "8px"
47
- }
48
- }, f = ({ className: r, size: i = "default", sx: o, ...t }) => {
49
- const a = [c];
50
- return i === "small" && a.push(p), n(o) ? a.push(...o) : d(o) && a.push(o), /* @__PURE__ */ l(e, {
51
- ...t,
52
- className: s("relative rounded-t-lg bg-white px-4", r),
53
- slotProps: {
54
- ...t.slotProps,
55
- indicator: {
56
- style: {
57
- background: "var(--colors-gama-500)",
58
- color: "var(--colors-gama-500)"
59
- },
60
- ...t.slotProps?.indicator ?? {}
61
- }
62
- },
63
- sx: a
1
+ import { cn as d } from "../../../helpers/cn.js";
2
+ import { resolveSx as T } from "../../../helpers/sx.js";
3
+ import { ChevronRightIcon as H } from "../../icons/chevron-right-icon/ChevronRightIcon.js";
4
+ import { ChevronLeftIcon as K } from "../../icons/chevron-left-icon/ChevronLeftIcon.js";
5
+ import { TabsContext as M } from "./TabsContext.js";
6
+ import { Children as P, cloneElement as V, isValidElement as _, useCallback as u, useLayoutEffect as q, useMemo as z, useRef as R, useState as S } from "react";
7
+ import { jsx as o, jsxs as E } from "react/jsx-runtime";
8
+ var I = 120, Z = ({ value: n, onChange: m, variant: b = "standard", scrollButtons: w = "auto", centered: A, size: h = "default", className: N, sx: j, children: g }) => {
9
+ const i = R(null), a = R(/* @__PURE__ */ new Map()), [x, W] = S({
10
+ left: 0,
11
+ width: 0
12
+ }), [c, B] = S({
13
+ left: !1,
14
+ right: !1
15
+ }), y = b === "scrollable", p = u((e, t) => {
16
+ t ? a.current.set(e, t) : a.current.delete(e);
17
+ }, []), v = u((e, t) => m?.(e, t), [m]), f = u(() => {
18
+ const e = a.current.get(n), t = i.current;
19
+ if (e && W({
20
+ left: e.offsetLeft,
21
+ width: e.offsetWidth
22
+ }), t) {
23
+ const { scrollLeft: l, scrollWidth: r, clientWidth: s } = t;
24
+ B({
25
+ left: l > 1,
26
+ right: l + s < r - 1
27
+ });
28
+ }
29
+ }, [n]);
30
+ q(() => {
31
+ f();
32
+ const e = i.current;
33
+ if (!e) return;
34
+ const t = new ResizeObserver(f);
35
+ return t.observe(e), () => t.disconnect();
36
+ }, [f, g]);
37
+ const k = (e) => {
38
+ i.current?.scrollBy({
39
+ left: e,
40
+ behavior: "smooth"
41
+ });
42
+ }, D = (e) => {
43
+ if (![
44
+ "ArrowRight",
45
+ "ArrowLeft",
46
+ "Home",
47
+ "End"
48
+ ].includes(e.key)) return;
49
+ e.preventDefault();
50
+ const t = Array.from(a.current.values()).filter((s) => !s.disabled);
51
+ if (t.length === 0) return;
52
+ const l = t.findIndex((s) => s === document.activeElement);
53
+ let r = l;
54
+ e.key === "ArrowRight" ? r = (l + 1) % t.length : e.key === "ArrowLeft" ? r = (l - 1 + t.length) % t.length : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1), t[r]?.focus();
55
+ }, C = y && w !== !1 && (w === !0 || c.left || c.right), O = z(() => ({
56
+ value: n,
57
+ size: h,
58
+ onSelect: v,
59
+ register: p
60
+ }), [
61
+ n,
62
+ h,
63
+ v,
64
+ p
65
+ ]), L = "flex h-10 w-10 shrink-0 items-center justify-center self-center rounded-[10%] border border-delta-500 text-delta-700 transition-colors hover:bg-gama-50 disabled:invisible";
66
+ return /* @__PURE__ */ o(M.Provider, {
67
+ value: O,
68
+ children: /* @__PURE__ */ E("div", {
69
+ className: d("relative flex items-center rounded-t-lg bg-white px-4", N),
70
+ style: T(j),
71
+ children: [
72
+ C && /* @__PURE__ */ o("button", {
73
+ type: "button",
74
+ "aria-label": "scroll tabs left",
75
+ className: d(L, "mr-2"),
76
+ disabled: !c.left,
77
+ onClick: () => k(-I),
78
+ children: /* @__PURE__ */ o(K, {
79
+ width: 24,
80
+ height: 24
81
+ })
82
+ }),
83
+ /* @__PURE__ */ E("div", {
84
+ ref: i,
85
+ role: "tablist",
86
+ "aria-orientation": "horizontal",
87
+ onKeyDown: D,
88
+ onScroll: f,
89
+ className: d("relative flex border-b border-delta-200 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", y ? "flex-1 overflow-x-auto" : "w-full", b === "fullWidth" && "[&>*]:flex-1", A && "justify-center", h === "small" && "min-h-9"),
90
+ children: [P.map(g, (e, t) => _(e) ? V(e, { index: t }) : e), /* @__PURE__ */ o("span", {
91
+ "aria-hidden": !0,
92
+ className: "absolute bottom-0 h-0.5 bg-gama-500 transition-all duration-300",
93
+ style: {
94
+ left: x.left,
95
+ width: x.width
96
+ }
97
+ })]
98
+ }),
99
+ C && /* @__PURE__ */ o("button", {
100
+ type: "button",
101
+ "aria-label": "scroll tabs right",
102
+ className: d(L, "ml-2"),
103
+ disabled: !c.right,
104
+ onClick: () => k(I),
105
+ children: /* @__PURE__ */ o(H, {
106
+ width: 24,
107
+ height: 24
108
+ })
109
+ })
110
+ ]
111
+ })
64
112
  });
65
113
  };
66
114
  export {
67
- f as StyledTabs
115
+ Z as StyledTabs
68
116
  };
@@ -0,0 +1,6 @@
1
+ import { createContext as t, useContext as e } from "react";
2
+ var o = t(null), a = () => e(o);
3
+ export {
4
+ o as TabsContext,
5
+ a as useTabsContext
6
+ };
@@ -0,0 +1,10 @@
1
+ import { createContext as r, useContext as t } from "react";
2
+ var o = r(null), c = () => {
3
+ const e = t(o);
4
+ if (!e) throw new Error("StyledAccordionSummary/Details must be rendered inside StyledAccordion");
5
+ return e;
6
+ };
7
+ export {
8
+ o as AccordionContext,
9
+ c as useAccordionContext
10
+ };
@@ -1,26 +1,33 @@
1
- import { cn as u } from "../../../../helpers/cn.js";
2
- import s from "./StyledAccordion.module.js";
3
- import "react";
4
- import { jsx as t } from "react/jsx-runtime";
5
- import { Accordion as e } from "@base-ui/react/accordion";
6
- var g = ({ className: c, children: i, expanded: r, defaultExpanded: l, onChange: m, ...n }) => {
7
- const o = "item", d = {
8
- ...n,
9
- type: "single",
10
- className: u(s.AccordionRoot, c),
11
- onValueChange: (a) => {
12
- m?.(a.includes(o));
13
- },
14
- ...r !== void 0 ? { value: r ? [o] : [] } : { defaultValue: l ? [o] : [] }
15
- };
16
- return /* @__PURE__ */ t(e.Root, {
17
- ...d,
18
- children: /* @__PURE__ */ t(e.Item, {
19
- value: o,
20
- children: i
1
+ import { cn as A } from "../../../../helpers/cn.js";
2
+ import I from "./StyledAccordion.module.js";
3
+ import { AccordionContext as S } from "./AccordionContext.js";
4
+ import { useId as l, useMemo as y, useState as C } from "react";
5
+ import { jsx as s } from "react/jsx-runtime";
6
+ var N = ({ className: d, children: m, expanded: t, defaultExpanded: p, disabled: e, onChange: u, ...f }) => {
7
+ const n = l(), r = l(), c = t !== void 0, [a, v] = C(!!p), o = c ? !!t : a, g = () => {
8
+ const i = !o;
9
+ c || v(i), u?.(i);
10
+ }, x = y(() => ({
11
+ open: o,
12
+ toggle: g,
13
+ disabled: e,
14
+ triggerId: n,
15
+ panelId: r
16
+ }), [
17
+ o,
18
+ e,
19
+ n,
20
+ r
21
+ ]);
22
+ return /* @__PURE__ */ s("div", {
23
+ ...f,
24
+ className: A(I.AccordionRoot, d),
25
+ children: /* @__PURE__ */ s(S.Provider, {
26
+ value: x,
27
+ children: m
21
28
  })
22
29
  });
23
30
  };
24
31
  export {
25
- g as StyledAccordion
32
+ N as StyledAccordion
26
33
  };
@@ -1,12 +1,12 @@
1
- var r = "_AccordionRoot_wzlmo_1", o = "_Trigger_wzlmo_9", _ = "_Header_wzlmo_18", e = "_TriggerIcon_wzlmo_40", a = "_TriggerIconRight_wzlmo_48", g = "_Panel_wzlmo_56", l = "_Content_wzlmo_67", n = {
1
+ var r = "_AccordionRoot_p579g_1", _ = "_Trigger_p579g_9", g = "_Header_p579g_18", e = "_TriggerIcon_p579g_40", o = "_TriggerIconRight_p579g_48", a = "_Panel_p579g_56", n = "_Content_p579g_64", t = {
2
2
  AccordionRoot: r,
3
- Trigger: o,
4
- Header: _,
3
+ Trigger: _,
4
+ Header: g,
5
5
  TriggerIcon: e,
6
- TriggerIconRight: a,
7
- Panel: g,
8
- Content: l
6
+ TriggerIconRight: o,
7
+ Panel: a,
8
+ Content: n
9
9
  };
10
10
  export {
11
- n as default
11
+ t as default
12
12
  };