create-ec-app 1.1.0 → 1.3.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 (80) hide show
  1. package/README.md +77 -0
  2. package/dist/index.js +304 -78
  3. package/dist/index.js.map +1 -1
  4. package/dist/pcf.d.ts.map +1 -1
  5. package/dist/pcf.js +82 -0
  6. package/dist/pcf.js.map +1 -1
  7. package/package.json +3 -1
  8. package/scripts/check-generated-css-scope.mjs +61 -0
  9. package/templates/base/package-lock.json +713 -1466
  10. package/templates/base/package.json +19 -19
  11. package/templates/base/src/App.tsx +1 -1
  12. package/templates/base/src/index.css +4 -1
  13. package/templates/base/src/main.tsx +4 -1
  14. package/templates/base/src/runtime/EcAppShell.tsx +29 -0
  15. package/templates/base/tsconfig.app.json +0 -1
  16. package/templates/base/tsconfig.json +1 -2
  17. package/templates/pcf/base/README.md +13 -0
  18. package/templates/pcf/base/index.ts +9 -3
  19. package/templates/pcf/base/package-lock.json +7290 -0
  20. package/templates/pcf/base/package.json +3 -3
  21. package/templates/targets/power-pages/src/App.patch.tsx +1 -1
  22. package/templates/targets/swa/package.patch.json +1 -1
  23. package/templates/ui/kendo/package.patch.json +2 -2
  24. package/templates/ui/kendo/src/main.patch.tsx +4 -1
  25. package/templates/ui/shadcn-ui/components.json +5 -2
  26. package/templates/ui/shadcn-ui/package.patch.json +3 -41
  27. package/templates/ui/shadcn-ui/src/index.patch.css +26 -9
  28. package/templates/ui/shadcn-ui/src/components/ui/accordion.tsx +0 -64
  29. package/templates/ui/shadcn-ui/src/components/ui/alert-dialog.tsx +0 -155
  30. package/templates/ui/shadcn-ui/src/components/ui/alert.tsx +0 -66
  31. package/templates/ui/shadcn-ui/src/components/ui/aspect-ratio.tsx +0 -11
  32. package/templates/ui/shadcn-ui/src/components/ui/avatar.tsx +0 -51
  33. package/templates/ui/shadcn-ui/src/components/ui/badge.tsx +0 -46
  34. package/templates/ui/shadcn-ui/src/components/ui/breadcrumb.tsx +0 -109
  35. package/templates/ui/shadcn-ui/src/components/ui/button-group.tsx +0 -83
  36. package/templates/ui/shadcn-ui/src/components/ui/button.tsx +0 -60
  37. package/templates/ui/shadcn-ui/src/components/ui/calendar.tsx +0 -216
  38. package/templates/ui/shadcn-ui/src/components/ui/card.tsx +0 -92
  39. package/templates/ui/shadcn-ui/src/components/ui/carousel.tsx +0 -239
  40. package/templates/ui/shadcn-ui/src/components/ui/chart.tsx +0 -357
  41. package/templates/ui/shadcn-ui/src/components/ui/checkbox.tsx +0 -32
  42. package/templates/ui/shadcn-ui/src/components/ui/collapsible.tsx +0 -31
  43. package/templates/ui/shadcn-ui/src/components/ui/command.tsx +0 -182
  44. package/templates/ui/shadcn-ui/src/components/ui/context-menu.tsx +0 -252
  45. package/templates/ui/shadcn-ui/src/components/ui/dialog.tsx +0 -141
  46. package/templates/ui/shadcn-ui/src/components/ui/drawer.tsx +0 -135
  47. package/templates/ui/shadcn-ui/src/components/ui/dropdown-menu.tsx +0 -255
  48. package/templates/ui/shadcn-ui/src/components/ui/empty.tsx +0 -104
  49. package/templates/ui/shadcn-ui/src/components/ui/field.tsx +0 -246
  50. package/templates/ui/shadcn-ui/src/components/ui/form.tsx +0 -167
  51. package/templates/ui/shadcn-ui/src/components/ui/hover-card.tsx +0 -44
  52. package/templates/ui/shadcn-ui/src/components/ui/input-group.tsx +0 -170
  53. package/templates/ui/shadcn-ui/src/components/ui/input-otp.tsx +0 -75
  54. package/templates/ui/shadcn-ui/src/components/ui/input.tsx +0 -21
  55. package/templates/ui/shadcn-ui/src/components/ui/item.tsx +0 -193
  56. package/templates/ui/shadcn-ui/src/components/ui/kbd.tsx +0 -28
  57. package/templates/ui/shadcn-ui/src/components/ui/label.tsx +0 -24
  58. package/templates/ui/shadcn-ui/src/components/ui/menubar.tsx +0 -274
  59. package/templates/ui/shadcn-ui/src/components/ui/navigation-menu.tsx +0 -168
  60. package/templates/ui/shadcn-ui/src/components/ui/pagination.tsx +0 -127
  61. package/templates/ui/shadcn-ui/src/components/ui/popover.tsx +0 -48
  62. package/templates/ui/shadcn-ui/src/components/ui/progress.tsx +0 -29
  63. package/templates/ui/shadcn-ui/src/components/ui/radio-group.tsx +0 -45
  64. package/templates/ui/shadcn-ui/src/components/ui/resizable.tsx +0 -54
  65. package/templates/ui/shadcn-ui/src/components/ui/scroll-area.tsx +0 -58
  66. package/templates/ui/shadcn-ui/src/components/ui/select.tsx +0 -185
  67. package/templates/ui/shadcn-ui/src/components/ui/separator.tsx +0 -28
  68. package/templates/ui/shadcn-ui/src/components/ui/sheet.tsx +0 -137
  69. package/templates/ui/shadcn-ui/src/components/ui/sidebar.tsx +0 -726
  70. package/templates/ui/shadcn-ui/src/components/ui/skeleton.tsx +0 -13
  71. package/templates/ui/shadcn-ui/src/components/ui/slider.tsx +0 -63
  72. package/templates/ui/shadcn-ui/src/components/ui/sonner.tsx +0 -38
  73. package/templates/ui/shadcn-ui/src/components/ui/spinner.tsx +0 -16
  74. package/templates/ui/shadcn-ui/src/components/ui/switch.tsx +0 -31
  75. package/templates/ui/shadcn-ui/src/components/ui/table.tsx +0 -114
  76. package/templates/ui/shadcn-ui/src/components/ui/tabs.tsx +0 -66
  77. package/templates/ui/shadcn-ui/src/components/ui/textarea.tsx +0 -18
  78. package/templates/ui/shadcn-ui/src/components/ui/toggle-group.tsx +0 -81
  79. package/templates/ui/shadcn-ui/src/components/ui/toggle.tsx +0 -45
  80. package/templates/ui/shadcn-ui/src/components/ui/tooltip.tsx +0 -61
