@korzun/design 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,6BAA6B;AAC7B,MAAM,IAAI,GAAG;IACX,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,MAAM;CACH,CAAC;AAEX,MAAM,IAAI,GAAG;IACX,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;CACN,CAAC;AAEX,MAAM,GAAG,GAAG;IACV,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;CACN,CAAC;AAoLX,yBAAyB;AACzB,SAAS,UAAU,CAAC,IAAe;IACjC,MAAM,UAAU,GAAmB;QACjC,IAAI;QACJ,IAAI;QACJ,GAAG;QACH,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC;YAClB,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC;YACpB,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;YAChB,KAAK,EAAE,IAAI,C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Ae;gBAC/B,OAAO,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,EAAE,EAAE;gBAClC,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU;gBACpC,iBAAiB,EAAE,OAAO;gBAC1B,iBAAiB,EAAE,KAAK;gBACxB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;gBACtC,UAAU,EAAE,MAAM;gBAClB,qBAAqB,EAAE,MAAM;aAC9B;YACD,MAAM,EAAE;gBACN,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM;gBAChC,cAAc,EAAE,OAAO;gBACvB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;gBACnC,cAAc,EAAE,KAAK;gBACrB,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,KAAK;gBACpB,UAAU,EAAE,QAAQ;gBACpB,cAAc,EAAE,KAAK;gBACrB,GAAG,EAAE,KAAK,CAAC,EAAE;gBACb,UAAU,EAAE,KAAK,CAAC,EAAE;gBACpB,aAAa,EAAE,KAAK,CAAC,EAAE;gBACvB,WAAW,EAAE,KAAK,CAAC,EAAE;gBACrB,YAAY,EAAE,KAAK,CAAC,EAAE;aACvB;SACF;KACF,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,KAAK;QACL,KAAK;QACL,MAAM;QACN,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,UAAU;QACV,UAAU;QACV,UAAU;QACV,MAAM;QACN,UAAU;QACV,MAAM;QACN,UAAU;QACV,MAAM;KACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAU,UAAU,CAAC,OAAO,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,SAAS,GAAU,UAAU,CAAC,MAAM,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,YAAY,GAAU,UAAU,CAAC","sourcesContent":["import { applyTransparency } from '../utils.js';\n\nexport type ThemeMode = 'light' | 'dark';\n\n// ─── Primitive palettes ───\nconst gray = {\n 50: '#FCFCFC',\n 100: '#EEEEEE',\n 150: '#e5e7eb',\n 200: '#DDDDDD',\n 300: '#D9D9D9',\n 400: '#D0D0D0',\n 500: '#9ca3af',\n 600: '#6E6E6E',\n 700: '#5A6375',\n 900: '#111',\n} as const;\n\nconst blue = {\n 50: '#EFF6FF',\n 100: '#dbeafe',\n 200: '#91CAFF',\n 300: '#87BAFF',\n 400: '#3696fe',\n 500: '#1777FF',\n 600: '#1D4ED8',\n 700: '#0758d9',\n 800: '#083FBC',\n} as const;\n\nconst red = {\n 50: '#fff1f0',\n 100: '#FFA8A6',\n 300: '#ff7874',\n 400: '#FF8E8E',\n 500: '#FF4D4F',\n 600: '#e98182',\n 700: '#D9373e',\n} as const;\n\n// JSS-spreadable style fragment. Loose by design: recipes nest pseudo-selectors\n// (`&:hover`) and string/number CSS values, which a stricter type can't capture\n// without inviting more friction than safety it would provide.\ntype Recipe = { [key: string]: Recipe | string | number };\n\n// ─── Theme interface ───\nexport interface Theme {\n colorScheme: ThemeMode;\n color: {\n gray: typeof gray;\n blue: typeof blue;\n red: typeof red;\n text: {\n primary: string;\n secondary: string;\n muted: string;\n faint: string;\n onPrimary: string;\n onDanger: string;\n description: string;\n };\n bg: {\n page: string;\n card: string;\n cardHeader: string;\n /**\n * The rail behind a segmented control's sliding lens. Its own token, not\n * `cardHeader`, because it must read against BOTH `page` and `card` — and\n * in dark mode those sit on either side of `cardHeader`, which left the\n * rail invisible on the page.\n */\n track: string;\n input: string;\n footer: string;\n glass: string;\n glassFallback: string;\n glassActive: string;\n selected: string;\n hover: string;\n success: string;\n placeholder: string;\n };\n border: {\n default: string;\n strong: string;\n light: string;\n focus: string;\n hover: string;\n danger: string;\n glass: string;\n glassActive: string;\n faint: string;\n loading: string;\n success: string;\n section: string;\n };\n success: string;\n brand: {\n default: string;\n hover: string;\n active: string;\n light: string;\n outline: string;\n loading: string;\n loadingHover: string;\n loadingActive: string;\n linkHover: string;\n };\n danger: {\n default: string;\n hover: string;\n active: string;\n light: string;\n outline: string;\n loading: string;\n loadingHover: string;\n loadingActive: string;\n };\n overlay: { backdrop: string };\n chip: {\n status: { text: string; bg: string; border: string };\n author: { text: string; bg: string; border: string };\n series: { text: string; bg: string; border: string };\n subject: { text: string; bg: string; border: string };\n book: { text: string; bg: string; border: string };\n entryType: { text: string; bg: string; border: string };\n user: { text: string; bg: string; border: string };\n rating: { text: string; bg: string; border: string };\n // Quiet grey for states that carry no category (e.g. \"no change\"), built\n // from the mode's muted text colour.\n neutral: { text: string; bg: string; border: string };\n };\n };\n space: {\n xxxs: string;\n xxs: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n xxl: string;\n xxxl: string;\n xxxxl: string;\n xxxxxl: string;\n };\n radius: { sm: string; md: string; lg: string; circle: string; pill: string };\n size: { metadataValue: string };\n // Intrinsic sizes of chrome that other elements must lay out around. These are\n // measured, not derived (the element's real height comes from its content), so\n // they need on-device tuning — keep the single source of truth here.\n // `floatingControlTopBase` is the odd one out: a POSITION, not a size — see\n // its definition below.\n layout: {\n navHeightMobile: string;\n modalWidth: string;\n controlHeight: string;\n floatingControlTopBase: string;\n };\n fontSize: {\n xxs: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n xxl: string;\n };\n fontFamily: { body: string; mono: string };\n fontWeight: { medium: number; semibold: number; bold: number; extrabold: number };\n lineHeight: { tight: number; body: number };\n shadow: {\n card: string;\n cardStack: string;\n hoverLift: string;\n dangerStack: string;\n brandStack: string;\n glass: string;\n glassActive: string;\n };\n transition: { fast: string; medium: string; slide: string; slow: string; spring: string };\n zIndex: {\n behind: number;\n base: number;\n stack: { lo: number; md: number; hi: number };\n header: number;\n sticky: number;\n toast: number;\n };\n breakpoint: {\n mobile: string;\n normal: string;\n };\n\n // Recipes are JSS-spreadable fragments. Loose typing lets them include\n // pseudo-selectors (`&:hover`) and nested rules without fighting JSS's TS surface.\n recipe: {\n input: Recipe;\n focusRing: Recipe;\n label: Recipe;\n spinner: Recipe;\n glass: Recipe;\n glassHighlight: Recipe;\n /** The shaded field row (`bg.cardHeader`, `md` corners) a control sits in inside a card. */\n row: Recipe;\n modal: {\n dialog: Recipe;\n header: Recipe;\n footer: Recipe;\n };\n card: {\n shell: Recipe;\n header: Recipe;\n footer: Recipe;\n };\n };\n}\n\n// ─── Build defaults ───\nfunction buildTheme(mode: ThemeMode): Theme {\n const lightColor: Theme['color'] = {\n gray,\n blue,\n red,\n text: {\n primary: gray[900],\n secondary: gray[700],\n muted: gray[600],\n faint: gray[500],\n onPrimary: '#FFFFFF',\n onDanger: '#FFFFFF',\n description: '#585863',\n },\n bg: {\n page: '#F6F6F9',\n card: gray[50],\n cardHeader: gray[100],\n // Unchanged from the `cardHeader` this used to borrow: in light mode the\n // track was already a step darker than the page, so light renders as before.\n track: gray[100],\n input: '#FFFFFF',\n footer: gray[100],\n glass: applyTransparency('#FFFFFF', 0.6),\n glassFallback: applyTransparency('#FFFFFF', 0.92),\n glassActive: applyTransparency('#FFFFFF', 0.55),\n selected: blue[100],\n // A translucent scrim, not an opaque grey: hover has to read on whatever\n // surface it lands on. The old '#f0f0f0' was lighter than the modal\n // footer (gray[100]) it was painted over, so hovering a text button\n // there produced no visible change at all.\n hover: applyTransparency('#000000', 0.07),\n success: '#f0fdf4',\n placeholder: '#d1d5db',\n },\n border: {\n default: gray[300],\n strong: gray[200],\n light: gray[150],\n focus: blue[700],\n hover: blue[200],\n danger: red[500],\n glass: applyTransparency('#000', 0.08),\n glassActive: applyTransparency('#FFFFFF', 0.7),\n faint: gray[500],\n loading: '#e6e6e6',\n success: '#bbf7d0',\n section: '#E6E6E9',\n },\n success: '#16a34a',\n brand: {\n default: blue[500],\n hover: blue[400],\n active: blue[700],\n light: blue[50],\n outline: blue[200],\n loading: '#73A6FF',\n loadingHover: blue[300],\n loadingActive: '#6893e7',\n linkHover: blue[300],\n },\n danger: {\n default: red[500],\n hover: red[300],\n active: red[700],\n light: red[50],\n outline: applyTransparency(red[300], 0.5),\n loading: red[400],\n loadingHover: red[100],\n loadingActive: red[600],\n },\n overlay: { backdrop: applyTransparency('#000', 0.7) },\n chip: {\n status: { text: '#6d3fc0', bg: 'rgba(109,63,192,0.08)', border: 'rgba(109,63,192,0.22)' },\n author: { text: '#1a7a52', bg: 'rgba(26,122,82,0.08)', border: 'rgba(26,122,82,0.22)' },\n series: { text: '#1a5fa8', bg: 'rgba(26,95,168,0.08)', border: 'rgba(26,95,168,0.22)' },\n subject: { text: '#8a5e00', bg: 'rgba(138,94,0,0.08)', border: 'rgba(138,94,0,0.22)' },\n book: { text: '#0e6b7d', bg: 'rgba(14, 107, 125, 0.08)', border: 'rgba(14, 107, 125, 0.22)' },\n entryType: {\n text: '#c0415e',\n bg: 'rgba(192, 65, 94, 0.08)',\n border: 'rgba(192, 65, 94, 0.22)',\n },\n user: { text: '#a23a95', bg: 'rgba(162,58,149,0.08)', border: 'rgba(162,58,149,0.22)' },\n rating: { text: '#b5451b', bg: 'rgba(181,69,27,0.08)', border: 'rgba(181,69,27,0.22)' },\n neutral: {\n text: gray[600],\n bg: applyTransparency(gray[600], 0.08),\n border: applyTransparency(gray[600], 0.22),\n },\n },\n };\n\n const darkMuted = '#9CA1AB';\n const darkColor: Theme['color'] = {\n gray,\n blue,\n red,\n text: {\n primary: '#F5F5F7',\n secondary: '#C8CBD2',\n muted: darkMuted,\n faint: '#6E7480',\n onPrimary: '#FFFFFF',\n onDanger: '#FFFFFF',\n description: '#A8ADB6',\n },\n bg: {\n page: '#242527',\n card: '#1A1B1E',\n cardHeader: '#232427',\n // A step LIGHTER than the page, not darker. This palette puts `page`\n // (#242527) above `card`/`input` (#1A1B1E), so the light-mode move —\n // recess the track below the surface — has nowhere to go in dark without\n // colliding with the lens. Raising it instead keeps the same ~8-per-channel\n // separation light mode has, in the only direction that is still free.\n track: '#2C2D31',\n input: '#1A1B1E',\n footer: '#232427',\n glass: applyTransparency('#1C1C1E', 0.6),\n glassFallback: applyTransparency('#1C1C1E', 0.92),\n glassActive: applyTransparency('#2C2C2E', 0.55),\n selected: applyTransparency(blue[500], 0.24),\n hover: applyTransparency('#FFFFFF', 0.12),\n success: applyTransparency('#22C55E', 0.14),\n placeholder: '#2A2B2F',\n },\n border: {\n default: '#3A3B40',\n strong: '#48494F',\n light: '#2B2C30',\n faint: '#3A3B40',\n focus: blue[400],\n hover: blue[600],\n danger: red[500],\n glass: applyTransparency('#FFFFFF', 0.12),\n glassActive: applyTransparency('#FFFFFF', 0.18),\n loading: '#34353A',\n success: applyTransparency('#22C55E', 0.4),\n section: '#2B2C30',\n },\n success: '#22C55E',\n brand: {\n default: blue[400],\n hover: blue[300],\n active: blue[200],\n light: applyTransparency(blue[500], 0.2),\n outline: applyTransparency(blue[400], 0.45),\n linkHover: blue[200],\n loading: '#3E5A8A',\n loadingHover: blue[600],\n loadingActive: '#33507F',\n },\n danger: {\n default: red[500],\n hover: red[400],\n active: red[700],\n light: applyTransparency(red[500], 0.18),\n outline: applyTransparency(red[300], 0.5),\n loading: red[400],\n loadingHover: red[600],\n loadingActive: red[700],\n },\n overlay: { backdrop: applyTransparency('#000', 0.7) },\n chip: {\n status: { text: '#C9B0F2', bg: 'rgba(167,139,250,0.16)', border: 'rgba(167,139,250,0.30)' },\n author: { text: '#7EE6B4', bg: 'rgba(52,211,153,0.16)', border: 'rgba(52,211,153,0.30)' },\n series: { text: '#8EC3F5', bg: 'rgba(96,165,250,0.16)', border: 'rgba(96,165,250,0.30)' },\n subject: { text: '#E8C879', bg: 'rgba(217,168,67,0.16)', border: 'rgba(217,168,67,0.30)' },\n book: { text: '#7FD0DE', bg: 'rgba(45, 170, 190, 0.18)', border: 'rgba(45, 170, 190, 0.32)' },\n entryType: {\n text: '#E89BAC',\n bg: 'rgba(192, 65, 94, 0.18)',\n border: 'rgba(192, 65, 94, 0.32)',\n },\n user: { text: '#E7A6DA', bg: 'rgba(162,58,149,0.16)', border: 'rgba(162,58,149,0.30)' },\n rating: { text: '#F2A07B', bg: 'rgba(181,69,27,0.18)', border: 'rgba(181,69,27,0.32)' },\n // Dark chips run stronger alphas (0.16 / 0.30) than light (0.08 / 0.22).\n neutral: {\n text: darkMuted,\n bg: applyTransparency(darkMuted, 0.16),\n border: applyTransparency(darkMuted, 0.3),\n },\n },\n };\n\n const color: Theme['color'] = mode === 'dark' ? darkColor : lightColor;\n\n const space: Theme['space'] = {\n xxxs: '0.1rem',\n xxs: '0.125rem',\n xs: '0.25rem',\n sm: '0.375rem',\n md: '0.5rem',\n lg: '0.625rem',\n xl: '0.75rem',\n xxl: '1rem',\n xxxl: '1.25rem',\n xxxxl: '1.5rem',\n xxxxxl: '2rem',\n };\n\n const radius: Theme['radius'] = {\n sm: '4px',\n md: '8px',\n lg: '16px',\n circle: '50%',\n pill: '999px',\n };\n const size: Theme['size'] = { metadataValue: '15rem' };\n // The floating mobile nav capsule is ~96px tall on-device (content + padding +\n // the min bottom floor). Tune against the measured height during on-device\n // verification; page padding and bottom-docked toasts both clear it via this token.\n // modalWidth: one width for every dialog so modals read as a single system.\n // controlHeight: the shared single-line height for inputs/select/chips (~33px)\n // so form controls line up on one row. Single source of truth.\n // Where the mobile controls (back button, page actions menu) pin once the page\n // has scrolled them up to it — the `top` of the sticky row `component/page`\n // holds them in. One rule, both contexts (no iOS-unreliable display-mode\n // query): a browser tab has no top safe-area inset, so env() ~ 0 and this\n // resolves to the fixed floor (room for the frosted shadow); in standalone the\n // notch inset dominates and pins the controls below the status bar — by\n // `space.xxxxl`, not the `space.lg` it used to be: `TopFade` blurs across the\n // inset there and a control resting `space.lg` under it read as caught in the\n // blur, so the controls (and the admin picker, which keeps the same gap —\n // `router/nav-layout-style`) rest a clear step below where it ends.\n const floatingControlTopBase = `max(${space.xxxl}, calc(env(safe-area-inset-top) + ${space.xxxxl}))`;\n const layout: Theme['layout'] = {\n navHeightMobile: '96px',\n modalWidth: '500px',\n controlHeight: '2.0625rem',\n floatingControlTopBase,\n };\n const fontSize: Theme['fontSize'] = {\n xxs: '0.6rem',\n xs: '0.7rem',\n sm: '0.75rem',\n md: '0.875rem',\n lg: '1rem',\n xl: '1.25rem',\n xxl: '1.75rem',\n };\n const fontFamily: Theme['fontFamily'] = {\n body: 'system-ui, sans-serif',\n mono: \"'Cascadia Code', 'Fira Code', monospace\",\n };\n const fontWeight: Theme['fontWeight'] = { medium: 500, semibold: 600, bold: 700, extrabold: 800 };\n const lineHeight: Theme['lineHeight'] = { tight: 1, body: 1.3 };\n\n const lightShadow: Theme['shadow'] = {\n card: '0 1px 3px rgba(0,0,0,0.07)',\n cardStack: `0px 2px 0px ${applyTransparency('#D9D9D9', 0.2)}`,\n hoverLift: '0 2px 8px rgba(0,0,0,0.15)',\n dangerStack: `0px 2px 0px ${applyTransparency('#FF4D4F', 0.1)}`,\n brandStack: `0px 2px 0px ${applyTransparency('#1777FF', 0.2)}`,\n glass: `0 8px 32px ${applyTransparency('#000', 0.12)}`,\n glassActive: `0 2px 6px ${applyTransparency('#000', 0.12)}`,\n };\n\n const darkShadow: Theme['shadow'] = {\n card: '0 1px 3px rgba(0,0,0,0.5)',\n cardStack: `0px 2px 0px ${applyTransparency('#000', 0.4)}`,\n hoverLift: '0 2px 8px rgba(0,0,0,0.6)',\n dangerStack: `0px 2px 0px ${applyTransparency('#000', 0.4)}`,\n brandStack: `0px 2px 0px ${applyTransparency('#000', 0.4)}`,\n glass: `0 8px 32px ${applyTransparency('#000', 0.5)}`,\n glassActive: `0 2px 6px ${applyTransparency('#000', 0.5)}`,\n };\n\n const shadow: Theme['shadow'] = mode === 'dark' ? darkShadow : lightShadow;\n\n const transition: Theme['transition'] = {\n fast: '0.1s ease-in',\n medium: '0.2s ease-in',\n slide: '0.2s ease-out',\n slow: '0.3s linear',\n spring: '0.35s cubic-bezier(0.4, 0, 0.2, 1)',\n };\n\n const zIndex: Theme['zIndex'] = {\n behind: -1,\n base: 1,\n stack: { lo: 1, md: 2, hi: 3 },\n header: 10,\n sticky: 1000,\n toast: 9999,\n };\n\n const breakpoint: Theme['breakpoint'] = {\n mobile: '@media (max-width: 640px)',\n normal: '@media (min-width: 641px)',\n };\n\n const recipe: Theme['recipe'] = {\n input: {\n fontFamily: fontFamily.body,\n // Match the select controls (0.80rem); without this, inputs fall back to the\n // smaller browser default and look inconsistent next to selects/chips.\n fontSize: '0.80rem',\n // Restore the 16px floor on mobile: this class-level font-size otherwise\n // out-specifies the global `input` rule and would let iOS auto-zoom on\n // focus. See global-styles.ts.\n [breakpoint.mobile]: { fontSize: '16px' },\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n backgroundColor: color.bg.input,\n borderColor: color.border.default,\n borderStyle: 'solid',\n borderWidth: '1px',\n borderRadius: radius.md,\n padding: space.md,\n '-webkit-appearance': 'none',\n '&:hover': { borderColor: color.border.hover },\n '&:focus': { borderColor: color.border.focus },\n '&$danger': { borderColor: color.border.danger },\n },\n focusRing: {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n label: {\n fontWeight: fontWeight.semibold,\n fontSize: fontSize.md,\n color: color.text.muted,\n display: 'block',\n '&$danger': { color: color.danger.default },\n },\n spinner: {\n animation: 'theme-rotation 1s infinite linear',\n height: '1em',\n width: '1em',\n },\n glass: {\n backgroundColor: color.bg.glass,\n backdropFilter: 'blur(20px) saturate(180%)',\n '-webkit-backdrop-filter': 'blur(20px) saturate(180%)',\n borderStyle: 'solid',\n borderWidth: '1px',\n borderColor: color.border.glass,\n boxShadow: shadow.glass,\n '@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)))': {\n backgroundColor: color.bg.glassFallback,\n },\n },\n glassHighlight: {\n backgroundColor: color.bg.glassActive,\n borderStyle: 'solid',\n borderWidth: '1px',\n borderColor: color.border.glassActive,\n boxShadow: shadow.glassActive,\n },\n row: {\n backgroundColor: color.bg.cardHeader,\n borderRadius: radius.md,\n padding: `${space.md} ${space.lg} ${space.md} ${space.sm}`,\n },\n modal: {\n dialog: {\n cursor: 'default',\n fontFamily: fontFamily.body,\n fontSize: fontSize.lg,\n fontStyle: 'normal',\n letterSpacing: 'normal',\n lineHeight: lineHeight.body,\n textTransform: 'none',\n wordBreak: 'normal',\n overflowWrap: 'break-word',\n borderRadius: radius.lg,\n border: 'none',\n padding: 0,\n overflow: 'hidden',\n // One shared width for every modal; the maxWidth keeps it inside a\n // narrow viewport (the auto side-margins then center it).\n width: layout.modalWidth,\n maxWidth: `calc(100vw - ${space.xxl} * 2)`,\n marginTop: '100px',\n marginLeft: 'auto',\n marginRight: 'auto',\n marginBottom: '50px',\n outline: 'none',\n '&::backdrop': {\n backgroundColor: color.overlay.backdrop,\n backdropFilter: 'blur(2px) saturate(0%)',\n },\n [breakpoint.mobile]: {\n marginTop: `calc(${space.xxxxxl} + env(safe-area-inset-top))`,\n marginBottom: `calc(${space.xxxxxl} + env(safe-area-inset-bottom))`,\n maxHeight: `calc(100dvh - ${space.xxxxxl} * 2 - env(safe-area-inset-top) - env(safe-area-inset-bottom))`,\n overflowY: 'auto',\n },\n },\n header: {\n fontWeight: fontWeight.semibold,\n fontSize: fontSize.xl,\n padding: space.xxl,\n },\n footer: {\n backgroundColor: color.bg.footer,\n borderTopStyle: 'solid',\n borderTopColor: color.border.strong,\n borderTopWidth: '1px',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'end',\n gap: space.md,\n paddingTop: space.xl,\n paddingBottom: space.xl,\n paddingLeft: space.xl,\n paddingRight: space.xl,\n },\n },\n card: {\n shell: {\n backgroundColor: color.bg.card,\n borderRadius: radius.lg,\n borderStyle: 'solid',\n borderWidth: '1px',\n borderColor: color.border.strong,\n overflow: 'hidden',\n boxShadow: shadow.cardStack,\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: `${space.md} ${space.xl}`,\n backgroundColor: color.bg.cardHeader,\n borderBottomStyle: 'solid',\n borderBottomWidth: '1px',\n borderBottomColor: color.border.strong,\n userSelect: 'none',\n '-webkit-user-select': 'none',\n },\n footer: {\n backgroundColor: color.bg.footer,\n borderTopStyle: 'solid',\n borderTopColor: color.border.strong,\n borderTopWidth: '1px',\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'end',\n gap: space.md,\n paddingTop: space.xl,\n paddingBottom: space.xl,\n paddingLeft: space.xl,\n paddingRight: space.xl,\n },\n },\n };\n\n return {\n colorScheme: mode,\n color,\n space,\n radius,\n size,\n layout,\n fontSize,\n fontFamily,\n fontWeight,\n lineHeight,\n shadow,\n transition,\n zIndex,\n breakpoint,\n recipe,\n };\n}\n\nexport const lightTheme: Theme = buildTheme('light');\nexport const darkTheme: Theme = buildTheme('dark');\nexport const defaultTheme: Theme = lightTheme;\n"]}
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,6BAA6B;AAC7B,MAAM,IAAI,GAAG;IACX,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,MAAM;CACH,CAAC;AAEX,MAAM,IAAI,GAAG;IACX,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;CACN,CAAC;AAEX,MAAM,GAAG,GAAG;IACV,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EA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K,CAAC,EAAE;gBACpB,aAAa,EAAE,KAAK,CAAC,EAAE;gBACvB,WAAW,EAAE,KAAK,CAAC,EAAE;gBACrB,YAAY,EAAE,KAAK,CAAC,EAAE;aACvB;SACF;KACF,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,KAAK;QACL,KAAK;QACL,MAAM;QACN,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,UAAU;QACV,UAAU;QACV,UAAU;QACV,MAAM;QACN,UAAU;QACV,MAAM;QACN,UAAU;QACV,MAAM;KACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAU,UAAU,CAAC,OAAO,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,SAAS,GAAU,UAAU,CAAC,MAAM,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,YAAY,GAAU,UAAU,CAAC","sourcesContent":["import { applyTransparency } from '../utils.js';\n\nexport type ThemeMode = 'light' | 'dark';\n\n// ─── Primitive palettes ───\nconst gray = {\n 50: '#FCFCFC',\n 100: '#EEEEEE',\n 150: '#e5e7eb',\n 200: '#DDDDDD',\n 300: '#D9D9D9',\n 400: '#D0D0D0',\n 500: '#9ca3af',\n 600: '#6E6E6E',\n 700: '#5A6375',\n 900: '#111',\n} as const;\n\nconst blue = {\n 50: '#EFF6FF',\n 100: '#dbeafe',\n 200: '#91CAFF',\n 300: '#87BAFF',\n 400: '#3696fe',\n 500: '#1777FF',\n 600: '#1D4ED8',\n 700: '#0758d9',\n 800: '#083FBC',\n} as const;\n\nconst red = {\n 50: '#fff1f0',\n 100: '#FFA8A6',\n 300: '#ff7874',\n 400: '#FF8E8E',\n 500: '#FF4D4F',\n 600: '#e98182',\n 700: '#D9373e',\n} as const;\n\n// JSS-spreadable style fragment. Loose by design: recipes nest pseudo-selectors\n// (`&:hover`) and string/number CSS values, which a stricter type can't capture\n// without inviting more friction than safety it would provide.\ntype Recipe = { [key: string]: Recipe | string | number };\n\n// ─── Theme interface ───\nexport interface Theme {\n colorScheme: ThemeMode;\n color: {\n gray: typeof gray;\n blue: typeof blue;\n red: typeof red;\n text: {\n primary: string;\n secondary: string;\n muted: string;\n faint: string;\n onPrimary: string;\n onDanger: string;\n description: string;\n };\n bg: {\n page: string;\n card: string;\n cardHeader: string;\n /**\n * The rail behind a segmented control's sliding lens. Its own token, not\n * `cardHeader`, because it must read against BOTH `page` and `card` — and\n * in dark mode those sit on either side of `cardHeader`, which left the\n * rail invisible on the page.\n */\n track: string;\n input: string;\n footer: string;\n glass: string;\n glassFallback: string;\n glassActive: string;\n selected: string;\n hover: string;\n success: string;\n placeholder: string;\n };\n border: {\n default: string;\n strong: string;\n light: string;\n focus: string;\n hover: string;\n danger: string;\n glass: string;\n glassActive: string;\n faint: string;\n loading: string;\n success: string;\n section: string;\n };\n success: string;\n /** Solid warning colour for icons and accents. */\n warning: string;\n /** Solid info colour for icons and accents. */\n info: string;\n brand: {\n default: string;\n hover: string;\n active: string;\n light: string;\n outline: string;\n loading: string;\n loadingHover: string;\n loadingActive: string;\n linkHover: string;\n };\n danger: {\n default: string;\n hover: string;\n active: string;\n light: string;\n outline: string;\n loading: string;\n loadingHover: string;\n loadingActive: string;\n };\n overlay: { backdrop: string };\n chip: {\n status: { text: string; bg: string; border: string };\n author: { text: string; bg: string; border: string };\n series: { text: string; bg: string; border: string };\n subject: { text: string; bg: string; border: string };\n book: { text: string; bg: string; border: string };\n entryType: { text: string; bg: string; border: string };\n user: { text: string; bg: string; border: string };\n rating: { text: string; bg: string; border: string };\n // Quiet grey for states that carry no category (e.g. \"no change\"), built\n // from the mode's muted text colour.\n neutral: { text: string; bg: string; border: string };\n // Status tones for state, as opposed to the label tones above.\n success: { text: string; bg: string; border: string };\n warning: { text: string; bg: string; border: string };\n danger: { text: string; bg: string; border: string };\n info: { text: string; bg: string; border: string };\n };\n };\n space: {\n xxxs: string;\n xxs: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n xxl: string;\n xxxl: string;\n xxxxl: string;\n xxxxxl: string;\n };\n radius: { sm: string; md: string; lg: string; circle: string; pill: string };\n size: { metadataValue: string };\n // Intrinsic sizes of chrome that other elements must lay out around. These are\n // measured, not derived (the element's real height comes from its content), so\n // they need on-device tuning — keep the single source of truth here.\n // `floatingControlTopBase` is the odd one out: a POSITION, not a size — see\n // its definition below.\n layout: {\n navHeightMobile: string;\n modalWidth: string;\n controlHeight: string;\n floatingControlTopBase: string;\n };\n fontSize: {\n xxs: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n xxl: string;\n };\n fontFamily: { body: string; mono: string };\n fontWeight: { medium: number; semibold: number; bold: number; extrabold: number };\n lineHeight: { tight: number; body: number };\n shadow: {\n card: string;\n cardStack: string;\n hoverLift: string;\n dangerStack: string;\n brandStack: string;\n glass: string;\n glassActive: string;\n };\n transition: { fast: string; medium: string; slide: string; slow: string; spring: string };\n zIndex: {\n behind: number;\n base: number;\n stack: { lo: number; md: number; hi: number };\n header: number;\n sticky: number;\n toast: number;\n };\n breakpoint: {\n mobile: string;\n normal: string;\n };\n\n // Recipes are JSS-spreadable fragments. Loose typing lets them include\n // pseudo-selectors (`&:hover`) and nested rules without fighting JSS's TS surface.\n recipe: {\n input: Recipe;\n focusRing: Recipe;\n label: Recipe;\n spinner: Recipe;\n glass: Recipe;\n glassHighlight: Recipe;\n /** The shaded field row (`bg.cardHeader`, `md` corners) a control sits in inside a card. */\n row: Recipe;\n modal: {\n dialog: Recipe;\n header: Recipe;\n footer: Recipe;\n };\n card: {\n shell: Recipe;\n header: Recipe;\n footer: Recipe;\n };\n };\n}\n\n// ─── Build defaults ───\nfunction buildTheme(mode: ThemeMode): Theme {\n const lightColor: Theme['color'] = {\n gray,\n blue,\n red,\n text: {\n primary: gray[900],\n secondary: gray[700],\n muted: gray[600],\n faint: gray[500],\n onPrimary: '#FFFFFF',\n onDanger: '#FFFFFF',\n description: '#585863',\n },\n bg: {\n page: '#F6F6F9',\n card: gray[50],\n cardHeader: gray[100],\n // Unchanged from the `cardHeader` this used to borrow: in light mode the\n // track was already a step darker than the page, so light renders as before.\n track: gray[100],\n input: '#FFFFFF',\n footer: gray[100],\n glass: applyTransparency('#FFFFFF', 0.6),\n glassFallback: applyTransparency('#FFFFFF', 0.92),\n glassActive: applyTransparency('#FFFFFF', 0.55),\n selected: blue[100],\n // A translucent scrim, not an opaque grey: hover has to read on whatever\n // surface it lands on. The old '#f0f0f0' was lighter than the modal\n // footer (gray[100]) it was painted over, so hovering a text button\n // there produced no visible change at all.\n hover: applyTransparency('#000000', 0.07),\n success: '#f0fdf4',\n placeholder: '#d1d5db',\n },\n border: {\n default: gray[300],\n strong: gray[200],\n light: gray[150],\n focus: blue[700],\n hover: blue[200],\n danger: red[500],\n glass: applyTransparency('#000', 0.08),\n glassActive: applyTransparency('#FFFFFF', 0.7),\n faint: gray[500],\n loading: '#e6e6e6',\n success: '#bbf7d0',\n section: '#E6E6E9',\n },\n success: '#16a34a',\n warning: '#ca8a04',\n info: blue[500],\n brand: {\n default: blue[500],\n hover: blue[400],\n active: blue[700],\n light: blue[50],\n outline: blue[200],\n loading: '#73A6FF',\n loadingHover: blue[300],\n loadingActive: '#6893e7',\n linkHover: blue[300],\n },\n danger: {\n default: red[500],\n hover: red[300],\n active: red[700],\n light: red[50],\n outline: applyTransparency(red[300], 0.5),\n loading: red[400],\n loadingHover: red[100],\n loadingActive: red[600],\n },\n overlay: { backdrop: applyTransparency('#000', 0.7) },\n chip: {\n status: { text: '#6d3fc0', bg: 'rgba(109,63,192,0.08)', border: 'rgba(109,63,192,0.22)' },\n author: { text: '#1a7a52', bg: 'rgba(26,122,82,0.08)', border: 'rgba(26,122,82,0.22)' },\n series: { text: '#1a5fa8', bg: 'rgba(26,95,168,0.08)', border: 'rgba(26,95,168,0.22)' },\n subject: { text: '#8a5e00', bg: 'rgba(138,94,0,0.08)', border: 'rgba(138,94,0,0.22)' },\n book: { text: '#0e6b7d', bg: 'rgba(14, 107, 125, 0.08)', border: 'rgba(14, 107, 125, 0.22)' },\n entryType: {\n text: '#c0415e',\n bg: 'rgba(192, 65, 94, 0.08)',\n border: 'rgba(192, 65, 94, 0.22)',\n },\n user: { text: '#a23a95', bg: 'rgba(162,58,149,0.08)', border: 'rgba(162,58,149,0.22)' },\n rating: { text: '#b5451b', bg: 'rgba(181,69,27,0.08)', border: 'rgba(181,69,27,0.22)' },\n neutral: {\n text: gray[600],\n bg: applyTransparency(gray[600], 0.08),\n border: applyTransparency(gray[600], 0.22),\n },\n success: {\n text: '#15803d',\n bg: applyTransparency('#16a34a', 0.08),\n border: applyTransparency('#16a34a', 0.22),\n },\n warning: { text: '#854d0e', bg: 'rgba(234,179,8,0.16)', border: 'rgba(202,138,4,0.40)' },\n danger: {\n text: red[700],\n bg: applyTransparency(red[500], 0.08),\n border: applyTransparency(red[500], 0.22),\n },\n info: {\n text: blue[700],\n bg: applyTransparency(blue[500], 0.08),\n border: applyTransparency(blue[500], 0.24),\n },\n },\n };\n\n const darkMuted = '#9CA1AB';\n const darkColor: Theme['color'] = {\n gray,\n blue,\n red,\n text: {\n primary: '#F5F5F7',\n secondary: '#C8CBD2',\n muted: darkMuted,\n faint: '#6E7480',\n onPrimary: '#FFFFFF',\n onDanger: '#FFFFFF',\n description: '#A8ADB6',\n },\n bg: {\n page: '#242527',\n card: '#1A1B1E',\n cardHeader: '#232427',\n // A step LIGHTER than the page, not darker. This palette puts `page`\n // (#242527) above `card`/`input` (#1A1B1E), so the light-mode move —\n // recess the track below the surface — has nowhere to go in dark without\n // colliding with the lens. Raising it instead keeps the same ~8-per-channel\n // separation light mode has, in the only direction that is still free.\n track: '#2C2D31',\n input: '#1A1B1E',\n footer: '#232427',\n glass: applyTransparency('#1C1C1E', 0.6),\n glassFallback: applyTransparency('#1C1C1E', 0.92),\n glassActive: applyTransparency('#2C2C2E', 0.55),\n selected: applyTransparency(blue[500], 0.24),\n hover: applyTransparency('#FFFFFF', 0.12),\n success: applyTransparency('#22C55E', 0.14),\n placeholder: '#2A2B2F',\n },\n border: {\n default: '#3A3B40',\n strong: '#48494F',\n light: '#2B2C30',\n faint: '#3A3B40',\n focus: blue[400],\n hover: blue[600],\n danger: red[500],\n glass: applyTransparency('#FFFFFF', 0.12),\n glassActive: applyTransparency('#FFFFFF', 0.18),\n loading: '#34353A',\n success: applyTransparency('#22C55E', 0.4),\n section: '#2B2C30',\n },\n success: '#22C55E',\n warning: '#EAB308',\n info: blue[400],\n brand: {\n default: blue[400],\n hover: blue[300],\n active: blue[200],\n light: applyTransparency(blue[500], 0.2),\n outline: applyTransparency(blue[400], 0.45),\n linkHover: blue[200],\n loading: '#3E5A8A',\n loadingHover: blue[600],\n loadingActive: '#33507F',\n },\n danger: {\n default: red[500],\n hover: red[400],\n active: red[700],\n light: applyTransparency(red[500], 0.18),\n outline: applyTransparency(red[300], 0.5),\n loading: red[400],\n loadingHover: red[600],\n loadingActive: red[700],\n },\n overlay: { backdrop: applyTransparency('#000', 0.7) },\n chip: {\n status: { text: '#C9B0F2', bg: 'rgba(167,139,250,0.16)', border: 'rgba(167,139,250,0.30)' },\n author: { text: '#7EE6B4', bg: 'rgba(52,211,153,0.16)', border: 'rgba(52,211,153,0.30)' },\n series: { text: '#8EC3F5', bg: 'rgba(96,165,250,0.16)', border: 'rgba(96,165,250,0.30)' },\n subject: { text: '#E8C879', bg: 'rgba(217,168,67,0.16)', border: 'rgba(217,168,67,0.30)' },\n book: { text: '#7FD0DE', bg: 'rgba(45, 170, 190, 0.18)', border: 'rgba(45, 170, 190, 0.32)' },\n entryType: {\n text: '#E89BAC',\n bg: 'rgba(192, 65, 94, 0.18)',\n border: 'rgba(192, 65, 94, 0.32)',\n },\n user: { text: '#E7A6DA', bg: 'rgba(162,58,149,0.16)', border: 'rgba(162,58,149,0.30)' },\n rating: { text: '#F2A07B', bg: 'rgba(181,69,27,0.18)', border: 'rgba(181,69,27,0.32)' },\n // Dark chips run stronger alphas (0.16 / 0.30) than light (0.08 / 0.22).\n neutral: {\n text: darkMuted,\n bg: applyTransparency(darkMuted, 0.16),\n border: applyTransparency(darkMuted, 0.3),\n },\n success: {\n text: '#86EFAC',\n bg: applyTransparency('#22C55E', 0.16),\n border: applyTransparency('#22C55E', 0.3),\n },\n warning: { text: '#FDE047', bg: 'rgba(234,179,8,0.20)', border: 'rgba(234,179,8,0.42)' },\n danger: {\n text: red[400],\n bg: applyTransparency(red[500], 0.16),\n border: applyTransparency(red[500], 0.3),\n },\n info: {\n text: blue[300],\n bg: applyTransparency(blue[400], 0.18),\n border: applyTransparency(blue[400], 0.36),\n },\n },\n };\n\n const color: Theme['color'] = mode === 'dark' ? darkColor : lightColor;\n\n const space: Theme['space'] = {\n xxxs: '0.1rem',\n xxs: '0.125rem',\n xs: '0.25rem',\n sm: '0.375rem',\n md: '0.5rem',\n lg: '0.625rem',\n xl: '0.75rem',\n xxl: '1rem',\n xxxl: '1.25rem',\n xxxxl: '1.5rem',\n xxxxxl: '2rem',\n };\n\n const radius: Theme['radius'] = {\n sm: '4px',\n md: '8px',\n lg: '16px',\n circle: '50%',\n pill: '999px',\n };\n const size: Theme['size'] = { metadataValue: '15rem' };\n // The floating mobile nav capsule is ~96px tall on-device (content + padding +\n // the min bottom floor). Tune against the measured height during on-device\n // verification; page padding and bottom-docked toasts both clear it via this token.\n // modalWidth: one width for every dialog so modals read as a single system.\n // controlHeight: the shared single-line height for inputs/select/chips (~33px)\n // so form controls line up on one row. Single source of truth.\n // Where the mobile controls (back button, page actions menu) pin once the page\n // has scrolled them up to it — the `top` of the sticky row `component/page`\n // holds them in. One rule, both contexts (no iOS-unreliable display-mode\n // query): a browser tab has no top safe-area inset, so env() ~ 0 and this\n // resolves to the fixed floor (room for the frosted shadow); in standalone the\n // notch inset dominates and pins the controls below the status bar — by\n // `space.xxxxl`, not the `space.lg` it used to be: `TopFade` blurs across the\n // inset there and a control resting `space.lg` under it read as caught in the\n // blur, so the controls (and the admin picker, which keeps the same gap —\n // `router/nav-layout-style`) rest a clear step below where it ends.\n const floatingControlTopBase = `max(${space.xxxl}, calc(env(safe-area-inset-top) + ${space.xxxxl}))`;\n const layout: Theme['layout'] = {\n navHeightMobile: '96px',\n modalWidth: '500px',\n controlHeight: '2.0625rem',\n floatingControlTopBase,\n };\n const fontSize: Theme['fontSize'] = {\n xxs: '0.6rem',\n xs: '0.7rem',\n sm: '0.75rem',\n md: '0.875rem',\n lg: '1rem',\n xl: '1.25rem',\n xxl: '1.75rem',\n };\n const fontFamily: Theme['fontFamily'] = {\n body: 'system-ui, sans-serif',\n mono: \"'Cascadia Code', 'Fira Code', monospace\",\n };\n const fontWeight: Theme['fontWeight'] = { medium: 500, semibold: 600, bold: 700, extrabold: 800 };\n const lineHeight: Theme['lineHeight'] = { tight: 1, body: 1.3 };\n\n const lightShadow: Theme['shadow'] = {\n card: '0 1px 3px rgba(0,0,0,0.07)',\n cardStack: `0px 2px 0px ${applyTransparency('#D9D9D9', 0.2)}`,\n hoverLift: '0 2px 8px rgba(0,0,0,0.15)',\n dangerStack: `0px 2px 0px ${applyTransparency('#FF4D4F', 0.1)}`,\n brandStack: `0px 2px 0px ${applyTransparency('#1777FF', 0.2)}`,\n glass: `0 8px 32px ${applyTransparency('#000', 0.12)}`,\n glassActive: `0 2px 6px ${applyTransparency('#000', 0.12)}`,\n };\n\n const darkShadow: Theme['shadow'] = {\n card: '0 1px 3px rgba(0,0,0,0.5)',\n cardStack: `0px 2px 0px ${applyTransparency('#000', 0.4)}`,\n hoverLift: '0 2px 8px rgba(0,0,0,0.6)',\n dangerStack: `0px 2px 0px ${applyTransparency('#000', 0.4)}`,\n brandStack: `0px 2px 0px ${applyTransparency('#000', 0.4)}`,\n glass: `0 8px 32px ${applyTransparency('#000', 0.5)}`,\n glassActive: `0 2px 6px ${applyTransparency('#000', 0.5)}`,\n };\n\n const shadow: Theme['shadow'] = mode === 'dark' ? darkShadow : lightShadow;\n\n const transition: Theme['transition'] = {\n fast: '0.1s ease-in',\n medium: '0.2s ease-in',\n slide: '0.2s ease-out',\n slow: '0.3s linear',\n spring: '0.35s cubic-bezier(0.4, 0, 0.2, 1)',\n };\n\n const zIndex: Theme['zIndex'] = {\n behind: -1,\n base: 1,\n stack: { lo: 1, md: 2, hi: 3 },\n header: 10,\n sticky: 1000,\n toast: 9999,\n };\n\n const breakpoint: Theme['breakpoint'] = {\n mobile: '@media (max-width: 640px)',\n normal: '@media (min-width: 641px)',\n };\n\n const recipe: Theme['recipe'] = {\n input: {\n fontFamily: fontFamily.body,\n // Match the select controls (0.80rem); without this, inputs fall back to the\n // smaller browser default and look inconsistent next to selects/chips.\n fontSize: '0.80rem',\n // Restore the 16px floor on mobile: this class-level font-size otherwise\n // out-specifies the global `input` rule and would let iOS auto-zoom on\n // focus. See global-styles.ts.\n [breakpoint.mobile]: { fontSize: '16px' },\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n backgroundColor: color.bg.input,\n borderColor: color.border.default,\n borderStyle: 'solid',\n borderWidth: '1px',\n borderRadius: radius.md,\n padding: space.md,\n '-webkit-appearance': 'none',\n '&:hover': { borderColor: color.border.hover },\n '&:focus': { borderColor: color.border.focus },\n '&$danger': { borderColor: color.border.danger },\n },\n focusRing: {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n label: {\n fontWeight: fontWeight.semibold,\n fontSize: fontSize.md,\n color: color.text.muted,\n display: 'block',\n '&$danger': { color: color.danger.default },\n },\n spinner: {\n animation: 'theme-rotation 1s infinite linear',\n height: '1em',\n width: '1em',\n },\n glass: {\n backgroundColor: color.bg.glass,\n backdropFilter: 'blur(20px) saturate(180%)',\n '-webkit-backdrop-filter': 'blur(20px) saturate(180%)',\n borderStyle: 'solid',\n borderWidth: '1px',\n borderColor: color.border.glass,\n boxShadow: shadow.glass,\n '@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)))': {\n backgroundColor: color.bg.glassFallback,\n },\n },\n glassHighlight: {\n backgroundColor: color.bg.glassActive,\n borderStyle: 'solid',\n borderWidth: '1px',\n borderColor: color.border.glassActive,\n boxShadow: shadow.glassActive,\n },\n row: {\n backgroundColor: color.bg.cardHeader,\n borderRadius: radius.md,\n padding: `${space.md} ${space.lg} ${space.md} ${space.sm}`,\n },\n modal: {\n dialog: {\n cursor: 'default',\n fontFamily: fontFamily.body,\n fontSize: fontSize.lg,\n fontStyle: 'normal',\n letterSpacing: 'normal',\n lineHeight: lineHeight.body,\n textTransform: 'none',\n wordBreak: 'normal',\n overflowWrap: 'break-word',\n borderRadius: radius.lg,\n border: 'none',\n padding: 0,\n overflow: 'hidden',\n // One shared width for every modal; the maxWidth keeps it inside a\n // narrow viewport (the auto side-margins then center it).\n width: layout.modalWidth,\n maxWidth: `calc(100vw - ${space.xxl} * 2)`,\n marginTop: '100px',\n marginLeft: 'auto',\n marginRight: 'auto',\n marginBottom: '50px',\n outline: 'none',\n '&::backdrop': {\n backgroundColor: color.overlay.backdrop,\n backdropFilter: 'blur(2px) saturate(0%)',\n },\n [breakpoint.mobile]: {\n marginTop: `calc(${space.xxxxxl} + env(safe-area-inset-top))`,\n marginBottom: `calc(${space.xxxxxl} + env(safe-area-inset-bottom))`,\n maxHeight: `calc(100dvh - ${space.xxxxxl} * 2 - env(safe-area-inset-top) - env(safe-area-inset-bottom))`,\n overflowY: 'auto',\n },\n },\n header: {\n fontWeight: fontWeight.semibold,\n fontSize: fontSize.xl,\n padding: space.xxl,\n },\n footer: {\n backgroundColor: color.bg.footer,\n borderTopStyle: 'solid',\n borderTopColor: color.border.strong,\n borderTopWidth: '1px',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'end',\n gap: space.md,\n paddingTop: space.xl,\n paddingBottom: space.xl,\n paddingLeft: space.xl,\n paddingRight: space.xl,\n },\n },\n card: {\n shell: {\n backgroundColor: color.bg.card,\n borderRadius: radius.lg,\n borderStyle: 'solid',\n borderWidth: '1px',\n borderColor: color.border.strong,\n overflow: 'hidden',\n boxShadow: shadow.cardStack,\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: `${space.md} ${space.xl}`,\n backgroundColor: color.bg.cardHeader,\n borderBottomStyle: 'solid',\n borderBottomWidth: '1px',\n borderBottomColor: color.border.strong,\n userSelect: 'none',\n '-webkit-user-select': 'none',\n },\n footer: {\n backgroundColor: color.bg.footer,\n borderTopStyle: 'solid',\n borderTopColor: color.border.strong,\n borderTopWidth: '1px',\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'end',\n gap: space.md,\n paddingTop: space.xl,\n paddingBottom: space.xl,\n paddingLeft: space.xl,\n paddingRight: space.xl,\n },\n },\n };\n\n return {\n colorScheme: mode,\n color,\n space,\n radius,\n size,\n layout,\n fontSize,\n fontFamily,\n fontWeight,\n lineHeight,\n shadow,\n transition,\n zIndex,\n breakpoint,\n recipe,\n };\n}\n\nexport const lightTheme: Theme = buildTheme('light');\nexport const darkTheme: Theme = buildTheme('dark');\nexport const defaultTheme: Theme = lightTheme;\n"]}
@@ -46,7 +46,7 @@ No `className`.
46
46
  { title: 'Slug', value: device.slug },
