@fluentui/react-dialog 9.0.0-beta.7 → 9.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.json +189 -5
  2. package/CHANGELOG.md +44 -6
  3. package/Spec.md +44 -25
  4. package/dist/index.d.ts +99 -55
  5. package/lib/Dialog.js.map +1 -1
  6. package/lib/DialogActions.js.map +1 -1
  7. package/lib/DialogBody.js.map +1 -1
  8. package/lib/DialogContent.js +2 -0
  9. package/lib/DialogContent.js.map +1 -0
  10. package/lib/DialogSurface.js.map +1 -1
  11. package/lib/DialogTitle.js.map +1 -1
  12. package/lib/DialogTrigger.js.map +1 -1
  13. package/lib/components/Dialog/Dialog.js +0 -2
  14. package/lib/components/Dialog/Dialog.js.map +1 -1
  15. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  16. package/lib/components/Dialog/index.js +0 -1
  17. package/lib/components/Dialog/index.js.map +1 -1
  18. package/lib/components/Dialog/renderDialog.js +2 -10
  19. package/lib/components/Dialog/renderDialog.js.map +1 -1
  20. package/lib/components/Dialog/useDialog.js +19 -129
  21. package/lib/components/Dialog/useDialog.js.map +1 -1
  22. package/lib/components/Dialog/useDialogContextValues.js +4 -4
  23. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  24. package/lib/components/DialogActions/DialogActions.js.map +1 -1
  25. package/lib/components/DialogActions/DialogActions.types.js.map +1 -1
  26. package/lib/components/DialogActions/index.js.map +1 -1
  27. package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
  28. package/lib/components/DialogActions/useDialogActions.js.map +1 -1
  29. package/lib/components/DialogActions/useDialogActionsStyles.js +3 -5
  30. package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  31. package/lib/components/DialogBody/DialogBody.js.map +1 -1
  32. package/lib/components/DialogBody/DialogBody.types.js.map +1 -1
  33. package/lib/components/DialogBody/index.js.map +1 -1
  34. package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
  35. package/lib/components/DialogBody/useDialogBody.js.map +1 -1
  36. package/lib/components/DialogBody/useDialogBodyStyles.js +5 -5
  37. package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  38. package/lib/components/DialogContent/DialogContent.js +15 -0
  39. package/lib/components/DialogContent/DialogContent.js.map +1 -0
  40. package/lib/components/DialogContent/DialogContent.types.js +2 -0
  41. package/lib/components/DialogContent/DialogContent.types.js.map +1 -0
  42. package/lib/components/DialogContent/index.js +6 -0
  43. package/lib/components/DialogContent/index.js.map +1 -0
  44. package/lib/components/DialogContent/renderDialogContent.js +16 -0
  45. package/lib/components/DialogContent/renderDialogContent.js.map +1 -0
  46. package/lib/components/DialogContent/useDialogContent.js +27 -0
  47. package/lib/components/DialogContent/useDialogContent.js.map +1 -0
  48. package/lib/components/DialogContent/useDialogContentStyles.js +26 -0
  49. package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -0
  50. package/lib/components/DialogSurface/DialogSurface.js.map +1 -1
  51. package/lib/components/DialogSurface/DialogSurface.types.js.map +1 -1
  52. package/lib/components/DialogSurface/index.js.map +1 -1
  53. package/lib/components/DialogSurface/renderDialogSurface.js +4 -2
  54. package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
  55. package/lib/components/DialogSurface/useDialogSurface.js +120 -21
  56. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  57. package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  58. package/lib/components/DialogSurface/useDialogSurfaceStyles.js +57 -7
  59. package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  60. package/lib/components/DialogTitle/DialogTitle.js +2 -3
  61. package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
  62. package/lib/components/DialogTitle/DialogTitle.types.js.map +1 -1
  63. package/lib/components/DialogTitle/index.js.map +1 -1
  64. package/lib/components/DialogTitle/renderDialogTitle.js +2 -5
  65. package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
  66. package/lib/components/DialogTitle/useDialogTitle.js +15 -9
  67. package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
  68. package/lib/components/DialogTitle/useDialogTitleStyles.js +61 -54
  69. package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  70. package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
  71. package/lib/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
  72. package/lib/components/DialogTrigger/index.js.map +1 -1
  73. package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  74. package/lib/components/DialogTrigger/useDialogTrigger.js +3 -22
  75. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  76. package/lib/contexts/constants.js +1 -1
  77. package/lib/contexts/constants.js.map +1 -1
  78. package/lib/contexts/dialogContext.js +2 -4
  79. package/lib/contexts/dialogContext.js.map +1 -1
  80. package/lib/contexts/dialogSurfaceContext.js.map +1 -1
  81. package/lib/contexts/index.js.map +1 -1
  82. package/lib/index.js +2 -1
  83. package/lib/index.js.map +1 -1
  84. package/lib/utils/index.js +4 -3
  85. package/lib/utils/index.js.map +1 -1
  86. package/lib/utils/isEscapeKeyDown.js +5 -4
  87. package/lib/utils/isEscapeKeyDown.js.map +1 -1
  88. package/lib/utils/isHTMLDialogElement.js +4 -0
  89. package/lib/utils/isHTMLDialogElement.js.map +1 -0
  90. package/lib/utils/useControlNativeDialogOpenState.js +20 -0
  91. package/lib/utils/useControlNativeDialogOpenState.js.map +1 -0
  92. package/lib/utils/useDisableBodyScroll.js +60 -0
  93. package/lib/utils/useDisableBodyScroll.js.map +1 -0
  94. package/lib/utils/useFocusFirstElement.js +41 -0
  95. package/lib/utils/useFocusFirstElement.js.map +1 -0
  96. package/lib-commonjs/Dialog.js.map +1 -1
  97. package/lib-commonjs/DialogActions.js.map +1 -1
  98. package/lib-commonjs/DialogBody.js.map +1 -1
  99. package/lib-commonjs/DialogContent.js +10 -0
  100. package/lib-commonjs/DialogContent.js.map +1 -0
  101. package/lib-commonjs/DialogSurface.js.map +1 -1
  102. package/lib-commonjs/DialogTitle.js.map +1 -1
  103. package/lib-commonjs/DialogTrigger.js.map +1 -1
  104. package/lib-commonjs/components/Dialog/Dialog.js +0 -3
  105. package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
  106. package/lib-commonjs/components/Dialog/index.js +0 -2
  107. package/lib-commonjs/components/Dialog/index.js.map +1 -1
  108. package/lib-commonjs/components/Dialog/renderDialog.js +2 -12
  109. package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
  110. package/lib-commonjs/components/Dialog/useDialog.js +18 -128
  111. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  112. package/lib-commonjs/components/Dialog/useDialogContextValues.js +4 -4
  113. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  114. package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -1
  115. package/lib-commonjs/components/DialogActions/index.js.map +1 -1
  116. package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
  117. package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -1
  118. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js +3 -6
  119. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  120. package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -1
  121. package/lib-commonjs/components/DialogBody/index.js.map +1 -1
  122. package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
  123. package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
  124. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js +4 -5
  125. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  126. package/lib-commonjs/components/DialogContent/DialogContent.js +26 -0
  127. package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -0
  128. package/lib-commonjs/components/DialogContent/DialogContent.types.js +6 -0
  129. package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -0
  130. package/lib-commonjs/components/DialogContent/index.js +18 -0
  131. package/lib-commonjs/components/DialogContent/index.js.map +1 -0
  132. package/lib-commonjs/components/DialogContent/renderDialogContent.js +27 -0
  133. package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -0
  134. package/lib-commonjs/components/DialogContent/useDialogContent.js +37 -0
  135. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -0
  136. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js +36 -0
  137. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -0
  138. package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -1
  139. package/lib-commonjs/components/DialogSurface/index.js.map +1 -1
  140. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +5 -2
  141. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
  142. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +120 -21
  143. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  144. package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  145. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js +57 -6
  146. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  147. package/lib-commonjs/components/DialogTitle/DialogTitle.js +2 -3
  148. package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
  149. package/lib-commonjs/components/DialogTitle/index.js.map +1 -1
  150. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +2 -6
  151. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
  152. package/lib-commonjs/components/DialogTitle/useDialogTitle.js +18 -10
  153. package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
  154. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js +62 -56
  155. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  156. package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -1
  157. package/lib-commonjs/components/DialogTrigger/index.js.map +1 -1
  158. package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  159. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js +4 -24
  160. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  161. package/lib-commonjs/contexts/constants.js +2 -2
  162. package/lib-commonjs/contexts/constants.js.map +1 -1
  163. package/lib-commonjs/contexts/dialogContext.js +2 -4
  164. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  165. package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
  166. package/lib-commonjs/contexts/index.js.map +1 -1
  167. package/lib-commonjs/index.js +34 -13
  168. package/lib-commonjs/index.js.map +1 -1
  169. package/lib-commonjs/utils/index.js +5 -3
  170. package/lib-commonjs/utils/index.js.map +1 -1
  171. package/lib-commonjs/utils/isEscapeKeyDown.js +5 -4
  172. package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
  173. package/lib-commonjs/utils/isHTMLDialogElement.js +13 -0
  174. package/lib-commonjs/utils/isHTMLDialogElement.js.map +1 -0
  175. package/lib-commonjs/utils/useControlNativeDialogOpenState.js +31 -0
  176. package/lib-commonjs/utils/useControlNativeDialogOpenState.js.map +1 -0
  177. package/lib-commonjs/utils/useDisableBodyScroll.js +73 -0
  178. package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -0
  179. package/lib-commonjs/utils/useFocusFirstElement.js +54 -0
  180. package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -0
  181. package/package.json +15 -16
  182. package/dist/tsdoc-metadata.json +0 -11
  183. package/lib/components/Dialog/useDialogStyles.js +0 -41
  184. package/lib/components/Dialog/useDialogStyles.js.map +0 -1
  185. package/lib/utils/isTargetDisabled.js +0 -14
  186. package/lib/utils/isTargetDisabled.js.map +0 -1
  187. package/lib/utils/localShorthands.js +0 -9
  188. package/lib/utils/localShorthands.js.map +0 -1
  189. package/lib/utils/normalizeDefaultPrevented.js +0 -11
  190. package/lib/utils/normalizeDefaultPrevented.js.map +0 -1
  191. package/lib-commonjs/components/Dialog/useDialogStyles.js +0 -53
  192. package/lib-commonjs/components/Dialog/useDialogStyles.js.map +0 -1
  193. package/lib-commonjs/utils/isTargetDisabled.js +0 -23
  194. package/lib-commonjs/utils/isTargetDisabled.js.map +0 -1
  195. package/lib-commonjs/utils/localShorthands.js +0 -18
  196. package/lib-commonjs/utils/localShorthands.js.map +0 -1
  197. package/lib-commonjs/utils/normalizeDefaultPrevented.js +0 -20
  198. package/lib-commonjs/utils/normalizeDefaultPrevented.js.map +0 -1
