@thewhatmatters/wmds 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/CONSUMING.md +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.d.ts +25 -10
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +423 -428
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +11 -10
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDockGate.js +130 -153
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts +7 -6
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +18 -11
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockGateStyles.js +2 -3
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +6 -12
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockStyles.js +6 -9
- package/dist/components/organisms/Dialog/Dialog.js +34 -34
- package/dist/components/organisms/Sheet/Sheet.js +38 -38
- package/dist/lib/dialogOverlay.d.ts +0 -5
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +1 -12
- package/dist/styles.css +1 -1
- package/docs/component-contracts.md +2 -2
- package/docs/components.md +2 -2
- package/docs/exports.json +1 -1
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +1 -1
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
- package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +1 -1
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +1 -1
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +3 -2
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +2 -2
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
- package/docs/patterns/components-descriptionlist--details.tsx +1 -1
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +1 -1
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
- package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +1 -1
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +1 -1
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/index.json +1 -1
- package/package.json +1 -1
|
@@ -2,34 +2,34 @@
|
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { motionTransitionProp as t } from "../../../lib/motion.js";
|
|
4
4
|
import { Card as n } from "../../molecules/Card/Card.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { dialogBackdropClasses as r, dialogOverlayRootClasses as i, dialogPanelShellClasses as a, dialogPanelSizeClasses as o, dialogSizes as s, overlayPanelChromeClasses as c, overlayPanelDialogBodyScrollClasses as l, overlayPanelDialogFooterClasses as u, overlayPanelMaxHeightClasses as d } from "./dialogStyles.js";
|
|
6
|
+
import { OverlayPanelHeader as f } from "./OverlayPanelHeader.js";
|
|
7
|
+
import { focusInitialElement as p, lockBodyScroll as m, trapFocus as h } from "../../../lib/dialogOverlay.js";
|
|
8
8
|
import { DialogProvider as g, useDialogContext as _, useDialogLabelIds as v } from "./DialogContext.js";
|
|
9
9
|
import { useCallback as y, useEffect as b, useRef as x } from "react";
|
|
10
10
|
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
11
|
import { AnimatePresence as w, motion as T } from "motion/react";
|
|
12
12
|
import { createPortal as E } from "react-dom";
|
|
13
13
|
//#region src/components/organisms/Dialog/Dialog.tsx
|
|
14
|
-
function D({ role: e, "aria-labelledby": n, "aria-describedby":
|
|
15
|
-
let { open:
|
|
16
|
-
|
|
17
|
-
}, [
|
|
14
|
+
function D({ role: e, "aria-labelledby": n, "aria-describedby": a, initialFocusSelector: o, children: s }) {
|
|
15
|
+
let { open: c, onOpenChange: l, dismissOnBackdrop: u, dismissOnEscape: d, triggerRef: f } = _("DialogPortal"), g = x(null), v = x(null), D = y(() => {
|
|
16
|
+
l(!1);
|
|
17
|
+
}, [l]);
|
|
18
18
|
b(() => {
|
|
19
|
-
if (!
|
|
20
|
-
v.current =
|
|
21
|
-
let e =
|
|
22
|
-
return t != null && (n =
|
|
23
|
-
|
|
19
|
+
if (!c) return;
|
|
20
|
+
v.current = f.current ?? document.activeElement;
|
|
21
|
+
let e = m(), t = g.current, n = () => {};
|
|
22
|
+
return t != null && (n = h(t), window.requestAnimationFrame(() => {
|
|
23
|
+
p(t, o);
|
|
24
24
|
})), () => {
|
|
25
25
|
n(), e(), v.current?.focus?.();
|
|
26
26
|
};
|
|
27
27
|
}, [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
o,
|
|
29
|
+
c,
|
|
30
|
+
f
|
|
31
31
|
]), b(() => {
|
|
32
|
-
if (!
|
|
32
|
+
if (!c || !d) return;
|
|
33
33
|
function e(e) {
|
|
34
34
|
e.key === "Escape" && (e.preventDefault(), D());
|
|
35
35
|
}
|
|
@@ -38,23 +38,23 @@ function D({ role: e, "aria-labelledby": n, "aria-describedby": c, initialFocusS
|
|
|
38
38
|
};
|
|
39
39
|
}, [
|
|
40
40
|
D,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
d,
|
|
42
|
+
c
|
|
43
43
|
]);
|
|
44
44
|
function O(e) {
|
|
45
|
-
if (!
|
|
45
|
+
if (!u) return;
|
|
46
46
|
let t = e.target;
|
|
47
47
|
g.current?.contains(t) || D();
|
|
48
48
|
}
|
|
49
|
-
return typeof document > "u" ? null : E(/* @__PURE__ */ S(w, { children:
|
|
50
|
-
className:
|
|
49
|
+
return typeof document > "u" ? null : E(/* @__PURE__ */ S(w, { children: c ? /* @__PURE__ */ C(T.div, {
|
|
50
|
+
className: i,
|
|
51
51
|
initial: { opacity: 0 },
|
|
52
52
|
animate: { opacity: 1 },
|
|
53
53
|
exit: { opacity: 0 },
|
|
54
54
|
transition: t("medium"),
|
|
55
55
|
onMouseDown: O,
|
|
56
56
|
children: [/* @__PURE__ */ S("div", {
|
|
57
|
-
className:
|
|
57
|
+
className: r,
|
|
58
58
|
"aria-hidden": "true"
|
|
59
59
|
}), /* @__PURE__ */ S(T.div, {
|
|
60
60
|
ref: g,
|
|
@@ -62,7 +62,7 @@ function D({ role: e, "aria-labelledby": n, "aria-describedby": c, initialFocusS
|
|
|
62
62
|
role: e,
|
|
63
63
|
"aria-modal": "true",
|
|
64
64
|
"aria-labelledby": n,
|
|
65
|
-
"aria-describedby":
|
|
65
|
+
"aria-describedby": a,
|
|
66
66
|
initial: {
|
|
67
67
|
opacity: 0,
|
|
68
68
|
scale: .96,
|
|
@@ -82,7 +82,7 @@ function D({ role: e, "aria-labelledby": n, "aria-describedby": c, initialFocusS
|
|
|
82
82
|
onMouseDown: (e) => {
|
|
83
83
|
e.stopPropagation();
|
|
84
84
|
},
|
|
85
|
-
children:
|
|
85
|
+
children: s
|
|
86
86
|
})]
|
|
87
87
|
}) : null }), document.body);
|
|
88
88
|
}
|
|
@@ -113,29 +113,29 @@ function k({ children: e, className: t }) {
|
|
|
113
113
|
children: e
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
function A({ title: t, description: r, headerStart: i, showClose:
|
|
117
|
-
let { titleId: v, descriptionId: y, onOpenChange: b } = _("Dialog.Content"), x = t != null, w = r != null, T = g != null || !x && w, E =
|
|
116
|
+
function A({ title: t, description: r, headerStart: i, showClose: s = !0, footer: p, size: m = "md", className: h, children: g }) {
|
|
117
|
+
let { titleId: v, descriptionId: y, onOpenChange: b } = _("Dialog.Content"), x = t != null, w = r != null, T = g != null || !x && w, E = p != null, O = T || E;
|
|
118
118
|
return /* @__PURE__ */ S(D, {
|
|
119
119
|
role: "dialog",
|
|
120
120
|
"aria-labelledby": x ? v : void 0,
|
|
121
121
|
"aria-describedby": w ? y : void 0,
|
|
122
122
|
children: /* @__PURE__ */ C(n, {
|
|
123
123
|
padding: "none",
|
|
124
|
-
bodyTerminal:
|
|
125
|
-
className: e(
|
|
124
|
+
bodyTerminal: p == null,
|
|
125
|
+
className: e(o[m], c, d, a, h),
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */ S(
|
|
127
|
+
/* @__PURE__ */ S(f, {
|
|
128
128
|
titleId: v,
|
|
129
129
|
descriptionId: y,
|
|
130
130
|
title: t,
|
|
131
131
|
description: r,
|
|
132
132
|
headerStart: i,
|
|
133
|
-
showClose:
|
|
133
|
+
showClose: s,
|
|
134
134
|
closeLabel: "Close dialog",
|
|
135
135
|
onClose: () => b(!1)
|
|
136
136
|
}),
|
|
137
137
|
O ? /* @__PURE__ */ C("div", {
|
|
138
|
-
className:
|
|
138
|
+
className: l,
|
|
139
139
|
children: [!x && w ? /* @__PURE__ */ S("p", {
|
|
140
140
|
id: y,
|
|
141
141
|
className: "text-muted",
|
|
@@ -143,8 +143,8 @@ function A({ title: t, description: r, headerStart: i, showClose: a = !0, footer
|
|
|
143
143
|
}) : null, g]
|
|
144
144
|
}) : null,
|
|
145
145
|
E ? /* @__PURE__ */ S("footer", {
|
|
146
|
-
className:
|
|
147
|
-
children:
|
|
146
|
+
className: u,
|
|
147
|
+
children: p
|
|
148
148
|
}) : null
|
|
149
149
|
]
|
|
150
150
|
})
|
|
@@ -155,4 +155,4 @@ var j = Object.assign(O, {
|
|
|
155
155
|
Content: A
|
|
156
156
|
});
|
|
157
157
|
//#endregion
|
|
158
|
-
export { j as Dialog, D as DialogPortal,
|
|
158
|
+
export { j as Dialog, D as DialogPortal, s as dialogSizes };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { motionTransitionProp as t } from "../../../lib/motion.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { dialogBackdropClasses as n, overlayPanelBodyScrollClasses as r, overlayPanelChromeClasses as i, overlayPanelFooterClasses as a, overlayPanelFooterDelineatedInnerClasses as o, overlayPanelFooterDelineatedShellClasses as s, overlayPanelFooterHairlineClasses as c, overlayPanelSectionStackClasses as l } from "../Dialog/dialogStyles.js";
|
|
5
|
+
import { OverlayPanelHeader as u } from "../Dialog/OverlayPanelHeader.js";
|
|
6
|
+
import { focusInitialElement as d, lockBodyScroll as f, trapFocus as p } from "../../../lib/dialogOverlay.js";
|
|
7
7
|
import { sheetOverlayRootClasses as m, sheetPanelBaseClasses as h, sheetPanelMotionTransition as g, sheetPanelMotionVariants as _, sheetPanelPlacementClasses as v, sheetPanelSizeClasses as y, sheetSides as b, sheetSizes as x } from "./sheetStyles.js";
|
|
8
8
|
import { SheetProvider as S, useSheetContext as C, useSheetLabelIds as w } from "./SheetContext.js";
|
|
9
9
|
import { useCallback as T, useEffect as E, useRef as D } from "react";
|
|
@@ -11,21 +11,21 @@ import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
|
11
11
|
import { AnimatePresence as A, motion as j } from "motion/react";
|
|
12
12
|
import { createPortal as M } from "react-dom";
|
|
13
13
|
//#region src/components/organisms/Sheet/Sheet.tsx
|
|
14
|
-
function N({ side:
|
|
15
|
-
let { open:
|
|
16
|
-
|
|
17
|
-
}, [
|
|
14
|
+
function N({ side: r, size: a, "aria-labelledby": o, "aria-describedby": s, children: c }) {
|
|
15
|
+
let { open: l, onOpenChange: u, dismissOnBackdrop: b, dismissOnEscape: x, triggerRef: S } = C("SheetPortal"), w = D(null), N = D(null), P = T(() => {
|
|
16
|
+
u(!1);
|
|
17
|
+
}, [u]);
|
|
18
18
|
E(() => {
|
|
19
|
-
if (!
|
|
19
|
+
if (!l) return;
|
|
20
20
|
N.current = S.current ?? document.activeElement;
|
|
21
|
-
let e =
|
|
22
|
-
return t != null && (
|
|
23
|
-
|
|
21
|
+
let e = f(), t = w.current, n = () => {};
|
|
22
|
+
return t != null && (n = p(t), window.requestAnimationFrame(() => {
|
|
23
|
+
d(t);
|
|
24
24
|
})), () => {
|
|
25
|
-
|
|
25
|
+
n(), e(), N.current?.focus?.();
|
|
26
26
|
};
|
|
27
|
-
}, [
|
|
28
|
-
if (!
|
|
27
|
+
}, [l, S]), E(() => {
|
|
28
|
+
if (!l || !x) return;
|
|
29
29
|
function e(e) {
|
|
30
30
|
e.key === "Escape" && (e.preventDefault(), P());
|
|
31
31
|
}
|
|
@@ -35,39 +35,39 @@ function N({ side: o, size: c, "aria-labelledby": l, "aria-describedby": u, chil
|
|
|
35
35
|
}, [
|
|
36
36
|
P,
|
|
37
37
|
x,
|
|
38
|
-
|
|
38
|
+
l
|
|
39
39
|
]);
|
|
40
40
|
function F(e) {
|
|
41
41
|
if (!b) return;
|
|
42
42
|
let t = e.target;
|
|
43
43
|
w.current?.contains(t) || P();
|
|
44
44
|
}
|
|
45
|
-
return typeof document > "u" ? null : M(/* @__PURE__ */ O(A, { children:
|
|
46
|
-
className: m[
|
|
45
|
+
return typeof document > "u" ? null : M(/* @__PURE__ */ O(A, { children: l ? /* @__PURE__ */ k(j.div, {
|
|
46
|
+
className: m[r],
|
|
47
47
|
initial: { opacity: 0 },
|
|
48
48
|
animate: { opacity: 1 },
|
|
49
49
|
exit: { opacity: 0 },
|
|
50
50
|
transition: t("medium"),
|
|
51
51
|
onMouseDown: F,
|
|
52
52
|
children: [/* @__PURE__ */ O("div", {
|
|
53
|
-
className:
|
|
53
|
+
className: n,
|
|
54
54
|
"aria-hidden": "true"
|
|
55
55
|
}), /* @__PURE__ */ O(j.div, {
|
|
56
56
|
ref: w,
|
|
57
|
-
className: e(h, v[
|
|
57
|
+
className: e(h, v[r], y[r][a], i, "relative z-[1]"),
|
|
58
58
|
role: "dialog",
|
|
59
59
|
"aria-modal": "true",
|
|
60
|
-
"aria-labelledby":
|
|
61
|
-
"aria-describedby":
|
|
62
|
-
variants: _(
|
|
60
|
+
"aria-labelledby": o,
|
|
61
|
+
"aria-describedby": s,
|
|
62
|
+
variants: _(r),
|
|
63
63
|
initial: "hidden",
|
|
64
64
|
animate: "visible",
|
|
65
65
|
exit: "exit",
|
|
66
|
-
transition: g(
|
|
66
|
+
transition: g(r),
|
|
67
67
|
onMouseDown: (e) => {
|
|
68
68
|
e.stopPropagation();
|
|
69
69
|
},
|
|
70
|
-
children:
|
|
70
|
+
children: c
|
|
71
71
|
})]
|
|
72
72
|
}) : null }), document.body);
|
|
73
73
|
}
|
|
@@ -98,46 +98,46 @@ function F({ children: e, className: t }) {
|
|
|
98
98
|
children: e
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
function I({ side: t = "bottom", size: n = "md", title:
|
|
102
|
-
let { titleId: _, descriptionId: v, onOpenChange: y } = C("Sheet.Content"), b =
|
|
101
|
+
function I({ side: t = "bottom", size: n = "md", title: i, description: d, headerStart: f, showClose: p = !0, footer: m, className: h, children: g }) {
|
|
102
|
+
let { titleId: _, descriptionId: v, onOpenChange: y } = C("Sheet.Content"), b = i != null, x = d != null, S = g != null || !b && x, w = m != null;
|
|
103
103
|
return /* @__PURE__ */ O(N, {
|
|
104
104
|
side: t,
|
|
105
105
|
size: n,
|
|
106
106
|
"aria-labelledby": b ? _ : void 0,
|
|
107
107
|
"aria-describedby": x ? v : void 0,
|
|
108
108
|
children: /* @__PURE__ */ k("div", {
|
|
109
|
-
className: e(
|
|
109
|
+
className: e(l, m == null ? "pb-4" : void 0, h),
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */ O(
|
|
111
|
+
/* @__PURE__ */ O(u, {
|
|
112
112
|
titleId: _,
|
|
113
113
|
descriptionId: v,
|
|
114
|
-
title:
|
|
115
|
-
description:
|
|
116
|
-
headerStart:
|
|
117
|
-
showClose:
|
|
114
|
+
title: i,
|
|
115
|
+
description: d,
|
|
116
|
+
headerStart: f,
|
|
117
|
+
showClose: p,
|
|
118
118
|
closeLabel: "Close sheet",
|
|
119
119
|
onClose: () => y(!1),
|
|
120
120
|
delineated: S || w
|
|
121
121
|
}),
|
|
122
122
|
S ? /* @__PURE__ */ k("div", {
|
|
123
|
-
className:
|
|
123
|
+
className: r,
|
|
124
124
|
children: [!b && x ? /* @__PURE__ */ O("p", {
|
|
125
125
|
id: v,
|
|
126
126
|
className: "text-muted",
|
|
127
|
-
children:
|
|
127
|
+
children: d
|
|
128
128
|
}) : null, g]
|
|
129
129
|
}) : null,
|
|
130
130
|
w ? S ? /* @__PURE__ */ k("footer", {
|
|
131
|
-
className:
|
|
131
|
+
className: s,
|
|
132
132
|
children: [/* @__PURE__ */ O("hr", {
|
|
133
|
-
className:
|
|
133
|
+
className: c,
|
|
134
134
|
"aria-hidden": "true"
|
|
135
135
|
}), /* @__PURE__ */ O("div", {
|
|
136
|
-
className:
|
|
136
|
+
className: o,
|
|
137
137
|
children: m
|
|
138
138
|
})]
|
|
139
139
|
}) : /* @__PURE__ */ O("footer", {
|
|
140
|
-
className: e(
|
|
140
|
+
className: e(a, "pb-4"),
|
|
141
141
|
children: m
|
|
142
142
|
}) : null
|
|
143
143
|
]
|
|
@@ -4,9 +4,4 @@ export declare function trapFocus(container: HTMLElement): () => void;
|
|
|
4
4
|
export declare function lockBodyScroll(): () => void;
|
|
5
5
|
/** Focus the first tabbable control inside the panel — usually the primary action or close. */
|
|
6
6
|
export declare function focusInitialElement(container: HTMLElement, preferSelector?: string): void;
|
|
7
|
-
/**
|
|
8
|
-
* Make everything outside `element` inert — every sibling of it and of each ancestor up to `<body>`.
|
|
9
|
-
* Elements that were inert already are left alone. Returns cleanup.
|
|
10
|
-
*/
|
|
11
|
-
export declare function inertOutside(element: HTMLElement): () => void;
|
|
12
7
|
//# sourceMappingURL=dialogOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialogOverlay.d.ts","sourceRoot":"","sources":["../../src/lib/dialogOverlay.ts"],"names":[],"mappings":"AAYA,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,IAAI,CAqC5D;AAED,yEAAyE;AACzE,wBAAgB,cAAc,IAAI,MAAM,IAAI,CAY3C;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,WAAW,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI,CAWN
|
|
1
|
+
{"version":3,"file":"dialogOverlay.d.ts","sourceRoot":"","sources":["../../src/lib/dialogOverlay.ts"],"names":[],"mappings":"AAYA,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,IAAI,CAqC5D;AAED,yEAAyE;AACzE,wBAAgB,cAAc,IAAI,MAAM,IAAI,CAY3C;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,WAAW,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI,CAWN"}
|
|
@@ -40,16 +40,5 @@ function i(t, n) {
|
|
|
40
40
|
}
|
|
41
41
|
t.querySelector(e)?.focus();
|
|
42
42
|
}
|
|
43
|
-
function a(e) {
|
|
44
|
-
let t = [], n = e;
|
|
45
|
-
for (; n.parentElement != null && n !== document.body;) {
|
|
46
|
-
let e = n.parentElement;
|
|
47
|
-
for (let r of Array.from(e.children)) r === n || !(r instanceof HTMLElement) || r.inert || r instanceof HTMLScriptElement || r instanceof HTMLStyleElement || (r.inert = !0, t.push(r));
|
|
48
|
-
n = e;
|
|
49
|
-
}
|
|
50
|
-
return () => {
|
|
51
|
-
for (let e of t) e.inert = !1;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
43
|
//#endregion
|
|
55
|
-
export { i as focusInitialElement,
|
|
44
|
+
export { i as focusInitialElement, r as lockBodyScroll, n as trapFocus };
|