@underpin/ui 0.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -1
  3. package/components/autocomplete.d.ts +25 -0
  4. package/components/autocomplete.js +71 -0
  5. package/components/autocomplete.js.map +1 -0
  6. package/components/avatar.d.ts +5 -0
  7. package/components/avatar.js +26 -0
  8. package/components/avatar.js.map +1 -0
  9. package/components/badge.d.ts +36 -0
  10. package/components/badge.js +140 -0
  11. package/components/badge.js.map +1 -0
  12. package/components/bar-list.d.ts +133 -0
  13. package/components/bar-list.js +204 -0
  14. package/components/bar-list.js.map +1 -0
  15. package/components/breakdown-card.d.ts +30 -0
  16. package/components/breakdown-card.js +43 -0
  17. package/components/breakdown-card.js.map +1 -0
  18. package/components/button-group.d.ts +17 -0
  19. package/components/button-group.js +27 -0
  20. package/components/button-group.js.map +1 -0
  21. package/components/button.d.ts +39 -0
  22. package/components/button.js +128 -0
  23. package/components/button.js.map +1 -0
  24. package/components/calendar.d.ts +27 -0
  25. package/components/calendar.js +95 -0
  26. package/components/calendar.js.map +1 -0
  27. package/components/callout.d.ts +26 -0
  28. package/components/callout.js +71 -0
  29. package/components/callout.js.map +1 -0
  30. package/components/card.d.ts +55 -0
  31. package/components/card.js +96 -0
  32. package/components/card.js.map +1 -0
  33. package/components/chart.d.ts +32 -0
  34. package/components/chart.js +43 -0
  35. package/components/chart.js.map +1 -0
  36. package/components/checkbox.d.ts +15 -0
  37. package/components/checkbox.js +42 -0
  38. package/components/checkbox.js.map +1 -0
  39. package/components/code-block.d.ts +21 -0
  40. package/components/code-block.js +35 -0
  41. package/components/code-block.js.map +1 -0
  42. package/components/collapse.d.ts +14 -0
  43. package/components/collapse.js +25 -0
  44. package/components/collapse.js.map +1 -0
  45. package/components/combobox.d.ts +71 -0
  46. package/components/combobox.js +155 -0
  47. package/components/combobox.js.map +1 -0
  48. package/components/copy-button.d.ts +29 -0
  49. package/components/copy-button.js +100 -0
  50. package/components/copy-button.js.map +1 -0
  51. package/components/copy-input.d.ts +15 -0
  52. package/components/copy-input.js +51 -0
  53. package/components/copy-input.js.map +1 -0
  54. package/components/date-picker-trigger.d.ts +12 -0
  55. package/components/date-picker-trigger.js +30 -0
  56. package/components/date-picker-trigger.js.map +1 -0
  57. package/components/date-picker.d.ts +36 -0
  58. package/components/date-picker.js +70 -0
  59. package/components/date-picker.js.map +1 -0
  60. package/components/detail-row.d.ts +51 -0
  61. package/components/detail-row.js +77 -0
  62. package/components/detail-row.js.map +1 -0
  63. package/components/dialog.d.ts +121 -0
  64. package/components/dialog.js +327 -0
  65. package/components/dialog.js.map +1 -0
  66. package/components/disabled-reason.d.ts +31 -0
  67. package/components/disabled-reason.js +67 -0
  68. package/components/disabled-reason.js.map +1 -0
  69. package/components/empty-state.d.ts +41 -0
  70. package/components/empty-state.js +84 -0
  71. package/components/empty-state.js.map +1 -0
  72. package/components/entity-avatar.d.ts +54 -0
  73. package/components/entity-avatar.js +68 -0
  74. package/components/entity-avatar.js.map +1 -0
  75. package/components/form-section.d.ts +22 -0
  76. package/components/form-section.js +38 -0
  77. package/components/form-section.js.map +1 -0
  78. package/components/form.d.ts +199 -0
  79. package/components/form.js +456 -0
  80. package/components/form.js.map +1 -0
  81. package/components/formatted-number.d.ts +21 -0
  82. package/components/formatted-number.js +13 -0
  83. package/components/formatted-number.js.map +1 -0
  84. package/components/heading.d.ts +23 -0
  85. package/components/heading.js +44 -0
  86. package/components/heading.js.map +1 -0
  87. package/components/icon-swap.d.ts +15 -0
  88. package/components/icon-swap.js +29 -0
  89. package/components/icon-swap.js.map +1 -0
  90. package/components/inline-action.d.ts +21 -0
  91. package/components/inline-action.js +36 -0
  92. package/components/inline-action.js.map +1 -0
  93. package/components/input.d.ts +51 -0
  94. package/components/input.js +52 -0
  95. package/components/input.js.map +1 -0
  96. package/components/kbd.d.ts +17 -0
  97. package/components/kbd.js +34 -0
  98. package/components/kbd.js.map +1 -0
  99. package/components/label.d.ts +10 -0
  100. package/components/label.js +20 -0
  101. package/components/label.js.map +1 -0
  102. package/components/menu.d.ts +77 -0
  103. package/components/menu.js +189 -0
  104. package/components/menu.js.map +1 -0
  105. package/components/nav-button.d.ts +34 -0
  106. package/components/nav-button.js +71 -0
  107. package/components/nav-button.js.map +1 -0
  108. package/components/nav.d.ts +39 -0
  109. package/components/nav.js +68 -0
  110. package/components/nav.js.map +1 -0
  111. package/components/number-input.d.ts +16 -0
  112. package/components/number-input.js +25 -0
  113. package/components/number-input.js.map +1 -0
  114. package/components/page.d.ts +14 -0
  115. package/components/page.js +23 -0
  116. package/components/page.js.map +1 -0
  117. package/components/pagination.d.ts +15 -0
  118. package/components/pagination.js +63 -0
  119. package/components/pagination.js.map +1 -0
  120. package/components/ping.d.ts +38 -0
  121. package/components/ping.js +50 -0
  122. package/components/ping.js.map +1 -0
  123. package/components/popover.d.ts +5 -0
  124. package/components/popover.js +25 -0
  125. package/components/popover.js.map +1 -0
  126. package/components/radio-group.d.ts +35 -0
  127. package/components/radio-group.js +81 -0
  128. package/components/radio-group.js.map +1 -0
  129. package/components/relative-time.d.ts +25 -0
  130. package/components/relative-time.js +51 -0
  131. package/components/relative-time.js.map +1 -0
  132. package/components/saved-mark.d.ts +15 -0
  133. package/components/saved-mark.js +45 -0
  134. package/components/saved-mark.js.map +1 -0
  135. package/components/search-input.d.ts +13 -0
  136. package/components/search-input.js +44 -0
  137. package/components/search-input.js.map +1 -0
  138. package/components/section-header.d.ts +83 -0
  139. package/components/section-header.js +170 -0
  140. package/components/section-header.js.map +1 -0
  141. package/components/segmented-control.d.ts +24 -0
  142. package/components/segmented-control.js +70 -0
  143. package/components/segmented-control.js.map +1 -0
  144. package/components/select.d.ts +28 -0
  145. package/components/select.js +129 -0
  146. package/components/select.js.map +1 -0
  147. package/components/shortcut-keys.d.ts +14 -0
  148. package/components/shortcut-keys.js +32 -0
  149. package/components/shortcut-keys.js.map +1 -0
  150. package/components/shortcuts-dialog.d.ts +10 -0
  151. package/components/shortcuts-dialog.js +92 -0
  152. package/components/shortcuts-dialog.js.map +1 -0
  153. package/components/skeleton.d.ts +8 -0
  154. package/components/skeleton.js +23 -0
  155. package/components/skeleton.js.map +1 -0
  156. package/components/sparkline.d.ts +25 -0
  157. package/components/sparkline.js +70 -0
  158. package/components/sparkline.js.map +1 -0
  159. package/components/stack.d.ts +21 -0
  160. package/components/stack.js +45 -0
  161. package/components/stack.js.map +1 -0
  162. package/components/stat-strip.d.ts +43 -0
  163. package/components/stat-strip.js +151 -0
  164. package/components/stat-strip.js.map +1 -0
  165. package/components/steps.d.ts +19 -0
  166. package/components/steps.js +25 -0
  167. package/components/steps.js.map +1 -0
  168. package/components/switch.d.ts +16 -0
  169. package/components/switch.js +29 -0
  170. package/components/switch.js.map +1 -0
  171. package/components/tabs.d.ts +18 -0
  172. package/components/tabs.js +65 -0
  173. package/components/tabs.js.map +1 -0
  174. package/components/text-link.d.ts +16 -0
  175. package/components/text-link.js +32 -0
  176. package/components/text-link.js.map +1 -0
  177. package/components/textarea.d.ts +10 -0
  178. package/components/textarea.js +23 -0
  179. package/components/textarea.js.map +1 -0
  180. package/components/theme.d.ts +28 -0
  181. package/components/theme.js +158 -0
  182. package/components/theme.js.map +1 -0
  183. package/components/time-series-chart.d.ts +122 -0
  184. package/components/time-series-chart.js +722 -0
  185. package/components/time-series-chart.js.map +1 -0
  186. package/components/toaster.d.ts +3 -0
  187. package/components/toaster.js +44 -0
  188. package/components/toaster.js.map +1 -0
  189. package/components/tooltip.d.ts +64 -0
  190. package/components/tooltip.js +126 -0
  191. package/components/tooltip.js.map +1 -0
  192. package/components/view-picker.d.ts +20 -0
  193. package/components/view-picker.js +24 -0
  194. package/components/view-picker.js.map +1 -0
  195. package/fonts/inter-OFL.txt +93 -0
  196. package/fonts/inter-cyrillic-ext.woff2 +0 -0
  197. package/fonts/inter-cyrillic.woff2 +0 -0
  198. package/fonts/inter-greek-ext.woff2 +0 -0
  199. package/fonts/inter-greek.woff2 +0 -0
  200. package/fonts/inter-latin-ext.woff2 +0 -0
  201. package/fonts/inter-latin.woff2 +0 -0
  202. package/fonts/inter-vietnamese.woff2 +0 -0
  203. package/fonts.css +83 -0
  204. package/lib/animation.d.ts +14 -0
  205. package/lib/animation.js +20 -0
  206. package/lib/animation.js.map +1 -0
  207. package/lib/aria.d.ts +5 -0
  208. package/lib/aria.js +12 -0
  209. package/lib/aria.js.map +1 -0
  210. package/lib/chart-curve.d.ts +13 -0
  211. package/lib/chart-curve.js +79 -0
  212. package/lib/chart-curve.js.map +1 -0
  213. package/lib/classes.d.ts +134 -0
  214. package/lib/classes.js +152 -0
  215. package/lib/classes.js.map +1 -0
  216. package/lib/color.d.ts +25 -0
  217. package/lib/color.js +149 -0
  218. package/lib/color.js.map +1 -0
  219. package/lib/day.d.ts +9 -0
  220. package/lib/day.js +20 -0
  221. package/lib/day.js.map +1 -0
  222. package/lib/design-tokens.d.ts +56 -0
  223. package/lib/design-tokens.js +196 -0
  224. package/lib/design-tokens.js.map +1 -0
  225. package/lib/icon.d.ts +17 -0
  226. package/lib/icon.js +34 -0
  227. package/lib/icon.js.map +1 -0
  228. package/lib/icons.d.ts +23 -0
  229. package/lib/icons.js +28 -0
  230. package/lib/icons.js.map +1 -0
  231. package/lib/interactive.d.ts +21 -0
  232. package/lib/interactive.js +31 -0
  233. package/lib/interactive.js.map +1 -0
  234. package/lib/media.d.ts +58 -0
  235. package/lib/media.js +116 -0
  236. package/lib/media.js.map +1 -0
  237. package/lib/segmented.d.ts +57 -0
  238. package/lib/segmented.js +83 -0
  239. package/lib/segmented.js.map +1 -0
  240. package/lib/shortcuts.d.ts +94 -0
  241. package/lib/shortcuts.js +271 -0
  242. package/lib/shortcuts.js.map +1 -0
  243. package/lib/slot.d.ts +9 -0
  244. package/lib/slot.js +18 -0
  245. package/lib/slot.js.map +1 -0
  246. package/lib/time-series.d.ts +100 -0
  247. package/lib/time-series.js +144 -0
  248. package/lib/time-series.js.map +1 -0
  249. package/lib/tone.d.ts +6 -0
  250. package/lib/tone.js +0 -0
  251. package/lib/variants.d.ts +12 -0
  252. package/lib/variants.js +14 -0
  253. package/lib/variants.js.map +1 -0
  254. package/package.json +110 -3
  255. package/styles.css +619 -0
  256. package/tokens.d.ts +104 -0
  257. package/tokens.js +108 -0
  258. package/tokens.js.map +1 -0
  259. package/publish.log +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Piotr Kulpinski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,46 @@
