@seanyeh77/ui 0.50.0 → 0.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,7 +103,7 @@ function ConsoleLayout({ title, tags, status, kpis, clock, fullscreen = true, ma
103
103
  ref,
104
104
  className: cx("ui-console", stacked && "is-stacked", className),
105
105
  children: /* @__PURE__ */ jsxs("div", {
106
- className: "ui-console-frame",
106
+ className: cx("ui-console-frame", bottom == null && "no-bottom"),
107
107
  style: frameStyle,
108
108
  children: [
109
109
  top,
@@ -1 +1 @@
1
- {"version":3,"file":"ConsoleLayout.js","names":["phCornersIn","phCornersOut"],"sources":["../../../src/components/ConsoleLayout/ConsoleLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconButton } from '../IconButton/IconButton';\nimport { devWarn } from '../../internal/dev';\nimport { cx } from '../../internal/util';\nimport { tr } from '../../i18n';\nimport { includeIcons } from '../../icons/store';\nimport phCornersIn from '../../icons/ph/corners-in';\nimport phCornersOut from '../../icons/ph/corners-out';\n\nincludeIcons(phCornersIn, phCornersOut);\n\n/** A card that shows only when the screen is tall enough. */\nexport interface ConsoleExtra {\n /** Stable key for the card. */\n id: string;\n /** Optional: also needs the layout's logical height (the screen height divided by the zoom) to be at least this\n * many px. Without it, the card shows whenever it fits under the side cards at its own height. */\n minHeight?: number;\n /** The card: usually a Card. */\n node: React.ReactNode;\n}\n\nexport interface ConsoleLayoutProps {\n /** The product or screen name, the page's only heading: 「設施監控」. */\n title: string;\n /** Right after the title: a Tag 「示範資料」 with the info icon. Same size and color as the text around it. */\n tags?: React.ReactNode;\n /** Right side, before the KPIs: one short state in plain words, 「AI 最佳化中」. Shown in body size and ink color;\n * pass plain text, not a Badge. */\n status?: React.ReactNode;\n /** Right side: `<KpiCard size=\"compact\" />` side by side. In the top bar they lose their card look and sit between\n * 1 px lines. */\n kpis?: React.ReactNode;\n /** Right side, after the KPIs: the time and whether it is live, 「16:24 即時」. */\n clock?: React.ReactNode;\n /** A 「全螢幕」 button at the right end (Fullscreen API). Default true; hidden where the browser has no full screen. */\n fullscreen?: boolean;\n /** The main view, left of the side panel; it fills its cell (pass one Card, e.g. with a ZoneMap). */\n main: React.ReactNode;\n /** The side panel, 400 px (360 px under 1280 px): cards from top to bottom (TimeControl, EventTimeline). When they\n * do not fit, the side panel scrolls on its own; the page never does. */\n side?: React.ReactNode;\n /** The bottom row under the main view, as tall as its content: e.g. a LineChart in a Card. The main view takes the\n * height that is left. */\n bottom?: React.ReactNode;\n /** Cards added at the end of the side panel when they fit there at their own height, in order (the first that does\n * not fit and every one after it stay out): `[{ id, node }]`. Stacked, all of them show. */\n extras?: ConsoleExtra[];\n /** Below this width of the layout (px) everything is one scrolling column (stacked). Default 1100: narrower, the main\n * view beside the side panel would be under 700 px wide. */\n stackedBelow?: number;\n /** 'auto' (default): stacked below `stackedBelow`. 'console': never stacked. 'stacked': always stacked. */\n mode?: 'auto' | 'console' | 'stacked';\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** Design size: at this size and up the layout zooms in. */\nconst BASE_W = 1440;\nconst BASE_H = 900;\nconst MAX_ZOOM = 1.5;\nconst STACKED_BELOW = 1100;\nconst PHONE = 600;\n\nconst noSubscribe = () => () => {};\nconst fullscreenEnabled = () => typeof document !== 'undefined' && document.fullscreenEnabled === true;\nconst serverFalse = () => false;\n\n/** Zoom for a screen of w × h px: 1 up to 1440 × 900, then grows with the screen, at most 1.5. */\nexport function consoleZoom(w: number, h: number): number {\n return Math.max(1, Math.min(MAX_ZOOM, Math.min(w / BASE_W, h / BASE_H)));\n}\n\n/** A full-screen monitoring layout: a top bar (title, tags, then status, KPIs, clock and full screen on the right),\n * the main view with a side panel beside it and a bottom row under it, filling the screen without scrolling. From\n * 1440 × 900 up everything zooms with the screen (at most 1.5×). Phones (under 600 px) get one scrolling column. */\nexport function ConsoleLayout({\n title,\n tags,\n status,\n kpis,\n clock,\n fullscreen = true,\n main,\n side,\n bottom,\n extras,\n stackedBelow = STACKED_BELOW,\n mode = 'auto',\n className,\n}: ConsoleLayoutProps) {\n const ref = React.useRef<HTMLDivElement>(null);\n const sideRef = React.useRef<HTMLElement>(null);\n const [size, setSize] = React.useState<{ w: number; h: number } | null>(null);\n const [full, setFull] = React.useState(false);\n // false on the server and the first browser render, so the markup matches; then whether full screen is allowed.\n const canFull = React.useSyncExternalStore(noSubscribe, fullscreenEnabled, serverFalse);\n\n React.useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n const measure = () => setSize({ w: el.clientWidth, h: el.clientHeight });\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(measure);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n React.useEffect(() => {\n const f = () => setFull(document.fullscreenElement != null && document.fullscreenElement === ref.current);\n document.addEventListener('fullscreenchange', f);\n return () => document.removeEventListener('fullscreenchange', f);\n }, []);\n\n const toggleFull = () => {\n const el = ref.current;\n if (!el) return;\n if (document.fullscreenElement) void document.exitFullscreen().catch(() => undefined);\n else void el.requestFullscreen().catch(() => undefined);\n };\n\n const stacked = mode === 'stacked' || (mode === 'auto' && size != null && size.w < stackedBelow);\n const phone = size != null && size.w < PHONE;\n // Stacked, the column scrolls and never zooms.\n // The zoom takes at most the window's height: a layout an app lets grow with its content would otherwise zoom in on\n // its own height.\n const zoomH = size ? Math.min(size.h, (typeof window !== 'undefined' && window.innerHeight) || size.h) : 0;\n const zoom = size && !stacked ? consoleZoom(size.w, zoomH) : 1;\n const logicalH = size ? size.h / zoom : 0;\n const allowed = (extras ?? []).filter((x) => stacked || x.minHeight == null || logicalH >= x.minHeight);\n const fit = useExtrasFit(sideRef, stacked ? -1 : allowed.length, `${allowed.map((x) => x.id).join('|')}|${size?.w}|${size?.h}|${zoom}`);\n const frameStyle: React.CSSProperties | undefined =\n size && !stacked && zoom !== 1 ? ({ zoom, width: size.w / zoom, height: size.h / zoom } as React.CSSProperties) : undefined;\n\n const top = (\n <header className=\"ui-console-top\">\n <div className=\"ui-console-start\">\n <h1 className=\"ui-console-title\">{title}</h1>\n {tags}\n </div>\n <div className=\"ui-console-end\">\n {status != null ? <span className=\"ui-console-status\">{status}</span> : null}\n {kpis != null ? <div className=\"ui-console-kpis\">{kpis}</div> : null}\n {clock != null ? <span className=\"ui-console-clock\">{clock}</span> : null}\n {fullscreen && canFull && !phone ? (\n <IconButton label={full ? tr('離開全螢幕') : tr('全螢幕')} icon={full ? 'corners-in' : 'corners-out'} onClick={toggleFull} />\n ) : null}\n </div>\n </header>\n );\n\n return (\n <div ref={ref} className={cx('ui-console', stacked && 'is-stacked', className)}>\n <div className=\"ui-console-frame\" style={frameStyle}>\n {top}\n {/* The main landmark draws no box (display: contents): the main view and the bottom row stay grid cells, and\n stacked, the whole column after the top bar is in it. */}\n <main className=\"ui-console-content\">\n <div className=\"ui-console-main\">{main}</div>\n {stacked ? (\n <>\n {side != null ? <div className=\"ui-console-cards\">{side}</div> : null}\n {bottom}\n {allowed.length ? (\n <div className=\"ui-console-cards\">\n {allowed.map((x) => (\n <React.Fragment key={x.id}>{x.node}</React.Fragment>\n ))}\n </div>\n ) : null}\n </>\n ) : bottom != null ? (\n <div className=\"ui-console-bottom\">{bottom}</div>\n ) : null}\n </main>\n {stacked ? null : (\n <aside ref={sideRef} className=\"ui-console-side\" aria-label={tr('側欄')}>\n {side}\n {/* Each extra in a wrapper that is measured; one that does not fit is laid out out of sight, at no height,\n so it is measured again when the panel grows. */}\n {allowed.map((x, i) => {\n const out = i >= fit;\n return (\n <div key={x.id} className={cx('ui-console-extra', out && 'is-out')} data-extra=\"\" aria-hidden={out || undefined} inert={out || undefined}>\n {x.node}\n </div>\n );\n })}\n </aside>\n )}\n </div>\n </div>\n );\n}\n\n/** How many extras fit in the side panel under its other cards, each at its own height, in order. n is how many there\n * are (-1: none are measured, stacked). Measured again when the panel or any card changes size. */\nfunction useExtrasFit(sideRef: React.RefObject<HTMLElement | null>, n: number, key: string): number {\n const [fit, setFit] = React.useState(0);\n React.useLayoutEffect(() => {\n const side = sideRef.current;\n if (!side || n <= 0) return setFit(0);\n const measure = () => {\n const cs = getComputedStyle(side);\n const gap = parseFloat(cs.rowGap) || 0;\n const room = side.clientHeight - (parseFloat(cs.paddingTop) || 0) - (parseFloat(cs.paddingBottom) || 0);\n const kids = [...side.children] as HTMLElement[];\n const cards = kids.filter((k) => !k.hasAttribute('data-extra'));\n const extraEls = kids.filter((k) => k.hasAttribute('data-extra'));\n devWarn(\n cards.some((k) => k.scrollHeight > k.clientHeight + 1 && !/auto|scroll/.test(getComputedStyle(k).overflowY)),\n 'ConsoleLayout',\n 'a side card is shorter than its content, so the content is cut. Keep side cards at their own height: do not give them flex: 1 or min-height: 0; the side panel scrolls when they do not fit.',\n );\n let used = cards.reduce((t, k, i) => t + k.offsetHeight + (i ? gap : 0), 0);\n let count = 0;\n for (const ex of extraEls) {\n // An extra out of sight has no height of its own: its card's height counts.\n const h = ex.classList.contains('is-out') ? ((ex.firstElementChild as HTMLElement | null)?.offsetHeight ?? 0) : ex.offsetHeight;\n const need = h + (used > 0 ? gap : 0);\n if (used + need > room + 0.5) break;\n used += need;\n count++;\n }\n setFit((f) => (f === count ? f : count));\n };\n measure();\n if (typeof ResizeObserver !== 'function') return;\n const ro = new ResizeObserver(measure);\n ro.observe(side);\n for (const k of side.children) {\n ro.observe(k);\n if (k.firstElementChild) ro.observe(k.firstElementChild);\n }\n return () => ro.disconnect();\n }, [sideRef, n, key]);\n return n < 0 ? 0 : fit;\n}\n"],"mappings":";;;;;;;;;;;AASA,aAAaA,oBAAaC,mBAAY;;AAiDtC,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,MAAM,gBAAgB;AACtB,MAAM,QAAQ;AAEd,MAAM,0BAA0B,CAAC;AACjC,MAAM,0BAA0B,OAAO,aAAa,eAAe,SAAS,sBAAsB;AAClG,MAAM,oBAAoB;;AAG1B,SAAgB,YAAY,GAAW,GAAmB;CACxD,OAAO,KAAK,IAAI,GA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AM,KAAK;GACrC,MAAM,OAAO,KAAK,gBAAgB,WAAW,GAAG,UAAU,KAAK,MAAM,WAAW,GAAG,aAAa,KAAK;GACrG,MAAM,OAAO,CAAC,GAAG,KAAK,QAAQ;GAC9B,MAAM,QAAQ,KAAK,QAAQ,MAAM,CAAC,EAAE,aAAa,YAAY,CAAC;GAC9D,MAAM,WAAW,KAAK,QAAQ,MAAM,EAAE,aAAa,YAAY,CAAC;GAChE,QACE,MAAM,MAAM,MAAM,EAAE,eAAe,EAAE,eAAe,KAAK,CAAC,cAAc,KAAK,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,GAC3G,iBACA,8LACF;GACA,IAAI,OAAO,MAAM,QAAQ,GAAG,GAAG,MAAM,IAAI,EAAE,gBAAgB,IAAI,MAAM,IAAI,CAAC;GAC1E,IAAI,QAAQ;GACZ,KAAK,MAAM,MAAM,UAAU;IAGzB,MAAM,QADI,GAAG,UAAU,SAAS,QAAQ,IAAM,GAAG,mBAA0C,gBAAgB,IAAK,GAAG,iBACjG,OAAO,IAAI,MAAM;IACnC,IAAI,OAAO,OAAO,OAAO,IAAK;IAC9B,QAAQ;IACR;GACF;GACA,QAAQ,MAAO,MAAM,QAAQ,IAAI,KAAM;EACzC;EACA,QAAQ;EACR,IAAI,OAAO,mBAAmB,YAAY;EAC1C,MAAM,KAAK,IAAI,eAAe,OAAO;EACrC,GAAG,QAAQ,IAAI;EACf,KAAK,MAAM,KAAK,KAAK,UAAU;GAC7B,GAAG,QAAQ,CAAC;GACZ,IAAI,EAAE,mBAAmB,GAAG,QAAQ,EAAE,iBAAiB;EACzD;EACA,aAAa,GAAG,WAAW;CAC7B,GAAG;EAAC;EAAS;EAAG;CAAG,CAAC;CACpB,OAAO,IAAI,IAAI,IAAI;AACrB"}
1
+ {"version":3,"file":"ConsoleLayout.js","names":["phCornersIn","phCornersOut"],"sources":["../../../src/components/ConsoleLayout/ConsoleLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IconButton } from '../IconButton/IconButton';\nimport { devWarn } from '../../internal/dev';\nimport { cx } from '../../internal/util';\nimport { tr } from '../../i18n';\nimport { includeIcons } from '../../icons/store';\nimport phCornersIn from '../../icons/ph/corners-in';\nimport phCornersOut from '../../icons/ph/corners-out';\n\nincludeIcons(phCornersIn, phCornersOut);\n\n/** A card that shows only when the screen is tall enough. */\nexport interface ConsoleExtra {\n /** Stable key for the card. */\n id: string;\n /** Optional: also needs the layout's logical height (the screen height divided by the zoom) to be at least this\n * many px. Without it, the card shows whenever it fits under the side cards at its own height. */\n minHeight?: number;\n /** The card: usually a Card. */\n node: React.ReactNode;\n}\n\nexport interface ConsoleLayoutProps {\n /** The product or screen name, the page's only heading: 「設施監控」. */\n title: string;\n /** Right after the title: a Tag 「示範資料」 with the info icon. Same size and color as the text around it. */\n tags?: React.ReactNode;\n /** Right side, before the KPIs: one short state in plain words, 「AI 最佳化中」. Shown in body size and ink color;\n * pass plain text, not a Badge. */\n status?: React.ReactNode;\n /** Right side: `<KpiCard size=\"compact\" />` side by side. In the top bar they lose their card look and sit between\n * 1 px lines. */\n kpis?: React.ReactNode;\n /** Right side, after the KPIs: the time and whether it is live, 「16:24 即時」. */\n clock?: React.ReactNode;\n /** A 「全螢幕」 button at the right end (Fullscreen API). Default true; hidden where the browser has no full screen. */\n fullscreen?: boolean;\n /** The main view, left of the side panel; it fills its cell (pass one Card, e.g. with a ZoneMap). */\n main: React.ReactNode;\n /** The side panel, 400 px (360 px under 1280 px): cards from top to bottom (TimeControl, EventTimeline). When they\n * do not fit, the side panel scrolls on its own; the page never does. */\n side?: React.ReactNode;\n /** The bottom row under the main view, as tall as its content: e.g. a LineChart in a Card. The main view takes the\n * height that is left. */\n bottom?: React.ReactNode;\n /** Cards added at the end of the side panel when they fit there at their own height, in order (the first that does\n * not fit and every one after it stay out): `[{ id, node }]`. Stacked, all of them show. */\n extras?: ConsoleExtra[];\n /** Below this width of the layout (px) everything is one scrolling column (stacked). Default 1100: narrower, the main\n * view beside the side panel would be under 700 px wide. */\n stackedBelow?: number;\n /** 'auto' (default): stacked below `stackedBelow`. 'console': never stacked. 'stacked': always stacked. */\n mode?: 'auto' | 'console' | 'stacked';\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** Design size: at this size and up the layout zooms in. */\nconst BASE_W = 1440;\nconst BASE_H = 900;\nconst MAX_ZOOM = 1.5;\nconst STACKED_BELOW = 1100;\nconst PHONE = 600;\n\nconst noSubscribe = () => () => {};\nconst fullscreenEnabled = () => typeof document !== 'undefined' && document.fullscreenEnabled === true;\nconst serverFalse = () => false;\n\n/** Zoom for a screen of w × h px: 1 up to 1440 × 900, then grows with the screen, at most 1.5. */\nexport function consoleZoom(w: number, h: number): number {\n return Math.max(1, Math.min(MAX_ZOOM, Math.min(w / BASE_W, h / BASE_H)));\n}\n\n/** A full-screen monitoring layout: a top bar (title, tags, then status, KPIs, clock and full screen on the right),\n * the main view with a side panel beside it and a bottom row under it, filling the screen without scrolling. From\n * 1440 × 900 up everything zooms with the screen (at most 1.5×). Phones (under 600 px) get one scrolling column. */\nexport function ConsoleLayout({\n title,\n tags,\n status,\n kpis,\n clock,\n fullscreen = true,\n main,\n side,\n bottom,\n extras,\n stackedBelow = STACKED_BELOW,\n mode = 'auto',\n className,\n}: ConsoleLayoutProps) {\n const ref = React.useRef<HTMLDivElement>(null);\n const sideRef = React.useRef<HTMLElement>(null);\n const [size, setSize] = React.useState<{ w: number; h: number } | null>(null);\n const [full, setFull] = React.useState(false);\n // false on the server and the first browser render, so the markup matches; then whether full screen is allowed.\n const canFull = React.useSyncExternalStore(noSubscribe, fullscreenEnabled, serverFalse);\n\n React.useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n const measure = () => setSize({ w: el.clientWidth, h: el.clientHeight });\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(measure);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n React.useEffect(() => {\n const f = () => setFull(document.fullscreenElement != null && document.fullscreenElement === ref.current);\n document.addEventListener('fullscreenchange', f);\n return () => document.removeEventListener('fullscreenchange', f);\n }, []);\n\n const toggleFull = () => {\n const el = ref.current;\n if (!el) return;\n if (document.fullscreenElement) void document.exitFullscreen().catch(() => undefined);\n else void el.requestFullscreen().catch(() => undefined);\n };\n\n const stacked = mode === 'stacked' || (mode === 'auto' && size != null && size.w < stackedBelow);\n const phone = size != null && size.w < PHONE;\n // Stacked, the column scrolls and never zooms.\n // The zoom takes at most the window's height: a layout an app lets grow with its content would otherwise zoom in on\n // its own height.\n const zoomH = size ? Math.min(size.h, (typeof window !== 'undefined' && window.innerHeight) || size.h) : 0;\n const zoom = size && !stacked ? consoleZoom(size.w, zoomH) : 1;\n const logicalH = size ? size.h / zoom : 0;\n const allowed = (extras ?? []).filter((x) => stacked || x.minHeight == null || logicalH >= x.minHeight);\n const fit = useExtrasFit(sideRef, stacked ? -1 : allowed.length, `${allowed.map((x) => x.id).join('|')}|${size?.w}|${size?.h}|${zoom}`);\n const frameStyle: React.CSSProperties | undefined =\n size && !stacked && zoom !== 1 ? ({ zoom, width: size.w / zoom, height: size.h / zoom } as React.CSSProperties) : undefined;\n\n const top = (\n <header className=\"ui-console-top\">\n <div className=\"ui-console-start\">\n <h1 className=\"ui-console-title\">{title}</h1>\n {tags}\n </div>\n <div className=\"ui-console-end\">\n {status != null ? <span className=\"ui-console-status\">{status}</span> : null}\n {kpis != null ? <div className=\"ui-console-kpis\">{kpis}</div> : null}\n {clock != null ? <span className=\"ui-console-clock\">{clock}</span> : null}\n {fullscreen && canFull && !phone ? (\n <IconButton label={full ? tr('離開全螢幕') : tr('全螢幕')} icon={full ? 'corners-in' : 'corners-out'} onClick={toggleFull} />\n ) : null}\n </div>\n </header>\n );\n\n return (\n <div ref={ref} className={cx('ui-console', stacked && 'is-stacked', className)}>\n <div className={cx('ui-console-frame', bottom == null && 'no-bottom')} style={frameStyle}>\n {top}\n {/* The main landmark draws no box (display: contents): the main view and the bottom row stay grid cells, and\n stacked, the whole column after the top bar is in it. */}\n <main className=\"ui-console-content\">\n <div className=\"ui-console-main\">{main}</div>\n {stacked ? (\n <>\n {side != null ? <div className=\"ui-console-cards\">{side}</div> : null}\n {bottom}\n {allowed.length ? (\n <div className=\"ui-console-cards\">\n {allowed.map((x) => (\n <React.Fragment key={x.id}>{x.node}</React.Fragment>\n ))}\n </div>\n ) : null}\n </>\n ) : bottom != null ? (\n <div className=\"ui-console-bottom\">{bottom}</div>\n ) : null}\n </main>\n {stacked ? null : (\n <aside ref={sideRef} className=\"ui-console-side\" aria-label={tr('側欄')}>\n {side}\n {/* Each extra in a wrapper that is measured; one that does not fit is laid out out of sight, at no height,\n so it is measured again when the panel grows. */}\n {allowed.map((x, i) => {\n const out = i >= fit;\n return (\n <div key={x.id} className={cx('ui-console-extra', out && 'is-out')} data-extra=\"\" aria-hidden={out || undefined} inert={out || undefined}>\n {x.node}\n </div>\n );\n })}\n </aside>\n )}\n </div>\n </div>\n );\n}\n\n/** How many extras fit in the side panel under its other cards, each at its own height, in order. n is how many there\n * are (-1: none are measured, stacked). Measured again when the panel or any card changes size. */\nfunction useExtrasFit(sideRef: React.RefObject<HTMLElement | null>, n: number, key: string): number {\n const [fit, setFit] = React.useState(0);\n React.useLayoutEffect(() => {\n const side = sideRef.current;\n if (!side || n <= 0) return setFit(0);\n const measure = () => {\n const cs = getComputedStyle(side);\n const gap = parseFloat(cs.rowGap) || 0;\n const room = side.clientHeight - (parseFloat(cs.paddingTop) || 0) - (parseFloat(cs.paddingBottom) || 0);\n const kids = [...side.children] as HTMLElement[];\n const cards = kids.filter((k) => !k.hasAttribute('data-extra'));\n const extraEls = kids.filter((k) => k.hasAttribute('data-extra'));\n devWarn(\n cards.some((k) => k.scrollHeight > k.clientHeight + 1 && !/auto|scroll/.test(getComputedStyle(k).overflowY)),\n 'ConsoleLayout',\n 'a side card is shorter than its content, so the content is cut. Keep side cards at their own height: do not give them flex: 1 or min-height: 0; the side panel scrolls when they do not fit.',\n );\n let used = cards.reduce((t, k, i) => t + k.offsetHeight + (i ? gap : 0), 0);\n let count = 0;\n for (const ex of extraEls) {\n // An extra out of sight has no height of its own: its card's height counts.\n const h = ex.classList.contains('is-out') ? ((ex.firstElementChild as HTMLElement | null)?.offsetHeight ?? 0) : ex.offsetHeight;\n const need = h + (used > 0 ? gap : 0);\n if (used + need > room + 0.5) break;\n used += need;\n count++;\n }\n setFit((f) => (f === count ? f : count));\n };\n measure();\n if (typeof ResizeObserver !== 'function') return;\n const ro = new ResizeObserver(measure);\n ro.observe(side);\n for (const k of side.children) {\n ro.observe(k);\n if (k.firstElementChild) ro.observe(k.firstElementChild);\n }\n return () => ro.disconnect();\n }, [sideRef, n, key]);\n return n < 0 ? 0 : fit;\n}\n"],"mappings":";;;;;;;;;;;AASA,aAAaA,oBAAaC,mBAAY;;AAiDtC,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,MAAM,gBAAgB;AACtB,MAAM,QAAQ;AAEd,MAAM,0BAA0B,CAAC;AACjC,MAAM,0BAA0B,OAAO,aAAa,eAAe,SAAS,sBAAsB;AAClG,MAAM,oBAAoB;;AAG1B,SAAgB,YAAY,GAAW,GAAmB;CACxD,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,UAAU,KAAK,IAAI,IAAI,QAAQ,IAAI,MAAM,CAAC,CAAC;AACzE;;;;AAKA,SAAgB,cAAc,EAC5B,OACA,MACA,QACA,MACA,OACA,aAAa,MACb,MACA,MACA,QACA,QACA,eAAe,eACf,OAAO,QACP,aACqB;CACrB,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,MAAM,UAAU,MAAM,OAAoB,IAAI;CAC9C,MAAM,CAAC,MAAM,WAAW,MAAM,SAA0C,IAAI;CAC5E,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAE5C,MAAM,UAAU,MAAM,qBAAqB,aAAa,mBAAmB,WAAW;CAEtF,MAAM,sBAAsB;EAC1B,MAAM,KAAK,IAAI;EACf,IAA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,GAAG,MAAM,IAAI,EAAE,gBAAgB,IAAI,MAAM,IAAI,CAAC;GAC1E,IAAI,QAAQ;GACZ,KAAK,MAAM,MAAM,UAAU;IAGzB,MAAM,QADI,GAAG,UAAU,SAAS,QAAQ,IAAM,GAAG,mBAA0C,gBAAgB,IAAK,GAAG,iBACjG,OAAO,IAAI,MAAM;IACnC,IAAI,OAAO,OAAO,OAAO,IAAK;IAC9B,QAAQ;IACR;GACF;GACA,QAAQ,MAAO,MAAM,QAAQ,IAAI,KAAM;EACzC;EACA,QAAQ;EACR,IAAI,OAAO,mBAAmB,YAAY;EAC1C,MAAM,KAAK,IAAI,eAAe,OAAO;EACrC,GAAG,QAAQ,IAAI;EACf,KAAK,MAAM,KAAK,KAAK,UAAU;GAC7B,GAAG,QAAQ,CAAC;GACZ,IAAI,EAAE,mBAAmB,GAAG,QAAQ,EAAE,iBAAiB;EACzD;EACA,aAAa,GAAG,WAAW;CAC7B,GAAG;EAAC;EAAS;EAAG;CAAG,CAAC;CACpB,OAAO,IAAI,IAAI,IAAI;AACrB"}
@@ -21,6 +21,13 @@
21
21
  gap: 12px;
22
22
  padding: 12px;
23
23
  }
24
+ /* Without a bottom row there is no third row, and so no gap above it: the main view reaches the bottom. */
25
+ .ui-console-frame.no-bottom {
26
+ grid-template-rows: auto minmax(0, 1fr);
27
+ }
28
+ .ui-console-frame.no-bottom .ui-console-side {
29
+ grid-row: 2;
30
+ }
24
31
  @container (max-width: 1279px) {
25
32
  .ui-console-frame {
26
33
  grid-template-columns: minmax(0, 1fr) 360px;
package/dist/styles.css CHANGED
@@ -10199,6 +10199,13 @@ button.ui-md-link.is-row {
10199
10199
  gap: 12px;
10200
10200
  padding: 12px;
10201
10201
  }
10202
+ /* Without a bottom row there is no third row, and so no gap above it: the main view reaches the bottom. */
10203
+ .ui-console-frame.no-bottom {
10204
+ grid-template-rows: auto minmax(0, 1fr);
10205
+ }
10206
+ .ui-console-frame.no-bottom .ui-console-side {
10207
+ grid-row: 2;
10208
+ }
10202
10209
  @container (max-width: 1279px) {
10203
10210
  .ui-console-frame {
10204
10211
  grid-template-columns: minmax(0, 1fr) 360px;
@@ -30,7 +30,7 @@ h(UI.ConsoleLayout, {
30
30
  - `kpis` 放 `KpiCard size="compact"`,在頂列裡去掉卡片底色和陰影,中間用 1 px 線分開。
31
31
  - `main`:主視覺,例如裝 ZoneMap 的 Card;填滿左邊的格子,放不下時在卡片裡捲動。卡片裡是由上而下排的欄,ZoneMap 加 `fill` 就會撐滿卡片剩下的高度。
32
32
  - `side`:側欄的卡片,由上到下,例如 TimeControl、EventTimeline。側欄 400 px(版面寬度小於 1280 px 時 360 px),放不下時側欄自己捲動。
33
- - `bottom`:主視覺下方一列,高度跟著內容,例如裝 LineChart 的 Card;主視覺拿剩下的高度。
33
+ - `bottom`:主視覺下方一列,高度跟著內容,例如裝 LineChart 的 Card;主視覺拿剩下的高度。沒有 `bottom` 時沒有這一列,主視覺一直到底,和側欄對齊。
34
34
  - `extras: [{ id, node, minHeight? }]`:側欄放得下才出現的卡片,加在側欄最後面。依序量每張卡片自己的高度,放得進側欄剩下的空間才顯示,第一張放不下的和後面的都不顯示;側欄因此不用為了它們捲動。`minHeight`(選用)另外要求「邏輯高度」(畫面高度 ÷ 放大倍數)至少這麼高。沒顯示的卡片仍在畫面外排版、量高度,螢幕閱讀器和 Tab 都略過(`inert`)。
35
35
  - 放大:1440 × 900 以上整個版面等比放大,倍數 = 寬 ÷ 1440 和 高 ÷ 900 的較小者,最多 1.5 倍;以下維持原大小、不縮小。寬是版面的寬,高是版面的高和視窗高度的較小者(版面被頁面撐高時不會因此放大);排成一欄時不放大。裡面的元件(FloorPlan、LineChart、DataTable、SplitPane 等)在放大後照常量尺寸。
36
36
  - 全螢幕按鈕(「全螢幕」/「離開全螢幕」)讓版面佔滿整個螢幕;瀏覽器沒有全螢幕功能時不顯示,`fullscreen={false}` 可以拿掉。
package/docs/agents.md CHANGED
@@ -65,11 +65,11 @@ export default [ui.configs.recommended];
65
65
  ```html
66
66
  <meta charset="utf-8">
67
67
  <meta name="viewport" content="width=device-width, initial-scale=1">
68
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.50.0/fonts.css">
69
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.50.0/tokens.css">
70
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.50.0/styles.css">
68
+ <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.50.1/fonts.css">
69
+ <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.50.1/tokens.css">
70
+ <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.50.1/styles.css">
71
71
  <div id="root"></div>
72
- <script src="https://seanyeh77.github.io/ui-design-system/dist/0.50.0/bundle.js"></script>
72
+ <script src="https://seanyeh77.github.io/ui-design-system/dist/0.50.1/bundle.js"></script>
73
73
  <script>
74
74
  const h = React.createElement;
75
75
  UI.initTheme();
@@ -77,6 +77,6 @@ export default [ui.configs.recommended];
77
77
  </script>
78
78
  ```
79
79
 
80
- Pin a version as above: `/dist/<version>/` never changes; `/dist/` always serves the latest release. jsDelivr has the same files (`https://cdn.jsdelivr.net/npm/@seanyeh77/ui@0.50.0/dist/bundle.js`, `…/dist/styles.css`; the fonts at `https://cdn.jsdelivr.net/npm/@seanyeh77/tokens@0.50.0/fonts.css`). Without a bundler, `@seanyeh77/ui/dist/fonts.css` cannot resolve its import: load the tokens package's `fonts.css` or the pinned site URL.
80
+ Pin a version as above: `/dist/<version>/` never changes; `/dist/` always serves the latest release. jsDelivr has the same files (`https://cdn.jsdelivr.net/npm/@seanyeh77/ui@0.50.1/dist/bundle.js`, `…/dist/styles.css`; the fonts at `https://cdn.jsdelivr.net/npm/@seanyeh77/tokens@0.50.1/fonts.css`). Without a bundler, `@seanyeh77/ui/dist/fonts.css` cannot resolve its import: load the tokens package's `fonts.css` or the pinned site URL.
81
81
 
82
82
  Scope: web UI, and the tokens of SeanYeh's Slidev decks (`initTheme({ preset: 'teaching' })`, see `theme.md`). Slide layout, Notion documents and teaching diagrams follow the separate `teaching-materials-style` skill.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyeh77/ui",
3
- "version": "0.50.0",
3
+ "version": "0.50.1",
4
4
  "description": "SeanYeh's design system: typed React components on Base UI, styled with design tokens.",
5
5
  "license": "MIT",
6
6
  "author": "Hsiu-An Yeh",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@base-ui/react": "^1.9.0",
61
- "@seanyeh77/tokens": "^0.50.0"
61
+ "@seanyeh77/tokens": "^0.50.1"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "node scripts/theme-defaults.ts && tsdown && node scripts/postbuild.ts",