create-ec-app 1.2.0 → 1.4.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 (81) hide show
  1. package/README.md +87 -0
  2. package/dist/index.js +115 -2
  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/targets/webresource/README.md +7 -6
  24. package/templates/ui/kendo/package.patch.json +2 -2
  25. package/templates/ui/kendo/src/main.patch.tsx +4 -1
  26. package/templates/ui/shadcn-ui/components.json +5 -2
  27. package/templates/ui/shadcn-ui/package.patch.json +4 -41
  28. package/templates/ui/shadcn-ui/src/index.patch.css +27 -9
  29. package/templates/ui/shadcn-ui/src/components/ui/accordion.tsx +0 -64
  30. package/templates/ui/shadcn-ui/src/components/ui/alert-dialog.tsx +0 -155
  31. package/templates/ui/shadcn-ui/src/components/ui/alert.tsx +0 -66
  32. package/templates/ui/shadcn-ui/src/components/ui/aspect-ratio.tsx +0 -11
  33. package/templates/ui/shadcn-ui/src/components/ui/avatar.tsx +0 -51
  34. package/templates/ui/shadcn-ui/src/components/ui/badge.tsx +0 -46
  35. package/templates/ui/shadcn-ui/src/components/ui/breadcrumb.tsx +0 -109
  36. package/templates/ui/shadcn-ui/src/components/ui/button-group.tsx +0 -83
  37. package/templates/ui/shadcn-ui/src/components/ui/button.tsx +0 -60
  38. package/templates/ui/shadcn-ui/src/components/ui/calendar.tsx +0 -216
  39. package/templates/ui/shadcn-ui/src/components/ui/card.tsx +0 -92
  40. package/templates/ui/shadcn-ui/src/components/ui/carousel.tsx +0 -239
  41. package/templates/ui/shadcn-ui/src/components/ui/chart.tsx +0 -357
  42. package/templates/ui/shadcn-ui/src/components/ui/checkbox.tsx +0 -32
  43. package/templates/ui/shadcn-ui/src/components/ui/collapsible.tsx +0 -31
  44. package/templates/ui/shadcn-ui/src/components/ui/command.tsx +0 -182
  45. package/templates/ui/shadcn-ui/src/components/ui/context-menu.tsx +0 -252
  46. package/templates/ui/shadcn-ui/src/components/ui/dialog.tsx +0 -141
  47. package/templates/ui/shadcn-ui/src/components/ui/drawer.tsx +0 -135
  48. package/templates/ui/shadcn-ui/src/components/ui/dropdown-menu.tsx +0 -255
  49. package/templates/ui/shadcn-ui/src/components/ui/empty.tsx +0 -104
  50. package/templates/ui/shadcn-ui/src/components/ui/field.tsx +0 -246
  51. package/templates/ui/shadcn-ui/src/components/ui/form.tsx +0 -167
  52. package/templates/ui/shadcn-ui/src/components/ui/hover-card.tsx +0 -44
  53. package/templates/ui/shadcn-ui/src/components/ui/input-group.tsx +0 -170
  54. package/templates/ui/shadcn-ui/src/components/ui/input-otp.tsx +0 -75
  55. package/templates/ui/shadcn-ui/src/components/ui/input.tsx +0 -21
  56. package/templates/ui/shadcn-ui/src/components/ui/item.tsx +0 -193
  57. package/templates/ui/shadcn-ui/src/components/ui/kbd.tsx +0 -28
  58. package/templates/ui/shadcn-ui/src/components/ui/label.tsx +0 -24
  59. package/templates/ui/shadcn-ui/src/components/ui/menubar.tsx +0 -274
  60. package/templates/ui/shadcn-ui/src/components/ui/navigation-menu.tsx +0 -168
  61. package/templates/ui/shadcn-ui/src/components/ui/pagination.tsx +0 -127
  62. package/templates/ui/shadcn-ui/src/components/ui/popover.tsx +0 -48
  63. package/templates/ui/shadcn-ui/src/components/ui/progress.tsx +0 -29
  64. package/templates/ui/shadcn-ui/src/components/ui/radio-group.tsx +0 -45
  65. package/templates/ui/shadcn-ui/src/components/ui/resizable.tsx +0 -54
  66. package/templates/ui/shadcn-ui/src/components/ui/scroll-area.tsx +0 -58
  67. package/templates/ui/shadcn-ui/src/components/ui/select.tsx +0 -185
  68. package/templates/ui/shadcn-ui/src/components/ui/separator.tsx +0 -28
  69. package/templates/ui/shadcn-ui/src/components/ui/sheet.tsx +0 -137
  70. package/templates/ui/shadcn-ui/src/components/ui/sidebar.tsx +0 -726
  71. package/templates/ui/shadcn-ui/src/components/ui/skeleton.tsx +0 -13
  72. package/templates/ui/shadcn-ui/src/components/ui/slider.tsx +0 -63
  73. package/templates/ui/shadcn-ui/src/components/ui/sonner.tsx +0 -38
  74. package/templates/ui/shadcn-ui/src/components/ui/spinner.tsx +0 -16
  75. package/templates/ui/shadcn-ui/src/components/ui/switch.tsx +0 -31
  76. package/templates/ui/shadcn-ui/src/components/ui/table.tsx +0 -114
  77. package/templates/ui/shadcn-ui/src/components/ui/tabs.tsx +0 -66
  78. package/templates/ui/shadcn-ui/src/components/ui/textarea.tsx +0 -18
  79. package/templates/ui/shadcn-ui/src/components/ui/toggle-group.tsx +0 -81
  80. package/templates/ui/shadcn-ui/src/components/ui/toggle.tsx +0 -45
  81. 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
  }
