@molecule/app-ui-react 1.0.2 → 1.2.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 +521 -1
- package/dist/components/ConfirmButton.d.ts +71 -0
- package/dist/components/ConfirmButton.d.ts.map +1 -0
- package/dist/components/ConfirmButton.js +88 -0
- package/dist/components/ConfirmButton.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +71 -0
- package/dist/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog.js +20 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.js +12 -1
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/LoadErrorBanner.d.ts +71 -0
- package/dist/components/LoadErrorBanner.d.ts.map +1 -0
- package/dist/components/LoadErrorBanner.js +31 -0
- package/dist/components/LoadErrorBanner.js.map +1 -0
- package/dist/components/PromptDialog.d.ts +91 -0
- package/dist/components/PromptDialog.d.ts.map +1 -0
- package/dist/components/PromptDialog.js +90 -0
- package/dist/components/PromptDialog.js.map +1 -0
- package/dist/components/ResponsiveAppShell.d.ts +327 -0
- package/dist/components/ResponsiveAppShell.d.ts.map +1 -0
- package/dist/components/ResponsiveAppShell.js +470 -0
- package/dist/components/ResponsiveAppShell.js.map +1 -0
- package/dist/components/UserMenu.d.ts.map +1 -1
- package/dist/components/UserMenu.js +5 -1
- package/dist/components/UserMenu.js.map +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ResponsiveAppShell — the shared responsive app shell: a top bar, a desktop
|
|
4
|
+
* sidebar (≥768px) and a mobile nav drawer (<768px) around one content region.
|
|
5
|
+
*
|
|
6
|
+
* Roughly 89 flagship apps hand-roll this shell in ~15 drifting variants
|
|
7
|
+
* (inline-style panels, `max-width: 768px` fenceposts, CSS-hidden duplicate
|
|
8
|
+
* shells, hydration-spinner gates). This family is the fleet standard; it
|
|
9
|
+
* follows the QA-hardened shape the best templates converged on
|
|
10
|
+
* (`time-tracking`'s `useIsDesktop`, `blog`'s drawer, `weather-dashboard`'s
|
|
11
|
+
* one-shell-per-breakpoint doctrine).
|
|
12
|
+
*
|
|
13
|
+
* Compose it:
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { ResponsiveAppShell } from '@molecule/app-ui-react'
|
|
17
|
+
* import { NavLink, Outlet } from 'react-router'
|
|
18
|
+
*
|
|
19
|
+
* const nav = (
|
|
20
|
+
* <>
|
|
21
|
+
* <NavLink to="/dashboard">Dashboard</NavLink>
|
|
22
|
+
* <NavLink to="/projects">Projects</NavLink>
|
|
23
|
+
* <NavLink to="/reports">Reports</NavLink>
|
|
24
|
+
* </>
|
|
25
|
+
* )
|
|
26
|
+
*
|
|
27
|
+
* export function Shell() {
|
|
28
|
+
* return (
|
|
29
|
+
* <ResponsiveAppShell>
|
|
30
|
+
* <ResponsiveAppShell.TopBar
|
|
31
|
+
* brand={<NavLink to="/dashboard">Timetrack</NavLink>}
|
|
32
|
+
* actions={<UserMenu />}
|
|
33
|
+
* />
|
|
34
|
+
* <ResponsiveAppShell.Sidebar>{nav}</ResponsiveAppShell.Sidebar>
|
|
35
|
+
* <ResponsiveAppShell.Drawer>{nav}</ResponsiveAppShell.Drawer>
|
|
36
|
+
* <ResponsiveAppShell.Content>
|
|
37
|
+
* <Outlet />
|
|
38
|
+
* </ResponsiveAppShell.Content>
|
|
39
|
+
* </ResponsiveAppShell>
|
|
40
|
+
* )
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* - **Breakpoint: 768px** — the fleet-wide `md` breakpoint. Exactly ONE shell
|
|
46
|
+
* is MOUNTED per breakpoint: `Sidebar` renders only ≥768px, `Drawer` (and
|
|
47
|
+
* the menu trigger) only below. This is deliberate — rendering both and
|
|
48
|
+
* hiding one with CSS (`hidden md:block` style) leaves duplicate `<main>`/
|
|
49
|
+
* `<nav>` landmarks in the accessibility tree, double-mounts route content
|
|
50
|
+
* (double fetches, duplicate text matches for e2e locators). CSS-only
|
|
51
|
+
* responsive pairs remain available for NON-duplicating surface swaps via
|
|
52
|
+
* `hiddenBelow()` / `hiddenFrom()` on the UIClassMap. The `useIsDesktop`
|
|
53
|
+
* hook is exported for apps that need the same signal elsewhere: it reads
|
|
54
|
+
* `matchMedia` synchronously on first client render (no mounted-then-swap
|
|
55
|
+
* flicker in this CSR-only package) and subscribes to `change` events; the
|
|
56
|
+
* initializer is guarded (`typeof window`/`matchMedia`) so SSR and
|
|
57
|
+
* non-browser harnesses render the mobile shell instead of crashing.
|
|
58
|
+
* - **a11y contract.** `TopBar` renders the `<header>` landmark and its menu
|
|
59
|
+
* trigger carries `aria-label` + `aria-expanded` + `aria-controls` (the
|
|
60
|
+
* panel id comes from `useId()`). `Sidebar` renders `<aside>` with a
|
|
61
|
+
* `<nav aria-label>` landmark around its children. `Drawer` implements the
|
|
62
|
+
* WAI-ARIA APG dialog pattern on mobile: `role="dialog"` + `aria-modal`
|
|
63
|
+
* panel, focus moves into the panel on open and returns to the trigger on
|
|
64
|
+
* close, Tab/Shift+Tab are trapped inside, Escape and a backdrop click
|
|
65
|
+
* close, and body scroll is locked (reference-counted, so a `<Modal>`
|
|
66
|
+
* confirm stacked above the drawer never unlocks early). `Content` renders
|
|
67
|
+
* the `<main>` landmark. Marking the CURRENT nav item is the CONSUMER's job
|
|
68
|
+
* — pass `aria-current="page"` from your nav children (the shell renders
|
|
69
|
+
* them pass-through).
|
|
70
|
+
* - **Behavior.** The drawer auto-closes on SPA navigation (react-router
|
|
71
|
+
* location change) so it never sticks over the next page, and when the
|
|
72
|
+
* viewport crosses to desktop while it is open. Apps need an
|
|
73
|
+
* `I18nProvider` (all visible labels go through `t(key, {}, {
|
|
74
|
+
* defaultValue })`) and a react-router context; without the router the
|
|
75
|
+
* shell still renders — it just cannot auto-close on navigation.
|
|
76
|
+
* - **Locators.** Every fixed element carries a `data-mol-id` default,
|
|
77
|
+
* overridable per sub-component: `shell-topbar`, `shell-drawer-open`
|
|
78
|
+
* (trigger), `shell-sidebar`, `shell-drawer` (panel), `shell-drawer-close`,
|
|
79
|
+
* `shell-content`, and `shell-root` on the root `<div>`.
|
|
80
|
+
* - **ClassMap gaps routed around (Rule 5 inline-style exceptions, each
|
|
81
|
+
* commented at the call site).** The UIClassMap `drawer` token is a
|
|
82
|
+
* RIGHT-anchored settings-panel shape (`!right-0 … !max-w-sm`) and cannot
|
|
83
|
+
* serve a left nav drawer; there is no standalone `overflowY: auto`,
|
|
84
|
+
* `z-index`, or `left: 0` token. The shell therefore applies small
|
|
85
|
+
* documented inline styles for the drawer/sidebar geometry (pixel width à
|
|
86
|
+
* la `@molecule/app-sidebar-layout-react`, `max-width: 85vw`,
|
|
87
|
+
* `overflow-y: auto`, stacking `zIndex`) instead of widening UIClassMap —
|
|
88
|
+
* a `navDrawer()`-style token belongs in `@molecule/app-ui` + the ClassMap
|
|
89
|
+
* bond, both outside this package.
|
|
90
|
+
* - **Siblings.** `@molecule/app-sidebar-layout-react` `SidebarLayout` is the
|
|
91
|
+
* router-coupled DESKTOP-only sidebar (no mobile collapse);
|
|
92
|
+
* `@molecule/app-shell-layout-react` `AppShellLayout` is the marketing
|
|
93
|
+
* header/footer frame. THIS family is the responsive authenticated shell.
|
|
94
|
+
* Do not nest `SidebarLayout` inside it — pick one shell per app.
|
|
95
|
+
*
|
|
96
|
+
* @module
|
|
97
|
+
*/
|
|
98
|
+
import { createContext, useContext, useEffect, useId, useRef, useState, } from 'react';
|
|
99
|
+
import { createPortal } from 'react-dom';
|
|
100
|
+
import { useLocation } from 'react-router';
|
|
101
|
+
import { useTranslation } from '@molecule/app-react';
|
|
102
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
103
|
+
import { renderIcon } from '../utilities/renderIcon.js';
|
|
104
|
+
/** The fleet-wide responsive breakpoint, as a `matchMedia` query. */
|
|
105
|
+
const DESKTOP_QUERY = '(min-width: 768px)';
|
|
106
|
+
/**
|
|
107
|
+
* Whether the viewport is at least 768px wide (the fleet's `md` breakpoint).
|
|
108
|
+
*
|
|
109
|
+
* Reads `window.matchMedia` synchronously in the state initializer, so the
|
|
110
|
+
* FIRST client render is already correct — no mobile-then-desktop swap frame
|
|
111
|
+
* (this is time-tracking's QA-hardened version; the naive
|
|
112
|
+
* "state starts false, sync in an effect" variant mounts the wrong shell for
|
|
113
|
+
* one frame and double-fetches route data on desktop). Subscribes to
|
|
114
|
+
* `change` events afterwards. Guarded for non-browser environments
|
|
115
|
+
* (SSR/node): returns `false` (the mobile shell) when no `window.matchMedia`
|
|
116
|
+
* exists.
|
|
117
|
+
*
|
|
118
|
+
* @param query - Override the media query. Defaults to `(min-width: 768px)`.
|
|
119
|
+
* @returns Whether the desktop shell should mount.
|
|
120
|
+
*/
|
|
121
|
+
export function useIsDesktop(query = DESKTOP_QUERY) {
|
|
122
|
+
const [isDesktop, setIsDesktop] = useState(() => {
|
|
123
|
+
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
|
|
124
|
+
return false;
|
|
125
|
+
return window.matchMedia(query).matches;
|
|
126
|
+
});
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
|
|
129
|
+
return undefined;
|
|
130
|
+
const mq = window.matchMedia(query);
|
|
131
|
+
const onChange = (e) => setIsDesktop(e.matches);
|
|
132
|
+
mq.addEventListener('change', onChange);
|
|
133
|
+
return () => mq.removeEventListener('change', onChange);
|
|
134
|
+
}, [query]);
|
|
135
|
+
return isDesktop;
|
|
136
|
+
}
|
|
137
|
+
/** Pixel widths for the {@link ShellSidebarWidth} presets. */
|
|
138
|
+
const SIDEBAR_WIDTH_PX = {
|
|
139
|
+
sm: 208,
|
|
140
|
+
md: 240,
|
|
141
|
+
lg: 256,
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Resolves the effective sidebar/drawer pixel width.
|
|
145
|
+
* @param width - The width preset or explicit pixel number.
|
|
146
|
+
* @returns The width in pixels (defaults to `md`, 240px).
|
|
147
|
+
*/
|
|
148
|
+
function resolveWidthPx(width) {
|
|
149
|
+
if (typeof width === 'number')
|
|
150
|
+
return width;
|
|
151
|
+
if (width)
|
|
152
|
+
return SIDEBAR_WIDTH_PX[width];
|
|
153
|
+
return SIDEBAR_WIDTH_PX.md;
|
|
154
|
+
}
|
|
155
|
+
// ---------------------------------------------------------------------------
|
|
156
|
+
// Reference-counted body scroll lock — the same approach Modal uses (its
|
|
157
|
+
// counter is module-private there). A drawer and a <Modal> confirm stacked
|
|
158
|
+
// above it can BOTH lock scroll; without a shared counter shape, closing
|
|
159
|
+
// either one would unlock scroll behind the other.
|
|
160
|
+
// ---------------------------------------------------------------------------
|
|
161
|
+
let scrollLockCount = 0;
|
|
162
|
+
let previousBodyOverflow = '';
|
|
163
|
+
/** Locks body scroll on the first caller; later callers just increment the count. */
|
|
164
|
+
function lockBodyScroll() {
|
|
165
|
+
if (scrollLockCount === 0) {
|
|
166
|
+
previousBodyOverflow = document.body.style.overflow;
|
|
167
|
+
document.body.style.overflow = 'hidden';
|
|
168
|
+
}
|
|
169
|
+
scrollLockCount += 1;
|
|
170
|
+
}
|
|
171
|
+
/** Decrements the lock count; restores the ORIGINAL overflow only once it reaches zero. */
|
|
172
|
+
function unlockBodyScroll() {
|
|
173
|
+
scrollLockCount = Math.max(0, scrollLockCount - 1);
|
|
174
|
+
if (scrollLockCount === 0) {
|
|
175
|
+
document.body.style.overflow = previousBodyOverflow;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/** Elements the WAI-ARIA APG dialog pattern treats as tab-stops for the focus trap. */
|
|
179
|
+
const FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
180
|
+
/**
|
|
181
|
+
* Returns the tab-stop elements inside a container, in DOM (tab) order.
|
|
182
|
+
* @param container - The element to search within.
|
|
183
|
+
* @returns The focusable descendants, in document order.
|
|
184
|
+
*/
|
|
185
|
+
function getFocusableElements(container) {
|
|
186
|
+
return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
187
|
+
}
|
|
188
|
+
const ShellContext = createContext(null);
|
|
189
|
+
/**
|
|
190
|
+
* Returns the nearest shell context, throwing if not inside a `ResponsiveAppShell`.
|
|
191
|
+
* @param component - The calling sub-component's name, for the error message.
|
|
192
|
+
* @returns The shell context value.
|
|
193
|
+
*/
|
|
194
|
+
function useShellContext(component) {
|
|
195
|
+
const ctx = useContext(ShellContext);
|
|
196
|
+
if (!ctx) {
|
|
197
|
+
throw new Error(`<${component}> must be rendered inside <ResponsiveAppShell>`);
|
|
198
|
+
}
|
|
199
|
+
return ctx;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Root of the responsive app shell. Owns the breakpoint signal and the
|
|
203
|
+
* drawer open state, closes the drawer on SPA navigation and on
|
|
204
|
+
* desktop-crossing resizes, and provides both to the sub-components via
|
|
205
|
+
* context.
|
|
206
|
+
*
|
|
207
|
+
* Render the four sub-components inside it — see the module example for the
|
|
208
|
+
* canonical composition.
|
|
209
|
+
*
|
|
210
|
+
* @param props - The shell sub-components, sidebar width, and className.
|
|
211
|
+
* @returns The flex-row shell root.
|
|
212
|
+
*/
|
|
213
|
+
function ResponsiveAppShellBase({ children, sidebarWidth, className, dataMolId = 'shell-root', }) {
|
|
214
|
+
const cm = getClassMap();
|
|
215
|
+
const isDesktop = useIsDesktop();
|
|
216
|
+
const location = useLocation();
|
|
217
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
218
|
+
const [hasDrawer, setHasDrawer] = useState(false);
|
|
219
|
+
const drawerId = useId();
|
|
220
|
+
// Close the drawer whenever the route changes — without it the drawer
|
|
221
|
+
// stays mounted over the next page and blocks clicks underneath (the
|
|
222
|
+
// fleet templates all carry this; it belongs in the shell).
|
|
223
|
+
useEffect(() => {
|
|
224
|
+
setDrawerOpen(false);
|
|
225
|
+
}, [location.pathname, location.search]);
|
|
226
|
+
// A resize crossing to desktop unmounts the drawer panel; dropping the
|
|
227
|
+
// logical open state too means resizing back to mobile doesn't surface a
|
|
228
|
+
// drawer the user closed (or never opened on this breakpoint).
|
|
229
|
+
useEffect(() => {
|
|
230
|
+
if (isDesktop)
|
|
231
|
+
setDrawerOpen(false);
|
|
232
|
+
}, [isDesktop]);
|
|
233
|
+
const openDrawer = () => setDrawerOpen(true);
|
|
234
|
+
const closeDrawer = () => setDrawerOpen(false);
|
|
235
|
+
return (_jsx("div", { className: cm.cn(
|
|
236
|
+
// Root flex ROW — the sidebar sits beside the content column (the
|
|
237
|
+
// dashboard-shell-layout rule: never position main next to a flow
|
|
238
|
+
// sidebar with margin-left alone).
|
|
239
|
+
cm.flex({}),
|
|
240
|
+
// Page canvas colors + min-height. The shell owns the page
|
|
241
|
+
// background so pages render on-theme without their own wrapper.
|
|
242
|
+
cm.page, cm.minH('screen'), className),
|
|
243
|
+
// Row on desktop (sidebar beside content), COLUMN below 768px (the
|
|
244
|
+
// top bar must stack ABOVE the content at mobile widths — a bare
|
|
245
|
+
// flex-row squeezed the TopBar into a side column and collapsed
|
|
246
|
+
// `<main>` to zero width; found by the first eight adopting apps).
|
|
247
|
+
// Inline because it is breakpoint-owned by the shell; consumer
|
|
248
|
+
// className still applies on top for width/overflow concerns.
|
|
249
|
+
style: { flexDirection: isDesktop ? 'row' : 'column' }, "data-mol-id": dataMolId, children: _jsx(ShellContext.Provider, { value: {
|
|
250
|
+
isDesktop,
|
|
251
|
+
sidebarWidthPx: resolveWidthPx(sidebarWidth),
|
|
252
|
+
drawerOpen,
|
|
253
|
+
openDrawer,
|
|
254
|
+
closeDrawer,
|
|
255
|
+
drawerId,
|
|
256
|
+
hasDrawer,
|
|
257
|
+
registerDrawer: setHasDrawer,
|
|
258
|
+
}, children: children }) }));
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The shell's `<header>` landmark: menu trigger (mobile, when a Drawer is
|
|
262
|
+
* composed), brand, and trailing actions.
|
|
263
|
+
*
|
|
264
|
+
* Sticks to the top of the viewport by default. The menu trigger renders
|
|
265
|
+
* only while a `ResponsiveAppShell.Drawer` is part of the composition AND
|
|
266
|
+
* the viewport is below the breakpoint.
|
|
267
|
+
*
|
|
268
|
+
* @param props - Brand/actions slots, `mobileOnly`, and class/id overrides.
|
|
269
|
+
* @returns The header landmark, or `null` when `mobileOnly` is set on desktop.
|
|
270
|
+
*/
|
|
271
|
+
export function ResponsiveAppShellTopBar({ brand, actions, mobileOnly = false, className, dataMolId = 'shell-topbar', testId, }) {
|
|
272
|
+
const cm = getClassMap();
|
|
273
|
+
const { t } = useTranslation();
|
|
274
|
+
const shell = useShellContext('ResponsiveAppShell.TopBar');
|
|
275
|
+
if (mobileOnly && shell.isDesktop)
|
|
276
|
+
return null;
|
|
277
|
+
const triggerLabel = t('appShell.openMenu', {}, { defaultValue: 'Open navigation menu' });
|
|
278
|
+
return (_jsxs("header", { className: cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'sm' }), cm.sp('px', 4), cm.h(14), cm.surface, cm.borderB,
|
|
279
|
+
// Sticky so the bar stays put while the page scrolls under it.
|
|
280
|
+
cm.position('sticky'), className),
|
|
281
|
+
// Inline exceptions (Rule 5, documented): there is no sticky-offset or
|
|
282
|
+
// standalone z-index token in the ClassMap. The value stays BELOW the
|
|
283
|
+
// drawer's overlay (z-40) so the open drawer always covers the bar.
|
|
284
|
+
style: { top: 0, zIndex: 20 }, "data-mol-id": dataMolId, "data-testid": testId, children: [_jsxs("div", { className: cm.cn(cm.flex({ align: 'center', gap: 'sm' })), style: { minWidth: 0 }, children: [shell.hasDrawer && !shell.isDesktop ? (_jsx("button", { type: "button", onClick: shell.openDrawer, "aria-label": triggerLabel, "aria-expanded": shell.drawerOpen, "aria-controls": shell.drawerId, "data-mol-id": "shell-drawer-open", className: cm.cn(cm.flex({ align: 'center', justify: 'center' }), cm.shrink0, cm.roundedFull, cm.cursorPointer),
|
|
285
|
+
// 44px — the fleet's minimum tap target. Inline (Rule 5): the
|
|
286
|
+
// Tailwind bond never generates `.h-11` (no token scans to it)
|
|
287
|
+
// and `.w-11` only appears via an unrelated token, so class-based
|
|
288
|
+
// sizing here rendered a ~20px trigger (found by flashcard-app's
|
|
289
|
+
// adoption pass).
|
|
290
|
+
style: { width: 44, height: 44 }, children: renderIcon('menu', cm.iconMd) })) : null, brand ? _jsx("div", { style: { minWidth: 0 }, children: brand }) : null] }), actions ? (_jsx("div", { className: cm.cn(cm.flex({ align: 'center', gap: 'sm' }), cm.shrink0), children: actions })) : null] }));
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The desktop sidebar (`<aside>` + `<nav>` landmarks). Renders NOTHING below
|
|
294
|
+
* 768px — the {@link ResponsiveAppShellDrawer} carries the nav there.
|
|
295
|
+
*
|
|
296
|
+
* Full viewport height, sticky at the top edge, scrolls internally when its
|
|
297
|
+
* content outgrows the viewport.
|
|
298
|
+
*
|
|
299
|
+
* @param props - Nav children, nav label, footer slot, class/id overrides.
|
|
300
|
+
* @returns The sidebar landmarks, or `null` below the breakpoint.
|
|
301
|
+
*/
|
|
302
|
+
export function ResponsiveAppShellSidebar({ children, navLabel, footer, className, dataMolId = 'shell-sidebar', testId, }) {
|
|
303
|
+
const cm = getClassMap();
|
|
304
|
+
const { t } = useTranslation();
|
|
305
|
+
const { isDesktop, sidebarWidthPx } = useShellContext('ResponsiveAppShell.Sidebar');
|
|
306
|
+
if (!isDesktop)
|
|
307
|
+
return null;
|
|
308
|
+
const resolvedNavLabel = navLabel ?? t('appShell.primaryNav', {}, { defaultValue: 'Primary navigation' });
|
|
309
|
+
return (_jsxs("aside", { className: cm.cn(cm.flex({ direction: 'col' }), cm.shrink0, cm.surface, cm.borderR, cm.h('screen'),
|
|
310
|
+
// Sticky keeps the rail in view if a consumer overrides its height
|
|
311
|
+
// below full-screen via className.
|
|
312
|
+
cm.position('sticky'), className),
|
|
313
|
+
// Inline exceptions (Rule 5, documented): a specific pixel width and
|
|
314
|
+
// `overflow-y: auto` have no ClassMap tokens — the same documented
|
|
315
|
+
// case `@molecule/app-sidebar-layout-react` routes around.
|
|
316
|
+
style: { top: 0, width: sidebarWidthPx, overflowY: 'auto' }, "data-mol-id": dataMolId, "data-testid": testId, children: [_jsx("nav", { "aria-label": resolvedNavLabel, className: cm.cn(cm.flex1, cm.stack(1)), children: children }), footer ? (_jsx("div", { className: cm.cn(cm.flex({ direction: 'col', gap: 'sm' }), cm.borderT, cm.sp('p', 3), cm.shrink0), children: footer })) : null] }));
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* The mobile nav drawer (<768px): a left-anchored dialog panel over a
|
|
320
|
+
* backdrop, opened by the menu trigger the TopBar renders.
|
|
321
|
+
*
|
|
322
|
+
* Implements the WAI-ARIA APG dialog pattern — focus moves into the panel on
|
|
323
|
+
* open and returns to the previously focused element (the trigger) on close,
|
|
324
|
+
* Tab is trapped inside, Escape and backdrop clicks close, body scroll locks
|
|
325
|
+
* (reference-counted with any stacked `<Modal>`), and the shell closes it on
|
|
326
|
+
* SPA navigation. Renders nothing on desktop or while closed.
|
|
327
|
+
*
|
|
328
|
+
* @param props - Nav children, header/nav-label/footer slots, close-button
|
|
329
|
+
* and class/id overrides.
|
|
330
|
+
* @returns The drawer portal while open on mobile, otherwise `null`.
|
|
331
|
+
*/
|
|
332
|
+
export function ResponsiveAppShellDrawer({ children, header, navLabel, footer, showCloseButton = true, className, dataMolId = 'shell-drawer', closeDataMolId = 'shell-drawer-close', testId, }) {
|
|
333
|
+
const cm = getClassMap();
|
|
334
|
+
const { t } = useTranslation();
|
|
335
|
+
const { isDesktop, sidebarWidthPx, drawerOpen, closeDrawer, drawerId, registerDrawer } = useShellContext('ResponsiveAppShell.Drawer');
|
|
336
|
+
// Register presence so the TopBar knows a trigger is meaningful. Mounted
|
|
337
|
+
// once per composition; the root's `hasDrawer` flips right after the first
|
|
338
|
+
// commit.
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
registerDrawer(true);
|
|
341
|
+
return () => registerDrawer(false);
|
|
342
|
+
}, [registerDrawer]);
|
|
343
|
+
const resolvedNavLabel = navLabel ?? t('appShell.primaryNav', {}, { defaultValue: 'Primary navigation' });
|
|
344
|
+
const panelRef = useRef(null);
|
|
345
|
+
const previouslyFocusedRef = useRef(null);
|
|
346
|
+
const open = drawerOpen && !isDesktop;
|
|
347
|
+
// Effect A — dialog focus management (Modal's approach): on open, capture
|
|
348
|
+
// the previously focused element and move focus into the panel; on close,
|
|
349
|
+
// restore it. Narrow deps — must run once per open/close transition, not
|
|
350
|
+
// on every parent re-render.
|
|
351
|
+
useEffect(() => {
|
|
352
|
+
if (!open)
|
|
353
|
+
return undefined;
|
|
354
|
+
previouslyFocusedRef.current = document.activeElement;
|
|
355
|
+
const panelEl = panelRef.current;
|
|
356
|
+
if (panelEl) {
|
|
357
|
+
const focusables = getFocusableElements(panelEl);
|
|
358
|
+
(focusables[0] ?? panelEl).focus();
|
|
359
|
+
}
|
|
360
|
+
return () => {
|
|
361
|
+
const toRestore = previouslyFocusedRef.current;
|
|
362
|
+
if (toRestore && document.contains(toRestore)) {
|
|
363
|
+
toRestore.focus();
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
}, [open]);
|
|
367
|
+
// Effect B — body scroll lock, reference-counted so a stacked <Modal>
|
|
368
|
+
// never loses its lock when the drawer closes first.
|
|
369
|
+
useEffect(() => {
|
|
370
|
+
if (!open)
|
|
371
|
+
return undefined;
|
|
372
|
+
lockBodyScroll();
|
|
373
|
+
return () => unlockBodyScroll();
|
|
374
|
+
}, [open]);
|
|
375
|
+
// Effect C — Escape closes; Tab is trapped inside the panel.
|
|
376
|
+
useEffect(() => {
|
|
377
|
+
if (!open)
|
|
378
|
+
return undefined;
|
|
379
|
+
const handleKeyDown = (e) => {
|
|
380
|
+
if (e.key === 'Escape') {
|
|
381
|
+
closeDrawer();
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (e.key !== 'Tab')
|
|
385
|
+
return;
|
|
386
|
+
const el = panelRef.current;
|
|
387
|
+
if (!el)
|
|
388
|
+
return;
|
|
389
|
+
const focusables = getFocusableElements(el);
|
|
390
|
+
if (focusables.length === 0) {
|
|
391
|
+
e.preventDefault();
|
|
392
|
+
el.focus();
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const first = focusables[0];
|
|
396
|
+
const last = focusables[focusables.length - 1];
|
|
397
|
+
const active = document.activeElement;
|
|
398
|
+
if (e.shiftKey) {
|
|
399
|
+
if (active === first || !el.contains(active)) {
|
|
400
|
+
e.preventDefault();
|
|
401
|
+
last.focus();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
else if (active === last || !el.contains(active)) {
|
|
405
|
+
e.preventDefault();
|
|
406
|
+
first.focus();
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
410
|
+
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
411
|
+
}, [open, closeDrawer]);
|
|
412
|
+
if (!open || typeof document === 'undefined')
|
|
413
|
+
return null;
|
|
414
|
+
const closeLabel = t('appShell.closeMenu', {}, { defaultValue: 'Close navigation menu' });
|
|
415
|
+
const drawer = (_jsxs(_Fragment, { children: [_jsx("div", { className: cm.overlay, "aria-hidden": "true" }), _jsx("div", { className: cm.cn(cm.position('fixed'), cm.inset0),
|
|
416
|
+
// The WRAPPER carries the z-index: a positioned element with
|
|
417
|
+
// z-index:auto forms its own stacking context, which would trap
|
|
418
|
+
// the panel's z-index inside it and let the z-40 backdrop paint
|
|
419
|
+
// ABOVE the whole drawer — every tap hit the inert backdrop
|
|
420
|
+
// (click-dead drawer; found by the first eight adopting apps).
|
|
421
|
+
// 41 keeps the wrapper (and everything in it) above the backdrop.
|
|
422
|
+
style: { zIndex: 41 }, onClick: (e) => {
|
|
423
|
+
if (e.target === e.currentTarget)
|
|
424
|
+
closeDrawer();
|
|
425
|
+
}, children: _jsxs("div", { ref: panelRef, id: drawerId, role: "dialog", "aria-modal": "true", "aria-label": resolvedNavLabel, tabIndex: -1, className: cm.cn(cm.flex({ direction: 'col' }), cm.surface, className),
|
|
426
|
+
// Inline exceptions (Rule 5, documented): the ClassMap `drawer`
|
|
427
|
+
// token is a RIGHT-anchored settings panel (`!right-0 !left-auto
|
|
428
|
+
// !max-w-sm`) and cannot serve a LEFT nav drawer; there are no
|
|
429
|
+
// `left: 0`, max-width-vw or standalone `overflow-y: auto`
|
|
430
|
+
// tokens. Geometry mirrors the fleet drawers (full-height left
|
|
431
|
+
// panel, never wider than 85vw). Stacking lives on the wrapper
|
|
432
|
+
// above — see its comment.
|
|
433
|
+
style: {
|
|
434
|
+
width: sidebarWidthPx,
|
|
435
|
+
maxWidth: '85vw',
|
|
436
|
+
overflowY: 'auto',
|
|
437
|
+
}, onClick: (e) => e.stopPropagation(), "data-mol-id": dataMolId, "data-testid": testId, children: [(header || showCloseButton) && (_jsxs("div", { className: cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'sm' }), cm.sp('p', 3), cm.shrink0), children: [header ? _jsx("div", { style: { minWidth: 0 }, children: header }) : _jsx("span", { "aria-hidden": "true" }), showCloseButton ? (_jsx("button", { type: "button", onClick: closeDrawer, "aria-label": closeLabel, "data-mol-id": closeDataMolId, className: cm.cn(cm.flex({ align: 'center', justify: 'center' }), cm.w(10), cm.h(10), cm.shrink0, cm.roundedFull, cm.cursorPointer, cm.textMuted), children: renderIcon('x-mark', cm.iconMd) })) : null] })), _jsx("nav", { "aria-label": resolvedNavLabel, className: cm.cn(cm.flex1, cm.stack(1)), children: children }), footer ? (_jsx("div", { className: cm.cn(cm.flex({ direction: 'col', gap: 'sm' }), cm.borderT, cm.sp('p', 3), cm.shrink0), children: footer })) : null] }) })] }));
|
|
438
|
+
return createPortal(drawer, document.body);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* The shell's `<main>` landmark. Grows to fill the row and may shrink below
|
|
442
|
+
* its content width, so page-level `overflow-x` strips scroll inside the
|
|
443
|
+
* page instead of widening the whole shell.
|
|
444
|
+
*
|
|
445
|
+
* @param props - The page content and class/id overrides.
|
|
446
|
+
* @returns The main landmark.
|
|
447
|
+
*/
|
|
448
|
+
export function ResponsiveAppShellContent({ children, className, style, dataMolId = 'shell-content', testId, }) {
|
|
449
|
+
const cm = getClassMap();
|
|
450
|
+
return (_jsx("main", { className: cm.cn(cm.flex1, className), style: { minWidth: 0, ...style }, "data-mol-id": dataMolId, "data-testid": testId, children: children }));
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* The responsive app shell family — see the {@link ResponsiveAppShellBase |
|
|
454
|
+
* root component} and the module docs for the full contract.
|
|
455
|
+
*
|
|
456
|
+
* Consumed as `<ResponsiveAppShell.TopBar />`, `.Sidebar`, `.Drawer` and
|
|
457
|
+
* `.Content` inside `<ResponsiveAppShell>`; each is also exported as a named
|
|
458
|
+
* component (`ResponsiveAppShellTopBar`, …) for star-import consumers.
|
|
459
|
+
*/
|
|
460
|
+
export const ResponsiveAppShell = Object.assign(ResponsiveAppShellBase, {
|
|
461
|
+
/** The `<header>` landmark — brand + actions + the drawer menu trigger. */
|
|
462
|
+
TopBar: ResponsiveAppShellTopBar,
|
|
463
|
+
/** The desktop `<aside>`/`<nav>` landmarks (≥768px only). */
|
|
464
|
+
Sidebar: ResponsiveAppShellSidebar,
|
|
465
|
+
/** The mobile dialog drawer (<768px only). */
|
|
466
|
+
Drawer: ResponsiveAppShellDrawer,
|
|
467
|
+
/** The `<main>` landmark. */
|
|
468
|
+
Content: ResponsiveAppShellContent,
|
|
469
|
+
});
|
|
470
|
+
//# sourceMappingURL=ResponsiveAppShell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponsiveAppShell.js","sourceRoot":"","sources":["../../src/components/ResponsiveAppShell.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AAEH,OAAO,EACL,aAAa,EAGb,UAAU,EACV,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,qEAAqE;AACrE,MAAM,aAAa,GAAG,oBAAoB,CAAA;AAE1C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB,aAAa;IACxD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC9C,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;YAAE,OAAO,KAAK,CAAA;QAC1F,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;YAAE,OAAO,SAAS,CAAA;QAC9F,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAC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wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,YAA8B,EAC9B,gBAAmC,EACnC,WAAoB,EACpB,eAAoB,EACpB,SAAuB,EACvB,SAAS,EACT,QAAQ,EACR,OAAO,GACR,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/components/UserMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAI3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AASnD;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,QAAQ,CAAA;IACtB,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,YAA8B,EAC9B,gBAAmC,EACnC,WAAoB,EACpB,eAAoB,EACpB,SAAuB,EACvB,SAAS,EACT,QAAQ,EACR,OAAO,GACR,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA0C7B"}
|
|
@@ -29,6 +29,10 @@ export function UserMenu({ children, ariaLabelKey = 'userMenu.open', ariaLabelDe
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
setOpen(false);
|
|
31
31
|
}, [location.pathname, location.search]);
|
|
32
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: onClick ?? (() => setOpen(true)), "aria-label": t(ariaLabelKey, {}, { defaultValue: ariaLabelDefault }), "data-mol-id": dataMolId,
|
|
32
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: onClick ?? (() => setOpen(true)), "aria-label": t(ariaLabelKey, {}, { defaultValue: ariaLabelDefault }), "data-mol-id": dataMolId,
|
|
33
|
+
// 40x40 trigger floor: the icon-only `size="sm"` button measured
|
|
34
|
+
// 42x26px fleet-wide (flagged as a tiny target in every app QA).
|
|
35
|
+
// Apps can still widen via `className`; the floor is the default.
|
|
36
|
+
className: cm.cn('min-h-10 min-w-10', className), disabled: disabled, children: _jsx(Icon, { name: triggerIcon, size: triggerIconSize }) }), _jsx(Modal, { open: open, onClose: () => setOpen(false), className: cm.drawer, "aria-label": t('userMenu.panelLabel', {}, { defaultValue: 'Account menu' }), children: _jsx(PanelCloseProvider, { close: () => setOpen(false), children: children }) })] }));
|
|
33
37
|
}
|
|
34
38
|
//# sourceMappingURL=UserMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.js","sourceRoot":"","sources":["../../src/components/UserMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAA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,SAAS,CAAC,EAChD,QAAQ,EAAE,QAAQ,YAElB,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,GAAI,GAC3C,EACT,KAAC,KAAK,IACJ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAC7B,SAAS,EAAE,EAAE,CAAC,MAAM,gBAGR,CAAC,CAAC,qBAAqB,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC,YAE1E,KAAC,kBAAkB,IAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAAG,QAAQ,GAAsB,GAC1E,IACP,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -11,6 +11,8 @@ export * from './Badge.js';
|
|
|
11
11
|
export * from './Button.js';
|
|
12
12
|
export * from './Card.js';
|
|
13
13
|
export * from './Checkbox.js';
|
|
14
|
+
export * from './ConfirmButton.js';
|
|
15
|
+
export * from './ConfirmDialog.js';
|
|
14
16
|
export * from './Dropdown.js';
|
|
15
17
|
export * from './EmptyState.js';
|
|
16
18
|
export * from './FloatingInput.js';
|
|
@@ -19,13 +21,16 @@ export * from './Icon.js';
|
|
|
19
21
|
export * from './Input.js';
|
|
20
22
|
export * from './LanguagePicker.js';
|
|
21
23
|
export * from './Layout.js';
|
|
24
|
+
export * from './LoadErrorBanner.js';
|
|
22
25
|
export * from './Modal.js';
|
|
23
26
|
export * from './PageHeader.js';
|
|
24
27
|
export * from './PageShell.js';
|
|
25
28
|
export * from './Pagination.js';
|
|
26
29
|
export * from './PanelClose.js';
|
|
27
30
|
export * from './Progress.js';
|
|
31
|
+
export * from './PromptDialog.js';
|
|
28
32
|
export * from './RadioGroup.js';
|
|
33
|
+
export * from './ResponsiveAppShell.js';
|
|
29
34
|
export * from './Select.js';
|
|
30
35
|
export * from './Separator.js';
|
|
31
36
|
export * from './SidebarUserCard.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA"}
|
package/dist/components/index.js
CHANGED
|
@@ -11,6 +11,8 @@ export * from './Badge.js';
|
|
|
11
11
|
export * from './Button.js';
|
|
12
12
|
export * from './Card.js';
|
|
13
13
|
export * from './Checkbox.js';
|
|
14
|
+
export * from './ConfirmButton.js';
|
|
15
|
+
export * from './ConfirmDialog.js';
|
|
14
16
|
export * from './Dropdown.js';
|
|
15
17
|
export * from './EmptyState.js';
|
|
16
18
|
export * from './FloatingInput.js';
|
|
@@ -19,13 +21,16 @@ export * from './Icon.js';
|
|
|
19
21
|
export * from './Input.js';
|
|
20
22
|
export * from './LanguagePicker.js';
|
|
21
23
|
export * from './Layout.js';
|
|
24
|
+
export * from './LoadErrorBanner.js';
|
|
22
25
|
export * from './Modal.js';
|
|
23
26
|
export * from './PageHeader.js';
|
|
24
27
|
export * from './PageShell.js';
|
|
25
28
|
export * from './Pagination.js';
|
|
26
29
|
export * from './PanelClose.js';
|
|
27
30
|
export * from './Progress.js';
|
|
31
|
+
export * from './PromptDialog.js';
|
|
28
32
|
export * from './RadioGroup.js';
|
|
33
|
+
export * from './ResponsiveAppShell.js';
|
|
29
34
|
export * from './Select.js';
|
|
30
35
|
export * from './Separator.js';
|
|
31
36
|
export * from './SidebarUserCard.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B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B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-ui-react",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "React UI components for molecule.dev",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@molecule/app-i18n": "1.0.2",
|
|
45
45
|
"@molecule/app-icons": "1.0.2",
|
|
46
|
-
"@molecule/app-react": "1.
|
|
46
|
+
"@molecule/app-react": "1.6.0",
|
|
47
47
|
"@testing-library/react": "16.3.2",
|
|
48
48
|
"@types/node": "26.1.2",
|
|
49
49
|
"@types/react": "19.2.17",
|