@@ -12,9 +12,9 @@
12
12
  "push": "pcf-scripts push"
13
13
  },
14
14
  "devDependencies": {
15
- "@types/powerapps-component-framework": "^1.3.14",
16
- "pcf-start": "^1.48.2",
17
- "pcf-scripts": "^1.48.2",
15
+ "@types/powerapps-component-framework": "^1.3.18",
16
+ "pcf-start": "^1.51.1",
17
+ "pcf-scripts": "^1.51.1",
18
18
  "typescript": "^5.9.3"
19
19
  }
20
20
  }
@@ -4,7 +4,7 @@ function App() {
4
4
  const { isAuthenticated, user } = useAuth(); //INFO: User is where the token information is stored (user?.idToken)
5
5
 
6
6
  return (
7
- <div className="flex flex-col items-center justify-center h-screen gap-4">
7
+ <div className="ec:flex ec:flex-col ec:items-center ec:justify-center ec:h-screen ec:gap-4">
8
8
  {isAuthenticated ? (
9
9
  <div>You are logged in</div>
10
10
  ) : (
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@azure/static-web-apps-cli": "^2.0.7"
3
+ "@azure/static-web-apps-cli": "^2.0.9"
4
4
  }
5
5
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@progress/kendo-licensing": "^1.7.2",
4
- "@progress/kendo-react-buttons": "^13.1.0",
3
+ "@progress/kendo-licensing": "^1.11.2",
4
+ "@progress/kendo-react-buttons": "^13.3.0",
5
5
  "@progress/kendo-theme-fluent": "^12.3.0"
6
6
  }
7
7
  }
@@ -4,6 +4,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
4
  import "@progress/kendo-theme-fluent/dist/all.css";
5
5
  import "./index.css";
6
6
  import App from "./App.tsx";
7
+ import { EcAppShell } from "./runtime/EcAppShell.tsx";
7
8
 
8
9
  const queryClient = new QueryClient({
9
10
  defaultOptions: {
@@ -23,7 +24,9 @@ const root = createRoot(document.getElementById("root")!);
23
24
  root.render(
24
25
  <StrictMode>
25
26
  <QueryClientProvider client={queryClient}>
26
- <App />
27
+ <EcAppShell>
28
+ <App />
29
+ </EcAppShell>
27
30
  </QueryClientProvider>
28
31
  </StrictMode>
29
32
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "new-york",
3
+ "style": "radix-nova",
4
4
  "rsc": false,
5
5
  "tsx": true,
6
6
  "tailwind": {
@@ -8,9 +8,10 @@
8
8
  "css": "src/index.css",
9
9
  "baseColor": "neutral",
10
10
  "cssVariables": true,
11
- "prefix": ""
11
+ "prefix": "ec"
12
12
  },
13
13
  "iconLibrary": "lucide",
14
+ "rtl": false,
14
15
  "aliases": {
15
16
  "components": "@/components",
16
17
  "utils": "@/lib/utils",
@@ -18,5 +19,7 @@
18
19
  "lib": "@/lib",
19
20
  "hooks": "@/hooks"
20
21
  },
22
+ "menuColor": "default",
23
+ "menuAccent": "subtle",
21
24
  "registries": {}
22
25
  }
@@ -2,49 +2,11 @@
2
2
  "dependencies": {
3
3
  "class-variance-authority": "^0.7.1",
4
4
  "clsx": "^2.1.1",
5
- "lucide-react": "^0.555.0",
6
- "tailwind-merge": "^3.4.0",
7
- "@hookform/resolvers": "^5.2.2",
8
- "@radix-ui/react-accordion": "^1.2.12",
9
- "@radix-ui/react-alert-dialog": "^1.1.15",
10
- "@radix-ui/react-aspect-ratio": "^1.1.8",
11
- "@radix-ui/react-avatar": "^1.1.11",
12
- "@radix-ui/react-checkbox": "^1.3.3",
13
- "@radix-ui/react-collapsible": "^1.1.12",
14
- "@radix-ui/react-context-menu": "^2.2.16",
15
- "@radix-ui/react-dialog": "^1.1.15",
16
- "@radix-ui/react-dropdown-menu": "^2.1.16",
17
- "@radix-ui/react-hover-card": "^1.1.15",
18
- "@radix-ui/react-label": "^2.1.8",
19
- "@radix-ui/react-menubar": "^1.1.16",
20
- "@radix-ui/react-navigation-menu": "^1.2.14",
21
- "@radix-ui/react-popover": "^1.1.15",
22
- "@radix-ui/react-progress": "^1.1.8",
23
- "@radix-ui/react-radio-group": "^1.3.8",
24
- "@radix-ui/react-scroll-area": "^1.2.10",
25
- "@radix-ui/react-select": "^2.2.6",
26
- "@radix-ui/react-separator": "^1.1.8",
27
- "@radix-ui/react-slider": "^1.3.6",
28
- "@radix-ui/react-slot": "^1.2.4",
29
- "@radix-ui/react-switch": "^1.2.6",
30
- "@radix-ui/react-tabs": "^1.1.13",
31
- "@radix-ui/react-toggle": "^1.1.10",
32
- "@radix-ui/react-toggle-group": "^1.1.11",
33
- "@radix-ui/react-tooltip": "^1.2.8",
34
- "cmdk": "^1.1.1",
35
- "date-fns": "^4.1.0",
36
- "embla-carousel-react": "^8.6.0",
37
- "input-otp": "^1.4.2",
38
- "next-themes": "^0.4.6",
39
- "react-day-picker": "^9.11.3",
40
- "react-hook-form": "^7.67.0",
41
- "react-resizable-panels": "^3.0.6",
42
- "recharts": "^2.15.4",
43
- "sonner": "^2.0.7",
44
- "vaul": "^1.1.2"
5
+ "lucide-react": "^1.17.0",
6
+ "radix-ui": "^1.4.3",
7
+ "tailwind-merge": "^3.6.0"
45
8
  },
46
9
  "devDependencies": {
47
10
  "tw-animate-css": "^1.4.0"
48
11
  }
49
12
  }
50
-
@@ -1,8 +1,11 @@
1
- @import "tailwindcss";
2
- @import "tw-animate-css";
1
+ @layer theme, base, components, utilities;
2
+
3
+ @import "tailwindcss/theme.css" layer(theme) prefix(ec);
4
+ @import "tailwindcss/utilities.css" layer(utilities) prefix(ec);
5
+ @import "tw-animate-css/prefix";
3
6
 
4
7
  @custom-variant hover (&:hover);
5
- @custom-variant dark (&:is(.dark *));
8
+ @custom-variant dark (&:is(.ec-app.dark *, .ec-app .dark *));
6
9
 
7
10
  @theme inline {
8
11
  --radius-sm: calc(var(--radius) - 4px);
@@ -42,7 +45,7 @@
42
45
  --color-sidebar-ring: var(--sidebar-ring);
43
46
  }
44
47
 
45
- :root {
48
+ .ec-app[data-ec-app-id="{{APP_NAME}}"] {
46
49
  --radius: 0.625rem;
47
50
  --background: oklch(1 0 0);
48
51
  --foreground: oklch(0.145 0 0);
@@ -75,9 +78,13 @@
75
78
  --sidebar-accent-foreground: oklch(0.205 0 0);
76
79
  --sidebar-border: oklch(0.922 0 0);
77
80
  --sidebar-ring: oklch(0.708 0 0);
81
+
82
+ background: var(--background);
83
+ color: var(--foreground);
78
84
  }
79
85
 
80
- .dark {
86
+ .ec-app[data-ec-app-id="{{APP_NAME}}"].dark,
87
+ .ec-app[data-ec-app-id="{{APP_NAME}}"] .dark {
81
88
  --background: oklch(0.145 0 0);
82
89
  --foreground: oklch(0.985 0 0);
83
90
  --card: oklch(0.205 0 0);
@@ -112,10 +119,20 @@
112
119
  }
113
120
 
114
121
  @layer base {
115
- * {
116
- @apply border-border outline-ring/50;
122
+ :where(.ec-app, .ec-app *, .ec-app *::before, .ec-app *::after) {
123
+ box-sizing: border-box;
124
+ }
125
+
126
+ :where(.ec-app *) {
127
+ border-color: var(--border);
128
+ outline-color: color-mix(in oklab, var(--ring) 50%, transparent);
117
129
  }
118
- body {
119
- @apply bg-background text-foreground;
130
+
131
+ :where(.ec-app button, .ec-app input, .ec-app select, .ec-app textarea) {
132
+ font: inherit;
133
+ }
134
+
135
+ :where(.ec-app button:not(:disabled), .ec-app [role="button"]:not(:disabled)) {
136
+ cursor: pointer;
120
137
  }
121
138
  }
@@ -1,64 +0,0 @@
1
- import * as React from "react"
2
- import * as AccordionPrimitive from "@radix-ui/react-accordion"
3
- import { ChevronDownIcon } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- function Accordion({
8
- ...props
9
- }: React.ComponentProps<typeof AccordionPrimitive.Root>) {
10
- return <AccordionPrimitive.Root data-slot="accordion" {...props} />
11
- }
12
-
13
- function AccordionItem({
14
- className,
15
- ...props
16
- }: React.ComponentProps<typeof AccordionPrimitive.Item>) {
17
- return (
18
- <AccordionPrimitive.Item
19
- data-slot="accordion-item"
20
- className={cn("border-b last:border-b-0", className)}
21
- {...props}
22
- />
23
- )
24
- }
25
-
26
- function AccordionTrigger({
27
- className,
28
- children,
29
- ...props
30
- }: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
31
- return (
32
- <AccordionPrimitive.Header className="flex">
33
- <AccordionPrimitive.Trigger
34
- data-slot="accordion-trigger"
35
- className={cn(
36
- "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
37
- className
38
- )}
39
- {...props}
40
- >
41
- {children}
42
- <ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
43
- </AccordionPrimitive.Trigger>
44
- </AccordionPrimitive.Header>
45
- )
46
- }
47
-
48
- function AccordionContent({
49
- className,
50
- children,
51
- ...props
52
- }: React.ComponentProps<typeof AccordionPrimitive.Content>) {
53
- return (
54
- <AccordionPrimitive.Content
55
- data-slot="accordion-content"
56
- className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
57
- {...props}
58
- >
59
- <div className={cn("pt-0 pb-4", className)}>{children}</div>
60
- </AccordionPrimitive.Content>
61
- )
62
- }
63
-
64
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -1,155 +0,0 @@
1
- import * as React from "react"
2
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
3
-
4
- import { cn } from "@/lib/utils"
5
- import { buttonVariants } from "@/components/ui/button"
6
-
7
- function AlertDialog({
8
- ...props
9
- }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
10
- return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
11
- }
12
-
13
- function AlertDialogTrigger({
14
- ...props
15
- }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
16
- return (
17
- <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
18
- )
19
- }
20
-
21
- function AlertDialogPortal({
22
- ...props
23
- }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
24
- return (
25
- <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
26
- )
27
- }
28
-
29
- function AlertDialogOverlay({
30
- className,
31
- ...props
32
- }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
33
- return (
34
- <AlertDialogPrimitive.Overlay
35
- data-slot="alert-dialog-overlay"
36
- className={cn(
37
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
38
- className
39
- )}
40
- {...props}
41
- />
42
- )
43
- }
44
-
45
- function AlertDialogContent({
46
- className,
47
- ...props
48
- }: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
49
- return (
50
- <AlertDialogPortal>
51
- <AlertDialogOverlay />
52
- <AlertDialogPrimitive.Content
53
- data-slot="alert-dialog-content"
54
- className={cn(
55
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
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("flex flex-col gap-2 text-center sm:text-left", className)}
72
- {...props}
73
- />
74
- )
75
- }
76
-
77
- function AlertDialogFooter({
78
- className,
79
- ...props
80
- }: React.ComponentProps<"div">) {
81
- return (
82
- <div
83
- data-slot="alert-dialog-footer"
84
- className={cn(
85
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
86
- className
87
- )}
88
- {...props}
89
- />
90
- )
91
- }
92
-
93
- function AlertDialogTitle({
94
- className,
95
- ...props
96
- }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
97
- return (
98
- <AlertDialogPrimitive.Title
99
- data-slot="alert-dialog-title"
100
- className={cn("text-lg font-semibold", className)}
101
- {...props}
102
- />
103
- )
104
- }
105
-
106
- function AlertDialogDescription({
107
- className,
108
- ...props
109
- }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
110
- return (
111
- <AlertDialogPrimitive.Description
112
- data-slot="alert-dialog-description"
113
- className={cn("text-muted-foreground text-sm", className)}
114
- {...props}
115
- />
116
- )
117
- }
118
-
119
- function AlertDialogAction({
120
- className,
121
- ...props
122
- }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
123
- return (
124
- <AlertDialogPrimitive.Action
125
- className={cn(buttonVariants(), className)}
126
- {...props}
127
- />
128
- )
129
- }
130
-
131
- function AlertDialogCancel({
132
- className,
133
- ...props
134
- }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
135
- return (
136
- <AlertDialogPrimitive.Cancel
137
- className={cn(buttonVariants({ variant: "outline" }), className)}
138
- {...props}
139
- />
140
- )
141
- }
142
-
143
- export {
144
- AlertDialog,
145
- AlertDialogPortal,
146
- AlertDialogOverlay,
147
- AlertDialogTrigger,
148
- AlertDialogContent,
149
- AlertDialogHeader,
150
- AlertDialogFooter,
151
- AlertDialogTitle,
152
- AlertDialogDescription,
153
- AlertDialogAction,
154
- AlertDialogCancel,
155
- }
@@ -1,66 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const alertVariants = cva(
7
- "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-card text-card-foreground",
12
- destructive:
13
- "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
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
- "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
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-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
59
- className
60
- )}
61
- {...props}
62
- />
63
- )
64
- }
65
-
66
- export { Alert, AlertTitle, AlertDescription }
@@ -1,11 +0,0 @@
1
- "use client"
2
-
3
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
4
-
5
- function AspectRatio({
6
- ...props
7
- }: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
8
- return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
9
- }
10
-
11
- export { AspectRatio }
@@ -1,51 +0,0 @@
1
- import * as React from "react"
2
- import * as AvatarPrimitive from "@radix-ui/react-avatar"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- function Avatar({
7
- className,
8
- ...props
9
- }: React.ComponentProps<typeof AvatarPrimitive.Root>) {
10
- return (
11
- <AvatarPrimitive.Root
12
- data-slot="avatar"
13
- className={cn(
14
- "relative flex size-8 shrink-0 overflow-hidden rounded-full",
15
- className
16
- )}
17
- {...props}
18
- />
19
- )
20
- }
21
-
22
- function AvatarImage({
23
- className,
24
- ...props
25
- }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
26
- return (
27
- <AvatarPrimitive.Image
28
- data-slot="avatar-image"
29
- className={cn("aspect-square size-full", className)}
30
- {...props}
31
- />
32
- )
33
- }
34
-
35
- function AvatarFallback({
36
- className,
37
- ...props
38
- }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
39
- return (
40
- <AvatarPrimitive.Fallback
41
- data-slot="avatar-fallback"
42
- className={cn(
43
- "bg-muted flex size-full items-center justify-center rounded-full",
44
- className
45
- )}
46
- {...props}
47
- />
48
- )
49
- }
50
-
51
- export { Avatar, AvatarImage, AvatarFallback }
@@ -1,46 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const badgeVariants = cva(
8
- "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
14
- secondary:
15
- "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
16
- destructive:
17
- "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
18
- outline:
19
- "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
20
- },
21
- },
22
- defaultVariants: {
23
- variant: "default",
24
- },
25
- }
26
- )
27
-
28
- function Badge({
29
- className,
30
- variant,
31
- asChild = false,
32
- ...props
33
- }: React.ComponentProps<"span"> &
34
- VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35
- const Comp = asChild ? Slot : "span"
36
-
37
- return (
38
- <Comp
39
- data-slot="badge"
40
- className={cn(badgeVariants({ variant }), className)}
41
- {...props}
42
- />
43
- )
44
- }
45
-
46
- export { Badge, badgeVariants }