@thewhatmatters/wmds 0.4.30 → 0.4.31
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 +23 -0
- package/dist/components/molecules/Breadcrumb/breadcrumbStyles.d.ts +1 -1
- package/dist/components/molecules/Breadcrumb/breadcrumbStyles.js +2 -2
- package/dist/components/molecules/Field/fieldStyles.d.ts +1 -1
- package/dist/components/molecules/Field/fieldStyles.js +1 -1
- package/dist/components/molecules/HeroIntro/HeroIntro.d.ts +8 -2
- package/dist/components/molecules/HeroIntro/HeroIntro.d.ts.map +1 -1
- package/dist/components/molecules/HeroIntro/HeroIntro.js +30 -22
- package/dist/components/molecules/HeroIntro/heroIntroStyles.d.ts +9 -2
- package/dist/components/molecules/HeroIntro/heroIntroStyles.d.ts.map +1 -1
- package/dist/components/molecules/HeroIntro/heroIntroStyles.js +2 -2
- package/dist/components/molecules/TileGrid/tileGridStyles.js +1 -1
- package/dist/components/organisms/Carousel/carouselStyles.js +3 -3
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +4 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -1
- package/dist/components/organisms/FooterReveal/footerRevealStyles.js +1 -1
- package/dist/components/organisms/SiteNav/SiteNav.d.ts +13 -6
- package/dist/components/organisms/SiteNav/SiteNav.d.ts.map +1 -1
- package/dist/components/organisms/SiteNav/SiteNav.js +305 -252
- package/dist/components/organisms/SiteNav/siteNavStyles.d.ts +33 -5
- package/dist/components/organisms/SiteNav/siteNavStyles.d.ts.map +1 -1
- package/dist/components/organisms/SiteNav/siteNavStyles.js +3 -3
- package/dist/components/organisms/SiteNav/useSiteNavMobileMenu.d.ts +17 -0
- package/dist/components/organisms/SiteNav/useSiteNavMobileMenu.d.ts.map +1 -0
- package/dist/components/organisms/SiteNav/useSiteNavMobileMenu.js +47 -0
- package/dist/lib/dialogOverlay.d.ts +8 -0
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +45 -26
- package/dist/styles.css +1 -1
- package/docs/components.md +2 -2
- package/docs/exports.json +3 -2
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-appshell--portal-dashboard-pattern.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--status-pill.tsx +1 -1
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-band--page-in-bands.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-card--terminal-frame.tsx +1 -1
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-carousel--image-carousel.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--revenue-by-line.tsx +1 -1
- package/docs/patterns/components-chart--segmented-ring-pattern.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-copyfield--clipboard-blocked.tsx +1 -1
- package/docs/patterns/components-copyfield--copied.tsx +1 -1
- package/docs/patterns/components-copyfield--copy-key.tsx +1 -1
- package/docs/patterns/components-copyfield--on-navy.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--alert-dialog-typed-confirmation.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-displaycontrols--theme-switch.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 +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +2 -2
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +2 -2
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +2 -2
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +2 -2
- package/docs/patterns/components-herointro--with-actions.tsx +22 -0
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +2 -2
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +2 -2
- 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 +1 -1
- package/docs/patterns/components-linktile--router-link.tsx +1 -1
- package/docs/patterns/components-logview--detail-pane.tsx +1 -1
- package/docs/patterns/components-logview--log-viewer.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--app-sidebar.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-sheet--side-sheet-header-actions.tsx +1 -1
- package/docs/patterns/components-sheet--side-sheet-url-deep-link.tsx +1 -1
- package/docs/patterns/components-sheet--side-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 +2 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--hero-stat.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-table--approvals-with-sheet.tsx +1 -1
- package/docs/patterns/components-table--approvals.tsx +3 -3
- package/docs/patterns/components-table--basic.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--needs-you-table.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-textarea--save-status.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 +2 -2
- package/docs/patterns/components-tilegrid--masonry.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-grid.tsx +3 -3
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +3 -3
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +3 -3
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +6 -6
- package/docs/patterns/guides-resource-detail--detail.tsx +2 -2
- package/docs/patterns/index.json +9 -1
- package/package.json +1 -1
|
@@ -64,7 +64,8 @@ export declare const siteNavStartClasses = "flex shrink-0 items-center gap-2 max
|
|
|
64
64
|
export declare const siteNavMiddleClasses = "flex min-w-0 flex-1 items-center justify-center";
|
|
65
65
|
/** Compact hug middle — content-sized; can shrink only when the pill hits `max-w-full`. */
|
|
66
66
|
export declare const siteNavMiddleHugClasses = "flex min-w-0 max-w-full items-center justify-center";
|
|
67
|
-
|
|
67
|
+
/** `max-md:ml-auto`: with the links hidden on phones, the actions and Menu still sit at the trailing edge. */
|
|
68
|
+
export declare const siteNavEndClasses = "flex shrink-0 flex-nowrap items-center gap-2 max-md:ml-auto max-md:[&_a]:min-h-11 max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11";
|
|
68
69
|
/**
|
|
69
70
|
* Middle slot when a `mobile` menu is supplied. Shown from `md`.
|
|
70
71
|
* No unprefixed `hidden` or `flex`: a later stylesheet's `.hidden` beats `md:flex`,
|
|
@@ -77,11 +78,21 @@ export declare const siteNavMiddleHugResponsiveClasses = "max-md:hidden md:flex
|
|
|
77
78
|
* IconButton paints `inline-flex`. `md:!hidden` beats a later non-important
|
|
78
79
|
* `.inline-flex`. The class is not `hidden`, so an app's `.hidden` does not match.
|
|
79
80
|
*/
|
|
80
|
-
|
|
81
|
+
/**
|
|
82
|
+
* The "☰ Menu" / "✕ Close" button: phones only, at least 44px tall (N7). Quiet in both states: no fill at
|
|
83
|
+
* rest or open, the ghost hover/press fill only. In the full bar its 16px padding is pulled past the
|
|
84
|
+
* trailing edge, so the word lines up with the content edge; the compact pill keeps its padding.
|
|
85
|
+
*/
|
|
86
|
+
export declare const siteNavMobileTriggerClasses = "min-h-11 !px-4 md:!hidden in-data-[state=expanded]:-mr-4";
|
|
81
87
|
/**
|
|
82
88
|
* Brand — layout only when wordmark **Button**; icon brands use **IconButton** (circular).
|
|
83
89
|
*/
|
|
84
90
|
export declare const siteNavBrandClasses = "text-fg!";
|
|
91
|
+
/**
|
|
92
|
+
* A wordmark brand in the full bar: its 16px pill padding is pulled past the leading edge, so the wordmark
|
|
93
|
+
* starts on the content edge like the page below it (the hit area stays). The compact pill keeps its padding.
|
|
94
|
+
*/
|
|
95
|
+
export declare const siteNavWordmarkBrandClasses = "text-fg! in-data-[state=expanded]:-ml-4";
|
|
85
96
|
/** Links cluster — full middle track width for overflow measure; cluster centered inside. */
|
|
86
97
|
export declare const siteNavLinksRootClasses = "relative flex min-w-0 w-full max-w-full items-center justify-center gap-1";
|
|
87
98
|
/** NavigationMenu root — hug the list so justify-center on the parent can center it. */
|
|
@@ -121,8 +132,25 @@ export declare const siteNavMenuLinkGridClasses = "grid grid-cols-1 gap-y-1 md:g
|
|
|
121
132
|
export declare const siteNavMenuReadRowClasses = "flex flex-col gap-3 md:flex-row md:gap-4";
|
|
122
133
|
/** Read thumb media — full-bleed band below `md`; 64px square from `md` up. */
|
|
123
134
|
export declare const siteNavMenuReadThumbClasses = "aspect-[16/10] w-full shrink-0 md:aspect-auto md:size-16";
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Phone menu panel (Header rule N8): fixed under the bar (`top` is set inline to the bar's bottom), full
|
|
137
|
+
* width and the rest of the height, on the page surface; its own scroll if the rows run long. The
|
|
138
|
+
* links sit on the page margins; the main action pins to the bottom.
|
|
139
|
+
*/
|
|
140
|
+
export declare const siteNavMobilePanelClasses = "fixed inset-x-0 bottom-0 z-[60] flex flex-col overflow-y-auto overscroll-contain bg-body px-[var(--grid-margin)] pt-2 pb-[max(var(--grid-margin),env(safe-area-inset-bottom))] md:hidden!";
|
|
141
|
+
/** The menu's rows, stacked. */
|
|
142
|
+
export declare const siteNavMobileListClasses = "flex flex-col";
|
|
143
|
+
/**
|
|
144
|
+
* Phone menu row (Header rule N5): full width, 56px. The current page is marked by weight and the
|
|
145
|
+
* selected fill, not colour alone (N2), with `aria-current="page"`.
|
|
146
|
+
*/
|
|
127
147
|
export declare const siteNavMobileLinkClasses: string;
|
|
148
|
+
/** The menu's main action, pinned to the bottom of the panel, full width. */
|
|
149
|
+
export declare const siteNavMobileActionClasses = "mt-auto flex flex-col gap-2 pt-6 [&_a]:w-full [&_button]:w-full";
|
|
150
|
+
/**
|
|
151
|
+
* The bar's own actions beside the Menu button. When brand + actions + Menu don't fit (`data-tight`,
|
|
152
|
+
* measured), they hide so the button keeps its word (Header rule N7); the open menu carries the main
|
|
153
|
+
* action instead. While the phone menu is open they hide too: the menu's own action is the one CTA on screen.
|
|
154
|
+
*/
|
|
155
|
+
export declare const siteNavEndActionsClasses = "contents data-[tight]:hidden! max-md:data-[menu-open]:hidden!";
|
|
128
156
|
//# sourceMappingURL=siteNavStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siteNavStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/SiteNav/siteNavStyles.ts"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,eAAO,MAAM,aAAa,kCAAmC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,2IAA2I;AAC3I,eAAO,MAAM,iBAAiB,8BAA+B,CAAC;AAC9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,gHAAgH;AAChH,eAAO,MAAM,qBAAqB,0BAA2B,CAAC;AAC9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,wGAAwG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,gGAAgG;AAChG,eAAO,MAAM,uBAAuB,QAOnC,CAAC;AAEF,eAAO,MAAM,0BAA0B,2CAA2C,CAAC;AAEnF,wGAAwG;AACxG,eAAO,MAAM,yBAAyB,QAMrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oCAAoC,CAAC;AAE3E,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAInE,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAA8B,CAAC;AAE1E,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,oCAAoC,CAAC;AAExE,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,uDACe,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,6CAA6C,CAAC;AAEpF,+EAA+E;AAC/E,eAAO,MAAM,2BAA2B,6DACoB,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,8LACuJ,CAAC;AAE9L,gCAAgC;AAChC,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAGpC,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,oEAAoE,CAAC;AAE5G;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,kEAAkE,CAAC"}
|
|
@@ -16,10 +16,10 @@ var r = ["expanded", "compact"], i = ["fixed", "inline"], a = ["hug", "grid"], o
|
|
|
16
16
|
middleOnly: "flex w-full min-w-0 items-center justify-center",
|
|
17
17
|
startOnly: "flex w-full items-center justify-start",
|
|
18
18
|
endOnly: "flex w-full items-center justify-end"
|
|
19
|
-
}, b = "max-md:[&_a]:min-h-11 max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11", x = `flex shrink-0 items-center gap-2 ${b}`, S = "flex min-w-0 flex-1 items-center justify-center", C = "flex min-w-0 max-w-full items-center justify-center", w = `flex shrink-0 flex-nowrap items-center gap-2 ${b}`, T = "max-md:hidden md:flex min-w-0 w-full flex-1 items-center justify-center", E = "max-md:hidden md:flex min-w-0 max-w-full items-center justify-center", D = "md:!hidden", O = "text-fg!", k = "relative flex min-w-0 w-full max-w-full items-center justify-center gap-1", A = "flex min-w-0 max-w-full justify-center", j = "m-0 flex min-w-0 list-none flex-nowrap items-center gap-1 overflow-hidden p-0", M = "pointer-events-none invisible absolute left-0 top-0 -z-10 flex w-max gap-1", N = e("text-muted! hover:text-fg!", "data-[state=open]:bg-ghost-hover data-[state=open]:text-fg!"), P = e("inline-flex [&>svg]:size-3.5 [&>svg]:stroke-current", "transition-transform data-[state=open]:rotate-180", n("fast")), F = "inline-flex h-9 items-center px-4 text-sm leading-none", I = "inline-flex h-9 items-center gap-1 px-4 text-sm leading-none", L = e("text-muted! hover:text-fg!", "data-[active]:bg-fill-selected! data-[active]:text-fg!", "aria-[current=page]:bg-fill-selected! aria-[current=page]:text-fg!"), R = e("text-muted! hover:text-fg!", "data-[popup-open]:bg-ghost-hover data-[popup-open]:text-fg!"), z = "inline-flex items-center gap-1", B = e("inline-flex [&>svg]:size-3.5 [&>svg]:stroke-current", "transition-transform data-[popup-open]:rotate-180", n("fast")), V = "z-[51] w-[min(var(--grid-max),calc(100vw_-_2_*_var(--grid-margin)))] outline-none", H = e("relative box-border w-full overflow-hidden rounded-3xl border border-elevation-edge bg-popover shadow-soft-sm", "h-[var(--popup-height)] origin-top", "transition-[height,opacity,transform]", n("medium"), "data-[starting-style]:-translate-y-2 data-[starting-style]:opacity-0", "data-[ending-style]:-translate-y-2 data-[ending-style]:opacity-0"), U = "relative h-full w-full overflow-hidden", W = e("grid w-full grid-cols-1 divide-y divide-border", "md:grid-cols-none md:grid-flow-col md:auto-cols-fr md:divide-x md:divide-y-0", "transition-opacity", n("fast"), "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"), G = "flex min-w-0 flex-col gap-4 p-6", K = {
|
|
19
|
+
}, b = "max-md:[&_a]:min-h-11 max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11", x = `flex shrink-0 items-center gap-2 ${b}`, S = "flex min-w-0 flex-1 items-center justify-center", C = "flex min-w-0 max-w-full items-center justify-center", w = `flex shrink-0 flex-nowrap items-center gap-2 max-md:ml-auto ${b}`, T = "max-md:hidden md:flex min-w-0 w-full flex-1 items-center justify-center", E = "max-md:hidden md:flex min-w-0 max-w-full items-center justify-center", D = "min-h-11 !px-4 md:!hidden in-data-[state=expanded]:-mr-4", O = "text-fg!", k = "text-fg! in-data-[state=expanded]:-ml-4", ee = "relative flex min-w-0 w-full max-w-full items-center justify-center gap-1", A = "flex min-w-0 max-w-full justify-center", j = "m-0 flex min-w-0 list-none flex-nowrap items-center gap-1 overflow-hidden p-0", M = "pointer-events-none invisible absolute left-0 top-0 -z-10 flex w-max gap-1", N = e("text-muted! hover:text-fg!", "data-[state=open]:bg-ghost-hover data-[state=open]:text-fg!"), P = e("inline-flex [&>svg]:size-3.5 [&>svg]:stroke-current", "transition-transform data-[state=open]:rotate-180", n("fast")), F = "inline-flex h-9 items-center px-4 text-sm leading-none", I = "inline-flex h-9 items-center gap-1 px-4 text-sm leading-none", L = e("text-muted! hover:text-fg!", "data-[active]:bg-fill-selected! data-[active]:text-fg!", "aria-[current=page]:bg-fill-selected! aria-[current=page]:text-fg!"), R = e("text-muted! hover:text-fg!", "data-[popup-open]:bg-ghost-hover data-[popup-open]:text-fg!"), z = "inline-flex items-center gap-1", B = e("inline-flex [&>svg]:size-3.5 [&>svg]:stroke-current", "transition-transform data-[popup-open]:rotate-180", n("fast")), V = "z-[51] w-[min(var(--grid-max),calc(100vw_-_2_*_var(--grid-margin)))] outline-none", H = e("relative box-border w-full overflow-hidden rounded-3xl border border-elevation-edge bg-popover shadow-soft-sm", "h-[var(--popup-height)] origin-top", "transition-[height,opacity,transform]", n("medium"), "data-[starting-style]:-translate-y-2 data-[starting-style]:opacity-0", "data-[ending-style]:-translate-y-2 data-[ending-style]:opacity-0"), U = "relative h-full w-full overflow-hidden", W = e("grid w-full grid-cols-1 divide-y divide-border", "md:grid-cols-none md:grid-flow-col md:auto-cols-fr md:divide-x md:divide-y-0", "transition-opacity", n("fast"), "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"), G = "flex min-w-0 flex-col gap-4 p-6", K = {
|
|
20
20
|
1: "col-span-1",
|
|
21
21
|
2: "col-span-1 md:col-span-2",
|
|
22
22
|
3: "col-span-1 md:col-span-3"
|
|
23
|
-
}, q = t("overline"), J = "-mx-4 justify-start! self-start", Y = "grid grid-cols-1 gap-y-1 md:grid-cols-2 md:gap-x-6", X = "flex flex-col gap-3 md:flex-row md:gap-4", Z = "aspect-[16/10] w-full shrink-0 md:aspect-auto md:size-16", Q = "flex flex-col
|
|
23
|
+
}, q = t("overline"), J = "-mx-4 justify-start! self-start", Y = "grid grid-cols-1 gap-y-1 md:grid-cols-2 md:gap-x-6", X = "flex flex-col gap-3 md:flex-row md:gap-4", Z = "aspect-[16/10] w-full shrink-0 md:aspect-auto md:size-16", Q = "fixed inset-x-0 bottom-0 z-[60] flex flex-col overflow-y-auto overscroll-contain bg-body px-[var(--grid-margin)] pt-2 pb-[max(var(--grid-margin),env(safe-area-inset-bottom))] md:hidden!", $ = "flex flex-col", te = e("min-h-14! w-full justify-start! text-fg! type-large!", "aria-[current=page]:bg-fill-selected! aria-[current=page]:font-semibold!"), ne = "mt-auto flex flex-col gap-2 pt-6 [&_a]:w-full [&_button]:w-full", re = "contents data-[tight]:hidden! max-md:data-[menu-open]:hidden!";
|
|
24
24
|
//#endregion
|
|
25
|
-
export { h as siteNavBarBaseClasses, _ as siteNavBarCompactLayoutClasses, g as siteNavBarStateClasses, O as siteNavBrandClasses, a as siteNavCompactLayouts, l as siteNavCompactViewportTopClasses, m as siteNavContainerClasses, s as siteNavDefaultCollapseAt, o as siteNavDefaultCollapseRatio, w as siteNavEndClasses, c as siteNavExpandedHeightClasses, L as siteNavLinkClasses, j as siteNavLinkListClasses,
|
|
25
|
+
export { h as siteNavBarBaseClasses, _ as siteNavBarCompactLayoutClasses, g as siteNavBarStateClasses, O as siteNavBrandClasses, a as siteNavCompactLayouts, l as siteNavCompactViewportTopClasses, m as siteNavContainerClasses, s as siteNavDefaultCollapseAt, o as siteNavDefaultCollapseRatio, re as siteNavEndActionsClasses, w as siteNavEndClasses, c as siteNavExpandedHeightClasses, L as siteNavLinkClasses, j as siteNavLinkListClasses, ee as siteNavLinksRootClasses, F as siteNavMeasureItemClasses, I as siteNavMeasureMoreClasses, M as siteNavMeasureRailClasses, v as siteNavMenuBackdropClasses, W as siteNavMenuContentClasses, J as siteNavMenuLinkClasses, Y as siteNavMenuLinkGridClasses, H as siteNavMenuPopupClasses, V as siteNavMenuPositionerClasses, X as siteNavMenuReadRowClasses, Z as siteNavMenuReadThumbClasses, G as siteNavMenuSectionClasses, q as siteNavMenuSectionLabelClasses, K as siteNavMenuSectionSpanClasses, U as siteNavMenuViewportClasses, S as siteNavMiddleClasses, C as siteNavMiddleHugClasses, E as siteNavMiddleHugResponsiveClasses, T as siteNavMiddleResponsiveClasses, ne as siteNavMobileActionClasses, te as siteNavMobileLinkClasses, $ as siteNavMobileListClasses, Q as siteNavMobilePanelClasses, D as siteNavMobileTriggerClasses, P as siteNavMoreIconClasses, N as siteNavMoreTriggerClasses, A as siteNavNavigationRootClasses, i as siteNavPlacements, d as siteNavRootFixedClasses, u as siteNavRootFlowClasses, p as siteNavRootInlineClasses, f as siteNavRootStickyClasses, y as siteNavSlotsClasses, x as siteNavStartClasses, r as siteNavStates, R as siteNavTriggerClasses, B as siteNavTriggerIconClasses, z as siteNavTriggerLabelClasses, k as siteNavWordmarkBrandClasses };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
export interface SiteNavMobileMenuOptions {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
/** The header: its bar (with the Menu / Close button) stays live above the panel. */
|
|
6
|
+
barRef: RefObject<HTMLElement | null>;
|
|
7
|
+
panelRef: RefObject<HTMLElement | null>;
|
|
8
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The phone menu as a dialog that keeps its bar (Header rule N6): page scroll locks, everything but the
|
|
12
|
+
* bar and the panel goes inert, Tab cycles through the bar and the panel, focus starts on the panel's
|
|
13
|
+
* first link, Escape closes, and focus returns to the Menu button. Widening past `md` closes it.
|
|
14
|
+
* Returns the panel's top edge (the bar's bottom) so the panel sits under the bar.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useSiteNavMobileMenu({ open, onClose, barRef, panelRef, triggerRef }: SiteNavMobileMenuOptions): number;
|
|
17
|
+
//# sourceMappingURL=useSiteNavMobileMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSiteNavMobileMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/SiteNav/useSiteNavMobileMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qFAAqF;IACrF,MAAM,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACxC,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,wBAAwB,UA6D7G"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { inertAllBut as e, lockBodyScroll as t, tabbablesIn as n } from "../../../lib/dialogOverlay.js";
|
|
3
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
4
|
+
//#region src/components/organisms/SiteNav/useSiteNavMobileMenu.ts
|
|
5
|
+
function o({ open: o, onClose: s, barRef: c, panelRef: l, triggerRef: u }) {
|
|
6
|
+
let [d, f] = a(0), p = i(s);
|
|
7
|
+
return r(() => {
|
|
8
|
+
p.current = s;
|
|
9
|
+
}), r(() => {
|
|
10
|
+
let r = c.current, i = l.current;
|
|
11
|
+
if (!o || r == null || i == null) return;
|
|
12
|
+
let a = () => f(Math.max(0, Math.round(r.getBoundingClientRect().bottom)));
|
|
13
|
+
a();
|
|
14
|
+
let s = t(), d = e([r, i]), m = () => [...n(r), ...n(i)];
|
|
15
|
+
function h(e) {
|
|
16
|
+
if (e.key === "Escape" && !e.isComposing && !e.defaultPrevented) {
|
|
17
|
+
e.preventDefault(), p.current();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (e.key !== "Tab") return;
|
|
21
|
+
let t = m();
|
|
22
|
+
if (t.length === 0) return;
|
|
23
|
+
let n = t.indexOf(document.activeElement), r = e.shiftKey ? t[n <= 0 ? t.length - 1 : n - 1] : t[n === -1 || n === t.length - 1 ? 0 : n + 1];
|
|
24
|
+
e.preventDefault(), r.focus();
|
|
25
|
+
}
|
|
26
|
+
document.addEventListener("keydown", h), window.addEventListener("resize", a);
|
|
27
|
+
let g = window.matchMedia("(min-width: 768px)"), _ = () => {
|
|
28
|
+
g.matches && p.current();
|
|
29
|
+
};
|
|
30
|
+
g.addEventListener("change", _);
|
|
31
|
+
let v = window.requestAnimationFrame(() => {
|
|
32
|
+
n(i)[0]?.focus();
|
|
33
|
+
});
|
|
34
|
+
return () => {
|
|
35
|
+
window.cancelAnimationFrame(v), document.removeEventListener("keydown", h), window.removeEventListener("resize", a), g.removeEventListener("change", _), d(), s();
|
|
36
|
+
let e = document.activeElement;
|
|
37
|
+
(e == null || e === document.body || i.contains(e) || r.contains(e)) && u.current?.focus();
|
|
38
|
+
};
|
|
39
|
+
}, [
|
|
40
|
+
o,
|
|
41
|
+
c,
|
|
42
|
+
l,
|
|
43
|
+
u
|
|
44
|
+
]), d;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { o as useSiteNavMobileMenu };
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
+
/** The tabbable controls inside `container`, in DOM order. */
|
|
3
|
+
export declare function tabbablesIn(container: HTMLElement): HTMLElement[];
|
|
4
|
+
/**
|
|
5
|
+
* Mark everything inert except `keep` and their ancestors — returns cleanup. Unlike `inertPageBehind`,
|
|
6
|
+
* this works when the surface lives inside the page (a header whose bar stays live above its own menu):
|
|
7
|
+
* at every level from each kept element up to `body`, the siblings that hold no kept element go inert.
|
|
8
|
+
*/
|
|
9
|
+
export declare function inertAllBut(keep: HTMLElement[]): () => void;
|
|
2
10
|
/** Tab cycle within a modal surface — returns cleanup. */
|
|
3
11
|
export declare function trapFocus(container: HTMLElement): () => void;
|
|
4
12
|
export declare function lockBodyScroll(): () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialogOverlay.d.ts","sourceRoot":"","sources":["../../src/lib/dialogOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc1D,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,IAAI,CAqC5D;AAaD,wBAAgB,cAAc,IAAI,MAAM,IAAI,CAgB3C;AAwBD,+FAA+F;AAC/F,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,WAAW,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI,CAWN;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,IAAI,CAwBhE;AAED,wGAAwG;AACxG,wBAAgB,gBAAgB,IAAI,IAAI,CAYvC;AAED,MAAM,WAAW,uBAAuB;IACtC,8FAA8F;IAC9F,IAA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;AAED,MAAM,WAAW,uBAAuB;IACtC,8FAA8F;IAC9F,IAAI,EAAE,OAAO,CAAC;IACd,sDAAsD;IACtD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mGAAmG;IACnG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8FAA8F;IAC9F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,cAAc,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAChD;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACvC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAY,EAAE,aAAoB,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,uBAAuB,GAC3G,IAAI,CA+CN"}
|
|
@@ -6,6 +6,25 @@ function r(e) {
|
|
|
6
6
|
return e.closest("[inert]") == null ? typeof e.checkVisibility == "function" ? e.checkVisibility({ visibilityProperty: !0 }) : e.offsetParent !== null && getComputedStyle(e).visibility !== "hidden" : !1;
|
|
7
7
|
}
|
|
8
8
|
function i(e) {
|
|
9
|
+
return Array.from(e.querySelectorAll(n)).filter(r);
|
|
10
|
+
}
|
|
11
|
+
function a(e) {
|
|
12
|
+
if (typeof document > "u") return () => void 0;
|
|
13
|
+
let t = (t) => e.some((e) => t === e || t.contains(e)), n = /* @__PURE__ */ new Set();
|
|
14
|
+
for (let r of e) for (let e = r; e != null && e !== document.body; e = e.parentElement) {
|
|
15
|
+
let r = e.parentElement;
|
|
16
|
+
if (r == null) break;
|
|
17
|
+
for (let e of Array.from(r.children)) !(e instanceof HTMLElement) || t(e) || e.hasAttribute("inert") || [
|
|
18
|
+
"SCRIPT",
|
|
19
|
+
"STYLE",
|
|
20
|
+
"LINK"
|
|
21
|
+
].includes(e.tagName) || (e.setAttribute("inert", ""), n.add(e));
|
|
22
|
+
}
|
|
23
|
+
return () => {
|
|
24
|
+
for (let e of n) e.removeAttribute("inert");
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function o(e) {
|
|
9
28
|
function t(t) {
|
|
10
29
|
if (t.key !== "Tab") return;
|
|
11
30
|
let i = Array.from(e.querySelectorAll(n)).filter((e) => r(e) || e === document.activeElement);
|
|
@@ -24,16 +43,16 @@ function i(e) {
|
|
|
24
43
|
e.removeEventListener("keydown", t);
|
|
25
44
|
};
|
|
26
45
|
}
|
|
27
|
-
var
|
|
28
|
-
function
|
|
46
|
+
var s = 0, c = () => void 0;
|
|
47
|
+
function l() {
|
|
29
48
|
if (typeof document > "u") return () => void 0;
|
|
30
|
-
|
|
49
|
+
s += 1, s === 1 && (c = u(document));
|
|
31
50
|
let e = !1;
|
|
32
51
|
return () => {
|
|
33
|
-
e || (e = !0, --
|
|
52
|
+
e || (e = !0, --s, s === 0 && c());
|
|
34
53
|
};
|
|
35
54
|
}
|
|
36
|
-
function
|
|
55
|
+
function u({ body: e, documentElement: t }) {
|
|
37
56
|
let n = e.style.overflow, r = e.style.paddingRight, i = t.style.scrollbarGutter;
|
|
38
57
|
e.style.overflow = "hidden";
|
|
39
58
|
let a = getComputedStyle(t).scrollbarGutter.includes("stable") ? Math.max(0, window.innerWidth - t.scrollWidth) : 0;
|
|
@@ -45,7 +64,7 @@ function c({ body: e, documentElement: t }) {
|
|
|
45
64
|
e.style.overflow = n, e.style.paddingRight = r, t.style.scrollbarGutter = i;
|
|
46
65
|
};
|
|
47
66
|
}
|
|
48
|
-
function
|
|
67
|
+
function d(e, t) {
|
|
49
68
|
if (t) {
|
|
50
69
|
let n = e.querySelector(t);
|
|
51
70
|
if (n != null) {
|
|
@@ -55,7 +74,7 @@ function l(e, t) {
|
|
|
55
74
|
}
|
|
56
75
|
e.querySelector(n)?.focus();
|
|
57
76
|
}
|
|
58
|
-
function
|
|
77
|
+
function f(e) {
|
|
59
78
|
if (typeof document > "u") return () => void 0;
|
|
60
79
|
let t = e;
|
|
61
80
|
for (; t.parentElement != null && t.parentElement !== document.body;) t = t.parentElement;
|
|
@@ -65,57 +84,57 @@ function u(e) {
|
|
|
65
84
|
for (let e of n) e.removeAttribute("inert");
|
|
66
85
|
};
|
|
67
86
|
}
|
|
68
|
-
function
|
|
87
|
+
function p() {
|
|
69
88
|
if (typeof document > "u") return;
|
|
70
89
|
let e = document.querySelector("main, [role='main']");
|
|
71
90
|
e != null && (e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.focus({ preventScroll: !0 }));
|
|
72
91
|
}
|
|
73
|
-
var
|
|
74
|
-
function
|
|
75
|
-
let
|
|
92
|
+
var m = [];
|
|
93
|
+
function h(n, { open: r, onClose: i, modal: a = !0, closeOnEscape: s = !0, initialFocus: c, returnFocusRef: u }) {
|
|
94
|
+
let p = t(i), h = t(s);
|
|
76
95
|
e(() => {
|
|
77
|
-
|
|
96
|
+
p.current = i, h.current = s;
|
|
78
97
|
}), e(() => {
|
|
79
98
|
let e = n.current;
|
|
80
99
|
if (!r || e == null) return;
|
|
81
100
|
let t = {};
|
|
82
|
-
|
|
83
|
-
let
|
|
101
|
+
m.push(t);
|
|
102
|
+
let i = u?.current ?? document.activeElement, s = a ? _(l(), f(e), o(e)) : g, y = window.requestAnimationFrame(() => {
|
|
84
103
|
let t = document.activeElement;
|
|
85
|
-
(t == null || t === document.body || t ===
|
|
104
|
+
(t == null || t === document.body || t === i) && d(e, c);
|
|
86
105
|
});
|
|
87
106
|
function b(e) {
|
|
88
|
-
e.key !== "Escape" || e.isComposing || e.defaultPrevented ||
|
|
107
|
+
e.key !== "Escape" || e.isComposing || e.defaultPrevented || m.at(-1) !== t || h.current && (e.preventDefault(), p.current());
|
|
89
108
|
}
|
|
90
109
|
return document.addEventListener("keydown", b), () => {
|
|
91
|
-
document.removeEventListener("keydown", b), window.cancelAnimationFrame(y),
|
|
110
|
+
document.removeEventListener("keydown", b), window.cancelAnimationFrame(y), m.splice(m.indexOf(t), 1), s(), v(e, i);
|
|
92
111
|
};
|
|
93
112
|
}, [
|
|
94
|
-
|
|
95
|
-
|
|
113
|
+
c,
|
|
114
|
+
a,
|
|
96
115
|
r,
|
|
97
116
|
n,
|
|
98
|
-
|
|
117
|
+
u
|
|
99
118
|
]);
|
|
100
119
|
}
|
|
101
|
-
function
|
|
102
|
-
function
|
|
120
|
+
function g() {}
|
|
121
|
+
function _(...e) {
|
|
103
122
|
return () => {
|
|
104
123
|
for (let t of e.reverse()) t();
|
|
105
124
|
};
|
|
106
125
|
}
|
|
107
|
-
function
|
|
126
|
+
function v(e, t) {
|
|
108
127
|
let n = document.activeElement;
|
|
109
128
|
if (!(n != null && n !== document.body && !e.contains(n))) {
|
|
110
129
|
if (t != null && t.isConnected && t !== document.body) {
|
|
111
130
|
t.focus();
|
|
112
131
|
return;
|
|
113
132
|
}
|
|
114
|
-
|
|
133
|
+
p(), window.requestAnimationFrame(() => {
|
|
115
134
|
let t = document.activeElement;
|
|
116
|
-
(t == null || t === document.body || e.contains(t)) &&
|
|
135
|
+
(t == null || t === document.body || e.contains(t)) && p();
|
|
117
136
|
});
|
|
118
137
|
}
|
|
119
138
|
}
|
|
120
139
|
//#endregion
|
|
121
|
-
export {
|
|
140
|
+
export { d as focusInitialElement, p as focusMainContent, a as inertAllBut, f as inertPageBehind, l as lockBodyScroll, i as tabbablesIn, o as trapFocus, h as useOverlayLifecycle };
|