asma-ui-core 3.34.0 → 3.35.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 +27 -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 +43 -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 +37 -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 +21 -2
  130. package/dist/src/components/navigation/menu/StyledMenu.d.ts +25 -2
  131. package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +21 -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 +31 -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
@@ -1,16 +1,30 @@
1
- import o from "./StyledAccordion.module.js";
2
- import { clsx as r } from "clsx";
3
- import "react";
4
- import { jsx as e } from "react/jsx-runtime";
5
- import { Accordion as c } from "@base-ui/react/accordion";
6
- var f = ({ children: m, className: t, contentClassName: i, ...l }) => /* @__PURE__ */ e(c.Panel, {
7
- ...l,
8
- className: r(o.Panel, t),
9
- children: /* @__PURE__ */ e("div", {
10
- className: r(o.Content, i),
11
- children: m
12
- })
13
- });
1
+ import n from "./StyledAccordion.module.js";
2
+ import { useAccordionContext as g } from "./AccordionContext.js";
3
+ import { clsx as s } from "clsx";
4
+ import { useEffect as h, useRef as v, useState as x } from "react";
5
+ import { jsx as c } from "react/jsx-runtime";
6
+ var C = ({ children: r, className: i, contentClassName: l, ...a }) => {
7
+ const { open: d, panelId: m, triggerId: u } = g(), e = v(null), [f, p] = x(0);
8
+ return h(() => {
9
+ if (!e.current) return;
10
+ const t = () => p(e.current?.scrollHeight ?? 0);
11
+ t();
12
+ const o = new ResizeObserver(t);
13
+ return o.observe(e.current), () => o.disconnect();
14
+ }, [r]), /* @__PURE__ */ c("div", {
15
+ ...a,
16
+ id: m,
17
+ role: "region",
18
+ "aria-labelledby": u,
19
+ className: s(n.Panel, i),
20
+ style: { "--accordion-panel-height": d ? `${f}px` : "0px" },
21
+ children: /* @__PURE__ */ c("div", {
22
+ ref: e,
23
+ className: s(n.Content, l),
24
+ children: r
25
+ })
26
+ });
27
+ };
14
28
  export {
15
- f as StyledAccordionDetails
29
+ C as StyledAccordionDetails
16
30
  };
@@ -1,35 +1,39 @@
1
- import { ChevronDownIcon as a } from "../../../icons/chevron-down-icon/ChevronDownIcon.js";
2
- import r from "./StyledAccordion.module.js";
1
+ import { ChevronDownIcon as b } from "../../../icons/chevron-down-icon/ChevronDownIcon.js";
2
+ import e from "./StyledAccordion.module.js";
3
+ import { useAccordionContext as A } from "./AccordionContext.js";
3
4
  import o from "clsx";
4
5
  import "react";