47
47
  { title: 'Cover size', value: `${device.coverWidth}×${device.coverHeight}` },
48
48
  { title: 'Grayscale cover', value: device.bwCover ? 'Yes' : 'No' },
49
- { title: 'Status', value: <Tag size="sm" tone="status">Active</Tag> },
49
+ { title: 'Status', value: <Tag size="sm" tone="success">Active</Tag> },
50
50
  ]}
51
51
  />
52
52
  </Card>
@@ -23,12 +23,26 @@ No `className`, no `ariaLabel`.
23
23
 
24
24
  ## Choosing a tone
25
25
 
26
- `TagTone` is `keyof Theme['color']['chip']`, so the tones are **domain names**,
27
- not colour names. Pick by what the tag *is*:
26
+ `TagTone` is `keyof Theme['color']['chip']`. There are two groups: label tones
27
+ are **domain names** (what kind of thing the tag names) and status tones are
28
+ **meanings** (what state it reports). Neither group is a set of colour names:
29
+ never pick a tone for its colour. Pick by what the tag *is*:
30
+
31
+ Status tones report a state:
32
+
33
+ | Tone | Use for |
34
+ |---|---|
35
+ | `success` | Something went well (Published, Paid). |
36
+ | `warning` | Needs attention soon (Overdue, Expiring). |
37
+ | `danger` | Something failed or is blocked (Failed, Rejected). |
38
+ | `info` | Neutral news (Scheduled, New). |
39
+ | `neutral` | A state with no category ("no change"): quiet grey. |
40
+
41
+ Label tones name a kind of thing:
28
42
 
