@underpin/ui 0.0.0-stage → 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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -2
  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 +116 -4
  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
@@ -0,0 +1,34 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { Button } from "./button.js";
3
+ import { navItem } from "./nav.js";
4
+ import { ComponentProps, ReactNode } from "react";
5
+ type NavButtonVariant = Exclude<NonNullable<VariantProps<typeof navItem>["variant"]>, "link">;
6
+ type NavButtonShellProps = Omit<ComponentProps<typeof Button>, "variant"> & {
7
+ leading: ReactNode;
8
+ variant?: NavButtonVariant;
9
+ };
10
+ /** The nav trigger's frame around any leading mark, for a row that is not an entity. */
11
+ declare function NavButtonShell({ leading, variant, children, className, ...props }: NavButtonShellProps): import("react").JSX.Element;
12
+ type NavButtonProps = NavButtonShellProps & {
13
+ /** The row's text, and the name its avatar takes initials from. */
14
+ label: string;
15
+ avatar?: string;
16
+ };
17
+ /**
18
+ * Compact nav trigger: a 20px avatar, one line of text and whatever `suffix` the caller
19
+ * passes (usually a chevron). Secondary text belongs in the menu it opens.
20
+ */
21
+ declare function NavButton({ avatar, label, ...props }: Omit<NavButtonProps, "leading" | "children">): import("react").JSX.Element;
22
+ declare function NavButtonSkeleton({ variant, ...props }: Omit<NavButtonShellProps, "leading" | "children">): import("react").JSX.Element;
23
+ type NavIdentityProps = ComponentProps<"div"> & {
24
+ name: ReactNode;
25
+ /**
26
+ * The muted second line under the name: an email, a workspace slug.
27
+ */
28
+ detail: ReactNode;
29
+ };
30
+ /**
31
+ * Name over a muted detail line — the identity stack a nav menu's items and headers share.
32
+ */
33
+ declare function NavIdentity({ name, detail, className, ...props }: NavIdentityProps): import("react").JSX.Element;
34
+ export { NavButton, NavButtonShell, NavButtonSkeleton, NavIdentity };
@@ -0,0 +1,71 @@
1
+ import { cn } from "../lib/variants.js";
2
+ import { Button } from "./button.js";
3
+ import { EntityAvatar } from "./entity-avatar.js";
4
+ import { navItem } from "./nav.js";
5
+ import { Skeleton } from "./skeleton.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/components/nav-button.tsx
8
+ /** The nav trigger's frame around any leading mark, for a row that is not an entity. */
9
+ function NavButtonShell({ leading, variant = "flat", children, className, ...props }) {
10
+ return /* @__PURE__ */ jsx(Button, {
11
+ size: variant === "outline" ? "md" : "sm",
12
+ variant: "ghost",
13
+ bordered: variant === "outline",
14
+ prefix: leading,
15
+ className: navItem({
16
+ variant,
17
+ className
18
+ }),
19
+ ...props,
20
+ children: /* @__PURE__ */ jsx("span", {
21
+ className: "font-medium text-control",
22
+ children
23
+ })
24
+ });
25
+ }
26
+ /**
27
+ * Compact nav trigger: a 20px avatar, one line of text and whatever `suffix` the caller
28
+ * passes (usually a chevron). Secondary text belongs in the menu it opens.
29
+ */
30
+ function NavButton({ avatar, label, ...props }) {
31
+ return /* @__PURE__ */ jsx(NavButtonShell, {
32
+ leading: /* @__PURE__ */ jsx(EntityAvatar, {
33
+ size: "sm",
34
+ src: avatar,
35
+ name: label
36
+ }),
37
+ ...props,
38
+ children: label
39
+ });
40
+ }
41
+ function NavButtonSkeleton({ variant, ...props }) {
42
+ return /* @__PURE__ */ jsx(NavButtonShell, {
43
+ disabled: true,
44
+ variant,
45
+ leading: /* @__PURE__ */ jsx(Skeleton, { className: "size-5 rounded-sm" }),
46
+ ...props,
47
+ children: /* @__PURE__ */ jsx(Skeleton, {
48
+ className: "w-28",
49
+ children: "\xA0"
50
+ })
51
+ });
52
+ }
53
+ /**
54
+ * Name over a muted detail line — the identity stack a nav menu's items and headers share.
55
+ */
56
+ function NavIdentity({ name, detail, className, ...props }) {
57
+ return /* @__PURE__ */ jsxs("div", {
58
+ className: cn("flex min-w-0 flex-col", className),
59
+ ...props,
60
+ children: [/* @__PURE__ */ jsx("span", {
61
+ className: "truncate font-medium text-control",
62
+ children: name
63
+ }), /* @__PURE__ */ jsx("span", {
64
+ className: "truncate text-ink-muted text-xs",
65
+ children: detail
66
+ })]
67
+ });
68
+ }
69
+ export { NavButton, NavButtonShell, NavButtonSkeleton, NavIdentity };
70
+
71
+ //# sourceMappingURL=nav-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-button.js","names":[],"sources":["../../src/components/nav-button.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from \"react\"\nimport { cn, type VariantProps } from \"../lib/variants\"\nimport { Button } from \"./button\"\nimport { EntityAvatar } from \"./entity-avatar\"\nimport { navItem } from \"./nav\"\nimport { Skeleton } from \"./skeleton\"\n\ntype NavButtonVariant = Exclude<NonNullable<VariantProps<typeof navItem>[\"variant\"]>, \"link\">\n\ntype NavButtonShellProps = Omit<ComponentProps<typeof Button>, \"variant\"> & {\n leading: ReactNode\n variant?: NavButtonVariant\n}\n\n/** The nav trigger's frame around any leading mark, for a row that is not an entity. */\nfunction NavButtonShell({\n leading,\n variant = \"flat\",\n children,\n className,\n ...props\n}: NavButtonShellProps) {\n return (\n <Button\n size={variant === \"outline\" ? \"md\" : \"sm\"}\n variant=\"ghost\"\n bordered={variant === \"outline\"}\n prefix={leading}\n className={navItem({ variant, className })}\n {...props}\n >\n <span className=\"font-medium text-control\">{children}</span>\n </Button>\n )\n}\n\ntype NavButtonProps = NavButtonShellProps & {\n /** The row's text, and the name its avatar takes initials from. */\n label: string\n avatar?: string\n}\n\n/**\n * Compact nav trigger: a 20px avatar, one line of text and whatever `suffix` the caller\n * passes (usually a chevron). Secondary text belongs in the menu it opens.\n */\nfunction NavButton({ avatar, label, ...props }: Omit<NavButtonProps, \"leading\" | \"children\">) {\n return (\n <NavButtonShell leading={<EntityAvatar size=\"sm\" src={avatar} name={label} />} {...props}>\n {label}\n </NavButtonShell>\n )\n}\n\nfunction NavButtonSkeleton({\n variant,\n ...props\n}: Omit<NavButtonShellProps, \"leading\" | \"children\">) {\n return (\n <NavButtonShell\n disabled\n variant={variant}\n leading={<Skeleton className=\"size-5 rounded-sm\" />}\n {...props}\n >\n <Skeleton className=\"w-28\">&nbsp;</Skeleton>\n </NavButtonShell>\n )\n}\n\ntype NavIdentityProps = ComponentProps<\"div\"> & {\n name: ReactNode\n\n /**\n * The muted second line under the name: an email, a workspace slug.\n */\n detail: ReactNode\n}\n\n/**\n * Name over a muted detail line — the identity stack a nav menu's items and headers share.\n */\nfunction NavIdentity({ name, detail, className, ...props }: NavIdentityProps) {\n return (\n <div className={cn(\"flex min-w-0 flex-col\", className)} {...props}>\n <span className=\"truncate font-medium text-control\">{name}</span>\n <span className=\"truncate text-ink-muted text-xs\">{detail}</span>\n </div>\n )\n}\n\nexport { NavButton, NavButtonShell, NavButtonSkeleton, NavIdentity }\n"],"mappings":";;;;;;;;AAeA,SAAS,eAAe,EACtB,SACA,UAAU,QACV,UACA,WACA,GAAG,SACmB;CACtB,OACE,oBAAC,QAAD;EACE,MAAM,YAAY,YAAY,OAAO;EACrC,SAAQ;EACR,UAAU,YAAY;EACtB,QAAQ;EACR,WAAW,QAAQ;GAAE;GAAS;EAAU,CAAC;EACzC,GAAI;EAEJ,UAAA,oBAAC,QAAD;GAAM,WAAU;GAA4B;EAAe,CAAA;CACrD,CAAA;AAEZ;;;;;AAYA,SAAS,UAAU,EAAE,QAAQ,OAAO,GAAG,SAAuD;CAC5F,OACE,oBAAC,gBAAD;EAAgB,SAAS,oBAAC,cAAD;GAAc,MAAK;GAAK,KAAK;GAAQ,MAAM;EAAQ,CAAA;EAAG,GAAI;EAChF,UAAA;CACa,CAAA;AAEpB;AAEA,SAAS,kBAAkB,EACzB,SACA,GAAG,SACiD;CACpD,OACE,oBAAC,gBAAD;EACE,UAAA;EACS;EACT,SAAS,oBAAC,UAAD,EAAU,WAAU,oBAAqB,CAAA;EAClD,GAAI;EAEJ,UAAA,oBAAC,UAAD;GAAU,WAAU;GAAO,UAAA;EAAgB,CAAA;CAC7B,CAAA;AAEpB;;;;AAcA,SAAS,YAAY,EAAE,MAAM,QAAQ,WAAW,GAAG,SAA2B;CAC5E,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,yBAAyB,SAAS;EAAG,GAAI;EAA5D,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;GAAqC,UAAA;EAAW,CAAA,GAChE,oBAAC,QAAD;GAAM,WAAU;GAAmC,UAAA;EAAa,CAAA,CAC7D;;AAET"}
@@ -0,0 +1,39 @@
1
+ import { ComponentProps } from "react";
2
+ export declare function Nav({ className, ...props }: ComponentProps<"nav">): import("react").JSX.Element;
3
+ /**
4
+ * Muted group label above a run of nav links, in sentence case. It starts on the rows' own inset,
5
+ * so the label sits over the rows' leading column rather than hanging off it.
6
+ */
7
+ export declare function NavLabel({ className, ...props }: ComponentProps<"p">): import("react").JSX.Element;
8
+ /**
9
+ * The hairline between two runs of nav links. It spans the whole rail, edge to edge, so it
10
+ * reads as a boundary between regions of the rail and meets the rail's own border, as a
11
+ * menu's separator spans its popup.
12
+ */
13
+ export declare function NavSeparator({ className, ...props }: ComponentProps<"hr">): import("react").JSX.Element;
14
+ /**
15
+ * The one nav row, applied to a `ghost` `Button`: every item starts from the same width, inset
16
+ * and gap, and each variant is the shape on top of it. A `link` or `flat` row is 32px tall; the
17
+ * `outline` row is the 32px control height, so it lines up with the toolbar controls. Both
18
+ * heights are fixed rather than padded, so a row leading with a taller visual keeps its size.
19
+ *
20
+ * `link`: a nav link or a settings tab, muted at rest, the subtle fill on hover, and a raised
21
+ * key with dark text when active. A coarse pointer grows the row to 36px, a finger-sized target
22
+ * that keeps the rail compact.
23
+ * The label is the control size, set here so it survives the merge with the Button's own text
24
+ * class. The active state keys off `aria-current="page"`, which router links set on their own
25
+ * and a plain button sets by hand, so the row a screen reader hears as current is the one that
26
+ * looks it.
27
+ *
28
+ * `outline`: an edged row on a card surface, for a row that leads with its own visual and
29
+ * opens a menu, with the hover of a secondary button.
30
+ *
31
+ * `flat`: the same row without the border or the surface.
32
+ */
33
+ export declare const navItem: import("tailwind-variants").TVReturnType<{
34
+ variant: {
35
+ link: string[];
36
+ outline: string;
37
+ flat: string;
38
+ };
39
+ }, undefined, string[], undefined, undefined, undefined>;
@@ -0,0 +1,68 @@
1
+ import { eyebrowClasses } from "../lib/classes.js";
2
+ import { cn, variants } from "../lib/variants.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/nav.tsx
5
+ function Nav({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx("nav", {
7
+ className: cn("flex flex-col gap-0.5 px-3 py-2", className),
8
+ ...props
9
+ });
10
+ }
11
+ /**
12
+ * Muted group label above a run of nav links, in sentence case. It starts on the rows' own inset,
13
+ * so the label sits over the rows' leading column rather than hanging off it.
14
+ */
15
+ function NavLabel({ className, ...props }) {
16
+ return /* @__PURE__ */ jsx("p", {
17
+ className: cn("px-2 pt-1.5 pb-1", eyebrowClasses, className),
18
+ ...props
19
+ });
20
+ }
21
+ /**
22
+ * The hairline between two runs of nav links. It spans the whole rail, edge to edge, so it
23
+ * reads as a boundary between regions of the rail and meets the rail's own border, as a
24
+ * menu's separator spans its popup.
25
+ */
26
+ function NavSeparator({ className, ...props }) {
27
+ return /* @__PURE__ */ jsx("hr", {
28
+ className: cn("border-t", className),
29
+ ...props
30
+ });
31
+ }
32
+ /**
33
+ * The one nav row, applied to a `ghost` `Button`: every item starts from the same width, inset
34
+ * and gap, and each variant is the shape on top of it. A `link` or `flat` row is 32px tall; the
35
+ * `outline` row is the 32px control height, so it lines up with the toolbar controls. Both
36
+ * heights are fixed rather than padded, so a row leading with a taller visual keeps its size.
37
+ *
38
+ * `link`: a nav link or a settings tab, muted at rest, the subtle fill on hover, and a raised
39
+ * key with dark text when active. A coarse pointer grows the row to 36px, a finger-sized target
40
+ * that keeps the rail compact.
41
+ * The label is the control size, set here so it survives the merge with the Button's own text
42
+ * class. The active state keys off `aria-current="page"`, which router links set on their own
43
+ * and a plain button sets by hand, so the row a screen reader hears as current is the one that
44
+ * looks it.
45
+ *
46
+ * `outline`: an edged row on a card surface, for a row that leads with its own visual and
47
+ * opens a menu, with the hover of a secondary button.
48
+ *
49
+ * `flat`: the same row without the border or the surface.
50
+ */
51
+ const navItem = variants({
52
+ base: ["w-full justify-start gap-2 px-2 active:not-disabled:not-aria-disabled:translate-y-0 active:not-disabled:not-aria-disabled:bg-fill", "[&>*:first-child]:ml-0 [&>*:last-child]:mr-0"],
53
+ variants: { variant: {
54
+ link: [
55
+ "h-8 pointer-coarse:h-9 border border-transparent text-ink-muted hover:text-ink",
56
+ "text-control",
57
+ "[&>svg]:size-5 [&>svg]:shrink-0 [&>svg]:p-0.5",
58
+ "aria-[current=page]:border-edge-strong aria-[current=page]:bg-surface aria-[current=page]:font-medium aria-[current=page]:text-ink aria-[current=page]:shadow-control",
59
+ "aria-[current=page]:hover:not-aria-disabled:bg-surface"
60
+ ],
61
+ outline: "h-control py-0 bg-surface",
62
+ flat: "h-8"
63
+ } },
64
+ defaultVariants: { variant: "link" }
65
+ });
66
+ export { Nav, NavLabel, NavSeparator, navItem };
67
+
68
+ //# sourceMappingURL=nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav.js","names":[],"sources":["../../src/components/nav.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\nimport { eyebrowClasses } from \"../lib/classes\"\nimport { cn, variants } from \"../lib/variants\"\n\nexport function Nav({ className, ...props }: ComponentProps<\"nav\">) {\n return <nav className={cn(\"flex flex-col gap-0.5 px-3 py-2\", className)} {...props} />\n}\n\n/**\n * Muted group label above a run of nav links, in sentence case. It starts on the rows' own inset,\n * so the label sits over the rows' leading column rather than hanging off it.\n */\nexport function NavLabel({ className, ...props }: ComponentProps<\"p\">) {\n return <p className={cn(\"px-2 pt-1.5 pb-1\", eyebrowClasses, className)} {...props} />\n}\n\n/**\n * The hairline between two runs of nav links. It spans the whole rail, edge to edge, so it\n * reads as a boundary between regions of the rail and meets the rail's own border, as a\n * menu's separator spans its popup.\n */\nexport function NavSeparator({ className, ...props }: ComponentProps<\"hr\">) {\n return <hr className={cn(\"border-t\", className)} {...props} />\n}\n\n/**\n * Every nav row leads with a 20px column: the 20px avatar of a row that has one, or the 16px\n * icon of a row that does not, centred in the same box. The Button's optical pull-in on the\n * first and last child is zeroed, so the column starts on the row's own inset and every label\n * in the rail begins on one line.\n */\nconst navAffixClasses = \"[&>*:first-child]:ml-0 [&>*:last-child]:mr-0\"\n\n/**\n * The one nav row, applied to a `ghost` `Button`: every item starts from the same width, inset\n * and gap, and each variant is the shape on top of it. A `link` or `flat` row is 32px tall; the\n * `outline` row is the 32px control height, so it lines up with the toolbar controls. Both\n * heights are fixed rather than padded, so a row leading with a taller visual keeps its size.\n *\n * `link`: a nav link or a settings tab, muted at rest, the subtle fill on hover, and a raised\n * key with dark text when active. A coarse pointer grows the row to 36px, a finger-sized target\n * that keeps the rail compact.\n * The label is the control size, set here so it survives the merge with the Button's own text\n * class. The active state keys off `aria-current=\"page\"`, which router links set on their own\n * and a plain button sets by hand, so the row a screen reader hears as current is the one that\n * looks it.\n *\n * `outline`: an edged row on a card surface, for a row that leads with its own visual and\n * opens a menu, with the hover of a secondary button.\n *\n * `flat`: the same row without the border or the surface.\n */\nexport const navItem = variants({\n // A row runs the rail's full width, so the Button's press would read as the layout moving;\n // the fill is the press feedback here.\n base: [\n \"w-full justify-start gap-2 px-2 active:not-disabled:not-aria-disabled:translate-y-0 active:not-disabled:not-aria-disabled:bg-fill\",\n navAffixClasses,\n ],\n\n variants: {\n variant: {\n link: [\n \"h-8 pointer-coarse:h-9 border border-transparent text-ink-muted hover:text-ink\",\n \"text-control\",\n // A 16px glyph drawn inside the 20px column an avatar fills.\n \"[&>svg]:size-5 [&>svg]:shrink-0 [&>svg]:p-0.5\",\n // The current page is a raised key, the way a segmented control marks its chosen option,\n // and keeps it under the pointer: the longer selector outranks the ghost hover, so a\n // hovered row never looks current and hovering where you are never looks like leaving it.\n \"aria-[current=page]:border-edge-strong aria-[current=page]:bg-surface aria-[current=page]:font-medium aria-[current=page]:text-ink aria-[current=page]:shadow-control\",\n \"aria-[current=page]:hover:not-aria-disabled:bg-surface\",\n ],\n outline: \"h-control py-0 bg-surface\",\n flat: \"h-8\",\n },\n },\n\n defaultVariants: {\n variant: \"link\",\n },\n})\n"],"mappings":";;;;AAIA,SAAgB,IAAI,EAAE,WAAW,GAAG,SAAgC;CAClE,OAAO,oBAAC,OAAD;EAAK,WAAW,GAAG,mCAAmC,SAAS;EAAG,GAAI;CAAQ,CAAA;AACvF;;;;;AAMA,SAAgB,SAAS,EAAE,WAAW,GAAG,SAA8B;CACrE,OAAO,oBAAC,KAAD;EAAG,WAAW,GAAG,oBAAoB,gBAAgB,SAAS;EAAG,GAAI;CAAQ,CAAA;AACtF;;;;;;AAOA,SAAgB,aAAa,EAAE,WAAW,GAAG,SAA+B;CAC1E,OAAO,oBAAC,MAAD;EAAI,WAAW,GAAG,YAAY,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC/D;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,UAAU,SAAS;CAG9B,MAAM,CACJ,qIACA,8CACF;CAEA,UAAU,EACR,SAAS;EACP,MAAM;GACJ;GACA;GAEA;GAIA;GACA;EACF;EACA,SAAS;EACT,MAAM;CACR,EACF;CAEA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Input } from "./input.js";
2
+ import { ComponentProps } from "react";
3
+ type NumberInputProps = Omit<ComponentProps<typeof Input>, "value" | "onChange" | "type"> & {
4
+ value: number | null | undefined;
5
+ onValueChange: (value: number | null | undefined) => void;
6
+ integer?: boolean;
7
+ nullable?: boolean;
8
+ };
9
+ /**
10
+ * A numeric input with a typed value. A cleared input yields `undefined` (validates as
11
+ * required instead of "expected number, received NaN"), or `null` when `nullable`, for an
12
+ * optional constraint edited via a partial patch where undefined means "leave unchanged" and
13
+ * only null clears the stored value.
14
+ */
15
+ export declare function NumberInput({ value, onValueChange, integer, nullable, ...props }: NumberInputProps): import("react").JSX.Element;
16
+ export {};
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { Input } from "./input.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/number-input.tsx
5
+ /**
6
+ * A numeric input with a typed value. A cleared input yields `undefined` (validates as
7
+ * required instead of "expected number, received NaN"), or `null` when `nullable`, for an
8
+ * optional constraint edited via a partial patch where undefined means "leave unchanged" and
9
+ * only null clears the stored value.
10
+ */
11
+ function NumberInput({ value, onValueChange, integer, nullable, ...props }) {
12
+ function parse(raw) {
13
+ if (raw === "") return nullable ? null : void 0;
14
+ return integer ? Number.parseInt(raw, 10) : Number.parseFloat(raw);
15
+ }
16
+ return /* @__PURE__ */ jsx(Input, {
17
+ type: "number",
18
+ value: value ?? "",
19
+ onChange: (event) => onValueChange(parse(event.target.value)),
20
+ ...props
21
+ });
22
+ }
23
+ export { NumberInput };
24
+
25
+ //# sourceMappingURL=number-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-input.js","names":[],"sources":["../../src/components/number-input.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ComponentProps } from \"react\"\nimport { Input } from \"./input\"\n\ntype NumberInputProps = Omit<ComponentProps<typeof Input>, \"value\" | \"onChange\" | \"type\"> & {\n value: number | null | undefined\n onValueChange: (value: number | null | undefined) => void\n integer?: boolean\n nullable?: boolean\n}\n\n/**\n * A numeric input with a typed value. A cleared input yields `undefined` (validates as\n * required instead of \"expected number, received NaN\"), or `null` when `nullable`, for an\n * optional constraint edited via a partial patch where undefined means \"leave unchanged\" and\n * only null clears the stored value.\n */\nexport function NumberInput({\n value,\n onValueChange,\n integer,\n nullable,\n ...props\n}: NumberInputProps) {\n function parse(raw: string) {\n if (raw === \"\") return nullable ? null : undefined\n return integer ? Number.parseInt(raw, 10) : Number.parseFloat(raw)\n }\n\n return (\n <Input\n type=\"number\"\n value={value ?? \"\"}\n onChange={event => onValueChange(parse(event.target.value))}\n {...props}\n />\n )\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,YAAY,EAC1B,OACA,eACA,SACA,UACA,GAAG,SACgB;CACnB,SAAS,MAAM,KAAa;EAC1B,IAAI,QAAQ,IAAI,OAAO,WAAW,OAAO,KAAA;EACzC,OAAO,UAAU,OAAO,SAAS,KAAK,EAAE,IAAI,OAAO,WAAW,GAAG;CACnE;CAEA,OACE,oBAAC,OAAD;EACE,MAAK;EACL,OAAO,SAAS;EAChB,WAAU,UAAS,cAAc,MAAM,MAAM,OAAO,KAAK,CAAC;EAC1D,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,14 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { ComponentProps } from "react";
3
+ declare const pageVariants: import("tailwind-variants").TVReturnType<{
4
+ width: {
5
+ narrow: string;
6
+ };
7
+ }, undefined, "flex w-full flex-col gap-5", undefined, undefined, undefined>;
8
+ type PageProps = ComponentProps<"div"> & VariantProps<typeof pageVariants>;
9
+ /**
10
+ * The root of a workspace route: owns the vertical rhythm between the page header and its
11
+ * content, so no page sets its own top margins or gaps.
12
+ */
13
+ export declare function Page({ className, width, ...props }: PageProps): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,23 @@
1
+ import { variants } from "../lib/variants.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/components/page.tsx
4
+ const pageVariants = variants({
5
+ base: "flex w-full flex-col gap-5",
6
+ variants: { width: { narrow: "max-w-3xl" } }
7
+ });
8
+ /**
9
+ * The root of a workspace route: owns the vertical rhythm between the page header and its
10
+ * content, so no page sets its own top margins or gaps.
11
+ */
12
+ function Page({ className, width, ...props }) {
13
+ return /* @__PURE__ */ jsx("div", {
14
+ className: pageVariants({
15
+ width,
16
+ className
17
+ }),
18
+ ...props
19
+ });
20
+ }
21
+ export { Page };
22
+
23
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","names":[],"sources":["../../src/components/page.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\nimport { variants, type VariantProps } from \"../lib/variants\"\n\nconst pageVariants = variants({\n // One rhythm for every workspace page: the header, then each block, 20px apart.\n base: \"flex w-full flex-col gap-5\",\n\n variants: {\n width: {\n // Single-column forms and settings. Left off, the page runs full width: dashboards,\n // lists, detail pages.\n narrow: \"max-w-3xl\",\n },\n },\n})\n\ntype PageProps = ComponentProps<\"div\"> & VariantProps<typeof pageVariants>\n\n/**\n * The root of a workspace route: owns the vertical rhythm between the page header and its\n * content, so no page sets its own top margins or gaps.\n */\nexport function Page({ className, width, ...props }: PageProps) {\n return <div className={pageVariants({ width, className })} {...props} />\n}\n"],"mappings":";;;AAGA,MAAM,eAAe,SAAS;CAE5B,MAAM;CAEN,UAAU,EACR,OAAO,EAGL,QAAQ,YACV,EACF;AACF,CAAC;;;;;AAQD,SAAgB,KAAK,EAAE,WAAW,OAAO,GAAG,SAAoB;CAC9D,OAAO,oBAAC,OAAD;EAAK,WAAW,aAAa;GAAE;GAAO;EAAU,CAAC;EAAG,GAAI;CAAQ,CAAA;AACzE"}
@@ -0,0 +1,15 @@
1
+ import { ComponentProps } from "react";
2
+ type PaginationProps = ComponentProps<"div"> & {
3
+ page: number;
4
+ pageCount: number;
5
+ total: number;
6
+ perPage: number;
7
+ onPageChange: (page: number) => void;
8
+ };
9
+ /**
10
+ * Offset-pagination controls for a list: a "Showing from–to of total" label and prev/next
11
+ * buttons. Presentational and router-agnostic — the caller wires `onPageChange` to its search
12
+ * params. Renders nothing when there's a single page.
13
+ */
14
+ export declare function Pagination({ page, pageCount, total, perPage, onPageChange, className, ...props }: PaginationProps): import("react").JSX.Element | null;
15
+ export {};
@@ -0,0 +1,63 @@
1
+ "use client";
2
+ import { ChevronLeftIcon, ChevronRightIcon } from "../lib/icons.js";
3
+ import { cn } from "../lib/variants.js";
4
+ import { Button } from "./button.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/components/pagination.tsx
7
+ /**
8
+ * 1-based row range shown on the current page, e.g. "26–50 of 42" → { from: 26, to: 42 }.
9
+ */
10
+ function pageRange(page, perPage, total) {
11
+ if (total === 0) return {
12
+ from: 0,
13
+ to: 0
14
+ };
15
+ return {
16
+ from: (page - 1) * perPage + 1,
17
+ to: Math.min(page * perPage, total)
18
+ };
19
+ }
20
+ /**
21
+ * Offset-pagination controls for a list: a "Showing from–to of total" label and prev/next
22
+ * buttons. Presentational and router-agnostic — the caller wires `onPageChange` to its search
23
+ * params. Renders nothing when there's a single page.
24
+ */
25
+ function Pagination({ page, pageCount, total, perPage, onPageChange, className, ...props }) {
26
+ if (pageCount <= 1) return null;
27
+ const { from, to } = pageRange(page, perPage, total);
28
+ return /* @__PURE__ */ jsxs("div", {
29
+ className: cn("flex items-center justify-between gap-4 pt-1", className),
30
+ ...props,
31
+ children: [/* @__PURE__ */ jsxs("p", {
32
+ className: "text-ink-muted text-xs tabular-nums",
33
+ children: [
34
+ "Showing ",
35
+ from,
36
+ "–",
37
+ to,
38
+ " of ",
39
+ total
40
+ ]
41
+ }), /* @__PURE__ */ jsxs("div", {
42
+ className: "flex items-center gap-2",
43
+ children: [/* @__PURE__ */ jsx(Button, {
44
+ variant: "secondary",
45
+ size: "sm",
46
+ "aria-label": "Previous page",
47
+ prefix: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),
48
+ disabled: page <= 1,
49
+ onClick: () => onPageChange(page - 1)
50
+ }), /* @__PURE__ */ jsx(Button, {
51
+ variant: "secondary",
52
+ size: "sm",
53
+ "aria-label": "Next page",
54
+ prefix: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
55
+ disabled: page >= pageCount,
56
+ onClick: () => onPageChange(page + 1)
57
+ })]
58
+ })]
59
+ });
60
+ }
61
+ export { Pagination };
62
+
63
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.js","names":[],"sources":["../../src/components/pagination.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ComponentProps } from \"react\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../lib/icons\"\nimport { cn } from \"../lib/variants\"\nimport { Button } from \"./button\"\n\n/**\n * 1-based row range shown on the current page, e.g. \"26–50 of 42\" → { from: 26, to: 42 }.\n */\nfunction pageRange(page: number, perPage: number, total: number) {\n if (total === 0) return { from: 0, to: 0 }\n return { from: (page - 1) * perPage + 1, to: Math.min(page * perPage, total) }\n}\n\ntype PaginationProps = ComponentProps<\"div\"> & {\n page: number\n pageCount: number\n total: number\n perPage: number\n onPageChange: (page: number) => void\n}\n\n/**\n * Offset-pagination controls for a list: a \"Showing from–to of total\" label and prev/next\n * buttons. Presentational and router-agnostic — the caller wires `onPageChange` to its search\n * params. Renders nothing when there's a single page.\n */\nexport function Pagination({\n page,\n pageCount,\n total,\n perPage,\n onPageChange,\n className,\n ...props\n}: PaginationProps) {\n if (pageCount <= 1) return null\n\n const { from, to } = pageRange(page, perPage, total)\n\n return (\n <div className={cn(\"flex items-center justify-between gap-4 pt-1\", className)} {...props}>\n <p className=\"text-ink-muted text-xs tabular-nums\">\n Showing {from}–{to} of {total}\n </p>\n\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"secondary\"\n size=\"sm\"\n aria-label=\"Previous page\"\n prefix={<ChevronLeftIcon />}\n disabled={page <= 1}\n onClick={() => onPageChange(page - 1)}\n />\n\n <Button\n variant=\"secondary\"\n size=\"sm\"\n aria-label=\"Next page\"\n prefix={<ChevronRightIcon />}\n disabled={page >= pageCount}\n onClick={() => onPageChange(page + 1)}\n />\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAUA,SAAS,UAAU,MAAc,SAAiB,OAAe;CAC/D,IAAI,UAAU,GAAG,OAAO;EAAE,MAAM;EAAG,IAAI;CAAE;CACzC,OAAO;EAAE,OAAO,OAAO,KAAK,UAAU;EAAG,IAAI,KAAK,IAAI,OAAO,SAAS,KAAK;CAAE;AAC/E;;;;;;AAeA,SAAgB,WAAW,EACzB,MACA,WACA,OACA,SACA,cACA,WACA,GAAG,SACe;CAClB,IAAI,aAAa,GAAG,OAAO;CAE3B,MAAM,EAAE,MAAM,OAAO,UAAU,MAAM,SAAS,KAAK;CAEnD,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,gDAAgD,SAAS;EAAG,GAAI;EAAnF,UAAA,CACE,qBAAC,KAAD;GAAG,WAAU;GAAb,UAAA;IAAmD;IACxC;IAAK;IAAE;IAAG;IAAK;GACvB;EAEH,CAAA,GAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,QAAD;IACE,SAAQ;IACR,MAAK;IACL,cAAW;IACX,QAAQ,oBAAC,iBAAD,CAAkB,CAAA;IAC1B,UAAU,QAAQ;IAClB,eAAe,aAAa,OAAO,CAAC;GACrC,CAAA,GAED,oBAAC,QAAD;IACE,SAAQ;IACR,MAAK;IACL,cAAW;IACX,QAAQ,oBAAC,kBAAD,CAAmB,CAAA;IAC3B,UAAU,QAAQ;IAClB,eAAe,aAAa,OAAO,CAAC;GACrC,CAAA,CACE;EACF,CAAA,CAAA;;AAET"}
@@ -0,0 +1,38 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { ComponentProps } from "react";
3
+ declare const pingVariants: import("tailwind-variants").TVReturnType<{
4
+ tone: {
5
+ success: string;
6
+ warning: string;
7
+ danger: string;
8
+ neutral: string;
9
+ };
10
+ size: {
11
+ sm: string;
12
+ md: string;
13
+ lg: string;
14
+ };
15
+ /**
16
+ * An outline in the surface colour, for a dot laid over an image or another element.
17
+ */
18
+ outline: {
19
+ true: string;
20
+ };
21
+ }, undefined, "relative flex shrink-0 rounded-full", undefined, undefined, undefined>;
22
+ type PingProps = ComponentProps<"span"> & VariantProps<typeof pingVariants> & {
23
+ /**
24
+ * Glow: a soft, slow pulse around the dot, for a status that is live right now. It
25
+ * overflows the box by half the dot size, so layout stays the size of the dot itself.
26
+ */
27
+ animate?: boolean;
28
+ /**
29
+ * Names the dot for a screen reader, for a dot whose status no text beside it states.
30
+ * Without it the dot is hidden from assistive tech, since its colour alone says nothing.
31
+ */
32
+ label?: string;
33
+ };
34
+ /**
35
+ * A status dot: solid fill, optionally glowing, optionally outlined against what it sits on.
36
+ */
37
+ export declare function Ping({ className, tone, size, outline, animate, label, ...props }: PingProps): import("react").JSX.Element;
38
+ export {};
@@ -0,0 +1,50 @@
1
+ import { variants } from "../lib/variants.js";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ // src/components/ping.tsx
4
+ const pingVariants = variants({
5
+ base: "relative flex shrink-0 rounded-full",
6
+ variants: {
7
+ tone: {
8
+ success: "text-success",
9
+ warning: "text-warning",
10
+ danger: "text-danger",
11
+ neutral: "text-ink-muted"
12
+ },
13
+ size: {
14
+ sm: "size-1.5",
15
+ md: "size-2",
16
+ lg: "size-2.5"
17
+ },
18
+ /**
19
+ * An outline in the surface colour, for a dot laid over an image or another element.
20
+ */
21
+ outline: { true: "outline-2 outline-surface" }
22
+ },
23
+ defaultVariants: {
24
+ tone: "neutral",
25
+ size: "md"
26
+ }
27
+ });
28
+ /**
29
+ * A status dot: solid fill, optionally glowing, optionally outlined against what it sits on.
30
+ */
31
+ function Ping({ className, tone, size, outline, animate = false, label, ...props }) {
32
+ const named = label ? {
33
+ role: "img",
34
+ "aria-label": label
35
+ } : { "aria-hidden": true };
36
+ return /* @__PURE__ */ jsxs("span", {
37
+ className: pingVariants({
38
+ tone,
39
+ size,
40
+ outline,
41
+ className
42
+ }),
43
+ ...named,
44
+ ...props,
45
+ children: [animate && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute -inset-1/2 animate-ping rounded-full bg-current opacity-30 blur-[1px] [animation-duration:2s] motion-reduce:animate-none" }), /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute -inset-1/2 animate-pulse rounded-full bg-current opacity-30 motion-reduce:animate-none" })] }), /* @__PURE__ */ jsx("span", { className: "absolute inset-0 rounded-full bg-current" })]
46
+ });
47
+ }
48
+ export { Ping };
49
+
50
+ //# sourceMappingURL=ping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ping.js","names":[],"sources":["../../src/components/ping.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\nimport type { Tone } from \"../lib/tone\"\nimport { variants, type VariantProps } from \"../lib/variants\"\n\nconst pingVariants = variants({\n base: \"relative flex shrink-0 rounded-full\",\n\n variants: {\n tone: {\n success: \"text-success\",\n warning: \"text-warning\",\n danger: \"text-danger\",\n neutral: \"text-ink-muted\",\n } satisfies Record<Tone, string>,\n size: {\n sm: \"size-1.5\",\n md: \"size-2\",\n lg: \"size-2.5\",\n },\n /**\n * An outline in the surface colour, for a dot laid over an image or another element.\n */\n outline: {\n true: \"outline-2 outline-surface\",\n },\n },\n\n defaultVariants: {\n tone: \"neutral\",\n size: \"md\",\n },\n})\n\ntype PingProps = ComponentProps<\"span\"> &\n VariantProps<typeof pingVariants> & {\n /**\n * Glow: a soft, slow pulse around the dot, for a status that is live right now. It\n * overflows the box by half the dot size, so layout stays the size of the dot itself.\n */\n animate?: boolean\n\n /**\n * Names the dot for a screen reader, for a dot whose status no text beside it states.\n * Without it the dot is hidden from assistive tech, since its colour alone says nothing.\n */\n label?: string\n }\n\n/**\n * A status dot: solid fill, optionally glowing, optionally outlined against what it sits on.\n */\nexport function Ping({\n className,\n tone,\n size,\n outline,\n animate = false,\n label,\n ...props\n}: PingProps) {\n const named = label ? ({ role: \"img\", \"aria-label\": label } as const) : { \"aria-hidden\": true }\n\n return (\n <span className={pingVariants({ tone, size, outline, className })} {...named} {...props}>\n {animate && (\n <>\n <span className=\"pointer-events-none absolute -inset-1/2 animate-ping rounded-full bg-current opacity-30 blur-[1px] [animation-duration:2s] motion-reduce:animate-none\" />\n <span className=\"pointer-events-none absolute -inset-1/2 animate-pulse rounded-full bg-current opacity-30 motion-reduce:animate-none\" />\n </>\n )}\n <span className=\"absolute inset-0 rounded-full bg-current\" />\n </span>\n )\n}\n"],"mappings":";;;AAIA,MAAM,eAAe,SAAS;CAC5B,MAAM;CAEN,UAAU;EACR,MAAM;GACJ,SAAS;GACT,SAAS;GACT,QAAQ;GACR,SAAS;EACX;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;;;;EAIA,SAAS,EACP,MAAM,4BACR;CACF;CAEA,iBAAiB;EACf,MAAM;EACN,MAAM;CACR;AACF,CAAC;;;;AAoBD,SAAgB,KAAK,EACnB,WACA,MACA,MACA,SACA,UAAU,OACV,OACA,GAAG,SACS;CACZ,MAAM,QAAQ,QAAS;EAAE,MAAM;EAAO,cAAc;CAAM,IAAc,EAAE,eAAe,KAAK;CAE9F,OACE,qBAAC,QAAD;EAAM,WAAW,aAAa;GAAE;GAAM;GAAM;GAAS;EAAU,CAAC;EAAG,GAAI;EAAO,GAAI;EAAlF,UAAA,CACG,WACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD,EAAM,WAAU,wJAAyJ,CAAA,GACzK,oBAAC,QAAD,EAAM,WAAU,sHAAuH,CAAA,CACvI,EAAA,CAAA,GAEJ,oBAAC,QAAD,EAAM,WAAU,2CAA4C,CAAA,CACxD;;AAEV"}
@@ -0,0 +1,5 @@
1
+ import { Popover as Popover$1 } from "@base-ui/react/popover";
2
+ declare const Popover: typeof Popover$1.Root;
3
+ declare const PopoverTrigger: Popover$1.Trigger;
4
+ declare function PopoverContent({ className, align, side, sideOffset, anchor, collisionAvoidance, ...props }: Popover$1.Popup.Props & Pick<Popover$1.Positioner.Props, "align" | "side" | "sideOffset" | "anchor" | "collisionAvoidance">): import("react").JSX.Element;
5
+ export { Popover, PopoverContent, PopoverTrigger };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { popoverAnimationClasses, popupBackdropClasses, popupSurfaceClasses } from "../lib/classes.js";
3
+ import { cn } from "../lib/variants.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Popover as Popover$1 } from "@base-ui/react/popover";
6
+ // src/components/popover.tsx
7
+ const Popover = Popover$1.Root;
8
+ const PopoverTrigger = Popover$1.Trigger;
9
+ function PopoverContent({ className, align = "center", side, sideOffset = 6, anchor, collisionAvoidance, ...props }) {
10
+ return /* @__PURE__ */ jsxs(Popover$1.Portal, { children: [/* @__PURE__ */ jsx(Popover$1.Backdrop, { className: popupBackdropClasses }), /* @__PURE__ */ jsx(Popover$1.Positioner, {
11
+ align,
12
+ side,
13
+ sideOffset,
14
+ anchor,
15
+ collisionAvoidance,
16
+ className: "isolate z-50",
17
+ children: /* @__PURE__ */ jsx(Popover$1.Popup, {
18
+ className: cn(popupSurfaceClasses, "min-w-72 w-(--anchor-width) p-4 outline-hidden", popoverAnimationClasses, className),
19
+ ...props
20
+ })
21
+ })] });
22
+ }
23
+ export { Popover, PopoverContent, PopoverTrigger };
24
+
25
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.js","names":["PopoverPrimitive"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["\"use client\"\n\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\"\nimport {\n POPUP_SIDE_OFFSET,\n popoverAnimationClasses,\n popupBackdropClasses,\n popupSurfaceClasses,\n} from \"../lib/classes\"\nimport { cn } from \"../lib/variants\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nfunction PopoverContent({\n className,\n align = \"center\",\n side,\n sideOffset = POPUP_SIDE_OFFSET,\n anchor,\n collisionAvoidance,\n ...props\n}: PopoverPrimitive.Popup.Props &\n Pick<\n PopoverPrimitive.Positioner.Props,\n \"align\" | \"side\" | \"sideOffset\" | \"anchor\" | \"collisionAvoidance\"\n >) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Backdrop className={popupBackdropClasses} />\n <PopoverPrimitive.Positioner\n align={align}\n side={side}\n sideOffset={sideOffset}\n anchor={anchor}\n collisionAvoidance={collisionAvoidance}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n className={cn(\n popupSurfaceClasses,\n \"min-w-72 w-(--anchor-width) p-4 outline-hidden\",\n popoverAnimationClasses,\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n )\n}\n\nexport { Popover, PopoverContent, PopoverTrigger }\n"],"mappings":";;;;;;AAWA,MAAM,UAAUA,UAAiB;AACjC,MAAM,iBAAiBA,UAAiB;AAExC,SAAS,eAAe,EACtB,WACA,QAAQ,UACR,MACA,aAAA,GACA,QACA,oBACA,GAAG,SAKA;CACH,OACE,qBAACA,UAAiB,QAAlB,EAAA,UAAA,CACE,oBAACA,UAAiB,UAAlB,EAA2B,WAAW,qBAAuB,CAAA,GAC7D,oBAACA,UAAiB,YAAlB;EACS;EACD;EACM;EACJ;EACY;EACpB,WAAU;EAEV,UAAA,oBAACA,UAAiB,OAAlB;GACE,WAAW,GACT,qBACA,kDACA,yBACA,SACF;GACA,GAAI;EACL,CAAA;CAC0B,CAAA,CACN,EAAA,CAAA;AAE7B"}
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from "react";
2
+ import { Radio as Radio$1 } from "@base-ui/react/radio";
3
+ import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
4
+ /**
5
+ * One choice out of a few, each shown at once with what it means. Arrow keys move the choice,
6
+ * as in any radio group. A choice between two states is a `Switch`; a longer list is a
7
+ * `Select`.
8
+ */
9
+ declare function RadioGroup({ className, ...props }: RadioGroup$1.Props): import("react").JSX.Element;
10
+ /**
11
+ * The 16px round control, raised on `Checkbox`'s strong edge and filled with the brand once
12
+ * chosen. A `RadioCard` keeps its own lighter card edge around it. Base UI renders a
13
+ * `<span role="radio">` beside a hidden input, so a disabled one carries `data-disabled` rather
14
+ * than matching `:disabled`, as with `Checkbox`.
15
+ */
16
+ declare function Radio({ className, ...props }: Radio$1.Root.Props): import("react").JSX.Element;
17
+ interface RadioCardProps extends Omit<Radio$1.Root.Props, "children"> {
18
+ label: ReactNode;
19
+ /** What the choice means, under the label. */
20
+ description?: ReactNode;
21
+ /** Beside the label, e.g. a "Default" badge. */
22
+ badge?: ReactNode;
23
+ /**
24
+ * Why the choice cannot be made. The radio turns read-only rather than disabled, so the arrow
25
+ * keys still reach it, which they skip on a disabled one; the reason is read with it and shown
26
+ * in a tooltip, which a tap opens too.
27
+ */
28
+ disabledReason?: string;
29
+ }
30
+ /**
31
+ * A choice as a card: the radio, then its label and what it means. The whole card is the
32
+ * `<label>`, so a click anywhere on it picks the choice; the chosen card takes the fill.
33
+ */
34
+ declare function RadioCard({ label, description, badge, disabledReason, readOnly, className, ...props }: RadioCardProps): import("react").JSX.Element;
35
+ export { Radio, RadioCard, RadioGroup };