@lobehub/ui 6.15.1 → 6.15.2
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/es/AutoComplete/style.d.mts +1 -1
- package/es/css/dashboard/ConsoleShell.css +8 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs +15 -4
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/style.mjs +4 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs +6 -2
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/stable.mjs +5 -1
- package/es/dashboard/ConsoleShell/stable.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +8 -1
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/hooks.mjs +12 -3
- package/es/dashboard/hooks.mjs.map +1 -1
- package/es/style.css +8 -0
- package/package.json +1 -1
|
@@ -41,7 +41,7 @@ declare const styleArrays: {
|
|
|
41
41
|
}> | Readonly<{
|
|
42
42
|
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
43
43
|
readonly cursor: stylex.StyleXClassNameFor<"cursor", "default">;
|
|
44
|
-
readonly display: stylex.StyleXClassNameFor<"display", "
|
|
44
|
+
readonly display: stylex.StyleXClassNameFor<"display", "none" | "flex">;
|
|
45
45
|
}>)[];
|
|
46
46
|
item: Readonly<{
|
|
47
47
|
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
@@ -863,6 +863,10 @@
|
|
|
863
863
|
.lb1o4wdq2:focus-within {
|
|
864
864
|
border-color: var(--lobe-fill-border-strong, var(--lobe-color-fill));
|
|
865
865
|
}
|
|
866
|
+
|
|
867
|
+
.lb13pt9l7.lb13pt9l7:where(.lb1iwm6ff[data-collapsed="true"] *) {
|
|
868
|
+
gap: 0;
|
|
869
|
+
}
|
|
866
870
|
}
|
|
867
871
|
|
|
868
872
|
@layer lobe-ui.l2-0-2-0-p2045 {
|
|
@@ -2386,6 +2390,10 @@
|
|
|
2386
2390
|
.lb7ao2f8:is([data-has-header], :has( > [data-slot="header"])) {
|
|
2387
2391
|
padding-top: 0;
|
|
2388
2392
|
}
|
|
2393
|
+
|
|
2394
|
+
.lb15u84wf.lb15u84wf:where(.lb1iwm6ff[data-collapsed="true"] *) {
|
|
2395
|
+
width: 0;
|
|
2396
|
+
}
|
|
2389
2397
|
}
|
|
2390
2398
|
|
|
2391
2399
|
@layer lobe-ui.l4-0-2-0-p4045 {
|
|
@@ -143,6 +143,12 @@ function ConsoleNav({ className, collapsed: collapsedProp, defaultExpanded = "al
|
|
|
143
143
|
const reducedMotion = usePrefersReducedMotion();
|
|
144
144
|
const [storedOverrides, setStoredOverrides] = useLocalStorage(storageKey, {});
|
|
145
145
|
const overrides = readOverrides(storedOverrides);
|
|
146
|
+
const [transitionsReady, setTransitionsReady] = useState(false);
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
const frame = window.requestAnimationFrame(() => setTransitionsReady(true));
|
|
149
|
+
return () => window.cancelAnimationFrame(frame);
|
|
150
|
+
}, []);
|
|
151
|
+
const instant = reducedMotion || !transitionsReady;
|
|
146
152
|
const context = {
|
|
147
153
|
onNavigate,
|
|
148
154
|
renderLink
|
|
@@ -255,11 +261,16 @@ function ConsoleNav({ className, collapsed: collapsedProp, defaultExpanded = "al
|
|
|
255
261
|
className: clsx$1(headerIconClassName, styleProps([
|
|
256
262
|
styles.chevron,
|
|
257
263
|
!expanded && styles.chevronFolded,
|
|
258
|
-
collapsed && styles.railFaded
|
|
264
|
+
collapsed && styles.railFaded,
|
|
265
|
+
instant && styles.transitionInstant
|
|
259
266
|
], dashboardConsoleNavClasses("chevron")).className)
|
|
260
267
|
}) : /* @__PURE__ */ jsx("span", {
|
|
261
268
|
"data-expanded": expanded,
|
|
262
|
-
...styleProps([
|
|
269
|
+
...styleProps([
|
|
270
|
+
styles.indicator,
|
|
271
|
+
expanded && styles.indicatorExpanded,
|
|
272
|
+
instant && styles.transitionInstant
|
|
273
|
+
], dashboardConsoleNavClasses("indicator")),
|
|
263
274
|
children: /* @__PURE__ */ jsx(Play, {
|
|
264
275
|
fill: "currentColor",
|
|
265
276
|
size: 7,
|
|
@@ -298,13 +309,13 @@ function ConsoleNav({ className, collapsed: collapsedProp, defaultExpanded = "al
|
|
|
298
309
|
children: [head, /* @__PURE__ */ jsx("div", {
|
|
299
310
|
"aria-hidden": !open,
|
|
300
311
|
"data-expanded": open,
|
|
301
|
-
"data-instant":
|
|
312
|
+
"data-instant": instant,
|
|
302
313
|
id: panelId,
|
|
303
314
|
inert: open ? void 0 : true,
|
|
304
315
|
...styleProps([
|
|
305
316
|
styles.groupPanel,
|
|
306
317
|
!open && styles.groupPanelCollapsed,
|
|
307
|
-
|
|
318
|
+
instant && styles.groupPanelInstant
|
|
308
319
|
], dashboardConsoleNavClasses("group-panel")),
|
|
309
320
|
children: /* @__PURE__ */ jsxs("div", {
|
|
310
321
|
...styleProps(styles.groupItems, dashboardConsoleNavClasses("group-items")),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleNav.mjs","names":["clsx"],"sources":["../../../src/dashboard/ConsoleNav/ConsoleNav.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport { ChevronDown, Play } from 'lucide-react';\nimport { type ReactNode, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nimport Icon from '@/Icon';\nimport ScrollShadow from '@/ScrollShadow';\nimport { styleProps } from '@/styles/stylex/props';\nimport Tooltip from '@/Tooltip';\n\nimport { useConsoleShellState } from '../ConsoleShell/context';\nimport { useLocalStorage, usePrefersReducedMotion } from '../hooks';\nimport { collectNavItems, findActiveBranch, resolveActiveHref } from './active';\nimport { dashboardConsoleNavClasses } from './stable';\nimport { styles } from './style';\nimport type { ConsoleNavGroup, ConsoleNavItem, ConsoleNavLinkProps, ConsoleNavProps } from './type';\n\nconst PANEL_TRANSITION_MS = 160;\nconst railLinkClassName = 'lobe-console-nav-rail-link';\n\nconst itemIndentStyles = [null, styles.itemIndent1, styles.itemIndent2];\nconst groupHeaderIndentStyles = [null, styles.groupHeaderIndent1, styles.groupHeaderIndent2];\nconst RAIL_TRANSITION_MS = 200;\n\ntype ExpandedOverrides = Record<string, boolean>;\n\n/** Older builds stored the closed group keys as an array. */\nfunction readOverrides(value: unknown): ExpandedOverrides {\n if (Array.isArray(value)) {\n return Object.fromEntries(value.map((key) => [String(key), false]));\n }\n return value && typeof value === 'object' ? (value as ExpandedOverrides) : {};\n}\n\nfunction scrollActiveIntoView(container: HTMLElement, behavior: ScrollBehavior = 'auto') {\n const link =\n container.querySelector<HTMLElement>('[aria-current=\"page\"]') ??\n [...container.querySelectorAll<HTMLElement>('button[data-active=\"true\"]')].at(-1);\n if (!link) return;\n const containerRect = container.getBoundingClientRect();\n const linkRect = link.getBoundingClientRect();\n if (linkRect.top >= containerRect.top && linkRect.bottom <= containerRect.bottom) return;\n container.scrollBy({\n behavior,\n top: linkRect.top - containerRect.top - (containerRect.height - linkRect.height) / 2,\n });\n}\n\ninterface LinkContext {\n onNavigate?: (href: string) => void;\n renderLink?: ConsoleNavProps['renderLink'];\n}\n\nfunction renderAnchor(context: LinkContext, linkProps: ConsoleNavLinkProps, onFollow: () => void) {\n if (context.renderLink) return context.renderLink(linkProps);\n return (\n <a\n aria-current={linkProps['aria-current']}\n aria-label={linkProps['aria-label']}\n className={linkProps.className}\n data-active={linkProps['data-active']}\n data-collapsed={linkProps['data-collapsed']}\n data-indent={linkProps['data-indent']}\n href={linkProps.href}\n rel={linkProps.external ? 'noreferrer' : undefined}\n target={linkProps.external ? '_blank' : undefined}\n title={linkProps.title}\n onClick={(event) => {\n if (context.onNavigate && !linkProps.external) event.preventDefault();\n onFollow();\n }}\n >\n {linkProps.children}\n </a>\n );\n}\n\nfunction NavLink({\n active,\n collapsed,\n context,\n href,\n icon,\n indent = 0,\n item,\n name,\n overlay = false,\n}: {\n active: boolean;\n collapsed: boolean;\n context: LinkContext;\n href: string;\n icon?: ConsoleNavItem['icon'];\n indent?: number;\n item?: ConsoleNavItem;\n name: string;\n overlay?: boolean;\n}) {\n const shell = useConsoleShellState();\n const label = item?.label ?? name;\n const follow = () => {\n context.onNavigate?.(href);\n shell?.closeNavigation();\n };\n const linkProps: ConsoleNavLinkProps = {\n 'aria-current': active ? 'page' : undefined,\n 'aria-label': collapsed ? name : undefined,\n 'children': overlay ? null : (\n <>\n {icon ? (\n <Icon\n className={styleProps(styles.navIcon, dashboardConsoleNavClasses('icon')).className}\n icon={icon}\n size={18}\n />\n ) : null}\n <span\n {...styleProps(\n [\n styles.itemLabel,\n styles.railFade,\n collapsed && [styles.itemLabelRail, styles.railFaded],\n ],\n dashboardConsoleNavClasses('label'),\n )}\n >\n {label}\n </span>\n {item?.badge ? (\n <span\n {...styleProps(\n [styles.badge, styles.railFade, collapsed && styles.railFaded],\n dashboardConsoleNavClasses('badge'),\n )}\n >\n {item.badge}\n </span>\n ) : null}\n {item?.badge ? (\n <span\n aria-hidden\n {...styleProps(\n [styles.dot, collapsed && styles.dotRail],\n dashboardConsoleNavClasses('dot'),\n )}\n />\n ) : null}\n </>\n ),\n 'className': overlay\n ? clsx(\n styleProps(\n [styles.railLink, active && styles.railLinkActive],\n dashboardConsoleNavClasses('rail-link'),\n ).className,\n railLinkClassName,\n )\n : (styleProps(\n [\n styles.item,\n active && styles.itemActive,\n (indent === 1 || indent === 2) && styles.itemIndented,\n itemIndentStyles[indent],\n collapsed && indent !== 0 && styles.itemRailIndent,\n ],\n dashboardConsoleNavClasses('item'),\n ).className ?? ''),\n 'data-active': active,\n 'data-collapsed': collapsed,\n 'data-indent': indent,\n 'external': item?.external,\n href,\n 'onClick': follow,\n 'title': collapsed ? undefined : label,\n };\n\n const link = renderAnchor(context, linkProps, follow);\n\n if (!icon && !overlay) return link;\n // Always mounted so toggling the rail keeps the same link element and its label can fade.\n return (\n <Tooltip disabled={!collapsed} placement=\"right\" title={name}>\n {link}\n </Tooltip>\n );\n}\n\nfunction Fold({ children, folded }: { children: ReactNode; folded: boolean }) {\n return (\n <div\n aria-hidden={folded || undefined}\n data-folded={folded}\n inert={folded || undefined}\n {...styleProps([styles.fold, folded && styles.folded], dashboardConsoleNavClasses('fold'))}\n >\n <div {...styleProps(styles.foldBody, dashboardConsoleNavClasses('fold-body'))}>\n {children}\n </div>\n </div>\n );\n}\n\nfunction ConsoleNav({\n className,\n collapsed: collapsedProp,\n defaultExpanded = 'all',\n groups = [],\n items = [],\n label = 'Primary',\n onNavigate,\n pathname,\n renderLink,\n storageKey,\n}: ConsoleNavProps) {\n const id = useId();\n const navRef = useRef<HTMLDivElement>(null);\n const shell = useConsoleShellState();\n const collapsed = collapsedProp ?? shell?.collapsed ?? false;\n const reducedMotion = usePrefersReducedMotion();\n const [storedOverrides, setStoredOverrides] = useLocalStorage<unknown>(storageKey, {});\n const overrides = readOverrides(storedOverrides);\n const context: LinkContext = { onNavigate, renderLink };\n\n const activeHref = resolveActiveHref(pathname, [...items, ...collectNavItems(groups)]);\n const activeBranch = findActiveBranch(pathname, groups, activeHref);\n\n // Arriving on a page reopens its branch even if it was closed by hand earlier.\n const [trackedPathname, setTrackedPathname] = useState(pathname);\n if (trackedPathname !== pathname) {\n setTrackedPathname(pathname);\n if (activeBranch.some((key) => overrides[key] === false)) {\n const next = { ...overrides };\n for (const key of activeBranch) delete next[key];\n setStoredOverrides(next);\n }\n }\n\n const isExpanded = (group: ConsoleNavGroup) =>\n overrides[group.key] ??\n (activeBranch.includes(group.key) || (group.defaultExpanded ?? defaultExpanded === 'all'));\n\n const toggleGroup = useCallback(\n (key: string, expanded: boolean) => {\n setStoredOverrides((current: unknown) => ({ ...readOverrides(current), [key]: !expanded }));\n },\n [setStoredOverrides],\n );\n\n useEffect(() => {\n const container = navRef.current;\n if (!container) return;\n scrollActiveIntoView(container);\n if (reducedMotion) return;\n const timer = window.setTimeout(() => scrollActiveIntoView(container), PANEL_TRANSITION_MS);\n return () => window.clearTimeout(timer);\n }, [activeHref, pathname, reducedMotion]);\n\n useEffect(() => {\n const container = navRef.current;\n if (!container) return;\n const timer = window.setTimeout(\n () => scrollActiveIntoView(container, reducedMotion ? 'auto' : 'smooth'),\n reducedMotion ? 0 : RAIL_TRANSITION_MS,\n );\n return () => window.clearTimeout(timer);\n }, [collapsed, reducedMotion]);\n\n // The rail folds rows out of this same tree instead of rendering its own, so icons stay put\n // while the sidebar width animates.\n const renderItems = (\n list: ConsoleNavItem[],\n indent: number,\n groupLabel: string | undefined,\n foldable: boolean,\n ) =>\n list.map((item) => {\n const link = (\n <NavLink\n active={item.href === activeHref}\n collapsed={collapsed}\n context={context}\n href={item.href}\n icon={item.icon}\n indent={item.icon ? Math.max(0, indent - 1) : indent}\n item={item}\n key={item.href}\n name={groupLabel ? `${groupLabel} / ${item.label}` : item.label}\n />\n );\n if (item.icon || !foldable) return link;\n return (\n <Fold folded={collapsed} key={item.href}>\n {link}\n </Fold>\n );\n });\n\n const renderGroup = (\n group: ConsoleNavGroup,\n level: number,\n indent: number,\n underRailIcon: boolean,\n afterGroup: boolean,\n ) => {\n const expanded = isExpanded(group);\n const panelId = `${id}-${group.key}`;\n // Nested groups are headings over their items, so the items keep the same indent.\n const childIndent = indent + (group.icon ? 1 : 0);\n const active = activeBranch.includes(group.key);\n const railIcon = level === 0 && Boolean(group.icon);\n const onRail = collapsed && !underRailIcon;\n const open = onRail ? !railIcon : expanded;\n const railHref = railIcon ? (group.href ?? collectNavItems([group])[0]?.href) : undefined;\n const railEmpty = !railIcon && !collectNavItems([group]).some((item) => item.icon);\n const nested = level !== 0;\n const headerIconClassName = stylex.props(\n styles.headerIcon,\n Boolean(group.icon) && styles.headerIconWide,\n ).className;\n\n const header = (\n <button\n aria-controls={panelId}\n aria-expanded={open}\n aria-hidden={(onRail && railIcon) || undefined}\n data-active={active}\n data-icon={Boolean(group.icon)}\n data-indent={indent}\n data-level={level}\n tabIndex={onRail && railIcon ? -1 : undefined}\n type=\"button\"\n onClick={() => toggleGroup(group.key, expanded)}\n {...styleProps(\n [\n styles.groupHeader,\n active && styles.groupHeaderActive,\n Boolean(group.icon) && styles.groupHeaderIcon,\n !nested && Boolean(group.icon) && styles.groupHeaderRailIcon,\n nested && styles.groupHeaderNested,\n nested && active && styles.groupHeaderNestedActive,\n groupHeaderIndentStyles[indent],\n ],\n dashboardConsoleNavClasses('group-header'),\n )}\n >\n {group.icon ? (\n <Icon\n className={clsx(dashboardConsoleNavClasses('group-icon'), headerIconClassName)}\n icon={group.icon}\n size={16}\n />\n ) : null}\n <span\n data-label=\"\"\n {...styleProps(\n [\n styles.itemLabel,\n styles.railFade,\n collapsed && [styles.itemLabelRail, styles.railFaded],\n nested && styles.groupLabelNested,\n ],\n dashboardConsoleNavClasses('label'),\n )}\n >\n {group.label}\n </span>\n {level === 0 ? (\n <Icon\n data-expanded={expanded}\n icon={ChevronDown}\n size={14}\n className={clsx(\n headerIconClassName,\n styleProps(\n [styles.chevron, !expanded && styles.chevronFolded, collapsed && styles.railFaded],\n dashboardConsoleNavClasses('chevron'),\n ).className,\n )}\n />\n ) : (\n <span\n data-expanded={expanded}\n {...styleProps(\n [styles.indicator, expanded && styles.indicatorExpanded],\n dashboardConsoleNavClasses('indicator'),\n )}\n >\n <Play fill={'currentColor'} size={7} strokeWidth={1} />\n </span>\n )}\n </button>\n );\n\n let head: ReactNode = header;\n if (railIcon) {\n head = (\n <div {...styleProps(styles.groupHead, dashboardConsoleNavClasses('group-head'))}>\n {header}\n {onRail && railHref ? (\n <NavLink\n collapsed\n overlay\n active={activeBranch[0] === group.key}\n context={context}\n href={railHref}\n name={group.label}\n />\n ) : null}\n </div>\n );\n } else if (!underRailIcon) {\n head = <Fold folded={onRail}>{header}</Fold>;\n }\n\n return (\n <div\n data-icon={Boolean(group.icon)}\n data-level={level}\n data-rail-empty={railEmpty}\n key={group.key}\n {...styleProps(\n [\n styles.group,\n !nested && Boolean(group.icon) && styles.groupLevelIcon,\n nested && styles.groupNested,\n collapsed && railEmpty && styles.groupRailEmpty,\n collapsed && afterGroup && !nested && !group.icon && styles.groupDivider,\n ],\n dashboardConsoleNavClasses('group'),\n )}\n >\n {head}\n <div\n aria-hidden={!open}\n data-expanded={open}\n data-instant={reducedMotion}\n id={panelId}\n inert={open ? undefined : true}\n {...styleProps(\n [\n styles.groupPanel,\n !open && styles.groupPanelCollapsed,\n reducedMotion && styles.groupPanelInstant,\n ],\n dashboardConsoleNavClasses('group-panel'),\n )}\n >\n <div {...styleProps(styles.groupItems, dashboardConsoleNavClasses('group-items'))}>\n {renderItems(group.items ?? [], childIndent, group.label, !(underRailIcon || railIcon))}\n {(group.groups ?? []).map((child, index) =>\n renderGroup(child, level + 1, childIndent, underRailIcon || railIcon, index > 0),\n )}\n </div>\n </div>\n </div>\n );\n };\n\n return (\n <ScrollShadow\n aria-label={label}\n as={'nav'}\n className={styleProps(styles.nav, clsx(dashboardConsoleNavClasses(), className)).className}\n data-collapsed={collapsed}\n orientation={'vertical'}\n ref={navRef}\n size={4}\n >\n {items.length > 0 ? (\n <div\n data-divided={groups.length > 0}\n data-rail-empty={!items.some((item) => item.icon)}\n {...styleProps(\n [\n styles.topItems,\n groups.length > 0 && styles.topItemsDivided,\n collapsed && !items.some((item) => item.icon) && styles.topItemsRailEmpty,\n ],\n dashboardConsoleNavClasses('top-items'),\n )}\n >\n {renderItems(items, 0, undefined, true)}\n </div>\n ) : null}\n {groups.map((group, index) => renderGroup(group, 0, 0, false, index > 0))}\n </ScrollShadow>\n );\n}\n\nConsoleNav.displayName = 'ConsoleNav';\n\nexport default ConsoleNav;\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;AAC1B,MAAM,mBAAmB;CAAC;CAAM,OAAO;CAAa,OAAO;AAAW;AACtE,M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C,CAC5D;;AAClB;AACA,WAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"ConsoleNav.mjs","names":["clsx"],"sources":["../../../src/dashboard/ConsoleNav/ConsoleNav.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport { ChevronDown, Play } from 'lucide-react';\nimport { type ReactNode, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nimport Icon from '@/Icon';\nimport ScrollShadow from '@/ScrollShadow';\nimport { styleProps } from '@/styles/stylex/props';\nimport Tooltip from '@/Tooltip';\n\nimport { useConsoleShellState } from '../ConsoleShell/context';\nimport { useLocalStorage, usePrefersReducedMotion } from '../hooks';\nimport { collectNavItems, findActiveBranch, resolveActiveHref } from './active';\nimport { dashboardConsoleNavClasses } from './stable';\nimport { styles } from './style';\nimport type { ConsoleNavGroup, ConsoleNavItem, ConsoleNavLinkProps, ConsoleNavProps } from './type';\n\nconst PANEL_TRANSITION_MS = 160;\nconst railLinkClassName = 'lobe-console-nav-rail-link';\n\nconst itemIndentStyles = [null, styles.itemIndent1, styles.itemIndent2];\nconst groupHeaderIndentStyles = [null, styles.groupHeaderIndent1, styles.groupHeaderIndent2];\nconst RAIL_TRANSITION_MS = 200;\n\ntype ExpandedOverrides = Record<string, boolean>;\n\n/** Older builds stored the closed group keys as an array. */\nfunction readOverrides(value: unknown): ExpandedOverrides {\n if (Array.isArray(value)) {\n return Object.fromEntries(value.map((key) => [String(key), false]));\n }\n return value && typeof value === 'object' ? (value as ExpandedOverrides) : {};\n}\n\nfunction scrollActiveIntoView(container: HTMLElement, behavior: ScrollBehavior = 'auto') {\n const link =\n container.querySelector<HTMLElement>('[aria-current=\"page\"]') ??\n [...container.querySelectorAll<HTMLElement>('button[data-active=\"true\"]')].at(-1);\n if (!link) return;\n const containerRect = container.getBoundingClientRect();\n const linkRect = link.getBoundingClientRect();\n if (linkRect.top >= containerRect.top && linkRect.bottom <= containerRect.bottom) return;\n container.scrollBy({\n behavior,\n top: linkRect.top - containerRect.top - (containerRect.height - linkRect.height) / 2,\n });\n}\n\ninterface LinkContext {\n onNavigate?: (href: string) => void;\n renderLink?: ConsoleNavProps['renderLink'];\n}\n\nfunction renderAnchor(context: LinkContext, linkProps: ConsoleNavLinkProps, onFollow: () => void) {\n if (context.renderLink) return context.renderLink(linkProps);\n return (\n <a\n aria-current={linkProps['aria-current']}\n aria-label={linkProps['aria-label']}\n className={linkProps.className}\n data-active={linkProps['data-active']}\n data-collapsed={linkProps['data-collapsed']}\n data-indent={linkProps['data-indent']}\n href={linkProps.href}\n rel={linkProps.external ? 'noreferrer' : undefined}\n target={linkProps.external ? '_blank' : undefined}\n title={linkProps.title}\n onClick={(event) => {\n if (context.onNavigate && !linkProps.external) event.preventDefault();\n onFollow();\n }}\n >\n {linkProps.children}\n </a>\n );\n}\n\nfunction NavLink({\n active,\n collapsed,\n context,\n href,\n icon,\n indent = 0,\n item,\n name,\n overlay = false,\n}: {\n active: boolean;\n collapsed: boolean;\n context: LinkContext;\n href: string;\n icon?: ConsoleNavItem['icon'];\n indent?: number;\n item?: ConsoleNavItem;\n name: string;\n overlay?: boolean;\n}) {\n const shell = useConsoleShellState();\n const label = item?.label ?? name;\n const follow = () => {\n context.onNavigate?.(href);\n shell?.closeNavigation();\n };\n const linkProps: ConsoleNavLinkProps = {\n 'aria-current': active ? 'page' : undefined,\n 'aria-label': collapsed ? name : undefined,\n 'children': overlay ? null : (\n <>\n {icon ? (\n <Icon\n className={styleProps(styles.navIcon, dashboardConsoleNavClasses('icon')).className}\n icon={icon}\n size={18}\n />\n ) : null}\n <span\n {...styleProps(\n [\n styles.itemLabel,\n styles.railFade,\n collapsed && [styles.itemLabelRail, styles.railFaded],\n ],\n dashboardConsoleNavClasses('label'),\n )}\n >\n {label}\n </span>\n {item?.badge ? (\n <span\n {...styleProps(\n [styles.badge, styles.railFade, collapsed && styles.railFaded],\n dashboardConsoleNavClasses('badge'),\n )}\n >\n {item.badge}\n </span>\n ) : null}\n {item?.badge ? (\n <span\n aria-hidden\n {...styleProps(\n [styles.dot, collapsed && styles.dotRail],\n dashboardConsoleNavClasses('dot'),\n )}\n />\n ) : null}\n </>\n ),\n 'className': overlay\n ? clsx(\n styleProps(\n [styles.railLink, active && styles.railLinkActive],\n dashboardConsoleNavClasses('rail-link'),\n ).className,\n railLinkClassName,\n )\n : (styleProps(\n [\n styles.item,\n active && styles.itemActive,\n (indent === 1 || indent === 2) && styles.itemIndented,\n itemIndentStyles[indent],\n collapsed && indent !== 0 && styles.itemRailIndent,\n ],\n dashboardConsoleNavClasses('item'),\n ).className ?? ''),\n 'data-active': active,\n 'data-collapsed': collapsed,\n 'data-indent': indent,\n 'external': item?.external,\n href,\n 'onClick': follow,\n 'title': collapsed ? undefined : label,\n };\n\n const link = renderAnchor(context, linkProps, follow);\n\n if (!icon && !overlay) return link;\n // Always mounted so toggling the rail keeps the same link element and its label can fade.\n return (\n <Tooltip disabled={!collapsed} placement=\"right\" title={name}>\n {link}\n </Tooltip>\n );\n}\n\nfunction Fold({ children, folded }: { children: ReactNode; folded: boolean }) {\n return (\n <div\n aria-hidden={folded || undefined}\n data-folded={folded}\n inert={folded || undefined}\n {...styleProps([styles.fold, folded && styles.folded], dashboardConsoleNavClasses('fold'))}\n >\n <div {...styleProps(styles.foldBody, dashboardConsoleNavClasses('fold-body'))}>\n {children}\n </div>\n </div>\n );\n}\n\nfunction ConsoleNav({\n className,\n collapsed: collapsedProp,\n defaultExpanded = 'all',\n groups = [],\n items = [],\n label = 'Primary',\n onNavigate,\n pathname,\n renderLink,\n storageKey,\n}: ConsoleNavProps) {\n const id = useId();\n const navRef = useRef<HTMLDivElement>(null);\n const shell = useConsoleShellState();\n const collapsed = collapsedProp ?? shell?.collapsed ?? false;\n const reducedMotion = usePrefersReducedMotion();\n const [storedOverrides, setStoredOverrides] = useLocalStorage<unknown>(storageKey, {});\n const overrides = readOverrides(storedOverrides);\n // Skip expand/collapse transitions until after the first paint so a storage\n // re-sync (e.g. SSR hydration) snaps instead of animating open → closed.\n const [transitionsReady, setTransitionsReady] = useState(false);\n useEffect(() => {\n const frame = window.requestAnimationFrame(() => setTransitionsReady(true));\n return () => window.cancelAnimationFrame(frame);\n }, []);\n const instant = reducedMotion || !transitionsReady;\n const context: LinkContext = { onNavigate, renderLink };\n\n const activeHref = resolveActiveHref(pathname, [...items, ...collectNavItems(groups)]);\n const activeBranch = findActiveBranch(pathname, groups, activeHref);\n\n // Arriving on a page reopens its branch even if it was closed by hand earlier.\n const [trackedPathname, setTrackedPathname] = useState(pathname);\n if (trackedPathname !== pathname) {\n setTrackedPathname(pathname);\n if (activeBranch.some((key) => overrides[key] === false)) {\n const next = { ...overrides };\n for (const key of activeBranch) delete next[key];\n setStoredOverrides(next);\n }\n }\n\n const isExpanded = (group: ConsoleNavGroup) =>\n overrides[group.key] ??\n (activeBranch.includes(group.key) || (group.defaultExpanded ?? defaultExpanded === 'all'));\n\n const toggleGroup = useCallback(\n (key: string, expanded: boolean) => {\n setStoredOverrides((current: unknown) => ({ ...readOverrides(current), [key]: !expanded }));\n },\n [setStoredOverrides],\n );\n\n useEffect(() => {\n const container = navRef.current;\n if (!container) return;\n scrollActiveIntoView(container);\n if (reducedMotion) return;\n const timer = window.setTimeout(() => scrollActiveIntoView(container), PANEL_TRANSITION_MS);\n return () => window.clearTimeout(timer);\n }, [activeHref, pathname, reducedMotion]);\n\n useEffect(() => {\n const container = navRef.current;\n if (!container) return;\n const timer = window.setTimeout(\n () => scrollActiveIntoView(container, reducedMotion ? 'auto' : 'smooth'),\n reducedMotion ? 0 : RAIL_TRANSITION_MS,\n );\n return () => window.clearTimeout(timer);\n }, [collapsed, reducedMotion]);\n\n // The rail folds rows out of this same tree instead of rendering its own, so icons stay put\n // while the sidebar width animates.\n const renderItems = (\n list: ConsoleNavItem[],\n indent: number,\n groupLabel: string | undefined,\n foldable: boolean,\n ) =>\n list.map((item) => {\n const link = (\n <NavLink\n active={item.href === activeHref}\n collapsed={collapsed}\n context={context}\n href={item.href}\n icon={item.icon}\n indent={item.icon ? Math.max(0, indent - 1) : indent}\n item={item}\n key={item.href}\n name={groupLabel ? `${groupLabel} / ${item.label}` : item.label}\n />\n );\n if (item.icon || !foldable) return link;\n return (\n <Fold folded={collapsed} key={item.href}>\n {link}\n </Fold>\n );\n });\n\n const renderGroup = (\n group: ConsoleNavGroup,\n level: number,\n indent: number,\n underRailIcon: boolean,\n afterGroup: boolean,\n ) => {\n const expanded = isExpanded(group);\n const panelId = `${id}-${group.key}`;\n // Nested groups are headings over their items, so the items keep the same indent.\n const childIndent = indent + (group.icon ? 1 : 0);\n const active = activeBranch.includes(group.key);\n const railIcon = level === 0 && Boolean(group.icon);\n const onRail = collapsed && !underRailIcon;\n const open = onRail ? !railIcon : expanded;\n const railHref = railIcon ? (group.href ?? collectNavItems([group])[0]?.href) : undefined;\n const railEmpty = !railIcon && !collectNavItems([group]).some((item) => item.icon);\n const nested = level !== 0;\n const headerIconClassName = stylex.props(\n styles.headerIcon,\n Boolean(group.icon) && styles.headerIconWide,\n ).className;\n\n const header = (\n <button\n aria-controls={panelId}\n aria-expanded={open}\n aria-hidden={(onRail && railIcon) || undefined}\n data-active={active}\n data-icon={Boolean(group.icon)}\n data-indent={indent}\n data-level={level}\n tabIndex={onRail && railIcon ? -1 : undefined}\n type=\"button\"\n onClick={() => toggleGroup(group.key, expanded)}\n {...styleProps(\n [\n styles.groupHeader,\n active && styles.groupHeaderActive,\n Boolean(group.icon) && styles.groupHeaderIcon,\n !nested && Boolean(group.icon) && styles.groupHeaderRailIcon,\n nested && styles.groupHeaderNested,\n nested && active && styles.groupHeaderNestedActive,\n groupHeaderIndentStyles[indent],\n ],\n dashboardConsoleNavClasses('group-header'),\n )}\n >\n {group.icon ? (\n <Icon\n className={clsx(dashboardConsoleNavClasses('group-icon'), headerIconClassName)}\n icon={group.icon}\n size={16}\n />\n ) : null}\n <span\n data-label=\"\"\n {...styleProps(\n [\n styles.itemLabel,\n styles.railFade,\n collapsed && [styles.itemLabelRail, styles.railFaded],\n nested && styles.groupLabelNested,\n ],\n dashboardConsoleNavClasses('label'),\n )}\n >\n {group.label}\n </span>\n {level === 0 ? (\n <Icon\n data-expanded={expanded}\n icon={ChevronDown}\n size={14}\n className={clsx(\n headerIconClassName,\n styleProps(\n [\n styles.chevron,\n !expanded && styles.chevronFolded,\n collapsed && styles.railFaded,\n instant && styles.transitionInstant,\n ],\n dashboardConsoleNavClasses('chevron'),\n ).className,\n )}\n />\n ) : (\n <span\n data-expanded={expanded}\n {...styleProps(\n [\n styles.indicator,\n expanded && styles.indicatorExpanded,\n instant && styles.transitionInstant,\n ],\n dashboardConsoleNavClasses('indicator'),\n )}\n >\n <Play fill={'currentColor'} size={7} strokeWidth={1} />\n </span>\n )}\n </button>\n );\n\n let head: ReactNode = header;\n if (railIcon) {\n head = (\n <div {...styleProps(styles.groupHead, dashboardConsoleNavClasses('group-head'))}>\n {header}\n {onRail && railHref ? (\n <NavLink\n collapsed\n overlay\n active={activeBranch[0] === group.key}\n context={context}\n href={railHref}\n name={group.label}\n />\n ) : null}\n </div>\n );\n } else if (!underRailIcon) {\n head = <Fold folded={onRail}>{header}</Fold>;\n }\n\n return (\n <div\n data-icon={Boolean(group.icon)}\n data-level={level}\n data-rail-empty={railEmpty}\n key={group.key}\n {...styleProps(\n [\n styles.group,\n !nested && Boolean(group.icon) && styles.groupLevelIcon,\n nested && styles.groupNested,\n collapsed && railEmpty && styles.groupRailEmpty,\n collapsed && afterGroup && !nested && !group.icon && styles.groupDivider,\n ],\n dashboardConsoleNavClasses('group'),\n )}\n >\n {head}\n <div\n aria-hidden={!open}\n data-expanded={open}\n data-instant={instant}\n id={panelId}\n inert={open ? undefined : true}\n {...styleProps(\n [\n styles.groupPanel,\n !open && styles.groupPanelCollapsed,\n instant && styles.groupPanelInstant,\n ],\n dashboardConsoleNavClasses('group-panel'),\n )}\n >\n <div {...styleProps(styles.groupItems, dashboardConsoleNavClasses('group-items'))}>\n {renderItems(group.items ?? [], childIndent, group.label, !(underRailIcon || railIcon))}\n {(group.groups ?? []).map((child, index) =>\n renderGroup(child, level + 1, childIndent, underRailIcon || railIcon, index > 0),\n )}\n </div>\n </div>\n </div>\n );\n };\n\n return (\n <ScrollShadow\n aria-label={label}\n as={'nav'}\n className={styleProps(styles.nav, clsx(dashboardConsoleNavClasses(), className)).className}\n data-collapsed={collapsed}\n orientation={'vertical'}\n ref={navRef}\n size={4}\n >\n {items.length > 0 ? (\n <div\n data-divided={groups.length > 0}\n data-rail-empty={!items.some((item) => item.icon)}\n {...styleProps(\n [\n styles.topItems,\n groups.length > 0 && styles.topItemsDivided,\n collapsed && !items.some((item) => item.icon) && styles.topItemsRailEmpty,\n ],\n dashboardConsoleNavClasses('top-items'),\n )}\n >\n {renderItems(items, 0, undefined, true)}\n </div>\n ) : null}\n {groups.map((group, index) => renderGroup(group, 0, 0, false, index > 0))}\n </ScrollShadow>\n );\n}\n\nConsoleNav.displayName = 'ConsoleNav';\n\nexport default ConsoleNav;\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;AAC1B,MAAM,mBAAmB;CAAC;CAAM,OAAO;CAAa,OAAO;AAAW;AACtE,MAAM,0BAA0B;CAAC;CAAM,OAAO;CAAoB,OAAO;AAAkB;AAC3F,MAAM,qBAAqB;;AAI3B,SAAS,cAAc,OAAmC;CACxD,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,OAAO,YAAY,MAAM,KAAI,QAAO,CAAC,OAAO,GAAG,GAAG,KAAK,CAAC,CAAC;CAElE,OAAO,SAAS,OAAO,UAAU,WAAW,QAA6B,CAAC;AAC5E;AACA,SAAS,qBAAqB,WAAwB,WAA2B,QAAQ;CACvF,MAAM,OAAO,UAAU,cAA2B,yBAAuB,KAAK,CAAC,GAAG,UAAU,iBAA8B,8BAA4B,CAAC,CAAC,CAAC,GAAG,EAAE;CAC9J,IAAI,CAAC,MAAM;CACX,MAA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AAY,CAAC,QAAQ,OAAO;KAAqB,WAAW,OAAO;IAAiB,GAAG,2BAA2B,aAAa,CAAC;IACvQ,UAAA,qBAAC,OAAD;KAAK,GAAI,WAAW,OAAO,YAAY,2BAA2B,aAAa,CAAC;KAAhF,UAAA,CACG,YAAY,MAAM,SAAS,CAAC,GAAG,aAAa,MAAM,OAAO,EAAE,iBAAiB,SAAS,IACpF,MAAM,UAAU,CAAC,EAAA,CAAG,KAAK,OAAO,UAAU,YAAY,OAAO,QAAQ,GAAG,aAAa,iBAAiB,UAAU,QAAQ,CAAC,CAAC,CACzH;;GACF,CAAA,CACF;EARyF,GAAA,MAAM,GAQ/F;CACT;CACA,OAAO,qBAAC,cAAD;EAAc,cAAY;EAAO,IAAI;EAAO,WAAW,WAAW,OAAO,KAAKA,OAAK,2BAA2B,GAAG,SAAS,CAAC,CAAC,CAAC;EAAW,kBAAgB;EAAW,aAAa;EAAY,KAAK;EAAQ,MAAM;EAA/M,UAAA,CACF,MAAM,SAAS,IAAI,oBAAC,OAAD;GAAK,gBAAc,OAAO,SAAS;GAAG,mBAAiB,CAAC,MAAM,MAAK,SAAQ,KAAK,IAAI;GAAG,GAAI,WAAW;IAAC,OAAO;IAAU,OAAO,SAAS,KAAK,OAAO;IAAiB,aAAa,CAAC,MAAM,MAAK,SAAQ,KAAK,IAAI,KAAK,OAAO;GAAiB,GAAG,2BAA2B,WAAW,CAAC;GACrS,UAAA,YAAY,OAAO,GAAG,KAAA,GAAW,IAAI;EACnC,CAAA,IAAI,MACV,OAAO,KAAK,OAAO,UAAU,YAAY,OAAO,GAAG,GAAG,OAAO,QAAQ,CAAC,CAAC,CAC5D;;AAClB;AACA,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/ConsoleNav/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { media } from '@/styles/stylex/media.stylex';\n\nconst reducedMotion = '@media (prefers-reduced-motion: reduce)';\n\nexport const styles = stylex.create({\n badge: {\n borderRadius: 999,\n flex: 'none',\n paddingInline: 6,\n backgroundColor: `color-mix(in srgb, ${cssVar.colorError} 12%, transparent)`,\n color: cssVar.colorError,\n fontSize: cssVar.fontSizeSM,\n fontVariantNumeric: 'tabular-nums',\n minInlineSize: 20,\n textAlign: 'center',\n },\n chevron: {\n flex: 'none',\n transition: {\n default: 'transform 160ms ease, opacity 120ms ease 80ms',\n [reducedMotion]: 'none',\n },\n },\n chevronFolded: {\n transform: 'rotate(-90deg)',\n },\n dot: {\n borderRadius: 999,\n transition: { default: 'opacity 120ms ease', [reducedMotion]: 'none' },\n backgroundColor: cssVar.colorError,\n blockSize: 7,\n inlineSize: 7,\n insetBlockStart: 7,\n insetInlineEnd: 9,\n opacity: 0,\n position: 'absolute',\n },\n dotRail: {\n opacity: 1,\n },\n fold: {\n transition: {\n default: 'grid-template-rows 200ms ease, margin 200ms ease, opacity 120ms ease',\n [reducedMotion]: 'none',\n },\n display: 'grid',\n gridTemplateRows: '1fr',\n },\n foldBody: {\n overflow: 'hidden',\n minBlockSize: 0,\n },\n folded: {\n gridTemplateRows: '0fr',\n marginBlockStart: { 'default': null, ':not(:first-child)': -2 },\n opacity: 0,\n },\n group: {\n 'transition': { default: 'margin 200ms ease', [reducedMotion]: 'none' },\n 'display': 'flex',\n 'flexDirection': 'column',\n 'marginBlockStart': 12,\n 'position': 'relative',\n '::before': {\n insetInline: 0,\n transition: { default: 'opacity 200ms ease', [reducedMotion]: 'none' },\n backgroundColor: `var(--lobe-fill-border, ${cssVar.colorFill})`,\n blockSize: 1,\n content: '\"\"',\n insetBlockStart: -6,\n opacity: 0,\n position: 'absolute',\n },\n },\n groupDivider: {\n '::before': {\n opacity: 1,\n },\n },\n groupHead: {\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n },\n groupHeader: {\n borderColor: 'currentcolor',\n borderRadius: cssVar.borderRadius,\n borderStyle: 'none',\n borderWidth: 'medium',\n gap: 8,\n alignItems: 'center',\n backgroundColor: 'transparent',\n color: { 'default': cssVar.colorTextSecondary, ':hover': cssVar.colorText },\n cursor: 'pointer',\n display: 'flex',\n fontSize: cssVar.fontSizeSM,\n fontWeight: 500,\n justifyContent: 'space-between',\n minBlockSize: 32,\n paddingInlineEnd: 10,\n paddingInlineStart: 10,\n textAlign: 'start',\n whiteSpace: 'nowrap',\n },\n groupHeaderActive: {\n color: cssVar.colorText,\n },\n groupHeaderIcon: {\n gap: 10,\n fontSize: cssVar.fontSize,\n justifyContent: 'flex-start',\n minBlockSize: 36,\n },\n groupHeaderIndent1: {\n paddingInlineStart: 38,\n },\n groupHeaderIndent2: {\n paddingInlineStart: 56,\n },\n groupHeaderNested: {\n gap: 8,\n color: { 'default': cssVar.colorTextDescription, ':hover': cssVar.colorTextSecondary },\n fontSize: cssVar.fontSizeSM,\n fontWeight: 400,\n justifyContent: 'flex-start',\n minBlockSize: 26,\n },\n groupHeaderNestedActive: {\n color: cssVar.colorTextSecondary,\n },\n groupHeaderRailIcon: {\n backgroundColor: { 'default': 'transparent', ':hover': cssVar.colorFillTertiary },\n },\n groupItems: {\n gap: 2,\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n },\n groupLabelNested: {\n flexBasis: 'auto',\n flexGrow: '0',\n flexShrink: '1',\n },\n groupLevelIcon: {\n marginBlockStart: 2,\n },\n groupNested: {\n marginBlockStart: 6,\n },\n groupPanel: {\n transition: 'grid-template-rows 160ms ease',\n display: 'grid',\n gridTemplateRows: '1fr',\n },\n groupPanelCollapsed: {\n gridTemplateRows: '0fr',\n },\n groupPanelInstant: {\n transition: 'none',\n },\n groupRailEmpty: {\n marginBlockStart: 0,\n },\n headerIcon: {\n flex: 'none',\n display: 'flex',\n },\n headerIconWide: {\n inlineSize: 18,\n justifyContent: 'center',\n },\n indicator: {\n flex: 'none',\n transition: 'transform 160ms ease',\n alignItems: 'center',\n color: cssVar.colorTextDescription,\n display: 'flex',\n justifyContent: 'center',\n marginInlineStart: -6,\n height: 18,\n width: 18,\n },\n indicatorExpanded: {\n transform: 'rotate(90deg)',\n },\n item: {\n borderRadius: cssVar.borderRadius,\n gap: 10,\n textDecoration: 'none',\n transition: 'background 120ms ease, color 120ms ease',\n alignItems: 'center',\n backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },\n color: { 'default': cssVar.colorTextSecondary, ':hover': cssVar.colorText },\n display: 'flex',\n minBlockSize: { default: 36, [media.mobile]: 44 },\n paddingInlineEnd: 10,\n paddingInlineStart: 10,\n position: 'relative',\n whiteSpace: 'nowrap',\n },\n itemActive: {\n backgroundColor: cssVar.colorFillSecondary,\n color: cssVar.colorText,\n fontWeight: 500,\n },\n itemIndent1: {\n paddingInlineStart: 38,\n },\n itemIndent2: {\n paddingInlineStart: 56,\n },\n itemIndented: {\n color: cssVar.colorText,\n minBlockSize: 32,\n },\n itemLabel: {\n flex: '1',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n itemLabelRail: {\n textOverflow: 'clip',\n },\n itemRailIndent: {\n paddingInlineStart: 10,\n },\n nav: {\n flex: '1',\n gap: 2,\n paddingInline: 8,\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n overflowAnchor: 'none',\n paddingBlockEnd: 12,\n scrollbarWidth: 'thin',\n },\n navIcon: {\n flex: 'none',\n display: 'flex',\n },\n railFade: {\n transition: { default: 'opacity 120ms ease 80ms', [reducedMotion]: 'none' },\n },\n railFaded: {\n opacity: 0,\n transitionDelay: '0s',\n },\n railLink: {\n inset: 0,\n borderRadius: cssVar.borderRadius,\n transition: 'background 120ms ease',\n backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },\n position: 'absolute',\n },\n railLinkActive: {\n backgroundColor: cssVar.colorFillSecondary,\n },\n skeletonFooter: {\n gap: 10,\n paddingInline: 4,\n alignItems: 'center',\n display: 'flex',\n },\n skeletonGroup: {\n gap: 2,\n display: 'flex',\n flexDirection: 'column',\n marginBlockStart: 12,\n },\n skeletonRow: {\n pointerEvents: 'none',\n },\n topItems: {\n gap: 2,\n transition: {\n default: 'margin 200ms ease, padding 200ms ease, border-color 200ms ease',\n [reducedMotion]: 'none',\n },\n display: 'flex',\n flexDirection: 'column',\n },\n topItemsDivided: {\n borderBlockEndColor: `var(--lobe-fill-border, ${cssVar.colorFill})`,\n borderBlockEndStyle: 'solid',\n borderBlockEndWidth: 1,\n marginBlockEnd: 6,\n paddingBlockEnd: 8,\n },\n topItemsRailEmpty: {\n borderBlockEndColor: 'transparent',\n marginBlockEnd: 0,\n paddingBlockEnd: 0,\n },\n});\n"],"mappings":";AAMA,MAAa,SAAS;CACpB,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;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;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,iBAAiB;EACf,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,mBAAmB;EACjB,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/ConsoleNav/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { media } from '@/styles/stylex/media.stylex';\n\nconst reducedMotion = '@media (prefers-reduced-motion: reduce)';\n\nexport const styles = stylex.create({\n badge: {\n borderRadius: 999,\n flex: 'none',\n paddingInline: 6,\n backgroundColor: `color-mix(in srgb, ${cssVar.colorError} 12%, transparent)`,\n color: cssVar.colorError,\n fontSize: cssVar.fontSizeSM,\n fontVariantNumeric: 'tabular-nums',\n minInlineSize: 20,\n textAlign: 'center',\n },\n chevron: {\n flex: 'none',\n transition: {\n default: 'transform 160ms ease, opacity 120ms ease 80ms',\n [reducedMotion]: 'none',\n },\n },\n chevronFolded: {\n transform: 'rotate(-90deg)',\n },\n dot: {\n borderRadius: 999,\n transition: { default: 'opacity 120ms ease', [reducedMotion]: 'none' },\n backgroundColor: cssVar.colorError,\n blockSize: 7,\n inlineSize: 7,\n insetBlockStart: 7,\n insetInlineEnd: 9,\n opacity: 0,\n position: 'absolute',\n },\n dotRail: {\n opacity: 1,\n },\n fold: {\n transition: {\n default: 'grid-template-rows 200ms ease, margin 200ms ease, opacity 120ms ease',\n [reducedMotion]: 'none',\n },\n display: 'grid',\n gridTemplateRows: '1fr',\n },\n foldBody: {\n overflow: 'hidden',\n minBlockSize: 0,\n },\n folded: {\n gridTemplateRows: '0fr',\n marginBlockStart: { 'default': null, ':not(:first-child)': -2 },\n opacity: 0,\n },\n group: {\n 'transition': { default: 'margin 200ms ease', [reducedMotion]: 'none' },\n 'display': 'flex',\n 'flexDirection': 'column',\n 'marginBlockStart': 12,\n 'position': 'relative',\n '::before': {\n insetInline: 0,\n transition: { default: 'opacity 200ms ease', [reducedMotion]: 'none' },\n backgroundColor: `var(--lobe-fill-border, ${cssVar.colorFill})`,\n blockSize: 1,\n content: '\"\"',\n insetBlockStart: -6,\n opacity: 0,\n position: 'absolute',\n },\n },\n groupDivider: {\n '::before': {\n opacity: 1,\n },\n },\n groupHead: {\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n },\n groupHeader: {\n borderColor: 'currentcolor',\n borderRadius: cssVar.borderRadius,\n borderStyle: 'none',\n borderWidth: 'medium',\n gap: 8,\n alignItems: 'center',\n backgroundColor: 'transparent',\n color: { 'default': cssVar.colorTextSecondary, ':hover': cssVar.colorText },\n cursor: 'pointer',\n display: 'flex',\n fontSize: cssVar.fontSizeSM,\n fontWeight: 500,\n justifyContent: 'space-between',\n minBlockSize: 32,\n paddingInlineEnd: 10,\n paddingInlineStart: 10,\n textAlign: 'start',\n whiteSpace: 'nowrap',\n },\n groupHeaderActive: {\n color: cssVar.colorText,\n },\n groupHeaderIcon: {\n gap: 10,\n fontSize: cssVar.fontSize,\n justifyContent: 'flex-start',\n minBlockSize: 36,\n },\n groupHeaderIndent1: {\n paddingInlineStart: 38,\n },\n groupHeaderIndent2: {\n paddingInlineStart: 56,\n },\n groupHeaderNested: {\n gap: 8,\n color: { 'default': cssVar.colorTextDescription, ':hover': cssVar.colorTextSecondary },\n fontSize: cssVar.fontSizeSM,\n fontWeight: 400,\n justifyContent: 'flex-start',\n minBlockSize: 26,\n },\n groupHeaderNestedActive: {\n color: cssVar.colorTextSecondary,\n },\n groupHeaderRailIcon: {\n backgroundColor: { 'default': 'transparent', ':hover': cssVar.colorFillTertiary },\n },\n groupItems: {\n gap: 2,\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n },\n groupLabelNested: {\n flexBasis: 'auto',\n flexGrow: '0',\n flexShrink: '1',\n },\n groupLevelIcon: {\n marginBlockStart: 2,\n },\n groupNested: {\n marginBlockStart: 6,\n },\n groupPanel: {\n transition: 'grid-template-rows 160ms ease',\n display: 'grid',\n gridTemplateRows: '1fr',\n },\n groupPanelCollapsed: {\n gridTemplateRows: '0fr',\n },\n groupPanelInstant: {\n transition: 'none',\n },\n transitionInstant: {\n transition: 'none',\n },\n groupRailEmpty: {\n marginBlockStart: 0,\n },\n headerIcon: {\n flex: 'none',\n display: 'flex',\n },\n headerIconWide: {\n inlineSize: 18,\n justifyContent: 'center',\n },\n indicator: {\n flex: 'none',\n transition: 'transform 160ms ease',\n alignItems: 'center',\n color: cssVar.colorTextDescription,\n display: 'flex',\n justifyContent: 'center',\n marginInlineStart: -6,\n height: 18,\n width: 18,\n },\n indicatorExpanded: {\n transform: 'rotate(90deg)',\n },\n item: {\n borderRadius: cssVar.borderRadius,\n gap: 10,\n textDecoration: 'none',\n transition: 'background 120ms ease, color 120ms ease',\n alignItems: 'center',\n backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },\n color: { 'default': cssVar.colorTextSecondary, ':hover': cssVar.colorText },\n display: 'flex',\n minBlockSize: { default: 36, [media.mobile]: 44 },\n paddingInlineEnd: 10,\n paddingInlineStart: 10,\n position: 'relative',\n whiteSpace: 'nowrap',\n },\n itemActive: {\n backgroundColor: cssVar.colorFillSecondary,\n color: cssVar.colorText,\n fontWeight: 500,\n },\n itemIndent1: {\n paddingInlineStart: 38,\n },\n itemIndent2: {\n paddingInlineStart: 56,\n },\n itemIndented: {\n color: cssVar.colorText,\n minBlockSize: 32,\n },\n itemLabel: {\n flex: '1',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n itemLabelRail: {\n textOverflow: 'clip',\n },\n itemRailIndent: {\n paddingInlineStart: 10,\n },\n nav: {\n flex: '1',\n gap: 2,\n paddingInline: 8,\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n overflowAnchor: 'none',\n paddingBlockEnd: 12,\n scrollbarWidth: 'thin',\n },\n navIcon: {\n flex: 'none',\n display: 'flex',\n },\n railFade: {\n transition: { default: 'opacity 120ms ease 80ms', [reducedMotion]: 'none' },\n },\n railFaded: {\n opacity: 0,\n transitionDelay: '0s',\n },\n railLink: {\n inset: 0,\n borderRadius: cssVar.borderRadius,\n transition: 'background 120ms ease',\n backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },\n position: 'absolute',\n },\n railLinkActive: {\n backgroundColor: cssVar.colorFillSecondary,\n },\n skeletonFooter: {\n gap: 10,\n paddingInline: 4,\n alignItems: 'center',\n display: 'flex',\n },\n skeletonGroup: {\n gap: 2,\n display: 'flex',\n flexDirection: 'column',\n marginBlockStart: 12,\n },\n skeletonRow: {\n pointerEvents: 'none',\n },\n topItems: {\n gap: 2,\n transition: {\n default: 'margin 200ms ease, padding 200ms ease, border-color 200ms ease',\n [reducedMotion]: 'none',\n },\n display: 'flex',\n flexDirection: 'column',\n },\n topItemsDivided: {\n borderBlockEndColor: `var(--lobe-fill-border, ${cssVar.colorFill})`,\n borderBlockEndStyle: 'solid',\n borderBlockEndWidth: 1,\n marginBlockEnd: 6,\n paddingBlockEnd: 8,\n },\n topItemsRailEmpty: {\n borderBlockEndColor: 'transparent',\n marginBlockEnd: 0,\n paddingBlockEnd: 0,\n },\n});\n"],"mappings":";AAMA,MAAa,SAAS;CACpB,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,QAAQ;EACR,Q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BAAgB;EACd,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,gBAAgB;EACd,QAAQ;EACR,OAAO;CACT;CACA,gBAAgB;EACd,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,iBAAiB;EACf,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,mBAAmB;EACjB,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
|
|
@@ -8,9 +8,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
// src/dashboard/ConsoleShell/ConsoleBrand.tsx
|
|
9
9
|
function ConsoleBrand({ className, href = "/", label, logo, renderLink, title }) {
|
|
10
10
|
const shell = useConsoleShellState();
|
|
11
|
-
const
|
|
11
|
+
const mark = /* @__PURE__ */ jsx("span", {
|
|
12
|
+
...styleProps(styles.brandMark, dashboardConsoleBrandClasses("mark")),
|
|
13
|
+
children: logo
|
|
14
|
+
});
|
|
15
|
+
const content = title == null || title === false || title === "" ? mark : /* @__PURE__ */ jsxs("span", {
|
|
12
16
|
...styleProps(styles.brandLockup, dashboardConsoleBrandClasses("lockup")),
|
|
13
|
-
children: [
|
|
17
|
+
children: [mark, /* @__PURE__ */ jsx("span", {
|
|
14
18
|
...styleProps(styles.brandName, dashboardConsoleBrandClasses("name")),
|
|
15
19
|
children: title
|
|
16
20
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleBrand.mjs","names":["clsx"],"sources":["../../../src/dashboard/ConsoleShell/ConsoleBrand.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { useConsoleShellState } from './context';\nimport { dashboardConsoleBrandClasses } from './stable';\nimport { styles } from './style';\nimport type { ConsoleBrandProps } from './type';\n\nfunction ConsoleBrand({\n className,\n href = '/',\n label,\n logo,\n renderLink,\n title,\n}: ConsoleBrandProps) {\n const shell = useConsoleShellState();\n const content =\n title == null || title === false || title === '' ? (\n
|
|
1
|
+
{"version":3,"file":"ConsoleBrand.mjs","names":["clsx"],"sources":["../../../src/dashboard/ConsoleShell/ConsoleBrand.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { useConsoleShellState } from './context';\nimport { dashboardConsoleBrandClasses } from './stable';\nimport { styles } from './style';\nimport type { ConsoleBrandProps } from './type';\n\nfunction ConsoleBrand({\n className,\n href = '/',\n label,\n logo,\n renderLink,\n title,\n}: ConsoleBrandProps) {\n const shell = useConsoleShellState();\n // Keep the mark at its natural size on the rail. Without flex:none the\n // lockup (logo + title) shrinks with the sidebar and the SVG becomes a speck.\n const mark = (\n <span {...styleProps(styles.brandMark, dashboardConsoleBrandClasses('mark'))}>{logo}</span>\n );\n const content =\n title == null || title === false || title === '' ? (\n mark\n ) : (\n <span {...styleProps(styles.brandLockup, dashboardConsoleBrandClasses('lockup'))}>\n {mark}\n <span {...styleProps(styles.brandName, dashboardConsoleBrandClasses('name'))}>{title}</span>\n </span>\n );\n const linkProps = {\n 'aria-label': label ?? (typeof title === 'string' ? title : 'Home'),\n 'children': content,\n 'className':\n styleProps(styles.brandAnchor, clsx(dashboardConsoleBrandClasses(), className)).className ??\n '',\n href,\n 'onClick': () => shell?.closeNavigation(),\n };\n if (renderLink) return renderLink(linkProps);\n return (\n <a\n aria-label={linkProps['aria-label']}\n className={linkProps.className}\n href={href}\n onClick={linkProps.onClick}\n >\n {content}\n </a>\n );\n}\n\nConsoleBrand.displayName = 'ConsoleBrand';\n\nexport default ConsoleBrand;\n"],"mappings":";;;;;;;;AAWA,SAAS,aAAa,EACpB,WACA,OAAO,KACP,OACA,MACA,YACA,SACoB;CACpB,MAAM,QAAQ,qBAAqB;CAGnC,MAAM,OACJ,oBAAC,QAAD;EAAM,GAAI,WAAW,OAAO,WAAW,6BAA6B,MAAM,CAAC;EAAI,UAAA;CAAW,CAAA;CAE5F,MAAM,UACJ,SAAS,QAAQ,UAAU,SAAS,UAAU,KAC5C,OAEA,qBAAC,QAAD;EAAM,GAAI,WAAW,OAAO,aAAa,6BAA6B,QAAQ,CAAC;EAA/E,UAAA,CACG,MACD,oBAAC,QAAD;GAAM,GAAI,WAAW,OAAO,WAAW,6BAA6B,MAAM,CAAC;GAAI,UAAA;EAAY,CAAA,CACvF;;CAEV,MAAM,YAAY;EAChB,cAAc,UAAU,OAAO,UAAU,WAAW,QAAQ;EAC5D,YAAY;EACZ,aACE,WAAW,OAAO,aAAaA,OAAK,6BAA6B,GAAG,SAAS,CAAC,CAAC,CAAC,aAChF;EACF;EACA,iBAAiB,OAAO,gBAAgB;CAC1C;CACA,IAAI,YAAY,OAAO,WAAW,SAAS;CAC3C,OACE,oBAAC,KAAD;EACE,cAAY,UAAU;EACtB,WAAW,UAAU;EACf;EACN,SAAS,UAAU;EAElB,UAAA;CACA,CAAA;AAEP;AAEA,aAAa,cAAc"}
|
|
@@ -21,7 +21,11 @@ const dashboardConsoleShellClasses = stableClasses({
|
|
|
21
21
|
});
|
|
22
22
|
const dashboardConsoleBrandClasses = stableClasses({
|
|
23
23
|
block: "dashboard-console-brand",
|
|
24
|
-
elements: [
|
|
24
|
+
elements: [
|
|
25
|
+
"lockup",
|
|
26
|
+
"mark",
|
|
27
|
+
"name"
|
|
28
|
+
]
|
|
25
29
|
});
|
|
26
30
|
export { dashboardConsoleBrandClasses, dashboardConsoleShellClasses };
|
|
27
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stable.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/stable.ts"],"sourcesContent":["import { stableClasses } from '@/utils/bem';\n\nexport const dashboardConsoleShellClasses = stableClasses({\n block: 'dashboard-console-shell',\n dataAttributes: ['collapsed', 'compact'],\n elements: [\n 'skip-link',\n 'sidebar',\n 'brand',\n 'brand-close',\n 'nav',\n 'footer',\n 'workspace',\n 'topbar',\n 'toggle',\n 'topbar-divider',\n 'topbar-main',\n 'tools',\n 'main',\n ],\n});\n\nexport const dashboardConsoleBrandClasses = stableClasses({\n block: 'dashboard-console-brand',\n elements: ['lockup', 'name'],\n});\n"],"mappings":";;AAEA,MAAa,+BAA+B,cAAc;CACxD,OAAO;CACP,gBAAgB,CAAC,aAAa,SAAS;CACvC,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC;AAED,MAAa,+BAA+B,cAAc;CACxD,OAAO;CACP,UAAU
|
|
1
|
+
{"version":3,"file":"stable.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/stable.ts"],"sourcesContent":["import { stableClasses } from '@/utils/bem';\n\nexport const dashboardConsoleShellClasses = stableClasses({\n block: 'dashboard-console-shell',\n dataAttributes: ['collapsed', 'compact'],\n elements: [\n 'skip-link',\n 'sidebar',\n 'brand',\n 'brand-close',\n 'nav',\n 'footer',\n 'workspace',\n 'topbar',\n 'toggle',\n 'topbar-divider',\n 'topbar-main',\n 'tools',\n 'main',\n ],\n});\n\nexport const dashboardConsoleBrandClasses = stableClasses({\n block: 'dashboard-console-brand',\n elements: ['lockup', 'mark', 'name'],\n});\n"],"mappings":";;AAEA,MAAa,+BAA+B,cAAc;CACxD,OAAO;CACP,gBAAgB,CAAC,aAAa,SAAS;CACvC,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC;AAED,MAAa,+BAA+B,cAAc;CACxD,OAAO;CACP,UAAU;EAAC;EAAU;EAAQ;CAAM;AACrC,CAAC"}
|
|
@@ -30,8 +30,14 @@ const styles = {
|
|
|
30
30
|
k7Eaqz: "lbeuugli",
|
|
31
31
|
$$css: true
|
|
32
32
|
},
|
|
33
|
+
brandMark: {
|
|
34
|
+
kUk6DE: "lb1okw0bk",
|
|
35
|
+
kGNEyG: "lb6s0dn4",
|
|
36
|
+
k1xSpc: "lb78zum5",
|
|
37
|
+
$$css: true
|
|
38
|
+
},
|
|
33
39
|
brandLockup: {
|
|
34
|
-
kOIVth: "lb883omv",
|
|
40
|
+
kOIVth: "lb883omv lb13pt9l7",
|
|
35
41
|
kGNEyG: "lb6s0dn4",
|
|
36
42
|
k1xSpc: "lb78zum5",
|
|
37
43
|
k7Eaqz: "lbeuugli",
|
|
@@ -43,6 +49,7 @@ const styles = {
|
|
|
43
49
|
kMwMTN: "lb66ogz0",
|
|
44
50
|
kGuDYH: "lbif65rj",
|
|
45
51
|
k63SB2: "lb1s688f",
|
|
52
|
+
kzqmXN: "lb15u84wf",
|
|
46
53
|
kLWn49: "lbwn7fz2",
|
|
47
54
|
kSiTet: "lb1uo4ipp",
|
|
48
55
|
kg5iWk: "lblyipyv lb10uu7sc",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { media } from '@/styles/stylex/media.stylex';\n\nimport { consoleBrandMarker } from './marker.stylex';\n\nconst SIDEBAR_INLINE_SIZE = 248;\n// Twice the nav icon inset (8px nav padding + 10px item padding) plus the 18px icon, so the icons\n// land centered on the rail without moving sideways.\nconst SIDEBAR_RAIL_INLINE_SIZE = 54;\nconst WORKSPACE_INSET = 8;\n\nconst reducedMotion = '@media (prefers-reduced-motion: reduce)';\nconst flushPage = ':has([data-page-layout=\"flush\"])';\n\n/**\n * `media.laptop`, not `media.tablet`. The aliases are named for\n * devices, and only `laptop` (max-width 991px) lines up with `useIsCompact`.\n */\nexport const styles = stylex.create({\n brand: {\n flex: 'none',\n paddingInline: 15,\n alignItems: 'center',\n blockSize: 56,\n color: cssVar.colorText,\n display: 'flex',\n marginBlockStart: { default: WORKSPACE_INSET, [media.laptop]: 0 },\n whiteSpace: 'nowrap',\n },\n /** Close button in the drawer's brand row: right edge, vertically centred with the brand. */\n brandClose: {\n flex: 'none',\n marginInlineEnd: '-7px',\n marginInlineStart: 'auto',\n },\n brandAnchor: {\n textDecoration: 'none',\n alignItems: 'center',\n color: 'inherit',\n display: 'flex',\n inlineSize: '100%',\n minInlineSize: 0,\n },\n brandLockup: {\n gap: 10,\n alignItems: 'center',\n display: 'flex',\n minInlineSize: 0,\n },\n brandName: {\n overflow: 'hidden',\n transition: { default: 'opacity 120ms ease 80ms', [reducedMotion]: 'none' },\n color: cssVar.colorText,\n fontSize: 14,\n fontWeight: 600,\n lineHeight: 1.3,\n opacity: {\n default: null,\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: 0,\n },\n textOverflow: {\n default: 'ellipsis',\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: 'clip',\n },\n transitionDelay: {\n default: null,\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: '0s',\n },\n whiteSpace: 'nowrap',\n },\n main: {\n padding: {\n default: 24,\n [flushPage]: 0,\n [media.mobile]: { default: 16, [flushPage]: 0 },\n },\n flex: '1',\n gap: {\n default: 20,\n [flushPage]: 0,\n [media.mobile]: { default: 16, [flushPage]: 0 },\n },\n overflow: { default: 'auto', [flushPage]: 'hidden' },\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n minInlineSize: 0,\n },\n navSlot: {\n flex: '1',\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n },\n shell: {\n flex: '1',\n overflow: 'hidden',\n backgroundColor: cssVar.colorBgLayout,\n blockSize: '100%',\n display: 'flex',\n minBlockSize: 0,\n },\n sidebar: {\n flex: 'none',\n overflow: 'hidden',\n transition: 'inline-size 200ms ease',\n blockSize: '100%',\n display: { default: 'flex', [media.laptop]: 'none' },\n flexDirection: 'column',\n inlineSize: SIDEBAR_INLINE_SIZE,\n minBlockSize: 0,\n },\n sidebarCollapsed: {\n inlineSize: SIDEBAR_RAIL_INLINE_SIZE,\n },\n sidebarInstant: {\n transition: 'none',\n },\n sidebarBottom: {\n padding: 8,\n flex: 'none',\n },\n skipLink: {\n borderRadius: cssVar.borderRadius,\n paddingBlock: 8,\n paddingInline: 12,\n backgroundColor: cssVar.colorBgElevated,\n color: cssVar.colorText,\n insetBlockStart: { 'default': -100, ':focus': 12 },\n insetInlineStart: 12,\n position: 'fixed',\n zIndex: 2000,\n },\n topbar: {\n flex: 'none',\n gap: 8,\n paddingInline: 12,\n alignItems: 'center',\n blockSize: 56,\n borderBlockEndColor: cssVar.colorBorderSecondary,\n borderBlockEndStyle: 'solid',\n borderBlockEndWidth: 1,\n display: 'flex',\n },\n topbarDivider: {\n flex: 'none',\n marginInline: 2,\n backgroundColor: cssVar.colorBorderSecondary,\n blockSize: 18,\n inlineSize: 1,\n },\n topbarMain: {\n flex: '1',\n alignItems: 'center',\n display: 'flex',\n minInlineSize: 0,\n },\n tools: {\n flex: 'none',\n gap: 6,\n alignItems: 'center',\n display: 'flex',\n marginInlineStart: 'auto',\n },\n /** Light only: the content area sits midway between the layout canvas and container white. */\n workspaceLight: {\n backgroundColor: `color-mix(in srgb, ${cssVar.colorBgLayout} 50%, ${cssVar.colorBgContainer})`,\n },\n workspace: {\n borderColor: {\n default: `color-mix(in srgb, ${cssVar.colorBorderSecondary} 70%, ${cssVar.colorBorder})`,\n [media.laptop]: 'currentcolor',\n },\n borderRadius: { default: cssVar.borderRadiusLG, [media.laptop]: 0 },\n borderStyle: { default: 'solid', [media.laptop]: 'none' },\n borderWidth: { default: 1, [media.laptop]: 'medium' },\n flex: '1',\n marginBlock: { default: WORKSPACE_INSET, [media.laptop]: 0 },\n marginInline: { default: `0 ${WORKSPACE_INSET}px`, [media.laptop]: 0 },\n overflow: 'hidden',\n backgroundColor: cssVar.colorBgContainer,\n boxShadow: { default: cssVar.boxShadowTertiary, [media.laptop]: 'none' },\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n minInlineSize: 0,\n },\n});\n"],"mappings":";;;;;AAmBA,MAAa,SAAS;CACpB,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR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ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { media } from '@/styles/stylex/media.stylex';\n\nimport { consoleBrandMarker } from './marker.stylex';\n\nconst SIDEBAR_INLINE_SIZE = 248;\n// Twice the nav icon inset (8px nav padding + 10px item padding) plus the 18px icon, so the icons\n// land centered on the rail without moving sideways.\nconst SIDEBAR_RAIL_INLINE_SIZE = 54;\nconst WORKSPACE_INSET = 8;\n\nconst reducedMotion = '@media (prefers-reduced-motion: reduce)';\nconst flushPage = ':has([data-page-layout=\"flush\"])';\n\n/**\n * `media.laptop`, not `media.tablet`. The aliases are named for\n * devices, and only `laptop` (max-width 991px) lines up with `useIsCompact`.\n */\nexport const styles = stylex.create({\n brand: {\n flex: 'none',\n paddingInline: 15,\n alignItems: 'center',\n blockSize: 56,\n color: cssVar.colorText,\n display: 'flex',\n marginBlockStart: { default: WORKSPACE_INSET, [media.laptop]: 0 },\n whiteSpace: 'nowrap',\n },\n /** Close button in the drawer's brand row: right edge, vertically centred with the brand. */\n brandClose: {\n flex: 'none',\n marginInlineEnd: '-7px',\n marginInlineStart: 'auto',\n },\n brandAnchor: {\n textDecoration: 'none',\n alignItems: 'center',\n color: 'inherit',\n display: 'flex',\n inlineSize: '100%',\n minInlineSize: 0,\n },\n /** Mark stays natural size on the rail; never flex-shrink with the title. */\n brandMark: {\n flex: 'none',\n alignItems: 'center',\n display: 'flex',\n },\n brandLockup: {\n gap: {\n default: 10,\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: 0,\n },\n alignItems: 'center',\n display: 'flex',\n minInlineSize: 0,\n },\n brandName: {\n overflow: 'hidden',\n transition: { default: 'opacity 120ms ease 80ms', [reducedMotion]: 'none' },\n color: cssVar.colorText,\n fontSize: 14,\n fontWeight: 600,\n // Collapse width with the rail so the mark is not squeezed by the faded title.\n inlineSize: {\n default: null,\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: 0,\n },\n lineHeight: 1.3,\n opacity: {\n default: null,\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: 0,\n },\n textOverflow: {\n default: 'ellipsis',\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: 'clip',\n },\n transitionDelay: {\n default: null,\n [stylex.when.ancestor('[data-collapsed=\"true\"]', consoleBrandMarker)]: '0s',\n },\n whiteSpace: 'nowrap',\n },\n main: {\n padding: {\n default: 24,\n [flushPage]: 0,\n [media.mobile]: { default: 16, [flushPage]: 0 },\n },\n flex: '1',\n gap: {\n default: 20,\n [flushPage]: 0,\n [media.mobile]: { default: 16, [flushPage]: 0 },\n },\n overflow: { default: 'auto', [flushPage]: 'hidden' },\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n minInlineSize: 0,\n },\n navSlot: {\n flex: '1',\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n },\n shell: {\n flex: '1',\n overflow: 'hidden',\n backgroundColor: cssVar.colorBgLayout,\n blockSize: '100%',\n display: 'flex',\n minBlockSize: 0,\n },\n sidebar: {\n flex: 'none',\n overflow: 'hidden',\n transition: 'inline-size 200ms ease',\n blockSize: '100%',\n display: { default: 'flex', [media.laptop]: 'none' },\n flexDirection: 'column',\n inlineSize: SIDEBAR_INLINE_SIZE,\n minBlockSize: 0,\n },\n sidebarCollapsed: {\n inlineSize: SIDEBAR_RAIL_INLINE_SIZE,\n },\n sidebarInstant: {\n transition: 'none',\n },\n sidebarBottom: {\n padding: 8,\n flex: 'none',\n },\n skipLink: {\n borderRadius: cssVar.borderRadius,\n paddingBlock: 8,\n paddingInline: 12,\n backgroundColor: cssVar.colorBgElevated,\n color: cssVar.colorText,\n insetBlockStart: { 'default': -100, ':focus': 12 },\n insetInlineStart: 12,\n position: 'fixed',\n zIndex: 2000,\n },\n topbar: {\n flex: 'none',\n gap: 8,\n paddingInline: 12,\n alignItems: 'center',\n blockSize: 56,\n borderBlockEndColor: cssVar.colorBorderSecondary,\n borderBlockEndStyle: 'solid',\n borderBlockEndWidth: 1,\n display: 'flex',\n },\n topbarDivider: {\n flex: 'none',\n marginInline: 2,\n backgroundColor: cssVar.colorBorderSecondary,\n blockSize: 18,\n inlineSize: 1,\n },\n topbarMain: {\n flex: '1',\n alignItems: 'center',\n display: 'flex',\n minInlineSize: 0,\n },\n tools: {\n flex: 'none',\n gap: 6,\n alignItems: 'center',\n display: 'flex',\n marginInlineStart: 'auto',\n },\n /** Light only: the content area sits midway between the layout canvas and container white. */\n workspaceLight: {\n backgroundColor: `color-mix(in srgb, ${cssVar.colorBgLayout} 50%, ${cssVar.colorBgContainer})`,\n },\n workspace: {\n borderColor: {\n default: `color-mix(in srgb, ${cssVar.colorBorderSecondary} 70%, ${cssVar.colorBorder})`,\n [media.laptop]: 'currentcolor',\n },\n borderRadius: { default: cssVar.borderRadiusLG, [media.laptop]: 0 },\n borderStyle: { default: 'solid', [media.laptop]: 'none' },\n borderWidth: { default: 1, [media.laptop]: 'medium' },\n flex: '1',\n marginBlock: { default: WORKSPACE_INSET, [media.laptop]: 0 },\n marginInline: { default: `0 ${WORKSPACE_INSET}px`, [media.laptop]: 0 },\n overflow: 'hidden',\n backgroundColor: cssVar.colorBgContainer,\n boxShadow: { default: cssVar.boxShadowTertiary, [media.laptop]: 'none' },\n display: 'flex',\n flexDirection: 'column',\n minBlockSize: 0,\n minInlineSize: 0,\n },\n});\n"],"mappings":";;;;;AAmBA,MAAa,SAAS;CACpB,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EAC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,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,gBAAgB;EACd,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
|
package/es/dashboard/hooks.mjs
CHANGED
|
@@ -20,12 +20,21 @@ function useIsCompact() {
|
|
|
20
20
|
function usePrefersReducedMotion() {
|
|
21
21
|
return useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
22
22
|
}
|
|
23
|
+
function readLocalStorageValue(key, defaultValue) {
|
|
24
|
+
if (!key || typeof window === "undefined") return defaultValue;
|
|
25
|
+
try {
|
|
26
|
+
const raw = window.localStorage.getItem(key);
|
|
27
|
+
if (raw !== null) return JSON.parse(raw);
|
|
28
|
+
} catch {}
|
|
29
|
+
return defaultValue;
|
|
30
|
+
}
|
|
23
31
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
32
|
+
* Lazily reads storage on the client so the first paint matches persisted state.
|
|
33
|
+
* On the server (no `window`) the default is used; a mount effect re-syncs when
|
|
34
|
+
* `key` changes or after hydration. Omit `key` to keep the value in memory only.
|
|
26
35
|
*/
|
|
27
36
|
function useLocalStorage(key, defaultValue) {
|
|
28
|
-
const [value, setValue] = useState(defaultValue);
|
|
37
|
+
const [value, setValue] = useState(() => readLocalStorageValue(key, defaultValue));
|
|
29
38
|
useEffect(() => {
|
|
30
39
|
if (!key) return;
|
|
31
40
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.mjs","names":[],"sources":["../../src/dashboard/hooks.ts"],"sourcesContent":["'use client';\n\nimport type { Dispatch, SetStateAction } from 'react';\nimport { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from 'react';\n\nexport function useMediaQuery(query: string) {\n const list = useMemo(\n () => (typeof window === 'undefined' ? null : window.matchMedia(query)),\n [query],\n );\n\n const subscribe = useCallback(\n (listener: () => void) => {\n if (!list) return () => {};\n list.addEventListener('change', listener);\n return () => list.removeEventListener('change', listener);\n },\n [list],\n );\n\n return useSyncExternalStore(\n subscribe,\n () => list?.matches ?? false,\n () => false,\n );\n}\n\n/** Phone-width layouts. Matches `responsive.mobile` (max-width 575px). */\nexport function useIsMobile() {\n return useMediaQuery('(max-width: 575px)');\n}\n\n/**\n * Tablet and below. Matches `responsive.laptop` (max-width 991px), which is\n * the width where a fixed console sidebar becomes a drawer.\n */\nexport function useIsCompact() {\n return useMediaQuery('(max-width: 991px)');\n}\n\nexport function usePrefersReducedMotion() {\n return useMediaQuery('(prefers-reduced-motion: reduce)');\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"hooks.mjs","names":[],"sources":["../../src/dashboard/hooks.ts"],"sourcesContent":["'use client';\n\nimport type { Dispatch, SetStateAction } from 'react';\nimport { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from 'react';\n\nexport function useMediaQuery(query: string) {\n const list = useMemo(\n () => (typeof window === 'undefined' ? null : window.matchMedia(query)),\n [query],\n );\n\n const subscribe = useCallback(\n (listener: () => void) => {\n if (!list) return () => {};\n list.addEventListener('change', listener);\n return () => list.removeEventListener('change', listener);\n },\n [list],\n );\n\n return useSyncExternalStore(\n subscribe,\n () => list?.matches ?? false,\n () => false,\n );\n}\n\n/** Phone-width layouts. Matches `responsive.mobile` (max-width 575px). */\nexport function useIsMobile() {\n return useMediaQuery('(max-width: 575px)');\n}\n\n/**\n * Tablet and below. Matches `responsive.laptop` (max-width 991px), which is\n * the width where a fixed console sidebar becomes a drawer.\n */\nexport function useIsCompact() {\n return useMediaQuery('(max-width: 991px)');\n}\n\nexport function usePrefersReducedMotion() {\n return useMediaQuery('(prefers-reduced-motion: reduce)');\n}\n\nfunction readLocalStorageValue<T>(key: string | undefined, defaultValue: T): T {\n if (!key || typeof window === 'undefined') return defaultValue;\n try {\n const raw = window.localStorage.getItem(key);\n if (raw !== null) return JSON.parse(raw) as T;\n } catch {\n // Ignore unreadable storage and keep the default.\n }\n return defaultValue;\n}\n\n/**\n * Lazily reads storage on the client so the first paint matches persisted state.\n * On the server (no `window`) the default is used; a mount effect re-syncs when\n * `key` changes or after hydration. Omit `key` to keep the value in memory only.\n */\nexport function useLocalStorage<T>(key: string | undefined, defaultValue: T) {\n const [value, setValue] = useState<T>(() => readLocalStorageValue(key, defaultValue));\n\n useEffect(() => {\n if (!key) return;\n try {\n const raw = window.localStorage.getItem(key);\n if (raw !== null) setValue(JSON.parse(raw) as T);\n } catch {\n // Ignore unreadable storage and keep the current value.\n }\n }, [key]);\n\n const setStoredValue = useCallback<Dispatch<SetStateAction<T>>>(\n (next) => {\n setValue((current) => {\n const resolved = typeof next === 'function' ? (next as (value: T) => T)(current) : next;\n if (key) {\n try {\n window.localStorage.setItem(key, JSON.stringify(resolved));\n } catch {\n // Ignore quota and private-mode failures.\n }\n }\n return resolved;\n });\n },\n [key],\n );\n\n return [value, setStoredValue] as const;\n}\n"],"mappings":";;;AAKA,SAAgB,cAAc,OAAe;CAC3C,MAAM,OAAO,cACJ,OAAO,WAAW,cAAc,OAAO,OAAO,WAAW,KAAK,GACrE,CAAC,KAAK,CACR;CAEA,MAAM,YAAY,aACf,aAAyB;EACxB,IAAI,CAAC,MAAM,aAAa,CAAC;EACzB,KAAK,iBAAiB,UAAU,QAAQ;EACxC,aAAa,KAAK,oBAAoB,UAAU,QAAQ;CAC1D,GACA,CAAC,IAAI,CACP;CAEA,OAAO,qBACL,iBACM,MAAM,WAAW,aACjB,KACR;AACF;;;;;AAWA,SAAgB,eAAe;CAC7B,OAAO,cAAc,oBAAoB;AAC3C;AAEA,SAAgB,0BAA0B;CACxC,OAAO,cAAc,kCAAkC;AACzD;AAEA,SAAS,sBAAyB,KAAyB,cAAoB;CAC7E,IAAI,CAAC,OAAO,OAAO,WAAW,aAAa,OAAO;CAClD,IAAI;EACF,MAAM,MAAM,OAAO,aAAa,QAAQ,GAAG;EAC3C,IAAI,QAAQ,MAAM,OAAO,KAAK,MAAM,GAAG;CACzC,QAAQ,CAER;CACA,OAAO;AACT;;;;;;AAOA,SAAgB,gBAAmB,KAAyB,cAAiB;CAC3E,MAAM,CAAC,OAAO,YAAY,eAAkB,sBAAsB,KAAK,YAAY,CAAC;CAEpF,gBAAgB;EACd,IAAI,CAAC,KAAK;EACV,IAAI;GACF,MAAM,MAAM,OAAO,aAAa,QAAQ,GAAG;GAC3C,IAAI,QAAQ,MAAM,SAAS,KAAK,MAAM,GAAG,CAAM;EACjD,QAAQ,CAER;CACF,GAAG,CAAC,GAAG,CAAC;CAmBR,OAAO,CAAC,OAjBe,aACpB,SAAS;EACR,UAAU,YAAY;GACpB,MAAM,WAAW,OAAO,SAAS,aAAc,KAAyB,OAAO,IAAI;GACnF,IAAI,KACF,IAAI;IACF,OAAO,aAAa,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;GAC3D,QAAQ,CAER;GAEF,OAAO;EACT,CAAC;CACH,GACA,CAAC,GAAG,CAGsB,CAAC;AAC/B"}
|
package/es/style.css
CHANGED
|
@@ -6086,6 +6086,10 @@
|
|
|
6086
6086
|
border-radius: 4px;
|
|
6087
6087
|
}
|
|
6088
6088
|
|
|
6089
|
+
.lb13pt9l7.lb13pt9l7:where(.lb1iwm6ff[data-collapsed="true"] *) {
|
|
6090
|
+
gap: 0;
|
|
6091
|
+
}
|
|
6092
|
+
|
|
6089
6093
|
.lbwk8ywg[data-scope-active] {
|
|
6090
6094
|
outline: 2px dashed color-mix(in srgb,var(--lobe-color-info) 60%,transparent);
|
|
6091
6095
|
}
|
|
@@ -12021,6 +12025,10 @@
|
|
|
12021
12025
|
top: calc(var(--lobe-tooltip-arrow-offset-block) * -1);
|
|
12022
12026
|
}
|
|
12023
12027
|
|
|
12028
|
+
.lb15u84wf.lb15u84wf:where(.lb1iwm6ff[data-collapsed="true"] *) {
|
|
12029
|
+
width: 0;
|
|
12030
|
+
}
|
|
12031
|
+
|
|
12024
12032
|
.lb1xdjrj8[aria-current="true"] {
|
|
12025
12033
|
width: 18px;
|
|
12026
12034
|
}
|