29
43
  | Tone | Use for |
30
44
  |---|---|
31
- | `status` | A state (Pending, Active, Read only). |
45
+ | `status` | Legacy; kept for Bookplate's existing chips. Don't pick it for new state tags. |
32
46
  | `author` | A person who wrote something. |
33
47
  | `series` | A series name. |
34
48
  | `subject` | A subject / genre / keyword. The default. |
@@ -36,7 +50,8 @@ not colour names. Pick by what the tag *is*:
36
50
  | `entryType` | The kind of an entry or record. |
37
51
  | `user` | An app user / account. |
38
52
  | `rating` | A rating value. |
39
- | `neutral` | A state with no category ("no change"): quiet grey. |
53
+
54
+ Note the name clash: `status` is a legacy label tone despite its name; for a state use `success`/`warning`/`danger`/`info`, or `neutral` when it carries no meaning.
40
55
 
41
56
  Each tone has its own `text`, `bg`, and `border` in both light and dark themes.
42
57
  A consumer's theme can't add tones; the list is fixed by the `Theme` type.
@@ -52,8 +67,8 @@ A consumer's theme can't add tones; the list is fixed by the `Theme` type.
52
67
  // Compact chips in a review row (inside a card).
53
68
  {fix.toChips.map((c) => <Tag key={c} size="sm">{c}</Tag>)}
