@plexui/ui 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronLeft, ChevronRight } from "../Icon/index.js";
2
+ import { ChevronLeft, ChevronLeftLg, ChevronRight, ChevronRightLg } from "../Icon/index.js";
3
3
  import s from "@plexui/styles/components/DatePicker/CalendarNavigationIcon.module.css";
4
- // Outlined Figma Compact calendar arrows, nodes 495:46787 and 495:46788.
5
- // Keep the 15x24 text boxes and their ink offsets; no SF Symbols font is needed.
6
- const PREVIOUS_PATH = "M0 8.64258C0 8.47331 0.0292969 8.31706 0.0878906 8.17383C0.152995 8.0306 0.250651 7.89388 0.380859 7.76367L7.98828 0.322266C8.20964 0.107422 8.47656 0 8.78906 0C9.00391 0 9.19596 0.0520833 9.36523 0.15625C9.54102 0.253906 9.68099 0.38737 9.78516 0.556641C9.88932 0.725911 9.94141 0.917969 9.94141 1.13281C9.94141 1.4388 9.82096 1.71224 9.58008 1.95312L2.72461 8.64258L9.58008 15.332C9.82096 15.5729 9.94141 15.8496 9.94141 16.1621C9.94141 16.3704 9.88932 16.5592 9.78516 16.7285C9.68099 16.9043 9.54102 17.041 9.36523 17.1387C9.19596 17.2428 9.00391 17.2949 8.78906 17.2949C8.47656 17.2949 8.20964 17.1842 7.98828 16.9629L0.380859 9.52148C0.250651 9.39128 0.152995 9.25456 0.0878906 9.11133C0.0292969 8.9681 0 8.81185 0 8.64258Z";
7
- const NEXT_PATH = "M9.94141 8.64258C9.94141 8.81185 9.90885 8.9681 9.84375 9.11133C9.77865 9.25456 9.68099 9.39128 9.55078 9.52148L1.94336 16.9629C1.72852 17.1842 1.46159 17.2949 1.14258 17.2949C0.934245 17.2949 0.742188 17.2428 0.566406 17.1387C0.390625 17.041 0.250651 16.9043 0.146484 16.7285C0.0488281 16.5592 0 16.3704 0 16.1621C0 15.8496 0.117188 15.5729 0.351562 15.332L7.20703 8.64258L0.351562 1.95312C0.117188 1.71224 0 1.4388 0 1.13281C0 0.917969 0.0488281 0.725911 0.146484 0.556641C0.250651 0.38737 0.390625 0.253906 0.566406 0.15625C0.742188 0.0520833 0.934245 0 1.14258 0C1.46159 0 1.72852 0.107422 1.94336 0.322266L9.55078 7.76367C9.68099 7.89388 9.77865 8.0306 9.84375 8.17383C9.90885 8.31706 9.94141 8.47331 9.94141 8.64258Z";
4
+ // On a phone the arrows keep the 15x24 boxes of the iOS month arrows and the centres of their ink (6.2 and 8.8
5
+ // from the leading edge, 12 from the top), drawn with the large Plex UI chevrons: Apple's symbols may not ship on
6
+ // the web. Each 24px chevron is cut to its box by the viewBox.
7
+ const PHONE_VIEW_BOX = { previous: "5.28 0 15 24", next: "3.71 0 15 24" };
8
8
  export const CalendarNavigationIcon = ({ direction }) => {
9
9
  const previous = direction === "previous";
10
10
  const DesktopIcon = previous ? ChevronLeft : ChevronRight;
11
- return (_jsxs(_Fragment, { children: [_jsx(DesktopIcon, { className: s.DesktopIcon, "data-no-autosize": "" }), _jsx("svg", { className: s.PhoneIcon, "data-direction": direction, "data-no-autosize": "", width: "15", height: "24", viewBox: "0 0 15 24", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { d: previous ? PREVIOUS_PATH : NEXT_PATH, transform: `translate(${previous ? 1.25 : 3.818359375} 3.306640625)` }) })] }));
11
+ const PhoneIcon = previous ? ChevronLeftLg : ChevronRightLg;
12
+ return (_jsxs(_Fragment, { children: [_jsx(DesktopIcon, { className: s.DesktopIcon, "data-no-autosize": "" }), _jsx(PhoneIcon, { className: s.PhoneIcon, "data-direction": direction, "data-no-autosize": "", width: "15", height: "24", viewBox: PHONE_VIEW_BOX[direction] })] }));
12
13
  };
13
14
  //# sourceMappingURL=CalendarNavigationIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarNavigationIcon.js","sourceRoot":"","sources":["../../../../src/components/DatePicker/CalendarNavigationIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,CAAC,MAAM,wEAAwE,CAAA;AAItF,yEAAyE;AACzE,iFAAiF;AACjF,MAAM,aAAa,GAAG,0tBAA0tB,CAAA;AAChvB,MAAM,SAAS,GAAG,otBAAotB,CAAA;AAEtuB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAE,SAAS,EAA+B,EAAE,EAAE;IACnF,MAAM,QAAQ,GAAG,SAAS,KAAK,UAAU,CAAA;IACzC,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAA;IAEzD,OAAO,CACL,8BACE,KAAC,WAAW,IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,sBAAmB,EAAE,GAAG,EAC7D,cACE,SAAS,EAAE,CAAC,CAAC,SAAS,oBACN,SAAS,sBACR,EAAE,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,iBACP,MAAM,YAElB,eACE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EACvC,SAAS,EAAE,aAAa,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,eAAe,GACpE,GACE,IACL,CACJ,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ChevronLeft, ChevronRight } from \"../Icon\"\nimport s from \"@plexui/styles/components/DatePicker/CalendarNavigationIcon.module.css\"\n\ntype CalendarNavigationIconProps = { direction: \"previous\" | \"next\" }\n\n// Outlined Figma Compact calendar arrows, nodes 495:46787 and 495:46788.\n// Keep the 15x24 text boxes and their ink offsets; no SF Symbols font is needed.\nconst PREVIOUS_PATH = \"M0 8.64258C0 8.47331 0.0292969 8.31706 0.0878906 8.17383C0.152995 8.0306 0.250651 7.89388 0.380859 7.76367L7.98828 0.322266C8.20964 0.107422 8.47656 0 8.78906 0C9.00391 0 9.19596 0.0520833 9.36523 0.15625C9.54102 0.253906 9.68099 0.38737 9.78516 0.556641C9.88932 0.725911 9.94141 0.917969 9.94141 1.13281C9.94141 1.4388 9.82096 1.71224 9.58008 1.95312L2.72461 8.64258L9.58008 15.332C9.82096 15.5729 9.94141 15.8496 9.94141 16.1621C9.94141 16.3704 9.88932 16.5592 9.78516 16.7285C9.68099 16.9043 9.54102 17.041 9.36523 17.1387C9.19596 17.2428 9.00391 17.2949 8.78906 17.2949C8.47656 17.2949 8.20964 17.1842 7.98828 16.9629L0.380859 9.52148C0.250651 9.39128 0.152995 9.25456 0.0878906 9.11133C0.0292969 8.9681 0 8.81185 0 8.64258Z\"\nconst NEXT_PATH = \"M9.94141 8.64258C9.94141 8.81185 9.90885 8.9681 9.84375 9.11133C9.77865 9.25456 9.68099 9.39128 9.55078 9.52148L1.94336 16.9629C1.72852 17.1842 1.46159 17.2949 1.14258 17.2949C0.934245 17.2949 0.742188 17.2428 0.566406 17.1387C0.390625 17.041 0.250651 16.9043 0.146484 16.7285C0.0488281 16.5592 0 16.3704 0 16.1621C0 15.8496 0.117188 15.5729 0.351562 15.332L7.20703 8.64258L0.351562 1.95312C0.117188 1.71224 0 1.4388 0 1.13281C0 0.917969 0.0488281 0.725911 0.146484 0.556641C0.250651 0.38737 0.390625 0.253906 0.566406 0.15625C0.742188 0.0520833 0.934245 0 1.14258 0C1.46159 0 1.72852 0.107422 1.94336 0.322266L9.55078 7.76367C9.68099 7.89388 9.77865 8.0306 9.84375 8.17383C9.90885 8.31706 9.94141 8.47331 9.94141 8.64258Z\"\n\nexport const CalendarNavigationIcon = ({ direction }: CalendarNavigationIconProps) => {\n const previous = direction === \"previous\"\n const DesktopIcon = previous ? ChevronLeft : ChevronRight\n\n return (\n <>\n <DesktopIcon className={s.DesktopIcon} data-no-autosize=\"\" />\n <svg\n className={s.PhoneIcon}\n data-direction={direction}\n data-no-autosize=\"\"\n width=\"15\"\n height=\"24\"\n viewBox=\"0 0 15 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n d={previous ? PREVIOUS_PATH : NEXT_PATH}\n transform={`translate(${previous ? 1.25 : 3.818359375} 3.306640625)`}\n />\n </svg>\n </>\n )\n}\n"]}
