create-rykira-app 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 (143) hide show
  1. package/README.md +50 -0
  2. package/bin/cli.js +149 -0
  3. package/deployment.md +168 -0
  4. package/how-to-deploy-package.md +132 -0
  5. package/package.json +23 -0
  6. package/starter-usage.md +132 -0
  7. package/template/.dockerignore +11 -0
  8. package/template/.env.example +20 -0
  9. package/template/.eslintrc.js +13 -0
  10. package/template/.github/workflows/ci.yml +60 -0
  11. package/template/.prettierignore +7 -0
  12. package/template/.prettierrc +11 -0
  13. package/template/README.md +21 -0
  14. package/template/apps/admin/app/favicon.ico +0 -0
  15. package/template/apps/admin/app/layout.tsx +30 -0
  16. package/template/apps/admin/app/page.tsx +19 -0
  17. package/template/apps/admin/components/.gitkeep +0 -0
  18. package/template/apps/admin/components/theme-provider.tsx +71 -0
  19. package/template/apps/admin/components.json +23 -0
  20. package/template/apps/admin/eslint.config.js +4 -0
  21. package/template/apps/admin/hooks/.gitkeep +0 -0
  22. package/template/apps/admin/lib/.gitkeep +0 -0
  23. package/template/apps/admin/next-env.d.ts +6 -0
  24. package/template/apps/admin/next.config.mjs +6 -0
  25. package/template/apps/admin/nixpacks.toml +8 -0
  26. package/template/apps/admin/package.json +32 -0
  27. package/template/apps/admin/postcss.config.mjs +1 -0
  28. package/template/apps/admin/tsconfig.json +23 -0
  29. package/template/apps/api/nixpacks.toml +8 -0
  30. package/template/apps/api/package.json +32 -0
  31. package/template/apps/api/src/index.ts +11 -0
  32. package/template/apps/api/src/server.ts +21 -0
  33. package/template/apps/api/tsconfig.json +18 -0
  34. package/template/apps/web/app/favicon.ico +0 -0
  35. package/template/apps/web/app/layout.tsx +30 -0
  36. package/template/apps/web/app/page.tsx +19 -0
  37. package/template/apps/web/components/.gitkeep +0 -0
  38. package/template/apps/web/components/theme-provider.tsx +71 -0
  39. package/template/apps/web/components.json +23 -0
  40. package/template/apps/web/eslint.config.js +4 -0
  41. package/template/apps/web/hooks/.gitkeep +0 -0
  42. package/template/apps/web/lib/.gitkeep +0 -0
  43. package/template/apps/web/next-env.d.ts +6 -0
  44. package/template/apps/web/next.config.mjs +6 -0
  45. package/template/apps/web/nixpacks.toml +8 -0
  46. package/template/apps/web/package.json +32 -0
  47. package/template/apps/web/postcss.config.mjs +1 -0
  48. package/template/apps/web/tsconfig.json +23 -0
  49. package/template/infrastructure/docker/Dockerfile.admin +36 -0
  50. package/template/infrastructure/docker/Dockerfile.api +36 -0
  51. package/template/infrastructure/docker/Dockerfile.web +48 -0
  52. package/template/infrastructure/docker/compose.dev.yml +50 -0
  53. package/template/infrastructure/docker/compose.prod.yml +119 -0
  54. package/template/infrastructure/scripts/deploy.sh +3 -0
  55. package/template/infrastructure/scripts/dev.sh +5 -0
  56. package/template/infrastructure/scripts/init-traefik.sh +10 -0
  57. package/template/infrastructure/scripts/setup-server.sh +25 -0
  58. package/template/infrastructure/scripts/update.sh +7 -0
  59. package/template/infrastructure/traefik/acme.json +0 -0
  60. package/template/infrastructure/traefik/dynamic.yml +23 -0
  61. package/template/infrastructure/traefik/traefik.yml +26 -0
  62. package/template/package.json +25 -0
  63. package/template/packages/eslint-config/README.md +3 -0
  64. package/template/packages/eslint-config/base.js +32 -0
  65. package/template/packages/eslint-config/next.js +51 -0
  66. package/template/packages/eslint-config/package.json +26 -0
  67. package/template/packages/eslint-config/react-internal.js +41 -0
  68. package/template/packages/typescript-config/README.md +3 -0
  69. package/template/packages/typescript-config/base.json +20 -0
  70. package/template/packages/typescript-config/nextjs.json +13 -0
  71. package/template/packages/typescript-config/package.json +9 -0
  72. package/template/packages/typescript-config/react-library.json +8 -0
  73. package/template/packages/ui/components.json +23 -0
  74. package/template/packages/ui/eslint.config.js +4 -0
  75. package/template/packages/ui/package.json +52 -0
  76. package/template/packages/ui/postcss.config.mjs +6 -0
  77. package/template/packages/ui/src/components/.gitkeep +0 -0
  78. package/template/packages/ui/src/components/accordion.tsx +74 -0
  79. package/template/packages/ui/src/components/alert-dialog.tsx +187 -0
  80. package/template/packages/ui/src/components/alert.tsx +76 -0
  81. package/template/packages/ui/src/components/aspect-ratio.tsx +22 -0
  82. package/template/packages/ui/src/components/avatar.tsx +109 -0
  83. package/template/packages/ui/src/components/badge.tsx +52 -0
  84. package/template/packages/ui/src/components/breadcrumb.tsx +125 -0
  85. package/template/packages/ui/src/components/button-group.tsx +87 -0
  86. package/template/packages/ui/src/components/button.tsx +60 -0
  87. package/template/packages/ui/src/components/calendar.tsx +221 -0
  88. package/template/packages/ui/src/components/card.tsx +103 -0
  89. package/template/packages/ui/src/components/carousel.tsx +242 -0
  90. package/template/packages/ui/src/components/chart.tsx +356 -0
  91. package/template/packages/ui/src/components/checkbox.tsx +29 -0
  92. package/template/packages/ui/src/components/collapsible.tsx +21 -0
  93. package/template/packages/ui/src/components/combobox.tsx +297 -0
  94. package/template/packages/ui/src/components/command.tsx +196 -0
  95. package/template/packages/ui/src/components/context-menu.tsx +271 -0
  96. package/template/packages/ui/src/components/dialog.tsx +157 -0
  97. package/template/packages/ui/src/components/direction.tsx +6 -0
  98. package/template/packages/ui/src/components/drawer.tsx +131 -0
  99. package/template/packages/ui/src/components/dropdown-menu.tsx +268 -0
  100. package/template/packages/ui/src/components/empty.tsx +101 -0
  101. package/template/packages/ui/src/components/field.tsx +238 -0
  102. package/template/packages/ui/src/components/hover-card.tsx +51 -0
  103. package/template/packages/ui/src/components/input-group.tsx +158 -0
  104. package/template/packages/ui/src/components/input-otp.tsx +87 -0
  105. package/template/packages/ui/src/components/input.tsx +20 -0
  106. package/template/packages/ui/src/components/item.tsx +201 -0
  107. package/template/packages/ui/src/components/kbd.tsx +26 -0
  108. package/template/packages/ui/src/components/label.tsx +20 -0
  109. package/template/packages/ui/src/components/menubar.tsx +280 -0
  110. package/template/packages/ui/src/components/native-select.tsx +52 -0
  111. package/template/packages/ui/src/components/navigation-menu.tsx +168 -0
  112. package/template/packages/ui/src/components/pagination.tsx +130 -0
  113. package/template/packages/ui/src/components/popover.tsx +90 -0
  114. package/template/packages/ui/src/components/progress.tsx +83 -0
  115. package/template/packages/ui/src/components/radio-group.tsx +38 -0
  116. package/template/packages/ui/src/components/resizable.tsx +50 -0
  117. package/template/packages/ui/src/components/scroll-area.tsx +55 -0
  118. package/template/packages/ui/src/components/select.tsx +201 -0
  119. package/template/packages/ui/src/components/separator.tsx +25 -0
  120. package/template/packages/ui/src/components/sheet.tsx +135 -0
  121. package/template/packages/ui/src/components/sidebar.tsx +723 -0
  122. package/template/packages/ui/src/components/skeleton.tsx +13 -0
  123. package/template/packages/ui/src/components/slider.tsx +59 -0
  124. package/template/packages/ui/src/components/sonner.tsx +49 -0
  125. package/template/packages/ui/src/components/spinner.tsx +10 -0
  126. package/template/packages/ui/src/components/switch.tsx +32 -0
  127. package/template/packages/ui/src/components/table.tsx +116 -0
  128. package/template/packages/ui/src/components/tabs.tsx +82 -0
  129. package/template/packages/ui/src/components/textarea.tsx +18 -0
  130. package/template/packages/ui/src/components/toggle-group.tsx +89 -0
  131. package/template/packages/ui/src/components/toggle.tsx +44 -0
  132. package/template/packages/ui/src/components/tooltip.tsx +66 -0
  133. package/template/packages/ui/src/hooks/.gitkeep +0 -0
  134. package/template/packages/ui/src/hooks/use-mobile.ts +19 -0
  135. package/template/packages/ui/src/lib/.gitkeep +0 -0
  136. package/template/packages/ui/src/lib/utils.ts +6 -0
  137. package/template/packages/ui/src/styles/globals.css +128 -0
  138. package/template/packages/ui/tsconfig.json +11 -0
  139. package/template/packages/ui/tsconfig.lint.json +8 -0
  140. package/template/pnpm-lock.yaml +9103 -0
  141. package/template/pnpm-workspace.yaml +3 -0
  142. package/template/tsconfig.json +4 -0
  143. package/template/turbo.json +24 -0
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "base-vega",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "src/styles/globals.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true
11
+ },
12
+ "iconLibrary": "lucide",
13
+ "aliases": {
14
+ "components": "@workspace/ui/components",
15
+ "utils": "@workspace/ui/lib/utils",
16
+ "hooks": "@workspace/ui/hooks",
17
+ "lib": "@workspace/ui/lib",
18
+ "ui": "@workspace/ui/components"
19
+ },
20
+ "rtl": false,
21
+ "menuColor": "default",
22
+ "menuAccent": "subtle"
23
+ }
@@ -0,0 +1,4 @@
1
+ import { config } from "@workspace/eslint-config/react-internal"
2
+
3
+ /** @type {import("eslint").Linter.Config} */
4
+ export default config
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@workspace/ui",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "scripts": {
7
+ "lint": "eslint",
8
+ "format": "prettier --write \"**/*.{ts,tsx}\"",
9
+ "typecheck": "tsc --noEmit"
10
+ },
11
+ "dependencies": {
12
+ "@base-ui/react": "^1.3.0",
13
+ "class-variance-authority": "^0.7.1",
14
+ "clsx": "^2.1.1",
15
+ "cmdk": "^1.1.1",
16
+ "date-fns": "^4.1.0",
17
+ "embla-carousel-react": "^8.6.0",
18
+ "input-otp": "^1.4.2",
19
+ "lucide-react": "^0.577.0",
20
+ "next-themes": "^0.4.6",
21
+ "react": "^19.2.4",
22
+ "react-day-picker": "^9.14.0",
23
+ "react-dom": "^19.2.4",
24
+ "react-resizable-panels": "^4.7.2",
25
+ "recharts": "2.15.4",
26
+ "shadcn": "^4.0.6",
27
+ "sonner": "^2.0.7",
28
+ "tailwind-merge": "^3.5.0",
29
+ "tw-animate-css": "^1.4.0",
30
+ "vaul": "^1.1.2",
31
+ "zod": "^3.25.76"
32
+ },
33
+ "devDependencies": {
34
+ "@tailwindcss/postcss": "^4.1.18",
35
+ "@turbo/gen": "^2.8.1",
36
+ "@types/node": "^25.1.0",
37
+ "@types/react": "^19.2.10",
38
+ "@types/react-dom": "^19.2.3",
39
+ "@workspace/eslint-config": "workspace:*",
40
+ "@workspace/typescript-config": "workspace:*",
41
+ "eslint": "^9.39.2",
42
+ "tailwindcss": "^4.1.18",
43
+ "typescript": "^5.9.3"
44
+ },
45
+ "exports": {
46
+ "./globals.css": "./src/styles/globals.css",
47
+ "./postcss.config": "./postcss.config.mjs",
48
+ "./lib/*": "./src/lib/*.ts",
49
+ "./components/*": "./src/components/*.tsx",
50
+ "./hooks/*": "./src/hooks/*.ts"
51
+ }
52
+ }
@@ -0,0 +1,6 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: { "@tailwindcss/postcss": {} },
4
+ };
5
+
6
+ export default config;
File without changes
@@ -0,0 +1,74 @@
1
+ "use client"
2
+
3
+ import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
4
+
5
+ import { cn } from "@workspace/ui/lib/utils"
6
+ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"
7
+
8
+ function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
9
+ return (
10
+ <AccordionPrimitive.Root
11
+ data-slot="accordion"
12
+ className={cn("flex w-full flex-col", className)}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+
18
+ function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
19
+ return (
20
+ <AccordionPrimitive.Item
21
+ data-slot="accordion-item"
22
+ className={cn("not-last:border-b", className)}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ function AccordionTrigger({
29
+ className,
30
+ children,
31
+ ...props
32
+ }: AccordionPrimitive.Trigger.Props) {
33
+ return (
34
+ <AccordionPrimitive.Header className="flex">
35
+ <AccordionPrimitive.Trigger
36
+ data-slot="accordion-trigger"
37
+ className={cn(
38
+ "group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
39
+ className
40
+ )}
41
+ {...props}
42
+ >
43
+ {children}
44
+ <ChevronDownIcon data-slot="accordion-trigger-icon" className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" />
45
+ <ChevronUpIcon data-slot="accordion-trigger-icon" className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" />
46
+ </AccordionPrimitive.Trigger>
47
+ </AccordionPrimitive.Header>
48
+ )
49
+ }
50
+
51
+ function AccordionContent({
52
+ className,
53
+ children,
54
+ ...props
55
+ }: AccordionPrimitive.Panel.Props) {
56
+ return (
57
+ <AccordionPrimitive.Panel
58
+ data-slot="accordion-content"
59
+ className="overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up"
60
+ {...props}
61
+ >
62
+ <div
63
+ className={cn(
64
+ "h-(--accordion-panel-height) pt-0 pb-4 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
65
+ className
66
+ )}
67
+ >
68
+ {children}
69
+ </div>
70
+ </AccordionPrimitive.Panel>
71
+ )
72
+ }
73
+
74
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -0,0 +1,187 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"
5
+
6
+ import { cn } from "@workspace/ui/lib/utils"
7
+ import { Button } from "@workspace/ui/components/button"
8
+
9
+ function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
10
+ return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
11
+ }
12
+
13
+ function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
14
+ return (
15
+ <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
16
+ )
17
+ }
18
+
19
+ function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
20
+ return (
21
+ <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
22
+ )
23
+ }
24
+
25
+ function AlertDialogOverlay({
26
+ className,
27
+ ...props
28
+ }: AlertDialogPrimitive.Backdrop.Props) {
29
+ return (
30
+ <AlertDialogPrimitive.Backdrop
31
+ data-slot="alert-dialog-overlay"
32
+ className={cn(
33
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
38
+ )
39
+ }
40
+
41
+ function AlertDialogContent({
42
+ className,
43
+ size = "default",
44
+ ...props
45
+ }: AlertDialogPrimitive.Popup.Props & {
46
+ size?: "default" | "sm"
47
+ }) {
48
+ return (
49
+ <AlertDialogPortal>
50
+ <AlertDialogOverlay />
51
+ <AlertDialogPrimitive.Popup
52
+ data-slot="alert-dialog-content"
53
+ data-size={size}
54
+ className={cn(
55
+ "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-background p-6 ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
56
+ className
57
+ )}
58
+ {...props}
59
+ />
60
+ </AlertDialogPortal>
61
+ )
62
+ }
63
+
64
+ function AlertDialogHeader({
65
+ className,
66
+ ...props
67
+ }: React.ComponentProps<"div">) {
68
+ return (
69
+ <div
70
+ data-slot="alert-dialog-header"
71
+ className={cn(
72
+ "grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
73
+ className
74
+ )}
75
+ {...props}
76
+ />
77
+ )
78
+ }
79
+
80
+ function AlertDialogFooter({
81
+ className,
82
+ ...props
83
+ }: React.ComponentProps<"div">) {
84
+ return (
85
+ <div
86
+ data-slot="alert-dialog-footer"
87
+ className={cn(
88
+ "flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
89
+ className
90
+ )}
91
+ {...props}
92
+ />
93
+ )
94
+ }
95
+
96
+ function AlertDialogMedia({
97
+ className,
98
+ ...props
99
+ }: React.ComponentProps<"div">) {
100
+ return (
101
+ <div
102
+ data-slot="alert-dialog-media"
103
+ className={cn(
104
+ "mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
105
+ className
106
+ )}
107
+ {...props}
108
+ />
109
+ )
110
+ }
111
+
112
+ function AlertDialogTitle({
113
+ className,
114
+ ...props
115
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
116
+ return (
117
+ <AlertDialogPrimitive.Title
118
+ data-slot="alert-dialog-title"
119
+ className={cn(
120
+ "text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
121
+ className
122
+ )}
123
+ {...props}
124
+ />
125
+ )
126
+ }
127
+
128
+ function AlertDialogDescription({
129
+ className,
130
+ ...props
131
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
132
+ return (
133
+ <AlertDialogPrimitive.Description
134
+ data-slot="alert-dialog-description"
135
+ className={cn(
136
+ "text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
137
+ className
138
+ )}
139
+ {...props}
140
+ />
141
+ )
142
+ }
143
+
144
+ function AlertDialogAction({
145
+ className,
146
+ ...props
147
+ }: React.ComponentProps<typeof Button>) {
148
+ return (
149
+ <Button
150
+ data-slot="alert-dialog-action"
151
+ className={cn(className)}
152
+ {...props}
153
+ />
154
+ )
155
+ }
156
+
157
+ function AlertDialogCancel({
158
+ className,
159
+ variant = "outline",
160
+ size = "default",
161
+ ...props
162
+ }: AlertDialogPrimitive.Close.Props &
163
+ Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
164
+ return (
165
+ <AlertDialogPrimitive.Close
166
+ data-slot="alert-dialog-cancel"
167
+ className={cn(className)}
168
+ render={<Button variant={variant} size={size} />}
169
+ {...props}
170
+ />
171
+ )
172
+ }
173
+
174
+ export {
175
+ AlertDialog,
176
+ AlertDialogAction,
177
+ AlertDialogCancel,
178
+ AlertDialogContent,
179
+ AlertDialogDescription,
180
+ AlertDialogFooter,
181
+ AlertDialogHeader,
182
+ AlertDialogMedia,
183
+ AlertDialogOverlay,
184
+ AlertDialogPortal,
185
+ AlertDialogTitle,
186
+ AlertDialogTrigger,
187
+ }
@@ -0,0 +1,76 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+
4
+ import { cn } from "@workspace/ui/lib/utils"
5
+
6
+ const alertVariants = cva(
7
+ "group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-card text-card-foreground",
12
+ destructive:
13
+ "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: "default",
18
+ },
19
+ }
20
+ )
21
+
22
+ function Alert({
23
+ className,
24
+ variant,
25
+ ...props
26
+ }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
27
+ return (
28
+ <div
29
+ data-slot="alert"
30
+ role="alert"
31
+ className={cn(alertVariants({ variant }), className)}
32
+ {...props}
33
+ />
34
+ )
35
+ }
36
+
37
+ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
38
+ return (
39
+ <div
40
+ data-slot="alert-title"
41
+ className={cn(
42
+ "font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
43
+ className
44
+ )}
45
+ {...props}
46
+ />
47
+ )
48
+ }
49
+
50
+ function AlertDescription({
51
+ className,
52
+ ...props
53
+ }: React.ComponentProps<"div">) {
54
+ return (
55
+ <div
56
+ data-slot="alert-description"
57
+ className={cn(
58
+ "text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
59
+ className
60
+ )}
61
+ {...props}
62
+ />
63
+ )
64
+ }
65
+
66
+ function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
67
+ return (
68
+ <div
69
+ data-slot="alert-action"
70
+ className={cn("absolute top-2.5 right-3", className)}
71
+ {...props}
72
+ />
73
+ )
74
+ }
75
+
76
+ export { Alert, AlertTitle, AlertDescription, AlertAction }
@@ -0,0 +1,22 @@
1
+ import { cn } from "@workspace/ui/lib/utils"
2
+
3
+ function AspectRatio({
4
+ ratio,
5
+ className,
6
+ ...props
7
+ }: React.ComponentProps<"div"> & { ratio: number }) {
8
+ return (
9
+ <div
10
+ data-slot="aspect-ratio"
11
+ style={
12
+ {
13
+ "--ratio": ratio,
14
+ } as React.CSSProperties
15
+ }
16
+ className={cn("relative aspect-(--ratio)", className)}
17
+ {...props}
18
+ />
19
+ )
20
+ }
21
+
22
+ export { AspectRatio }
@@ -0,0 +1,109 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar"
5
+
6
+ import { cn } from "@workspace/ui/lib/utils"
7
+
8
+ function Avatar({
9
+ className,
10
+ size = "default",
11
+ ...props
12
+ }: AvatarPrimitive.Root.Props & {
13
+ size?: "default" | "sm" | "lg"
14
+ }) {
15
+ return (
16
+ <AvatarPrimitive.Root
17
+ data-slot="avatar"
18
+ data-size={size}
19
+ className={cn(
20
+ "group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
29
+ return (
30
+ <AvatarPrimitive.Image
31
+ data-slot="avatar-image"
32
+ className={cn(
33
+ "aspect-square size-full rounded-full object-cover",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
38
+ )
39
+ }
40
+
41
+ function AvatarFallback({
42
+ className,
43
+ ...props
44
+ }: AvatarPrimitive.Fallback.Props) {
45
+ return (
46
+ <AvatarPrimitive.Fallback
47
+ data-slot="avatar-fallback"
48
+ className={cn(
49
+ "flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
50
+ className
51
+ )}
52
+ {...props}
53
+ />
54
+ )
55
+ }
56
+
57
+ function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
58
+ return (
59
+ <span
60
+ data-slot="avatar-badge"
61
+ className={cn(
62
+ "absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
63
+ "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
64
+ "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
65
+ "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
66
+ className
67
+ )}
68
+ {...props}
69
+ />
70
+ )
71
+ }
72
+
73
+ function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
74
+ return (
75
+ <div
76
+ data-slot="avatar-group"
77
+ className={cn(
78
+ "group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
79
+ className
80
+ )}
81
+ {...props}
82
+ />
83
+ )
84
+ }
85
+
86
+ function AvatarGroupCount({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<"div">) {
90
+ return (
91
+ <div
92
+ data-slot="avatar-group-count"
93
+ className={cn(
94
+ "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
95
+ className
96
+ )}
97
+ {...props}
98
+ />
99
+ )
100
+ }
101
+
102
+ export {
103
+ Avatar,
104
+ AvatarImage,
105
+ AvatarFallback,
106
+ AvatarGroup,
107
+ AvatarGroupCount,
108
+ AvatarBadge,
109
+ }
@@ -0,0 +1,52 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props"
2
+ import { useRender } from "@base-ui/react/use-render"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+
5
+ import { cn } from "@workspace/ui/lib/utils"
6
+
7
+ const badgeVariants = cva(
8
+ "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
13
+ secondary:
14
+ "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
15
+ destructive:
16
+ "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
17
+ outline:
18
+ "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
19
+ ghost:
20
+ "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
21
+ link: "text-primary underline-offset-4 hover:underline",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ },
27
+ }
28
+ )
29
+
30
+ function Badge({
31
+ className,
32
+ variant = "default",
33
+ render,
34
+ ...props
35
+ }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
36
+ return useRender({
37
+ defaultTagName: "span",
38
+ props: mergeProps<"span">(
39
+ {
40
+ className: cn(badgeVariants({ variant }), className),
41
+ },
42
+ props
43
+ ),
44
+ render,
45
+ state: {
46
+ slot: "badge",
47
+ variant,
48
+ },
49
+ })
50
+ }
51
+
52
+ export { Badge, badgeVariants }