54
69
 
55
- // A status, in neutral or status tone.
56
- <Tag size="sm" tone="status">{write ? 'Read & write' : 'Read only'}</Tag>
70
+ // A state with no meaning to signal: neutral.
71
+ <Tag size="sm" tone="neutral">{write ? 'Read & write' : 'Read only'}</Tag>
57
72
 
58
73
  // A clickable author chip that filters the list.
59
74
  <Tag tone="author" onClick={() => setFilter({ author: name })}>{name}</Tag>
@@ -63,7 +78,12 @@ A consumer's theme can't add tones; the list is fixed by the `Theme` type.
63
78
 
64
79
  - Do choose `tone` by meaning, so the same kind of thing is the same colour
65
80
  everywhere.
81
+ - Do use `tone="warning"` for "Overdue".
66
82
  - Do use `size="sm"` inside text rows and lists.
67
83
  - Don't use `neutral` just to make a tag grey when it has a category.
84
+ - Don't use `subject` or `author` to mean warning or success.
85
+ - Don't use `info` to look like a link (it shares a hue with links; use
86
+ `Button type="link"` for actions).
87
+ - Don't use `status` for a new state tag; it is a legacy label tone.
68
88
  - Don't nest a clickable Tag inside another clickable element (Button, a
69
89
  clickable Card); both would fire.
