@squadbase/vantage 0.6.2-dev1.b332e5a → 0.6.2-dev1.d7c0911

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 (212) hide show
  1. package/dist/add-4GHF2TX2.js +6 -0
  2. package/dist/add-4GHF2TX2.js.map +1 -0
  3. package/dist/{build-TVKFIVFQ.js → build-X5NVCQKT.js} +7 -7
  4. package/dist/{build-TVKFIVFQ.js.map → build-X5NVCQKT.js.map} +1 -1
  5. package/dist/{check-3KHZXZMQ.js → check-ZBIH422T.js} +5 -5
  6. package/dist/{check-3KHZXZMQ.js.map → check-ZBIH422T.js.map} +1 -1
  7. package/dist/chunk-2ICNHUG6.js +1820 -0
  8. package/dist/chunk-2ICNHUG6.js.map +1 -0
  9. package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
  10. package/dist/chunk-2N72FKLB.js.map +1 -0
  11. package/dist/{chunk-P7W4LR3Z.js → chunk-7DZGJQ3P.js} +3 -3
  12. package/dist/{chunk-P7W4LR3Z.js.map → chunk-7DZGJQ3P.js.map} +1 -1
  13. package/dist/{chunk-U2M6HGKQ.js → chunk-AABMKHEU.js} +4 -4
  14. package/dist/{chunk-U2M6HGKQ.js.map → chunk-AABMKHEU.js.map} +1 -1
  15. package/dist/{chunk-QI3XQKHS.js → chunk-GNXCX4WE.js} +10 -3
  16. package/dist/chunk-GNXCX4WE.js.map +1 -0
  17. package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
  18. package/dist/chunk-PDOBHMUQ.js.map +1 -0
  19. package/dist/{chunk-ZVANIULZ.js → chunk-RNTDBX6S.js} +4 -4
  20. package/dist/{chunk-ZVANIULZ.js.map → chunk-RNTDBX6S.js.map} +1 -1
  21. package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
  22. package/dist/chunk-U736PVHY.js.map +1 -0
  23. package/dist/{chunk-PVTHHV7X.js → chunk-V3LF7BE7.js} +27 -5
  24. package/dist/chunk-V3LF7BE7.js.map +1 -0
  25. package/dist/{chunk-LMUACBMA.js → chunk-WAMZWZJB.js} +53 -8
  26. package/dist/chunk-WAMZWZJB.js.map +1 -0
  27. package/dist/chunk-WRSX2MDK.js +7866 -0
  28. package/dist/chunk-WRSX2MDK.js.map +1 -0
  29. package/dist/{chunk-RPZAALCX.js → chunk-XPQSTZUU.js} +254 -164
  30. package/dist/chunk-XPQSTZUU.js.map +1 -0
  31. package/dist/{chunk-DTDVSFRY.js → chunk-XQUSGIDG.js} +17 -3
  32. package/dist/chunk-XQUSGIDG.js.map +1 -0
  33. package/dist/cli.js +12 -11
  34. package/dist/cli.js.map +1 -1
  35. package/dist/client/index.d.ts +32 -3
  36. package/dist/client/index.js +205 -12
  37. package/dist/client/index.js.map +1 -1
  38. package/dist/components/index.d.ts +1975 -28
  39. package/dist/components/index.js +4 -4
  40. package/dist/{dev-GDKATCC7.js → dev-4XEDTELV.js} +8 -8
  41. package/dist/dev-4XEDTELV.js.map +1 -0
  42. package/dist/doc/index.js +2 -2
  43. package/dist/doc/index.js.map +1 -1
  44. package/dist/{docs-EJJ3BECT.js → docs-JVP4RPKT.js} +3 -3
  45. package/dist/{docs-EJJ3BECT.js.map → docs-JVP4RPKT.js.map} +1 -1
  46. package/dist/{doctor-WQXPXP6K.js → doctor-5E2VEZPK.js} +5 -5
  47. package/dist/{doctor-WQXPXP6K.js.map → doctor-5E2VEZPK.js.map} +1 -1
  48. package/dist/markdown/index.js +1 -1
  49. package/dist/markdown/index.js.map +1 -1
  50. package/dist/{preview-OGMCNQUO.js → preview-T6CLSQVX.js} +3 -3
  51. package/dist/{preview-OGMCNQUO.js.map → preview-T6CLSQVX.js.map} +1 -1
  52. package/dist/query/index.d.ts +0 -11
  53. package/dist/query/index.js +2 -2
  54. package/dist/{routes-MWBWWOJ2.js → routes-3SGAFDMC.js} +4 -4
  55. package/dist/{routes-MWBWWOJ2.js.map → routes-3SGAFDMC.js.map} +1 -1
  56. package/dist/{search-6Y422SV6.js → search-5LC4XPB5.js} +3 -3
  57. package/dist/{search-6Y422SV6.js.map → search-5LC4XPB5.js.map} +1 -1
  58. package/dist/table/index.js +10 -9
  59. package/dist/table/index.js.map +1 -1
  60. package/dist/ui/index.d.ts +144 -11
  61. package/dist/ui/index.js +1339 -87
  62. package/dist/ui/index.js.map +1 -1
  63. package/dist/{upgrade-HCANX4GQ.js → upgrade-JHXZBGQS.js} +6 -6
  64. package/dist/{upgrade-HCANX4GQ.js.map → upgrade-JHXZBGQS.js.map} +1 -1
  65. package/dist/vite/index.d.ts +10 -0
  66. package/dist/vite/index.js +3 -3
  67. package/docs/en/components.md +29 -15
  68. package/docs/en/parts/data-table.md +22 -0
  69. package/docs/en/parts/delta.md +50 -0
  70. package/docs/en/parts/format.md +43 -0
  71. package/docs/en/parts/kpi-card.md +57 -0
  72. package/docs/en/parts/metric-value.md +3 -2
  73. package/docs/en/parts/sparkline.md +1 -1
  74. package/docs/en/parts/trend-indicator.md +17 -1
  75. package/docs/en/ui-and-theming.md +1 -1
  76. package/docs/index.json +366 -76
  77. package/docs/ja/changelog.md +31 -0
  78. package/docs/ja/components.md +57 -101
  79. package/docs/ja/page-types/csv.md +83 -0
  80. package/docs/ja/page-types/doc.md +83 -0
  81. package/docs/ja/page-types/excel.md +82 -0
  82. package/docs/ja/page-types/slide.md +132 -0
  83. package/docs/ja/page-types.md +47 -0
  84. package/docs/ja/parts/area-chart.md +61 -0
  85. package/docs/ja/parts/bar-chart.md +69 -0
  86. package/docs/ja/parts/bar-list.md +35 -0
  87. package/docs/ja/parts/category-bar.md +36 -0
  88. package/docs/ja/parts/data-table.md +22 -0
  89. package/docs/ja/parts/delta.md +50 -0
  90. package/docs/ja/parts/donut-chart.md +47 -0
  91. package/docs/ja/parts/echart.md +3 -0
  92. package/docs/ja/parts/format.md +44 -0
  93. package/docs/ja/parts/kpi-card.md +55 -0
  94. package/docs/ja/parts/line-chart.md +58 -0
  95. package/docs/ja/parts/metric-value.md +3 -2
  96. package/docs/ja/parts/progress-circle.md +34 -0
  97. package/docs/ja/parts/sparkline.md +2 -2
  98. package/docs/ja/parts/tracker.md +32 -0
  99. package/docs/ja/parts/trend-indicator.md +17 -1
  100. package/docs/ja/routing.md +8 -86
  101. package/docs/ja/ui/alert-dialog.md +41 -0
  102. package/docs/ja/ui/avatar.md +31 -0
  103. package/docs/ja/ui/combobox.md +74 -0
  104. package/docs/ja/ui/drawer.md +41 -0
  105. package/docs/ja/ui/field.md +42 -0
  106. package/docs/ja/ui/hover-card.md +21 -0
  107. package/docs/ja/ui/kbd.md +16 -0
  108. package/docs/ja/ui/pagination.md +36 -0
  109. package/docs/ja/ui/radio-group.md +21 -0
  110. package/docs/ja/ui/toast.md +46 -0
  111. package/docs/ja/ui-and-theming.md +14 -7
  112. package/package.json +13 -4
  113. package/registry/ui/accordion.tsx +76 -0
  114. package/registry/ui/alert-dialog.tsx +189 -0
  115. package/registry/ui/alert.tsx +80 -0
  116. package/registry/ui/app-shell.tsx +287 -0
  117. package/registry/ui/area-chart.tsx +3639 -0
  118. package/registry/ui/avatar.tsx +110 -0
  119. package/registry/ui/badge.tsx +56 -0
  120. package/registry/ui/bar-chart.tsx +3636 -0
  121. package/registry/ui/bar-list.tsx +3680 -0
  122. package/registry/ui/breadcrumb.tsx +128 -0
  123. package/registry/ui/button.tsx +62 -0
  124. package/registry/ui/calendar.tsx +223 -0
  125. package/registry/ui/card.tsx +107 -0
  126. package/registry/ui/category-bar.tsx +1255 -0
  127. package/registry/ui/chart-frame.tsx +1358 -0
  128. package/registry/ui/checkbox.tsx +30 -0
  129. package/registry/ui/collapsible.tsx +23 -0
  130. package/registry/ui/combobox.tsx +310 -0
  131. package/registry/ui/command.tsx +198 -0
  132. package/registry/ui/dashboard-card.tsx +217 -0
  133. package/registry/ui/data-table.tsx +693 -146
  134. package/registry/ui/date-range-picker.tsx +390 -0
  135. package/registry/ui/delta.tsx +188 -0
  136. package/registry/ui/dialog.tsx +161 -0
  137. package/registry/ui/donut-chart.tsx +3688 -0
  138. package/registry/ui/drawer.tsx +229 -0
  139. package/registry/ui/dropdown-menu.tsx +274 -0
  140. package/registry/ui/echart.tsx +890 -0
  141. package/registry/ui/field.tsx +240 -0
  142. package/registry/ui/filter-bar.tsx +392 -0
  143. package/registry/ui/funnel-steps.tsx +3541 -0
  144. package/registry/ui/heatmap.tsx +1752 -0
  145. package/registry/ui/hover-card.tsx +52 -0
  146. package/registry/ui/input-group.tsx +160 -0
  147. package/registry/ui/input.tsx +24 -0
  148. package/registry/ui/kbd.tsx +30 -0
  149. package/registry/ui/kpi-card.tsx +677 -0
  150. package/registry/ui/label.tsx +22 -0
  151. package/registry/ui/legend.tsx +3500 -0
  152. package/registry/ui/line-chart.tsx +3637 -0
  153. package/registry/ui/metric-value.tsx +62 -0
  154. package/registry/ui/multi-select.tsx +232 -0
  155. package/registry/ui/page-shell.tsx +282 -0
  156. package/registry/ui/pagination.tsx +140 -0
  157. package/registry/ui/placeholder.tsx +36 -0
  158. package/registry/ui/popover.tsx +92 -0
  159. package/registry/ui/progress-circle.tsx +867 -0
  160. package/registry/ui/progress.tsx +85 -0
  161. package/registry/ui/radio-group.tsx +39 -0
  162. package/registry/ui/sample-data.tsx +86 -0
  163. package/registry/ui/scatter-chart.tsx +4150 -0
  164. package/registry/ui/scroll-area.tsx +56 -0
  165. package/registry/ui/searchable-select.tsx +214 -0
  166. package/registry/ui/section-header.tsx +43 -0
  167. package/registry/ui/segmented-control.tsx +76 -0
  168. package/registry/ui/select.tsx +255 -0
  169. package/registry/ui/separator.tsx +27 -0
  170. package/registry/ui/sheet.tsx +139 -0
  171. package/registry/ui/sidebar.tsx +725 -0
  172. package/registry/ui/skeleton.tsx +17 -0
  173. package/registry/ui/slider.tsx +56 -0
  174. package/registry/ui/sparkline.tsx +230 -0
  175. package/registry/ui/spinner.tsx +14 -0
  176. package/registry/ui/states.tsx +90 -0
  177. package/registry/ui/status-badge.tsx +121 -0
  178. package/registry/ui/switch.tsx +34 -0
  179. package/registry/ui/table.tsx +118 -0
  180. package/registry/ui/tabs.tsx +84 -0
  181. package/registry/ui/textarea.tsx +22 -0
  182. package/registry/ui/toast.tsx +250 -0
  183. package/registry/ui/toggle-group.tsx +91 -0
  184. package/registry/ui/toggle.tsx +47 -0
  185. package/registry/ui/tooltip.tsx +68 -0
  186. package/registry/ui/tracker.tsx +843 -0
  187. package/registry/ui/trend-indicator.tsx +74 -0
  188. package/registry/ui/updated-at.tsx +122 -0
  189. package/registry/ui/waterfall-chart.tsx +4186 -0
  190. package/skills/vantage-add-feature/SKILL.md +9 -7
  191. package/skills/vantage-pitfalls/SKILL.md +5 -1
  192. package/templates/AGENTS.md +22 -1
  193. package/templates/agents/csv.md +2 -1
  194. package/templates/agents/doc.md +4 -3
  195. package/templates/agents/page.md +20 -6
  196. package/templates/agents/xlsx.md +2 -1
  197. package/theme.css +237 -136
  198. package/dist/add-DY4AXANK.js +0 -6
  199. package/dist/add-DY4AXANK.js.map +0 -1
  200. package/dist/chunk-5ZOP4SQR.js.map +0 -1
  201. package/dist/chunk-A2UUGASH.js.map +0 -1
  202. package/dist/chunk-DTDVSFRY.js.map +0 -1
  203. package/dist/chunk-LMUACBMA.js.map +0 -1
  204. package/dist/chunk-NKFBFDRZ.js +0 -2241
  205. package/dist/chunk-NKFBFDRZ.js.map +0 -1
  206. package/dist/chunk-PVTHHV7X.js.map +0 -1
  207. package/dist/chunk-PXRX5PEC.js.map +0 -1
  208. package/dist/chunk-QI3XQKHS.js.map +0 -1
  209. package/dist/chunk-RPZAALCX.js.map +0 -1
  210. package/dist/chunk-VA776YE5.js +0 -316
  211. package/dist/chunk-VA776YE5.js.map +0 -1
  212. package/dist/dev-GDKATCC7.js.map +0 -1
