basalt-ui 1.30.2 → 1.31.0
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/AGENTS.md +1 -1
- package/CHANGELOG.md +31 -0
- package/MIGRATING.md +172 -12
- package/agent/rules/basalt-controls.md +19 -19
- package/agent/rules/basalt-mantine.md +1 -1
- package/configs/oxlint-plugin.js +254 -4
- package/configs/oxlint-plugin.test.ts +145 -2
- package/configs/oxlint.json +2 -1
- package/dist/agent-chat/composer.d.ts.map +1 -1
- package/dist/agent-chat/composer.js +41 -43
- package/dist/agent-chat/thread-workspace.d.ts +2 -2
- package/dist/agent-chat/thread-workspace.d.ts.map +1 -1
- package/dist/agent-chat/thread-workspace.js +3 -4
- package/dist/agent-chat/use-keyboard-inset.d.ts +2 -0
- package/dist/agent-chat/use-keyboard-inset.d.ts.map +1 -0
- package/dist/agent-chat/use-keyboard-inset.js +34 -0
- package/dist/charts/cursor/touch-pin.d.ts +45 -0
- package/dist/charts/cursor/touch-pin.d.ts.map +1 -0
- package/dist/charts/cursor/touch-pin.js +79 -0
- package/dist/charts/hooks/use-discrete-cursor.d.ts +66 -0
- package/dist/charts/hooks/use-discrete-cursor.d.ts.map +1 -0
- package/dist/charts/hooks/use-discrete-cursor.js +198 -0
- package/dist/charts/hooks/use-hysteresis.d.ts +18 -0
- package/dist/charts/hooks/use-hysteresis.d.ts.map +1 -0
- package/dist/charts/hooks/use-hysteresis.js +12 -0
- package/dist/charts/hooks/useBandPlot.d.ts +7 -0
- package/dist/charts/hooks/useBandPlot.d.ts.map +1 -1
- package/dist/charts/hooks/useBandPlot.js +62 -18
- package/dist/charts/hooks/useChartCursor.d.ts +40 -11
- package/dist/charts/hooks/useChartCursor.d.ts.map +1 -1
- package/dist/charts/hooks/useChartCursor.js +102 -11
- package/dist/charts/index.d.ts +0 -1
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +0 -10
- package/dist/charts/kinds/BandStrip.d.ts.map +1 -1
- package/dist/charts/kinds/BandStrip.js +54 -41
- package/dist/charts/kinds/Donut.d.ts +9 -3
- package/dist/charts/kinds/Donut.d.ts.map +1 -1
- package/dist/charts/kinds/Donut.js +110 -48
- package/dist/charts/kinds/DualPanel.d.ts.map +1 -1
- package/dist/charts/kinds/DualPanel.js +145 -131
- package/dist/charts/kinds/Heatmap.d.ts +7 -0
- package/dist/charts/kinds/Heatmap.d.ts.map +1 -1
- package/dist/charts/kinds/Heatmap.js +37 -16
- package/dist/charts/kinds/MirroredBars.d.ts.map +1 -1
- package/dist/charts/kinds/MirroredBars.js +83 -68
- package/dist/charts/kinds/donut-layout.d.ts +47 -0
- package/dist/charts/kinds/donut-layout.d.ts.map +1 -0
- package/dist/charts/kinds/donut-layout.js +52 -0
- package/dist/charts/layout/auto-margin.d.ts +7 -2
- package/dist/charts/layout/auto-margin.d.ts.map +1 -1
- package/dist/charts/layout/auto-margin.js +12 -3
- package/dist/charts/layout/end-labels.d.ts +64 -0
- package/dist/charts/layout/end-labels.d.ts.map +1 -0
- package/dist/charts/layout/end-labels.js +76 -0
- package/dist/charts/primitives/Axes.d.ts +32 -4
- package/dist/charts/primitives/Axes.d.ts.map +1 -1
- package/dist/charts/primitives/Axes.js +62 -16
- package/dist/charts/primitives/CartesianChart.d.ts +7 -6
- package/dist/charts/primitives/CartesianChart.d.ts.map +1 -1
- package/dist/charts/primitives/CartesianChart.js +271 -125
- package/dist/charts/primitives/ChartCard.d.ts +0 -14
- package/dist/charts/primitives/ChartCard.d.ts.map +1 -1
- package/dist/charts/primitives/ChartCard.js +74 -21
- package/dist/charts/primitives/ChartFrame.d.ts +28 -22
- package/dist/charts/primitives/ChartFrame.d.ts.map +1 -1
- package/dist/charts/primitives/ChartFrame.js +133 -34
- package/dist/charts/primitives/ChartLegend.d.ts +19 -15
- package/dist/charts/primitives/ChartLegend.d.ts.map +1 -1
- package/dist/charts/primitives/ChartLegend.js +212 -71
- package/dist/charts/primitives/ChartTooltip.d.ts.map +1 -1
- package/dist/charts/primitives/ChartTooltip.js +4 -3
- package/dist/charts/primitives/Crosshair.js +2 -2
- package/dist/charts/primitives/HoverOverlay.d.ts +6 -1
- package/dist/charts/primitives/HoverOverlay.d.ts.map +1 -1
- package/dist/charts/primitives/HoverOverlay.js +37 -26
- package/dist/charts/primitives/HoverOverlay.module.css +13 -0
- package/dist/charts/primitives/HoverOverlay.module.css.d.ts +8 -0
- package/dist/charts/primitives/chart-card-context.d.ts +29 -0
- package/dist/charts/primitives/chart-card-context.d.ts.map +1 -0
- package/dist/charts/primitives/chart-card-context.js +13 -0
- package/dist/charts/primitives/chart-frame-layout.d.ts +93 -113
- package/dist/charts/primitives/chart-frame-layout.d.ts.map +1 -1
- package/dist/charts/primitives/chart-frame-layout.js +76 -29
- package/dist/charts/primitives/chart-layout.d.ts +112 -0
- package/dist/charts/primitives/chart-layout.d.ts.map +1 -0
- package/dist/charts/primitives/chart-layout.js +175 -0
- package/dist/charts/primitives/chart-tier.d.ts +13 -11
- package/dist/charts/primitives/chart-tier.d.ts.map +1 -1
- package/dist/charts/primitives/chart-tier.js +42 -13
- package/dist/charts/series.d.ts +4 -1
- package/dist/charts/series.d.ts.map +1 -1
- package/dist/charts/utils/ticks.d.ts +27 -8
- package/dist/charts/utils/ticks.d.ts.map +1 -1
- package/dist/charts/utils/ticks.js +35 -11
- package/dist/common/errors.d.ts +11 -1
- package/dist/common/errors.d.ts.map +1 -1
- package/dist/common/errors.js +16 -2
- package/dist/common/hit-floor.d.ts +10 -0
- package/dist/common/hit-floor.d.ts.map +1 -0
- package/dist/common/hit-floor.js +6 -0
- package/dist/{shell → common}/isomorphic-layout-effect.d.ts +4 -3
- package/dist/common/isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/common/use-measured-widths.d.ts +37 -0
- package/dist/common/use-measured-widths.d.ts.map +1 -0
- package/dist/common/use-measured-widths.js +51 -0
- package/dist/common/use-media-query.d.ts +6 -0
- package/dist/common/use-media-query.d.ts.map +1 -0
- package/dist/common/use-media-query.js +40 -0
- package/dist/common/validate.d.ts +9 -0
- package/dist/common/validate.d.ts.map +1 -1
- package/dist/common/validate.js +9 -4
- package/dist/content/article-layout.d.ts +4 -2
- package/dist/content/article-layout.d.ts.map +1 -1
- package/dist/content/article-layout.js +43 -3
- package/dist/content/article-layout.module.css +45 -4
- package/dist/content/article-layout.module.css.d.ts +3 -0
- package/dist/content/code-block.d.ts.map +1 -1
- package/dist/content/code-block.js +40 -2
- package/dist/content/code-block.module.css +32 -2
- package/dist/content/prose.module.css +13 -8
- package/dist/controls/actions.d.ts +29 -6
- package/dist/controls/actions.d.ts.map +1 -1
- package/dist/controls/actions.js +158 -27
- package/dist/controls/actions.module.css +14 -1
- package/dist/controls/actions.module.css.d.ts +1 -0
- package/dist/controls/controls.module.css +8 -31
- package/dist/controls/enum-filter.js +2 -2
- package/dist/controls/filter-context.d.ts +10 -0
- package/dist/controls/filter-context.d.ts.map +1 -1
- package/dist/controls/filter-context.js +2 -0
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +1 -0
- package/dist/controls/index.d.ts +1 -1
- package/dist/controls/index.d.ts.map +1 -1
- package/dist/controls/index.js +0 -2
- package/dist/controls/multi-select-filter.js +2 -2
- package/dist/controls/sync-button.module.css +1 -1
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +1 -0
- package/dist/dashboard/section.module.css +1 -26
- package/dist/dashboard/stat-card.d.ts +1 -1
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +4 -1
- package/dist/dashboard/stat-card.module.css +6 -9
- package/dist/dashboard/stat-group.module.css +16 -4
- package/dist/dashboard/widget-grid.d.ts.map +1 -1
- package/dist/dashboard/widget-header.d.ts +14 -4
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +23 -6
- package/dist/dashboard/widget-header.module.css +145 -133
- package/dist/dashboard/widget-header.module.css.d.ts +2 -0
- package/dist/data/data-table.d.ts +23 -0
- package/dist/data/data-table.d.ts.map +1 -1
- package/dist/data/data-table.js +339 -141
- package/dist/data/data-table.module.css +94 -0
- package/dist/data/data-table.module.css.d.ts +11 -0
- package/dist/data/virtual-list.d.ts.map +1 -1
- package/dist/data/virtual-list.js +10 -0
- package/dist/forms/form-layout.d.ts.map +1 -1
- package/dist/forms/form-layout.js +3 -3
- package/dist/forms/form-layout.module.css +30 -5
- package/dist/forms/form-layout.module.css.d.ts +1 -0
- package/dist/guard/index.d.ts +8 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +67 -2
- package/dist/guard/types.d.ts +3 -3
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/provider/index.d.ts +20 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +22 -2
- package/dist/shell/app-brand.d.ts.map +1 -1
- package/dist/shell/app-brand.js +1 -0
- package/dist/shell/app-brand.module.css +2 -2
- package/dist/shell/app-header.module.css +18 -8
- package/dist/shell/app-main.module.css +54 -3
- package/dist/shell/app-main.module.css.d.ts +1 -0
- package/dist/shell/app-mobile-nav.module.css +16 -4
- package/dist/shell/app-sidebar.module.css +4 -6
- package/dist/shell/index.d.ts +12 -0
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +57 -16
- package/dist/shell/mobile-nav-model.d.ts +1 -1
- package/dist/shell/page-aside.d.ts +22 -3
- package/dist/shell/page-aside.d.ts.map +1 -1
- package/dist/shell/page-aside.js +27 -13
- package/dist/shell/page-bar.d.ts.map +1 -1
- package/dist/shell/page-bar.js +10 -5
- package/dist/shell/page-bar.module.css +10 -34
- package/dist/shell/use-breakpoint.d.ts +3 -4
- package/dist/shell/use-breakpoint.d.ts.map +1 -1
- package/dist/shell/use-breakpoint.js +3 -25
- package/dist/shell/use-size-class.d.ts +6 -0
- package/dist/shell/use-size-class.d.ts.map +1 -0
- package/dist/shell/use-size-class.js +19 -0
- package/dist/state/persisted-or-local.d.ts +4 -1
- package/dist/state/persisted-or-local.d.ts.map +1 -1
- package/dist/state/persisted-or-local.js +4 -3
- package/dist/state/persisted.d.ts +10 -0
- package/dist/state/persisted.d.ts.map +1 -1
- package/dist/state/persisted.js +44 -14
- package/dist/styles.css +41 -0
- package/dist/surfaces.d.ts +4 -4
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +11 -3
- package/dist/theme/controls.module.css +7 -0
- package/dist/theme/ctl-theme.d.ts +1 -0
- package/dist/theme/ctl-theme.d.ts.map +1 -1
- package/dist/theme/ctl-theme.js +12 -4
- package/dist/theme/floating.module.css +36 -0
- package/dist/theme/floating.module.css.d.ts +3 -0
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +34 -5
- package/dist/theme/nav-link.module.css +7 -0
- package/dist/tokens/index.d.ts +7 -16
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +23 -28
- package/dist/tokens/palette.d.ts +5 -27
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +8 -30
- package/dist/tokens/size-classes.d.ts +40 -0
- package/dist/tokens/size-classes.d.ts.map +1 -0
- package/dist/tokens/size-classes.js +29 -0
- package/dist/tokens.css +8 -4
- package/llms.txt +3 -3
- package/package.json +17 -17
- package/src/agent-chat/composer.tsx +74 -47
- package/src/agent-chat/thread-workspace.tsx +8 -11
- package/src/agent-chat/use-keyboard-inset.ts +68 -0
- package/src/charts/cursor/touch-pin.ts +138 -0
- package/src/charts/hooks/use-discrete-cursor.ts +335 -0
- package/src/charts/hooks/use-hysteresis.ts +26 -0
- package/src/charts/hooks/useBandPlot.ts +90 -27
- package/src/charts/hooks/useChartCursor.ts +211 -26
- package/src/charts/index.ts +0 -8
- package/src/charts/kinds/BandStrip.tsx +11 -1
- package/src/charts/kinds/Donut.tsx +153 -62
- package/src/charts/kinds/DualPanel.tsx +19 -4
- package/src/charts/kinds/Heatmap.tsx +61 -22
- package/src/charts/kinds/MirroredBars.tsx +15 -3
- package/src/charts/kinds/donut-layout.ts +82 -0
- package/src/charts/layout/auto-margin.ts +24 -5
- package/src/charts/layout/end-labels.ts +135 -0
- package/src/charts/primitives/Axes.tsx +112 -21
- package/src/charts/primitives/CartesianChart.tsx +282 -68
- package/src/charts/primitives/ChartCard.tsx +141 -48
- package/src/charts/primitives/ChartFrame.tsx +243 -60
- package/src/charts/primitives/ChartLegend.tsx +257 -73
- package/src/charts/primitives/ChartTooltip.tsx +8 -3
- package/src/charts/primitives/Crosshair.tsx +2 -2
- package/src/charts/primitives/HoverOverlay.module.css +13 -0
- package/src/charts/primitives/HoverOverlay.module.css.d.ts +8 -0
- package/src/charts/primitives/HoverOverlay.tsx +15 -4
- package/src/charts/primitives/chart-card-context.ts +37 -0
- package/src/charts/primitives/chart-frame-layout.ts +214 -177
- package/src/charts/primitives/chart-layout.ts +318 -0
- package/src/charts/primitives/chart-tier.tsx +66 -21
- package/src/charts/series.ts +4 -1
- package/src/charts/utils/ticks.ts +95 -19
- package/src/common/errors.ts +25 -1
- package/src/common/hit-floor.ts +9 -0
- package/src/{shell → common}/isomorphic-layout-effect.ts +4 -3
- package/src/common/use-measured-widths.ts +88 -0
- package/src/common/use-media-query.ts +56 -0
- package/src/common/validate.ts +17 -4
- package/src/content/article-layout.module.css +45 -4
- package/src/content/article-layout.module.css.d.ts +3 -0
- package/src/content/article-layout.tsx +60 -5
- package/src/content/code-block.module.css +32 -2
- package/src/content/code-block.tsx +47 -3
- package/src/content/prose.module.css +13 -8
- package/src/controls/actions.module.css +14 -1
- package/src/controls/actions.module.css.d.ts +1 -0
- package/src/controls/actions.tsx +223 -75
- package/src/controls/controls.module.css +8 -31
- package/src/controls/enum-filter.tsx +2 -2
- package/src/controls/filter-context.tsx +11 -0
- package/src/controls/filter-pill.tsx +1 -0
- package/src/controls/index.ts +0 -1
- package/src/controls/multi-select-filter.tsx +2 -2
- package/src/controls/sync-button.module.css +1 -1
- package/src/dashboard/section.module.css +1 -26
- package/src/dashboard/section.tsx +1 -0
- package/src/dashboard/stat-card.module.css +6 -9
- package/src/dashboard/stat-card.tsx +6 -3
- package/src/dashboard/stat-group.module.css +16 -4
- package/src/dashboard/widget-grid.tsx +7 -6
- package/src/dashboard/widget-header.module.css +145 -133
- package/src/dashboard/widget-header.module.css.d.ts +2 -0
- package/src/dashboard/widget-header.tsx +45 -11
- package/src/data/data-table.module.css +94 -0
- package/src/data/data-table.module.css.d.ts +11 -0
- package/src/data/data-table.tsx +503 -164
- package/src/data/virtual-list.tsx +31 -0
- package/src/forms/form-layout.module.css +30 -5
- package/src/forms/form-layout.module.css.d.ts +1 -0
- package/src/forms/form-layout.tsx +12 -10
- package/src/guard/index.ts +183 -3
- package/src/guard/types.ts +3 -2
- package/src/index.ts +2 -0
- package/src/provider/index.tsx +53 -1
- package/src/shell/app-brand.module.css +2 -2
- package/src/shell/app-brand.tsx +1 -0
- package/src/shell/app-header.module.css +18 -8
- package/src/shell/app-main.module.css +54 -3
- package/src/shell/app-main.module.css.d.ts +1 -0
- package/src/shell/app-mobile-nav.module.css +16 -4
- package/src/shell/app-sidebar.module.css +4 -6
- package/src/shell/index.tsx +200 -129
- package/src/shell/mobile-nav-model.ts +1 -1
- package/src/shell/page-aside.tsx +70 -21
- package/src/shell/page-bar.module.css +10 -34
- package/src/shell/page-bar.tsx +10 -5
- package/src/shell/use-breakpoint.ts +9 -45
- package/src/shell/use-size-class.ts +31 -0
- package/src/state/persisted-or-local.ts +10 -4
- package/src/state/persisted.ts +76 -17
- package/src/styles.css +41 -0
- package/src/surfaces.ts +9 -1
- package/src/theme/controls.module.css +7 -0
- package/src/theme/ctl-theme.tsx +15 -3
- package/src/theme/floating.module.css +36 -0
- package/src/theme/floating.module.css.d.ts +3 -0
- package/src/theme/index.ts +46 -8
- package/src/theme/nav-link.module.css +7 -0
- package/src/tokens/index.ts +20 -30
- package/src/tokens/palette.ts +6 -28
- package/src/tokens/size-classes.ts +46 -0
- package/dist/shell/isomorphic-layout-effect.d.ts.map +0 -1
- /package/dist/{shell → common}/isomorphic-layout-effect.js +0 -0
package/dist/shell/app-brand.js
CHANGED
|
@@ -80,6 +80,7 @@ function AppBrand({ brand, collapsed, onToggleCollapse, className, style }) {
|
|
|
80
80
|
size: 28,
|
|
81
81
|
visibleFrom: "sm",
|
|
82
82
|
className: classes.ghostIcon,
|
|
83
|
+
"data-basalt-hit": true,
|
|
83
84
|
onClick: onToggleCollapse,
|
|
84
85
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
85
86
|
children: /* @__PURE__ */ jsx(IconCollapse, { collapsed })
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
/* Below `sm` there is no navbar at all (the bottom bar is the whole nav), so the zone would be a
|
|
38
38
|
* zero-width box holding a hidden toggle. The breadcrumb owns the phone header's lead. */
|
|
39
|
-
@media (max-width:
|
|
39
|
+
@media (max-width: 52.49375em) {
|
|
40
40
|
.zone {
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
* (logo + name) hides and the toggle centres. The zone drops its inset so the toggle's centre lands
|
|
104
104
|
* on the rail's icon column rather than 13px right of it.
|
|
105
105
|
*/
|
|
106
|
-
@media (min-width:
|
|
106
|
+
@media (min-width: 52.5em) {
|
|
107
107
|
.zone[data-collapsed] {
|
|
108
108
|
padding-inline: 0;
|
|
109
109
|
}
|
|
@@ -65,12 +65,10 @@
|
|
|
65
65
|
* plus ~66px of mobile bar, ~66px of globals and ~26px of gaps inside a 374px content box, so the
|
|
66
66
|
* floor is never the binding constraint there.
|
|
67
67
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* NEITHER is the real answer, which is measuring the row (a ResizeObserver fold) rather than
|
|
73
|
-
* declaring breakpoints for it. This pair is the cheap, declared interim until that exists.
|
|
68
|
+
* Above `sm` the row is measured, not declared: `.lead` stops growing and `.pageBar` takes every
|
|
69
|
+
* remaining pixel (`flex: 1 1 0`), so its width IS the room `PageBar` row 1 folds its secondary
|
|
70
|
+
* actions against (`controls/actions.tsx`, `planBarFold`). `max-width` keeps a long breadcrumb from
|
|
71
|
+
* starving it.
|
|
74
72
|
*/
|
|
75
73
|
.lead {
|
|
76
74
|
display: flex;
|
|
@@ -111,6 +109,18 @@
|
|
|
111
109
|
gap: var(--vx-space-control-gap);
|
|
112
110
|
}
|
|
113
111
|
|
|
112
|
+
@media (min-width: 52.5em) {
|
|
113
|
+
.lead {
|
|
114
|
+
flex: 0 1 auto;
|
|
115
|
+
max-width: 40%;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.pageBar {
|
|
119
|
+
flex: 1 1 0;
|
|
120
|
+
min-width: 0;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
114
124
|
/*
|
|
115
125
|
* The shell globals sit at the SAME 32px `ctl` tier as everything else in the row, and they get there
|
|
116
126
|
* the
|
|
@@ -148,10 +158,10 @@
|
|
|
148
158
|
* the row's elastic side truncated `Overview / Dashboard` to `O… / D…`, which is two ellipses and a
|
|
149
159
|
* separator in place of the one word that says where the reader is.
|
|
150
160
|
*
|
|
151
|
-
* `
|
|
161
|
+
* `52.49375em` is the `sm` breakpoint in the exact literal form every other basalt CSS module uses —
|
|
152
162
|
* a media query cannot resolve a custom property.
|
|
153
163
|
*/
|
|
154
|
-
@media (max-width:
|
|
164
|
+
@media (max-width: 52.49375em) {
|
|
155
165
|
.crumbAncestors {
|
|
156
166
|
display: none;
|
|
157
167
|
}
|
|
@@ -131,8 +131,59 @@
|
|
|
131
131
|
* `padding-right`; the block padding keeps coming from the shorthand. The bottom inset already
|
|
132
132
|
* rides `margin-bottom` above (`env(safe-area-inset-bottom)`); the PWA's top inset needs no rule here
|
|
133
133
|
* (the status bar uses the opaque `default` style, per argo's own seed comment). */
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
:global(:root[data-basalt-host]:not([data-basalt-host='web'])) .main {
|
|
135
|
+
padding-right: max(var(--app-shell-padding), env(safe-area-inset-right));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
* PUBLIC SHELL BOTTOM INSET — `--app-shell-footer-offset` (stable name, do not rename): the visible
|
|
140
|
+
* bottom-bar height WITHOUT the safe-area inset, and 0 wherever there is no bar (from `sm` up).
|
|
141
|
+
* Anything bottom-anchored (toasts, a chat composer) sits at
|
|
142
|
+
* `calc(var(--app-shell-footer-offset, 0px) + env(safe-area-inset-bottom, 0px))`.
|
|
143
|
+
*
|
|
144
|
+
* Mantine emits it on `:root` for a fixed-mode AppShell (its `cssVariablesSelector`), so a
|
|
145
|
+
* body-level portal reads it; the landscape override below is on `:root` for the same reason.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
/*
|
|
149
|
+
* An OPEN aside that does not dock: the region reserved only its rail, so it widens itself over
|
|
150
|
+
* main (`--app-shell-aside-width` is set on this element by `shell/index.tsx`) instead of shrinking
|
|
151
|
+
* it, lifted on the card depth token.
|
|
152
|
+
*/
|
|
153
|
+
.asideOverlay {
|
|
154
|
+
box-shadow: var(--vx-shadow-card);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/*
|
|
158
|
+
* Landscape phone: the header and the bottom bar take their compact row, SCALED to the viewport's
|
|
159
|
+
* own height budget rather than a flat step — a flat 40/45 barely shrinks (44→40, 56→45, ≈9-20%)
|
|
160
|
+
* against the height itself halving (812→375), so the chrome's SHARE of the screen nearly doubles
|
|
161
|
+
* (r2 N1: 16.7% portrait → 32.3% landscape even with the flat numbers). `clamp(floor, Ndvh,
|
|
162
|
+
* ceiling)` keeps continuity at the 480px breakpoint edge (Ndvh ≈ ceiling there) and keeps
|
|
163
|
+
* shrinking below it, down to a floor: 36px for the header (room for the brand/burger row), and
|
|
164
|
+
* `--vx-space-mobile-nav-row-height + 1px` (its own seam) for the bar — the row token, not a flat
|
|
165
|
+
* 45px, because `deriveSpacing`'s density knob only FLOORS that token at 44 and is free to scale it
|
|
166
|
+
* taller at density > 0; a hardcoded 45px floor would then clamp the footer BELOW its own row's
|
|
167
|
+
* real height at any positive density, clipping it. The heights are JS numbers in `AppShell` props,
|
|
168
|
+
* so the override is on `:root` where Mantine writes them; `:root:root` outranks its later-rendered
|
|
169
|
+
* `<style>` at equal source order. Both rules are gated to the same width — the header and the bar
|
|
170
|
+
* both exist ONLY below `sm` in this landscape-compact form; a wide landscape phone/tablet has no
|
|
171
|
+
* bar (and keeps `--app-shell-footer-offset` 0) and reads its header at the ordinary, un-clamped
|
|
172
|
+
* height, not this mobile row. Labels hidden: `app-mobile-nav.module.css`.
|
|
173
|
+
*/
|
|
174
|
+
@media (max-height: 480px) and (orientation: landscape) and (max-width: 52.49375em) {
|
|
175
|
+
:global(:root:root) {
|
|
176
|
+
--app-shell-header-height: clamp(36px, 9dvh, 40px);
|
|
177
|
+
--app-shell-header-offset: clamp(36px, 9dvh, 40px);
|
|
178
|
+
--app-shell-footer-height: clamp(
|
|
179
|
+
calc(var(--vx-space-mobile-nav-row-height) + 1px),
|
|
180
|
+
9.4dvh,
|
|
181
|
+
56px
|
|
182
|
+
);
|
|
183
|
+
--app-shell-footer-offset: clamp(
|
|
184
|
+
calc(var(--vx-space-mobile-nav-row-height) + 1px),
|
|
185
|
+
9.4dvh,
|
|
186
|
+
56px
|
|
187
|
+
);
|
|
137
188
|
}
|
|
138
189
|
}
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
* The popover's SECTION RHYTHM — what replaced the single `Menu.Divider`, and it is SPACE, not a
|
|
196
196
|
* line.
|
|
197
197
|
*
|
|
198
|
-
* The Drawer's bulk was never its row height (
|
|
198
|
+
* The Drawer's bulk was never its row height (44px is the WCAG 2.5.5 AAA-enhanced floor pinned by
|
|
199
199
|
* `theme/density-relations.test.ts`); it was the stack rhythm around the rows — a 12px section
|
|
200
200
|
* gap, 18px of Drawer padding and a header row. A popover with one hairline through the middle and
|
|
201
201
|
* no rhythm at all is the other extreme, so each group opens its own band instead.
|
|
@@ -218,8 +218,8 @@
|
|
|
218
218
|
* `max-height` above answers, and the cheaper half. MEASURED per heading at 8/8: 8px margin + 8px
|
|
219
219
|
* padding-top + 2px padding-bottom + a 17px line = a 35px box, and there are FIVE of them in the
|
|
220
220
|
* shipped More surface — 175px, 28% of the whole dropdown spent on five words. 6/4 takes each
|
|
221
|
-
* banded heading to 29px and hands 24px back to the rows. It does NOT touch the row height (
|
|
222
|
-
* is the WCAG 2.5.5 floor named at the top of this comment) and it does not add the line the
|
|
221
|
+
* banded heading to 29px and hands 24px back to the rows. It does NOT touch the row height (44px
|
|
222
|
+
* is the WCAG 2.5.5 AAA-enhanced floor named at the top of this comment) and it does not add the line the
|
|
223
223
|
* paragraph above rules out: this is the same space that argument asked to carry the boundary,
|
|
224
224
|
* spent tighter.
|
|
225
225
|
*/
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
* longer fights that — it used to force the dense desktop row's padding back OPEN with
|
|
332
332
|
* `!important`, which is exactly how a "44px touch row" and a "29px sidebar row" ended up as two
|
|
333
333
|
* unrelated geometries for the same list. What is left here is only what the theme does not supply:
|
|
334
|
-
* the touch-target `min-height` floor (`--vx-space-mobile-nav-row-height`,
|
|
334
|
+
* the touch-target `min-height` floor (`--vx-space-mobile-nav-row-height`, 44px — WCAG 2.5.5 AAA-enhanced).
|
|
335
335
|
*/
|
|
336
336
|
.row {
|
|
337
337
|
display: flex;
|
|
@@ -403,3 +403,15 @@
|
|
|
403
403
|
transition: none;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
+
|
|
407
|
+
/* Landscape phone: the bar's compact row (`app-main.module.css` sets its height) is icons only —
|
|
408
|
+
* the label is visually hidden, not removed, so each tab keeps its accessible name. */
|
|
409
|
+
@media (max-height: 480px) and (orientation: landscape) {
|
|
410
|
+
.label {
|
|
411
|
+
position: absolute;
|
|
412
|
+
width: 1px;
|
|
413
|
+
height: 1px;
|
|
414
|
+
overflow: hidden;
|
|
415
|
+
clip-path: inset(50%);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
@@ -30,10 +30,8 @@
|
|
|
30
30
|
* notch on the side the sidebar touches. `max()` is a FLOOR — the inset only grows the padding
|
|
31
31
|
* past its normal value, never shrinks it. Right inset is `app-main.module.css`'s to draw; the
|
|
32
32
|
* PWA's top inset needs no rule here (the status bar uses the opaque `default` style). */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
padding-left: max(var(--vx-space-row-inset-x), env(safe-area-inset-left));
|
|
36
|
-
}
|
|
33
|
+
:global(:root[data-basalt-host]:not([data-basalt-host='web'])) .root {
|
|
34
|
+
padding-left: max(var(--vx-space-row-inset-x), env(safe-area-inset-left));
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
.link {
|
|
@@ -634,12 +632,12 @@
|
|
|
634
632
|
}
|
|
635
633
|
|
|
636
634
|
/*
|
|
637
|
-
* Icon-rail (collapsed) — desktop only. Gated behind min-width: sm (
|
|
635
|
+
* Icon-rail (collapsed) — desktop only. Gated behind min-width: sm (52.5em) so the sidebar doesn't
|
|
638
636
|
* exist at all below that breakpoint (see `MobileNav`) regardless of the persisted collapse flag.
|
|
639
637
|
* Hide the section labels and nav labels; center the remaining icons. The brand's own rail form
|
|
640
638
|
* lives in `app-brand.module.css` now, keyed off the same `data-collapsed` attribute.
|
|
641
639
|
*/
|
|
642
|
-
@media (min-width:
|
|
640
|
+
@media (min-width: 52.5em) {
|
|
643
641
|
.root[data-collapsed] .searchSlot {
|
|
644
642
|
padding-block: var(--vx-space-sidebar-region-gap);
|
|
645
643
|
display: flex;
|
package/dist/shell/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { GlobalAction } from '../controls/actions.js';
|
|
|
4
4
|
import type { AccountMenuItem, BasaltAccountProps } from './account-types.js';
|
|
5
5
|
import type { SidebarSearchActions, SidebarSearchConfig } from './sidebar-search.js';
|
|
6
6
|
import type { MobileNavConfig, SidebarBlock, SidebarSection } from './nav-types.js';
|
|
7
|
+
import type { SizeClass } from './use-size-class.js';
|
|
7
8
|
export { AppSidebar, type AppSidebarProps } from './app-sidebar.js';
|
|
8
9
|
export { NavCountBadge, type NavCountBadgeProps } from './nav-count-badge.js';
|
|
9
10
|
export { SidebarSearch, type SidebarSearchProps, type SidebarSearchConfig, type SidebarSearchActions, } from './sidebar-search.js';
|
|
@@ -15,6 +16,7 @@ export { AppBreadcrumbs, type AppBreadcrumbsProps } from './app-breadcrumbs.js';
|
|
|
15
16
|
export { PageBar, type PageBarProps, type PageBarSlot } from './page-bar.js';
|
|
16
17
|
export { PageAside, type PageAsideProps, type PageAsideSlot } from './page-aside.js';
|
|
17
18
|
export { useBreakpoint, type BreakpointName } from './use-breakpoint.js';
|
|
19
|
+
export { useSizeClass, type SizeClass } from './use-size-class.js';
|
|
18
20
|
export { PageTitle, type PageTitleProps, type PageTitleSlot } from './page-title.js';
|
|
19
21
|
/**
|
|
20
22
|
* The shared nav vocabulary lives in `src/shell/nav-types.ts` so the headless router bridge can
|
|
@@ -134,6 +136,16 @@ export type BasaltShellProps = BasaltProps & {
|
|
|
134
136
|
/** Page content. */
|
|
135
137
|
children?: ReactNode;
|
|
136
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* The room-to-dock `min-width` query's SSR/no-`matchMedia` fallback — an `'expanded'`
|
|
141
|
+
* `sizeClassHint` means the server already believes there is room, matching `useSizeClass`'s own
|
|
142
|
+
* hint-seeded guard one level up (`use-size-class.ts`). Extracted as its own pure function (rather
|
|
143
|
+
* than the inline `sizeClassHint === 'expanded'` it replaces) purely so `index.test.tsx` can pin it
|
|
144
|
+
* without needing to render `BasaltShell` through a real SSR pass — `AppShell`'s + `PageAside`'s own
|
|
145
|
+
* effects/refs/portals make that path unobservable through rendered markup, and the previous
|
|
146
|
+
* hardcoded `false` fallback here shipped with no test at all for exactly that reason.
|
|
147
|
+
*/
|
|
148
|
+
export declare function roomToDockServerFallback(sizeClassHint: SizeClass | undefined): boolean;
|
|
137
149
|
/**
|
|
138
150
|
* The shell's two page-level regions are providers, and both wrap the frame rather than living
|
|
139
151
|
* inside it: `PageBarProvider` owns the header portal and the single-kebab claim, `AsideProvider`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAiB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAWlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACjF,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EAEZ,cAAc,EACf,MAAM,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAMjD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kB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AAG,SAAS,GAAG,OAAO,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BASlD"}
|
package/dist/shell/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AppShell, Box } from "@mantine/core";
|
|
3
|
-
import { Fragment, useCallback, useEffect, useMemo } from "react";
|
|
2
|
+
import { AppShell, Box, rem } from "@mantine/core";
|
|
3
|
+
import { Fragment, useCallback, useContext, useEffect, useMemo } from "react";
|
|
4
4
|
import { registerSidebarToggle } from "../commands/shell-bridge.js";
|
|
5
5
|
import { cx } from "../common/props.js";
|
|
6
|
+
import { useMediaQuery } from "../common/use-media-query.js";
|
|
6
7
|
import { assertRequiredProps } from "../common/validate.js";
|
|
7
8
|
import { AppSidebar } from "./app-sidebar.js";
|
|
8
9
|
import { AppBrand } from "./app-brand.js";
|
|
@@ -10,10 +11,12 @@ import { MobileNav, accountRowCount } from "./app-mobile-nav.js";
|
|
|
10
11
|
import { blockRowCount, projectMobileNav } from "./mobile-nav-model.js";
|
|
11
12
|
import { AppBreadcrumbs } from "./app-breadcrumbs.js";
|
|
12
13
|
import { PageBarBandOutlet, PageBarOutlet, PageBarProvider, usePageKebabClaimed } from "./page-bar.js";
|
|
13
|
-
import { AsideOutlet, AsideProvider, useAsideRegion } from "./page-aside.js";
|
|
14
|
+
import { AsideDocksContext, AsideOutlet, AsideProvider, useAsideRegion } from "./page-aside.js";
|
|
14
15
|
import { OverflowMenu, globalActionAsBarAction, globalActionMobile } from "../controls/actions.js";
|
|
15
16
|
import { CtlSlot, useBasaltSpacing } from "../theme/index.js";
|
|
16
|
-
import {
|
|
17
|
+
import { createPersistedStore } from "../state/persisted.js";
|
|
18
|
+
import { toEm } from "../tokens/size-classes.js";
|
|
19
|
+
import { SizeClassHintContext, useSizeClass } from "./use-size-class.js";
|
|
17
20
|
import brandClasses from "./app-brand.module.css";
|
|
18
21
|
import headerClasses from "./app-header.module.css";
|
|
19
22
|
import mainClasses from "./app-main.module.css";
|
|
@@ -35,6 +38,7 @@ import { AppBreadcrumbs as AppBreadcrumbs2 } from "./app-breadcrumbs.js";
|
|
|
35
38
|
import { PageBar } from "./page-bar.js";
|
|
36
39
|
import { PageAside } from "./page-aside.js";
|
|
37
40
|
import { useBreakpoint } from "./use-breakpoint.js";
|
|
41
|
+
import { useSizeClass as useSizeClass2 } from "./use-size-class.js";
|
|
38
42
|
import { PageTitle } from "./page-title.js";
|
|
39
43
|
function findActiveCrumb(sections) {
|
|
40
44
|
for (const section of sections) {
|
|
@@ -65,10 +69,14 @@ const collapseStores = /* @__PURE__ */ new Map();
|
|
|
65
69
|
function collapseStore(key) {
|
|
66
70
|
const cached = collapseStores.get(key);
|
|
67
71
|
if (cached) return cached;
|
|
68
|
-
const store =
|
|
72
|
+
const store = createPersistedStore({ key, version: COLLAPSE_VERSION, initial: false });
|
|
69
73
|
collapseStores.set(key, store);
|
|
70
74
|
return store;
|
|
71
75
|
}
|
|
76
|
+
const MAIN_MIN_WIDTH = 720;
|
|
77
|
+
function roomToDockServerFallback(sizeClassHint) {
|
|
78
|
+
return sizeClassHint === "expanded";
|
|
79
|
+
}
|
|
72
80
|
function BasaltShell(props) {
|
|
73
81
|
assertRequiredProps("BasaltShell", props, ["brand", "sections"]);
|
|
74
82
|
return /* @__PURE__ */ jsx(PageBarProvider, { globalActions: props.globalActions ?? [], children: /* @__PURE__ */ jsx(AsideProvider, { children: /* @__PURE__ */ jsx(ShellFrame, { ...props }) }) });
|
|
@@ -93,9 +101,31 @@ function ShellFrame({
|
|
|
93
101
|
const { step } = useBasaltSpacing();
|
|
94
102
|
const inset = { base: step.appShellInsetMobile, sm: step.appShellInset };
|
|
95
103
|
const aside = useAsideRegion();
|
|
96
|
-
const
|
|
104
|
+
const sizeClass = useSizeClass();
|
|
105
|
+
const [storedCollapsed, setStoredCollapsed, collapseIsSet] = collapseStore(storageKey)();
|
|
97
106
|
const isCollapseControlled = collapsedProp !== void 0;
|
|
98
|
-
const
|
|
107
|
+
const uncontrolledCollapsed = collapseIsSet ? storedCollapsed : sizeClass === "medium";
|
|
108
|
+
const collapsed = isCollapseControlled ? collapsedProp : uncontrolledCollapsed;
|
|
109
|
+
const navbarWidth = collapsed ? step.appShellNavbarRailWidth : step.appShellNavbarWidth;
|
|
110
|
+
const sizeClassHint = useContext(SizeClassHintContext);
|
|
111
|
+
const roomToDock = useMediaQuery(
|
|
112
|
+
`(min-width: ${toEm(navbarWidth + step.appShellAsideWidth + MAIN_MIN_WIDTH)})`,
|
|
113
|
+
roomToDockServerFallback(sizeClassHint)
|
|
114
|
+
);
|
|
115
|
+
const docks = sizeClass === "expanded" && roomToDock;
|
|
116
|
+
const asideOpen = aside.claimed && !aside.folded;
|
|
117
|
+
const asideOverlay = asideOpen && !docks;
|
|
118
|
+
const asideReserved = asideOpen && docks ? step.appShellAsideWidth : step.appShellAsideRailWidth;
|
|
119
|
+
const asideWidth = aside.claimed ? asideReserved : 0;
|
|
120
|
+
const { requestClose } = aside;
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (!asideOverlay) return;
|
|
123
|
+
const onKeyDown = (event) => {
|
|
124
|
+
if (event.key === "Escape") requestClose();
|
|
125
|
+
};
|
|
126
|
+
window.addEventListener("keydown", onKeyDown);
|
|
127
|
+
return () => window.removeEventListener("keydown", onKeyDown);
|
|
128
|
+
}, [asideOverlay, requestClose]);
|
|
99
129
|
const toggleCollapse = useCallback(() => {
|
|
100
130
|
const next = !collapsed;
|
|
101
131
|
if (!isCollapseControlled) setStoredCollapsed(next);
|
|
@@ -111,7 +141,7 @@ function ShellFrame({
|
|
|
111
141
|
() => projectMobileNav(sections, { config: mobileNav, extraMoreRows }),
|
|
112
142
|
[sections, mobileNav, extraMoreRows]
|
|
113
143
|
);
|
|
114
|
-
return /* @__PURE__ */ jsxs(
|
|
144
|
+
return /* @__PURE__ */ jsx(AsideDocksContext.Provider, { value: docks, children: /* @__PURE__ */ jsxs(
|
|
115
145
|
AppShell,
|
|
116
146
|
{
|
|
117
147
|
h: "100dvh",
|
|
@@ -120,16 +150,14 @@ function ShellFrame({
|
|
|
120
150
|
height: step.appShellHeaderHeight
|
|
121
151
|
},
|
|
122
152
|
navbar: {
|
|
123
|
-
width: {
|
|
124
|
-
base: step.appShellNavbarWidth,
|
|
125
|
-
sm: collapsed ? step.appShellNavbarRailWidth : step.appShellNavbarWidth
|
|
126
|
-
},
|
|
153
|
+
width: { base: step.appShellNavbarWidth, sm: navbarWidth },
|
|
127
154
|
breakpoint: "sm",
|
|
128
155
|
// No mobile sidebar drawer, ever — the bottom bar is the entire mobile nav.
|
|
129
156
|
collapsed: { mobile: true }
|
|
130
157
|
},
|
|
131
158
|
aside: {
|
|
132
|
-
|
|
159
|
+
// An overlay reserves the rail only — `<AppShell.Aside>` below widens itself over main.
|
|
160
|
+
width: asideWidth,
|
|
133
161
|
breakpoint: "sm",
|
|
134
162
|
// Below `sm` there is no region at all — `PageAside` renders its content in the page
|
|
135
163
|
// flow instead, one node, no responsive twin (law C9).
|
|
@@ -170,7 +198,18 @@ function ShellFrame({
|
|
|
170
198
|
children
|
|
171
199
|
}
|
|
172
200
|
),
|
|
173
|
-
/* @__PURE__ */ jsx(
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
AppShell.Aside,
|
|
203
|
+
{
|
|
204
|
+
p: 0,
|
|
205
|
+
withBorder: aside.claimed,
|
|
206
|
+
...asideOverlay && {
|
|
207
|
+
className: mainClasses.asideOverlay,
|
|
208
|
+
style: { "--app-shell-aside-width": rem(step.appShellAsideWidth) }
|
|
209
|
+
},
|
|
210
|
+
children: /* @__PURE__ */ jsx(AsideOutlet, { className: asideClasses.outlet })
|
|
211
|
+
}
|
|
212
|
+
),
|
|
174
213
|
/* @__PURE__ */ jsx(AppShell.Footer, { hiddenFrom: "sm", p: 0, children: /* @__PURE__ */ jsx(
|
|
175
214
|
MobileNav,
|
|
176
215
|
{
|
|
@@ -183,7 +222,7 @@ function ShellFrame({
|
|
|
183
222
|
) })
|
|
184
223
|
]
|
|
185
224
|
}
|
|
186
|
-
);
|
|
225
|
+
) });
|
|
187
226
|
}
|
|
188
227
|
function HeaderGlobalActions({ actions }) {
|
|
189
228
|
const kebabClaimed = usePageKebabClaimed();
|
|
@@ -217,5 +256,7 @@ export {
|
|
|
217
256
|
SidebarAccount,
|
|
218
257
|
SidebarSearch,
|
|
219
258
|
projectMobileNav2 as projectMobileNav,
|
|
220
|
-
|
|
259
|
+
roomToDockServerFallback,
|
|
260
|
+
useBreakpoint,
|
|
261
|
+
useSizeClass2 as useSizeClass
|
|
221
262
|
};
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* padding), so the 560px cap uses 73% of it; on the smallest supported viewport (320x568) the
|
|
20
20
|
* headroom is ~496px and 72dvh is 409px — the cap is binding on every supported phone, and the row
|
|
21
21
|
* count never is. The old arithmetic here ("6 x 44px + 8px padding against 415px of headroom") was
|
|
22
|
-
* stale in almost every number: rows are
|
|
22
|
+
* stale in almost every number: rows are 44px (`--vx-space-mobile-nav-row-height`), the dropdown's
|
|
23
23
|
* own padding is `2 * --vx-space-stack-xs` = 8px, and the headroom figures above are the measured
|
|
24
24
|
* ones.
|
|
25
25
|
*
|
|
@@ -13,6 +13,14 @@ type AsideRegion = {
|
|
|
13
13
|
folded: boolean;
|
|
14
14
|
claim: () => () => void;
|
|
15
15
|
publishFolded: (folded: boolean) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Bumped by `requestClose` — never 0 again once a close has been requested, so `PageAside` can
|
|
18
|
+
* treat "changed since mount" as "fold now" without a ref of its own. `ShellFrame` is the one
|
|
19
|
+
* caller, on Escape while the aside renders as an overlay.
|
|
20
|
+
*/
|
|
21
|
+
closeSignal: number;
|
|
22
|
+
/** Asks the claiming `PageAside` to fold — the keyboard escape hatch for the overlay form. */
|
|
23
|
+
requestClose: () => void;
|
|
16
24
|
};
|
|
17
25
|
/**
|
|
18
26
|
* Internal — mounted by `BasaltShell` inside `PageBarProvider`. Owns the portal target, the claim
|
|
@@ -21,8 +29,16 @@ type AsideRegion = {
|
|
|
21
29
|
export declare function AsideProvider({ children }: {
|
|
22
30
|
children: ReactNode;
|
|
23
31
|
}): ReactNode;
|
|
24
|
-
/** Internal — the region's state, read by `BasaltShell` to size `AppShell.Aside
|
|
25
|
-
|
|
32
|
+
/** Internal — the region's state, read by `BasaltShell` to size `AppShell.Aside` and to request a
|
|
33
|
+
* close (the Escape hatch on the overlay form). */
|
|
34
|
+
export declare function useAsideRegion(): Pick<AsideRegion, 'claimed' | 'folded' | 'requestClose'>;
|
|
35
|
+
/**
|
|
36
|
+
* Internal — whether an OPEN aside would push the main column (expanded, main keeps its floor)
|
|
37
|
+
* rather than overlay it. Provided by `ShellFrame`, which alone knows the navbar width, from the
|
|
38
|
+
* same render that computes it: a state published after mount would make the first pass read
|
|
39
|
+
* "cannot dock" and fold a default-open aside for one commit.
|
|
40
|
+
*/
|
|
41
|
+
export declare const AsideDocksContext: import("react").Context<boolean>;
|
|
26
42
|
/** Internal — the node inside `AppShell.Aside` the active page's panel portals into. */
|
|
27
43
|
export declare function AsideOutlet({ className }: {
|
|
28
44
|
className?: string;
|
|
@@ -34,7 +50,10 @@ export type PageAsideProps = BasaltProps & SlotStylesProps<PageAsideSlot> & {
|
|
|
34
50
|
title: string;
|
|
35
51
|
/** Persists the fold at `basalt:aside:<persistKey>`. Omit for an unpersisted fold. */
|
|
36
52
|
persistKey?: string;
|
|
37
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* The fold while the user has not chosen one — an explicit (persisted or toggled) choice always
|
|
55
|
+
* wins. @default open where the aside docks beside main, folded where it would overlay it
|
|
56
|
+
*/
|
|
38
57
|
defaultFolded?: boolean;
|
|
39
58
|
children: ReactNode;
|
|
40
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-aside.d.ts","sourceRoot":"","sources":["../../src/shell/page-aside.t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c,GAAG,WAAW,GACtC,eAAe,CAAC,aAAa,CAAC,GAAG;IAC/B,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAA;IACb,sFAAsF;IACtF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAoEH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAyI1D"}
|
package/dist/shell/page-aside.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
2
|
+
import { createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
|
-
import { useMantineTheme } from "@mantine/core";
|
|
5
4
|
import { cx } from "../common/props.js";
|
|
6
5
|
import { assertRequiredProps } from "../common/validate.js";
|
|
7
6
|
import { usePersistedOrLocal } from "../state/persisted-or-local.js";
|
|
8
7
|
import { FilterSetScope } from "../controls/filter-context.js";
|
|
9
8
|
import { useAsidePanelSlot } from "./page-bar.js";
|
|
10
|
-
import { useIsomorphicLayoutEffect } from "
|
|
11
|
-
import {
|
|
9
|
+
import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
|
|
10
|
+
import { useSizeClass } from "./use-size-class.js";
|
|
12
11
|
import classes from "./page-aside.module.css";
|
|
13
12
|
const NO_REGION = {
|
|
14
13
|
target: null,
|
|
@@ -20,6 +19,9 @@ const NO_REGION = {
|
|
|
20
19
|
claim: () => () => {
|
|
21
20
|
},
|
|
22
21
|
publishFolded: () => {
|
|
22
|
+
},
|
|
23
|
+
closeSignal: 0,
|
|
24
|
+
requestClose: () => {
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
const AsideContext = createContext(NO_REGION);
|
|
@@ -27,6 +29,7 @@ function AsideProvider({ children }) {
|
|
|
27
29
|
const [target, setTarget] = useState(null);
|
|
28
30
|
const [claims, setClaims] = useState(0);
|
|
29
31
|
const [folded, setFolded] = useState(false);
|
|
32
|
+
const [closeSignal, setCloseSignal] = useState(0);
|
|
30
33
|
const claim = useCallback(() => {
|
|
31
34
|
setClaims((n) => n + 1);
|
|
32
35
|
return () => {
|
|
@@ -34,6 +37,7 @@ function AsideProvider({ children }) {
|
|
|
34
37
|
setFolded(false);
|
|
35
38
|
};
|
|
36
39
|
}, []);
|
|
40
|
+
const requestClose = useCallback(() => setCloseSignal((n) => n + 1), []);
|
|
37
41
|
const value = {
|
|
38
42
|
target,
|
|
39
43
|
setTarget,
|
|
@@ -41,14 +45,17 @@ function AsideProvider({ children }) {
|
|
|
41
45
|
claimed: claims > 0,
|
|
42
46
|
folded,
|
|
43
47
|
claim,
|
|
44
|
-
publishFolded: setFolded
|
|
48
|
+
publishFolded: setFolded,
|
|
49
|
+
closeSignal,
|
|
50
|
+
requestClose
|
|
45
51
|
};
|
|
46
52
|
return /* @__PURE__ */ jsx(AsideContext.Provider, { value, children });
|
|
47
53
|
}
|
|
48
54
|
function useAsideRegion() {
|
|
49
|
-
const { claimed, folded } = useContext(AsideContext);
|
|
50
|
-
return { claimed, folded };
|
|
55
|
+
const { claimed, folded, requestClose } = useContext(AsideContext);
|
|
56
|
+
return { claimed, folded, requestClose };
|
|
51
57
|
}
|
|
58
|
+
const AsideDocksContext = createContext(false);
|
|
52
59
|
function AsideOutlet({ className }) {
|
|
53
60
|
const { setTarget } = useContext(AsideContext);
|
|
54
61
|
return /* @__PURE__ */ jsx("div", { ref: setTarget, className });
|
|
@@ -111,17 +118,17 @@ function PageAside(props) {
|
|
|
111
118
|
assertRequiredProps("PageAside", props, ["title"], {
|
|
112
119
|
title: "it names the region \u2014 it is the header text AND the `aria-label` on the landmark."
|
|
113
120
|
});
|
|
114
|
-
const { title, persistKey, defaultFolded
|
|
115
|
-
const { target, inShell, claim, publishFolded } = useContext(AsideContext);
|
|
121
|
+
const { title, persistKey, defaultFolded, children, className, style, classNames } = props;
|
|
122
|
+
const { target, inShell, claim, publishFolded, closeSignal } = useContext(AsideContext);
|
|
123
|
+
const docks = useContext(AsideDocksContext);
|
|
116
124
|
const { host: panelHost, claim: claimPanel, target: panelTarget } = useAsidePanelSlot();
|
|
117
|
-
const
|
|
118
|
-
const desktop = useMediaQueryMatches(`(min-width: ${theme.breakpoints.sm})`, true);
|
|
125
|
+
const isCompact = useSizeClass() === "compact";
|
|
119
126
|
const [folded, setFolded] = usePersistedOrLocal({
|
|
120
127
|
scope: "aside",
|
|
121
128
|
persistKey,
|
|
122
|
-
initial: defaultFolded
|
|
129
|
+
initial: defaultFolded ?? !docks
|
|
123
130
|
});
|
|
124
|
-
const portalled = inShell &&
|
|
131
|
+
const portalled = inShell && !isCompact;
|
|
125
132
|
const projected = !portalled && panelHost;
|
|
126
133
|
const [settled, setSettled] = useState(false);
|
|
127
134
|
const panelClaim = useMemo(() => ({ title, icon: /* @__PURE__ */ jsx(IconAsidePanel, {}) }), [title]);
|
|
@@ -136,6 +143,12 @@ function PageAside(props) {
|
|
|
136
143
|
if (!portalled) return;
|
|
137
144
|
publishFolded(folded);
|
|
138
145
|
}, [portalled, folded, publishFolded]);
|
|
146
|
+
const closeSignalBaseline = useRef(closeSignal);
|
|
147
|
+
useIsomorphicLayoutEffect(() => {
|
|
148
|
+
if (!portalled || closeSignal === closeSignalBaseline.current) return;
|
|
149
|
+
closeSignalBaseline.current = closeSignal;
|
|
150
|
+
setFolded(true);
|
|
151
|
+
}, [portalled, closeSignal]);
|
|
139
152
|
useIsomorphicLayoutEffect(() => {
|
|
140
153
|
if (!projected) return;
|
|
141
154
|
return claimPanel(panelClaim);
|
|
@@ -168,6 +181,7 @@ function PageAside(props) {
|
|
|
168
181
|
return createPortal(panel, target);
|
|
169
182
|
}
|
|
170
183
|
export {
|
|
184
|
+
AsideDocksContext,
|
|
171
185
|
AsideOutlet,
|
|
172
186
|
AsideProvider,
|
|
173
187
|
PageAside,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-bar.d.ts","sourceRoot":"","sources":["../../src/shell/page-bar.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"page-bar.d.ts","sourceRoot":"","sources":["../../src/shell/page-bar.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAWnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAK9D,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,wBAAwB,CAAA;AAKxD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,gGAAgG;IAChG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CACzB,CAAA;AAuDD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,QAAQ,GACT,EAAE;IACD,aAAa,EAAE,SAAS,YAAY,EAAE,CAAA;IACtC,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,SAAS,CAsDZ;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAGlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,E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