@@ -3,7 +3,7 @@
3
3
  `import { Popover } from '@korzun/design/control'`
4
4
 
5
5
  A positioning primitive: renders `children` in a portal on `document.body`,
6
- `position: fixed` directly beneath an anchor element, so a dropdown can escape
6
+ `position: fixed` below or above an anchor element, so a dropdown can escape
7
7
  ancestors that clip overflow (rounded cards). It paints **nothing** itself: no
8
8
  background, border, shadow, or radius. `Select` and `ChipsInput` build their
9
9
  dropdowns on it.
@@ -15,24 +15,53 @@ Use something else for: a modal (`useModalDialog`), page action menus
15
15
 
16
16
  | Prop | Type | Default | Notes |
17
17
  |---|---|---|---|
18
- | `anchorRef` | `RefObject<HTMLElement \| null>` | (required) | Element to sit under. Left edges align. |
18
+ | `anchorRef` | `RefObject<HTMLElement \| null>` | (required) | Element to place against. |
19
19
  | `open` | `boolean` | (required) | When `false`, renders nothing. Fully controlled. |
20
20
  | `children` | `ReactNode` | (required) | Your surface: give it its own background, border, radius. |
21
- | `gap` | `number` | `4` | Pixels between the anchor's bottom and the popover. |
21
+ | `side` | `'bottom' \| 'top'` | `'bottom'` | Preferred side; flips to the other side when this one has no room. |
22
+ | `align` | `'start' \| 'center' \| 'end'` | `'start'` | Horizontal alignment to the anchor's left edge, centre, or right edge. |
23
+ | `gap` | `number` | `4` | Pixels between the anchor and the popover; also the margin kept from the viewport's left and right edges when `matchWidth` is false. |
22
24
  | `matchWidth` | `boolean` | `true` | Width = anchor width. `false` lets content size itself. |
