@mantine/core 9.4.0 → 9.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/cjs/components/Accordion/Accordion.cjs +5 -3
  2. package/cjs/components/Accordion/Accordion.cjs.map +1 -1
  3. package/cjs/components/Accordion/Accordion.context.cjs.map +1 -1
  4. package/cjs/components/Accordion/AccordionPanel/AccordionPanel.cjs +2 -1
  5. package/cjs/components/Accordion/AccordionPanel/AccordionPanel.cjs.map +1 -1
  6. package/cjs/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.cjs +2 -2
  7. package/cjs/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.cjs.map +1 -1
  8. package/cjs/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.cjs +2 -2
  9. package/cjs/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.cjs.map +1 -1
  10. package/cjs/components/Collapse/Collapse.cjs +26 -9
  11. package/cjs/components/Collapse/Collapse.cjs.map +1 -1
  12. package/cjs/components/Menu/MenuDropdown/MenuDropdown.cjs +1 -0
  13. package/cjs/components/Menu/MenuDropdown/MenuDropdown.cjs.map +1 -1
  14. package/cjs/components/Menubar/MenubarTarget/MenubarTarget.cjs +1 -1
  15. package/cjs/components/Menubar/MenubarTarget/MenubarTarget.cjs.map +1 -1
  16. package/cjs/components/ModalBase/ModalBase.cjs +3 -2
  17. package/cjs/components/ModalBase/ModalBase.cjs.map +1 -1
  18. package/cjs/components/RollingNumber/get-digit-parts.cjs +2 -1
  19. package/cjs/components/RollingNumber/get-digit-parts.cjs.map +1 -1
  20. package/cjs/components/Slider/Slider.module.cjs.map +1 -1
  21. package/cjs/components/Textarea/Autosize.cjs +1 -0
  22. package/cjs/components/Textarea/Autosize.cjs.map +1 -1
  23. package/cjs/components/Transition/Transition.cjs.map +1 -1
  24. package/cjs/components/Tree/FlatTreeNode.cjs +16 -3
  25. package/cjs/components/Tree/FlatTreeNode.cjs.map +1 -1
  26. package/cjs/components/Tree/Tree.module.cjs.map +1 -1
  27. package/cjs/components/Tree/TreeNode.cjs +17 -5
  28. package/cjs/components/Tree/TreeNode.cjs.map +1 -1
  29. package/cjs/components/Tree/flatten-tree-data/flatten-tree-data.cjs +1 -1
  30. package/cjs/components/Tree/flatten-tree-data/flatten-tree-data.cjs.map +1 -1
  31. package/cjs/components/TreeSelect/TreeSelectOption.cjs +5 -3
  32. package/cjs/components/TreeSelect/TreeSelectOption.cjs.map +1 -1
  33. package/cjs/components/TreeSelect/flatten-tree-select-data.cjs +1 -1
  34. package/cjs/components/TreeSelect/flatten-tree-select-data.cjs.map +1 -1
  35. package/cjs/utils/Floating/FloatingArrow/FloatingArrow.cjs +1 -0
  36. package/cjs/utils/Floating/FloatingArrow/FloatingArrow.cjs.map +1 -1
  37. package/esm/components/Accordion/Accordion.context.mjs.map +1 -1
  38. package/esm/components/Accordion/Accordion.mjs +5 -3
  39. package/esm/components/Accordion/Accordion.mjs.map +1 -1
  40. package/esm/components/Accordion/AccordionPanel/AccordionPanel.mjs +2 -1
  41. package/esm/components/Accordion/AccordionPanel/AccordionPanel.mjs.map +1 -1
  42. package/esm/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.mjs +2 -2
  43. package/esm/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.mjs.map +1 -1
  44. package/esm/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.mjs +2 -2
  45. package/esm/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.mjs.map +1 -1
  46. package/esm/components/Collapse/Collapse.mjs +26 -9
  47. package/esm/components/Collapse/Collapse.mjs.map +1 -1
  48. package/esm/components/Menu/MenuDropdown/MenuDropdown.mjs +1 -0
  49. package/esm/components/Menu/MenuDropdown/MenuDropdown.mjs.map +1 -1
  50. package/esm/components/Menubar/MenubarTarget/MenubarTarget.mjs +1 -1
  51. package/esm/components/Menubar/MenubarTarget/MenubarTarget.mjs.map +1 -1
  52. package/esm/components/ModalBase/ModalBase.mjs +3 -2
  53. package/esm/components/ModalBase/ModalBase.mjs.map +1 -1
  54. package/esm/components/RollingNumber/get-digit-parts.mjs +2 -1
  55. package/esm/components/RollingNumber/get-digit-parts.mjs.map +1 -1
  56. package/esm/components/Slider/Slider.module.mjs.map +1 -1
  57. package/esm/components/Textarea/Autosize.mjs +1 -0
  58. package/esm/components/Textarea/Autosize.mjs.map +1 -1
  59. package/esm/components/Transition/Transition.mjs.map +1 -1
  60. package/esm/components/Tree/FlatTreeNode.mjs +16 -3
  61. package/esm/components/Tree/FlatTreeNode.mjs.map +1 -1
  62. package/esm/components/Tree/Tree.module.mjs.map +1 -1
  63. package/esm/components/Tree/TreeNode.mjs +17 -5
  64. package/esm/components/Tree/TreeNode.mjs.map +1 -1
  65. package/esm/components/Tree/flatten-tree-data/flatten-tree-data.mjs +1 -1
  66. package/esm/components/Tree/flatten-tree-data/flatten-tree-data.mjs.map +1 -1
  67. package/esm/components/TreeSelect/TreeSelectOption.mjs +5 -3
  68. package/esm/components/TreeSelect/TreeSelectOption.mjs.map +1 -1
  69. package/esm/components/TreeSelect/flatten-tree-select-data.mjs +1 -1
  70. package/esm/components/TreeSelect/flatten-tree-select-data.mjs.map +1 -1
  71. package/esm/utils/Floating/FloatingArrow/FloatingArrow.mjs +1 -0
  72. package/esm/utils/Floating/FloatingArrow/FloatingArrow.mjs.map +1 -1
  73. package/lib/components/Accordion/Accordion.context.d.ts +1 -0
  74. package/lib/components/Accordion/Accordion.d.ts +2 -0
  75. package/lib/components/Accordion/AccordionPanel/AccordionPanel.d.ts +2 -0
  76. package/lib/components/Collapse/Collapse.d.ts +6 -0
  77. package/lib/components/ModalBase/ModalBase.d.ts +7 -1
  78. package/lib/components/Transition/Transition.d.ts +2 -2
  79. package/lib/components/TreeSelect/TreeSelectOption.d.ts +4 -0
  80. package/package.json +2 -2
  81. package/styles/Slider.css +4 -0
  82. package/styles/Slider.layer.css +4 -0
  83. package/styles/Tree.css +1 -1
  84. package/styles/Tree.layer.css +1 -1
  85. package/styles.css +5 -1
  86. package/styles.layer.css +5 -1
@@ -23,7 +23,8 @@ const defaultProps = {
23
23
  chevronPosition: "right",
24
24
  variant: "default",
25
25
  chevronSize: "auto",
26
- chevronIconSize: 16
26
+ chevronIconSize: 16,
27
+ keepMountedMode: "activity"
27
28
  };
