@korzun/design 0.0.4 → 0.0.6

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 (199) hide show
  1. package/AGENTS.md +3 -0
  2. package/dist/component/card/index.d.ts +13 -2
  3. package/dist/component/card/index.d.ts.map +1 -1
  4. package/dist/component/card/index.js +1 -0
  5. package/dist/component/card/index.js.map +1 -1
  6. package/dist/component/card/style.d.ts.map +1 -1
  7. package/dist/component/card/style.js +3 -1
  8. package/dist/component/card/style.js.map +1 -1
  9. package/dist/component/card-divider/index.d.ts +15 -0
  10. package/dist/component/card-divider/index.d.ts.map +1 -1
  11. package/dist/component/card-divider/index.js +4 -0
  12. package/dist/component/card-divider/index.js.map +1 -1
  13. package/dist/component/card-row/index.d.ts +5 -0
  14. package/dist/component/card-row/index.d.ts.map +1 -1
  15. package/dist/component/card-row/index.js +1 -0
  16. package/dist/component/card-row/index.js.map +1 -1
  17. package/dist/component/card-row/style.js +1 -1
  18. package/dist/component/card-row/style.js.map +1 -1
  19. package/dist/component/collapsible-section/index.d.ts +8 -3
  20. package/dist/component/collapsible-section/index.d.ts.map +1 -1
  21. package/dist/component/collapsible-section/index.js +1 -0
  22. package/dist/component/collapsible-section/index.js.map +1 -1
  23. package/dist/component/empty-state/index.d.ts +2 -2
  24. package/dist/component/empty-state/index.d.ts.map +1 -1
  25. package/dist/component/empty-state/index.js.map +1 -1
  26. package/dist/component/index.d.ts +10 -10
  27. package/dist/component/index.d.ts.map +1 -1
  28. package/dist/component/index.js.map +1 -1
  29. package/dist/component/meta-line/index.d.ts +1 -1
  30. package/dist/component/meta-line/index.d.ts.map +1 -1
  31. package/dist/component/meta-line/index.js.map +1 -1
  32. package/dist/component/metadata/index.d.ts +2 -0
  33. package/dist/component/metadata/index.d.ts.map +1 -1
  34. package/dist/component/metadata/index.js +1 -0
  35. package/dist/component/metadata/index.js.map +1 -1
  36. package/dist/component/metadata-list/index.d.ts +6 -2
  37. package/dist/component/metadata-list/index.d.ts.map +1 -1
  38. package/dist/component/metadata-list/index.js +1 -0
  39. package/dist/component/metadata-list/index.js.map +1 -1
  40. package/dist/component/nav-desktop/index.d.ts +6 -0
  41. package/dist/component/nav-desktop/index.d.ts.map +1 -1
  42. package/dist/component/nav-desktop/index.js +5 -2
  43. package/dist/component/nav-desktop/index.js.map +1 -1
  44. package/dist/component/nav-mobile/index.d.ts +11 -3
  45. package/dist/component/nav-mobile/index.d.ts.map +1 -1
  46. package/dist/component/nav-mobile/index.js +5 -0
  47. package/dist/component/nav-mobile/index.js.map +1 -1
  48. package/dist/component/nav-types.d.ts +4 -0
  49. package/dist/component/nav-types.d.ts.map +1 -1
  50. package/dist/component/nav-types.js.map +1 -1
  51. package/dist/component/page/index.d.ts +10 -2
  52. package/dist/component/page/index.d.ts.map +1 -1
  53. package/dist/component/page/index.js +1 -0
  54. package/dist/component/page/index.js.map +1 -1
  55. package/dist/component/progress-indicator/index.d.ts +4 -2
  56. package/dist/component/progress-indicator/index.d.ts.map +1 -1
  57. package/dist/component/progress-indicator/index.js +1 -0
  58. package/dist/component/progress-indicator/index.js.map +1 -1
  59. package/dist/component/tag/index.d.ts +6 -3
  60. package/dist/component/tag/index.d.ts.map +1 -1
  61. package/dist/component/tag/index.js +1 -0
  62. package/dist/component/tag/index.js.map +1 -1
  63. package/dist/component/theme-setting/index.d.ts +6 -0
  64. package/dist/component/theme-setting/index.d.ts.map +1 -1
  65. package/dist/component/theme-setting/index.js +4 -0
  66. package/dist/component/theme-setting/index.js.map +1 -1
  67. package/dist/component/top-fade/index.d.ts +7 -0
  68. package/dist/component/top-fade/index.d.ts.map +1 -1
  69. package/dist/component/top-fade/index.js +5 -2
  70. package/dist/component/top-fade/index.js.map +1 -1
  71. package/dist/control/action-menu-list/index.d.ts +7 -0
  72. package/dist/control/action-menu-list/index.d.ts.map +1 -1
  73. package/dist/control/action-menu-list/index.js.map +1 -1
  74. package/dist/control/back-button/index.d.ts +9 -2
  75. package/dist/control/back-button/index.d.ts.map +1 -1
  76. package/dist/control/back-button/index.js +4 -0
  77. package/dist/control/back-button/index.js.map +1 -1
  78. package/dist/control/button/index.d.ts +30 -1
  79. package/dist/control/button/index.d.ts.map +1 -1
  80. package/dist/control/button/index.js +4 -0
  81. package/dist/control/button/index.js.map +1 -1
  82. package/dist/control/chips-input/index.d.ts +20 -0
  83. package/dist/control/chips-input/index.d.ts.map +1 -1
  84. package/dist/control/chips-input/index.js +4 -0
  85. package/dist/control/chips-input/index.js.map +1 -1
  86. package/dist/control/confirm-modal/index.d.ts +15 -2
  87. package/dist/control/confirm-modal/index.d.ts.map +1 -1
  88. package/dist/control/confirm-modal/index.js +4 -0
  89. package/dist/control/confirm-modal/index.js.map +1 -1
  90. package/dist/control/date-time-input/index.d.ts +4 -0
  91. package/dist/control/date-time-input/index.d.ts.map +1 -1
  92. package/dist/control/date-time-input/index.js.map +1 -1
  93. package/dist/control/field-list/index.d.ts +20 -2
  94. package/dist/control/field-list/index.d.ts.map +1 -1
  95. package/dist/control/field-list/index.js +4 -0
  96. package/dist/control/field-list/index.js.map +1 -1
  97. package/dist/control/index.d.ts +16 -21
  98. package/dist/control/index.d.ts.map +1 -1
  99. package/dist/control/index.js +5 -5
  100. package/dist/control/index.js.map +1 -1
  101. package/dist/control/number-input/index.d.ts +12 -0
  102. package/dist/control/number-input/index.d.ts.map +1 -1
  103. package/dist/control/number-input/index.js +4 -0
  104. package/dist/control/number-input/index.js.map +1 -1
  105. package/dist/control/page-actions-bar/index.d.ts +11 -3
  106. package/dist/control/page-actions-bar/index.d.ts.map +1 -1
  107. package/dist/control/page-actions-bar/index.js +5 -1
  108. package/dist/control/page-actions-bar/index.js.map +1 -1
  109. package/dist/control/page-actions-menu/index.d.ts +6 -1
  110. package/dist/control/page-actions-menu/index.d.ts.map +1 -1
  111. package/dist/control/page-actions-menu/index.js +4 -0
  112. package/dist/control/page-actions-menu/index.js.map +1 -1
  113. package/dist/control/page-footer-actions/index.d.ts +16 -2
  114. package/dist/control/page-footer-actions/index.d.ts.map +1 -1
  115. package/dist/control/page-footer-actions/index.js +4 -0
  116. package/dist/control/page-footer-actions/index.js.map +1 -1
  117. package/dist/control/popover/index.d.ts +6 -3
  118. package/dist/control/popover/index.d.ts.map +1 -1
  119. package/dist/control/popover/index.js +2 -0
  120. package/dist/control/popover/index.js.map +1 -1
  121. package/dist/control/segmented-control/index.d.ts +10 -3
  122. package/dist/control/segmented-control/index.d.ts.map +1 -1
  123. package/dist/control/segmented-control/index.js.map +1 -1
  124. package/dist/control/select/index.d.ts +17 -0
  125. package/dist/control/select/index.d.ts.map +1 -1
  126. package/dist/control/select/index.js +4 -0
  127. package/dist/control/select/index.js.map +1 -1
  128. package/dist/control/switch/index.d.ts +16 -2
  129. package/dist/control/switch/index.d.ts.map +1 -1
  130. package/dist/control/switch/index.js +4 -0
  131. package/dist/control/switch/index.js.map +1 -1
  132. package/dist/control/switch/style.d.ts.map +1 -1
  133. package/dist/control/switch/style.js +1 -3
  134. package/dist/control/switch/style.js.map +1 -1
  135. package/dist/control/text-area/index.d.ts +15 -0
  136. package/dist/control/text-area/index.d.ts.map +1 -1
  137. package/dist/control/text-area/index.js +4 -0
  138. package/dist/control/text-area/index.js.map +1 -1
  139. package/dist/control/text-input/index.d.ts +23 -1
  140. package/dist/control/text-input/index.d.ts.map +1 -1
  141. package/dist/control/text-input/index.js +4 -0
  142. package/dist/control/text-input/index.js.map +1 -1
  143. package/dist/control/use-modal-dialog/index.d.ts +7 -1
  144. package/dist/control/use-modal-dialog/index.d.ts.map +1 -1
  145. package/dist/control/use-modal-dialog/index.js +5 -0
  146. package/dist/control/use-modal-dialog/index.js.map +1 -1
  147. package/dist/theme/theme.d.ts +2 -0
  148. package/dist/theme/theme.d.ts.map +1 -1
  149. package/dist/theme/theme.js +5 -0
  150. package/dist/theme/theme.js.map +1 -1
  151. package/docs/component/card-row.md +11 -12
  152. package/docs/component/card.md +4 -5
  153. package/docs/control/confirm-modal.md +1 -2
  154. package/docs/control/segmented-control.md +2 -2
  155. package/docs/corners.md +4 -4
  156. package/docs/philosophy.md +1 -1
  157. package/docs/theme.md +1 -0
  158. package/docs/tokens.md +1 -0
  159. package/package.json +1 -1
  160. package/src/component/card/index.tsx +14 -2
  161. package/src/component/card/style.ts +3 -1
  162. package/src/component/card-divider/index.tsx +15 -6
  163. package/src/component/card-row/index.tsx +6 -0
  164. package/src/component/card-row/style.ts +1 -1
  165. package/src/component/collapsible-section/index.tsx +8 -2
  166. package/src/component/empty-state/index.tsx +2 -2
  167. package/src/component/index.ts +10 -10
  168. package/src/component/meta-line/index.tsx +1 -1
  169. package/src/component/metadata/index.tsx +6 -1
  170. package/src/component/metadata-list/index.tsx +13 -2
  171. package/src/component/nav-desktop/index.tsx +6 -2
  172. package/src/component/nav-mobile/index.tsx +11 -3
  173. package/src/component/nav-types.ts +4 -0
  174. package/src/component/page/index.tsx +11 -1
  175. package/src/component/progress-indicator/index.tsx +4 -1
  176. package/src/component/tag/index.tsx +6 -3
  177. package/src/component/theme-setting/index.tsx +7 -0
  178. package/src/component/top-fade/index.tsx +8 -2
  179. package/src/control/action-menu-list/index.tsx +7 -0
  180. package/src/control/back-button/index.tsx +9 -1
  181. package/src/control/button/index.tsx +39 -5
  182. package/src/control/chips-input/index.tsx +20 -3
  183. package/src/control/confirm-modal/index.tsx +15 -1
  184. package/src/control/date-time-input/index.tsx +4 -0
  185. package/src/control/field-list/index.tsx +20 -1
  186. package/src/control/index.ts +39 -22
  187. package/src/control/number-input/index.tsx +12 -0
  188. package/src/control/page-actions-bar/index.tsx +16 -2
  189. package/src/control/page-actions-menu/index.tsx +6 -1
  190. package/src/control/page-footer-actions/index.tsx +16 -1
  191. package/src/control/popover/index.tsx +6 -2
  192. package/src/control/segmented-control/index.tsx +10 -3
  193. package/src/control/select/index.tsx +17 -1
  194. package/src/control/switch/index.tsx +17 -1
  195. package/src/control/switch/style.ts +1 -3
  196. package/src/control/text-area/index.tsx +15 -0
  197. package/src/control/text-input/index.tsx +25 -0
  198. package/src/control/use-modal-dialog/index.ts +11 -2
  199. package/src/theme/theme.ts +7 -0