1
+ {"version":3,"file":"CalendarNavigationIcon.js","sourceRoot":"","sources":["../../../../src/components/DatePicker/CalendarNavigationIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAClF,OAAO,CAAC,MAAM,wEAAwE,CAAA;AAItF,+GAA+G;AAC/G,kHAAkH;AAClH,+DAA+D;AAC/D,MAAM,cAAc,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,CAAA;AAEzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAE,SAAS,EAA+B,EAAE,EAAE;IACnF,MAAM,QAAQ,GAAG,SAAS,KAAK,UAAU,CAAA;IACzC,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAA;IACzD,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAA;IAE3D,OAAO,CACL,8BACE,KAAC,WAAW,IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,sBAAmB,EAAE,GAAG,EAC7D,KAAC,SAAS,IACR,SAAS,EAAE,CAAC,CAAC,SAAS,oBACN,SAAS,sBACR,EAAE,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,GAClC,IACD,CACJ,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ChevronLeft, ChevronLeftLg, ChevronRight, ChevronRightLg } from \"../Icon\"\nimport s from \"@plexui/styles/components/DatePicker/CalendarNavigationIcon.module.css\"\n\ntype CalendarNavigationIconProps = { direction: \"previous\" | \"next\" }\n\n// On a phone the arrows keep the 15x24 boxes of the iOS month arrows and the centres of their ink (6.2 and 8.8\n// from the leading edge, 12 from the top), drawn with the large Plex UI chevrons: Apple's symbols may not ship on\n// the web. Each 24px chevron is cut to its box by the viewBox.\nconst PHONE_VIEW_BOX = { previous: \"5.28 0 15 24\", next: \"3.71 0 15 24\" }\n\nexport const CalendarNavigationIcon = ({ direction }: CalendarNavigationIconProps) => {\n const previous = direction === \"previous\"\n const DesktopIcon = previous ? ChevronLeft : ChevronRight\n const PhoneIcon = previous ? ChevronLeftLg : ChevronRightLg\n\n return (\n <>\n <DesktopIcon className={s.DesktopIcon} data-no-autosize=\"\" />\n <PhoneIcon\n className={s.PhoneIcon}\n data-direction={direction}\n data-no-autosize=\"\"\n width=\"15\"\n height=\"24\"\n viewBox={PHONE_VIEW_BOX[direction]}\n />\n </>\n )\n}\n"]}
@@ -46,7 +46,7 @@ export const Dialog = ({ open: controlledOpen, onOpenChange: controlledOnOpenCha
46
46
  const Trigger = ({ children }) => {
47
47
  return _jsx(RadixDialog.Trigger, { asChild: true, children: children });
48
48
  };
49
- const Content = ({ children, width = 480, showClose = true, pill = false, className, placement = "center", mobilePlacement: requestedMobilePlacement, mobileVariant, surface = "plain", onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onInteractOutside, zIndex, rootProps, overlayProps, layout = "auto", ...rest }) => {
49
+ const Content = ({ children, width = 480, showClose = true, pill = false, className, placement = "center", mobilePlacement: requestedMobilePlacement, mobileVariant: requestedMobileVariant, surface = "plain", onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onInteractOutside, zIndex, rootProps, overlayProps, layout = "auto", ...rest }) => {
50
50
  const { open, setOpen } = useDialogContext();
51
51
  const outerPhoneLayout = useContext(PhoneLayoutContext);
52
52
  // A dialog laid out as on a phone by its own prop, outside a PhoneLayout, keeps the window: what it holds and
@@ -55,9 +55,12 @@ const Content = ({ children, width = 480, showClose = true, pill = false, classN
55
55
  const [content, setContent] = useState(null);
56
56
  useDialogViewport(content, outerPhoneLayout?.container ?? null);
57
57
  const overlaySurfaceRef = usePopoverDismissableSurface();
58
+ // A phone has no other modal view than the sheet and the alert (owner 12.11: «нет такого в iOS»): a centered
59
+ // dialog is an alert, any other a sheet, at the bottom or over the whole screen.
60
+ const mobileVariant = requestedMobileVariant ?? (requestedMobilePlacement === "center" ? "alert" : "sheet");
58
61
  const mobilePlacement = mobileVariant === "alert"
59
62
  ? "center"
60
- : requestedMobilePlacement ?? (mobileVariant === "sheet" ? "bottom" : undefined);
63
+ : (requestedMobilePlacement ?? placement) === "fullscreen" ? "fullscreen" : "bottom";
61
64
  const [exitGuard] = useState(createExitGuard);
62
65
  const [panel, setPanel] = useState(null);
63
66
  // Dialog.Body reports where content lies under the bars: they show their lines with it.
@@ -75,7 +78,12 @@ const Content = ({ children, width = 480, showClose = true, pill = false, classN
75
78
  const setRoot = boundary.setRoot;
76
79
  const setPanelRef = useCallback((node) => { setPanel(node); setRoot(node); }, [setRoot]);
77
80
  const openedAt = useRef(0);
78
- const crossesScreen = placement === "bottom" || placement === "start" || placement === "end" || placement === "fullscreen" || mobilePlacement === "bottom" || mobilePlacement === "fullscreen";
81
+ // A sheet crosses the screen on a phone, and wherever its owner asked for one; a dialog left to its defaults stays
82
+ // the centred panel on a desktop, with that panel's timing.
83
+ const phone = usePhoneLayout() || layout === "phone";
84
+ const sheetCrosses = (phone || requestedMobileVariant === "sheet" || requestedMobilePlacement !== undefined) &&
85
+ (mobilePlacement === "bottom" || mobilePlacement === "fullscreen");
86
+ const crossesScreen = placement === "bottom" || placement === "start" || placement === "end" || placement === "fullscreen" || sheetCrosses;
79
87
  // The content of a closing dialog is frozen for its exit, so this reads the owner's latest
80
88
  // handler: state that changes together with the close decides where focus returns.
81
89
  const handleCloseAutoFocus = useStableCallback((event) => {
@@ -95,11 +103,23 @@ const Content = ({ children, width = 480, showClose = true, pill = false, classN
95
103
  if (open)
96
104
  openedAt.current = performance.now();
97
105
  }, [open]);
106
+ // A sheet pulled down asks as a press outside does: an owner that keeps the dialog open on one, such as a form
107
+ // with unsaved changes, keeps it on the other, and the sheet returns.
108
+ const dismissByDrag = useStableCallback((originalEvent) => {
109
+ if (onInteractOutside) {
110
+ const request = new CustomEvent("dialog.sheetDrag", { cancelable: true, detail: { originalEvent } });
111
+ onInteractOutside(request);
112
+ if (request.defaultPrevented)
113
+ return false;
114
+ }
115
+ setOpen(false);
116
+ return true;
117
+ });
98
118
  useEffect(() => {
99
119
  if (!panel || mobilePlacement !== "bottom")
100
120
  return undefined;
101
- return attachSheetDrag(panel, () => setOpen(false));
102
- }, [panel, mobilePlacement, setOpen]);
121
+ return attachSheetDrag(panel, dismissByDrag);
122
+ }, [panel, mobilePlacement, dismissByDrag]);
103
123
  useLayoutEffect(() => {
104
124
  if (!panel)
105
125
  return;
@@ -162,6 +182,7 @@ const headerParts = (children, prefix = "") => Children.toArray(children).flatMa
162
182
  return [prefix ? cloneElement(part, { key: `${prefix}${String(part.key)}` }) : part];
163
183
  });
164
184
  const isHeaderAction = (part) => isValidElement(part) && part.type === HeaderAction;
185
+ const isLeadingAction = (part) => isHeaderAction(part) && part.props.side === "leading";
165
186
  const isDescription = (part) => isValidElement(part) && part.type === Description;
166
187
  const Header = ({ children, className, background = "glass" }) => {
167
188
  const sheet = useContext(DialogSheetContext);
@@ -175,15 +196,17 @@ const Header = ({ children, className, background = "glass" }) => {
175
196
  // On a phone the header of a Sheet is its Toolbar (iOS 27 kit Sheets 507-24684, Toolbar - Top - iPhone
176
197
  // 1-54520): Close at the leading edge, the title alone centered on the row of controls, the header actions
177
198
  // at the trailing edge, all on one 44px row 16px under the top edge.
178
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { background: background, className: className, "data-dialog-bar": "", children: _jsxs(DialogBarContext.Provider, { value: true, children: [sheet.showClose && (_jsx(Toolbar.Leading, { className: s.BarClose, children: _jsx(RadixDialog.Close, { asChild: true, children: _jsx(NavigationButton, { action: "close", variant: "ghost", "aria-label": "Close dialog" }) }) })), _jsx("div", { className: clsx(t.Heading, s.BarHeading), children: parts.filter((part) => !isHeaderAction(part) && !isDescription(part)) }), parts.filter(isHeaderAction)] }) }), description && (sheet.descriptionSlot ? createPortal(description, sheet.descriptionSlot) : description)] }));
199
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { background: background, className: className, "data-dialog-bar": "", children: _jsxs(DialogBarContext.Provider, { value: true, children: [sheet.showClose && !parts.some(isLeadingAction) && (_jsx(Toolbar.Leading, { className: s.BarClose, children: _jsx(RadixDialog.Close, { asChild: true, children: _jsx(NavigationButton, { action: "close", variant: "ghost", "aria-label": "Close dialog" }) }) })), parts.filter(isLeadingAction), _jsx("div", { className: clsx(t.Heading, s.BarHeading), children: parts.filter((part) => !isHeaderAction(part) && !isDescription(part)) }), parts.filter((part) => isHeaderAction(part) && !isLeadingAction(part))] }) }), description && (sheet.descriptionSlot ? createPortal(description, sheet.descriptionSlot) : description)] }));
179
200
  }
180
201
  return _jsx("div", { className: clsx(s.Header, className), "data-background": background, "data-scrolled": scrolled ? "" : undefined, children: children });
181
202
  };
