@mantine/core 7.0.0-alpha.13 → 7.0.0-alpha.14

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 (158) hide show
  1. package/cjs/components/Combobox/Combobox.context.js +13 -0
  2. package/cjs/components/Combobox/Combobox.context.js.map +1 -0
  3. package/cjs/components/Combobox/Combobox.js +139 -0
  4. package/cjs/components/Combobox/Combobox.js.map +1 -0
  5. package/cjs/components/Combobox/Combobox.module.css.js +8 -0
  6. package/cjs/components/Combobox/Combobox.module.css.js.map +1 -0
  7. package/cjs/components/Combobox/ComboboxChevron/ComboboxChevron.js +39 -19
  8. package/cjs/components/Combobox/ComboboxChevron/ComboboxChevron.js.map +1 -1
  9. package/cjs/components/Combobox/ComboboxDropdown/ComboboxDropdown.js +70 -0
  10. package/cjs/components/Combobox/ComboboxDropdown/ComboboxDropdown.js.map +1 -0
  11. package/cjs/components/Combobox/ComboboxEmpty/ComboboxEmpty.js +63 -0
  12. package/cjs/components/Combobox/ComboboxEmpty/ComboboxEmpty.js.map +1 -0
  13. package/cjs/components/Combobox/ComboboxOption/ComboboxOption.js +119 -0
  14. package/cjs/components/Combobox/ComboboxOption/ComboboxOption.js.map +1 -0
  15. package/cjs/components/Combobox/ComboboxOptions/ComboboxOptions.js +75 -0
  16. package/cjs/components/Combobox/ComboboxOptions/ComboboxOptions.js.map +1 -0
  17. package/cjs/components/Combobox/ComboboxSearch/ComboboxSearch.js +92 -0
  18. package/cjs/components/Combobox/ComboboxSearch/ComboboxSearch.js.map +1 -0
  19. package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.js +74 -0
  20. package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.js.map +1 -0
  21. package/cjs/components/Combobox/use-combobox/get-index/get-index.js +47 -0
  22. package/cjs/components/Combobox/use-combobox/get-index/get-index.js.map +1 -0
  23. package/cjs/components/Combobox/use-combobox/get-index/get-virtualized-index.js +57 -0
  24. package/cjs/components/Combobox/use-combobox/get-index/get-virtualized-index.js.map +1 -0
  25. package/cjs/components/Combobox/use-combobox/use-combobox.js +152 -0
  26. package/cjs/components/Combobox/use-combobox/use-combobox.js.map +1 -0
  27. package/cjs/components/Combobox/use-combobox/use-virtualized-combobox.js +125 -0
  28. package/cjs/components/Combobox/use-combobox/use-virtualized-combobox.js.map +1 -0
  29. package/cjs/components/Combobox/use-combobox-target-props/use-combobox-target-props.js +80 -0
  30. package/cjs/components/Combobox/use-combobox-target-props/use-combobox-target-props.js.map +1 -0
  31. package/cjs/components/Drawer/Drawer.context.js +13 -0
  32. package/cjs/components/Drawer/Drawer.context.js.map +1 -0
  33. package/cjs/components/Drawer/Drawer.js +95 -0
  34. package/cjs/components/Drawer/Drawer.js.map +1 -0
  35. package/cjs/components/Drawer/Drawer.module.css.js +8 -0
  36. package/cjs/components/Drawer/Drawer.module.css.js.map +1 -0
  37. package/cjs/components/Drawer/DrawerBody.js +60 -0
  38. package/cjs/components/Drawer/DrawerBody.js.map +1 -0
  39. package/cjs/components/Drawer/DrawerCloseButton.js +60 -0
  40. package/cjs/components/Drawer/DrawerCloseButton.js.map +1 -0
  41. package/cjs/components/Drawer/DrawerContent.js +67 -0
  42. package/cjs/components/Drawer/DrawerContent.js.map +1 -0
  43. package/cjs/components/Drawer/DrawerHeader.js +60 -0
  44. package/cjs/components/Drawer/DrawerHeader.js.map +1 -0
  45. package/cjs/components/Drawer/DrawerOverlay.js +60 -0
  46. package/cjs/components/Drawer/DrawerOverlay.js.map +1 -0
  47. package/cjs/components/Drawer/DrawerRoot.js +128 -0
  48. package/cjs/components/Drawer/DrawerRoot.js.map +1 -0
  49. package/cjs/components/Drawer/DrawerTitle.js +60 -0
  50. package/cjs/components/Drawer/DrawerTitle.js.map +1 -0
  51. package/cjs/components/Modal/Modal.js.map +1 -1
  52. package/cjs/components/Modal/ModalRoot.js +6 -3
  53. package/cjs/components/Modal/ModalRoot.js.map +1 -1
  54. package/cjs/components/ModalBase/ModalBase.js +7 -5
  55. package/cjs/components/ModalBase/ModalBase.js.map +1 -1
  56. package/cjs/components/Popover/Popover.js +1 -1
  57. package/cjs/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js +1 -1
  58. package/cjs/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js.map +1 -1
  59. package/cjs/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js +23 -2
  60. package/cjs/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js.map +1 -1
  61. package/cjs/index.css +283 -158
  62. package/cjs/index.js +44 -0
  63. package/cjs/index.js.map +1 -1
  64. package/esm/components/Combobox/Combobox.context.js +8 -0
  65. package/esm/components/Combobox/Combobox.context.js.map +1 -0
  66. package/esm/components/Combobox/Combobox.js +131 -0
  67. package/esm/components/Combobox/Combobox.js.map +1 -0
  68. package/esm/components/Combobox/Combobox.module.css.js +4 -0
  69. package/esm/components/Combobox/Combobox.module.css.js.map +1 -0
  70. package/esm/components/Combobox/ComboboxChevron/ComboboxChevron.js +39 -18
  71. package/esm/components/Combobox/ComboboxChevron/ComboboxChevron.js.map +1 -1
  72. package/esm/components/Combobox/ComboboxDropdown/ComboboxDropdown.js +62 -0
  73. package/esm/components/Combobox/ComboboxDropdown/ComboboxDropdown.js.map +1 -0
  74. package/esm/components/Combobox/ComboboxEmpty/ComboboxEmpty.js +55 -0
  75. package/esm/components/Combobox/ComboboxEmpty/ComboboxEmpty.js.map +1 -0
  76. package/esm/components/Combobox/ComboboxOption/ComboboxOption.js +111 -0
  77. package/esm/components/Combobox/ComboboxOption/ComboboxOption.js.map +1 -0
  78. package/esm/components/Combobox/ComboboxOptions/ComboboxOptions.js +67 -0
  79. package/esm/components/Combobox/ComboboxOptions/ComboboxOptions.js.map +1 -0
  80. package/esm/components/Combobox/ComboboxSearch/ComboboxSearch.js +84 -0
  81. package/esm/components/Combobox/ComboboxSearch/ComboboxSearch.js.map +1 -0
  82. package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.js +66 -0
  83. package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.js.map +1 -0
  84. package/esm/components/Combobox/use-combobox/get-index/get-index.js +41 -0
  85. package/esm/components/Combobox/use-combobox/get-index/get-index.js.map +1 -0
  86. package/esm/components/Combobox/use-combobox/get-index/get-virtualized-index.js +51 -0
  87. package/esm/components/Combobox/use-combobox/get-index/get-virtualized-index.js.map +1 -0
  88. package/esm/components/Combobox/use-combobox/use-combobox.js +148 -0
  89. package/esm/components/Combobox/use-combobox/use-combobox.js.map +1 -0
  90. package/esm/components/Combobox/use-combobox/use-virtualized-combobox.js +121 -0
  91. package/esm/components/Combobox/use-combobox/use-virtualized-combobox.js.map +1 -0
  92. package/esm/components/Combobox/use-combobox-target-props/use-combobox-target-props.js +76 -0
  93. package/esm/components/Combobox/use-combobox-target-props/use-combobox-target-props.js.map +1 -0
  94. package/esm/components/Drawer/Drawer.context.js +8 -0
  95. package/esm/components/Drawer/Drawer.context.js.map +1 -0
  96. package/esm/components/Drawer/Drawer.js +87 -0
  97. package/esm/components/Drawer/Drawer.js.map +1 -0
  98. package/esm/components/Drawer/Drawer.module.css.js +4 -0
  99. package/esm/components/Drawer/Drawer.module.css.js.map +1 -0
  100. package/esm/components/Drawer/DrawerBody.js +52 -0
  101. package/esm/components/Drawer/DrawerBody.js.map +1 -0
  102. package/esm/components/Drawer/DrawerCloseButton.js +52 -0
  103. package/esm/components/Drawer/DrawerCloseButton.js.map +1 -0
  104. package/esm/components/Drawer/DrawerContent.js +59 -0
  105. package/esm/components/Drawer/DrawerContent.js.map +1 -0
  106. package/esm/components/Drawer/DrawerHeader.js +52 -0
  107. package/esm/components/Drawer/DrawerHeader.js.map +1 -0
  108. package/esm/components/Drawer/DrawerOverlay.js +52 -0
  109. package/esm/components/Drawer/DrawerOverlay.js.map +1 -0
  110. package/esm/components/Drawer/DrawerRoot.js +120 -0
  111. package/esm/components/Drawer/DrawerRoot.js.map +1 -0
  112. package/esm/components/Drawer/DrawerTitle.js +52 -0
  113. package/esm/components/Drawer/DrawerTitle.js.map +1 -0
  114. package/esm/components/Modal/Modal.js.map +1 -1
  115. package/esm/components/Modal/ModalRoot.js +6 -3
  116. package/esm/components/Modal/ModalRoot.js.map +1 -1
  117. package/esm/components/ModalBase/ModalBase.js +7 -5
  118. package/esm/components/ModalBase/ModalBase.js.map +1 -1
  119. package/esm/components/Popover/Popover.js +1 -1
  120. package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js +1 -1
  121. package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js.map +1 -1
  122. package/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js +23 -2
  123. package/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js.map +1 -1
  124. package/esm/index.css +283 -158
  125. package/esm/index.js +22 -0
  126. package/esm/index.js.map +1 -1
  127. package/lib/components/Combobox/Combobox.context.d.ts +15 -0
  128. package/lib/components/Combobox/Combobox.d.ts +89 -0
  129. package/lib/components/Combobox/ComboboxChevron/ComboboxChevron.d.ts +20 -6
  130. package/lib/components/Combobox/ComboboxDropdown/ComboboxDropdown.d.ts +19 -0
  131. package/lib/components/Combobox/ComboboxEmpty/ComboboxEmpty.d.ts +16 -0
  132. package/lib/components/Combobox/ComboboxOption/ComboboxOption.d.ts +24 -0
  133. package/lib/components/Combobox/ComboboxOptions/ComboboxOptions.d.ts +16 -0
  134. package/lib/components/Combobox/ComboboxSearch/ComboboxSearch.d.ts +19 -0
  135. package/lib/components/Combobox/ComboboxTarget/ComboboxTarget.d.ts +22 -0
  136. package/lib/components/Combobox/index.d.ts +19 -0
  137. package/lib/components/Combobox/use-combobox/get-index/get-index.d.ts +3 -0
  138. package/lib/components/Combobox/use-combobox/get-index/get-virtualized-index.d.ts +14 -0
  139. package/lib/components/Combobox/use-combobox/use-combobox.d.ts +37 -0
  140. package/lib/components/Combobox/use-combobox/use-virtualized-combobox.d.ts +25 -0
  141. package/lib/components/Combobox/use-combobox-target-props/use-combobox-target-props.d.ts +24 -0
  142. package/lib/components/Drawer/Drawer.context.d.ts +13 -0
  143. package/lib/components/Drawer/Drawer.d.ts +59 -0
  144. package/lib/components/Drawer/DrawerBody.d.ts +17 -0
  145. package/lib/components/Drawer/DrawerCloseButton.d.ts +17 -0
  146. package/lib/components/Drawer/DrawerContent.d.ts +17 -0
  147. package/lib/components/Drawer/DrawerHeader.d.ts +17 -0
  148. package/lib/components/Drawer/DrawerOverlay.d.ts +17 -0
  149. package/lib/components/Drawer/DrawerRoot.d.ts +32 -0
  150. package/lib/components/Drawer/DrawerTitle.d.ts +17 -0
  151. package/lib/components/Drawer/index.d.ts +16 -0
  152. package/lib/components/Modal/Modal.d.ts +3 -2
  153. package/lib/components/Modal/ModalRoot.d.ts +1 -0
  154. package/lib/components/index.d.ts +2 -0
  155. package/lib/core/styles-api/index.d.ts +2 -0
  156. package/lib/core/styles-api/use-styles/get-style/get-theme-styles/get-theme-styles.d.ts +1 -2
  157. package/lib/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.d.ts +2 -3
  158. package/package.json +4 -4