1
1
  # @underpin/ui
2
2
 
3
- Placeholder release. Use 2.0.0 or later.
3
+ React components built on [Base UI](https://base-ui.com) and styled with Tailwind CSS v4 design tokens. Each component is its own subpath, so an app loads only what it imports.
4
+
5
+ This package was published as `@dirstack/ui` up to 1.15.0. Upgrading from `@dirstack/ui` 1.x to `@underpin/ui` 2.0? [`MIGRATION.md`](MIGRATION.md) lists the rename and every breaking change, with its before and after.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @underpin/ui @base-ui/react tailwindcss tailwindcss-animate
11
+ ```
12
+
13
+ Peers: `react` and `react-dom` 19 or newer, `@base-ui/react` 1, `tailwindcss` 4 and `tailwindcss-animate` 1. `@tanstack/react-form` 1 is optional and only `@underpin/ui/form` needs it.
14
+
15
+ ## Styles
16
+
17
+ Import the stylesheet once in your Tailwind entry, after Tailwind itself:
18
+
19
+ ```css
20
+ @import "tailwindcss";
21
+ @import "@underpin/ui/styles.css";
22
+ ```
23
+
24
+ The stylesheet carries the design tokens, the `tailwindcss-animate` plugin, the Inter and Geist Mono variable fonts, and a `@source` rule that scans the built components. You do not add the package to your own `@source` list.
25
+
26
+ Every colour is a `light-dark()` pair. Left alone it follows the operating system, and `data-theme="dark"` or `data-theme="light"` on `<html>` forces one. `@underpin/ui/theme` manages that attribute: `useTheme()` returns `[theme, setTheme]` and stores the choice in `localStorage.theme`, and `ThemeSelect` is a ready System, Light and Dark control. To avoid a flash of the wrong scheme, apply the stored theme before first paint:
27
+
28
+ ```html
29
+ <script>try{var t=localStorage.theme;if(t==="light"||t==="dark")document.documentElement.dataset.theme=t}catch(e){}</script>
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```tsx
35
+ import { Button } from "@underpin/ui/button"
36
+ import { Dialog, DialogContent, DialogTitle, DialogTrigger } from "@underpin/ui/dialog"
37
+ import { cn } from "@underpin/ui/variants"
38
+ ```
39
+
40
+ Every component under `src/components` is a subpath: `@underpin/ui/<file name>`. The helpers have fixed subpaths: `variants` (`cn`, `variants`, `VariantProps`), `classes`, `interactive`, `slot`, `tone`, `animation`, `icon`, `day`, `shortcuts`, `media`, `time-series`, `chart-curve` and `tokens` (the colour tokens as hex, for code that cannot read CSS).
41
+
42
+ Components that hold state or render a Base UI part open with `"use client"`. The rest render in a React Server Component as they are.
43
+
44
+ ## License
45
+
46
+ MIT
@@ -0,0 +1,25 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { PasswordManagerProps, inputVariants } from "./input.js";
3
+ import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
4
+ declare const Autocomplete: typeof Autocomplete$1.Root;
5
+ /**
6
+ * The text field. Styled as the package's Input, so an autocomplete sitting next to a plain
7
+ * field in a form row is the same control with a list behind it.
8
+ */
9
+ declare function AutocompleteInput({ className, interactive, size, allowPasswordManager, ...props }: Autocomplete$1.Input.Props & VariantProps<typeof inputVariants> & PasswordManagerProps): import("react").JSX.Element;
10
+ /**
11
+ * The popup the matches appear in. Holds an `AutocompleteList` and, optionally, an
12
+ * `AutocompleteEmpty` beside it — `Empty` has to be the list's sibling to know it is empty.
13
+ * Sized to the input rather than to the longest match, so a list of paths can't shove the
14
+ * popup past the form.
15
+ */
16
+ declare function AutocompleteContent({ className, children, align, side, sideOffset, ...props }: Autocomplete$1.Popup.Props & Pick<Autocomplete$1.Positioner.Props, "align" | "side" | "sideOffset">): import("react").JSX.Element;
17
+ /**
18
+ * The scroller around the items. Takes them as children, or as a function called with each
19
+ * of the root's (filtered) `items` — the second form is what keeps a long list virtual.
20
+ */
21
+ declare function AutocompleteList({ className, ...props }: Autocomplete$1.List.Props): import("react").JSX.Element;
22
+ declare function AutocompleteItem({ className, children, ...props }: Autocomplete$1.Item.Props): import("react").JSX.Element;
23
+ /** Stands in for the list while nothing matches what's typed; renders nothing when it does. */
24
+ declare function AutocompleteEmpty({ className, ...props }: Autocomplete$1.Empty.Props): import("react").JSX.Element;
25
+ export { Autocomplete, AutocompleteContent, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompleteList };
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ import { popoverAnimationClasses, popupEmptyClasses, popupItemClasses, popupSurfaceClasses } from "../lib/classes.js";
3
+ import { cn } from "../lib/variants.js";
4
+ import { inputVariants, passwordManagerAttributes } from "./input.js";
5
+ import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
6
+ import { jsx } from "react/jsx-runtime";
7
+ // src/components/autocomplete.tsx
8
+ const Autocomplete = Autocomplete$1.Root;
9
+ /**
10
+ * The text field. Styled as the package's Input, so an autocomplete sitting next to a plain
11
+ * field in a form row is the same control with a list behind it.
12
+ */
13
+ function AutocompleteInput({ className, interactive, size, allowPasswordManager, ...props }) {
14
+ return /* @__PURE__ */ jsx(Autocomplete$1.Input, {
15
+ className: cn(inputVariants({
16
+ interactive,
17
+ size
18
+ }), className),
19
+ ...passwordManagerAttributes(allowPasswordManager),
20
+ ...props
21
+ });
22
+ }
23
+ /**
24
+ * The popup the matches appear in. Holds an `AutocompleteList` and, optionally, an
25
+ * `AutocompleteEmpty` beside it — `Empty` has to be the list's sibling to know it is empty.
26
+ * Sized to the input rather than to the longest match, so a list of paths can't shove the
27
+ * popup past the form.
28
+ */
29
+ function AutocompleteContent({ className, children, align, side, sideOffset = 6, ...props }) {
30
+ return /* @__PURE__ */ jsx(Autocomplete$1.Portal, { children: /* @__PURE__ */ jsx(Autocomplete$1.Positioner, {
31
+ sideOffset,
32
+ align,
33
+ side,
34
+ className: "isolate z-50",
35
+ children: /* @__PURE__ */ jsx(Autocomplete$1.Popup, {
36
+ className: cn(popupSurfaceClasses, "relative z-50 isolate max-h-(--available-height) w-(--anchor-width) overflow-hidden outline-none", popoverAnimationClasses, className),
37
+ ...props,
38
+ children
39
+ })
40
+ }) });
41
+ }
42
+ /**
43
+ * The scroller around the items. Takes them as children, or as a function called with each
44
+ * of the root's (filtered) `items` — the second form is what keeps a long list virtual.
45
+ */
46
+ function AutocompleteList({ className, ...props }) {
47
+ return /* @__PURE__ */ jsx(Autocomplete$1.List, {
48
+ className: cn("max-h-(--available-height) overflow-y-auto overscroll-contain p-1", className),
49
+ ...props
50
+ });
51
+ }
52
+ function AutocompleteItem({ className, children, ...props }) {
53
+ return /* @__PURE__ */ jsx(Autocomplete$1.Item, {
54
+ className: cn(popupItemClasses, "w-full px-2", className),
55
+ ...props,
56
+ children: /* @__PURE__ */ jsx("span", {
57
+ className: "min-w-0 flex-1 truncate",
58
+ children
59
+ })
60
+ });
61
+ }
62
+ /** Stands in for the list while nothing matches what's typed; renders nothing when it does. */
63
+ function AutocompleteEmpty({ className, ...props }) {
64
+ return /* @__PURE__ */ jsx(Autocomplete$1.Empty, {
65
+ className: cn(popupEmptyClasses, className),
66
+ ...props
67
+ });
68
+ }
69
+ export { Autocomplete, AutocompleteContent, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompleteList };
70
+
71
+ //# sourceMappingURL=autocomplete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocomplete.js","names":["AutocompletePrimitive"],"sources":["../../src/components/autocomplete.tsx"],"sourcesContent":["\"use client\"\n\nimport { Autocomplete as AutocompletePrimitive } from \"@base-ui/react/autocomplete\"\nimport {\n POPUP_SIDE_OFFSET,\n popoverAnimationClasses,\n popupEmptyClasses,\n popupItemClasses,\n popupSurfaceClasses,\n} from \"../lib/classes\"\nimport { cn, type VariantProps } from \"../lib/variants\"\nimport { inputVariants, passwordManagerAttributes, type PasswordManagerProps } from \"./input\"\n\nconst Autocomplete = AutocompletePrimitive.Root\n\n/**\n * The text field. Styled as the package's Input, so an autocomplete sitting next to a plain\n * field in a form row is the same control with a list behind it.\n */\nfunction AutocompleteInput({\n className,\n interactive,\n size,\n allowPasswordManager,\n ...props\n}: AutocompletePrimitive.Input.Props & VariantProps<typeof inputVariants> & PasswordManagerProps) {\n // Merged outside the variants call, unlike everywhere else: Base UI types this part's\n // `className` as a function of its own state too, which `variants` cannot take.\n return (\n <AutocompletePrimitive.Input\n className={cn(inputVariants({ interactive, size }), className)}\n {...passwordManagerAttributes(allowPasswordManager)}\n {...props}\n />\n )\n}\n\n/**\n * The popup the matches appear in. Holds an `AutocompleteList` and, optionally, an\n * `AutocompleteEmpty` beside it — `Empty` has to be the list's sibling to know it is empty.\n * Sized to the input rather than to the longest match, so a list of paths can't shove the\n * popup past the form.\n */\nfunction AutocompleteContent({\n className,\n children,\n align,\n side,\n sideOffset = POPUP_SIDE_OFFSET,\n ...props\n}: AutocompletePrimitive.Popup.Props &\n Pick<AutocompletePrimitive.Positioner.Props, \"align\" | \"side\" | \"sideOffset\">) {\n return (\n <AutocompletePrimitive.Portal>\n <AutocompletePrimitive.Positioner\n sideOffset={sideOffset}\n align={align}\n side={side}\n className=\"isolate z-50\"\n >\n <AutocompletePrimitive.Popup\n className={cn(\n popupSurfaceClasses,\n \"relative z-50 isolate max-h-(--available-height) w-(--anchor-width) overflow-hidden outline-none\",\n popoverAnimationClasses,\n className,\n )}\n {...props}\n >\n {children}\n </AutocompletePrimitive.Popup>\n </AutocompletePrimitive.Positioner>\n </AutocompletePrimitive.Portal>\n )\n}\n\n/**\n * The scroller around the items. Takes them as children, or as a function called with each\n * of the root's (filtered) `items` — the second form is what keeps a long list virtual.\n */\nfunction AutocompleteList({ className, ...props }: AutocompletePrimitive.List.Props) {\n return (\n <AutocompletePrimitive.List\n className={cn(\"max-h-(--available-height) overflow-y-auto overscroll-contain p-1\", className)}\n {...props}\n />\n )\n}\n\nfunction AutocompleteItem({ className, children, ...props }: AutocompletePrimitive.Item.Props) {\n return (\n <AutocompletePrimitive.Item\n className={cn(popupItemClasses, \"w-full px-2\", className)}\n {...props}\n >\n {/* Truncation belongs on a child: `text-overflow` has no effect on a flex container,\n so the same classes on the item itself clip a long match without an ellipsis. It\n takes the row's width, so children can lay a hint out against the right edge. */}\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </AutocompletePrimitive.Item>\n )\n}\n\n/** Stands in for the list while nothing matches what's typed; renders nothing when it does. */\nfunction AutocompleteEmpty({ className, ...props }: AutocompletePrimitive.Empty.Props) {\n return <AutocompletePrimitive.Empty className={cn(popupEmptyClasses, className)} {...props} />\n}\n\nexport {\n Autocomplete,\n AutocompleteInput,\n AutocompleteContent,\n AutocompleteList,\n AutocompleteItem,\n AutocompleteEmpty,\n}\n"],"mappings":";;;;;;;AAaA,MAAM,eAAeA,eAAsB;;;;;AAM3C,SAAS,kBAAkB,EACzB,WACA,aACA,MACA,sBACA,GAAG,SAC6F;CAGhG,OACE,oBAACA,eAAsB,OAAvB;EACE,WAAW,GAAG,cAAc;GAAE;GAAa;EAAK,CAAC,GAAG,SAAS;EAC7D,GAAI,0BAA0B,oBAAoB;EAClD,GAAI;CACL,CAAA;AAEL;;;;;;;AAQA,SAAS,oBAAoB,EAC3B,WACA,UACA,OACA,MACA,aAAA,GACA,GAAG,SAE4E;CAC/E,OACE,oBAACA,eAAsB,QAAvB,EAAA,UACE,oBAACA,eAAsB,YAAvB;EACc;EACL;EACD;EACN,WAAU;EAEV,UAAA,oBAACA,eAAsB,OAAvB;GACE,WAAW,GACT,qBACA,oGACA,yBACA,SACF;GACA,GAAI;GAEH;EAC0B,CAAA;CACG,CAAA,EACN,CAAA;AAElC;;;;;AAMA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAA2C;CACnF,OACE,oBAACA,eAAsB,MAAvB;EACE,WAAW,GAAG,qEAAqE,SAAS;EAC5F,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,iBAAiB,EAAE,WAAW,UAAU,GAAG,SAA2C;CAC7F,OACE,oBAACA,eAAsB,MAAvB;EACE,WAAW,GAAG,kBAAkB,eAAe,SAAS;EACxD,GAAI;EAKJ,UAAA,oBAAC,QAAD;GAAM,WAAU;GAA2B;EAAe,CAAA;CAChC,CAAA;AAEhC;;AAGA,SAAS,kBAAkB,EAAE,WAAW,GAAG,SAA4C;CACrF,OAAO,oBAACA,eAAsB,OAAvB;EAA6B,WAAW,GAAG,mBAAmB,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC/F"}
@@ -0,0 +1,5 @@
1
+ import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
2
+ declare function Avatar({ className, ...props }: Avatar$1.Root.Props): import("react").JSX.Element;
3
+ declare function AvatarImage({ className, ...props }: Avatar$1.Image.Props): import("react").JSX.Element;
4
+ declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props): import("react").JSX.Element;
5
+ export { Avatar, AvatarFallback, AvatarImage };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { cn } from "../lib/variants.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
5
+ // src/components/avatar.tsx
6
+ function Avatar({ className, ...props }) {
7
+ return /* @__PURE__ */ jsx(Avatar$1.Root, {
8
+ className: cn("relative flex size-10 shrink-0 overflow-clip rounded-md", className),
9
+ ...props
10
+ });
11
+ }
12
+ function AvatarImage({ className, ...props }) {
13
+ return /* @__PURE__ */ jsx(Avatar$1.Image, {
14
+ className: cn("aspect-square size-full", className),
15
+ ...props
16
+ });
17
+ }
18
+ function AvatarFallback({ className, ...props }) {
19
+ return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
20
+ className: cn("flex size-full items-center justify-center bg-fill text-xs", className),
21
+ ...props
22
+ });
23
+ }
24
+ export { Avatar, AvatarFallback, AvatarImage };
25
+
26
+ //# sourceMappingURL=avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.js","names":["AvatarPrimitive"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["\"use client\"\n\nimport { Avatar as AvatarPrimitive } from \"@base-ui/react/avatar\"\nimport { cn } from \"../lib/variants\"\n\nfunction Avatar({ className, ...props }: AvatarPrimitive.Root.Props) {\n return (\n <AvatarPrimitive.Root\n className={cn(\"relative flex size-10 shrink-0 overflow-clip rounded-md\", className)}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {\n return <AvatarPrimitive.Image className={cn(\"aspect-square size-full\", className)} {...props} />\n}\n\nfunction AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props) {\n return (\n <AvatarPrimitive.Fallback\n className={cn(\"flex size-full items-center justify-center bg-fill text-xs\", className)}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarFallback, AvatarImage }\n"],"mappings":";;;;;AAKA,SAAS,OAAO,EAAE,WAAW,GAAG,SAAqC;CACnE,OACE,oBAACA,SAAgB,MAAjB;EACE,WAAW,GAAG,2DAA2D,SAAS;EAClF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OAAO,oBAACA,SAAgB,OAAjB;EAAuB,WAAW,GAAG,2BAA2B,SAAS;EAAG,GAAI;CAAQ,CAAA;AACjG;AAEA,SAAS,eAAe,EAAE,WAAW,GAAG,SAAyC;CAC/E,OACE,oBAACA,SAAgB,UAAjB;EACE,WAAW,GAAG,8DAA8D,SAAS;EACrF,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,36 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { ReactNode } from "react";
4
+ /**
5
+ * Three independent axes, as most design systems split a badge: `tone` is what it means (the
6
+ * `Tone` vocabulary plus the brand), `variant` how loud it is, `size` how big. Soft is a tinted
7
+ * fill alone, outline adds an edge in the tone, solid fills with the tone itself for a count or
8
+ * a "New". A badge rendered as a link or a button answers the pointer.
9
+ */
10
+ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
11
+ tone: {
12
+ neutral: string;
13
+ brand: string;
14
+ success: string;
15
+ warning: string;
16
+ danger: string;
17
+ };
18
+ variant: {
19
+ soft: string;
20
+ outline: string;
21
+ solid: string;
22
+ };
23
+ size: {
24
+ sm: string;
25
+ md: string;
26
+ lg: string;
27
+ };
28
+ }, undefined, "inline-flex items-center rounded-sm border border-transparent font-display font-medium whitespace-nowrap tabular-nums", undefined, undefined, undefined>;
29
+ interface BadgeProps extends Omit<useRender.ComponentProps<"span">, "prefix">, VariantProps<typeof badgeVariants> {
30
+ /** The slot to be rendered before the label. */
31
+ prefix?: ReactNode;
32
+ /** The slot to be rendered after the label. */
33
+ suffix?: ReactNode;
34
+ }
35
+ declare function Badge({ children, className, render, tone, variant, size, prefix, suffix, ...rest }: BadgeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
36
+ export { Badge, badgeVariants };
@@ -0,0 +1,140 @@
1
+ import { slot } from "../lib/slot.js";
2
+ import { variants } from "../lib/variants.js";
3
+ import { Fragment, jsxs } from "react/jsx-runtime";
4
+ import { mergeProps } from "@base-ui/react";
5
+ import { useRender } from "@base-ui/react/use-render";
6
+ // src/components/badge.tsx
7
+ /**
8
+ * Three independent axes, as most design systems split a badge: `tone` is what it means (the
9
+ * `Tone` vocabulary plus the brand), `variant` how loud it is, `size` how big. Soft is a tinted
10
+ * fill alone, outline adds an edge in the tone, solid fills with the tone itself for a count or
11
+ * a "New". A badge rendered as a link or a button answers the pointer.
12
+ */
13
+ const badgeVariants = variants({
14
+ base: "inline-flex items-center rounded-sm border border-transparent font-display font-medium whitespace-nowrap tabular-nums",
15
+ variants: {
16
+ tone: {
17
+ neutral: "",
18
+ brand: "",
19
+ success: "",
20
+ warning: "",
21
+ danger: ""
22
+ },
23
+ variant: {
24
+ soft: "",
25
+ outline: "",
26
+ solid: ""
27
+ },
28
+ size: {
29
+ sm: "px-1 gap-1 text-2xs",
30
+ md: "px-1.5 py-px gap-1.5 text-xs",
31
+ lg: "px-2 py-px gap-2 text-sm rounded-md"
32
+ }
33
+ },
34
+ compoundVariants: [
35
+ {
36
+ tone: "neutral",
37
+ variant: "soft",
38
+ class: "bg-fill hover:[&[href],&[type]]:bg-fill-strong"
39
+ },
40
+ {
41
+ tone: "neutral",
42
+ variant: "outline",
43
+ class: "border-edge bg-canvas hover:[&[href],&[type]]:bg-fill-subtle"
44
+ },
45
+ {
46
+ tone: "neutral",
47
+ variant: "solid",
48
+ class: "bg-ink text-ink-inverse hover:[&[href],&[type]]:opacity-90"
49
+ },
50
+ {
51
+ tone: "brand",
52
+ variant: "soft",
53
+ class: "bg-brand-subtle text-brand-ink hover:[&[href],&[type]]:opacity-75"
54
+ },
55
+ {
56
+ tone: "brand",
57
+ variant: "outline",
58
+ class: "border border-brand-edge bg-brand-subtle text-brand-ink hover:[&[href],&[type]]:opacity-75"
59
+ },
60
+ {
61
+ tone: "brand",
62
+ variant: "solid",
63
+ class: "bg-brand text-brand-on hover:[&[href],&[type]]:opacity-90"
64
+ },
65
+ {
66
+ tone: "success",
67
+ variant: "soft",
68
+ class: "bg-success-subtle text-success-ink hover:[&[href],&[type]]:opacity-75"
69
+ },
70
+ {
71
+ tone: "success",
72
+ variant: "outline",
73
+ class: "border border-success-edge bg-success-subtle text-success-ink hover:[&[href],&[type]]:opacity-75"
74
+ },
75
+ {
76
+ tone: "success",
77
+ variant: "solid",
78
+ class: "bg-success text-success-on hover:[&[href],&[type]]:opacity-90"
79
+ },
80
+ {
81
+ tone: "warning",
82
+ variant: "soft",
83
+ class: "bg-warning-subtle text-warning-ink hover:[&[href],&[type]]:opacity-75"
84
+ },
85
+ {
86
+ tone: "warning",
87
+ variant: "outline",
88
+ class: "border border-warning-edge bg-warning-subtle text-warning-ink hover:[&[href],&[type]]:opacity-75"
89
+ },
90
+ {
91
+ tone: "warning",
92
+ variant: "solid",
93
+ class: "bg-warning text-warning-on hover:[&[href],&[type]]:opacity-90"
94
+ },
95
+ {
96
+ tone: "danger",
97
+ variant: "soft",
98
+ class: "bg-danger-subtle text-danger-ink hover:[&[href],&[type]]:opacity-75"
99
+ },
100
+ {
101
+ tone: "danger",
102
+ variant: "outline",
103
+ class: "border border-danger-edge bg-danger-subtle text-danger-ink hover:[&[href],&[type]]:opacity-75"
104
+ },
105
+ {
106
+ tone: "danger",
107
+ variant: "solid",
108
+ class: "bg-danger text-danger-on hover:[&[href],&[type]]:opacity-90"
109
+ }
110
+ ],
111
+ defaultVariants: {
112
+ tone: "neutral",
113
+ variant: "soft",
114
+ size: "md"
115
+ }
116
+ });
117
+ const badgeAffixClasses = "shrink-0 size-[1.1em]";
118
+ function Badge({ children, className, render, tone, variant, size, prefix, suffix, ...rest }) {
119
+ const props = mergeProps({
120
+ className: badgeVariants({
121
+ tone,
122
+ variant,
123
+ size,
124
+ className
125
+ }),
126
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
127
+ slot(prefix, { className: badgeAffixClasses }),
128
+ children,
129
+ slot(suffix, { className: badgeAffixClasses })
130
+ ] })
131
+ }, rest);
132
+ return useRender({
133
+ defaultTagName: "span",
134
+ render,
135
+ props
136
+ });
137
+ }
138
+ export { Badge, badgeVariants };
139
+
140
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.js","names":[],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport type { ReactNode } from \"react\"\nimport { slot } from \"../lib/slot\"\nimport { variants, type VariantProps } from \"../lib/variants\"\n\n/**\n * Three independent axes, as most design systems split a badge: `tone` is what it means (the\n * `Tone` vocabulary plus the brand), `variant` how loud it is, `size` how big. Soft is a tinted\n * fill alone, outline adds an edge in the tone, solid fills with the tone itself for a count or\n * a \"New\". A badge rendered as a link or a button answers the pointer.\n */\nconst badgeVariants = variants({\n // Every badge has a 1px border, clear unless the variant draws an edge, so soft, outline and\n // solid badges of one size stand the same height: 16, 20 and 24px, the step's own line plus\n // the border, and 1px of padding above and below from md up. Counts take tabular figures.\n base: \"inline-flex items-center rounded-sm border border-transparent font-display font-medium whitespace-nowrap tabular-nums\",\n\n variants: {\n tone: {\n neutral: \"\",\n brand: \"\",\n success: \"\",\n warning: \"\",\n danger: \"\",\n },\n variant: {\n soft: \"\",\n outline: \"\",\n solid: \"\",\n },\n size: {\n sm: \"px-1 gap-1 text-2xs\",\n md: \"px-1.5 py-px gap-1.5 text-xs\",\n lg: \"px-2 py-px gap-2 text-sm rounded-md\",\n },\n },\n\n compoundVariants: [\n // A soft or outline neutral badge takes the text colour around it.\n { tone: \"neutral\", variant: \"soft\", class: \"bg-fill hover:[&[href],&[type]]:bg-fill-strong\" },\n {\n tone: \"neutral\",\n variant: \"outline\",\n class: \"border-edge bg-canvas hover:[&[href],&[type]]:bg-fill-subtle\",\n },\n {\n tone: \"neutral\",\n variant: \"solid\",\n class: \"bg-ink text-ink-inverse hover:[&[href],&[type]]:opacity-90\",\n },\n // An outline edge is the tone's ink at 20%, so the edge and the label draw one colour.\n {\n tone: \"brand\",\n variant: \"soft\",\n class: \"bg-brand-subtle text-brand-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"brand\",\n variant: \"outline\",\n class:\n \"border border-brand-edge bg-brand-subtle text-brand-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"brand\",\n variant: \"solid\",\n class: \"bg-brand text-brand-on hover:[&[href],&[type]]:opacity-90\",\n },\n {\n tone: \"success\",\n variant: \"soft\",\n class: \"bg-success-subtle text-success-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"success\",\n variant: \"outline\",\n class:\n \"border border-success-edge bg-success-subtle text-success-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"success\",\n variant: \"solid\",\n class: \"bg-success text-success-on hover:[&[href],&[type]]:opacity-90\",\n },\n {\n tone: \"warning\",\n variant: \"soft\",\n class: \"bg-warning-subtle text-warning-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"warning\",\n variant: \"outline\",\n class:\n \"border border-warning-edge bg-warning-subtle text-warning-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"warning\",\n variant: \"solid\",\n class: \"bg-warning text-warning-on hover:[&[href],&[type]]:opacity-90\",\n },\n {\n tone: \"danger\",\n variant: \"soft\",\n class: \"bg-danger-subtle text-danger-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"danger\",\n variant: \"outline\",\n class:\n \"border border-danger-edge bg-danger-subtle text-danger-ink hover:[&[href],&[type]]:opacity-75\",\n },\n {\n tone: \"danger\",\n variant: \"solid\",\n class: \"bg-danger text-danger-on hover:[&[href],&[type]]:opacity-90\",\n },\n ],\n\n defaultVariants: {\n tone: \"neutral\",\n variant: \"soft\",\n size: \"md\",\n },\n})\n\nconst badgeAffixClasses = \"shrink-0 size-[1.1em]\"\n\ninterface BadgeProps\n extends Omit<useRender.ComponentProps<\"span\">, \"prefix\">, VariantProps<typeof badgeVariants> {\n /** The slot to be rendered before the label. */\n prefix?: ReactNode\n\n /** The slot to be rendered after the label. */\n suffix?: ReactNode\n}\n\nfunction Badge({\n children,\n className,\n render,\n tone,\n variant,\n size,\n prefix,\n suffix,\n ...rest\n}: BadgeProps) {\n const props = mergeProps<\"span\">(\n {\n className: badgeVariants({ tone, variant, size, className }),\n children: (\n <>\n {slot(prefix, { className: badgeAffixClasses })}\n {children}\n {slot(suffix, { className: badgeAffixClasses })}\n </>\n ),\n },\n rest,\n )\n\n return useRender({ defaultTagName: \"span\", render, props })\n}\n\nexport { Badge, badgeVariants }\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,gBAAgB,SAAS;CAI7B,MAAM;CAEN,UAAU;EACR,MAAM;GACJ,SAAS;GACT,OAAO;GACP,SAAS;GACT,SAAS;GACT,QAAQ;EACV;EACA,SAAS;GACP,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CAEA,kBAAkB;EAEhB;GAAE,MAAM;GAAW,SAAS;GAAQ,OAAO;EAAiD;EAC5F;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EAEA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OACE;EACJ;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OACE;EACJ;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OACE;EACJ;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;EACA;GACE,MAAM;GACN,SAAS;GACT,OACE;EACJ;EACA;GACE,MAAM;GACN,SAAS;GACT,OAAO;EACT;CACF;CAEA,iBAAiB;EACf,MAAM;EACN,SAAS;EACT,MAAM;CACR;AACF,CAAC;AAED,MAAM,oBAAoB;AAW1B,SAAS,MAAM,EACb,UACA,WACA,QACA,MACA,SACA,MACA,QACA,QACA,GAAG,QACU;CACb,MAAM,QAAQ,WACZ;EACE,WAAW,cAAc;GAAE;GAAM;GAAS;GAAM;EAAU,CAAC;EAC3D,UACE,qBAAA,UAAA,EAAA,UAAA;GACG,KAAK,QAAQ,EAAE,WAAW,kBAAkB,CAAC;GAC7C;GACA,KAAK,QAAQ,EAAE,WAAW,kBAAkB,CAAC;EAC9C,EAAA,CAAA;CAEN,GACA,IACF;CAEA,OAAO,UAAU;EAAE,gBAAgB;EAAQ;EAAQ;CAAM,CAAC;AAC5D"}
@@ -0,0 +1,133 @@
1
+ import { NumberFormat } from "./formatted-number.js";
2
+ import { ComponentProps, ReactNode } from "react";
3
+ /**
4
+ * Ranked breakdown list: each row is a label sitting on a soft bar whose width is the row's
5
+ * share of the largest value, measured across the whole row, with the figures right-aligned
6
+ * beside it. It is a real `<table>` on auto layout, so every figure column is exactly as wide
7
+ * as its own widest cell (its column name included) rather than every column sharing one
8
+ * width cut to fit the longest name. Compose it as `BarList` → `BarList.Header` +
9
+ * `BarList.Body` (or `BarList.Skeleton`), so the names and the figures share the columns.
10
+ *
11
+ * A row that links out carries its `href` on the arrow beside the label; a row-sized click
12
+ * target (click-to-filter) goes in the row's `overlay`, since a `<tr>` can be neither.
13
+ *
14
+ * The bar and the overlay span the row but hang off the label cell, not the `<tr>`: Safari
15
+ * never made a positioned table row a containing block (WebKit 240961), so anything absolute
16
+ * inside one lands on the nearest positioned ancestor outside the table (the card), and every
17
+ * row's bar ran the card's full height and painted over the rows above it. A cell is honoured
18
+ * everywhere, and the wrapper is a container so `100cqw` is the table's width, which is what
19
+ * a share of the row measures against.
20
+ */
21
+ declare function BarListRoot({ className, ...props }: ComponentProps<"table">): import("react").JSX.Element;
22
+ /** Laid out from the label cell's left edge across the whole row, whatever the column count. */
23
+ export declare const rowSpanClasses = "absolute inset-y-0 left-0 w-[100cqw]";
24
+ export type BarListRowProps = Omit<ComponentProps<"tr">, "children"> & {
25
+ /**
26
+ * Row text; string labels truncate.
27
+ */
28
+ label: ReactNode;
29
+ /**
30
+ * Plain-text row name for the link's aria label, when `label` isn't a string.
31
+ */
32
+ name?: string;
33
+ /**
34
+ * Leading visual (favicon, flag, icon tile), 16px.
35
+ */
36
+ icon?: ReactNode;
37
+ value: number;
38
+ /**
39
+ * The largest value in the list; the bar spans `value / max` of the row.
40
+ */
41
+ max: number;
42
+ /**
43
+ * Bar width as a fraction of the row, overriding `value / max`: e.g. a rank ladder so the
44
+ * bars hold still while the rows' labels and values change under them.
45
+ */
46
+ share?: number;
47
+ format?: NumberFormat;
48
+ /**
49
+ * The figure that leads the row (revenue, a conversion rate), in the column right after the
50
+ * label: the same place on a card and in the full list beside it.
51
+ */
52
+ secondaryValue?: number | string;
53
+ secondaryFormat?: NumberFormat;
54
+ /** Styles the secondary figure, e.g. tinting money apart from the counts around it. */
55
+ secondaryClassName?: string;
56
+ /**
57
+ * Further muted figures in their own columns between the secondary one and the value, for
58
+ * a wide list (a dialog) that has room for figures the card holds back.
59
+ */
60
+ extras?: {
61
+ value: ReactNode;
62
+ className?: string;
63
+ }[];
64
+ /**
65
+ * External URL, shown as an arrow beside the label that opens in a new tab.
66
+ */
67
+ href?: string;
68
+ /**
69
+ * An element laid over the whole row, such as a click-to-filter button. It renders inside the
70
+ * label cell, which positions it; give it `rowSpanClasses` to cover every column. Give it a
71
+ * `z-index`: the figure cells are positioned and come after it, so at `z-auto` they would
72
+ * paint over it and swallow every click outside the label. Keep it under the `href` arrow's
73
+ * `z-10` and the arrow stays clickable above it.
74
+ */
75
+ overlay?: ReactNode;
76
+ };
77
+ declare function BarListRow({ label, name, icon, value, max, share: shareOverride, format, secondaryValue, secondaryFormat, secondaryClassName, extras, href, overlay, className, style, ...props }: BarListRowProps): import("react").JSX.Element;
78
+ export type BarListBodyProps = ComponentProps<"tbody">;
79
+ /**
80
+ * Holds the `BarList.Row`s, next to the `BarList.Header` that names their columns.
81
+ */
82
+ declare function BarListBody(props: BarListBodyProps): import("react").JSX.Element;
83
+ export type BarListHeaderProps = Omit<ComponentProps<"thead">, "children"> & {
84
+ /**
85
+ * Names the rows' `extras` columns, in the same order.
86
+ */
87
+ extras?: {
88
+ label: ReactNode;
89
+ className?: string;
90
+ }[];
91
+ /**
92
+ * Names the secondary column; leave it out when no row fills that column.
93
+ */
94
+ secondary?: ReactNode;
95
+ value: ReactNode;
96
+ /**
97
+ * Pin the names to the top of the nearest scroll container, for a list long enough to scroll
98
+ * (the full list in a dialog), so the figures stay named however far down you are. Give the
99
+ * scroll container no top padding: the names then start where they stick and never move.
100
+ */
101
+ sticky?: boolean;
102
+ };
103
+ /**
104
+ * Column names over a `BarList`, in the rows' own columns: the table lines them up, and each
105
+ * name is free to be as wide as it needs. Keep it inside the same `BarList` as whatever swaps
106
+ * the rows for their skeleton, and the card keeps one height across loading and loaded; drop
107
+ * the whole table for an empty or error state, or the names stand over nothing.
108
+ */
109
+ declare function BarListHeader({ extras, secondary, value, sticky, className, ...props }: BarListHeaderProps): import("react").JSX.Element;
110
+ export type BarListSkeletonProps = ComponentProps<"tbody"> & {
111
+ /**
112
+ * Rows to draw, matching the list that replaces it.
113
+ */
114
+ rows?: number;
115
+ /**
116
+ * Columns the list has, the label one included, so the one figure the skeleton draws lands
117
+ * under the same name the data's will.
118
+ */
119
+ columns?: number;
120
+ };
121
+ /**
122
+ * Loading stand-in at the exact row height of `BarList.Row`, so swapping in data causes no
123
+ * layout shift. Its bars take `Skeleton`'s own fill, a step darker than a row's, so the pulse
124
+ * still reads on a card.
125
+ */
126
+ declare function BarListSkeleton({ rows, columns, className, ...props }: BarListSkeletonProps): import("react").JSX.Element;
127
+ declare const BarList: typeof BarListRoot & {
128
+ Row: typeof BarListRow;
129
+ Body: typeof BarListBody;
130
+ Header: typeof BarListHeader;
131
+ Skeleton: typeof BarListSkeleton;
132
+ };
133
+ export { BarList };