182
- const HeaderAction = ({ children, className }) => {
203
+ const HeaderAction = ({ children, className, side = "trailing" }) => {
183
204
  const bar = useContext(DialogBarContext);
205
+ if (bar && side === "leading")
206
+ return _jsx(Toolbar.Leading, { className: clsx(s.BarClose, className), children: children });
184
207
  if (bar)
185
208
  return _jsx(Toolbar.Trailing, { className: className, children: children });
186
- return _jsx("div", { className: clsx(s.HeaderAction, className), children: children });
209
+ return _jsx("div", { className: clsx(s.HeaderAction, className), "data-side": side === "leading" ? "leading" : undefined, children: children });
187
210
  };
188
211
  /** The scrolling part between Header and Footer: with it, only the body scrolls */
189
212
  const Body = ({ children, className }) => {
@@ -216,7 +239,13 @@ const DescriptionSlot = () => {
216
239
  const Footer = ({ children, className, mobileLayout, background = "soft" }) => {
217
240
  const setFooter = useFloatingBoundaryRegistration()?.setFooter;
218
241
  const contentBelow = useContext(DialogScrollContext)?.edges.contentBelow;
219
- return (_jsx("div", { ref: setFooter, className: clsx(s.Footer, className), "data-mobile-layout": mobileLayout, "data-background": background, "data-content-below": contentBelow ? "" : undefined, children: children }));
242
+ const sheet = useContext(DialogSheetContext);
243
+ const phone = usePhoneLayout();
244
+ // A phone Sheet stacks its main action on top, as an iOS setup sheet does. A footer is written with it last,
245
+ // where a desktop row ends, so the order is turned in the page itself: focus and a screen reader meet the
246
+ // actions in the order they are seen.
247
+ const parts = sheet && phone && mobileLayout !== "inline" ? headerParts(children).reverse() : children;
248
+ return (_jsx("div", { ref: setFooter, className: clsx(s.Footer, className), "data-mobile-layout": mobileLayout, "data-background": background, "data-content-below": contentBelow ? "" : undefined, children: parts }));
220
249
  };
221
250
  const Title = ({ children, className }) => {
222
251
  const bar = useContext(DialogBarContext);
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AACrI,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,iBAAiB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AE,EAAE,EAAC,KAAK,EAAC,OAAO,QAAC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,YAC5K,kCAAiC,EAAE,EAAC,QAAQ,EAAE,CAAC,CAAC,YAAG,QAAQ,IAAjD,IAAI,CAAoD,GAClD,GACd,CACP,CAAA;AAED,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAA2B,EAAE,EAAE;IACtD,OAAO,KAAC,WAAW,CAAC,KAAK,IAAC,OAAO,kBAAE,QAAQ,GAAqB,CAAA;AAClE,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;AACxB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;AACxB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAA;AAClC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;AAClB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;AACpB,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;AAChC,MAAM,CAAC,eAAe,GAAG,eAAe,CAAA;AACxC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;AACpB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { Dialog as RadixDialog } from \"radix-ui\"\nimport {\n Children,\n cloneElement,\n createContext,\n Fragment,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { FloatingBoundaryProvider, useFloatingBoundaryRegistration, useFloatingBoundaryScope } from \"../../hooks/useFloatingBoundary\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { inToastRegion } from \"../../lib/toastRegion\"\nimport { cancelableKeyCopy, dataAttributes, keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { NavigationButton } from \"../Button/NavigationButton\"\nimport { Toolbar, ToolbarHostContext, type BarBackground, type ToolbarHost } from \"../Toolbar/Toolbar\"\nimport { NO_SCROLL_EDGES, observeScrollEdges, sameScrollEdges, type ScrollEdges } from \"../../lib/scrollEdges\"\nimport { TransitionGroup } from \"../Transition\"\nimport { createExitGuard, overlayTiming, overlayTimingLarge } from \"../Transition/shared\"\nimport { attachSheetDrag } from \"./sheetDrag\"\nimport { watchDialogViewport } from \"./dialogViewport\"\nimport { enterStep, leaveStep, releaseStepHeight, settleStepHeight, STEP_TIMING } from \"./dialogSteps\"\nimport { PhoneLayoutContext, usePhoneLayout, type PhoneLayoutValue } from \"../PhoneLayout/PhoneLayout\"\nimport { usePopoverDismissableSurface } from \"../Popover/deferredOutsidePress\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\nimport t from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\ntype DialogContextValue = {\n open: boolean\n setOpen: (nextState: boolean) => void\n}\n\nconst DOUBLE_CLICK = 300\n\nconst DialogContext = createContext<DialogContextValue | null>(null)\n\nconst useDialogContext = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\nexport type DialogProps = {\n open?: boolean\n onOpenChange?: (open: boolean) => void\n children: ReactNode\n}\n\nexport const Dialog = ({\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n children,\n}: DialogProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const isOpen = controlledOpen ?? open\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n controlledOnOpenChange?.(nextState)\n setOpen(nextState)\n },\n [controlledOnOpenChange],\n )\n\n const store = useMemo<DialogContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n }),\n [isOpen, handleOpenChange],\n )\n\n return (\n <DialogContext value={store}>\n <RadixDialog.Root open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </RadixDialog.Root>\n </DialogContext>\n )\n}\n\nconst Trigger = ({ children }: { children: ReactNode }) => {\n return <RadixDialog.Trigger asChild>{children}</RadixDialog.Trigger>\n}\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/** A press or a focus outside the dialog; `event.detail.originalEvent` is the browser's event. */\nexport type DialogInteractOutsideEvent = CustomEvent<{ originalEvent: PointerEvent | FocusEvent }>\n\n/** Class, style and data attributes for one of the dialog's layers. */\nexport type DialogLayerProps = {\n className?: string\n style?: CSSProperties\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nexport type DialogContentProps = {\n children: ReactNode\n width?: number | string\n showClose?: boolean\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill?: boolean\n className?: string\n /**\n * Where the panel sits: centered, near the top (search, command lists),\n * a sheet along the bottom, a full-height panel on the start or end side,\n * or the whole screen.\n * @default center\n */\n placement?: DialogPlacement\n /** Placement at 767px and below, such as a bottom sheet on phones. @default placement */\n mobilePlacement?: Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">\n /** Mobile presentation at 767px and below. Sheets default to bottom placement. */\n mobileVariant?: \"alert\" | \"sheet\"\n /** Mobile panel palette; dark mode uses elevated surfaces. @default \"plain\" */\n surface?: \"plain\" | \"grouped\"\n /**\n * Called when focus moves into the dialog on open. Call\n * `event.preventDefault()` to focus something else yourself.\n */\n onOpenAutoFocus?: (event: Event) => void\n /** Called when focus returns on close. Call `event.preventDefault()` to keep it elsewhere. */\n onCloseAutoFocus?: (event: Event) => void\n /**\n * Called on Escape before the dialog closes. Call `event.preventDefault()` to keep it open, such as for a form\n * with unsaved changes.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /**\n * Called on a press or a focus outside the dialog before it closes. Call `event.preventDefault()` to keep it open,\n * such as for a press on a developer panel over the page.\n */\n onInteractOutside?: (event: DialogInteractOutsideEvent) => void\n /** Stack order of the overlay and the dialog. @default 50 */\n zIndex?: number\n /** Class, style and data attributes for the fixed layer that holds the panel. Data attributes of Content land here too. */\n rootProps?: DialogLayerProps\n /** Class, style and data attributes for the overlay. */\n overlayProps?: DialogLayerProps\n /**\n * `phone` lays the dialog out as on a phone at any window width. Inside a PhoneLayout it always is.\n * @default \"auto\"\n */\n layout?: \"auto\" | \"phone\"\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nconst Content = ({\n children,\n width = 480,\n showClose = true,\n pill = false,\n className,\n placement = \"center\",\n mobilePlacement: requestedMobilePlacement,\n mobileVariant,\n surface = \"plain\",\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onInteractOutside,\n zIndex,\n rootProps,\n overlayProps,\n layout = \"auto\",\n ...rest\n}: DialogContentProps) => {\n const { open, setOpen } = useDialogContext()\n const outerPhoneLayout = useContext(PhoneLayoutContext)\n // A dialog laid out as on a phone by its own prop, outside a PhoneLayout, keeps the window: what it holds and\n // the dialogs it opens are phone ones too.\n const phoneLayout = useMemo<PhoneLayoutValue | null>(\n () => outerPhoneLayout ?? (layout === \"phone\" ? { container: null } : null),\n [outerPhoneLayout, layout],\n )\n const [content, setContent] = useState<HTMLDivElement | null>(null)\n useDialogViewport(content, outerPhoneLayout?.container ?? null)\n const overlaySurfaceRef = usePopoverDismissableSurface()\n const mobilePlacement =\n mobileVariant === \"alert\"\n ? \"center\"\n : requestedMobilePlacement ?? (mobileVariant === \"sheet\" ? \"bottom\" : undefined)\n const [exitGuard] = useState(createExitGuard)\n const [panel, setPanel] = useState<HTMLDivElement | null>(null)\n // Dialog.Body reports where content lies under the bars: they show their lines with it.\n const [edges, setEdgesState] = useState(NO_SCROLL_EDGES)\n const setEdges = useCallback((next: ScrollEdges) => setEdgesState((current) => sameScrollEdges(current, next) ? current : next), [])\n const scroll = useMemo(() => ({ edges, setEdges }), [edges, setEdges])\n const toolbarHost = useMemo<ToolbarHost>(() => ({ kind: \"dialog\", scrolled: edges.scrolled, contentBelow: edges.contentBelow }), [edges])\n // Where a phone Sheet's description goes: the first text of the content, under the bar. Dialog.Body offers\n // its top; a Dialog.DescriptionSlot of the content's own, such as a scroller inside a form, comes first.\n const [bodySlot, setBodySlot] = useState<HTMLElement | null>(null)\n const [ownSlot, setOwnSlot] = useState<HTMLElement | null>(null)\n const descriptionSlot = ownSlot ?? bodySlot\n const sheet = useMemo<DialogSheetValue | null>(\n () => (mobileVariant === \"sheet\" ? { showClose, descriptionSlot, setBodySlot, setOwnSlot } : null),\n [mobileVariant, showClose, descriptionSlot],\n )\n const boundary = useFloatingBoundaryScope()\n const setRoot = boundary.setRoot\n const setPanelRef = useCallback((node: HTMLDivElement | null) => { setPanel(node); setRoot(node) }, [setRoot])\n const openedAt = useRef(0)\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || placement === \"fullscreen\" || mobilePlacement === \"bottom\" || mobilePlacement === \"fullscreen\"\n\n // The content of a closing dialog is frozen for its exit, so this reads the owner's latest\n // handler: state that changes together with the close decides where focus returns.\n const handleCloseAutoFocus = useStableCallback((event: Event) => {\n onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n })\n\n useEscCloseStack(open, (event) => {\n if (onEscapeKeyDown) {\n const request = cancelableKeyCopy(event)\n onEscapeKeyDown(request)\n if (request.defaultPrevented) return\n }\n setOpen(false)\n })\n\n useEffect(() => {\n if (open) openedAt.current = performance.now()\n }, [open])\n\n useEffect(() => {\n if (!panel || mobilePlacement !== \"bottom\") return undefined\n return attachSheetDrag(panel, () => setOpen(false))\n }, [panel, mobilePlacement, setOpen])\n\n useLayoutEffect(() => {\n if (!panel) return\n const update = () => {\n // A phone Toolbar takes the place of the header or footer bar on its side: one the dialog places itself\n // before the bar its header becomes.\n const header = panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}:not([data-dialog-bar])`)\n ?? panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}`)\n ?? panel.querySelector<HTMLElement>(`:scope > .${s.Header}`)\n const footer = panel.querySelector<HTMLElement>(`:scope > ${BOTTOM_TOOLBAR}`) ?? panel.querySelector<HTMLElement>(`:scope > .${s.Footer}`)\n panel.style.setProperty(\"--dialog-header-height\", `${header?.offsetHeight ?? 0}px`)\n panel.style.setProperty(\"--dialog-footer-height\", `${footer?.offsetHeight ?? 0}px`)\n }\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeBars = () => {\n observer?.disconnect()\n panel.querySelectorAll<HTMLElement>(`:scope > .${s.Header}, :scope > .${s.Footer}, :scope > [data-toolbar]`)\n .forEach((bar) => observer?.observe(bar, { box: \"border-box\" }))\n update()\n }\n observeBars()\n // A form can add or remove its action bar while the dialog stays open.\n const children = new MutationObserver(observeBars)\n children.observe(panel, { childList: true })\n return () => { observer?.disconnect(); children.disconnect() }\n }, [panel])\n\n const layerStyle = toCssVariables({ \"dialog-z-index\": zIndex === undefined ? undefined : String(zIndex) })\n\n return (\n <FloatingBoundaryProvider value={boundary}>\n <PhoneLayoutContext value={phoneLayout}>\n <RadixDialog.Portal forceMount container={outerPhoneLayout?.container ?? undefined}>\n {/* Portaled out of any phone layout, a phone dialog carries its own scope, above its transition: the phone\n rules of the style sheet start there. */}\n <PhoneScope enabled={phoneLayout !== null && !outerPhoneLayout?.container}>\n {/* A dialog mounted open enters too, as `open` set with the mount does */}\n <TransitionGroup\n {...(crossesScreen ? overlayTimingLarge : overlayTiming)}\n {...exitGuard.transition}\n className={s.Transition}\n overlay\n preventInitialTransition={false}\n >\n {open && (\n <div key=\"dialog\">\n <RadixDialog.Overlay\n {...overlayProps}\n ref={overlaySurfaceRef}\n className={clsx(s.Overlay, overlayProps?.className)}\n style={{ ...layerStyle, ...overlayProps?.style }}\n />\n <RadixDialog.Content\n {...dataAttributes(rest)}\n {...rootProps}\n ref={setContent}\n forceMount\n className={clsx(s.Content, rootProps?.className)}\n data-plex-dialog=\"\"\n style={{ ...toCssVariables({ \"dialog-width\": width }), ...layerStyle, ...rootProps?.style }}\n data-placement={placement === \"center\" ? undefined : placement}\n data-mobile-placement={mobilePlacement}\n data-mobile-variant={mobileVariant}\n data-surface={surface}\n data-pill={pill ? \"\" : undefined}\n onEscapeKeyDown={preventDefaultHandler}\n onInteractOutside={(event) => {\n // A press or focus in a toast is not outside: the toast region is a layer above the dialog. The\n // Toaster stops these before Radix sees them; this holds when the Toaster mounted after the dialog.\n if (inToastRegion(event.detail.originalEvent.target)) return event.preventDefault()\n onInteractOutside?.(event)\n if (event.defaultPrevented) return\n // The second click of a double click lands on the overlay: it must not undo the first\n if (performance.now() - openedAt.current < DOUBLE_CLICK) event.preventDefault()\n else exitGuard.onInteractOutside(event)\n }}\n onOpenAutoFocus={onOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n >\n <div ref={setPanelRef} className={clsx(s.Panel, className)}>\n {showClose && (\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" className={s.CloseButton} aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n )}\n <DialogScrollContext.Provider value={scroll}>\n <DialogSheetContext.Provider value={sheet}>\n {/* A dialog opened from a header action is not inside that header's bar */}\n <DialogBarContext.Provider value={false}>\n <ToolbarHostContext.Provider value={toolbarHost}>{children}</ToolbarHostContext.Provider>\n </DialogBarContext.Provider>\n </DialogSheetContext.Provider>\n </DialogScrollContext.Provider>\n </div>\n </RadixDialog.Content>\n </div>\n )}\n </TransitionGroup>\n </PhoneScope>\n </RadixDialog.Portal>\n </PhoneLayoutContext>\n </FloatingBoundaryProvider>\n )\n}\n\ntype DialogScrollValue = { edges: ScrollEdges; setEdges: (edges: ScrollEdges) => void }\nconst DialogScrollContext = createContext<DialogScrollValue | null>(null)\n// What the header of a Sheet needs from its Content to become the Sheet's bar on a phone\ntype DialogSheetValue = {\n showClose: boolean\n descriptionSlot: HTMLElement | null\n setBodySlot: (slot: HTMLElement | null) => void\n setOwnSlot: (slot: HTMLElement | null) => void\n}\nconst DialogSheetContext = createContext<DialogSheetValue | null>(null)\n// Inside that bar: the title, the description and the header actions take the Toolbar's parts\nconst DialogBarContext = createContext(false)\n\nconst PhoneScope = ({ enabled, children }: { enabled: boolean; children: ReactNode }) =>\n enabled ? <div className={s.PhoneScope} data-plex-layout=\"phone\">{children}</div> : children\n\nconst useDialogViewport = (content: HTMLElement | null, container: HTMLElement | null) => {\n useLayoutEffect(() => (content ? watchDialogViewport(content, container) : undefined), [content, container])\n}\nconst TOP_TOOLBAR = '[data-toolbar][data-placement=\"top\"]'\nconst BOTTOM_TOOLBAR = '[data-toolbar][data-placement=\"bottom\"]'\n\ntype DialogSlotProps = {\n children: ReactNode\n className?: string\n}\n\n/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */\nexport type DialogBarBackground = BarBackground\nexport type DialogHeaderProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"glass\" */\n background?: DialogBarBackground\n}\n\n// The header's own parts, fragments opened up, so its actions can stand at the end of the bar. A part from a\n// fragment keeps the fragment's key before its own, so two parts never share a key.\nconst headerParts = (children: ReactNode, prefix = \"\"): ReactNode[] =>\n Children.toArray(children).flatMap((part) => {\n if (!isValidElement<{ children?: ReactNode }>(part)) return [part]\n if (part.type === Fragment) return headerParts(part.props.children, `${prefix}${String(part.key)}/`)\n return [prefix ? cloneElement(part, { key: `${prefix}${String(part.key)}` }) : part]\n })\nconst isHeaderAction = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === HeaderAction\nconst isDescription = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === Description\n\nconst Header = ({ children, className, background = \"glass\" }: DialogHeaderProps) => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const scrolled = useContext(DialogScrollContext)?.edges.scrolled\n if (sheet && phone) {\n const parts = headerParts(children)\n const descriptions = parts.filter(isDescription)\n // The description reads as the first text of the content, at the top of Dialog.Body when there is one\n const description = descriptions.length > 0 && <div className={s.SheetDescription}>{descriptions}</div>\n // On a phone the header of a Sheet is its Toolbar (iOS 27 kit Sheets 507-24684, Toolbar - Top - iPhone\n // 1-54520): Close at the leading edge, the title alone centered on the row of controls, the header actions\n // at the trailing edge, all on one 44px row 16px under the top edge.\n return (\n <>\n <Toolbar background={background} className={className} data-dialog-bar=\"\">\n <DialogBarContext.Provider value={true}>\n {sheet.showClose && (\n <Toolbar.Leading className={s.BarClose}>\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n </Toolbar.Leading>\n )}\n <div className={clsx(t.Heading, s.BarHeading)}>{parts.filter((part) => !isHeaderAction(part) && !isDescription(part))}</div>\n {parts.filter(isHeaderAction)}\n </DialogBarContext.Provider>\n </Toolbar>\n {description && (sheet.descriptionSlot ? createPortal(description, sheet.descriptionSlot) : description)}\n </>\n )\n }\n return <div className={clsx(s.Header, className)} data-background={background} data-scrolled={scrolled ? \"\" : undefined}>{children}</div>\n}\n\nconst HeaderAction = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n if (bar) return <Toolbar.Trailing className={className}>{children}</Toolbar.Trailing>\n return <div className={clsx(s.HeaderAction, className)}>{children}</div>\n}\n\n/** The scrolling part between Header and Footer: with it, only the body scrolls */\nconst Body = ({ children, className }: DialogSlotProps) => {\n const setEdges = useContext(DialogScrollContext)?.setEdges\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n // A phone Sheet's description starts the body (Dialog.Header portals it here)\n const setDescriptionSlot = sheet && phone ? sheet.setBodySlot : null\n const element = useRef<HTMLDivElement | null>(null)\n useLayoutEffect(() => {\n const body = element.current\n if (!body || !setEdges) return\n const stop = observeScrollEdges(body, setEdges)\n return () => { stop(); setEdges(NO_SCROLL_EDGES) }\n }, [setEdges])\n return (\n <div ref={element} className={clsx(s.Body, className)}>\n {setDescriptionSlot && <div ref={setDescriptionSlot} className={s.SheetDescriptionSlot} />}\n {children}\n </div>\n )\n}\n\n/**\n * Where a phone Sheet's description goes in content of your own, such as a scroller inside a form so that Enter\n * submits: the description starts it, as it starts Dialog.Body, and it comes before the body's place. It renders\n * nothing outside a phone Sheet.\n */\nconst DescriptionSlot = () => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const setOwnSlot = sheet && phone ? sheet.setOwnSlot : null\n return setOwnSlot ? <div ref={setOwnSlot} className={s.SheetDescriptionSlot} /> : null\n}\n\nexport type DialogFooterProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"soft\" */\n background?: DialogBarBackground\n /** Override the mobile action layout. Two alert actions default to inline, three or more and sheets to stacked. */\n mobileLayout?: \"inline\" | \"stacked\"\n}\n\nconst Footer = ({ children, className, mobileLayout, background = \"soft\" }: DialogFooterProps) => {\n const setFooter = useFloatingBoundaryRegistration()?.setFooter\n const contentBelow = useContext(DialogScrollContext)?.edges.contentBelow\n return (\n <div\n ref={setFooter}\n className={clsx(s.Footer, className)}\n data-mobile-layout={mobileLayout}\n data-background={background}\n data-content-below={contentBelow ? \"\" : undefined}\n >\n {children}\n </div>\n )\n}\n\nconst Title = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n return <RadixDialog.Title className={clsx(bar ? t.Title : s.Title, className)}>{children}</RadixDialog.Title>\n}\n\nconst Description = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n const element = useRef<HTMLParagraphElement | null>(null)\n const [shown, setShown] = useState(false)\n useLayoutEffect(() => {\n // The header leaves its own descriptions out of the bar. One the bar still holds, inside a part of the\n // header's own, is the title's second line (Toolbar's subtitle) when the reader sees it; one that is only\n // read out, visually hidden, leaves the title on its one line.\n const node = element.current\n // A measurement of the laid-out description, which only an effect after layout can read\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setShown(bar && !!node && node.offsetHeight > 1 && node.offsetWidth > 1)\n }, [bar, children, className])\n return (\n <RadixDialog.Description ref={element} className={clsx(bar && shown ? t.Subtitle : s.Description, className)}>\n {children}\n </RadixDialog.Description>\n )\n}\n\nexport type DialogStepsProps = {\n /** The step on screen. A new value brings its content in. */\n step: string | number\n /**\n * `forward` brings the new step in from the trailing edge over the one before, as a push on iOS; `back` returns to\n * a step before it.\n * @default \"forward\"\n */\n direction?: \"forward\" | \"back\"\n children: ReactNode\n className?: string\n}\n\n/** The steps of a flow inside a dialog, such as a sign-in that asks for an email and then a code. */\nconst Steps = ({ step, direction = \"forward\", children, className }: DialogStepsProps) => (\n <div className={clsx(s.Steps, className)} data-direction={direction}>\n <TransitionGroup {...STEP_TIMING} as=\"div\" overlay className={s.Step} onEnter={enterStep} onExit={leaveStep} onExitActive={settleStepHeight} onExitComplete={releaseStepHeight}>\n <div key={step} data-dialog-step=\"\" tabIndex={-1}>{children}</div>\n </TransitionGroup>\n </div>\n)\n\nconst Close = ({ children }: { children: ReactNode }) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>\n}\n\nDialog.Trigger = Trigger\nDialog.Content = Content\nDialog.Header = Header\nDialog.HeaderAction = HeaderAction\nDialog.Body = Body\nDialog.Footer = Footer\nDialog.Title = Title\nDialog.Description = Description\nDialog.DescriptionSlot = DescriptionSlot\nDialog.Close = Close\nDialog.Steps = Steps\n"]}
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU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AClE,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;AACxB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;AACxB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAA;AAClC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;AAClB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;AACpB,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;AAChC,MAAM,CAAC,eAAe,GAAG,eAAe,CAAA;AACxC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;AACpB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { Dialog as RadixDialog } from \"radix-ui\"\nimport {\n Children,\n cloneElement,\n createContext,\n Fragment,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { FloatingBoundaryProvider, useFloatingBoundaryRegistration, useFloatingBoundaryScope } from \"../../hooks/useFloatingBoundary\"\nimport { useEscCloseStack } from \"../../hooks/useEscCloseStack\"\nimport { inToastRegion } from \"../../lib/toastRegion\"\nimport { cancelableKeyCopy, dataAttributes, keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers\"\nimport { useStableCallback } from \"../../hooks/useStableCallback\"\nimport { NavigationButton } from \"../Button/NavigationButton\"\nimport { Toolbar, ToolbarHostContext, type BarBackground, type ToolbarHost } from \"../Toolbar/Toolbar\"\nimport { NO_SCROLL_EDGES, observeScrollEdges, sameScrollEdges, type ScrollEdges } from \"../../lib/scrollEdges\"\nimport { TransitionGroup } from \"../Transition\"\nimport { createExitGuard, overlayTiming, overlayTimingLarge } from \"../Transition/shared\"\nimport { attachSheetDrag } from \"./sheetDrag\"\nimport { watchDialogViewport } from \"./dialogViewport\"\nimport { enterStep, leaveStep, releaseStepHeight, settleStepHeight, STEP_TIMING } from \"./dialogSteps\"\nimport { PhoneLayoutContext, usePhoneLayout, type PhoneLayoutValue } from \"../PhoneLayout/PhoneLayout\"\nimport { usePopoverDismissableSurface } from \"../Popover/deferredOutsidePress\"\nimport s from \"@plexui/styles/components/Dialog/Dialog.module.css\"\nimport t from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\ntype DialogContextValue = {\n open: boolean\n setOpen: (nextState: boolean) => void\n}\n\nconst DOUBLE_CLICK = 300\n\nconst DialogContext = createContext<DialogContextValue | null>(null)\n\nconst useDialogContext = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw new Error(\"Dialog compound components must be used inside <Dialog>\")\n }\n\n return context\n}\n\nexport type DialogProps = {\n open?: boolean\n onOpenChange?: (open: boolean) => void\n children: ReactNode\n}\n\nexport const Dialog = ({\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n children,\n}: DialogProps) => {\n const [open, setOpen] = useState<boolean>(false)\n const isOpen = controlledOpen ?? open\n\n const handleOpenChange = useCallback(\n (nextState: boolean) => {\n controlledOnOpenChange?.(nextState)\n setOpen(nextState)\n },\n [controlledOnOpenChange],\n )\n\n const store = useMemo<DialogContextValue>(\n () => ({\n open: isOpen,\n setOpen: handleOpenChange,\n }),\n [isOpen, handleOpenChange],\n )\n\n return (\n <DialogContext value={store}>\n <RadixDialog.Root open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </RadixDialog.Root>\n </DialogContext>\n )\n}\n\nconst Trigger = ({ children }: { children: ReactNode }) => {\n return <RadixDialog.Trigger asChild>{children}</RadixDialog.Trigger>\n}\n\nexport type DialogPlacement = \"center\" | \"top\" | \"bottom\" | \"start\" | \"end\" | \"fullscreen\"\n\n/**\n * A press or a focus outside the dialog, or a phone sheet pulled down to close; `event.detail.originalEvent` is the\n * browser's event (a TouchEvent for the sheet).\n */\nexport type DialogInteractOutsideEvent = CustomEvent<{ originalEvent: PointerEvent | FocusEvent | TouchEvent }>\n\n/** Class, style and data attributes for one of the dialog's layers. */\nexport type DialogLayerProps = {\n className?: string\n style?: CSSProperties\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nexport type DialogContentProps = {\n children: ReactNode\n width?: number | string\n showClose?: boolean\n /**\n * Rounder panel and a round close button, for dialogs that sit beside pill controls.\n * @default false\n */\n pill?: boolean\n className?: string\n /**\n * Where the panel sits: centered, near the top (search, command lists),\n * a sheet along the bottom, a full-height panel on the start or end side,\n * or the whole screen.\n * @default center\n */\n placement?: DialogPlacement\n /**\n * Where a phone sheet stands at 767px and below: `bottom`, or `fullscreen` for the whole screen. `center` is the\n * alert's place: without `mobileVariant` it makes the dialog an alert. @default \"fullscreen\" for a fullscreen\n * dialog, else \"bottom\"\n */\n mobilePlacement?: Extract<DialogPlacement, \"center\" | \"bottom\" | \"fullscreen\">\n /**\n * The iOS presentation at 767px and below. A phone has two modal views: the sheet, which iOS gives any view it\n * presents, and the alert, a short question with its answers (UIAlertController). @default \"sheet\"\n */\n mobileVariant?: \"alert\" | \"sheet\"\n /** Mobile panel palette; dark mode uses elevated surfaces. @default \"plain\" */\n surface?: \"plain\" | \"grouped\"\n /**\n * Called when focus moves into the dialog on open. Call\n * `event.preventDefault()` to focus something else yourself.\n */\n onOpenAutoFocus?: (event: Event) => void\n /** Called when focus returns on close. Call `event.preventDefault()` to keep it elsewhere. */\n onCloseAutoFocus?: (event: Event) => void\n /**\n * Called on Escape before the dialog closes. Call `event.preventDefault()` to keep it open, such as for a form\n * with unsaved changes.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n /**\n * Called on a press or a focus outside the dialog, and on a phone sheet pulled down to close, before it closes. Call\n * `event.preventDefault()` to keep it open, such as for a form with unsaved changes (the sheet then returns, as an\n * iOS sheet does under `isModalInPresentation`), or for a press on a developer panel over the page.\n */\n onInteractOutside?: (event: DialogInteractOutsideEvent) => void\n /** Stack order of the overlay and the dialog. @default 50 */\n zIndex?: number\n /** Class, style and data attributes for the fixed layer that holds the panel. Data attributes of Content land here too. */\n rootProps?: DialogLayerProps\n /** Class, style and data attributes for the overlay. */\n overlayProps?: DialogLayerProps\n /**\n * `phone` lays the dialog out as on a phone at any window width. Inside a PhoneLayout it always is.\n * @default \"auto\"\n */\n layout?: \"auto\" | \"phone\"\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined\n}\n\nconst Content = ({\n children,\n width = 480,\n showClose = true,\n pill = false,\n className,\n placement = \"center\",\n mobilePlacement: requestedMobilePlacement,\n mobileVariant: requestedMobileVariant,\n surface = \"plain\",\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onInteractOutside,\n zIndex,\n rootProps,\n overlayProps,\n layout = \"auto\",\n ...rest\n}: DialogContentProps) => {\n const { open, setOpen } = useDialogContext()\n const outerPhoneLayout = useContext(PhoneLayoutContext)\n // A dialog laid out as on a phone by its own prop, outside a PhoneLayout, keeps the window: what it holds and\n // the dialogs it opens are phone ones too.\n const phoneLayout = useMemo<PhoneLayoutValue | null>(\n () => outerPhoneLayout ?? (layout === \"phone\" ? { container: null } : null),\n [outerPhoneLayout, layout],\n )\n const [content, setContent] = useState<HTMLDivElement | null>(null)\n useDialogViewport(content, outerPhoneLayout?.container ?? null)\n const overlaySurfaceRef = usePopoverDismissableSurface()\n // A phone has no other modal view than the sheet and the alert (owner 12.11: «нет такого в iOS»): a centered\n // dialog is an alert, any other a sheet, at the bottom or over the whole screen.\n const mobileVariant = requestedMobileVariant ?? (requestedMobilePlacement === \"center\" ? \"alert\" : \"sheet\")\n const mobilePlacement =\n mobileVariant === \"alert\"\n ? \"center\"\n : (requestedMobilePlacement ?? placement) === \"fullscreen\" ? \"fullscreen\" : \"bottom\"\n const [exitGuard] = useState(createExitGuard)\n const [panel, setPanel] = useState<HTMLDivElement | null>(null)\n // Dialog.Body reports where content lies under the bars: they show their lines with it.\n const [edges, setEdgesState] = useState(NO_SCROLL_EDGES)\n const setEdges = useCallback((next: ScrollEdges) => setEdgesState((current) => sameScrollEdges(current, next) ? current : next), [])\n const scroll = useMemo(() => ({ edges, setEdges }), [edges, setEdges])\n const toolbarHost = useMemo<ToolbarHost>(() => ({ kind: \"dialog\", scrolled: edges.scrolled, contentBelow: edges.contentBelow }), [edges])\n // Where a phone Sheet's description goes: the first text of the content, under the bar. Dialog.Body offers\n // its top; a Dialog.DescriptionSlot of the content's own, such as a scroller inside a form, comes first.\n const [bodySlot, setBodySlot] = useState<HTMLElement | null>(null)\n const [ownSlot, setOwnSlot] = useState<HTMLElement | null>(null)\n const descriptionSlot = ownSlot ?? bodySlot\n const sheet = useMemo<DialogSheetValue | null>(\n () => (mobileVariant === \"sheet\" ? { showClose, descriptionSlot, setBodySlot, setOwnSlot } : null),\n [mobileVariant, showClose, descriptionSlot],\n )\n const boundary = useFloatingBoundaryScope()\n const setRoot = boundary.setRoot\n const setPanelRef = useCallback((node: HTMLDivElement | null) => { setPanel(node); setRoot(node) }, [setRoot])\n const openedAt = useRef(0)\n // A sheet crosses the screen on a phone, and wherever its owner asked for one; a dialog left to its defaults stays\n // the centred panel on a desktop, with that panel's timing.\n const phone = usePhoneLayout() || layout === \"phone\"\n const sheetCrosses = (phone || requestedMobileVariant === \"sheet\" || requestedMobilePlacement !== undefined) &&\n (mobilePlacement === \"bottom\" || mobilePlacement === \"fullscreen\")\n const crossesScreen =\n placement === \"bottom\" || placement === \"start\" || placement === \"end\" || placement === \"fullscreen\" || sheetCrosses\n\n // The content of a closing dialog is frozen for its exit, so this reads the owner's latest\n // handler: state that changes together with the close decides where focus returns.\n const handleCloseAutoFocus = useStableCallback((event: Event) => {\n onCloseAutoFocus?.(event)\n keepMovedFocus(event)\n })\n\n useEscCloseStack(open, (event) => {\n if (onEscapeKeyDown) {\n const request = cancelableKeyCopy(event)\n onEscapeKeyDown(request)\n if (request.defaultPrevented) return\n }\n setOpen(false)\n })\n\n useEffect(() => {\n if (open) openedAt.current = performance.now()\n }, [open])\n\n // A sheet pulled down asks as a press outside does: an owner that keeps the dialog open on one, such as a form\n // with unsaved changes, keeps it on the other, and the sheet returns.\n const dismissByDrag = useStableCallback((originalEvent: TouchEvent) => {\n if (onInteractOutside) {\n const request: DialogInteractOutsideEvent = new CustomEvent(\"dialog.sheetDrag\", { cancelable: true, detail: { originalEvent } })\n onInteractOutside(request)\n if (request.defaultPrevented) return false\n }\n setOpen(false)\n return true\n })\n\n useEffect(() => {\n if (!panel || mobilePlacement !== \"bottom\") return undefined\n return attachSheetDrag(panel, dismissByDrag)\n }, [panel, mobilePlacement, dismissByDrag])\n\n useLayoutEffect(() => {\n if (!panel) return\n const update = () => {\n // A phone Toolbar takes the place of the header or footer bar on its side: one the dialog places itself\n // before the bar its header becomes.\n const header = panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}:not([data-dialog-bar])`)\n ?? panel.querySelector<HTMLElement>(`:scope > ${TOP_TOOLBAR}`)\n ?? panel.querySelector<HTMLElement>(`:scope > .${s.Header}`)\n const footer = panel.querySelector<HTMLElement>(`:scope > ${BOTTOM_TOOLBAR}`) ?? panel.querySelector<HTMLElement>(`:scope > .${s.Footer}`)\n panel.style.setProperty(\"--dialog-header-height\", `${header?.offsetHeight ?? 0}px`)\n panel.style.setProperty(\"--dialog-footer-height\", `${footer?.offsetHeight ?? 0}px`)\n }\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n const observeBars = () => {\n observer?.disconnect()\n panel.querySelectorAll<HTMLElement>(`:scope > .${s.Header}, :scope > .${s.Footer}, :scope > [data-toolbar]`)\n .forEach((bar) => observer?.observe(bar, { box: \"border-box\" }))\n update()\n }\n observeBars()\n // A form can add or remove its action bar while the dialog stays open.\n const children = new MutationObserver(observeBars)\n children.observe(panel, { childList: true })\n return () => { observer?.disconnect(); children.disconnect() }\n }, [panel])\n\n const layerStyle = toCssVariables({ \"dialog-z-index\": zIndex === undefined ? undefined : String(zIndex) })\n\n return (\n <FloatingBoundaryProvider value={boundary}>\n <PhoneLayoutContext value={phoneLayout}>\n <RadixDialog.Portal forceMount container={outerPhoneLayout?.container ?? undefined}>\n {/* Portaled out of any phone layout, a phone dialog carries its own scope, above its transition: the phone\n rules of the style sheet start there. */}\n <PhoneScope enabled={phoneLayout !== null && !outerPhoneLayout?.container}>\n {/* A dialog mounted open enters too, as `open` set with the mount does */}\n <TransitionGroup\n {...(crossesScreen ? overlayTimingLarge : overlayTiming)}\n {...exitGuard.transition}\n className={s.Transition}\n overlay\n preventInitialTransition={false}\n >\n {open && (\n <div key=\"dialog\">\n <RadixDialog.Overlay\n {...overlayProps}\n ref={overlaySurfaceRef}\n className={clsx(s.Overlay, overlayProps?.className)}\n style={{ ...layerStyle, ...overlayProps?.style }}\n />\n <RadixDialog.Content\n {...dataAttributes(rest)}\n {...rootProps}\n ref={setContent}\n forceMount\n className={clsx(s.Content, rootProps?.className)}\n data-plex-dialog=\"\"\n style={{ ...toCssVariables({ \"dialog-width\": width }), ...layerStyle, ...rootProps?.style }}\n data-placement={placement === \"center\" ? undefined : placement}\n data-mobile-placement={mobilePlacement}\n data-mobile-variant={mobileVariant}\n data-surface={surface}\n data-pill={pill ? \"\" : undefined}\n onEscapeKeyDown={preventDefaultHandler}\n onInteractOutside={(event) => {\n // A press or focus in a toast is not outside: the toast region is a layer above the dialog. The\n // Toaster stops these before Radix sees them; this holds when the Toaster mounted after the dialog.\n if (inToastRegion(event.detail.originalEvent.target)) return event.preventDefault()\n onInteractOutside?.(event)\n if (event.defaultPrevented) return\n // The second click of a double click lands on the overlay: it must not undo the first\n if (performance.now() - openedAt.current < DOUBLE_CLICK) event.preventDefault()\n else exitGuard.onInteractOutside(event)\n }}\n onOpenAutoFocus={onOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n >\n <div ref={setPanelRef} className={clsx(s.Panel, className)}>\n {showClose && (\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" className={s.CloseButton} aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n )}\n <DialogScrollContext.Provider value={scroll}>\n <DialogSheetContext.Provider value={sheet}>\n {/* A dialog opened from a header action is not inside that header's bar */}\n <DialogBarContext.Provider value={false}>\n <ToolbarHostContext.Provider value={toolbarHost}>{children}</ToolbarHostContext.Provider>\n </DialogBarContext.Provider>\n </DialogSheetContext.Provider>\n </DialogScrollContext.Provider>\n </div>\n </RadixDialog.Content>\n </div>\n )}\n </TransitionGroup>\n </PhoneScope>\n </RadixDialog.Portal>\n </PhoneLayoutContext>\n </FloatingBoundaryProvider>\n )\n}\n\ntype DialogScrollValue = { edges: ScrollEdges; setEdges: (edges: ScrollEdges) => void }\nconst DialogScrollContext = createContext<DialogScrollValue | null>(null)\n// What the header of a Sheet needs from its Content to become the Sheet's bar on a phone\ntype DialogSheetValue = {\n showClose: boolean\n descriptionSlot: HTMLElement | null\n setBodySlot: (slot: HTMLElement | null) => void\n setOwnSlot: (slot: HTMLElement | null) => void\n}\nconst DialogSheetContext = createContext<DialogSheetValue | null>(null)\n// Inside that bar: the title, the description and the header actions take the Toolbar's parts\nconst DialogBarContext = createContext(false)\n\nconst PhoneScope = ({ enabled, children }: { enabled: boolean; children: ReactNode }) =>\n enabled ? <div className={s.PhoneScope} data-plex-layout=\"phone\">{children}</div> : children\n\nconst useDialogViewport = (content: HTMLElement | null, container: HTMLElement | null) => {\n useLayoutEffect(() => (content ? watchDialogViewport(content, container) : undefined), [content, container])\n}\nconst TOP_TOOLBAR = '[data-toolbar][data-placement=\"top\"]'\nconst BOTTOM_TOOLBAR = '[data-toolbar][data-placement=\"bottom\"]'\n\ntype DialogSlotProps = {\n children: ReactNode\n className?: string\n}\n\n/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */\nexport type DialogBarBackground = BarBackground\nexport type DialogHeaderProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"glass\" */\n background?: DialogBarBackground\n}\n\n// The header's own parts, fragments opened up, so its actions can stand at the end of the bar. A part from a\n// fragment keeps the fragment's key before its own, so two parts never share a key.\nconst headerParts = (children: ReactNode, prefix = \"\"): ReactNode[] =>\n Children.toArray(children).flatMap((part) => {\n if (!isValidElement<{ children?: ReactNode }>(part)) return [part]\n if (part.type === Fragment) return headerParts(part.props.children, `${prefix}${String(part.key)}/`)\n return [prefix ? cloneElement(part, { key: `${prefix}${String(part.key)}` }) : part]\n })\nconst isHeaderAction = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === HeaderAction\nconst isLeadingAction = (part: ReactNode): part is ReactElement<DialogHeaderActionProps> =>\n isHeaderAction(part) && (part.props as DialogHeaderActionProps).side === \"leading\"\nconst isDescription = (part: ReactNode): part is ReactElement => isValidElement(part) && part.type === Description\n\nconst Header = ({ children, className, background = \"glass\" }: DialogHeaderProps) => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const scrolled = useContext(DialogScrollContext)?.edges.scrolled\n if (sheet && phone) {\n const parts = headerParts(children)\n const descriptions = parts.filter(isDescription)\n // The description reads as the first text of the content, at the top of Dialog.Body when there is one\n const description = descriptions.length > 0 && <div className={s.SheetDescription}>{descriptions}</div>\n // On a phone the header of a Sheet is its Toolbar (iOS 27 kit Sheets 507-24684, Toolbar - Top - iPhone\n // 1-54520): Close at the leading edge, the title alone centered on the row of controls, the header actions\n // at the trailing edge, all on one 44px row 16px under the top edge.\n return (\n <>\n <Toolbar background={background} className={className} data-dialog-bar=\"\">\n <DialogBarContext.Provider value={true}>\n {/* A step's Back takes the leading place, as the back button of a screen pushed inside an iOS sheet */}\n {sheet.showClose && !parts.some(isLeadingAction) && (\n <Toolbar.Leading className={s.BarClose}>\n <RadixDialog.Close asChild>\n <NavigationButton action=\"close\" variant=\"ghost\" aria-label=\"Close dialog\" />\n </RadixDialog.Close>\n </Toolbar.Leading>\n )}\n {parts.filter(isLeadingAction)}\n <div className={clsx(t.Heading, s.BarHeading)}>{parts.filter((part) => !isHeaderAction(part) && !isDescription(part))}</div>\n {parts.filter((part) => isHeaderAction(part) && !isLeadingAction(part))}\n </DialogBarContext.Provider>\n </Toolbar>\n {description && (sheet.descriptionSlot ? createPortal(description, sheet.descriptionSlot) : description)}\n </>\n )\n }\n return <div className={clsx(s.Header, className)} data-background={background} data-scrolled={scrolled ? \"\" : undefined}>{children}</div>\n}\n\nexport type DialogHeaderActionProps = DialogSlotProps & {\n /**\n * `leading` puts the action before the title, such as the Back of a step in `Dialog.Steps`: on a phone Sheet it\n * takes the place of Close, as the back button of a screen pushed inside an iOS sheet does.\n * @default \"trailing\"\n */\n side?: \"leading\" | \"trailing\"\n}\n\nconst HeaderAction = ({ children, className, side = \"trailing\" }: DialogHeaderActionProps) => {\n const bar = useContext(DialogBarContext)\n if (bar && side === \"leading\") return <Toolbar.Leading className={clsx(s.BarClose, className)}>{children}</Toolbar.Leading>\n if (bar) return <Toolbar.Trailing className={className}>{children}</Toolbar.Trailing>\n return <div className={clsx(s.HeaderAction, className)} data-side={side === \"leading\" ? \"leading\" : undefined}>{children}</div>\n}\n\n/** The scrolling part between Header and Footer: with it, only the body scrolls */\nconst Body = ({ children, className }: DialogSlotProps) => {\n const setEdges = useContext(DialogScrollContext)?.setEdges\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n // A phone Sheet's description starts the body (Dialog.Header portals it here)\n const setDescriptionSlot = sheet && phone ? sheet.setBodySlot : null\n const element = useRef<HTMLDivElement | null>(null)\n useLayoutEffect(() => {\n const body = element.current\n if (!body || !setEdges) return\n const stop = observeScrollEdges(body, setEdges)\n return () => { stop(); setEdges(NO_SCROLL_EDGES) }\n }, [setEdges])\n return (\n <div ref={element} className={clsx(s.Body, className)}>\n {setDescriptionSlot && <div ref={setDescriptionSlot} className={s.SheetDescriptionSlot} />}\n {children}\n </div>\n )\n}\n\n/**\n * Where a phone Sheet's description goes in content of your own, such as a scroller inside a form so that Enter\n * submits: the description starts it, as it starts Dialog.Body, and it comes before the body's place. It renders\n * nothing outside a phone Sheet.\n */\nconst DescriptionSlot = () => {\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n const setOwnSlot = sheet && phone ? sheet.setOwnSlot : null\n return setOwnSlot ? <div ref={setOwnSlot} className={s.SheetDescriptionSlot} /> : null\n}\n\nexport type DialogFooterProps = DialogSlotProps & {\n /** How the bar meets the content scrolled under it in a phone Sheet. @default \"soft\" */\n background?: DialogBarBackground\n /** Override the mobile action layout. Two alert actions default to inline, three or more and sheets to stacked. */\n mobileLayout?: \"inline\" | \"stacked\"\n}\n\nconst Footer = ({ children, className, mobileLayout, background = \"soft\" }: DialogFooterProps) => {\n const setFooter = useFloatingBoundaryRegistration()?.setFooter\n const contentBelow = useContext(DialogScrollContext)?.edges.contentBelow\n const sheet = useContext(DialogSheetContext)\n const phone = usePhoneLayout()\n // A phone Sheet stacks its main action on top, as an iOS setup sheet does. A footer is written with it last,\n // where a desktop row ends, so the order is turned in the page itself: focus and a screen reader meet the\n // actions in the order they are seen.\n const parts = sheet && phone && mobileLayout !== \"inline\" ? headerParts(children).reverse() : children\n return (\n <div\n ref={setFooter}\n className={clsx(s.Footer, className)}\n data-mobile-layout={mobileLayout}\n data-background={background}\n data-content-below={contentBelow ? \"\" : undefined}\n >\n {parts}\n </div>\n )\n}\n\nconst Title = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n return <RadixDialog.Title className={clsx(bar ? t.Title : s.Title, className)}>{children}</RadixDialog.Title>\n}\n\nconst Description = ({ children, className }: DialogSlotProps) => {\n const bar = useContext(DialogBarContext)\n const element = useRef<HTMLParagraphElement | null>(null)\n const [shown, setShown] = useState(false)\n useLayoutEffect(() => {\n // The header leaves its own descriptions out of the bar. One the bar still holds, inside a part of the\n // header's own, is the title's second line (Toolbar's subtitle) when the reader sees it; one that is only\n // read out, visually hidden, leaves the title on its one line.\n const node = element.current\n // A measurement of the laid-out description, which only an effect after layout can read\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setShown(bar && !!node && node.offsetHeight > 1 && node.offsetWidth > 1)\n }, [bar, children, className])\n return (\n <RadixDialog.Description ref={element} className={clsx(bar && shown ? t.Subtitle : s.Description, className)}>\n {children}\n </RadixDialog.Description>\n )\n}\n\nexport type DialogStepsProps = {\n /** The step on screen. A new value brings its content in. */\n step: string | number\n /**\n * `forward` brings the new step in from the trailing edge over the one before, as a push on iOS; `back` returns to\n * a step before it.\n * @default \"forward\"\n */\n direction?: \"forward\" | \"back\"\n children: ReactNode\n className?: string\n}\n\n/** The steps of a flow inside a dialog, such as a sign-in that asks for an email and then a code. */\nconst Steps = ({ step, direction = \"forward\", children, className }: DialogStepsProps) => (\n <div className={clsx(s.Steps, className)} data-direction={direction}>\n <TransitionGroup {...STEP_TIMING} as=\"div\" overlay className={s.Step} onEnter={enterStep} onExit={leaveStep} onExitActive={settleStepHeight} onExitComplete={releaseStepHeight}>\n <div key={step} data-dialog-step=\"\" tabIndex={-1}>{children}</div>\n </TransitionGroup>\n </div>\n)\n\nconst Close = ({ children }: { children: ReactNode }) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>\n}\n\nDialog.Trigger = Trigger\nDialog.Content = Content\nDialog.Header = Header\nDialog.HeaderAction = HeaderAction\nDialog.Body = Body\nDialog.Footer = Footer\nDialog.Title = Title\nDialog.Description = Description\nDialog.DescriptionSlot = DescriptionSlot\nDialog.Close = Close\nDialog.Steps = Steps\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,GAUP,MAAM,UAAU,CAAA","sourcesContent":["export {\n Dialog,\n type DialogBarBackground,\n type DialogContentProps,\n type DialogFooterProps,\n type DialogHeaderProps,\n type DialogInteractOutsideEvent,\n type DialogLayerProps,\n type DialogPlacement,\n type DialogProps,\n type DialogStepsProps,\n} from \"./Dialog\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,GAWP,MAAM,UAAU,CAAA","sourcesContent":["export {\n Dialog,\n type DialogBarBackground,\n type DialogContentProps,\n type DialogFooterProps,\n type DialogHeaderActionProps,\n type DialogHeaderProps,\n type DialogInteractOutsideEvent,\n type DialogLayerProps,\n type DialogPlacement,\n type DialogProps,\n type DialogStepsProps,\n} from \"./Dialog\"\n"]}
@@ -9,6 +9,7 @@ const SETTLE = 400;
9
9
  const INTERACTIVE = "a, button, input, select, textarea, [role='button']";