@@ -8,9 +8,12 @@ import type { NavItem } from '../nav-types.js';
8
8
  * instead of one bar fading out while a different one fades in.
9
9
  */
10
10
  export interface NavPill {
11
- /** Destinations shown while this side is expanded. */
11
+ /** Destinations shown while this side is expanded. `[]` makes the side permanently a circle. */
12
12
  items: NavItem[];
13
- /** The single destination it collapses to. */
13
+ /**
14
+ * The single destination it collapses to. Its `label` is the circle's `aria-label`; its
15
+ * `badge` shows only while collapsed; its `active` lights the circle.
16
+ */
14
17
  collapsed: NavItem;
15
18
  }
16
19
  export interface NavMobileProps {
@@ -18,8 +21,13 @@ export interface NavMobileProps {
18
21
  main: NavPill;
19
22
  /** The right-hand side: settings. */
20
23
  settings: NavPill;
21
- /** Which side is expanded; the other is a circle. */
24
+ /** Which side is expanded; the other is a circle. Derive it from the route. */
22
25
  expanded: 'main' | 'settings';
23
26
  }
27
+ /**
28
+ * The bottom navigation on phones: two frosted pills, one expanded into tabs and one a
29
+ * circle; scrolling down minimizes it. Must render inside a react-router router, and every
30
+ * `Page` under it needs `bottomNav`.
31
+ */
24
32
  export declare const NavMobile: ({ main, settings, expanded }: NavMobileProps) => import("react").JSX.Element;
25
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/nav-mobile/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,sDAAsD;IACtD,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,IAAI,EAAE,OAAO,CAAC;IACd,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC;CAC/B;AA0CD,eAAO,MAAM,SAAS,iCAAkC,cAAc,gCAuBrE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/nav-mobile/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,gGAAgG;IAChG,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,IAAI,EAAE,OAAO,CAAC;IACd,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC;CAC/B;AA0CD;;;;GAIG;AACH,eAAO,MAAM,SAAS,iCAAkC,cAAc,gCAuBrE,CAAC"}
@@ -24,6 +24,11 @@ const sameBox = (a, b) => a != null &&
24
24
  // animating — so the two never fight: a side is a circle when it is not the
25
25
  // expanded side OR the bar is minimized. The other side's circle is left as it
26
26
  // is, like the search button iOS keeps beside its minimized bar.
27
+ /**
28
+ * The bottom navigation on phones: two frosted pills, one expanded into tabs and one a
29
+ * circle; scrolling down minimizes it. Must render inside a react-router router, and every
30
+ * `Page` under it needs `bottomNav`.
31
+ */
27
32
  export const NavMobile = ({ main, settings, expanded }) => {
28
33
  const styles = useStyle();
29
34
  const { key } = useLocation();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/nav-mobile/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAsB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,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SAAS,EAAE,MAAM,CAAC,QAAQ,iBAAc,eAAe,GAAG,IAC/E,CACR,CAAC","sourcesContent":["import cx from 'classnames';\nimport { type CSSProperties, useEffect, useRef, useState } from 'react';\nimport { Link, useLocation } from 'react-router';\n\nimport { useMinimizeOnScroll } from '../../hooks/use-minimize-on-scroll.js';\nimport { useTheme } from '../../theme/index.js';\nimport type { NavItem } from '../nav-types.js';\nimport { useStyle } from './style.js';\n\n/**\n * One side of the bar, in both of the shapes it can take.\n *\n * Both shapes are always rendered, which is what makes the swap a MORPH rather\n * than a cross-fade: the pill around them is a single element whose width\n * animates between the two, so the capsule is seen to shrink into the circle\n * instead of one bar fading out while a different one fades in.\n */\nexport interface NavPill {\n /** Destinations shown while this side is expanded. */\n items: NavItem[];\n /** The single destination it collapses to. */\n collapsed: NavItem;\n}\n\nexport interface NavMobileProps {\n /** The left-hand side: the app's main destinations. */\n main: NavPill;\n /** The right-hand side: settings. */\n settings: NavPill;\n /** Which side is expanded; the other is a circle. */\n expanded: 'main' | 'settings';\n}\n\n/** Horizontal geometry measured from the live DOM. */\ninterface LensBox {\n /** Active tab's left offset within the capsule. */\n left: number;\n /** Active tab's width (the lens/mask width). */\n width: number;\n /** Full capsule width — pins the blue reveal grid so its columns match the real row. */\n capsuleWidth: number;\n /**\n * The PILL's height, not the capsule's, and the diameter it collapses to.\n *\n * Measured from the pill because the row stretches both pills to a common\n * height: a side whose own content is shorter — a reader's settings side has\n * no expanded destinations at all — would otherwise collapse to a circle\n * smaller than the bar beside it.\n */\n pillHeight: number;\n}\n\nconst sameBox = (a: LensBox | null, b: LensBox | null): boolean =>\n a != null &&\n b != null &&\n a.left === b.left &&\n a.width === b.width &&\n a.capsuleWidth === b.capsuleWidth &&\n a.pillHeight === b.pillHeight;\n\n// Narrow navigation pinned to the bottom of the viewport (mobile only): two frosted\n// \"liquid glass\" pills, one expanded and one collapsed to a circle. The expanded one's\n// active tab is wrapped by a glass lens that slides between (equal-width) tabs. A blue\n// copy of the tab row, clipped to the lens, reveals the active color only where the lens\n// is. Hidden at and above the desktop breakpoint.\n//\n// Scrolling down MINIMIZES the expanded side to a circle holding the active\n// tab, the way the iOS tab bar gets out of the way of what you are reading;\n// scrolling up, reaching the top, tapping the circle or changing page brings it\n// back. It is the same morph the route-driven collapse uses — one width\n// animating — so the two never fight: a side is a circle when it is not the\n// expanded side OR the bar is minimized. The other side's circle is left as it\n// is, like the search button iOS keeps beside its minimized bar.\nexport const NavMobile = ({ main, settings, expanded }: NavMobileProps) => {\n const styles = useStyle();\n const { key } = useLocation();\n const { minimized, expand } = useMinimizeOnScroll({ resetKey: key });\n\n return (\n <nav className={styles.root}>\n <Pill\n pill={main}\n expanded={expanded === 'main'}\n minimized={minimized}\n onExpand={expand}\n styles={styles}\n />\n <Pill\n pill={settings}\n expanded={expanded === 'settings'}\n minimized={minimized}\n onExpand={expand}\n styles={styles}\n />\n </nav>\n );\n};\n\nconst Pill = ({\n pill,\n expanded,\n minimized,\n onExpand,\n styles,\n}: {\n pill: NavPill;\n expanded: boolean;\n /** The bar has scrolled out of the way; an expanded side shows its active tab alone. */\n minimized: boolean;\n onExpand: () => void;\n styles: ReturnType<typeof useStyle>;\n}) => {\n const theme = useTheme();\n const pillRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [box, setBox] = useState<LensBox | null>(null);\n const [shown, setShown] = useState(false);\n const [ready, setReady] = useState(false);\n\n const { items, collapsed } = pill;\n const activeItem = items.find((item) => item.active);\n const activeTo = activeItem?.to;\n const CollapsedIcon = collapsed.Icon;\n\n // The three shapes, exactly one of them showing. `open` is the capsule;\n // the two circles split the rest by WHY the side is a circle.\n const open = expanded && !minimized;\n const showMinimized = expanded && minimized;\n // The minimized circle stands for the capsule it replaced, so it wears the\n // tab you are on — where you are is the one thing worth keeping on screen.\n // When the route maps to no tab it falls back to the side's own collapsed\n // glyph rather than showing nothing.\n const MinimizedIcon = activeItem?.Icon ?? CollapsedIcon;\n // Its badge is the active tab's own when it has one — that tab's icon is\n // what is showing, so its count is honest there — and otherwise a dot for\n // whatever the hidden siblings want, the same claim a collapsed side makes.\n const minimizedBadge: NavItem['badge'] =\n activeItem?.badge ?? (items.some((item) => item.badge !== undefined) ? 'dot' : undefined);\n\n // Measure the active tab's horizontal box (its vertical extent is fixed in CSS) so\n // the lens can wrap and morph to it, plus the two sizes this pill animates between.\n // Runs after paint so the morph transition starts from the on-screen position. Keeps\n // the last lens box when the route maps to no tab, so the lens fades out / back in\n // place. Re-measures on active-tab/tab-set change, on expand/collapse, and on resize.\n useEffect(() => {\n const container = containerRef.current;\n const pillElement = pillRef.current;\n if (!container || !pillElement) return;\n\n const measure = () => {\n const pillBox = pillElement.getBoundingClientRect();\n const containerBox = container.getBoundingClientRect();\n const active = container.querySelector<HTMLElement>('[aria-current=\"page\"]');\n if (!active) {\n // Still record the SIZES. A collapsed pill has no active tab inside it,\n // and an early return here would leave it with no width to animate to.\n setBox((prev) =>\n prev === null\n ? { left: 0, width: 0, capsuleWidth: containerBox.width, pillHeight: pillBox.height }\n : { ...prev, capsuleWidth: containerBox.width, pillHeight: pillBox.height }\n );\n setShown(false);\n return;\n }\n const activeBox = active.getBoundingClientRect();\n const next: LensBox = {\n left: activeBox.left - containerBox.left - container.clientLeft,\n width: activeBox.width,\n capsuleWidth: containerBox.width,\n pillHeight: pillBox.height,\n };\n setBox((prev) => (sameBox(prev, next) ? prev : next));\n setShown(true);\n };\n\n measure();\n\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(container);\n observer.observe(pillElement);\n return () => observer.disconnect();\n }, [activeTo, items.length, expanded]);\n\n // Enable the morph transitions one frame after the first placement, so they are never\n // turned on in the same frame a position or width is first set. Without this a pill\n // would animate its whole width on mount — from the natural capsule width down to a\n // circle — as if the bar were collapsing on arrival.\n useEffect(() => {\n let raf = 0;\n let timer: ReturnType<typeof setTimeout> | undefined;\n if (typeof requestAnimationFrame === 'function') {\n raf = requestAnimationFrame(() => setReady(true));\n } else {\n timer = setTimeout(() => setReady(true), 0);\n }\n return () => {\n if (raf) cancelAnimationFrame(raf);\n if (timer) clearTimeout(timer);\n };\n }, []);\n\n // The lens slides via transform. The blue reveal is a fixed full-row overlay that\n // never moves — instead a clip-path window (matching the lens box) animates over it,\n // so the blue can't drift relative to the tabs; it's simply unmasked as the lens passes.\n const lensStyle: CSSProperties = box\n ? { opacity: shown ? 1 : 0, width: box.width, transform: `translateX(${box.left}px)` }\n : { opacity: 0 };\n const clip = box\n ? `inset(${theme.space.xs} ${box.capsuleWidth - box.left - box.width}px ${theme.space.xs} ${box.left}px round ${theme.radius.pill})`\n : undefined;\n const revealStyle: CSSProperties = box\n ? { opacity: shown ? 1 : 0, clipPath: clip, WebkitClipPath: clip }\n : { opacity: 0 };\n\n // The morph itself: one number, animated. Expanded, the pill is as wide as its capsule\n // naturally is; collapsed, as wide as it is tall, which at `radius.pill` is a circle.\n // Left to CSS until the first measurement, so a pill never renders at a guessed width.\n const pillStyle: CSSProperties | undefined =\n box === null ? undefined : { width: open ? box.capsuleWidth : box.pillHeight };\n\n return (\n <div\n ref={pillRef}\n className={cx(styles.pill, { [styles.pillReady]: ready, [styles.pillCollapsed]: !open })}\n style={pillStyle}\n >\n <div className={styles.glass} aria-hidden=\"true\" />\n <div\n ref={containerRef}\n className={cx(styles.capsule, { [styles.capsuleHidden]: !open })}\n // A collapsed pill's destinations are behind a clip, not merely faded:\n // without these they stay in the accessibility tree and the tab order, and a\n // screen reader reads a navigation nobody can see.\n aria-hidden={open ? undefined : true}\n inert={open ? undefined : true}\n >\n <span\n className={cx(styles.lens, { [styles.lensReady]: ready })}\n style={lensStyle}\n aria-hidden=\"true\"\n />\n {items.map(({ to, label, Icon, active, badge }) => (\n <Link key={to} className={styles.item} aria-current={active ? 'page' : undefined} to={to}>\n <BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />\n {label}\n </Link>\n ))}\n {/* The badge is repeated in BOTH visible rows, not just on the real\n tab. The real tab is transparent and these rows paint above it, so a\n badge left only there sat under each row's copy of the icon, whose\n strokes showed through it. Here it paints over the icon, as on\n desktop, and the two copies are pixel-aligned like everything else\n in these rows. */}\n <div className={styles.grayLayer} aria-hidden=\"true\">\n {items.map(({ to, label, Icon, badge }) => (\n <span key={to} className={styles.layerItem}>\n <BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />\n {label}\n </span>\n ))}\n </div>\n <div\n className={cx(styles.reveal, { [styles.revealReady]: ready })}\n style={revealStyle}\n aria-hidden=\"true\"\n >\n {items.map(({ to, label, Icon, badge }) => (\n <span key={to} className={styles.layerItem}>\n <BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />\n {label}\n </span>\n ))}\n </div>\n </div>\n <Link\n className={cx(styles.collapsedLink, {\n [styles.collapsedHidden]: expanded,\n [styles.collapsedActive]: collapsed.active,\n })}\n // The mirror of the capsule's pair above: whichever shape is not showing\n // is out of the accessibility tree and the tab order, so the bar offers\n // exactly what is on screen and nothing else.\n aria-hidden={expanded ? true : undefined}\n inert={expanded ? true : undefined}\n aria-current={collapsed.active ? 'page' : undefined}\n aria-label={collapsed.label}\n to={collapsed.to}\n >\n {/* Same badge wrapper the capsule's own tabs use. A collapsed side\n hides whatever is inside it, so without this a tab that wanted\n attention would go silent exactly when it could not be seen.\n Only while actually COLLAPSED: this shape stays mounted when the\n side is expanded (it is what the pill morphs back to), and a badge\n left in the document there would double-count the one already\n showing on the tab it stands for. */}\n <BadgedIcon\n Icon={CollapsedIcon}\n badge={expanded ? undefined : collapsed.badge}\n size={18}\n styles={styles}\n />\n </Link>\n {/* The scrolled-away shape. A BUTTON, not a link to the active tab: you\n are already there, and what a tap on a minimized bar asks for is the\n bar back, not a navigation (which would also push a history entry\n and scroll the page to its top). Hidden by the same pair as the other\n two shapes, so the bar offers one shape at a time. */}\n <button\n type=\"button\"\n className={cx(styles.minimizedButton, {\n [styles.collapsedHidden]: !showMinimized,\n // Lit only when a tab IS selected. Falling back to the stand-in\n // glyph is not a selection, and a lit stand-in told a reader on\n // Settings that something in the main group was.\n [styles.minimizedActive]: activeItem !== undefined,\n })}\n aria-hidden={showMinimized ? undefined : true}\n inert={showMinimized ? undefined : true}\n aria-expanded={false}\n aria-label=\"Show navigation\"\n onClick={onExpand}\n >\n <BadgedIcon\n Icon={MinimizedIcon}\n badge={showMinimized ? minimizedBadge : undefined}\n size={18}\n styles={styles}\n />\n </button>\n </div>\n );\n};\n\n/**\n * An icon with its badge on the upper-right corner, the way an app badge sits.\n *\n * Same wrapper as `nav-desktop`: the badge is positioned against the ICON, not\n * the whole tab. Anchoring to the tab at a fixed `top`/`right` tracked the\n * tab's geometry rather than the icon's.\n */\nconst BadgedIcon = ({\n Icon,\n badge,\n size,\n styles,\n}: {\n Icon: NavItem['Icon'];\n badge: NavItem['badge'];\n size: number;\n styles: ReturnType<typeof useStyle>;\n}) => (\n <span className={styles.iconWrap}>\n <Icon height={size} width={size} />\n {typeof badge === 'number' && badge > 0 && <span className={styles.badge}>{badge}</span>}\n {badge === 'dot' && <span className={styles.badgeDot} data-testid=\"nav-badge-dot\" />}\n </span>\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/nav-mobile/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAsB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgDtC,MAAM,OAAO,GAAG,CAAC,CAAiB,EAAE,CAAiB,EAAW,EAAE,CAChE,CAAC,IAAI,IAAI;IACT,CAAC,IAAI,IAAI;IACT,CAAC,CAAC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ACpC,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,aAAa;oBACxC,gEAAgE;oBAChE,gEAAgE;oBAChE,iDAAiD;oBACjD,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,UAAU,KAAK,SAAS;iBACnD,CAAC,iBACW,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAC7C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,mBACxB,KAAK,gBACT,iBAAiB,EAC5B,OAAO,EAAE,QAAQ,YAEjB,KAAC,UAAU,IACT,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EACjD,IAAI,EAAE,EAAE,EACR,MAAM,EAAE,MAAM,GACd,GACK,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,EAClB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,GAMP,EAAE,EAAE,CAAC,CACJ,gBAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,aAC9B,KAAC,IAAI,IAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAI,EAClC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,EACvF,KAAK,KAAK,KAAK,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,iBAAc,eAAe,GAAG,IAC/E,CACR,CAAC","sourcesContent":["import cx from 'classnames';\nimport { type CSSProperties, useEffect, useRef, useState } from 'react';\nimport { Link, useLocation } from 'react-router';\n\nimport { useMinimizeOnScroll } from '../../hooks/use-minimize-on-scroll.js';\nimport { useTheme } from '../../theme/index.js';\nimport type { NavItem } from '../nav-types.js';\nimport { useStyle } from './style.js';\n\n/**\n * One side of the bar, in both of the shapes it can take.\n *\n * Both shapes are always rendered, which is what makes the swap a MORPH rather\n * than a cross-fade: the pill around them is a single element whose width\n * animates between the two, so the capsule is seen to shrink into the circle\n * instead of one bar fading out while a different one fades in.\n */\nexport interface NavPill {\n /** Destinations shown while this side is expanded. `[]` makes the side permanently a circle. */\n items: NavItem[];\n /**\n * The single destination it collapses to. Its `label` is the circle's `aria-label`; its\n * `badge` shows only while collapsed; its `active` lights the circle.\n */\n collapsed: NavItem;\n}\n\nexport interface NavMobileProps {\n /** The left-hand side: the app's main destinations. */\n main: NavPill;\n /** The right-hand side: settings. */\n settings: NavPill;\n /** Which side is expanded; the other is a circle. Derive it from the route. */\n expanded: 'main' | 'settings';\n}\n\n/** Horizontal geometry measured from the live DOM. */\ninterface LensBox {\n /** Active tab's left offset within the capsule. */\n left: number;\n /** Active tab's width (the lens/mask width). */\n width: number;\n /** Full capsule width — pins the blue reveal grid so its columns match the real row. */\n capsuleWidth: number;\n /**\n * The PILL's height, not the capsule's, and the diameter it collapses to.\n *\n * Measured from the pill because the row stretches both pills to a common\n * height: a side whose own content is shorter — a reader's settings side has\n * no expanded destinations at all — would otherwise collapse to a circle\n * smaller than the bar beside it.\n */\n pillHeight: number;\n}\n\nconst sameBox = (a: LensBox | null, b: LensBox | null): boolean =>\n a != null &&\n b != null &&\n a.left === b.left &&\n a.width === b.width &&\n a.capsuleWidth === b.capsuleWidth &&\n a.pillHeight === b.pillHeight;\n\n// Narrow navigation pinned to the bottom of the viewport (mobile only): two frosted\n// \"liquid glass\" pills, one expanded and one collapsed to a circle. The expanded one's\n// active tab is wrapped by a glass lens that slides between (equal-width) tabs. A blue\n// copy of the tab row, clipped to the lens, reveals the active color only where the lens\n// is. Hidden at and above the desktop breakpoint.\n//\n// Scrolling down MINIMIZES the expanded side to a circle holding the active\n// tab, the way the iOS tab bar gets out of the way of what you are reading;\n// scrolling up, reaching the top, tapping the circle or changing page brings it\n// back. It is the same morph the route-driven collapse uses — one width\n// animating — so the two never fight: a side is a circle when it is not the\n// expanded side OR the bar is minimized. The other side's circle is left as it\n// is, like the search button iOS keeps beside its minimized bar.\n/**\n * The bottom navigation on phones: two frosted pills, one expanded into tabs and one a\n * circle; scrolling down minimizes it. Must render inside a react-router router, and every\n * `Page` under it needs `bottomNav`.\n */\nexport const NavMobile = ({ main, settings, expanded }: NavMobileProps) => {\n const styles = useStyle();\n const { key } = useLocation();\n const { minimized, expand } = useMinimizeOnScroll({ resetKey: key });\n\n return (\n <nav className={styles.root}>\n <Pill\n pill={main}\n expanded={expanded === 'main'}\n minimized={minimized}\n onExpand={expand}\n styles={styles}\n />\n <Pill\n pill={settings}\n expanded={expanded === 'settings'}\n minimized={minimized}\n onExpand={expand}\n styles={styles}\n />\n </nav>\n );\n};\n\nconst Pill = ({\n pill,\n expanded,\n minimized,\n onExpand,\n styles,\n}: {\n pill: NavPill;\n expanded: boolean;\n /** The bar has scrolled out of the way; an expanded side shows its active tab alone. */\n minimized: boolean;\n onExpand: () => void;\n styles: ReturnType<typeof useStyle>;\n}) => {\n const theme = useTheme();\n const pillRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [box, setBox] = useState<LensBox | null>(null);\n const [shown, setShown] = useState(false);\n const [ready, setReady] = useState(false);\n\n const { items, collapsed } = pill;\n const activeItem = items.find((item) => item.active);\n const activeTo = activeItem?.to;\n const CollapsedIcon = collapsed.Icon;\n\n // The three shapes, exactly one of them showing. `open` is the capsule;\n // the two circles split the rest by WHY the side is a circle.\n const open = expanded && !minimized;\n const showMinimized = expanded && minimized;\n // The minimized circle stands for the capsule it replaced, so it wears the\n // tab you are on — where you are is the one thing worth keeping on screen.\n // When the route maps to no tab it falls back to the side's own collapsed\n // glyph rather than showing nothing.\n const MinimizedIcon = activeItem?.Icon ?? CollapsedIcon;\n // Its badge is the active tab's own when it has one — that tab's icon is\n // what is showing, so its count is honest there — and otherwise a dot for\n // whatever the hidden siblings want, the same claim a collapsed side makes.\n const minimizedBadge: NavItem['badge'] =\n activeItem?.badge ?? (items.some((item) => item.badge !== undefined) ? 'dot' : undefined);\n\n // Measure the active tab's horizontal box (its vertical extent is fixed in CSS) so\n // the lens can wrap and morph to it, plus the two sizes this pill animates between.\n // Runs after paint so the morph transition starts from the on-screen position. Keeps\n // the last lens box when the route maps to no tab, so the lens fades out / back in\n // place. Re-measures on active-tab/tab-set change, on expand/collapse, and on resize.\n useEffect(() => {\n const container = containerRef.current;\n const pillElement = pillRef.current;\n if (!container || !pillElement) return;\n\n const measure = () => {\n const pillBox = pillElement.getBoundingClientRect();\n const containerBox = container.getBoundingClientRect();\n const active = container.querySelector<HTMLElement>('[aria-current=\"page\"]');\n if (!active) {\n // Still record the SIZES. A collapsed pill has no active tab inside it,\n // and an early return here would leave it with no width to animate to.\n setBox((prev) =>\n prev === null\n ? { left: 0, width: 0, capsuleWidth: containerBox.width, pillHeight: pillBox.height }\n : { ...prev, capsuleWidth: containerBox.width, pillHeight: pillBox.height }\n );\n setShown(false);\n return;\n }\n const activeBox = active.getBoundingClientRect();\n const next: LensBox = {\n left: activeBox.left - containerBox.left - container.clientLeft,\n width: activeBox.width,\n capsuleWidth: containerBox.width,\n pillHeight: pillBox.height,\n };\n setBox((prev) => (sameBox(prev, next) ? prev : next));\n setShown(true);\n };\n\n measure();\n\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(container);\n observer.observe(pillElement);\n return () => observer.disconnect();\n }, [activeTo, items.length, expanded]);\n\n // Enable the morph transitions one frame after the first placement, so they are never\n // turned on in the same frame a position or width is first set. Without this a pill\n // would animate its whole width on mount — from the natural capsule width down to a\n // circle — as if the bar were collapsing on arrival.\n useEffect(() => {\n let raf = 0;\n let timer: ReturnType<typeof setTimeout> | undefined;\n if (typeof requestAnimationFrame === 'function') {\n raf = requestAnimationFrame(() => setReady(true));\n } else {\n timer = setTimeout(() => setReady(true), 0);\n }\n return () => {\n if (raf) cancelAnimationFrame(raf);\n if (timer) clearTimeout(timer);\n };\n }, []);\n\n // The lens slides via transform. The blue reveal is a fixed full-row overlay that\n // never moves — instead a clip-path window (matching the lens box) animates over it,\n // so the blue can't drift relative to the tabs; it's simply unmasked as the lens passes.\n const lensStyle: CSSProperties = box\n ? { opacity: shown ? 1 : 0, width: box.width, transform: `translateX(${box.left}px)` }\n : { opacity: 0 };\n const clip = box\n ? `inset(${theme.space.xs} ${box.capsuleWidth - box.left - box.width}px ${theme.space.xs} ${box.left}px round ${theme.radius.pill})`\n : undefined;\n const revealStyle: CSSProperties = box\n ? { opacity: shown ? 1 : 0, clipPath: clip, WebkitClipPath: clip }\n : { opacity: 0 };\n\n // The morph itself: one number, animated. Expanded, the pill is as wide as its capsule\n // naturally is; collapsed, as wide as it is tall, which at `radius.pill` is a circle.\n // Left to CSS until the first measurement, so a pill never renders at a guessed width.\n const pillStyle: CSSProperties | undefined =\n box === null ? undefined : { width: open ? box.capsuleWidth : box.pillHeight };\n\n return (\n <div\n ref={pillRef}\n className={cx(styles.pill, { [styles.pillReady]: ready, [styles.pillCollapsed]: !open })}\n style={pillStyle}\n >\n <div className={styles.glass} aria-hidden=\"true\" />\n <div\n ref={containerRef}\n className={cx(styles.capsule, { [styles.capsuleHidden]: !open })}\n // A collapsed pill's destinations are behind a clip, not merely faded:\n // without these they stay in the accessibility tree and the tab order, and a\n // screen reader reads a navigation nobody can see.\n aria-hidden={open ? undefined : true}\n inert={open ? undefined : true}\n >\n <span\n className={cx(styles.lens, { [styles.lensReady]: ready })}\n style={lensStyle}\n aria-hidden=\"true\"\n />\n {items.map(({ to, label, Icon, active, badge }) => (\n <Link key={to} className={styles.item} aria-current={active ? 'page' : undefined} to={to}>\n <BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />\n {label}\n </Link>\n ))}\n {/* The badge is repeated in BOTH visible rows, not just on the real\n tab. The real tab is transparent and these rows paint above it, so a\n badge left only there sat under each row's copy of the icon, whose\n strokes showed through it. Here it paints over the icon, as on\n desktop, and the two copies are pixel-aligned like everything else\n in these rows. */}\n <div className={styles.grayLayer} aria-hidden=\"true\">\n {items.map(({ to, label, Icon, badge }) => (\n <span key={to} className={styles.layerItem}>\n <BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />\n {label}\n </span>\n ))}\n </div>\n <div\n className={cx(styles.reveal, { [styles.revealReady]: ready })}\n style={revealStyle}\n aria-hidden=\"true\"\n >\n {items.map(({ to, label, Icon, badge }) => (\n <span key={to} className={styles.layerItem}>\n <BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />\n {label}\n </span>\n ))}\n </div>\n </div>\n <Link\n className={cx(styles.collapsedLink, {\n [styles.collapsedHidden]: expanded,\n [styles.collapsedActive]: collapsed.active,\n })}\n // The mirror of the capsule's pair above: whichever shape is not showing\n // is out of the accessibility tree and the tab order, so the bar offers\n // exactly what is on screen and nothing else.\n aria-hidden={expanded ? true : undefined}\n inert={expanded ? true : undefined}\n aria-current={collapsed.active ? 'page' : undefined}\n aria-label={collapsed.label}\n to={collapsed.to}\n >\n {/* Same badge wrapper the capsule's own tabs use. A collapsed side\n hides whatever is inside it, so without this a tab that wanted\n attention would go silent exactly when it could not be seen.\n Only while actually COLLAPSED: this shape stays mounted when the\n side is expanded (it is what the pill morphs back to), and a badge\n left in the document there would double-count the one already\n showing on the tab it stands for. */}\n <BadgedIcon\n Icon={CollapsedIcon}\n badge={expanded ? undefined : collapsed.badge}\n size={18}\n styles={styles}\n />\n </Link>\n {/* The scrolled-away shape. A BUTTON, not a link to the active tab: you\n are already there, and what a tap on a minimized bar asks for is the\n bar back, not a navigation (which would also push a history entry\n and scroll the page to its top). Hidden by the same pair as the other\n two shapes, so the bar offers one shape at a time. */}\n <button\n type=\"button\"\n className={cx(styles.minimizedButton, {\n [styles.collapsedHidden]: !showMinimized,\n // Lit only when a tab IS selected. Falling back to the stand-in\n // glyph is not a selection, and a lit stand-in told a reader on\n // Settings that something in the main group was.\n [styles.minimizedActive]: activeItem !== undefined,\n })}\n aria-hidden={showMinimized ? undefined : true}\n inert={showMinimized ? undefined : true}\n aria-expanded={false}\n aria-label=\"Show navigation\"\n onClick={onExpand}\n >\n <BadgedIcon\n Icon={MinimizedIcon}\n badge={showMinimized ? minimizedBadge : undefined}\n size={18}\n styles={styles}\n />\n </button>\n </div>\n );\n};\n\n/**\n * An icon with its badge on the upper-right corner, the way an app badge sits.\n *\n * Same wrapper as `nav-desktop`: the badge is positioned against the ICON, not\n * the whole tab. Anchoring to the tab at a fixed `top`/`right` tracked the\n * tab's geometry rather than the icon's.\n */\nconst BadgedIcon = ({\n Icon,\n badge,\n size,\n styles,\n}: {\n Icon: NavItem['Icon'];\n badge: NavItem['badge'];\n size: number;\n styles: ReturnType<typeof useStyle>;\n}) => (\n <span className={styles.iconWrap}>\n <Icon height={size} width={size} />\n {typeof badge === 'number' && badge > 0 && <span className={styles.badge}>{badge}</span>}\n {badge === 'dot' && <span className={styles.badgeDot} data-testid=\"nav-badge-dot\" />}\n </span>\n);\n"]}
@@ -2,9 +2,13 @@ import type { ReactElement } from 'react';
2
2
  import type { IconProps } from '../icon/index.js';
3
3
  /** A single navigation destination, shared by the desktop and mobile layouts. */
4
4
  export interface NavItem {
5
+ /** Route path passed to react-router `<Link to>`. Must be unique within a list (it is the key). */
5
6
  to: string;
7
+ /** Visible text. */
6
8
  label: string;
9
+ /** An icon component (`HomeIcon`), not an element. */
7
10
  Icon: (props: IconProps) => ReactElement;
11
+ /** You compute this from the route; the nav does not match routes. Sets `aria-current="page"`. */
8
12
  active: boolean;
9
13
  /** A count of pending fixes, or `'dot'` for "active, nothing to decide yet". */
10
14
  badge?: number | 'dot';
@@ -1 +1 @@
1
- {"version":3,"file":"nav-types.d.ts","sourceRoot":"","sources":["../../src/component/nav-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,iFAAiF;AACjF,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,YAAY,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACxB"}
1
+ {"version":3,"file":"nav-types.d.ts","sourceRoot":"","sources":["../../src/component/nav-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,iFAAiF;AACjF,MAAM,WAAW,OAAO;IACtB,mGAAmG;IACnG,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,YAAY,CAAC;IACzC,kGAAkG;IAClG,MAAM,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"nav-types.js","sourceRoot":"","sources":["../../src/component/nav-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement } from 'react';\n\nimport type { IconProps } from '../icon/index.js';\n\n/** A single navigation destination, shared by the desktop and mobile layouts. */\nexport interface NavItem {\n to: string;\n label: string;\n Icon: (props: IconProps) => ReactElement;\n active: boolean;\n /** A count of pending fixes, or `'dot'` for \"active, nothing to decide yet\". */\n badge?: number | 'dot';\n}\n"]}
1
+ {"version":3,"file":"nav-types.js","sourceRoot":"","sources":["../../src/component/nav-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement } from 'react';\n\nimport type { IconProps } from '../icon/index.js';\n\n/** A single navigation destination, shared by the desktop and mobile layouts. */\nexport interface NavItem {\n /** Route path passed to react-router `<Link to>`. Must be unique within a list (it is the key). */\n to: string;\n /** Visible text. */\n label: string;\n /** An icon component (`HomeIcon`), not an element. */\n Icon: (props: IconProps) => ReactElement;\n /** You compute this from the route; the nav does not match routes. Sets `aria-current=\"page\"`. */\n active: boolean;\n /** A count of pending fixes, or `'dot'` for \"active, nothing to decide yet\". */\n badge?: number | 'dot';\n}\n"]}
@@ -2,9 +2,16 @@ import { PropsWithChildren } from 'react';
2
2
  import { type PageActionItem } from '../../control/page-actions-menu/index.js';
3
3
  import { type FooterAction } from '../../control/page-footer-actions/index.js';
4
4
  import { PageTypeValue } from './style.js';
5
- type PageProps = PropsWithChildren<{
5
+ export type { PageTypeValue };
6
+ export type PageProps = PropsWithChildren<{
7
+ /** `'default'` (default) or `'minimal'`, which drops all layout styles and the header row. */
6
8
  type?: PageTypeValue;
9
+ /** Route path for the back button. **Mobile only**: there is no back button on desktop. */
7
10
  back?: string;
11
+ /**
12
+ * Page-level actions. Desktop: `primary` items as buttons, the rest in a "More…" menu.
13
+ * Mobile: all in a floating menu.
14
+ */
8
15
  headerActions?: PageActionItem[];
9
16
  /** Overrides the overflow trigger's label (default "More…") on the desktop
10
17
  * action bar — e.g. "Actions" when every action lives in the menu. */
@@ -20,6 +27,7 @@ type PageProps = PropsWithChildren<{
20
27
  * slot it lines up with every other page's actions instead.
21
28
  */
22
29
  header?: React.ReactNode;
30
+ /** Sticky footer buttons. */
23
31
  footerActions?: FooterAction[];
24
32
  /** Sets `document.title` when given; the title is not restored on unmount. Leave it
25
33
  * out when the app manages the title itself. */
@@ -28,6 +36,6 @@ type PageProps = PropsWithChildren<{
28
36
  * (`NavMobile`) on mobile. Default `false`. */
29
37
  bottomNav?: boolean;
30
38
  }>;
39
+ /** The `<main>` of every screen: a centred column of Cards, plus back button, header and footer actions. */
31
40
  export declare const Page: ({ children, type, back, headerActions, actionsLabel, header, footerActions, documentTitle, bottomNav, }: PageProps) => import("react").JSX.Element;
32
- export {};
33
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/page/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAKrD,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAsB,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/D,KAAK,SAAS,GAAG,iBAAiB,CAAC;IACjC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,cAAc,EAAE,CAAC;IACjC;0EACsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B;oDACgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;mDAC+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,IAAI,4GAUd,SAAS,gCAuCX,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/page/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAKrD,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAsB,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/D,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;IACxC,8FAA8F;IAC9F,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,cAAc,EAAE,CAAC;IACjC;0EACsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B;oDACgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;mDAC+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,4GAA4G;AAC5G,eAAO,MAAM,IAAI,4GAUd,SAAS,gCAuCX,CAAC"}
@@ -7,6 +7,7 @@ import { PageActionsBar } from '../../control/page-actions-bar/index.js';
7
7
  import { PageActionsMenu } from '../../control/page-actions-menu/index.js';
8
8
  import { PageFooterActions } from '../../control/page-footer-actions/index.js';
9
9
  import { useStyle, PageType } from './style.js';
10
+ /** The `<main>` of every screen: a centred column of Cards, plus back button, header and footer actions. */
10
11
  export const Page = ({ children, type = PageType.default, back, headerActions, actionsLabel, header, footerActions, documentTitle, bottomNav = false, }) => {
11
12
  const styles = useStyle();
12
13
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/page/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAqB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAuB,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAqB,MAAM,4CAA4C,CAAC;AAClG,OAAO,E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AAG,CAAC,IAAI,CAC1D,KAAC,iBAAiB,IAAC,KAAK,EAAE,aAAa,GAAI,CAC5C,IACI,GACE,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { PropsWithChildren, useEffect } from 'react';\nimport { Fragment } from 'react/jsx-runtime';\n\nimport { BackButton } from '../../control/back-button/index.js';\nimport { PageActionsBar } from '../../control/page-actions-bar/index.js';\nimport { PageActionsMenu, type PageActionItem } from '../../control/page-actions-menu/index.js';\nimport { PageFooterActions, type FooterAction } from '../../control/page-footer-actions/index.js';\nimport { useStyle, PageType, PageTypeValue } from './style.js';\n\ntype PageProps = PropsWithChildren<{\n type?: PageTypeValue;\n back?: string;\n headerActions?: PageActionItem[];\n /** Overrides the overflow trigger's label (default \"More…\") on the desktop\n * action bar — e.g. \"Actions\" when every action lives in the menu. */\n actionsLabel?: string;\n /**\n * The page's own chrome for the header row — the row the desktop actions bar\n * occupies, which every default page holds open whether or not it has\n * actions (see `style.ts`).\n *\n * `page/library` passes its `<SearchBar />` here rather than rendering it as\n * the first child: as a child it would sit BELOW the reserved row, starting\n * the one page anyone lands on first lower than every other page. In the\n * slot it lines up with every other page's actions instead.\n */\n header?: React.ReactNode;\n footerActions?: FooterAction[];\n /** Sets `document.title` when given; the title is not restored on unmount. Leave it\n * out when the app manages the title itself. */\n documentTitle?: string;\n /** Reserve space under the content for a floating bottom navigation bar\n * (`NavMobile`) on mobile. Default `false`. */\n bottomNav?: boolean;\n}>;\n\nexport const Page = ({\n children,\n type = PageType.default as PageTypeValue,\n back,\n headerActions,\n actionsLabel,\n header,\n footerActions,\n documentTitle,\n bottomNav = false,\n}: PageProps) => {\n const styles = useStyle();\n\n useEffect(() => {\n if (documentTitle !== undefined) document.title = documentTitle;\n }, [documentTitle]);\n\n const hasHeaderActions = headerActions !== undefined && headerActions.length > 0;\n const hasControls = back !== undefined || hasHeaderActions;\n\n return (\n <Fragment>\n <main className={cx(styles[type], { [styles.bottomNav]: bottomNav })}>\n {hasControls && (\n <div className={styles.controlsRow}>\n {back !== undefined && <BackButton to={back} />}\n {hasHeaderActions && <PageActionsMenu items={headerActions} />}\n </div>\n )}\n {/* Rendered for every default page, EMPTY INCLUDED — holding the row\n open is what keeps pages with and without actions starting their\n content at the same height. A minimal page (login, loading, the\n forced password change) has no nav, no actions and nothing to line\n up with, so it gets no row. */}\n {type === PageType.default && (\n <header className={styles.headerRow}>\n {header}\n {hasHeaderActions && (\n <PageActionsBar items={headerActions} actionsLabel={actionsLabel} />\n )}\n </header>\n )}\n {children}\n {footerActions !== undefined && footerActions.length > 0 && (\n <PageFooterActions items={footerActions} />\n )}\n </main>\n </Fragment>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/page/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAqB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAuB,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAqB,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAsC/D,4GAA4G;AAC5G,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACnB,QAAQ,EACR,IAAI,GAAG,QAAQ,CAAC,OAAwB,EACxC,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,MAAM,EACN,aAAa,EACb,aAAa,EACb,SAAS,GAAG,KAAK,GACP,EAAE,EAAE;IACd,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,aAAa,KAAK,SAAS;YAAE,QAAQ,CAAC,KAAK,GAAG,aAAa,CAAC;IAClE,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,gBAAgB,GAAG,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IACjF,MAAM,WAAW,GAAG,IAAI,KAAK,SAAS,IAAI,gBAAgB,CAAC;IAE3D,OAAO,CACL,KAAC,QAAQ,cACP,gBAAM,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,aACjE,WAAW,IAAI,CACd,eAAK,SAAS,EAAE,MAAM,CAAC,WAAW,aAC/B,IAAI,KAAK,SAAS,IAAI,KAAC,UAAU,IAAC,EAAE,EAAE,IAAI,GAAI,EAC9C,gBAAgB,IAAI,KAAC,eAAe,IAAC,KAAK,EAAE,aAAa,GAAI,IAC1D,CACP,EAMA,IAAI,KAAK,QAAQ,CAAC,OAAO,IAAI,CAC5B,kBAAQ,SAAS,EAAE,MAAM,CAAC,SAAS,aAChC,MAAM,EACN,gBAAgB,IAAI,CACnB,KAAC,cAAc,IAAC,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAI,CACrE,IACM,CACV,EACA,QAAQ,EACR,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC1D,KAAC,iBAAiB,IAAC,KAAK,EAAE,aAAa,GAAI,CAC5C,IACI,GACE,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { PropsWithChildren, useEffect } from 'react';\nimport { Fragment } from 'react/jsx-runtime';\n\nimport { BackButton } from '../../control/back-button/index.js';\nimport { PageActionsBar } from '../../control/page-actions-bar/index.js';\nimport { PageActionsMenu, type PageActionItem } from '../../control/page-actions-menu/index.js';\nimport { PageFooterActions, type FooterAction } from '../../control/page-footer-actions/index.js';\nimport { useStyle, PageType, PageTypeValue } from './style.js';\n\nexport type { PageTypeValue };\n\nexport type PageProps = PropsWithChildren<{\n /** `'default'` (default) or `'minimal'`, which drops all layout styles and the header row. */\n type?: PageTypeValue;\n /** Route path for the back button. **Mobile only**: there is no back button on desktop. */\n back?: string;\n /**\n * Page-level actions. Desktop: `primary` items as buttons, the rest in a \"More…\" menu.\n * Mobile: all in a floating menu.\n */\n headerActions?: PageActionItem[];\n /** Overrides the overflow trigger's label (default \"More…\") on the desktop\n * action bar — e.g. \"Actions\" when every action lives in the menu. */\n actionsLabel?: string;\n /**\n * The page's own chrome for the header row — the row the desktop actions bar\n * occupies, which every default page holds open whether or not it has\n * actions (see `style.ts`).\n *\n * `page/library` passes its `<SearchBar />` here rather than rendering it as\n * the first child: as a child it would sit BELOW the reserved row, starting\n * the one page anyone lands on first lower than every other page. In the\n * slot it lines up with every other page's actions instead.\n */\n header?: React.ReactNode;\n /** Sticky footer buttons. */\n footerActions?: FooterAction[];\n /** Sets `document.title` when given; the title is not restored on unmount. Leave it\n * out when the app manages the title itself. */\n documentTitle?: string;\n /** Reserve space under the content for a floating bottom navigation bar\n * (`NavMobile`) on mobile. Default `false`. */\n bottomNav?: boolean;\n}>;\n\n/** The `<main>` of every screen: a centred column of Cards, plus back button, header and footer actions. */\nexport const Page = ({\n children,\n type = PageType.default as PageTypeValue,\n back,\n headerActions,\n actionsLabel,\n header,\n footerActions,\n documentTitle,\n bottomNav = false,\n}: PageProps) => {\n const styles = useStyle();\n\n useEffect(() => {\n if (documentTitle !== undefined) document.title = documentTitle;\n }, [documentTitle]);\n\n const hasHeaderActions = headerActions !== undefined && headerActions.length > 0;\n const hasControls = back !== undefined || hasHeaderActions;\n\n return (\n <Fragment>\n <main className={cx(styles[type], { [styles.bottomNav]: bottomNav })}>\n {hasControls && (\n <div className={styles.controlsRow}>\n {back !== undefined && <BackButton to={back} />}\n {hasHeaderActions && <PageActionsMenu items={headerActions} />}\n </div>\n )}\n {/* Rendered for every default page, EMPTY INCLUDED — holding the row\n open is what keeps pages with and without actions starting their\n content at the same height. A minimal page (login, loading, the\n forced password change) has no nav, no actions and nothing to line\n up with, so it gets no row. */}\n {type === PageType.default && (\n <header className={styles.headerRow}>\n {header}\n {hasHeaderActions && (\n <PageActionsBar items={headerActions} actionsLabel={actionsLabel} />\n )}\n </header>\n )}\n {children}\n {footerActions !== undefined && footerActions.length > 0 && (\n <PageFooterActions items={footerActions} />\n )}\n </main>\n </Fragment>\n );\n};\n"]}
@@ -1,4 +1,5 @@
1
- type ProgressIndicatorProps = {
1
+ export type ProgressIndicatorProps = {
2
+ /** A **fraction from 0 to 1**, not a percentage (`0.42` shows "42%"). Clamped to 0–1. */
2
3
  value: number;
3
4
  /**
4
5
  * Required, not defaulted (2026-08-13 final review, M-1): `role=
@@ -10,8 +11,9 @@ type ProgressIndicatorProps = {
10
11
  * ${title}`.
11
12
  */
12
13
  ariaLabel: string;
14
+ /** Width and height of the SVG in px (default 40). The label's font size does not scale. */
13
15
  size?: number;
14
16
  };
17
+ /** A small pie-style progress mark plus a "Not started" / "N%" / "Completed" label. */
15
18
  export declare const ProgressIndicator: ({ value, ariaLabel, size }: ProgressIndicatorProps) => import("react").JSX.Element;
16
- export {};
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/progress-indicator/index.tsx"],"names":[],"mappings":"AAEA,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAeF,eAAO,MAAM,iBAAiB,+BAAqC,sBAAsB,gCA2BxF,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/progress-indicator/index.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACnC,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAeF,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,+BAAqC,sBAAsB,gCA2BxF,CAAC"}
@@ -11,6 +11,7 @@ const sectorPath = (pct) => {
11
11
  const largeArc = pct > 50 ? 1 : 0;
12
12
  return `M ${CX} ${CY} L ${CX} ${CY - R_INNER} A ${R_INNER} ${R_INNER} 0 ${largeArc} 1 ${x} ${y} Z`;
13
13
  };
14
+ /** A small pie-style progress mark plus a "Not started" / "N%" / "Completed" label. */
14
15
  export const ProgressIndicator = ({ value, ariaLabel, size = 40 }) => {
15
16
  const style = useStyle();
16
17
  const clamped = Math.min(100, Math.max(0, value * 100));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/progress-indicator/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAiBtC,MAAM,EAAE,GAAG,EAAE,CAAC;AACd,MAAM,EAAE,GAAG,EAAE,CAAC;AACd,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC,mBAAmB;AACvC,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,8DAA8D;AAEjF,MAAM,UAAU,GAAG,CAAC,GAAW,EAAU,EAAE;IACzC,MAAM,KAAK,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACtD,MAAM,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,GAA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CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,GACrF,IACH,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useStyle } from './style.js';\n\ntype ProgressIndicatorProps = {\n value: number;\n /**\n * Required, not defaulted (2026-08-13 final review, M-1): `role=\n * \"progressbar\"` below has no accessible name of its own — a bare number\n * (\"N%\") means nothing out of context to a screen-reader user, and this\n * component has four semantic call sites (book, series, my-progress-row,\n * user-progress-row) that each mean something different. Every caller\n * must say what progress this actually is, e.g. `Reading progress for\n * ${title}`.\n */\n ariaLabel: string;\n size?: number;\n};\n\nconst CX = 50;\nconst CY = 50;\nconst R_INNER = 36; // track and sector\nconst R_RING = 44; // outer ring (gap between inner edge and R_INNER is ~5 units)\n\nconst sectorPath = (pct: number): string => {\n const angle = (pct / 100) * 2 * Math.PI - Math.PI / 2;\n const x = CX + R_INNER * Math.cos(angle);\n const y = CY + R_INNER * Math.sin(angle);\n const largeArc = pct > 50 ? 1 : 0;\n return `M ${CX} ${CY} L ${CX} ${CY - R_INNER} A ${R_INNER} ${R_INNER} 0 ${largeArc} 1 ${x} ${y} Z`;\n};\n\nexport const ProgressIndicator = ({ value, ariaLabel, size = 40 }: ProgressIndicatorProps) => {\n const style = useStyle();\n const clamped = Math.min(100, Math.max(0, value * 100));\n\n return (\n <div className={style.root}>\n {clamped > 0 && clamped < 100 && (\n <svg\n viewBox=\"0 0 100 100\"\n width={size}\n height={size}\n role=\"progressbar\"\n aria-label={ariaLabel}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(clamped)}\n >\n <circle cx={CX} cy={CY} r={R_INNER} className={style.track} />\n <path d={sectorPath(clamped)} className={style.sector} />\n <circle cx={CX} cy={CY} r={R_RING} className={style.ring} />\n </svg>\n )}\n <span className={style.label}>\n {clamped === 0 ? 'Not started' : clamped === 100 ? 'Completed' : `${Math.round(clamped)}%`}\n </span>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/progress-indicator/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAmBtC,MAAM,EAAE,GAAG,EAAE,CAAC;AACd,MAAM,EAAE,GAAG,EAAE,CAAC;AACd,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC,mBAAmB;AACvC,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,8DAA8D;AAEjF,MAAM,UAAU,GAAG,CAAC,GAAW,EAAU,EAAE;IACzC,MAAM,KAAK,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACtD,MAAM,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,MAAM,OAAO,IAAI,OAAO,MAAM,QAAQ,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;AACrG,CAAC,CAAC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,GAAG,EAAE,EAA0B,EAAE,EAAE;IAC3F,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;IAExD,OAAO,CACL,eAAK,SAAS,EAAE,KAAK,CAAC,IAAI,aACvB,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,GAAG,IAAI,CAC/B,eACE,OAAO,EAAC,aAAa,EACrB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,IAAI,EAAC,aAAa,gBACN,SAAS,mBACN,CAAC,mBACD,GAAG,mBACH,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAElC,iBAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,GAAI,EAC9D,eAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,GAAI,EACzD,iBAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,GAAI,IACxD,CACP,EACD,eAAM,SAAS,EAAE,KAAK,CAAC,KAAK,YACzB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,GACrF,IACH,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useStyle } from './style.js';\n\nexport type ProgressIndicatorProps = {\n /** A **fraction from 0 to 1**, not a percentage (`0.42` shows \"42%\"). Clamped to 0–1. */\n value: number;\n /**\n * Required, not defaulted (2026-08-13 final review, M-1): `role=\n * \"progressbar\"` below has no accessible name of its own — a bare number\n * (\"N%\") means nothing out of context to a screen-reader user, and this\n * component has four semantic call sites (book, series, my-progress-row,\n * user-progress-row) that each mean something different. Every caller\n * must say what progress this actually is, e.g. `Reading progress for\n * ${title}`.\n */\n ariaLabel: string;\n /** Width and height of the SVG in px (default 40). The label's font size does not scale. */\n size?: number;\n};\n\nconst CX = 50;\nconst CY = 50;\nconst R_INNER = 36; // track and sector\nconst R_RING = 44; // outer ring (gap between inner edge and R_INNER is ~5 units)\n\nconst sectorPath = (pct: number): string => {\n const angle = (pct / 100) * 2 * Math.PI - Math.PI / 2;\n const x = CX + R_INNER * Math.cos(angle);\n const y = CY + R_INNER * Math.sin(angle);\n const largeArc = pct > 50 ? 1 : 0;\n return `M ${CX} ${CY} L ${CX} ${CY - R_INNER} A ${R_INNER} ${R_INNER} 0 ${largeArc} 1 ${x} ${y} Z`;\n};\n\n/** A small pie-style progress mark plus a \"Not started\" / \"N%\" / \"Completed\" label. */\nexport const ProgressIndicator = ({ value, ariaLabel, size = 40 }: ProgressIndicatorProps) => {\n const style = useStyle();\n const clamped = Math.min(100, Math.max(0, value * 100));\n\n return (\n <div className={style.root}>\n {clamped > 0 && clamped < 100 && (\n <svg\n viewBox=\"0 0 100 100\"\n width={size}\n height={size}\n role=\"progressbar\"\n aria-label={ariaLabel}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(clamped)}\n >\n <circle cx={CX} cy={CY} r={R_INNER} className={style.track} />\n <path d={sectorPath(clamped)} className={style.sector} />\n <circle cx={CX} cy={CY} r={R_RING} className={style.ring} />\n </svg>\n )}\n <span className={style.label}>\n {clamped === 0 ? 'Not started' : clamped === 100 ? 'Completed' : `${Math.round(clamped)}%`}\n </span>\n </div>\n );\n};\n"]}
@@ -1,12 +1,15 @@
1
1
  import { type TagTone } from './style.js';
2
2
  export type { TagTone };
3
- interface TagProps {
3
+ export interface TagProps {
4
+ /** The label. */
4
5
  children: React.ReactNode;
6
+ /** Makes it a button (focusable, Enter/Space, pointer cursor). Receives no event. */
5
7
  onClick?: () => void;
6
- /** `sm` renders a compact chip that fits within a normal text line height. */
8
+ /** `sm` renders a compact chip that fits within a normal text line height. Default `'md'`. */
7
9
  size?: 'sm' | 'md';
8
- /** Colour, from the theme's `color.chip` tokens. `neutral` is a quiet grey. */
10
+ /** Colour, from the theme's `color.chip` tokens (default `'subject'`). `neutral` is a quiet grey. */
9
11
  tone?: TagTone;
10
12
  }
13
+ /** A small coloured chip for a category, status, or value. Optionally clickable. */
11
14
  export declare const Tag: ({ children, onClick, size, tone }: TagProps) => import("react").JSX.Element;
12
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/tag/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,YAAY,CAAC;AAEpD,YAAY,EAAE,OAAO,EAAE,CAAC;AAExB,UAAU,QAAQ;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,GAAG,sCAA0D,QAAQ,gCA2BjF,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/tag/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,YAAY,CAAC;AAEpD,YAAY,EAAE,OAAO,EAAE,CAAC;AAExB,MAAM,WAAW,QAAQ;IACvB,iBAAiB;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8FAA8F;IAC9F,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,qGAAqG;IACrG,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,oFAAoF;AACpF,eAAO,MAAM,GAAG,sCAA0D,QAAQ,gCA2BjF,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import cx from 'classnames';
3
3
  import { useStyle } from './style.js';
4
+ /** A small coloured chip for a category, status, or value. Optionally clickable. */
4
5
  export const Tag = ({ children, onClick, size = 'md', tone = 'subject' }) => {
5
6
  const style = useStyle();
6
7
  return (_jsx("span", { className: cx(style.root, style[`tone-${tone}`], size === 'sm' && style.sm, onClick !== undefined && style.clickable), onClick: onClick, role: onClick !== undefined ? 'button' : undefined, tabIndex: onClick !== undefined ? 0 : undefined, onKeyDown: onClick !== undefined
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/tag/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAgB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAapD,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,SAAS,EAAY,EAAE,EAAE;IACpF,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,EACrB,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,EAAE,EACzB,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,CACzC,EACD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAClD,QAAQ,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC/C,SAAS,EACP,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;gBACJ,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;oBACvC,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;YACH,CAAC,CAAC,SAAS,YAGd,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\n\nimport { type TagTone, useStyle } from './style.js';\n\nexport type { TagTone };\n\ninterface TagProps {\n children: React.ReactNode;\n onClick?: () => void;\n /** `sm` renders a compact chip that fits within a normal text line height. */\n size?: 'sm' | 'md';\n /** Colour, from the theme's `color.chip` tokens. `neutral` is a quiet grey. */\n tone?: TagTone;\n}\n\nexport const Tag = ({ children, onClick, size = 'md', tone = 'subject' }: TagProps) => {\n const style = useStyle();\n return (\n <span\n className={cx(\n style.root,\n style[`tone-${tone}`],\n size === 'sm' && style.sm,\n onClick !== undefined && style.clickable\n )}\n onClick={onClick}\n role={onClick !== undefined ? 'button' : undefined}\n tabIndex={onClick !== undefined ? 0 : undefined}\n onKeyDown={\n onClick !== undefined\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n {children}\n </span>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/tag/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAgB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAepD,oFAAoF;AACpF,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,SAAS,EAAY,EAAE,EAAE;IACpF,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,EACrB,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,EAAE,EACzB,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,CACzC,EACD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAClD,QAAQ,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC/C,SAAS,EACP,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;gBACJ,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;oBACvC,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;YACH,CAAC,CAAC,SAAS,YAGd,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\n\nimport { type TagTone, useStyle } from './style.js';\n\nexport type { TagTone };\n\nexport interface TagProps {\n /** The label. */\n children: React.ReactNode;\n /** Makes it a button (focusable, Enter/Space, pointer cursor). Receives no event. */\n onClick?: () => void;\n /** `sm` renders a compact chip that fits within a normal text line height. Default `'md'`. */\n size?: 'sm' | 'md';\n /** Colour, from the theme's `color.chip` tokens (default `'subject'`). `neutral` is a quiet grey. */\n tone?: TagTone;\n}\n\n/** A small coloured chip for a category, status, or value. Optionally clickable. */\nexport const Tag = ({ children, onClick, size = 'md', tone = 'subject' }: TagProps) => {\n const style = useStyle();\n return (\n <span\n className={cx(\n style.root,\n style[`tone-${tone}`],\n size === 'sm' && style.sm,\n onClick !== undefined && style.clickable\n )}\n onClick={onClick}\n role={onClick !== undefined ? 'button' : undefined}\n tabIndex={onClick !== undefined ? 0 : undefined}\n onKeyDown={\n onClick !== undefined\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n {children}\n </span>\n );\n};\n"]}
@@ -1,2 +1,8 @@
1
+ /** ThemeSetting takes no props. */
2
+ export type ThemeSettingProps = Record<string, never>;
3
+ /**
4
+ * A ready-made "Appearance" `Card` with a Light / Dark / Auto switch bound to the theme. Takes no
5
+ * props; does nothing without a `ThemeProvider` above it.
6
+ */
1
7
  export declare const ThemeSetting: () => import("react").JSX.Element;
2
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/theme-setting/index.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,mCAaxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/theme-setting/index.tsx"],"names":[],"mappings":"AAUA,mCAAmC;AACnC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,YAAY,mCAaxB,CAAC"}
@@ -7,6 +7,10 @@ const OPTIONS = [
7
7
  { value: 'dark', label: 'Dark' },
8
8
  { value: 'auto', label: 'Auto' },
9
9
  ];
10
+ /**
11
+ * A ready-made "Appearance" `Card` with a Light / Dark / Auto switch bound to the theme. Takes no
12
+ * props; does nothing without a `ThemeProvider` above it.
13
+ */
10
14
  export const ThemeSetting = () => {
11
15
  const [setting, setSetting] = useThemeSetting();
12
16
  return (_jsx(Card, { title: "Appearance", children: _jsx(SegmentedControl, { label: "Appearance", value: setting, options: OPTIONS, onChange: setSetting }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/theme-setting/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;CACxB,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,eAAe,EAAE,CAAC;IAEhD,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAC,YAAY,YACtB,KAAC,gBAAgB,IACf,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,UAAU,GACpB,GACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { SegmentedControl } from '../../control/segmented-control/index.js';\nimport { useThemeSetting } from '../../theme/index.js';\nimport { Card } from '../card/index.js';\n\nconst OPTIONS = [\n { value: 'light', label: 'Light' },\n { value: 'dark', label: 'Dark' },\n { value: 'auto', label: 'Auto' },\n] as const;\n\nexport const ThemeSetting = () => {\n const [setting, setSetting] = useThemeSetting();\n\n return (\n <Card title=\"Appearance\">\n <SegmentedControl\n label=\"Appearance\"\n value={setting}\n options={OPTIONS}\n onChange={setSetting}\n />\n </Card>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/theme-setting/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;CACxB,CAAC;AAKX;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,eAAe,EAAE,CAAC;IAEhD,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAC,YAAY,YACtB,KAAC,gBAAgB,IACf,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,UAAU,GACpB,GACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { SegmentedControl } from '../../control/segmented-control/index.js';\nimport { useThemeSetting } from '../../theme/index.js';\nimport { Card } from '../card/index.js';\n\nconst OPTIONS = [\n { value: 'light', label: 'Light' },\n { value: 'dark', label: 'Dark' },\n { value: 'auto', label: 'Auto' },\n] as const;\n\n/** ThemeSetting takes no props. */\nexport type ThemeSettingProps = Record<string, never>;\n\n/**\n * A ready-made \"Appearance\" `Card` with a Light / Dark / Auto switch bound to the theme. Takes no\n * props; does nothing without a `ThemeProvider` above it.\n */\nexport const ThemeSetting = () => {\n const [setting, setSetting] = useThemeSetting();\n\n return (\n <Card title=\"Appearance\">\n <SegmentedControl\n label=\"Appearance\"\n value={setting}\n options={OPTIONS}\n onChange={setSetting}\n />\n </Card>\n );\n};\n"]}
@@ -1,2 +1,9 @@
1
+ /** TopFade takes no props. */
2
+ export type TopFadeProps = Record<string, never>;
3
+ /**
4
+ * Mobile-only scrim: a fixed frosted-glass layer at the top of the viewport that blurs
5
+ * scrolling content beneath the device status bar and fades out below it (Safari-style).
6
+ * Takes no props. Render once, only in the installed app (`isStandalone()`).
7
+ */
1
8
  export declare const TopFade: () => import("react").JSX.Element;
2
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/top-fade/index.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,mCAGnB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/top-fade/index.tsx"],"names":[],"mappings":"AAEA,8BAA8B;AAC9B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,OAAO,mCAGnB,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useStyle } from './style.js';
3
- // Mobile-only scrim: a fixed frosted-glass layer at the top of the viewport that blurs
4
- // scrolling content beneath the device status bar and fades out below it (Safari-style).
3
+ /**
4
+ * Mobile-only scrim: a fixed frosted-glass layer at the top of the viewport that blurs
5
+ * scrolling content beneath the device status bar and fades out below it (Safari-style).
6
+ * Takes no props. Render once, only in the installed app (`isStandalone()`).
7
+ */
5
8
  export const TopFade = () => {
6
9
  const styles = useStyle();
7
10
  return _jsx("div", { className: styles.root, "aria-hidden": "true" });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/top-fade/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,uFAAuF;AACvF,yFAAyF;AACzF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,iBAAc,MAAM,GAAG,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["import { useStyle } from './style.js';\n\n// Mobile-only scrim: a fixed frosted-glass layer at the top of the viewport that blurs\n// scrolling content beneath the device status bar and fades out below it (Safari-style).\nexport const TopFade = () => {\n const styles = useStyle();\n return <div className={styles.root} aria-hidden=\"true\" />;\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/top-fade/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,iBAAc,MAAM,GAAG,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["import { useStyle } from './style.js';\n\n/** TopFade takes no props. */\nexport type TopFadeProps = Record<string, never>;\n\n/**\n * Mobile-only scrim: a fixed frosted-glass layer at the top of the viewport that blurs\n * scrolling content beneath the device status bar and fades out below it (Safari-style).\n * Takes no props. Render once, only in the installed app (`isStandalone()`).\n */\nexport const TopFade = () => {\n const styles = useStyle();\n return <div className={styles.root} aria-hidden=\"true\" />;\n};\n"]}
@@ -16,12 +16,19 @@ export interface PageActionIntentProps {
16
16
  onFocus: () => void;
17
17
  onTouchStart: () => void;
18
18
  }
19
+ /** One page action, shared by `PageActionsBar` and `PageActionsMenu`. */
19
20
  export interface PageActionItem {
21
+ /** Button or menu text. Must be unique: it is the React key. */
20
22
  label: string;
23
+ /** Receives no event. In a menu, the menu closes first. */
21
24
  onClick: () => void;
25
+ /** Red text or treatment. Styling only; it does not add a separator. */
22
26
  danger?: boolean;
27
+ /** Greys the item out and blocks selection. */
23
28
  disabled?: boolean;
29
+ /** `PageActionsBar` only: render as an inline Button instead of in the overflow menu. */
24
30
  primary?: boolean;
31
+ /** `PageActionsBar` primary items only: side of the bar; anything but `'leading'` is trailing. */
25
32
  align?: 'leading' | 'trailing';
26
33
  /** Fires ahead of `onClick`, on intent to click — see
27
34
  * `PageActionIntentProps`. Used to prefetch what selecting this item is
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/control/action-menu-list/index.tsx"],"names":[],"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AAK,GAAG,CAAC,IAAI,CACpC,cAAK,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,EAAC,WAAW,GAAG,CACtD,EACD,iBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,EAChE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KACzB,IAAI,CAAC,WAAW,YAEnB,IAAI,CAAC,KAAK,GACJ,KAbI,IAAI,CAAC,KAAK,CAcd,CACZ,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import cx from 'classnames';\nimport { Fragment } from 'react';\n\nimport { useStyle } from './style.js';\n\n/**\n * Hover/focus/touch handlers to spread onto a menu item — structurally\n * `usePrefetchOnIntent`'s `intentProps` (`~/lib/use-prefetch-on-intent`),\n * declared as a plain shape here so this control keeps its zero-dependency\n * relationship with Apollo.\n *\n * NOT applied to PRIMARY items: those render through `PageActionsBar`'s\n * `Button` (`~/control/button`), whose props are an explicit allow-list with\n * no pointer handlers on it. Every intent-carrying action so far is an\n * overflow item, so widening `Button` was not worth doing speculatively —\n * but a future primary action that wants prefetch needs that change first,\n * rather than silently getting nothing.\n */\nexport interface PageActionIntentProps {\n onMouseEnter: () => void;\n onFocus: () => void;\n onTouchStart: () => void;\n}\n\nexport interface PageActionItem {\n label: string;\n onClick: () => void;\n danger?: boolean;\n disabled?: boolean;\n primary?: boolean;\n align?: 'leading' | 'trailing';\n /** Fires ahead of `onClick`, on intent to click — see\n * `PageActionIntentProps`. Used to prefetch what selecting this item is\n * about to need. */\n intentProps?: PageActionIntentProps;\n /** Render a divider immediately above this item (ignored on the first item),\n * grouping it apart from the items before it. `danger` only affects styling,\n * not grouping — a caller that wants a destructive item set off must say so\n * explicitly here. */\n separatorBefore?: boolean;\n}\n\nexport type ActionMenuSurface = 'solid' | 'glass';\n\ninterface ActionMenuListProps {\n items: PageActionItem[];\n surface: ActionMenuSurface;\n onSelect: (item: PageActionItem) => void;\n}\n\nexport function ActionMenuList({ items, surface, onSelect }: ActionMenuListProps) {\n const styles = useStyle();\n\n return (\n <div className={cx(styles.popover, styles[surface])} role=\"menu\">\n {items.map((item, index) => (\n <Fragment key={item.label}>\n {item.separatorBefore && index > 0 && (\n <div className={styles.separator} role=\"separator\" />\n )}\n <button\n type=\"button\"\n role=\"menuitem\"\n className={cx(styles.item, { [styles.itemDanger]: item.danger })}\n disabled={item.disabled}\n onClick={() => onSelect(item)}\n {...item.intentProps}\n >\n {item.label}\n </button>\n </Fragment>\n ))}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/control/action-menu-list/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAsDtC,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAuB;IAC9E,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAC,MAAM,YAC7D,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,MAAC,QAAQ,eACN,IAAI,CAAC,eAAe,IAAI,KAAK,GAAG,CAAC,IAAI,CACpC,cAAK,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,EAAC,WAAW,GAAG,CACtD,EACD,iBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,EAChE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KACzB,IAAI,CAAC,WAAW,YAEnB,IAAI,CAAC,KAAK,GACJ,KAbI,IAAI,CAAC,KAAK,CAcd,CACZ,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import cx from 'classnames';\nimport { Fragment } from 'react';\n\nimport { useStyle } from './style.js';\n\n/**\n * Hover/focus/touch handlers to spread onto a menu item — structurally\n * `usePrefetchOnIntent`'s `intentProps` (`~/lib/use-prefetch-on-intent`),\n * declared as a plain shape here so this control keeps its zero-dependency\n * relationship with Apollo.\n *\n * NOT applied to PRIMARY items: those render through `PageActionsBar`'s\n * `Button` (`~/control/button`), whose props are an explicit allow-list with\n * no pointer handlers on it. Every intent-carrying action so far is an\n * overflow item, so widening `Button` was not worth doing speculatively —\n * but a future primary action that wants prefetch needs that change first,\n * rather than silently getting nothing.\n */\nexport interface PageActionIntentProps {\n onMouseEnter: () => void;\n onFocus: () => void;\n onTouchStart: () => void;\n}\n\n/** One page action, shared by `PageActionsBar` and `PageActionsMenu`. */\nexport interface PageActionItem {\n /** Button or menu text. Must be unique: it is the React key. */\n label: string;\n /** Receives no event. In a menu, the menu closes first. */\n onClick: () => void;\n /** Red text or treatment. Styling only; it does not add a separator. */\n danger?: boolean;\n /** Greys the item out and blocks selection. */\n disabled?: boolean;\n /** `PageActionsBar` only: render as an inline Button instead of in the overflow menu. */\n primary?: boolean;\n /** `PageActionsBar` primary items only: side of the bar; anything but `'leading'` is trailing. */\n align?: 'leading' | 'trailing';\n /** Fires ahead of `onClick`, on intent to click — see\n * `PageActionIntentProps`. Used to prefetch what selecting this item is\n * about to need. */\n intentProps?: PageActionIntentProps;\n /** Render a divider immediately above this item (ignored on the first item),\n * grouping it apart from the items before it. `danger` only affects styling,\n * not grouping — a caller that wants a destructive item set off must say so\n * explicitly here. */\n separatorBefore?: boolean;\n}\n\nexport type ActionMenuSurface = 'solid' | 'glass';\n\ninterface ActionMenuListProps {\n items: PageActionItem[];\n surface: ActionMenuSurface;\n onSelect: (item: PageActionItem) => void;\n}\n\nexport function ActionMenuList({ items, surface, onSelect }: ActionMenuListProps) {\n const styles = useStyle();\n\n return (\n <div className={cx(styles.popover, styles[surface])} role=\"menu\">\n {items.map((item, index) => (\n <Fragment key={item.label}>\n {item.separatorBefore && index > 0 && (\n <div className={styles.separator} role=\"separator\" />\n )}\n <button\n type=\"button\"\n role=\"menuitem\"\n className={cx(styles.item, { [styles.itemDanger]: item.danger })}\n disabled={item.disabled}\n onClick={() => onSelect(item)}\n {...item.intentProps}\n >\n {item.label}\n </button>\n </Fragment>\n ))}\n </div>\n );\n}\n"]}
@@ -1,6 +1,13 @@
1
- interface BackButtonProps {
1
+ export interface BackButtonProps {
2
+ /**
3
+ * Path to navigate to. Pushes a new history entry (it does not go back in
4
+ * history), asking the destination to restore its scroll position.
5
+ */
2
6
  to: string;
3
7
  }
8
+ /**
9
+ * Round glass "Back" button that navigates to `to`. Mobile-only (hidden at
10
+ * 641px and up); needs a react-router router. Prefer `Page back="…"`.
11
+ */
4
12
  export declare function BackButton({ to }: BackButtonProps): import("react").JSX.Element;
5
- export {};
6
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/control/back-button/index.tsx"],"names":[],"mappings":"AAMA,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,+BAiCjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/control/back-button/index.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,+BAiCjD"}
@@ -3,6 +3,10 @@ import { useCallback } from 'react';
3
3
  import { useNavigate } from 'react-router';
4
4
  import { ChevronIcon } from '../../icon/index.js';
5
5
  import { useStyle } from './style.js';
6
+ /**
7
+ * Round glass "Back" button that navigates to `to`. Mobile-only (hidden at
8
+ * 641px and up); needs a react-router router. Prefer `Page back="…"`.
9
+ */
6
10
  export function BackButton({ to }) {
7
11
  const styles = useStyle();
8
12
  const navigate = useNavigate();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/control/back-button/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAMtC,MAAM,UAAU,UAAU,CAAC,EAAE,EAAE,EAAmB;IAChD,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,mFAAmF;IACnF,sFAAsF;IACtF,MAAM,WAAW,GAAG,WAAW,CAC7B,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,CAAC,EACtD,CAAC,QAAQ,EAAE,EAAE,CAAC,CACf,CAAC;IAEF,MAAM,aAAa,GAAG,WAAW,CAC/B,CAAC,KAA0C,EAAE,EAAE;QAC7C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YAC/C,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,QAAQ,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACnD,CAAC;IACH,CAAC,EACD,CAAC,QAAQ,EAAE,EAAE,CAAC,CACf,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACA,MAAM,EACjB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,YAExB,KAAC,WAAW,IAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,iBAAc,MAAM,GAAG,GAC7E,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport { useNavigate } from 'react-router';\n\nimport { ChevronIcon } from '../../icon/index.js';\nimport { useStyle } from './style.js';\n\ninterface BackButtonProps {\n to: string;\n}\n\nexport function BackButton({ to }: BackButtonProps) {\n const styles = useStyle();\n const navigate = useNavigate();\n\n // This is a forward push (a new history entry), not a real POP, so tell the scroll\n // manager to restore the destination's remembered position instead of jumping to top.\n const handleClick = useCallback(\n () => navigate(to, { state: { restoreScroll: true } }),\n [navigate, to]\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n navigate(to, { state: { restoreScroll: true } });\n }\n },\n [navigate, to]\n );\n\n return (\n <div\n className={styles.root}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Back\"\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n <ChevronIcon className={styles.icon} width={20} height={20} aria-hidden=\"true\" />\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/control/back-button/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAA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avigate } from 'react-router';\n\nimport { ChevronIcon } from '../../icon/index.js';\nimport { useStyle } from './style.js';\n\nexport interface BackButtonProps {\n /**\n * Path to navigate to. Pushes a new history entry (it does not go back in\n * history), asking the destination to restore its scroll position.\n */\n to: string;\n}\n\n/**\n * Round glass \"Back\" button that navigates to `to`. Mobile-only (hidden at\n * 641px and up); needs a react-router router. Prefer `Page back=\"…\"`.\n */\nexport function BackButton({ to }: BackButtonProps) {\n const styles = useStyle();\n const navigate = useNavigate();\n\n // This is a forward push (a new history entry), not a real POP, so tell the scroll\n // manager to restore the destination's remembered position instead of jumping to top.\n const handleClick = useCallback(\n () => navigate(to, { state: { restoreScroll: true } }),\n [navigate, to]\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n navigate(to, { state: { restoreScroll: true } });\n }\n },\n [navigate, to]\n );\n\n return (\n <div\n className={styles.root}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Back\"\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n <ChevronIcon className={styles.icon} width={20} height={20} aria-hidden=\"true\" />\n </div>\n );\n}\n"]}