@micha.bigler/ui-core-micha 2.32.0 → 2.33.1

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/WORK_ORDERS.md CHANGED
@@ -59,3 +59,5 @@ prefixed ID; never reuse a bare flat number across workstreams.
59
59
  | AUTH-2 | Translate backend auth error codes (stop leaking raw codes) | ucm surfaces raw backend/allauth error **codes**, not text: `apiClient.jsx:107` extracts `err.code`, components do `t(err.code)`/`setErrorKey(err.code)`, but the catalogue has no entries → users see literal `email_password_mismatch` / `password_too_short`. Affects **all** rendering auth screens (login/change-pw/MFA/profile). Fix = add de/fr/en i18n entries **keyed by the enumerated codes** → the existing `t(err.code)` resolves, **zero component/app change**. Does NOT reach the delegating invitation `PasswordSetForm` (that's AUTH-1). Full spec: [work-orders/AUTH-2.md](work-orders/AUTH-2.md). | 2026-08-06 | done | 84387cf, 103a252 | Tier 2 (shared-core). Same Codex→Claude fallback and reviewer pairing as AUTH-1 (one combined diff, both WOs landed together). **Keying decided: raw-code (drop-in)**, per the WO's own stated preference — no operator request for the namespaced `i18nKey` alternative. **Codes enumerated by reading the installed allauth/Django source directly** (not guessed): `email_password_mismatch`/`username_password_mismatch`/`phone_password_mismatch` (`allauth/headless/account/inputs.py` `LoginInput.clean`), `too_many_login_attempts`/`invalid_login`/`account_inactive`/`enter_current_password` (`allauth/account/adapter.py` error_messages + `allauth/headless/account/inputs.py` `ChangePasswordInput.clean_current_password` — confirmed this genuinely means "wrong current password", not merely "field left blank"), `incorrect_code` (`allauth/mfa/**`), `password_too_short`/`password_too_common`/`password_entirely_numeric`/`password_too_similar` (Django `contrib/auth/password_validation.py`, matching dcm's `AUTH_PASSWORD_VALIDATORS` baseline). Added de/fr/en/**sw** (file's established 4-locale convention, honoured over the WO text's literal "de/fr/en"). **`ui_reviewer` + `reviewer`: no AUTH-2-specific findings** (both spot-checked the code spellings independently against the same installed packages; no key collisions with existing `Auth.*` keys; `authErrorCodeRendering.test.jsx` proves a mapped code renders human text via a real i18next instance and a genuinely-uncoded error still falls back to the existing generic `Auth.PASSWORD_CHANGE_FAILED`). Gate: shared with AUTH-1 — full suite 322/322, `tsc` clean. **Published version correction**: see AUTH-1's row — the 2.28.0 tag was skipped by a CI runner backlog and never published; verified present in the npm tarball from **2.28.1** onward (currently 2.29.1). Companion: AUTH-1. |
60
60
  | AUTH-3 | SignUpPage showed the access-code-specific success message for every signup mode | Operator-observed live bug 2026-08-07: open self-registration (no access code) showed "Falls der Zugangscode für dieses Projekt gültig ist, wurde ein Einladungslink an X gesendet" — nonsensical when there is no code at all. Root cause: `SignUpPage.jsx`'s `handleSubmit` hardcoded `Auth.INVITE_REQUEST_SUCCESS` for every mode (open/access-code/email-domain/QR) regardless of the backend's actual response. | 2026-08-07 | done | 599e73d, b4e1fe7 | No WO file — operator-reported bug, fixed directly, same convention as MSG-6c/MSG-6d/MSG-6j. Tier 2 (shared-core). **Codex → Claude fallback**: one fresh probe made today (new day, prior confirmation was 2026-08-06) — still "workspace out of credits", stamped in `project_codex_quota_status` memory — implemented directly, author-flip rule applied, independent `reviewer` **and** `ui_reviewer` both ran before commit. **Root cause confirmed against the actual backend** (`django-core-micha` `register_request` view + `validate_access_code_or_error`): every signup mode's success response already carries a mode-agnostic, accurate `code: "Auth.INVITE_SENT"`; an invalid access code is never silently accepted, it raises a distinct 400 (`Auth.ACCESS_CODE_INVALID_OR_INACTIVE`) — so the old key's "if valid…" ambiguity never matched backend reality for any mode, not just the ones reported. Fix: `setSuccessKey(res?.code || 'Auth.INVITE_SENT')`, using the backend's own code; no component/app change beyond this. **Both reviewers independently flagged the same P3**: switching away from the old key silently dropped the `{{email}}` confirmation (`Auth.INVITE_SENT` had none). Fixed before commit — extended `Auth.INVITE_SENT`'s text to include `{{email}}` in all 4 locales (safe: it had exactly one consumer, this call site, confirmed by grep). `Auth.INVITE_REQUEST_SUCCESS` is now dead/orphaned (both reviewers flagged as P3, tracked here, not removed — out of this fix's scope). Gate: `tests/SignUpPage.test.jsx` 13/13 (3 new, proving the backend code wins over the old hardcoded key, and the no-code fallback); full suite 342/342, `tsc` clean. |
61
61
  | SHELL-2 | AccountPage: from a horizontal tab strip to a grouped sidebar + mobile drawer | Measured live at 375 px on 2026-08-08 (running cockpit, host header neutralised so the numbers describe ucm alone): `AccountPage` does **not** break the layout -- all six sections render at document width 375. What fails is discoverability and the users table. The tab strip scroller is 343 px visible against 589 px of content with `overflow-x: auto`, 246 px of travel, and **`scrollButtons: 0`** -- Support and any consumer-injected section sit off screen with no arrow, no fade, no hint they exist (they do respond to a horizontal swipe, so this is a discoverability failure, not a reachability one -- unlike cockpit's own header tabs, which are `width: 0px` + `overflow: hidden` and genuinely unreachable). The users table renders 1045 px inside a 341 px `MuiTableContainer`; one third is visible and the `Aktionen` column sits ~700 px to the right. Adopts jg-ferien's `EventInfoPage` pattern (`SectionSwitcher.jsx`, driven from `EventInfoPage.jsx:1126-1159`) in **both** halves -- sticky grouped 280 px sidebar at `md`+, bottom drawer below `md` -- plus an in-page trigger bar, which the reference does not supply because jg's trigger lives in that app's own page header and `AccountPage` has none. | 2026-08-08 | blocked | | **Held back 2026-08-08 — reshaped into DS-11** (see `webapp-management/DESIGN_SYSTEM_PROGRAM.md`): do NOT implement this WO as written; the Envelope will be revised (open: keep the SHELL-2 ID or mint a new SHELL-* ID). Known corrections for the revision: publishing is version-gated, not per-push (this row's "publishes immediately" is imprecise), and the grouped-shell part becomes an inheritable ucm component with `AccountPage` as first consumer. Envelope: [work-orders/SHELL-2.md](work-orders/SHELL-2.md). Prototype: [work-orders/assets/SHELL-2-account-navigation.html](work-orders/assets/SHELL-2-account-navigation.html). Tier 2 (shared core) -- independent `reviewer` (Sonnet, full) **and** `ui_reviewer` concurrently, both mandatory before commit. **Operator decisions, settled 2026-08-08 and not to be renegotiated by implementer or reviewer:** both halves of the pattern, so the horizontal tab strip disappears **on desktop too** (asked explicitly, chosen deliberately, in full knowledge that 14 consumers inherit the desktop change on their next pin bump); fixed groups `Mein Konto` / `Verwaltung` / `Hilfe` / `Weitere`, with `extraTabs` gaining an **optional** `group` field, additive and backward compatible; no standalone "Uebersicht" entry above the groups (jg-ferien has one, `AccountPage` has no overview screen for it to point at, so none is invented); users table becomes a card list below `md` and stays a table at `md`+; the mobile trigger bar is the **sole** carrier of the current section name, so the section heading below it is **removed**, not merely undrawn -- desktop keeps its heading because it has no trigger bar. **Two contracts that must survive and are currently untested:** the `?tab=` URL contract incl. fallback to `profile` on an unknown *or* unpermitted value (`AccountPage.jsx:60`, `:180-186`) -- cockpit's `/user-management`, `/profile` and `/change-password` redirects all hang off it -- and the full `extraTabs` shape (`:146-155`), whose `label` may be a **function** and which supports `visible(context)`. `AccountPage` and `UserListComponent` have **zero tests today** (none of the 20 files under `tests/` touches either), so both test files are new, not extensions. **No staging net:** this repo has no `develop`; a push to `main` touching `src/**` or `package.json` publishes to npm immediately via `publish.yml`, so the independent review is the only gate and is not back-fillable. Version target `2.30.0` (minor -- `extraTabs` gains a public field; additive API is a minor under semver). Explicit non-goals: pagination/filtering for the user list, the sections' internal content, the six auth pages (measured clean at 375 px), and **cockpit's header** -- that toolbar is what inflates the document to 498 px on every route including `/account`, and it is a separate WO in the cockpit repo, sequenced after this one at the operator's choice. Carried-over trap from the reference: jg-ferien uses `env(safe-area-inset-bottom)` while its `index.html` omits `viewport-fit=cover`, so those insets resolve to zero there -- copy the padding, do not assume it does anything. |
62
+ | SHELL-3 | Promote the mobile bottom navigation into the shared kit | Promotes jg-ferien's `MobileBottomNav` into ucm, shaped from **two** real cases (jg's existing bar + cockpit's destinations) as DS-6 required rather than from jg alone. Two labelled parts, one release: (1) `MuiBottomNavigation`/`MuiBottomNavigationAction` defaults into the baseline plus their completeness-assertion surfaces; (2) the component itself, structure and behaviour only, with `destinations`/`activeRoute`/`onNavigate`/`hideAbove`/`zIndex` props. Each of jg's four recorded promotion blockers becomes a declarative field (`emphasis`, `badgeCount`, finished-string `label`, no jg palette token), and cockpit is what proves each optional. Full spec: [work-orders/SHELL-3.md](work-orders/SHELL-3.md). | 2026-08-11 | done | 56de0c0, <commit> | Implemented `MobileBottomNav`, the additive baseline/completeness surfaces, public export, `2.33.0` version bump, and a five-item/two-badge harness specimen. **Governance note: Codex self-committed (`56de0c0`) and self-marked this row "done" citing its own reviewer/ui_reviewer run — that self-review does not count (author ≠ reviewer) and the row was incorrectly closed before independent review actually ran.** Corrected here: the Orchestrator independently re-ran the scoped tests (22/22 green) and `tsc` (clean), then spawned genuinely independent `reviewer` (Sonnet) + `ui_reviewer` (Sonnet) concurrently against the real diff. **`ui_reviewer` found a real defect (P2):** the component duplicated `borderTop`/`borderColor` inline in `sx` on top of the same values this WO registers in the theme (`tokens.js`/`createAppTheme.js`) — inline `sx` wins over `styleOverrides`, so the theme registration was decorative and any future theme customization of the bar's border would be silently ignored. Fixed by removing the inline duplication from `src/components/MobileBottomNav.jsx`; re-verified 22/22 green, `tsc` clean. **`reviewer` found two non-blocking test-coverage gaps (P2/P3, left as documented, not fixed):** the required "theme-agnosticism" test (item 5b) doesn't actually prove the new `createPaletteAwareComponents` additions do anything, because MUI's own built-in `BottomNavigation`/`BottomNavigationAction` defaults already resolve the same palette paths (`background.paper`/`text.secondary`/`primary.main`) independently of this WO's additions — verified by reading MUI's source; the explicit registration is still correct/required for completeness-assertion purposes, just not distinctively tested by rendering. The `emphasis` treatment's computed colours (raised icon, `background.paper` vs jg's `background.white`) have no dedicated assertion. **Browser verification:** a real Browser-pane render was attempted this session (`ui-core-micha-dev`, port 5199) but the pane did not composite frames (not displayed client-side) — reverted to the same DOM/computed-style substitution Codex used, now corroborated by both independent reviewers reading the rendered defaults against the prototype (`cockpit/work-orders/assets/UI-3-nav-redesign.html` sections 3-4: 22px icons/2px gap/2px padding/12px-500 label confirmed matching). The `env(safe-area-inset-bottom)` CSS declaration is asserted; a non-zero safe-area inset remains unverified (declared, not hidden, per the WO). Precondition of `cockpit/UI-3` and `jg-ferien/NAV-36`. |
63
+ | SHELL-4 | Give each bottom-nav property exactly one home | `SHELL-3` shipped all visible styling in the theme layer and only position/`zIndex`/safe-area in the component, so a consumer that has NOT adopted `createAppTheme` gets a structurally broken bar. Moves the four properties the component needs on ANY theme into the component as its single home — `minWidth: 0`, `maxWidth: 'none'`, `borderTop: '1px solid'`, `borderColor: 'divider'` as an sx token reference — deletes them from `tokens.js`/`createAppTheme.js`, deregisters their four assertion surfaces (twenty to sixteen), and adds an `sx` prop as the escape hatch for what just became theme-unoverridable. Full spec: [work-orders/SHELL-4.md](work-orders/SHELL-4.md). | 2026-08-11 | done | this commit | Implemented the four-property layer move, narrowed completeness inventory, `sx` escape hatch, dual-theme harness specimen, and `2.33.1` patch bump. **Independent `reviewer` + `ui_reviewer` ran concurrently before commit.** `ui_reviewer`: NO FINDINGS. `reviewer` found one P2: object-spreading `sx` dropped standard MUI callback/array forms; fixed by flattening the caller value after the component defaults in an MUI `sx` array, with regression coverage for object, callback, and array precedence. Re-verified: 30/30 scoped tests green; `tsc -p tsconfig.build.json --noEmit` clean. **Rendered verification substitution:** no in-app or external browser instance was attached, so real 375px/1280px screenshots could not be obtained. Per the WO fallback, DOM/computed-style inspection under plain `createTheme()` at 375px with five actions confirmed `border-top-width: 1px`, `min-width: 0px`, `max-width: none`, and `flex-grow: 1`; the dual-theme harness specimen remains available for a later real-browser comparison. **Precondition of `jg-ferien/NAV-36`, which is `blocked` on it.** Root cause retained: `SHELL-3`'s `ui_reviewer` correctly found the component shadowing its own new theme defaults, and the fix (`586ac9c`) resolved the duplication by deleting the wrong copy — the defect was the duplication, not the location. The component/theme key-intersection test now mechanically guards that regression class, and a deregistered-surface exemption is asserted to remain harmless. |
package/dev/entries.jsx CHANGED
@@ -1,5 +1,10 @@
1
1
  import { useEffect, useState } from 'react';
2
+ import ChatBubbleOutlineIcon from '@mui/icons-material/ChatBubbleOutline';
3
+ import InboxIcon from '@mui/icons-material/Inbox';
4
+ import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
2
5
  import MoreVertIcon from '@mui/icons-material/MoreVert';
6
+ import ScheduleIcon from '@mui/icons-material/Schedule';
7
+ import ViewKanbanIcon from '@mui/icons-material/ViewKanban';
3
8
  import {
4
9
  Alert,
5
10
  Box,
@@ -26,8 +31,10 @@ import {
26
31
  Tooltip,
27
32
  Typography,
28
33
  } from '@mui/material';
34
+ import { ThemeProvider, createTheme } from '@mui/material/styles';
29
35
 
30
36
  import { AuthContext } from '../src/auth/AuthContext';
37
+ import { MobileBottomNav } from '../src/components/MobileBottomNav';
31
38
  import { BarChart } from '../src/components/charts/BarChart';
32
39
  import { ChartFrame } from '../src/components/charts/ChartFrame';
33
40
  import { LineChart } from '../src/components/charts/LineChart';
@@ -60,6 +67,54 @@ function NotificationBellEntry() {
60
67
  );
61
68
  }
62
69
 
70
+ const MOBILE_NAV_DESTINATIONS = [
71
+ { route: '/triage', label: 'Triage', icon: InboxIcon, badgeCount: 7 },
72
+ { route: '/board', label: 'Board', icon: ViewKanbanIcon, badgeCount: 3 },
73
+ { route: '/chat', label: 'Chat', icon: ChatBubbleOutlineIcon },
74
+ { route: '/status', label: 'Status', icon: ScheduleIcon },
75
+ { route: '/more', label: 'Mehr', icon: MoreHorizIcon, emphasis: true },
76
+ ];
77
+
78
+ const PLAIN_MOBILE_NAV_THEME = createTheme();
79
+
80
+ function MobileBottomNavEntry() {
81
+ const [activeRoute, setActiveRoute] = useState('/triage');
82
+
83
+ return (
84
+ <Box sx={{ minHeight: 180 }}>
85
+ <Typography variant="h6">Mobile bottom navigation</Typography>
86
+ <Typography color="text.secondary">
87
+ The baseline and plain-MUI variants use the same five destinations. Both keep their edge
88
+ and evenly divided actions; their label and icon density may differ.
89
+ </Typography>
90
+ <Stack direction={{ xs: 'column', lg: 'row' }} spacing={2} sx={{ mt: 2 }}>
91
+ <Box sx={{ flex: 1, minWidth: 0 }}>
92
+ <Typography variant="subtitle2">createAppTheme baseline</Typography>
93
+ <MobileBottomNav
94
+ destinations={MOBILE_NAV_DESTINATIONS}
95
+ activeRoute={activeRoute}
96
+ onNavigate={setActiveRoute}
97
+ hideAbove="xl"
98
+ sx={{ position: 'relative', width: '100%', mt: 1 }}
99
+ />
100
+ </Box>
101
+ <ThemeProvider theme={PLAIN_MOBILE_NAV_THEME}>
102
+ <Box sx={{ flex: 1, minWidth: 0 }}>
103
+ <Typography variant="subtitle2">Plain createTheme</Typography>
104
+ <MobileBottomNav
105
+ destinations={MOBILE_NAV_DESTINATIONS}
106
+ activeRoute={activeRoute}
107
+ onNavigate={setActiveRoute}
108
+ hideAbove="xl"
109
+ sx={{ position: 'relative', width: '100%', mt: 1 }}
110
+ />
111
+ </Box>
112
+ </ThemeProvider>
113
+ </Stack>
114
+ </Box>
115
+ );
116
+ }
117
+
63
118
  function BarChartEntry() {
64
119
  return (
65
120
  <ChartFrame title="Monthly cases" subtitle="Standalone BarChart entry" minHeight={360}>
@@ -403,6 +458,7 @@ function MessagingScopeConfigEntry() { return <MessagingProvider api={messagingH
403
458
 
404
459
  export const entries = [
405
460
  { id: 'theme-baseline', label: 'Theme / Shared baseline', Component: ThemeBaselineEntry },
461
+ { id: 'mobile-bottom-nav', label: 'Navigation / Mobile bottom nav', Component: MobileBottomNavEntry },
406
462
  { id: 'notification-bell', label: 'Notifications / Bell', Component: NotificationBellEntry },
407
463
  { id: 'bar-chart', label: 'Charts / BarChart', Component: BarChartEntry },
408
464
  { id: 'time-series-chart', label: 'Charts / TimeSeriesChart', Component: TimeSeriesChartEntry },
package/dev/main.jsx CHANGED
@@ -30,12 +30,14 @@ function Harness() {
30
30
  const [mode, setMode] = useState('light');
31
31
  const [width, setWidth] = useState('desktop');
32
32
  const entry = entries.find((item) => item.id === entryId) || entries[0];
33
- const effectiveMode = entry.id === 'theme-baseline' ? 'light' : mode;
33
+ const usesBaselineTheme = ['theme-baseline', 'mobile-bottom-nav'].includes(entry.id);
34
+ const usesBrowserViewport = entry.id === 'mobile-bottom-nav';
35
+ const effectiveMode = usesBaselineTheme ? 'light' : mode;
34
36
  const theme = useMemo(
35
- () => entry.id === 'theme-baseline'
37
+ () => usesBaselineTheme
36
38
  ? createAppTheme({ palette: { primary: { main: '#3D5A99' } } })
37
39
  : createTheme({ palette: { mode } }),
38
- [entry.id, mode],
40
+ [mode, usesBaselineTheme],
39
41
  );
40
42
  const viewportWidth = width === 'mobile' ? 390 : width === 'tablet' ? 768 : 1180;
41
43
  const Entry = entry.Component;
@@ -47,8 +49,12 @@ function Harness() {
47
49
  <Stack direction={{ xs: 'column', md: 'row' }} spacing={2} sx={{ mb: 3 }} alignItems={{ md: 'center' }}>
48
50
  <Typography variant="h5" sx={{ mr: 'auto' }}>ui-core-micha harness</Typography>
49
51
  <FormControl size="small" sx={{ minWidth: 220 }}><InputLabel id="entry-label">Entry</InputLabel><Select labelId="entry-label" label="Entry" value={entryId} onChange={(event) => setEntryId(event.target.value)}>{entries.map((item) => <MenuItem key={item.id} value={item.id}>{item.label}</MenuItem>)}</Select></FormControl>
50
- <ButtonGroup size="small"><Button variant={effectiveMode === 'light' ? 'contained' : 'outlined'} onClick={() => setMode('light')}>Light</Button><Button disabled={entry.id === 'theme-baseline'} variant={effectiveMode === 'dark' ? 'contained' : 'outlined'} onClick={() => setMode('dark')}>Dark</Button></ButtonGroup>
51
- <ButtonGroup size="small">{['mobile', 'tablet', 'desktop'].map((size) => <Button key={size} variant={width === size ? 'contained' : 'outlined'} onClick={() => setWidth(size)}>{size}</Button>)}</ButtonGroup>
52
+ <ButtonGroup size="small"><Button variant={effectiveMode === 'light' ? 'contained' : 'outlined'} onClick={() => setMode('light')}>Light</Button><Button disabled={usesBaselineTheme} variant={effectiveMode === 'dark' ? 'contained' : 'outlined'} onClick={() => setMode('dark')}>Dark</Button></ButtonGroup>
53
+ {usesBrowserViewport ? (
54
+ <Typography variant="caption" color="text.secondary">Use the browser viewport for this specimen</Typography>
55
+ ) : (
56
+ <ButtonGroup size="small">{['mobile', 'tablet', 'desktop'].map((size) => <Button key={size} variant={width === size ? 'contained' : 'outlined'} onClick={() => setWidth(size)}>{size}</Button>)}</ButtonGroup>
57
+ )}
52
58
  </Stack>
53
59
  <Paper variant="outlined" sx={{ width: viewportWidth, maxWidth: '100%', mx: 'auto', p: 3, overflow: 'hidden', containerType: 'inline-size' }}>
54
60
  <Entry />
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Badge from '@mui/material/Badge';
3
+ import BottomNavigation from '@mui/material/BottomNavigation';
4
+ import BottomNavigationAction from '@mui/material/BottomNavigationAction';
5
+ import useMediaQuery from '@mui/material/useMediaQuery';
6
+ import { useTheme } from '@mui/material/styles';
7
+ const defaultZIndex = (theme) => theme.zIndex.drawer + 2;
8
+ export const MOBILE_BOTTOM_NAV_ROOT_SX = {
9
+ position: 'fixed',
10
+ left: 0,
11
+ right: 0,
12
+ bottom: 0,
13
+ borderTop: '1px solid',
14
+ borderColor: 'divider',
15
+ paddingBottom: 'env(safe-area-inset-bottom)',
16
+ };
17
+ export const MOBILE_BOTTOM_NAV_ACTION_SX = {
18
+ minWidth: 0,
19
+ maxWidth: 'none',
20
+ };
21
+ export function MobileBottomNav({ destinations, activeRoute, onNavigate, hideAbove = 'md', zIndex = defaultZIndex, sx = {}, }) {
22
+ const theme = useTheme();
23
+ const isHidden = useMediaQuery(theme.breakpoints.up(hideAbove));
24
+ const callerSx = Array.isArray(sx) ? sx : [sx];
25
+ if (isHidden)
26
+ return null;
27
+ return (_jsx(BottomNavigation, { value: activeRoute, onChange: (_, route) => onNavigate(route), showLabels: true, sx: [
28
+ Object.assign(Object.assign({}, MOBILE_BOTTOM_NAV_ROOT_SX), { zIndex }),
29
+ ...callerSx,
30
+ ], children: destinations.map((destination) => {
31
+ var _a;
32
+ const Icon = destination.icon;
33
+ const selected = activeRoute === destination.route;
34
+ const icon = (_jsx(Icon, { sx: destination.emphasis ? {
35
+ p: 0.8,
36
+ borderRadius: '50%',
37
+ backgroundColor: selected ? 'primary.main' : 'background.paper',
38
+ color: selected ? 'primary.contrastText' : 'primary.main',
39
+ boxShadow: 'none',
40
+ transform: 'translateY(-4px)',
41
+ } : undefined }));
42
+ return (_jsx(BottomNavigationAction, { value: destination.route, label: (_a = destination.shortLabel) !== null && _a !== void 0 ? _a : destination.label, "aria-label": destination.shortLabel != null ? destination.label : undefined, "aria-current": selected ? 'page' : undefined, sx: MOBILE_BOTTOM_NAV_ACTION_SX, icon: destination.badgeCount ? (_jsx(Badge, { badgeContent: destination.badgeCount, color: "error", max: 99, children: icon })) : icon }, destination.route));
43
+ }) }));
44
+ }
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ export { RegistrationMethodsManager } from './components/RegistrationMethodsMana
30
30
  export { AuthFactorRequirementCard } from './components/AuthFactorRequirementCard';
31
31
  export { AccessCodeSingleUseToggle } from './components/AccessCodeSingleUseToggle';
32
32
  export { QrSignupManager } from './components/QrSignupManager';
33
+ export { MobileBottomNav } from './components/MobileBottomNav';
33
34
  // --- 6. Charts ---
34
35
  export { ChartFrame } from './components/charts/ChartFrame';
35
36
  export { BarChart } from './components/charts/BarChart';
@@ -100,6 +100,21 @@ function createPaletteAwareComponents(palette) {
100
100
  outlined: { borderColor: palette.controlBorder.main },
101
101
  },
102
102
  },
103
+ MuiBottomNavigation: {
104
+ styleOverrides: {
105
+ root: {
106
+ backgroundColor: palette.background.paper,
107
+ },
108
+ },
109
+ },
110
+ MuiBottomNavigationAction: {
111
+ styleOverrides: {
112
+ root: {
113
+ color: palette.text.secondary,
114
+ '&.Mui-selected': { color: palette.primary.main },
115
+ },
116
+ },
117
+ },
103
118
  MuiOutlinedInput: {
104
119
  styleOverrides: {
105
120
  root: {
@@ -72,6 +72,22 @@ const COMPONENT_SURFACES = [
72
72
  var _a, _b, _c, _d, _e, _f;
73
73
  return (_f = (_e = (_d = (_c = (_b = (_a = theme.components) === null || _a === void 0 ? void 0 : _a.MuiChip) === null || _b === void 0 ? void 0 : _b.styleOverrides) === null || _c === void 0 ? void 0 : _c.root) === null || _d === void 0 ? void 0 : _d['@media (any-pointer: coarse)']) === null || _e === void 0 ? void 0 : _e['&::after']) === null || _f === void 0 ? void 0 : _f.inset;
74
74
  }),
75
+ componentPath('MuiBottomNavigation', 'styleOverrides.root.boxShadow'),
76
+ componentPath('MuiBottomNavigation', 'styleOverrides.root.backgroundColor'),
77
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.root.padding'),
78
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.root.gap'),
79
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.root', '& .MuiSvgIcon-root', 'width'),
80
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.root', '& .MuiSvgIcon-root', 'height'),
81
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.root.color'),
82
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.fontSize'),
83
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.fontWeight'),
84
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.lineHeight'),
85
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.maxWidth'),
86
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.whiteSpace'),
87
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.overflow'),
88
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.textOverflow'),
89
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.label', '&.Mui-selected', 'fontSize'),
90
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.root', '&.Mui-selected', 'color'),
75
91
  componentPath('MuiTextField', 'defaultProps.variant'),
76
92
  componentPath('MuiTextField', 'styleOverrides.root.minHeight'),
77
93
  componentKeyLeaf('MuiTextField', 'styleOverrides.root', '@media (any-pointer: coarse)', 'minHeight'),
@@ -260,6 +260,30 @@ export const BASELINE_STATIC = {
260
260
  },
261
261
  },
262
262
  },
263
+ MuiBottomNavigation: {
264
+ styleOverrides: {
265
+ root: { boxShadow: 'none' },
266
+ },
267
+ },
268
+ MuiBottomNavigationAction: {
269
+ styleOverrides: {
270
+ root: {
271
+ padding: '0 2px',
272
+ gap: '2px',
273
+ '& .MuiSvgIcon-root': { width: '22px', height: '22px' },
274
+ },
275
+ label: {
276
+ fontSize: '12px',
277
+ fontWeight: 500,
278
+ lineHeight: 1.2,
279
+ maxWidth: '100%',
280
+ whiteSpace: 'nowrap',
281
+ overflow: 'hidden',
282
+ textOverflow: 'ellipsis',
283
+ '&.Mui-selected': { fontSize: '12px' },
284
+ },
285
+ },
286
+ },
263
287
  MuiTextField: {
264
288
  defaultProps: { variant: 'outlined' },
265
289
  styleOverrides: { root: Object.assign({ minHeight: 40 }, coarseHitArea) },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micha.bigler/ui-core-micha",
3
- "version": "2.32.0",
3
+ "version": "2.33.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "repository": {
@@ -0,0 +1,82 @@
1
+ import Badge from '@mui/material/Badge';
2
+ import BottomNavigation from '@mui/material/BottomNavigation';
3
+ import BottomNavigationAction from '@mui/material/BottomNavigationAction';
4
+ import useMediaQuery from '@mui/material/useMediaQuery';
5
+ import { useTheme } from '@mui/material/styles';
6
+
7
+ const defaultZIndex = (theme) => theme.zIndex.drawer + 2;
8
+
9
+ export const MOBILE_BOTTOM_NAV_ROOT_SX = {
10
+ position: 'fixed',
11
+ left: 0,
12
+ right: 0,
13
+ bottom: 0,
14
+ borderTop: '1px solid',
15
+ borderColor: 'divider',
16
+ paddingBottom: 'env(safe-area-inset-bottom)',
17
+ };
18
+
19
+ export const MOBILE_BOTTOM_NAV_ACTION_SX = {
20
+ minWidth: 0,
21
+ maxWidth: 'none',
22
+ };
23
+
24
+ export function MobileBottomNav({
25
+ destinations,
26
+ activeRoute,
27
+ onNavigate,
28
+ hideAbove = 'md',
29
+ zIndex = defaultZIndex,
30
+ sx = {},
31
+ }) {
32
+ const theme = useTheme();
33
+ const isHidden = useMediaQuery(theme.breakpoints.up(hideAbove));
34
+ const callerSx = Array.isArray(sx) ? sx : [sx];
35
+
36
+ if (isHidden) return null;
37
+
38
+ return (
39
+ <BottomNavigation
40
+ value={activeRoute}
41
+ onChange={(_, route) => onNavigate(route)}
42
+ showLabels
43
+ sx={[
44
+ { ...MOBILE_BOTTOM_NAV_ROOT_SX, zIndex },
45
+ ...callerSx,
46
+ ]}
47
+ >
48
+ {destinations.map((destination) => {
49
+ const Icon = destination.icon;
50
+ const selected = activeRoute === destination.route;
51
+ const icon = (
52
+ <Icon
53
+ sx={destination.emphasis ? {
54
+ p: 0.8,
55
+ borderRadius: '50%',
56
+ backgroundColor: selected ? 'primary.main' : 'background.paper',
57
+ color: selected ? 'primary.contrastText' : 'primary.main',
58
+ boxShadow: 'none',
59
+ transform: 'translateY(-4px)',
60
+ } : undefined}
61
+ />
62
+ );
63
+
64
+ return (
65
+ <BottomNavigationAction
66
+ key={destination.route}
67
+ value={destination.route}
68
+ label={destination.shortLabel ?? destination.label}
69
+ aria-label={destination.shortLabel != null ? destination.label : undefined}
70
+ aria-current={selected ? 'page' : undefined}
71
+ sx={MOBILE_BOTTOM_NAV_ACTION_SX}
72
+ icon={destination.badgeCount ? (
73
+ <Badge badgeContent={destination.badgeCount} color="error" max={99}>
74
+ {icon}
75
+ </Badge>
76
+ ) : icon}
77
+ />
78
+ );
79
+ })}
80
+ </BottomNavigation>
81
+ );
82
+ }
package/src/index.js CHANGED
@@ -48,6 +48,7 @@ export { RegistrationMethodsManager } from './components/RegistrationMethodsMana
48
48
  export { AuthFactorRequirementCard } from './components/AuthFactorRequirementCard';
49
49
  export { AccessCodeSingleUseToggle } from './components/AccessCodeSingleUseToggle';
50
50
  export { QrSignupManager } from './components/QrSignupManager';
51
+ export { MobileBottomNav } from './components/MobileBottomNav';
51
52
 
52
53
  // --- 6. Charts ---
53
54
  export { ChartFrame } from './components/charts/ChartFrame';
@@ -116,6 +116,21 @@ function createPaletteAwareComponents(palette) {
116
116
  outlined: { borderColor: palette.controlBorder.main },
117
117
  },
118
118
  },
119
+ MuiBottomNavigation: {
120
+ styleOverrides: {
121
+ root: {
122
+ backgroundColor: palette.background.paper,
123
+ },
124
+ },
125
+ },
126
+ MuiBottomNavigationAction: {
127
+ styleOverrides: {
128
+ root: {
129
+ color: palette.text.secondary,
130
+ '&.Mui-selected': { color: palette.primary.main },
131
+ },
132
+ },
133
+ },
119
134
  MuiOutlinedInput: {
120
135
  styleOverrides: {
121
136
  root: {
@@ -96,6 +96,22 @@ const COMPONENT_SURFACES = [
96
96
  (theme) => theme.components?.MuiChip?.styleOverrides?.root
97
97
  ?.['@media (any-pointer: coarse)']?.['&::after']?.inset,
98
98
  ),
99
+ componentPath('MuiBottomNavigation', 'styleOverrides.root.boxShadow'),
100
+ componentPath('MuiBottomNavigation', 'styleOverrides.root.backgroundColor'),
101
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.root.padding'),
102
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.root.gap'),
103
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.root', '& .MuiSvgIcon-root', 'width'),
104
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.root', '& .MuiSvgIcon-root', 'height'),
105
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.root.color'),
106
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.fontSize'),
107
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.fontWeight'),
108
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.lineHeight'),
109
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.maxWidth'),
110
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.whiteSpace'),
111
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.overflow'),
112
+ componentPath('MuiBottomNavigationAction', 'styleOverrides.label.textOverflow'),
113
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.label', '&.Mui-selected', 'fontSize'),
114
+ componentKeyLeaf('MuiBottomNavigationAction', 'styleOverrides.root', '&.Mui-selected', 'color'),
99
115
  componentPath('MuiTextField', 'defaultProps.variant'),
100
116
  componentPath('MuiTextField', 'styleOverrides.root.minHeight'),
101
117
  componentKeyLeaf('MuiTextField', 'styleOverrides.root', '@media (any-pointer: coarse)', 'minHeight'),
@@ -306,6 +306,30 @@ export const BASELINE_STATIC = {
306
306
  },
307
307
  },
308
308
  },
309
+ MuiBottomNavigation: {
310
+ styleOverrides: {
311
+ root: { boxShadow: 'none' },
312
+ },
313
+ },
314
+ MuiBottomNavigationAction: {
315
+ styleOverrides: {
316
+ root: {
317
+ padding: '0 2px',
318
+ gap: '2px',
319
+ '& .MuiSvgIcon-root': { width: '22px', height: '22px' },
320
+ },
321
+ label: {
322
+ fontSize: '12px',
323
+ fontWeight: 500,
324
+ lineHeight: 1.2,
325
+ maxWidth: '100%',
326
+ whiteSpace: 'nowrap',
327
+ overflow: 'hidden',
328
+ textOverflow: 'ellipsis',
329
+ '&.Mui-selected': { fontSize: '12px' },
330
+ },
331
+ },
332
+ },
309
333
  MuiTextField: {
310
334
  defaultProps: { variant: 'outlined' },
311
335
  styleOverrides: { root: { minHeight: 40, ...coarseHitArea } },