@slipstream-ui/core 0.12.0 → 0.12.1
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/dist/index.js +33 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -9
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +1 -1
- package/dist/manifests/alert.manifest.json +1 -1
- package/dist/manifests/announcement-bar.manifest.json +1 -1
- package/dist/manifests/app-shell.manifest.json +1 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +1 -1
- package/dist/manifests/auth-layout.manifest.json +1 -1
- package/dist/manifests/autocomplete.manifest.json +1 -1
- package/dist/manifests/avatar.manifest.json +1 -1
- package/dist/manifests/badge.manifest.json +1 -1
- package/dist/manifests/block.manifest.json +1 -1
- package/dist/manifests/bottom-nav.manifest.json +1 -1
- package/dist/manifests/breadcrumb.manifest.json +1 -1
- package/dist/manifests/button-group.manifest.json +1 -1
- package/dist/manifests/button.manifest.json +1 -1
- package/dist/manifests/calendar.manifest.json +1 -1
- package/dist/manifests/card.manifest.json +1 -1
- package/dist/manifests/checkbox.manifest.json +1 -1
- package/dist/manifests/comparison-table.manifest.json +1 -1
- package/dist/manifests/confirm-dialog.manifest.json +1 -1
- package/dist/manifests/consent-banner.manifest.json +1 -1
- package/dist/manifests/contact-strip.manifest.json +1 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cover-image.manifest.json +1 -1
- package/dist/manifests/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +1 -1
- package/dist/manifests/date-picker-popover.manifest.json +1 -1
- package/dist/manifests/date-picker.manifest.json +1 -1
- package/dist/manifests/date-range-picker.manifest.json +1 -1
- package/dist/manifests/deal-card.manifest.json +1 -1
- package/dist/manifests/dialog.manifest.json +1 -1
- package/dist/manifests/document-card.manifest.json +1 -1
- package/dist/manifests/drawer.manifest.json +1 -1
- package/dist/manifests/empty-state.manifest.json +1 -1
- package/dist/manifests/entity-card.manifest.json +1 -1
- package/dist/manifests/feature-grid.manifest.json +1 -1
- package/dist/manifests/feature-row.manifest.json +1 -1
- package/dist/manifests/fieldset.manifest.json +1 -1
- package/dist/manifests/file-upload.manifest.json +1 -1
- package/dist/manifests/filter-bar.manifest.json +1 -1
- package/dist/manifests/filter-chips.manifest.json +1 -1
- package/dist/manifests/filter-panel.manifest.json +1 -1
- package/dist/manifests/flex.manifest.json +1 -1
- package/dist/manifests/form-field.manifest.json +1 -1
- package/dist/manifests/form-layout.manifest.json +1 -1
- package/dist/manifests/form.manifest.json +1 -1
- package/dist/manifests/grid.manifest.json +1 -1
- package/dist/manifests/heading.manifest.json +1 -1
- package/dist/manifests/hero.manifest.json +1 -1
- package/dist/manifests/image.manifest.json +1 -1
- package/dist/manifests/input-group.manifest.json +1 -1
- package/dist/manifests/input.manifest.json +1 -1
- package/dist/manifests/label.manifest.json +1 -1
- package/dist/manifests/link-tabs.manifest.json +1 -1
- package/dist/manifests/link.manifest.json +1 -1
- package/dist/manifests/list-toolbar.manifest.json +1 -1
- package/dist/manifests/list.manifest.json +1 -1
- package/dist/manifests/load-more.manifest.json +1 -1
- package/dist/manifests/logo-cloud.manifest.json +1 -1
- package/dist/manifests/media-card.manifest.json +1 -1
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/month-schedule.manifest.json +1 -1
- package/dist/manifests/multi-select.manifest.json +1 -1
- package/dist/manifests/newsletter.manifest.json +1 -1
- package/dist/manifests/page-header.manifest.json +1 -1
- package/dist/manifests/pagination.manifest.json +1 -1
- package/dist/manifests/password-input.manifest.json +1 -1
- package/dist/manifests/popover.manifest.json +1 -1
- package/dist/manifests/process-steps.manifest.json +1 -1
- package/dist/manifests/progress.manifest.json +1 -1
- package/dist/manifests/prose.manifest.json +1 -1
- package/dist/manifests/radio.manifest.json +1 -1
- package/dist/manifests/range-slider.manifest.json +1 -1
- package/dist/manifests/search.manifest.json +1 -1
- package/dist/manifests/section-heading.manifest.json +1 -1
- package/dist/manifests/section.manifest.json +1 -1
- package/dist/manifests/segmented-control.manifest.json +1 -1
- package/dist/manifests/select-menu.manifest.json +1 -1
- package/dist/manifests/select.manifest.json +1 -1
- package/dist/manifests/separator.manifest.json +1 -1
- package/dist/manifests/site-footer.manifest.json +1 -1
- package/dist/manifests/site-header.manifest.json +1 -1
- package/dist/manifests/skeleton.manifest.json +1 -1
- package/dist/manifests/spinner.manifest.json +1 -1
- package/dist/manifests/stat-band.manifest.json +1 -1
- package/dist/manifests/stepper.manifest.json +1 -1
- package/dist/manifests/switch.manifest.json +1 -1
- package/dist/manifests/table-card.manifest.json +1 -1
- package/dist/manifests/table-of-contents.manifest.json +1 -1
- package/dist/manifests/table.manifest.json +1 -1
- package/dist/manifests/tabs.manifest.json +1 -1
- package/dist/manifests/testimonial.manifest.json +1 -1
- package/dist/manifests/text.manifest.json +1 -1
- package/dist/manifests/textarea.manifest.json +1 -1
- package/dist/manifests/theme-toggle.manifest.json +1 -1
- package/dist/manifests/time-picker.manifest.json +1 -1
- package/dist/manifests/timeline.manifest.json +1 -1
- package/dist/manifests/toast.manifest.json +1 -1
- package/dist/manifests/tombstone-card.manifest.json +1 -1
- package/dist/manifests/tooltip.manifest.json +1 -1
- package/dist/src/components/site-header/SiteHeader.js +33 -9
- package/dist/src/components/site-header/SiteHeader.js.map +1 -1
- package/dist/src/components/site-header/SiteHeader.mjs +33 -9
- package/dist/src/components/site-header/SiteHeader.mjs.map +1 -1
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/components/site-header/SiteHeader.test.tsx +27 -0
- package/src/components/site-header/SiteHeader.tsx +60 -21
- package/src/manifests/accordion.manifest.json +1 -1
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +1 -1
- package/src/manifests/app-shell.manifest.json +1 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +1 -1
- package/src/manifests/auth-layout.manifest.json +1 -1
- package/src/manifests/autocomplete.manifest.json +1 -1
- package/src/manifests/avatar.manifest.json +1 -1
- package/src/manifests/badge.manifest.json +1 -1
- package/src/manifests/block.manifest.json +1 -1
- package/src/manifests/bottom-nav.manifest.json +1 -1
- package/src/manifests/breadcrumb.manifest.json +1 -1
- package/src/manifests/button-group.manifest.json +1 -1
- package/src/manifests/button.manifest.json +1 -1
- package/src/manifests/calendar.manifest.json +1 -1
- package/src/manifests/card.manifest.json +1 -1
- package/src/manifests/checkbox.manifest.json +1 -1
- package/src/manifests/comparison-table.manifest.json +1 -1
- package/src/manifests/confirm-dialog.manifest.json +1 -1
- package/src/manifests/consent-banner.manifest.json +1 -1
- package/src/manifests/contact-strip.manifest.json +1 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cover-image.manifest.json +1 -1
- package/src/manifests/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +1 -1
- package/src/manifests/date-picker-popover.manifest.json +1 -1
- package/src/manifests/date-picker.manifest.json +1 -1
- package/src/manifests/date-range-picker.manifest.json +1 -1
- package/src/manifests/deal-card.manifest.json +1 -1
- package/src/manifests/dialog.manifest.json +1 -1
- package/src/manifests/document-card.manifest.json +1 -1
- package/src/manifests/drawer.manifest.json +1 -1
- package/src/manifests/empty-state.manifest.json +1 -1
- package/src/manifests/entity-card.manifest.json +1 -1
- package/src/manifests/feature-grid.manifest.json +1 -1
- package/src/manifests/feature-row.manifest.json +1 -1
- package/src/manifests/fieldset.manifest.json +1 -1
- package/src/manifests/file-upload.manifest.json +1 -1
- package/src/manifests/filter-bar.manifest.json +1 -1
- package/src/manifests/filter-chips.manifest.json +1 -1
- package/src/manifests/filter-panel.manifest.json +1 -1
- package/src/manifests/flex.manifest.json +1 -1
- package/src/manifests/form-field.manifest.json +1 -1
- package/src/manifests/form-layout.manifest.json +1 -1
- package/src/manifests/form.manifest.json +1 -1
- package/src/manifests/grid.manifest.json +1 -1
- package/src/manifests/heading.manifest.json +1 -1
- package/src/manifests/hero.manifest.json +1 -1
- package/src/manifests/image.manifest.json +1 -1
- package/src/manifests/input-group.manifest.json +1 -1
- package/src/manifests/input.manifest.json +1 -1
- package/src/manifests/label.manifest.json +1 -1
- package/src/manifests/link-tabs.manifest.json +1 -1
- package/src/manifests/link.manifest.json +1 -1
- package/src/manifests/list-toolbar.manifest.json +1 -1
- package/src/manifests/list.manifest.json +1 -1
- package/src/manifests/load-more.manifest.json +1 -1
- package/src/manifests/logo-cloud.manifest.json +1 -1
- package/src/manifests/media-card.manifest.json +1 -1
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/month-schedule.manifest.json +1 -1
- package/src/manifests/multi-select.manifest.json +1 -1
- package/src/manifests/newsletter.manifest.json +1 -1
- package/src/manifests/page-header.manifest.json +1 -1
- package/src/manifests/pagination.manifest.json +1 -1
- package/src/manifests/password-input.manifest.json +1 -1
- package/src/manifests/popover.manifest.json +1 -1
- package/src/manifests/process-steps.manifest.json +1 -1
- package/src/manifests/progress.manifest.json +1 -1
- package/src/manifests/prose.manifest.json +1 -1
- package/src/manifests/radio.manifest.json +1 -1
- package/src/manifests/range-slider.manifest.json +1 -1
- package/src/manifests/search.manifest.json +1 -1
- package/src/manifests/section-heading.manifest.json +1 -1
- package/src/manifests/section.manifest.json +1 -1
- package/src/manifests/segmented-control.manifest.json +1 -1
- package/src/manifests/select-menu.manifest.json +1 -1
- package/src/manifests/select.manifest.json +1 -1
- package/src/manifests/separator.manifest.json +1 -1
- package/src/manifests/site-footer.manifest.json +1 -1
- package/src/manifests/site-header.manifest.json +1 -1
- package/src/manifests/skeleton.manifest.json +1 -1
- package/src/manifests/spinner.manifest.json +1 -1
- package/src/manifests/stat-band.manifest.json +1 -1
- package/src/manifests/stepper.manifest.json +1 -1
- package/src/manifests/switch.manifest.json +1 -1
- package/src/manifests/table-card.manifest.json +1 -1
- package/src/manifests/table-of-contents.manifest.json +1 -1
- package/src/manifests/table.manifest.json +1 -1
- package/src/manifests/tabs.manifest.json +1 -1
- package/src/manifests/testimonial.manifest.json +1 -1
- package/src/manifests/text.manifest.json +1 -1
- package/src/manifests/textarea.manifest.json +1 -1
- package/src/manifests/theme-toggle.manifest.json +1 -1
- package/src/manifests/time-picker.manifest.json +1 -1
- package/src/manifests/timeline.manifest.json +1 -1
- package/src/manifests/toast.manifest.json +1 -1
- package/src/manifests/tombstone-card.manifest.json +1 -1
- package/src/manifests/tooltip.manifest.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "month-schedule",
|
|
9
9
|
"exportName": "MonthSchedule",
|
|
10
10
|
"description": "Month grid that shows dated events inside each day, with a type legend and a small-screen agenda — the schedule counterpart to Calendar's date picker.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "multi-select",
|
|
9
9
|
"exportName": "MultiSelect",
|
|
10
10
|
"description": "Searchable multi-select filter with visible removable chips and a checkbox panel.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "newsletter",
|
|
9
9
|
"exportName": "Newsletter",
|
|
10
10
|
"description": "Email capture block with inline or stacked layout, pending state, success and failure feedback.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "process-steps",
|
|
9
9
|
"exportName": "ProcessSteps",
|
|
10
10
|
"description": "Ordered process cards with derived step numbers or custom icons.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "prose",
|
|
9
9
|
"exportName": "Prose",
|
|
10
10
|
"description": "Self-contained long-form typography for rendered markdown/MDX: headings, links, lists, code, tables, quotes and figures.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "range-slider",
|
|
9
9
|
"exportName": "RangeSlider",
|
|
10
10
|
"description": "Dual-thumb numeric range slider with labeled native inputs and formatted values.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "section-heading",
|
|
9
9
|
"exportName": "SectionHeading",
|
|
10
10
|
"description": "Section heading block: eyebrow, title (level 2-4), description and actions, with left/center alignment and three sizes.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "section",
|
|
9
9
|
"exportName": "Section",
|
|
10
10
|
"description": "Full-width page section with a surface tone, vertical rhythm and an optional centered container.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "segmented-control",
|
|
9
9
|
"exportName": "SegmentedControl",
|
|
10
10
|
"description": "Single- or multi-select segmented control for view and filter switches.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "select-menu",
|
|
9
9
|
"exportName": "SelectMenu",
|
|
10
10
|
"description": "Custom listbox select for rich options: descriptions, icons, groups, multi-select, custom rows and hidden inputs for forms.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "site-footer",
|
|
9
9
|
"exportName": "SiteFooter",
|
|
10
10
|
"description": "Marketing footer: brand + tagline column, link columns and a legal bar; router-agnostic via linkComponent.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "site-header",
|
|
9
9
|
"exportName": "SiteHeader",
|
|
10
10
|
"description": "Marketing/site header: sticky bar with brand, horizontal navigation with prefix-aware active states, right-aligned actions and a mobile drawer.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "stat-band",
|
|
9
9
|
"exportName": "StatBand",
|
|
10
10
|
"description": "Semantic description list of headline stats with labels, optional hints and column presets.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "table-card",
|
|
9
9
|
"exportName": "TableCard",
|
|
10
10
|
"description": "Table shell with title/description, header actions, optional toolbar, edge-to-edge body and a footer row.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "table-of-contents",
|
|
9
9
|
"exportName": "TableOfContents",
|
|
10
10
|
"description": "Sticky 'On this page' navigation with real anchor links, nested levels and aria-current, plus a useScrollSpy hook for the active heading.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "testimonial",
|
|
9
9
|
"exportName": "Testimonial",
|
|
10
10
|
"description": "Semantic written testimonial with quote, person, role, company, avatar and logo slots.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.12.
|
|
7
|
+
"version": "0.12.1",
|
|
8
8
|
"sourceDir": "tombstone-card",
|
|
9
9
|
"exportName": "TombstoneCard",
|
|
10
10
|
"description": "Placeholder card for archived, closed or unavailable marketplace items.",
|
|
@@ -138,6 +138,24 @@ function SiteHeader({
|
|
|
138
138
|
);
|
|
139
139
|
};
|
|
140
140
|
const hasColumns = (item) => Array.isArray(item.columns) && item.columns.length > 0;
|
|
141
|
+
const alignPanel = React.useCallback((panel) => {
|
|
142
|
+
const item = panel.parentElement;
|
|
143
|
+
if (!item) return;
|
|
144
|
+
const itemRect = item.getBoundingClientRect();
|
|
145
|
+
const width = panel.offsetWidth;
|
|
146
|
+
const gutter = 8;
|
|
147
|
+
const centered = itemRect.left + itemRect.width / 2 - width / 2;
|
|
148
|
+
const left = Math.max(gutter, Math.min(centered, window.innerWidth - gutter - width));
|
|
149
|
+
panel.style.left = `${left - itemRect.left}px`;
|
|
150
|
+
panel.style.right = "auto";
|
|
151
|
+
}, []);
|
|
152
|
+
const useIsoLayoutEffect = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
|
|
153
|
+
useIsoLayoutEffect(() => {
|
|
154
|
+
if (!openMenu) return;
|
|
155
|
+
const panelId = `${generatedId}-panel-${openMenu.replace(/\s+/g, "-").toLowerCase()}`;
|
|
156
|
+
const panel = document.getElementById(panelId);
|
|
157
|
+
if (panel) alignPanel(panel);
|
|
158
|
+
}, [openMenu, generatedId, alignPanel]);
|
|
141
159
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
142
160
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
143
161
|
"header",
|
|
@@ -229,15 +247,21 @@ function SiteHeader({
|
|
|
229
247
|
{
|
|
230
248
|
id: panelId,
|
|
231
249
|
hidden: !open,
|
|
232
|
-
className:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
250
|
+
className: "absolute left-0 top-full z-50 pt-2",
|
|
251
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
252
|
+
"div",
|
|
253
|
+
{
|
|
254
|
+
className: (0, import_cn.cn)(
|
|
255
|
+
"grid gap-6 rounded-lg border border-border bg-popover p-5 shadow-lg",
|
|
256
|
+
item.columns.length > 1 ? "grid-cols-2" : "grid-cols-1",
|
|
257
|
+
item.columns.length > 1 ? "w-[38rem] max-w-[calc(100vw-2rem)]" : "w-[22rem] max-w-[calc(100vw-2rem)]"
|
|
258
|
+
),
|
|
259
|
+
children: item.columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-40", children: [
|
|
260
|
+
column.heading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: column.heading }),
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-0.5", children: column.items.map((link) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: navLink(link, "panel") }, `${column.heading ?? index}-${link.href}-${link.label}`)) })
|
|
262
|
+
] }, column.heading ?? index))
|
|
263
|
+
}
|
|
264
|
+
)
|
|
241
265
|
}
|
|
242
266
|
)
|
|
243
267
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/site-header/SiteHeader.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\nimport { Drawer } from '../drawer/Drawer';\n\n/** A single destination in the header or inside a mega panel. */\nexport type SiteNavLink = {\n href: string;\n label: string;\n /** Render with target=_blank + rel=noopener. */\n external?: boolean;\n /** Optional second line shown in a desktop mega panel. */\n description?: string;\n};\n\n/** One column inside a mega panel: a heading and its links. */\nexport type SiteNavColumn = {\n heading?: string;\n items: SiteNavLink[];\n};\n\nexport type SiteNavItem =\n | (SiteNavLink & { columns?: undefined })\n | {\n href?: string;\n label: string;\n external?: boolean;\n description?: string;\n /**\n * Nested navigation. Present items render as a disclosure trigger with\n * a desktop panel and a mobile <details> group instead of a link.\n */\n columns: SiteNavColumn[];\n };\n\nexport type SiteHeaderProps = React.HTMLAttributes<HTMLElement> & LinkLikeProps & {\n /** Brand slot - logo/lockup or wordmark. Wrapped in a link to \"/\". */\n brand: React.ReactNode;\n /**\n * Slim utility strip rendered above the brand row (locale switch, feed\n * link, submit link). Content is placed in a container matching the nav\n * metrics; lay out multiple items with justify-between or a flex row.\n */\n topBar?: React.ReactNode;\n /** Primary navigation items. */\n items: SiteNavItem[];\n /** Current route for active styling (aria-current=\"page\"). */\n activeHref?: string;\n /**\n * Active matching: 'prefix' highlights /docs when on /docs/installation\n * (default - marketing), 'exact' only the identical href (app chrome).\n */\n match?: 'prefix' | 'exact';\n /** Right-aligned actions (theme toggle, GitHub, CTA). */\n actions?: React.ReactNode;\n /** Actions rendered inside the mobile drawer; defaults to `actions`. */\n mobileActions?: React.ReactNode;\n /** Accessible name for the brand link (default \"Home\"). */\n brandLabel?: string;\n /** Accessible name for the desktop navigation landmark (default \"Main\"). */\n navLabel?: string;\n /** Accessible name for the mobile navigation landmark (default \"Mobile\"). */\n mobileNavLabel?: string;\n /** Pin to the top (default true). */\n sticky?: boolean;\n /** Title of the mobile navigation drawer. Default 'Menu'. */\n mobileLabel?: string;\n /** Accessible name for the mobile menu trigger when closed (default \"Open menu\"). */\n mobileMenuOpenLabel?: string;\n /** Accessible name for the mobile menu trigger when open (default \"Close menu\"). */\n mobileMenuCloseLabel?: string;\n /** Accessible name for the mobile drawer close button (default \"Close drawer\"). */\n mobileDrawerCloseLabel?: string;\n /** Render the built-in mobile trigger and drawer (default true). Set false when the host owns mobile navigation. */\n showMobileTrigger?: boolean;\n /** Breakpoint where the horizontal navigation appears (default 'md'). */\n desktopBreakpoint?: 'md' | 'lg';\n /** Extra classes for the inner nav row (height, padding). */\n navClassName?: string;\n};\n\nfunction isActive(\n itemHref: string,\n activeHref: string | undefined,\n match: 'prefix' | 'exact'\n): boolean {\n if (!activeHref) return false;\n if (itemHref === activeHref) return true;\n if (match === 'exact') return false;\n // Prefix match on path boundaries: /docs matches /docs/components, not /docsx.\n return (\n activeHref === itemHref ||\n activeHref.startsWith(itemHref.endsWith('/') ? itemHref : `${itemHref}/`)\n );\n}\n\nfunction Caret() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 12 12\"\n className=\"h-2.5 w-2.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m2.5 4.5 3.5 3.5 3.5-3.5\" />\n </svg>\n );\n}\n\n/**\n * Marketing/site header: sticky bar with brand, horizontal navigation with\n * prefix-aware active states, optional nested mega panels, right-aligned\n * actions and a mobile drawer. Router-agnostic through `linkComponent` +\n * `linkHrefProp`.\n */\nexport function SiteHeader({\n brand,\n topBar,\n items,\n activeHref,\n match = 'prefix',\n actions,\n mobileActions,\n linkComponent,\n linkHrefProp = 'href',\n brandLabel = 'Home',\n navLabel = 'Main',\n mobileNavLabel = 'Mobile',\n sticky = true,\n mobileLabel = 'Menu',\n mobileMenuOpenLabel = 'Open menu',\n mobileMenuCloseLabel = 'Close menu',\n mobileDrawerCloseLabel = 'Close drawer',\n showMobileTrigger = true,\n desktopBreakpoint = 'md',\n navClassName,\n className,\n ...props\n}: SiteHeaderProps) {\n const [mobileOpen, setMobileOpen] = React.useState(false);\n const [openMenu, setOpenMenu] = React.useState<string | null>(null);\n const pendingFocus = React.useRef<string | null>(null);\n const generatedId = React.useId();\n const menuId = `${generatedId}-menu`;\n const Link = linkComponent ?? 'a';\n\n const destination = (href: string) => linkDestination(href, linkHrefProp);\n\n // Escape and an outside pointer close the desktop panel. Focus movement\n // inside the item is handled by onBlur so tabbing through stays open.\n React.useEffect(() => {\n if (!openMenu) return;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpenMenu(null);\n };\n const onPointer = (event: PointerEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (!target.closest('[data-site-nav-item]')) setOpenMenu(null);\n };\n document.addEventListener('keydown', onKey);\n document.addEventListener('pointerdown', onPointer);\n return () => {\n document.removeEventListener('keydown', onKey);\n document.removeEventListener('pointerdown', onPointer);\n };\n }, [openMenu]);\n\n // ArrowDown opens the panel and asks for the first link to take focus, but\n // the panel is hidden until the state render lands, so focus one tick later.\n React.useEffect(() => {\n if (!openMenu || !pendingFocus.current) return;\n const panel = document.getElementById(pendingFocus.current);\n pendingFocus.current = null;\n panel?.querySelector<HTMLElement>('a[href]')?.focus();\n }, [openMenu]);\n\n const navLink = (item: SiteNavLink, extra?: 'mobile' | 'panel') => {\n const active = isActive(item.href, activeHref, match);\n return (\n <Link\n key={item.href}\n {...destination(item.href)}\n aria-current={active ? 'page' : undefined}\n {...(item.external ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n onClick={extra === 'mobile' ? () => setMobileOpen(false) : undefined}\n className={cn(\n 'rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n extra === 'mobile' &&\n 'block rounded-md px-3 py-2 text-base hover:bg-accent',\n extra === 'panel' && 'block rounded-md p-2 hover:bg-accent',\n !extra && 'text-sm hover:text-foreground',\n !extra && (active ? 'font-medium text-foreground' : 'text-muted-foreground')\n )}\n >\n {extra === 'panel' ? (\n <>\n <span className=\"block text-sm font-medium\">{item.label}</span>\n {item.description && (\n <span className=\"mt-0.5 block text-xs text-muted-foreground\">\n {item.description}\n </span>\n )}\n </>\n ) : (\n item.label\n )}\n </Link>\n );\n };\n\n const hasColumns = (item: SiteNavItem): item is SiteNavItem & { columns: SiteNavColumn[] } =>\n Array.isArray(item.columns) && item.columns.length > 0;\n\n return (\n <>\n <header\n className={cn(\n 'w-full border-b border-border bg-background/80 backdrop-blur supports-[backdrop-filter]:bg-background/60',\n sticky && 'sticky top-0 z-40',\n className\n )}\n {...props}\n >\n {topBar && (\n <div className=\"border-b border-border/60 text-muted-foreground\">\n <div className=\"mx-auto flex h-9 w-full max-w-7xl items-center justify-between gap-4 px-4 text-xs sm:px-6\">\n {topBar}\n </div>\n </div>\n )}\n <nav\n aria-label={navLabel}\n className={cn(\n 'mx-auto flex h-14 w-full max-w-7xl items-center justify-between gap-4 px-4 sm:px-6',\n navClassName\n )}\n >\n <div className=\"flex min-w-0 items-center gap-6\">\n <Link\n {...destination('/')}\n aria-label={brandLabel}\n className=\"flex shrink-0 items-center\"\n >\n {brand}\n </Link>\n <ul\n className={cn(\n 'hidden items-center gap-5',\n desktopBreakpoint === 'lg' ? 'lg:flex' : 'md:flex'\n )}\n >\n {items.map((item) => {\n if (!hasColumns(item)) {\n return <li key={item.href}>{navLink(item)}</li>;\n }\n const panelId = `${generatedId}-panel-${item.label.replace(/\\s+/g, '-').toLowerCase()}`;\n const open = openMenu === item.label;\n return (\n <li\n key={item.label}\n data-site-nav-item\n className=\"relative\"\n onMouseEnter={() => setOpenMenu(item.label)}\n onMouseLeave={() => setOpenMenu(null)}\n onBlur={(event) => {\n const next = event.relatedTarget as Node | null;\n if (!next || !event.currentTarget.contains(next)) {\n setOpenMenu(null);\n }\n }}\n >\n <button\n type=\"button\"\n aria-expanded={open}\n aria-controls={panelId}\n onClick={() => setOpenMenu(item.label)}\n onKeyDown={(event) => {\n if (event.key === 'Escape') {\n setOpenMenu(null);\n event.currentTarget.focus();\n }\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n pendingFocus.current = panelId;\n setOpenMenu(item.label);\n }\n }}\n className={cn(\n 'flex items-center gap-1 rounded-sm text-sm transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n isActive(item.href ?? '', activeHref, match)\n ? 'font-medium text-foreground'\n : 'text-muted-foreground'\n )}\n >\n {item.label}\n <Caret />\n </button>\n <div\n id={panelId}\n hidden={!open}\n className={cn(\n 'absolute left-0 top-full z-50 mt-2 grid gap-6 rounded-lg border border-border bg-popover p-5 shadow-lg',\n item.columns.length > 1 ? 'grid-cols-2' : 'grid-cols-1',\n 'min-w-[22rem]'\n )}\n >\n {item.columns.map((column, index) => (\n <div key={column.heading ?? index} className=\"min-w-40\">\n {column.heading && (\n <p className=\"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {column.heading}\n </p>\n )}\n <ul className=\"flex flex-col gap-0.5\">\n {column.items.map((link) => (\n <li key={`${column.heading ?? index}-${link.href}-${link.label}`}>\n {navLink(link, 'panel')}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n <div className=\"flex items-center gap-2\">\n {actions}\n {showMobileTrigger && (\n <button\n type=\"button\"\n onClick={() => setMobileOpen((open) => !open)}\n aria-label={mobileOpen ? mobileMenuCloseLabel : mobileMenuOpenLabel}\n aria-expanded={mobileOpen}\n aria-controls={menuId}\n aria-haspopup=\"dialog\"\n className={cn(\n 'rounded-md border border-border p-2 text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n desktopBreakpoint === 'lg' ? 'lg:hidden' : 'md:hidden'\n )}\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n className=\"h-5 w-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n >\n {mobileOpen ? (\n <path d=\"M6 6l12 12M18 6L6 18\" />\n ) : (\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n )}\n </svg>\n </button>\n )}\n </div>\n </nav>\n </header>\n {showMobileTrigger && (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n title={mobileLabel}\n closeLabel={mobileDrawerCloseLabel}\n side=\"right\"\n size=\"sm\"\n animate\n >\n <nav id={menuId} aria-label={mobileNavLabel} className=\"flex flex-col gap-1\">\n {items.map((item) =>\n hasColumns(item) ? (\n <details key={item.label} className=\"rounded-md\">\n <summary className=\"cursor-pointer rounded-md px-3 py-2 text-base font-medium hover:bg-accent\">\n {item.label}\n </summary>\n <div className=\"mt-1 flex flex-col gap-2 pb-2\">\n {item.columns.map((column, index) => (\n <div key={column.heading ?? index} className=\"px-3\">\n {column.heading && (\n <p className=\"mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {column.heading}\n </p>\n )}\n <ul className=\"flex flex-col gap-1\">\n {column.items.map((link) => (\n <li key={`${column.heading ?? index}-${link.href}-${link.label}`}>\n {navLink(link, 'mobile')}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </details>\n ) : (\n navLink(item, 'mobile')\n )\n )}\n </nav>\n {(mobileActions ?? actions) && (\n <div className=\"mt-4 border-t border-border pt-4\">{mobileActions ?? actions}</div>\n )}\n </Drawer>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8GM;AA5GN,YAAuB;AACvB,gBAAmB;AACnB,kBAAoD;AACpD,oBAAuB;AA8EvB,SAAS,SACP,UACA,YACA,OACS;AACT,MAAI,CAAC,WAAY,QAAO;AACxB,MAAI,aAAa,WAAY,QAAO;AACpC,MAAI,UAAU,QAAS,QAAO;AAE9B,SACE,eAAe,YACf,WAAW,WAAW,SAAS,SAAS,GAAG,IAAI,WAAW,GAAG,QAAQ,GAAG;AAE5E;AAEA,SAAS,QAAQ;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,SAAQ;AAAA,MACR,WAAU;AAAA,MACV,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MAEf,sDAAC,UAAK,GAAE,4BAA2B;AAAA;AAAA,EACrC;AAEJ;AAQO,SAAS,WAAW;AA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O;AAAA,0BACP,aAAY;AAAA,0BACZ,eAAc;AAAA,0BAEb,uBACC,4CAAC,UAAK,GAAE,wBAAuB,IAE/B,4CAAC,UAAK,GAAE,2BAA0B;AAAA;AAAA,sBAEtC;AAAA;AAAA,kBACF;AAAA,mBAEJ;AAAA;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IACF;AAAA,IACC,qBACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd,OAAO;AAAA,QACP,YAAY;AAAA,QACZ,MAAK;AAAA,QACL,MAAK;AAAA,QACL,SAAO;AAAA,QAEP;AAAA,sDAAC,SAAI,IAAI,QAAQ,cAAY,gBAAgB,WAAU,uBACpD,gBAAM;AAAA,YAAI,CAAC,SACV,WAAW,IAAI,IACb,6CAAC,aAAyB,WAAU,cAClC;AAAA,0DAAC,aAAQ,WAAU,6EAChB,eAAK,OACR;AAAA,cACA,4CAAC,SAAI,WAAU,iCACZ,eAAK,QAAQ,IAAI,CAAC,QAAQ,UACzB,6CAAC,SAAkC,WAAU,QAC1C;AAAA,uBAAO,WACN,4CAAC,OAAE,WAAU,0EACV,iBAAO,SACV;AAAA,gBAEF,4CAAC,QAAG,WAAU,uBACX,iBAAO,MAAM,IAAI,CAAC,SACjB,4CAAC,QACE,kBAAQ,MAAM,QAAQ,KADhB,GAAG,OAAO,WAAW,KAAK,IAAI,KAAK,IAAI,IAAI,KAAK,KAAK,EAE9D,CACD,GACH;AAAA,mBAZQ,OAAO,WAAW,KAa5B,CACD,GACH;AAAA,iBArBY,KAAK,KAsBnB,IAEA,QAAQ,MAAM,QAAQ;AAAA,UAE1B,GACF;AAAA,WACE,iBAAiB,YACjB,4CAAC,SAAI,WAAU,oCAAoC,2BAAiB,SAAQ;AAAA;AAAA;AAAA,IAEhF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/site-header/SiteHeader.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\nimport { Drawer } from '../drawer/Drawer';\n\n/** A single destination in the header or inside a mega panel. */\nexport type SiteNavLink = {\n href: string;\n label: string;\n /** Render with target=_blank + rel=noopener. */\n external?: boolean;\n /** Optional second line shown in a desktop mega panel. */\n description?: string;\n};\n\n/** One column inside a mega panel: a heading and its links. */\nexport type SiteNavColumn = {\n heading?: string;\n items: SiteNavLink[];\n};\n\nexport type SiteNavItem =\n | (SiteNavLink & { columns?: undefined })\n | {\n href?: string;\n label: string;\n external?: boolean;\n description?: string;\n /**\n * Nested navigation. Present items render as a disclosure trigger with\n * a desktop panel and a mobile <details> group instead of a link.\n */\n columns: SiteNavColumn[];\n };\n\nexport type SiteHeaderProps = React.HTMLAttributes<HTMLElement> & LinkLikeProps & {\n /** Brand slot - logo/lockup or wordmark. Wrapped in a link to \"/\". */\n brand: React.ReactNode;\n /**\n * Slim utility strip rendered above the brand row (locale switch, feed\n * link, submit link). Content is placed in a container matching the nav\n * metrics; lay out multiple items with justify-between or a flex row.\n */\n topBar?: React.ReactNode;\n /** Primary navigation items. */\n items: SiteNavItem[];\n /** Current route for active styling (aria-current=\"page\"). */\n activeHref?: string;\n /**\n * Active matching: 'prefix' highlights /docs when on /docs/installation\n * (default - marketing), 'exact' only the identical href (app chrome).\n */\n match?: 'prefix' | 'exact';\n /** Right-aligned actions (theme toggle, GitHub, CTA). */\n actions?: React.ReactNode;\n /** Actions rendered inside the mobile drawer; defaults to `actions`. */\n mobileActions?: React.ReactNode;\n /** Accessible name for the brand link (default \"Home\"). */\n brandLabel?: string;\n /** Accessible name for the desktop navigation landmark (default \"Main\"). */\n navLabel?: string;\n /** Accessible name for the mobile navigation landmark (default \"Mobile\"). */\n mobileNavLabel?: string;\n /** Pin to the top (default true). */\n sticky?: boolean;\n /** Title of the mobile navigation drawer. Default 'Menu'. */\n mobileLabel?: string;\n /** Accessible name for the mobile menu trigger when closed (default \"Open menu\"). */\n mobileMenuOpenLabel?: string;\n /** Accessible name for the mobile menu trigger when open (default \"Close menu\"). */\n mobileMenuCloseLabel?: string;\n /** Accessible name for the mobile drawer close button (default \"Close drawer\"). */\n mobileDrawerCloseLabel?: string;\n /** Render the built-in mobile trigger and drawer (default true). Set false when the host owns mobile navigation. */\n showMobileTrigger?: boolean;\n /** Breakpoint where the horizontal navigation appears (default 'md'). */\n desktopBreakpoint?: 'md' | 'lg';\n /** Extra classes for the inner nav row (height, padding). */\n navClassName?: string;\n};\n\nfunction isActive(\n itemHref: string,\n activeHref: string | undefined,\n match: 'prefix' | 'exact'\n): boolean {\n if (!activeHref) return false;\n if (itemHref === activeHref) return true;\n if (match === 'exact') return false;\n // Prefix match on path boundaries: /docs matches /docs/components, not /docsx.\n return (\n activeHref === itemHref ||\n activeHref.startsWith(itemHref.endsWith('/') ? itemHref : `${itemHref}/`)\n );\n}\n\nfunction Caret() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 12 12\"\n className=\"h-2.5 w-2.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m2.5 4.5 3.5 3.5 3.5-3.5\" />\n </svg>\n );\n}\n\n/**\n * Marketing/site header: sticky bar with brand, horizontal navigation with\n * prefix-aware active states, optional nested mega panels, right-aligned\n * actions and a mobile drawer. Router-agnostic through `linkComponent` +\n * `linkHrefProp`.\n */\nexport function SiteHeader({\n brand,\n topBar,\n items,\n activeHref,\n match = 'prefix',\n actions,\n mobileActions,\n linkComponent,\n linkHrefProp = 'href',\n brandLabel = 'Home',\n navLabel = 'Main',\n mobileNavLabel = 'Mobile',\n sticky = true,\n mobileLabel = 'Menu',\n mobileMenuOpenLabel = 'Open menu',\n mobileMenuCloseLabel = 'Close menu',\n mobileDrawerCloseLabel = 'Close drawer',\n showMobileTrigger = true,\n desktopBreakpoint = 'md',\n navClassName,\n className,\n ...props\n}: SiteHeaderProps) {\n const [mobileOpen, setMobileOpen] = React.useState(false);\n const [openMenu, setOpenMenu] = React.useState<string | null>(null);\n const pendingFocus = React.useRef<string | null>(null);\n const generatedId = React.useId();\n const menuId = `${generatedId}-menu`;\n const Link = linkComponent ?? 'a';\n\n const destination = (href: string) => linkDestination(href, linkHrefProp);\n\n // Escape and an outside pointer close the desktop panel. Focus movement\n // inside the item is handled by onBlur so tabbing through stays open.\n React.useEffect(() => {\n if (!openMenu) return;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpenMenu(null);\n };\n const onPointer = (event: PointerEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (!target.closest('[data-site-nav-item]')) setOpenMenu(null);\n };\n document.addEventListener('keydown', onKey);\n document.addEventListener('pointerdown', onPointer);\n return () => {\n document.removeEventListener('keydown', onKey);\n document.removeEventListener('pointerdown', onPointer);\n };\n }, [openMenu]);\n\n // ArrowDown opens the panel and asks for the first link to take focus, but\n // the panel is hidden until the state render lands, so focus one tick later.\n React.useEffect(() => {\n if (!openMenu || !pendingFocus.current) return;\n const panel = document.getElementById(pendingFocus.current);\n pendingFocus.current = null;\n panel?.querySelector<HTMLElement>('a[href]')?.focus();\n }, [openMenu]);\n\n const navLink = (item: SiteNavLink, extra?: 'mobile' | 'panel') => {\n const active = isActive(item.href, activeHref, match);\n return (\n <Link\n key={item.href}\n {...destination(item.href)}\n aria-current={active ? 'page' : undefined}\n {...(item.external ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n onClick={extra === 'mobile' ? () => setMobileOpen(false) : undefined}\n className={cn(\n 'rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n extra === 'mobile' &&\n 'block rounded-md px-3 py-2 text-base hover:bg-accent',\n extra === 'panel' && 'block rounded-md p-2 hover:bg-accent',\n !extra && 'text-sm hover:text-foreground',\n !extra && (active ? 'font-medium text-foreground' : 'text-muted-foreground')\n )}\n >\n {extra === 'panel' ? (\n <>\n <span className=\"block text-sm font-medium\">{item.label}</span>\n {item.description && (\n <span className=\"mt-0.5 block text-xs text-muted-foreground\">\n {item.description}\n </span>\n )}\n </>\n ) : (\n item.label\n )}\n </Link>\n );\n };\n\n const hasColumns = (item: SiteNavItem): item is SiteNavItem & { columns: SiteNavColumn[] } =>\n Array.isArray(item.columns) && item.columns.length > 0;\n\n /*\n * Panels are wider than their triggers, so a fixed left-0 anchor pushes\n * edge menus off-screen. On open we measure the panel and clamp its left\n * edge into the viewport; the inline style wins over the left-0 class.\n * Layout effect keeps the correction ahead of paint.\n */\n const alignPanel = React.useCallback((panel: HTMLElement) => {\n const item = panel.parentElement;\n if (!item) return;\n const itemRect = item.getBoundingClientRect();\n const width = panel.offsetWidth;\n const gutter = 8;\n const centered = itemRect.left + itemRect.width / 2 - width / 2;\n const left = Math.max(gutter, Math.min(centered, window.innerWidth - gutter - width));\n panel.style.left = `${left - itemRect.left}px`;\n panel.style.right = 'auto';\n }, []);\n\n const useIsoLayoutEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n\n useIsoLayoutEffect(() => {\n if (!openMenu) return;\n const panelId = `${generatedId}-panel-${openMenu.replace(/\\s+/g, '-').toLowerCase()}`;\n const panel = document.getElementById(panelId);\n if (panel) alignPanel(panel);\n }, [openMenu, generatedId, alignPanel]);\n\n return (\n <>\n <header\n className={cn(\n 'w-full border-b border-border bg-background/80 backdrop-blur supports-[backdrop-filter]:bg-background/60',\n sticky && 'sticky top-0 z-40',\n className\n )}\n {...props}\n >\n {topBar && (\n <div className=\"border-b border-border/60 text-muted-foreground\">\n <div className=\"mx-auto flex h-9 w-full max-w-7xl items-center justify-between gap-4 px-4 text-xs sm:px-6\">\n {topBar}\n </div>\n </div>\n )}\n <nav\n aria-label={navLabel}\n className={cn(\n 'mx-auto flex h-14 w-full max-w-7xl items-center justify-between gap-4 px-4 sm:px-6',\n navClassName\n )}\n >\n <div className=\"flex min-w-0 items-center gap-6\">\n <Link\n {...destination('/')}\n aria-label={brandLabel}\n className=\"flex shrink-0 items-center\"\n >\n {brand}\n </Link>\n <ul\n className={cn(\n 'hidden items-center gap-5',\n desktopBreakpoint === 'lg' ? 'lg:flex' : 'md:flex'\n )}\n >\n {items.map((item) => {\n if (!hasColumns(item)) {\n return <li key={item.href}>{navLink(item)}</li>;\n }\n const panelId = `${generatedId}-panel-${item.label.replace(/\\s+/g, '-').toLowerCase()}`;\n const open = openMenu === item.label;\n return (\n <li\n key={item.label}\n data-site-nav-item\n className=\"relative\"\n onMouseEnter={() => setOpenMenu(item.label)}\n onMouseLeave={() => setOpenMenu(null)}\n onBlur={(event) => {\n const next = event.relatedTarget as Node | null;\n if (!next || !event.currentTarget.contains(next)) {\n setOpenMenu(null);\n }\n }}\n >\n <button\n type=\"button\"\n aria-expanded={open}\n aria-controls={panelId}\n onClick={() => setOpenMenu(item.label)}\n onKeyDown={(event) => {\n if (event.key === 'Escape') {\n setOpenMenu(null);\n event.currentTarget.focus();\n }\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n pendingFocus.current = panelId;\n setOpenMenu(item.label);\n }\n }}\n className={cn(\n 'flex items-center gap-1 rounded-sm text-sm transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n isActive(item.href ?? '', activeHref, match)\n ? 'font-medium text-foreground'\n : 'text-muted-foreground'\n )}\n >\n {item.label}\n <Caret />\n </button>\n {/*\n * The pt-2 bridge keeps the pointer inside the <li> while\n * it travels from the trigger into the panel - a margin\n * gap would fire onMouseLeave and slam the menu shut.\n */}\n <div\n id={panelId}\n hidden={!open}\n className=\"absolute left-0 top-full z-50 pt-2\"\n >\n <div\n className={cn(\n 'grid gap-6 rounded-lg border border-border bg-popover p-5 shadow-lg',\n item.columns.length > 1 ? 'grid-cols-2' : 'grid-cols-1',\n item.columns.length > 1\n ? 'w-[38rem] max-w-[calc(100vw-2rem)]'\n : 'w-[22rem] max-w-[calc(100vw-2rem)]'\n )}\n >\n {item.columns.map((column, index) => (\n <div key={column.heading ?? index} className=\"min-w-40\">\n {column.heading && (\n <p className=\"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {column.heading}\n </p>\n )}\n <ul className=\"flex flex-col gap-0.5\">\n {column.items.map((link) => (\n <li key={`${column.heading ?? index}-${link.href}-${link.label}`}>\n {navLink(link, 'panel')}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n <div className=\"flex items-center gap-2\">\n {actions}\n {showMobileTrigger && (\n <button\n type=\"button\"\n onClick={() => setMobileOpen((open) => !open)}\n aria-label={mobileOpen ? mobileMenuCloseLabel : mobileMenuOpenLabel}\n aria-expanded={mobileOpen}\n aria-controls={menuId}\n aria-haspopup=\"dialog\"\n className={cn(\n 'rounded-md border border-border p-2 text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n desktopBreakpoint === 'lg' ? 'lg:hidden' : 'md:hidden'\n )}\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n className=\"h-5 w-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n >\n {mobileOpen ? (\n <path d=\"M6 6l12 12M18 6L6 18\" />\n ) : (\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n )}\n </svg>\n </button>\n )}\n </div>\n </nav>\n </header>\n {showMobileTrigger && (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n title={mobileLabel}\n closeLabel={mobileDrawerCloseLabel}\n side=\"right\"\n size=\"sm\"\n animate\n >\n <nav id={menuId} aria-label={mobileNavLabel} className=\"flex flex-col gap-1\">\n {items.map((item) =>\n hasColumns(item) ? (\n <details key={item.label} className=\"rounded-md\">\n <summary className=\"cursor-pointer rounded-md px-3 py-2 text-base font-medium hover:bg-accent\">\n {item.label}\n </summary>\n <div className=\"mt-1 flex flex-col gap-2 pb-2\">\n {item.columns.map((column, index) => (\n <div key={column.heading ?? index} className=\"px-3\">\n {column.heading && (\n <p className=\"mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {column.heading}\n </p>\n )}\n <ul className=\"flex flex-col gap-1\">\n {column.items.map((link) => (\n <li key={`${column.heading ?? index}-${link.href}-${link.label}`}>\n {navLink(link, 'mobile')}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </details>\n ) : (\n navLink(item, 'mobile')\n )\n )}\n </nav>\n {(mobileActions ?? actions) && (\n <div className=\"mt-4 border-t border-border pt-4\">{mobileActions ?? actions}</div>\n )}\n </Drawer>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8GM;AA5GN,YAAuB;AACvB,gBAAmB;AACnB,kBAAoD;AACpD,oBAAuB;AA8EvB,SAAS,SACP,UACA,YACA,OACS;AACT,MAAI,CAAC,WAAY,QAAO;AACxB,MAAI,aAAa,WAAY,QAAO;AACpC,MAAI,UAAU,QAAS,QAAO;AAE9B,SACE,eAAe,YACf,WAAW,WAAW,SAAS,SAAS,GAAG,IAAI,WAAW,GAAG,QAAQ,GAAG;AAE5E;AAEA,SAAS,QAAQ;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,SAAQ;AAAA,MACR,WAAU;AAAA,MACV,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MAEf,sDAAC,UAAK,GAAE,4BAA2B;AAAA;AAAA,EACrC;AAEJ;AAQO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,aAAa;AAAA,EACb,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,cAAc;AA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