28
29
  const varsResolver = require_create_vars_resolver.createVarsResolver((_, { transitionDuration, chevronSize, radius }) => ({ root: {
29
30
  "--accordion-transition-duration": transitionDuration === void 0 ? void 0 : `${transitionDuration}ms`,
@@ -32,7 +33,7 @@ const varsResolver = require_create_vars_resolver.createVarsResolver((_, { trans
32
33
  } }));
33
34
  const Accordion = require_factory.genericFactory((_props) => {
34
35
  const props = require_use_props.useProps("Accordion", defaultProps, _props);
35
- const { classNames, className, style, styles, unstyled, vars, children, multiple, value, defaultValue, onChange, id, loop, transitionDuration, disableChevronRotation, chevronPosition, chevronSize, order, chevron, variant, radius, chevronIconSize, attributes, keepMounted, ...others } = props;
36
+ const { classNames, className, style, styles, unstyled, vars, children, multiple, value, defaultValue, onChange, id, loop, transitionDuration, disableChevronRotation, chevronPosition, chevronSize, order, chevron, variant, radius, chevronIconSize, attributes, keepMounted, keepMountedMode, ...others } = props;
36
37
  const uid = (0, _mantine_hooks.useId)(id);
37
38
  const [_value, handleChange] = (0, _mantine_hooks.useUncontrolled)({
38
39
  value,
@@ -72,7 +73,8 @@ const Accordion = require_factory.genericFactory((_props) => {
72
73
  getStyles,
73
74
  variant,
74
75
  unstyled,
75
- keepMounted
76
+ keepMounted,
77
+ keepMountedMode
76
78
  },
77
79
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
78
80
  ...getStyles("root"),
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.cjs","names":["createVarsResolver","rem","getRadius","genericFactory","useProps","useStyles","AccordionProvider","getSafeId","AccordionChevron","Box","classes","AccordionItem","AccordionPanel","AccordionControl"],"sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getRadius,\n getSafeId,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AccordionProvider } from './Accordion.context';\nimport { AccordionChevronPosition, AccordionHeadingOrder, AccordionValue } from './Accordion.types';\nimport { AccordionChevron } from './AccordionChevron';\nimport { AccordionControl, type AccordionControlProps } from './AccordionControl/AccordionControl';\nimport { AccordionItem, type AccordionItemProps } from './AccordionItem/AccordionItem';\nimport { AccordionPanel, type AccordionPanelProps } from './AccordionPanel/AccordionPanel';\nimport classes from './Accordion.module.css';\nimport type { AccordionItemContextValue } from './AccordionItem.context';\nexport type AccordionStylesNames =\n | 'root'\n | 'content'\n | 'item'\n | 'panel'\n | 'icon'\n | 'chevron'\n | 'label'\n | 'itemTitle'\n | 'control';\n\nexport type AccordionVariant = 'default' | 'contained' | 'filled' | 'separated';\nexport type AccordionCssVariables = {\n root: '--accordion-transition-duration' | '--accordion-chevron-size' | '--accordion-radius';\n};\n\nexport interface AccordionProps<Multiple extends boolean = false>\n extends\n BoxProps,\n StylesApiProps<AccordionFactory>,\n ElementProps<'div', 'value' | 'defaultValue' | 'onChange'> {\n /** If set, multiple items can be opened at the same time @default false */\n multiple?: Multiple;\n\n /** Controlled component value */\n value?: AccordionValue<Multiple>;\n\n /** Uncontrolled component default value */\n defaultValue?: AccordionValue<Multiple>;\n\n /** Called when value changes, payload type depends on `multiple` prop */\n onChange?: (value: AccordionValue<Multiple>) => void;\n\n /** If set, arrow keys loop through items (first to last and last to first) @default true */\n loop?: boolean;\n\n /** Transition duration in ms @default 200 */\n transitionDuration?: number;\n\n /** If set, chevron rotation is disabled @default false */\n disableChevronRotation?: boolean;\n\n /** Position of the chevron relative to the item label @default right */\n chevronPosition?: AccordionChevronPosition;\n\n /** Size of the chevron icon container @default auto */\n chevronSize?: number | string;\n\n /** Size of the default chevron icon. Ignored when `chevron` prop is set. Use `chevronSize` instead when using custom chevron. @default 16 */\n chevronIconSize?: number | string;\n\n /** Sets heading level (h2-h6) for `Accordion.Control` elements. Wraps each control in the corresponding heading tag, recommended to meet WAI-ARIA accessibility requirements. Has no visual effect. */\n order?: AccordionHeadingOrder;\n\n /** Custom chevron icon */\n chevron?: React.ReactNode;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius. Numbers are converted to rem. @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set to `false`, panels are unmounted when collapsed. By default, panels stay mounted when collapsed. @default true */\n keepMounted?: boolean;\n}\n\nexport type AccordionFactory = Factory<{\n props: AccordionProps;\n ref: HTMLDivElement;\n stylesNames: AccordionStylesNames;\n vars: AccordionCssVariables;\n variant: AccordionVariant;\n signature: <Multiple extends boolean = false>(\n props: AccordionProps<Multiple>\n ) => React.JSX.Element;\n staticComponents: {\n Item: typeof AccordionItem;\n Panel: typeof AccordionPanel;\n Control: typeof AccordionControl;\n Chevron: typeof AccordionChevron;\n };\n}>;\n\nconst defaultProps = {\n multiple: false,\n loop: true,\n disableChevronRotation: false,\n chevronPosition: 'right',\n variant: 'default',\n chevronSize: 'auto',\n chevronIconSize: 16,\n} satisfies Partial<AccordionProps>;\n\nconst varsResolver = createVarsResolver<AccordionFactory>(\n (_, { transitionDuration, chevronSize, radius }) => ({\n root: {\n '--accordion-transition-duration':\n transitionDuration === undefined ? undefined : `${transitionDuration}ms`,\n '--accordion-chevron-size': chevronSize === undefined ? undefined : rem(chevronSize),\n '--accordion-radius': radius === undefined ? undefined : getRadius(radius),\n },\n })\n);\n\nexport const Accordion = genericFactory<AccordionFactory>((_props) => {\n const props = useProps('Accordion', defaultProps as any, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n multiple,\n value,\n defaultValue,\n onChange,\n id,\n loop,\n transitionDuration,\n disableChevronRotation,\n chevronPosition,\n chevronSize,\n order,\n chevron,\n variant,\n radius,\n chevronIconSize,\n attributes,\n keepMounted,\n ...others\n } = props;\n\n const uid = useId(id);\n const [_value, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: multiple ? ([] as any) : null,\n onChange,\n });\n\n const isItemActive = (itemValue: string) =>\n Array.isArray(_value) ? _value.includes(itemValue) : itemValue === _value;\n\n const handleItemChange = (itemValue: string) => {\n const nextValue = Array.isArray(_value)\n ? _value.includes(itemValue)\n ? _value.filter((selectedValue) => selectedValue !== itemValue)\n : [..._value, itemValue]\n : itemValue === _value\n ? null\n : (itemValue as any);\n\n handleChange(nextValue);\n };\n\n const getStyles = useStyles<AccordionFactory>({\n name: 'Accordion',\n classes,\n props: props as AccordionProps,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <AccordionProvider\n value={{\n isItemActive,\n onChange: handleItemChange,\n getControlId: getSafeId(\n `${uid}-control`,\n 'Accordion.Item component was rendered with invalid value or without value'\n ),\n getRegionId: getSafeId(\n `${uid}-panel`,\n 'Accordion.Item component was rendered with invalid value or without value'\n ),\n chevron: chevron === null ? null : chevron || <AccordionChevron size={chevronIconSize} />,\n transitionDuration,\n disableChevronRotation,\n chevronPosition,\n order,\n loop,\n getStyles,\n variant,\n unstyled,\n keepMounted,\n }}\n >\n <Box {...getStyles('root')} id={uid} {...others} variant={variant} data-accordion>\n {children}\n </Box>\n </AccordionProvider>\n );\n});\n\nAccordion.classes = classes;\nAccordion.varsResolver = varsResolver;\nAccordion.displayName = '@mantine/core/Accordion';\nAccordion.Item = AccordionItem;\nAccordion.Panel = AccordionPanel;\nAccordion.Control = AccordionControl;\nAccordion.Chevron = AccordionChevron;\n\nexport namespace Accordion {\n export type Props = AccordionProps;\n export type StylesNames = AccordionStylesNames;\n export type CssVariables = AccordionCssVariables;\n export type Factory = AccordionFactory;\n export type Variant = AccordionVariant;\n\n export namespace Control {\n export type Props = AccordionControlProps;\n }\n\n export namespace Item {\n export type Props = AccordionItemProps;\n export type Context = AccordionItemContextValue;\n }\n\n export namespace Panel {\n export type Props = AccordionPanelProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyGA,MAAM,eAAe;CACnB,UAAU;CACV,MAAM;CACN,wBAAwB;CACxB,iBAAiB;CACjB,SAAS;CACT,aAAa;CACb,iBAAiB;AACnB;AAEA,MAAM,eAAeA,6BAAAA,oBAClB,GAAG,EAAE,oBAAoB,aAAa,cAAc,EACnD,MAAM;CACJ,mCACE,uBAAuB,KAAA,IAAY,KAAA,IAAY,GAAG,mBAAmB;CACvE,4BAA4B,gBAAgB,KAAA,IAAY,KAAA,IAAYC,YAAAA,IAAI,WAAW;CACnF,sBAAsB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,MAAM;AAC3E,EACF,EACF;AAEA,MAAa,YAAYC,gBAAAA,gBAAkC,WAAW;CACpE,MAAM,QAAQC,kBAAAA,SAAS,aAAa,cAAqB,MAAM;CAC/D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,UACA,OACA,cACA,UACA,IACA,MACA,oBACA,wBACA,iBACA,aACA,OACA,SACA,SACA,QACA,iBACA,YACA,aACA,GAAG,WACD;CAEJ,MAAM,OAAA,GAAA,eAAA,MAAA,CAAY,EAAE;CACpB,MAAM,CAAC,QAAQ,iBAAA,GAAA,eAAA,gBAAA,CAAgC;EAC7C;EACA;EACA,YAAY,WAAY,CAAC,IAAY;EACrC;CACF,CAAC;CAED,MAAM,gBAAgB,cACpB,MAAM,QAAQ,MAAM,IAAI,OAAO,SAAS,SAAS,IAAI,cAAc;CAErE,MAAM,oBAAoB,cAAsB;EAS9C,aARkB,MAAM,QAAQ,MAAM,IAClC,OAAO,SAAS,SAAS,IACvB,OAAO,QAAQ,kBAAkB,kBAAkB,SAAS,IAC5D,CAAC,GAAG,QAAQ,SAAS,IACvB,cAAc,SACZ,OACC,SAEe;CACxB;CAEA,MAAM,YAAYC,mBAAAA,UAA4B;EAC5C,MAAM;EACN,SAAA,yBAAA;EACO;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,mBAAD;EACE,OAAO;GACL;GACA,UAAU;GACV,cAAcC,oBAAAA,UACZ,GAAG,IAAI,WACP,2EACF;GACA,aAAaA,oBAAAA,UACX,GAAG,IAAI,SACP,2EACF;GACA,SAAS,YAAY,OAAO,OAAO,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,kBAAD,EAAkB,MAAM,gBAAkB,CAAA;GACxF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;YAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;GAAK,GAAI,UAAU,MAAM;GAAG,IAAI;GAAK,GAAI;GAAiB;GAAS,kBAAA;GAChE;EACE,CAAA;CACY,CAAA;AAEvB,CAAC;AAED,UAAU,UAAUC,yBAAAA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc;AACxB,UAAU,OAAOC,sBAAAA;AACjB,UAAU,QAAQC,uBAAAA;AAClB,UAAU,UAAUC,yBAAAA;AACpB,UAAU,UAAUL,yBAAAA"}
1
+ {"version":3,"file":"Accordion.cjs","names":["createVarsResolver","rem","getRadius","genericFactory","useProps","useStyles","AccordionProvider","getSafeId","AccordionChevron","Box","classes","AccordionItem","AccordionPanel","AccordionControl"],"sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getRadius,\n getSafeId,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AccordionProvider } from './Accordion.context';\nimport { AccordionChevronPosition, AccordionHeadingOrder, AccordionValue } from './Accordion.types';\nimport { AccordionChevron } from './AccordionChevron';\nimport { AccordionControl, type AccordionControlProps } from './AccordionControl/AccordionControl';\nimport { AccordionItem, type AccordionItemProps } from './AccordionItem/AccordionItem';\nimport { AccordionPanel, type AccordionPanelProps } from './AccordionPanel/AccordionPanel';\nimport classes from './Accordion.module.css';\nimport type { AccordionItemContextValue } from './AccordionItem.context';\nexport type AccordionStylesNames =\n | 'root'\n | 'content'\n | 'item'\n | 'panel'\n | 'icon'\n | 'chevron'\n | 'label'\n | 'itemTitle'\n | 'control';\n\nexport type AccordionVariant = 'default' | 'contained' | 'filled' | 'separated';\nexport type AccordionCssVariables = {\n root: '--accordion-transition-duration' | '--accordion-chevron-size' | '--accordion-radius';\n};\n\nexport interface AccordionProps<Multiple extends boolean = false>\n extends\n BoxProps,\n StylesApiProps<AccordionFactory>,\n ElementProps<'div', 'value' | 'defaultValue' | 'onChange'> {\n /** If set, multiple items can be opened at the same time @default false */\n multiple?: Multiple;\n\n /** Controlled component value */\n value?: AccordionValue<Multiple>;\n\n /** Uncontrolled component default value */\n defaultValue?: AccordionValue<Multiple>;\n\n /** Called when value changes, payload type depends on `multiple` prop */\n onChange?: (value: AccordionValue<Multiple>) => void;\n\n /** If set, arrow keys loop through items (first to last and last to first) @default true */\n loop?: boolean;\n\n /** Transition duration in ms @default 200 */\n transitionDuration?: number;\n\n /** If set, chevron rotation is disabled @default false */\n disableChevronRotation?: boolean;\n\n /** Position of the chevron relative to the item label @default right */\n chevronPosition?: AccordionChevronPosition;\n\n /** Size of the chevron icon container @default auto */\n chevronSize?: number | string;\n\n /** Size of the default chevron icon. Ignored when `chevron` prop is set. Use `chevronSize` instead when using custom chevron. @default 16 */\n chevronIconSize?: number | string;\n\n /** Sets heading level (h2-h6) for `Accordion.Control` elements. Wraps each control in the corresponding heading tag, recommended to meet WAI-ARIA accessibility requirements. Has no visual effect. */\n order?: AccordionHeadingOrder;\n\n /** Custom chevron icon */\n chevron?: React.ReactNode;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius. Numbers are converted to rem. @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set to `false`, panels are unmounted when collapsed. By default, panels stay mounted when collapsed. @default true */\n keepMounted?: boolean;\n\n /** Controls how inactive panels content is hidden when `keepMounted` is `true`, `'activity'` – hidden with `Activity` component, `'display-none'` – hidden with `display: none` styles @default 'activity' */\n keepMountedMode?: 'activity' | 'display-none';\n}\n\nexport type AccordionFactory = Factory<{\n props: AccordionProps;\n ref: HTMLDivElement;\n stylesNames: AccordionStylesNames;\n vars: AccordionCssVariables;\n variant: AccordionVariant;\n signature: <Multiple extends boolean = false>(\n props: AccordionProps<Multiple>\n ) => React.JSX.Element;\n staticComponents: {\n Item: typeof AccordionItem;\n Panel: typeof AccordionPanel;\n Control: typeof AccordionControl;\n Chevron: typeof AccordionChevron;\n };\n}>;\n\nconst defaultProps = {\n multiple: false,\n loop: true,\n disableChevronRotation: false,\n chevronPosition: 'right',\n variant: 'default',\n chevronSize: 'auto',\n chevronIconSize: 16,\n keepMountedMode: 'activity',\n} satisfies Partial<AccordionProps>;\n\nconst varsResolver = createVarsResolver<AccordionFactory>(\n (_, { transitionDuration, chevronSize, radius }) => ({\n root: {\n '--accordion-transition-duration':\n transitionDuration === undefined ? undefined : `${transitionDuration}ms`,\n '--accordion-chevron-size': chevronSize === undefined ? undefined : rem(chevronSize),\n '--accordion-radius': radius === undefined ? undefined : getRadius(radius),\n },\n })\n);\n\nexport const Accordion = genericFactory<AccordionFactory>((_props) => {\n const props = useProps('Accordion', defaultProps as any, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n multiple,\n value,\n defaultValue,\n onChange,\n id,\n loop,\n transitionDuration,\n disableChevronRotation,\n chevronPosition,\n chevronSize,\n order,\n chevron,\n variant,\n radius,\n chevronIconSize,\n attributes,\n keepMounted,\n keepMountedMode,\n ...others\n } = props;\n\n const uid = useId(id);\n const [_value, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: multiple ? ([] as any) : null,\n onChange,\n });\n\n const isItemActive = (itemValue: string) =>\n Array.isArray(_value) ? _value.includes(itemValue) : itemValue === _value;\n\n const handleItemChange = (itemValue: string) => {\n const nextValue = Array.isArray(_value)\n ? _value.includes(itemValue)\n ? _value.filter((selectedValue) => selectedValue !== itemValue)\n : [..._value, itemValue]\n : itemValue === _value\n ? null\n : (itemValue as any);\n\n handleChange(nextValue);\n };\n\n const getStyles = useStyles<AccordionFactory>({\n name: 'Accordion',\n classes,\n props: props as AccordionProps,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <AccordionProvider\n value={{\n isItemActive,\n onChange: handleItemChange,\n getControlId: getSafeId(\n `${uid}-control`,\n 'Accordion.Item component was rendered with invalid value or without value'\n ),\n getRegionId: getSafeId(\n `${uid}-panel`,\n 'Accordion.Item component was rendered with invalid value or without value'\n ),\n chevron: chevron === null ? null : chevron || <AccordionChevron size={chevronIconSize} />,\n transitionDuration,\n disableChevronRotation,\n chevronPosition,\n order,\n loop,\n getStyles,\n variant,\n unstyled,\n keepMounted,\n keepMountedMode,\n }}\n >\n <Box {...getStyles('root')} id={uid} {...others} variant={variant} data-accordion>\n {children}\n </Box>\n </AccordionProvider>\n );\n});\n\nAccordion.classes = classes;\nAccordion.varsResolver = varsResolver;\nAccordion.displayName = '@mantine/core/Accordion';\nAccordion.Item = AccordionItem;\nAccordion.Panel = AccordionPanel;\nAccordion.Control = AccordionControl;\nAccordion.Chevron = AccordionChevron;\n\nexport namespace Accordion {\n export type Props = AccordionProps;\n export type StylesNames = AccordionStylesNames;\n export type CssVariables = AccordionCssVariables;\n export type Factory = AccordionFactory;\n export type Variant = AccordionVariant;\n\n export namespace Control {\n export type Props = AccordionControlProps;\n }\n\n export namespace Item {\n export type Props = AccordionItemProps;\n export type Context = AccordionItemContextValue;\n }\n\n export namespace Panel {\n export type Props = AccordionPanelProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA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E,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,mBAAD;EACE,OAAO;GACL;GACA,UAAU;GACV,cAAcC,oBAAAA,UACZ,GAAG,IAAI,WACP,2EACF;GACA,aAAaA,oBAAAA,UACX,GAAG,IAAI,SACP,2EACF;GACA,SAAS,YAAY,OAAO,OAAO,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,kBAAD,EAAkB,MAAM,gBAAkB,CAAA;GACxF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;YAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;GAAK,GAAI,UAAU,MAAM;GAAG,IAAI;GAAK,GAAI;GAAiB;GAAS,kBAAA;GAChE;EACE,CAAA;CACY,CAAA;AAEvB,CAAC;AAED,UAAU,UAAUC,yBAAAA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc;AACxB,UAAU,OAAOC,sBAAAA;AACjB,UAAU,QAAQC,uBAAAA;AAClB,UAAU,UAAUC,yBAAAA;AACpB,UAAU,UAAUL,yBAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.context.cjs","names":["createSafeContext"],"sources":["../../../src/components/Accordion/Accordion.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '../../core';\nimport type { AccordionFactory } from './Accordion';\nimport { AccordionChevronPosition, AccordionHeadingOrder } from './Accordion.types';\n\nexport interface AccordionContextValue {\n loop: boolean | undefined;\n transitionDuration: number | undefined;\n disableChevronRotation: boolean | undefined;\n chevronPosition: AccordionChevronPosition | undefined;\n order: AccordionHeadingOrder | undefined;\n chevron: React.ReactNode;\n onChange: (value: string) => void;\n isItemActive: (value: string) => boolean;\n getControlId: (value: string) => string;\n getRegionId: (value: string) => string;\n getStyles: GetStylesApi<AccordionFactory>;\n variant: string | undefined;\n unstyled: boolean | undefined;\n keepMounted: boolean | undefined;\n}\n\nexport const [AccordionProvider, useAccordionContext] = createSafeContext<AccordionContextValue>(\n 'Accordion component was not found in the tree'\n);\n"],"mappings":";;AAqBA,MAAa,CAAC,mBAAmB,6FAAuBA,CAAAA,CAAAA,kBACtD,+CACF"}
1
+ {"version":3,"file":"Accordion.context.cjs","names":["createSafeContext"],"sources":["../../../src/components/Accordion/Accordion.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '../../core';\nimport type { AccordionFactory } from './Accordion';\nimport { AccordionChevronPosition, AccordionHeadingOrder } from './Accordion.types';\n\nexport interface AccordionContextValue {\n loop: boolean | undefined;\n transitionDuration: number | undefined;\n disableChevronRotation: boolean | undefined;\n chevronPosition: AccordionChevronPosition | undefined;\n order: AccordionHeadingOrder | undefined;\n chevron: React.ReactNode;\n onChange: (value: string) => void;\n isItemActive: (value: string) => boolean;\n getControlId: (value: string) => string;\n getRegionId: (value: string) => string;\n getStyles: GetStylesApi<AccordionFactory>;\n variant: string | undefined;\n unstyled: boolean | undefined;\n keepMounted: boolean | undefined;\n keepMountedMode: 'activity' | 'display-none' | undefined;\n}\n\nexport const [AccordionProvider, useAccordionContext] = createSafeContext<AccordionContextValue>(\n 'Accordion component was not found in the tree'\n);\n"],"mappings":";;AAsBA,MAAa,CAAC,mBAAmB,6FAAuBA,CAAAA,CAAAA,kBACtD,+CACF"}
@@ -8,7 +8,7 @@ const require_Accordion_module = require("../Accordion.module.cjs");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  //#region packages/@mantine/core/src/components/Accordion/AccordionPanel/AccordionPanel.tsx
10
10
  const AccordionPanel = require_factory.factory((props) => {
11
- const { classNames, className, style, styles, vars, children, keepMounted, ...others } = require_use_props.useProps("AccordionPanel", null, props);
11
+ const { classNames, className, style, styles, vars, children, keepMounted, keepMountedMode, ...others } = require_use_props.useProps("AccordionPanel", null, props);
12
12
  const { value } = require_AccordionItem_context.useAccordionItemContext();
13
13
  const ctx = require_Accordion_context.useAccordionContext();
14
14
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Collapse.Collapse, {
@@ -24,6 +24,7 @@ const AccordionPanel = require_factory.factory((props) => {
24
24
  id: ctx.getRegionId(value),
25
25
  "aria-labelledby": ctx.getControlId(value),
26
26
  keepMounted: keepMounted ?? ctx.keepMounted,
27
+ keepMountedMode: keepMountedMode ?? ctx.keepMountedMode,
27
28
  ...others,
28
29
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
29
30
  ...ctx.getStyles("content", {
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionPanel.cjs","names":["factory","useProps","useAccordionItemContext","useAccordionContext","Collapse","classes"],"sources":["../../../../src/components/Accordion/AccordionPanel/AccordionPanel.tsx"],"sourcesContent":["import {\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { Collapse } from '../../Collapse';\nimport { useAccordionContext } from '../Accordion.context';\nimport { useAccordionItemContext } from '../AccordionItem.context';\nimport classes from '../Accordion.module.css';\n\nexport type AccordionPanelStylesNames = 'panel' | 'content';\n\nexport interface AccordionPanelProps\n extends BoxProps, CompoundStylesApiProps<AccordionPanelFactory>, ElementProps<'div'> {\n /** Called when the panel animation completes */\n onTransitionEnd?: () => void;\n\n /** Called when the panel animation starts */\n onTransitionStart?: () => void;\n\n /** If set, overrides the Accordion-level `keepMounted` value. When undefined (default), uses Accordion's `keepMounted` setting. */\n keepMounted?: boolean;\n}\n\nexport type AccordionPanelFactory = Factory<{\n props: AccordionPanelProps;\n ref: HTMLDivElement;\n stylesNames: AccordionPanelStylesNames;\n compound: true;\n}>;\n\nexport const AccordionPanel = factory<AccordionPanelFactory>((props) => {\n const { classNames, className, style, styles, vars, children, keepMounted, ...others } = useProps(\n 'AccordionPanel',\n null,\n props\n );\n\n const { value } = useAccordionItemContext();\n const ctx = useAccordionContext();\n\n return (\n <Collapse\n {...ctx.getStyles('panel', { className, classNames, style, styles })}\n expanded={ctx.isItemActive(value)}\n transitionDuration={ctx.transitionDuration ?? 200}\n role=\"region\"\n id={ctx.getRegionId(value)}\n aria-labelledby={ctx.getControlId(value)}\n keepMounted={keepMounted ?? ctx.keepMounted}\n {...others}\n >\n <div {...ctx.getStyles('content', { classNames, styles })}>{children}</div>\n </Collapse>\n );\n});\n\nAccordionPanel.displayName = '@mantine/core/AccordionPanel';\nAccordionPanel.classes = classes;\n"],"mappings":";;;;;;;;;AAkCA,MAAa,iBAAiBA,gBAAAA,SAAgC,UAAU;CACtE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,UAAU,aAAa,GAAG,WAAWC,kBAAAA,SACvF,kBACA,MACA,KACF;CAEA,MAAM,EAAE,UAAUC,8BAAAA,wBAAwB;CAC1C,MAAM,MAAMC,0BAAAA,oBAAoB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,UAAD;EACE,GAAI,IAAI,UAAU,SAAS;GAAE;GAAW;GAAY;GAAO;EAAO,CAAC;EACnE,UAAU,IAAI,aAAa,KAAK;EAChC,oBAAoB,IAAI,sBAAsB;EAC9C,MAAK;EACL,IAAI,IAAI,YAAY,KAAK;EACzB,mBAAiB,IAAI,aAAa,KAAK;EACvC,aAAa,eAAe,IAAI;EAChC,GAAI;YAEJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,GAAI,IAAI,UAAU,WAAW;IAAE;IAAY;GAAO,CAAC;GAAI;EAAc,CAAA;CAClE,CAAA;AAEd,CAAC;AAED,eAAe,cAAc;AAC7B,eAAe,UAAUC,yBAAAA"}
1
+ {"version":3,"file":"AccordionPanel.cjs","names":["factory","useProps","useAccordionItemContext","useAccordionContext","Collapse","classes"],"sources":["../../../../src/components/Accordion/AccordionPanel/AccordionPanel.tsx"],"sourcesContent":["import {\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { Collapse } from '../../Collapse';\nimport { useAccordionContext } from '../Accordion.context';\nimport { useAccordionItemContext } from '../AccordionItem.context';\nimport classes from '../Accordion.module.css';\n\nexport type AccordionPanelStylesNames = 'panel' | 'content';\n\nexport interface AccordionPanelProps\n extends BoxProps, CompoundStylesApiProps<AccordionPanelFactory>, ElementProps<'div'> {\n /** Called when the panel animation completes */\n onTransitionEnd?: () => void;\n\n /** Called when the panel animation starts */\n onTransitionStart?: () => void;\n\n /** If set, overrides the Accordion-level `keepMounted` value. When undefined (default), uses Accordion's `keepMounted` setting. */\n keepMounted?: boolean;\n\n /** If set, overrides the Accordion-level `keepMountedMode` value. When undefined (default), uses Accordion's `keepMountedMode` setting. */\n keepMountedMode?: 'activity' | 'display-none';\n}\n\nexport type AccordionPanelFactory = Factory<{\n props: AccordionPanelProps;\n ref: HTMLDivElement;\n stylesNames: AccordionPanelStylesNames;\n compound: true;\n}>;\n\nexport const AccordionPanel = factory<AccordionPanelFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n children,\n keepMounted,\n keepMountedMode,\n ...others\n } = useProps('AccordionPanel', null, props);\n\n const { value } = useAccordionItemContext();\n const ctx = useAccordionContext();\n\n return (\n <Collapse\n {...ctx.getStyles('panel', { className, classNames, style, styles })}\n expanded={ctx.isItemActive(value)}\n transitionDuration={ctx.transitionDuration ?? 200}\n role=\"region\"\n id={ctx.getRegionId(value)}\n aria-labelledby={ctx.getControlId(value)}\n keepMounted={keepMounted ?? ctx.keepMounted}\n keepMountedMode={keepMountedMode ?? ctx.keepMountedMode}\n {...others}\n >\n <div {...ctx.getStyles('content', { classNames, styles })}>{children}</div>\n </Collapse>\n );\n});\n\nAccordionPanel.displayName = '@mantine/core/AccordionPanel';\nAccordionPanel.classes = classes;\n"],"mappings":";;;;;;;;;AAqCA,MAAa,iBAAiBA,gBAAAA,SAAgC,UAAU;CACtE,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,UACA,aACA,iBACA,GAAG,WACDC,kBAAAA,SAAS,kBAAkB,MAAM,KAAK;CAE1C,MAAM,EAAE,UAAUC,8BAAAA,wBAAwB;CAC1C,MAAM,MAAMC,0BAAAA,oBAAoB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,UAAD;EACE,GAAI,IAAI,UAAU,SAAS;GAAE;GAAW;GAAY;GAAO;EAAO,CAAC;EACnE,UAAU,IAAI,aAAa,KAAK;EAChC,oBAAoB,IAAI,sBAAsB;EAC9C,MAAK;EACL,IAAI,IAAI,YAAY,KAAK;EACzB,mBAAiB,IAAI,aAAa,KAAK;EACvC,aAAa,eAAe,IAAI;EAChC,iBAAiB,mBAAmB,IAAI;EACxC,GAAI;YAEJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,GAAI,IAAI,UAAU,WAAW;IAAE;IAAY;GAAO,CAAC;GAAI;EAAc,CAAA;CAClE,CAAA;AAEd,CAAC;AAED,eAAe,cAAc;AAC7B,eAAe,UAAUC,yBAAAA"}
@@ -10,7 +10,7 @@ function assignAsideVariables({ baseStyles, minMediaStyles, maxMediaStyles, asid
10
10
  const asideWidth = aside?.width;
11
11
  const collapsedAsideTransform = "translateX(var(--app-shell-aside-width))";
12
12
  const collapsedAsideTransformRtl = "translateX(calc(var(--app-shell-aside-width) * -1))";
13
- if (aside?.breakpoint && !aside?.collapsed?.mobile) {
13
+ if (aside?.breakpoint !== void 0 && !aside?.collapsed?.mobile) {
14
14
  maxMediaStyles[aside?.breakpoint] = maxMediaStyles[aside?.breakpoint] || {};
15
15
  if (mode === "fixed") {
16
16
  maxMediaStyles[aside?.breakpoint]["--app-shell-aside-width"] = "100%";
@@ -38,7 +38,7 @@ function assignAsideVariables({ baseStyles, minMediaStyles, maxMediaStyles, asid
38
38
  }
39
39
  });
40
40
  }
41
- if (aside?.breakpoint && mode === "static") {
41
+ if (aside?.breakpoint !== void 0 && mode === "static") {
42
42
  minMediaStyles[aside.breakpoint] = minMediaStyles[aside.breakpoint] || {};
43
43
  minMediaStyles[aside.breakpoint]["--app-shell-aside-position"] = "sticky";
44
44
  minMediaStyles[aside.breakpoint]["--app-shell-aside-grid-row"] = "2";
@@ -1 +1 @@
1
- {"version":3,"file":"assign-aside-variables.cjs","names":["isPrimitiveSize","rem","getBaseSize","isResponsiveSize","getBreakpointValue"],"sources":["../../../../../src/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.ts"],"sourcesContent":["import { getBreakpointValue, keys, MantineTheme, rem } from '../../../../core';\nimport type { AppShellProps } from '../../AppShell';\nimport { getBaseSize } from '../get-base-size/get-base-size';\nimport type { CSSVariables, MediaQueryVariables } from '../get-variables/get-variables';\nimport { isPrimitiveSize } from '../is-primitive-size/is-primitive-size';\nimport { isResponsiveSize } from '../is-responsive-size/is-responsive-size';\n\ninterface AssignAsideVariablesInput {\n baseStyles: CSSVariables;\n minMediaStyles: MediaQueryVariables;\n maxMediaStyles: MediaQueryVariables;\n aside: AppShellProps['aside'] | undefined;\n theme: MantineTheme;\n mode: 'fixed' | 'static';\n}\n\nexport function assignAsideVariables({\n baseStyles,\n minMediaStyles,\n maxMediaStyles,\n aside,\n theme,\n mode,\n}: AssignAsideVariablesInput) {\n const asideWidth = aside?.width;\n const collapsedAsideTransform = 'translateX(var(--app-shell-aside-width))';\n const collapsedAsideTransformRtl = 'translateX(calc(var(--app-shell-aside-width) * -1))';\n\n if (aside?.breakpoint && !aside?.collapsed?.mobile) {\n maxMediaStyles[aside?.breakpoint] = maxMediaStyles[aside?.breakpoint] || {};\n if (mode === 'fixed') {\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-width'] = '100%';\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-offset'] = '0px';\n } else {\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-width'] = '0px';\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-offset'] = '0px';\n }\n }\n\n if (isPrimitiveSize(asideWidth)) {\n const baseSize = rem(getBaseSize(asideWidth));\n baseStyles['--app-shell-aside-width'] = baseSize;\n baseStyles['--app-shell-aside-offset'] = baseSize;\n }\n\n if (isResponsiveSize(asideWidth)) {\n if (typeof asideWidth.base !== 'undefined') {\n baseStyles['--app-shell-aside-width'] = rem(asideWidth.base);\n baseStyles['--app-shell-aside-offset'] = rem(asideWidth.base);\n }\n\n keys(asideWidth).forEach((key) => {\n if (key !== 'base') {\n minMediaStyles[key] = minMediaStyles[key] || {};\n minMediaStyles[key]['--app-shell-aside-width'] = rem(asideWidth![key]);\n minMediaStyles[key]['--app-shell-aside-offset'] = rem(asideWidth![key]);\n }\n });\n }\n\n if (aside?.breakpoint && mode === 'static') {\n minMediaStyles[aside.breakpoint] = minMediaStyles[aside.breakpoint] || {};\n minMediaStyles[aside.breakpoint]['--app-shell-aside-position'] = 'sticky';\n minMediaStyles[aside.breakpoint]['--app-shell-aside-grid-row'] = '2';\n minMediaStyles[aside.breakpoint]['--app-shell-aside-grid-column'] = '3';\n // Adjust main column end when aside is visible\n minMediaStyles[aside.breakpoint]['--app-shell-main-column-end'] = '3';\n }\n\n if (aside?.collapsed?.desktop) {\n const breakpointValue = aside!.breakpoint;\n minMediaStyles[breakpointValue] = minMediaStyles[breakpointValue] || {};\n minMediaStyles[breakpointValue]['--app-shell-aside-transform'] = collapsedAsideTransform;\n minMediaStyles[breakpointValue]['--app-shell-aside-transform-rtl'] = collapsedAsideTransformRtl;\n if (mode === 'fixed') {\n minMediaStyles[breakpointValue]['--app-shell-aside-offset'] = '0px !important';\n } else {\n minMediaStyles[breakpointValue]['--app-shell-aside-width'] = '0px';\n minMediaStyles[breakpointValue]['--app-shell-aside-display'] = 'none';\n minMediaStyles[breakpointValue]['--app-shell-main-column-end'] = '-1';\n }\n minMediaStyles[breakpointValue]['--app-shell-aside-scroll-locked-visibility'] = 'hidden';\n }\n\n if (aside?.collapsed?.mobile) {\n const breakpointValue = getBreakpointValue(aside!.breakpoint, theme.breakpoints) - 0.1;\n maxMediaStyles[breakpointValue] = maxMediaStyles[breakpointValue] || {};\n if (mode === 'fixed') {\n maxMediaStyles[breakpointValue]['--app-shell-aside-width'] = '100%';\n maxMediaStyles[breakpointValue]['--app-shell-aside-offset'] = '0px';\n } else {\n maxMediaStyles[breakpointValue]['--app-shell-aside-width'] = '0px';\n }\n maxMediaStyles[breakpointValue]['--app-shell-aside-transform'] = collapsedAsideTransform;\n maxMediaStyles[breakpointValue]['--app-shell-aside-transform-rtl'] = collapsedAsideTransformRtl;\n maxMediaStyles[breakpointValue]['--app-shell-aside-scroll-locked-visibility'] = 'hidden';\n }\n}\n"],"mappings":";;;;;;;;AAgBA,SAAgB,qBAAqB,EACnC,YACA,gBACA,gBACA,OACA,OACA,QAC4B;CAC5B,MAAM,aAAa,OAAO;CAC1B,MAAM,0BAA0B;CAChC,MAAM,6BAA6B;CAEnC,IAAI,OAAO,cAAc,CAAC,OAAO,WAAW,QAAQ;EAClD,eAAe,OAAO,cAAc,eAAe,OAAO,eAAe,CAAC;EAC1E,IAAI,SAAS,SAAS;GACpB,eAAe,OAAO,WAAW,CAAC,6BAA6B;GAC/D,eAAe,OAAO,WAAW,CAAC,8BAA8B;EAClE,OAAO;GACL,eAAe,OAAO,WAAW,CAAC,6BAA6B;GAC/D,eAAe,OAAO,WAAW,CAAC,8BAA8B;EAClE;CACF;CAEA,IAAIA,0BAAAA,gBAAgB,UAAU,GAAG;EAC/B,MAAM,WAAWC,YAAAA,IAAIC,sBAAAA,YAAY,UAAU,CAAC;EAC5C,WAAW,6BAA6B;EACxC,WAAW,8BAA8B;CAC3C;CAEA,IAAIC,2BAAAA,iBAAiB,UAAU,GAAG;EAChC,IAAI,OAAO,WAAW,SAAS,aAAa;GAC1C,WAAW,6BAA6BF,YAAAA,IAAI,WAAW,IAAI;GAC3D,WAAW,8BAA8BA,YAAAA,IAAI,WAAW,IAAI;EAC9D;EAEA,aAAA,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;GAChC,IAAI,QAAQ,QAAQ;IAClB,eAAe,OAAO,eAAe,QAAQ,CAAC;IAC9C,eAAe,IAAI,CAAC,6BAA6BA,YAAAA,IAAI,WAAY,IAAI;IACrE,eAAe,IAAI,CAAC,8BAA8BA,YAAAA,IAAI,WAAY,IAAI;GACxE;EACF,CAAC;CACH;CAEA,IAAI,OAAO,cAAc,SAAS,UAAU;EAC1C,eAAe,MAAM,cAAc,eAAe,MAAM,eAAe,CAAC;EACxE,eAAe,MAAM,WAAW,CAAC,gCAAgC;EACjE,eAAe,MAAM,WAAW,CAAC,gCAAgC;EACjE,eAAe,MAAM,WAAW,CAAC,mCAAmC;EAEpE,eAAe,MAAM,WAAW,CAAC,iCAAiC;CACpE;CAEA,IAAI,OAAO,WAAW,SAAS;EAC7B,MAAM,kBAAkB,MAAO;EAC/B,eAAe,mBAAmB,eAAe,oBAAoB,CAAC;EACtE,eAAe,gBAAgB,CAAC,iCAAiC;EACjE,eAAe,gBAAgB,CAAC,qCAAqC;EACrE,IAAI,SAAS,SACX,eAAe,gBAAgB,CAAC,8BAA8B;OACzD;GACL,eAAe,gBAAgB,CAAC,6BAA6B;GAC7D,eAAe,gBAAgB,CAAC,+BAA+B;GAC/D,eAAe,gBAAgB,CAAC,iCAAiC;EACnE;EACA,eAAe,gBAAgB,CAAC,gDAAgD;CAClF;CAEA,IAAI,OAAO,WAAW,QAAQ;EAC5B,MAAM,kBAAkBG,6BAAAA,mBAAmB,MAAO,YAAY,MAAM,WAAW,IAAI;EACnF,eAAe,mBAAmB,eAAe,oBAAoB,CAAC;EACtE,IAAI,SAAS,SAAS;GACpB,eAAe,gBAAgB,CAAC,6BAA6B;GAC7D,eAAe,gBAAgB,CAAC,8BAA8B;EAChE,OACE,eAAe,gBAAgB,CAAC,6BAA6B;EAE/D,eAAe,gBAAgB,CAAC,iCAAiC;EACjE,eAAe,gBAAgB,CAAC,qCAAqC;EACrE,eAAe,gBAAgB,CAAC,gDAAgD;CAClF;AACF"}
1
+ {"version":3,"file":"assign-aside-variables.cjs","names":["isPrimitiveSize","rem","getBaseSize","isResponsiveSize","getBreakpointValue"],"sources":["../../../../../src/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.ts"],"sourcesContent":["import { getBreakpointValue, keys, MantineTheme, rem } from '../../../../core';\nimport type { AppShellProps } from '../../AppShell';\nimport { getBaseSize } from '../get-base-size/get-base-size';\nimport type { CSSVariables, MediaQueryVariables } from '../get-variables/get-variables';\nimport { isPrimitiveSize } from '../is-primitive-size/is-primitive-size';\nimport { isResponsiveSize } from '../is-responsive-size/is-responsive-size';\n\ninterface AssignAsideVariablesInput {\n baseStyles: CSSVariables;\n minMediaStyles: MediaQueryVariables;\n maxMediaStyles: MediaQueryVariables;\n aside: AppShellProps['aside'] | undefined;\n theme: MantineTheme;\n mode: 'fixed' | 'static';\n}\n\nexport function assignAsideVariables({\n baseStyles,\n minMediaStyles,\n maxMediaStyles,\n aside,\n theme,\n mode,\n}: AssignAsideVariablesInput) {\n const asideWidth = aside?.width;\n const collapsedAsideTransform = 'translateX(var(--app-shell-aside-width))';\n const collapsedAsideTransformRtl = 'translateX(calc(var(--app-shell-aside-width) * -1))';\n\n if (aside?.breakpoint !== undefined && !aside?.collapsed?.mobile) {\n maxMediaStyles[aside?.breakpoint] = maxMediaStyles[aside?.breakpoint] || {};\n if (mode === 'fixed') {\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-width'] = '100%';\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-offset'] = '0px';\n } else {\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-width'] = '0px';\n maxMediaStyles[aside?.breakpoint]['--app-shell-aside-offset'] = '0px';\n }\n }\n\n if (isPrimitiveSize(asideWidth)) {\n const baseSize = rem(getBaseSize(asideWidth));\n baseStyles['--app-shell-aside-width'] = baseSize;\n baseStyles['--app-shell-aside-offset'] = baseSize;\n }\n\n if (isResponsiveSize(asideWidth)) {\n if (typeof asideWidth.base !== 'undefined') {\n baseStyles['--app-shell-aside-width'] = rem(asideWidth.base);\n baseStyles['--app-shell-aside-offset'] = rem(asideWidth.base);\n }\n\n keys(asideWidth).forEach((key) => {\n if (key !== 'base') {\n minMediaStyles[key] = minMediaStyles[key] || {};\n minMediaStyles[key]['--app-shell-aside-width'] = rem(asideWidth![key]);\n minMediaStyles[key]['--app-shell-aside-offset'] = rem(asideWidth![key]);\n }\n });\n }\n\n if (aside?.breakpoint !== undefined && mode === 'static') {\n minMediaStyles[aside.breakpoint] = minMediaStyles[aside.breakpoint] || {};\n minMediaStyles[aside.breakpoint]['--app-shell-aside-position'] = 'sticky';\n minMediaStyles[aside.breakpoint]['--app-shell-aside-grid-row'] = '2';\n minMediaStyles[aside.breakpoint]['--app-shell-aside-grid-column'] = '3';\n // Adjust main column end when aside is visible\n minMediaStyles[aside.breakpoint]['--app-shell-main-column-end'] = '3';\n }\n\n if (aside?.collapsed?.desktop) {\n const breakpointValue = aside!.breakpoint;\n minMediaStyles[breakpointValue] = minMediaStyles[breakpointValue] || {};\n minMediaStyles[breakpointValue]['--app-shell-aside-transform'] = collapsedAsideTransform;\n minMediaStyles[breakpointValue]['--app-shell-aside-transform-rtl'] = collapsedAsideTransformRtl;\n if (mode === 'fixed') {\n minMediaStyles[breakpointValue]['--app-shell-aside-offset'] = '0px !important';\n } else {\n minMediaStyles[breakpointValue]['--app-shell-aside-width'] = '0px';\n minMediaStyles[breakpointValue]['--app-shell-aside-display'] = 'none';\n minMediaStyles[breakpointValue]['--app-shell-main-column-end'] = '-1';\n }\n minMediaStyles[breakpointValue]['--app-shell-aside-scroll-locked-visibility'] = 'hidden';\n }\n\n if (aside?.collapsed?.mobile) {\n const breakpointValue = getBreakpointValue(aside!.breakpoint, theme.breakpoints) - 0.1;\n maxMediaStyles[breakpointValue] = maxMediaStyles[breakpointValue] || {};\n if (mode === 'fixed') {\n maxMediaStyles[breakpointValue]['--app-shell-aside-width'] = '100%';\n maxMediaStyles[breakpointValue]['--app-shell-aside-offset'] = '0px';\n } else {\n maxMediaStyles[breakpointValue]['--app-shell-aside-width'] = '0px';\n }\n maxMediaStyles[breakpointValue]['--app-shell-aside-transform'] = collapsedAsideTransform;\n maxMediaStyles[breakpointValue]['--app-shell-aside-trans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,CAAC;EACxE,eAAe,MAAM,WAAW,CAAC,gCAAgC;EACjE,eAAe,MAAM,WAAW,CAAC,gCAAgC;EACjE,eAAe,MAAM,WAAW,CAAC,mCAAmC;EAEpE,eAAe,MAAM,WAAW,CAAC,iCAAiC;CACpE;CAEA,IAAI,OAAO,WAAW,SAAS;EAC7B,MAAM,kBAAkB,MAAO;EAC/B,eAAe,mBAAmB,eAAe,oBAAoB,CAAC;EACtE,eAAe,gBAAgB,CAAC,iCAAiC;EACjE,eAAe,gBAAgB,CAAC,qCAAqC;EACrE,IAAI,SAAS,SACX,eAAe,gBAAgB,CAAC,8BAA8B;OACzD;GACL,eAAe,gBAAgB,CAAC,6BAA6B;GAC7D,eAAe,gBAAgB,CAAC,+BAA+B;GAC/D,eAAe,gBAAgB,CAAC,iCAAiC;EACnE;EACA,eAAe,gBAAgB,CAAC,gDAAgD;CAClF;CAEA,IAAI,OAAO,WAAW,QAAQ;EAC5B,MAAM,kBAAkBG,6BAAAA,mBAAmB,MAAO,YAAY,MAAM,WAAW,IAAI;EACnF,eAAe,mBAAmB,eAAe,oBAAoB,CAAC;EACtE,IAAI,SAAS,SAAS;GACpB,eAAe,gBAAgB,CAAC,6BAA6B;GAC7D,eAAe,gBAAgB,CAAC,8BAA8B;EAChE,OACE,eAAe,gBAAgB,CAAC,6BAA6B;EAE/D,eAAe,gBAAgB,CAAC,iCAAiC;EACjE,eAAe,gBAAgB,CAAC,qCAAqC;EACrE,eAAe,gBAAgB,CAAC,gDAAgD;CAClF;AACF"}
@@ -10,7 +10,7 @@ function assignNavbarVariables({ baseStyles, minMediaStyles, maxMediaStyles, nav
10
10
  const navbarWidth = navbar?.width;
11
11
  const collapsedNavbarTransform = "translateX(calc(var(--app-shell-navbar-width) * -1))";
12
12
  const collapsedNavbarTransformRtl = "translateX(var(--app-shell-navbar-width))";
13
- if (navbar?.breakpoint && !navbar?.collapsed?.mobile) {
13
+ if (navbar?.breakpoint !== void 0 && !navbar?.collapsed?.mobile) {
14
14
  maxMediaStyles[navbar?.breakpoint] = maxMediaStyles[navbar?.breakpoint] || {};
15
15
  maxMediaStyles[navbar?.breakpoint]["--app-shell-navbar-offset"] = "0px";
16
16
  maxMediaStyles[navbar?.breakpoint]["--app-shell-navbar-width"] = "100%";
@@ -37,7 +37,7 @@ function assignNavbarVariables({ baseStyles, minMediaStyles, maxMediaStyles, nav
37
37
  }
38
38
  });
39
39
  }
40
- if (navbar?.breakpoint && mode === "static") {
40
+ if (navbar?.breakpoint !== void 0 && mode === "static") {
41
41
  minMediaStyles[navbar.breakpoint] = minMediaStyles[navbar.breakpoint] || {};
42
42
  minMediaStyles[navbar.breakpoint]["--app-shell-navbar-position"] = "sticky";
43
43
  minMediaStyles[navbar.breakpoint]["--app-shell-navbar-grid-row"] = "2";
@@ -1 +1 @@
1
- {"version":3,"file":"assign-navbar-variables.cjs","names":["isPrimitiveSize","rem","getBaseSize","isResponsiveSize","getBreakpointValue"],"sources":["../../../../../src/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.ts"],"sourcesContent":["import { getBreakpointValue, keys, MantineTheme, rem } from '../../../../core';\nimport type { AppShellProps } from '../../AppShell';\nimport { getBaseSize } from '../get-base-size/get-base-size';\nimport type { CSSVariables, MediaQueryVariables } from '../get-variables/get-variables';\nimport { isPrimitiveSize } from '../is-primitive-size/is-primitive-size';\nimport { isResponsiveSize } from '../is-responsive-size/is-responsive-size';\n\ninterface AssignNavbarVariablesInput {\n baseStyles: CSSVariables;\n minMediaStyles: MediaQueryVariables;\n maxMediaStyles: MediaQueryVariables;\n navbar: AppShellProps['navbar'] | undefined;\n theme: MantineTheme;\n mode: 'fixed' | 'static';\n}\n\nexport function assignNavbarVariables({\n baseStyles,\n minMediaStyles,\n maxMediaStyles,\n navbar,\n theme,\n mode,\n}: AssignNavbarVariablesInput) {\n const navbarWidth = navbar?.width;\n const collapsedNavbarTransform = 'translateX(calc(var(--app-shell-navbar-width) * -1))';\n const collapsedNavbarTransformRtl = 'translateX(var(--app-shell-navbar-width))';\n\n if (navbar?.breakpoint && !navbar?.collapsed?.mobile) {\n maxMediaStyles[navbar?.breakpoint] = maxMediaStyles[navbar?.breakpoint] || {};\n maxMediaStyles[navbar?.breakpoint]['--app-shell-navbar-offset'] = '0px';\n maxMediaStyles[navbar?.breakpoint]['--app-shell-navbar-width'] = '100%';\n if (mode === 'static') {\n maxMediaStyles[navbar?.breakpoint]['--app-shell-navbar-grid-width'] = '0px';\n }\n }\n\n if (isPrimitiveSize(navbarWidth)) {\n const baseSize = rem(getBaseSize(navbarWidth));\n baseStyles['--app-shell-navbar-width'] = baseSize;\n baseStyles['--app-shell-navbar-offset'] = baseSize;\n if (mode === 'static') {\n baseStyles['--app-shell-navbar-grid-width'] = baseSize;\n }\n }\n\n if (isResponsiveSize(navbarWidth)) {\n if (typeof navbarWidth.base !== 'undefined') {\n baseStyles['--app-shell-navbar-width'] = rem(navbarWidth.base);\n baseStyles['--app-shell-navbar-offset'] = rem(navbarWidth.base);\n if (mode === 'static') {\n baseStyles['--app-shell-navbar-grid-width'] = rem(navbarWidth.base);\n }\n }\n\n keys(navbarWidth).forEach((key) => {\n if (key !== 'base') {\n minMediaStyles[key] = minMediaStyles[key] || {};\n minMediaStyles[key]['--app-shell-navbar-width'] = rem(navbarWidth![key]);\n minMediaStyles[key]['--app-shell-navbar-offset'] = rem(navbarWidth![key]);\n if (mode === 'static') {\n minMediaStyles[key]['--app-shell-navbar-grid-width'] = rem(navbarWidth![key]);\n }\n }\n });\n }\n\n if (navbar?.breakpoint && mode === 'static') {\n minMediaStyles[navbar.breakpoint] = minMediaStyles[navbar.breakpoint] || {};\n minMediaStyles[navbar.breakpoint]['--app-shell-navbar-position'] = 'sticky';\n minMediaStyles[navbar.breakpoint]['--app-shell-navbar-grid-row'] = '2';\n minMediaStyles[navbar.breakpoint]['--app-shell-navbar-grid-column'] = '1';\n minMediaStyles[navbar.breakpoint]['--app-shell-main-column-start'] = '2';\n }\n\n if (navbar?.collapsed?.desktop) {\n const breakpointValue = navbar!.breakpoint;\n minMediaStyles[breakpointValue] = minMediaStyles[breakpointValue] || {};\n minMediaStyles[breakpointValue]['--app-shell-navbar-transform'] = collapsedNavbarTransform;\n minMediaStyles[breakpointValue]['--app-shell-navbar-transform-rtl'] =\n collapsedNavbarTransformRtl;\n if (mode === 'fixed') {\n minMediaStyles[breakpointValue]['--app-shell-navbar-offset'] = '0px !important';\n } else {\n // In static mode, hide the element completely so grid column collapses\n minMediaStyles[breakpointValue]['--app-shell-navbar-width'] = '0px';\n minMediaStyles[breakpointValue]['--app-shell-navbar-display'] = 'none';\n minMediaStyles[breakpointValue]['--app-shell-main-column-start'] = '1';\n }\n }\n\n if (navbar?.collapsed?.mobile) {\n const breakpointValue = getBreakpointValue(navbar!.breakpoint, theme.breakpoints) - 0.1;\n maxMediaStyles[breakpointValue] = maxMediaStyles[breakpointValue] || {};\n maxMediaStyles[breakpointValue]['--app-shell-navbar-width'] = '100%';\n maxMediaStyles[breakpointValue]['--app-shell-navbar-offset'] = '0px';\n if (mode === 'static') {\n maxMediaStyles[breakpointValue]['--app-shell-navbar-grid-width'] = '0px';\n }\n maxMediaStyles[breakpointValue]['--app-shell-navbar-transform'] = collapsedNavbarTransform;\n maxMediaStyles[breakpointValue]['--app-shell-navbar-transform-rtl'] =\n collapsedNavbarTransformRtl;\n }\n}\n"],"mappings":";;;;;;;;AAgBA,SAAgB,sBAAsB,EACpC,YACA,gBACA,gBACA,QACA,OACA,QAC6B;CAC7B,MAAM,cAAc,QAAQ;CAC5B,MAAM,2BAA2B;CACjC,MAAM,8BAA8B;CAEpC,IAAI,QAAQ,cAAc,CAAC,QAAQ,WAAW,QAAQ;EACpD,eAAe,QAAQ,cAAc,eAAe,QAAQ,eAAe,CAAC;EAC5E,eAAe,QAAQ,WAAW,CAAC,+BAA+B;EAClE,eAAe,QAAQ,WAAW,CAAC,8BAA8B;EACjE,IAAI,SAAS,UACX,eAAe,QAAQ,WAAW,CAAC,mCAAmC;CA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+BAA+B;OAC1D;GAEL,eAAe,gBAAgB,CAAC,8BAA8B;GAC9D,eAAe,gBAAgB,CAAC,gCAAgC;GAChE,eAAe,gBAAgB,CAAC,mCAAmC;EACrE;CACF;CAEA,IAAI,QAAQ,WAAW,QAAQ;EAC7B,MAAM,kBAAkBG,6BAAAA,mBAAmB,OAAQ,YAAY,MAAM,WAAW,IAAI;EACpF,eAAe,mBAAmB,eAAe,oBAAoB,CAAC;EACtE,eAAe,gBAAgB,CAAC,8BAA8B;EAC9D,eAAe,gBAAgB,CAAC,+BAA+B;EAC/D,IAAI,SAAS,UACX,eAAe,gBAAgB,CAAC,mCAAmC;EAErE,eAAe,gBAAgB,CAAC,kCAAkC;EAClE,eAAe,gBAAgB,CAAC,sCAC9B;CACJ;AACF"}
1
+ {"version":3,"file":"assign-navbar-variables.cjs","names":["isPrimitiveSize","rem","getBaseSize","isResponsiveSize","getBreakpointValue"],"sources":["../../../../../src/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.ts"],"sourcesContent":["import { getBreakpointValue, keys, MantineTheme, rem } from '../../../../core';\nimport type { AppShellProps } from '../../AppShell';\nimport { getBaseSize } from '../get-base-size/get-base-size';\nimport type { CSSVariables, MediaQueryVariables } from '../get-variables/get-variables';\nimport { isPrimitiveSize } from '../is-primitive-size/is-primitive-size';\nimport { isResponsiveSize } from '../is-responsive-size/is-responsive-size';\n\ninterface AssignNavbarVariablesInput {\n baseStyles: CSSVariables;\n minMediaStyles: MediaQueryVariables;\n maxMediaStyles: MediaQueryVariables;\n navbar: AppShellProps['navbar'] | undefined;\n theme: MantineTheme;\n mode: 'fixed' | 'static';\n}\n\nexport function assignNavbarVariables({\n baseStyles,\n minMediaStyles,\n maxMediaStyles,\n navbar,\n theme,\n mode,\n}: AssignNavbarVariablesInput) {\n const navbarWidth = navbar?.width;\n const collapsedNavbarTransform = 'translateX(calc(var(--app-shell-navbar-width) * -1))';\n const collapsedNavbarTransformRtl = 'translateX(var(--app-shell-navbar-width))';\n\n if (navbar?.breakpoint !== undefined && !navbar?.collapsed?.mobile) {\n maxMediaStyles[navbar?.breakpoint] = maxMediaStyles[navbar?.breakpoint] || {};\n maxMediaStyles[navbar?.breakpoint]['--app-shell-navbar-offset'] = '0px';\n maxMediaStyles[navbar?.breakpoint]['--app-shell-navbar-width'] = '100%';\n if (mode === 'static') {\n maxMediaStyles[navbar?.breakpoint]['--app-shell-navbar-grid-width'] = '0px';\n }\n }\n\n if (isPrimitiveSize(navbarWidth)) {\n const baseSize = rem(getBaseSize(navbarWidth));\n baseStyles['--app-shell-navbar-width'] = baseSize;\n baseStyles['--app-shell-navbar-offset'] = baseSize;\n if (mode === 'static') {\n baseStyles['--app-shell-navbar-grid-width'] = baseSize;\n }\n }\n\n if (isResponsiveSize(navbarWidth)) {\n if (typeof navbarWidth.base !== 'undefined') {\n baseStyles['--app-shell-navbar-width'] = rem(navbarWidth.base);\n baseStyles['--app-shell-navbar-offset'] = rem(navbarWidth.base);\n if (mode === 'static') {\n baseStyles['--app-shell-navbar-grid-width'] = rem(navbarWidth.base);\n }\n }\n\n keys(navbarWidth).forEach((key) => {\n if (key !== 'base') {\n minMediaStyles[key] = minMediaStyles[key] || {};\n minMediaStyles[key]['--app-shell-navbar-width'] = rem(navbarWidth![key]);\n minMediaStyles[key]['--app-shell-navbar-offset'] = rem(navbarWidth![key]);\n if (mode === 'static') {\n minMediaStyles[key]['--app-shell-navbar-grid-width'] = rem(navbarWidth![key]);\n }\n }\n });\n }\n\n if (navbar?.breakpoint !== undefined && mode === 'static') {\n minMediaStyles[navbar.breakpoint] = minMediaStyles[navbar.breakpoint] || {};\n minMediaStyles[navbar.breakpoint]['--app-shell-navbar-position'] = 'sticky';\n minMediaStyles[navbar.breakpoint]['--app-shell-navbar-grid-row'] = '2';\n minMediaStyles[navbar.breakpoint]['--app-shell-navbar-grid-column'] = '1';\n minMediaStyles[navbar.breakpoint]['--app-shell-main-column-start'] = '2';\n }\n\n if (navbar?.collapsed?.desktop) {\n const breakpointValue = navbar!.breakpoint;\n minMediaStyles[breakpointValue] = minMediaStyles[breakpointValue] || {};\n minMediaStyles[breakpointValue]['--app-shell-navbar-transform'] = collapsedNavbarTransform;\n minMediaStyles[breakpointValue]['--app-shell-navbar-transform-rtl'] =\n collapsedNavbarTransformRtl;\n if (mode === 'fixed') {\n minMediaStyles[breakpointValue]['--app-shell-navbar-offset'] = '0px !important';\n } else {\n // In static mode, hide the element completely so grid column collapses\n minMediaStyles[breakpointValue]['--app-shell-navbar-width'] = '0px';\n minMediaStyles[breakpointValue]['--app-shell-navbar-display'] = 'none';\n minMediaStyles[breakpointValue]['--app-shell-main-column-start'] = '1';\n }\n }\n\n if (navbar?.collapsed?.mobile) {\n const breakpointValue = getBreakpointValue(navbar!.breakpoint, theme.breakpoints) - 0.1;\n maxMediaStyles[breakpointValue] = maxMediaStyles[breakpointValue] || {};\n maxMediaStyles[breakpointValue]['--app-shell-navbar-width'] = '100%';\n maxMediaStyles[breakpointValue]['--app-shell-navbar-offset'] = '0px';\n if (mode === 'static') {\n maxMediaStyles[breakpointValue]['--app-shell-navbar-grid-width'] = '0px';\n }\n maxMediaStyles[breakpointValue]['--app-shell-navbar-transform'] = collapsedNavbarTransform;\n maxMediaStyles[breakpointValue]['--app-shell-navbar-transform-rtl'] =\n collapsedNavbarTransformRtl;\n }\n}\n"],"mappings":";;;;;;;;AAgBA,SAAgB,sBAAsB,EACpC,YACA,gBACA,gBACA,QACA,OACA,QAC6B;CAC7B,MAAM,cAAc,QAAQ;CAC5B,MAAM,2BAA2B;CACjC,MAAM,8BAA8B;CAEpC,IAAI,QAAQ,eAAe,KAAA,KAAa,CAAC,QAAQ,WAAW,QAAQ;EAClE,eAAe,QAAQ,cAAc,eAAe,QAAQ,eAAe,CAAC;EAC5E,eAAe,QAAQ,WAAW,CAAC,+BAA+B;EAClE,eAAe,QAAQ,WAAW,CAAC,8BAA8B;EACjE,IAAI,SAAS,UACX,eAAe,QAAQ,WAAW,CAAC,mC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AAe,gBAAgB,CAAC,+BAA+B;OAC1D;GAEL,eAAe,gBAAgB,CAAC,8BAA8B;GAC9D,eAAe,gBAAgB,CAAC,gCAAgC;GAChE,eAAe,gBAAgB,CAAC,mCAAmC;EACrE;CACF;CAEA,IAAI,QAAQ,WAAW,QAAQ;EAC7B,MAAM,kBAAkBG,6BAAAA,mBAAmB,OAAQ,YAAY,MAAM,WAAW,IAAI;EACpF,eAAe,mBAAmB,eAAe,oBAAoB,CAAC;EACtE,eAAe,gBAAgB,CAAC,8BAA8B;EAC9D,eAAe,gBAAgB,CAAC,+BAA+B;EAC/D,IAAI,SAAS,UACX,eAAe,gBAAgB,CAAC,mCAAmC;EAErE,eAAe,gBAAgB,CAAC,kCAAkC;EAClE,eAAe,gBAAgB,CAAC,sCAC9B;CACJ;AACF"}
@@ -14,10 +14,11 @@ const defaultProps = {
14
14
  transitionTimingFunction: "ease",
15
15
  animateOpacity: true,
16
16
  orientation: "vertical",
17
- keepMounted: true
17
+ keepMounted: true,
18
+ keepMountedMode: "activity"
18
19
  };
19
20
  const Collapse = require_factory.factory((props) => {
20
- const { children, expanded, transitionDuration, transitionTimingFunction, style, onTransitionEnd, onTransitionStart, animateOpacity, keepMounted, ref, orientation, ...others } = require_use_props.useProps("Collapse", defaultProps, props);
21
+ const { children, expanded, transitionDuration, transitionTimingFunction, style, onTransitionEnd, onTransitionStart, animateOpacity, keepMounted, keepMountedMode, ref, orientation, ...others } = require_use_props.useProps("Collapse", defaultProps, props);
21
22
  const env = require_Mantine_context.useMantineEnv();
22
23
  const theme = require_MantineThemeProvider.useMantineTheme();
23
24
  const shouldReduceMotion = (0, _mantine_hooks.useReducedMotion)();
@@ -31,22 +32,37 @@ const Collapse = require_factory.factory((props) => {
31
32
  keepMounted: false
32
33
  });
33
34
  if (duration === 0) {
34
- if (keepMounted === true && env !== "test") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Activity, {
35
- mode: expanded ? "visible" : "hidden",
36
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
35
+ if (keepMounted === true && (keepMountedMode === "display-none" || env !== "test")) {
36
+ if (keepMountedMode === "display-none") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
37
37
  ...others,
38
+ style: {
39
+ ...require_get_style_object.getStyleObject(style, theme),
40
+ ...!expanded ? { display: "none" } : {}
41
+ },
42
+ ref,
38
43
  children
39
- })
40
- });
44
+ });
45
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Activity, {
46
+ mode: expanded ? "visible" : "hidden",
47
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
48
+ ...others,
49
+ style,
50
+ ref,
51
+ children
52
+ })
53
+ });
54
+ }
41
55
  return expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
42
56
  ...others,
57
+ style,
58
+ ref,
43
59
  children
44
60
  }) : null;
45
61
  }
46
62
  const isExited = collapse.state === "exited";
47
63
  let content;
48
64
  if (keepMounted === false) content = isExited ? null : children;
49
- else if (keepMounted === true) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Activity, {
65
+ else if (keepMounted === true) content = keepMountedMode === "display-none" ? children : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Activity, {
50
66
  mode: isExited ? "hidden" : "visible",
51
67
  children
52
68
  });
@@ -57,7 +73,8 @@ const Collapse = require_factory.factory((props) => {
57
73
  style: {
58
74
  opacity: expanded || !animateOpacity ? 1 : 0,
59
75
  transition: animateOpacity ? `opacity ${duration}ms ${transitionTimingFunction}` : "none",
60
- ...require_get_style_object.getStyleObject(style, theme)
76
+ ...require_get_style_object.getStyleObject(style, theme),
77
+ ...keepMounted && keepMountedMode === "display-none" && isExited ? { display: "none" } : {}
61
78
  },
62
79
  ref
63
80
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"Collapse.cjs","names":["factory","useProps","useMantineEnv","useMantineTheme","useHorizontalCollapse","useCollapse","Activity","Box","getStyleObject"],"sources":["../../../src/components/Collapse/Collapse.tsx"],"sourcesContent":["import { Activity } from 'react';\nimport { useCollapse, useHorizontalCollapse, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n Factory,\n factory,\n getStyleObject,\n useMantineEnv,\n useMantineTheme,\n useProps,\n} from '../../core';\n\nexport interface CollapseProps extends BoxProps, Omit<React.ComponentProps<'div'>, keyof BoxProps> {\n /** Collapse orientation @default 'vertical' */\n orientation?: 'vertical' | 'horizontal';\n\n /** Expanded state */\n expanded: boolean;\n\n /** Called when the transition ends */\n onTransitionEnd?: () => void;\n\n /** Called when transition starts */\n onTransitionStart?: () => void;\n\n /** Transition duration in ms @default 200 */\n transitionDuration?: number;\n\n /** Transition timing function @default ease */\n transitionTimingFunction?: string;\n\n /** Determines whether the opacity is animated @default true */\n animateOpacity?: boolean;\n\n /** If set, the element is kept in the DOM when collapsed. When `true`, React 19 `Activity` is used to preserve state while collapsed. When `false`, the element is unmounted after the exit animation. @default true */\n keepMounted?: boolean;\n}\n\nexport type CollapseFactory = Factory<{\n props: CollapseProps;\n ref: HTMLDivElement;\n}>;\n\nconst defaultProps = {\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n animateOpacity: true,\n orientation: 'vertical',\n keepMounted: true,\n} satisfies Partial<CollapseProps>;\n\nexport const Collapse = factory<CollapseFactory>((props) => {\n const {\n children,\n expanded,\n transitionDuration,\n transitionTimingFunction,\n style,\n onTransitionEnd,\n onTransitionStart,\n animateOpacity,\n keepMounted,\n ref,\n orientation,\n ...others\n } = useProps('Collapse', defaultProps, props);\n\n const env = useMantineEnv();\n const theme = useMantineTheme();\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 0 : transitionDuration;\n const hook = orientation === 'horizontal' ? useHorizontalCollapse : useCollapse;\n\n const collapse = hook({\n expanded,\n transitionDuration: duration,\n transitionTimingFunction,\n onTransitionEnd,\n onTransitionStart,\n keepMounted: false,\n });\n\n if (duration === 0) {\n if (keepMounted === true && env !== 'test') {\n return (\n <Activity mode={expanded ? 'visible' : 'hidden'}>\n <Box {...others}>{children}</Box>\n </Activity>\n );\n }\n return expanded ? <Box {...others}>{children}</Box> : null;\n }\n\n const isExited = collapse.state === 'exited';\n\n let content: React.ReactNode;\n if (keepMounted === false) {\n content = isExited ? null : children;\n } else if (keepMounted === true) {\n content = <Activity mode={isExited ? 'hidden' : 'visible'}>{children}</Activity>;\n } else {\n content = children;\n }\n\n return (\n <Box\n {...others}\n {...collapse.getCollapseProps({\n style: {\n opacity: expanded || !animateOpacity ? 1 : 0,\n transition: animateOpacity ? `opacity ${duration}ms ${transitionTimingFunction}` : 'none',\n ...getStyleObject(style, theme),\n },\n ref,\n })}\n >\n {content}\n </Box>\n );\n});\n\nCollapse.displayName = '@mantine/core/Collapse';\n\nexport namespace Collapse {\n export type Props = CollapseProps;\n export type Factory = CollapseFactory;\n}\n"],"mappings":";;;;;;;;;;;AA4CA,MAAM,eAAe;CACnB,oBAAoB;CACpB,0BAA0B;CAC1B,gBAAgB;CAChB,aAAa;CACb,aAAa;AACf;AAEA,MAAa,WAAWA,gBAAAA,SAA0B,UAAU;CAC1D,MAAM,EACJ,UACA,UACA,oBACA,0BACA,OACA,iBACA,mBACA,gBACA,aACA,KACA,aACA,GAAG,WACDC,kBAAAA,SAAS,YAAY,cAAc,KAAK;CAE5C,MAAM,MAAMC,wBAAAA,cAAc;CAC1B,MAAM,QAAQC,6BAAAA,gBAAgB;CAC9B,MAAM,sBAAA,GAAA,eAAA,iBAAA,CAAsC;CAE5C,MAAM,YADe,MAAM,uBAAuB,qBAAqB,SACvC,IAAI;CAGpC,MAAM,YAFO,gBAAgB,eAAeC,eAAAA,wBAAwBC,eAAAA,YAAAA,CAE9C;EACpB;EACA,oBAAoB;EACpB;EACA;EACA;EACA,aAAa;CACf,CAAC;CAED,IAAI,aAAa,GAAG;EAClB,IAAI,gBAAgB,QAAQ,QAAQ,QAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,MAAAA,UAAD;GAAU,MAAM,WAAW,YAAY;aACrC,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;IAAK,GAAI;IAAS;GAAc,CAAA;EACxB,CAAA;EAGd,OAAO,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAACA,YAAAA,KAAD;GAAK,GAAI;GAAS;EAAc,CAAA,IAAI;CACxD;CAEA,MAAM,WAAW,SAAS,UAAU;CAEpC,IAAI;CACJ,IAAI,gBAAgB,OAClB,UAAU,WAAW,OAAO;MACvB,IAAI,gBAAgB,MACzB,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACD,MAAAA,UAAD;EAAU,MAAM,WAAW,WAAW;EAAY;CAAmB,CAAA;MAE/E,UAAU;CAGZ,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;EACE,GAAI;EACJ,GAAI,SAAS,iBAAiB;GAC5B,OAAO;IACL,SAAS,YAAY,CAAC,iBAAiB,IAAI;IAC3C,YAAY,iBAAiB,WAAW,SAAS,KAAK,6BAA6B;IACnF,GAAGC,yBAAAA,eAAe,OAAO,KAAK;GAChC;GACA;EACF,CAAC;YAEA;CACE,CAAA;AAET,CAAC;AAED,SAAS,cAAc"}
1
+ {"version":3,"file":"Collapse.cjs","names":["factory","useProps","useMantineEnv","useMantineTheme","useHorizontalCollapse","useCollapse","Box","getStyleObject","Activity"],"sources":["../../../src/components/Collapse/Collapse.tsx"],"sourcesContent":["import { Activity } from 'react';\nimport { useCollapse, useHorizontalCollapse, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n Factory,\n factory,\n getStyleObject,\n useMantineEnv,\n useMantineTheme,\n useProps,\n} from '../../core';\n\nexport interface CollapseProps extends BoxProps, Omit<React.ComponentProps<'div'>, keyof BoxProps> {\n /** Collapse orientation @default 'vertical' */\n orientation?: 'vertical' | 'horizontal';\n\n /** Expanded state */\n expanded: boolean;\n\n /** Called when the transition ends */\n onTransitionEnd?: () => void;\n\n /** Called when transition starts */\n onTransitionStart?: () => void;\n\n /** Transition duration in ms @default 200 */\n transitionDuration?: number;\n\n /** Transition timing function @default ease */\n transitionTimingFunction?: string;\n\n /** Determines whether the opacity is animated @default true */\n animateOpacity?: boolean;\n\n /** If set, the element is kept in the DOM when collapsed. When `true`, React 19 `Activity` is used to preserve state while collapsed. When `false`, the element is unmounted after the exit animation. @default true */\n keepMounted?: boolean;\n\n /** Controls how the element is hidden when `keepMounted` is set:\n * `'activity'` – hidden with React 19 `Activity` component,\n * `'display-none'` – hidden with `display: none` styles\n * @default 'activity'\n */\n keepMountedMode?: 'activity' | 'display-none';\n}\n\nexport type CollapseFactory = Factory<{\n props: CollapseProps;\n ref: HTMLDivElement;\n}>;\n\nconst defaultProps = {\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n animateOpacity: true,\n orientation: 'vertical',\n keepMounted: true,\n keepMountedMode: 'activity',\n} satisfies Partial<CollapseProps>;\n\nexport const Collapse = factory<CollapseFactory>((props) => {\n const {\n children,\n expanded,\n transitionDuration,\n transitionTimingFunction,\n style,\n onTransitionEnd,\n onTransitionStart,\n animateOpacity,\n keepMounted,\n keepMountedMode,\n ref,\n orientation,\n ...others\n } = useProps('Collapse', defaultProps, props);\n\n const env = useMantineEnv();\n const theme = useMantineTheme();\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 0 : transitionDuration;\n const hook = orientation === 'horizontal' ? useHorizontalCollapse : useCollapse;\n\n const collapse = hook({\n expanded,\n transitionDuration: duration,\n transitionTimingFunction,\n onTransitionEnd,\n onTransitionStart,\n keepMounted: false,\n });\n\n if (duration === 0) {\n if (keepMounted === true && (keepMountedMode === 'display-none' || env !== 'test')) {\n if (keepMountedMode === 'display-none') {\n return (\n <Box\n {...others}\n style={{\n ...getStyleObject(style, theme),\n ...(!expanded ? { display: 'none' } : {}),\n }}\n ref={ref}\n >\n {children}\n </Box>\n );\n }\n\n return (\n <Activity mode={expanded ? 'visible' : 'hidden'}>\n <Box {...others} style={style} ref={ref}>\n {children}\n </Box>\n </Activity>\n );\n }\n\n return expanded ? (\n <Box {...others} style={style} ref={ref}>\n {children}\n </Box>\n ) : null;\n }\n\n const isExited = collapse.state === 'exited';\n\n let content: React.ReactNode;\n if (keepMounted === false) {\n content = isExited ? null : children;\n } else if (keepMounted === true) {\n content =\n keepMountedMode === 'display-none' ? (\n children\n ) : (\n <Activity mode={isExited ? 'hidden' : 'visible'}>{children}</Activity>\n );\n } else {\n content = children;\n }\n\n return (\n <Box\n {...others}\n {...collapse.getCollapseProps({\n style: {\n opacity: expanded || !animateOpacity ? 1 : 0,\n transition: animateOpacity ? `opacity ${duration}ms ${transitionTimingFunction}` : 'none',\n ...getStyleObject(style, theme),\n ...(keepMounted && keepMountedMode === 'display-none' && isExited\n ? { display: 'none' }\n : {}),\n },\n ref,\n })}\n >\n {content}\n </Box>\n );\n});\n\nCollapse.displayName = '@mantine/core/Collapse';\n\nexport namespace Collapse {\n export type Props = CollapseProps;\n export type Factory = CollapseFactory;\n}\n"],"mappings":";;;;;;;;;;;AAmDA,MAAM,eAAe;CACnB,oBAAoB;CACpB,0BAA0B;CAC1B,gBAAgB;CAChB,aAAa;CACb,aAAa;CACb,iBAAiB;AACnB;AAEA,MAAa,WAAWA,gBAAAA,SAA0B,UAAU;CAC1D,MAAM,EACJ,UACA,UACA,oBACA,0BACA,OACA,iBACA,mBACA,gBACA,aACA,iBACA,KACA,aACA,GAAG,WACDC,kBAAAA,SAAS,YAAY,cAAc,KAAK;CAE5C,MAAM,MAAMC,wBAAAA,cAAc;CAC1B,MAAM,QAAQC,6BAAAA,gBAAgB;CAC9B,MAAM,sBAAA,GAAA,eAAA,iBAAA,CAAsC;CAE5C,MAAM,YADe,MAAM,uBAAuB,qBAAqB,SACvC,IAAI;CAGpC,MAAM,YAFO,gBAAgB,eAAeC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,OAAO,IAClB,CAAC;GACP;GACA;EACF,CAAC;YAEA;CACE,CAAA;AAET,CAAC;AAED,SAAS,cAAc"}
@@ -47,6 +47,7 @@ const MenuDropdown = require_factory.factory((props) => {
47
47
  "data-menu-dropdown": true,
48
48
  onKeyDown: handleKeyDown,
49
49
  children: [ctx.withInitialFocusPlaceholder && !ctx.hasSearch && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
50
+ role: "presentation",
50
51
  tabIndex: -1,
51
52
  "data-autofocus": true,
52
53
  "data-mantine-stop-propagation": true,
@@ -1 +1 @@
1
- {"version":3,"file":"MenuDropdown.cjs","names":["factory","useProps","useMenuContext","useMenuTypeAhead","createEventHandler","Popover","classes"],"sources":["../../../../src/components/Menu/MenuDropdown/MenuDropdown.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { useMenuContext } from '../Menu.context';\nimport { useMenuTypeAhead } from '../use-menu-type-ahead';\nimport classes from '../Menu.module.css';\n\nexport type MenuDropdownStylesNames = 'dropdown';\n\nexport interface MenuDropdownProps\n extends BoxProps, CompoundStylesApiProps<MenuDropdownFactory>, ElementProps<'div'> {}\n\nexport type MenuDropdownFactory = Factory<{\n props: MenuDropdownProps;\n ref: HTMLDivElement;\n stylesNames: MenuDropdownStylesNames;\n compound: true;\n}>;\n\nexport const MenuDropdown = factory<MenuDropdownFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n children,\n ref,\n ...others\n } = useProps('MenuDropdown', null, props);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const ctx = useMenuContext();\n\n const typeAhead = useMenuTypeAhead({\n enabled: !ctx.hasSearch,\n opened: ctx.opened,\n getDropdown: () => wrapperRef.current,\n });\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n typeAhead(event);\n if (event.defaultPrevented || ctx.hasSearch) {\n return;\n }\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n wrapperRef.current\n ?.querySelectorAll<HTMLButtonElement>('[data-menu-item]:not(:disabled)')[0]\n ?.focus();\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(\n onMouseEnter,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.openDropdown()\n );\n\n const handleMouseLeave = createEventHandler<any>(\n onMouseLeave,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.closeDropdown()\n );\n\n return (\n <Popover.Dropdown\n {...others}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n role=\"menu\"\n aria-orientation=\"vertical\"\n ref={useMergedRef(ref, wrapperRef)}\n {...ctx.getStyles('dropdown', {\n className,\n style,\n styles,\n classNames,\n withStaticClass: false,\n })}\n tabIndex={-1}\n data-menu-dropdown\n onKeyDown={handleKeyDown}\n >\n {ctx.withInitialFocusPlaceholder && !ctx.hasSearch && (\n <div tabIndex={-1} data-autofocus data-mantine-stop-propagation style={{ outline: 0 }} />\n )}\n {children}\n </Popover.Dropdown>\n );\n});\n\nMenuDropdown.classes = classes;\nMenuDropdown.displayName = '@mantine/core/MenuDropdown';\n"],"mappings":";;;;;;;;;;;;AA4BA,MAAa,eAAeA,gBAAAA,SAA8B,UAAU;CAClE,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,cACA,cACA,WACA,UACA,KACA,GAAG,WACDC,kBAAAA,SAAS,gBAAgB,MAAM,KAAK;CAExC,MAAM,cAAA,GAAA,MAAA,OAAA,CAAoC,IAAI;CAC9C,MAAM,MAAMC,qBAAAA,eAAe;CAE3B,MAAM,YAAYC,4BAAAA,iBAAiB;EACjC,SAAS,CAAC,IAAI;EACd,QAAQ,IAAI;EACZ,mBAAmB,WAAW;CAChC,CAAC;CAED,MAAM,gBAAgBC,6BAAAA,mBAAwB,YAAY,UAAU;EAClE,UAAU,KAAK;EACf,IAAI,MAAM,oBAAoB,IAAI,WAChC;EAEF,IAAI,MAAM,QAAQ,aAAa,MAAM,QAAQ,aAAa;GACxD,MAAM,eAAe;GACrB,WAAW,SACP,iBAAoC,iCAAiC,CAAC,CAAC,EAAE,EACzE,MAAM;EACZ;CACF,CAAC;CAED,MAAM,mBAAmBA,6BAAAA,mBACvB,qBACO,IAAI,YAAY,WAAW,IAAI,YAAY,kBAAkB,IAAI,aAAa,CACvF;CAEA,MAAM,mBAAmBA,6BAAAA,mBACvB,qBACO,IAAI,YAAY,WAAW,IAAI,YAAY,kBAAkB,IAAI,cAAc,CACxF;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,QAAQ,UAAT;EACE,GAAI;EACJ,cAAc;EACd,cAAc;EACd,MAAK;EACL,oBAAiB;EACjB,MAAA,GAAA,eAAA,aAAA,CAAkB,KAAK,UAAU;EACjC,GAAI,IAAI,UAAU,YAAY;GAC5B;GACA;GACA;GACA;GACA,iBAAiB;EACnB,CAAC;EACD,UAAU;EACV,sBAAA;EACA,WAAW;YAhBb,CAkBG,IAAI,+BAA+B,CAAC,IAAI,aACvC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,UAAU;GAAI,kBAAA;GAAe,iCAAA;GAA8B,OAAO,EAAE,SAAS,EAAE;EAAI,CAAA,GAEzF,QACe;;AAEtB,CAAC;AAED,aAAa,UAAUC,oBAAAA;AACvB,aAAa,cAAc"}
1
+ {"version":3,"file":"MenuDropdown.cjs","names":["factory","useProps","useMenuContext","useMenuTypeAhead","createEventHandler","Popover","classes"],"sources":["../../../../src/components/Menu/MenuDropdown/MenuDropdown.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { useMenuContext } from '../Menu.context';\nimport { useMenuTypeAhead } from '../use-menu-type-ahead';\nimport classes from '../Menu.module.css';\n\nexport type MenuDropdownStylesNames = 'dropdown';\n\nexport interface MenuDropdownProps\n extends BoxProps, CompoundStylesApiProps<MenuDropdownFactory>, ElementProps<'div'> {}\n\nexport type MenuDropdownFactory = Factory<{\n props: MenuDropdownProps;\n ref: HTMLDivElement;\n stylesNames: MenuDropdownStylesNames;\n compound: true;\n}>;\n\nexport const MenuDropdown = factory<MenuDropdownFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n children,\n ref,\n ...others\n } = useProps('MenuDropdown', null, props);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const ctx = useMenuContext();\n\n const typeAhead = useMenuTypeAhead({\n enabled: !ctx.hasSearch,\n opened: ctx.opened,\n getDropdown: () => wrapperRef.current,\n });\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n typeAhead(event);\n if (event.defaultPrevented || ctx.hasSearch) {\n return;\n }\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n wrapperRef.current\n ?.querySelectorAll<HTMLButtonElement>('[data-menu-item]:not(:disabled)')[0]\n ?.focus();\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(\n onMouseEnter,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.openDropdown()\n );\n\n const handleMouseLeave = createEventHandler<any>(\n onMouseLeave,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.closeDropdown()\n );\n\n return (\n <Popover.Dropdown\n {...others}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n role=\"menu\"\n aria-orientation=\"vertical\"\n ref={useMergedRef(ref, wrapperRef)}\n {...ctx.getStyles('dropdown', {\n className,\n style,\n styles,\n classNames,\n withStaticClass: false,\n })}\n tabIndex={-1}\n data-menu-dropdown\n onKeyDown={handleKeyDown}\n >\n {ctx.withInitialFocusPlaceholder && !ctx.hasSearch && (\n <div\n role=\"presentation\"\n tabIndex={-1}\n data-autofocus\n data-mantine-stop-propagation\n style={{ outline: 0 }}\n />\n )}\n {children}\n </Popover.Dropdown>\n );\n});\n\nMenuDropdown.classes = classes;\nMenuDropdown.displayName = '@mantine/core/MenuDropdown';\n"],"mappings":";;;;;;;;;;;;AA4BA,MAAa,eAAeA,gBAAAA,SAA8B,UAAU;CAClE,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,cACA,cACA,WACA,UACA,KACA,GAAG,WACDC,kBAAAA,SAAS,gBAAgB,MAAM,KAAK;CAExC,MAAM,cAAA,GAAA,MAAA,OAAA,CAAoC,IAAI;CAC9C,MAAM,MAAMC,qBAAAA,eAAe;CAE3B,MAAM,YAAYC,4BAAAA,iBAAiB;EACjC,SAAS,CAAC,IAAI;EACd,QAAQ,IAAI;EACZ,mBAAmB,WAAW;CAChC,CAAC;CAED,MAAM,gBAAgBC,6BAAAA,mBAAwB,YAAY,UAAU;EAClE,UAAU,KAAK;EACf,IAAI,MAAM,oBAAoB,IAAI,WAChC;EAEF,IAAI,MAAM,QAAQ,aAAa,MAAM,QAAQ,aAAa;GACxD,MAAM,eAAe;GACrB,WAAW,SACP,iBAAoC,iCAAiC,CAAC,CAAC,EAAE,EACzE,MAAM;EACZ;CACF,CAAC;CAED,MAAM,mBAAmBA,6BAAAA,mBACvB,qBACO,IAAI,YAAY,WAAW,IAAI,YAAY,kBAAkB,IAAI,aAAa,CACvF;CAEA,MAAM,mBAAmBA,6BAAAA,mBACvB,qBACO,IAAI,YAAY,WAAW,IAAI,YAAY,kBAAkB,IAAI,cAAc,CACxF;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,QAAQ,UAAT;EACE,GAAI;EACJ,cAAc;EACd,cAAc;EACd,MAAK;EACL,oBAAiB;EACjB,MAAA,GAAA,eAAA,aAAA,CAAkB,KAAK,UAAU;EACjC,GAAI,IAAI,UAAU,YAAY;GAC5B;GACA;GACA;GACA;GACA,iBAAiB;EACnB,CAAC;EACD,UAAU;EACV,sBAAA;EACA,WAAW;YAhBb,CAkBG,IAAI,+BAA+B,CAAC,IAAI,aACvC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GACE,MAAK;GACL,UAAU;GACV,kBAAA;GACA,iCAAA;GACA,OAAO,EAAE,SAAS,EAAE;EACrB,CAAA,GAEF,QACe;;AAEtB,CAAC;AAED,aAAa,UAAUC,oBAAAA;AACvB,aAAa,cAAc"}
@@ -64,7 +64,7 @@ function MenubarTarget(props) {
64
64
  ctx.openMenu(menuCtx.index, "hover");
65
65
  ctx.setActiveIndex(menuCtx.index);
66
66
  } else if (ctx.openIndex !== null && ctx.openIndex !== menuCtx.index) {
67
- ctx.openMenu(menuCtx.index, "hover");
67
+ ctx.openMenu(menuCtx.index, "click");
68
68
  ctx.setActiveIndex(menuCtx.index);
69
69
  }
70
70
  });
@@ -1 +1 @@
1
- {"version":3,"file":"MenubarTarget.cjs","names":["useProps","useMenubarContext","useMenubarMenuContext","useDirection","createEventHandler","Popover","UnstyledButton"],"sources":["../../../../src/components/Menubar/MenubarTarget/MenubarTarget.tsx"],"sourcesContent":["import {\n createEventHandler,\n ElementProps,\n MantineStyleProp,\n useDirection,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenubarContext, useMenubarMenuContext } from '../Menubar.context';\n\nexport interface MenubarTargetProps extends ElementProps<'button'> {\n 'data-disabled'?: boolean;\n\n /** Target label */\n children: React.ReactNode;\n\n /** Inline styles applied to the target button */\n style?: MantineStyleProp;\n\n /** Key of the prop used to get element ref, useful for forwarding refs to custom components @default 'ref' */\n refProp?: string;\n}\n\nconst defaultProps = {\n refProp: 'ref',\n} satisfies Partial<MenubarTargetProps>;\n\nfunction isPrintableKey(event: React.KeyboardEvent) {\n return (\n event.key.length === 1 && event.key !== ' ' && !event.ctrlKey && !event.metaKey && !event.altKey\n );\n}\n\nfunction getTargetLabel(node: HTMLElement) {\n return (node.textContent ?? '').trim().toLowerCase();\n}\n\nexport function MenubarTarget(props: MenubarTargetProps) {\n const {\n children,\n refProp,\n className,\n style,\n disabled,\n 'data-disabled': dataDisabled,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onKeyDown,\n ...others\n } = useProps('MenubarTarget', defaultProps, props);\n\n const ctx = useMenubarContext();\n const menuCtx = useMenubarMenuContext();\n const { dir } = useDirection();\n\n const isDisabled = disabled || dataDisabled;\n const isActive = ctx.activeIndex === menuCtx.index;\n\n // Before the menu indexes resolve from the DOM (first render / SSR HTML), every target\n // would otherwise compute `tabIndex={-1}`, leaving the menubar with no tab stop until\n // effects run. Keep unresolved targets focusable so keyboard users can enter the menubar.\n const isUnresolvedTabStop = menuCtx.index === -1 && !isDisabled;\n\n const moveToAdjacent = (direction: 1 | -1) => {\n const nextIndex = ctx.getAdjacentIndex(menuCtx.index, direction);\n ctx.setActiveIndex(nextIndex);\n ctx.focusTarget(nextIndex);\n if (ctx.openIndex !== null) {\n ctx.openMenu(nextIndex, 'click');\n }\n };\n\n const openAndFocusItem = (itemPosition: 'first' | 'last') => {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n ctx.focusMenuItem(menuCtx.index, itemPosition);\n };\n\n const typeAhead = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const targets = ctx.getTargets();\n if (targets.length === 0) {\n return;\n }\n\n const char = event.key.toLowerCase();\n for (let offset = 1; offset <= targets.length; offset += 1) {\n const index = (menuCtx.index + offset) % targets.length;\n const node = targets[index];\n if (\n node &&\n !node.disabled &&\n !node.hasAttribute('data-disabled') &&\n getTargetLabel(node).startsWith(char)\n ) {\n event.preventDefault();\n ctx.setActiveIndex(index);\n node.focus();\n if (ctx.openIndex !== null) {\n ctx.openMenu(index, 'click');\n }\n break;\n }\n }\n };\n\n const handleClick = createEventHandler<any>(onClick, () => {\n if (isDisabled) {\n return;\n }\n if (ctx.openIndex === menuCtx.index && ctx.getOpenSource() !== 'hover') {\n ctx.closeMenu();\n } else {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(onMouseEnter, () => {\n if (isDisabled) {\n return;\n }\n ctx.cancelClose();\n if (ctx.trigger === 'hover') {\n ctx.openMenu(menuCtx.index, 'hover');\n ctx.setActiveIndex(menuCtx.index);\n } else if (ctx.openIndex !== null && ctx.openIndex !== menuCtx.index) {\n ctx.openMenu(menuCtx.index, 'hover');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseLeave = createEventHandler<any>(onMouseLeave, () => {\n if (ctx.trigger === 'hover') {\n ctx.scheduleClose();\n }\n });\n\n const handleFocus = createEventHandler<any>(onFocus, () => ctx.setActiveIndex(menuCtx.index));\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n if (isDisabled) {\n return;\n }\n const forwardKey = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const backKey = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n\n if (event.key === forwardKey) {\n event.preventDefault();\n moveToAdjacent(1);\n } else if (event.key === backKey) {\n event.preventDefault();\n moveToAdjacent(-1);\n } else if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n openAndFocusItem('first');\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n openAndFocusItem('last');\n } else if (event.key === 'Home') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n ctx.setActiveIndex(enabled[0]);\n ctx.focusTarget(enabled[0]);\n }\n } else if (event.key === 'End') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n const last = enabled[enabled.length - 1];\n ctx.setActiveIndex(last);\n ctx.focusTarget(last);\n }\n } else if (event.key === 'Escape') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (event.key === 'Tab') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (isPrintableKey(event)) {\n typeAhead(event);\n }\n });\n\n return (\n <Popover.Target refProp={refProp} popupType=\"menu\">\n <UnstyledButton\n {...others}\n unstyled={ctx.unstyled}\n role=\"menuitem\"\n tabIndex={isActive || isUnresolvedTabStop ? 0 : -1}\n disabled={disabled}\n data-menubar-target\n data-menubar-id={menuCtx.id}\n data-disabled={dataDisabled || undefined}\n data-expanded={menuCtx.opened || undefined}\n data-mantine-stop-propagation={menuCtx.opened || undefined}\n {...ctx.getStyles('target', { className, style })}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n >\n {children}\n </UnstyledButton>\n </Popover.Target>\n );\n}\n\nMenubarTarget.displayName = '@mantine/core/MenubarTarget';\n"],"mappings":";;;;;;;;;AAwBA,MAAM,eAAe,EACnB,SAAS,MACX;AAEA,SAAS,eAAe,OAA4B;CAClD,OACE,MAAM,IAAI,WAAW,KAAK,MAAM,QAAQ,OAAO,CAAC,MAAM,WAAW,CAAC,MAAM,WAAW,CAAC,MAAM;AAE9F;AAEA,SAAS,eAAe,MAAmB;CACzC,QAAQ,KAAK,eAAe,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY;AACrD;AAEA,SAAgB,cAAc,OAA2B;CACvD,MAAM,EACJ,UACA,SACA,WACA,OACA,UACA,iBAAiB,cACjB,SACA,cACA,cACA,SACA,WACA,GAAG,WACDA,kBAAAA,SAAS,iBAAiB,cAAc,KAAK;CAEjD,MAAM,MAAMC,wBAAAA,kBAAkB;CAC9B,MAAM,UAAUC,wBAAAA,sBAAsB;CACtC,MAAM,EAAE,QAAQC,0BAAAA,aAAa;CAE7B,MAAM,aAAa,YAAY;CAC/B,MAAM,WAAW,IAAI,gBAAgB,QAAQ;CAK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I,YAAY,IAAI;GACtB;EACF,OAAO,IAAI,MAAM,QAAQ;OACnB,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,MAAM,QAAQ;OACnB,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,eAAe,KAAK,GAC7B,UAAU,KAAK;CAEnB,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,QAAQ,QAAT;EAAyB;EAAS,WAAU;YAC1C,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD;GACE,GAAI;GACJ,UAAU,IAAI;GACd,MAAK;GACL,UAAU,YAAY,sBAAsB,IAAI;GACtC;GACV,uBAAA;GACA,mBAAiB,QAAQ;GACzB,iBAAe,gBAAgB,KAAA;GAC/B,iBAAe,QAAQ,UAAU,KAAA;GACjC,iCAA+B,QAAQ,UAAU,KAAA;GACjD,GAAI,IAAI,UAAU,UAAU;IAAE;IAAW;GAAM,CAAC;GAChD,SAAS;GACT,cAAc;GACd,cAAc;GACd,SAAS;GACT,WAAW;GAEV;EACa,CAAA;CACF,CAAA;AAEpB;AAEA,cAAc,cAAc"}
1
+ {"version":3,"file":"MenubarTarget.cjs","names":["useProps","useMenubarContext","useMenubarMenuContext","useDirection","createEventHandler","Popover","UnstyledButton"],"sources":["../../../../src/components/Menubar/MenubarTarget/MenubarTarget.tsx"],"sourcesContent":["import {\n createEventHandler,\n ElementProps,\n MantineStyleProp,\n useDirection,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenubarContext, useMenubarMenuContext } from '../Menubar.context';\n\nexport interface MenubarTargetProps extends ElementProps<'button'> {\n 'data-disabled'?: boolean;\n\n /** Target label */\n children: React.ReactNode;\n\n /** Inline styles applied to the target button */\n style?: MantineStyleProp;\n\n /** Key of the prop used to get element ref, useful for forwarding refs to custom components @default 'ref' */\n refProp?: string;\n}\n\nconst defaultProps = {\n refProp: 'ref',\n} satisfies Partial<MenubarTargetProps>;\n\nfunction isPrintableKey(event: React.KeyboardEvent) {\n return (\n event.key.length === 1 && event.key !== ' ' && !event.ctrlKey && !event.metaKey && !event.altKey\n );\n}\n\nfunction getTargetLabel(node: HTMLElement) {\n return (node.textContent ?? '').trim().toLowerCase();\n}\n\nexport function MenubarTarget(props: MenubarTargetProps) {\n const {\n children,\n refProp,\n className,\n style,\n disabled,\n 'data-disabled': dataDisabled,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onKeyDown,\n ...others\n } = useProps('MenubarTarget', defaultProps, props);\n\n const ctx = useMenubarContext();\n const menuCtx = useMenubarMenuContext();\n const { dir } = useDirection();\n\n const isDisabled = disabled || dataDisabled;\n const isActive = ctx.activeIndex === menuCtx.index;\n\n // Before the menu indexes resolve from the DOM (first render / SSR HTML), every target\n // would otherwise compute `tabIndex={-1}`, leaving the menubar with no tab stop until\n // effects run. Keep unresolved targets focusable so keyboard users can enter the menubar.\n const isUnresolvedTabStop = menuCtx.index === -1 && !isDisabled;\n\n const moveToAdjacent = (direction: 1 | -1) => {\n const nextIndex = ctx.getAdjacentIndex(menuCtx.index, direction);\n ctx.setActiveIndex(nextIndex);\n ctx.focusTarget(nextIndex);\n if (ctx.openIndex !== null) {\n ctx.openMenu(nextIndex, 'click');\n }\n };\n\n const openAndFocusItem = (itemPosition: 'first' | 'last') => {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n ctx.focusMenuItem(menuCtx.index, itemPosition);\n };\n\n const typeAhead = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const targets = ctx.getTargets();\n if (targets.length === 0) {\n return;\n }\n\n const char = event.key.toLowerCase();\n for (let offset = 1; offset <= targets.length; offset += 1) {\n const index = (menuCtx.index + offset) % targets.length;\n const node = targets[index];\n if (\n node &&\n !node.disabled &&\n !node.hasAttribute('data-disabled') &&\n getTargetLabel(node).startsWith(char)\n ) {\n event.preventDefault();\n ctx.setActiveIndex(index);\n node.focus();\n if (ctx.openIndex !== null) {\n ctx.openMenu(index, 'click');\n }\n break;\n }\n }\n };\n\n const handleClick = createEventHandler<any>(onClick, () => {\n if (isDisabled) {\n return;\n }\n if (ctx.openIndex === menuCtx.index && ctx.getOpenSource() !== 'hover') {\n ctx.closeMenu();\n } else {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(onMouseEnter, () => {\n if (isDisabled) {\n return;\n }\n ctx.cancelClose();\n if (ctx.trigger === 'hover') {\n ctx.openMenu(menuCtx.index, 'hover');\n ctx.setActiveIndex(menuCtx.index);\n } else if (ctx.openIndex !== null && ctx.openIndex !== menuCtx.index) {\n // Hover-switching with trigger=\"click\" continues a click-driven interaction:\n // keep 'click' as the open source so that the next click on the target\n // closes the menu, same as a click-opened menu (desktop application pattern)\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseLeave = createEventHandler<any>(onMouseLeave, () => {\n if (ctx.trigger === 'hover') {\n ctx.scheduleClose();\n }\n });\n\n const handleFocus = createEventHandler<any>(onFocus, () => ctx.setActiveIndex(menuCtx.index));\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n if (isDisabled) {\n return;\n }\n const forwardKey = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const backKey = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n\n if (event.key === forwardKey) {\n event.preventDefault();\n moveToAdjacent(1);\n } else if (event.key === backKey) {\n event.preventDefault();\n moveToAdjacent(-1);\n } else if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n openAndFocusItem('first');\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n openAndFocusItem('last');\n } else if (event.key === 'Home') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n ctx.setActiveIndex(enabled[0]);\n ctx.focusTarget(enabled[0]);\n }\n } else if (event.key === 'End') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n const last = enabled[enabled.length - 1];\n ctx.setActiveIndex(last);\n ctx.focusTarget(last);\n }\n } else if (event.key === 'Escape') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (event.key === 'Tab') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (isPrintableKey(event)) {\n typeAhead(event);\n }\n });\n\n return (\n <Popover.Target refProp={refProp} popupType=\"menu\">\n <UnstyledButton\n {...others}\n unstyled={ctx.unstyled}\n role=\"menuitem\"\n tabIndex={isActive || isUnresolvedTabStop ? 0 : -1}\n disabled={disabled}\n data-menubar-target\n data-menubar-id={menuCtx.id}\n data-disabled={dataDisabled || undefined}\n data-expanded={menuCtx.opened || undefined}\n data-mantine-stop-propagation={menuCtx.opened || undefined}\n {...ctx.getStyles('target', { className, style })}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n >\n {children}\n </UnstyledButton>\n </Popover.Target>\n );\n}\n\nMenubarTarget.displayName = '@mantine/core/MenubarTarget';\n"],"mappings":";;;;;;;;;AAwBA,MAAM,eAAe,EACnB,SAAS,MACX;AAEA,SAAS,eAAe,OAA4B;CAClD,OACE,MAAM,IAAI,WAAW,KAAK,MAAM,QAAQ,OAAO,CAAC,MAAM,WAAW,CAAC,MAAM,WAAW,CAAC,MAAM;AAE9F;AAEA,SAAS,eAAe,MAAmB;CACzC,QAAQ,KAAK,eAAe,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY;AACrD;AAEA,SAAgB,cAAc,OAA2B;CACvD,MAAM,EACJ,UACA,SACA,WACA,OACA,UACA,iBAAiB,cACjB,SACA,cACA,cACA,SACA,WACA,GAAG,WACDA,kBAAAA,SAAS,iBAAiB,cAAc,KAAK;CAEjD,MAAM,MAAMC,w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,OAAO;GAC9B,MAAM,eAAe;GACrB,MAAM,UAAU,IAAI,kBAAkB;GACtC,IAAI,QAAQ,SAAS,GAAG;IACtB,MAAM,OAAO,QAAQ,QAAQ,SAAS;IACtC,IAAI,eAAe,IAAI;IACvB,IAAI,YAAY,IAAI;GACtB;EACF,OAAO,IAAI,MAAM,QAAQ;OACnB,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,MAAM,QAAQ;OACnB,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,eAAe,KAAK,GAC7B,UAAU,KAAK;CAEnB,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,QAAQ,QAAT;EAAyB;EAAS,WAAU;YAC1C,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD;GACE,GAAI;GACJ,UAAU,IAAI;GACd,MAAK;GACL,UAAU,YAAY,sBAAsB,IAAI;GACtC;GACV,uBAAA;GACA,mBAAiB,QAAQ;GACzB,iBAAe,gBAAgB,KAAA;GAC/B,iBAAe,QAAQ,UAAU,KAAA;GACjC,iCAA+B,QAAQ,UAAU,KAAA;GACjD,GAAI,IAAI,UAAU,UAAU;IAAE;IAAW;GAAM,CAAC;GAChD,SAAS;GACT,cAAc;GACd,cAAc;GACd,SAAS;GACT,WAAW;GAEV;EACa,CAAA;CACF,CAAA;AAEpB;AAEA,cAAc,cAAc"}
@@ -8,7 +8,7 @@ const require_use_modal = require("./use-modal.cjs");
8
8
  let react_remove_scroll = require("react-remove-scroll");
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
10
10
  //#region packages/@mantine/core/src/components/ModalBase/ModalBase.tsx
11
- function ModalBase({ keepMounted, opened, onClose, id, transitionProps, onExitTransitionEnd, onEnterTransitionEnd, trapFocus, closeOnEscape, returnFocus, closeOnClickOutside, withinPortal, portalProps, lockScroll, children, zIndex, shadow, padding, __vars, unstyled, removeScrollProps, ...others }) {
11
+ function ModalBase({ keepMounted, keepMountedMode = "activity", opened, onClose, id, transitionProps, onExitTransitionEnd, onEnterTransitionEnd, trapFocus, closeOnEscape, returnFocus, closeOnClickOutside, withinPortal, portalProps, lockScroll, children, zIndex, shadow, padding, __vars, unstyled, removeScrollProps, ...others }) {
12
12
  const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } = require_use_modal.useModal({
13
13
  id,
14
14
  transitionProps,
@@ -31,7 +31,8 @@ function ModalBase({ keepMounted, opened, onClose, id, transitionProps, onExitTr
31
31
  onEnterTransitionEnd,
32
32
  transitionProps: {
33
33
  ...transitionProps,
34
- keepMounted
34
+ keepMounted,
35
+ keepMountedMode
35
36
  },
36
37
  getTitleId: () => `${_id}-title`,
37
38
  getBodyId: () => `${_id}-body`,
@@ -1 +1 @@
1
- {"version":3,"file":"ModalBase.cjs","names":["useModal","OptionalPortal","ModalBaseProvider","RemoveScroll","Box","getDefaultZIndex","getShadow","getSpacing"],"sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n} from '../../core';\nimport { BasePortalProps, OptionalPortal } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\ntype RemoveScrollProps = Omit<React.ComponentProps<typeof RemoveScroll>, 'children'>;\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n unstyled?: boolean;\n\n /** If set modal/drawer is not unmounted from the DOM when hidden. `display: none` styles are applied instead. @default false */\n keepMounted?: boolean;\n\n /** Controls opened state */\n opened: boolean;\n\n /** Called when modal/drawer is closed */\n onClose: () => void;\n\n /** Id used to connect modal/drawer with body and title */\n id?: string;\n\n /** If set, scroll is locked when `opened={true}` @default true */\n lockScroll?: boolean;\n\n /** If set, focus is trapped within the modal/drawer @default true */\n trapFocus?: boolean;\n\n /** If set, the component is rendered inside `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: BasePortalProps;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** If set, the modal/drawer is closed when user clicks on the overlay @default true */\n closeOnClickOutside?: boolean;\n\n /** Props added to the `Transition` component that used to animate overlay and body, use to configure duration and animation type, `{ duration: 200, transition: 'fade-down' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Called when exit transition ends */\n onExitTransitionEnd?: () => void;\n\n /** Called when enter transition ends */\n onEnterTransitionEnd?: () => void;\n\n /** If set, `onClose` is called when user presses the escape key @default true */\n closeOnEscape?: boolean;\n\n /** If set, focus is returned to the last active element when `onClose` is called @default true */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element @default 200 */\n zIndex?: string | number;\n\n /** Key of `theme.shadows` or any valid CSS box-shadow value @default 'xl' */\n shadow?: MantineShadow;\n\n /** Key of `theme.spacing` or any valid CSS value to set content, header and footer padding @default 'md' */\n padding?: MantineSpacing;\n\n /** Controls width of the content area @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** Props passed down to react-remove-scroll, can be used to customize scroll lock behavior */\n removeScrollProps?: RemoveScrollProps;\n}\n\nexport function ModalBase({\n keepMounted,\n opened,\n onClose,\n id,\n transitionProps,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n trapFocus,\n closeOnEscape,\n returnFocus,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n lockScroll,\n children,\n zIndex,\n shadow,\n padding,\n __vars,\n unstyled,\n removeScrollProps,\n ...others\n}: ModalBaseProps) {\n const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =\n useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });\n\n const { key: removeScrollKey, ...otherRemoveScrollProps } = removeScrollProps || {};\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <ModalBaseProvider\n value={{\n opened,\n onClose,\n closeOnClickOutside,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n transitionProps: { ...transitionProps, keepMounted },\n getTitleId: () => `${_id}-title`,\n getBodyId: () => `${_id}-body`,\n titleMounted,\n bodyMounted,\n setTitleMounted,\n setBodyMounted,\n trapFocus,\n closeOnEscape,\n zIndex,\n unstyled,\n }}\n >\n <RemoveScroll\n enabled={shouldLockScroll && lockScroll}\n key={removeScrollKey}\n {...otherRemoveScrollProps}\n >\n <Box\n {...others}\n id={_id}\n __vars={{\n ...__vars,\n '--mb-z-index': (zIndex || getDefaultZIndex('modal')).toString(),\n '--mb-shadow': getShadow(shadow),\n '--mb-padding': getSpacing(padding),\n }}\n >\n {children}\n </Box>\n </RemoveScroll>\n </ModalBaseProvider>\n </OptionalPortal>\n );\n}\n\nModalBase.displayName = '@mantine/core/ModalBase';\n"],"mappings":";;;;;;;;;;AAmFA,SAAgB,UAAU,EACxB,aACA,QACA,SACA,IACA,iBACA,qBACA,sBACA,WACA,eACA,aACA,qBACA,cACA,aACA,YACA,UACA,QACA,QACA,SACA,QACA,UACA,mBACA,GAAG,UACc;CACjB,MAAM,EAAE,KAAK,cAAc,aAAa,kBAAkB,iBAAiB,mBACzEA,kBAAAA,SAAS;EAAE;EAAI;EAAiB;EAAQ;EAAW;EAAe;EAAS;CAAY,CAAC;CAE1F,MAAM,EAAE,KAAK,iBAAiB,GAAG,2BAA2B,qBAAqB,CAAC;CAElF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD;EAAgB,GAAI;EAA2B;YAC7C,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,mBAAD;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA,iBAAiB;KAAE,GAAG;KAAiB;IAAY;IACnD,kBAAkB,GAAG,IAAI;IACzB,iBAAiB,GAAG,IAAI;IACxB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;aAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,cAAD;IACE,SAAS,oBAAoB;IAE7B,GAAI;cAEJ,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;KACE,GAAI;KACJ,IAAI;KACJ,QAAQ;MACN,GAAG;MACH,iBAAiB,UAAUC,4BAAAA,iBAAiB,OAAO,EAAA,CAAG,SAAS;MAC/D,eAAeC,iBAAAA,UAAU,MAAM;MAC/B,gBAAgBC,iBAAAA,WAAW,OAAO;KACpC;KAEC;IACE,CAAA;GACO,GAfP,eAeO;EACG,CAAA;CACL,CAAA;AAEpB;AAEA,UAAU,cAAc"}
1
+ {"version":3,"file":"ModalBase.cjs","names":["useModal","OptionalPortal","ModalBaseProvider","RemoveScroll","Box","getDefaultZIndex","getShadow","getSpacing"],"sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n} from '../../core';\nimport { BasePortalProps, OptionalPortal } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\ntype RemoveScrollProps = Omit<React.ComponentProps<typeof RemoveScroll>, 'children'>;\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n unstyled?: boolean;\n\n /** If set modal/drawer is not unmounted from the DOM when hidden. `display: none` styles are applied instead. @default false */\n keepMounted?: boolean;\n\n /** Controls how the modal/drawer is hidden when `keepMounted` is set:\n * `'activity'` - hidden with React 19 `Activity` component,\n * `'display-none'` - hidden with `display: none` styles\n * @default 'activity'\n */\n keepMountedMode?: 'activity' | 'display-none';\n\n /** Controls opened state */\n opened: boolean;\n\n /** Called when modal/drawer is closed */\n onClose: () => void;\n\n /** Id used to connect modal/drawer with body and title */\n id?: string;\n\n /** If set, scroll is locked when `opened={true}` @default true */\n lockScroll?: boolean;\n\n /** If set, focus is trapped within the modal/drawer @default true */\n trapFocus?: boolean;\n\n /** If set, the component is rendered inside `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: BasePortalProps;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** If set, the modal/drawer is closed when user clicks on the overlay @default true */\n closeOnClickOutside?: boolean;\n\n /** Props added to the `Transition` component that used to animate overlay and body, use to configure duration and animation type, `{ duration: 200, transition: 'fade-down' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Called when exit transition ends */\n onExitTransitionEnd?: () => void;\n\n /** Called when enter transition ends */\n onEnterTransitionEnd?: () => void;\n\n /** If set, `onClose` is called when user presses the escape key @default true */\n closeOnEscape?: boolean;\n\n /** If set, focus is returned to the last active element when `onClose` is called @default true */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element @default 200 */\n zIndex?: string | number;\n\n /** Key of `theme.shadows` or any valid CSS box-shadow value @default 'xl' */\n shadow?: MantineShadow;\n\n /** Key of `theme.spacing` or any valid CSS value to set content, header and footer padding @default 'md' */\n padding?: MantineSpacing;\n\n /** Controls width of the content area @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** Props passed down to react-remove-scroll, can be used to customize scroll lock behavior */\n removeScrollProps?: RemoveScrollProps;\n}\n\nexport function ModalBase({\n keepMounted,\n keepMountedMode = 'activity',\n opened,\n onClose,\n id,\n transitionProps,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n trapFocus,\n closeOnEscape,\n returnFocus,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n lockScroll,\n children,\n zIndex,\n shadow,\n padding,\n __vars,\n unstyled,\n removeScrollProps,\n ...others\n}: ModalBaseProps) {\n const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =\n useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });\n\n const { key: removeScrollKey, ...otherRemoveScrollProps } = removeScrollProps || {};\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <ModalBaseProvider\n value={{\n opened,\n onClose,\n closeOnClickOutside,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n transitionProps: { ...transitionProps, keepMounted, keepMountedMode },\n getTitleId: () => `${_id}-title`,\n getBodyId: () => `${_id}-body`,\n titleMounted,\n bodyMounted,\n setTitleMounted,\n setBodyMounted,\n trapFocus,\n closeOnEscape,\n zIndex,\n unstyled,\n }}\n >\n <RemoveScroll\n enabled={shouldLockScroll && lockScroll}\n key={removeScrollKey}\n {...otherRemoveScrollProps}\n >\n <Box\n {...others}\n id={_id}\n __vars={{\n ...__vars,\n '--mb-z-index': (zIndex || getDefaultZIndex('modal')).toString(),\n '--mb-shadow': getShadow(shadow),\n '--mb-padding': getSpacing(padding),\n }}\n >\n {children}\n </Box>\n </RemoveScroll>\n </ModalBaseProvider>\n </OptionalPortal>\n );\n}\n\nModalBase.displayName = '@mantine/core/ModalBase';\n"],"mappings":";;;;;;;;;;AA0FA,SAAgB,UAAU,EACxB,aACA,kBAAkB,YAClB,QACA,SACA,IACA,iBACA,qBACA,sBACA,WACA,eACA,aACA,qBACA,cACA,aACA,YACA,UACA,QACA,QACA,SACA,QACA,UACA,mBACA,GAAG,UACc;CACjB,MAAM,EAAE,KAAK,cAAc,aAAa,kBAAkB,iBAAiB,mBACzEA,kBAAAA,SAAS;EAAE;EAAI;EAAiB;EAAQ;EAAW;EAAe;EAAS;CAAY,CAAC;CAE1F,MAAM,EAAE,KAAK,iBAAiB,GAAG,2BAA2B,qBAAqB,CAAC;CAElF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD;EAAgB,GAAI;EAA2B;YAC7C,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,mBAAD;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA,iBAAiB;KAAE,GAAG;KAAiB;KAAa;IAAgB;IACpE,kBAAkB,GAAG,IAAI;IACzB,iBAAiB,GAAG,IAAI;IACxB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;aAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,cAAD;IACE,SAAS,oBAAoB;IAE7B,GAAI;cAEJ,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;KACE,GAAI;KACJ,IAAI;KACJ,QAAQ;MACN,GAAG;MACH,iBAAiB,UAAUC,4BAAAA,iBAAiB,OAAO,EAAA,CAAG,SAAS;MAC/D,eAAeC,iBAAAA,UAAU,MAAM;MAC/B,gBAAgBC,iBAAAA,WAAW,OAAO;KACpC;KAEC;IACE,CAAA;GACO,GAfP,eAeO;EACG,CAAA;CACL,CAAA;AAEpB;AAEA,UAAU,cAAc"}
@@ -27,8 +27,9 @@ function getDigitParts({ value, decimalScale, fixedDecimalScale }) {
27
27
  const dotIdx = str.indexOf(".");
28
28
  const intStr = dotIdx >= 0 ? str.slice(0, dotIdx) : str;
29
29
  const fracStr = dotIdx >= 0 ? str.slice(dotIdx + 1) : "";
30
+ const roundedToZero = !/[1-9]/.test(str);
30
31
  return {
31
- negative: value < 0,
32
+ negative: value < 0 && !roundedToZero,
32
33
  intDigits: intStr.split(""),
33
34
  fracDigits: fracStr ? fracStr.split("") : [],
34
35
  hasDecimal: dotIdx >= 0
@@ -1 +1 @@
1
- {"version":3,"file":"get-digit-parts.cjs","names":[],"sources":["../../../src/components/RollingNumber/get-digit-parts.ts"],"sourcesContent":["export interface DigitParts {\n negative: boolean;\n intDigits: string[];\n fracDigits: string[];\n hasDecimal: boolean;\n}\n\nexport interface GetDigitPartsInput {\n value: number;\n decimalScale?: number;\n fixedDecimalScale?: boolean;\n}\n\nconst PLAIN_FORMAT = new Intl.NumberFormat('en-US', {\n useGrouping: false,\n maximumFractionDigits: 20,\n});\n\nfunction toPlainString(num: number, decimalScale?: number): string {\n if (!Number.isFinite(num)) {\n return '0';\n }\n\n if (decimalScale !== undefined) {\n return new Intl.NumberFormat('en-US', {\n useGrouping: false,\n minimumFractionDigits: decimalScale,\n maximumFractionDigits: decimalScale,\n }).format(num);\n }\n\n const str = String(num);\n if (!str.includes('e') && !str.includes('E')) {\n return str;\n }\n\n return PLAIN_FORMAT.format(num);\n}\n\nexport function getDigitParts({\n value,\n decimalScale,\n fixedDecimalScale,\n}: GetDigitPartsInput): DigitParts {\n const abs = Math.abs(value);\n let str = toPlainString(abs, decimalScale);\n\n if (!fixedDecimalScale && decimalScale !== undefined) {\n const parts = str.split('.');\n if (parts[1]) {\n const trimmed = parts[1].replace(/0+$/, '');\n str = trimmed ? `${parts[0]}.${trimmed}` : parts[0];\n }\n }\n\n const dotIdx = str.indexOf('.');\n const intStr = dotIdx >= 0 ? str.slice(0, dotIdx) : str;\n const fracStr = dotIdx >= 0 ? str.slice(dotIdx + 1) : '';\n\n return {\n negative: value < 0,\n intDigits: intStr.split(''),\n fracDigits: fracStr ? fracStr.split('') : [],\n hasDecimal: dotIdx >= 0,\n };\n}\n"],"mappings":";;AAaA,MAAM,eAAe,IAAI,KAAK,aAAa,SAAS;CAClD,aAAa;CACb,uBAAuB;AACzB,CAAC;AAED,SAAS,cAAc,KAAa,cAA+B;CACjE,IAAI,CAAC,OAAO,SAAS,GAAG,GACtB,OAAO;CAGT,IAAI,iBAAiB,KAAA,GACnB,OAAO,IAAI,KAAK,aAAa,SAAS;EACpC,aAAa;EACb,uBAAuB;EACvB,uBAAuB;CACzB,CAAC,CAAC,CAAC,OAAO,GAAG;CAGf,MAAM,MAAM,OAAO,GAAG;CACtB,IAAI,CAAC,IAAI,SAAS,GAAG,KAAK,CAAC,IAAI,SAAS,GAAG,GACzC,OAAO;CAGT,OAAO,aAAa,OAAO,GAAG;AAChC;AAEA,SAAgB,cAAc,EAC5B,OACA,cACA,qBACiC;CAEjC,IAAI,MAAM,cADE,KAAK,IAAI,KACK,GAAG,YAAY;CAEzC,IAAI,CAAC,qBAAqB,iBAAiB,KAAA,GAAW;EACpD,MAAM,QAAQ,IAAI,MAAM,GAAG;EAC3B,IAAI,MAAM,IAAI;GACZ,MAAM,UAAU,MAAM,EAAE,CAAC,QAAQ,OAAO,EAAE;GAC1C,MAAM,UAAU,GAAG,MAAM,GAAG,GAAG,YAAY,MAAM;EACnD;CACF;CAEA,MAAM,SAAS,IAAI,QAAQ,GAAG;CAC9B,MAAM,SAAS,UAAU,IAAI,IAAI,MAAM,GAAG,MAAM,IAAI;CACpD,MAAM,UAAU,UAAU,IAAI,IAAI,MAAM,SAAS,CAAC,IAAI;CAEtD,OAAO;EACL,UAAU,QAAQ;EAClB,WAAW,OAAO,MAAM,EAAE;EAC1B,YAAY,UAAU,QAAQ,MAAM,EAAE,IAAI,CAAC;EAC3C,YAAY,UAAU;CACxB;AACF"}
1
+ {"version":3,"file":"get-digit-parts.cjs","names":[],"sources":["../../../src/components/RollingNumber/get-digit-parts.ts"],"sourcesContent":["export interface DigitParts {\n negative: boolean;\n intDigits: string[];\n fracDigits: string[];\n hasDecimal: boolean;\n}\n\nexport interface GetDigitPartsInput {\n value: number;\n decimalScale?: number;\n fixedDecimalScale?: boolean;\n}\n\nconst PLAIN_FORMAT = new Intl.NumberFormat('en-US', {\n useGrouping: false,\n maximumFractionDigits: 20,\n});\n\nfunction toPlainString(num: number, decimalScale?: number): string {\n if (!Number.isFinite(num)) {\n return '0';\n }\n\n if (decimalScale !== undefined) {\n return new Intl.NumberFormat('en-US', {\n useGrouping: false,\n minimumFractionDigits: decimalScale,\n maximumFractionDigits: decimalScale,\n }).format(num);\n }\n\n const str = String(num);\n if (!str.includes('e') && !str.includes('E')) {\n return str;\n }\n\n return PLAIN_FORMAT.format(num);\n}\n\nexport function getDigitParts({\n value,\n decimalScale,\n fixedDecimalScale,\n}: GetDigitPartsInput): DigitParts {\n const abs = Math.abs(value);\n let str = toPlainString(abs, decimalScale);\n\n if (!fixedDecimalScale && decimalScale !== undefined) {\n const parts = str.split('.');\n if (parts[1]) {\n const trimmed = parts[1].replace(/0+$/, '');\n str = trimmed ? `${parts[0]}.${trimmed}` : parts[0];\n }\n }\n\n const dotIdx = str.indexOf('.');\n const intStr = dotIdx >= 0 ? str.slice(0, dotIdx) : str;\n const fracStr = dotIdx >= 0 ? str.slice(dotIdx + 1) : '';\n\n const roundedToZero = !/[1-9]/.test(str);\n\n return {\n negative: value < 0 && !roundedToZero,\n intDigits: intStr.split(''),\n fracDigits: fracStr ? fracStr.split('') : [],\n hasDecimal: dotIdx >= 0,\n };\n}\n"],"mappings":";;AAaA,MAAM,eAAe,IAAI,KAAK,aAAa,SAAS;CAClD,aAAa;CACb,uBAAuB;AACzB,CAAC;AAED,SAAS,cAAc,KAAa,cAA+B;CACjE,IAAI,CAAC,OAAO,SAAS,GAAG,GACtB,OAAO;CAGT,IAAI,iBAAiB,KAAA,GACnB,OAAO,IAAI,KAAK,aAAa,SAAS;EACpC,aAAa;EACb,uBAAuB;EACvB,uBAAuB;CACzB,CAAC,CAAC,CAAC,OAAO,GAAG;CAGf,MAAM,MAAM,OAAO,GAAG;CACtB,IAAI,CAAC,IAAI,SAAS,GAAG,KAAK,CAAC,IAAI,SAAS,GAAG,GACzC,OAAO;CAGT,OAAO,aAAa,OAAO,GAAG;AAChC;AAEA,SAAgB,cAAc,EAC5B,OACA,cACA,qBACiC;CAEjC,IAAI,MAAM,cADE,KAAK,IAAI,KACK,GAAG,YAAY;CAEzC,IAAI,CAAC,qBAAqB,iBAAiB,KAAA,GAAW;EACpD,MAAM,QAAQ,IAAI,MAAM,GAAG;EAC3B,IAAI,MAAM,IAAI;GACZ,MAAM,UAAU,MAAM,EAAE,CAAC,QAAQ,OAAO,EAAE;GAC1C,MAAM,UAAU,GAAG,MAAM,GAAG,GAAG,YAAY,MAAM;EACnD;CACF;CAEA,MAAM,SAAS,IAAI,QAAQ,GAAG;CAC9B,MAAM,SAAS,UAAU,IAAI,IAAI,MAAM,GAAG,MAAM,IAAI;CACpD,MAAM,UAAU,UAAU,IAAI,IAAI,MAAM,SAAS,CAAC,IAAI;CAEtD,MAAM,gBAAgB,CAAC,QAAQ,KAAK,GAAG;CAEvC,OAAO;EACL,UAAU,QAAQ,KAAK,CAAC;EACxB,WAAW,OAAO,MAAM,EAAE;EAC1B,YAAY,UAAU,QAAQ,MAAM,EAAE,IAAI,CAAC;EAC3C,YAAY,UAAU;CACxB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.module.cjs","names":[],"sources":["../../../src/components/Slider/Slider.module.css"],"sourcesContent":[".root {\n --slider-size-xs: 4px;\n --slider-size-sm: 6px;\n --slider-size-md: 8px;\n --slider-size-lg: 10px;\n --slider-size-xl: 12px;\n\n --slider-size: var(--slider-size-md);\n --slider-radius: 1000px;\n --slider-color: var(--mantine-primary-color-filled);\n --slider-track-disabled-bg: var(--mantine-color-disabled);\n\n -webkit-tap-highlight-color: transparent;\n outline: none;\n height: calc(var(--slider-size) * 2);\n padding-inline: var(--slider-size);\n display: flex;\n flex-direction: column;\n align-items: center;\n touch-action: none;\n position: relative;\n\n @mixin light {\n --slider-track-bg: var(--mantine-color-gray-2);\n }\n\n @mixin dark {\n --slider-track-bg: var(--mantine-color-dark-4);\n }\n\n &[data-orientation='vertical'] {\n width: calc(var(--slider-size) * 2);\n height: 200px;\n padding-inline: 0;\n padding-block: var(--slider-size);\n }\n}\n\n.label {\n position: absolute;\n top: -36px;\n font-size: var(--mantine-font-size-xs);\n color: var(--mantine-color-white);\n padding: calc(var(--mantine-spacing-xs) / 2);\n border-radius: var(--mantine-radius-sm);\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n touch-action: none;\n\n @mixin where-light {\n background-color: var(--mantine-color-gray-9);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-4);\n }\n\n :where(.root[data-orientation='vertical']) & {\n top: auto;\n inset-inline-start: calc(100% + 8px);\n }\n}\n\n.thumb {\n position: absolute;\n display: flex;\n height: var(--slider-thumb-size);\n width: var(--slider-thumb-size);\n border: 4px solid;\n transform: translate(-50%, -50%);\n top: 50%;\n cursor: pointer;\n border-radius: var(--slider-radius);\n align-items: center;\n justify-content: center;\n transition:\n box-shadow 100ms ease,\n transform 100ms ease;\n z-index: 3;\n user-select: none;\n touch-action: none;\n outline-offset: 2px;\n left: var(--slider-thumb-offset);\n\n @mixin where-rtl {\n left: auto;\n right: calc(var(--slider-thumb-offset) - var(--slider-thumb-size));\n }\n\n fieldset:disabled &,\n &:where([data-disabled]) {\n display: none;\n }\n\n &:where([data-dragging]) {\n transform: translate(-50%, -50%) scale(1.05);\n box-shadow: var(--mantine-shadow-sm);\n }\n\n @mixin where-light {\n color: var(--slider-color);\n border-color: var(--slider-color);\n background-color: var(--mantine-color-white);\n }\n\n @mixin where-dark {\n color: var(--mantine-color-white);\n border-color: var(--mantine-color-white);\n background-color: var(--slider-color);\n }\n\n :where(.root[data-orientation='vertical']) & {\n left: 50%;\n top: auto;\n right: auto;\n bottom: var(--slider-thumb-offset);\n transform: translate(-50%, 50%);\n\n &:where([data-dragging]) {\n transform: translate(-50%, 50%) scale(1.05);\n }\n\n @mixin where-rtl {\n left: 50%;\n right: auto;\n }\n }\n}\n\n.trackContainer {\n display: flex;\n align-items: center;\n width: 100%;\n height: calc(var(--slider-size) * 2);\n cursor: pointer;\n\n fieldset:disabled &,\n &:where([data-disabled]) {\n cursor: not-allowed;\n }\n\n :where(.root[data-orientation='vertical']) & {\n flex-direction: column;\n width: calc(var(--slider-size) * 2);\n height: 100%;\n }\n}\n\n.track {\n position: relative;\n width: 100%;\n height: var(--slider-size);\n\n &:where([data-inverted]:not([data-disabled])) {\n --track-bg: var(--slider-color);\n }\n\n fieldset:disabled &:where([data-inverted]),\n &:where([data-inverted][data-disabled]) {\n --track-bg: var(--slider-track-disabled-bg);\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n border-radius: var(--slider-radius);\n inset-inline: calc(var(--slider-size) * -1);\n background-color: var(--track-bg, var(--slider-track-bg));\n z-index: 0;\n }\n\n :where(.root[data-orientation='vertical']) & {\n width: var(--slider-size);\n height: 100%;\n\n &::before {\n inset-inline: 0;\n top: calc(var(--slider-size) * -1);\n bottom: calc(var(--slider-size) * -1);\n }\n }\n}\n\n.bar {\n position: absolute;\n z-index: 1;\n top: 0;\n bottom: 0;\n background-color: var(--slider-color);\n border-radius: var(--slider-radius);\n width: var(--slider-bar-width);\n inset-inline-start: var(--slider-bar-offset);\n\n &:where([data-inverted]) {\n background-color: var(--slider-track-bg);\n }\n\n fieldset:disabled &:where(:not([data-inverted])),\n &:where([data-disabled]:not([data-inverted])) {\n background-color: var(--mantine-color-disabled-color);\n }\n\n :where(.root[data-orientation='vertical']) & {\n top: auto;\n bottom: var(--slider-bar-offset);\n inset-inline-start: 0;\n width: 100%;\n height: var(--slider-bar-width);\n }\n}\n\n.markWrapper {\n position: absolute;\n inset-inline-start: calc(var(--mark-offset) - var(--slider-size) / 2);\n top: 0;\n z-index: 2;\n height: 0;\n pointer-events: none;\n\n :where(.root[data-orientation='vertical']) & {\n inset-inline-start: 0;\n top: auto;\n bottom: calc(var(--mark-offset) + var(--slider-size) / 2);\n height: 0;\n width: 0;\n }\n}\n\n.mark {\n border: 2px solid;\n height: var(--slider-size);\n width: var(--slider-size);\n border-radius: 1000px;\n background-color: var(--mantine-color-white);\n pointer-events: none;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n\n &:where([data-filled]) {\n border-color: var(--slider-color);\n\n &:where([data-disabled]) {\n border-color: var(--mantine-color-disabled-border);\n }\n }\n}\n\n.markLabel {\n transform: translate(calc(-50% + var(--slider-size) / 2), calc(var(--mantine-spacing-xs) / 2));\n font-size: var(--mantine-font-size-sm);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n\n @mixin where-light {\n color: var(--mantine-color-gray-6);\n }\n\n @mixin where-dark {\n color: var(--mantine-color-dark-2);\n }\n\n :where(.root[data-orientation='vertical']) & {\n transform: translate(\n calc(var(--slider-size) + var(--mantine-spacing-xs) / 2),\n calc(-50% - var(--slider-size) / 2)\n );\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Slider.module.cjs","names":[],"sources":["../../../src/components/Slider/Slider.module.css"],"sourcesContent":[".root {\n --slider-size-xs: 4px;\n --slider-size-sm: 6px;\n --slider-size-md: 8px;\n --slider-size-lg: 10px;\n --slider-size-xl: 12px;\n\n --slider-size: var(--slider-size-md);\n --slider-radius: 1000px;\n --slider-color: var(--mantine-primary-color-filled);\n --slider-track-disabled-bg: var(--mantine-color-disabled);\n\n -webkit-tap-highlight-color: transparent;\n outline: none;\n height: calc(var(--slider-size) * 2);\n padding-inline: var(--slider-size);\n display: flex;\n flex-direction: column;\n align-items: center;\n touch-action: none;\n position: relative;\n\n @mixin light {\n --slider-track-bg: var(--mantine-color-gray-2);\n }\n\n @mixin dark {\n --slider-track-bg: var(--mantine-color-dark-4);\n }\n\n &[data-orientation='vertical'] {\n width: calc(var(--slider-size) * 2);\n height: 200px;\n padding-inline: 0;\n padding-block: var(--slider-size);\n }\n}\n\n.label {\n position: absolute;\n top: -36px;\n font-size: var(--mantine-font-size-xs);\n color: var(--mantine-color-white);\n padding: calc(var(--mantine-spacing-xs) / 2);\n border-radius: var(--mantine-radius-sm);\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n touch-action: none;\n\n @mixin where-light {\n background-color: var(--mantine-color-gray-9);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-4);\n }\n\n :where(.root[data-orientation='vertical']) & {\n top: auto;\n inset-inline-start: calc(100% + 8px);\n }\n}\n\n.thumb {\n position: absolute;\n display: flex;\n height: var(--slider-thumb-size);\n width: var(--slider-thumb-size);\n border: 4px solid;\n transform: translate(-50%, -50%);\n top: 50%;\n cursor: pointer;\n border-radius: var(--slider-radius);\n align-items: center;\n justify-content: center;\n transition:\n box-shadow 100ms ease,\n transform 100ms ease;\n z-index: 3;\n user-select: none;\n touch-action: none;\n outline-offset: 2px;\n left: var(--slider-thumb-offset);\n\n @mixin where-rtl {\n left: auto;\n right: calc(var(--slider-thumb-offset) - var(--slider-thumb-size));\n }\n\n fieldset:disabled &,\n &:where([data-disabled]) {\n display: none;\n }\n\n &:where([data-dragging]) {\n transform: translate(-50%, -50%) scale(1.05);\n box-shadow: var(--mantine-shadow-sm);\n }\n\n @mixin where-light {\n color: var(--slider-color);\n border-color: var(--slider-color);\n background-color: var(--mantine-color-white);\n }\n\n @mixin where-dark {\n color: var(--mantine-color-white);\n border-color: var(--mantine-color-white);\n background-color: var(--slider-color);\n }\n\n :where(.root[data-orientation='vertical']) & {\n left: 50%;\n top: auto;\n right: auto;\n bottom: var(--slider-thumb-offset);\n transform: translate(-50%, 50%);\n\n &:where([data-dragging]) {\n transform: translate(-50%, 50%) scale(1.05);\n }\n\n @mixin where-rtl {\n left: 50%;\n right: auto;\n }\n }\n}\n\n.trackContainer {\n display: flex;\n align-items: center;\n width: 100%;\n height: calc(var(--slider-size) * 2);\n cursor: pointer;\n\n fieldset:disabled &,\n &:where([data-disabled]) {\n cursor: not-allowed;\n }\n\n :where(.root[data-orientation='vertical']) & {\n flex-direction: column;\n width: calc(var(--slider-size) * 2);\n height: 100%;\n }\n}\n\n.track {\n position: relative;\n width: 100%;\n height: var(--slider-size);\n\n &:where([data-inverted]:not([data-disabled])) {\n --track-bg: var(--slider-color);\n }\n\n fieldset:disabled &:where([data-inverted]),\n &:where([data-inverted][data-disabled]) {\n --track-bg: var(--slider-track-disabled-bg);\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n border-radius: var(--slider-radius);\n inset-inline: calc(var(--slider-size) * -1);\n background-color: var(--track-bg, var(--slider-track-bg));\n z-index: 0;\n }\n\n :where(.root[data-orientation='vertical']) & {\n width: var(--slider-size);\n height: 100%;\n\n &::before {\n inset-inline: 0;\n top: calc(var(--slider-size) * -1);\n bottom: calc(var(--slider-size) * -1);\n }\n }\n}\n\n.bar {\n position: absolute;\n z-index: 1;\n top: 0;\n bottom: 0;\n background-color: var(--slider-color);\n border-radius: var(--slider-radius);\n width: var(--slider-bar-width);\n inset-inline-start: var(--slider-bar-offset);\n\n &:where([data-inverted]) {\n background-color: var(--slider-track-bg);\n }\n\n fieldset:disabled &:where(:not([data-inverted])),\n &:where([data-disabled]:not([data-inverted])) {\n background-color: var(--mantine-color-disabled-color);\n }\n\n :where(.root[data-orientation='vertical']) & {\n top: auto;\n bottom: var(--slider-bar-offset);\n inset-inline-start: 0;\n width: 100%;\n height: var(--slider-bar-width);\n }\n}\n\n.markWrapper {\n position: absolute;\n inset-inline-start: calc(var(--mark-offset) - var(--slider-size) / 2);\n top: 0;\n z-index: 2;\n height: 0;\n pointer-events: none;\n\n :where(.root[data-orientation='vertical']) & {\n inset-inline-start: 0;\n top: auto;\n bottom: calc(var(--mark-offset) + var(--slider-size) / 2);\n height: 0;\n width: 0;\n }\n}\n\n.mark {\n border: 2px solid;\n height: var(--slider-size);\n width: var(--slider-size);\n border-radius: 1000px;\n background-color: var(--mantine-color-white);\n pointer-events: none;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n\n &:where([data-filled]) {\n border-color: var(--slider-color);\n\n &:where([data-disabled]) {\n border-color: var(--mantine-color-disabled-border);\n }\n }\n}\n\n.markLabel {\n transform: translate(calc(-50% + var(--slider-size) / 2), calc(var(--mantine-spacing-xs) / 2));\n font-size: var(--mantine-font-size-sm);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n\n @mixin where-rtl {\n transform: translate(calc(50% - var(--slider-size) / 2), calc(var(--mantine-spacing-xs) / 2));\n }\n\n @mixin where-light {\n color: var(--mantine-color-gray-6);\n }\n\n @mixin where-dark {\n color: var(--mantine-color-dark-2);\n }\n\n :where(.root[data-orientation='vertical']) & {\n transform: translate(\n calc(var(--slider-size) + var(--mantine-spacing-xs) / 2),\n calc(-50% - var(--slider-size) / 2)\n );\n }\n}\n"],"mappings":""}
@@ -147,6 +147,7 @@ function TextareaAutosize({ maxRows, minRows, onChange, ref: userRef, ...props }
147
147
  return () => document.body.removeEventListener("reset", handleReset);
148
148
  }, [isControlled]);
149
149
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
150
+ rows: minRows,
150
151
  ...props,
151
152
  onChange: handleChange,
152
153
  ref