@@ -0,0 +1,120 @@
1
+ import React from 'react';
2
+ import { DrawerProvider } from './Drawer.context.js';
3
+ import classes from './Drawer.module.css.js';
4
+ import { ModalBase } from '../ModalBase/ModalBase.js';
5
+ import { factory } from '../../core/factory/factory.js';
6
+ import { useProps } from '../../core/MantineProvider/use-props/use-props.js';
7
+ import { useStyles } from '../../core/styles-api/use-styles/use-styles.js';
8
+ import { getDefaultZIndex } from '../../core/utils/get-default-z-index/get-default-z-index.js';
9
+ import { createVarsResolver } from '../../core/styles-api/create-vars-resolver/create-vars-resolver.js';
10
+ import { getSize } from '../../core/utils/get-size/get-size.js';
11
+
12
+ var __defProp = Object.defineProperty;
13
+ var __defProps = Object.defineProperties;
14
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
15
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
16
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
18
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19
+ var __spreadValues = (a, b) => {
20
+ for (var prop in b || (b = {}))
21
+ if (__hasOwnProp.call(b, prop))
22
+ __defNormalProp(a, prop, b[prop]);
23
+ if (__getOwnPropSymbols)
24
+ for (var prop of __getOwnPropSymbols(b)) {
25
+ if (__propIsEnum.call(b, prop))
26
+ __defNormalProp(a, prop, b[prop]);
27
+ }
28
+ return a;
29
+ };
30
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
31
+ var __objRest = (source, exclude) => {
32
+ var target = {};
33
+ for (var prop in source)
34
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
35
+ target[prop] = source[prop];
36
+ if (source != null && __getOwnPropSymbols)
37
+ for (var prop of __getOwnPropSymbols(source)) {
38
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
39
+ target[prop] = source[prop];
40
+ }
41
+ return target;
42
+ };
43
+ const transitions = {
44
+ top: "slide-down",
45
+ bottom: "slide-up",
46
+ left: "slide-right",
47
+ right: "slide-left"
48
+ };
49
+ const defaultProps = {
50
+ closeOnClickOutside: true,
51
+ withinPortal: true,
52
+ lockScroll: true,
53
+ trapFocus: true,
54
+ returnFocus: true,
55
+ closeOnEscape: true,
56
+ keepMounted: false,
57
+ zIndex: getDefaultZIndex("modal"),
58
+ padding: "md",
59
+ size: "md",
60
+ shadow: "xl",
61
+ position: "left"
62
+ };
63
+ const varsResolver = createVarsResolver((_, { position, size }) => ({
64
+ root: {
65
+ "--drawer-size": getSize(size, "drawer-size"),
66
+ "--drawer-flex": position === "left" || position === "right" ? "0 0 var(--drawer-size)" : "0 0 100%",
67
+ "--drawer-height": position === "left" || position === "right" ? "100%" : "var(--drawer-size)",
68
+ "--drawer-align": position === "bottom" ? "flex-end" : "flex-start",
69
+ "--drawer-justify": position === "right" ? "flex-end" : "flex-start"
70
+ }
71
+ }));
72
+ const DrawerRoot = factory((_props, ref) => {
73
+ const props = useProps("DrawerRoot", defaultProps, _props);
74
+ const _a = props, {
75
+ classNames,
76
+ className,
77
+ style,
78
+ styles,
79
+ unstyled,
80
+ vars,
81
+ scrollAreaComponent,
82
+ position,
83
+ transitionProps
84
+ } = _a, others = __objRest(_a, [
85
+ "classNames",
86
+ "className",
87
+ "style",
88
+ "styles",
89
+ "unstyled",
90
+ "vars",
91
+ "scrollAreaComponent",
92
+ "position",
93
+ "transitionProps"
94
+ ]);
95
+ const getStyles = useStyles({
96
+ name: "Drawer",
97
+ classes,
98
+ props,
99
+ className,
100
+ style,
101
+ classNames,
102
+ styles,
103
+ unstyled,
104
+ vars,
105
+ varsResolver
106
+ });
107
+ return /* @__PURE__ */ React.createElement(DrawerProvider, { value: { scrollAreaComponent, getStyles } }, /* @__PURE__ */ React.createElement(
108
+ ModalBase,
109
+ __spreadValues(__spreadProps(__spreadValues({
110
+ ref
111
+ }, getStyles("root")), {
112
+ transitionProps: __spreadValues({ transition: transitions[position] }, transitionProps)
113
+ }), others)
114
+ ));
115
+ });
116
+ DrawerRoot.classes = classes;
117
+ DrawerRoot.displayName = "@mantine/core/DrawerRoot";
118
+
119
+ export { DrawerRoot };
120
+ //# sourceMappingURL=DrawerRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawerRoot.js","sources":["../../../src/components/Drawer/DrawerRoot.tsx"],"sourcesContent":["import React from 'react';\nimport {\n StylesApiProps,\n factory,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n getDefaultZIndex,\n getSize,\n} from '../../core';\nimport { MantineTransition } from '../Transition';\nimport { ModalBaseProps, ModalBase, ModalBaseStylesNames } from '../ModalBase';\nimport { DrawerProvider, ScrollAreaComponent } from './Drawer.context';\nimport classes from './Drawer.module.css';\n\ntype DrawerPosition = 'bottom' | 'left' | 'right' | 'top';\n\nexport type DrawerRootStylesNames = ModalBaseStylesNames;\nexport type DrawerRootVariant = string;\nexport type DrawerRootCssVariables = {\n root:\n | '--drawer-size'\n | '--drawer-flex'\n | '--drawer-height'\n | '--drawer-align'\n | '--drawer-justify';\n};\n\nexport interface DrawerRootProps extends StylesApiProps<DrawerRootFactory>, ModalBaseProps {\n /** Scroll area component, native `div` element by default */\n scrollAreaComponent?: ScrollAreaComponent;\n\n /** Side of the screen on which drawer will be opened, `'left'` by default */\n position?: DrawerPosition;\n}\n\nexport type DrawerRootFactory = Factory<{\n props: DrawerRootProps;\n ref: HTMLDivElement;\n stylesNames: DrawerRootStylesNames;\n vars: DrawerRootCssVariables;\n variant: DrawerRootVariant;\n compound: true;\n}>;\n\nconst transitions: Record<DrawerPosition, MantineTransition> = {\n top: 'slide-down',\n bottom: 'slide-up',\n left: 'slide-right',\n right: 'slide-left',\n};\n\nconst defaultProps: Partial<DrawerRootProps> = {\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n padding: 'md',\n size: 'md',\n shadow: 'xl',\n position: 'left',\n};\n\nconst varsResolver = createVarsResolver<DrawerRootFactory>((_, { position, size }) => ({\n root: {\n '--drawer-size': getSize(size, 'drawer-size'),\n '--drawer-flex':\n position === 'left' || position === 'right' ? '0 0 var(--drawer-size)' : '0 0 100%',\n '--drawer-height': position === 'left' || position === 'right' ? '100%' : 'var(--drawer-size)',\n '--drawer-align': position === 'bottom' ? 'flex-end' : 'flex-start',\n '--drawer-justify': position === 'right' ? 'flex-end' : 'flex-start',\n },\n}));\n\nexport const DrawerRoot = factory<DrawerRootFactory>((_props, ref) => {\n const props = useProps('DrawerRoot', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n scrollAreaComponent,\n position,\n transitionProps,\n ...others\n } = props;\n\n const getStyles = useStyles<DrawerRootFactory>({\n name: 'Drawer',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return (\n <DrawerProvider value={{ scrollAreaComponent, getStyles }}>\n <ModalBase\n ref={ref}\n {...getStyles('root')}\n transitionProps={{ transition: transitions[position!], ...transitionProps }}\n {...others}\n />\n </DrawerProvider>\n );\n});\n\nDrawerRoot.classes = classes;\nDrawerRoot.displayName = '@mantine/core/DrawerRoot';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC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AAI,IAAI;AACR,IAAI,mBAAmB;AACvB,IAAI,QAAQ;AACZ,IAAI,eAAe;AACnB,GAAG,GAAG,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE;AACjC,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,MAAM;AACV,IAAI,qBAAqB;AACzB,IAAI,UAAU;AACd,IAAI,iBAAiB;AACrB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;AAC9B,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,OAAO;AACX,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,kBAAkB,KAAK,CAAC,aAAa;AAC/I,IAAI,SAAS;AACb,IAAI,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC;AAChD,MAAM,GAAG;AACT,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE;AAC3B,MAAM,eAAe,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,eAAe,CAAC;AAC7F,KAAK,CAAC,EAAE,MAAM,CAAC;AACf,GAAG,CAAC,CAAC;AACL,CAAC,EAAE;AACH,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;AAC7B,UAAU,CAAC,WAAW,GAAG,0BAA0B;;;;"}
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { useDrawerContext } from './Drawer.context.js';
3
+ import classes from './Drawer.module.css.js';
4
+ import { ModalBaseTitle } from '../ModalBase/ModalBaseTitle.js';
5
+ import { factory } from '../../core/factory/factory.js';
6
+ import { useProps } from '../../core/MantineProvider/use-props/use-props.js';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ const defaultProps = {};
37
+ const DrawerTitle = factory((_props, ref) => {
38
+ const props = useProps("DrawerTitle", defaultProps, _props);
39
+ const _a = props, { classNames, className, style, styles, unstyled, vars } = _a, others = __objRest(_a, ["classNames", "className", "style", "styles", "unstyled", "vars"]);
40
+ const ctx = useDrawerContext();
41
+ return /* @__PURE__ */ React.createElement(
42
+ ModalBaseTitle,
43
+ __spreadValues(__spreadValues({
44
+ ref
45
+ }, ctx.getStyles("title", { classNames, style, styles, className })), others)
46
+ );
47
+ });
48
+ DrawerTitle.classes = classes;
49
+ DrawerTitle.displayName = "@mantine/core/DrawerTitle";
50
+
51
+ export { DrawerTitle };
52
+ //# sourceMappingURL=DrawerTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawerTitle.js","sources":["../../../src/components/Drawer/DrawerTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { StylesApiProps, factory, useProps, Factory } from '../../core';\nimport { ModalBaseTitle, ModalBaseTitleProps } from '../ModalBase';\nimport { useDrawerContext } from './Drawer.context';\nimport classes from './Drawer.module.css';\n\nexport type DrawerTitleStylesNames = 'title';\n\nexport interface DrawerTitleProps extends ModalBaseTitleProps, StylesApiProps<DrawerTitleFactory> {}\n\nexport type DrawerTitleFactory = Factory<{\n props: DrawerTitleProps;\n ref: HTMLHeadingElement;\n stylesNames: DrawerTitleStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<DrawerTitleProps> = {};\n\nexport const DrawerTitle = factory<DrawerTitleFactory>((_props, ref) => {\n const props = useProps('DrawerTitle', defaultProps, _props);\n const { classNames, className, style, styles, unstyled, vars, ...others } = props;\n\n const ctx = useDrawerContext();\n\n return (\n <ModalBaseTitle\n ref={ref}\n {...ctx.getStyles('title', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nDrawerTitle.classes = classes;\nDrawerTitle.displayName = '@mantine/core/DrawerTitle';\n"],"names":[],"mappings":";;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE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AC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC,KAAK;AACL,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAMF,MAAM,YAAY,GAAG,EAAE,CAAC;AACZ,MAAC,WAAW,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK;AACpD,EAAE,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AAC9D,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9K,EAAE,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;AACjC,EAAE,uBAAuB,KAAK,CAAC,aAAa;AAC5C,IAAI,cAAc;AAClB,IAAI,cAAc,CAAC,cAAc,CAAC;AAClC,MAAM,GAAG;AACT,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;AACjF,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;AAC9B,WAAW,CAAC,WAAW,GAAG,2BAA2B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import React from 'react';\nimport { factory, useProps, Factory, getDefaultZIndex } from '../../core';\nimport { ModalBaseOverlayProps, ModalBaseCloseButtonProps } from '../ModalBase';\nimport {\n ModalRoot,\n ModalRootProps,\n ModalRootCssVariables,\n ModalRootStylesNames,\n} from './ModalRoot';\nimport { ModalBody } from './ModalBody';\nimport { ModalCloseButton } from './ModalCloseButton';\nimport { ModalOverlay } from './ModalOverlay';\nimport { ModalContent } from './ModalContent';\nimport { ModalTitle } from './ModalTitle';\nimport { ModalHeader } from './ModalHeader';\nimport classes from './Modal.module.css';\n\nexport type ModalStylesNames = ModalRootStylesNames;\nexport type ModalVariant = string;\nexport type ModalCssVariables = ModalRootCssVariables;\n\nexport interface ModalProps extends ModalRootProps {\n /** Modal title */\n title?: React.ReactNode;\n\n /** Determines whether overlay should be rendered, `true` by default */\n withOverlay?: boolean;\n\n /** Props passed down to the `Overlay` component, use to configure opacity, `background-color`, styles and other properties */\n overlayProps?: ModalBaseOverlayProps;\n\n /** Modal content */\n children?: React.ReactNode;\n\n /** Determines whether close button should be rendered, `true` by default */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: ModalBaseCloseButtonProps;\n}\n\nexport type ModalFactory = Factory<{\n props: ModalProps;\n ref: HTMLDivElement;\n stylesNames: ModalStylesNames;\n vars: ModalCssVariables;\n variant: ModalVariant;\n staticComponents: {\n Root: typeof ModalRoot;\n Overlay: typeof ModalOverlay;\n Content: typeof ModalContent;\n Body: typeof ModalBody;\n Header: typeof ModalHeader;\n Title: typeof ModalTitle;\n CloseButton: typeof ModalCloseButton;\n };\n}>;\n\nconst defaultProps: Partial<ModalProps> = {\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n padding: 'md',\n size: 'md',\n shadow: 'xl',\n transitionProps: { duration: 200, transition: 'pop' },\n withOverlay: true,\n withCloseButton: true,\n};\n\nexport const Modal = factory<ModalFactory>((_props, ref) => {\n const {\n title,\n withOverlay,\n overlayProps,\n withCloseButton,\n closeButtonProps,\n children,\n ...others\n } = useProps('Modal', defaultProps, _props);\n\n const hasHeader = !!title || withCloseButton;\n\n return (\n <ModalRoot ref={ref} {...others}>\n {withOverlay && <ModalOverlay {...overlayProps} />}\n <ModalContent>\n {hasHeader && (\n <ModalHeader>\n {title && <ModalTitle>{title}</ModalTitle>}\n {withCloseButton && <ModalCloseButton {...closeButtonProps} />}\n </ModalHeader>\n )}\n\n <ModalBody>{children}</ModalBody>\n </ModalContent>\n </ModalRoot>\n );\n});\n\nModal.classes = classes;\nModal.displayName = '@mantine/core/Modal';\nModal.Root = ModalRoot;\nModal.Overlay = ModalOverlay;\nModal.Content = ModalContent;\nModal.Body = ModalBody;\nModal.Header = ModalHeader;\nModal.Title = ModalTitle;\nModal.CloseButton = ModalCloseButton;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB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CAAC,aAAa,CAAC,gBAAgB,EAAE,cAAc,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACljB,CAAC,EAAE;AACH,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,KAAK,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAC1C,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;AACvB,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC;AAC7B,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC;AAC7B,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;AACvB,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;AAC3B,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;AACzB,KAAK,CAAC,WAAW,GAAG,gBAAgB;;;;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import React from 'react';\nimport { factory, useProps, Factory, getDefaultZIndex } from '../../core';\nimport { ModalBaseOverlayProps, ModalBaseCloseButtonProps } from '../ModalBase';\nimport {\n ModalRoot,\n ModalRootProps,\n ModalRootCssVariables,\n ModalRootStylesNames,\n} from './ModalRoot';\nimport { ModalBody } from './ModalBody';\nimport { ModalCloseButton } from './ModalCloseButton';\nimport { ModalOverlay } from './ModalOverlay';\nimport { ModalContent } from './ModalContent';\nimport { ModalTitle } from './ModalTitle';\nimport { ModalHeader } from './ModalHeader';\nimport classes from './Modal.module.css';\n\nexport type ModalStylesNames = ModalRootStylesNames;\nexport type ModalVariant = string;\nexport type ModalCssVariables = ModalRootCssVariables;\n\nexport interface ModalProps extends ModalRootProps {\n __staticSelector?: string;\n\n /** Modal title */\n title?: React.ReactNode;\n\n /** Determines whether the overlay should be rendered, `true` by default */\n withOverlay?: boolean;\n\n /** Props passed down to the `Overlay` component, use to configure opacity, `background-color`, styles and other properties */\n overlayProps?: ModalBaseOverlayProps;\n\n /** Modal content */\n children?: React.ReactNode;\n\n /** Determines whether the close button should be rendered, `true` by default */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: ModalBaseCloseButtonProps;\n}\n\nexport type ModalFactory = Factory<{\n props: ModalProps;\n ref: HTMLDivElement;\n stylesNames: ModalStylesNames;\n vars: ModalCssVariables;\n variant: ModalVariant;\n staticComponents: {\n Root: typeof ModalRoot;\n Overlay: typeof ModalOverlay;\n Content: typeof ModalContent;\n Body: typeof ModalBody;\n Header: typeof ModalHeader;\n Title: typeof ModalTitle;\n CloseButton: typeof ModalCloseButton;\n };\n}>;\n\nconst defaultProps: Partial<ModalProps> = {\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n padding: 'md',\n size: 'md',\n shadow: 'xl',\n transitionProps: { duration: 200, transition: 'pop' },\n withOverlay: true,\n withCloseButton: true,\n};\n\nexport const Modal = factory<ModalFactory>((_props, ref) => {\n const {\n title,\n withOverlay,\n overlayProps,\n withCloseButton,\n closeButtonProps,\n children,\n ...others\n } = useProps('Modal', defaultProps, _props);\n\n const hasHeader = !!title || withCloseButton;\n\n return (\n <ModalRoot ref={ref} {...others}>\n {withOverlay && <ModalOverlay {...overlayProps} />}\n <ModalContent>\n {hasHeader && (\n <ModalHeader>\n {title && <ModalTitle>{title}</ModalTitle>}\n {withCloseButton && <ModalCloseButton {...closeButtonProps} />}\n </ModalHeader>\n )}\n\n <ModalBody>{children}</ModalBody>\n </ModalContent>\n </ModalRoot>\n );\n});\n\nModal.classes = classes;\nModal.displayName = '@mantine/core/Modal';\nModal.Root = ModalRoot;\nModal.Overlay = ModalOverlay;\nModal.Content = ModalContent;\nModal.Body = ModalBody;\nModal.Header = ModalHeader;\nModal.Title = ModalTitle;\nModal.CloseButton = ModalCloseButton;\n"],"names":[],"m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B,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;AACvB,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;AAC3B,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;AACzB,KAAK,CAAC,WAAW,GAAG,gBAAgB;;;;"}
@@ -42,6 +42,7 @@ var __objRest = (source, exclude) => {
42
42
  return target;
43
43
  };
