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.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/data-display/badge/StyledBadge.js +29 -24
- package/dist/components/data-display/chip/StyledChip.js +45 -60
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +32 -38
- package/dist/components/data-display/tooltip/StyledTooltip.js +50 -33
- package/dist/components/data-display/typography/StyledTypography.js +62 -4
- package/dist/components/feedback/dialog/StyledDialog.js +70 -50
- package/dist/components/feedback/dialog/StyledDialog.module.js +2 -9
- package/dist/components/feedback/dialog/StyledDialogActions.js +16 -16
- package/dist/components/feedback/dialog/StyledDialogContent.js +17 -14
- package/dist/components/feedback/dialog/StyledDialogTitle.js +18 -13
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +56 -57
- package/dist/components/feedback/snack-bar/StyledAlert.js +72 -14
- package/dist/components/feedback/snack-bar/StyledSnackbar.js +34 -8
- package/dist/components/feedback/snack-bar/components/StyledDefaultSnackbar.js +33 -34
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +55 -58
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +12 -12
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +1 -1
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +1 -1
- package/dist/components/inputs/field-styles.js +6 -0
- package/dist/components/inputs/input-field/StyledInputField.js +104 -81
- package/dist/components/inputs/input-field/StyledInputField.module.js +4 -0
- package/dist/components/inputs/radio-button/base-ui/RadioGroupContext.js +6 -0
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +40 -29
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +10 -10
- package/dist/components/inputs/radio-button/base-ui/StyledRadioGroup.js +35 -23
- package/dist/components/inputs/select/StyledSelect.js +124 -45
- package/dist/components/inputs/select/StyledSelectItem.js +19 -23
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +181 -151
- package/dist/components/inputs/slider/StyledSlider.js +78 -52
- package/dist/components/inputs/slider/StyledSlider.module.js +10 -0
- package/dist/components/inputs/switch/base-ui/StyledSwitch.js +44 -39
- package/dist/components/miscellaneous/FormControlContext.js +6 -0
- package/dist/components/miscellaneous/StyledFormControl.js +39 -21
- package/dist/components/miscellaneous/StyledFormControlLabel.js +27 -16
- package/dist/components/miscellaneous/StyledFormGroup.js +16 -4
- package/dist/components/miscellaneous/StyledFormHelperText.js +12 -4
- package/dist/components/miscellaneous/StyledInputLabel.js +20 -4
- package/dist/components/mui-compat/Avatar.js +29 -0
- package/dist/components/mui-compat/ClickAwayListener.js +29 -0
- package/dist/components/mui-compat/Container.js +24 -0
- package/dist/components/mui-compat/Fade.js +29 -0
- package/dist/components/mui-compat/Fade.module.js +9 -0
- package/dist/components/mui-compat/FormLabel.js +22 -0
- package/dist/components/mui-compat/Paper.js +44 -0
- package/dist/components/mui-compat/Popper.js +35 -0
- package/dist/components/mui-compat/Skeleton.js +26 -0
- package/dist/components/mui-compat/Stack.js +24 -0
- package/dist/components/navigation/drawer/StyledDrawer.js +42 -4
- package/dist/components/navigation/listbox/Listbox.js +7 -7
- package/dist/components/navigation/menu/StyledMenu.js +28 -11
- package/dist/components/navigation/menu/StyledMenuItem.js +16 -18
- package/dist/components/navigation/menu/StyledMenuList.js +32 -4
- package/dist/components/navigation/tabs/StyledTab.js +25 -13
- package/dist/components/navigation/tabs/StyledTabs.js +112 -64
- package/dist/components/navigation/tabs/TabsContext.js +6 -0
- package/dist/components/utils/accordion/base-ui/AccordionContext.js +10 -0
- package/dist/components/utils/accordion/base-ui/StyledAccordion.js +28 -21
- package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +7 -7
- package/dist/components/utils/accordion/base-ui/StyledAccordionDetails.js +28 -14
- package/dist/components/utils/accordion/base-ui/StyledAccordionSummary.js +31 -27
- package/dist/components/utils/popover/StyledPopover.js +44 -15
- package/dist/datetime/components/date-picker/StyledDatePicker.js +6 -6
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +1 -1
- package/dist/datetime/components/date-picker/components/HelperTextWithTooltip.js +6 -6
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +11 -11
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerFooter.js +13 -14
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectMonth.js +14 -14
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectYear.js +6 -6
- package/dist/datetime/components/date-picker/components/StyledDayPicker.js +4 -5
- package/dist/datetime/components/date-picker/hooks/useDatePickerMask.js +4 -4
- package/dist/datetime/components/time-picker/StyledTimePicker.js +25 -25
- package/dist/datetime/components/time-picker/TimePickerInput.js +15 -16
- package/dist/datetime/components/time-picker/TimePickerPopper.js +21 -19
- package/dist/datetime/helpers/cn.js +4 -5
- package/dist/helpers/arrays.js +4 -0
- package/dist/helpers/cn.js +4 -5
- package/dist/helpers/inputMask.js +45 -0
- package/dist/helpers/sx.js +46 -0
- package/dist/index.js +183 -175
- package/dist/src/api-surface.test.d.ts +1 -0
- package/dist/src/components/data-display/badge/StyledBadge.d.ts +26 -2
- package/dist/src/components/data-display/chip/StyledChip.d.ts +39 -5
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +11 -4
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +36 -2
- package/dist/src/components/data-display/typography/StyledTypography.d.ts +19 -1
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +50 -4
- package/dist/src/components/feedback/dialog/StyledDialogActions.d.ts +12 -2
- package/dist/src/components/feedback/dialog/StyledDialogContent.d.ts +12 -2
- package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +10 -2
- package/dist/src/components/feedback/snack-bar/SnackbarProvider.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/StyledAlert.d.ts +24 -2
- package/dist/src/components/feedback/snack-bar/StyledAlertSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/StyledSnackbar.d.ts +21 -2
- package/dist/src/components/feedback/snack-bar/components/StyledDefaultSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/components/StyledInfoSnackbar.d.ts +1 -1
- package/dist/src/components/feedback/snack-bar/components/types.d.ts +1 -1
- package/dist/src/components/inputs/checkbox/base-ui/StyledCheckbox.d.ts +9 -4
- package/dist/src/components/inputs/dynamic-select/types.d.ts +2 -2
- package/dist/src/components/inputs/field-styles.d.ts +22 -0
- package/dist/src/components/inputs/input-field/StyledInputField.d.ts +67 -11
- package/dist/src/components/inputs/input-field/index.d.ts +1 -1
- package/dist/src/components/inputs/radio-button/base-ui/RadioGroupContext.d.ts +10 -0
- package/dist/src/components/inputs/radio-button/base-ui/StyledRadio.d.ts +20 -5
- package/dist/src/components/inputs/radio-button/base-ui/StyledRadioGroup.d.ts +24 -7
- package/dist/src/components/inputs/select/StyledSelect.d.ts +39 -16
- package/dist/src/components/inputs/select/StyledSelectItem.d.ts +14 -2
- package/dist/src/components/inputs/select/index.d.ts +0 -1
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +88 -17
- package/dist/src/components/inputs/slider/StyledSlider.d.ts +55 -3
- package/dist/src/components/inputs/switch/base-ui/StyledSwitch.d.ts +20 -4
- package/dist/src/components/miscellaneous/FormControlContext.d.ts +14 -0
- package/dist/src/components/miscellaneous/StyledFormControl.d.ts +22 -2
- package/dist/src/components/miscellaneous/StyledFormControlLabel.d.ts +21 -2
- package/dist/src/components/miscellaneous/StyledFormGroup.d.ts +11 -2
- package/dist/src/components/miscellaneous/StyledFormHelperText.d.ts +12 -2
- package/dist/src/components/miscellaneous/StyledInputLabel.d.ts +20 -2
- package/dist/src/components/mui-compat/Avatar.d.ts +6 -0
- package/dist/src/components/mui-compat/ClickAwayListener.d.ts +19 -0
- package/dist/src/components/mui-compat/Container.d.ts +6 -0
- package/dist/src/components/mui-compat/Fade.d.ts +21 -0
- package/dist/src/components/mui-compat/FormLabel.d.ts +6 -0
- package/dist/src/components/mui-compat/Paper.d.ts +6 -0
- package/dist/src/components/mui-compat/Popper.d.ts +29 -0
- package/dist/src/components/mui-compat/Skeleton.d.ts +7 -0
- package/dist/src/components/mui-compat/Stack.d.ts +7 -0
- package/dist/src/components/mui-compat/index.d.ts +9 -0
- package/dist/src/components/mui-compat/types.d.ts +46 -0
- package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +28 -2
- package/dist/src/components/navigation/menu/StyledMenu.d.ts +33 -2
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +23 -2
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +16 -2
- package/dist/src/components/navigation/menu/index.d.ts +0 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -3
- package/dist/src/components/navigation/tabs/StyledTabs.d.ts +16 -7
- package/dist/src/components/navigation/tabs/TabsContext.d.ts +11 -0
- package/dist/src/components/utils/accordion/base-ui/AccordionContext.d.ts +10 -0
- package/dist/src/components/utils/accordion/base-ui/StyledAccordion.d.ts +9 -3
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionDetails.d.ts +5 -0
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionSummary.d.ts +8 -4
- package/dist/src/components/utils/copy-wrapper/CopyWrapper.d.ts +1 -1
- package/dist/src/components/utils/filter-menu/StyledFilterMenu.d.ts +2 -2
- package/dist/src/components/utils/popover/StyledPopover.d.ts +32 -2
- package/dist/src/datetime/components/date-picker/components/StyledCalendarPicker.d.ts +1 -1
- package/dist/src/datetime/components/date-picker/components/StyledDayPicker.d.ts +1 -1
- package/dist/src/datetime/components/date-picker/hooks/useDatePickerMask.d.ts +1 -2
- package/dist/src/datetime/components/time-picker/TimePickerInput.d.ts +1 -1
- package/dist/src/datetime/components/time-picker/TimePickerPopper.d.ts +1 -1
- package/dist/src/datetime/components/time-picker/types.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledFormControl.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledInputField.d.ts +1 -12
- package/dist/src/datetime/shared-components/StyledSelect.d.ts +1 -16
- package/dist/src/datetime/shared-components/StyledSelectItem.d.ts +1 -2
- package/dist/src/datetime/shared-components/StyledTooltip.d.ts +1 -2
- package/dist/src/helpers/arrays.d.ts +2 -0
- package/dist/src/helpers/arrays.test.d.ts +1 -0
- package/dist/src/helpers/inputMask.d.ts +29 -0
- package/dist/src/helpers/inputMask.test.d.ts +1 -0
- package/dist/src/helpers/sx.d.ts +2 -0
- package/dist/src/helpers/sx.test.d.ts +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/table/shared-components/StyledCheckbox.d.ts +7 -4
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +18 -2
- package/dist/src/table/shared-components/menu-item/index.d.ts +13 -2
- package/dist/src/table/shared-components/tooltip/index.d.ts +5 -1
- package/dist/src/table/types.d.ts +1 -1
- package/dist/table/components/Fetching.js +4 -4
- package/dist/table/components/TableRow.js +7 -7
- package/dist/table/components/TableSkeleton.js +6 -6
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +24 -24
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +26 -25
- package/dist/table/components/table-footer/TablePagination.js +27 -24
- package/dist/table/components/table-footer/TableRowCountSelect.js +30 -27
- package/dist/table/helpers/cn.js +4 -5
- package/dist/table/shared-components/StyledCheckbox.js +54 -55
- package/dist/table/shared-components/StyledCheckbox.module.js +10 -10
- package/dist/table/shared-components/StyledMenuItem.js +12 -18
- package/dist/table/shared-components/menu-item/index.js +13 -17
- package/dist/table/shared-components/tooltip/index.js +4 -23
- package/package.json +9 -16
- package/dist/components/feedback/dialog/StyledDialogActions.module.js +0 -8
- package/dist/components/feedback/dialog/StyledDialogContent.module.js +0 -4
- package/dist/components/feedback/dialog/StyledDialogTitle.module.js +0 -4
- package/dist/components/inputs/checkbox/StyledCheckbox.js +0 -20
- package/dist/components/inputs/radio-button/StyledRadio.js +0 -17
- package/dist/datetime/shared-components/ExpandIcon.js +0 -18
- package/dist/datetime/shared-components/StyledFormControl.js +0 -23
- package/dist/datetime/shared-components/StyledInputField.js +0 -47
- package/dist/datetime/shared-components/StyledSelect.js +0 -47
- package/dist/datetime/shared-components/StyledSelectItem.js +0 -13
- package/dist/datetime/shared-components/StyledTooltip.js +0 -32
- package/dist/src/components/inputs/checkbox/StyledCheckbox.d.ts +0 -4
- package/dist/src/components/inputs/radio-button/StyledRadio.d.ts +0 -4
- package/dist/src/components/inputs/radio-button/StyledRadioGroup.d.ts +0 -4
- package/dist/src/components/inputs/switch/StyledSwitch.d.ts +0 -5
- package/dist/src/components/utils/accordion/StyledAccordion.d.ts +0 -2
- package/dist/src/components/utils/accordion/StyledAccordionDetails.d.ts +0 -2
- 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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
|
|
43
|
+
D as StyledDrawer
|
|
6
44
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 =
|
|
5
|
-
const t =
|
|
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] =
|
|
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
|
|
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(
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
30
|
+
M as StyledMenu
|
|
14
31
|
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
19
|
+
D as StyledMenuItem
|
|
22
20
|
};
|
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
|
|
33
|
+
k as StyledMenuList
|
|
6
34
|
};
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
26
|
+
d as StyledTab
|
|
15
27
|
};
|
|
@@ -1,68 +1,116 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
115
|
+
Z as StyledTabs
|
|
68
116
|
};
|
|
@@ -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
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var
|
|
7
|
-
const o =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
32
|
+
N as StyledAccordion
|
|
26
33
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var r = "
|
|
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:
|
|
4
|
-
Header:
|
|
3
|
+
Trigger: _,
|
|
4
|
+
Header: g,
|
|
5
5
|
TriggerIcon: e,
|
|
6
|
-
TriggerIconRight:
|
|
7
|
-
Panel:
|
|
8
|
-
Content:
|
|
6
|
+
TriggerIconRight: o,
|
|
7
|
+
Panel: a,
|
|
8
|
+
Content: n
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
t as default
|
|
12
12
|
};
|