@korzun/design 0.0.6 → 0.2.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.
Files changed (89) hide show
  1. package/AGENTS.md +11 -4
  2. package/dist/component/heading/index.d.ts +303 -0
  3. package/dist/component/heading/index.d.ts.map +1 -0
  4. package/dist/component/heading/index.js +21 -0
  5. package/dist/component/heading/index.js.map +1 -0
  6. package/dist/component/heading/style.d.ts +5 -0
  7. package/dist/component/heading/style.d.ts.map +1 -0
  8. package/dist/component/heading/style.js +5 -0
  9. package/dist/component/heading/style.js.map +1 -0
  10. package/dist/component/index.d.ts +4 -0
  11. package/dist/component/index.d.ts.map +1 -1
  12. package/dist/component/index.js +4 -0
  13. package/dist/component/index.js.map +1 -1
  14. package/dist/component/inline/index.d.ts +303 -0
  15. package/dist/component/inline/index.d.ts.map +1 -0
  16. package/dist/component/inline/index.js +13 -0
  17. package/dist/component/inline/index.js.map +1 -0
  18. package/dist/component/inline/style.d.ts +5 -0
  19. package/dist/component/inline/style.d.ts.map +1 -0
  20. package/dist/component/inline/style.js +18 -0
  21. package/dist/component/inline/style.js.map +1 -0
  22. package/dist/component/stack/gap.d.ts +4 -0
  23. package/dist/component/stack/gap.d.ts.map +1 -0
  24. package/dist/component/stack/gap.js +10 -0
  25. package/dist/component/stack/gap.js.map +1 -0
  26. package/dist/component/stack/index.d.ts +299 -0
  27. package/dist/component/stack/index.d.ts.map +1 -0
  28. package/dist/component/stack/index.js +13 -0
  29. package/dist/component/stack/index.js.map +1 -0
  30. package/dist/component/stack/style.d.ts +5 -0
  31. package/dist/component/stack/style.d.ts.map +1 -0
  32. package/dist/component/stack/style.js +12 -0
  33. package/dist/component/stack/style.js.map +1 -0
  34. package/dist/component/tag/index.d.ts +1 -1
  35. package/dist/component/tag/index.d.ts.map +1 -1
  36. package/dist/component/tag/index.js.map +1 -1
  37. package/dist/component/tag/style.d.ts +1 -1
  38. package/dist/component/tag/style.d.ts.map +1 -1
  39. package/dist/component/text/index.d.ts +307 -0
  40. package/dist/component/text/index.d.ts.map +1 -0
  41. package/dist/component/text/index.js +15 -0
  42. package/dist/component/text/index.js.map +1 -0
  43. package/dist/component/text/style.d.ts +11 -0
  44. package/dist/component/text/style.d.ts.map +1 -0
  45. package/dist/component/text/style.js +48 -0
  46. package/dist/component/text/style.js.map +1 -0
  47. package/dist/control/index.d.ts +1 -1
  48. package/dist/control/index.d.ts.map +1 -1
  49. package/dist/control/index.js +1 -1
  50. package/dist/control/index.js.map +1 -1
  51. package/dist/control/popover/index.d.ts +24 -8
  52. package/dist/control/popover/index.d.ts.map +1 -1
  53. package/dist/control/popover/index.js +60 -15
  54. package/dist/control/popover/index.js.map +1 -1
  55. package/dist/control/popover/position.d.ts +47 -0
  56. package/dist/control/popover/position.d.ts.map +1 -0
  57. package/dist/control/popover/position.js +29 -0
  58. package/dist/control/popover/position.js.map +1 -0
  59. package/dist/theme/theme.d.ts +25 -0
  60. package/dist/theme/theme.d.ts.map +1 -1
  61. package/dist/theme/theme.js +43 -1
  62. package/dist/theme/theme.js.map +1 -1
  63. package/docs/component/heading.md +85 -0
  64. package/docs/component/inline.md +64 -0
  65. package/docs/component/meta-line.md +13 -17
  66. package/docs/component/metadata-list.md +1 -1
  67. package/docs/component/stack.md +68 -0
  68. package/docs/component/tag.md +26 -6
  69. package/docs/component/text.md +94 -0
  70. package/docs/control/popover.md +41 -10
  71. package/docs/patterns.md +28 -9
  72. package/docs/theme.md +10 -9
  73. package/docs/tokens.md +4 -4
  74. package/package.json +1 -1
  75. package/src/component/heading/index.tsx +64 -0
  76. package/src/component/heading/style.ts +5 -0
  77. package/src/component/index.ts +4 -0
  78. package/src/component/inline/index.tsx +57 -0
  79. package/src/component/inline/style.ts +18 -0
  80. package/src/component/stack/gap.ts +16 -0
  81. package/src/component/stack/index.tsx +49 -0
  82. package/src/component/stack/style.ts +12 -0
  83. package/src/component/tag/index.tsx +1 -1
  84. package/src/component/text/index.tsx +61 -0
  85. package/src/component/text/style.ts +67 -0
  86. package/src/control/index.ts +6 -1
  87. package/src/control/popover/index.tsx +77 -19
  88. package/src/control/popover/position.ts +66 -0
  89. package/src/theme/theme.ts +59 -2
