@servicetitan/anvil2 1.32.1 → 1.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/{Alert-BcjnX40X-DdR5a1fS.js → Alert-BcjnX40X-DK8meb2Z.js} +2 -3
- package/dist/{Alert-BcjnX40X-DdR5a1fS.js.map → Alert-BcjnX40X-DK8meb2Z.js.map} +1 -1
- package/dist/{Alert-S-riTJp2.js → Alert-D4O5XFXo.js} +2 -2
- package/dist/{Alert-S-riTJp2.js.map → Alert-D4O5XFXo.js.map} +1 -1
- package/dist/Alert.js +1 -1
- package/dist/{Announcement-BUNvjkVo.js → Announcement-D30SgkZg.js} +2 -3
- package/dist/{Announcement-BUNvjkVo.js.map → Announcement-D30SgkZg.js.map} +1 -1
- package/dist/Announcement.js +1 -1
- package/dist/{Checkbox-DdIDGlbE.js → Checkbox-C4JF-LvE.js} +2 -2
- package/dist/{Checkbox-DdIDGlbE.js.map → Checkbox-C4JF-LvE.js.map} +1 -1
- package/dist/{Checkbox-B1OkhWY6-BXBzUXK4.js → Checkbox-ZLz_xJx9-CxqouREp.js} +44 -10
- package/dist/Checkbox-ZLz_xJx9-CxqouREp.js.map +1 -0
- package/dist/Checkbox.css +69 -72
- package/dist/Checkbox.js +1 -1
- package/dist/{Checkbox.module-DMrZNVpb-DOdjd86H.js → Checkbox.module-B6diiZe0-DDAy-YPr.js} +19 -18
- package/dist/Checkbox.module-B6diiZe0-DDAy-YPr.js.map +1 -0
- package/dist/{Combobox-DZp6NgeF.js → Combobox-VCa5Qplb.js} +5 -6
- package/dist/Combobox-VCa5Qplb.js.map +1 -0
- package/dist/Combobox.js +1 -1
- package/dist/{DateField-BuCxeZbi.js → DateField-Ex0bquMB.js} +5 -5
- package/dist/{DateField-BuCxeZbi.js.map → DateField-Ex0bquMB.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DaysOfTheWeek-BL27GHpA.js → DaysOfTheWeek-CQqCFF2f.js} +3 -4
- package/dist/DaysOfTheWeek-CQqCFF2f.js.map +1 -0
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/Dialog-QtgPY3ji.js +333 -0
- package/dist/Dialog-QtgPY3ji.js.map +1 -0
- package/dist/Dialog.css +146 -0
- package/dist/Dialog.js +1 -1
- package/dist/{DndSort-8xmZRn1w.js → DndSort-BVcdqJLB.js} +2 -2
- package/dist/{DndSort-8xmZRn1w.js.map → DndSort-BVcdqJLB.js.map} +1 -1
- package/dist/DndSort.js +1 -1
- package/dist/{Drawer-R27M51bR.js → Drawer-18QCWW4F.js} +2 -2
- package/dist/{Drawer-R27M51bR.js.map → Drawer-18QCWW4F.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/{Flex-DlNiHX1G-CBMDzqYU.js → Flex-CLu2TnzF-aW2OhBYv.js} +9 -4
- package/dist/Flex-CLu2TnzF-aW2OhBYv.js.map +1 -0
- package/dist/{Flex-DlNiHX1G.css → Flex-CLu2TnzF.css} +14 -1
- package/dist/{Flex-CqNlL2mR.js → Flex-Dvn6ix9U.js} +2 -2
- package/dist/{Flex-CqNlL2mR.js.map → Flex-Dvn6ix9U.js.map} +1 -1
- package/dist/Flex.js +1 -1
- package/dist/{InputMask-C8Yx-RsH-PbALaG2H.js → InputMask-CAaKh5xX-n62jt7dp.js} +2 -2
- package/dist/{InputMask-C8Yx-RsH-PbALaG2H.js.map → InputMask-CAaKh5xX-n62jt7dp.js.map} +1 -1
- package/dist/{InputMask-Dfdl3HR_.js → InputMask-txxn_qIf.js} +2 -2
- package/dist/{InputMask-Dfdl3HR_.js.map → InputMask-txxn_qIf.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{ListView-D3u27ODE.js → ListView-DNwkCrxf.js} +3 -3
- package/dist/ListView-DNwkCrxf.js.map +1 -0
- package/dist/ListView.js +1 -1
- package/dist/{Listbox-CthJSHQ3-BnNf4vnZ.js → Listbox-DlKyRbri-Dc3ny9gH.js} +2 -2
- package/dist/{Listbox-CthJSHQ3-BnNf4vnZ.js.map → Listbox-DlKyRbri-Dc3ny9gH.js.map} +1 -1
- package/dist/{Listbox-Oz_LxoiF.js → Listbox-eNhS0Wmx.js} +2 -2
- package/dist/{Listbox-Oz_LxoiF.js.map → Listbox-eNhS0Wmx.js.map} +1 -1
- package/dist/Listbox.js +1 -1
- package/dist/{Menu-DY1JLQrj.js → Menu-DvVci7Qr.js} +225 -110
- package/dist/Menu-DvVci7Qr.js.map +1 -0
- package/dist/Menu.css +35 -26
- package/dist/Menu.js +1 -1
- package/dist/{Overflow-DXWJ1gWT-6WRtRAc3.js → Overflow-D6S5X1N4-C7YfnaOv.js} +3 -3
- package/dist/{Overflow-DXWJ1gWT-6WRtRAc3.js.map → Overflow-D6S5X1N4-C7YfnaOv.js.map} +1 -1
- package/dist/{Overflow-STQ_RpAD.js → Overflow-DDsq_uUA.js} +2 -2
- package/dist/{Overflow-STQ_RpAD.js.map → Overflow-DDsq_uUA.js.map} +1 -1
- package/dist/Overflow.js +1 -1
- package/dist/{Page-DWih1Hby.js → Page-BFVfMExj.js} +6 -6
- package/dist/{Page-DWih1Hby.js.map → Page-BFVfMExj.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Popover-CV-xrb9G.js → Popover-BbcT-mFU.js} +2 -2
- package/dist/{Popover-CV-xrb9G.js.map → Popover-BbcT-mFU.js.map} +1 -1
- package/dist/{Popover-DX4P8WCW-BgQrtbWH.js → Popover-CbeghwZg--83MWVgP.js} +3 -3
- package/dist/{Popover-DX4P8WCW-BgQrtbWH.js.map → Popover-CbeghwZg--83MWVgP.js.map} +1 -1
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-CgpalFK8-DxfzF8hg.js → ProgressBar-DojG9LHF-nlymvlXw.js} +311 -535
- package/dist/ProgressBar-DojG9LHF-nlymvlXw.js.map +1 -0
- package/dist/{ProgressBar-CgpalFK8.css → ProgressBar-DojG9LHF.css} +167 -276
- package/dist/{ProgressBar-BBEzuQ2S.js → ProgressBar-OtKoZ_jO.js} +2 -2
- package/dist/{ProgressBar-BBEzuQ2S.js.map → ProgressBar-OtKoZ_jO.js.map} +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-zEofJnTU.js → Radio-BWK27b7p.js} +2 -2
- package/dist/{Radio-zEofJnTU.js.map → Radio-BWK27b7p.js.map} +1 -1
- package/dist/{Radio-DE79qJFW-BRf9rOOV.js → Radio-BbohS64t-Ch6NvYfF.js} +54 -24
- package/dist/Radio-BbohS64t-Ch6NvYfF.js.map +1 -0
- package/dist/{Radio-DE79qJFW.css → Radio-BbohS64t.css} +50 -54
- package/dist/Radio.js +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/{SelectCardGroup-B_CVDaUI.js → SelectCardGroup-4MngIOom.js} +3 -3
- package/dist/{SelectCardGroup-B_CVDaUI.js.map → SelectCardGroup-4MngIOom.js.map} +1 -1
- package/dist/{Stepper-CeH1RiN9.js → Stepper-CuQn-jSf.js} +2 -2
- package/dist/{Stepper-CeH1RiN9.js.map → Stepper-CuQn-jSf.js.map} +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/{TextField-CgkazfKE.js → TextField-Djr02a3D.js} +2 -2
- package/dist/{TextField-CgkazfKE.js.map → TextField-Djr02a3D.js.map} +1 -1
- package/dist/{TextField-69svqHPM-Box5JvkC.js → TextField-DtlCGV8B-BPoNBGYn.js} +2 -3
- package/dist/TextField-DtlCGV8B-BPoNBGYn.js.map +1 -0
- package/dist/TextField.js +1 -1
- package/dist/{Textarea-Dv67XBNL.js → Textarea-DjqGI_N0.js} +2 -3
- package/dist/Textarea-DjqGI_N0.js.map +1 -0
- package/dist/Textarea.js +1 -1
- package/dist/Toast.js +1 -1
- package/dist/{Toolbar-gsDzLpRl.js → Toolbar-DiUrfZ4O.js} +5 -5
- package/dist/{Toolbar-gsDzLpRl.js.map → Toolbar-DiUrfZ4O.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{Tooltip-B8v6z3nj.js → Tooltip-DE8tqyR3.js} +2 -2
- package/dist/{Tooltip-B8v6z3nj.js.map → Tooltip-DE8tqyR3.js.map} +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/{check_circle-BGfigqq-.js → check_circle-DJhuiYqa.js} +4 -2
- package/dist/check_circle-DJhuiYqa.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Flex/Flex.d.ts +18 -6
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/index.js +26 -26
- package/dist/internal/utils/generateChromaticStickersheetProps.d.ts +16 -0
- package/dist/{toast-C-F09cHz.js → toast-BRfZ2rPu.js} +2 -2
- package/dist/{toast-C-F09cHz.js.map → toast-BRfZ2rPu.js.map} +1 -1
- package/package.json +3 -3
- package/dist/Checkbox-B1OkhWY6-BXBzUXK4.js.map +0 -1
- package/dist/Checkbox.module-DMrZNVpb-DOdjd86H.js.map +0 -1
- package/dist/Combobox-DZp6NgeF.js.map +0 -1
- package/dist/DaysOfTheWeek-BL27GHpA.js.map +0 -1
- package/dist/Dialog-CWhCRYT8.js +0 -66
- package/dist/Dialog-CWhCRYT8.js.map +0 -1
- package/dist/Flex-DlNiHX1G-CBMDzqYU.js.map +0 -1
- package/dist/Helper-DBmwQvEP-BB75un4q.js +0 -55
- package/dist/Helper-DBmwQvEP-BB75un4q.js.map +0 -1
- package/dist/Helper-DBmwQvEP.css +0 -25
- package/dist/ListView-D3u27ODE.js.map +0 -1
- package/dist/Menu-DY1JLQrj.js.map +0 -1
- package/dist/ProgressBar-CgpalFK8-DxfzF8hg.js.map +0 -1
- package/dist/Radio-DE79qJFW-BRf9rOOV.js.map +0 -1
- package/dist/TextField-69svqHPM-Box5JvkC.js.map +0 -1
- package/dist/Textarea-Dv67XBNL.js.map +0 -1
- package/dist/check_circle-BGfigqq-.js.map +0 -1
- package/dist/getActiveElements-CqR6e_P--CqR6e_P-.js +0 -16
- package/dist/getActiveElements-CqR6e_P--CqR6e_P-.js.map +0 -1
- package/dist/warning-c4Wj1rI4.js +0 -6
- package/dist/warning-c4Wj1rI4.js.map +0 -1
- /package/dist/{Overflow-DXWJ1gWT.css → Overflow-D6S5X1N4.css} +0 -0
- /package/dist/{Popover-DX4P8WCW.css → Popover-CbeghwZg.css} +0 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useContext, useRef, useState, useId, useEffect, useCallback } from 'react';
|
|
3
|
+
import { useTrackingId } from './useTrackingId.js';
|
|
4
|
+
import { c as childrenToString } from './childrenToString-Bz9MqbHb-Bz9MqbHb.js';
|
|
5
|
+
import { c as cx } from './index-tZvMCc77.js';
|
|
6
|
+
import { i as DialogContext, u as useKeyboardFocusables, j as useDialogScrollLock, g as getActiveElement, k as ToastProvider, l as ToasterPopover, m as ToasterContent } from './ProgressBar-DojG9LHF-nlymvlXw.js';
|
|
7
|
+
import { S as SvgClose } from './close-DZj38AEh.js';
|
|
8
|
+
import { T as Text } from './Text-BCRKWTMM-B3ftA79H.js';
|
|
9
|
+
import { B as Button } from './Button-CEDmdZ-2-DJVJnigb.js';
|
|
10
|
+
import { u as useMergeRefs } from './useMergeRefs-Bde85AWI-Bde85AWI.js';
|
|
11
|
+
|
|
12
|
+
import './Dialog.css';const dialog = "_dialog_8cy6o_3";
|
|
13
|
+
const container = "_container_8cy6o_23";
|
|
14
|
+
const content = "_content_8cy6o_36";
|
|
15
|
+
const header = "_header_8cy6o_43";
|
|
16
|
+
const footer = "_footer_8cy6o_63";
|
|
17
|
+
const large = "_large_8cy6o_100";
|
|
18
|
+
const fullscreen = "_fullscreen_8cy6o_100";
|
|
19
|
+
const sticky = "_sticky_8cy6o_120";
|
|
20
|
+
const styles = {
|
|
21
|
+
dialog: dialog,
|
|
22
|
+
container: container,
|
|
23
|
+
content: content,
|
|
24
|
+
header: header,
|
|
25
|
+
"close-container": "_close-container_8cy6o_56",
|
|
26
|
+
footer: footer,
|
|
27
|
+
large: large,
|
|
28
|
+
fullscreen: fullscreen,
|
|
29
|
+
sticky: sticky,
|
|
30
|
+
"close-button": "_close-button_8cy6o_126"
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function useDialogContext() {
|
|
34
|
+
const context = useContext(DialogContext);
|
|
35
|
+
if (!context) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
"useDialogContext must be used within a DialogContextProvider"
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return context;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const DialogCancelButton$1 = forwardRef((props, ref) => {
|
|
44
|
+
const { onClick, ...rest } = props;
|
|
45
|
+
const { close } = useDialogContext();
|
|
46
|
+
const onClickHandler = (e) => {
|
|
47
|
+
onClick?.(e);
|
|
48
|
+
close();
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
Button,
|
|
52
|
+
{
|
|
53
|
+
"aria-label": "Close dialog",
|
|
54
|
+
"data-anv": "dialog-cancel-button",
|
|
55
|
+
onClick: onClickHandler,
|
|
56
|
+
ref,
|
|
57
|
+
...rest
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
DialogCancelButton$1.displayName = "DialogCancelButton";
|
|
62
|
+
|
|
63
|
+
const DialogHeader$1 = forwardRef(
|
|
64
|
+
(props, ref) => {
|
|
65
|
+
const { children, className, ...rest } = props;
|
|
66
|
+
const headerClassNames = cx(className, styles["header"]);
|
|
67
|
+
return /* @__PURE__ */ jsxs(
|
|
68
|
+
"header",
|
|
69
|
+
{
|
|
70
|
+
className: headerClassNames,
|
|
71
|
+
"data-anv": "dialog-header",
|
|
72
|
+
ref,
|
|
73
|
+
...rest,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx(Text, { variant: "headline", el: "h1", children }),
|
|
76
|
+
/* @__PURE__ */ jsx("span", { className: styles["close-container"], children: /* @__PURE__ */ jsx(
|
|
77
|
+
DialogCancelButton$1,
|
|
78
|
+
{
|
|
79
|
+
className: styles["close-button"],
|
|
80
|
+
size: "small",
|
|
81
|
+
appearance: "ghost",
|
|
82
|
+
"aria-label": "Close dialog",
|
|
83
|
+
icon: SvgClose
|
|
84
|
+
}
|
|
85
|
+
) })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
DialogHeader$1.displayName = "DialogHeader";
|
|
92
|
+
|
|
93
|
+
const DialogFooter$1 = forwardRef(
|
|
94
|
+
(props, ref) => {
|
|
95
|
+
const { children, className, sticky = false, ...rest } = props;
|
|
96
|
+
const footerClassNames = cx(styles["footer"], className, {
|
|
97
|
+
[styles["sticky"]]: sticky
|
|
98
|
+
});
|
|
99
|
+
return /* @__PURE__ */ jsx(
|
|
100
|
+
"footer",
|
|
101
|
+
{
|
|
102
|
+
className: footerClassNames,
|
|
103
|
+
"data-anv": "dialog-footer",
|
|
104
|
+
ref,
|
|
105
|
+
...rest,
|
|
106
|
+
children
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
DialogFooter$1.displayName = "DialogFooter";
|
|
112
|
+
|
|
113
|
+
const DialogContent$1 = forwardRef(
|
|
114
|
+
(props, ref) => {
|
|
115
|
+
const { children, className, ...rest } = props;
|
|
116
|
+
const contentClassNames = cx(styles["content"], className);
|
|
117
|
+
return /* @__PURE__ */ jsx(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
className: contentClassNames,
|
|
121
|
+
"data-anv": "dialog-content",
|
|
122
|
+
ref,
|
|
123
|
+
...rest,
|
|
124
|
+
children
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
DialogContent$1.displayName = "DialogContent";
|
|
130
|
+
|
|
131
|
+
const DialogElement$1 = forwardRef(
|
|
132
|
+
(props, ref) => {
|
|
133
|
+
const {
|
|
134
|
+
className,
|
|
135
|
+
open = false,
|
|
136
|
+
children,
|
|
137
|
+
onOpen,
|
|
138
|
+
onOpenChange,
|
|
139
|
+
onClose,
|
|
140
|
+
onKeyDown,
|
|
141
|
+
fullScreen = false,
|
|
142
|
+
disableCloseOnEscape = false,
|
|
143
|
+
disableCloseOnClickOutside = false,
|
|
144
|
+
size,
|
|
145
|
+
enableScrollChaining,
|
|
146
|
+
...rest
|
|
147
|
+
} = props;
|
|
148
|
+
const elRef = useRef(null);
|
|
149
|
+
const contentRef = useRef(null);
|
|
150
|
+
const [hasOpenPopover, setHasOpenPopover] = useState(false);
|
|
151
|
+
const id = useId();
|
|
152
|
+
const DialogClassNames = cx([styles["dialog"]], className, {
|
|
153
|
+
[styles["fullscreen"]]: fullScreen,
|
|
154
|
+
[styles["large"]]: size === "large"
|
|
155
|
+
});
|
|
156
|
+
const { focusables } = useKeyboardFocusables(contentRef, {
|
|
157
|
+
observeChange: true
|
|
158
|
+
});
|
|
159
|
+
useDialogScrollLock({
|
|
160
|
+
open,
|
|
161
|
+
id,
|
|
162
|
+
enableScrollChaining,
|
|
163
|
+
elementRef: elRef
|
|
164
|
+
});
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (typeof document === "undefined" || disableCloseOnClickOutside) return;
|
|
167
|
+
const onClickOutsideHandler = (e) => {
|
|
168
|
+
if (hasOpenPopover) return;
|
|
169
|
+
if (e.composedPath()[0] === elRef.current) {
|
|
170
|
+
onClose?.();
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
document.addEventListener("mousedown", onClickOutsideHandler);
|
|
174
|
+
return () => document.removeEventListener("mousedown", onClickOutsideHandler);
|
|
175
|
+
}, [disableCloseOnClickOutside, onClose, onOpenChange, hasOpenPopover]);
|
|
176
|
+
const initial = useRef(true);
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if (initial.current) {
|
|
179
|
+
initial.current = false;
|
|
180
|
+
} else {
|
|
181
|
+
onOpenChange?.(open);
|
|
182
|
+
}
|
|
183
|
+
if (open) {
|
|
184
|
+
onOpen?.();
|
|
185
|
+
elRef.current?.showModal();
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
setTimeout(() => {
|
|
189
|
+
elRef.current?.close();
|
|
190
|
+
}, 1);
|
|
191
|
+
}, [id, onOpen, onOpenChange, open]);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
if (!open) return;
|
|
194
|
+
if (!focusables) return;
|
|
195
|
+
const activeElement = getActiveElement(document);
|
|
196
|
+
if (!activeElement) return;
|
|
197
|
+
if (activeElement.dataset.anv !== "dialog-header-close-button" && focusables.includes(activeElement)) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (focusables[0]?.dataset.anv === "dialog-header-close-button" && focusables[1]) {
|
|
201
|
+
focusables[1].focus();
|
|
202
|
+
} else {
|
|
203
|
+
focusables[0]?.focus();
|
|
204
|
+
}
|
|
205
|
+
}, [open, focusables]);
|
|
206
|
+
const onKeyDownHandler = (e) => {
|
|
207
|
+
onKeyDown?.(e);
|
|
208
|
+
if (e.code === "Escape") {
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
if (disableCloseOnEscape) return;
|
|
211
|
+
if (hasOpenPopover) return;
|
|
212
|
+
onClose?.();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (e.code === "Tab") {
|
|
216
|
+
if (e.shiftKey && e.target === focusables?.[0]) {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
focusables[focusables.length - 1]?.focus();
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (e.target === focusables?.[focusables.length - 1] && !e.shiftKey) {
|
|
222
|
+
e.preventDefault();
|
|
223
|
+
focusables[0].focus();
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const close = useCallback(() => {
|
|
229
|
+
onClose?.();
|
|
230
|
+
}, [onClose]);
|
|
231
|
+
return (
|
|
232
|
+
// dialog element does seem to be interactive on MDN guideline
|
|
233
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
234
|
+
/* @__PURE__ */ jsxs(
|
|
235
|
+
"dialog",
|
|
236
|
+
{
|
|
237
|
+
className: DialogClassNames,
|
|
238
|
+
"data-anv": "dialog",
|
|
239
|
+
"data-anv-scroll-chaining": enableScrollChaining,
|
|
240
|
+
ref: useMergeRefs([ref, elRef]),
|
|
241
|
+
onKeyDown: onKeyDownHandler,
|
|
242
|
+
...rest,
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ jsx(ToastProvider, { isDialogToaster: open, children: /* @__PURE__ */ jsx(ToasterPopover, { children: /* @__PURE__ */ jsx(ToasterContent, { id: "dialog-toaster" }) }) }),
|
|
245
|
+
/* @__PURE__ */ jsx(
|
|
246
|
+
DialogContext.Provider,
|
|
247
|
+
{
|
|
248
|
+
value: { close, ref: elRef, hasOpenPopover, setHasOpenPopover },
|
|
249
|
+
children: /* @__PURE__ */ jsx(
|
|
250
|
+
"section",
|
|
251
|
+
{
|
|
252
|
+
ref: contentRef,
|
|
253
|
+
className: styles["container"],
|
|
254
|
+
"data-open": open,
|
|
255
|
+
children
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
DialogElement$1.displayName = "Dialog";
|
|
267
|
+
const Dialog$1 = Object.assign(DialogElement$1, {
|
|
268
|
+
Header: DialogHeader$1,
|
|
269
|
+
Footer: DialogFooter$1,
|
|
270
|
+
Content: DialogContent$1,
|
|
271
|
+
CancelButton: DialogCancelButton$1
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const DialogElement = forwardRef(
|
|
275
|
+
(props, ref) => {
|
|
276
|
+
return /* @__PURE__ */ jsx(Dialog$1, { ref, ...props });
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
const DialogHeader = forwardRef(
|
|
280
|
+
(props, ref) => {
|
|
281
|
+
const data = {
|
|
282
|
+
children: childrenToString(props.children)
|
|
283
|
+
};
|
|
284
|
+
const trackingId = useTrackingId({
|
|
285
|
+
name: "Dialog",
|
|
286
|
+
data,
|
|
287
|
+
hasOverride: !!props["data-tracking-id"]
|
|
288
|
+
});
|
|
289
|
+
return /* @__PURE__ */ jsx(DialogHeader$1, { ref, "data-tracking-id": trackingId, ...props });
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
const DialogFooter = forwardRef(
|
|
293
|
+
(props, ref) => {
|
|
294
|
+
return /* @__PURE__ */ jsx(DialogFooter$1, { ref, ...props });
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
const DialogContent = forwardRef(
|
|
298
|
+
(props, ref) => {
|
|
299
|
+
return /* @__PURE__ */ jsx(DialogContent$1, { ref, ...props });
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
const DialogCancelButton = forwardRef(
|
|
303
|
+
(props, ref) => {
|
|
304
|
+
const data = {
|
|
305
|
+
title: props.title,
|
|
306
|
+
appearance: props.appearance,
|
|
307
|
+
size: props.size,
|
|
308
|
+
type: props.type
|
|
309
|
+
};
|
|
310
|
+
const trackingId = useTrackingId({
|
|
311
|
+
name: "DialogCancelButton",
|
|
312
|
+
data,
|
|
313
|
+
hasOverride: !!props["data-tracking-id"]
|
|
314
|
+
});
|
|
315
|
+
return /* @__PURE__ */ jsx(
|
|
316
|
+
DialogCancelButton$1,
|
|
317
|
+
{
|
|
318
|
+
ref,
|
|
319
|
+
"data-tracking-id": trackingId,
|
|
320
|
+
...props
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
const Dialog = Object.assign(DialogElement, {
|
|
326
|
+
Header: DialogHeader,
|
|
327
|
+
Footer: DialogFooter,
|
|
328
|
+
Content: DialogContent,
|
|
329
|
+
CancelButton: DialogCancelButton
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
export { Dialog as D, DialogHeader as a, DialogFooter as b, DialogContent as c, DialogCancelButton as d };
|
|
333
|
+
//# sourceMappingURL=Dialog-QtgPY3ji.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog-QtgPY3ji.js","sources":["../../hammer-react/dist/Dialog-DHe86y47.js","../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { jsx, jsxs } from 'react/jsx-runtime';\nimport { useContext, forwardRef, useRef, useState, useId, useEffect, useCallback } from 'react';\nimport cx from 'classnames';\nimport { D as DialogContext, p as useDialogScrollLock, o as getActiveElement, q as ToastProvider, r as ToasterPopover, v as ToasterContent } from './ProgressBar-DojG9LHF.js';\nimport Close from '@servicetitan/hammer-icon/mdi/round/close.svg';\nimport { T as Text } from './Text-BCRKWTMM.js';\nimport { B as Button } from './Button-CEDmdZ-2.js';\nimport { u as useKeyboardFocusables } from './useKeyboardFocusables-CwVMAe5C.js';\nimport { u as useMergeRefs } from './useMergeRefs-Bde85AWI.js';\n\nimport './Dialog.css';const dialog = \"_dialog_8cy6o_3\";\nconst container = \"_container_8cy6o_23\";\nconst content = \"_content_8cy6o_36\";\nconst header = \"_header_8cy6o_43\";\nconst footer = \"_footer_8cy6o_63\";\nconst large = \"_large_8cy6o_100\";\nconst fullscreen = \"_fullscreen_8cy6o_100\";\nconst sticky = \"_sticky_8cy6o_120\";\nconst styles = {\n\tdialog: dialog,\n\tcontainer: container,\n\tcontent: content,\n\theader: header,\n\t\"close-container\": \"_close-container_8cy6o_56\",\n\tfooter: footer,\n\tlarge: large,\n\tfullscreen: fullscreen,\n\tsticky: sticky,\n\t\"close-button\": \"_close-button_8cy6o_126\"\n};\n\nfunction useDialogContext() {\n const context = useContext(DialogContext);\n if (!context) {\n throw new Error(\n \"useDialogContext must be used within a DialogContextProvider\"\n );\n }\n return context;\n}\n\nconst DialogCancelButton = forwardRef((props, ref) => {\n const { onClick, ...rest } = props;\n const { close } = useDialogContext();\n const onClickHandler = (e) => {\n onClick?.(e);\n close();\n };\n return /* @__PURE__ */ jsx(\n Button,\n {\n \"aria-label\": \"Close dialog\",\n \"data-anv\": \"dialog-cancel-button\",\n onClick: onClickHandler,\n ref,\n ...rest\n }\n );\n});\nDialogCancelButton.displayName = \"DialogCancelButton\";\n\nconst DialogHeader = forwardRef(\n (props, ref) => {\n const { children, className, ...rest } = props;\n const headerClassNames = cx(className, styles[\"header\"]);\n return /* @__PURE__ */ jsxs(\n \"header\",\n {\n className: headerClassNames,\n \"data-anv\": \"dialog-header\",\n ref,\n ...rest,\n children: [\n /* @__PURE__ */ jsx(Text, { variant: \"headline\", el: \"h1\", children }),\n /* @__PURE__ */ jsx(\"span\", { className: styles[\"close-container\"], children: /* @__PURE__ */ jsx(\n DialogCancelButton,\n {\n className: styles[\"close-button\"],\n size: \"small\",\n appearance: \"ghost\",\n \"aria-label\": \"Close dialog\",\n icon: Close\n }\n ) })\n ]\n }\n );\n }\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = forwardRef(\n (props, ref) => {\n const { children, className, sticky = false, ...rest } = props;\n const footerClassNames = cx(styles[\"footer\"], className, {\n [styles[\"sticky\"]]: sticky\n });\n return /* @__PURE__ */ jsx(\n \"footer\",\n {\n className: footerClassNames,\n \"data-anv\": \"dialog-footer\",\n ref,\n ...rest,\n children\n }\n );\n }\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogContent = forwardRef(\n (props, ref) => {\n const { children, className, ...rest } = props;\n const contentClassNames = cx(styles[\"content\"], className);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n className: contentClassNames,\n \"data-anv\": \"dialog-content\",\n ref,\n ...rest,\n children\n }\n );\n }\n);\nDialogContent.displayName = \"DialogContent\";\n\nconst DialogElement = forwardRef(\n (props, ref) => {\n const {\n className,\n open = false,\n children,\n onOpen,\n onOpenChange,\n onClose,\n onKeyDown,\n fullScreen = false,\n disableCloseOnEscape = false,\n disableCloseOnClickOutside = false,\n size,\n enableScrollChaining,\n ...rest\n } = props;\n const elRef = useRef(null);\n const contentRef = useRef(null);\n const [hasOpenPopover, setHasOpenPopover] = useState(false);\n const id = useId();\n const DialogClassNames = cx([styles[\"dialog\"]], className, {\n [styles[\"fullscreen\"]]: fullScreen,\n [styles[\"large\"]]: size === \"large\"\n });\n const { focusables } = useKeyboardFocusables(contentRef, {\n observeChange: true\n });\n useDialogScrollLock({\n open,\n id,\n enableScrollChaining,\n elementRef: elRef\n });\n useEffect(() => {\n if (typeof document === \"undefined\" || disableCloseOnClickOutside) return;\n const onClickOutsideHandler = (e) => {\n if (hasOpenPopover) return;\n if (e.composedPath()[0] === elRef.current) {\n onClose?.();\n }\n };\n document.addEventListener(\"mousedown\", onClickOutsideHandler);\n return () => document.removeEventListener(\"mousedown\", onClickOutsideHandler);\n }, [disableCloseOnClickOutside, onClose, onOpenChange, hasOpenPopover]);\n const initial = useRef(true);\n useEffect(() => {\n if (initial.current) {\n initial.current = false;\n } else {\n onOpenChange?.(open);\n }\n if (open) {\n onOpen?.();\n elRef.current?.showModal();\n return;\n }\n setTimeout(() => {\n elRef.current?.close();\n }, 1);\n }, [id, onOpen, onOpenChange, open]);\n useEffect(() => {\n if (!open) return;\n if (!focusables) return;\n const activeElement = getActiveElement(document);\n if (!activeElement) return;\n if (activeElement.dataset.anv !== \"dialog-header-close-button\" && focusables.includes(activeElement)) {\n return;\n }\n if (focusables[0]?.dataset.anv === \"dialog-header-close-button\" && focusables[1]) {\n focusables[1].focus();\n } else {\n focusables[0]?.focus();\n }\n }, [open, focusables]);\n const onKeyDownHandler = (e) => {\n onKeyDown?.(e);\n if (e.code === \"Escape\") {\n e.preventDefault();\n if (disableCloseOnEscape) return;\n if (hasOpenPopover) return;\n onClose?.();\n return;\n }\n if (e.code === \"Tab\") {\n if (e.shiftKey && e.target === focusables?.[0]) {\n e.preventDefault();\n focusables[focusables.length - 1]?.focus();\n return;\n }\n if (e.target === focusables?.[focusables.length - 1] && !e.shiftKey) {\n e.preventDefault();\n focusables[0].focus();\n return;\n }\n }\n };\n const close = useCallback(() => {\n onClose?.();\n }, [onClose]);\n return (\n // dialog element does seem to be interactive on MDN guideline\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n /* @__PURE__ */ jsxs(\n \"dialog\",\n {\n className: DialogClassNames,\n \"data-anv\": \"dialog\",\n \"data-anv-scroll-chaining\": enableScrollChaining,\n ref: useMergeRefs([ref, elRef]),\n onKeyDown: onKeyDownHandler,\n ...rest,\n children: [\n /* @__PURE__ */ jsx(ToastProvider, { isDialogToaster: open, children: /* @__PURE__ */ jsx(ToasterPopover, { children: /* @__PURE__ */ jsx(ToasterContent, { id: \"dialog-toaster\" }) }) }),\n /* @__PURE__ */ jsx(\n DialogContext.Provider,\n {\n value: { close, ref: elRef, hasOpenPopover, setHasOpenPopover },\n children: /* @__PURE__ */ jsx(\n \"section\",\n {\n ref: contentRef,\n className: styles[\"container\"],\n \"data-open\": open,\n children\n }\n )\n }\n )\n ]\n }\n )\n );\n }\n);\nDialogElement.displayName = \"Dialog\";\nconst Dialog = Object.assign(DialogElement, {\n Header: DialogHeader,\n Footer: DialogFooter,\n Content: DialogContent,\n CancelButton: DialogCancelButton\n});\n\nexport { Dialog as D, DialogCancelButton as a, DialogContent as b, DialogFooter as c, DialogHeader as d };\n//# sourceMappingURL=Dialog-DHe86y47.js.map\n","import {\n Dialog as CoreDialog,\n DialogHeader as CoreDialogHeader,\n DialogFooter as CoreDialogFooter,\n DialogContent as CoreDialogContent,\n DialogCancelButton as CoreDialogCancelButton,\n DialogProps as CoreDialogProps,\n DialogHeaderProps as CoreDialogHeaderProps,\n DialogFooterProps as CoreDialogFooterProps,\n DialogContentProps as CoreDialogContentProps,\n DialogCancelButtonProps as CoreDialogCancelButtonProps,\n childrenToString,\n} from \"@servicetitan/hammer-react\";\nimport { Ref, forwardRef } from \"react\";\nimport { useTrackingId } from \"../../hooks/useTrackingId\";\nimport { DataTrackingId } from \"../../types/DataTrackingId\";\n\nexport type DialogProps = CoreDialogProps;\nexport type DialogHeaderProps = CoreDialogHeaderProps & DataTrackingId;\nexport type DialogFooterProps = CoreDialogFooterProps;\nexport type DialogContentProps = CoreDialogContentProps;\nexport type DialogCancelButtonProps = CoreDialogCancelButtonProps &\n DataTrackingId;\n\nconst DialogElement = forwardRef(\n (props: DialogProps, ref: Ref<HTMLDialogElement>) => {\n return <CoreDialog ref={ref} {...props} />;\n },\n);\n\nexport const DialogHeader = forwardRef(\n (props: DialogHeaderProps, ref: Ref<HTMLDivElement>) => {\n const data = {\n children: childrenToString(props.children),\n };\n\n const trackingId = useTrackingId({\n name: \"Dialog\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n return (\n <CoreDialogHeader ref={ref} data-tracking-id={trackingId} {...props} />\n );\n },\n);\nexport const DialogFooter = forwardRef(\n (props: DialogFooterProps, ref: Ref<HTMLDivElement>) => {\n return <CoreDialogFooter ref={ref} {...props} />;\n },\n);\nexport const DialogContent = forwardRef(\n (props: DialogContentProps, ref: Ref<HTMLDivElement>) => {\n return <CoreDialogContent ref={ref} {...props} />;\n },\n);\nexport const DialogCancelButton = forwardRef(\n (props: DialogCancelButtonProps, ref: Ref<HTMLButtonElement>) => {\n const data = {\n title: props.title,\n appearance: props.appearance,\n size: props.size,\n type: props.type,\n };\n\n const trackingId = useTrackingId({\n name: \"DialogCancelButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n return (\n <CoreDialogCancelButton\n ref={ref}\n data-tracking-id={trackingId}\n {...props}\n />\n );\n },\n);\n\nexport const Dialog = Object.assign(DialogElement, {\n Header: DialogHeader,\n Footer: DialogFooter,\n Content: DialogContent,\n CancelButton: DialogCancelButton,\n});\n"],"names":["DialogCancelButton","DialogHeader","Close","DialogFooter","DialogContent","DialogElement","Dialog","CoreDialog","CoreDialogHeader","CoreDialogFooter","CoreDialogContent","CoreDialogCancelButton"],"mappings":";;;;;;;;;;;AAUsB,MAA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N;AAEa,MAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAO,aAAe,EAAA;AAAA,EACjD,MAAQ,EAAA,YAAA;AAAA,EACR,MAAQ,EAAA,YAAA;AAAA,EACR,OAAS,EAAA,aAAA;AAAA,EACT,YAAc,EAAA;AAChB,CAAC;;;;"}
|
package/dist/Dialog.css
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400;1,6..12,600;1,6..12,700&display=swap");@layer starter, reset, base, state, application;
|
|
2
|
+
|
|
3
|
+
@layer starter, reset, base, state, application;
|
|
4
|
+
@layer base {
|
|
5
|
+
._dialog_8cy6o_3 {
|
|
6
|
+
border: none;
|
|
7
|
+
background: transparent;
|
|
8
|
+
padding-block: 0;
|
|
9
|
+
padding-inline: 0;
|
|
10
|
+
outline: none;
|
|
11
|
+
animation: _close-dialog_8cy6o_1 2s forwards;
|
|
12
|
+
border: 0.0625rem solid var(--border-color-subdued, #dfe0e1);
|
|
13
|
+
border-radius: 0.75rem;
|
|
14
|
+
max-width: 22.5rem;
|
|
15
|
+
width: calc(100% - 1.5rem);
|
|
16
|
+
background-color: var(--background-color, #ffffff);
|
|
17
|
+
overflow: visible;
|
|
18
|
+
overflow: clip;
|
|
19
|
+
--ypos: 1.5rem;
|
|
20
|
+
--dialog-padding: 1.5rem;
|
|
21
|
+
}
|
|
22
|
+
._dialog_8cy6o_3::backdrop {
|
|
23
|
+
background: #040404;
|
|
24
|
+
}
|
|
25
|
+
._dialog_8cy6o_3 ._container_8cy6o_23 {
|
|
26
|
+
font-family: var(--font-family-base, "Nunito Sans", sans-serif);
|
|
27
|
+
font-size: 100%;
|
|
28
|
+
color: var(--foreground-color, #141414);
|
|
29
|
+
display: flex;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
background-color: inherit;
|
|
33
|
+
border-radius: 0.75rem;
|
|
34
|
+
max-height: calc(100dvh - 2rem);
|
|
35
|
+
overflow: auto;
|
|
36
|
+
overscroll-behavior: contain;
|
|
37
|
+
}
|
|
38
|
+
._dialog_8cy6o_3 ._container_8cy6o_23 ._content_8cy6o_36 {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-grow: 1;
|
|
41
|
+
padding-block-start: 0.25rem;
|
|
42
|
+
padding-block-end: 0.25rem;
|
|
43
|
+
padding-inline: var(--dialog-padding);
|
|
44
|
+
}
|
|
45
|
+
._dialog_8cy6o_3 ._header_8cy6o_43 {
|
|
46
|
+
position: sticky;
|
|
47
|
+
top: 0;
|
|
48
|
+
display: flex;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
padding-block: var(--dialog-padding);
|
|
51
|
+
padding-inline: var(--dialog-padding);
|
|
52
|
+
background-color: var(--background-color, #ffffff);
|
|
53
|
+
z-index: 1;
|
|
54
|
+
}
|
|
55
|
+
._dialog_8cy6o_3 ._header_8cy6o_43 h1 {
|
|
56
|
+
margin: 0;
|
|
57
|
+
}
|
|
58
|
+
._dialog_8cy6o_3 ._header_8cy6o_43 ._close-container_8cy6o_56 {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
align-items: center;
|
|
62
|
+
width: 1.5625rem;
|
|
63
|
+
height: 1.5625rem;
|
|
64
|
+
}
|
|
65
|
+
._dialog_8cy6o_3 ._footer_8cy6o_63 {
|
|
66
|
+
display: flex;
|
|
67
|
+
gap: 0.5rem;
|
|
68
|
+
justify-content: flex-end;
|
|
69
|
+
padding-block: var(--dialog-padding);
|
|
70
|
+
padding-inline: var(--dialog-padding);
|
|
71
|
+
background-color: var(--background-color, #ffffff);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
@layer state {
|
|
75
|
+
._dialog_8cy6o_3[open] {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
transform: translateY(0%);
|
|
78
|
+
}
|
|
79
|
+
._dialog_8cy6o_3 {
|
|
80
|
+
opacity: 0;
|
|
81
|
+
transform: translateY(var(--ypos));
|
|
82
|
+
transition: all 300ms allow-discrete;
|
|
83
|
+
}
|
|
84
|
+
@starting-style {
|
|
85
|
+
._dialog_8cy6o_3[open] {
|
|
86
|
+
opacity: 0;
|
|
87
|
+
transform: translateY(var(--ypos));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
._dialog_8cy6o_3::backdrop {
|
|
91
|
+
opacity: 0;
|
|
92
|
+
transition: all 300ms allow-discrete;
|
|
93
|
+
}
|
|
94
|
+
._dialog_8cy6o_3[open]::backdrop {
|
|
95
|
+
opacity: 0.6;
|
|
96
|
+
}
|
|
97
|
+
@starting-style {
|
|
98
|
+
._dialog_8cy6o_3[open]::backdrop {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
._dialog_8cy6o_3._large_8cy6o_100:not(._fullscreen_8cy6o_100) {
|
|
103
|
+
max-width: 35rem;
|
|
104
|
+
}
|
|
105
|
+
._dialog_8cy6o_3._fullscreen_8cy6o_100 {
|
|
106
|
+
margin: 0;
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 100%;
|
|
109
|
+
max-width: 100%;
|
|
110
|
+
max-height: 100%;
|
|
111
|
+
border: none;
|
|
112
|
+
border-radius: 0;
|
|
113
|
+
--ypos: 2.5rem;
|
|
114
|
+
}
|
|
115
|
+
._dialog_8cy6o_3._fullscreen_8cy6o_100 > ._container_8cy6o_23 {
|
|
116
|
+
min-height: -webkit-fill-available;
|
|
117
|
+
min-height: -moz-available;
|
|
118
|
+
min-height: stretch;
|
|
119
|
+
border-radius: 0;
|
|
120
|
+
}
|
|
121
|
+
._dialog_8cy6o_3._fullscreen_8cy6o_100::backdrop {
|
|
122
|
+
background-color: #ffffff;
|
|
123
|
+
}
|
|
124
|
+
._dialog_8cy6o_3 ._footer_8cy6o_63._sticky_8cy6o_120 {
|
|
125
|
+
position: sticky;
|
|
126
|
+
inset-block-end: 0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
@layer application {
|
|
130
|
+
._dialog_8cy6o_3 ._header_8cy6o_43 ._close-button_8cy6o_126 {
|
|
131
|
+
color: var(--foreground-color, #141414);
|
|
132
|
+
}
|
|
133
|
+
@media (prefers-reduced-motion: reduce) {
|
|
134
|
+
._dialog_8cy6o_3 {
|
|
135
|
+
--ypos: 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
body:has(
|
|
140
|
+
dialog[data-anv="dialog"][open]:not([data-anv-scroll-chaining="true"])
|
|
141
|
+
) {
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
}
|
|
144
|
+
body:has([data-anv-dialogs-open="true"]) {
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
package/dist/Dialog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { D as Dialog, d as DialogCancelButton, c as DialogContent, b as DialogFooter, a as DialogHeader, D as default } from './Dialog-
|
|
1
|
+
export { D as Dialog, d as DialogCancelButton, c as DialogContent, b as DialogFooter, a as DialogHeader, D as default } from './Dialog-QtgPY3ji.js';
|
|
2
2
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { useLayoutEffect, useEffect, useMemo, useRef, useCallback, useState, memo, useContext, createContext, useReducer, forwardRef, cloneElement } from 'react';
|
|
4
4
|
import { unstable_batchedUpdates, createPortal } from 'react-dom';
|
|
5
5
|
import { c as cx } from './index-tZvMCc77.js';
|
|
6
|
-
import { F as Flex } from './Flex-
|
|
6
|
+
import { F as Flex } from './Flex-CLu2TnzF-aW2OhBYv.js';
|
|
7
7
|
import { B as ButtonCompound } from './ButtonCompound-BeUo4_Zv-psxZY03N.js';
|
|
8
8
|
import { C as Card } from './Card-DukbBYaA-C2a2vYKk.js';
|
|
9
9
|
import { I as Icon } from './Icon-DuwR7O2z-C_rTZRSc.js';
|
|
@@ -5619,4 +5619,4 @@ const DndSort = Object.assign(DndSort$1, {
|
|
|
5619
5619
|
});
|
|
5620
5620
|
|
|
5621
5621
|
export { DndSort as D, DndSortCard as a, DndSortZone as b };
|
|
5622
|
-
//# sourceMappingURL=DndSort-
|
|
5622
|
+
//# sourceMappingURL=DndSort-BVcdqJLB.js.map
|