@thewhatmatters/wmds 0.4.6 → 0.4.8
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 +52 -0
- package/CONSUMING.md +4 -0
- package/README.md +2 -2
- package/dist/components/molecules/LinkTile/LinkTile.d.ts +45 -0
- package/dist/components/molecules/LinkTile/LinkTile.d.ts.map +1 -0
- package/dist/components/molecules/LinkTile/LinkTile.js +115 -0
- package/dist/components/molecules/LinkTile/linkTileStyles.d.ts +31 -0
- package/dist/components/molecules/LinkTile/linkTileStyles.d.ts.map +1 -0
- package/dist/components/molecules/LinkTile/linkTileStyles.js +8 -0
- package/dist/components/molecules/TileGrid/TileGrid.d.ts +42 -0
- package/dist/components/molecules/TileGrid/TileGrid.d.ts.map +1 -0
- package/dist/components/molecules/TileGrid/TileGrid.js +94 -0
- package/dist/components/molecules/TileGrid/tileGridMath.d.ts +8 -0
- package/dist/components/molecules/TileGrid/tileGridMath.d.ts.map +1 -0
- package/dist/components/molecules/TileGrid/tileGridMath.js +20 -0
- package/dist/components/molecules/TileGrid/tileGridStyles.d.ts +33 -0
- package/dist/components/molecules/TileGrid/tileGridStyles.d.ts.map +1 -0
- package/dist/components/molecules/TileGrid/tileGridStyles.js +16 -0
- package/dist/components/organisms/Carousel/Carousel.d.ts +58 -0
- package/dist/components/organisms/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/organisms/Carousel/Carousel.js +310 -0
- package/dist/components/organisms/Carousel/carouselMath.d.ts +39 -0
- package/dist/components/organisms/Carousel/carouselMath.d.ts.map +1 -0
- package/dist/components/organisms/Carousel/carouselMath.js +47 -0
- package/dist/components/organisms/Carousel/carouselStyles.d.ts +49 -0
- package/dist/components/organisms/Carousel/carouselStyles.d.ts.map +1 -0
- package/dist/components/organisms/Carousel/carouselStyles.js +25 -0
- package/dist/components/organisms/Dialog/Dialog.d.ts +12 -2
- package/dist/components/organisms/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +46 -44
- package/dist/components/organisms/Dialog/OverlayPanelHeader.d.ts +3 -1
- package/dist/components/organisms/Dialog/OverlayPanelHeader.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/OverlayPanelHeader.js +20 -17
- package/dist/components/organisms/Dialog/dialogStyles.d.ts +5 -1
- package/dist/components/organisms/Dialog/dialogStyles.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/dialogStyles.js +13 -11
- package/dist/components/organisms/FilterPanel/FilterPanel.d.ts +54 -0
- package/dist/components/organisms/FilterPanel/FilterPanel.d.ts.map +1 -0
- package/dist/components/organisms/FilterPanel/FilterPanel.js +137 -0
- package/dist/components/organisms/FilterPanel/filterSelection.d.ts +44 -0
- package/dist/components/organisms/FilterPanel/filterSelection.d.ts.map +1 -0
- package/dist/components/organisms/FilterPanel/filterSelection.js +35 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -65
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/docs/components.md +8 -4
- package/docs/exports.json +56 -3
- 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-carousel--image-carousel.tsx +30 -0
- 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 +1 -1
- 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-filterpanel--panel.tsx +55 -0
- 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-intakeform--short-form-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-linktile--resource-tile.tsx +33 -0
- package/docs/patterns/components-linktile--router-link.tsx +25 -0
- 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-tilegrid--masonry.tsx +44 -0
- 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-grid.tsx +182 -0
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +64 -153
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +98 -54
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/guides-resource-detail--detail.tsx +261 -0
- package/docs/patterns/index.json +57 -1
- package/package.json +1 -1
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../../lib/cn.js";
|
|
3
|
+
import { motionTransitionProp as t } from "../../../lib/motion.js";
|
|
4
|
+
import { carouselClamp as n, carouselMaxScroll as r, carouselNearestSnap as i, carouselOverflows as a, carouselOverscrollOffset as o, carouselProgress as s, carouselProgressAtPointer as c, carouselSnapPoints as l, carouselStep as u, carouselThumbShare as d } from "./carouselMath.js";
|
|
5
|
+
import { carouselBreakpoints as f, carouselDefaultItemWidth as p, carouselExtentClasses as m, carouselFrameClasses as h, carouselItemClasses as g, carouselProgressClasses as ee, carouselProgressPlacementClasses as te, carouselProgressPlacements as _, carouselProgressThumbClasses as ne, carouselProgressTrackClasses as re, carouselRootClasses as ie, carouselTrackClasses as ae, carouselViewportClasses as oe } from "./carouselStyles.js";
|
|
6
|
+
import { Children as se, createContext as v, isValidElement as ce, useCallback as y, useContext as b, useEffect as le, useLayoutEffect as ue, useMemo as x, useRef as S, useState as de } from "react";
|
|
7
|
+
import { jsx as C, jsxs as fe } from "react/jsx-runtime";
|
|
8
|
+
import { animate as pe, motion as me, useMotionValue as he, useMotionValueEvent as ge, useReducedMotion as _e, useTransform as ve } from "motion/react";
|
|
9
|
+
//#region src/components/organisms/Carousel/Carousel.tsx
|
|
10
|
+
var w = v(null), ye = { item: (e, t) => `${e} of ${t}` }, be = 10;
|
|
11
|
+
function T(e, t) {
|
|
12
|
+
try {
|
|
13
|
+
e.setPointerCapture(t);
|
|
14
|
+
} catch {}
|
|
15
|
+
}
|
|
16
|
+
function xe(e) {
|
|
17
|
+
if (typeof e == "number") return {
|
|
18
|
+
base: e,
|
|
19
|
+
sm: e,
|
|
20
|
+
md: e,
|
|
21
|
+
lg: e
|
|
22
|
+
};
|
|
23
|
+
let t = e.base ?? p.base, n = e.sm ?? t, r = e.md ?? n;
|
|
24
|
+
return {
|
|
25
|
+
base: t,
|
|
26
|
+
sm: n,
|
|
27
|
+
md: r,
|
|
28
|
+
lg: e.lg ?? r
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function E(e, t, n) {
|
|
32
|
+
n ? e.style.removeProperty(t) : e.style.setProperty(t, "0px");
|
|
33
|
+
}
|
|
34
|
+
function D({ "aria-label": f, "aria-labelledby": g, itemWidth: _ = p, snap: v = !0, bleed: b = !1, fade: x = !0, progress: w = "center", labels: D, children: O, className: k }) {
|
|
35
|
+
let A = _e() ?? !1, j = S(null), M = S(null), N = S(null), P = S(null), F = S(null), I = S({
|
|
36
|
+
max: 0,
|
|
37
|
+
points: [0],
|
|
38
|
+
direction: 1
|
|
39
|
+
}), L = S(null), R = S(null), z = S(null), B = S(null), V = S(!1), [H, Ce] = de(null), U = he(0), W = he(0), we = ve(W, (e) => -I.current.direction * o(e)), G = y(() => Math.abs(M.current?.scrollLeft ?? 0), []), K = y(() => {
|
|
40
|
+
let e = j.current, t = M.current;
|
|
41
|
+
if (!e || !t) return;
|
|
42
|
+
let { max: n } = I.current, r = Math.abs(t.scrollLeft);
|
|
43
|
+
e.style.setProperty("--carousel-progress", String(s(r, n))), E(t, "--scroll-fade-s", r > 1), E(t, "--scroll-fade-e", r < n - 1);
|
|
44
|
+
}, []), Te = y((e) => {
|
|
45
|
+
let t = M.current;
|
|
46
|
+
t && (t.scrollLeft = I.current.direction * e, K());
|
|
47
|
+
}, [K]);
|
|
48
|
+
ge(U, "change", (e) => {
|
|
49
|
+
let t = n(e, 0, I.current.max);
|
|
50
|
+
Te(t), W.set(A ? 0 : e - t);
|
|
51
|
+
});
|
|
52
|
+
function q(e) {
|
|
53
|
+
let t = M.current;
|
|
54
|
+
t && (e ? t.dataset.moving = "" : delete t.dataset.moving);
|
|
55
|
+
}
|
|
56
|
+
function J() {
|
|
57
|
+
L.current?.stop(), L.current = null, R.current = null;
|
|
58
|
+
}
|
|
59
|
+
function Y() {
|
|
60
|
+
L.current = null, R.current = null, q(!1);
|
|
61
|
+
}
|
|
62
|
+
function Ee() {
|
|
63
|
+
L.current != null && (J(), U.jump(G()), q(!1));
|
|
64
|
+
}
|
|
65
|
+
function X(e, r = !0) {
|
|
66
|
+
let i = n(e, 0, I.current.max);
|
|
67
|
+
if (J(), U.jump(G()), A || !r) {
|
|
68
|
+
q(!1), U.jump(i);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
R.current = i, q(!0), L.current = pe(U, i, {
|
|
72
|
+
...t("medium"),
|
|
73
|
+
onComplete: Y
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function De(e) {
|
|
77
|
+
let { max: t, points: r } = I.current, a = (e) => i(r, n(e, 0, t));
|
|
78
|
+
if (J(), A) {
|
|
79
|
+
X(v ? a(U.get()) : U.get(), !1);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let o = U.get(), s = v ? a(o) : n(o, 0, t);
|
|
83
|
+
if (e === 0 && s === o) {
|
|
84
|
+
Y();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
q(!0), L.current = pe(U, s === o ? o + Math.sign(e) : s, {
|
|
88
|
+
type: "inertia",
|
|
89
|
+
velocity: e,
|
|
90
|
+
min: 0,
|
|
91
|
+
max: t,
|
|
92
|
+
modifyTarget: v ? a : void 0,
|
|
93
|
+
onComplete: Y
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
let Z = y(() => {
|
|
97
|
+
let e = j.current, t = M.current, n = N.current;
|
|
98
|
+
if (!e || !t || !n || W.get() !== 0) return;
|
|
99
|
+
if (b) {
|
|
100
|
+
let t = e.getBoundingClientRect(), n = Math.max(0, Math.floor(t.left)), r = Math.max(0, Math.floor(document.documentElement.clientWidth - t.right));
|
|
101
|
+
e.style.setProperty("--carousel-bleed-left", `${n}px`), e.style.setProperty("--carousel-bleed-right", `${r}px`);
|
|
102
|
+
} else e.style.removeProperty("--carousel-bleed-left"), e.style.removeProperty("--carousel-bleed-right");
|
|
103
|
+
let i = getComputedStyle(t).direction === "rtl" ? -1 : 1, o = t.clientWidth, s = t.scrollWidth, c = r(o, s), u = Array.from(n.querySelectorAll(":scope > [data-carousel-item]")), f = u[0]?.getBoundingClientRect(), p = f == null ? [] : u.map((e) => {
|
|
104
|
+
let t = e.getBoundingClientRect();
|
|
105
|
+
return i === 1 ? t.left - f.left : f.right - t.right;
|
|
106
|
+
});
|
|
107
|
+
I.current = {
|
|
108
|
+
max: c,
|
|
109
|
+
direction: i,
|
|
110
|
+
points: l(p, c)
|
|
111
|
+
};
|
|
112
|
+
let m = P.current;
|
|
113
|
+
m && e.style.setProperty("--carousel-thumb", String(d(o, s, m.clientWidth))), K();
|
|
114
|
+
let h = a(o, s);
|
|
115
|
+
Ce((e) => e === h ? e : h);
|
|
116
|
+
}, [
|
|
117
|
+
b,
|
|
118
|
+
W,
|
|
119
|
+
K
|
|
120
|
+
]);
|
|
121
|
+
ue(() => {
|
|
122
|
+
if (Z(), window.addEventListener("resize", Z), typeof ResizeObserver > "u") return () => window.removeEventListener("resize", Z);
|
|
123
|
+
let e = new ResizeObserver(Z);
|
|
124
|
+
for (let t of [
|
|
125
|
+
j.current,
|
|
126
|
+
M.current,
|
|
127
|
+
N.current,
|
|
128
|
+
P.current
|
|
129
|
+
]) t && e.observe(t);
|
|
130
|
+
return () => {
|
|
131
|
+
e.disconnect(), window.removeEventListener("resize", Z);
|
|
132
|
+
};
|
|
133
|
+
}, [Z, w]), le(() => () => L.current?.stop(), []);
|
|
134
|
+
function Oe(e) {
|
|
135
|
+
if (e.pointerType !== "mouse" || e.button !== 0 || I.current.max <= 0) return;
|
|
136
|
+
let t = L.current != null;
|
|
137
|
+
J(), U.jump(G()), z.current = {
|
|
138
|
+
pointerId: e.pointerId,
|
|
139
|
+
startX: e.clientX,
|
|
140
|
+
startPosition: G(),
|
|
141
|
+
active: !1,
|
|
142
|
+
interrupted: t
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function ke(e) {
|
|
146
|
+
let t = z.current;
|
|
147
|
+
if (!(!t || t.pointerId !== e.pointerId)) {
|
|
148
|
+
if (e.buttons === 0) {
|
|
149
|
+
Q(e);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (!t.active) {
|
|
153
|
+
if (Math.abs(e.clientX - t.startX) < 4) return;
|
|
154
|
+
t.active = !0, t.startX = e.clientX, T(e.currentTarget, e.pointerId), e.currentTarget.dataset.dragging = "", q(!0);
|
|
155
|
+
}
|
|
156
|
+
U.set(t.startPosition - I.current.direction * (e.clientX - t.startX));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function Q(e) {
|
|
160
|
+
let t = z.current;
|
|
161
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
162
|
+
if (z.current = null, !t.active) {
|
|
163
|
+
t.interrupted && De(0);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
let n = e.currentTarget;
|
|
167
|
+
n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), delete n.dataset.dragging, V.current = !0, window.setTimeout(() => {
|
|
168
|
+
V.current = !1;
|
|
169
|
+
}, 0), De(e.type === "pointercancel" ? 0 : U.getVelocity());
|
|
170
|
+
}
|
|
171
|
+
function Ae(e) {
|
|
172
|
+
V.current && (V.current = !1, e.preventDefault(), e.stopPropagation());
|
|
173
|
+
}
|
|
174
|
+
function je(e) {
|
|
175
|
+
if (e.target !== e.currentTarget || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
176
|
+
let { max: t, points: n, direction: r } = I.current, i = R.current ?? G(), a;
|
|
177
|
+
switch (e.key) {
|
|
178
|
+
case "ArrowRight":
|
|
179
|
+
a = u(n, i, r);
|
|
180
|
+
break;
|
|
181
|
+
case "ArrowLeft":
|
|
182
|
+
a = u(n, i, r === 1 ? -1 : 1);
|
|
183
|
+
break;
|
|
184
|
+
case "Home":
|
|
185
|
+
a = 0;
|
|
186
|
+
break;
|
|
187
|
+
case "End":
|
|
188
|
+
a = t;
|
|
189
|
+
break;
|
|
190
|
+
default: return;
|
|
191
|
+
}
|
|
192
|
+
e.preventDefault(), X(a);
|
|
193
|
+
}
|
|
194
|
+
function Me(e) {
|
|
195
|
+
let t = P.current, n = F.current, { max: r, points: a, direction: o } = I.current;
|
|
196
|
+
if (!t || !n || r <= 0 || e.button !== 0) return;
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
let l = t.getBoundingClientRect(), u = n.getBoundingClientRect();
|
|
199
|
+
if (e.clientX >= u.left - be && e.clientX <= u.right + be) {
|
|
200
|
+
J(), U.jump(G()), q(!0), T(e.currentTarget, e.pointerId), e.currentTarget.dataset.scrubbing = "", B.current = {
|
|
201
|
+
pointerId: e.pointerId,
|
|
202
|
+
startX: e.clientX,
|
|
203
|
+
startProgress: s(G(), r),
|
|
204
|
+
travel: l.width - u.width
|
|
205
|
+
};
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
let d = o === 1 ? e.clientX - l.left : l.right - e.clientX, f = c(d, l.width, u.width) * r;
|
|
209
|
+
X(v ? i(a, f) : f);
|
|
210
|
+
}
|
|
211
|
+
function Ne(e) {
|
|
212
|
+
let t = B.current;
|
|
213
|
+
if (!t || t.pointerId !== e.pointerId || t.travel <= 0) return;
|
|
214
|
+
let { max: r, direction: i } = I.current, a = i * (e.clientX - t.startX) / t.travel;
|
|
215
|
+
U.set(n(t.startProgress + a, 0, 1) * r);
|
|
216
|
+
}
|
|
217
|
+
function Pe(e) {
|
|
218
|
+
let t = B.current;
|
|
219
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
220
|
+
B.current = null;
|
|
221
|
+
let n = e.currentTarget;
|
|
222
|
+
n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), delete n.dataset.scrubbing, v ? X(i(I.current.points, G())) : q(!1);
|
|
223
|
+
}
|
|
224
|
+
let $ = xe(_), Fe = {
|
|
225
|
+
"--carousel-item": String($.base),
|
|
226
|
+
"--carousel-item-sm": String($.sm),
|
|
227
|
+
"--carousel-item-md": String($.md),
|
|
228
|
+
"--carousel-item-lg": String($.lg)
|
|
229
|
+
}, Ie = D?.item ?? ye.item, Le = se.toArray(O), Re = H == null ? void 0 : String(H);
|
|
230
|
+
return /* @__PURE__ */ fe("div", {
|
|
231
|
+
ref: j,
|
|
232
|
+
className: e(ie, k),
|
|
233
|
+
style: Fe,
|
|
234
|
+
"data-carousel": "",
|
|
235
|
+
children: [/* @__PURE__ */ C("div", {
|
|
236
|
+
className: h,
|
|
237
|
+
children: /* @__PURE__ */ C("div", {
|
|
238
|
+
ref: M,
|
|
239
|
+
role: "region",
|
|
240
|
+
"aria-label": f,
|
|
241
|
+
"aria-labelledby": g,
|
|
242
|
+
tabIndex: H === !1 ? void 0 : 0,
|
|
243
|
+
"data-carousel-viewport": "",
|
|
244
|
+
"data-overflowing": Re,
|
|
245
|
+
className: e(oe, v && "snap-x snap-mandatory data-[moving]:snap-none", x && "scroll-fade-x"),
|
|
246
|
+
style: { "--scroll-fade-s": "0px" },
|
|
247
|
+
onScroll: K,
|
|
248
|
+
onKeyDown: je,
|
|
249
|
+
onPointerDown: Oe,
|
|
250
|
+
onPointerMove: ke,
|
|
251
|
+
onPointerUp: Q,
|
|
252
|
+
onPointerCancel: Q,
|
|
253
|
+
onClickCapture: Ae,
|
|
254
|
+
onDragStart: (e) => e.preventDefault(),
|
|
255
|
+
onWheel: Ee,
|
|
256
|
+
onTouchStart: Ee,
|
|
257
|
+
children: /* @__PURE__ */ C("div", {
|
|
258
|
+
className: m,
|
|
259
|
+
children: /* @__PURE__ */ C(me.div, {
|
|
260
|
+
ref: N,
|
|
261
|
+
className: ae,
|
|
262
|
+
style: { x: we },
|
|
263
|
+
children: Le.map((e, t) => /* @__PURE__ */ C(Se, {
|
|
264
|
+
label: Ie(t + 1, Le.length),
|
|
265
|
+
children: e
|
|
266
|
+
}, ce(e) && e.key != null ? e.key : t))
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
})
|
|
270
|
+
}), w === "none" ? null : /* @__PURE__ */ C("div", {
|
|
271
|
+
"aria-hidden": "true",
|
|
272
|
+
"data-carousel-progress": "",
|
|
273
|
+
"data-overflowing": Re,
|
|
274
|
+
className: e(ee, te[w]),
|
|
275
|
+
onPointerDown: Me,
|
|
276
|
+
onPointerMove: Ne,
|
|
277
|
+
onPointerUp: Pe,
|
|
278
|
+
onPointerCancel: Pe,
|
|
279
|
+
children: /* @__PURE__ */ C("div", {
|
|
280
|
+
ref: P,
|
|
281
|
+
className: re,
|
|
282
|
+
children: /* @__PURE__ */ C("div", {
|
|
283
|
+
ref: F,
|
|
284
|
+
className: ne,
|
|
285
|
+
"data-carousel-progress-thumb": ""
|
|
286
|
+
})
|
|
287
|
+
})
|
|
288
|
+
})]
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function Se({ label: e, children: t }) {
|
|
292
|
+
let n = x(() => ({ label: e }), [e]);
|
|
293
|
+
return /* @__PURE__ */ C(w.Provider, {
|
|
294
|
+
value: n,
|
|
295
|
+
children: t
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function O({ children: t, className: n }) {
|
|
299
|
+
let r = b(w);
|
|
300
|
+
return /* @__PURE__ */ C("div", {
|
|
301
|
+
role: "group",
|
|
302
|
+
"aria-label": r?.label,
|
|
303
|
+
"data-carousel-item": "",
|
|
304
|
+
className: e(g, n),
|
|
305
|
+
children: t
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
var k = Object.assign(D, { Item: O });
|
|
309
|
+
//#endregion
|
|
310
|
+
export { k as Carousel, f as carouselBreakpoints, p as carouselDefaultItemWidth, _ as carouselProgressPlacements };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carousel geometry — positions are logical: `0` is the row's start and the value grows toward
|
|
3
|
+
* its end, in px, in both writing directions. The component maps them to `scrollLeft`.
|
|
4
|
+
*/
|
|
5
|
+
/** Share of an overscroll the row follows before it springs back. */
|
|
6
|
+
export declare const carouselOverscrollElasticity = 0.5;
|
|
7
|
+
/** Pointer travel, in px, before a press on the row becomes a drag. */
|
|
8
|
+
export declare const carouselDragThreshold = 4;
|
|
9
|
+
/** The filled part of the scrubber never gets narrower than this, in px. */
|
|
10
|
+
export declare const carouselThumbMinWidth = 24;
|
|
11
|
+
export declare function carouselClamp(value: number, min: number, max: number): number;
|
|
12
|
+
/** How far the row can scroll. `0` when every item fits. */
|
|
13
|
+
export declare function carouselMaxScroll(viewWidth: number, contentWidth: number): number;
|
|
14
|
+
/** True when the row has more than it can show. */
|
|
15
|
+
export declare function carouselOverflows(viewWidth: number, contentWidth: number): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Where the row rests: each item's leading edge, capped at the end of the row. Items that
|
|
18
|
+
* share a resting place (those past the last full view) collapse into one point.
|
|
19
|
+
*/
|
|
20
|
+
export declare function carouselSnapPoints(itemOffsets: readonly number[], maxScroll: number): number[];
|
|
21
|
+
/** The resting place closest to `position`. */
|
|
22
|
+
export declare function carouselNearestSnap(points: readonly number[], position: number): number;
|
|
23
|
+
/** One item toward the end (`1`) or the start (`-1`) from `position`; stays put at either end. */
|
|
24
|
+
export declare function carouselStep(points: readonly number[], position: number, direction: 1 | -1): number;
|
|
25
|
+
/** Row progress, 0–1. */
|
|
26
|
+
export declare function carouselProgress(position: number, maxScroll: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* Width of the scrubber's filled part as a share of its track (0–1): the share of the row in
|
|
29
|
+
* view, held to `carouselThumbMinWidth` so it stays easy to grab.
|
|
30
|
+
*/
|
|
31
|
+
export declare function carouselThumbShare(viewWidth: number, contentWidth: number, trackWidth: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* Row progress for a press on the scrubber's track at `pointer` px from the track's start: the
|
|
34
|
+
* filled part centers on the pointer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function carouselProgressAtPointer(pointer: number, trackWidth: number, thumbWidth: number): number;
|
|
37
|
+
/** How far the row shifts for an overscroll of `overshoot` px. */
|
|
38
|
+
export declare function carouselOverscrollOffset(overshoot: number): number;
|
|
39
|
+
//# sourceMappingURL=carouselMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carouselMath.d.ts","sourceRoot":"","sources":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,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIzG;AAED,kEAAkE;AAClE,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/organisms/Carousel/carouselMath.ts
|
|
3
|
+
var e = .5;
|
|
4
|
+
function t(e, t, n) {
|
|
5
|
+
return Math.min(Math.max(e, t), n);
|
|
6
|
+
}
|
|
7
|
+
function n(e, t) {
|
|
8
|
+
return Math.max(0, t - e);
|
|
9
|
+
}
|
|
10
|
+
function r(e, t) {
|
|
11
|
+
return n(e, t) > 1;
|
|
12
|
+
}
|
|
13
|
+
function i(e, n) {
|
|
14
|
+
let r = [];
|
|
15
|
+
for (let i of [...e].sort((e, t) => e - t)) {
|
|
16
|
+
let e = t(i, 0, n), a = r[r.length - 1];
|
|
17
|
+
(a === void 0 || e - a > 1) && r.push(e);
|
|
18
|
+
}
|
|
19
|
+
return r.length === 0 ? [0] : r;
|
|
20
|
+
}
|
|
21
|
+
function a(e, t) {
|
|
22
|
+
let n = e[0] ?? 0;
|
|
23
|
+
for (let r of e) Math.abs(r - t) < Math.abs(n - t) && (n = r);
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
function o(e, t, n) {
|
|
27
|
+
if (n === 1) return e.find((e) => e > t + 1) ?? e[e.length - 1] ?? 0;
|
|
28
|
+
for (let n = e.length - 1; n >= 0; --n) if (e[n] < t - 1) return e[n];
|
|
29
|
+
return e[0] ?? 0;
|
|
30
|
+
}
|
|
31
|
+
function s(e, n) {
|
|
32
|
+
return n <= 0 ? 0 : t(e / n, 0, 1);
|
|
33
|
+
}
|
|
34
|
+
function c(e, n, r) {
|
|
35
|
+
if (n <= 0 || r <= 0) return 1;
|
|
36
|
+
let i = t(e / n, 0, 1);
|
|
37
|
+
return t(Math.max(i, 24 / r), 0, 1);
|
|
38
|
+
}
|
|
39
|
+
function l(e, n, r) {
|
|
40
|
+
let i = n - r;
|
|
41
|
+
return i <= 0 ? 0 : t((e - r / 2) / i, 0, 1);
|
|
42
|
+
}
|
|
43
|
+
function u(t) {
|
|
44
|
+
return t * e;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { t as carouselClamp, n as carouselMaxScroll, a as carouselNearestSnap, r as carouselOverflows, e as carouselOverscrollElasticity, u as carouselOverscrollOffset, s as carouselProgress, l as carouselProgressAtPointer, i as carouselSnapPoints, o as carouselStep, c as carouselThumbShare };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const carouselProgressPlacements: readonly ["center", "start", "full", "none"];
|
|
2
|
+
/**
|
|
3
|
+
* Where the scrubber sits under the row: a shorter track at the `center` (default) or the
|
|
4
|
+
* `start`, the `full` row width, or `none`. The shorter tracks are full width on phones.
|
|
5
|
+
*/
|
|
6
|
+
export type CarouselProgressPlacement = (typeof carouselProgressPlacements)[number];
|
|
7
|
+
export declare const carouselBreakpoints: readonly ["base", "sm", "md", "lg"];
|
|
8
|
+
export type CarouselBreakpoint = (typeof carouselBreakpoints)[number];
|
|
9
|
+
/** Item width as a percentage of the row, per breakpoint. A breakpoint left out keeps the one below it. */
|
|
10
|
+
export type CarouselItemWidth = number | Partial<Record<CarouselBreakpoint, number>>;
|
|
11
|
+
/** About one item on phones, two from `sm`, two and a half from `lg` — the next one always shows. */
|
|
12
|
+
export declare const carouselDefaultItemWidth: {
|
|
13
|
+
readonly base: 80;
|
|
14
|
+
readonly sm: 55;
|
|
15
|
+
readonly lg: 40;
|
|
16
|
+
};
|
|
17
|
+
/** The root is the size container the item widths are a share of. */
|
|
18
|
+
export declare const carouselRootClasses = "@container/carousel flex w-full min-w-0 flex-col";
|
|
19
|
+
/**
|
|
20
|
+
* Holds the row and draws its focus ring — the row itself is masked by the edge fade, which would
|
|
21
|
+
* cut a ring off. With `bleed` it reaches past the root to the page edges.
|
|
22
|
+
*/
|
|
23
|
+
export declare const carouselFrameClasses: string;
|
|
24
|
+
/**
|
|
25
|
+
* The scroller. Its own scrollbar is hidden — the scrubber stands in for it. The block padding
|
|
26
|
+
* (taken back by the margins) leaves room for an item's shadow, which the scroller would clip.
|
|
27
|
+
*/
|
|
28
|
+
export declare const carouselViewportClasses: string;
|
|
29
|
+
/** Rest on item edges — off while the pointer or an animation is moving the row. */
|
|
30
|
+
export declare const carouselViewportSnapClasses = "snap-x snap-mandatory data-[moving]:snap-none";
|
|
31
|
+
export declare const carouselViewportFadeClasses = "scroll-fade-x";
|
|
32
|
+
/**
|
|
33
|
+
* As wide as the items, plus the bleed on either side. It stays put while the track inside it
|
|
34
|
+
* shifts on an overscroll, so the scroll width does not change under the pointer.
|
|
35
|
+
*/
|
|
36
|
+
export declare const carouselExtentClasses = "w-max min-w-full pl-[var(--carousel-bleed-left,0px)] pr-[var(--carousel-bleed-right,0px)]";
|
|
37
|
+
/** Items in a row on the page grid's gutter. Images and links inside are not picked up by a drag. */
|
|
38
|
+
export declare const carouselTrackClasses: string;
|
|
39
|
+
export declare const carouselItemClasses: string;
|
|
40
|
+
/**
|
|
41
|
+
* The scrubber's hit area: 44px tall around a slim track. It keeps its place when every item
|
|
42
|
+
* fits, so the page under it does not move when the row starts to overflow.
|
|
43
|
+
*/
|
|
44
|
+
export declare const carouselProgressClasses = "group/carousel-progress relative flex h-11 w-full cursor-pointer touch-none select-none items-center data-[overflowing=false]:invisible";
|
|
45
|
+
export declare const carouselProgressPlacementClasses: Record<Exclude<CarouselProgressPlacement, "none">, string>;
|
|
46
|
+
export declare const carouselProgressTrackClasses: string;
|
|
47
|
+
/** The filled part: its width is the share of the row in view, its place the row's progress. */
|
|
48
|
+
export declare const carouselProgressThumbClasses: string;
|
|
49
|
+
//# sourceMappingURL=carouselStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carouselStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Carousel/carouselStyles.ts"],"names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ionClasses as t, motionTransition as n } from "../../../lib/motion.js";
|
|
4
|
+
//#region src/components/organisms/Carousel/carouselStyles.ts
|
|
5
|
+
var r = [
|
|
6
|
+
"center",
|
|
7
|
+
"start",
|
|
8
|
+
"full",
|
|
9
|
+
"none"
|
|
10
|
+
], i = [
|
|
11
|
+
"base",
|
|
12
|
+
"sm",
|
|
13
|
+
"md",
|
|
14
|
+
"lg"
|
|
15
|
+
], a = {
|
|
16
|
+
base: 80,
|
|
17
|
+
sm: 55,
|
|
18
|
+
lg: 40
|
|
19
|
+
}, o = "@container/carousel flex w-full min-w-0 flex-col", s = e("relative rounded-[var(--radius-card-shell)]", "ml-[calc(var(--carousel-bleed-left,0px)*-1)] mr-[calc(var(--carousel-bleed-right,0px)*-1)]", "has-[>[data-carousel-viewport]:focus-visible]:ring-2 has-[>[data-carousel-viewport]:focus-visible]:ring-focus-ring", "has-[>[data-carousel-viewport]:focus-visible]:ring-offset-2 has-[>[data-carousel-viewport]:focus-visible]:ring-offset-body", t), c = e("-mt-2 -mb-6 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-2 pb-6 outline-none", "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden", "scroll-pl-[var(--carousel-bleed-left,0px)] scroll-pr-[var(--carousel-bleed-right,0px)]", "data-[overflowing=true]:cursor-grab data-[dragging]:cursor-grabbing data-[dragging]:select-none"), l = "snap-x snap-mandatory data-[moving]:snap-none", u = "scroll-fade-x", d = "w-max min-w-full pl-[var(--carousel-bleed-left,0px)] pr-[var(--carousel-bleed-right,0px)]", f = e("flex w-max min-w-full gap-[var(--grid-column-gap,1.5rem)]", "[&_a]:[-webkit-user-drag:none] [&_img]:[-webkit-user-drag:none]"), p = e("min-w-0 shrink-0 grow-0 snap-start", "basis-[calc(var(--carousel-item)*1cqw)] sm:basis-[calc(var(--carousel-item-sm)*1cqw)]", "md:basis-[calc(var(--carousel-item-md)*1cqw)] lg:basis-[calc(var(--carousel-item-lg)*1cqw)]"), m = "group/carousel-progress relative flex h-11 w-full cursor-pointer touch-none select-none items-center data-[overflowing=false]:invisible", h = {
|
|
20
|
+
center: "self-center sm:w-60",
|
|
21
|
+
start: "self-start sm:w-60",
|
|
22
|
+
full: ""
|
|
23
|
+
}, g = e("relative h-1 w-full rounded-full bg-neutral transition-[height]", "group-data-[scrubbing]/carousel-progress:h-1.5", n("fast")), _ = e("absolute inset-y-0 w-[calc(var(--carousel-thumb,0)*100%)] cursor-grab rounded-full bg-muted", "start-[calc(var(--carousel-progress,0)*(1_-_var(--carousel-thumb,0))*100%)]", "transition-colors group-hover/carousel-progress:bg-fg", "group-data-[scrubbing]/carousel-progress:cursor-grabbing group-data-[scrubbing]/carousel-progress:bg-fg", n("fast"));
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as carouselBreakpoints, a as carouselDefaultItemWidth, d as carouselExtentClasses, s as carouselFrameClasses, p as carouselItemClasses, m as carouselProgressClasses, h as carouselProgressPlacementClasses, r as carouselProgressPlacements, _ as carouselProgressThumbClasses, g as carouselProgressTrackClasses, o as carouselRootClasses, f as carouselTrackClasses, c as carouselViewportClasses, u as carouselViewportFadeClasses, l as carouselViewportSnapClasses };
|
|
@@ -20,11 +20,19 @@ export interface DialogContentProps {
|
|
|
20
20
|
description?: ReactNode;
|
|
21
21
|
/** Leading header slot — icon, **Badge**, **Status** (**Card.Header** `start`). */
|
|
22
22
|
headerStart?: ReactNode;
|
|
23
|
+
/** Actions before the close — **IconButton** `size="sm"`, for example previous and next. */
|
|
24
|
+
headerEnd?: ReactNode;
|
|
23
25
|
/** Header dismiss — default `true` for generic dialogs. */
|
|
24
26
|
showClose?: boolean;
|
|
25
27
|
/** Footer action cluster — compose **Button** roles. */
|
|
26
28
|
footer?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* `sm` / `md` (default) / `lg` — a centered panel of that width. `full` — the window less a
|
|
31
|
+
* margin (up to 90rem × 60rem), and the whole screen on phones: media viewers and detail views.
|
|
32
|
+
*/
|
|
27
33
|
size?: DialogSize;
|
|
34
|
+
/** Names the dialog when there is no `title` — the id of a heading inside the body. */
|
|
35
|
+
"aria-labelledby"?: string;
|
|
28
36
|
className?: DialogLayoutClassName;
|
|
29
37
|
children?: ReactNode;
|
|
30
38
|
}
|
|
@@ -33,16 +41,18 @@ export interface DialogPortalProps {
|
|
|
33
41
|
"aria-labelledby"?: string;
|
|
34
42
|
"aria-describedby"?: string;
|
|
35
43
|
initialFocusSelector?: string;
|
|
44
|
+
/** Fill the window (the whole screen on phones) — **Dialog.Content** `size="full"`. */
|
|
45
|
+
fill?: boolean;
|
|
36
46
|
children: ReactNode;
|
|
37
47
|
}
|
|
38
48
|
/** Portal + scrim + focus trap — shared by **Dialog.Content** and **AlertDialog**. */
|
|
39
|
-
export declare function DialogPortal({ role, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, initialFocusSelector, children, }: DialogPortalProps): import("react").ReactPortal | null;
|
|
49
|
+
export declare function DialogPortal({ role, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, initialFocusSelector, fill, children, }: DialogPortalProps): import("react").ReactPortal | null;
|
|
40
50
|
declare function DialogRoot({ open, onOpenChange, dismissOnBackdrop, dismissOnEscape, children, }: DialogProps): import("react").JSX.Element;
|
|
41
51
|
declare function DialogTrigger({ children, className, }: {
|
|
42
52
|
children: ReactNode;
|
|
43
53
|
className?: DialogLayoutClassName;
|
|
44
54
|
}): import("react").JSX.Element;
|
|
45
|
-
declare function DialogContent({ title, description, headerStart, showClose, footer, size, className, children, }: DialogContentProps): import("react").JSX.Element;
|
|
55
|
+
declare function DialogContent({ title, description, headerStart, showClose, headerEnd, footer, size, "aria-labelledby": ariaLabelledBy, className, children, }: DialogContentProps): import("react").JSX.Element;
|
|
46
56
|
/**
|
|
47
57
|
* Modal overlay — portal scrim, focus trap, scroll lock; composes **Card** shell.
|
|
48
58
|
* Composes **Card** shell + portal scrim; use **AlertDialog** for blocking confirms.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAef,OAAO,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAef,OAAO,EAML,WAAW,EAMX,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,0EAA0E;AAC1E,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wCAAwC;IACxC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,mFAAmF;IACnF,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wDAAwD;IACxD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,uFAAuF;IACvF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,E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