5
- import { Fragment as n, jsx as e, jsxs as s } from "react/jsx-runtime";
6
- import { Accordion as c } from "@base-ui/react/accordion";
7
- var N = ({ size: g = "large", expandChevronRight: m, className: l, headerClassName: d, sx: p, children: i, ...x }) => {
8
- const t = g === "small", f = {
9
- "--trigger-height": t ? "48px" : "72px",
10
- "--trigger-padding-x": t ? "8px" : "16px",
11
- "--trigger-font-size": t ? "14px" : "18px",
12
- "--chevron-size": t ? "20px" : "24px",
6
+ import { Fragment as c, jsx as t, jsxs as l } from "react/jsx-runtime";
7
+ var _ = ({ size: d = "large", expandChevronRight: i, className: g, headerClassName: m, sx: p, children: n, onClick: x, ...h }) => {
8
+ const { open: a, toggle: u, disabled: f, triggerId: y, panelId: I } = A(), r = d === "small", v = {
9
+ "--trigger-height": r ? "48px" : "72px",
10
+ "--trigger-padding-x": r ? "8px" : "16px",
11
+ "--trigger-font-size": r ? "14px" : "18px",
12
+ "--chevron-size": r ? "20px" : "24px",
13
13
  ...p
14
- };
15
- return /* @__PURE__ */ e(c.Header, {
16
- className: o(r.Header, d),
17
- children: /* @__PURE__ */ e(c.Trigger, {
18
- ...x,
19
- nativeButton: !1,
20
- render: /* @__PURE__ */ e("div", {}),
21
- className: o(r.Trigger, l),
22
- style: f,
23
- children: m ? /* @__PURE__ */ s(n, { children: [i, /* @__PURE__ */ e(a, {
24
- className: o(r.TriggerIcon, r.TriggerIconRight),
25
- "data-state-icon": !0
26
- })] }) : /* @__PURE__ */ s(n, { children: [/* @__PURE__ */ e(a, {
27
- className: r.TriggerIcon,
28
- "data-state-icon": !0
29
- }), i] })
14
+ }, s = /* @__PURE__ */ t(b, {
15
+ className: o(e.TriggerIcon, i && e.TriggerIconRight),
16
+ "data-state-icon": !0
17
+ });
18
+ return /* @__PURE__ */ t("h3", {
19
+ className: o(e.Header, m),
20
+ children: /* @__PURE__ */ t("button", {
21
+ ...h,
22
+ type: "button",
23
+ id: y,
24
+ "aria-expanded": a,
25
+ "aria-controls": I,
26
+ disabled: f,
27
+ onClick: (S) => {
28
+ x?.(S), u();
29
+ },
30
+ className: o(e.Trigger, g),
31
+ style: v,
32
+ "data-panel-open": a ? "" : void 0,
33
+ children: i ? /* @__PURE__ */ l(c, { children: [n, s] }) : /* @__PURE__ */ l(c, { children: [s, n] })
30
34
  })
31
35
  });
32
36
  };
33
37
  export {
34
- N as StyledAccordionSummary
38
+ _ as StyledAccordionSummary
35
39
  };
@@ -1,17 +1,45 @@
1
- import { Popover as a } from "@mui/material";
2
- import { jsx as e } from "react/jsx-runtime";
3
- var n = ({ anchorOrigin: o, transformOrigin: r, className: t, ...i }) => /* @__PURE__ */ e(a, {
4
- anchorOrigin: o ?? {
5
- vertical: "bottom",
6
- horizontal: "left"
7
- },
8
- transformOrigin: r ?? {
9
- vertical: "top",
10
- horizontal: "left"
11
- },
12
- className: t ?? "my-1",
13
- ...i
14
- });
1
+ import { cn as w } from "../../../helpers/cn.js";
2
+ import { resolveSx as l } from "../../../helpers/sx.js";
3
+ import { useMemo as x } from "react";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ import { FloatingPortal as z, autoUpdate as R, flip as A, offset as D, shift as M, useDismiss as N, useFloating as P, useInteractions as S, useMergeRefs as k } from "@floating-ui/react";
6
+ var C = {
7
+ vertical: "bottom",
8
+ horizontal: "left"
9
+ }, E = {
10
+ vertical: "top",
11
+ horizontal: "left"
12
+ }, T = (e, t) => `${t.vertical === "bottom" ? "top" : t.vertical === "top" ? "bottom" : e.vertical === "top" ? "top" : "bottom"}${e.horizontal === "left" ? "-start" : e.horizontal === "right" ? "-end" : ""}`, j = ({ open: e, anchorEl: t, onClose: s, anchorOrigin: o = C, transformOrigin: r = E, id: n, className: p, sx: m, slotProps: a, onClick: c, children: f }) => {
13
+ const { refs: d, floatingStyles: u, context: v } = P({
14
+ open: e,
15
+ placement: x(() => T(o, r), [o, r]),
16
+ whileElementsMounted: R,
17
+ elements: { reference: t ?? void 0 },
18
+ middleware: [
19
+ D(4),
20
+ A({ padding: 8 }),
21
+ M({ padding: 8 })
22
+ ],
23
+ onOpenChange: (y, F, b) => {
24
+ y || s?.(F ?? {}, b === "escape-key" ? "escapeKeyDown" : "backdropClick");
25
+ }
26
+ }), { getFloatingProps: g } = S([N(v, {
27
+ outsidePress: !0,
28
+ escapeKey: !0
29
+ })]), h = k([d.setFloating]);
30
+ return e ? /* @__PURE__ */ i(z, { children: /* @__PURE__ */ i("div", {
31
+ ref: h,
32
+ id: n,
33
+ style: {
34
+ ...u,
35
+ ...l(m),
36
+ ...l(a?.paper?.sx)
37
+ },
38
+ ...g({ onClick: c }),
39
+ className: w("z-[1300] overflow-auto rounded bg-white shadow-lg", p ?? "my-1", a?.paper?.className),
40
+ children: f
41
+ }) }) : null;
42
+ };
15
43
  export {
16
- n as StyledPopover
44
+ j as StyledPopover
17
45
  };
@@ -3,17 +3,17 @@ import { StyledDayPicker as k } from "./components/StyledDayPicker.js";
3
3
  import { StyledCalendarPicker as u } from "./components/StyledCalendarPicker.js";
4
4
  import { DatePickerInputIndex as x } from "./components/DatePickerInputIndex.js";
5
5
  import { useIsMobileView as C } from "../../hooks/useWindowWidthSize.hook.js";
6
- import { useBackNavigationClose as h } from "../../hooks/useBackNavigationClose.hook.js";
6
+ import { StyledDrawer as h } from "../../../components/navigation/drawer/StyledDrawer.js";
7
+ import { useBackNavigationClose as v } from "../../hooks/useBackNavigationClose.hook.js";
7
8
  import { useState as s } from "react";
8
- import { Drawer as v } from "@mui/material";
9
- import { Fragment as b, jsx as o, jsxs as D } from "react/jsx-runtime";
9
+ import { Fragment as b, jsx as o, jsxs as y } from "react/jsx-runtime";
10
10
  var j = (c) => {
11
11
  const a = C(), [e, n] = s(null), [p, m] = s(!1), [d, i] = s(!1), P = (l) => {
12
12
  n(l.currentTarget), f(l, m);
13
13
  }, r = () => {
14
14
  i(!0), n(null);
15
15
  };
16
- h({
16
+ v({
17
17
  open: !!e,
18
18
  onClose: r
19
19
  });
@@ -22,7 +22,7 @@ var j = (c) => {
22
22
  validateOnCalendarClose: d,
23
23
  onValidatedOnce: () => i(!1)
24
24
  };
25
- return /* @__PURE__ */ D(b, { children: [
25
+ return /* @__PURE__ */ y(b, { children: [
26
26
  /* @__PURE__ */ o(x, {
27
27
  datePickerProps: t,
28
28
  onClick: P
@@ -36,7 +36,7 @@ var j = (c) => {
36
36
  },
37
37
  positionAbove: p
38
38
  }),
39
- a && /* @__PURE__ */ o(v, {
39
+ a && /* @__PURE__ */ o(h, {
40
40
  anchor: "bottom",
41
41
  open: !!e,
42
42
  onClose: r,
@@ -1,5 +1,5 @@
1
+ import { StyledInputField as G } from "../../../../components/inputs/input-field/StyledInputField.js";
1
2
  import { getValue as x } from "../helpers.js";
2
- import { StyledInputField as G } from "../../../shared-components/StyledInputField.js";
3
3
  import { cn as J } from "../../../helpers/cn.js";
4
4
  import { DatePickerButton as K } from "./DatePickerButton.js";
5
5
  import { useDatePickerMask as L } from "../hooks/useDatePickerMask.js";
@@ -1,6 +1,6 @@
1
- import { cn as a } from "../../../helpers/cn.js";
2
- import { OutlineErrorRounded as s } from "../../../shared-components/OutlineErrorRounded.js";
3
- import { StyledTooltip as m } from "../../../shared-components/StyledTooltip.js";
1
+ import { StyledTooltip as a } from "../../../../components/data-display/tooltip/StyledTooltip.js";
2
+ import { cn as s } from "../../../helpers/cn.js";
3
+ import { OutlineErrorRounded as m } from "../../../shared-components/OutlineErrorRounded.js";
4
4
  import "react";
5
5
  import { Fragment as d, jsx as r, jsxs as p } from "react/jsx-runtime";
6
6
  var b = ({ text: e, hasError: i }) => {
@@ -8,8 +8,8 @@ var b = ({ text: e, hasError: i }) => {
8
8
  const t = i ? 35 : 40, o = e.length > t, n = o ? e.slice(0, t) + "…" : e, l = /* @__PURE__ */ p("div", {
9
9
  className: "flex items-start gap-1",
10
10
  children: [/* @__PURE__ */ r("div", {
11
- className: a("flex", "transform-gpu transition-all duration-300 ease-in-out"),
12
- children: i && /* @__PURE__ */ r(s, {
11
+ className: s("flex", "transform-gpu transition-all duration-300 ease-in-out"),
12
+ children: i && /* @__PURE__ */ r(m, {
13
13
  width: 20,
14
14
  height: 20,
15
15
  color: "var(--colors-error-500)"
@@ -27,7 +27,7 @@ var b = ({ text: e, hasError: i }) => {
27
27
  children: n
28
28
  })]
29
29
  });
30
- return o ? /* @__PURE__ */ r(m, {
30
+ return o ? /* @__PURE__ */ r(a, {
31
31
  title: e,
32
32
  placement: "right",
33
33
  arrow: !0,
@@ -1,25 +1,25 @@
1
- import { StyledDayPicker as n } from "./StyledDayPicker.js";
2
- import { Popover as c } from "@mui/material";
1
+ import { StyledPopover as n } from "../../../../components/utils/popover/StyledPopover.js";
2
+ import { StyledDayPicker as c } from "./StyledDayPicker.js";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
- var h = ({ datePickerProps: e, popoverProps: o, positionAbove: t }) => {
5
- const { open: i, anchorEl: l, onClose: a } = o;
6
- return /* @__PURE__ */ r(c, {
7
- open: i,
8
- anchorEl: l,
4
+ var h = ({ datePickerProps: e, popoverProps: t, positionAbove: o }) => {
5
+ const { open: l, anchorEl: i, onClose: a } = t;
6
+ return /* @__PURE__ */ r(n, {
7
+ open: l,
8
+ anchorEl: i,
9
9
  onClose: a,
10
10
  anchorOrigin: {
11
- vertical: t ? "top" : 50,
11
+ vertical: o ? "top" : 50,
12
12
  horizontal: "left"
13
13
  },
14
14
  transformOrigin: {
15
- vertical: t ? "bottom" : "top",
15
+ vertical: o ? "bottom" : "top",
16
16
  horizontal: "left"
17
17
  },
18
18
  children: /* @__PURE__ */ r("div", {
19
19
  className: "p-4",
20
- children: /* @__PURE__ */ r(n, {
20
+ children: /* @__PURE__ */ r(c, {
21
21
  datePickerProps: e,
22
- popoverProps: o
22
+ popoverProps: t
23
23
  })
24
24
  })
25
25
  });
@@ -2,11 +2,10 @@ import { ChevronLeftIcon as c } from "../../../shared-components/ChevronLeftIcon
2
2
  import { ChevronRightIcon as f } from "../../../shared-components/ChevronRightIcon.js";
3
3
  import { StyledButton as a } from "../../../shared-components/button/StyledButton.js";
4
4
  import { jsx as t, jsxs as s } from "react/jsx-runtime";
5
- import { useNavigation as v } from "react-day-picker";
6
- import { isDate as y, isValid as x } from "date-fns";
7
- import { compact as u, isArray as g, isObject as C } from "lodash-es";
8
- var W = ({ onClose: m, isNb: l, selected: i, removeSelection: h, setMonth: e, onClear: d, required: p }) => {
9
- const { nextMonth: n, previousMonth: r } = v();
5
+ import { useNavigation as y } from "react-day-picker";
6
+ import { isDate as v, isValid as u } from "date-fns";
7
+ var b = ({ onClose: m, isNb: e, selected: i, removeSelection: h, setMonth: l, onClear: d, required: p }) => {
8
+ const { nextMonth: n, previousMonth: r } = y();
10
9
  return /* @__PURE__ */ s("div", {
11
10
  style: {
12
11
  marginTop: "8px",
@@ -18,12 +17,12 @@ var W = ({ onClose: m, isNb: l, selected: i, removeSelection: h, setMonth: e, on
18
17
  dataTest: "",
19
18
  variant: "text",
20
19
  onClick: (o) => {
21
- d ? d() : h(o), e(new Date(Date.now()));
20
+ d ? d() : h(o), l(new Date(Date.now()));
22
21
  },
23
22
  size: "small",
24
- disabled: !!p || i === null || g(i) && i.length === 0 || y(i) && !x(i) || C(i) && !u(Object.values(i)).length,
23
+ disabled: !!p || i === null || Array.isArray(i) && i.length === 0 || v(i) && !u(i) || typeof i == "object" && i !== null && !Object.values(i).filter(Boolean).length,
25
24
  style: { minWidth: "60px" },
26
- children: l ? "Nullstill" : "Clear"
25
+ children: e ? "Nullstill" : "Clear"
27
26
  }),
28
27
  /* @__PURE__ */ s("div", {
29
28
  style: {
@@ -37,7 +36,7 @@ var W = ({ onClose: m, isNb: l, selected: i, removeSelection: h, setMonth: e, on
37
36
  size: "small",
38
37
  disabled: !r,
39
38
  onClick: () => {
40
- r && e(r);
39
+ r && l(r);
41
40
  },
42
41
  style: { minWidth: "25px" },
43
42
  children: /* @__PURE__ */ t(c, {
@@ -49,10 +48,10 @@ var W = ({ onClose: m, isNb: l, selected: i, removeSelection: h, setMonth: e, on
49
48
  dataTest: "",
50
49
  size: "small",
51
50
  onClick: () => {
52
- e(new Date(Date.now()));
51
+ l(new Date(Date.now()));
53
52
  },
54
53
  variant: "outlined",
55
- children: l ? "I dag" : "Today"
54
+ children: e ? "I dag" : "Today"
56
55
  }),
57
56
  /* @__PURE__ */ t(a, {
58
57
  dataTest: "",
@@ -60,7 +59,7 @@ var W = ({ onClose: m, isNb: l, selected: i, removeSelection: h, setMonth: e, on
60
59
  size: "small",
61
60
  disabled: !n,
62
61
  onClick: () => {
63
- n && e(n);
62
+ n && l(n);
64
63
  },
65
64
  style: { minWidth: "25px" },
66
65
  children: /* @__PURE__ */ t(f, {
@@ -78,11 +77,11 @@ var W = ({ onClose: m, isNb: l, selected: i, removeSelection: h, setMonth: e, on
78
77
  m?.(o, "backdropClick");
79
78
  },
80
79
  style: { minWidth: "60px" },
81
- children: l ? "Velg" : "Select"
80
+ children: e ? "Velg" : "Select"
82
81
  })
83
82
  ]
84
83
  });
85
84
  };
86
85
  export {
87
- W as StyledCalendarPickerFooter
86
+ b as StyledCalendarPickerFooter
88
87
  };
@@ -1,17 +1,17 @@
1
- import { StyledFormControl as c } from "../../../shared-components/StyledFormControl.js";
2
- import { StyledSelect as b } from "../../../shared-components/StyledSelect.js";
3
- import { StyledSelectItem as f } from "../../../shared-components/StyledSelectItem.js";
1
+ import { StyledSelect as c } from "../../../../components/inputs/select/StyledSelect.js";
2
+ import { StyledSelectItem as b } from "../../../../components/inputs/select/StyledSelectItem.js";
3
+ import { StyledFormControl as f } from "../../../../components/miscellaneous/StyledFormControl.js";
4
4
  import u from "./StyledCalendarPickerSelectPeriod.module.js";
5
- import { jsx as r } from "react/jsx-runtime";
6
- import { capitalize as S } from "lodash-es";
7
- function x(a) {
8
- const { options: o = [], onChange: l, value: t, disabled: d, className: n, style: i, name: m } = a, s = a["aria-label"];
9
- return /* @__PURE__ */ r(c, {
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ var h = (r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase();
7
+ function g(r) {
8
+ const { options: o = [], onChange: t, value: l, disabled: d, className: n, style: i, name: m } = r, s = r["aria-label"];
9
+ return /* @__PURE__ */ a(f, {
10
10
  style: {
11
11
  marginLeft: "-2px",
12
12
  marginRight: "8px"
13
13
  },
14
- children: /* @__PURE__ */ r(b, {
14
+ children: /* @__PURE__ */ a(c, {
15
15
  dataTest: "StyledCalendarPickerSelectMonth",
16
16
  size: "small",
17
17
  variant: "standard",
@@ -20,8 +20,8 @@ function x(a) {
20
20
  disabled: d,
21
21
  className: n,
22
22
  style: i,
23
- value: t ?? "",
24
- onChange: (e) => l?.(e),
23
+ value: l ?? "",
24
+ onChange: (e) => t?.(e),
25
25
  MenuProps: { className: u["styled-calendar-picker-select-period-menu"] },
26
26
  sx: {
27
27
  "&::before": { borderBottom: "none" },
@@ -29,14 +29,14 @@ function x(a) {
29
29
  "&:hover:not(.Mui-disabled, .Mui-error)::before": { borderBottom: "none" },
30
30
  "&:focus::before": { borderBottom: "none" }
31
31
  },
32
- children: o.map((e) => /* @__PURE__ */ r(f, {
32
+ children: o.map((e) => /* @__PURE__ */ a(b, {
33
33
  value: e.value,
34
34
  disabled: e.disabled,
35
- children: S(e.label)
35
+ children: h(e.label)
36
36
  }, e.value))
37
37
  })
38
38
  });
39
39
  }
40
40
  export {
41
- x as StyledCalendarPickerSelectMonth
41
+ g as StyledCalendarPickerSelectMonth
42
42
  };
@@ -1,16 +1,16 @@
1
- import { StyledFormControl as o } from "../../../shared-components/StyledFormControl.js";
2
- import { StyledSelect as u } from "../../../shared-components/StyledSelect.js";
3
- import { StyledSelectItem as S } from "../../../shared-components/StyledSelectItem.js";
1
+ import { StyledSelect as o } from "../../../../components/inputs/select/StyledSelect.js";
2
+ import { StyledSelectItem as u } from "../../../../components/inputs/select/StyledSelectItem.js";
3
+ import { StyledFormControl as S } from "../../../../components/miscellaneous/StyledFormControl.js";
4
4
  import y from "./StyledCalendarPickerSelectPeriod.module.js";
5
5
  import { jsx as a } from "react/jsx-runtime";
6
6
  function C(l) {
7
7
  const { options: r = [], onChange: t, value: d, disabled: i, className: n, style: m, name: c } = l, s = l["aria-label"];
8
- return /* @__PURE__ */ a(o, {
8
+ return /* @__PURE__ */ a(S, {
9
9
  style: {
10
10
  width: "70px",
11
11
  marginLeft: "5px"
12
12
  },
13
- children: /* @__PURE__ */ a(u, {
13
+ children: /* @__PURE__ */ a(o, {
14
14
  dataTest: "StyledCalendarPickerSelectYear",
15
15
  size: "small",
16
16
  variant: "standard",
@@ -22,7 +22,7 @@ function C(l) {
22
22
  value: d ?? "",
23
23
  onChange: (e) => t?.(e),
24
24
  MenuProps: { className: y["styled-calendar-picker-select-period-menu"] },
25
- children: r.map((e) => /* @__PURE__ */ a(S, {
25
+ children: r.map((e) => /* @__PURE__ */ a(u, {
26
26
  value: e.value,
27
27
  disabled: e.disabled,
28
28
  children: e.label
@@ -5,12 +5,11 @@ import { StyledCalendarPickerSelectYear as N } from "./StyledCalendarPickerSelec
5
5
  import e from "./StyledCalendarPicker.module.js";
6
6
  import { buildDisabled as Y } from "../helpers.js";
7
7
  import { useState as F } from "react";
8
- import "@mui/material";
9
8
  import { jsx as i } from "react/jsx-runtime";
10
9
  import { DayPicker as W } from "react-day-picker";
11
10
  import { endOfMonth as q, startOfToday as R } from "date-fns";
12
11
  import { enGB as T } from "date-fns/locale";
13
- var Q = ({ datePickerProps: t, popoverProps: y }) => {
12
+ var K = ({ datePickerProps: t, popoverProps: y }) => {
14
13
  const { showOutsideDays: h = !0, locale: s = T, numberOfMonths: b, disabledDays: w, onClear: f, title: j, ...g } = t, { onClose: m } = y, [_, c] = F((t.mode === "range" ? t.selected?.from : t.selected) ?? /* @__PURE__ */ new Date()), u = s.code === "nb", v = (b ?? 1) < 2, D = Y(w, "disallowPast" in t ? t.disallowPast : void 0, "disallowFuture" in t ? t.disallowFuture : void 0, R()), S = (n) => {
15
14
  if (!t.selected || !t.onSelect) return;
16
15
  const o = /* @__PURE__ */ new Date(), a = {};
@@ -30,8 +29,8 @@ var Q = ({ datePickerProps: t, popoverProps: y }) => {
30
29
  if (c(n), !!t.onSelect && (!t.mode || t.mode === "single")) {
31
30
  const o = t.selected;
32
31
  if (o instanceof Date) {
33
- const a = n.getFullYear(), d = n.getMonth(), l = o.getDate(), p = q(new Date(a, d, 1)).getDate(), M = Math.min(l, p), r = new Date(o);
34
- r.setFullYear(a, d, M), t.onSelect(r, r, {}, {});
32
+ const a = n.getFullYear(), d = n.getMonth(), l = o.getDate(), M = q(new Date(a, d, 1)).getDate(), p = Math.min(l, M), r = new Date(o);
33
+ r.setFullYear(a, d, p), t.onSelect(r, r, {}, {});
35
34
  }
36
35
  }
37
36
  },
@@ -106,5 +105,5 @@ var Q = ({ datePickerProps: t, popoverProps: y }) => {
106
105
  });
107
106
  };
108
107
  export {
109
- Q as StyledDayPicker
108
+ K as StyledDayPicker
110
109
  };
@@ -1,9 +1,9 @@
1
- import { useMask as e } from "@react-input/mask";
2
- var a = () => ({ maskRef: e({
1
+ import { useInputMask as a } from "../../../../helpers/inputMask.js";
2
+ var s = () => ({ maskRef: a({
3
3
  mask: " / / ",
4
- replacement: { " ": /\d/ },
4
+ maskChar: " ",
5
5
  showMask: !0
6
6
  }) });
7
7
  export {
8
- a as useDatePickerMask
8
+ s as useDatePickerMask
9
9
  };
@@ -1,63 +1,63 @@
1
- import { TimePickerPopper as j } from "./TimePickerPopper.js";
2
- import { getTimeFromValue as H } from "./helpers/getTimeFromValue.js";
1
+ import { PopupState as j } from "../../../hooks/usePopupState.js";
2
+ import { ClickAwayListener as D } from "../../../components/mui-compat/ClickAwayListener.js";
3
+ import { TimePickerPopper as E } from "./TimePickerPopper.js";
4
+ import { getTimeFromValue as P } from "./helpers/getTimeFromValue.js";
3
5
  import { TimePickerInput as T } from "./TimePickerInput.js";
4
6
  import { useState as h } from "react";
5
- import { ClickAwayListener as D } from "@mui/material";
6
- import { jsx as o, jsxs as E } from "react/jsx-runtime";
7
- import { format as v, isBefore as A, isValid as B } from "date-fns";
8
- import N from "material-ui-popup-state";
9
- var J = (i) => {
10
- const { value: a, onSelect: l, notBeforeTime: m } = i, V = a ? v(a, "HH:mm") : "", [x, s] = h(V), [w, t] = h(!1), [g, n] = h(!0), c = w ? x : V, u = (e) => !e || !m || !B(m) || !A(e, m), k = c.length === 5 ? H(c, a) : null, y = k ? u(k) : !0, P = (e) => {
7
+ import { jsx as o, jsxs as A } from "react/jsx-runtime";
8
+ import { format as v, isBefore as B, isValid as N } from "date-fns";
9
+ var J = (l) => {
10
+ const { value: a, onSelect: i, notBeforeTime: m } = l, V = a ? v(a, "HH:mm") : "", [x, s] = h(V), [w, t] = h(!1), [g, n] = h(!0), c = w ? x : V, u = (e) => !e || !m || !N(m) || !B(e, m), k = c.length === 5 ? P(c, a) : null, y = k ? u(k) : !0, C = (e) => {
11
11
  const r = e.close;
12
12
  r?.();
13
- }, C = (e, r) => {
13
+ }, H = (e, r) => {
14
14
  const d = e.target.value;
15
15
  if (t(!0), s(d), d.length !== 5) {
16
16
  n(!1);
17
17
  return;
18
18
  }
19
- const f = H(d, a);
19
+ const f = P(d, a);
20
20
  if (!f) {
21
- l(void 0), n(!1);
21
+ i(void 0), n(!1);
22
22
  return;
23
23
  }
24
- n(!0), u(f) ? (l(f), t(!1), P(r)) : l(void 0);
24
+ n(!0), u(f) ? (i(f), t(!1), C(r)) : i(void 0);
25
25
  }, I = (e) => {
26
26
  if (n(!0), u(e)) {
27
- l(e), s(e ? v(e, "HH:mm") : ""), t(!1);
27
+ i(e), s(e ? v(e, "HH:mm") : ""), t(!1);
28
28
  return;
29
29
  }
30
- l(void 0), s(e ? v(e, "HH:mm") : ""), t(!0);
30
+ i(void 0), s(e ? v(e, "HH:mm") : ""), t(!0);
31
31
  }, L = () => {
32
- l(void 0), s(""), t(!1), n(!0);
32
+ i(void 0), s(""), t(!1), n(!0);
33
33
  };
34
- return /* @__PURE__ */ o(N, {
34
+ return /* @__PURE__ */ o(j, {
35
35
  variant: "popper",
36
36
  popupId: "time-picker-popper",
37
- children: (e) => i.disabled || i.readOnly ? /* @__PURE__ */ o(T, {
38
- ...i,
37
+ children: (e) => l.disabled || l.readOnly ? /* @__PURE__ */ o(T, {
38
+ ...l,
39
39
  popupState: e,
40
40
  localValue: c,
41
41
  isValidTime: g,
42
42
  isValidEndTime: y,
43
- handleChange: (r) => C(r, e)
43
+ handleChange: (r) => H(r, e)
44
44
  }) : /* @__PURE__ */ o(D, {
45
45
  mouseEvent: "onMouseDown",
46
- onClickAway: () => P(e),
47
- children: /* @__PURE__ */ E("div", {
46
+ onClickAway: () => C(e),
47
+ children: /* @__PURE__ */ A("div", {
48
48
  className: "relative h-auto w-auto",
49
49
  children: [/* @__PURE__ */ o("div", {
50
50
  className: "m-0 flex h-fit items-center justify-center p-0",
51
51
  children: /* @__PURE__ */ o(T, {
52
- ...i,
52
+ ...l,
53
53
  popupState: e,
54
54
  localValue: c,
55
55
  isValidTime: g,
56
56
  isValidEndTime: y,
57
- handleChange: (r) => C(r, e)
57
+ handleChange: (r) => H(r, e)
58
58
  })
59
- }), e.isOpen && /* @__PURE__ */ o(j, {
60
- ...i,
59
+ }), e.isOpen && /* @__PURE__ */ o(E, {
60
+ ...l,
61
61
  popupState: e,
62
62
  handleClear: L,
63
63
  onSelect: (r) => I(r)