@@ -270,19 +270,20 @@ Basic flow:
270
270
  npm run build
271
271
  ```
272
272
 
273
- 2. Run the generator against the current project directory:
273
+ 2. Run the generator and point `--pcf-dir` at the generated PCF project directory:
274
274
 
275
275
  ```bash
276
- npx create-ec-app --pcf-dir . --namespace EC --constructor FusionNotebookHost
276
+ npx create-ec-app@latest --pcf-dir ./pcf/{{ControlName}} namespace {{EC}} --constructor {{ControlName}} --display-name "Control Name"
277
277
  ```
278
278
 
279
- If you are not inside the webresource folder, point `--pcf-dir` at that folder explicitly:
279
+ 3. Install dependencies inside that generated PCF directory:
280
280
 
281
281
  ```bash
282
- npx create-ec-app --pcf-dir /path/to/my-webresource --namespace EC --constructor FusionNotebookHost
282
+ cd ./pcf/{{ControlName}}
283
+ npm install
283
284
  ```
284
285
 
285
- This writes a standalone PCF project to `pcf/FusionNotebookHost` by default. The generated control:
286
+ This writes a standalone PCF project to the `--pcf-dir` folder. The generated control:
286
287
 
287
288
  - imports `src/App.tsx` directly instead of wrapping built HTML in an iframe
288
289
  - reuses the built stylesheet from `dist/main.css`
@@ -295,7 +296,7 @@ Typical conversion flow from inside a generated webresource project:
295
296
  ```bash
296
297
  npm install
297
298
  npm run build
298
- npx create-ec-app --pcf-dir . --namespace EC --constructor FusionNotebookHost --display-name "Fusion Notebook Host"
299
+ npx create-ec-app@latest --pcf-dir ./pcf/FusionNotebookHost namespace EC --constructor FusionNotebookHost --display-name "Fusion Notebook Host"
299
300
  cd pcf/FusionNotebookHost
300
301
  npm install
301
302
  npm run build
@@ -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,12 @@
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
+ "shadcn": "^4.10.0",
8
+ "tailwind-merge": "^3.6.0"
45
9
  },
46
10
  "devDependencies": {
47
11
  "tw-animate-css": "^1.4.0"
48
12
  }
49
13
  }
50
-
@@ -1,8 +1,12 @@
1
- @import "tailwindcss";
2
- @import "tw-animate-css";
1
+ @layer theme, base, components, utilities;
2
+
3
+ @import "tailwindcss/theme.css" layer(theme) prefix(ec) important;
4
+ @import "tailwindcss/utilities.css" layer(utilities) prefix(ec) important;
5
+ @import "tw-animate-css/prefix";
6
+ @import "shadcn/tailwind.css";
3
7
 
4
8
  @custom-variant hover (&:hover);
5
- @custom-variant dark (&:is(.dark *));
9
+ @custom-variant dark (&:is(.ec-app.dark *, .ec-app .dark *));
6
10
 
7
11
  @theme inline {
8
12
  --radius-sm: calc(var(--radius) - 4px);
@@ -42,7 +46,7 @@
42
46
  --color-sidebar-ring: var(--sidebar-ring);
43
47
  }
44
48
 
45
- :root {
49
+ .ec-app[data-ec-app-id="{{APP_NAME}}"] {
46
50
  --radius: 0.625rem;
47
51
  --background: oklch(1 0 0);
48
52
  --foreground: oklch(0.145 0 0);
@@ -75,9 +79,13 @@
75
79
  --sidebar-accent-foreground: oklch(0.205 0 0);
76
80
  --sidebar-border: oklch(0.922 0 0);
77
81
  --sidebar-ring: oklch(0.708 0 0);
82
+
83
+ background: var(--background);
84
+ color: var(--foreground);
78
85
  }
79
86
 
80
- .dark {
87
+ .ec-app[data-ec-app-id="{{APP_NAME}}"].dark,
88
+ .ec-app[data-ec-app-id="{{APP_NAME}}"] .dark {
81
89
  --background: oklch(0.145 0 0);
82
90
  --foreground: oklch(0.985 0 0);
83
91
  --card: oklch(0.205 0 0);
@@ -112,10 +120,20 @@
112
120
  }
113
121
 
114
122
  @layer base {
115
- * {
116
- @apply border-border outline-ring/50;
123
+ :where(.ec-app, .ec-app *, .ec-app *::before, .ec-app *::after) {
124
+ box-sizing: border-box;
125
+ }
126
+
127
+ :where(.ec-app *) {
128
+ border-color: var(--border);
129
+ outline-color: color-mix(in oklab, var(--ring) 50%, transparent);
117
130
  }
118
- body {
119
- @apply bg-background text-foreground;
131
+
132
+ :where(.ec-app button, .ec-app input, .ec-app select, .ec-app textarea) {
133
+ font: inherit;
134
+ }
135
+
136
+ :where(.ec-app button:not(:disabled), .ec-app [role="button"]:not(:disabled)) {
137
+ cursor: pointer;
120
138
  }
121
139
  }
@@ -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 }