@artstorefronts/arthelper-nav 0.1.0-alpha.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/README.md +266 -0
- package/dist/config.d.ts +23 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +134 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +21 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +12 -0
- package/dist/context.js.map +1 -0
- package/dist/cookie.d.ts +13 -0
- package/dist/cookie.d.ts.map +1 -0
- package/dist/cookie.js +28 -0
- package/dist/cookie.js.map +1 -0
- package/dist/fallback.d.ts +13 -0
- package/dist/fallback.d.ts.map +1 -0
- package/dist/fallback.js +17 -0
- package/dist/fallback.js.map +1 -0
- package/dist/icons.d.ts +14 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +29 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.css +509 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/nav-bar.d.ts +13 -0
- package/dist/nav-bar.d.ts.map +1 -0
- package/dist/nav-bar.js +91 -0
- package/dist/nav-bar.js.map +1 -0
- package/dist/nav-trigger.d.ts +16 -0
- package/dist/nav-trigger.d.ts.map +1 -0
- package/dist/nav-trigger.js +21 -0
- package/dist/nav-trigger.js.map +1 -0
- package/dist/provider.d.ts +19 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +46 -0
- package/dist/provider.js.map +1 -0
- package/dist/resolve.d.ts +32 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +51 -0
- package/dist/resolve.js.map +1 -0
- package/dist/theme.d.ts +13 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +21 -0
- package/dist/theme.js.map +1 -0
- package/dist/types.d.ts +50 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +38 -0
package/dist/index.css
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
/* @artstorefronts/arthelper-nav — the ArtHelper suite bar.
|
|
2
|
+
*
|
|
3
|
+
* Every selector is `ahsuite-` prefixed and no Tailwind utility appears anywhere,
|
|
4
|
+
* because client, town-square and marketing each own a separate Tailwind v4
|
|
5
|
+
* CSS-first config and purge scope. Hosts import this by deep path:
|
|
6
|
+
* @import '@artstorefronts/arthelper-nav/dist/index.css';
|
|
7
|
+
*
|
|
8
|
+
* Two deliberate departures from the prototype:
|
|
9
|
+
* 1. Collapsed state is keyed off `data-collapsed="true"` on the bar and on the
|
|
10
|
+
* docked trigger, not a class on <body>. A package must never mutate its host's
|
|
11
|
+
* <body>.
|
|
12
|
+
* 2. `position: sticky` is opt-in per host via the `ahsuite-bar--sticky` modifier
|
|
13
|
+
* (the NavBar `sticky` prop), not baked into `.ahsuite-bar`. A host that is a
|
|
14
|
+
* fixed-height flex column never scrolls its document and does not want it.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* ---------------------------------------------------------------------------
|
|
18
|
+
* Tokens. `.ahsuite-panel` inherits from `.ahsuite-bar`; `.ahsuite-docked` lives
|
|
19
|
+
* in the host's own header and so carries its own copy.
|
|
20
|
+
* Dark "Forest" is the default.
|
|
21
|
+
* ------------------------------------------------------------------------- */
|
|
22
|
+
.ahsuite-bar,
|
|
23
|
+
.ahsuite-docked {
|
|
24
|
+
--ahsuite-bar-bg: #12211a;
|
|
25
|
+
--ahsuite-bar-border: #ffffff1f;
|
|
26
|
+
--ahsuite-waffle-icon: #c4d2c8;
|
|
27
|
+
--ahsuite-waffle-hover-bg: #ffffff1f;
|
|
28
|
+
--ahsuite-waffle-hover-icon: #9fd9b4;
|
|
29
|
+
--ahsuite-wordmark: #fff;
|
|
30
|
+
--ahsuite-divider: #ffffff1f;
|
|
31
|
+
--ahsuite-chip-bg: #ffffff1f;
|
|
32
|
+
--ahsuite-chip-icon: #c4d2c8;
|
|
33
|
+
--ahsuite-chip-hover-bg: #ffffff2e;
|
|
34
|
+
--ahsuite-chip-hover-icon: #9fd9b4;
|
|
35
|
+
--ahsuite-chip-active-bg: transparent;
|
|
36
|
+
--ahsuite-chip-active-image: linear-gradient(180deg, #3dbe66, #2aa34f);
|
|
37
|
+
--ahsuite-chip-active-icon: #fff;
|
|
38
|
+
--ahsuite-label: #c4d2c8;
|
|
39
|
+
--ahsuite-label-active: #fff;
|
|
40
|
+
--ahsuite-surface-bg: #12211a;
|
|
41
|
+
--ahsuite-surface-border: #ffffff1f;
|
|
42
|
+
--ahsuite-control-border: #ffffff2e;
|
|
43
|
+
--ahsuite-row-hover-bg: #ffffff1f;
|
|
44
|
+
--ahsuite-accent-text: #9fd9b4;
|
|
45
|
+
--ahsuite-tiles-justify: flex-start;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ahsuite-bar[data-theme='light'],
|
|
49
|
+
.ahsuite-docked[data-theme='light'] {
|
|
50
|
+
--ahsuite-bar-bg: #fff;
|
|
51
|
+
--ahsuite-bar-border: #e6e1d5;
|
|
52
|
+
--ahsuite-waffle-icon: #4a5951;
|
|
53
|
+
--ahsuite-waffle-hover-bg: #f1ede2;
|
|
54
|
+
--ahsuite-waffle-hover-icon: #2e9e58;
|
|
55
|
+
--ahsuite-wordmark: #12211a;
|
|
56
|
+
--ahsuite-divider: #e6e1d5;
|
|
57
|
+
--ahsuite-chip-bg: #f1ede2;
|
|
58
|
+
--ahsuite-chip-icon: #4a5951;
|
|
59
|
+
--ahsuite-chip-hover-bg: #e4f4e8;
|
|
60
|
+
--ahsuite-chip-hover-icon: #2e9e58;
|
|
61
|
+
--ahsuite-label: #4a5951;
|
|
62
|
+
--ahsuite-label-active: #12211a;
|
|
63
|
+
--ahsuite-surface-bg: #fff;
|
|
64
|
+
--ahsuite-surface-border: #e6e1d5;
|
|
65
|
+
--ahsuite-control-border: #e6e1d5;
|
|
66
|
+
--ahsuite-row-hover-bg: #f1ede2;
|
|
67
|
+
--ahsuite-accent-text: #2e9e58;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ---------------------------------------------------------------------------
|
|
71
|
+
* The bar. In normal flow, never fixed and never portalled, so the page shifts
|
|
72
|
+
* down exactly once. box-sizing: border-box means the measured height including
|
|
73
|
+
* the 1px border is exactly 56px.
|
|
74
|
+
* ------------------------------------------------------------------------- */
|
|
75
|
+
.ahsuite-bar {
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
height: 56px;
|
|
78
|
+
flex: 0 0 auto;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: flex-start;
|
|
82
|
+
gap: 10px;
|
|
83
|
+
padding: 0 12px;
|
|
84
|
+
width: 100%;
|
|
85
|
+
background: var(--ahsuite-bar-bg);
|
|
86
|
+
background-color: var(--ahsuite-bar-bg);
|
|
87
|
+
border-bottom: 1px solid var(--ahsuite-bar-border);
|
|
88
|
+
font-family: inherit;
|
|
89
|
+
color: var(--ahsuite-label);
|
|
90
|
+
isolation: isolate;
|
|
91
|
+
visibility: visible;
|
|
92
|
+
/* `visibility 0s linear 0s` (no delay) is the expand half of the delayed-visibility
|
|
93
|
+
* pair below: on the way back in the bar must be visible for frame one, so the
|
|
94
|
+
* height and opacity have something to animate. */
|
|
95
|
+
transition:
|
|
96
|
+
height 180ms ease,
|
|
97
|
+
opacity 180ms ease,
|
|
98
|
+
visibility 0s linear 0s;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ahsuite-bar * {
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ahsuite-bar--sticky {
|
|
106
|
+
position: sticky;
|
|
107
|
+
top: 0;
|
|
108
|
+
z-index: 60;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Collapse ACTUALLY minimizes: the bar leaves layout completely, reserving
|
|
112
|
+
* nothing, so the host header rises and the page gets all 56px back.
|
|
113
|
+
*
|
|
114
|
+
* `visibility` is the load-bearing declaration, and the only one here that removes
|
|
115
|
+
* the bar from the ACCESSIBILITY TREE and the TAB ORDER. `height: 0`, `opacity: 0`,
|
|
116
|
+
* `overflow: hidden` and `pointer-events: none` do none of those three things: a bar
|
|
117
|
+
* collapsed with only those is still announced as the "ArtHelper suite" navigation
|
|
118
|
+
* region and still takes Tab focus, so a viewer tabbing from the top of the page
|
|
119
|
+
* lands on an invisible "Show the suite bar" button and then an invisible wordmark
|
|
120
|
+
* link that navigates off-site. `.ahsuite-docked` above already gets this right.
|
|
121
|
+
*
|
|
122
|
+
* It has to be DELAYED, not immediate: `visibility` is a discrete property, so
|
|
123
|
+
* `visibility 0s linear 180ms` holds it at `visible` for the whole slide and flips it
|
|
124
|
+
* the instant the height and opacity land — the same delayed-visibility pair
|
|
125
|
+
* `.ahsuite-tiles` already uses below. Setting it without the delay would make the
|
|
126
|
+
* bar vanish in one frame instead of animating.
|
|
127
|
+
*
|
|
128
|
+
* It also takes the mobile dropdown with it, which `overflow: hidden` cannot:
|
|
129
|
+
* `.ahsuite-panel` is `position: fixed`, so it is not clipped by an ancestor's
|
|
130
|
+
* overflow, but `visibility` inherits regardless of positioning. Together with the
|
|
131
|
+
* `.ahsuite-trigger` that opens it becoming unfocusable, that is what makes the
|
|
132
|
+
* ghost panel unreachable below 768px rather than merely closed after the fact. */
|
|
133
|
+
.ahsuite-bar[data-collapsed='true'] {
|
|
134
|
+
height: 0;
|
|
135
|
+
opacity: 0;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
border-bottom-width: 0;
|
|
138
|
+
pointer-events: none;
|
|
139
|
+
visibility: hidden;
|
|
140
|
+
transition:
|
|
141
|
+
height 180ms ease,
|
|
142
|
+
opacity 180ms ease,
|
|
143
|
+
visibility 0s linear 180ms;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ahsuite-waffle {
|
|
147
|
+
display: inline-flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
width: 32px;
|
|
151
|
+
height: 32px;
|
|
152
|
+
padding: 0;
|
|
153
|
+
margin: 0;
|
|
154
|
+
background: transparent;
|
|
155
|
+
border: 0;
|
|
156
|
+
border-radius: 8px;
|
|
157
|
+
color: var(--ahsuite-waffle-icon);
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
flex: 0 0 auto;
|
|
160
|
+
font: inherit;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ahsuite-waffle:hover {
|
|
164
|
+
color: var(--ahsuite-waffle-hover-icon);
|
|
165
|
+
background: var(--ahsuite-waffle-hover-bg);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.ahsuite-waffle svg {
|
|
169
|
+
display: block;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.ahsuite-wordmark {
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
color: var(--ahsuite-wordmark);
|
|
175
|
+
font-size: 15px;
|
|
176
|
+
line-height: 1;
|
|
177
|
+
letter-spacing: -0.01em;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
flex: 0 0 auto;
|
|
180
|
+
text-decoration: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.ahsuite-divider {
|
|
184
|
+
display: block;
|
|
185
|
+
width: 1px;
|
|
186
|
+
height: 20px;
|
|
187
|
+
background: var(--ahsuite-divider);
|
|
188
|
+
flex: 0 0 auto;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.ahsuite-bar[data-collapsed='true'] .ahsuite-divider {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* ---------------------------------------------------------------------------
|
|
196
|
+
* Desktop tile row. `alignment` drives justify-content and nothing else.
|
|
197
|
+
* ------------------------------------------------------------------------- */
|
|
198
|
+
.ahsuite-tiles {
|
|
199
|
+
display: flex;
|
|
200
|
+
gap: 4px;
|
|
201
|
+
align-items: center;
|
|
202
|
+
justify-content: var(--ahsuite-tiles-justify);
|
|
203
|
+
overflow: hidden;
|
|
204
|
+
max-width: 1200px;
|
|
205
|
+
opacity: 1;
|
|
206
|
+
transform: translateY(0);
|
|
207
|
+
transition:
|
|
208
|
+
opacity 180ms ease,
|
|
209
|
+
max-width 180ms ease,
|
|
210
|
+
transform 180ms ease;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.ahsuite-bar[data-collapsed='true'] .ahsuite-tiles {
|
|
214
|
+
opacity: 0;
|
|
215
|
+
max-width: 0;
|
|
216
|
+
transform: translateY(-4px);
|
|
217
|
+
visibility: hidden;
|
|
218
|
+
transition:
|
|
219
|
+
opacity 180ms ease,
|
|
220
|
+
max-width 180ms ease,
|
|
221
|
+
transform 180ms ease,
|
|
222
|
+
visibility 0s linear 180ms;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.ahsuite-tile {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
align-items: center;
|
|
229
|
+
justify-content: center;
|
|
230
|
+
gap: 4px;
|
|
231
|
+
width: 88px;
|
|
232
|
+
height: 52px;
|
|
233
|
+
flex: 0 0 88px;
|
|
234
|
+
padding: 0;
|
|
235
|
+
margin: 0;
|
|
236
|
+
background: transparent;
|
|
237
|
+
border: 0;
|
|
238
|
+
border-radius: 8px;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
font: inherit;
|
|
241
|
+
color: var(--ahsuite-label);
|
|
242
|
+
text-decoration: none;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* An active app with no destination is an indicator, not a link. */
|
|
246
|
+
span.ahsuite-tile,
|
|
247
|
+
span.ahsuite-row {
|
|
248
|
+
cursor: default;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.ahsuite-chip {
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
width: 28px;
|
|
256
|
+
height: 28px;
|
|
257
|
+
flex: 0 0 28px;
|
|
258
|
+
border-radius: 8px;
|
|
259
|
+
background: var(--ahsuite-chip-bg);
|
|
260
|
+
background-color: var(--ahsuite-chip-bg);
|
|
261
|
+
color: var(--ahsuite-chip-icon);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.ahsuite-chip svg {
|
|
265
|
+
display: block;
|
|
266
|
+
width: 16px;
|
|
267
|
+
height: 16px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.ahsuite-tile:hover .ahsuite-chip {
|
|
271
|
+
background: var(--ahsuite-chip-hover-bg);
|
|
272
|
+
background-color: var(--ahsuite-chip-hover-bg);
|
|
273
|
+
color: var(--ahsuite-chip-hover-icon);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.ahsuite-label {
|
|
277
|
+
font-size: 11px;
|
|
278
|
+
font-weight: 500;
|
|
279
|
+
line-height: 1;
|
|
280
|
+
color: var(--ahsuite-label);
|
|
281
|
+
white-space: nowrap;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* accent_color arrives as a single flat fill: --ahsuite-chip-active-bg is the
|
|
285
|
+
* colour and --ahsuite-chip-active-image is switched to none. */
|
|
286
|
+
.ahsuite-chip--active,
|
|
287
|
+
.ahsuite-tile--active .ahsuite-chip--active,
|
|
288
|
+
.ahsuite-tile--active:hover .ahsuite-chip--active {
|
|
289
|
+
background-color: var(--ahsuite-chip-active-bg);
|
|
290
|
+
background-image: var(--ahsuite-chip-active-image);
|
|
291
|
+
color: var(--ahsuite-chip-active-icon);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.ahsuite-tile--active .ahsuite-label {
|
|
295
|
+
font-weight: 600;
|
|
296
|
+
color: var(--ahsuite-label-active);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* ---------------------------------------------------------------------------
|
|
300
|
+
* The docked restore control, placed by the host in its own header. Only visible
|
|
301
|
+
* while the bar is minimized, and the only way back. Deliberately neutral
|
|
302
|
+
* greys — it sits on the host's surface, not the bar's.
|
|
303
|
+
* ------------------------------------------------------------------------- */
|
|
304
|
+
.ahsuite-docked {
|
|
305
|
+
display: none;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.ahsuite-docked[data-collapsed='true'] {
|
|
309
|
+
display: inline-flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
gap: 6px;
|
|
312
|
+
margin-left: 8px;
|
|
313
|
+
padding: 2px 8px 2px 2px;
|
|
314
|
+
background: transparent;
|
|
315
|
+
border: 1px solid #8080804d;
|
|
316
|
+
border-radius: 10px;
|
|
317
|
+
color: inherit;
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
font: inherit;
|
|
320
|
+
flex: 0 0 auto;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.ahsuite-docked[data-collapsed='true']:hover {
|
|
324
|
+
background: #80808026;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.ahsuite-docked * {
|
|
328
|
+
box-sizing: border-box;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.ahsuite-docked .ahsuite-waffle-mini {
|
|
332
|
+
display: block;
|
|
333
|
+
width: 14px;
|
|
334
|
+
height: 14px;
|
|
335
|
+
flex: 0 0 14px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* ---------------------------------------------------------------------------
|
|
339
|
+
* Below the md breakpoint (768px) the tile row is replaced by a labelled
|
|
340
|
+
* dropdown trigger at least 44px tall.
|
|
341
|
+
* ------------------------------------------------------------------------- */
|
|
342
|
+
.ahsuite-trigger {
|
|
343
|
+
display: none;
|
|
344
|
+
align-items: center;
|
|
345
|
+
gap: 8px;
|
|
346
|
+
min-height: 44px;
|
|
347
|
+
padding: 6px 10px;
|
|
348
|
+
background: transparent;
|
|
349
|
+
border: 1px solid var(--ahsuite-control-border);
|
|
350
|
+
border-radius: 8px;
|
|
351
|
+
color: var(--ahsuite-label);
|
|
352
|
+
cursor: pointer;
|
|
353
|
+
font: inherit;
|
|
354
|
+
flex: 0 1 auto;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.ahsuite-trigger:hover {
|
|
358
|
+
background: var(--ahsuite-row-hover-bg);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.ahsuite-trigger-label {
|
|
362
|
+
font-size: 14px;
|
|
363
|
+
font-weight: 600;
|
|
364
|
+
color: var(--ahsuite-label-active);
|
|
365
|
+
line-height: 1;
|
|
366
|
+
white-space: nowrap;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.ahsuite-trigger .ahsuite-chevron {
|
|
370
|
+
width: 18px;
|
|
371
|
+
height: 18px;
|
|
372
|
+
display: block;
|
|
373
|
+
color: var(--ahsuite-label);
|
|
374
|
+
flex: 0 0 18px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.ahsuite-panel {
|
|
378
|
+
display: none;
|
|
379
|
+
position: fixed;
|
|
380
|
+
top: 62px;
|
|
381
|
+
left: 12px;
|
|
382
|
+
right: 12px;
|
|
383
|
+
z-index: 61;
|
|
384
|
+
padding: 6px;
|
|
385
|
+
background: var(--ahsuite-surface-bg);
|
|
386
|
+
border: 1px solid var(--ahsuite-surface-border);
|
|
387
|
+
border-radius: 12px;
|
|
388
|
+
font-family: inherit;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.ahsuite-panel-head {
|
|
392
|
+
display: flex;
|
|
393
|
+
align-items: center;
|
|
394
|
+
justify-content: space-between;
|
|
395
|
+
min-height: 44px;
|
|
396
|
+
padding: 0 8px;
|
|
397
|
+
border-bottom: 1px solid var(--ahsuite-surface-border);
|
|
398
|
+
margin-bottom: 4px;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.ahsuite-panel-title {
|
|
402
|
+
font-size: 11px;
|
|
403
|
+
font-weight: 600;
|
|
404
|
+
letter-spacing: 0.06em;
|
|
405
|
+
color: var(--ahsuite-accent-text);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.ahsuite-close {
|
|
409
|
+
display: inline-flex;
|
|
410
|
+
align-items: center;
|
|
411
|
+
gap: 6px;
|
|
412
|
+
min-height: 36px;
|
|
413
|
+
padding: 0 10px;
|
|
414
|
+
background: transparent;
|
|
415
|
+
border: 1px solid var(--ahsuite-control-border);
|
|
416
|
+
border-radius: 8px;
|
|
417
|
+
color: var(--ahsuite-label);
|
|
418
|
+
font: inherit;
|
|
419
|
+
font-size: 12px;
|
|
420
|
+
cursor: pointer;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.ahsuite-close:hover {
|
|
424
|
+
background: var(--ahsuite-row-hover-bg);
|
|
425
|
+
color: var(--ahsuite-chip-hover-icon);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.ahsuite-close svg {
|
|
429
|
+
width: 14px;
|
|
430
|
+
height: 14px;
|
|
431
|
+
display: block;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.ahsuite-row {
|
|
435
|
+
display: flex;
|
|
436
|
+
align-items: center;
|
|
437
|
+
gap: 10px;
|
|
438
|
+
width: 100%;
|
|
439
|
+
min-height: 44px;
|
|
440
|
+
padding: 6px 8px;
|
|
441
|
+
background: transparent;
|
|
442
|
+
border: 0;
|
|
443
|
+
border-radius: 8px;
|
|
444
|
+
color: var(--ahsuite-label);
|
|
445
|
+
font: inherit;
|
|
446
|
+
text-align: left;
|
|
447
|
+
cursor: pointer;
|
|
448
|
+
text-decoration: none;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.ahsuite-row:hover {
|
|
452
|
+
background: var(--ahsuite-row-hover-bg);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.ahsuite-row:hover .ahsuite-chip {
|
|
456
|
+
background: var(--ahsuite-chip-hover-bg);
|
|
457
|
+
background-color: var(--ahsuite-chip-hover-bg);
|
|
458
|
+
color: var(--ahsuite-chip-hover-icon);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.ahsuite-row:hover .ahsuite-chip--active {
|
|
462
|
+
background-color: var(--ahsuite-chip-active-bg);
|
|
463
|
+
background-image: var(--ahsuite-chip-active-image);
|
|
464
|
+
color: var(--ahsuite-chip-active-icon);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.ahsuite-row-label {
|
|
468
|
+
font-size: 14px;
|
|
469
|
+
font-weight: 500;
|
|
470
|
+
line-height: 1;
|
|
471
|
+
color: var(--ahsuite-label);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.ahsuite-row--active .ahsuite-row-label {
|
|
475
|
+
font-weight: 600;
|
|
476
|
+
color: var(--ahsuite-label-active);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
@media (max-width: 767px) {
|
|
480
|
+
.ahsuite-tiles {
|
|
481
|
+
display: none;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.ahsuite-trigger {
|
|
485
|
+
display: inline-flex;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.ahsuite-panel {
|
|
489
|
+
display: block;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.ahsuite-panel[hidden] {
|
|
493
|
+
display: none;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/* The collapsed selectors have to be repeated here. `.ahsuite-bar[data-collapsed='true']`
|
|
498
|
+
* outranks a bare `.ahsuite-bar` on specificity, so listing only the base classes would
|
|
499
|
+
* leave the collapse transitions running under reduced motion — and, worse, would leave
|
|
500
|
+
* `visibility` deferred by 180ms with no animation to wait for, i.e. 180ms of an
|
|
501
|
+
* invisible-but-focusable bar. */
|
|
502
|
+
@media (prefers-reduced-motion: reduce) {
|
|
503
|
+
.ahsuite-bar,
|
|
504
|
+
.ahsuite-bar[data-collapsed='true'],
|
|
505
|
+
.ahsuite-tiles,
|
|
506
|
+
.ahsuite-bar[data-collapsed='true'] .ahsuite-tiles {
|
|
507
|
+
transition: none;
|
|
508
|
+
}
|
|
509
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { useNav } from './context.js';
|
|
2
|
+
export { COLLAPSED_COOKIE } from './cookie.js';
|
|
3
|
+
export { FALLBACK_CONFIG } from './fallback.js';
|
|
4
|
+
export { NavBar } from './nav-bar.js';
|
|
5
|
+
export { NavTrigger } from './nav-trigger.js';
|
|
6
|
+
export { NavProvider } from './provider.js';
|
|
7
|
+
export { resolveApps } from './resolve.js';
|
|
8
|
+
export type { NavContextValue } from './context.js';
|
|
9
|
+
export type { NavBarProps } from './nav-bar.js';
|
|
10
|
+
export type { NavTriggerProps } from './nav-trigger.js';
|
|
11
|
+
export type { NavProviderProps } from './provider.js';
|
|
12
|
+
export type { NavAlignment, NavApp, NavAppClickArgs, NavConfigPayload, NavLogo, NavTheme, NavThemeMode, ResolvedNavApp, } from './types.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EACV,YAAY,EACZ,MAAM,EACN,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { useNav } from './context.js';
|
|
2
|
+
export { COLLAPSED_COOKIE } from './cookie.js';
|
|
3
|
+
export { FALLBACK_CONFIG } from './fallback.js';
|
|
4
|
+
export { NavBar } from './nav-bar.js';
|
|
5
|
+
export { NavTrigger } from './nav-trigger.js';
|
|
6
|
+
export { NavProvider } from './provider.js';
|
|
7
|
+
export { resolveApps } from './resolve.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface NavBarProps {
|
|
2
|
+
/**
|
|
3
|
+
* Opt in per host. A host whose document scrolls (town-square) needs sticky;
|
|
4
|
+
* a host that is a fixed-height flex column (client) does not, and sticky there
|
|
5
|
+
* would be inert dead weight. Default false — the bar is always in normal flow.
|
|
6
|
+
*/
|
|
7
|
+
sticky?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function NavBar({ sticky, className }: NavBarProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { NavBar };
|
|
12
|
+
export type { NavBarProps };
|
|
13
|
+
//# sourceMappingURL=nav-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-bar.d.ts","sourceRoot":"","sources":["../src/nav-bar.tsx"],"names":[],"mappings":"AASA,UAAU,WAAW;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsED,iBAAS,MAAM,CAAC,EAAE,MAAc,EAAE,SAAS,EAAE,EAAE,WAAW,2CA6HzD;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/nav-bar.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown, X } from 'lucide-react';
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { useNav } from './context.js';
|
|
6
|
+
import { NavIcon, WaffleIcon } from './icons.js';
|
|
7
|
+
import { themeVars } from './theme.js';
|
|
8
|
+
function chipClass(entry) {
|
|
9
|
+
return entry.active ? 'ahsuite-chip ahsuite-chip--active' : 'ahsuite-chip';
|
|
10
|
+
}
|
|
11
|
+
function Chip({ entry }) {
|
|
12
|
+
return (_jsx("span", { className: chipClass(entry), children: _jsx(NavIcon, { name: entry.app.icon }) }));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One desktop tile. A real anchor, so the browser navigates natively and the
|
|
16
|
+
* address bar becomes the destination — `activate` only fires the host's seam.
|
|
17
|
+
* The host's own app without a destination renders as an inert indicator instead.
|
|
18
|
+
*/
|
|
19
|
+
function Tile({ entry, onActivate }) {
|
|
20
|
+
const className = entry.active ? 'ahsuite-tile ahsuite-tile--active' : 'ahsuite-tile';
|
|
21
|
+
if (!entry.navigable) {
|
|
22
|
+
return (_jsxs("span", { "aria-current": entry.active ? 'page' : undefined, className: className, children: [_jsx(Chip, { entry: entry }), _jsx("span", { className: "ahsuite-label", children: entry.app.label })] }));
|
|
23
|
+
}
|
|
24
|
+
return (_jsxs("a", { "aria-current": entry.active ? 'page' : undefined, className: className, href: entry.app.href, onClick: () => onActivate(entry), children: [_jsx(Chip, { entry: entry }), _jsx("span", { className: "ahsuite-label", children: entry.app.label })] }));
|
|
25
|
+
}
|
|
26
|
+
/** One dropdown row below the md breakpoint. Shares Tile's activation handler exactly. */
|
|
27
|
+
function Row({ entry, onActivate }) {
|
|
28
|
+
const className = entry.active ? 'ahsuite-row ahsuite-row--active' : 'ahsuite-row';
|
|
29
|
+
if (!entry.navigable) {
|
|
30
|
+
return (_jsxs("span", { "aria-current": entry.active ? 'page' : undefined, className: className, children: [_jsx(Chip, { entry: entry }), _jsx("span", { className: "ahsuite-row-label", children: entry.app.label })] }));
|
|
31
|
+
}
|
|
32
|
+
return (_jsxs("a", { "aria-current": entry.active ? 'page' : undefined, className: className, href: entry.app.href, onClick: () => onActivate(entry), children: [_jsx(Chip, { entry: entry }), _jsx("span", { className: "ahsuite-row-label", children: entry.app.label })] }));
|
|
33
|
+
}
|
|
34
|
+
function NavBar({ sticky = false, className }) {
|
|
35
|
+
const { config, apps, activeApp, collapsed, toggle, activate } = useNav();
|
|
36
|
+
const [open, setOpen] = useState(false);
|
|
37
|
+
const panelRef = useRef(null);
|
|
38
|
+
const triggerRef = useRef(null);
|
|
39
|
+
// The dropdown must be dismissable without leaving the page: Escape, the Close
|
|
40
|
+
// button, or a pointer anywhere outside it.
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!open) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
const onKeyDown = (event) => {
|
|
46
|
+
if (event.key !== 'Escape') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setOpen(false);
|
|
50
|
+
triggerRef.current?.focus();
|
|
51
|
+
};
|
|
52
|
+
const onPointerDown = (event) => {
|
|
53
|
+
const target = event.target;
|
|
54
|
+
if (!target) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (panelRef.current?.contains(target) || triggerRef.current?.contains(target)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
setOpen(false);
|
|
61
|
+
};
|
|
62
|
+
document.addEventListener('keydown', onKeyDown);
|
|
63
|
+
document.addEventListener('mousedown', onPointerDown);
|
|
64
|
+
return () => {
|
|
65
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
66
|
+
document.removeEventListener('mousedown', onPointerDown);
|
|
67
|
+
};
|
|
68
|
+
}, [open]);
|
|
69
|
+
// Collapsing while the dropdown is open must not leave it open to reappear on the
|
|
70
|
+
// next expand. This handles that one direction only, and deliberately so: it fires
|
|
71
|
+
// on a CHANGE of `collapsed`, so it could never have policed a panel opened while
|
|
72
|
+
// already collapsed. What makes that unreachable is the stylesheet — a collapsed
|
|
73
|
+
// `.ahsuite-bar` is `visibility: hidden`, which takes `.ahsuite-trigger` out of the
|
|
74
|
+
// tab order and the panel (a `position: fixed` descendant that `overflow: hidden`
|
|
75
|
+
// does not clip) out of the accessibility tree with it. There is no longer a way to
|
|
76
|
+
// reach the trigger to open it, so this effect is not the guard — it is the tidy-up.
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!collapsed) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
setOpen(false);
|
|
82
|
+
}, [collapsed]);
|
|
83
|
+
const onActivate = useCallback((entry) => {
|
|
84
|
+
activate(entry);
|
|
85
|
+
setOpen(false);
|
|
86
|
+
}, [activate]);
|
|
87
|
+
const classes = ['ahsuite-bar', sticky ? 'ahsuite-bar--sticky' : '', className ?? ''].filter(Boolean).join(' ');
|
|
88
|
+
return (_jsxs("div", { "aria-label": "ArtHelper suite", className: classes, "data-collapsed": collapsed ? 'true' : 'false', "data-theme": config.theme.mode, role: "navigation", style: themeVars(config.theme), children: [_jsx("button", { "aria-expanded": !collapsed, "aria-label": collapsed ? 'Show the suite bar' : 'Hide the suite bar', className: "ahsuite-waffle", onClick: toggle, type: "button", children: _jsx(WaffleIcon, {}) }), config.logo.href ? (_jsx("a", { className: "ahsuite-wordmark", href: config.logo.href, children: config.logo.label })) : (_jsx("span", { className: "ahsuite-wordmark", children: config.logo.label })), _jsx("span", { "aria-hidden": "true", className: "ahsuite-divider" }), _jsx("div", { className: "ahsuite-tiles", children: apps.map((entry) => (_jsx(Tile, { entry: entry, onActivate: onActivate }, entry.app.id))) }), _jsxs("button", { "aria-controls": "ahsuite-panel", "aria-expanded": open, "aria-haspopup": "true", className: "ahsuite-trigger", onClick: () => setOpen((current) => !current), ref: triggerRef, type: "button", children: [activeApp ? _jsx(Chip, { entry: activeApp }) : null, _jsx("span", { className: "ahsuite-trigger-label", children: activeApp?.app.label ?? 'Apps' }), _jsx(ChevronDown, { "aria-hidden": "true", className: "ahsuite-chevron", height: 18, strokeWidth: 2, width: 18 })] }), _jsxs("div", { "aria-label": "Apps", className: "ahsuite-panel", hidden: !open, id: "ahsuite-panel", ref: panelRef, role: "dialog", children: [_jsxs("div", { className: "ahsuite-panel-head", children: [_jsx("span", { className: "ahsuite-panel-title", children: "Apps" }), _jsxs("button", { "aria-label": "Close", className: "ahsuite-close", onClick: () => setOpen(false), type: "button", children: [_jsx(X, { "aria-hidden": "true", className: "ahsuite-icon", height: 14, strokeWidth: 2, width: 14 }), _jsx("span", { children: "Close" })] })] }), apps.map((entry) => (_jsx(Row, { entry: entry, onActivate: onActivate }, entry.app.id)))] })] }));
|
|
89
|
+
}
|
|
90
|
+
export { NavBar };
|
|
91
|
+
//# sourceMappingURL=nav-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-bar.js","sourceRoot":"","sources":["../src/nav-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QA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EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,aAC/F,KAAC,CAAC,mBAAa,MAAM,EAAC,SAAS,EAAC,cAAc,EAAC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,GAAI,EACxF,mCAAkB,IACX,IACL,EACL,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACnB,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,EAAqB,UAAU,EAAE,UAAU,IAApC,KAAK,CAAC,GAAG,CAAC,EAAE,CAA4B,CACjE,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface NavTriggerProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* The waffle plus active-app chip a host places by hand in its own header, beside
|
|
6
|
+
* its logo. This is the RESTORE control: while the bar is collapsed it is the only
|
|
7
|
+
* way back, so it is visibly interactive and always carries the restore label.
|
|
8
|
+
*
|
|
9
|
+
* It is display:none while the bar is expanded (and therefore out of the
|
|
10
|
+
* accessibility tree), which is why the label and aria-expanded are fixed rather
|
|
11
|
+
* than swapped — the bar's own waffle is the hide control.
|
|
12
|
+
*/
|
|
13
|
+
declare function NavTrigger({ className }: NavTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { NavTrigger };
|
|
15
|
+
export type { NavTriggerProps };
|
|
16
|
+
//# sourceMappingURL=nav-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-trigger.d.ts","sourceRoot":"","sources":["../src/nav-trigger.tsx"],"names":[],"mappings":"AAMA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE,eAAe,2CAuBjD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|