@@ -2,26 +2,50 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import cx from 'classnames';
3
3
  import { useCallback, useEffect, useLayoutEffect, useRef, useState, } from 'react';
4
4
  import { createPortal } from 'react-dom';
5
+ import { computePosition, } from './position.js';
5
6
  import { useStyle } from './style.js';
6
7
  /**
7
8
  * Renders `children` in a portal on `document.body`, positioned with `fixed`
8
- * coordinates directly under `anchorRef`. This lets dropdowns escape ancestors
9
- * that clip overflow (e.g. cards with rounded corners) without those ancestors
9
+ * coordinates against `anchorRef`. This lets dropdowns escape ancestors that
10
+ * clip overflow (e.g. cards with rounded corners) without those ancestors
10
11
  * having to opt out of clipping.
11
12
  *
12
- * No Escape handling or focus management, and it never flips above the anchor.
13
+ * Opens on `side` (default below) and flips when that side has no room; aligns
14
+ * per `align` and clamps horizontally to the viewport (only without
15
+ * `matchWidth`). The wrapper carries `data-side` with the side actually used.
16
+ * On the top side it is anchored by CSS `bottom`, so it stays attached as its
17
+ * content changes height. The first render is transparent (`opacity: 0`, still
18
+ * focusable) until measured, then it re-measures on scroll (capture phase),
19
+ * window resize, and content resize (`ResizeObserver`, where available).
20
+ *
21
+ * With `onClose`, Escape closes it unless the keydown was already
22
+ * `defaultPrevented`; it calls `preventDefault` so an enclosing `<dialog>`
23
+ * does not also cancel. No focus management.
13
24
  */