44
44
  const defaultProps = {
45
+ __staticSelector: "Modal",
45
46
  yOffset: "5vh",
46
47
  xOffset: "5vw",
47
48
  closeOnClickOutside: true,
@@ -81,7 +82,8 @@ const ModalRoot = factory((_props, ref) => {
81
82
  radius,
82
83
  fullScreen,
83
84
  centered,
84
- xOffset
85
+ xOffset,
86
+ __staticSelector
85
87
  } = _a, others = __objRest(_a, [
86
88
  "classNames",
87
89
  "className",
@@ -94,10 +96,11 @@ const ModalRoot = factory((_props, ref) => {
94
96
  "radius",
95
97
  "fullScreen",
96
98
  "centered",
97
- "xOffset"
99
+ "xOffset",
100
+ "__staticSelector"
98
101
  ]);
99
102
  const getStyles = useStyles({
100
- name: "Modal",
103
+ name: __staticSelector,
101
104
  classes,
102
105
  props,
103
106
  className,
@@ -1 +1 @@
1
- {"version":3,"file":"ModalRoot.js","sources":["../../../src/components/Modal/ModalRoot.tsx"],"sourcesContent":["import React from 'react';\nimport {\n StylesApiProps,\n factory,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n MantineRadius,\n getRadius,\n getDefaultZIndex,\n getSize,\n rem,\n} from '../../core';\nimport { ModalBaseProps, ModalBase, ModalBaseStylesNames } from '../ModalBase';\nimport { ModalProvider, ScrollAreaComponent } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalRootStylesNames = ModalBaseStylesNames;\nexport type ModalRootVariant = string;\nexport type ModalRootCssVariables = {\n root: '--modal-radius' | '--modal-size' | '--modal-y-offset' | '--modal-x-offset';\n};\n\nexport interface ModalRootProps extends StylesApiProps<ModalRootFactory>, ModalBaseProps {\n /** Top/bottom modal offset, `5vh` by default */\n yOffset?: React.CSSProperties['marginTop'];\n\n /** Left/right modal offset, `5vw` by default */\n xOffset?: React.CSSProperties['marginLeft'];\n\n /** Scroll area component, native `div` element by default */\n scrollAreaComponent?: ScrollAreaComponent;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, `theme.defaultRadius` by default */\n radius?: MantineRadius | (string & {}) | number;\n\n /** Determines whether the modal should be centered vertically, `false` by default */\n centered?: boolean;\n\n /** Determines whether the modal should take the entire screen, `false` by default */\n fullScreen?: boolean;\n}\n\nexport type ModalRootFactory = Factory<{\n props: ModalRootProps;\n ref: HTMLDivElement;\n stylesNames: ModalRootStylesNames;\n vars: ModalRootCssVariables;\n variant: ModalRootVariant;\n compound: true;\n}>;\n\nconst defaultProps: Partial<ModalRootProps> = {\n yOffset: '5vh',\n xOffset: '5vw',\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n padding: 'md',\n size: 'md',\n shadow: 'xl',\n transitionProps: { duration: 200, transition: 'pop' },\n};\n\nconst varsResolver = createVarsResolver<ModalRootFactory>(\n (_, { radius, size, yOffset, xOffset }) => ({\n root: {\n '--modal-radius': getRadius(radius),\n '--modal-size': getSize(size, 'modal-size'),\n '--modal-y-offset': rem(yOffset),\n '--modal-x-offset': rem(xOffset),\n },\n })\n);\n\nexport const ModalRoot = factory<ModalRootFactory>((_props, ref) => {\n const props = useProps('ModalRoot', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n yOffset,\n scrollAreaComponent,\n radius,\n fullScreen,\n centered,\n xOffset,\n ...others\n } = props;\n\n const getStyles = useStyles<ModalRootFactory>({\n name: 'Modal',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return (\n <ModalProvider value={{ yOffset, scrollAreaComponent, getStyles }}>\n <ModalBase\n ref={ref}\n {...getStyles('root')}\n data-full-screen={fullScreen || undefined}\n data-centered={centered || undefined}\n {...others}\n />\n </ModalProvider>\n );\n});\n\nModalRoot.classes = classes;\nModalRoot.displayName = '@mantine/core/ModalRoot';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,E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ACb,IAAI,qBAAqB;AACzB,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,UAAU;AACd,IAAI,SAAS;AACb,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;AAC9B,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO;AACX,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,kBAAkB,KAAK,CAAC,aAAa;AACvJ,IAAI,SAAS;AACb,IAAI,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC;AAChD,MAAM,GAAG;AACT,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE;AAC3B,MAAM,kBAAkB,EAAE,UAAU,IAAI,KAAK,CAAC;AAC9C,MAAM,eAAe,EAAE,QAAQ,IAAI,KAAK,CAAC;AACzC,KAAK,CAAC,EAAE,MAAM,CAAC;AACf,GAAG,CAAC,CAAC;AACL,CAAC,EAAE;AACH,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC5B,SAAS,CAAC,WAAW,GAAG,yBAAyB;;;;"}
1
+ {"version":3,"file":"ModalRoot.js","sources":["../../../src/components/Modal/ModalRoot.tsx"],"sourcesContent":["import React from 'react';\nimport {\n StylesApiProps,\n factory,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n MantineRadius,\n getRadius,\n getDefaultZIndex,\n getSize,\n rem,\n} from '../../core';\nimport { ModalBaseProps, ModalBase, ModalBaseStylesNames } from '../ModalBase';\nimport { ModalProvider, ScrollAreaComponent } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalRootStylesNames = ModalBaseStylesNames;\nexport type ModalRootVariant = string;\nexport type ModalRootCssVariables = {\n root: '--modal-radius' | '--modal-size' | '--modal-y-offset' | '--modal-x-offset';\n};\n\nexport interface ModalRootProps extends StylesApiProps<ModalRootFactory>, ModalBaseProps {\n __staticSelector?: string;\n\n /** Top/bottom modal offset, `5vh` by default */\n yOffset?: React.CSSProperties['marginTop'];\n\n /** Left/right modal offset, `5vw` by default */\n xOffset?: React.CSSProperties['marginLeft'];\n\n /** Scroll area component, native `div` element by default */\n scrollAreaComponent?: ScrollAreaComponent;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, `theme.defaultRadius` by default */\n radius?: MantineRadius | (string & {}) | number;\n\n /** Determines whether the modal should be centered vertically, `false` by default */\n centered?: boolean;\n\n /** Determines whether the modal should take the entire screen, `false` by default */\n fullScreen?: boolean;\n}\n\nexport type ModalRootFactory = Factory<{\n props: ModalRootProps;\n ref: HTMLDivElement;\n stylesNames: ModalRootStylesNames;\n vars: ModalRootCssVariables;\n variant: ModalRootVariant;\n compound: true;\n}>;\n\nconst defaultProps: Partial<ModalRootProps> = {\n __staticSelector: 'Modal',\n yOffset: '5vh',\n xOffset: '5vw',\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n padding: 'md',\n size: 'md',\n shadow: 'xl',\n transitionProps: { duration: 200, transition: 'pop' },\n};\n\nconst varsResolver = createVarsResolver<ModalRootFactory>(\n (_, { radius, size, yOffset, xOffset }) => ({\n root: {\n '--modal-radius': getRadius(radius),\n '--modal-size': getSize(size, 'modal-size'),\n '--modal-y-offset': rem(yOffset),\n '--modal-x-offset': rem(xOffset),\n },\n })\n);\n\nexport const ModalRoot = factory<ModalRootFactory>((_props, ref) => {\n const props = useProps('ModalRoot', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n yOffset,\n scrollAreaComponent,\n radius,\n fullScreen,\n centered,\n xOffset,\n __staticSelector,\n ...others\n } = props;\n\n const getStyles = useStyles<ModalRootFactory>({\n name: __staticSelector!,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return (\n <ModalProvider value={{ yOffset, scrollAreaComponent, getStyles }}>\n <ModalBase\n ref={ref}\n {...getStyles('root')}\n data-full-screen={fullScreen || undefined}\n data-centered={centered || undefined}\n {...others}\n />\n </ModalProvider>\n );\n});\n\nModalRoot.classes = classes;\nModalRoot.displayName = '@mantine/core/ModalRoot';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,E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AyB;;;;"}
@@ -3,9 +3,9 @@ import { RemoveScroll } from 'react-remove-scroll';
3
3
  import { ModalBaseProvider } from './ModalBase.context.js';
4
4
  import { useModal } from './use-modal.js';
5
5
  import { OptionalPortal } from '../Portal/OptionalPortal.js';
6
- import { getShadow, getSpacing } from '../../core/utils/get-size/get-size.js';
7
6
  import { Box } from '../../core/Box/Box.js';
8
7
  import { getDefaultZIndex } from '../../core/utils/get-default-z-index/get-default-z-index.js';
8
+ import { getShadow, getSpacing } from '../../core/utils/get-size/get-size.js';
9
9
 
10
10
  var __defProp = Object.defineProperty;
11
11
  var __defProps = Object.defineProperties;
@@ -56,7 +56,8 @@ const ModalBase = forwardRef(
56
56
  children,
57
57
  zIndex,
58
58
  shadow,
59
- padding
59
+ padding,
60
+ __vars
60
61
  } = _b, others = __objRest(_b, [
61
62
  "keepMounted",
62
63
  "opened",
@@ -73,7 +74,8 @@ const ModalBase = forwardRef(
73
74
  "children",
74
75
  "zIndex",
75
76
  "shadow",
76
- "padding"
77
+ "padding",
78
+ "__vars"
77
79
  ]);
78
80
  const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } = useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });
79
81
  return /* @__PURE__ */ React.createElement(OptionalPortal, __spreadProps(__spreadValues({}, portalProps), { withinPortal }), /* @__PURE__ */ React.createElement(
@@ -100,11 +102,11 @@ const ModalBase = forwardRef(
100
102
  __spreadProps(__spreadValues({
101
103
  ref
102
104
  }, others), {
103
- __vars: {
105
+ __vars: __spreadProps(__spreadValues({}, __vars), {
104
106
  "--mb-z-index": (zIndex || getDefaultZIndex("modal")).toString(),
105
107
  "--mb-shadow": getShadow(shadow),
106
108
  "--mb-padding": getSpacing(padding)
107
- }
109
+ })
108
110
  }),
109
111
  children
110
112
  ))
@@ -1 +1 @@
1
- {"version":3,"file":"ModalBase.js","sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n} from '../../core';\nimport { OptionalPortal, PortalProps } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n /** If set modal/drawer will not be unmounted from the DOM when it is hidden, `display: none` styles will be added instead, `false` by default */\n keepMounted?: boolean;\n\n /** Determines whether modal/drawer is opened */\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 /** Determines whether scroll should be locked when `opened={true}`, `true` by default */\n lockScroll?: boolean;\n\n /** Determines whether focus should be trapped, `true` by default */\n trapFocus?: boolean;\n\n /** Determines whether the component should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** Determines whether the modal/drawer should be closed when user clicks on the overlay, `true` by default */\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: 'pop' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Determines whether `onClose` should be called when user presses the escape key, `true` by default */\n closeOnEscape?: boolean;\n\n /** Determines whether focus should be returned to the last active element when `onClose` is called, `true` by default */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element, `200` by default */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Key of `theme.shadows` or any valid CSS box-shadow value, 'xl' by default */\n shadow?: MantineShadow | (string & {});\n\n /** Key of `theme.spacing` or any valid CSS value to set content, header and footer padding, `'md'` by default */\n padding?: MantineSpacing | (string & {}) | number;\n\n /** Controls width of the content area, `'md'` by default */\n size?: MantineSize | (string & {}) | number;\n}\n\nexport const ModalBase = forwardRef<HTMLDivElement, ModalBaseProps>(\n (\n {\n keepMounted,\n opened,\n onClose,\n id,\n transitionProps,\n trapFocus,\n closeOnEscape,\n returnFocus,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n lockScroll,\n children,\n zIndex,\n shadow,\n padding,\n ...others\n },\n ref\n ) => {\n const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =\n useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <ModalBaseProvider\n value={{\n opened,\n onClose,\n closeOnClickOutside,\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 }}\n >\n <RemoveScroll enabled={shouldLockScroll && lockScroll}>\n <Box\n ref={ref}\n {...others}\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);\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAA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AAY,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC;AAC/C,WAAW;AACX,SAAS,CAAC;AACV,QAAQ,QAAQ;AAChB,OAAO,CAAC;AACR,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"ModalBase.js","sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n} from '../../core';\nimport { OptionalPortal, PortalProps } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n /** If set modal/drawer will not be unmounted from the DOM when it is hidden, `display: none` styles will be added instead, `false` by default */\n keepMounted?: boolean;\n\n /** Determines whether modal/drawer is opened */\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 /** Determines whether scroll should be locked when `opened={true}`, `true` by default */\n lockScroll?: boolean;\n\n /** Determines whether focus should be trapped, `true` by default */\n trapFocus?: boolean;\n\n /** Determines whether the component should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** Determines whether the modal/drawer should be closed when user clicks on the overlay, `true` by default */\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: 'pop' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Determines whether `onClose` should be called when user presses the escape key, `true` by default */\n closeOnEscape?: boolean;\n\n /** Determines whether focus should be returned to the last active element when `onClose` is called, `true` by default */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element, `200` by default */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Key of `theme.shadows` or any valid CSS box-shadow value, 'xl' by default */\n shadow?: MantineShadow | (string & {});\n\n /** Key of `theme.spacing` or any valid CSS value to set content, header and footer padding, `'md'` by default */\n padding?: MantineSpacing | (string & {}) | number;\n\n /** Controls width of the content area, `'md'` by default */\n size?: MantineSize | (string & {}) | number;\n}\n\nexport const ModalBase = forwardRef<HTMLDivElement, ModalBaseProps>(\n (\n {\n keepMounted,\n opened,\n onClose,\n id,\n transitionProps,\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 ...others\n },\n ref\n ) => {\n const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =\n useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <ModalBaseProvider\n value={{\n opened,\n onClose,\n closeOnClickOutside,\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 }}\n >\n <RemoveScroll enabled={shouldLockScroll && lockScroll}>\n <Box\n ref={ref}\n {...others}\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);\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iB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CAAC,aAAa;AACxI,QAAQ,GAAG;AACX,QAAQ,aAAa,CAAC,cAAc,CAAC;AACrC,UAAU,GAAG;AACb,SAAS,EAAE,MAAM,CAAC,EAAE;AACpB,UAAU,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE;AAC5D,YAAY,cAAc,EAAE,CAAC,MAAM,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE;AAC5E,YAAY,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC;AAC5C,YAAY,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC;AAC/C,WAAW,CAAC;AACZ,SAAS,CAAC;AACV,QAAQ,QAAQ;AAChB,OAAO,CAAC;AACR,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
@@ -6,12 +6,12 @@ import { PopoverTarget } from './PopoverTarget/PopoverTarget.js';
6
6
  import { PopoverDropdown } from './PopoverDropdown/PopoverDropdown.js';
7
7
  import classes from './Popover.module.css.js';
8
8
  import { getFloatingPosition } from '../Floating/get-floating-position/get-floating-position.js';
9
+ import { getRadius, getShadow } from '../../core/utils/get-size/get-size.js';
9
10
  import { useProps } from '../../core/MantineProvider/use-props/use-props.js';
10
11
  import { useStyles } from '../../core/styles-api/use-styles/use-styles.js';
11
12
  import { useDirection } from '../../core/DirectionProvider/DirectionProvider.js';
12
13
  import { getDefaultZIndex } from '../../core/utils/get-default-z-index/get-default-z-index.js';
13
14
  import { createVarsResolver } from '../../core/styles-api/create-vars-resolver/create-vars-resolver.js';
14
- import { getRadius, getShadow } from '../../core/utils/get-size/get-size.js';
15
15
 
16
16
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
17
17
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -3,7 +3,7 @@ import { MantineContext } from '../Mantine.context.js';
3
3
 
4
4
  function disableTransition() {
5
5
  const style = document.createElement("style");
6
- style.innerHTML = "* {transition: none !important;}";
6
+ style.innerHTML = "*, *::before, *::after {transition: none !important;}";
7
7
  style.setAttribute("data-mantine-disable-transition", "true");
8
8
  document.head.appendChild(style);
9
9
  const clear = () => document.querySelectorAll("[data-mantine-disable-transition]").forEach((element) => element.remove());
@@ -1 +1 @@
1
- {"version":3,"file":"use-mantine-color-scheme.js","sources":["../../../../src/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.ts"],"sourcesContent":["import { useContext, useEffect, useRef } from 'react';\nimport { MantineContext } from '../Mantine.context';\nimport { MantineColorScheme } from '../theme.types';\n\nfunction disableTransition() {\n const style = document.createElement('style');\n style.innerHTML = '* {transition: none !important;}';\n style.setAttribute('data-mantine-disable-transition', 'true');\n document.head.appendChild(style);\n const clear = () =>\n document\n .querySelectorAll('[data-mantine-disable-transition]')\n .forEach((element) => element.remove());\n return clear;\n}\n\nexport function useMantineColorScheme() {\n const clearStylesRef = useRef<() => void>();\n const timeoutRef = useRef<number>();\n const ctx = useContext(MantineContext);\n\n if (!ctx) {\n throw new Error('[@mantine/core] MantineProvider was not found in tree');\n }\n\n const setColorScheme = (value: MantineColorScheme) => {\n ctx.setColorScheme(value);\n clearStylesRef.current = disableTransition();\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => {\n clearStylesRef.current?.();\n }, 10);\n };\n\n const clearColorScheme = () => {\n ctx.clearColorScheme();\n clearStylesRef.current = disableTransition();\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => {\n clearStylesRef.current?.();\n }, 10);\n };\n\n useEffect(\n () => () => {\n clearStylesRef.current?.();\n window.clearTimeout(timeoutRef.current);\n },\n []\n );\n\n return {\n colorScheme: ctx.colorScheme,\n setColorScheme,\n clearColorScheme,\n };\n}\n"],"names":[],"mappings":";;;AAEA,SAAS,iBAAiB,GAAG;AAC7B,EAAE,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAChD,EAAE,KAAK,CAAC,SAAS,GAAG,kCAAkC,CAAC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O,GAAG,iBAAiB,EAAE,CAAC;AACjD,IAAI,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC5C,IAAI,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM;AACjD,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,CAAC,EAAE,GAAG,cAAc,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC/E,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,GAAG,CAAC;AACJ,EAAE,SAAS;AACX,IAAI,MAAM,MAAM;AAChB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,CAAC,EAAE,GAAG,cAAc,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC/E,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC9C,KAAK;AACL,IAAI,EAAE;AACN,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,WAAW,EAAE,GAAG,CAAC,WAAW;AAChC,IAAI,cAAc;AAClB,IAAI,gBAAgB;AACpB,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"use-mantine-color-scheme.js","sources":["../../../../src/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.ts"],"sourcesContent":["import { useContext, useEffect, useRef } from 'react';\nimport { MantineContext } from '../Mantine.context';\nimport { MantineColorScheme } from '../theme.types';\n\nfunction disableTransition() {\n const style = document.createElement('style');\n style.innerHTML = '*, *::before, *::after {transition: none !important;}';\n style.setAttribute('data-mantine-disable-transition', 'true');\n document.head.appendChild(style);\n const clear = () =>\n document\n .querySelectorAll('[data-mantine-disable-transition]')\n .forEach((element) => element.remove());\n return clear;\n}\n\nexport function useMantineColorScheme() {\n const clearStylesRef = useRef<() => void>();\n const timeoutRef = useRef<number>();\n const ctx = useContext(MantineContext);\n\n if (!ctx) {\n throw new Error('[@mantine/core] MantineProvider was not found in tree');\n }\n\n const setColorScheme = (value: MantineColorScheme) => {\n ctx.setColorScheme(value);\n clearStylesRef.current = disableTransition();\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => {\n clearStylesRef.current?.();\n }, 10);\n };\n\n const clearColorScheme = () => {\n ctx.clearColorScheme();\n clearStylesRef.current = disableTransition();\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => {\n clearStylesRef.current?.();\n }, 10);\n };\n\n useEffect(\n () => () => {\n clearStylesRef.current?.();\n window.clearTimeout(timeoutRef.current);\n },\n []\n );\n\n return {\n colorScheme: ctx.colorScheme,\n setColorScheme,\n clearColorScheme,\n };\n}\n"],"names":[],"mappings":";;;AAEA,SAAS,iBAAiB,GAAG;AAC7B,EAAE,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAChD,EAAE,KAAK,CAAC,SAAS,GAAG,uDAAuD,CAAC;AAC5E,EAAE,KAAK,CAAC,YAAY,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;AAChE,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,EAAE,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,gBAAgB,CAAC,mCAAmC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5H,EAAE,OAAO,KAAK,CAAC;AACf,CAAC;AACM,SAAS,qBAAqB,GAAG;AACxC,EAAE,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC;AAClC,EAAE,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;AAC9B,EAAE,MAAM,GAAG,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;AACzC,EAAE,IAAI,CAAC,GAAG,EAAE;AACZ,IAA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AC,CAAC;AAC/E,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC9C,KAAK;AACL,IAAI,EAAE;AACN,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,WAAW,EAAE,GAAG,CAAC,WAAW;AAChC,IAAI,cAAc;AAClB,IAAI,gBAAgB;AACpB,GAAG,CAAC;AACJ;;;;"}
@@ -1,6 +1,27 @@
1
- const emptyStyles = {};
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
2
17
  function resolveStyles({ theme, styles, props, stylesCtx }) {
3
- return typeof styles === "function" ? styles(theme, props, stylesCtx) : styles || emptyStyles;
18
+ const arrayStyles = Array.isArray(styles) ? styles : [styles];
19
+ return arrayStyles.reduce((acc, style) => {
20
+ if (typeof style === "function") {
21
+ return __spreadValues(__spreadValues({}, acc), style(theme, props, stylesCtx));
22
+ }
23
+ return __spreadValues(__spreadValues({}, acc), style);
24
+ }, {});
4
25
  }
5
26
 
6
27
  export { resolveStyles };
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-styles.js","sources":["../../../../../../src/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nimport type { MantineTheme } from '../../../../MantineProvider';\nimport type { _Styles } from '../get-style';\n\nexport interface ResolveStylesInput {\n theme: MantineTheme;\n styles: _Styles;\n props: Record<string, any>;\n stylesCtx: Record<string, any> | undefined;\n}\n\nconst emptyStyles: Record<string, CSSProperties> = {};\n\nexport function resolveStyles({ theme, styles, props, stylesCtx }: ResolveStylesInput) {\n return typeof styles === 'function' ? styles(theme, props, stylesCtx) : styles || emptyStyles;\n}\n"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,EAAE,CAAC;AAChB,SAAS,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;AACnE,EAAE,OAAO,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,GAAG,MAAM,IAAI,WAAW,CAAC;AAChG;;;;"}
1
+ {"version":3,"file":"resolve-styles.js","sources":["../../../../../../src/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.ts"],"sourcesContent":["import type { MantineTheme } from '../../../../MantineProvider';\nimport type { _Styles } from '../get-style';\n\nexport interface ResolveStylesInput {\n theme: MantineTheme;\n styles: _Styles | _Styles[];\n props: Record<string, any>;\n stylesCtx: Record<string, any> | undefined;\n}\n\nexport function resolveStyles({ theme, styles, props, stylesCtx }: ResolveStylesInput) {\n const arrayStyles = Array.isArray(styles) ? styles : [styles];\n\n return arrayStyles.reduce<Record<string, any>>((acc, style) => {\n if (typeof style === 'function') {\n return { ...acc, ...style(theme, props, stylesCtx) };\n }\n\n return { ...acc, ...style };\n }, {});\n}\n"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG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