23
- | `onClose` | `() => void` | | Called on a mousedown outside both anchor and content. Omit to opt out. Receives no event. |
25
+ | `onClose` | `() => void` | | Called on a mousedown outside both anchor and content, and on Escape (see below). Omit to opt out of both. Receives no event. |
24
26
  | `className` | `string` | | Applied to the fixed wrapper. Override with `'&&'`, never `!important`. |
25
27
 
26
28
  ## Behaviour to know
27
29
 
28
- - **No Escape handling and no focus management.** Add your own keydown handler
29
- if Escape should close it.
30
- - Always opens below the anchor; it does not flip up or clamp to the viewport.
31
- It repositions on window resize and on any scroll (capture phase).
32
- - First paint is skipped until the anchor is measured, so it never flashes at 0,0.
30
+ - **Flip.** It opens on `side`. If the content does not fit on that side and
31
+ the other side has more room, it opens on the other side. When neither side
32
+ fits it keeps whichever has more room.
33
+ - **Clamp.** Only when `matchWidth` is false: `left` is clamped so the
34
+ content stays `gap` pixels inside the viewport's left and right edges;
35
+ content wider than the viewport pins to `gap`. With `matchWidth` (the
36
+ default) it lines up with the anchor exactly, edge margin or not. There is
37
+ no vertical clamp.
38
+ - **Top side is anchored by its bottom edge** (CSS `bottom`), so a popover
39
+ above its anchor stays attached when its content grows or shrinks.
40
+ - **`data-side`.** The wrapper carries `data-side="bottom"` or `"top"`: the side
41
+ actually used after flipping. Style against it (an arrow, an animation
42
+ origin) rather than against the `side` prop.
43
+ - It re-measures, flip decision included, on window resize, on any scroll
44
+ (capture phase), and when its content resizes (`ResizeObserver`, where the
45
+ browser has it), so it stays attached to a scrolled anchor and to content
46
+ that changes size.
47
+ - Its first render is transparent (`opacity: 0`) and is measured in a layout
48
+ effect before paint, so it never flashes at 0,0 or on the wrong side. It is
49
+ not `visibility: hidden`, so an `autoFocus` child takes focus on mount.
50
+ - **Escape.** With `onClose`, an Escape keydown anywhere in the document calls
51
+ `onClose`, unless the event is already `defaultPrevented` (a control such as
52
+ `Select` handled it first). It calls `preventDefault()` on the key, so an
53
+ enclosing native `<dialog>` does not also fire `cancel` and close.
54
+ - **Nested popovers.** Each open popover listens on the document, so with
55
+ nested popovers Escape is taken by the one opened first (the outermost),
56
+ not the innermost. A proper layer stack comes with `Menu`.
57
+ - **No focus management.** Focus stays where it was; return it yourself if
58
+ closing should move it.
33
59
  - z-index is `theme.zIndex.sticky` (1000). Inside a modal `<dialog>` opened with