14
- export const Popover = ({ anchorRef, open, children, className, gap = 4, matchWidth = true, onClose, }) => {
25
+ export const Popover = ({ anchorRef, open, children, className, gap = 4, matchWidth = true, side = 'bottom', align = 'start', onClose, }) => {
15
26
  const style = useStyle();
16
27
  const contentRef = useRef(null);
17
- const [position, setPosition] = useState(null);
28
+ const [placement, setPlacement] = useState(null);
18
29
  const updatePosition = useCallback(() => {
19
30
  const anchor = anchorRef.current;
20
- if (!anchor)
31
+ const content = contentRef.current;
32
+ if (!anchor || !content)
21
33
  return;
22
34
  const rect = anchor.getBoundingClientRect();
23
- setPosition({ top: rect.bottom + gap, left: rect.left, width: rect.width });
24
- }, [anchorRef, gap]);
35
+ // Measure at the width it will render with, so wrapped height is right.
36
+ if (matchWidth)
37
+ content.style.width = `${rect.width}px`;
38
+ const size = content.getBoundingClientRect();
39
+ setPlacement(computePosition({
40
+ anchor: rect,
41
+ content: { width: size.width, height: size.height },
42
+ viewport: { width: window.innerWidth, height: window.innerHeight },
43
+ side,
44
+ align,
45
+ gap,
46
+ matchWidth,
47
+ }));
48
+ }, [anchorRef, gap, matchWidth, side, align]);
25
49
  useLayoutEffect(() => {
26
50
  if (!open)
27
51
  return;
@@ -30,9 +54,14 @@ export const Popover = ({ anchorRef, open, children, className, gap = 4, matchWi
30
54
  // Capture-phase scroll so nested scroll containers reposition too.
31
55
  window.addEventListener('scroll', handle, true);
32
56
  window.addEventListener('resize', handle);
57
+ const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(handle) : undefined;
58
+ if (observer && contentRef.current)
59
+ observer.observe(contentRef.current);
33
60
  return () => {
34
61
  window.removeEventListener('scroll', handle, true);
35
62
  window.removeEventListener('resize', handle);
63
+ observer?.disconnect();
64
+ setPlacement(null);
36
65
  };
37
66
  }, [open, updatePosition]);
38
67
  useEffect(() => {
@@ -46,15 +75,31 @@ export const Popover = ({ anchorRef, open, children, className, gap = 4, matchWi
46
75
  return;
47
76
  onClose();
48
77
  };
78
+ const handleKeyDown = (event) => {
79
+ if (event.key !== 'Escape' || event.defaultPrevented)
80
+ return;
81
+ // preventDefault on keydown is what stops a native <dialog> from cancelling.
82
+ event.preventDefault();
83
+ onClose();
84
+ };
49
85
  document.addEventListener('mousedown', handleMouseDown);
50
- return () => document.removeEventListener('mousedown', handleMouseDown);
86
+ document.addEventListener('keydown', handleKeyDown);
87
+ return () => {
88
+ document.removeEventListener('mousedown', handleMouseDown);
89
+ document.removeEventListener('keydown', handleKeyDown);
90
+ };
51
91
  }, [open, onClose, anchorRef]);
52
- if (!open || !position)
92
+ if (!open)
53
93
  return null;
54
- return createPortal(_jsx("div", { ref: contentRef, className: cx(style.popover, className), style: {
55
- top: position.top,
56
- left: position.left,
57
- width: matchWidth ? position.width : undefined,
58
- }, children: children }), document.body);
94
+ return createPortal(_jsx("div", { ref: contentRef, className: cx(style.popover, className), "data-side": placement?.side, style: placement
95
+ ? {
96
+ top: placement.top,
97
+ bottom: placement.bottom,
98
+ left: placement.left,
99
+ width: placement.width,
100
+ }
101
+ : // Never painted: the layout effect measures and re-renders first.
102
+ // Opacity, not visibility, so an autoFocus child can take focus.
103
+ { top: 0, left: 0, opacity: 0 }, children: children }), document.body);
59
104
  };
60
105
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/control/popover/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAGL,WAAW,EACX,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAwBtC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EACtB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,GAAG,GAAG,CAAC,EACP,UAAU,GAAG,IAAI,EACjB,OAAO,GACM,EAAE,EAAE;IACjB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAkB,IAAI,CAAC,CAAC;IAEhE,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,MAAM,MAAM,GAAG,SAAS,CAA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ACZ,CAAC,CAAC;QACF,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACxD,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAC1E,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IAE/B,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAEpC,OAAO,YAAY,CACjB,cACE,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,EACvC,KAAK,EAAE;YACL,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SAC/C,YAEA,QAAQ,GACL,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport {\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { useStyle } from './style.js';\n\ntype Position = { top: number; left: number; width: number };\n\nexport type PopoverProps = {\n /** Element the popover aligns to (positioned directly beneath it). */\n anchorRef: RefObject<HTMLElement | null>;\n /** Whether the popover is rendered. */\n open: boolean;\n /** Your surface: give it its own background, border, and radius. */\n children: ReactNode;\n /** Applied to the fixed wrapper; win specificity with `'&&'`, never `!important`. */\n className?: string;\n /** Vertical gap between the anchor and the popover, in pixels. */\n gap?: number;\n /** Match the popover width to the anchor width (default true). */\n matchWidth?: boolean;\n /**\n * Called on a pointer-down outside both the anchor and the popover content.\n * Omit to opt out of outside-close handling.\n */\n onClose?: () => void;\n};\n\n/**\n * Renders `children` in a portal on `document.body`, positioned with `fixed`\n * coordinates directly under `anchorRef`. This lets dropdowns escape ancestors\n * that clip overflow (e.g. cards with rounded corners) without those ancestors\n * having to opt out of clipping.\n *\n * No Escape handling or focus management, and it never flips above the anchor.\n */\nexport const Popover = ({\n anchorRef,\n open,\n children,\n className,\n gap = 4,\n matchWidth = true,\n onClose,\n}: PopoverProps) => {\n const style = useStyle();\n const contentRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = useState<Position | null>(null);\n\n const updatePosition = useCallback(() => {\n const anchor = anchorRef.current;\n if (!anchor) return;\n const rect = anchor.getBoundingClientRect();\n setPosition({ top: rect.bottom + gap, left: rect.left, width: rect.width });\n }, [anchorRef, gap]);\n\n useLayoutEffect(() => {\n if (!open) return;\n updatePosition();\n const handle = () => updatePosition();\n // Capture-phase scroll so nested scroll containers reposition too.\n window.addEventListener('scroll', handle, true);\n window.addEventListener('resize', handle);\n return () => {\n window.removeEventListener('scroll', handle, true);\n window.removeEventListener('resize', handle);\n };\n }, [open, updatePosition]);\n\n useEffect(() => {\n if (!open || !onClose) return;\n const handleMouseDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (anchorRef.current?.contains(target)) return;\n if (contentRef.current?.contains(target)) return;\n onClose();\n };\n document.addEventListener('mousedown', handleMouseDown);\n return () => document.removeEventListener('mousedown', handleMouseDown);\n }, [open, onClose, anchorRef]);\n\n if (!open || !position) return null;\n\n return createPortal(\n <div\n ref={contentRef}\n className={cx(style.popover, className)}\n style={{\n top: position.top,\n left: position.left,\n width: matchWidth ? position.width : undefined,\n }}\n >\n {children}\n </div>,\n document.body\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/control/popover/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAGL,WAAW,EACX,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WA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AAE,YAGpC,QAAQ,GACL,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport {\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport {\n computePosition,\n type Placement,\n type PopoverAlign,\n type PopoverSide,\n} from './position.js';\nimport { useStyle } from './style.js';\n\nexport type { PopoverAlign, PopoverSide } from './position.js';\n\nexport type PopoverProps = {\n /** Element the popover aligns to (placed below or above it, per `side`). */\n anchorRef: RefObject<HTMLElement | null>;\n /** Whether the popover is rendered. */\n open: boolean;\n /** Your surface: give it its own background, border, and radius. */\n children: ReactNode;\n /** Applied to the fixed wrapper; win specificity with `'&&'`, never `!important`. */\n className?: string;\n /** Vertical gap between the anchor and the popover, in pixels; also the viewport edge margin when `matchWidth` is false. */\n gap?: number;\n /** Match the popover width to the anchor width (default true). */\n matchWidth?: boolean;\n /** Preferred side; flips to the other side when this one has no room. */\n side?: PopoverSide;\n /** Horizontal alignment to the anchor's left edge, centre, or right edge. */\n align?: PopoverAlign;\n /**\n * Called on a pointer-down outside both the anchor and the popover content,\n * and on an Escape keydown no control has already handled. Omit to opt out.\n */\n onClose?: () => void;\n};\n\n/**\n * Renders `children` in a portal on `document.body`, positioned with `fixed`\n * coordinates against `anchorRef`. This lets dropdowns escape ancestors that\n * clip overflow (e.g. cards with rounded corners) without those ancestors\n * having to opt out of clipping.\n *\n * Opens on `side` (default below) and flips when that side has no room; aligns\n * per `align` and clamps horizontally to the viewport (only without\n * `matchWidth`). The wrapper carries `data-side` with the side actually used.\n * On the top side it is anchored by CSS `bottom`, so it stays attached as its\n * content changes height. The first render is transparent (`opacity: 0`, still\n * focusable) until measured, then it re-measures on scroll (capture phase),\n * window resize, and content resize (`ResizeObserver`, where available).\n *\n * With `onClose`, Escape closes it unless the keydown was already\n * `defaultPrevented`; it calls `preventDefault` so an enclosing `<dialog>`\n * does not also cancel. No focus management.\n */\nexport const Popover = ({\n anchorRef,\n open,\n children,\n className,\n gap = 4,\n matchWidth = true,\n side = 'bottom',\n align = 'start',\n onClose,\n}: PopoverProps) => {\n const style = useStyle();\n const contentRef = useRef<HTMLDivElement>(null);\n const [placement, setPlacement] = useState<Placement | null>(null);\n\n const updatePosition = useCallback(() => {\n const anchor = anchorRef.current;\n const content = contentRef.current;\n if (!anchor || !content) return;\n const rect = anchor.getBoundingClientRect();\n // Measure at the width it will render with, so wrapped height is right.\n if (matchWidth) content.style.width = `${rect.width}px`;\n const size = content.getBoundingClientRect();\n setPlacement(\n computePosition({\n anchor: rect,\n content: { width: size.width, height: size.height },\n viewport: { width: window.innerWidth, height: window.innerHeight },\n side,\n align,\n gap,\n matchWidth,\n })\n );\n }, [anchorRef, gap, matchWidth, side, align]);\n\n useLayoutEffect(() => {\n if (!open) return;\n updatePosition();\n const handle = () => updatePosition();\n // Capture-phase scroll so nested scroll containers reposition too.\n window.addEventListener('scroll', handle, true);\n window.addEventListener('resize', handle);\n const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(handle) : undefined;\n if (observer && contentRef.current) observer.observe(contentRef.current);\n return () => {\n window.removeEventListener('scroll', handle, true);\n window.removeEventListener('resize', handle);\n observer?.disconnect();\n setPlacement(null);\n };\n }, [open, updatePosition]);\n\n useEffect(() => {\n if (!open || !onClose) return;\n const handleMouseDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (anchorRef.current?.contains(target)) return;\n if (contentRef.current?.contains(target)) return;\n onClose();\n };\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented) return;\n // preventDefault on keydown is what stops a native <dialog> from cancelling.\n event.preventDefault();\n onClose();\n };\n document.addEventListener('mousedown', handleMouseDown);\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('mousedown', handleMouseDown);\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [open, onClose, anchorRef]);\n\n if (!open) return null;\n\n return createPortal(\n <div\n ref={contentRef}\n className={cx(style.popover, className)}\n data-side={placement?.side}\n style={\n placement\n ? {\n top: placement.top,\n bottom: placement.bottom,\n left: placement.left,\n width: placement.width,\n }\n : // Never painted: the layout effect measures and re-renders first.\n // Opacity, not visibility, so an autoFocus child can take focus.\n { top: 0, left: 0, opacity: 0 }\n }\n >\n {children}\n </div>,\n document.body\n );\n};\n"]}
@@ -0,0 +1,47 @@
1
+ /** Which side of the anchor the popover prefers. */
2
+ export type PopoverSide = 'bottom' | 'top';
3
+ /** Horizontal alignment of the popover against the anchor. */
4
+ export type PopoverAlign = 'start' | 'center' | 'end';
5
+ /** Viewport-relative rectangle, as from getBoundingClientRect. */
6
+ export type Rect = {
7
+ top: number;
8
+ bottom: number;
9
+ left: number;
10
+ right: number;
11
+ width: number;
12
+ };
13
+ /**
14
+ * Resolved popover position; `side` is the side actually used after flipping.
15
+ * Exactly one of `top` / `bottom` is set: the bottom side is anchored by its
16
+ * top edge (CSS `top`), the top side by its bottom edge (CSS `bottom`, measured
17
+ * from the viewport's bottom), so content that grows or shrinks while open
18
+ * stays attached to the anchor.
19
+ */
20
+ export type Placement = {
21
+ top: number | undefined;
22
+ bottom: number | undefined;
23
+ left: number;
24
+ width: number | undefined;
25
+ side: PopoverSide;
26
+ };
27
+ /**
28
+ * Pure placement: picks the side (flipping when the preferred side does not
29
+ * fit and the other has more room), aligns horizontally, and clamps to the
30
+ * viewport horizontally unless `matchWidth` (then it lines up with the anchor).
31
+ */
32
+ export declare function computePosition({ anchor, content, viewport, side, align, gap, matchWidth, }: {
33
+ anchor: Rect;
34
+ content: {
35
+ width: number;
36
+ height: number;
37
+ };
38
+ viewport: {
39
+ width: number;
40
+ height: number;
41
+ };
42
+ side: PopoverSide;
43
+ align: PopoverAlign;
44
+ gap: number;
45
+ matchWidth: boolean;
46
+ }): Placement;
47
+ //# sourceMappingURL=position.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/control/popover/position.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,CAAC;AAC3C,8DAA8D;AAC9D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACtD,kEAAkE;AAClE,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/F;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,GAAG,EACH,UAAU,GACX,EAAE;IACD,MAAM,EAAE,IAAI,CAAC;IACb,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,SAAS,CAuBZ"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Pure placement: picks the side (flipping when the preferred side does not
3
+ * fit and the other has more room), aligns horizontally, and clamps to the
4
+ * viewport horizontally unless `matchWidth` (then it lines up with the anchor).
5
+ */
6
+ export function computePosition({ anchor, content, viewport, side, align, gap, matchWidth, }) {
7
+ const w = matchWidth ? anchor.width : content.width;
8
+ const h = content.height;
9
+ const roomBelow = viewport.height - anchor.bottom - gap;
10
+ const roomAbove = anchor.top - gap;
11
+ const room = (s) => (s === 'bottom' ? roomBelow : roomAbove);
12
+ const other = side === 'bottom' ? 'top' : 'bottom';
13
+ const used = room(side) >= h || room(other) <= room(side) ? side : other;
14
+ const top = used === 'bottom' ? anchor.bottom + gap : undefined;
15
+ const bottom = used === 'top' ? viewport.height - anchor.top + gap : undefined;
16
+ let left;
17
+ if (align === 'start')
18
+ left = anchor.left;
19
+ else if (align === 'center')
20
+ left = anchor.left + anchor.width / 2 - w / 2;
21
+ else
22
+ left = anchor.right - w;
23
+ if (!matchWidth) {
24
+ left =
25
+ w > viewport.width - 2 * gap ? gap : Math.max(gap, Math.min(left, viewport.width - w - gap));
26
+ }
27
+ return { top, bottom, left, width: matchWidth ? anchor.width : undefined, side: used };
28
+ }
29
+ //# sourceMappingURL=position.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.js","sourceRoot":"","sources":["../../../src/control/popover/position.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,GAAG,EACH,UAAU,GASX;IACC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACpD,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAEzB,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;IACxD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;IACnC,MA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,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACzF,CAAC","sourcesContent":["/** Which side of the anchor the popover prefers. */\nexport type PopoverSide = 'bottom' | 'top';\n/** Horizontal alignment of the popover against the anchor. */\nexport type PopoverAlign = 'start' | 'center' | 'end';\n/** Viewport-relative rectangle, as from getBoundingClientRect. */\nexport type Rect = { top: number; bottom: number; left: number; right: number; width: number };\n/**\n * Resolved popover position; `side` is the side actually used after flipping.\n * Exactly one of `top` / `bottom` is set: the bottom side is anchored by its\n * top edge (CSS `top`), the top side by its bottom edge (CSS `bottom`, measured\n * from the viewport's bottom), so content that grows or shrinks while open\n * stays attached to the anchor.\n */\nexport type Placement = {\n top: number | undefined;\n bottom: number | undefined;\n left: number;\n width: number | undefined;\n side: PopoverSide;\n};\n\n/**\n * Pure placement: picks the side (flipping when the preferred side does not\n * fit and the other has more room), aligns horizontally, and clamps to the\n * viewport horizontally unless `matchWidth` (then it lines up with the anchor).\n */\nexport function computePosition({\n anchor,\n content,\n viewport,\n side,\n align,\n gap,\n matchWidth,\n}: {\n anchor: Rect;\n content: { width: number; height: number };\n viewport: { width: number; height: number };\n side: PopoverSide;\n align: PopoverAlign;\n gap: number;\n matchWidth: boolean;\n}): Placement {\n const w = matchWidth ? anchor.width : content.width;\n const h = content.height;\n\n const roomBelow = viewport.height - anchor.bottom - gap;\n const roomAbove = anchor.top - gap;\n const room = (s: PopoverSide) => (s === 'bottom' ? roomBelow : roomAbove);\n const other: PopoverSide = side === 'bottom' ? 'top' : 'bottom';\n const used = room(side) >= h || room(other) <= room(side) ? side : other;\n const top = used === 'bottom' ? anchor.bottom + gap : undefined;\n const bottom = used === 'top' ? viewport.height - anchor.top + gap : undefined;\n\n let left: number;\n if (align === 'start') left = anchor.left;\n else if (align === 'center') left = anchor.left + anchor.width / 2 - w / 2;\n else left = anchor.right - w;\n\n if (!matchWidth) {\n left =\n w > viewport.width - 2 * gap ? gap : Math.max(gap, Math.min(left, viewport.width - w - gap));\n }\n\n return { top, bottom, left, width: matchWidth ? anchor.width : undefined, side: used };\n}\n"]}
@@ -85,6 +85,10 @@ export interface Theme {
85
85
  section: string;
86
86
  };
87
87
  success: string;
88
+ /** Solid warning colour for icons and accents. */
89
+ warning: string;
90
+ /** Solid info colour for icons and accents. */
91
+ info: string;
88
92
  brand: {
89
93
  default: string;
90
94
  hover: string;
@@ -155,6 +159,26 @@ export interface Theme {
155
159
  bg: string;
156
160
  border: string;
157
161
  };
162
+ success: {
163
+ text: string;
164
+ bg: string;
165
+ border: string;
166
+ };
167
+ warning: {
168
+ text: string;
169
+ bg: string;
170
+ border: string;
171
+ };
172
+ danger: {
173
+ text: string;
174
+ bg: string;
175
+ border: string;
176
+ };
177
+ info: {
178
+ text: string;
179
+ bg: string;
180
+ border: string;
181
+ };
158
182
  };
159
183
  };
160
184
  space: {
@@ -200,6 +224,7 @@ export interface Theme {
200
224
  mono: string;
201
225
  };
202
226
  fontWeight: {
227
+ regular: number;
203
228
  medium: number;
204
229
  semibold: number;
205
230
  bold: number;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAGzC,QAAA,MAAM,IAAI;aACR,EAAE,EAAE,SAAS;aACb,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,MAAM;CACH,CAAC;AAEX,QAAA,MAAM,IAAI;aACR,EAAE,EAAE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YAAY,EAAE,KAAkB,CAAC"}
@@ -83,6 +83,8 @@ function buildTheme(mode) {
83
83
  section: '#E6E6E9',
84
84
  },
85
85
  success: '#16a34a',
86
+ warning: '#ca8a04',
87
+ info: blue[500],
86
88
  brand: {
87
89
  default: blue[500],
88
90
  hover: blue[400],
@@ -123,6 +125,22 @@ function buildTheme(mode) {
123
125
  bg: applyTransparency(gray[600], 0.08),
124
126
  border: applyTransparency(gray[600], 0.22),
125
127
  },
128
+ success: {
129
+ text: '#15803d',
130
+ bg: applyTransparency('#16a34a', 0.08),
131
+ border: applyTransparency('#16a34a', 0.22),
132
+ },
133
+ warning: { text: '#854d0e', bg: 'rgba(234,179,8,0.16)', border: 'rgba(202,138,4,0.40)' },
134
+ danger: {
135
+ text: red[700],
136
+ bg: applyTransparency(red[500], 0.08),
137
+ border: applyTransparency(red[500], 0.22),
138
+ },
139
+ info: {
140
+ text: blue[700],
141
+ bg: applyTransparency(blue[500], 0.08),
142
+ border: applyTransparency(blue[500], 0.24),
143
+ },
126
144
  },
127
145
  };
128
146
  const darkMuted = '#9CA1AB';
@@ -174,6 +192,8 @@ function buildTheme(mode) {
174
192
  section: '#2B2C30',
175
193
  },
176
194
  success: '#22C55E',
195
+ warning: '#EAB308',
196
+ info: blue[400],
177
197
  brand: {
178
198
  default: blue[400],
179
199
  hover: blue[300],
@@ -215,6 +235,22 @@ function buildTheme(mode) {
215
235
  bg: applyTransparency(darkMuted, 0.16),
216
236
  border: applyTransparency(darkMuted, 0.3),
217
237
  },
238
+ success: {
239
+ text: '#86EFAC',
240
+ bg: applyTransparency('#22C55E', 0.16),
241
+ border: applyTransparency('#22C55E', 0.3),
242
+ },
243
+ warning: { text: '#FDE047', bg: 'rgba(234,179,8,0.20)', border: 'rgba(234,179,8,0.42)' },
244
+ danger: {
245
+ text: red[400],
246
+ bg: applyTransparency(red[500], 0.16),
247
+ border: applyTransparency(red[500], 0.3),
248
+ },
249
+ info: {
250
+ text: blue[300],
251
+ bg: applyTransparency(blue[400], 0.18),
252
+ border: applyTransparency(blue[400], 0.36),
253
+ },
218
254
  },
219
255
  };
220
256
  const color = mode === 'dark' ? darkColor : lightColor;
@@ -275,7 +311,13 @@ function buildTheme(mode) {
275
311
  body: 'system-ui, sans-serif',
276
312
  mono: "'Cascadia Code', 'Fira Code', monospace",
277
313
  };
278
- const fontWeight = { medium: 500, semibold: 600, bold: 700, extrabold: 800 };
314
+ const fontWeight = {
315
+ regular: 400,
316
+ medium: 500,
317
+ semibold: 600,
318
+ bold: 700,
319
+ extrabold: 800,
320
+ };
279
321
  const lineHeight = { tight: 1, body: 1.3 };
280
322
  const lightShadow = {
281
323
  card: '0 1px 3px rgba(0,0,0,0.07)',
@@ -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,G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ACV,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,SA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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 /** 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: {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n extrabold: number;\n };\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'] = {\n regular: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n extrabold: 800,\n };\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"]}