@@ -9,11 +9,11 @@ const React = /*#__PURE__*/require("react");
9
9
 
10
10
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
13
-
14
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
12
+ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
15
13
 
16
14
  const utils_1 = /*#__PURE__*/require("../../utils");
15
+
16
+ const contexts_1 = /*#__PURE__*/require("../../contexts");
17
17
  /**
18
18
  * Create the state required to render Dialog.
19
19
  *
@@ -27,7 +27,6 @@ const utils_1 = /*#__PURE__*/require("../../utils");
27
27
  const useDialog_unstable = props => {
28
28
  const {
29
29
  children,
30
- overlay,
31
30
  modalType = 'modal',
32
31
  onOpenChange
33
32
  } = props;
@@ -37,63 +36,36 @@ const useDialog_unstable = props => {
37
36
  defaultState: props.defaultOpen,
38
37
  initialState: false
39
38
  });
40
- const overlayShorthand = react_utilities_1.resolveShorthand(overlay, {
41
- required: modalType !== 'non-modal',
42
- defaultProps: {
43
- 'aria-hidden': 'true'
44
- }
45
- });
46
39
  const requestOpenChange = react_utilities_1.useEventCallback(data => {
47
- const isDefaultPrevented = utils_1.normalizeDefaultPrevented(data.event);
48
-
49
- if (onOpenChange) {
50
- onOpenChange(data.event, data);
51
- } // if user prevents default then do not change state value
40
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(data.event, data); // if user prevents default then do not change state value
52
41
  // otherwise updates state value and trigger reference to the element that caused the opening
53
42
 
54
-
55
- if (!isDefaultPrevented()) {
56
- triggerRef.current = !open && data.open ? data.event.currentTarget : null;
43
+ if (!data.event.isDefaultPrevented()) {
57
44
  setOpen(data.open);
58
45
  }
59
46
  });
60
- const {
61
- contentRef,
62
- triggerRef
63
- } = useFocusFirstElement({
64
- open,
65
- modalType,
66
- requestOpenChange
67
- });
68
- const handleOverLayClick = react_utilities_1.useEventCallback(event => {
69
- var _a;
70
-
71
- (_a = overlayShorthand === null || overlayShorthand === void 0 ? void 0 : overlayShorthand.onClick) === null || _a === void 0 ? void 0 : _a.call(overlayShorthand, event);
72
-
73
- if (isOverlayClickDismiss(event, modalType)) {
74
- requestOpenChange({
75
- event,
76
- open: false,
77
- type: 'overlayClick'
78
- });
47
+ const focusRef = utils_1.useFocusFirstElement(open, modalType);
48
+ const nativeControlRef = utils_1.useControlNativeDialogOpenState(open, modalType);
49
+ const disableBodyScroll = utils_1.useDisableBodyScroll();
50
+ const isBodyScrollLocked = Boolean(open && modalType !== 'non-modal');
51
+ react_utilities_1.useIsomorphicLayoutEffect(() => {
52
+ if (isBodyScrollLocked) {
53
+ return disableBodyScroll();
79
54
  }
80
- });
55
+ }, [disableBodyScroll, isBodyScrollLocked]);
81
56
  return {
82
57
  components: {
83
- overlay: 'div'
84
- },
85
- overlay: overlayShorthand && { ...overlayShorthand,
86
- onClick: handleOverLayClick
58
+ backdrop: 'div'
87
59
  },
88
60
  open,
89
61
  modalType,
90
- content,
62
+ content: open ? content : null,
91
63
  trigger,
92
- triggerRef,
93
- contentRef,
94
64
  requestOpenChange,
95
65
  dialogBodyID: react_utilities_1.useId('dialog-body-'),
96
- dialogTitleID: react_utilities_1.useId('dialog-title-')
66
+ dialogTitleID: react_utilities_1.useId('dialog-title-'),
67
+ isNestedDialog: react_context_selector_1.useHasParentContext(contexts_1.DialogContext),
68
+ dialogRef: react_utilities_1.useMergedRefs(focusRef, nativeControlRef)
97
69
  };
98
70
  };
99
71
 
@@ -126,86 +98,4 @@ function childrenToTriggerAndContent(children) {
126
98
  return [undefined, undefined];
127
99
  }
128
100
  }
