@dirstack/ui 1.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 (182) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -0
  3. package/dist/components/animated-number.d.ts +18 -0
  4. package/dist/components/animated-number.d.ts.map +1 -0
  5. package/dist/components/animated-number.js +29 -0
  6. package/dist/components/animated-number.js.map +1 -0
  7. package/dist/components/avatar.d.ts +8 -0
  8. package/dist/components/avatar.d.ts.map +1 -0
  9. package/dist/components/avatar.js +27 -0
  10. package/dist/components/avatar.js.map +1 -0
  11. package/dist/components/badge.d.ts +58 -0
  12. package/dist/components/badge.d.ts.map +1 -0
  13. package/dist/components/badge.js +51 -0
  14. package/dist/components/badge.js.map +1 -0
  15. package/dist/components/button.d.ts +63 -0
  16. package/dist/components/button.d.ts.map +1 -0
  17. package/dist/components/button.js +66 -0
  18. package/dist/components/button.js.map +1 -0
  19. package/dist/components/callout.d.ts +41 -0
  20. package/dist/components/callout.d.ts.map +1 -0
  21. package/dist/components/callout.js +49 -0
  22. package/dist/components/callout.js.map +1 -0
  23. package/dist/components/card.d.ts +61 -0
  24. package/dist/components/card.d.ts.map +1 -0
  25. package/dist/components/card.js +67 -0
  26. package/dist/components/card.js.map +1 -0
  27. package/dist/components/chart.d.ts +32 -0
  28. package/dist/components/chart.d.ts.map +1 -0
  29. package/dist/components/chart.js +121 -0
  30. package/dist/components/chart.js.map +1 -0
  31. package/dist/components/copy-button.d.ts +22 -0
  32. package/dist/components/copy-button.d.ts.map +1 -0
  33. package/dist/components/copy-button.js +50 -0
  34. package/dist/components/copy-button.js.map +1 -0
  35. package/dist/components/copy-input.d.ts +13 -0
  36. package/dist/components/copy-input.d.ts.map +1 -0
  37. package/dist/components/copy-input.js +28 -0
  38. package/dist/components/copy-input.js.map +1 -0
  39. package/dist/components/detail-row.d.ts +93 -0
  40. package/dist/components/detail-row.d.ts.map +1 -0
  41. package/dist/components/detail-row.js +69 -0
  42. package/dist/components/detail-row.js.map +1 -0
  43. package/dist/components/dialog.d.ts +173 -0
  44. package/dist/components/dialog.d.ts.map +1 -0
  45. package/dist/components/dialog.js +139 -0
  46. package/dist/components/dialog.js.map +1 -0
  47. package/dist/components/empty-state.d.ts +96 -0
  48. package/dist/components/empty-state.d.ts.map +1 -0
  49. package/dist/components/empty-state.js +69 -0
  50. package/dist/components/empty-state.js.map +1 -0
  51. package/dist/components/entity-avatar.d.ts +77 -0
  52. package/dist/components/entity-avatar.d.ts.map +1 -0
  53. package/dist/components/entity-avatar.js +48 -0
  54. package/dist/components/entity-avatar.js.map +1 -0
  55. package/dist/components/form-row.d.ts +35 -0
  56. package/dist/components/form-row.d.ts.map +1 -0
  57. package/dist/components/form-row.js +46 -0
  58. package/dist/components/form-row.js.map +1 -0
  59. package/dist/components/form-section.d.ts +24 -0
  60. package/dist/components/form-section.d.ts.map +1 -0
  61. package/dist/components/form-section.js +39 -0
  62. package/dist/components/form-section.js.map +1 -0
  63. package/dist/components/form.d.ts +28 -0
  64. package/dist/components/form.d.ts.map +1 -0
  65. package/dist/components/form.js +88 -0
  66. package/dist/components/form.js.map +1 -0
  67. package/dist/components/heading.d.ts +44 -0
  68. package/dist/components/heading.d.ts.map +1 -0
  69. package/dist/components/heading.js +45 -0
  70. package/dist/components/heading.js.map +1 -0
  71. package/dist/components/input.d.ts +55 -0
  72. package/dist/components/input.d.ts.map +1 -0
  73. package/dist/components/input.js +33 -0
  74. package/dist/components/input.js.map +1 -0
  75. package/dist/components/kbd.d.ts +28 -0
  76. package/dist/components/kbd.d.ts.map +1 -0
  77. package/dist/components/kbd.js +31 -0
  78. package/dist/components/kbd.js.map +1 -0
  79. package/dist/components/label.d.ts +21 -0
  80. package/dist/components/label.d.ts.map +1 -0
  81. package/dist/components/label.js +21 -0
  82. package/dist/components/label.js.map +1 -0
  83. package/dist/components/menu.d.ts +22 -0
  84. package/dist/components/menu.d.ts.map +1 -0
  85. package/dist/components/menu.js +73 -0
  86. package/dist/components/menu.js.map +1 -0
  87. package/dist/components/nav-button.d.ts +34 -0
  88. package/dist/components/nav-button.d.ts.map +1 -0
  89. package/dist/components/nav-button.js +70 -0
  90. package/dist/components/nav-button.js.map +1 -0
  91. package/dist/components/nav.d.ts +44 -0
  92. package/dist/components/nav.d.ts.map +1 -0
  93. package/dist/components/nav.js +53 -0
  94. package/dist/components/nav.js.map +1 -0
  95. package/dist/components/number-input.d.ts +18 -0
  96. package/dist/components/number-input.d.ts.map +1 -0
  97. package/dist/components/number-input.js +25 -0
  98. package/dist/components/number-input.js.map +1 -0
  99. package/dist/components/page.d.ts +24 -0
  100. package/dist/components/page.d.ts.map +1 -0
  101. package/dist/components/page.js +24 -0
  102. package/dist/components/page.js.map +1 -0
  103. package/dist/components/pagination.d.ts +17 -0
  104. package/dist/components/pagination.d.ts.map +1 -0
  105. package/dist/components/pagination.js +63 -0
  106. package/dist/components/pagination.js.map +1 -0
  107. package/dist/components/popover.d.ts +8 -0
  108. package/dist/components/popover.d.ts.map +1 -0
  109. package/dist/components/popover.js +24 -0
  110. package/dist/components/popover.js.map +1 -0
  111. package/dist/components/search-input.d.ts +14 -0
  112. package/dist/components/search-input.d.ts.map +1 -0
  113. package/dist/components/search-input.js +36 -0
  114. package/dist/components/search-input.js.map +1 -0
  115. package/dist/components/section-header.d.ts +107 -0
  116. package/dist/components/section-header.d.ts.map +1 -0
  117. package/dist/components/section-header.js +147 -0
  118. package/dist/components/section-header.js.map +1 -0
  119. package/dist/components/select.d.ts +17 -0
  120. package/dist/components/select.d.ts.map +1 -0
  121. package/dist/components/select.js +94 -0
  122. package/dist/components/select.js.map +1 -0
  123. package/dist/components/skeleton.d.ts +5 -0
  124. package/dist/components/skeleton.d.ts.map +1 -0
  125. package/dist/components/skeleton.js +13 -0
  126. package/dist/components/skeleton.js.map +1 -0
  127. package/dist/components/stack.d.ts +54 -0
  128. package/dist/components/stack.d.ts.map +1 -0
  129. package/dist/components/stack.js +46 -0
  130. package/dist/components/stack.js.map +1 -0
  131. package/dist/components/stat-strip.d.ts +38 -0
  132. package/dist/components/stat-strip.d.ts.map +1 -0
  133. package/dist/components/stat-strip.js +57 -0
  134. package/dist/components/stat-strip.js.map +1 -0
  135. package/dist/components/steps.d.ts +19 -0
  136. package/dist/components/steps.d.ts.map +1 -0
  137. package/dist/components/steps.js +29 -0
  138. package/dist/components/steps.js.map +1 -0
  139. package/dist/components/switch.d.ts +6 -0
  140. package/dist/components/switch.d.ts.map +1 -0
  141. package/dist/components/switch.js +17 -0
  142. package/dist/components/switch.js.map +1 -0
  143. package/dist/components/tabs.d.ts +62 -0
  144. package/dist/components/tabs.d.ts.map +1 -0
  145. package/dist/components/tabs.js +64 -0
  146. package/dist/components/tabs.js.map +1 -0
  147. package/dist/components/textarea.d.ts +9 -0
  148. package/dist/components/textarea.d.ts.map +1 -0
  149. package/dist/components/textarea.js +18 -0
  150. package/dist/components/textarea.js.map +1 -0
  151. package/dist/components/toaster.d.ts +6 -0
  152. package/dist/components/toaster.d.ts.map +1 -0
  153. package/dist/components/toaster.js +37 -0
  154. package/dist/components/toaster.js.map +1 -0
  155. package/dist/components/tooltip.d.ts +15 -0
  156. package/dist/components/tooltip.d.ts.map +1 -0
  157. package/dist/components/tooltip.js +41 -0
  158. package/dist/components/tooltip.js.map +1 -0
  159. package/dist/lib/animation.d.ts +12 -0
  160. package/dist/lib/animation.d.ts.map +1 -0
  161. package/dist/lib/animation.js +14 -0
  162. package/dist/lib/animation.js.map +1 -0
  163. package/dist/lib/classes.d.ts +29 -0
  164. package/dist/lib/classes.d.ts.map +1 -0
  165. package/dist/lib/classes.js +39 -0
  166. package/dist/lib/classes.js.map +1 -0
  167. package/dist/lib/icons.d.ts +21 -0
  168. package/dist/lib/icons.d.ts.map +1 -0
  169. package/dist/lib/icons.js +43 -0
  170. package/dist/lib/icons.js.map +1 -0
  171. package/dist/lib/interactive.d.ts +41 -0
  172. package/dist/lib/interactive.d.ts.map +1 -0
  173. package/dist/lib/interactive.js +30 -0
  174. package/dist/lib/interactive.js.map +1 -0
  175. package/dist/lib/slot.d.ts +12 -0
  176. package/dist/lib/slot.d.ts.map +1 -0
  177. package/dist/lib/slot.js +19 -0
  178. package/dist/lib/slot.js.map +1 -0
  179. package/dist/lib/variants.d.ts +3 -0
  180. package/dist/lib/variants.js +3 -0
  181. package/dist/styles.css +169 -0
  182. package/package.json +112 -0
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 ADDED
@@ -0,0 +1,67 @@
1
+ # @dirstack/ui
2
+
3
+ A shared React component library. Headless-friendly components built on [Base UI](https://base-ui.com), styled with Tailwind CSS v4 design tokens, and shipped as per-component subpaths so you only pull in what you use.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ bun add @dirstack/ui
9
+ # or: npm install @dirstack/ui
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ Import each component from its own subpath:
15
+
16
+ ```tsx
17
+ import { Button } from "@dirstack/ui/button"
18
+ import { Dialog, DialogContent, DialogTitle } from "@dirstack/ui/dialog"
19
+ import { cn, variants } from "@dirstack/ui/variants"
20
+
21
+ export function Example() {
22
+ return <Button variant="primary">Save</Button>
23
+ }
24
+ ```
25
+
26
+ The shared helpers live at fixed subpaths: `@dirstack/ui/variants` (`cn`, `variants`, `VariantProps`), `@dirstack/ui/classes` (shared class strings), `@dirstack/ui/slot`, and `@dirstack/ui/interactive` (`interactiveVariants`).
27
+
28
+ ## Styles
29
+
30
+ The package ships its own theme. Import it once in your Tailwind v4 entry, after `@import "tailwindcss"`:
31
+
32
+ ```css
33
+ @import "tailwindcss";
34
+ @import "@dirstack/ui/styles.css";
35
+ ```
36
+
37
+ That stylesheet carries the full design-token set (`--color-*` mirroring the shadcn/ui variable names plus `success`/`warning`/`danger` trios, `--font-*`, `--spacing-*`, keyframes), the `tailwindcss-animate` plugin, and a `@source` directive that scans the library so its utility classes are generated for you. You do not need to add the package to your own `@source` list.
38
+
39
+ Every color is a `light-dark()` pair driven by `color-scheme`: left alone it follows the OS, and `data-theme="dark"` or `data-theme="light"` on `<html>` forces one. The theme expects the consumer to load the "Inter Variable" font; without it, type falls back to the system stack.
40
+
41
+ Override any token in your own CSS to re-theme:
42
+
43
+ ```css
44
+ @theme {
45
+ --color-primary: light-dark(oklch(0.6 0.2 250), oklch(0.7 0.18 250));
46
+ }
47
+ ```
48
+
49
+ ## Peer dependencies
50
+
51
+ - `react` >= 19 and `react-dom` >= 19
52
+ - `@base-ui/react` >= 1
53
+ - `react-hook-form` >= 7 (only for the form components)
54
+ - `tailwindcss` >= 4
55
+ - `tailwindcss-animate` >= 1
56
+
57
+ ## Development
58
+
59
+ ```bash
60
+ bun install
61
+ bun run typecheck
62
+ bun run build # tsdown: per-module JS + d.ts, plus dist/styles.css
63
+ ```
64
+
65
+ ## License
66
+
67
+ MIT © [Piotr Kulpinski](https://kulpinski.pl)
@@ -0,0 +1,18 @@
1
+ import NumberFlow from "@number-flow/react";
2
+ import { ComponentProps } from "react";
3
+ //#region src/components/animated-number.d.ts
4
+ type AnimatedNumberProps = Omit<ComponentProps<typeof NumberFlow>, "value"> & {
5
+ /**
6
+ * Strings (empty-value dashes like "—") render as-is, without animation.
7
+ */
8
+ value: number | string;
9
+ };
10
+ /**
11
+ * Number that spins to its new value on revalidation. Static on first mount and under
12
+ * prefers-reduced-motion (NumberFlow defaults). The `continuous` plugin sweeps digits through
13
+ * intermediate values as it climbs. Timing is shared with the performance chart so the two
14
+ * move in sync.
15
+ */
16
+ export declare function AnimatedNumber({ value, ...props }: AnimatedNumberProps): string | import("react").JSX.Element;
17
+ //#endregion
18
+ //# sourceMappingURL=animated-number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-number.d.ts","names":[],"sources":["../../src/components/animated-number.tsx"],"mappings":";;;KAQK,sBAAsB,KAAK,sBAAsB;;;;EAIpD;;;;;;;;wBASc,iBAAiB,UAAU,SAAS,+CAAmB,IAAA"}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { ANIMATION_EASING } from "../lib/animation.js";
3
+ import NumberFlow, { continuous } from "@number-flow/react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/animated-number.tsx
6
+ const timing = {
7
+ duration: 500,
8
+ easing: ANIMATION_EASING
9
+ };
10
+ /**
11
+ * Number that spins to its new value on revalidation. Static on first mount and under
12
+ * prefers-reduced-motion (NumberFlow defaults). The `continuous` plugin sweeps digits through
13
+ * intermediate values as it climbs. Timing is shared with the performance chart so the two
14
+ * move in sync.
15
+ */
16
+ function AnimatedNumber({ value, ...props }) {
17
+ if (typeof value === "string") return value;
18
+ return /* @__PURE__ */ jsx(NumberFlow, {
19
+ plugins: [continuous],
20
+ transformTiming: timing,
21
+ opacityTiming: timing,
22
+ value,
23
+ ...props
24
+ });
25
+ }
26
+ //#endregion
27
+ export { AnimatedNumber };
28
+
29
+ //# sourceMappingURL=animated-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-number.js","names":[],"sources":["../../src/components/animated-number.tsx"],"sourcesContent":["\"use client\"\n\nimport NumberFlow, { continuous } from \"@number-flow/react\"\nimport type { ComponentProps } from \"react\"\nimport { ANIMATION_DURATION, ANIMATION_EASING } from \"~/lib/animation\"\n\nconst timing = { duration: ANIMATION_DURATION, easing: ANIMATION_EASING }\n\ntype AnimatedNumberProps = Omit<ComponentProps<typeof NumberFlow>, \"value\"> & {\n /**\n * Strings (empty-value dashes like \"—\") render as-is, without animation.\n */\n value: number | string\n}\n\n/**\n * Number that spins to its new value on revalidation. Static on first mount and under\n * prefers-reduced-motion (NumberFlow defaults). The `continuous` plugin sweeps digits through\n * intermediate values as it climbs. Timing is shared with the performance chart so the two\n * move in sync.\n */\nexport function AnimatedNumber({ value, ...props }: AnimatedNumberProps) {\n if (typeof value === \"string\") return value\n\n return (\n <NumberFlow\n plugins={[continuous]}\n transformTiming={timing}\n opacityTiming={timing}\n value={value}\n {...props}\n />\n )\n}\n"],"mappings":";;;;;AAMA,MAAM,SAAS;CAAE,UAAA;CAA8B,QAAQ;AAAiB;;;;;;;AAexE,SAAgB,eAAe,EAAE,OAAO,GAAG,SAA8B;CACvE,IAAI,OAAO,UAAU,UAAU,OAAO;CAEtC,OACE,oBAAC,YAAD;EACE,SAAS,CAAC,UAAU;EACpB,iBAAiB;EACjB,eAAe;EACR;EACP,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,8 @@
1
+ import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
2
+ //#region src/components/avatar.d.ts
3
+ declare function Avatar({ className, ...props }: Avatar$1.Root.Props): import("react").JSX.Element;
4
+ declare function AvatarImage({ className, ...props }: Avatar$1.Image.Props): import("react").JSX.Element;
5
+ declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props): import("react").JSX.Element;
6
+ //#endregion
7
+ export { Avatar, AvatarFallback, AvatarImage };
8
+ //# sourceMappingURL=avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.d.ts","names":[],"sources":["../../src/components/avatar.tsx"],"mappings":";;iBAKS,SAAS,cAAc,SAAS,SAAgB,KAAK,wBAAK,IAAA;iBAS1D,cAAc,cAAc,SAAS,SAAgB,MAAM,wBAAK,IAAA;iBAIhE,iBAAiB,cAAc,SAAS,SAAgB,SAAS,wBAAK,IAAA"}
@@ -0,0 +1,27 @@
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
+ //#region 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-foreground/5 text-xs", className),
21
+ ...props
22
+ });
23
+ }
24
+ //#endregion
25
+ export { Avatar, AvatarFallback, AvatarImage };
26
+
27
+ //# 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(\n \"flex size-full items-center justify-center bg-foreground/5 text-xs\",\n className,\n )}\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,GACT,sEACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,58 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { ReactNode } from "react";
4
+ //#region src/components/badge.d.ts
5
+ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
6
+ variant: {
7
+ secondary: "bg-background border-border hover:[&[href],&[type]]:bg-muted";
8
+ soft: "bg-border/50 hover:[&[href],&[type]]:bg-border/75";
9
+ success: "bg-success-subtle border-success/20 text-success-foreground hover:[&[href],&[type]]:opacity-75";
10
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground hover:[&[href],&[type]]:opacity-75";
11
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground hover:[&[href],&[type]]:opacity-75";
12
+ };
13
+ size: {
14
+ sm: "px-1 py-px gap-1 text-[0.625rem]";
15
+ md: "px-1.5 py-0.5 gap-1.5 text-xs";
16
+ lg: "px-2 py-1 gap-2 text-sm rounded-md";
17
+ };
18
+ }, undefined, "inline-flex items-center rounded-sm font-display font-medium leading-tight border border-transparent whitespace-nowrap", {
19
+ variant: {
20
+ secondary: "bg-background border-border hover:[&[href],&[type]]:bg-muted";
21
+ soft: "bg-border/50 hover:[&[href],&[type]]:bg-border/75";
22
+ success: "bg-success-subtle border-success/20 text-success-foreground hover:[&[href],&[type]]:opacity-75";
23
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground hover:[&[href],&[type]]:opacity-75";
24
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground hover:[&[href],&[type]]:opacity-75";
25
+ };
26
+ size: {
27
+ sm: "px-1 py-px gap-1 text-[0.625rem]";
28
+ md: "px-1.5 py-0.5 gap-1.5 text-xs";
29
+ lg: "px-2 py-1 gap-2 text-sm rounded-md";
30
+ };
31
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
32
+ variant: {
33
+ secondary: "bg-background border-border hover:[&[href],&[type]]:bg-muted";
34
+ soft: "bg-border/50 hover:[&[href],&[type]]:bg-border/75";
35
+ success: "bg-success-subtle border-success/20 text-success-foreground hover:[&[href],&[type]]:opacity-75";
36
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground hover:[&[href],&[type]]:opacity-75";
37
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground hover:[&[href],&[type]]:opacity-75";
38
+ };
39
+ size: {
40
+ sm: "px-1 py-px gap-1 text-[0.625rem]";
41
+ md: "px-1.5 py-0.5 gap-1.5 text-xs";
42
+ lg: "px-2 py-1 gap-2 text-sm rounded-md";
43
+ };
44
+ }, undefined>>;
45
+ type BadgeProps = Omit<useRender.ComponentProps<"span">, "prefix"> & VariantProps<typeof badgeVariants> & {
46
+ /**
47
+ * The slot to be rendered before the label.
48
+ */
49
+ prefix?: ReactNode;
50
+ /**
51
+ * The slot to be rendered after the label.
52
+ */
53
+ suffix?: ReactNode;
54
+ };
55
+ declare function Badge({ children, className, render, variant, size, prefix, suffix, ...rest }: BadgeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
56
+ //#endregion
57
+ export { Badge, badgeVariants };
58
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","names":[],"sources":["../../src/components/badge.tsx"],"mappings":";;;;cAMM,2CAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2Bd,aAAa,KAAK,UAAU,oCAC/B,oBAAoB;;;;EAIlB,SAAS;;;;EAKT,SAAS;;iBAKJ,QACP,UACA,WACA,QACA,SACA,MACA,QACA,WACG,QACF,6BAAU,+CAAA"}
@@ -0,0 +1,51 @@
1
+ import { cn, variants } from "../lib/variants.js";
2
+ import { slot } from "../lib/slot.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
+ //#region src/components/badge.tsx
7
+ const badgeVariants = variants({
8
+ base: "inline-flex items-center rounded-sm font-display font-medium leading-tight border border-transparent whitespace-nowrap",
9
+ variants: {
10
+ variant: {
11
+ secondary: "bg-background border-border hover:[&[href],&[type]]:bg-muted",
12
+ soft: "bg-border/50 hover:[&[href],&[type]]:bg-border/75",
13
+ success: "bg-success-subtle border-success/20 text-success-foreground hover:[&[href],&[type]]:opacity-75",
14
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground hover:[&[href],&[type]]:opacity-75",
15
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground hover:[&[href],&[type]]:opacity-75"
16
+ },
17
+ size: {
18
+ sm: "px-1 py-px gap-1 text-[0.625rem]",
19
+ md: "px-1.5 py-0.5 gap-1.5 text-xs",
20
+ lg: "px-2 py-1 gap-2 text-sm rounded-md"
21
+ }
22
+ },
23
+ defaultVariants: {
24
+ variant: "soft",
25
+ size: "md"
26
+ }
27
+ });
28
+ const badgeAffixClasses = "shrink-0 size-[1.1em]";
29
+ function Badge({ children, className, render, variant, size, prefix, suffix, ...rest }) {
30
+ const props = mergeProps({
31
+ className: cn(badgeVariants({
32
+ variant,
33
+ size,
34
+ className
35
+ })),
36
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
37
+ slot(prefix, { className: badgeAffixClasses }),
38
+ children,
39
+ slot(suffix, { className: badgeAffixClasses })
40
+ ] })
41
+ }, rest);
42
+ return useRender({
43
+ defaultTagName: "span",
44
+ render,
45
+ props
46
+ });
47
+ }
48
+ //#endregion
49
+ export { Badge, badgeVariants };
50
+
51
+ //# 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 { cn, variants, type VariantProps } from \"~/lib/variants\"\n\nconst badgeVariants = variants({\n base: \"inline-flex items-center rounded-sm font-display font-medium leading-tight border border-transparent whitespace-nowrap\",\n\n variants: {\n variant: {\n secondary: \"bg-background border-border hover:[&[href],&[type]]:bg-muted\",\n soft: \"bg-border/50 hover:[&[href],&[type]]:bg-border/75\",\n success:\n \"bg-success-subtle border-success/20 text-success-foreground hover:[&[href],&[type]]:opacity-75\",\n warning:\n \"bg-warning-subtle border-warning/20 text-warning-foreground hover:[&[href],&[type]]:opacity-75\",\n danger:\n \"bg-danger-subtle border-danger/20 text-danger-foreground hover:[&[href],&[type]]:opacity-75\",\n },\n size: {\n sm: \"px-1 py-px gap-1 text-[0.625rem]\",\n md: \"px-1.5 py-0.5 gap-1.5 text-xs\",\n lg: \"px-2 py-1 gap-2 text-sm rounded-md\",\n },\n },\n\n defaultVariants: {\n variant: \"soft\",\n size: \"md\",\n },\n})\n\ntype BadgeProps = Omit<useRender.ComponentProps<\"span\">, \"prefix\"> &\n VariantProps<typeof badgeVariants> & {\n /**\n * The slot to be rendered before the label.\n */\n prefix?: ReactNode\n\n /**\n * The slot to be rendered after the label.\n */\n suffix?: ReactNode\n }\n\nconst badgeAffixClasses = \"shrink-0 size-[1.1em]\"\n\nfunction Badge({\n children,\n className,\n render,\n variant,\n size,\n prefix,\n suffix,\n ...rest\n}: BadgeProps) {\n const props = mergeProps<\"span\">(\n {\n className: cn(badgeVariants({ 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":";;;;;;AAMA,MAAM,gBAAgB,SAAS;CAC7B,MAAM;CAEN,UAAU;EACR,SAAS;GACP,WAAW;GACX,MAAM;GACN,SACE;GACF,SACE;GACF,QACE;EACJ;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CAEA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CAAC;AAeD,MAAM,oBAAoB;AAE1B,SAAS,MAAM,EACb,UACA,WACA,QACA,SACA,MACA,QACA,QACA,GAAG,QACU;CACb,MAAM,QAAQ,WACZ;EACE,WAAW,GAAG,cAAc;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EACzD,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,63 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { interactiveVariants } from "../lib/interactive.js";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ import { ReactNode } from "react";
5
+ //#region src/components/button.d.ts
6
+ declare const buttonVariants: import("tailwind-variants").TVReturnType<{
7
+ variant: {
8
+ primary: "text-background bg-foreground hover:opacity-90";
9
+ secondary: "bg-card text-secondary-foreground";
10
+ soft: "bg-muted text-secondary-foreground hover:bg-muted/75 hover:text-foreground hover:outline-none";
11
+ ghost: "text-secondary-foreground hover:bg-foreground/5 hover:text-foreground hover:outline-none";
12
+ danger: "bg-danger text-white hover:bg-danger/90";
13
+ };
14
+ size: {
15
+ sm: "px-2 py-1 gap-[0.66ch]";
16
+ md: "min-h-control px-3 py-2 gap-[0.75ch]";
17
+ lg: "px-3.5 py-2.5 gap-[1ch] rounded-lg sm:text-sm/tight";
18
+ };
19
+ }, undefined, string[], {
20
+ variant: {
21
+ primary: "text-background bg-foreground hover:opacity-90";
22
+ secondary: "bg-card text-secondary-foreground";
23
+ soft: "bg-muted text-secondary-foreground hover:bg-muted/75 hover:text-foreground hover:outline-none";
24
+ ghost: "text-secondary-foreground hover:bg-foreground/5 hover:text-foreground hover:outline-none";
25
+ danger: "bg-danger text-white hover:bg-danger/90";
26
+ };
27
+ size: {
28
+ sm: "px-2 py-1 gap-[0.66ch]";
29
+ md: "min-h-control px-3 py-2 gap-[0.75ch]";
30
+ lg: "px-3.5 py-2.5 gap-[1ch] rounded-lg sm:text-sm/tight";
31
+ };
32
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
33
+ variant: {
34
+ primary: "text-background bg-foreground hover:opacity-90";
35
+ secondary: "bg-card text-secondary-foreground";
36
+ soft: "bg-muted text-secondary-foreground hover:bg-muted/75 hover:text-foreground hover:outline-none";
37
+ ghost: "text-secondary-foreground hover:bg-foreground/5 hover:text-foreground hover:outline-none";
38
+ danger: "bg-danger text-white hover:bg-danger/90";
39
+ };
40
+ size: {
41
+ sm: "px-2 py-1 gap-[0.66ch]";
42
+ md: "min-h-control px-3 py-2 gap-[0.75ch]";
43
+ lg: "px-3.5 py-2.5 gap-[1ch] rounded-lg sm:text-sm/tight";
44
+ };
45
+ }, undefined>>;
46
+ export type ButtonProps = Omit<useRender.ComponentProps<"button">, "size" | "prefix"> & VariantProps<typeof buttonVariants> & Pick<VariantProps<typeof interactiveVariants>, "hover" | "focus"> & {
47
+ /**
48
+ * If set to `true`, the button will be rendered in the pending state.
49
+ */
50
+ isPending?: boolean;
51
+ /**
52
+ * The slot to be rendered before the label.
53
+ */
54
+ prefix?: ReactNode;
55
+ /**
56
+ * The slot to be rendered after the label.
57
+ */
58
+ suffix?: ReactNode;
59
+ };
60
+ declare function Button({ children, className, disabled, render, isPending, prefix, suffix, variant, size, hover, focus, ...rest }: ButtonProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
61
+ //#endregion
62
+ export { Button, buttonVariants };
63
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","names":[],"sources":["../../src/components/button.tsx"],"mappings":";;;;;cAQM,4CAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoCR,cAAc,KAAK,UAAU,+CACvC,oBAAoB,kBACpB,KAAK,oBAAoB;;;;EAIvB;;;;EAKA,SAAS;;;;EAKT,SAAS;;iBAGJ,SACP,UACA,WACA,UACA,QACA,WACA,QACA,QACA,SACA,MACA,OACA,UACG,QACF,8BAAW,+CAAA"}
@@ -0,0 +1,66 @@
1
+ import { cn, variants } from "../lib/variants.js";
2
+ import { slot } from "../lib/slot.js";
3
+ import { LoaderIcon } from "../lib/icons.js";
4
+ import { interactiveVariants } from "../lib/interactive.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { mergeProps } from "@base-ui/react";
7
+ import { useRender } from "@base-ui/react/use-render";
8
+ import { Children, isValidElement } from "react";
9
+ //#region src/components/button.tsx
10
+ const buttonVariants = variants({
11
+ base: ["group/button inline-flex items-center justify-center font-medium text-control text-start rounded-md overflow-clip select-none hover:z-10", "disabled:opacity-60 disabled:pointer-events-none aria-disabled:opacity-60 aria-disabled:pointer-events-none"],
12
+ variants: {
13
+ variant: {
14
+ primary: "text-background bg-foreground hover:opacity-90",
15
+ secondary: "bg-card text-secondary-foreground",
16
+ soft: "bg-muted text-secondary-foreground hover:bg-muted/75 hover:text-foreground hover:outline-none",
17
+ ghost: "text-secondary-foreground hover:bg-foreground/5 hover:text-foreground hover:outline-none",
18
+ danger: "bg-danger text-white hover:bg-danger/90"
19
+ },
20
+ size: {
21
+ sm: "px-2 py-1 gap-[0.66ch]",
22
+ md: "min-h-control px-3 py-2 gap-[0.75ch]",
23
+ lg: "px-3.5 py-2.5 gap-[1ch] rounded-lg sm:text-sm/tight"
24
+ }
25
+ },
26
+ defaultVariants: {
27
+ variant: "primary",
28
+ size: "md"
29
+ }
30
+ });
31
+ const buttonAffixClasses = "shrink-0 first:-ml-[0.21425em] last:-mr-[0.21425em] [svg]:my-[0.077em] [svg]:size-[1.1em]";
32
+ /** Hidden while the button is pending, so only the spinner reads as content. */
33
+ const buttonPendingClasses = "group-data-pending/button:text-transparent";
34
+ function Button({ children, className, disabled, render, isPending, prefix, suffix, variant, size, hover = true, focus = true, ...rest }) {
35
+ const props = mergeProps({
36
+ disabled: disabled || isPending,
37
+ "aria-busy": isPending || void 0,
38
+ className: cn(interactiveVariants({
39
+ hover,
40
+ focus,
41
+ bordered: variant === "secondary"
42
+ }), buttonVariants({
43
+ variant,
44
+ size,
45
+ className
46
+ })),
47
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
48
+ slot(prefix && isPending ? /* @__PURE__ */ jsx(LoaderIcon, { className: "animate-spin" }) : prefix, { className: buttonAffixClasses }),
49
+ Children.count(children) > 0 && slot(isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children }), { className: cn("flex-1 truncate only:text-center has-[div]:contents", buttonPendingClasses) }),
50
+ slot(suffix, { className: cn(buttonAffixClasses, buttonPendingClasses) }),
51
+ !prefix && !!isPending && /* @__PURE__ */ jsx(LoaderIcon, { className: "absolute size-[1.25em] animate-spin" })
52
+ ] })
53
+ }, rest);
54
+ return useRender({
55
+ defaultTagName: "button",
56
+ render,
57
+ props: {
58
+ "data-pending": isPending || void 0,
59
+ ...props
60
+ }
61
+ });
62
+ }
63
+ //#endregion
64
+ export { Button, buttonVariants };
65
+
66
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { Children, isValidElement, type ReactNode } from \"react\"\nimport { LoaderIcon } from \"~/lib/icons\"\nimport { interactiveVariants } from \"~/lib/interactive\"\nimport { slot } from \"~/lib/slot\"\nimport { variants, cn, type VariantProps } from \"~/lib/variants\"\n\nconst buttonVariants = variants({\n base: [\n \"group/button inline-flex items-center justify-center font-medium text-control text-start rounded-md overflow-clip select-none hover:z-10\",\n \"disabled:opacity-60 disabled:pointer-events-none aria-disabled:opacity-60 aria-disabled:pointer-events-none\",\n ],\n\n variants: {\n variant: {\n primary: \"text-background bg-foreground hover:opacity-90\",\n secondary: \"bg-card text-secondary-foreground\",\n soft: \"bg-muted text-secondary-foreground hover:bg-muted/75 hover:text-foreground hover:outline-none\",\n ghost:\n \"text-secondary-foreground hover:bg-foreground/5 hover:text-foreground hover:outline-none\",\n danger: \"bg-danger text-white hover:bg-danger/90\",\n },\n size: {\n sm: \"px-2 py-1 gap-[0.66ch]\",\n // The default control height. A floor rather than a fixed height, so a row that leads\n // with something taller than the label (the sidebar's 20px avatar) still grows.\n md: \"min-h-control px-3 py-2 gap-[0.75ch]\",\n lg: \"px-3.5 py-2.5 gap-[1ch] rounded-lg sm:text-sm/tight\",\n },\n },\n\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n})\n\nconst buttonAffixClasses =\n \"shrink-0 first:-ml-[0.21425em] last:-mr-[0.21425em] [svg]:my-[0.077em] [svg]:size-[1.1em]\"\n\n/** Hidden while the button is pending, so only the spinner reads as content. */\nconst buttonPendingClasses = \"group-data-pending/button:text-transparent\"\n\nexport type ButtonProps = Omit<useRender.ComponentProps<\"button\">, \"size\" | \"prefix\"> &\n VariantProps<typeof buttonVariants> &\n Pick<VariantProps<typeof interactiveVariants>, \"hover\" | \"focus\"> & {\n /**\n * If set to `true`, the button will be rendered in the pending state.\n */\n isPending?: boolean\n\n /**\n * The slot to be rendered before the label.\n */\n prefix?: ReactNode\n\n /**\n * The slot to be rendered after the label.\n */\n suffix?: ReactNode\n }\n\nfunction Button({\n children,\n className,\n disabled,\n render,\n isPending,\n prefix,\n suffix,\n variant,\n size,\n hover = true,\n focus = true,\n ...rest\n}: ButtonProps) {\n const props = mergeProps<\"button\">(\n {\n disabled: disabled || isPending,\n \"aria-busy\": isPending || undefined,\n className: cn(\n interactiveVariants({ hover, focus, bordered: variant === \"secondary\" }),\n buttonVariants({ variant, size, className }),\n ),\n children: (\n <>\n {slot(prefix && isPending ? <LoaderIcon className=\"animate-spin\" /> : prefix, {\n className: buttonAffixClasses,\n })}\n\n {Children.count(children) > 0 &&\n slot(isValidElement(children) ? children : <span>{children}</span>, {\n className: cn(\n \"flex-1 truncate only:text-center has-[div]:contents\",\n buttonPendingClasses,\n ),\n })}\n\n {slot(suffix, { className: cn(buttonAffixClasses, buttonPendingClasses) })}\n\n {!prefix && !!isPending && <LoaderIcon className=\"absolute size-[1.25em] animate-spin\" />}\n </>\n ),\n },\n rest,\n )\n\n // `data-pending` drives the label and suffix fade; it sits outside `mergeProps`, whose\n // button props type has no room for a custom data attribute.\n return useRender({\n defaultTagName: \"button\",\n render,\n props: { \"data-pending\": isPending || undefined, ...props },\n })\n}\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;;;AAQA,MAAM,iBAAiB,SAAS;CAC9B,MAAM,CACJ,4IACA,6GACF;CAEA,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,MAAM;GACN,OACE;GACF,QAAQ;EACV;EACA,MAAM;GACJ,IAAI;GAGJ,IAAI;GACJ,IAAI;EACN;CACF;CAEA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CAAC;AAED,MAAM,qBACJ;;AAGF,MAAM,uBAAuB;AAqB7B,SAAS,OAAO,EACd,UACA,WACA,UACA,QACA,WACA,QACA,QACA,SACA,MACA,QAAQ,MACR,QAAQ,MACR,GAAG,QACW;CACd,MAAM,QAAQ,WACZ;EACE,UAAU,YAAY;EACtB,aAAa,aAAa,KAAA;EAC1B,WAAW,GACT,oBAAoB;GAAE;GAAO;GAAO,UAAU,YAAY;EAAY,CAAC,GACvE,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,CAC7C;EACA,UACE,qBAAA,UAAA,EAAA,UAAA;GACG,KAAK,UAAU,YAAY,oBAAC,YAAD,EAAY,WAAU,eAAgB,CAAA,IAAI,QAAQ,EAC5E,WAAW,mBACb,CAAC;GAEA,SAAS,MAAM,QAAQ,IAAI,KAC1B,KAAK,eAAe,QAAQ,IAAI,WAAW,oBAAC,QAAD,EAAO,SAAe,CAAA,GAAG,EAClE,WAAW,GACT,uDACA,oBACF,EACF,CAAC;GAEF,KAAK,QAAQ,EAAE,WAAW,GAAG,oBAAoB,oBAAoB,EAAE,CAAC;GAExE,CAAC,UAAU,CAAC,CAAC,aAAa,oBAAC,YAAD,EAAY,WAAU,sCAAuC,CAAA;EACxF,EAAA,CAAA;CAEN,GACA,IACF;CAIA,OAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO;GAAE,gBAAgB,aAAa,KAAA;GAAW,GAAG;EAAM;CAC5D,CAAC;AACH"}
@@ -0,0 +1,41 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { Stack } from "./stack.js";
3
+ import { ComponentProps, ReactNode } from "react";
4
+ //#region src/components/callout.d.ts
5
+ declare const calloutVariants: import("tailwind-variants").TVReturnType<{
6
+ variant: {
7
+ soft: "bg-muted text-secondary-foreground";
8
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground/90";
9
+ success: "bg-success-subtle border-success/20 text-success-foreground/90";
10
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground/90";
11
+ };
12
+ }, undefined, "w-full rounded-lg border px-3.5 py-2.5", {
13
+ variant: {
14
+ soft: "bg-muted text-secondary-foreground";
15
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground/90";
16
+ success: "bg-success-subtle border-success/20 text-success-foreground/90";
17
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground/90";
18
+ };
19
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
20
+ variant: {
21
+ soft: "bg-muted text-secondary-foreground";
22
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground/90";
23
+ success: "bg-success-subtle border-success/20 text-success-foreground/90";
24
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground/90";
25
+ };
26
+ }, undefined>>;
27
+ type CalloutProps = Omit<ComponentProps<typeof Stack>, "prefix" | "suffix"> & VariantProps<typeof calloutVariants> & {
28
+ /**
29
+ * The slot to be rendered before the content.
30
+ */
31
+ prefix?: ReactNode;
32
+ /**
33
+ * The slot to be rendered after the content.
34
+ */
35
+ suffix?: ReactNode;
36
+ };
37
+ declare function Callout({ children, className, variant, prefix, suffix, ...props }: CalloutProps): import("react").JSX.Element;
38
+ declare function CalloutText({ className, ...props }: ComponentProps<"p">): import("react").JSX.Element;
39
+ //#endregion
40
+ export { Callout, CalloutText };
41
+ //# sourceMappingURL=callout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callout.d.ts","names":[],"sources":["../../src/components/callout.tsx"],"mappings":";;;;cAKM,6CAAe;;;;;;;;;;;;;;;;;;;;;;KA4BhB,eAAe,KAAK,sBAAsB,+BAC7C,oBAAoB;;;;EAIlB,SAAS;;;;EAKT,SAAS;;iBAGJ,UAAU,UAAU,WAAW,SAAS,QAAQ,WAAW,SAAS,+BAAY,IAAA;iBAgBhF,cAAc,cAAc,SAAS,sCAAmB,IAAA"}
@@ -0,0 +1,49 @@
1
+ import { cn, variants } from "../lib/variants.js";
2
+ import { slot } from "../lib/slot.js";
3
+ import { Stack } from "./stack.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/callout.tsx
6
+ const calloutVariants = variants({
7
+ base: "w-full rounded-lg border px-3.5 py-2.5",
8
+ variants: { variant: {
9
+ soft: "bg-muted text-secondary-foreground",
10
+ warning: "bg-warning-subtle border-warning/20 text-warning-foreground/90",
11
+ success: "bg-success-subtle border-success/20 text-success-foreground/90",
12
+ danger: "bg-danger-subtle border-danger/20 text-danger-foreground/90"
13
+ } },
14
+ defaultVariants: { variant: "soft" }
15
+ });
16
+ /**
17
+ * How assistive tech should treat each tone: the two failure tones interrupt, a success
18
+ * confirmation is announced politely, and a plain note is neither.
19
+ */
20
+ const calloutRoles = {
21
+ soft: "note",
22
+ warning: "alert",
23
+ success: "status",
24
+ danger: "alert"
25
+ };
26
+ function Callout({ children, className, variant, prefix, suffix, ...props }) {
27
+ return /* @__PURE__ */ jsxs(Stack, {
28
+ size: "sm",
29
+ wrap: false,
30
+ role: calloutRoles[variant ?? "soft"],
31
+ className: cn(calloutVariants({ variant }), className),
32
+ ...props,
33
+ children: [
34
+ slot(prefix, { className: "mt-0.5 self-start shrink-0 size-4.5" }),
35
+ children,
36
+ slot(suffix, { className: "mt-0.5 self-start shrink-0 size-4.5" })
37
+ ]
38
+ });
39
+ }
40
+ function CalloutText({ className, ...props }) {
41
+ return /* @__PURE__ */ jsx("p", {
42
+ className: cn("font-medium text-pretty text-sm/relaxed", className),
43
+ ...props
44
+ });
45
+ }
46
+ //#endregion
47
+ export { Callout, CalloutText };
48
+
49
+ //# sourceMappingURL=callout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callout.js","names":[],"sources":["../../src/components/callout.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from \"react\"\nimport { Stack } from \"~/components/stack\"\nimport { slot } from \"~/lib/slot\"\nimport { variants, cn, type VariantProps } from \"~/lib/variants\"\n\nconst calloutVariants = variants({\n base: \"w-full rounded-lg border px-3.5 py-2.5\",\n\n variants: {\n variant: {\n soft: \"bg-muted text-secondary-foreground\",\n warning: \"bg-warning-subtle border-warning/20 text-warning-foreground/90\",\n success: \"bg-success-subtle border-success/20 text-success-foreground/90\",\n danger: \"bg-danger-subtle border-danger/20 text-danger-foreground/90\",\n },\n },\n\n defaultVariants: {\n variant: \"soft\",\n },\n})\n\n/**\n * How assistive tech should treat each tone: the two failure tones interrupt, a success\n * confirmation is announced politely, and a plain note is neither.\n */\nconst calloutRoles = {\n soft: \"note\",\n warning: \"alert\",\n success: \"status\",\n danger: \"alert\",\n} as const\n\ntype CalloutProps = Omit<ComponentProps<typeof Stack>, \"prefix\" | \"suffix\"> &\n VariantProps<typeof calloutVariants> & {\n /**\n * The slot to be rendered before the content.\n */\n prefix?: ReactNode\n\n /**\n * The slot to be rendered after the content.\n */\n suffix?: ReactNode\n }\n\nfunction Callout({ children, className, variant, prefix, suffix, ...props }: CalloutProps) {\n return (\n <Stack\n size=\"sm\"\n wrap={false}\n role={calloutRoles[variant ?? \"soft\"]}\n className={cn(calloutVariants({ variant }), className)}\n {...props}\n >\n {slot(prefix, { className: \"mt-0.5 self-start shrink-0 size-4.5\" })}\n {children}\n {slot(suffix, { className: \"mt-0.5 self-start shrink-0 size-4.5\" })}\n </Stack>\n )\n}\n\nfunction CalloutText({ className, ...props }: ComponentProps<\"p\">) {\n return <p className={cn(\"font-medium text-pretty text-sm/relaxed\", className)} {...props} />\n}\n\nexport { Callout, CalloutText }\n"],"mappings":";;;;;AAKA,MAAM,kBAAkB,SAAS;CAC/B,MAAM;CAEN,UAAU,EACR,SAAS;EACP,MAAM;EACN,SAAS;EACT,SAAS;EACT,QAAQ;CACV,EACF;CAEA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC;;;;;AAMD,MAAM,eAAe;CACnB,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAeA,SAAS,QAAQ,EAAE,UAAU,WAAW,SAAS,QAAQ,QAAQ,GAAG,SAAuB;CACzF,OACE,qBAAC,OAAD;EACE,MAAK;EACL,MAAM;EACN,MAAM,aAAa,WAAW;EAC9B,WAAW,GAAG,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS;EACrD,GAAI;EALN,UAAA;GAOG,KAAK,QAAQ,EAAE,WAAW,sCAAsC,CAAC;GACjE;GACA,KAAK,QAAQ,EAAE,WAAW,sCAAsC,CAAC;EAC7D;;AAEX;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA8B;CACjE,OAAO,oBAAC,KAAD;EAAG,WAAW,GAAG,2CAA2C,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC7F"}
@@ -0,0 +1,61 @@
1
+ import { VariantProps } from "../lib/variants.js";
2
+ import { SectionHeader } from "./section-header.js";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ import { ComponentProps } from "react";
5
+ //#region src/components/card.d.ts
6
+ /**
7
+ * The one raised surface in the app: a white panel on the canvas, hairline border, 12px radius
8
+ * and a whisper of shadow, clipping whatever sits in its corners. Every card, list card and
9
+ * stat strip is this recipe — change it here and it changes everywhere.
10
+ */
11
+ export declare const cardSurfaceClasses = "overflow-clip rounded-xl border bg-card shadow-xs";
12
+ declare const cardVariants: import("tailwind-variants").TVReturnType<{
13
+ /**
14
+ * Separate the children with hairlines, for a card whose body is a run of rows or panels.
15
+ */
16
+ divided: {
17
+ true: "divide-y";
18
+ };
19
+ }, undefined, string[], {
20
+ /**
21
+ * Separate the children with hairlines, for a card whose body is a run of rows or panels.
22
+ */
23
+ divided: {
24
+ true: "divide-y";
25
+ };
26
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
27
+ /**
28
+ * Separate the children with hairlines, for a card whose body is a run of rows or panels.
29
+ */
30
+ divided: {
31
+ true: "divide-y";
32
+ };
33
+ }, undefined>>;
34
+ declare const cardPanelVariants: import("tailwind-variants").TVReturnType<{
35
+ size: {
36
+ md: "p-4 md:p-6";
37
+ lg: "p-6 md:p-8";
38
+ };
39
+ }, undefined, "border-t first:border-t-0", {
40
+ size: {
41
+ md: "p-4 md:p-6";
42
+ lg: "p-6 md:p-8";
43
+ };
44
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
45
+ size: {
46
+ md: "p-4 md:p-6";
47
+ lg: "p-6 md:p-8";
48
+ };
49
+ }, undefined>>;
50
+ /**
51
+ * The card heading: `SectionHeader` preset to the card scale (an `h4` title, tight spacing). Pass
52
+ * `size="panel"` for the smaller dashboard-panel scale.
53
+ */
54
+ declare function CardHeader(props: ComponentProps<typeof SectionHeader>): import("react").JSX.Element;
55
+ export type CardProps = useRender.ComponentProps<"div"> & VariantProps<typeof cardVariants>;
56
+ declare function Card({ render, className, divided, ...props }: CardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
57
+ export type CardPanelProps = useRender.ComponentProps<"div"> & VariantProps<typeof cardPanelVariants>;
58
+ declare function CardPanel({ className, render, size, ...props }: CardPanelProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
59
+ //#endregion
60
+ export { Card, CardHeader, CardPanel };
61
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","names":[],"sources":["../../src/components/card.tsx"],"mappings":";;;;;;;;;;qBAUa;cAEP,0CAAY;;;;;;;;;;;;;;;;;;;;;;cAgBZ,+CAAiB;;;;;;;;;;;;;;;;;;;;iBAmBd,WAAW,OAAO,sBAAsB,iCAAc,IAAA;YAInD,YAAY,UAAU,wBAAwB,oBAAoB;iBAErE,OAAO,QAAQ,WAAW,YAAY,SAAS,4BAAS,+CAAA;YAQrD,iBAAiB,UAAU,wBACrC,oBAAoB;iBAEb,YAAY,WAAW,QAAQ,SAAS,SAAS,iCAAc,+CAAA"}