34
60
  `showModal()`, a body portal sits outside the dialog's top layer, so it is
35
61
  likely hidden behind the dialog and inert. Test before using it there.
62
+ The reverse also bites: an open popover left behind a `showModal()` dialog
63
+ still takes Escape first, so the dialog does not close. Close popovers
64
+ before opening a dialog.
36
65
  - Clicking the anchor does not count as "outside", so a toggle button on the
37
66
  anchor works without racing `onClose`.
38
67
 
@@ -71,4 +100,6 @@ const [open, setOpen] = useState(false);
71
100
 
72
101
  - Do wrap a `Button` in a `<div ref>` to anchor it; `Button` takes no ref.
73
102
  - Do give the content its own surface and radius; the wrapper is transparent.
74
- - Don't expect it to close on Escape or on selection; that is your code.
103
+ - Do call `preventDefault()` in your own Escape handler if you close the
104
+ popover yourself, so `onClose` is not called a second time.
105
+ - Don't expect it to close on selection; that is your code.
package/docs/theme.md CHANGED
@@ -61,8 +61,10 @@ export const useStyle = createUseStyles((theme: Theme) => ({
61
61
  | `color.border` | `default`, `strong`, `light`, `focus`, `hover`, `danger`, `glass`, `glassActive`, `faint`, `loading`, `success`, `section` | Cards and dividers use `strong`; inputs use `default` |
62
62
  | `color.brand` | `default`, `hover`, `active`, `light`, `outline`, `loading*`, `linkHover` | The primary action colour |
63
63
  | `color.danger` | `default`, `hover`, `active`, `light`, `outline`, `loading*` | Destructive actions and errors |
64
- | `color.success` | (a string) | There are no warning or info colours yet |
65
- | `color.chip.<tone>` | `{ text, bg, border }` for `status`, `author`, `series`, `subject`, `book`, `entryType`, `user`, `rating`, `neutral` | Used by `Tag` |
64
+ | `color.success` | (a string) | Solid green |
65
+ | `color.warning` | (a string) | Solid amber |
66
+ | `color.info` | (a string) | Solid blue, the mode's `brand.default` |
67
+ | `color.chip.<tone>` | `{ text, bg, border }` for 13 tones. Status tones: `success`, `warning`, `danger`, `info`, `neutral`. Label tones: `status`, `author`, `series`, `subject`, `book`, `entryType`, `user`, `rating` | Used by `Tag` |
66
68
  | `color.overlay` | `backdrop` | Modal backdrop |
67
69
  | `color.gray` / `blue` / `red` | primitive scales | Don't use these in app code; use the semantic tokens above |
68
70
  | `space` | `xxxs` 0.1rem, `xxs` 0.125, `xs` 0.25, `sm` 0.375, `md` 0.5, `lg` 0.625, `xl` 0.75, `xxl` 1, `xxxl` 1.25, `xxxxl` 1.5, `xxxxxl` 2rem | `md` is the default gap between stacked fields |
package/docs/tokens.md CHANGED
@@ -14,11 +14,11 @@ Surfaces, text, borders and state colours, mode-aware. Keys are grouped as follo
14
14
  - `color.text`: `primary secondary muted faint onPrimary onDanger description`
15
15
  - `color.bg`: `page card cardHeader track input footer glass glassFallback glassActive selected hover success placeholder`. `track` must read against both `page` and `card`; `hover` is a translucent scrim; `glass*` feed `recipe.glass`.
16
16
  - `color.border`: `default strong light focus hover danger glass glassActive faint loading success section`
17
- - `color.success`: a single value.
17
+ - `color.success`, `color.warning`, `color.info`: a single value each.
18
18
  - `color.brand`: `default hover active light outline loading loadingHover loadingActive linkHover`
19
19
  - `color.danger`: `default hover active light outline loading loadingHover loadingActive`
20
20
  - `color.overlay`: `backdrop`
21
- - `color.chip`: eight tinted label colourways, each `{ text, bg, border }`: `status author series subject book entryType user rating`. See Slated for curation.
21
+ - `color.chip`: thirteen tinted colourways, each `{ text, bg, border }`. Status tones: `success warning danger info neutral`. Label tones: `status author series subject book entryType user rating` (the `status` label tone is not a status tone). See Slated for curation.
22
22
 
23
23
  ## space
24
24
 
@@ -90,7 +90,7 @@ JSS-spreadable style fragments (`...theme.recipe.x`), not components.
90
90
 
91
91
  Both groups below move into the package byte-for-byte in 0.0.1 and are due for a decision before the API settles.
92
92
 
93
- - `color.chip.*`: eight colourways (`status author series subject book entryType user rating`) named after Bookplate's metadata chips, not after a general role.
93
+ - `color.chip.*`: the eight label colourways (`status author series subject book entryType user rating`) are named after Bookplate's metadata chips, not after a general role.
94
94
  - `size.metadataValue`: `15rem`, a width named after Bookplate's metadata display.
95
95
 
96
96
  No other token name or comment in `src/theme/theme.ts` is clearly Bookplate-specific. Two comments mention app internals (`floatingControlTopBase` refers to the admin picker and `router/nav-layout-style`), but the tokens themselves are generic.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korzun/design",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -11,7 +11,7 @@ export interface TagProps {
11
11
  onClick?: () => void;
12
12
  /** `sm` renders a compact chip that fits within a normal text line height. Default `'md'`. */
13
13
  size?: 'sm' | 'md';
14
- /** Colour, from the theme's `color.chip` tokens (default `'subject'`). `neutral` is a quiet grey. */
14
+ /** Colour, from the theme's `color.chip` tokens. Status tones (`success`, `warning`, `danger`, `info`, `neutral`) report state; label tones (the rest) name a kind of thing. `status` is a legacy label tone despite its name; for a state use `success`/`warning`/`danger`/`info`, or `neutral` when it carries no meaning. Default `subject`. */
15
15
  tone?: TagTone;
16
16
  }
17
17
 
@@ -27,7 +27,12 @@ export {
27
27
  type FooterAction,
28
28
  type PageFooterActionsProps,
29
29
  } from './page-footer-actions/index.js';
30
- export { Popover, type PopoverProps } from './popover/index.js';
30
+ export {
31
+ Popover,
32
+ type PopoverAlign,
33
+ type PopoverProps,
34
+ type PopoverSide,
35
+ } from './popover/index.js';
31
36
  export { Select, type SelectOption, type SelectProps } from './select/index.js';
32
37
  export {
33
38
  SegmentedControl,
@@ -10,12 +10,18 @@ import {
10
10
  } from 'react';
11
11
  import { createPortal } from 'react-dom';
12
12
 
13
+ import {
14
+ computePosition,
15
+ type Placement,
16
+ type PopoverAlign,
17
+ type PopoverSide,
18
+ } from './position.js';
13
19
  import { useStyle } from './style.js';
14
20
 
15
- type Position = { top: number; left: number; width: number };
21
+ export type { PopoverAlign, PopoverSide } from './position.js';
16
22
 
17
23
  export type PopoverProps = {
18
- /** Element the popover aligns to (positioned directly beneath it). */
24
+ /** Element the popover aligns to (placed below or above it, per `side`). */
19
25
  anchorRef: RefObject<HTMLElement | null>;
20
26
  /** Whether the popover is rendered. */
21
27
  open: boolean;
@@ -23,24 +29,38 @@ export type PopoverProps = {
23
29
  children: ReactNode;
24
30
  /** Applied to the fixed wrapper; win specificity with `'&&'`, never `!important`. */
25
31
  className?: string;
26
- /** Vertical gap between the anchor and the popover, in pixels. */
32
+ /** Vertical gap between the anchor and the popover, in pixels; also the viewport edge margin when `matchWidth` is false. */
27
33
  gap?: number;
28
34
  /** Match the popover width to the anchor width (default true). */
29
35
  matchWidth?: boolean;
36
+ /** Preferred side; flips to the other side when this one has no room. */
37
+ side?: PopoverSide;
38
+ /** Horizontal alignment to the anchor's left edge, centre, or right edge. */
39
+ align?: PopoverAlign;
30
40
  /**
31
- * Called on a pointer-down outside both the anchor and the popover content.
32
- * Omit to opt out of outside-close handling.
41
+ * Called on a pointer-down outside both the anchor and the popover content,
42
+ * and on an Escape keydown no control has already handled. Omit to opt out.
33
43
  */
34
44
  onClose?: () => void;
35
45
  };
36
46
 
37
47
  /**
38
48
  * Renders `children` in a portal on `document.body`, positioned with `fixed`
39
- * coordinates directly under `anchorRef`. This lets dropdowns escape ancestors
40
- * that clip overflow (e.g. cards with rounded corners) without those ancestors
49
+ * coordinates against `anchorRef`. This lets dropdowns escape ancestors that
50
+ * clip overflow (e.g. cards with rounded corners) without those ancestors
41
51
  * having to opt out of clipping.
42
52
  *
43
- * No Escape handling or focus management, and it never flips above the anchor.
53
+ * Opens on `side` (default below) and flips when that side has no room; aligns
54
+ * per `align` and clamps horizontally to the viewport (only without
55
+ * `matchWidth`). The wrapper carries `data-side` with the side actually used.
56
+ * On the top side it is anchored by CSS `bottom`, so it stays attached as its
57
+ * content changes height. The first render is transparent (`opacity: 0`, still
58
+ * focusable) until measured, then it re-measures on scroll (capture phase),
59
+ * window resize, and content resize (`ResizeObserver`, where available).
60
+ *
61
+ * With `onClose`, Escape closes it unless the keydown was already
62
+ * `defaultPrevented`; it calls `preventDefault` so an enclosing `<dialog>`
63
+ * does not also cancel. No focus management.
44
64
  */
45
65
  export const Popover = ({
46
66
  anchorRef,
@@ -49,18 +69,34 @@ export const Popover = ({
49
69
  className,
50
70
  gap = 4,
51
71
  matchWidth = true,
72
+ side = 'bottom',
73
+ align = 'start',
52
74
  onClose,
53
75
  }: PopoverProps) => {
54
76
  const style = useStyle();
55
77
  const contentRef = useRef<HTMLDivElement>(null);
56
- const [position, setPosition] = useState<Position | null>(null);
78
+ const [placement, setPlacement] = useState<Placement | null>(null);
57
79
 
58
80
  const updatePosition = useCallback(() => {
59
81
  const anchor = anchorRef.current;
60
- if (!anchor) return;
82
+ const content = contentRef.current;
83
+ if (!anchor || !content) return;
61
84
  const rect = anchor.getBoundingClientRect();
62
- setPosition({ top: rect.bottom + gap, left: rect.left, width: rect.width });
63
- }, [anchorRef, gap]);
85
+ // Measure at the width it will render with, so wrapped height is right.
86
+ if (matchWidth) content.style.width = `${rect.width}px`;
87
+ const size = content.getBoundingClientRect();
88
+ setPlacement(
89
+ computePosition({
90
+ anchor: rect,
91
+ content: { width: size.width, height: size.height },
92
+ viewport: { width: window.innerWidth, height: window.innerHeight },
93
+ side,
94
+ align,
95
+ gap,
96
+ matchWidth,
97
+ })
98
+ );
99
+ }, [anchorRef, gap, matchWidth, side, align]);
64
100
 
65
101
  useLayoutEffect(() => {
66
102
  if (!open) return;
@@ -69,9 +105,13 @@ export const Popover = ({
69
105
  // Capture-phase scroll so nested scroll containers reposition too.
70
106
  window.addEventListener('scroll', handle, true);
71
107
  window.addEventListener('resize', handle);
108
+ const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(handle) : undefined;
109
+ if (observer && contentRef.current) observer.observe(contentRef.current);
72
110
  return () => {
73
111
  window.removeEventListener('scroll', handle, true);
74
112
  window.removeEventListener('resize', handle);
113
+ observer?.disconnect();
114
+ setPlacement(null);
75
115
  };
76
116
  }, [open, updatePosition]);
77
117
 
@@ -83,21 +123,39 @@ export const Popover = ({
83
123
  if (contentRef.current?.contains(target)) return;
84
124
  onClose();
85
125
  };
126
+ const handleKeyDown = (event: KeyboardEvent) => {
127
+ if (event.key !== 'Escape' || event.defaultPrevented) return;
128
+ // preventDefault on keydown is what stops a native <dialog> from cancelling.
129
+ event.preventDefault();
130
+ onClose();
131
+ };
86
132
  document.addEventListener('mousedown', handleMouseDown);
87
- return () => document.removeEventListener('mousedown', handleMouseDown);
133
+ document.addEventListener('keydown', handleKeyDown);
134
+ return () => {
135
+ document.removeEventListener('mousedown', handleMouseDown);
136
+ document.removeEventListener('keydown', handleKeyDown);
137
+ };
88
138
  }, [open, onClose, anchorRef]);
89
139
 
90
- if (!open || !position) return null;
140
+ if (!open) return null;
91
141
 
92
142
  return createPortal(
93
143
  <div
94
144
  ref={contentRef}
95
145
  className={cx(style.popover, className)}
96
- style={{
97
- top: position.top,
98
- left: position.left,
99
- width: matchWidth ? position.width : undefined,
100
- }}
146
+ data-side={placement?.side}
147
+ style={
148
+ placement
149
+ ? {
150
+ top: placement.top,
151
+ bottom: placement.bottom,
152
+ left: placement.left,
153
+ width: placement.width,
154
+ }
155
+ : // Never painted: the layout effect measures and re-renders first.
156
+ // Opacity, not visibility, so an autoFocus child can take focus.
157
+ { top: 0, left: 0, opacity: 0 }
158
+ }
101
159
  >
102
160
  {children}
103
161
  </div>,