129
- /**
130
- * Checks is click event is a proper Overlay click dismiss
131
- */
132
-
133
-
134
- function isOverlayClickDismiss(event, type) {
135
- const isDefaultPrevented = utils_1.normalizeDefaultPrevented(event);
136
- return type === 'modal' && !isDefaultPrevented();
137
- }
138
- /**
139
- * Focus first element on content when dialog is opened,
140
- * in case there's no focusable element, then a eventlistener is added to document
141
- * to ensure Escape keydown functionality
142
- */
143
-
144
-
145
- function useFocusFirstElement({
146
- open,
147
- requestOpenChange,
148
- modalType
149
- }) {
150
- const {
151
- findFirstFocusable
152
- } = react_tabster_1.useFocusFinders();
153
- const {
154
- targetDocument
155
- } = react_shared_contexts_1.useFluent_unstable();
156
- const contentRef = React.useRef(null);
157
- const triggerRef = React.useRef(null);
158
- React.useEffect(() => {
159
- if (!open) {
160
- return;
161
- }
162
-
163
- const element = contentRef.current && findFirstFocusable(contentRef.current);
164
-
165
- if (element) {
166
- element.focus(); // NOTE: if it's non-modal global listener to escape is necessary
167
-
168
- if (modalType !== 'non-modal') {
169
- return;
170
- }
171
- } else {
172
- if (process.env.NODE_ENV !== 'production') {
173
- // eslint-disable-next-line no-console
174
- console.warn('A Dialog should have at least one focusable element inside DialogSurface');
175
- }
176
- }
177
-
178
- if (triggerRef.current && targetDocument) {
179
- const trigger = triggerRef.current; // if the trigger is still the active element, the default behavior is to return focus to document.body,
180
- // which can be achived by blurring
181
-
182
- if (targetDocument.activeElement === trigger) {
183
- trigger.blur();
184
- }
185
-
186
- const listener = event => {
187
- if (utils_1.isEscapeKeyDismiss(event, modalType)) {
188
- requestOpenChange({
189
- event,
190
- open: false,
191
- type: 'documentEscapeKeyDown'
192
- });
193
- trigger.focus();
194
- event.stopImmediatePropagation();
195
- }
196
- };
197
-
198
- targetDocument.addEventListener('keydown', listener, {
199
- passive: false
200
- });
201
- return () => {
202
- targetDocument.removeEventListener('keydown', listener);
203
- };
204
- }
205
- }, [findFirstFocusable, requestOpenChange, open, modalType, targetDocument]);
206
- return {
207
- contentRef,
208
- triggerRef
209
- };
210
- }
211
101
  //# sourceMappingURL=useDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Dialog/useDialog.ts"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand, useControllableState, useEventCallback, useId } from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { normalizeDefaultPrevented, isEscapeKeyDismiss } from '../../utils';\n\nimport type { DialogProps, DialogState, DialogModalType, DialogOpenChangeData } from './Dialog.types';\n\n/**\n * Create the state required to render Dialog.\n *\n * The returned state can be modified with hooks such as useDialogStyles_unstable,\n * before being passed to renderDialog_unstable.\n *\n * @param props - props from this instance of Dialog\n */\nexport const useDialog_unstable = (props: DialogProps): DialogState => {\n const { children, overlay, modalType = 'modal', onOpenChange } = props;\n\n const [trigger, content] = childrenToTriggerAndContent(children);\n\n const [open, setOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const overlayShorthand = resolveShorthand(overlay, {\n required: modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n },\n });\n\n const requestOpenChange = useEventCallback((data: DialogOpenChangeData) => {\n const isDefaultPrevented = normalizeDefaultPrevented(data.event);\n\n if (onOpenChange) {\n onOpenChange(data.event, data);\n }\n\n // if user prevents default then do not change state value\n // otherwise updates state value and trigger reference to the element that caused the opening\n if (!isDefaultPrevented()) {\n (triggerRef as React.MutableRefObject<HTMLElement | null>).current =\n !open && data.open ? (data.event.currentTarget as HTMLElement) : null;\n setOpen(data.open);\n }\n });\n\n const { contentRef, triggerRef } = useFocusFirstElement({\n open,\n modalType,\n requestOpenChange,\n });\n\n const handleOverLayClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n overlayShorthand?.onClick?.(event);\n if (isOverlayClickDismiss(event, modalType)) {\n requestOpenChange({ event, open: false, type: 'overlayClick' });\n }\n });\n\n return {\n components: {\n overlay: 'div',\n },\n overlay: overlayShorthand && {\n ...overlayShorthand,\n onClick: handleOverLayClick,\n },\n open,\n modalType,\n content,\n trigger,\n triggerRef,\n contentRef,\n requestOpenChange,\n dialogBodyID: useId('dialog-body-'),\n dialogTitleID: useId('dialog-title-'),\n };\n};\n\n/**\n * Extracts trigger and content from children\n */\nfunction childrenToTriggerAndContent(\n children: React.ReactNode,\n): readonly [trigger: React.ReactNode, content: React.ReactNode] {\n const childrenArray = React.Children.toArray(children) as React.ReactElement[];\n if (process.env.NODE_ENV !== 'production') {\n if (childrenArray.length !== 1 && childrenArray.length !== 2) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Dialog must contain at least one child <DialogSurface/>,\\n' +\n 'and at most two children <DialogTrigger/> <DialogSurface/> (in this order)',\n );\n }\n }\n switch (childrenArray.length) {\n // case where there's a trigger followed by content\n case 2:\n return childrenArray as [trigger: React.ReactNode, content: React.ReactNode];\n // case where there's only content\n case 1:\n return [undefined, childrenArray[0]];\n // unknown case\n default:\n return [undefined, undefined];\n }\n}\n\n/**\n * Checks is click event is a proper Overlay click dismiss\n */\nfunction isOverlayClickDismiss(event: React.MouseEvent, type: DialogModalType): boolean {\n const isDefaultPrevented = normalizeDefaultPrevented(event);\n return type === 'modal' && !isDefaultPrevented();\n}\n\n/**\n * Focus first element on content when dialog is opened,\n * in case there's no focusable element, then a eventlistener is added to document\n * to ensure Escape keydown functionality\n */\nfunction useFocusFirstElement({\n open,\n requestOpenChange,\n modalType,\n}: Pick<DialogState, 'open' | 'requestOpenChange' | 'modalType'>) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const contentRef = React.useRef<HTMLElement>(null);\n const triggerRef = React.useRef<HTMLElement>(null);\n\n React.useEffect(() => {\n if (!open) {\n return;\n }\n\n const element = contentRef.current && findFirstFocusable(contentRef.current);\n if (element) {\n element.focus();\n // NOTE: if it's non-modal global listener to escape is necessary\n if (modalType !== 'non-modal') {\n return;\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('A Dialog should have at least one focusable element inside DialogSurface');\n }\n }\n\n if (triggerRef.current && targetDocument) {\n const trigger = triggerRef.current;\n // if the trigger is still the active element, the default behavior is to return focus to document.body,\n // which can be achived by blurring\n if (targetDocument.activeElement === trigger) {\n trigger.blur();\n }\n const listener = (event: KeyboardEvent) => {\n if (isEscapeKeyDismiss(event, modalType)) {\n requestOpenChange({\n event,\n open: false,\n type: 'documentEscapeKeyDown',\n });\n trigger.focus();\n event.stopImmediatePropagation();\n }\n };\n targetDocument.addEventListener('keydown', listener, { passive: false });\n return () => {\n targetDocument.removeEventListener('keydown', listener);\n };\n }\n }, [findFirstFocusable, requestOpenChange, open, modalType, targetDocument]);\n\n return { contentRef, triggerRef };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialog.ts"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useControlNativeDialogOpenState, useDisableBodyScroll, useFocusFirstElement } from '../../utils';\nimport { DialogContext } from '../../contexts';\n\nimport type { DialogOpenChangeData, DialogProps, DialogState } from './Dialog.types';\n\n/**\n * Create the state required to render Dialog.\n *\n * The returned state can be modified with hooks such as useDialogStyles_unstable,\n * before being passed to renderDialog_unstable.\n *\n * @param props - props from this instance of Dialog\n */\nexport const useDialog_unstable = (props: DialogProps): DialogState => {\n const { children, modalType = 'modal', onOpenChange } = props;\n\n const [trigger, content] = childrenToTriggerAndContent(children);\n\n const [open, setOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const requestOpenChange = useEventCallback((data: DialogOpenChangeData) => {\n onOpenChange?.(data.event, data);\n\n // if user prevents default then do not change state value\n // otherwise updates state value and trigger reference to the element that caused the opening\n if (!data.event.isDefaultPrevented()) {\n setOpen(data.open);\n }\n });\n\n const focusRef = useFocusFirstElement(open, modalType);\n const nativeControlRef = useControlNativeDialogOpenState(open, modalType);\n const disableBodyScroll = useDisableBodyScroll();\n const isBodyScrollLocked = Boolean(open && modalType !== 'non-modal');\n\n useIsomorphicLayoutEffect(() => {\n if (isBodyScrollLocked) {\n return disableBodyScroll();\n }\n }, [disableBodyScroll, isBodyScrollLocked]);\n\n return {\n components: {\n backdrop: 'div',\n },\n open,\n modalType,\n content: open ? content : null,\n trigger,\n requestOpenChange,\n dialogBodyID: useId('dialog-body-'),\n dialogTitleID: useId('dialog-title-'),\n isNestedDialog: useHasParentContext(DialogContext),\n dialogRef: useMergedRefs(focusRef, nativeControlRef),\n };\n};\n\n/**\n * Extracts trigger and content from children\n */\nfunction childrenToTriggerAndContent(\n children: React.ReactNode,\n): readonly [trigger: React.ReactNode, content: React.ReactNode] {\n const childrenArray = React.Children.toArray(children) as React.ReactElement[];\n if (process.env.NODE_ENV !== 'production') {\n if (childrenArray.length !== 1 && childrenArray.length !== 2) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Dialog must contain at least one child <DialogSurface/>,\\n' +\n 'and at most two children <DialogTrigger/> <DialogSurface/> (in this order)',\n );\n }\n }\n switch (childrenArray.length) {\n // case where there's a trigger followed by content\n case 2:\n return childrenArray as [trigger: React.ReactNode, content: React.ReactNode];\n // case where there's only content\n case 1:\n return [undefined, childrenArray[0]];\n // unknown case\n default:\n return [undefined, undefined];\n }\n}\n"],"sourceRoot":"../src/"}
