@thewhatmatters/wmds 0.4.1 → 0.4.3
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 +38 -0
- package/CONSUMING.md +3 -2
- package/bin/wmds-check.mjs +108 -10
- package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts +59 -0
- package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/molecules/Breadcrumb/Breadcrumb.js +188 -0
- package/dist/components/molecules/Breadcrumb/breadcrumbStyles.d.ts +21 -0
- package/dist/components/molecules/Breadcrumb/breadcrumbStyles.d.ts.map +1 -0
- package/dist/components/molecules/Breadcrumb/breadcrumbStyles.js +11 -0
- package/dist/components/molecules/Dropdown/DropdownItem.d.ts +7 -2
- package/dist/components/molecules/Dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/components/molecules/Dropdown/DropdownItem.js +40 -24
- package/dist/components/organisms/ChatDock/ChatDock.d.ts +9 -18
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +411 -411
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +19 -9
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDockGate.js +152 -123
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts +11 -0
- package/dist/components/organisms/ChatDock/chatDockGateContext.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockGateContext.js +9 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +15 -10
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockGateStyles.js +3 -3
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +10 -4
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockStyles.js +9 -6
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts +6 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockViewport.js +14 -1
- package/dist/components/organisms/Dialog/Dialog.js +34 -34
- package/dist/components/organisms/Sheet/Sheet.js +38 -38
- package/dist/components/organisms/SiteNav/SiteNav.js +86 -86
- package/dist/components/organisms/Toast/Toast.d.ts.map +1 -1
- package/dist/components/organisms/Toast/Toast.js +11 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -88
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.d.ts +5 -0
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +29 -15
- package/dist/styles.css +1 -1
- package/docs/component-contracts.md +4 -2
- package/docs/components.md +7 -6
- package/docs/exports.json +17 -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 +9 -0
- package/docs/patterns/components-breadcrumb--long-path.tsx +9 -0
- package/docs/patterns/components-breadcrumb--path.tsx +9 -0
- package/docs/patterns/components-breadcrumb--router-links.tsx +10 -0
- 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 +1 -1
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +54 -11
- 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 +41 -17
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +39 -4
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/index.json +33 -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 { focusInitialElement as r, lockBodyScroll as i, trapFocus as a } from "../../../lib/dialogOverlay.js";
|
|
6
|
+
import { dialogBackdropClasses as o, dialogOverlayRootClasses as s, dialogPanelShellClasses as c, dialogPanelSizeClasses as l, dialogSizes as u, overlayPanelChromeClasses as d, overlayPanelDialogBodyScrollClasses as f, overlayPanelDialogFooterClasses as p, overlayPanelMaxHeightClasses as m } from "./dialogStyles.js";
|
|
7
|
+
import { OverlayPanelHeader as h } from "./OverlayPanelHeader.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": c, initialFocusSelector: l, children: u }) {
|
|
15
|
+
let { open: d, onOpenChange: f, dismissOnBackdrop: p, dismissOnEscape: m, triggerRef: h } = _("DialogPortal"), g = x(null), v = x(null), D = y(() => {
|
|
16
|
+
f(!1);
|
|
17
|
+
}, [f]);
|
|
18
18
|
b(() => {
|
|
19
|
-
if (!
|
|
20
|
-
v.current =
|
|
21
|
-
let e =
|
|
22
|
-
return t != null && (n =
|
|
23
|
-
|
|
19
|
+
if (!d) return;
|
|
20
|
+
v.current = h.current ?? document.activeElement;
|
|
21
|
+
let e = i(), t = g.current, n = () => {};
|
|
22
|
+
return t != null && (n = a(t), window.requestAnimationFrame(() => {
|
|
23
|
+
r(t, l);
|
|
24
24
|
})), () => {
|
|
25
25
|
n(), e(), v.current?.focus?.();
|
|
26
26
|
};
|
|
27
27
|
}, [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
l,
|
|
29
|
+
d,
|
|
30
|
+
h
|
|
31
31
|
]), b(() => {
|
|
32
|
-
if (!
|
|
32
|
+
if (!d || !m) 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": a, initialFocusS
|
|
|
38
38
|
};
|
|
39
39
|
}, [
|
|
40
40
|
D,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
m,
|
|
42
|
+
d
|
|
43
43
|
]);
|
|
44
44
|
function O(e) {
|
|
45
|
-
if (!
|
|
45
|
+
if (!p) 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: d ? /* @__PURE__ */ C(T.div, {
|
|
50
|
+
className: s,
|
|
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: o,
|
|
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": a, initialFocusS
|
|
|
62
62
|
role: e,
|
|
63
63
|
"aria-modal": "true",
|
|
64
64
|
"aria-labelledby": n,
|
|
65
|
-
"aria-describedby":
|
|
65
|
+
"aria-describedby": c,
|
|
66
66
|
initial: {
|
|
67
67
|
opacity: 0,
|
|
68
68
|
scale: .96,
|
|
@@ -82,7 +82,7 @@ function D({ role: e, "aria-labelledby": n, "aria-describedby": a, initialFocusS
|
|
|
82
82
|
onMouseDown: (e) => {
|
|
83
83
|
e.stopPropagation();
|
|
84
84
|
},
|
|
85
|
-
children:
|
|
85
|
+
children: u
|
|
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: a = !0, footer: o, size: s = "md", className: u, children: g }) {
|
|
117
|
+
let { titleId: v, descriptionId: y, onOpenChange: b } = _("Dialog.Content"), x = t != null, w = r != null, T = g != null || !x && w, E = o != 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: o == null,
|
|
125
|
+
className: e(l[s], d, m, c, u),
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */ S(
|
|
127
|
+
/* @__PURE__ */ S(h, {
|
|
128
128
|
titleId: v,
|
|
129
129
|
descriptionId: y,
|
|
130
130
|
title: t,
|
|
131
131
|
description: r,
|
|
132
132
|
headerStart: i,
|
|
133
|
-
showClose:
|
|
133
|
+
showClose: a,
|
|
134
134
|
closeLabel: "Close dialog",
|
|
135
135
|
onClose: () => b(!1)
|
|
136
136
|
}),
|
|
137
137
|
O ? /* @__PURE__ */ C("div", {
|
|
138
|
-
className:
|
|
138
|
+
className: f,
|
|
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: s = !0, footer
|
|
|
143
143
|
}) : null, g]
|
|
144
144
|
}) : null,
|
|
145
145
|
E ? /* @__PURE__ */ S("footer", {
|
|
146
|
-
className:
|
|
147
|
-
children:
|
|
146
|
+
className: p,
|
|
147
|
+
children: o
|
|
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, u 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 { focusInitialElement as n, lockBodyScroll as r, trapFocus as i } from "../../../lib/dialogOverlay.js";
|
|
5
|
+
import { dialogBackdropClasses as a, overlayPanelBodyScrollClasses as o, overlayPanelChromeClasses as s, overlayPanelFooterClasses as c, overlayPanelFooterDelineatedInnerClasses as l, overlayPanelFooterDelineatedShellClasses as u, overlayPanelFooterHairlineClasses as d, overlayPanelSectionStackClasses as f } from "../Dialog/dialogStyles.js";
|
|
6
|
+
import { OverlayPanelHeader as p } from "../Dialog/OverlayPanelHeader.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: o, size: c, "aria-labelledby": l, "aria-describedby": u, children: d }) {
|
|
15
|
+
let { open: f, onOpenChange: p, dismissOnBackdrop: b, dismissOnEscape: x, triggerRef: S } = C("SheetPortal"), w = D(null), N = D(null), P = T(() => {
|
|
16
|
+
p(!1);
|
|
17
|
+
}, [p]);
|
|
18
18
|
E(() => {
|
|
19
|
-
if (!
|
|
19
|
+
if (!f) return;
|
|
20
20
|
N.current = S.current ?? document.activeElement;
|
|
21
|
-
let e =
|
|
22
|
-
return t != null && (
|
|
23
|
-
|
|
21
|
+
let e = r(), t = w.current, a = () => {};
|
|
22
|
+
return t != null && (a = i(t), window.requestAnimationFrame(() => {
|
|
23
|
+
n(t);
|
|
24
24
|
})), () => {
|
|
25
|
-
|
|
25
|
+
a(), e(), N.current?.focus?.();
|
|
26
26
|
};
|
|
27
|
-
}, [
|
|
28
|
-
if (!
|
|
27
|
+
}, [f, S]), E(() => {
|
|
28
|
+
if (!f || !x) return;
|
|
29
29
|
function e(e) {
|
|
30
30
|
e.key === "Escape" && (e.preventDefault(), P());
|
|
31
31
|
}
|
|
@@ -35,39 +35,39 @@ function N({ side: r, size: a, "aria-labelledby": o, "aria-describedby": s, chil
|
|
|
35
35
|
}, [
|
|
36
36
|
P,
|
|
37
37
|
x,
|
|
38
|
-
|
|
38
|
+
f
|
|
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: f ? /* @__PURE__ */ k(j.div, {
|
|
46
|
+
className: m[o],
|
|
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: a,
|
|
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[o], y[o][c], s, "relative z-[1]"),
|
|
58
58
|
role: "dialog",
|
|
59
59
|
"aria-modal": "true",
|
|
60
|
-
"aria-labelledby":
|
|
61
|
-
"aria-describedby":
|
|
62
|
-
variants: _(
|
|
60
|
+
"aria-labelledby": l,
|
|
61
|
+
"aria-describedby": u,
|
|
62
|
+
variants: _(o),
|
|
63
63
|
initial: "hidden",
|
|
64
64
|
animate: "visible",
|
|
65
65
|
exit: "exit",
|
|
66
|
-
transition: g(
|
|
66
|
+
transition: g(o),
|
|
67
67
|
onMouseDown: (e) => {
|
|
68
68
|
e.stopPropagation();
|
|
69
69
|
},
|
|
70
|
-
children:
|
|
70
|
+
children: d
|
|
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: r, description: i, headerStart: a, showClose: s = !0, footer: m, className: h, children: g }) {
|
|
102
|
+
let { titleId: _, descriptionId: v, onOpenChange: y } = C("Sheet.Content"), b = r != null, x = i != 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(f, m == null ? "pb-4" : void 0, h),
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */ O(
|
|
111
|
+
/* @__PURE__ */ O(p, {
|
|
112
112
|
titleId: _,
|
|
113
113
|
descriptionId: v,
|
|
114
|
-
title:
|
|
115
|
-
description:
|
|
116
|
-
headerStart:
|
|
117
|
-
showClose:
|
|
114
|
+
title: r,
|
|
115
|
+
description: i,
|
|
116
|
+
headerStart: a,
|
|
117
|
+
showClose: s,
|
|
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: o,
|
|
124
124
|
children: [!b && x ? /* @__PURE__ */ O("p", {
|
|
125
125
|
id: v,
|
|
126
126
|
className: "text-muted",
|
|
127
|
-
children:
|
|
127
|
+
children: i
|
|
128
128
|
}) : null, g]
|
|
129
129
|
}) : null,
|
|
130
130
|
w ? S ? /* @__PURE__ */ k("footer", {
|
|
131
|
-
className:
|
|
131
|
+
className: u,
|
|
132
132
|
children: [/* @__PURE__ */ O("hr", {
|
|
133
|
-
className:
|
|
133
|
+
className: d,
|
|
134
134
|
"aria-hidden": "true"
|
|
135
135
|
}), /* @__PURE__ */ O("div", {
|
|
136
|
-
className:
|
|
136
|
+
className: l,
|
|
137
137
|
children: m
|
|
138
138
|
})]
|
|
139
139
|
}) : /* @__PURE__ */ O("footer", {
|
|
140
|
-
className: e(
|
|
140
|
+
className: e(c, "pb-4"),
|
|
141
141
|
children: m
|
|
142
142
|
}) : null
|
|
143
143
|
]
|