@umodeapporg/ui 0.38.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Shell/AppHeader.d.ts +2 -0
- package/dist/components/Shell/AppHeader.js +2 -0
- package/dist/components/Shell/AppHeader.js.map +1 -1
- package/dist/components/Shell/AppShell.d.ts +2 -0
- package/dist/components/Shell/AppShell.js +2 -0
- package/dist/components/Shell/AppShell.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/styles/theme.css +7 -1
|
@@ -18,6 +18,8 @@ interface IAppHeaderProps {
|
|
|
18
18
|
controlsSlot?: ReactNode;
|
|
19
19
|
/** The account surface (usually the lib's UserMenu wired by the host). */
|
|
20
20
|
userMenuSlot?: ReactNode;
|
|
21
|
+
/** Seasonal ornament painted across the header, behind its controls, never taking a click. */
|
|
22
|
+
decoration?: ReactNode;
|
|
21
23
|
onHoverEnter: () => void;
|
|
22
24
|
onHoverLeave: () => void;
|
|
23
25
|
}
|
|
@@ -17,12 +17,14 @@ const AppHeader = ({
|
|
|
17
17
|
toolsSlot,
|
|
18
18
|
controlsSlot,
|
|
19
19
|
userMenuSlot,
|
|
20
|
+
decoration,
|
|
20
21
|
onHoverEnter,
|
|
21
22
|
onHoverLeave
|
|
22
23
|
}) => {
|
|
23
24
|
const { t } = useTranslation("ui");
|
|
24
25
|
const { Link: NavigationLink } = useUiNavigation();
|
|
25
26
|
return /* @__PURE__ */ jsxs("header", { className: "fixed top-0 z-50 flex h-16 w-full select-none items-center justify-between border-x-0 border-t-0 py-2 pr-4 glass-subtle", children: [
|
|
27
|
+
decoration && /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 -z-10 overflow-hidden print:hidden", children: decoration }),
|
|
26
28
|
/* @__PURE__ */ jsxs("div", { className: "flex cursor-pointer items-center gap-x-2", children: [
|
|
27
29
|
/* @__PURE__ */ jsx("div", { className: "sidebar-rail-slot flex shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
28
30
|
MaterialSymbol,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.js","sources":["../../../src/components/Shell/AppHeader.tsx"],"sourcesContent":["import { ReactNode, Ref } from 'react';\nimport classNames from 'classnames';\nimport { useTranslation } from 'react-i18next';\n\nimport { useUiNavigation } from '@/components/Navigation/UiNavigationContext';\nimport ControlledTooltip from '@/components/UI/ControlledTooltip';\nimport { MaterialSymbol } from '@/components/UI/MaterialSymbol';\nimport UmodeLogo from '@/components/UI/UmodeLogo';\n\nimport { HEADER_CONTROL_SHELL_CLASS } from './headerControlStyles';\n\ninterface IAppHeaderProps {\n toggleSidebar: () => void;\n isSidebarOpen: boolean;\n toggleLabelKey: string;\n toggleRef?: Ref<HTMLElement>;\n /** Mobile drawer only: drives `aria-expanded` / `aria-controls` on the toggle. */\n mobileSidebar?: { id: string; open: boolean };\n homePath: string;\n /** Replaces the uMode logo; the header stays the same. */\n logo?: ReactNode;\n /** App tools rendered inside the pill shell (workspace, notifications...). */\n toolsSlot?: ReactNode;\n /** Theme/language knobs (usually the lib's ThemeToggle + LanguageToggle wired by the host). */\n controlsSlot?: ReactNode;\n /** The account surface (usually the lib's UserMenu wired by the host). */\n userMenuSlot?: ReactNode;\n onHoverEnter: () => void;\n onHoverLeave: () => void;\n}\n\nconst AppHeader: React.FC<IAppHeaderProps> = ({\n toggleSidebar,\n isSidebarOpen,\n toggleLabelKey,\n toggleRef,\n mobileSidebar,\n homePath,\n logo,\n toolsSlot,\n controlsSlot,\n userMenuSlot,\n onHoverEnter,\n onHoverLeave,\n}) => {\n const { t } = useTranslation('ui');\n const { Link: NavigationLink } = useUiNavigation();\n\n return (\n <header className=\"fixed top-0 z-50 flex h-16 w-full select-none items-center justify-between border-x-0 border-t-0 py-2 pr-4 glass-subtle\">\n <div className=\"flex cursor-pointer items-center gap-x-2\">\n <div className=\"sidebar-rail-slot flex shrink-0 items-center justify-center\">\n <MaterialSymbol\n icon={isSidebarOpen ? 'menu_open' : 'menu'}\n size={22}\n weight={400}\n ref={toggleRef}\n onClick={toggleSidebar}\n aria-controls={mobileSidebar?.id}\n aria-expanded={mobileSidebar?.open}\n onMouseEnter={onHoverEnter}\n onMouseLeave={onHoverLeave}\n aria-label={t(toggleLabelKey)}\n className={classNames(\n 'rounded-lg p-1 transition-colors duration-base',\n isSidebarOpen\n ? 'text-brand-emphasis hover:bg-brand-soft'\n : 'text-foreground-muted hover:bg-muted-hover hover:text-foreground',\n )}\n />\n </div>\n\n <ControlledTooltip content={t('sidebar.home')}>\n <NavigationLink\n to={homePath}\n aria-label={t('sidebar.home')}\n className=\"interactive hidden shrink-0 rounded-lg px-1 text-foreground hover:opacity-70 tablet:block\"\n >\n {logo ?? <UmodeLogo className=\"h-5 w-auto\" />}\n </NavigationLink>\n </ControlledTooltip>\n </div>\n\n {/* min-w-0: when the header runs out of room this side gives way, so a user menu that truncates can truncate. */}\n <div className=\"flex min-w-0 items-center gap-x-2\">\n {toolsSlot && <div className={HEADER_CONTROL_SHELL_CLASS}>{toolsSlot}</div>}\n {controlsSlot}\n\n {userMenuSlot && (\n <>\n <div className=\"mx-1 h-6 w-px shrink-0 bg-border\" aria-hidden />\n {userMenuSlot}\n </>\n )}\n </div>\n </header>\n );\n};\n\nexport default AppHeader;\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"AppHeader.js","sources":["../../../src/components/Shell/AppHeader.tsx"],"sourcesContent":["import { ReactNode, Ref } from 'react';\nimport classNames from 'classnames';\nimport { useTranslation } from 'react-i18next';\n\nimport { useUiNavigation } from '@/components/Navigation/UiNavigationContext';\nimport ControlledTooltip from '@/components/UI/ControlledTooltip';\nimport { MaterialSymbol } from '@/components/UI/MaterialSymbol';\nimport UmodeLogo from '@/components/UI/UmodeLogo';\n\nimport { HEADER_CONTROL_SHELL_CLASS } from './headerControlStyles';\n\ninterface IAppHeaderProps {\n toggleSidebar: () => void;\n isSidebarOpen: boolean;\n toggleLabelKey: string;\n toggleRef?: Ref<HTMLElement>;\n /** Mobile drawer only: drives `aria-expanded` / `aria-controls` on the toggle. */\n mobileSidebar?: { id: string; open: boolean };\n homePath: string;\n /** Replaces the uMode logo; the header stays the same. */\n logo?: ReactNode;\n /** App tools rendered inside the pill shell (workspace, notifications...). */\n toolsSlot?: ReactNode;\n /** Theme/language knobs (usually the lib's ThemeToggle + LanguageToggle wired by the host). */\n controlsSlot?: ReactNode;\n /** The account surface (usually the lib's UserMenu wired by the host). */\n userMenuSlot?: ReactNode;\n /** Seasonal ornament painted across the header, behind its controls, never taking a click. */\n decoration?: ReactNode;\n onHoverEnter: () => void;\n onHoverLeave: () => void;\n}\n\nconst AppHeader: React.FC<IAppHeaderProps> = ({\n toggleSidebar,\n isSidebarOpen,\n toggleLabelKey,\n toggleRef,\n mobileSidebar,\n homePath,\n logo,\n toolsSlot,\n controlsSlot,\n userMenuSlot,\n decoration,\n onHoverEnter,\n onHoverLeave,\n}) => {\n const { t } = useTranslation('ui');\n const { Link: NavigationLink } = useUiNavigation();\n\n return (\n <header className=\"fixed top-0 z-50 flex h-16 w-full select-none items-center justify-between border-x-0 border-t-0 py-2 pr-4 glass-subtle\">\n {decoration && (\n <div aria-hidden className=\"pointer-events-none absolute inset-0 -z-10 overflow-hidden print:hidden\">\n {decoration}\n </div>\n )}\n\n <div className=\"flex cursor-pointer items-center gap-x-2\">\n <div className=\"sidebar-rail-slot flex shrink-0 items-center justify-center\">\n <MaterialSymbol\n icon={isSidebarOpen ? 'menu_open' : 'menu'}\n size={22}\n weight={400}\n ref={toggleRef}\n onClick={toggleSidebar}\n aria-controls={mobileSidebar?.id}\n aria-expanded={mobileSidebar?.open}\n onMouseEnter={onHoverEnter}\n onMouseLeave={onHoverLeave}\n aria-label={t(toggleLabelKey)}\n className={classNames(\n 'rounded-lg p-1 transition-colors duration-base',\n isSidebarOpen\n ? 'text-brand-emphasis hover:bg-brand-soft'\n : 'text-foreground-muted hover:bg-muted-hover hover:text-foreground',\n )}\n />\n </div>\n\n <ControlledTooltip content={t('sidebar.home')}>\n <NavigationLink\n to={homePath}\n aria-label={t('sidebar.home')}\n className=\"interactive hidden shrink-0 rounded-lg px-1 text-foreground hover:opacity-70 tablet:block\"\n >\n {logo ?? <UmodeLogo className=\"h-5 w-auto\" />}\n </NavigationLink>\n </ControlledTooltip>\n </div>\n\n {/* min-w-0: when the header runs out of room this side gives way, so a user menu that truncates can truncate. */}\n <div className=\"flex min-w-0 items-center gap-x-2\">\n {toolsSlot && <div className={HEADER_CONTROL_SHELL_CLASS}>{toolsSlot}</div>}\n {controlsSlot}\n\n {userMenuSlot && (\n <>\n <div className=\"mx-1 h-6 w-px shrink-0 bg-border\" aria-hidden />\n {userMenuSlot}\n </>\n )}\n </div>\n </header>\n );\n};\n\nexport default AppHeader;\n"],"names":[],"mappings":";;;;;;;;AAiCA,MAAM,YAAuC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,EAAA,IAAM,eAAe,IAAI;AACjC,QAAM,EAAE,MAAM,eAAA,IAAmB,gBAAA;AAEjC,SACE,qBAAC,UAAA,EAAO,WAAU,2HACf,UAAA;AAAA,IAAA,kCACE,OAAA,EAAI,eAAW,MAAC,WAAU,2EACxB,UAAA,YACH;AAAA,IAGF,qBAAC,OAAA,EAAI,WAAU,4CACb,UAAA;AAAA,MAAA,oBAAC,OAAA,EAAI,WAAU,+DACb,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM,gBAAgB,cAAc;AAAA,UACpC,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,KAAK;AAAA,UACL,SAAS;AAAA,UACT,iBAAe,eAAe;AAAA,UAC9B,iBAAe,eAAe;AAAA,UAC9B,cAAc;AAAA,UACd,cAAc;AAAA,UACd,cAAY,EAAE,cAAc;AAAA,UAC5B,WAAW;AAAA,YACT;AAAA,YACA,gBACI,4CACA;AAAA,UAAA;AAAA,QACN;AAAA,MAAA,GAEJ;AAAA,MAEA,oBAAC,mBAAA,EAAkB,SAAS,EAAE,cAAc,GAC1C,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI;AAAA,UACJ,cAAY,EAAE,cAAc;AAAA,UAC5B,WAAU;AAAA,UAET,UAAA,QAAQ,oBAAC,WAAA,EAAU,WAAU,aAAA,CAAa;AAAA,QAAA;AAAA,MAAA,EAC7C,CACF;AAAA,IAAA,GACF;AAAA,IAGA,qBAAC,OAAA,EAAI,WAAU,qCACZ,UAAA;AAAA,MAAA,aAAa,oBAAC,OAAA,EAAI,WAAW,4BAA6B,UAAA,WAAU;AAAA,MACpE;AAAA,MAEA,gBACC,qBAAA,UAAA,EACE,UAAA;AAAA,QAAA,oBAAC,OAAA,EAAI,WAAU,oCAAmC,eAAW,MAAC;AAAA,QAC7D;AAAA,MAAA,EAAA,CACH;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -7,6 +7,8 @@ interface IAppShellProps {
|
|
|
7
7
|
toolsSlot?: ReactNode;
|
|
8
8
|
controlsSlot?: ReactNode;
|
|
9
9
|
userMenuSlot?: ReactNode;
|
|
10
|
+
/** Seasonal ornament across the header (a string of lights), behind its controls. */
|
|
11
|
+
headerDecoration?: ReactNode;
|
|
10
12
|
/** Sidebar rows pinned to the foot, above the sign-out row (profile, settings, help). */
|
|
11
13
|
footerItems?: Array<ISidebarMenuItem>;
|
|
12
14
|
/** Sidebar footer sign-out row; hidden when absent. */
|
|
@@ -19,6 +19,7 @@ const AppShell = ({
|
|
|
19
19
|
toolsSlot,
|
|
20
20
|
controlsSlot,
|
|
21
21
|
userMenuSlot,
|
|
22
|
+
headerDecoration,
|
|
22
23
|
footerItems,
|
|
23
24
|
onLogout,
|
|
24
25
|
children
|
|
@@ -88,6 +89,7 @@ const AppShell = ({
|
|
|
88
89
|
toolsSlot,
|
|
89
90
|
controlsSlot,
|
|
90
91
|
userMenuSlot,
|
|
92
|
+
decoration: headerDecoration,
|
|
91
93
|
onHoverEnter,
|
|
92
94
|
onHoverLeave
|
|
93
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.js","sources":["../../../src/components/Shell/AppShell.tsx"],"sourcesContent":["import { ReactNode, useEffect, useId, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport { getTabbableElements } from '@/components/Form/ControlledDialogPrimitives';\nimport { useUiNavigation } from '@/components/Navigation/UiNavigationContext';\n\nimport AppHeader from './AppHeader';\nimport AppSidebar from './AppSidebar';\nimport { ISidebarMenuItem } from './SidebarMenu';\nimport { useSidebarState } from './useSidebarState';\n\nimport '../../styles/sidebar.css';\n\ninterface IAppShellProps {\n items: Array<ISidebarMenuItem>;\n homePath: string;\n logo?: ReactNode;\n toolsSlot?: ReactNode;\n controlsSlot?: ReactNode;\n userMenuSlot?: ReactNode;\n /** Sidebar rows pinned to the foot, above the sign-out row (profile, settings, help). */\n footerItems?: Array<ISidebarMenuItem>;\n /** Sidebar footer sign-out row; hidden when absent. */\n onLogout?: () => void;\n children: ReactNode;\n}\n\nconst setInert = (element: HTMLElement | null, inert: boolean) => {\n if (!element) return;\n if (inert) element.setAttribute('inert', '');\n else element.removeAttribute('inert');\n};\n\n/**\n * The uMode application chrome: fixed glass header, rail/dock/hover sidebar (pin persisted\n * through uiPreferences, Ctrl+\\ shortcut) and the scroll container every page renders into.\n * Everything app-shaped (menu items, tools, account surface, logout) arrives as props/slots.\n */\nconst AppShell: React.FC<IAppShellProps> = ({\n items,\n homePath,\n logo,\n toolsSlot,\n controlsSlot,\n userMenuSlot,\n footerItems,\n onLogout,\n children,\n}) => {\n const { location } = useUiNavigation();\n const scrollRef = useRef<HTMLDivElement>(null);\n const sidebarRef = useRef<HTMLElement>(null);\n const toggleRef = useRef<HTMLElement>(null);\n const wasMobileOpenRef = useRef(false);\n const sidebarId = useId();\n\n const {\n isMobile,\n isVisible,\n isDocked,\n isOverlayOnMobile,\n showRail,\n toggleLabelKey,\n togglePrimary,\n onHoverEnter,\n onHoverLeave,\n closeMobileDrawer,\n } = useSidebarState();\n\n const isSidebarHidden = isMobile && !isVisible;\n const wasSidebarHiddenRef = useRef(isSidebarHidden);\n\n useEffect(() => {\n scrollRef.current?.scrollTo({ top: 0, behavior: 'smooth' });\n }, [location.pathname]);\n\n /* The closed mobile drawer only slides off-screen, so it can animate out: `inert` takes it\n out of the Tab order and the accessibility tree, and the open drawer makes the page behind\n its scrim inert instead. Set through the DOM because React 18 does not type the attribute.\n Focus leaves the sidebar BEFORE it goes inert, and only when it is actually being hidden\n (drawer closing, or a desktop resize down to mobile): a drawer that becomes the visible\n desktop sidebar keeps the focus where it is. */\n useEffect(() => {\n const sidebar = sidebarRef.current;\n const wasOpen = wasMobileOpenRef.current;\n const wasHidden = wasSidebarHiddenRef.current;\n wasMobileOpenRef.current = isOverlayOnMobile;\n wasSidebarHiddenRef.current = isSidebarHidden;\n\n if (sidebar && isSidebarHidden && !wasHidden) {\n const active = document.activeElement;\n const isFocusLost = sidebar.contains(active) || (wasOpen && (!active || active === document.body));\n if (isFocusLost) toggleRef.current?.focus();\n }\n\n setInert(sidebar, isSidebarHidden);\n setInert(scrollRef.current, isOverlayOnMobile);\n\n if (sidebar && isOverlayOnMobile && !wasOpen) getTabbableElements(sidebar)[0]?.focus();\n }, [isSidebarHidden, isOverlayOnMobile]);\n\n useEffect(() => {\n if (!isOverlayOnMobile) return undefined;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented) return;\n const active = document.activeElement;\n const ownsFocus =\n !active || active === document.body || active === toggleRef.current || sidebarRef.current?.contains(active);\n if (!ownsFocus) return;\n event.preventDefault();\n closeMobileDrawer();\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOverlayOnMobile, closeMobileDrawer]);\n\n return (\n <div className=\"h-screen w-full bg-surface\">\n <AppHeader\n toggleSidebar={togglePrimary}\n isSidebarOpen={isDocked}\n toggleLabelKey={toggleLabelKey}\n toggleRef={toggleRef}\n mobileSidebar={isMobile ? { id: sidebarId, open: isOverlayOnMobile } : undefined}\n homePath={homePath}\n logo={logo}\n toolsSlot={toolsSlot}\n controlsSlot={controlsSlot}\n userMenuSlot={userMenuSlot}\n onHoverEnter={onHoverEnter}\n onHoverLeave={onHoverLeave}\n />\n\n <main\n className={classNames('sidebar-content flex h-screen w-full', {\n 'is-rail': !isMobile && !isDocked,\n 'is-mobile': isMobile,\n })}\n >\n {isOverlayOnMobile && (\n <div\n aria-hidden\n className=\"fixed inset-0 z-40 bg-scrim motion-reduce:transition-none\"\n onClick={closeMobileDrawer}\n />\n )}\n\n <AppSidebar\n id={sidebarId}\n sidebarRef={sidebarRef}\n items={items}\n isMobile={isMobile}\n isVisible={isVisible}\n collapsed={showRail}\n isFloating={!isMobile && !showRail && !isDocked}\n onHoverEnter={onHoverEnter}\n onHoverLeave={onHoverLeave}\n onNavigate={isMobile ? closeMobileDrawer : undefined}\n footerItems={footerItems}\n onLogout={onLogout}\n />\n\n <div\n id=\"scrollableDiv\"\n ref={scrollRef}\n className=\"z-30 h-screen w-full px-4 pt-24 tablet:px-6\"\n style={{ overflow: 'auto' }}\n >\n {children}\n </div>\n </main>\n </div>\n );\n};\n\nexport default AppShell;\n"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AppShell.js","sources":["../../../src/components/Shell/AppShell.tsx"],"sourcesContent":["import { ReactNode, useEffect, useId, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport { getTabbableElements } from '@/components/Form/ControlledDialogPrimitives';\nimport { useUiNavigation } from '@/components/Navigation/UiNavigationContext';\n\nimport AppHeader from './AppHeader';\nimport AppSidebar from './AppSidebar';\nimport { ISidebarMenuItem } from './SidebarMenu';\nimport { useSidebarState } from './useSidebarState';\n\nimport '../../styles/sidebar.css';\n\ninterface IAppShellProps {\n items: Array<ISidebarMenuItem>;\n homePath: string;\n logo?: ReactNode;\n toolsSlot?: ReactNode;\n controlsSlot?: ReactNode;\n userMenuSlot?: ReactNode;\n /** Seasonal ornament across the header (a string of lights), behind its controls. */\n headerDecoration?: ReactNode;\n /** Sidebar rows pinned to the foot, above the sign-out row (profile, settings, help). */\n footerItems?: Array<ISidebarMenuItem>;\n /** Sidebar footer sign-out row; hidden when absent. */\n onLogout?: () => void;\n children: ReactNode;\n}\n\nconst setInert = (element: HTMLElement | null, inert: boolean) => {\n if (!element) return;\n if (inert) element.setAttribute('inert', '');\n else element.removeAttribute('inert');\n};\n\n/**\n * The uMode application chrome: fixed glass header, rail/dock/hover sidebar (pin persisted\n * through uiPreferences, Ctrl+\\ shortcut) and the scroll container every page renders into.\n * Everything app-shaped (menu items, tools, account surface, logout) arrives as props/slots.\n */\nconst AppShell: React.FC<IAppShellProps> = ({\n items,\n homePath,\n logo,\n toolsSlot,\n controlsSlot,\n userMenuSlot,\n headerDecoration,\n footerItems,\n onLogout,\n children,\n}) => {\n const { location } = useUiNavigation();\n const scrollRef = useRef<HTMLDivElement>(null);\n const sidebarRef = useRef<HTMLElement>(null);\n const toggleRef = useRef<HTMLElement>(null);\n const wasMobileOpenRef = useRef(false);\n const sidebarId = useId();\n\n const {\n isMobile,\n isVisible,\n isDocked,\n isOverlayOnMobile,\n showRail,\n toggleLabelKey,\n togglePrimary,\n onHoverEnter,\n onHoverLeave,\n closeMobileDrawer,\n } = useSidebarState();\n\n const isSidebarHidden = isMobile && !isVisible;\n const wasSidebarHiddenRef = useRef(isSidebarHidden);\n\n useEffect(() => {\n scrollRef.current?.scrollTo({ top: 0, behavior: 'smooth' });\n }, [location.pathname]);\n\n /* The closed mobile drawer only slides off-screen, so it can animate out: `inert` takes it\n out of the Tab order and the accessibility tree, and the open drawer makes the page behind\n its scrim inert instead. Set through the DOM because React 18 does not type the attribute.\n Focus leaves the sidebar BEFORE it goes inert, and only when it is actually being hidden\n (drawer closing, or a desktop resize down to mobile): a drawer that becomes the visible\n desktop sidebar keeps the focus where it is. */\n useEffect(() => {\n const sidebar = sidebarRef.current;\n const wasOpen = wasMobileOpenRef.current;\n const wasHidden = wasSidebarHiddenRef.current;\n wasMobileOpenRef.current = isOverlayOnMobile;\n wasSidebarHiddenRef.current = isSidebarHidden;\n\n if (sidebar && isSidebarHidden && !wasHidden) {\n const active = document.activeElement;\n const isFocusLost = sidebar.contains(active) || (wasOpen && (!active || active === document.body));\n if (isFocusLost) toggleRef.current?.focus();\n }\n\n setInert(sidebar, isSidebarHidden);\n setInert(scrollRef.current, isOverlayOnMobile);\n\n if (sidebar && isOverlayOnMobile && !wasOpen) getTabbableElements(sidebar)[0]?.focus();\n }, [isSidebarHidden, isOverlayOnMobile]);\n\n useEffect(() => {\n if (!isOverlayOnMobile) return undefined;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented) return;\n const active = document.activeElement;\n const ownsFocus =\n !active || active === document.body || active === toggleRef.current || sidebarRef.current?.contains(active);\n if (!ownsFocus) return;\n event.preventDefault();\n closeMobileDrawer();\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOverlayOnMobile, closeMobileDrawer]);\n\n return (\n <div className=\"h-screen w-full bg-surface\">\n <AppHeader\n toggleSidebar={togglePrimary}\n isSidebarOpen={isDocked}\n toggleLabelKey={toggleLabelKey}\n toggleRef={toggleRef}\n mobileSidebar={isMobile ? { id: sidebarId, open: isOverlayOnMobile } : undefined}\n homePath={homePath}\n logo={logo}\n toolsSlot={toolsSlot}\n controlsSlot={controlsSlot}\n userMenuSlot={userMenuSlot}\n decoration={headerDecoration}\n onHoverEnter={onHoverEnter}\n onHoverLeave={onHoverLeave}\n />\n\n <main\n className={classNames('sidebar-content flex h-screen w-full', {\n 'is-rail': !isMobile && !isDocked,\n 'is-mobile': isMobile,\n })}\n >\n {isOverlayOnMobile && (\n <div\n aria-hidden\n className=\"fixed inset-0 z-40 bg-scrim motion-reduce:transition-none\"\n onClick={closeMobileDrawer}\n />\n )}\n\n <AppSidebar\n id={sidebarId}\n sidebarRef={sidebarRef}\n items={items}\n isMobile={isMobile}\n isVisible={isVisible}\n collapsed={showRail}\n isFloating={!isMobile && !showRail && !isDocked}\n onHoverEnter={onHoverEnter}\n onHoverLeave={onHoverLeave}\n onNavigate={isMobile ? closeMobileDrawer : undefined}\n footerItems={footerItems}\n onLogout={onLogout}\n />\n\n <div\n id=\"scrollableDiv\"\n ref={scrollRef}\n className=\"z-30 h-screen w-full px-4 pt-24 tablet:px-6\"\n style={{ overflow: 'auto' }}\n >\n {children}\n </div>\n </main>\n </div>\n );\n};\n\nexport default AppShell;\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -338,7 +338,9 @@
|
|
|
338
338
|
- Gold lives in `ring`, which is never a text background: focus, and the glow of the
|
|
339
339
|
decoration. Cranberry lives in `accent`, whose ink turns white because it is dark.
|
|
340
340
|
- The chart palette only swaps series 1 and 6, so the first series follows the brand and
|
|
341
|
-
the set the audit already separated stays the same set.
|
|
341
|
+
the set the audit already separated stays the same set.
|
|
342
|
+
- The night turns from violet to a midnight blue: it is the winter sky a host paints
|
|
343
|
+
behind the page while the skin is on, and the gold of the ring is its accent. */
|
|
342
344
|
:root[data-theme='dark'][data-theme-skin='christmas'] {
|
|
343
345
|
--color-ring: 236 190 80;
|
|
344
346
|
--color-selection: 22 90 66;
|
|
@@ -364,6 +366,10 @@
|
|
|
364
366
|
--color-success-border: 52 80 26;
|
|
365
367
|
--color-chart-1: 74 222 128;
|
|
366
368
|
--color-chart-6: 180 124 245;
|
|
369
|
+
--color-night: 9 20 50;
|
|
370
|
+
--color-night-lobe: 24 52 120;
|
|
371
|
+
--color-night-muted: 204 218 240;
|
|
372
|
+
--color-night-accent: 236 190 80;
|
|
367
373
|
}
|
|
368
374
|
|
|
369
375
|
/* Zero-flash safety net. The inline boot script in index.html always resolves the
|