10
10
  const DRAG_TRANSFORM = "--dialog-panel-drag-transform";
11
11
  const EXITING = "[data-exiting], [data-exiting-active]";
12
+ /** `close` returns false when the owner keeps the dialog open: the sheet then returns at once. */
12
13
  export const attachSheetDrag = (panel, close) => {
13
14
  const view = panel.ownerDocument.defaultView;
14
15
  if (!view)
@@ -106,7 +107,8 @@ export const attachSheetDrag = (panel, close) => {
106
107
  if (panel.isConnected && !panel.closest(EXITING))
107
108
  returnToRest();
108
109
  }, SETTLE);
109
- close();
110
+ if (close(event) === false)
111
+ returnToRest();
110
112
  return;
111
113
  }
112
114
  returnToRest();
@@ -1 +1 @@
1
- {"version":3,"file":"sheetDrag.js","sourceRoot":"","sources":["../../../../src/components/Dialog/sheetDrag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,sGAAsG;AACtG,mGAAmG;AACnG,MAAM,IAAI,GAAG,EAAE,CAAA;AACf,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,IAAI,GAAG,GAAG,CAAA;AAChB,MAAM,MAAM,GAAG,GAAG,CAAA;AAClB,MAAM,WAAW,GAAG,qDAAqD,CAAA;AACzE,MAAM,cAAc,GAAG,+BAA+B,CAAA;AACtD,MAAM,OAAO,GAAG,uCAAuC,CAAA;AAEvD,MAAM,CAAC,MAAM,eA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,CAAC,CAAC,SAAS,CAAA;IACd,aAAa,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE;QACtC,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,YAAY,CAAC,EAAE,iBAAiB,EAAE,IAAI;KAC3E,CAAC,CAAA;IAEF,KAAK,CAAC,gBAAgB,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,KAAK,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/D,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;IACzC,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IAE/C,OAAO,GAAG,EAAE;QACV,aAAa,EAAE,UAAU,EAAE,CAAA;QAC3B,KAAK,CAAC,mBAAmB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;QAChD,KAAK,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;QAC9C,KAAK,CAAC,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAC5C,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;QAClD,MAAM,GAAG,IAAI,CAAA;QACb,KAAK,EAAE,CAAA;IACT,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { isPhoneLayout } from \"../../lib/phoneLayout\"\n\n// A bottom sheet follows the finger. A drag from its top 44px moves it 1:1, never up. Past 30% of its\n// height, or at 0.5px/ms, it closes; otherwise it returns. Buttons in that strip keep their press.\nconst GRIP = 44\nconst CLOSE_SHARE = 0.3\nconst CLOSE_SPEED = 0.5\nconst REST = 100\nconst SETTLE = 400\nconst INTERACTIVE = \"a, button, input, select, textarea, [role='button']\"\nconst DRAG_TRANSFORM = \"--dialog-panel-drag-transform\"\nconst EXITING = \"[data-exiting], [data-exiting-active]\"\n\nexport const attachSheetDrag = (panel: HTMLElement, close: () => void) => {\n const view = panel.ownerDocument.defaultView\n if (!view) return () => {}\n let startY: number | null = null\n let lastY = 0\n let lastTime = 0\n let speed = 0\n let settleTimer: number | undefined\n\n const stopSettling = () => {\n if (settleTimer !== undefined) view.clearTimeout(settleTimer)\n settleTimer = undefined\n panel.removeEventListener(\"transitionend\", onSettled)\n }\n const clearInline = () => {\n panel.style.transition = \"\"\n panel.style.transform = \"\"\n }\n const clear = () => {\n stopSettling()\n clearInline()\n panel.style.removeProperty(DRAG_TRANSFORM)\n }\n const onSettled = (event: TransitionEvent) => {\n if (event.target === panel && event.propertyName === \"transform\") clear()\n }\n const returnToRest = () => {\n stopSettling()\n if (view.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) {\n clear()\n return\n }\n panel.style.transition = \"transform var(--motion-enter) var(--cubic-enter)\"\n panel.style.transform = \"\"\n panel.style.removeProperty(DRAG_TRANSFORM)\n const durationText = view.getComputedStyle(panel).transitionDuration\n const duration = Number.parseFloat(durationText) * (durationText.endsWith(\"ms\") ? 1 : 1000)\n if (duration === 0) {\n clear()\n return\n }\n panel.addEventListener(\"transitionend\", onSettled)\n // A theme can lengthen the token or remove the transition altogether.\n // This cleanup must not cut a valid longer transition at the veto timeout.\n settleTimer = view.setTimeout(clear, Math.max(SETTLE, Number.isFinite(duration) ? duration : 0))\n }\n\n const onStart = (event: TouchEvent) => {\n const phone = isPhoneLayout(panel)\n if (event.touches.length !== 1 || !phone || panel.closest(EXITING)) return\n const { clientY } = event.touches[0]\n if (clientY - panel.getBoundingClientRect().top > GRIP) return\n if (event.target instanceof view.Element && event.target.closest(INTERACTIVE)) return\n stopSettling()\n startY = clientY\n lastY = clientY\n lastTime = event.timeStamp\n speed = 0\n }\n\n const onMove = (event: TouchEvent) => {\n const touch = event.touches[0]\n if (startY === null || !touch) return\n event.preventDefault()\n const { clientY } = touch\n speed = (clientY - lastY) / Math.max(1, event.timeStamp - lastTime)\n lastY = clientY\n lastTime = event.timeStamp\n panel.style.transition = \"none\"\n panel.style.transform = `translateY(${Math.max(0, clientY - startY)}px)`\n }\n\n const onEnd = (event: TouchEvent) => {\n if (startY === null) return\n const travelled = lastY - startY\n // A finger that rested before lifting is no flick.\n const flick = speed > CLOSE_SPEED && event.timeStamp - lastTime < REST\n startY = null\n if (travelled <= 0) {\n clear()\n return\n }\n if (travelled > panel.getBoundingClientRect().height * CLOSE_SHARE || flick) {\n // The normal/exit-start CSS states retain this exact release position.\n // No inline transform or transition may mask the active CSS exit.\n panel.style.setProperty(DRAG_TRANSFORM, `translateY(${travelled}px)`)\n clearInline()\n // An owner can veto close. Register before close, which can detach us.\n settleTimer = view.setTimeout(() => {\n settleTimer = undefined\n if (panel.isConnected && !panel.closest(EXITING)) returnToRest()\n }, SETTLE)\n close()\n return\n }\n returnToRest()\n }\n\n const onCancel = () => {\n startY = null\n clear()\n }\n\n // A retained panel can reopen before its exit completes. Its new entrance\n // must return to rest, not finish at the old gesture's release offset.\n const dialog = panel.closest(\"[data-plex-dialog]\")\n const stateObserver = dialog ? new view.MutationObserver((records) => {\n if (panel.style.getPropertyValue(DRAG_TRANSFORM) &&\n dialog.getAttribute(\"data-state\") === \"open\" &&\n records.some((record) => record.oldValue === \"closed\")) clear()\n }) : undefined\n stateObserver?.observe(dialog ?? panel, {\n attributes: true, attributeFilter: [\"data-state\"], attributeOldValue: true,\n })\n\n panel.addEventListener(\"touchstart\", onStart, { passive: true })\n panel.addEventListener(\"touchmove\", onMove, { passive: false })\n panel.addEventListener(\"touchend\", onEnd)\n panel.addEventListener(\"touchcancel\", onCancel)\n\n return () => {\n stateObserver?.disconnect()\n panel.removeEventListener(\"touchstart\", onStart)\n panel.removeEventListener(\"touchmove\", onMove)\n panel.removeEventListener(\"touchend\", onEnd)\n panel.removeEventListener(\"touchcancel\", onCancel)\n startY = null\n clear()\n }\n}\n"]}
1
+ {"version":3,"file":"sheetDrag.js","sourceRoot":"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BAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAC5C,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;QAClD,MAAM,GAAG,IAAI,CAAA;QACb,KAAK,EAAE,CAAA;IACT,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { isPhoneLayout } from \"../../lib/phoneLayout\"\n\n// A bottom sheet follows the finger. A drag from its top 44px moves it 1:1, never up. Past 30% of its\n// height, or at 0.5px/ms, it closes; otherwise it returns. Buttons in that strip keep their press.\nconst GRIP = 44\nconst CLOSE_SHARE = 0.3\nconst CLOSE_SPEED = 0.5\nconst REST = 100\nconst SETTLE = 400\nconst INTERACTIVE = \"a, button, input, select, textarea, [role='button']\"\nconst DRAG_TRANSFORM = \"--dialog-panel-drag-transform\"\nconst EXITING = \"[data-exiting], [data-exiting-active]\"\n\n/** `close` returns false when the owner keeps the dialog open: the sheet then returns at once. */\nexport const attachSheetDrag = (panel: HTMLElement, close: (event: TouchEvent) => boolean | void) => {\n const view = panel.ownerDocument.defaultView\n if (!view) return () => {}\n let startY: number | null = null\n let lastY = 0\n let lastTime = 0\n let speed = 0\n let settleTimer: number | undefined\n\n const stopSettling = () => {\n if (settleTimer !== undefined) view.clearTimeout(settleTimer)\n settleTimer = undefined\n panel.removeEventListener(\"transitionend\", onSettled)\n }\n const clearInline = () => {\n panel.style.transition = \"\"\n panel.style.transform = \"\"\n }\n const clear = () => {\n stopSettling()\n clearInline()\n panel.style.removeProperty(DRAG_TRANSFORM)\n }\n const onSettled = (event: TransitionEvent) => {\n if (event.target === panel && event.propertyName === \"transform\") clear()\n }\n const returnToRest = () => {\n stopSettling()\n if (view.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) {\n clear()\n return\n }\n panel.style.transition = \"transform var(--motion-enter) var(--cubic-enter)\"\n panel.style.transform = \"\"\n panel.style.removeProperty(DRAG_TRANSFORM)\n const durationText = view.getComputedStyle(panel).transitionDuration\n const duration = Number.parseFloat(durationText) * (durationText.endsWith(\"ms\") ? 1 : 1000)\n if (duration === 0) {\n clear()\n return\n }\n panel.addEventListener(\"transitionend\", onSettled)\n // A theme can lengthen the token or remove the transition altogether.\n // This cleanup must not cut a valid longer transition at the veto timeout.\n settleTimer = view.setTimeout(clear, Math.max(SETTLE, Number.isFinite(duration) ? duration : 0))\n }\n\n const onStart = (event: TouchEvent) => {\n const phone = isPhoneLayout(panel)\n if (event.touches.length !== 1 || !phone || panel.closest(EXITING)) return\n const { clientY } = event.touches[0]\n if (clientY - panel.getBoundingClientRect().top > GRIP) return\n if (event.target instanceof view.Element && event.target.closest(INTERACTIVE)) return\n stopSettling()\n startY = clientY\n lastY = clientY\n lastTime = event.timeStamp\n speed = 0\n }\n\n const onMove = (event: TouchEvent) => {\n const touch = event.touches[0]\n if (startY === null || !touch) return\n event.preventDefault()\n const { clientY } = touch\n speed = (clientY - lastY) / Math.max(1, event.timeStamp - lastTime)\n lastY = clientY\n lastTime = event.timeStamp\n panel.style.transition = \"none\"\n panel.style.transform = `translateY(${Math.max(0, clientY - startY)}px)`\n }\n\n const onEnd = (event: TouchEvent) => {\n if (startY === null) return\n const travelled = lastY - startY\n // A finger that rested before lifting is no flick.\n const flick = speed > CLOSE_SPEED && event.timeStamp - lastTime < REST\n startY = null\n if (travelled <= 0) {\n clear()\n return\n }\n if (travelled > panel.getBoundingClientRect().height * CLOSE_SHARE || flick) {\n // The normal/exit-start CSS states retain this exact release position.\n // No inline transform or transition may mask the active CSS exit.\n panel.style.setProperty(DRAG_TRANSFORM, `translateY(${travelled}px)`)\n clearInline()\n // An owner can veto close. Register before close, which can detach us.\n settleTimer = view.setTimeout(() => {\n settleTimer = undefined\n if (panel.isConnected && !panel.closest(EXITING)) returnToRest()\n }, SETTLE)\n if (close(event) === false) returnToRest()\n return\n }\n returnToRest()\n }\n\n const onCancel = () => {\n startY = null\n clear()\n }\n\n // A retained panel can reopen before its exit completes. Its new entrance\n // must return to rest, not finish at the old gesture's release offset.\n const dialog = panel.closest(\"[data-plex-dialog]\")\n const stateObserver = dialog ? new view.MutationObserver((records) => {\n if (panel.style.getPropertyValue(DRAG_TRANSFORM) &&\n dialog.getAttribute(\"data-state\") === \"open\" &&\n records.some((record) => record.oldValue === \"closed\")) clear()\n }) : undefined\n stateObserver?.observe(dialog ?? panel, {\n attributes: true, attributeFilter: [\"data-state\"], attributeOldValue: true,\n })\n\n panel.addEventListener(\"touchstart\", onStart, { passive: true })\n panel.addEventListener(\"touchmove\", onMove, { passive: false })\n panel.addEventListener(\"touchend\", onEnd)\n panel.addEventListener(\"touchcancel\", onCancel)\n\n return () => {\n stateObserver?.disconnect()\n panel.removeEventListener(\"touchstart\", onStart)\n panel.removeEventListener(\"touchmove\", onMove)\n panel.removeEventListener(\"touchend\", onEnd)\n panel.removeEventListener(\"touchcancel\", onCancel)\n startY = null\n clear()\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const FilterBadge = (props) => (_jsxs("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...props, children: [_jsx("path", { d: "M15 16C15.5523 16 16 16.4477 16 17C16 17.5523 15.5523 18 15 18H9C8.44772 18 8 17.5523 8 17C8 16.4477 8.44772 16 9 16H15ZM18 11C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H18ZM13 6C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6H13Z", fill: "currentColor" }), _jsx("circle", { cx: "20", cy: "4", r: "4", fill: "var(--color-primary, #0285FF)" })] }));
2
+ const FilterBadge = (props) => (_jsxs("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...props, children: [_jsx("path", { d: "M15 16C15.5523 16 16 16.4477 16 17C16 17.5523 15.5523 18 15 18H9C8.44772 18 8 17.5523 8 17C8 16.4477 8.44772 16 9 16H15ZM18 11C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H18ZM13 6C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6H13Z", fill: "currentColor" }), _jsx("circle", { cx: "20", cy: "4", r: "4", fill: "var(--color-accent, #0285FF)" })] }));
3
3
  FilterBadge.displayName = "FilterBadge";
4
4
  export default FilterBadge;
5
5
  //# sourceMappingURL=FilterBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterBadge.js","sourceRoot":"","sources":["../../../../../src/components/Icon/svg/FilterBadge.tsx"],"names":[],"mappings":";AACA,MAAM,WAAW,GAAG,CAAC,KAA8B,EAAE,EAAE,CAAC,CACtD,eAAK,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,iBAAa,MAAM,KAAK,KAAK,aAChG,eAAM,CAAC,EAAC,iWAAiW,EAAC,IAAI,EAAC,cAAc,GAAG,EAChY,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,+BAA+B,GAAG,IAChE,CACP,CAAA;AACD,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AACvC,eAAe,WAAW,CAAA","sourcesContent":["import type { SVGProps } from \"react\"\nconst FilterBadge = (props: SVGProps<SVGSVGElement>) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" {...props}>\n <path d=\"M15 16C15.5523 16 16 16.4477 16 17C16 17.5523 15.5523 18 15 18H9C8.44772 18 8 17.5523 8 17C8 16.4477 8.44772 16 9 16H15ZM18 11C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H18ZM13 6C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6H13Z\" fill=\"currentColor\" />\n <circle cx=\"20\" cy=\"4\" r=\"4\" fill=\"var(--color-primary, #0285FF)\" />\n </svg>\n)\nFilterBadge.displayName = \"FilterBadge\"\nexport default FilterBadge\n"]}
1
+ {"version":3,"file":"FilterBadge.js","sourceRoot":"","sources":["../../../../../src/components/Icon/svg/FilterBadge.tsx"],"names":[],"mappings":";AACA,MAAM,WAAW,GAAG,CAAC,KAA8B,EAAE,EAAE,CAAC,CACtD,eAAK,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,iBAAa,MAAM,KAAK,KAAK,aAChG,eAAM,CAAC,EAAC,iWAAiW,EAAC,IAAI,EAAC,cAAc,GAAG,EAChY,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,8BAA8B,GAAG,IAC/D,CACP,CAAA;AACD,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AACvC,eAAe,WAAW,CAAA","sourcesContent":["import type { SVGProps } from \"react\"\nconst FilterBadge = (props: SVGProps<SVGSVGElement>) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" {...props}>\n <path d=\"M15 16C15.5523 16 16 16.4477 16 17C16 17.5523 15.5523 18 15 18H9C8.44772 18 8 17.5523 8 17C8 16.4477 8.44772 16 9 16H15ZM18 11C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H18ZM13 6C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6H13Z\" fill=\"currentColor\" />\n <circle cx=\"20\" cy=\"4\" r=\"4\" fill=\"var(--color-accent, #0285FF)\" />\n </svg>\n)\nFilterBadge.displayName = \"FilterBadge\"\nexport default FilterBadge\n"]}
@@ -0,0 +1 @@
1
+ @import "@plexui/styles/styles/geist-mono.css";
@@ -0,0 +1 @@
1
+ @import "@plexui/styles/styles/inter.css";
@@ -10,9 +10,9 @@ export declare const Dialog: {
10
10
  Trigger: ({ children }: {
11
11
  children: ReactNode;
12
12
  }) => import("react/jsx-runtime").JSX.Element;
13
- Content: ({ children, width, showClose, pill, className, placement, mobilePlacement: requestedMobilePlacement, mobileVariant, surface, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onInteractOutside, zIndex, rootProps, overlayProps, layout, ...rest }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
13
+ Content: ({ children, width, showClose, pill, className, placement, mobilePlacement: requestedMobilePlacement, mobileVariant: requestedMobileVariant, surface, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onInteractOutside, zIndex, rootProps, overlayProps, layout, ...rest }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
14
14
  Header: ({ children, className, background }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
15
- HeaderAction: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
15
+ HeaderAction: ({ children, className, side }: DialogHeaderActionProps) => import("react/jsx-runtime").JSX.Element;
16
16
  Body: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
17
17
  Footer: ({ children, className, mobileLayout, background }: DialogFooterProps) => import("react/jsx-runtime").JSX.Element;
18
18
  Title: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
@@ -24,9 +24,12 @@ export declare const Dialog: {
24
24
  Steps: ({ step, direction, children, className }: DialogStepsProps) => import("react/jsx-runtime").JSX.Element;
25
25
  };
26
26
  export type DialogPlacement = "center" | "top" | "bottom" | "start" | "end" | "fullscreen";
27
- /** A press or a focus outside the dialog; `event.detail.originalEvent` is the browser's event. */
27
+ /**
28
+ * A press or a focus outside the dialog, or a phone sheet pulled down to close; `event.detail.originalEvent` is the
29
+ * browser's event (a TouchEvent for the sheet).
30
+ */
28
31
  export type DialogInteractOutsideEvent = CustomEvent<{
29
- originalEvent: PointerEvent | FocusEvent;
32
+ originalEvent: PointerEvent | FocusEvent | TouchEvent;
30
33
  }>;
31
34
  /** Class, style and data attributes for one of the dialog's layers. */
32
35
  export type DialogLayerProps = {
@@ -51,9 +54,16 @@ export type DialogContentProps = {
51
54
  * @default center
52
55
  */
53
56
  placement?: DialogPlacement;
54
- /** Placement at 767px and below, such as a bottom sheet on phones. @default placement */
57
+ /**
58
+ * Where a phone sheet stands at 767px and below: `bottom`, or `fullscreen` for the whole screen. `center` is the
59
+ * alert's place: without `mobileVariant` it makes the dialog an alert. @default "fullscreen" for a fullscreen
60
+ * dialog, else "bottom"
61
+ */
55
62
  mobilePlacement?: Extract<DialogPlacement, "center" | "bottom" | "fullscreen">;
56
- /** Mobile presentation at 767px and below. Sheets default to bottom placement. */
63
+ /**
64
+ * The iOS presentation at 767px and below. A phone has two modal views: the sheet, which iOS gives any view it
65
+ * presents, and the alert, a short question with its answers (UIAlertController). @default "sheet"
66
+ */
57
67
  mobileVariant?: "alert" | "sheet";
58
68
  /** Mobile panel palette; dark mode uses elevated surfaces. @default "plain" */
59
69
  surface?: "plain" | "grouped";
@@ -70,8 +80,9 @@ export type DialogContentProps = {
70
80
  */
71
81
  onEscapeKeyDown?: (event: KeyboardEvent) => void;
72
82
  /**
73
- * Called on a press or a focus outside the dialog before it closes. Call `event.preventDefault()` to keep it open,
74
- * such as for a press on a developer panel over the page.
83
+ * Called on a press or a focus outside the dialog, and on a phone sheet pulled down to close, before it closes. Call
84
+ * `event.preventDefault()` to keep it open, such as for a form with unsaved changes (the sheet then returns, as an
85
+ * iOS sheet does under `isModalInPresentation`), or for a press on a developer panel over the page.
75
86
  */
76
87
  onInteractOutside?: (event: DialogInteractOutsideEvent) => void;
77
88
  /** Stack order of the overlay and the dialog. @default 50 */
@@ -97,6 +108,14 @@ export type DialogHeaderProps = DialogSlotProps & {
97
108
  /** How the bar meets the content scrolled under it in a phone Sheet. @default "glass" */
98
109
  background?: DialogBarBackground;
99
110
  };
111
+ export type DialogHeaderActionProps = DialogSlotProps & {
112
+ /**
113
+ * `leading` puts the action before the title, such as the Back of a step in `Dialog.Steps`: on a phone Sheet it
114
+ * takes the place of Close, as the back button of a screen pushed inside an iOS sheet does.
115
+ * @default "trailing"
116
+ */
117
+ side?: "leading" | "trailing";
118
+ };
100
119
  export type DialogFooterProps = DialogSlotProps & {
101
120
  /** How the bar meets the content scrolled under it in a phone Sheet. @default "soft" */
102
121
  background?: DialogBarBackground;
@@ -1 +1 @@
1
- export { Dialog, type DialogBarBackground, type DialogContentProps, type DialogFooterProps, type DialogHeaderProps, type DialogInteractOutsideEvent, type DialogLayerProps, type DialogPlacement, type DialogProps, type DialogStepsProps, } from "./Dialog.js";
1
+ export { Dialog, type DialogBarBackground, type DialogContentProps, type DialogFooterProps, type DialogHeaderActionProps, type DialogHeaderProps, type DialogInteractOutsideEvent, type DialogLayerProps, type DialogPlacement, type DialogProps, type DialogStepsProps, } from "./Dialog.js";
@@ -1 +1,2 @@
1
- export declare const attachSheetDrag: (panel: HTMLElement, close: () => void) => () => void;
1
+ /** `close` returns false when the owner keeps the dialog open: the sheet then returns at once. */
2
+ export declare const attachSheetDrag: (panel: HTMLElement, close: (event: TouchEvent) => boolean | void) => () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/ui",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "Modern design system for building high-quality applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -99,7 +99,7 @@
99
99
  "@maskito/core": "^5.2.2",
100
100
  "@maskito/kit": "^5.2.2",
101
101
  "@maskito/react": "^5.2.2",
102
- "@plexui/styles": "^0.2.0",
102
+ "@plexui/styles": "^0.3.0",
103
103
  "@radix-ui/react-dismissable-layer": "1.2.1",
104
104
  "@radix-ui/react-focus-guards": "1.2.0",
105
105
  "@radix-ui/react-focus-scope": "1.3.1",