@thewhatmatters/wmds 0.4.37 → 0.4.39
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 +21 -0
- package/dist/components/organisms/AppShell/AppShell.d.ts +6 -3
- package/dist/components/organisms/AppShell/AppShell.d.ts.map +1 -1
- package/dist/components/organisms/AppShell/AppShell.js +183 -152
- package/dist/styles.css +1 -1
- package/docs/components.md +1 -1
- package/docs/exports.json +1 -1
- 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-above.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-errorsummary--contact-form.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 +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-herointro--with-actions.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 +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 +1 -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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +1 -1
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +1 -1
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/guides-resource-detail--detail.tsx +1 -1
- package/docs/patterns/index.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ Every release of `@thewhatmatters/wmds` is listed here, newest first.
|
|
|
7
7
|
- **Pasted patterns:** when a release changes a **Pattern — …** story's Show code, it is named under Consumer actions so apps re-copy it.
|
|
8
8
|
- **How to add an entry** (contributors): add your change to the top entry. If that version is already on npm (`npm view @thewhatmatters/wmds versions`), start a new entry above it and bump `version` in `package.json` to match. `npm run check:changelog` enforces the format.
|
|
9
9
|
|
|
10
|
+
## 0.4.39
|
|
11
|
+
|
|
12
|
+
**AppShell: the phone page picker's chevron is a plain glyph.**
|
|
13
|
+
|
|
14
|
+
- **AppShell** `menuButton="picker"`: the chevron after the page name was a filled square (Button `endIcon`, which is a menu trigger's square); it's a plain muted chevron now.
|
|
15
|
+
|
|
16
|
+
### Consumer actions
|
|
17
|
+
|
|
18
|
+
- None.
|
|
19
|
+
|
|
20
|
+
## 0.4.38
|
|
21
|
+
|
|
22
|
+
**AppShell: a page picker on the phone menu button.**
|
|
23
|
+
|
|
24
|
+
- **AppShell** `menuButton="picker"` (new): below `lg` the menu button shows the icon, the current page (`title`, truncating) and a chevron, standing in for the title, so a long page name isn't cut to one word ("Hero — Feature Center ▾"). Its name is `labels.menu: title`. The `h1` stays in the page for screen readers and is visible from `lg`.
|
|
25
|
+
- Story **AppShell → State — phone, page picker**, with an interaction test.
|
|
26
|
+
|
|
27
|
+
### Consumer actions
|
|
28
|
+
|
|
29
|
+
- None.
|
|
30
|
+
|
|
10
31
|
## 0.4.37
|
|
11
32
|
|
|
12
33
|
**AppShell: a docked aside you can use while watching the page, a labelled phone menu button, and titles that end in an ellipsis.**
|
|
@@ -15,7 +15,7 @@ export interface AppShellLabels {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const appShellAsideModes: readonly ["overlay", "docked"];
|
|
17
17
|
export type AppShellAsideMode = (typeof appShellAsideModes)[number];
|
|
18
|
-
export declare const appShellMenuButtons: readonly ["icon", "label"];
|
|
18
|
+
export declare const appShellMenuButtons: readonly ["icon", "label", "picker"];
|
|
19
19
|
export type AppShellMenuButton = (typeof appShellMenuButtons)[number];
|
|
20
20
|
export interface AppShellProps {
|
|
21
21
|
/** Page title — the `h1` in the title bar. */
|
|
@@ -49,8 +49,11 @@ export interface AppShellProps {
|
|
|
49
49
|
onAsideOpenChange?: (open: boolean) => void;
|
|
50
50
|
labels?: Partial<AppShellLabels>;
|
|
51
51
|
/**
|
|
52
|
-
* The phone menu button (below `lg`): `icon` (default)
|
|
53
|
-
* text ("Patterns"), when the glyph alone wouldn't say what the menu holds
|
|
52
|
+
* The phone menu button (below `lg`): `icon` (default); `label`, the icon plus `labels.menu` as visible
|
|
53
|
+
* text ("Patterns"), when the glyph alone wouldn't say what the menu holds; or `picker`, the icon plus the
|
|
54
|
+
* current page (`title`) and a chevron, standing in for the title on phones, when the menu is a list of
|
|
55
|
+
* pages and the button should say which one you're on ("Hero — Feature Center ▾"). With `picker` the
|
|
56
|
+
* `h1` stays in the page for screen readers but is only visible from `lg`.
|
|
54
57
|
*/
|
|
55
58
|
menuButton?: AppShellMenuButton;
|
|
56
59
|
/** Page content. **AppShell.Brand**, **Sidebar**, **Header**, and **Aside** children fill their slots instead. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/AppShell/AppShell.tsx"],"names":[],"mappings":"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"}
|
|
@@ -4,260 +4,291 @@ import { Button as t } from "../../atoms/Button/Button.js";
|
|
|
4
4
|
import { IconButton as n } from "../../atoms/IconButton/IconButton.js";
|
|
5
5
|
import { Kbd as r } from "../../atoms/Kbd/Kbd.js";
|
|
6
6
|
import { Tooltip as i } from "../../atoms/Tooltip/Tooltip.js";
|
|
7
|
-
import {
|
|
7
|
+
import { pageHeaderTitleClasses as ee } from "../../molecules/PageHeader/pageHeaderStyles.js";
|
|
8
|
+
import { PageHeader as a } from "../../molecules/PageHeader/PageHeader.js";
|
|
8
9
|
import { overlayPanelBodyScrollClasses as te, overlayPanelSectionStackClasses as ne } from "../Dialog/dialogStyles.js";
|
|
9
10
|
import { OverlayPanelHeader as re } from "../Dialog/OverlayPanelHeader.js";
|
|
10
11
|
import { Panel as ie } from "../Panel/Panel.js";
|
|
11
12
|
import { Sheet as ae } from "../Sheet/Sheet.js";
|
|
12
|
-
import { appShellAsideDockedClasses as oe, appShellBrandClasses as se, appShellCanvasClasses as ce, appShellMainClasses as le, appShellRootClasses as ue, appShellSheetBodyClasses as de, appShellSidebarBodyClasses as
|
|
13
|
-
import { Children as
|
|
14
|
-
import { PanelLeft as
|
|
15
|
-
import { Fragment as
|
|
13
|
+
import { appShellAsideDockedClasses as oe, appShellBrandClasses as se, appShellCanvasClasses as ce, appShellMainClasses as le, appShellRootClasses as ue, appShellSheetBodyClasses as de, appShellSidebarBodyClasses as o, appShellSidebarClasses as fe, appShellSidebarFooterClasses as pe, appShellSkipLinkClasses as me, appShellSurfaceClasses as he, appShellToggleDesktopClasses as ge, appShellToggleMobileClasses as s } from "./appShellStyles.js";
|
|
14
|
+
import { Children as c, createContext as _e, isValidElement as ve, useCallback as l, useContext as ye, useEffect as u, useId as be, useMemo as xe, useRef as d, useState as f } from "react";
|
|
15
|
+
import { ChevronDown as Se, PanelLeft as p } from "lucide-react";
|
|
16
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
16
17
|
//#region src/components/organisms/AppShell/AppShell.tsx
|
|
17
|
-
var
|
|
18
|
+
var Ce = {
|
|
18
19
|
collapse: "Collapse sidebar",
|
|
19
20
|
expand: "Expand sidebar",
|
|
20
21
|
menu: "Menu",
|
|
21
22
|
aside: "Details",
|
|
22
23
|
skipToContent: "Skip to content"
|
|
23
|
-
},
|
|
24
|
+
}, _ = ["overlay", "docked"], v = [
|
|
25
|
+
"icon",
|
|
26
|
+
"label",
|
|
27
|
+
"picker"
|
|
28
|
+
];
|
|
29
|
+
function y({ children: e }) {
|
|
30
|
+
return /* @__PURE__ */ h(m, { children: e });
|
|
31
|
+
}
|
|
32
|
+
function b({ children: e }) {
|
|
33
|
+
return /* @__PURE__ */ h(m, { children: e });
|
|
34
|
+
}
|
|
24
35
|
function x({ children: e }) {
|
|
25
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ h(m, { children: e });
|
|
26
37
|
}
|
|
27
38
|
function S({ children: e }) {
|
|
28
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ h(m, { children: e });
|
|
29
40
|
}
|
|
30
41
|
function C({ children: e }) {
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
}
|
|
33
|
-
function w({ children: e }) {
|
|
34
|
-
return /* @__PURE__ */ _(g, { children: e });
|
|
42
|
+
return /* @__PURE__ */ h(m, { children: e });
|
|
35
43
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var E = c(null);
|
|
40
|
-
function D() {
|
|
41
|
-
let e = d(E);
|
|
44
|
+
var w = _e(null);
|
|
45
|
+
function T() {
|
|
46
|
+
let e = ye(w);
|
|
42
47
|
if (e == null) throw Error("useAppShell must be used inside <AppShell>.");
|
|
43
48
|
return e;
|
|
44
49
|
}
|
|
45
|
-
function
|
|
46
|
-
let [r, i] =
|
|
47
|
-
return [e ?? r,
|
|
50
|
+
function E(e, t, n) {
|
|
51
|
+
let [r, i] = f(t);
|
|
52
|
+
return [e ?? r, l((t) => {
|
|
48
53
|
e ?? i(t), n?.(t);
|
|
49
54
|
}, [e, n])];
|
|
50
55
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
56
|
+
var D = "(min-width: 1024px)";
|
|
57
|
+
function we(e) {
|
|
53
58
|
return e instanceof HTMLElement && e.isContentEditable;
|
|
54
59
|
}
|
|
55
|
-
function
|
|
60
|
+
function Te(e) {
|
|
56
61
|
let t = { content: [] };
|
|
57
|
-
return
|
|
58
|
-
if (!
|
|
62
|
+
return c.forEach(e, (e) => {
|
|
63
|
+
if (!ve(e)) {
|
|
59
64
|
e != null && e !== !1 && t.content.push(e);
|
|
60
65
|
return;
|
|
61
66
|
}
|
|
62
|
-
e.type ===
|
|
67
|
+
e.type === y ? t.brand = e.props.children : e.type === b ? t.sidebar = e.props.children : e.type === x ? t.sidebarFooter = e.props.children : e.type === S ? t.header = e.props.children : e.type === C ? t.aside = e.props : t.content.push(e);
|
|
63
68
|
}), t;
|
|
64
69
|
}
|
|
65
|
-
function
|
|
66
|
-
let
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
-
},
|
|
70
|
-
!e &&
|
|
71
|
-
}, [
|
|
72
|
-
window.matchMedia(
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
let e = window.matchMedia(
|
|
76
|
-
|
|
70
|
+
function O({ title: c, brand: _e, sidebar: ve, sidebarFooter: ye, header: _, aside: v, asideTitle: y, asideDescription: b, sidebarOpen: x, defaultSidebarOpen: S = !0, onSidebarOpenChange: C, asideOpen: T, defaultAsideOpen: O = !1, onAsideOpenChange: k, asideMode: Ee = "overlay", menuButton: A = "icon", labels: De, children: Oe, className: ke }) {
|
|
71
|
+
let j = {
|
|
72
|
+
...Ce,
|
|
73
|
+
...De
|
|
74
|
+
}, M = Te(Oe), N = _e ?? M.brand, P = ve ?? M.sidebar, F = ye ?? M.sidebarFooter, I = _ ?? M.header, L = v ?? M.aside?.children, R = P != null, z = L != null, [B, Ae] = E(x, S, C), [V, H] = E(T, O, k), [U, W] = f(!1), [je, G] = f(!1), K = be(), Me = d(null), Ne = d(null), q = l((e) => {
|
|
75
|
+
!e && Me.current?.contains(document.activeElement) && Ne.current?.focus(), Ae(e);
|
|
76
|
+
}, [Ae]), J = l(() => {
|
|
77
|
+
window.matchMedia(D).matches ? q(!B) : W((e) => !e);
|
|
78
|
+
}, [q, B]);
|
|
79
|
+
u(() => {
|
|
80
|
+
let e = window.matchMedia(D);
|
|
81
|
+
G(e.matches);
|
|
77
82
|
function t(e) {
|
|
78
|
-
|
|
83
|
+
G(e.matches), e.matches && W(!1);
|
|
79
84
|
}
|
|
80
85
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
81
|
-
}, []),
|
|
86
|
+
}, []), u(() => {
|
|
82
87
|
if (!R) return;
|
|
83
88
|
function e(e) {
|
|
84
|
-
e.defaultPrevented || e.altKey || e.shiftKey || !(e.metaKey || e.ctrlKey) || e.key.toLowerCase() !== "b" ||
|
|
89
|
+
e.defaultPrevented || e.altKey || e.shiftKey || !(e.metaKey || e.ctrlKey) || e.key.toLowerCase() !== "b" || we(e.target) || (e.preventDefault(), J());
|
|
85
90
|
}
|
|
86
91
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
87
|
-
}, [R,
|
|
88
|
-
let
|
|
92
|
+
}, [R, J]);
|
|
93
|
+
let Pe = xe(() => ({
|
|
89
94
|
sidebarOpen: B,
|
|
90
|
-
setSidebarOpen:
|
|
91
|
-
menuOpen:
|
|
92
|
-
setMenuOpen:
|
|
93
|
-
asideOpen:
|
|
94
|
-
setAsideOpen:
|
|
95
|
-
toggleSidebar:
|
|
95
|
+
setSidebarOpen: q,
|
|
96
|
+
menuOpen: U,
|
|
97
|
+
setMenuOpen: W,
|
|
98
|
+
asideOpen: V,
|
|
99
|
+
setAsideOpen: H,
|
|
100
|
+
toggleSidebar: J
|
|
96
101
|
}), [
|
|
97
|
-
|
|
98
|
-
W,
|
|
102
|
+
V,
|
|
99
103
|
U,
|
|
100
|
-
|
|
104
|
+
H,
|
|
105
|
+
q,
|
|
101
106
|
B,
|
|
102
|
-
|
|
107
|
+
J
|
|
103
108
|
]);
|
|
104
|
-
function
|
|
105
|
-
e.target.closest("nav a[href], nav button") != null &&
|
|
109
|
+
function Fe(e) {
|
|
110
|
+
e.target.closest("nav a[href], nav button") != null && W(!1);
|
|
106
111
|
}
|
|
107
|
-
let
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, [
|
|
111
|
-
function
|
|
112
|
-
let e =
|
|
113
|
-
|
|
112
|
+
let Y = z && Ee === "docked" && je, X = `${K}-aside`, Ie = d(null), Z = d(null);
|
|
113
|
+
u(() => {
|
|
114
|
+
Y && (V ? Z.current = document.activeElement : Z.current = null);
|
|
115
|
+
}, [V, Y]);
|
|
116
|
+
function Le() {
|
|
117
|
+
let e = Z.current, t = Ie.current?.contains(document.activeElement) ?? !1;
|
|
118
|
+
H(!1), t && (e?.isConnected ? e.focus() : document.getElementById(`${K}-main`)?.focus());
|
|
114
119
|
}
|
|
115
|
-
let
|
|
120
|
+
let Re = B ? j.collapse : j.expand, Q = `${K}-main`, ze = N == null ? null : /* @__PURE__ */ h("div", {
|
|
116
121
|
className: se,
|
|
117
|
-
children:
|
|
118
|
-
}),
|
|
122
|
+
children: N
|
|
123
|
+
}), Be = F == null ? null : /* @__PURE__ */ h("div", {
|
|
119
124
|
className: pe,
|
|
120
|
-
children:
|
|
121
|
-
}),
|
|
122
|
-
ref:
|
|
125
|
+
children: F
|
|
126
|
+
}), $ = R ? /* @__PURE__ */ g(i.Provider, { children: [/* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(i.Trigger, { render: /* @__PURE__ */ h(n, {
|
|
127
|
+
ref: Ne,
|
|
123
128
|
role: "ghost",
|
|
124
129
|
size: "sm",
|
|
125
130
|
title: "",
|
|
126
|
-
icon: /* @__PURE__ */
|
|
127
|
-
"aria-label":
|
|
131
|
+
icon: /* @__PURE__ */ h(p, { strokeWidth: 2 }),
|
|
132
|
+
"aria-label": Re,
|
|
128
133
|
"aria-expanded": B,
|
|
129
134
|
"aria-controls": K,
|
|
130
135
|
"aria-keyshortcuts": "Control+B Meta+B",
|
|
131
136
|
className: ge,
|
|
132
|
-
onClick: () =>
|
|
133
|
-
}) }), /* @__PURE__ */
|
|
137
|
+
onClick: () => q(!B)
|
|
138
|
+
}) }), /* @__PURE__ */ h(i.Content, { children: /* @__PURE__ */ g("span", {
|
|
134
139
|
className: "inline-flex items-center gap-2",
|
|
135
140
|
children: [
|
|
136
|
-
|
|
137
|
-
/* @__PURE__ */
|
|
141
|
+
Re,
|
|
142
|
+
/* @__PURE__ */ h(r, {
|
|
138
143
|
size: "sm",
|
|
139
144
|
children: "Ctrl"
|
|
140
145
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ h(r, {
|
|
142
147
|
size: "sm",
|
|
143
148
|
children: "B"
|
|
144
149
|
})
|
|
145
150
|
]
|
|
146
|
-
}) })] }),
|
|
151
|
+
}) })] }), A === "picker" ? /* @__PURE__ */ g(t, {
|
|
147
152
|
role: "ghost",
|
|
148
153
|
size: "sm",
|
|
149
|
-
icon: /* @__PURE__ */
|
|
150
|
-
"aria-
|
|
154
|
+
icon: /* @__PURE__ */ h(p, { strokeWidth: 2 }),
|
|
155
|
+
"aria-label": `${j.menu}: ${c}`,
|
|
156
|
+
"aria-expanded": U,
|
|
151
157
|
"aria-haspopup": "dialog",
|
|
152
158
|
"aria-keyshortcuts": "Control+B Meta+B",
|
|
153
|
-
className: e(
|
|
154
|
-
onClick: () =>
|
|
155
|
-
children:
|
|
156
|
-
|
|
159
|
+
className: e(s, "min-w-0 max-w-full"),
|
|
160
|
+
onClick: () => W(!0),
|
|
161
|
+
children: [/* @__PURE__ */ h("span", {
|
|
162
|
+
className: "min-w-0 truncate",
|
|
163
|
+
children: c
|
|
164
|
+
}), /* @__PURE__ */ h(Se, {
|
|
165
|
+
strokeWidth: 2,
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
className: "size-4 shrink-0 text-muted"
|
|
168
|
+
})]
|
|
169
|
+
}) : A === "label" ? /* @__PURE__ */ h(t, {
|
|
157
170
|
role: "ghost",
|
|
158
171
|
size: "sm",
|
|
159
|
-
icon: /* @__PURE__ */
|
|
160
|
-
"aria-
|
|
161
|
-
"aria-expanded": W,
|
|
172
|
+
icon: /* @__PURE__ */ h(p, { strokeWidth: 2 }),
|
|
173
|
+
"aria-expanded": U,
|
|
162
174
|
"aria-haspopup": "dialog",
|
|
163
175
|
"aria-keyshortcuts": "Control+B Meta+B",
|
|
164
|
-
className:
|
|
165
|
-
onClick: () =>
|
|
176
|
+
className: e(s, "shrink-0"),
|
|
177
|
+
onClick: () => W(!0),
|
|
178
|
+
children: j.menu
|
|
179
|
+
}) : /* @__PURE__ */ h(n, {
|
|
180
|
+
role: "ghost",
|
|
181
|
+
size: "sm",
|
|
182
|
+
icon: /* @__PURE__ */ h(p, { strokeWidth: 2 }),
|
|
183
|
+
"aria-label": j.menu,
|
|
184
|
+
"aria-expanded": U,
|
|
185
|
+
"aria-haspopup": "dialog",
|
|
186
|
+
"aria-keyshortcuts": "Control+B Meta+B",
|
|
187
|
+
className: s,
|
|
188
|
+
onClick: () => W(!0)
|
|
166
189
|
})] }) : null;
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
-
value:
|
|
169
|
-
children: /* @__PURE__ */
|
|
170
|
-
className: e(ue,
|
|
190
|
+
return /* @__PURE__ */ h(w.Provider, {
|
|
191
|
+
value: Pe,
|
|
192
|
+
children: /* @__PURE__ */ g("div", {
|
|
193
|
+
className: e(ue, ke),
|
|
171
194
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
href: `#${
|
|
195
|
+
/* @__PURE__ */ h("a", {
|
|
196
|
+
href: `#${Q}`,
|
|
174
197
|
className: me,
|
|
175
198
|
onClick: (e) => {
|
|
176
|
-
e.preventDefault(), document.getElementById(
|
|
199
|
+
e.preventDefault(), document.getElementById(Q)?.focus();
|
|
177
200
|
},
|
|
178
|
-
children:
|
|
201
|
+
children: j.skipToContent
|
|
179
202
|
}),
|
|
180
|
-
R ? /* @__PURE__ */
|
|
181
|
-
ref:
|
|
203
|
+
R ? /* @__PURE__ */ g("div", {
|
|
204
|
+
ref: Me,
|
|
182
205
|
id: K,
|
|
183
206
|
className: e(fe, !B && "lg:!hidden"),
|
|
184
207
|
children: [
|
|
185
|
-
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
className:
|
|
188
|
-
children:
|
|
208
|
+
ze,
|
|
209
|
+
/* @__PURE__ */ h("div", {
|
|
210
|
+
className: o,
|
|
211
|
+
children: P
|
|
189
212
|
}),
|
|
190
|
-
|
|
213
|
+
Be
|
|
191
214
|
]
|
|
192
215
|
}) : null,
|
|
193
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ g("div", {
|
|
194
217
|
className: ce,
|
|
195
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ g("div", {
|
|
196
219
|
className: he,
|
|
197
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [A === "picker" ? /* @__PURE__ */ h(a, {
|
|
221
|
+
variant: "app",
|
|
222
|
+
"aria-label": c,
|
|
223
|
+
start: /* @__PURE__ */ g(m, { children: [$, /* @__PURE__ */ h("h1", {
|
|
224
|
+
className: e(ee.app, "max-lg:sr-only"),
|
|
225
|
+
children: c
|
|
226
|
+
})] }),
|
|
227
|
+
end: I
|
|
228
|
+
}) : /* @__PURE__ */ h(a, {
|
|
198
229
|
variant: "app",
|
|
199
|
-
title:
|
|
200
|
-
"aria-label":
|
|
201
|
-
start:
|
|
202
|
-
end:
|
|
203
|
-
}), /* @__PURE__ */
|
|
204
|
-
id:
|
|
230
|
+
title: c,
|
|
231
|
+
"aria-label": c,
|
|
232
|
+
start: $,
|
|
233
|
+
end: I
|
|
234
|
+
}), /* @__PURE__ */ h("main", {
|
|
235
|
+
id: Q,
|
|
205
236
|
tabIndex: -1,
|
|
206
237
|
className: le,
|
|
207
|
-
children:
|
|
238
|
+
children: M.content
|
|
208
239
|
})]
|
|
209
|
-
}),
|
|
210
|
-
ref:
|
|
211
|
-
id:
|
|
212
|
-
"aria-labelledby": `${
|
|
240
|
+
}), Y && V ? /* @__PURE__ */ h("aside", {
|
|
241
|
+
ref: Ie,
|
|
242
|
+
id: X,
|
|
243
|
+
"aria-labelledby": `${X}-title`,
|
|
213
244
|
className: oe,
|
|
214
245
|
onKeyDown: (e) => {
|
|
215
|
-
e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(),
|
|
246
|
+
e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), Le());
|
|
216
247
|
},
|
|
217
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ g("div", {
|
|
218
249
|
className: ne,
|
|
219
|
-
children: [/* @__PURE__ */
|
|
220
|
-
titleId: `${
|
|
221
|
-
descriptionId: `${
|
|
222
|
-
title:
|
|
223
|
-
description:
|
|
250
|
+
children: [/* @__PURE__ */ h(re, {
|
|
251
|
+
titleId: `${X}-title`,
|
|
252
|
+
descriptionId: `${X}-description`,
|
|
253
|
+
title: y ?? M.aside?.title ?? j.aside,
|
|
254
|
+
description: b ?? M.aside?.description,
|
|
224
255
|
closeLabel: "Close panel",
|
|
225
|
-
onClose:
|
|
256
|
+
onClose: Le,
|
|
226
257
|
delineated: !0
|
|
227
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ h("div", {
|
|
228
259
|
className: e(te, "pb-4"),
|
|
229
260
|
children: L
|
|
230
261
|
})]
|
|
231
262
|
})
|
|
232
263
|
}) : null]
|
|
233
264
|
}),
|
|
234
|
-
R ? /* @__PURE__ */
|
|
235
|
-
open:
|
|
236
|
-
onOpenChange:
|
|
237
|
-
children: /* @__PURE__ */
|
|
265
|
+
R ? /* @__PURE__ */ h(ae, {
|
|
266
|
+
open: U,
|
|
267
|
+
onOpenChange: W,
|
|
268
|
+
children: /* @__PURE__ */ h(ae.Content, {
|
|
238
269
|
side: "start",
|
|
239
|
-
title:
|
|
240
|
-
children: /* @__PURE__ */
|
|
270
|
+
title: j.menu,
|
|
271
|
+
children: /* @__PURE__ */ g("div", {
|
|
241
272
|
className: de,
|
|
242
|
-
onClick:
|
|
273
|
+
onClick: Fe,
|
|
243
274
|
children: [
|
|
244
|
-
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
className:
|
|
247
|
-
children:
|
|
275
|
+
ze,
|
|
276
|
+
/* @__PURE__ */ h("div", {
|
|
277
|
+
className: o,
|
|
278
|
+
children: P
|
|
248
279
|
}),
|
|
249
|
-
|
|
280
|
+
Be
|
|
250
281
|
]
|
|
251
282
|
})
|
|
252
283
|
})
|
|
253
284
|
}) : null,
|
|
254
|
-
z && !
|
|
255
|
-
open:
|
|
256
|
-
onOpenChange:
|
|
257
|
-
children: /* @__PURE__ */
|
|
285
|
+
z && !Y ? /* @__PURE__ */ h(ie, {
|
|
286
|
+
open: V,
|
|
287
|
+
onOpenChange: H,
|
|
288
|
+
children: /* @__PURE__ */ h(ie.Content, {
|
|
258
289
|
side: "end",
|
|
259
|
-
title:
|
|
260
|
-
description:
|
|
290
|
+
title: y ?? M.aside?.title ?? j.aside,
|
|
291
|
+
description: b ?? M.aside?.description,
|
|
261
292
|
children: L
|
|
262
293
|
})
|
|
263
294
|
}) : null
|
|
@@ -265,12 +296,12 @@ function A({ title: s, brand: c, sidebar: l, sidebarFooter: d, header: g, aside:
|
|
|
265
296
|
})
|
|
266
297
|
});
|
|
267
298
|
}
|
|
268
|
-
var
|
|
269
|
-
Brand:
|
|
270
|
-
Sidebar:
|
|
271
|
-
SidebarFooter:
|
|
272
|
-
Header:
|
|
273
|
-
Aside:
|
|
299
|
+
var k = Object.assign(O, {
|
|
300
|
+
Brand: y,
|
|
301
|
+
Sidebar: b,
|
|
302
|
+
SidebarFooter: x,
|
|
303
|
+
Header: S,
|
|
304
|
+
Aside: C
|
|
274
305
|
});
|
|
275
306
|
//#endregion
|
|
276
|
-
export {
|
|
307
|
+
export { k as AppShell, _ as appShellAsideModes, v as appShellMenuButtons, T as useAppShell };
|