@@ -0,0 +1,128 @@
1
+ // Copied by `vantage add ui breadcrumb`. This file is yours to edit.
2
+ // Generated from @squadbase/squadkit registry/ui/breadcrumb.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
3
+ "use client"
4
+
5
+ import * as React from "react"
6
+ import { mergeProps } from "@base-ui/react/merge-props"
7
+ import { useRender } from "@base-ui/react/use-render"
8
+
9
+ import { cn } from "@squadbase/vantage/ui"
10
+ import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
11
+
12
+ function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
13
+ return (
14
+ <nav
15
+ aria-label="breadcrumb"
16
+ data-slot="breadcrumb"
17
+ className={cn(className)}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
24
+ return (
25
+ <ol
26
+ data-slot="breadcrumb-list"
27
+ className={cn(
28
+ "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
29
+ className
30
+ )}
31
+ {...props}
32
+ />
33
+ )
34
+ }
35
+
36
+ function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
37
+ return (
38
+ <li
39
+ data-slot="breadcrumb-item"
40
+ className={cn("inline-flex items-center gap-1", className)}
41
+ {...props}
42
+ />
43
+ )
44
+ }
45
+
46
+ function BreadcrumbLink({
47
+ className,
48
+ render,
49
+ ...props
50
+ }: useRender.ComponentProps<"a">) {
51
+ return useRender({
52
+ defaultTagName: "a",
53
+ props: mergeProps<"a">(
54
+ {
55
+ className: cn("transition-colors hover:text-foreground", className),
56
+ },
57
+ props
58
+ ),
59
+ render,
60
+ state: {
61
+ slot: "breadcrumb-link",
62
+ },
63
+ })
64
+ }
65
+
66
+ function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
67
+ return (
68
+ <span
69
+ data-slot="breadcrumb-page"
70
+ role="link"
71
+ aria-disabled="true"
72
+ aria-current="page"
73
+ className={cn("font-normal text-foreground", className)}
74
+ {...props}
75
+ />
76
+ )
77
+ }
78
+
79
+ function BreadcrumbSeparator({
80
+ children,
81
+ className,
82
+ ...props
83
+ }: React.ComponentProps<"li">) {
84
+ return (
85
+ <li
86
+ data-slot="breadcrumb-separator"
87
+ role="presentation"
88
+ aria-hidden="true"
89
+ className={cn("[&>svg]:size-3.5", className)}
90
+ {...props}
91
+ >
92
+ {children ?? (
93
+ <ChevronRightIcon className="cn-rtl-flip" />
94
+ )}
95
+ </li>
96
+ )
97
+ }
98
+
99
+ function BreadcrumbEllipsis({
100
+ className,
101
+ ...props
102
+ }: React.ComponentProps<"span">) {
103
+ return (
104
+ <span
105
+ data-slot="breadcrumb-ellipsis"
106
+ role="presentation"
107
+ aria-hidden="true"
108
+ className={cn(
109
+ "flex size-5 items-center justify-center [&>svg]:size-4",
110
+ className
111
+ )}
112
+ {...props}
113
+ >
114
+ <MoreHorizontalIcon />
115
+ <span className="sr-only">More</span>
116
+ </span>
117
+ )
118
+ }
119
+
120
+ export {
121
+ Breadcrumb,
122
+ BreadcrumbList,
123
+ BreadcrumbItem,
124
+ BreadcrumbLink,
125
+ BreadcrumbPage,
126
+ BreadcrumbSeparator,
127
+ BreadcrumbEllipsis,
128
+ }
@@ -0,0 +1,62 @@
1
+ // Copied by `vantage add ui button`. This file is yours to edit.
2
+ // Generated from @squadbase/squadkit registry/ui/button.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
3
+ "use client"
4
+
5
+ import { Button as ButtonPrimitive } from "@base-ui/react/button"
6
+ import { cva, type VariantProps } from "class-variance-authority"
7
+
8
+ import { cn } from "@squadbase/vantage/ui"
9
+
10
+ const buttonVariants = cva(
11
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
12
+ {
13
+ variants: {
14
+ variant: {
15
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
16
+ outline:
17
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
18
+ secondary:
19
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
20
+ ghost:
21
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
22
+ destructive:
23
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
24
+ link: "text-primary underline-offset-4 hover:underline",
25
+ },
26
+ size: {
27
+ default:
28
+ "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
29
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
30
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
31
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
32
+ icon: "size-8",
33
+ "icon-xs":
34
+ "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
35
+ "icon-sm":
36
+ "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
37
+ "icon-lg": "size-9",
38
+ },
39
+ },
40
+ defaultVariants: {
41
+ variant: "default",
42
+ size: "default",
43
+ },
44
+ }
45
+ )
46
+
47
+ function Button({
48
+ className,
49
+ variant = "default",
50
+ size = "default",
51
+ ...props
52
+ }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
53
+ return (
54
+ <ButtonPrimitive
55
+ data-slot="button"
56
+ className={cn(buttonVariants({ variant, size, className }))}
57
+ {...props}
58
+ />
59
+ )
60
+ }
61
+
62
+ export { Button, buttonVariants }
@@ -0,0 +1,223 @@
1
+ // Copied by `vantage add ui calendar`. This file is yours to edit.
2
+ // Generated from @squadbase/squadkit registry/ui/calendar.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
3
+ "use client"
4
+
5
+ import * as React from "react"
6
+ import {
7
+ DayPicker,
8
+ getDefaultClassNames,
9
+ type DayButton,
10
+ type Locale,
11
+ } from "react-day-picker"
12
+
13
+ import { cn } from "@squadbase/vantage/ui"
14
+ import { Button, buttonVariants } from "@squadbase/vantage/ui"
15
+ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
16
+
17
+ function Calendar({
18
+ className,
19
+ classNames,
20
+ showOutsideDays = true,
21
+ captionLayout = "label",
22
+ buttonVariant = "ghost",
23
+ locale,
24
+ formatters,
25
+ components,
26
+ ...props
27
+ }: React.ComponentProps<typeof DayPicker> & {
28
+ buttonVariant?: React.ComponentProps<typeof Button>["variant"]
29
+ }) {
30
+ const defaultClassNames = getDefaultClassNames()
31
+
32
+ return (
33
+ <DayPicker
34
+ showOutsideDays={showOutsideDays}
35
+ className={cn(
36
+ "group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
37
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
38
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
39
+ className
40
+ )}
41
+ captionLayout={captionLayout}
42
+ locale={locale}
43
+ formatters={{
44
+ formatMonthDropdown: (date) =>
45
+ date.toLocaleString(locale?.code, { month: "short" }),
46
+ ...formatters,
47
+ }}
48
+ classNames={{
49
+ root: cn("w-fit", defaultClassNames.root),
50
+ months: cn(
51
+ "relative flex flex-col gap-4 md:flex-row",
52
+ defaultClassNames.months
53
+ ),
54
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
55
+ nav: cn(
56
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
57
+ defaultClassNames.nav
58
+ ),
59
+ button_previous: cn(
60
+ buttonVariants({ variant: buttonVariant }),
61
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
62
+ defaultClassNames.button_previous
63
+ ),
64
+ button_next: cn(
65
+ buttonVariants({ variant: buttonVariant }),
66
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
67
+ defaultClassNames.button_next
68
+ ),
69
+ month_caption: cn(
70
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
71
+ defaultClassNames.month_caption
72
+ ),
73
+ dropdowns: cn(
74
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
75
+ defaultClassNames.dropdowns
76
+ ),
77
+ dropdown_root: cn(
78
+ "cn-calendar-dropdown-root relative rounded-(--cell-radius)",
79
+ defaultClassNames.dropdown_root
80
+ ),
81
+ dropdown: cn(
82
+ "absolute inset-0 bg-popover opacity-0",
83
+ defaultClassNames.dropdown
84
+ ),
85
+ caption_label: cn(
86
+ "font-medium select-none",
87
+ captionLayout === "label"
88
+ ? "cn-calendar-caption text-sm"
89
+ : "cn-calendar-caption-label flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
90
+ defaultClassNames.caption_label
91
+ ),
92
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
93
+ weekdays: cn("flex", defaultClassNames.weekdays),
94
+ weekday: cn(
95
+ "flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
96
+ defaultClassNames.weekday
97
+ ),
98
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
99
+ week_number_header: cn(
100
+ "w-(--cell-size) select-none",
101
+ defaultClassNames.week_number_header
102
+ ),
103
+ week_number: cn(
104
+ "text-[0.8rem] text-muted-foreground select-none",
105
+ defaultClassNames.week_number
106
+ ),
107
+ day: cn(
108
+ "group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
109
+ props.showWeekNumber
110
+ ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
111
+ : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
112
+ defaultClassNames.day
113
+ ),
114
+ range_start: cn(
115
+ "relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
116
+ defaultClassNames.range_start
117
+ ),
118
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
119
+ range_end: cn(
120
+ "relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
121
+ defaultClassNames.range_end
122
+ ),
123
+ today: cn(
124
+ "rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
125
+ defaultClassNames.today
126
+ ),
127
+ outside: cn(
128
+ "text-muted-foreground aria-selected:text-muted-foreground",
129
+ defaultClassNames.outside
130
+ ),
131
+ disabled: cn(
132
+ "text-muted-foreground opacity-50",
133
+ defaultClassNames.disabled
134
+ ),
135
+ hidden: cn("invisible", defaultClassNames.hidden),
136
+ ...classNames,
137
+ }}
138
+ components={{
139
+ Root: ({ className, rootRef, ...props }) => {
140
+ return (
141
+ <div
142
+ data-slot="calendar"
143
+ ref={rootRef}
144
+ className={cn(className)}
145
+ {...props}
146
+ />
147
+ )
148
+ },
149
+ Chevron: ({ className, orientation, ...props }) => {
150
+ if (orientation === "left") {
151
+ return (
152
+ <ChevronLeftIcon className={cn("cn-rtl-flip size-4", className)} {...props} />
153
+ )
154
+ }
155
+
156
+ if (orientation === "right") {
157
+ return (
158
+ <ChevronRightIcon className={cn("cn-rtl-flip size-4", className)} {...props} />
159
+ )
160
+ }
161
+
162
+ return (
163
+ <ChevronDownIcon className={cn("size-4", className)} {...props} />
164
+ )
165
+ },
166
+ DayButton: ({ ...props }) => (
167
+ <CalendarDayButton locale={locale} {...props} />
168
+ ),
169
+ WeekNumber: ({ children, ...props }) => {
170
+ return (
171
+ <td {...props}>
172
+ <div className="flex size-(--cell-size) items-center justify-center text-center">
173
+ {children}
174
+ </div>
175
+ </td>
176
+ )
177
+ },
178
+ ...components,
179
+ }}
180
+ {...props}
181
+ />
182
+ )
183
+ }
184
+
185
+ function CalendarDayButton({
186
+ className,
187
+ day,
188
+ modifiers,
189
+ locale,
190
+ ...props
191
+ }: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {
192
+ const defaultClassNames = getDefaultClassNames()
193
+
194
+ const ref = React.useRef<HTMLButtonElement>(null)
195
+ React.useEffect(() => {
196
+ if (modifiers.focused) ref.current?.focus()
197
+ }, [modifiers.focused])
198
+
199
+ return (
200
+ <Button
201
+ variant="ghost"
202
+ size="icon"
203
+ data-day={day.date.toLocaleDateString(locale?.code)}
204
+ data-selected-single={
205
+ modifiers.selected &&
206
+ !modifiers.range_start &&
207
+ !modifiers.range_end &&
208
+ !modifiers.range_middle
209
+ }
210
+ data-range-start={modifiers.range_start}
211
+ data-range-end={modifiers.range_end}
212
+ data-range-middle={modifiers.range_middle}
213
+ className={cn(
214
+ "relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70",
215
+ defaultClassNames.day,
216
+ className
217
+ )}
218
+ {...props}
219
+ />
220
+ )
221
+ }
222
+
223
+ export { Calendar, CalendarDayButton }
@@ -0,0 +1,107 @@
1
+ // Copied by `vantage add ui card`. This file is yours to edit.
2
+ // Generated from @squadbase/squadkit registry/ui/card.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
3
+ "use client"
4
+
5
+ import * as React from "react"
6
+
7
+ import { cn } from "@squadbase/vantage/ui"
8
+
9
+ function Card({
10
+ className,
11
+ size = "default",
12
+ ...props
13
+ }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
14
+ return (
15
+ <div
16
+ data-slot="card"
17
+ data-size={size}
18
+ className={cn(
19
+ "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl border bg-card shadow-[var(--shadow-card)] py-(--card-spacing) text-sm text-card-foreground [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
20
+ className
21
+ )}
22
+ {...props}
23
+ />
24
+ )
25
+ }
26
+
27
+ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
28
+ return (
29
+ <div
30
+ data-slot="card-header"
31
+ className={cn(
32
+ "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
33
+ className
34
+ )}
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
41
+ return (
42
+ <div
43
+ data-slot="card-title"
44
+ className={cn(
45
+ "cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
46
+ className
47
+ )}
48
+ {...props}
49
+ />
50
+ )
51
+ }
52
+
53
+ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
54
+ return (
55
+ <div
56
+ data-slot="card-description"
57
+ className={cn("text-sm text-muted-foreground", className)}
58
+ {...props}
59
+ />
60
+ )
61
+ }
62
+
63
+ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
64
+ return (
65
+ <div
66
+ data-slot="card-action"
67
+ className={cn(
68
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
69
+ className
70
+ )}
71
+ {...props}
72
+ />
73
+ )
74
+ }
75
+
76
+ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
77
+ return (
78
+ <div
79
+ data-slot="card-content"
80
+ className={cn("px-(--card-spacing)", className)}
81
+ {...props}
82
+ />
83
+ )
84
+ }
85
+
86
+ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
87
+ return (
88
+ <div
89
+ data-slot="card-footer"
90
+ className={cn(
91
+ "flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",
92
+ className
93
+ )}
94
+ {...props}
95
+ />
96
+ )
97
+ }
98
+
99
+ export {
100
+ Card,
101
+ CardHeader,
102
+ CardFooter,
103
+ CardTitle,
104
+ CardAction,
105
+ CardDescription,
106
+ CardContent,
107
+ }