@@ -9,10 +9,10 @@ function useDialogContextValues_unstable(state) {
9
9
  const {
10
10
  modalType,
11
11
  open,
12
- triggerRef,
13
- contentRef,
14
12
  dialogBodyID,
13
+ dialogRef,
15
14
  dialogTitleID,
15
+ isNestedDialog,
16
16
  requestOpenChange
17
17
  } = state;
18
18
  /**
@@ -23,10 +23,10 @@ function useDialogContextValues_unstable(state) {
23
23
  const dialog = {
24
24
  open,
25
25
  modalType,
26
- triggerRef,
27
- contentRef,
26
+ dialogRef,
28
27
  dialogBodyID,
29
28
  dialogTitleID,
29
+ isNestedDialog,
30
30
  requestOpenChange
31
31
  };
32
32
  const dialogSurface = false;
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Dialog/useDialogContextValues.ts"],"names":[],"mappings":";;;;;;;AAGA,SAAgB,+BAAhB,CAAgD,KAAhD,EAAkE;EAChE,MAAM;IAAE,SAAF;IAAa,IAAb;IAAmB,UAAnB;IAA+B,UAA/B;IAA2C,YAA3C;IAAyD,aAAzD;IAAwE;EAAxE,IAA8F,KAApG;EAEA;;;AAGG;;EACH,MAAM,MAAM,GAAuB;IACjC,IADiC;IAEjC,SAFiC;IAGjC,UAHiC;IAIjC,UAJiC;IAKjC,YALiC;IAMjC,aANiC;IAOjC;EAPiC,CAAnC;EAUA,MAAM,aAAa,GAA8B,KAAjD;EAEA,OAAO;IAAE,MAAF;IAAU;EAAV,CAAP;AACD;;AApBD,OAAA,CAAA,+BAAA,GAAA,+BAAA","sourcesContent":["import type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogContextValues, DialogState } from './Dialog.types';\n\nexport function useDialogContextValues_unstable(state: DialogState): DialogContextValues {\n const { modalType, open, triggerRef, contentRef, dialogBodyID, dialogTitleID, requestOpenChange } = state;\n\n /**\n * This context is created with \"@fluentui/react-context-selector\",\n * there is no sense to memoize it\n */\n const dialog: DialogContextValue = {\n open,\n modalType,\n triggerRef,\n contentRef,\n dialogBodyID,\n dialogTitleID,\n requestOpenChange,\n };\n\n const dialogSurface: DialogSurfaceContextValue = false;\n\n return { dialog, dialogSurface };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/Dialog/useDialogContextValues.ts"],"names":[],"mappings":";;;;;;;AAGA,SAAgB,+BAAhB,CAAgD,KAAhD,EAAkE;EAChE,MAAM;IAAE,SAAF;IAAa,IAAb;IAAmB,YAAnB;IAAiC,SAAjC;IAA4C,aAA5C;IAA2D,cAA3D;IAA2E;EAA3E,IAAiG,KAAvG;EAEA;;;AAGG;;EACH,MAAM,MAAM,GAAuB;IACjC,IADiC;IAEjC,SAFiC;IAGjC,SAHiC;IAIjC,YAJiC;IAKjC,aALiC;IAMjC,cANiC;IAOjC;EAPiC,CAAnC;EAUA,MAAM,aAAa,GAA8B,KAAjD;EAEA,OAAO;IAAE,MAAF;IAAU;EAAV,CAAP;AACD;;AApBD,OAAA,CAAA,+BAAA,GAAA,+BAAA","sourcesContent":["import type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogContextValues, DialogState } from './Dialog.types';\n\nexport function useDialogContextValues_unstable(state: DialogState): DialogContextValues {\n const { modalType, open, dialogBodyID, dialogRef, dialogTitleID, isNestedDialog, requestOpenChange } = state;\n\n /**\n * This context is created with \"@fluentui/react-context-selector\",\n * there is no sense to memoize it\n */\n const dialog: DialogContextValue = {\n open,\n modalType,\n dialogRef,\n dialogBodyID,\n dialogTitleID,\n isNestedDialog,\n requestOpenChange,\n };\n\n const dialogSurface: DialogSurfaceContextValue = false;\n\n return { dialog, dialogSurface };\n}\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogActions/DialogActions.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,EAAiC,GAAjC,CAAd;EAEA,wBAAA,CAAA,+BAAA,CAAgC,KAAhC;EACA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CALqE,CAAzD;AAOb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogActions_unstable } from './useDialogActions';\nimport { renderDialogActions_unstable } from './renderDialogActions';\nimport { useDialogActionsStyles_unstable } from './useDialogActionsStyles';\nimport type { DialogActionsProps } from './DialogActions.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * `DialogActions` is a container for the actions of the dialog.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogActions: ForwardRefComponent<DialogActionsProps> = React.forwardRef((props, ref) => {\n const state = useDialogActions_unstable(props, ref);\n\n useDialogActionsStyles_unstable(state);\n return renderDialogActions_unstable(state);\n});\n\nDialogActions.displayName = 'DialogActions';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/DialogActions.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,EAAiC,GAAjC,CAAd;EAEA,wBAAA,CAAA,+BAAA,CAAgC,KAAhC;EACA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CALqE,CAAzD;AAOb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogActions_unstable } from './useDialogActions';\nimport { renderDialogActions_unstable } from './renderDialogActions';\nimport { useDialogActionsStyles_unstable } from './useDialogActionsStyles';\nimport type { DialogActionsProps } from './DialogActions.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * `DialogActions` is a container for the actions of the dialog.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogActions: ForwardRefComponent<DialogActionsProps> = React.forwardRef((props, ref) => {\n const state = useDialogActions_unstable(props, ref);\n\n useDialogActionsStyles_unstable(state);\n return renderDialogActions_unstable(state);\n});\n\nDialogActions.displayName = 'DialogActions';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogActions/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogActions';\nexport * from './DialogActions.types';\nexport * from './renderDialogActions';\nexport * from './useDialogActions';\nexport * from './useDialogActionsStyles';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogActions';\nexport * from './DialogActions.types';\nexport * from './renderDialogActions';\nexport * from './useDialogActions';\nexport * from './useDialogActionsStyles';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogActions/renderDialogActions.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA6B,KAA7B,CAA7B,CADwE,CAGxE;;EACA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogActionsState, DialogActionsSlots } from './DialogActions.types';\n\n/**\n * Render the final JSX of DialogActions\n */\nexport const renderDialogActions_unstable = (state: DialogActionsState) => {\n const { slots, slotProps } = getSlots<DialogActionsSlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/renderDialogActions.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA6B,KAA7B,CAA7B,CADwE,CAGxE;;EACA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogActionsState, DialogActionsSlots } from './DialogActions.types';\n\n/**\n * Render the final JSX of DialogActions\n */\nexport const renderDialogActions_unstable = (state: DialogActionsState) => {\n const { slots, slotProps } = getSlots<DialogActionsSlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogActions/useDialogActions.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,QAAQ,GAAG;EAAb,IAAuB,KAA7B;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAA7B,CAJD;IAQL;EARK,CAAP;AAUD,CAfM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogActionsProps, DialogActionsState } from './DialogActions.types';\n\n/**\n * Create the state required to render DialogActions.\n *\n * The returned state can be modified with hooks such as useDialogActionsStyles_unstable,\n * before being passed to renderDialogActions_unstable.\n *\n * @param props - props from this instance of DialogActions\n * @param ref - reference to root HTMLElement of DialogActions\n */\nexport const useDialogActions_unstable = (\n props: DialogActionsProps,\n ref: React.Ref<HTMLElement>,\n): DialogActionsState => {\n const { position = 'end' } = props;\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n position,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/useDialogActions.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,QAAQ,GAAG;EAAb,IAAuB,KAA7B;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAA7B,CAJD;IAQL;EARK,CAAP;AAUD,CAfM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogActionsProps, DialogActionsState } from './DialogActions.types';\n\n/**\n * Create the state required to render DialogActions.\n *\n * The returned state can be modified with hooks such as useDialogActionsStyles_unstable,\n * before being passed to renderDialogActions_unstable.\n *\n * @param props - props from this instance of DialogActions\n * @param ref - reference to root HTMLElement of DialogActions\n */\nexport const useDialogActions_unstable = (\n props: DialogActionsProps,\n ref: React.Ref<HTMLElement>,\n): DialogActionsState => {\n const { position = 'end' } = props;\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n position,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -9,8 +9,6 @@ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
10
  const constants_1 = /*#__PURE__*/require("../../contexts/constants");
11
11
 
12
- const localShorthands = /*#__PURE__*/require("../../utils/localShorthands");
13
-
14
12
  exports.dialogActionsClassNames = {
15
13
  root: 'fui-DialogActions'
16
14
  };
@@ -22,26 +20,25 @@ const useStyles = /*#__PURE__*/react_1.__styles({
22
20
  "mc9l5x": "f22iagw",
23
21
  "i8kkvl": "f4px1ci",
24
22
  "Belr9w4": "fn67r4l",
25
- "Bnr8eeb": "f12ep7o",
26
23
  "Bmdcpmo": "f6glcwc",
27
24
  "th9wkt": "f1e3st1r"
28
25
  },
29
26
  "gridPositionEnd": {
30
27
  "Bdqf98w": "f1a7i8kp",
31
28
  "Ijaq50": "f11u0jfc",
32
- "nk6f5a": "f23awfp",
33
29
  "Br312pm": "f1d6tb1o",
30
+ "nk6f5a": "f23awfp",
34
31
  "Bw0ie65": "fiappcv"
35
32
  },
36
33
  "gridPositionStart": {
37
34
  "Bdqf98w": "fsxvdwy",
38
35
  "Ijaq50": "f1vnb230",
39
- "nk6f5a": "f13d374e",
40
36
  "Br312pm": "f14781pt",
37
+ "nk6f5a": "f13d374e",
41
38
  "Bw0ie65": "f1fjo411"
42
39
  }
43
40
  }, {
44
- "d": [".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".f1ewtqcl{box-sizing:border-box;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f12ep7o>.fui-Button{max-width:100%;}", ".f1a7i8kp{justify-self:end;}", ".f11u0jfc{grid-row-start:actions-end;}", ".f23awfp{grid-row-end:actions-end;}", ".f1d6tb1o{grid-column-start:actions-end;}", ".fiappcv{grid-column-end:actions-end;}", ".fsxvdwy{justify-self:start;}", ".f1vnb230{grid-row-start:actions-start;}", ".f13d374e{grid-row-end:actions-start;}", ".f14781pt{grid-column-start:actions-start;}", ".f1fjo411{grid-column-end:actions-start;}"],
41
+ "d": [".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".f1ewtqcl{box-sizing:border-box;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1a7i8kp{justify-self:end;}", ".f11u0jfc{grid-row-start:actions-end;}", ".f1d6tb1o{grid-column-start:actions-end;}", ".f23awfp{grid-row-end:actions-end;}", ".fiappcv{grid-column-end:actions-end;}", ".fsxvdwy{justify-self:start;}", ".f1vnb230{grid-row-start:actions-start;}", ".f14781pt{grid-column-start:actions-start;}", ".f13d374e{grid-row-end:actions-start;}", ".f1fjo411{grid-column-end:actions-start;}"],
45
42
  "m": [["@media screen and (max-width: 480px){.f6glcwc{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}}", {
46
43
  "m": "screen and (max-width: 480px)"
47
44
  }], ["@media screen and (max-width: 480px){.f1e3st1r{justify-self:stretch;}}", {
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogActions/useDialogActionsStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAMA,MAAA,eAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEa,OAAA,CAAA,uBAAA,GAA8D;EACzE,IAAI,EAAE;AADmE,CAA9D;;AAIb,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;AAAA,EAAlB;AAwBA;;AAEG;;;AACI,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,uBAAA,CAAwB,IADH,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,QAAN,KAAmB,OAAnB,IAA8B,MAAM,CAAC,iBAHhB,EAIrB,KAAK,CAAC,QAAN,KAAmB,KAAnB,IAA4B,MAAM,CAAC,eAJd,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;EAOA,OAAO,KAAP;AACD,CAVM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogActionsSlots, DialogActionsState } from './DialogActions.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport {\n DIALOG_GAP,\n ACTIONS_END_GRID_AREA,\n ACTIONS_START_GRID_AREA,\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n} from '../../contexts/constants';\nimport * as localShorthands from '../../utils/localShorthands';\n\nexport const dialogActionsClassNames: SlotClassNames<DialogActionsSlots> = {\n root: 'fui-DialogActions',\n};\n\nconst useStyles = makeStyles({\n root: {\n height: 'fit-content',\n boxSizing: 'border-box',\n display: 'flex',\n ...shorthands.gap(DIALOG_GAP),\n '> .fui-Button': {\n maxWidth: '100%',\n },\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n flexDirection: 'column',\n justifySelf: 'stretch',\n },\n },\n gridPositionEnd: {\n justifySelf: 'end',\n ...localShorthands.gridArea(ACTIONS_END_GRID_AREA),\n },\n gridPositionStart: {\n justifySelf: 'start',\n ...localShorthands.gridArea(ACTIONS_START_GRID_AREA),\n },\n});\n\n/**\n * Apply styling to the DialogActions slots based on the state\n */\nexport const useDialogActionsStyles_unstable = (state: DialogActionsState): DialogActionsState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogActionsClassNames.root,\n styles.root,\n state.position === 'start' && styles.gridPositionStart,\n state.position === 'end' && styles.gridPositionEnd,\n state.root.className,\n );\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogActions/useDialogActionsStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAOa,OAAA,CAAA,uBAAA,GAA8D;EACzE,IAAI,EAAE;AADmE,CAA9D;;AAIb,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;AAAA,EAAlB;AAqBA;;AAEG;;;AACI,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,uBAAA,CAAwB,IADH,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,QAAN,KAAmB,OAAnB,IAA8B,MAAM,CAAC,iBAHhB,EAIrB,KAAK,CAAC,QAAN,KAAmB,KAAnB,IAA4B,MAAM,CAAC,eAJd,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;EAOA,OAAO,KAAP;AACD,CAVM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogActionsSlots, DialogActionsState } from './DialogActions.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport {\n DIALOG_GAP,\n ACTIONS_END_GRID_AREA,\n ACTIONS_START_GRID_AREA,\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n} from '../../contexts/constants';\n\nexport const dialogActionsClassNames: SlotClassNames<DialogActionsSlots> = {\n root: 'fui-DialogActions',\n};\n\nconst useStyles = makeStyles({\n root: {\n height: 'fit-content',\n boxSizing: 'border-box',\n display: 'flex',\n ...shorthands.gap(DIALOG_GAP),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n flexDirection: 'column',\n justifySelf: 'stretch',\n },\n },\n gridPositionEnd: {\n justifySelf: 'end',\n ...shorthands.gridArea(ACTIONS_END_GRID_AREA),\n },\n gridPositionStart: {\n justifySelf: 'start',\n ...shorthands.gridArea(ACTIONS_START_GRID_AREA),\n },\n});\n\n/**\n * Apply styling to the DialogActions slots based on the state\n */\nexport const useDialogActionsStyles_unstable = (state: DialogActionsState): DialogActionsState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogActionsClassNames.root,\n styles.root,\n state.position === 'start' && styles.gridPositionStart,\n state.position === 'end' && styles.gridPositionEnd,\n state.root.className,\n );\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogBody/DialogBody.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,UAAA,gBAAmD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAC9F,MAAM,KAAK,GAAG,eAAA,CAAA,sBAAA,CAAuB,KAAvB,EAA8B,GAA9B,CAAd;EAEA,qBAAA,CAAA,4BAAA,CAA6B,KAA7B;EACA,OAAO,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAP;AACD,CAL+D,CAAnD;AAOb,OAAA,CAAA,UAAA,CAAW,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { useDialogBody_unstable } from './useDialogBody';\nimport { renderDialogBody_unstable } from './renderDialogBody';\nimport { useDialogBodyStyles_unstable } from './useDialogBodyStyles';\nimport type { DialogBodyProps } from './DialogBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogBody` is a container where the content of the dialog is rendered.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogBody: ForwardRefComponent<DialogBodyProps> = React.forwardRef((props, ref) => {\n const state = useDialogBody_unstable(props, ref);\n\n useDialogBodyStyles_unstable(state);\n return renderDialogBody_unstable(state);\n});\n\nDialogBody.displayName = 'DialogBody';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/DialogBody.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,UAAA,gBAAmD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAC9F,MAAM,KAAK,GAAG,eAAA,CAAA,sBAAA,CAAuB,KAAvB,EAA8B,GAA9B,CAAd;EAEA,qBAAA,CAAA,4BAAA,CAA6B,KAA7B;EACA,OAAO,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,CAAP;AACD,CAL+D,CAAnD;AAOb,OAAA,CAAA,UAAA,CAAW,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { useDialogBody_unstable } from './useDialogBody';\nimport { renderDialogBody_unstable } from './renderDialogBody';\nimport { useDialogBodyStyles_unstable } from './useDialogBodyStyles';\nimport type { DialogBodyProps } from './DialogBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogBody` is a container where the content of the dialog is rendered.\n * Apart from styling, this component does not have other behavior.\n */\nexport const DialogBody: ForwardRefComponent<DialogBodyProps> = React.forwardRef((props, ref) => {\n const state = useDialogBody_unstable(props, ref);\n\n useDialogBodyStyles_unstable(state);\n return renderDialogBody_unstable(state);\n});\n\nDialogBody.displayName = 'DialogBody';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogBody/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogBody';\nexport * from './DialogBody.types';\nexport * from './renderDialogBody';\nexport * from './useDialogBody';\nexport * from './useDialogBodyStyles';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogBody';\nexport * from './DialogBody.types';\nexport * from './renderDialogBody';\nexport * from './useDialogBody';\nexport * from './useDialogBodyStyles';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogBody/renderDialogBody.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAA2B;EAClE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,CAA7B,CADkE,CAGlE;;EACA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogBodyState, DialogBodySlots } from './DialogBody.types';\n\n/**\n * Render the final JSX of DialogBody\n */\nexport const renderDialogBody_unstable = (state: DialogBodyState) => {\n const { slots, slotProps } = getSlots<DialogBodySlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/renderDialogBody.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAA2B;EAClE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,CAA7B,CADkE,CAGlE;;EACA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogBodyState, DialogBodySlots } from './DialogBody.types';\n\n/**\n * Render the final JSX of DialogBody\n */\nexport const renderDialogBody_unstable = (state: DialogBodyState) => {\n const { slots, slotProps } = getSlots<DialogBodySlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogBody/useDialogBody.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAyB,GAAzB,KAAyE;EAC7G,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,EAAE,EAAE,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,YAArC,CAF6B;MAGjC,GAAG;IAH8B,CAA7B;EAJD,CAAP;AAUD,CAXM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogBodyProps, DialogBodyState } from './DialogBody.types';\nimport { useDialogContext_unstable } from '../../contexts';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogBody_unstable = (props: DialogBodyProps, ref: React.Ref<HTMLElement>): DialogBodyState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n id: useDialogContext_unstable(ctx => ctx.dialogBodyID),\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/useDialogBody.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,UAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAyB,GAAzB,KAAyE;EAC7G,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,EAAE,EAAE,UAAA,CAAA,yBAAA,CAA0B,GAAG,IAAI,GAAG,CAAC,YAArC,CAF6B;MAGjC,GAAG;IAH8B,CAA7B;EAJD,CAAP;AAUD,CAXM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogBodyProps, DialogBodyState } from './DialogBody.types';\nimport { useDialogContext_unstable } from '../../contexts';\n\n/**\n * Create the state required to render DialogBody.\n *\n * The returned state can be modified with hooks such as useDialogBodyStyles_unstable,\n * before being passed to renderDialogBody_unstable.\n *\n * @param props - props from this instance of DialogBody\n * @param ref - reference to root HTMLElement of DialogBody\n */\nexport const useDialogBody_unstable = (props: DialogBodyProps, ref: React.Ref<HTMLElement>): DialogBodyState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n id: useDialogContext_unstable(ctx => ctx.dialogBodyID),\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -9,8 +9,6 @@ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
10
  const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
11
 
12
- const localShorthands = /*#__PURE__*/require("../../utils/localShorthands");
13
-
14
12
  const constants_1 = /*#__PURE__*/require("../../contexts/constants");
15
13
 
16
14
  exports.dialogBodyClassNames = {
@@ -23,12 +21,13 @@ exports.dialogBodyClassNames = {
23
21
  const useStyles = /*#__PURE__*/react_1.__styles({
24
22
  "root": {
25
23
  "a9b677": "fly5x3f",
26
- "Bqenvij": "f3052tw",
24
+ "Bqenvij": "f1l02sjl",
25
+ "Bmxbyg5": "f5zp4f",
27
26
  "sshi5w": "f1nxs5xn",
28
27
  "B7ck84d": "f1ewtqcl",
29
28
  "Ijaq50": "f6owso0",
30
- "nk6f5a": "foucsne",
31
29
  "Br312pm": "fupswjn",
30
+ "nk6f5a": "foucsne",
32
31
  "Bw0ie65": "f1ka72gx",
33
32
  "Bahqtrf": "fk6fouc",
34
33
  "Be2twd7": "fkhj508",
@@ -36,7 +35,7 @@ const useStyles = /*#__PURE__*/react_1.__styles({
36
35
  "Bg96gwp": "f1i3iumi"
37
36
  }
38
37
  }, {
39
- "d": [".fly5x3f{width:100%;}", ".f3052tw{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;}", ".f1nxs5xn{min-height:32px;}", ".f1ewtqcl{box-sizing:border-box;}", ".f6owso0{grid-row-start:body;}", ".foucsne{grid-row-end:body;}", ".fupswjn{grid-column-start:body;}", ".f1ka72gx{grid-column-end:body;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
38
+ "d": [".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f5zp4f{overflow-y:auto;}", ".f1nxs5xn{min-height:32px;}", ".f1ewtqcl{box-sizing:border-box;}", ".f6owso0{grid-row-start:body;}", ".fupswjn{grid-column-start:body;}", ".foucsne{grid-row-end:body;}", ".f1ka72gx{grid-column-end:body;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
40
39
  });
41
40
  /**
42
41
  * Apply styling to the DialogBody slots based on the state
@@ -1 +1 @@
1
- {"version":3,"sources":["components/DialogBody/useDialogBodyStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAEa,OAAA,CAAA,oBAAA,GAAwD;EACnE,IAAI,EAAE;AAD6D,CAAxD;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAWA;;AAEG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA4C;EACtF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,oBAAA,CAAqB,IAAlC,EAAwC,MAAM,CAAC,IAA/C,EAAqD,KAAK,CAAC,IAAN,CAAW,SAAhE,CAAvB,CAFsF,CAItF;EACA;;EAEA,OAAO,KAAP;AACD,CARM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { DialogBodySlots, DialogBodyState } from './DialogBody.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport * as localShorthands from '../../utils/localShorthands';\nimport { BODY_GRID_AREA } from '../../contexts/constants';\n\nexport const dialogBodyClassNames: SlotClassNames<DialogBodySlots> = {\n root: 'fui-DialogBody',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: 'fit-content',\n minHeight: '32px',\n boxSizing: 'border-box',\n ...localShorthands.gridArea(BODY_GRID_AREA),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the DialogBody slots based on the state\n */\nexport const useDialogBodyStyles_unstable = (state: DialogBodyState): DialogBodyState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogBodyClassNames.root, styles.root, state.root.className);\n\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogBody/useDialogBodyStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAEa,OAAA,CAAA,oBAAA,GAAwD;EACnE,IAAI,EAAE;AAD6D,CAAxD;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA4C;EACtF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,oBAAA,CAAqB,IAAlC,EAAwC,MAAM,CAAC,IAA/C,EAAqD,KAAK,CAAC,IAAN,CAAW,SAAhE,CAAvB,CAFsF,CAItF;EACA;;EAEA,OAAO,KAAP;AACD,CARM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogBodySlots, DialogBodyState } from './DialogBody.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { BODY_GRID_AREA } from '../../contexts/constants';\n\nexport const dialogBodyClassNames: SlotClassNames<DialogBodySlots> = {\n root: 'fui-DialogBody',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n overflowY: 'auto',\n minHeight: '32px',\n boxSizing: 'border-box',\n ...shorthands.gridArea(BODY_GRID_AREA),\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Apply styling to the DialogBody slots based on the state\n */\nexport const useDialogBodyStyles_unstable = (state: DialogBodyState): DialogBodyState => {\n const styles = useStyles();\n state.root.className = mergeClasses(dialogBodyClassNames.root, styles.root, state.root.className);\n\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DialogContent = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const useDialogContent_1 = /*#__PURE__*/require("./useDialogContent");
11
+
12
+ const renderDialogContent_1 = /*#__PURE__*/require("./renderDialogContent");
13
+
14
+ const useDialogContentStyles_1 = /*#__PURE__*/require("./useDialogContentStyles");
15
+ /**
16
+ * DialogContent component - TODO: add more docs
17
+ */
18
+
19
+
20
+ exports.DialogContent = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = useDialogContent_1.useDialogContent_unstable(props, ref);
22
+ useDialogContentStyles_1.useDialogContentStyles_unstable(state);
23
+ return renderDialogContent_1.renderDialogContent_unstable(state);
24
+ });
25
+ exports.DialogContent.displayName = 'DialogContent';
26
+ //# sourceMappingURL=DialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/DialogContent.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,EAAiC,GAAjC,CAAd;EAEA,wBAAA,CAAA,+BAAA,CAAgC,KAAhC;EACA,OAAO,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,CAAP;AACD,CALqE,CAAzD;AAOb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { useDialogContent_unstable } from './useDialogContent';\nimport { renderDialogContent_unstable } from './renderDialogContent';\nimport { useDialogContentStyles_unstable } from './useDialogContentStyles';\nimport type { DialogContentProps } from './DialogContent.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DialogContent component - TODO: add more docs\n */\nexport const DialogContent: ForwardRefComponent<DialogContentProps> = React.forwardRef((props, ref) => {\n const state = useDialogContent_unstable(props, ref);\n\n useDialogContentStyles_unstable(state);\n return renderDialogContent_unstable(state);\n});\n\nDialogContent.displayName = 'DialogContent';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=DialogContent.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
9
+ tslib_1.__exportStar(require("./DialogContent"), exports);
10
+
11
+ tslib_1.__exportStar(require("./DialogContent.types"), exports);
12
+
13
+ tslib_1.__exportStar(require("./renderDialogContent"), exports);
14
+
15
+ tslib_1.__exportStar(require("./useDialogContent"), exports);
16
+
17
+ tslib_1.__exportStar(require("./useDialogContentStyles"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './DialogContent';\nexport * from './DialogContent.types';\nexport * from './renderDialogContent';\nexport * from './useDialogContent';\nexport * from './useDialogContentStyles';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderDialogContent_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+ /**
12
+ * Render the final JSX of DialogContent
13
+ */
14
+
15
+
16
+ const renderDialogContent_unstable = state => {
17
+ const {
18
+ slots,
19
+ slotProps
20
+ } = react_utilities_1.getSlots(state); // TODO Add additional slots in the appropriate place
21
+
22
+ return React.createElement(slots.root, { ...slotProps.root
23
+ });
24
+ };
25
+
26
+ exports.renderDialogContent_unstable = renderDialogContent_unstable;
27
+ //# sourceMappingURL=renderDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA8B;EACxE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA6B,KAA7B,CAA7B,CADwE,CAGxE;;EACA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogContentState, DialogContentSlots } from './DialogContent.types';\n\n/**\n * Render the final JSX of DialogContent\n */\nexport const renderDialogContent_unstable = (state: DialogContentState) => {\n const { slots, slotProps } = getSlots<DialogContentSlots>(state);\n\n // TODO Add additional slots in the appropriate place\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useDialogContent_unstable = void 0;
7
+
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
+ /**
10
+ * Create the state required to render DialogContent.
11
+ *
12
+ * The returned state can be modified with hooks such as useDialogContentStyles_unstable,
13
+ * before being passed to renderDialogContent_unstable.
14
+ *
15
+ * @param props - props from this instance of DialogContent
16
+ * @param ref - reference to root HTMLElement of DialogContent
17
+ */
18
+
19
+
20
+ const useDialogContent_unstable = (props, ref) => {
21
+ return {
22
+ // TODO add appropriate props/defaults
23
+ components: {
24
+ // TODO add each slot's element type or component
25
+ root: 'div'
26
+ },
27
+ // TODO add appropriate slots, for example:
28
+ // mySlot: resolveShorthand(props.mySlot),
29
+ root: react_utilities_1.getNativeElementProps('div', {
30
+ ref,
31
+ ...props
32
+ })
33
+ };
34
+ };
35
+
36
+ exports.useDialogContent_unstable = useDialogContent_unstable;
37
+ //# sourceMappingURL=useDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["packages/react-components/react-dialog/src/components/DialogContent/useDialogContent.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,OAAO;IACL;IACA,UAAU,EAAE;MACV;MACA,IAAI,EAAE;IAFI,CAFP;IAML;IACA;IACA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAA7B;EARD,CAAP;AAaD,CAjBM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogContentProps, DialogContentState } from './DialogContent.types';\n\n/**\n * Create the state required to render DialogContent.\n *\n * The returned state can be modified with hooks such as useDialogContentStyles_unstable,\n * before being passed to renderDialogContent_unstable.\n *\n * @param props - props from this instance of DialogContent\n * @param ref - reference to root HTMLElement of DialogContent\n */\nexport const useDialogContent_unstable = (\n props: DialogContentProps,\n ref: React.Ref<HTMLElement>,\n): DialogContentState => {\n return {\n // TODO add appropriate props/defaults\n components: {\n // TODO add each slot's element type or component\n root: 'div',\n },\n // TODO add appropriate slots, for example:\n // mySlot: resolveShorthand(props.mySlot),\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useDialogContentStyles_unstable = exports.dialogContentClassNames = void 0;
7
+
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
+
10
+ exports.dialogContentClassNames = {
11
+ root: 'fui-DialogContent' // TODO: add class names for all slots on DialogContentSlots.
12
+ // Should be of the form `<slotName>: 'fui-DialogContent__<slotName>`
13
+
14
+ };
15
+ /**
16
+ * Styles for the root slot
17
+ */
18
+
19
+ const useStyles = /*#__PURE__*/react_1.__styles({
20
+ "root": {}
21
+ }, {});
22
+ /**
23
+ * Apply styling to the DialogContent slots based on the state
24
+ */
25
+
26
+
27
+ const useDialogContentStyles_unstable = state => {
28
+ const styles = useStyles();
29
+ state.root.className = react_1.mergeClasses(exports.dialogContentClassNames.root, styles.root, state.root.className); // TODO Add class names to slots, for example:
30
+ // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
31
+
32
+ return state;
33
+ };
34
+
35
+ exports.useDialogContentStyles_unstable = useDialogContentStyles_unstable;
36
+ //# sourceMappingURL=useDialogContentStyles.js.map