@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
package/AGENTS.md CHANGED
@@ -34,6 +34,9 @@ To load this guide in a consuming app, add this line to its `CLAUDE.md` or
34
34
  | `@korzun/design` | everything above, flat, plus `applyTransparency`; the `ThemeSetting` type is renamed `ThemeSettingValue` here |
35
35
 
36
36
  Import only from these entry points, never from `dist/…` or `src/…` paths.
37
+ Every component exports its props type as `<Name>Props` (`ButtonProps`,
38
+ `CardProps`, …), and every prop has a JSDoc comment, so hover or read the
39
+ `.d.ts` for details.
37
40
 
38
41
  ## Rules
39
42
 
@@ -1,15 +1,26 @@
1
1
  import { PropsWithChildren, ReactNode, ReactElement } from 'react';
2
- export type Props = PropsWithChildren<{
2
+ export type CardProps = PropsWithChildren<{
3
+ /** On the outer element. Override with `'&&'` specificity, never `!important`. */
3
4
  className?: string;
5
+ /** Starts a collapsible card collapsed. Defaults to **true**: pass `false` to start open. Uncontrolled. */
4
6
  defaultCollapsed?: boolean;
7
+ /** Grey footer bar, right-aligned. Clicks don't bubble to `onClick`. Hidden while collapsed. */
5
8
  footer?: ReactNode;
9
+ /** Right side of the header. Clicks and keys here don't bubble to `onClick` or the collapse toggle. */
6
10
  headerAction?: ReactNode | ReactElement[];
11
+ /** Header becomes a `role="button"` toggle (Enter/Space) with a chevron. Collapsed content unmounts. */
7
12
  isCollapsible?: boolean;
13
+ /** Whole-card click. The card is not focusable; Enter/Space bubbling from any focused child fires it. */
8
14
  onClick?: () => void;
15
+ /** Header click. Ignored when `isCollapsible` (the header toggles instead); its presence renders a header. */
9
16
  onClickHeader?: () => void;
17
+ /** `'large'` (default): `space.xl` body padding. `'small'`: 1px body padding, for list rows. */
10
18
  size?: 'small' | 'large';
19
+ /** Small faint text after the title. */
11
20
  subTitle?: string;
21
+ /** Header title. */
12
22
  title?: string | ReactNode;
13
23
  }>;
14
- export declare const Card: ({ children, className, defaultCollapsed, footer, headerAction, isCollapsible, onClick, onClickHeader, size, subTitle, title, }: Props) => import("react").JSX.Element;
24
+ /** The bordered surface each feature on a screen lives in: optional header, padded body, optional footer. */
25
+ export declare const Card: ({ children, className, defaultCollapsed, footer, headerAction, isCollapsible, onClick, onClickHeader, size, subTitle, title, }: CardProps) => import("react").JSX.Element;
15
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/card/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AAK1F,MAAM,MAAM,KAAK,GAAG,iBAAiB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,GAAG,YAAY,EAAE,CAAC;IAC1C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC,CAAC;AACH,eAAO,MAAM,IAAI,mIAYd,KAAK,gCA4FP,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/card/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AAK1F,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;IACxC,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2GAA2G;IAC3G,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gGAAgG;IAChG,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,uGAAuG;IACvG,YAAY,CAAC,EAAE,SAAS,GAAG,YAAY,EAAE,CAAC;IAC1C,wGAAwG;IACxG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yGAAyG;IACzG,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8GAA8G;IAC9G,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gGAAgG;IAChG,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC,CAAC;AAEH,6GAA6G;AAC7G,eAAO,MAAM,IAAI,mIAYd,SAAS,gCA4FX,CAAC"}
@@ -3,6 +3,7 @@ import cx from 'classnames';
3
3
  import { useCallback, useState } from 'react';
4
4
  import { ChevronCircleIcon } from '../../icon/index.js';
5
5
  import { useStyle } from './style.js';
6
+ /** The bordered surface each feature on a screen lives in: optional header, padded body, optional footer. */
6
7
  export const Card = ({ children, className, defaultCollapsed = true, footer, headerAction, isCollapsible = false, onClick, onClickHeader, size = 'large', subTitle, title, }) => {
7
8
  const style = useStyle();
8
9
  const [isExpanded, setIsExpanded] = useState(!defaultCollapsed);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/card/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAA8C,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AActC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACnB,QAAQ,EACR,SAAS,EACT,gBAAgB,GAAG,IAAI,EACvB,MAAM,EACN,YAAY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,CAC3C,CAAC,EACH,QAAQ,IAAI,cAAK,SAAS,EAAE,KAAK,CAAC,QAAQ,YAAG,QAAQ,GAAO,IACzD,CACP,EACD,cAAK,SAAS,EAAE,KAAK,CAAC,MAAM,GAAI,EAC/B,YAAY,IAAI,CACf,cACE,SAAS,EAAE,KAAK,CAAC,YAAY,EAC7B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACnC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,YAEpC,YAAY,GACT,CACP,IACG,CACP,EACA,eAAe,IAAI,cAAK,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,YAAG,eAAe,GAAO,EAC1F,MAAM,IAAI,CAAC,CAAC,aAAa,IAAI,UAAU,CAAC,IAAI,CAC3C,cACE,SAAS,EAAE,KAAK,CAAC,MAAM,EACvB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACnC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,YAEpC,MAAM,GACH,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { PropsWithChildren, ReactNode, ReactElement, useCallback, useState } from 'react';\n\nimport { ChevronCircleIcon } from '../../icon/index.js';\nimport { useStyle } from './style.js';\n\nexport type Props = PropsWithChildren<{\n className?: string;\n defaultCollapsed?: boolean;\n footer?: ReactNode;\n headerAction?: ReactNode | ReactElement[];\n isCollapsible?: boolean;\n onClick?: () => void;\n onClickHeader?: () => void;\n size?: 'small' | 'large';\n subTitle?: string;\n title?: string | ReactNode;\n}>;\nexport const Card = ({\n children,\n className,\n defaultCollapsed = true,\n footer,\n headerAction,\n isCollapsible = false,\n onClick,\n onClickHeader,\n size = 'large',\n subTitle,\n title,\n}: Props) => {\n const style = useStyle();\n const [isExpanded, setIsExpanded] = useState<boolean>(!defaultCollapsed);\n const handleToggle = useCallback(() => setIsExpanded((prev) => !prev), []);\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n if (onClick) {\n onClick();\n }\n }\n },\n [onClick]\n );\n\n const handleHeaderKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (!isCollapsible) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleToggle();\n }\n },\n [handleToggle, isCollapsible]\n );\n\n const visibleChildren = isCollapsible ? (isExpanded ? children : null) : children;\n\n return (\n <div\n className={cx(style.root, style[size], className, {\n [style.clickable]: onClick !== undefined,\n })}\n onClick={onClick}\n onKeyDown={handleKeyDown}\n >\n {(title || subTitle || headerAction || onClickHeader || isCollapsible) && (\n <div\n className={cx(style.header, {\n [style.collapsed]: !visibleChildren,\n [style.clickable]: onClickHeader !== undefined || isCollapsible,\n })}\n onClick={isCollapsible ? handleToggle : (onClickHeader ?? undefined)}\n onKeyDown={handleHeaderKeyDown}\n role={isCollapsible ? 'button' : undefined}\n tabIndex={isCollapsible ? 0 : undefined}\n aria-expanded={isCollapsible ? isExpanded : undefined}\n >\n {(title || subTitle) && (\n <div className={style.titleGroup}>\n {title &&\n (isCollapsible ? (\n <div className={style.titleWrapper}>\n <ChevronCircleIcon\n className={cx(\n style.chevron,\n isExpanded ? style.chevronExpanded : style.chevronCollapsed\n )}\n />\n <div className={style.title}>{title}</div>\n </div>\n ) : (\n <div className={style.title}>{title}</div>\n ))}\n {subTitle && <div className={style.subTitle}>{subTitle}</div>}\n </div>\n )}\n <div className={style.spacer} />\n {headerAction && (\n <div\n className={style.headerAction}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {headerAction}\n </div>\n )}\n </div>\n )}\n {visibleChildren && <div className={cx(style.content, style[size])}>{visibleChildren}</div>}\n {footer && (!isCollapsible || isExpanded) && (\n <div\n className={style.footer}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {footer}\n </div>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/card/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAA8C,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAyBtC,6GAA6G;AAC7G,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACnB,QAAQ,EACR,SAAS,EACT,gBAAgB,GAAG,IAAI,EACvB,MAAM,EACN,YAAY,EACZ,aAAa,GAAG,KAAK,EACrB,OAAO,EACP,aAAa,EACb,IAAI,GAAG,OAAO,EACd,QAAQ,EACR,KAAK,GACK,EAAE,EAAE;IACd,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAU,CAAC,gBAAgB,CAAC,CAAC;IACzE,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAE3E,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,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,MAAM,mBAAmB,GAAG,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SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,YAEpC,MAAM,GACH,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { PropsWithChildren, ReactNode, ReactElement, useCallback, useState } from 'react';\n\nimport { ChevronCircleIcon } from '../../icon/index.js';\nimport { useStyle } from './style.js';\n\nexport type CardProps = PropsWithChildren<{\n /** On the outer element. Override with `'&&'` specificity, never `!important`. */\n className?: string;\n /** Starts a collapsible card collapsed. Defaults to **true**: pass `false` to start open. Uncontrolled. */\n defaultCollapsed?: boolean;\n /** Grey footer bar, right-aligned. Clicks don't bubble to `onClick`. Hidden while collapsed. */\n footer?: ReactNode;\n /** Right side of the header. Clicks and keys here don't bubble to `onClick` or the collapse toggle. */\n headerAction?: ReactNode | ReactElement[];\n /** Header becomes a `role=\"button\"` toggle (Enter/Space) with a chevron. Collapsed content unmounts. */\n isCollapsible?: boolean;\n /** Whole-card click. The card is not focusable; Enter/Space bubbling from any focused child fires it. */\n onClick?: () => void;\n /** Header click. Ignored when `isCollapsible` (the header toggles instead); its presence renders a header. */\n onClickHeader?: () => void;\n /** `'large'` (default): `space.xl` body padding. `'small'`: 1px body padding, for list rows. */\n size?: 'small' | 'large';\n /** Small faint text after the title. */\n subTitle?: string;\n /** Header title. */\n title?: string | ReactNode;\n}>;\n\n/** The bordered surface each feature on a screen lives in: optional header, padded body, optional footer. */\nexport const Card = ({\n children,\n className,\n defaultCollapsed = true,\n footer,\n headerAction,\n isCollapsible = false,\n onClick,\n onClickHeader,\n size = 'large',\n subTitle,\n title,\n}: CardProps) => {\n const style = useStyle();\n const [isExpanded, setIsExpanded] = useState<boolean>(!defaultCollapsed);\n const handleToggle = useCallback(() => setIsExpanded((prev) => !prev), []);\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n if (onClick) {\n onClick();\n }\n }\n },\n [onClick]\n );\n\n const handleHeaderKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (!isCollapsible) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleToggle();\n }\n },\n [handleToggle, isCollapsible]\n );\n\n const visibleChildren = isCollapsible ? (isExpanded ? children : null) : children;\n\n return (\n <div\n className={cx(style.root, style[size], className, {\n [style.clickable]: onClick !== undefined,\n })}\n onClick={onClick}\n onKeyDown={handleKeyDown}\n >\n {(title || subTitle || headerAction || onClickHeader || isCollapsible) && (\n <div\n className={cx(style.header, {\n [style.collapsed]: !visibleChildren,\n [style.clickable]: onClickHeader !== undefined || isCollapsible,\n })}\n onClick={isCollapsible ? handleToggle : (onClickHeader ?? undefined)}\n onKeyDown={handleHeaderKeyDown}\n role={isCollapsible ? 'button' : undefined}\n tabIndex={isCollapsible ? 0 : undefined}\n aria-expanded={isCollapsible ? isExpanded : undefined}\n >\n {(title || subTitle) && (\n <div className={style.titleGroup}>\n {title &&\n (isCollapsible ? (\n <div className={style.titleWrapper}>\n <ChevronCircleIcon\n className={cx(\n style.chevron,\n isExpanded ? style.chevronExpanded : style.chevronCollapsed\n )}\n />\n <div className={style.title}>{title}</div>\n </div>\n ) : (\n <div className={style.title}>{title}</div>\n ))}\n {subTitle && <div className={style.subTitle}>{subTitle}</div>}\n </div>\n )}\n <div className={style.spacer} />\n {headerAction && (\n <div\n className={style.headerAction}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {headerAction}\n </div>\n )}\n </div>\n )}\n {visibleChildren && <div className={cx(style.content, style[size])}>{visibleChildren}</div>}\n {footer && (!isCollapsible || isExpanded) && (\n <div\n className={style.footer}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {footer}\n </div>\n )}\n </div>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/component/card/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEnE,eAAO,MAAM,QAAQ;;oRAkElB,CAAC"}
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/component/card/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEnE,eAAO,MAAM,QAAQ;;oRAoElB,CAAC"}
@@ -2,7 +2,9 @@ import { createUseStyles } from '../../theme/index.js';
2
2
  export const useStyle = createUseStyles((theme) => ({
3
3
  root: {
4
4
  ...theme.recipe.card.shell,
5
- '&$small': { borderRadius: '9px' },
5
+ // A small card insets its content by 1px, so it is md + 1px: concentric with the
6
+ // md-cornered children (covers, rows) that sit flush inside it.
7
+ '&$small': { borderRadius: `calc(${theme.radius.md} + 1px)` },
6
8
  },
7
9
  header: {
8
10
  ...theme.recipe.card.header,
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/component/card/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,sBAAsB,CAAC;AAEnE,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE;QACJ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;QAC1B,SAAS,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE;KACnC;IACD,MAAM,EAAE;QACN,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;QAC3B,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;QACjD,aAAa,EAAE;YACb,iBAAiB,EAAE,MAAM;SAC1B;KACF;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE;K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IAChC,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACV,CAAC,CAAC,CAAC","sourcesContent":["import { createUseStyles, type Theme } from '../../theme/index.js';\n\nexport const useStyle = createUseStyles((theme: Theme) => ({\n root: {\n ...theme.recipe.card.shell,\n '&$small': { borderRadius: '9px' },\n },\n header: {\n ...theme.recipe.card.header,\n '&$danger': { color: theme.color.danger.default },\n '&$collapsed': {\n borderBottomStyle: 'none',\n },\n },\n headerAction: {\n display: 'flex',\n gap: theme.space.sm,\n },\n footer: {\n ...theme.recipe.card.footer,\n },\n title: {\n fontWeight: theme.fontWeight.semibold,\n fontSize: theme.fontSize.md,\n color: theme.color.text.muted,\n },\n subTitle: {\n fontSize: theme.fontSize.xs,\n color: theme.color.text.faint,\n marginLeft: theme.space.xs,\n },\n spacer: { flexGrow: 1 },\n content: {\n '&$small': {\n padding: '1px',\n },\n '&$large': { padding: theme.space.xl },\n },\n titleGroup: {\n display: 'flex',\n alignItems: 'baseline',\n },\n titleWrapper: {\n display: 'flex',\n alignItems: 'baseline',\n gap: theme.space.xl,\n },\n chevron: {\n position: 'relative',\n top: '4.5px', // sub-pixel optical centering\n left: '1.5px',\n display: 'block',\n height: '20px',\n width: '20px',\n margin: '-6px',\n transition: `transform ${theme.transition.medium}`,\n },\n chevronCollapsed: {\n transform: 'rotate(0deg)',\n },\n chevronExpanded: {\n transform: 'rotate(90deg)',\n },\n clickable: { cursor: 'pointer' },\n collapsed: {},\n danger: {},\n small: {},\n large: {},\n}));\n"]}
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/component/card/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,sBAAsB,CAAC;AAEnE,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE;QACJ,GAAG,KAAK,CAAC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AAG,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE;KACpB;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,OAAO,EAAE,8BAA8B;QAC5C,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,aAAa,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE;KACnD;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,cAAc;KAC1B;IACD,eAAe,EAAE;QACf,SAAS,EAAE,eAAe;KAC3B;IACD,SAAS,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;IAChC,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACV,CAAC,CAAC,CAAC","sourcesContent":["import { createUseStyles, type Theme } from '../../theme/index.js';\n\nexport const useStyle = createUseStyles((theme: Theme) => ({\n root: {\n ...theme.recipe.card.shell,\n // A small card insets its content by 1px, so it is md + 1px: concentric with the\n // md-cornered children (covers, rows) that sit flush inside it.\n '&$small': { borderRadius: `calc(${theme.radius.md} + 1px)` },\n },\n header: {\n ...theme.recipe.card.header,\n '&$danger': { color: theme.color.danger.default },\n '&$collapsed': {\n borderBottomStyle: 'none',\n },\n },\n headerAction: {\n display: 'flex',\n gap: theme.space.sm,\n },\n footer: {\n ...theme.recipe.card.footer,\n },\n title: {\n fontWeight: theme.fontWeight.semibold,\n fontSize: theme.fontSize.md,\n color: theme.color.text.muted,\n },\n subTitle: {\n fontSize: theme.fontSize.xs,\n color: theme.color.text.faint,\n marginLeft: theme.space.xs,\n },\n spacer: { flexGrow: 1 },\n content: {\n '&$small': {\n padding: '1px',\n },\n '&$large': { padding: theme.space.xl },\n },\n titleGroup: {\n display: 'flex',\n alignItems: 'baseline',\n },\n titleWrapper: {\n display: 'flex',\n alignItems: 'baseline',\n gap: theme.space.xl,\n },\n chevron: {\n position: 'relative',\n top: '4.5px', // sub-pixel optical centering\n left: '1.5px',\n display: 'block',\n height: '20px',\n width: '20px',\n margin: '-6px',\n transition: `transform ${theme.transition.medium}`,\n },\n chevronCollapsed: {\n transform: 'rotate(0deg)',\n },\n chevronExpanded: {\n transform: 'rotate(90deg)',\n },\n clickable: { cursor: 'pointer' },\n collapsed: {},\n danger: {},\n small: {},\n large: {},\n}));\n"]}
@@ -1,10 +1,25 @@
1
1
  import type { ReactNode } from 'react';
2
+ /** Where a divider's label or actions sit on the line. */
2
3
  export type CardDividerAlign = 'left' | 'center' | 'right';
3
4
  export type CardDividerProps = {
5
+ /** Optional label. Without it (and without actions) the divider is a plain full-width line. */
4
6
  children?: ReactNode;
7
+ /**
8
+ * Where the label sits (default `'left'`). Left/right hug that edge with a short stub of line
9
+ * poking past; center leaves equal line on both sides.
10
+ */
5
11
  align?: CardDividerAlign;
12
+ /** Optional actions rendered on the divider line (e.g. a bulk-action button). */
6
13
  actions?: ReactNode;
14
+ /**
15
+ * Where the actions sit (default `'right'`). When actions share a position with the label they
16
+ * stack in the same group — label first, then actions.
17
+ */
7
18
  actionsAlign?: CardDividerAlign;
8
19
  };
20
+ /**
21
+ * A rule splitting one `Card` body into sections, optionally labelled. Full-bleed: assumes the
22
+ * `space.xl` padding of a `size="large"` card body.
23
+ */
9
24
  export declare const CardDivider: ({ children, align, actions, actionsAlign, }: CardDividerProps) => import("react").JSX.Element;
10
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/card-divider/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAE7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IAGrB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAEzB,OAAO,CAAC,EAAE,SAAS,CAAC;IAGpB,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAKF,eAAO,MAAM,WAAW,gDAKrB,gBAAgB,gCA6ClB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/card-divider/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,iFAAiF;IACjF,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAKF;;;GAGG;AACH,eAAO,MAAM,WAAW,gDAKrB,gBAAgB,gCA6ClB,CAAC"}
@@ -2,6 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import cx from 'classnames';
3
3
  import { useStyle } from './style.js';
4
4
  const isPresent = (node) => node !== undefined && node !== null && node !== false;
5
+ /**
6
+ * A rule splitting one `Card` body into sections, optionally labelled. Full-bleed: assumes the
7
+ * `space.xl` padding of a `size="large"` card body.
8
+ */
5
9
  export const CardDivider = ({ children, align = 'left', actions, actionsAlign = 'right', }) => {
6
10
  const style = useStyle();
7
11
  const hasLabel = isPresent(children);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/card-divider/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,C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AAK,CAAC,KAAK,YAAG,MAAM,CAAC,GAAG,CAAC,GAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAErF,OAAO,CACL,eAAK,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAC,WAAW,aAC1C,eAAM,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAI,EACxE,IAAI,CAAC,MAAM,CAAC,EACb,eAAM,SAAS,EAAE,KAAK,CAAC,IAAI,GAAI,EAC9B,IAAI,CAAC,QAAQ,CAAC,EACf,eAAM,SAAS,EAAE,KAAK,CAAC,IAAI,GAAI,EAC9B,IAAI,CAAC,OAAO,CAAC,EACd,eAAM,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAI,IACtE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { ReactNode } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type CardDividerAlign = 'left' | 'center' | 'right';\n\nexport type CardDividerProps = {\n // Optional label. Without it (and without actions) the divider is a plain full-width line.\n children?: ReactNode;\n // Where the label sits. Left/right hug that edge with a short stub of line poking past;\n // center leaves equal line on both sides.\n align?: CardDividerAlign;\n // Optional actions rendered on the divider line (e.g. a bulk-action button).\n actions?: ReactNode;\n // Where the actions sit. When actions share a position with the label they stack in the\n // same group — label first, then actions.\n actionsAlign?: CardDividerAlign;\n};\n\nconst isPresent = (node: ReactNode): boolean =>\n node !== undefined && node !== null && node !== false;\n\nexport const CardDivider = ({\n children,\n align = 'left',\n actions,\n actionsAlign = 'right',\n}: CardDividerProps) => {\n const style = useStyle();\n\n const hasLabel = isPresent(children);\n const hasActions = isPresent(actions);\n\n if (!hasLabel && !hasActions) {\n return (\n <div className={style.root} role=\"separator\">\n <span className={style.line} />\n </div>\n );\n }\n\n // Bucket the label and actions into positions; within a bucket the label renders first.\n const groups: Record<CardDividerAlign, ReactNode[]> = { left: [], center: [], right: [] };\n if (hasLabel) {\n groups[align].push(\n <span key=\"label\" className={style.label}>\n {children}\n </span>\n );\n }\n if (hasActions) {\n groups[actionsAlign].push(\n <span key=\"actions\" className={style.actions}>\n {actions}\n </span>\n );\n }\n\n const slot = (pos: CardDividerAlign) =>\n groups[pos].length > 0 ? <span className={style.group}>{groups[pos]}</span> : null;\n\n return (\n <div className={style.root} role=\"separator\">\n <span className={cx(style.line, groups.left.length > 0 && style.stub)} />\n {slot('left')}\n <span className={style.line} />\n {slot('center')}\n <span className={style.line} />\n {slot('right')}\n <span className={cx(style.line, groups.right.length > 0 && style.stub)} />\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/card-divider/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAsBtC,MAAM,SAAS,GAAG,CAAC,IAAe,EAAW,EAAE,CAC7C,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,QAAQ,EACR,KAAK,GAAG,MAAM,EACd,OAAO,EACP,YAAY,GAAG,OAAO,GACL,EAAE,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAEtC,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7B,OAAO,CACL,cAAK,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,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AAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAI,IACtE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { ReactNode } from 'react';\n\nimport { useStyle } from './style.js';\n\n/** Where a divider's label or actions sit on the line. */\nexport type CardDividerAlign = 'left' | 'center' | 'right';\n\nexport type CardDividerProps = {\n /** Optional label. Without it (and without actions) the divider is a plain full-width line. */\n children?: ReactNode;\n /**\n * Where the label sits (default `'left'`). Left/right hug that edge with a short stub of line\n * poking past; center leaves equal line on both sides.\n */\n align?: CardDividerAlign;\n /** Optional actions rendered on the divider line (e.g. a bulk-action button). */\n actions?: ReactNode;\n /**\n * Where the actions sit (default `'right'`). When actions share a position with the label they\n * stack in the same group — label first, then actions.\n */\n actionsAlign?: CardDividerAlign;\n};\n\nconst isPresent = (node: ReactNode): boolean =>\n node !== undefined && node !== null && node !== false;\n\n/**\n * A rule splitting one `Card` body into sections, optionally labelled. Full-bleed: assumes the\n * `space.xl` padding of a `size=\"large\"` card body.\n */\nexport const CardDivider = ({\n children,\n align = 'left',\n actions,\n actionsAlign = 'right',\n}: CardDividerProps) => {\n const style = useStyle();\n\n const hasLabel = isPresent(children);\n const hasActions = isPresent(actions);\n\n if (!hasLabel && !hasActions) {\n return (\n <div className={style.root} role=\"separator\">\n <span className={style.line} />\n </div>\n );\n }\n\n // Bucket the label and actions into positions; within a bucket the label renders first.\n const groups: Record<CardDividerAlign, ReactNode[]> = { left: [], center: [], right: [] };\n if (hasLabel) {\n groups[align].push(\n <span key=\"label\" className={style.label}>\n {children}\n </span>\n );\n }\n if (hasActions) {\n groups[actionsAlign].push(\n <span key=\"actions\" className={style.actions}>\n {actions}\n </span>\n );\n }\n\n const slot = (pos: CardDividerAlign) =>\n groups[pos].length > 0 ? <span className={style.group}>{groups[pos]}</span> : null;\n\n return (\n <div className={style.root} role=\"separator\">\n <span className={cx(style.line, groups.left.length > 0 && style.stub)} />\n {slot('left')}\n <span className={style.line} />\n {slot('center')}\n <span className={style.line} />\n {slot('right')}\n <span className={cx(style.line, groups.right.length > 0 && style.stub)} />\n </div>\n );\n};\n"]}
@@ -1,6 +1,11 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  export type CardRowProps = PropsWithChildren<{
3
+ /**
4
+ * Adds a pointer cursor; fires on click and Enter/Space. The row is not focusable, so keys only
5
+ * reach it from a focused child.
6
+ */
3
7
  onClick?: () => void;
4
8
  }>;
9
+ /** A compact bordered row for stacking items inside a `Card` body. Optionally clickable. */
5
10
  export declare const CardRow: ({ children, onClick }: CardRowProps) => import("react").JSX.Element;
6
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/card-row/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAe,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC,CAAC;AACH,eAAO,MAAM,OAAO,0BAA2B,YAAY,gCAuB1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/card-row/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAe,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,OAAO,0BAA2B,YAAY,gCAuB1D,CAAC"}
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import cx from 'classnames';
3
3
  import { useCallback } from 'react';
4
4
  import { useStyle } from './style.js';
5
+ /** A compact bordered row for stacking items inside a `Card` body. Optionally clickable. */
5
6
  export const CardRow = ({ children, onClick }) => {
6
7
  const styles = useStyle();
7
8
  const handleBookKeyDown = useCallback((event) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/card-row/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAqB,WAAW,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAgB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,KAA0C,EAAE,EAAE;QAC7C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YAC/C,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC,EACzE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,iBAAiB,YAE3B,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { PropsWithChildren, useCallback } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type CardRowProps = PropsWithChildren<{\n onClick?: () => void;\n}>;\nexport const CardRow = ({ children, onClick }: CardRowProps) => {\n const styles = useStyle();\n\n const handleBookKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n if (onClick) {\n onClick();\n }\n }\n },\n [onClick]\n );\n\n return (\n <div\n className={cx(styles.root, { [styles.clickable]: onClick !== undefined })}\n onClick={onClick}\n onKeyDown={handleBookKeyDown}\n >\n {children}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/card-row/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAqB,WAAW,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAgB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,KAA0C,EAAE,EAAE;QAC7C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YAC/C,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC,EACzE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,iBAAiB,YAE3B,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { PropsWithChildren, useCallback } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type CardRowProps = PropsWithChildren<{\n /**\n * Adds a pointer cursor; fires on click and Enter/Space. The row is not focusable, so keys only\n * reach it from a focused child.\n */\n onClick?: () => void;\n}>;\n\n/** A compact bordered row for stacking items inside a `Card` body. Optionally clickable. */\nexport const CardRow = ({ children, onClick }: CardRowProps) => {\n const styles = useStyle();\n\n const handleBookKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n if (onClick) {\n onClick();\n }\n }\n },\n [onClick]\n );\n\n return (\n <div\n className={cx(styles.root, { [styles.clickable]: onClick !== undefined })}\n onClick={onClick}\n onKeyDown={handleBookKeyDown}\n >\n {children}\n </div>\n );\n};\n"]}
@@ -4,7 +4,7 @@ export const useStyle = createUseStyles((theme) => ({
4
4
  ...theme.recipe.card.shell,
5
5
  backgroundColor: theme.color.bg.card,
6
6
  padding: '6px', // row-specific compact padding
7
- borderRadius: '12px', // row-specific 10px radius (not on theme scale)
7
+ // Corners come from recipe.card.shell (radius.lg): a row sits on the page background.
8
8
  },
9
9
  clickable: {
10
10
  cursor: 'pointer',
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/component/card-row/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,sBAAsB,CAAC;AAEnE,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE;QACJ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;QAC1B,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI;QACpC,OAAO,EAAE,KAAK,EAAE,+BAA+B;QAC/C,YAAY,EAAE,MAAM,EAAE,gDAAgD;KACvE;IACD,SAAS,EAAE;QACT,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAC,CAAC","sourcesContent":["import { createUseStyles, type Theme } from '../../theme/index.js';\n\nexport const useStyle = createUseStyles((theme: Theme) => ({\n root: {\n ...theme.recipe.card.shell,\n backgroundColor: theme.color.bg.card,\n padding: '6px', // row-specific compact padding\n borderRadius: '12px', // row-specific 10px radius (not on theme scale)\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n"]}
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/component/card-row/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,sBAAsB,CAAC;AAEnE,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE;QACJ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;QAC1B,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI;QACpC,OAAO,EAAE,KAAK,EAAE,+BAA+B;QAC/C,sFAAsF;KACvF;IACD,SAAS,EAAE;QACT,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAC,CAAC","sourcesContent":["import { createUseStyles, type Theme } from '../../theme/index.js';\n\nexport const useStyle = createUseStyles((theme: Theme) => ({\n root: {\n ...theme.recipe.card.shell,\n backgroundColor: theme.color.bg.card,\n padding: '6px', // row-specific compact padding\n // Corners come from recipe.card.shell (radius.lg): a row sits on the page background.\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n"]}
@@ -1,11 +1,16 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
- type StandaloneSectionProps = PropsWithChildren<{
2
+ export type CollapsibleSectionProps = PropsWithChildren<{
3
+ /** Rendered at the header's right end. An array of keyed elements; clicking one also toggles the section. */
3
4
  actions?: ReactNode[];
5
+ /** Controlled open state. Omit for uncontrolled, which starts closed (there is no `defaultOpen`). */
4
6
  open?: boolean;
7
+ /** Faint text after the title, e.g. a count ("3 items"). */
5
8
  subTitle?: string;
9
+ /** Header label, rendered uppercase via CSS. */
6
10
  title: string;
11
+ /** Called on every header click/Enter/Space. Receives no value: flip your own state. */
7
12
  onOpenToggle?: () => void;
8
13
  }>;
9
- export declare function CollapsibleSection({ children, title, subTitle, actions, open: externalOpen, onOpenToggle, }: StandaloneSectionProps): import("react").JSX.Element;
10
- export {};
14
+ /** A disclosure section with no card chrome. Children are unmounted while closed. */
15
+ export declare function CollapsibleSection({ children, title, subTitle, actions, open: externalOpen, onOpenToggle, }: CollapsibleSectionProps): import("react").JSX.Element;
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/collapsible-section/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAI5E,KAAK,sBAAsB,GAAG,iBAAiB,CAAC;IAC9C,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC,CAAC;AAEH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAY,EACZ,IAAI,EAAE,YAAY,EAClB,YAAuB,GACxB,EAAE,sBAAsB,+BAsCxB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/collapsible-section/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAI5E,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD,6GAA6G;IAC7G,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,qGAAqG;IACrG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC,CAAC;AAEH,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAY,EACZ,IAAI,EAAE,YAAY,EAClB,YAAuB,GACxB,EAAE,uBAAuB,+BAsCzB"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useState } from 'react';
3
3
  import { useStyle } from './style.js';
4
+ /** A disclosure section with no card chrome. Children are unmounted while closed. */
4
5
  export function CollapsibleSection({ children, title, subTitle, actions = [], open: externalOpen, onOpenToggle = () => { }, }) {
5
6
  const styles = useStyle();
6
7
  const [localOpen, setLocalOpen] = useState(false);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/collapsible-section/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,EAAE,EACZ,IAAI,EAAE,YAAY,EAClB,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,GACA;IACvB,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,YAAY,IAAI,SAAS,CAAC;IACvC,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE;QACxC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9B,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,eAAe,GAAG,WAAW,CACjC,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,gBAAgB,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACzB,eACE,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,eAAe,aAE1B,eAAM,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAQ,EAC1D,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,EAC5C,QAAQ,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,QAAQ,GAAQ,EAC7D,eAAM,SAAS,EAAE,MAAM,CAAC,MAAM,GAAI,EACjC,OAAO,IACJ,EACL,IAAI,IAAI,QAAQ,IACb,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { PropsWithChildren, ReactNode, useCallback, useState } from 'react';\n\nimport { useStyle } from './style.js';\n\ntype StandaloneSectionProps = PropsWithChildren<{\n actions?: ReactNode[];\n open?: boolean;\n subTitle?: string;\n title: string;\n onOpenToggle?: () => void;\n}>;\n\nexport function CollapsibleSection({\n children,\n title,\n subTitle,\n actions = [],\n open: externalOpen,\n onOpenToggle = () => {},\n}: StandaloneSectionProps) {\n const styles = useStyle();\n\n const [localOpen, setLocalOpen] = useState(false);\n const open = externalOpen ?? localOpen;\n const handleOpenToggle = useCallback(() => {\n setLocalOpen((prev) => !prev);\n onOpenToggle();\n }, [onOpenToggle]);\n\n const handleOnKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleOpenToggle();\n }\n },\n [handleOpenToggle]\n );\n\n return (\n <div className={styles.root}>\n <div\n className={styles.header}\n role=\"button\"\n tabIndex={0}\n onClick={handleOpenToggle}\n onKeyDown={handleOnKeyDown}\n >\n <span className={styles.chevron}>{open ? '▼' : '▶'}</span>\n <span className={styles.label}>{title}</span>\n {subTitle && <span className={styles.count}>{subTitle}</span>}\n <span className={styles.spacer} />\n {actions}\n </div>\n {open && children}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/collapsible-section/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAetC,qFAAqF;AACrF,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,EAAE,EACZ,IAAI,EAAE,YAAY,EAClB,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,GACC;IACxB,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,YAAY,IAAI,SAAS,CAAC;IACvC,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE;QACxC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9B,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,eAAe,GAAG,WAAW,CACjC,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,gBAAgB,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACzB,eACE,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,eAAe,aAE1B,eAAM,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAQ,EAC1D,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,EAC5C,QAAQ,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,QAAQ,GAAQ,EAC7D,eAAM,SAAS,EAAE,MAAM,CAAC,MAAM,GAAI,EACjC,OAAO,IACJ,EACL,IAAI,IAAI,QAAQ,IACb,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { PropsWithChildren, ReactNode, useCallback, useState } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type CollapsibleSectionProps = PropsWithChildren<{\n /** Rendered at the header's right end. An array of keyed elements; clicking one also toggles the section. */\n actions?: ReactNode[];\n /** Controlled open state. Omit for uncontrolled, which starts closed (there is no `defaultOpen`). */\n open?: boolean;\n /** Faint text after the title, e.g. a count (\"3 items\"). */\n subTitle?: string;\n /** Header label, rendered uppercase via CSS. */\n title: string;\n /** Called on every header click/Enter/Space. Receives no value: flip your own state. */\n onOpenToggle?: () => void;\n}>;\n\n/** A disclosure section with no card chrome. Children are unmounted while closed. */\nexport function CollapsibleSection({\n children,\n title,\n subTitle,\n actions = [],\n open: externalOpen,\n onOpenToggle = () => {},\n}: CollapsibleSectionProps) {\n const styles = useStyle();\n\n const [localOpen, setLocalOpen] = useState(false);\n const open = externalOpen ?? localOpen;\n const handleOpenToggle = useCallback(() => {\n setLocalOpen((prev) => !prev);\n onOpenToggle();\n }, [onOpenToggle]);\n\n const handleOnKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleOpenToggle();\n }\n },\n [handleOpenToggle]\n );\n\n return (\n <div className={styles.root}>\n <div\n className={styles.header}\n role=\"button\"\n tabIndex={0}\n onClick={handleOpenToggle}\n onKeyDown={handleOnKeyDown}\n >\n <span className={styles.chevron}>{open ? '▼' : '▶'}</span>\n <span className={styles.label}>{title}</span>\n {subTitle && <span className={styles.count}>{subTitle}</span>}\n <span className={styles.spacer} />\n {actions}\n </div>\n {open && children}\n </div>\n );\n}\n"]}
@@ -2,9 +2,9 @@ import type { ReactNode } from 'react';
2
2
  export type EmptyStateProps = {
3
3
  /** The one line that says what is not here. */
4
4
  title: string;
5
- /** The optional second line: what to do about it, or why it is empty. */
5
+ /** The optional second line: what to do about it, or why it is empty. Only `undefined` omits it. */
6
6
  children?: ReactNode;
7
- /** Tints the title — for a load FAILURE, not for an honestly empty list. */
7
+ /** Tints the title — for a load FAILURE, not for an honestly empty list. Default `false`. */
8
8
  danger?: boolean;
9
9
  };
10
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/empty-state/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,MAAM,eAAe,GAAG;IAC5B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,gCAAyC,eAAe,gCAS9E,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/empty-state/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,MAAM,eAAe,GAAG;IAC5B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,oGAAoG;IACpG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,gCAAyC,eAAe,gCAS9E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/empty-state/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAWtC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAmB,EAAE,EAAE;IACjF,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,OAAO,CACL,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACzB,cAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,YAAG,KAAK,GAAO,EAC3E,QAAQ,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,YAAG,QAAQ,GAAO,IACxE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { ReactNode } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type EmptyStateProps = {\n /** The one line that says what is not here. */\n title: string;\n /** The optional second line: what to do about it, or why it is empty. */\n children?: ReactNode;\n /** Tints the title — for a load FAILURE, not for an honestly empty list. */\n danger?: boolean;\n};\n\n/**\n * The centred \"nothing here\" block a page shows in place of a list.\n *\n * This exists because a list's empty/loading/error text has to read\n * differently depending on whether it sits INSIDE a `Card` or directly on the\n * page. Inside a card, a plain left-aligned line is right — it is one line of\n * card content, indented and bounded like every other. Rendered bare on a\n * page it has nothing around it, and reads as stray text jammed against the\n * left edge, which is exactly what `/request` shipped with when its\n * `Card` wrapper was dropped in the add-page reorg.\n */\nexport const EmptyState = ({ title, children, danger = false }: EmptyStateProps) => {\n const styles = useStyle();\n\n return (\n <div className={styles.root}>\n <div className={cx(styles.title, { [styles.danger]: danger })}>{title}</div>\n {children !== undefined && <div className={styles.subtitle}>{children}</div>}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/empty-state/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAWtC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAmB,EAAE,EAAE;IACjF,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,OAAO,CACL,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACzB,cAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,YAAG,KAAK,GAAO,EAC3E,QAAQ,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,YAAG,QAAQ,GAAO,IACxE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { ReactNode } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type EmptyStateProps = {\n /** The one line that says what is not here. */\n title: string;\n /** The optional second line: what to do about it, or why it is empty. Only `undefined` omits it. */\n children?: ReactNode;\n /** Tints the title — for a load FAILURE, not for an honestly empty list. Default `false`. */\n danger?: boolean;\n};\n\n/**\n * The centred \"nothing here\" block a page shows in place of a list.\n *\n * This exists because a list's empty/loading/error text has to read\n * differently depending on whether it sits INSIDE a `Card` or directly on the\n * page. Inside a card, a plain left-aligned line is right — it is one line of\n * card content, indented and bounded like every other. Rendered bare on a\n * page it has nothing around it, and reads as stray text jammed against the\n * left edge, which is exactly what `/request` shipped with when its\n * `Card` wrapper was dropped in the add-page reorg.\n */\nexport const EmptyState = ({ title, children, danger = false }: EmptyStateProps) => {\n const styles = useStyle();\n\n return (\n <div className={styles.root}>\n <div className={cx(styles.title, { [styles.danger]: danger })}>{title}</div>\n {children !== undefined && <div className={styles.subtitle}>{children}</div>}\n </div>\n );\n};\n"]}
@@ -1,16 +1,16 @@
1
- export { Card } from './card/index.js';
2
- export { CardDivider } from './card-divider/index.js';
1
+ export { Card, type CardProps } from './card/index.js';
2
+ export { CardDivider, type CardDividerAlign, type CardDividerProps } from './card-divider/index.js';
3
3
  export { CardRow, type CardRowProps } from './card-row/index.js';
4
- export { CollapsibleSection } from './collapsible-section/index.js';
5
- export { EmptyState } from './empty-state/index.js';
4
+ export { CollapsibleSection, type CollapsibleSectionProps } from './collapsible-section/index.js';
5
+ export { EmptyState, type EmptyStateProps } from './empty-state/index.js';
6
6
  export { MetaLine, type MetaLineProps } from './meta-line/index.js';
7
- export { MetadataList, type Metadata } from './metadata-list/index.js';
7
+ export { MetadataList, type Metadata, type MetadataListProps } from './metadata-list/index.js';
8
8
  export { NavDesktop, type NavDesktopProps } from './nav-desktop/index.js';
9
9
  export { NavMobile, type NavMobileProps, type NavPill } from './nav-mobile/index.js';
10
10
  export type { NavItem } from './nav-types.js';
11
- export { Page } from './page/index.js';
12
- export { ProgressIndicator } from './progress-indicator/index.js';
13
- export { Tag, type TagTone } from './tag/index.js';
14
- export { ThemeSetting } from './theme-setting/index.js';
15
- export { TopFade } from './top-fade/index.js';
11
+ export { Page, type PageProps, type PageTypeValue } from './page/index.js';
12
+ export { ProgressIndicator, type ProgressIndicatorProps } from './progress-indicator/index.js';
13
+ export { Tag, type TagProps, type TagTone } from './tag/index.js';
14
+ export { ThemeSetting, type ThemeSettingProps } from './theme-setting/index.js';
15
+ export { TopFade, type TopFadeProps } from './top-fade/index.js';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrF,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings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IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAqB,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAiB,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAqC,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,GAAG,EAAgB,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { Card } from './card/index.js';\nexport { CardDivider } from './card-divider/index.js';\nexport { CardRow, type CardRowProps } from './card-row/index.js';\nexport { CollapsibleSection } from './collapsible-section/index.js';\nexport { EmptyState } from './empty-state/index.js';\nexport { MetaLine, type MetaLineProps } from './meta-line/index.js';\nexport { MetadataList, type Metadata } from './metadata-list/index.js';\nexport { NavDesktop, type NavDesktopProps } from './nav-desktop/index.js';\nexport { NavMobile, type NavMobileProps, type NavPill } from './nav-mobile/index.js';\nexport type { NavItem } from './nav-types.js';\nexport { Page } from './page/index.js';\nexport { ProgressIndicator } from './progress-indicator/index.js';\nexport { Tag, type TagTone } from './tag/index.js';\nexport { ThemeSetting } from './theme-setting/index.js';\nexport { TopFade } from './top-fade/index.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAgD,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAqB,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAgC,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAyC,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAqC,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,IAAI,EAAsC,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAA+B,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAE,GAAG,EAA+B,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,OAAO,EAAqB,MAAM,qBAAqB,CAAC","sourcesContent":["export { Card, type CardProps } from './card/index.js';\nexport { CardDivider, type CardDividerAlign, type CardDividerProps } from './card-divider/index.js';\nexport { CardRow, type CardRowProps } from './card-row/index.js';\nexport { CollapsibleSection, type CollapsibleSectionProps } from './collapsible-section/index.js';\nexport { EmptyState, type EmptyStateProps } from './empty-state/index.js';\nexport { MetaLine, type MetaLineProps } from './meta-line/index.js';\nexport { MetadataList, type Metadata, type MetadataListProps } from './metadata-list/index.js';\nexport { NavDesktop, type NavDesktopProps } from './nav-desktop/index.js';\nexport { NavMobile, type NavMobileProps, type NavPill } from './nav-mobile/index.js';\nexport type { NavItem } from './nav-types.js';\nexport { Page, type PageProps, type PageTypeValue } from './page/index.js';\nexport { ProgressIndicator, type ProgressIndicatorProps } from './progress-indicator/index.js';\nexport { Tag, type TagProps, type TagTone } from './tag/index.js';\nexport { ThemeSetting, type ThemeSettingProps } from './theme-setting/index.js';\nexport { TopFade, type TopFadeProps } from './top-fade/index.js';\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export type MetaLineProps = {
3
- /** The data to show, in order. Falsy entries are skipped. */
3
+ /** The data to show, in order. `null`, `undefined` and `false` are skipped; `''` and `0` are kept. */
4
4
  items: ReactNode[];
5
5
  /** Applied to the outer element; the font size and colour set here reach every item. */
6
6
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/meta-line/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,MAAM,aAAa,GAAG;IAC1B,6DAA6D;IAC7D,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,yBAA0B,aAAa,uCAiB3D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/meta-line/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,MAAM,aAAa,GAAG;IAC1B,sGAAsG;IACtG,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,yBAA0B,aAAa,uCAiB3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/meta-line/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAiB,EAAE,EAAE;IAC9D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC;IAC9F,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,YACxC,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,YACxB,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,eAAc,SAAS,EAAE,MAAM,CAAC,IAAI,iBAAc,WAAW,YAC1D,IAAI,IADI,CAAC,CAEL,CACR,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { ReactNode } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type MetaLineProps = {\n /** The data to show, in order. Falsy entries are skipped. */\n items: ReactNode[];\n /** Applied to the outer element; the font size and colour set here reach every item. */\n className?: string;\n};\n\n/**\n * A row's secondary line: a few short data (\"Frank Herbert\", \"Book 3\", \"42%\")\n * separated by middots. When the line is too narrow for all of them, it wraps\n * between data, never inside one, and no separator is left dangling at the end\n * of a line or leading the next.\n *\n * The separators are CSS, not text: each item draws its own leading \"·\" in a\n * fixed-width cell, the list is shifted left by one cell and the overflow\n * clipped. Whichever item starts a line, its separator is the one hidden —\n * which is exactly the one that should not show. Keeping them out of the DOM\n * also means screen readers read the data, not the punctuation.\n */\nexport const MetaLine = ({ items, className }: MetaLineProps) => {\n const styles = useStyle();\n const present = items.filter((item) => item !== null && item !== undefined && item !== false);\n if (present.length === 0) {\n return null;\n }\n return (\n <div className={cx(styles.root, className)}>\n <div className={styles.list}>\n {present.map((item, i) => (\n <span key={i} className={styles.item} data-testid=\"meta-item\">\n {item}\n </span>\n ))}\n </div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/meta-line/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAiB,EAAE,EAAE;IAC9D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC;IAC9F,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,YACxC,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,YACxB,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,eAAc,SAAS,EAAE,MAAM,CAAC,IAAI,iBAAc,WAAW,YAC1D,IAAI,IADI,CAAC,CAEL,CACR,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { ReactNode } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type MetaLineProps = {\n /** The data to show, in order. `null`, `undefined` and `false` are skipped; `''` and `0` are kept. */\n items: ReactNode[];\n /** Applied to the outer element; the font size and colour set here reach every item. */\n className?: string;\n};\n\n/**\n * A row's secondary line: a few short data (\"Frank Herbert\", \"Book 3\", \"42%\")\n * separated by middots. When the line is too narrow for all of them, it wraps\n * between data, never inside one, and no separator is left dangling at the end\n * of a line or leading the next.\n *\n * The separators are CSS, not text: each item draws its own leading \"·\" in a\n * fixed-width cell, the list is shifted left by one cell and the overflow\n * clipped. Whichever item starts a line, its separator is the one hidden —\n * which is exactly the one that should not show. Keeping them out of the DOM\n * also means screen readers read the data, not the punctuation.\n */\nexport const MetaLine = ({ items, className }: MetaLineProps) => {\n const styles = useStyle();\n const present = items.filter((item) => item !== null && item !== undefined && item !== false);\n if (present.length === 0) {\n return null;\n }\n return (\n <div className={cx(styles.root, className)}>\n <div className={styles.list}>\n {present.map((item, i) => (\n <span key={i} className={styles.item} data-testid=\"meta-item\">\n {item}\n </span>\n ))}\n </div>\n </div>\n );\n};\n"]}
@@ -1,6 +1,8 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  export type MetadataProps = PropsWithChildren<{
3
+ /** Label, shown faint and CSS-capitalized. */
3
4
  title: string;
4
5
  }>;
6
+ /** One title/value pair: the building block of `MetadataList`. */
5
7
  export declare const Metadata: ({ children, title }: MetadataProps) => import("react").JSX.Element;
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/metadata/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI1C,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACjE,eAAO,MAAM,QAAQ,wBAAyB,aAAa,gCAS1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/metadata/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI1C,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;IAC5C,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,kEAAkE;AAClE,eAAO,MAAM,QAAQ,wBAAyB,aAAa,gCAS1D,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useStyle } from './style.js';
3
+ /** One title/value pair: the building block of `MetadataList`. */
3
4
  export const Metadata = ({ children, title }) => {
4
5
  const styles = useStyle();
5
6
  return (_jsxs("div", { className: styles.root, children: [_jsx("div", { className: styles.title, children: title }), _jsx("div", { className: styles.value, children: children })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/metadata/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAiB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,OAAO,CACL,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACzB,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAO,EAC3C,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,QAAQ,GAAO,IAC1C,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { PropsWithChildren } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type MetadataProps = PropsWithChildren<{ title: string }>;\nexport const Metadata = ({ children, title }: MetadataProps) => {\n const styles = useStyle();\n\n return (\n <div className={styles.root}>\n <div className={styles.title}>{title}</div>\n <div className={styles.value}>{children}</div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/metadata/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAOtC,kEAAkE;AAClE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAiB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,OAAO,CACL,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACzB,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAO,EAC3C,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,QAAQ,GAAO,IAC1C,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { PropsWithChildren } from 'react';\n\nimport { useStyle } from './style.js';\n\nexport type MetadataProps = PropsWithChildren<{\n /** Label, shown faint and CSS-capitalized. */\n title: string;\n}>;\n\n/** One title/value pair: the building block of `MetadataList`. */\nexport const Metadata = ({ children, title }: MetadataProps) => {\n const styles = useStyle();\n\n return (\n <div className={styles.root}>\n <div className={styles.title}>{title}</div>\n <div className={styles.value}>{children}</div>\n </div>\n );\n};\n"]}
@@ -1,10 +1,14 @@
1
+ /** One labelled value in a `MetadataList`. */
1
2
  export type Metadata = {
3
+ /** Label, shown faint and CSS-capitalized. Keep it unique within a list (it is part of the key). */
2
4
  title: string;
5
+ /** The value. Truncated with an ellipsis at `theme.size.metadataValue`; never wraps. */
3
6
  value: string | React.ReactNode;
4
7
  };
5
- type MetadataListProps = {
8
+ export type MetadataListProps = {
9
+ /** The pairs, in order. Every entry renders, even with an empty value: filter first. */
6
10
  metadata: Metadata[];
7
11
  };
12
+ /** A wrapping row of small labelled values, typically a `Card` body describing one record. */
8
13
  export declare const MetadataList: ({ metadata }: MetadataListProps) => import("react").JSX.Element;
9
- export {};
10
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/metadata-list/index.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;AAC1E,KAAK,iBAAiB,GAAG;IAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC;AAClD,eAAO,MAAM,YAAY,iBAAkB,iBAAiB,gCAS3D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/metadata-list/index.tsx"],"names":[],"mappings":"AAGA,8CAA8C;AAC9C,MAAM,MAAM,QAAQ,GAAG;IACrB,oGAAoG;IACpG,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wFAAwF;IACxF,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,YAAY,iBAAkB,iBAAiB,gCAS3D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Metadata as MetadataComponent } from '../metadata/index.js';
3
3
  import { useStyle } from './style.js';
4
+ /** A wrapping row of small labelled values, typically a `Card` body describing one record. */
4
5
  export const MetadataList = ({ metadata }) => {
5
6
  const styles = useStyle();
6
7
  const metadataElements = metadata.map(({ title, value }) => (_jsx(MetadataComponent, { title: title, children: value }, title + value)));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/metadata-list/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAC9D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC1D,KAAC,iBAAiB,IAAqB,KAAK,EAAE,KAAK,YAChD,KAAK,IADgB,KAAK,GAAG,KAAK,CAEjB,CACrB,CAAC,CAAC;IAEH,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,YAAG,gBAAgB,GAAO,CAAC;AAC/D,CAAC,CAAC","sourcesContent":["import { Metadata as MetadataComponent } from '../metadata/index.js';\nimport { useStyle } from './style.js';\n\nexport type Metadata = { title: string; value: string | React.ReactNode };\ntype MetadataListProps = { metadata: Metadata[] };\nexport const MetadataList = ({ metadata }: MetadataListProps) => {\n const styles = useStyle();\n const metadataElements = metadata.map(({ title, value }) => (\n <MetadataComponent key={title + value} title={title}>\n {value}\n </MetadataComponent>\n ));\n\n return <div className={styles.root}>{metadataElements}</div>;\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/metadata-list/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AActC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAC9D,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC1D,KAAC,iBAAiB,IAAqB,KAAK,EAAE,KAAK,YAChD,KAAK,IADgB,KAAK,GAAG,KAAK,CAEjB,CACrB,CAAC,CAAC;IAEH,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,YAAG,gBAAgB,GAAO,CAAC;AAC/D,CAAC,CAAC","sourcesContent":["import { Metadata as MetadataComponent } from '../metadata/index.js';\nimport { useStyle } from './style.js';\n\n/** One labelled value in a `MetadataList`. */\nexport type Metadata = {\n /** Label, shown faint and CSS-capitalized. Keep it unique within a list (it is part of the key). */\n title: string;\n /** The value. Truncated with an ellipsis at `theme.size.metadataValue`; never wraps. */\n value: string | React.ReactNode;\n};\nexport type MetadataListProps = {\n /** The pairs, in order. Every entry renders, even with an empty value: filter first. */\n metadata: Metadata[];\n};\n\n/** A wrapping row of small labelled values, typically a `Card` body describing one record. */\nexport const MetadataList = ({ metadata }: MetadataListProps) => {\n const styles = useStyle();\n const metadataElements = metadata.map(({ title, value }) => (\n <MetadataComponent key={title + value} title={title}>\n {value}\n </MetadataComponent>\n ));\n\n return <div className={styles.root}>{metadataElements}</div>;\n};\n"]}
@@ -1,6 +1,12 @@
1
1
  import type { NavItem } from '../nav-types.js';
2
2
  export interface NavDesktopProps {
3
+ /** Destinations, rendered in order and keyed by `to`. Each item's `active` is yours to compute. */
3
4
  items: NavItem[];
4
5
  }
6
+ /**
7
+ * Wide navigation bar pinned to the top of the viewport (desktop only). The active
8
+ * link is marked with a gray underline. Hidden below the mobile breakpoint.
9
+ * Must render inside a react-router router.
10
+ */
5
11
  export declare const NavDesktop: ({ items }: NavDesktopProps) => import("react").JSX.Element;
6
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/nav-desktop/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB;AAID,eAAO,MAAM,UAAU,cAAe,eAAe,gCA8BpD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/nav-desktop/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,cAAe,eAAe,gCA8BpD,CAAC"}
@@ -2,8 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import cx from 'classnames';
3
3
  import { Link } from 'react-router';
4
4
  import { useStyle } from './style.js';
5
- // Wide navigation bar pinned to the top of the viewport (desktop only). The active
6
- // link is marked with a gray underline. Hidden below the mobile breakpoint.
5
+ /**
6
+ * Wide navigation bar pinned to the top of the viewport (desktop only). The active
7
+ * link is marked with a gray underline. Hidden below the mobile breakpoint.
8
+ * Must render inside a react-router router.
9
+ */
7
10
  export const NavDesktop = ({ items }) => {
8
11
  const styles = useStyle();
9
12
  return (_jsx("header", { className: styles.root, children: _jsx("nav", { className: styles.items, children: items.map(({ to, label, Icon, active, badge }) => (_jsxs(Link, { className: cx(styles.item, { [styles.active]: active }), "aria-current": active ? 'page' : undefined, to: to, children: [_jsxs("span", { className: styles.iconWrap, children: [_jsx(Icon, { height: 14, width: 14 }), typeof badge === 'number' && badge > 0 && (_jsx("span", { className: styles.badge, children: badge })), badge === 'dot' && _jsx("span", { className: styles.badgeDot, "data-testid": "nav-badge-dot" })] }), label] }, to))) }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/nav-desktop/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAMtC,mFAAmF;AACnF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAmB,EAAE,EAAE;IACvD,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,OAAO,CACL,iBAAQ,SAAS,EAAE,MAAM,CAAC,IAAI,YAC5B,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YACzB,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACjD,MAAC,IAAI,IAEH,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,kBACzC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACzC,EAAE,EAAE,EAAE,aAMN,gBAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,aAC9B,KAAC,IAAI,IAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,GAAI,EAC9B,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,IAAI,CACzC,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,CAC9C,EACA,KAAK,KAAK,KAAK,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,iBAAc,eAAe,GAAG,IAC/E,EACN,KAAK,KAhBD,EAAE,CAiBF,CACR,CAAC,GACE,GACC,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { Link } from 'react-router';\n\nimport type { NavItem } from '../nav-types.js';\nimport { useStyle } from './style.js';\n\nexport interface NavDesktopProps {\n items: NavItem[];\n}\n\n// Wide navigation bar pinned to the top of the viewport (desktop only). The active\n// link is marked with a gray underline. Hidden below the mobile breakpoint.\nexport const NavDesktop = ({ items }: NavDesktopProps) => {\n const styles = useStyle();\n\n return (\n <header className={styles.root}>\n <nav className={styles.items}>\n {items.map(({ to, label, Icon, active, badge }) => (\n <Link\n key={to}\n className={cx(styles.item, { [styles.active]: active })}\n aria-current={active ? 'page' : undefined}\n to={to}\n >\n {/* The icon and its badge share a positioned wrapper so the badge\n can sit on the icon's upper-right corner, the way an app badge\n does. Anchoring to the whole item instead would pin it to the\n item's corner — past the end of the label. */}\n <span className={styles.iconWrap}>\n <Icon height={14} width={14} />\n {typeof badge === 'number' && badge > 0 && (\n <span className={styles.badge}>{badge}</span>\n )}\n {badge === 'dot' && <span className={styles.badgeDot} data-testid=\"nav-badge-dot\" />}\n </span>\n {label}\n </Link>\n ))}\n </nav>\n </header>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/nav-desktop/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAOtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAmB,EAAE,EAAE;IACvD,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAE1B,OAAO,CACL,iBAAQ,SAAS,EAAE,MAAM,CAAC,IAAI,YAC5B,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YACzB,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACjD,MAAC,IAAI,IAEH,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,kBACzC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACzC,EAAE,EAAE,EAAE,aAMN,gBAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,aAC9B,KAAC,IAAI,IAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,GAAI,EAC9B,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,IAAI,CACzC,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,CAC9C,EACA,KAAK,KAAK,KAAK,IAAI,eAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,iBAAc,eAAe,GAAG,IAC/E,EACN,KAAK,KAhBD,EAAE,CAiBF,CACR,CAAC,GACE,GACC,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport { Link } from 'react-router';\n\nimport type { NavItem } from '../nav-types.js';\nimport { useStyle } from './style.js';\n\nexport interface NavDesktopProps {\n /** Destinations, rendered in order and keyed by `to`. Each item's `active` is yours to compute. */\n items: NavItem[];\n}\n\n/**\n * Wide navigation bar pinned to the top of the viewport (desktop only). The active\n * link is marked with a gray underline. Hidden below the mobile breakpoint.\n * Must render inside a react-router router.\n */\nexport const NavDesktop = ({ items }: NavDesktopProps) => {\n const styles = useStyle();\n\n return (\n <header className={styles.root}>\n <nav className={styles.items}>\n {items.map(({ to, label, Icon, active, badge }) => (\n <Link\n key={to}\n className={cx(styles.item, { [styles.active]: active })}\n aria-current={active ? 'page' : undefined}\n to={to}\n >\n {/* The icon and its badge share a positioned wrapper so the badge\n can sit on the icon's upper-right corner, the way an app badge\n does. Anchoring to the whole item instead would pin it to the\n item's corner — past the end of the label. */}\n <span className={styles.iconWrap}>\n <Icon height={14} width={14} />\n {typeof badge === 'number' && badge > 0 && (\n <span className={styles.badge}>{badge}</span>\n )}\n {badge === 'dot' && <span className={styles.badgeDot} data-testid=\"nav-badge-dot\" />}\n </span>\n {label}\n </Link>\n ))}\n </nav>\n </header>\n );\n};\n"]}