@newtone-dev/ui-react-web 0.30.0 → 0.32.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/dist/drawer/drawer.d.ts +9 -0
- package/dist/drawer/drawer.d.ts.map +1 -0
- package/dist/drawer/drawer.js +36 -0
- package/dist/drawer/drawer.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/navbar/navbar.css +2 -2
- package/dist/navbar/navbar.d.ts +2 -2
- package/dist/navbar/navbar.d.ts.map +1 -1
- package/dist/navbar/navbar.js +5 -24
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/shell/context.d.ts +14 -0
- package/dist/shell/context.d.ts.map +1 -0
- package/dist/shell/context.js +10 -0
- package/dist/shell/context.js.map +1 -0
- package/dist/shell/header/header.d.ts +12 -0
- package/dist/shell/header/header.d.ts.map +1 -0
- package/dist/shell/header/header.js +10 -0
- package/dist/shell/header/header.js.map +1 -0
- package/dist/shell/index.d.ts +7 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +4 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/panel/panel.d.ts +11 -0
- package/dist/shell/panel/panel.d.ts.map +1 -0
- package/dist/shell/panel/panel.js +9 -0
- package/dist/shell/panel/panel.js.map +1 -0
- package/dist/shell/panel-link/panel-link.d.ts +14 -0
- package/dist/shell/panel-link/panel-link.d.ts.map +1 -0
- package/dist/shell/panel-link/panel-link.js +16 -0
- package/dist/shell/panel-link/panel-link.js.map +1 -0
- package/dist/shell/shell.css +241 -0
- package/dist/shell/shell.d.ts +66 -0
- package/dist/shell/shell.d.ts.map +1 -0
- package/dist/shell/shell.js +82 -0
- package/dist/shell/shell.js.map +1 -0
- package/dist/shell/toggle/toggle.d.ts +15 -0
- package/dist/shell/toggle/toggle.d.ts.map +1 -0
- package/dist/shell/toggle/toggle.js +13 -0
- package/dist/shell/toggle/toggle.js.map +1 -0
- package/dist/{page → site}/band.d.ts +8 -8
- package/dist/{page → site}/band.d.ts.map +1 -1
- package/dist/{page → site}/band.js +12 -12
- package/dist/{page → site}/band.js.map +1 -1
- package/dist/{page → site}/footer.d.ts +11 -11
- package/dist/{page → site}/footer.d.ts.map +1 -1
- package/dist/site/footer.js +30 -0
- package/dist/{page → site}/footer.js.map +1 -1
- package/dist/site/index.d.ts +5 -0
- package/dist/{page → site}/index.d.ts.map +1 -1
- package/dist/site/index.js +8 -0
- package/dist/{page → site}/index.js.map +1 -1
- package/dist/{page/page.css → site/site.css} +70 -68
- package/dist/{page/page.d.ts → site/site.d.ts} +29 -27
- package/dist/site/site.d.ts.map +1 -0
- package/dist/{page/page.js → site/site.js} +17 -17
- package/dist/site/site.js.map +1 -0
- package/dist/text/selection-paint.d.ts +1 -1
- package/dist/text/selection-paint.js +1 -1
- package/package.json +10 -5
- package/dist/page/footer.js +0 -30
- package/dist/page/index.d.ts +0 -5
- package/dist/page/index.js +0 -8
- package/dist/page/page.d.ts.map +0 -1
- package/dist/page/page.js.map +0 -1
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/* An app's frame: the panel, the column, and the five states the panel can be in.
|
|
2
|
+
*
|
|
3
|
+
* Every colour is a ROLE: Shell has no token group (DECISIONS 2026-10-09, a component reads the roles
|
|
4
|
+
* and a slice is earned). The panel is `deep` and the column the root's rung; elevation is what tells
|
|
5
|
+
* them apart.
|
|
6
|
+
*
|
|
7
|
+
* LENGTHS IT DECIDES, each a measure of something (section 5, *a shape nobody may vary*):
|
|
8
|
+
* 16rem the full panel -- the longest label newtone_app has at body size, with its icon, its
|
|
9
|
+
* padding and room for one more word
|
|
10
|
+
* 4rem the rail -- a 44px hit area and 10px either side; the same 64 the header's row is tall
|
|
11
|
+
* 1px the hairlines, as everywhere in this library: border width has no core scale
|
|
12
|
+
*
|
|
13
|
+
* The state is `data-newtone-shell-state` on the root: full | rail | overlay | drawer | hidden.
|
|
14
|
+
* The two widths are typed out as in navbar.css and site.css -- a media query cannot read a custom
|
|
15
|
+
* property, and `node tools/check-breakpoints.mjs` keeps the copies honest.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
.newtone-shell {
|
|
19
|
+
--_shell-full: 16rem;
|
|
20
|
+
--_shell-rail: 4rem;
|
|
21
|
+
--_shell-row: calc(var(--newtone-space-16) + 1px);
|
|
22
|
+
--_shell-ink: var(--newtone-role-text-primary);
|
|
23
|
+
position: relative;
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-template-columns: var(--_shell-full) minmax(0, 1fr);
|
|
26
|
+
block-size: 100dvh;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
background: var(--newtone-role-surface-primary);
|
|
29
|
+
color: var(--newtone-role-text-primary);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.newtone-shell[data-newtone-shell-state='rail'],
|
|
33
|
+
.newtone-shell[data-newtone-shell-state='overlay'] {
|
|
34
|
+
grid-template-columns: var(--_shell-rail) minmax(0, 1fr);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.newtone-shell[data-newtone-shell-state='drawer'],
|
|
38
|
+
.newtone-shell[data-newtone-shell-state='hidden'] {
|
|
39
|
+
grid-template-columns: minmax(0, 1fr);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ---- the panel ------------------------------------------------------------ */
|
|
43
|
+
|
|
44
|
+
.newtone-shell-panel {
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
min-block-size: 0;
|
|
49
|
+
inline-size: 100%;
|
|
50
|
+
overflow-x: hidden;
|
|
51
|
+
overflow-y: auto;
|
|
52
|
+
background: var(--newtone-role-surface-primary);
|
|
53
|
+
color: var(--newtone-role-text-primary);
|
|
54
|
+
border-inline-end: 1px solid var(--newtone-role-divider);
|
|
55
|
+
z-index: 2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.newtone-shell-brand {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
flex: none;
|
|
62
|
+
block-size: var(--_shell-row);
|
|
63
|
+
padding-inline: var(--newtone-space-4);
|
|
64
|
+
border-block-end: 1px solid var(--newtone-role-divider);
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
white-space: nowrap;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.newtone-shell-links {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: var(--newtone-space-1);
|
|
73
|
+
margin: 0;
|
|
74
|
+
padding: var(--newtone-space-3) 10px;
|
|
75
|
+
list-style: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.newtone-shell-link {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: var(--newtone-space-3);
|
|
82
|
+
min-block-size: 44px;
|
|
83
|
+
padding-inline: 10px;
|
|
84
|
+
border-radius: var(--newtone-radius-md);
|
|
85
|
+
color: inherit;
|
|
86
|
+
text-decoration: none;
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.newtone-shell-link:hover {
|
|
91
|
+
background: var(--newtone-role-surface-secondary);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.newtone-shell-link[aria-current='page'] {
|
|
95
|
+
background: var(--newtone-role-surface-secondary);
|
|
96
|
+
color: var(--newtone-role-text-accent);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.newtone-shell-link:focus-visible {
|
|
100
|
+
outline: 2px solid var(--newtone-role-text-accent);
|
|
101
|
+
outline-offset: -2px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.newtone-shell-link-icon {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
flex: none;
|
|
107
|
+
inline-size: 24px;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* THE RAIL: icons only. The label is hidden visually and stays the link's accessible name. */
|
|
112
|
+
.newtone-shell[data-newtone-shell-state='rail'] .newtone-shell-panel:not(:hover):not(:focus-within) .newtone-shell-link-label {
|
|
113
|
+
position: absolute;
|
|
114
|
+
inline-size: 1px;
|
|
115
|
+
block-size: 1px;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
clip-path: inset(50%);
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@media (hover: none) {
|
|
122
|
+
.newtone-shell[data-newtone-shell-state='rail'] .newtone-shell-panel:not(:focus-within) .newtone-shell-link-label {
|
|
123
|
+
position: absolute;
|
|
124
|
+
inline-size: 1px;
|
|
125
|
+
block-size: 1px;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
clip-path: inset(50%);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* OVER <main>, NOT BESIDE IT. The overlay, and the rail opened by hover or focus, take the full
|
|
132
|
+
width while the grid column stays the rail's -- so <main>'s inline size never changes. */
|
|
133
|
+
.newtone-shell[data-newtone-shell-state='overlay'] .newtone-shell-panel,
|
|
134
|
+
.newtone-shell[data-newtone-shell-state='rail'] .newtone-shell-panel:focus-within {
|
|
135
|
+
position: absolute;
|
|
136
|
+
inset-block: 0;
|
|
137
|
+
inset-inline-start: 0;
|
|
138
|
+
inline-size: var(--_shell-full);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@media (hover: hover) {
|
|
142
|
+
.newtone-shell[data-newtone-shell-state='rail'] .newtone-shell-panel:hover {
|
|
143
|
+
position: absolute;
|
|
144
|
+
inset-block: 0;
|
|
145
|
+
inset-inline-start: 0;
|
|
146
|
+
inline-size: var(--_shell-full);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.newtone-shell[data-newtone-shell-state='overlay'] .newtone-shell-panel,
|
|
151
|
+
.newtone-shell[data-newtone-shell-state='drawer'] .newtone-shell-panel,
|
|
152
|
+
.newtone-shell[data-newtone-shell-state='rail'] .newtone-shell-panel:is(:hover, :focus-within) {
|
|
153
|
+
box-shadow:
|
|
154
|
+
0 var(--newtone-shadow-raised-contact-y) var(--newtone-shadow-raised-contact-blur)
|
|
155
|
+
color-mix(in oklab, var(--_shell-ink) var(--newtone-shadow-raised-strength-contact), transparent),
|
|
156
|
+
0 var(--newtone-shadow-raised-ambient-y) var(--newtone-shadow-raised-ambient-blur)
|
|
157
|
+
color-mix(in oklab, var(--_shell-ink) var(--newtone-shadow-raised-strength-ambient), transparent);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* THE DRAWER, below `compact`: no rail, no icons; the panel slides in from the left over a scrim. */
|
|
161
|
+
.newtone-shell[data-newtone-shell-state='hidden'] .newtone-shell-panel,
|
|
162
|
+
.newtone-shell[data-newtone-shell-state='drawer'] .newtone-shell-panel {
|
|
163
|
+
position: fixed;
|
|
164
|
+
inset-block: 0;
|
|
165
|
+
inset-inline-start: 0;
|
|
166
|
+
inline-size: min(var(--_shell-full), 85vw);
|
|
167
|
+
z-index: 3;
|
|
168
|
+
transition: transform var(--newtone-motion-duration-quick) var(--newtone-motion-easing-standard);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.newtone-shell[data-newtone-shell-state='hidden'] .newtone-shell-panel {
|
|
172
|
+
transform: translateX(-100%);
|
|
173
|
+
visibility: hidden;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.newtone-shell-scrim {
|
|
177
|
+
position: fixed;
|
|
178
|
+
inset: 0;
|
|
179
|
+
z-index: 2;
|
|
180
|
+
background: color-mix(in oklab, var(--_shell-ink) 32%, transparent);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@media (prefers-reduced-motion: reduce) {
|
|
184
|
+
.newtone-shell-panel {
|
|
185
|
+
transition: none;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* ---- the column ----------------------------------------------------------- */
|
|
190
|
+
|
|
191
|
+
.newtone-shell-column {
|
|
192
|
+
display: grid;
|
|
193
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
194
|
+
grid-column: -2;
|
|
195
|
+
min-inline-size: 0;
|
|
196
|
+
min-block-size: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.newtone-shell-header {
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
gap: var(--newtone-space-3);
|
|
203
|
+
block-size: var(--_shell-row);
|
|
204
|
+
padding-inline: var(--newtone-space-4);
|
|
205
|
+
border-block-end: 1px solid var(--newtone-role-divider);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.newtone-shell-main {
|
|
209
|
+
min-block-size: 0;
|
|
210
|
+
overflow: auto;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.newtone-shell-footer {
|
|
214
|
+
padding: var(--newtone-space-3) var(--newtone-space-4);
|
|
215
|
+
border-block-start: 1px solid var(--newtone-role-divider);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.newtone-shell-toggle {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
flex: none;
|
|
223
|
+
inline-size: 44px;
|
|
224
|
+
block-size: 44px;
|
|
225
|
+
margin-inline-start: calc(-1 * var(--newtone-space-2));
|
|
226
|
+
padding: 0;
|
|
227
|
+
border: 0;
|
|
228
|
+
border-radius: var(--newtone-radius-md);
|
|
229
|
+
background: transparent;
|
|
230
|
+
color: inherit;
|
|
231
|
+
cursor: pointer;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.newtone-shell-toggle:hover {
|
|
235
|
+
background: var(--newtone-role-surface-secondary);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.newtone-shell-toggle:focus-visible {
|
|
239
|
+
outline: 2px solid var(--newtone-role-text-accent);
|
|
240
|
+
outline-offset: 2px;
|
|
241
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type Mode, type Theme } from '../surface/index.js';
|
|
3
|
+
import { ShellPanel } from './panel/panel.js';
|
|
4
|
+
import { ShellPanelLink } from './panel-link/panel-link.js';
|
|
5
|
+
import { ShellHeader } from './header/header.js';
|
|
6
|
+
import { ShellToggle } from './toggle/toggle.js';
|
|
7
|
+
/**
|
|
8
|
+
* An app's frame: a primary navigation panel on the left, and beside it a column of a header,
|
|
9
|
+
* `<main>` and a footer. Its sibling for websites is `Site`, and the two are separate components on
|
|
10
|
+
* purpose -- production/newtone/_blueprint/DECISIONS/2026-10-09-two-frames-site-and-shell.md.
|
|
11
|
+
* Discharges production/newtone/ui_react-web/_blueprint/components/shell.md.
|
|
12
|
+
*
|
|
13
|
+
* ---- the panel at each width ---------------------------------------------
|
|
14
|
+
*
|
|
15
|
+
* wide >= 80rem open: the full panel, docked closed: the rail, docked
|
|
16
|
+
* between 48-80rem open: the full panel OVER <main> closed: the rail
|
|
17
|
+
* compact < 48rem open: a drawer from the left closed: nothing
|
|
18
|
+
*
|
|
19
|
+
* Joshua, 2026-10-09: *"the panel would appear over the main content, instead of shrinking the main
|
|
20
|
+
* content."* So between the two breakpoints the grid column stays the rail's 4rem whatever the panel
|
|
21
|
+
* shows, and the full panel is positioned over the column -- <main>'s width is the same open and
|
|
22
|
+
* closed. Hover and focus over the rail open it the same way, from CSS, without touching `open`.
|
|
23
|
+
*
|
|
24
|
+
* ---- `open` means "the panel shows in full", and its default is the width's
|
|
25
|
+
*
|
|
26
|
+
* True at `wide`, false below it, read once on mount and RESET when a breakpoint is crossed. One
|
|
27
|
+
* boolean carried across widths would arrive at a phone as an open drawer nobody asked for. A
|
|
28
|
+
* consumer controlling `open` receives the reset as an `onOpenChange` call and may refuse it.
|
|
29
|
+
*
|
|
30
|
+
* ---- the document never scrolls -----------------------------------------
|
|
31
|
+
*
|
|
32
|
+
* The root is one screen tall; the panel's list and <main> each scroll. Nothing here is sticky,
|
|
33
|
+
* which is the difference from a Site, whose document scrolls under a sticky bar.
|
|
34
|
+
*
|
|
35
|
+
* ---- elevation -------------------------------------------------------------
|
|
36
|
+
*
|
|
37
|
+
* The panel is `deep`; the header, <main> and the footer are the root's rung; cards inside take
|
|
38
|
+
* `high`. A frame places its own regions on the ladder -- the one place section 5's first row lets a
|
|
39
|
+
* component decide a facet. Joshua: *"the shell's nav would be deep too."*
|
|
40
|
+
*/
|
|
41
|
+
export interface ShellProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
42
|
+
/** The panel's top row. In the rail a site hides its wordmark with its own rule on `[data-newtone-shell-state="rail"]`. */
|
|
43
|
+
brand?: ReactNode;
|
|
44
|
+
/** `Shell.Panel` and its links. */
|
|
45
|
+
panel?: ReactNode;
|
|
46
|
+
/** `Shell.Header`: the toggle first, then the app's tools. */
|
|
47
|
+
header?: ReactNode;
|
|
48
|
+
/** The column's footer. Omitted, there is no footer row and no hairline above it. */
|
|
49
|
+
footer?: ReactNode;
|
|
50
|
+
/** Whether the panel shows in full. Controlled or not, as Navbar's `open` is. */
|
|
51
|
+
open?: boolean;
|
|
52
|
+
onOpenChange?: (open: boolean) => void;
|
|
53
|
+
/** Forwarded to the root `Surface`, read nowhere here. */
|
|
54
|
+
theme?: Theme;
|
|
55
|
+
/** Forwarded to the root `Surface`, read nowhere here. */
|
|
56
|
+
mode?: Mode;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export declare function Shell({ brand, panel, header, footer, open: openProp, onOpenChange, theme, mode, className, children, ...rest }: ShellProps): import("react").JSX.Element;
|
|
60
|
+
export declare namespace Shell {
|
|
61
|
+
export { ShellPanel as Panel };
|
|
62
|
+
export { ShellPanelLink as PanelLink };
|
|
63
|
+
export { ShellHeader as Header };
|
|
64
|
+
export { ShellToggle as Toggle };
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +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U,+BA6EZ;yBAzFe,KAAK;aA4FP,UAAU;aACN,cAAc;aACjB,WAAW;aACX,WAAW"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useRef, useState } from 'react';
|
|
3
|
+
import { Surface } from '../surface/index.js';
|
|
4
|
+
import { useDrawer } from '../drawer/drawer.js';
|
|
5
|
+
import { ShellContext } from './context.js';
|
|
6
|
+
import { ShellPanel } from './panel/panel.js';
|
|
7
|
+
import { ShellPanelLink } from './panel-link/panel-link.js';
|
|
8
|
+
import { ShellHeader } from './header/header.js';
|
|
9
|
+
import { ShellToggle } from './toggle/toggle.js';
|
|
10
|
+
// The two widths are typed out here as they are in navbar.css and site.css: a media query cannot
|
|
11
|
+
// read a custom property. `node tools/check-breakpoints.mjs`, from ~/source, keeps the copies honest.
|
|
12
|
+
const WIDE = '(min-width: 80rem)';
|
|
13
|
+
const BETWEEN = '(min-width: 48rem)';
|
|
14
|
+
function widthNow() {
|
|
15
|
+
if (typeof window === 'undefined')
|
|
16
|
+
return 'wide';
|
|
17
|
+
if (window.matchMedia(WIDE).matches)
|
|
18
|
+
return 'wide';
|
|
19
|
+
if (window.matchMedia(BETWEEN).matches)
|
|
20
|
+
return 'between';
|
|
21
|
+
return 'compact';
|
|
22
|
+
}
|
|
23
|
+
function stateOf(width, open) {
|
|
24
|
+
if (width === 'wide')
|
|
25
|
+
return open ? 'full' : 'rail';
|
|
26
|
+
if (width === 'between')
|
|
27
|
+
return open ? 'overlay' : 'rail';
|
|
28
|
+
return open ? 'drawer' : 'hidden';
|
|
29
|
+
}
|
|
30
|
+
export function Shell({ brand, panel, header, footer, open: openProp, onOpenChange, theme, mode, className, children, ...rest }) {
|
|
31
|
+
const [width, setWidth] = useState(widthNow);
|
|
32
|
+
const { open, setOpen, triggerRef } = useDrawer(openProp, onOpenChange, width === 'wide');
|
|
33
|
+
const panelId = useId();
|
|
34
|
+
const panelRef = useRef(null);
|
|
35
|
+
const columnRef = useRef(null);
|
|
36
|
+
const state = stateOf(width, open);
|
|
37
|
+
// A breakpoint crossed resets `open` to the new width's default.
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const queries = [window.matchMedia(WIDE), window.matchMedia(BETWEEN)];
|
|
40
|
+
const onChange = () => {
|
|
41
|
+
const next = widthNow();
|
|
42
|
+
setWidth(next);
|
|
43
|
+
setOpen(next === 'wide');
|
|
44
|
+
};
|
|
45
|
+
queries.forEach(q => q.addEventListener('change', onChange));
|
|
46
|
+
return () => queries.forEach(q => q.removeEventListener('change', onChange));
|
|
47
|
+
}, [setOpen]);
|
|
48
|
+
// The drawer: <main> is inert behind it, and focus moves into it, since the toggle would
|
|
49
|
+
// otherwise be the only reachable thing left on the screen. Written as an attribute rather than
|
|
50
|
+
// the `inert` prop, which React 18 does not know.
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const column = columnRef.current;
|
|
53
|
+
if (!column)
|
|
54
|
+
return;
|
|
55
|
+
if (state === 'drawer') {
|
|
56
|
+
column.setAttribute('inert', '');
|
|
57
|
+
panelRef.current?.querySelector('a, button')?.focus();
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
column.removeAttribute('inert');
|
|
61
|
+
}, [state]);
|
|
62
|
+
// An overlay opened by the toggle closes on a click outside the panel.
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (state !== 'overlay')
|
|
65
|
+
return;
|
|
66
|
+
const onPointerDown = (event) => {
|
|
67
|
+
const target = event.target;
|
|
68
|
+
if (panelRef.current?.contains(target) || triggerRef.current?.contains(target))
|
|
69
|
+
return;
|
|
70
|
+
setOpen(false);
|
|
71
|
+
};
|
|
72
|
+
document.addEventListener('pointerdown', onPointerDown);
|
|
73
|
+
return () => document.removeEventListener('pointerdown', onPointerDown);
|
|
74
|
+
}, [state, setOpen, triggerRef]);
|
|
75
|
+
return (_jsx(ShellContext.Provider, { value: { open, setOpen, state, panelId, triggerRef }, children: _jsxs(Surface, { ...rest, theme: theme, mode: mode, className: ['newtone-shell', className].filter(Boolean).join(' '), "data-newtone-shell-state": state, children: [_jsxs("nav", { ref: panelRef, id: panelId, "data-newtone-surface": "", "data-newtone-elevation": "deep", "aria-label": "Primary", className: "newtone-shell-panel", children: [brand === undefined ? null : _jsx("div", { className: "newtone-shell-brand", children: brand }), panel] }), _jsxs("div", { ref: columnRef, className: "newtone-shell-column", children: [header, _jsx("main", { className: "newtone-shell-main", children: children }), footer === undefined ? null : _jsx("footer", { className: "newtone-shell-footer", children: footer })] }), state === 'drawer' ? (_jsx("div", { className: "newtone-shell-scrim", "aria-hidden": "true", onClick: () => setOpen(false) })) : null] }) }));
|
|
76
|
+
}
|
|
77
|
+
/** The parts hang off `Shell` and are exported nowhere else, as `Navbar`'s and `Site`'s are. */
|
|
78
|
+
Shell.Panel = ShellPanel;
|
|
79
|
+
Shell.PanelLink = ShellPanelLink;
|
|
80
|
+
Shell.Header = ShellHeader;
|
|
81
|
+
Shell.Toggle = ShellToggle;
|
|
82
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/shell/shell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAA;AAC/F,OAAO,EAAE,OAAO,EAAyB,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAyDhD,i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AAE,QAAQ,GAAQ,EACrD,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAQ,SAAS,EAAC,sBAAsB,YAAE,MAAM,GAAU,IACvF,EACL,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAClB,cAAK,SAAS,EAAC,qBAAqB,iBAAa,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,CAC5F,CAAC,CAAC,CAAC,IAAI,IACF,GACU,CAC3B,CAAA;AACL,CAAC;AAED,gGAAgG;AAChG,KAAK,CAAC,KAAK,GAAG,UAAU,CAAA;AACxB,KAAK,CAAC,SAAS,GAAG,cAAc,CAAA;AAChC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAA;AAC1B,KAAK,CAAC,MAAM,GAAG,WAAW,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ShellToggleProps {
|
|
3
|
+
/** The button's accessible name. */
|
|
4
|
+
label: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
/** The glyph. Omitted, the `menu` icon. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Opens and closes the panel. **It goes first in `Shell.Header`, on the left**, where a `Site`'s menu
|
|
11
|
+
* button is the last thing in its bar, on the right -- each trigger sits where its kind of product
|
|
12
|
+
* puts it. contracts/navbar/the-trigger-side-and-the-link-count.md.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ShellToggle({ label, className, children }: ShellToggleProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/shell/toggle/toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,gBAAgB;IAC7B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAe3E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '../../icon/icon.js';
|
|
3
|
+
import { useShell } from '../context.js';
|
|
4
|
+
/**
|
|
5
|
+
* Opens and closes the panel. **It goes first in `Shell.Header`, on the left**, where a `Site`'s menu
|
|
6
|
+
* button is the last thing in its bar, on the right -- each trigger sits where its kind of product
|
|
7
|
+
* puts it. contracts/navbar/the-trigger-side-and-the-link-count.md.
|
|
8
|
+
*/
|
|
9
|
+
export function ShellToggle({ label, className, children }) {
|
|
10
|
+
const { open, setOpen, panelId, triggerRef } = useShell('Toggle');
|
|
11
|
+
return (_jsx("button", { ref: triggerRef, type: "button", "aria-label": label, "aria-expanded": open, "aria-controls": panelId, className: ['newtone-shell-toggle', className].filter(Boolean).join(' '), onClick: () => setOpen(!open), children: children ?? _jsx(Icon, { name: "menu" }) }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../../src/shell/toggle/toggle.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAUxC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAoB;IACxE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACjE,OAAO,CACH,iBACI,GAAG,EAAE,UAAU,EACf,IAAI,EAAC,QAAQ,gBACD,KAAK,mBACF,IAAI,mBACJ,OAAO,EACtB,SAAS,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACxE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAE5B,QAAQ,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GAC5B,CACZ,CAAA;AACL,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Elevation, type Mode, type Theme } from '../surface/index.js';
|
|
2
2
|
import type { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
import type { SpaceStep } from '../wrapper/index.js';
|
|
4
|
-
export interface
|
|
4
|
+
export interface SiteBandProps extends HTMLAttributes<HTMLElement> {
|
|
5
5
|
/** The band's element. Omitted means `section`. */
|
|
6
6
|
as?: ElementType;
|
|
7
7
|
/**
|
|
@@ -19,11 +19,11 @@ export interface PageBandProps extends HTMLAttributes<HTMLElement> {
|
|
|
19
19
|
theme?: Theme;
|
|
20
20
|
mode?: Mode;
|
|
21
21
|
elevation?: Elevation;
|
|
22
|
-
/** Space between the band's children. 0.26.0; omitted, `8` from 0.27.0. components/
|
|
22
|
+
/** Space between the band's children. 0.26.0; omitted, `8` from 0.27.0. components/site.md. */
|
|
23
23
|
gap?: SpaceStep;
|
|
24
|
-
/** The band's padding above and below. 0.26.0; omitted, `12` from 0.27.0. components/
|
|
24
|
+
/** The band's padding above and below. 0.26.0; omitted, `12` from 0.27.0. components/site.md. */
|
|
25
25
|
padding?: SpaceStep;
|
|
26
|
-
/** One screenful under the bar, its content centred in it. 0.26.0; components/
|
|
26
|
+
/** One screenful under the bar, its content centred in it. 0.26.0; components/site.md. */
|
|
27
27
|
fold?: boolean;
|
|
28
28
|
children?: ReactNode;
|
|
29
29
|
}
|
|
@@ -49,11 +49,11 @@ export interface PageBandProps extends HTMLAttributes<HTMLElement> {
|
|
|
49
49
|
* exactly that question.
|
|
50
50
|
*
|
|
51
51
|
* **The cap arrives as a custom property and not as a prop**, because a band is a child the
|
|
52
|
-
* CONSUMER renders: `
|
|
53
|
-
* named in components/
|
|
52
|
+
* CONSUMER renders: `Site` cannot pass it anything. The two alternatives are both worse and both
|
|
53
|
+
* named in components/site.md -- a React context makes every band a client component, and a prop
|
|
54
54
|
* per band is one number written once per section.
|
|
55
55
|
*
|
|
56
|
-
* Discharges production/newtone/ui_react-web/_blueprint/components/
|
|
56
|
+
* Discharges production/newtone/ui_react-web/_blueprint/components/site.md, *The band*.
|
|
57
57
|
*/
|
|
58
|
-
export declare function
|
|
58
|
+
export declare function SiteBand({ as: As, theme, mode, elevation, gap, padding, fold, className, children, ...rest }: SiteBandProps): import("react").JSX.Element;
|
|
59
59
|
//# sourceMappingURL=band.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"band.d.ts","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"band.d.ts","sourceRoot":"","sources":["../../src/site/band.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,KAAK,EAAiB,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAClF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,mDAAmD;IACnD,EAAE,CAAC,EAAE,WAAW,CAAA;IAChB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,+FAA+F;IAC/F,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,iGAAiG;IACjG,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CAAC,EACrB,EAAE,EAAE,EAAc,EAClB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,GAAO,EACP,OAAY,EACZ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,aAAa,+BAmCf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// The subpaths, not the barrel, for the reason
|
|
2
|
+
// The subpaths, not the barrel, for the reason site.tsx gives: this renders inside server
|
|
3
3
|
// components and must not reach anything that calls a hook. See the repo blueprint, section 4.3.
|
|
4
4
|
import { Surface } from '../surface/index.js';
|
|
5
5
|
/**
|
|
@@ -24,28 +24,28 @@ import { Surface } from '../surface/index.js';
|
|
|
24
24
|
* exactly that question.
|
|
25
25
|
*
|
|
26
26
|
* **The cap arrives as a custom property and not as a prop**, because a band is a child the
|
|
27
|
-
* CONSUMER renders: `
|
|
28
|
-
* named in components/
|
|
27
|
+
* CONSUMER renders: `Site` cannot pass it anything. The two alternatives are both worse and both
|
|
28
|
+
* named in components/site.md -- a React context makes every band a client component, and a prop
|
|
29
29
|
* per band is one number written once per section.
|
|
30
30
|
*
|
|
31
|
-
* Discharges production/newtone/ui_react-web/_blueprint/components/
|
|
31
|
+
* Discharges production/newtone/ui_react-web/_blueprint/components/site.md, *The band*.
|
|
32
32
|
*/
|
|
33
|
-
export function
|
|
33
|
+
export function SiteBand({ as: As = 'section', theme, mode, elevation, gap = 8, padding = 12, fold, className, children, ...rest }) {
|
|
34
34
|
// THE RHYTHM IS THE TRACK'S: 8 / 12 BY DEFAULT FROM 0.27.0, the house's band
|
|
35
35
|
// (assembling-a-site.md §3). `gap={0} padding={0}` with no `fold` is the opt-out, and it renders
|
|
36
36
|
// what 0.25 rendered -- a block track, not a flex column -- because a flex column stops margins
|
|
37
|
-
// collapsing and the two sites that opt out lay out their own. components/
|
|
37
|
+
// collapsing and the two sites that opt out lay out their own. components/site.md.
|
|
38
38
|
const flows = gap !== 0 || padding !== 0 || fold === true;
|
|
39
39
|
const track = flows
|
|
40
40
|
? {
|
|
41
|
-
'--newtone-
|
|
42
|
-
'--newtone-
|
|
41
|
+
'--newtone-site-band-gap': `var(--newtone-space-${gap})`,
|
|
42
|
+
'--newtone-site-band-padding': `var(--newtone-space-${padding})`,
|
|
43
43
|
}
|
|
44
44
|
: undefined;
|
|
45
|
-
return (_jsx(Surface, { as: As, theme: theme, mode: mode, elevation: elevation, className: ['newtone-
|
|
46
|
-
'newtone-
|
|
47
|
-
flows && 'newtone-
|
|
48
|
-
fold && 'newtone-
|
|
45
|
+
return (_jsx(Surface, { as: As, theme: theme, mode: mode, elevation: elevation, className: ['newtone-site-band', className].filter(Boolean).join(' '), ...rest, children: _jsx("div", { className: [
|
|
46
|
+
'newtone-site-track',
|
|
47
|
+
flows && 'newtone-site-track--flow',
|
|
48
|
+
fold && 'newtone-site-track--fold',
|
|
49
49
|
]
|
|
50
50
|
.filter(Boolean)
|
|
51
51
|
.join(' '), style: track, children: children }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"band.js","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"band.js","sourceRoot":"","sources":["../../src/site/band.tsx"],"names":[],"mappings":";AAAA,0FAA0F;AAC1F,iGAAiG;AACjG,OAAO,EAAE,OAAO,EAAyC,MAAM,qBAAqB,CAAA;AA+BpF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,QAAQ,CAAC,EACrB,EAAE,EAAE,EAAE,GAAG,SAAS,EAClB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,GAAG,GAAG,CAAC,EACP,OAAO,GAAG,EAAE,EACZ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACK;IACZ,6EAA6E;IAC7E,iGAAiG;IACjG,gGAAgG;IAChG,mFAAmF;IACnF,MAAM,KAAK,GAAG,GAAG,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,CAAA;IACzD,MAAM,KAAK,GAA8B,KAAK;QAC1C,CAAC,CAAE;YACG,yBAAyB,EAAE,uBAAuB,GAAG,GAAG;YACxD,6BAA6B,EAAE,uBAAuB,OAAO,GAAG;SACjD;QACrB,CAAC,CAAC,SAAS,CAAA;IACf,OAAO,CACH,KAAC,OAAO,IACJ,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACjE,IAAI,YAER,cACI,SAAS,EAAE;gBACP,oBAAoB;gBACpB,KAAK,IAAI,0BAA0B;gBACnC,IAAI,IAAI,0BAA0B;aACrC;iBACI,MAAM,CAAC,OAAO,CAAC;iBACf,IAAI,CAAC,GAAG,CAAC,EACd,KAAK,EAAE,KAAK,YAEX,QAAQ,GACP,GACA,CACb,CAAA;AACL,CAAC"}
|
|
@@ -5,13 +5,13 @@ import { type ReactNode } from 'react';
|
|
|
5
5
|
* contact beside columns of links under eyebrows, a rule, a bottom bar -- written once, with
|
|
6
6
|
* adenario's numbers, after three sites had written them by hand (adenario, Andrea's, Fluxus's).
|
|
7
7
|
* They render inside the footer slot's own track, so none of them pays a gutter.
|
|
8
|
-
* components/
|
|
8
|
+
* components/site.md, *The footer's parts*; assembling-a-site.md §6.
|
|
9
9
|
*
|
|
10
10
|
* A SITE FILLS THE SLOTS IT HAS CONTENT FOR. There is no slot for a city, social accounts, legal
|
|
11
11
|
* pages or mode controls: a site with one puts it in the bar's or the brand's children, and the
|
|
12
12
|
* slot is built when a second site has the same thing to put there.
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface SiteFooterProps {
|
|
15
15
|
/** `FooterBrand` and `FooterColumn`s, then at most one `FooterBar`. */
|
|
16
16
|
children?: ReactNode;
|
|
17
17
|
}
|
|
@@ -20,8 +20,8 @@ export interface PageFooterProps {
|
|
|
20
20
|
* the bar follows. Children are sorted by type rather than by a slot prop so a site writes them in
|
|
21
21
|
* reading order.
|
|
22
22
|
*/
|
|
23
|
-
export declare function
|
|
24
|
-
export interface
|
|
23
|
+
export declare function SiteFooter({ children }: SiteFooterProps): import("react").JSX.Element;
|
|
24
|
+
export interface SiteFooterBrandProps {
|
|
25
25
|
/** Where the mark goes; a site's home. */
|
|
26
26
|
href: string;
|
|
27
27
|
/** The link's accessible name, e.g. "Joshua Allen, home". */
|
|
@@ -31,8 +31,8 @@ export interface PageFooterBrandProps {
|
|
|
31
31
|
/** The ways to reach the owner, each a line. */
|
|
32
32
|
children?: ReactNode;
|
|
33
33
|
}
|
|
34
|
-
export declare function
|
|
35
|
-
export interface
|
|
34
|
+
export declare function SiteFooterBrand({ href, label, mark, children }: SiteFooterBrandProps): import("react").JSX.Element;
|
|
35
|
+
export interface SiteFooterColumnProps {
|
|
36
36
|
/**
|
|
37
37
|
* Set as an eyebrow in capitals -- the one place a heading is at eyebrow scale. Any content, so
|
|
38
38
|
* a site can mark a title it has not confirmed.
|
|
@@ -41,17 +41,17 @@ export interface PageFooterColumnProps {
|
|
|
41
41
|
/** `FooterLink`s. */
|
|
42
42
|
children?: ReactNode;
|
|
43
43
|
}
|
|
44
|
-
export declare function
|
|
45
|
-
export interface
|
|
44
|
+
export declare function SiteFooterColumn({ title, children }: SiteFooterColumnProps): import("react").JSX.Element;
|
|
45
|
+
export interface SiteFooterLinkProps {
|
|
46
46
|
href: string;
|
|
47
47
|
children?: ReactNode;
|
|
48
48
|
}
|
|
49
|
-
export declare function
|
|
50
|
-
export interface
|
|
49
|
+
export declare function SiteFooterLink({ href, children }: SiteFooterLinkProps): import("react").JSX.Element;
|
|
50
|
+
export interface SiteFooterBarProps {
|
|
51
51
|
/** The copyright line, e.g. "© 2026 Joshua Allen". */
|
|
52
52
|
copyright?: string;
|
|
53
53
|
/** Whatever small print the site has, after the copyright. */
|
|
54
54
|
children?: ReactNode;
|
|
55
55
|
}
|
|
56
|
-
export declare function
|
|
56
|
+
export declare function SiteFooterBar({ copyright, children }: SiteFooterBarProps): import("react").JSX.Element;
|
|
57
57
|
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/site/footer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhD;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,eAAe;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAoBvD;AAED,MAAM,WAAW,oBAAoB;IACjC,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,IAAI,EAAE,SAAS,CAAA;IACf,gDAAgD;IAChD,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,oBAAoB,+BAepF;AAED,MAAM,WAAW,qBAAq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