@dinachi/cli 0.6.3 → 0.7.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 (36) hide show
  1. package/dist/index.js +122 -33
  2. package/package.json +2 -3
  3. package/templates/alert-dialog/alert-dialog.tsx +62 -47
  4. package/templates/autocomplete/autocomplete.tsx +7 -7
  5. package/templates/badge/badge.tsx +58 -119
  6. package/templates/card/card.tsx +1 -1
  7. package/templates/checkbox/checkbox.tsx +16 -14
  8. package/templates/combobox/combobox.tsx +5 -5
  9. package/templates/context-menu/context-menu.tsx +124 -186
  10. package/templates/context-menu/index.ts +3 -1
  11. package/templates/dialog/dialog.tsx +26 -27
  12. package/templates/drawer/drawer.tsx +23 -21
  13. package/templates/field/field.tsx +5 -15
  14. package/templates/form/form.tsx +9 -66
  15. package/templates/label/index.ts +1 -0
  16. package/templates/label/label.tsx +21 -0
  17. package/templates/menu/index.ts +2 -0
  18. package/templates/menu/menu.tsx +59 -61
  19. package/templates/menubar/menubar.tsx +44 -72
  20. package/templates/navigation-menu/navigation-menu.tsx +61 -18
  21. package/templates/popover/index.ts +4 -1
  22. package/templates/popover/popover.tsx +80 -30
  23. package/templates/preview-card/preview-card.tsx +19 -5
  24. package/templates/radio/index.ts +1 -1
  25. package/templates/radio/radio.tsx +30 -14
  26. package/templates/select/select.tsx +75 -73
  27. package/templates/skeleton/index.ts +1 -0
  28. package/templates/skeleton/skeleton.tsx +12 -0
  29. package/templates/slider/slider.tsx +9 -15
  30. package/templates/switch/switch.tsx +15 -11
  31. package/templates/tabs/tabs.tsx +2 -2
  32. package/templates/toast/toast.tsx +76 -48
  33. package/templates/toggle/toggle.tsx +0 -17
  34. package/templates/toggle-group/toggle-group.tsx +8 -3
  35. package/templates/toolbar/toolbar.tsx +5 -4
  36. package/templates/tooltip/tooltip.tsx +9 -54
package/dist/index.js CHANGED
@@ -202,6 +202,13 @@ function getComponentRegistry() {
202
202
  dependencies: ["@base-ui/react"],
203
203
  utilityDependencies: ["cn"]
204
204
  },
205
+ label: {
206
+ name: "label",
207
+ description: "A styled label component for form fields.",
208
+ files: [{ name: "label.tsx" }, { name: "index.ts" }],
209
+ dependencies: [],
210
+ utilityDependencies: ["cn"]
211
+ },
205
212
  menu: {
206
213
  name: "menu",
207
214
  description: "A popup menu for actions and options triggered by a button.",
@@ -262,7 +269,7 @@ function getComponentRegistry() {
262
269
  name: "radio",
263
270
  description: "A radio input and group for selecting a single option from a set.",
264
271
  files: [{ name: "radio.tsx" }, { name: "index.ts" }],
265
- dependencies: ["@base-ui/react", "lucide-react"],
272
+ dependencies: ["@base-ui/react"],
266
273
  utilityDependencies: ["cn"]
267
274
  },
268
275
  "scroll-area": {
@@ -286,6 +293,13 @@ function getComponentRegistry() {
286
293
  dependencies: ["@base-ui/react"],
287
294
  utilityDependencies: ["cn"]
288
295
  },
296
+ skeleton: {
297
+ name: "skeleton",
298
+ description: "A placeholder loading animation component.",
299
+ files: [{ name: "skeleton.tsx" }, { name: "index.ts" }],
300
+ dependencies: [],
301
+ utilityDependencies: ["cn"]
302
+ },
289
303
  slider: {
290
304
  name: "slider",
291
305
  description: "An input where the user selects a value from within a given range.",
@@ -472,6 +486,7 @@ var DEPENDENCY_VERSION_MAP = {
472
486
  "lucide-react": "^0.552.0",
473
487
  "class-variance-authority": "^0.7.1",
474
488
  "tailwindcss-animate": "^1.0.7",
489
+ "tw-animate-css": "^1.3.4",
475
490
  "clsx": "^2.1.1",
476
491
  "tailwind-merge": "^3.3.1"
477
492
  };
@@ -566,9 +581,23 @@ function resolveConfiguredPath(aliasOrPath, projectRoot, compilerConfig) {
566
581
  }
567
582
  return path3.resolve(projectRoot, normalized);
568
583
  }
569
- function rewriteTemplateImports(content, targetFilePath, utilsFilePath, libDirPath) {
570
- const utilsImportPath = toImportPath(targetFilePath, utilsFilePath);
571
- const variantsImportPath = toImportPath(targetFilePath, path3.join(libDirPath, "variants.ts"));
584
+ function tryResolveAsAlias(absoluteFilePath, compilerConfig) {
585
+ if (!compilerConfig) return null;
586
+ for (const [pattern, targets] of Object.entries(compilerConfig.paths)) {
587
+ if (!pattern.includes("*") || !targets[0]?.includes("*")) continue;
588
+ const [prefix] = pattern.split("*");
589
+ const [targetPrefix] = targets[0].split("*");
590
+ const targetBase = path3.resolve(compilerConfig.baseUrl, targetPrefix);
591
+ const rel = path3.relative(targetBase, absoluteFilePath).replace(/\\/g, "/");
592
+ if (!rel.startsWith("..")) {
593
+ return prefix + stripExtension(rel);
594
+ }
595
+ }
596
+ return null;
597
+ }
598
+ function rewriteTemplateImports(content, targetFilePath, utilsFilePath, libDirPath, compilerConfig) {
599
+ const utilsImportPath = tryResolveAsAlias(utilsFilePath, compilerConfig) ?? toImportPath(targetFilePath, utilsFilePath);
600
+ const variantsImportPath = tryResolveAsAlias(path3.join(libDirPath, "variants.ts"), compilerConfig) ?? toImportPath(targetFilePath, path3.join(libDirPath, "variants.ts"));
572
601
  return content.replace(/(['"])@\/lib\/utils\1/g, `$1${utilsImportPath}$1`).replace(/(['"])@\/lib\/variants\1/g, `$1${variantsImportPath}$1`);
573
602
  }
574
603
  function getComponentDependencies(componentName, visited = /* @__PURE__ */ new Set()) {
@@ -659,25 +688,25 @@ function detectTailwindMajorVersion(projectRoot) {
659
688
  }
660
689
  }
661
690
  async function ensureTW4Plugin(deps, cssFilePath) {
662
- if (!deps.includes("tailwindcss-animate")) {
691
+ if (!deps.includes("tw-animate-css") && !deps.includes("tailwindcss-animate")) {
663
692
  return null;
664
693
  }
665
694
  if (!fs3.existsSync(cssFilePath)) {
666
695
  return { skipped: true, path: cssFilePath };
667
696
  }
668
697
  const content = await fs3.readFile(cssFilePath, "utf-8");
669
- if (content.includes("tailwindcss-animate")) {
698
+ if (content.includes("tw-animate-css") || content.includes("tailwindcss-animate")) {
670
699
  return { exists: true, path: cssFilePath };
671
700
  }
672
- const pluginLine = '@plugin "tailwindcss-animate";';
701
+ const importLine = '@import "tw-animate-css";';
673
702
  const importMatch = content.match(/^@import\s+["']tailwindcss["'];?\s*$/m);
674
703
  let updated;
675
704
  if (importMatch) {
676
705
  updated = content.replace(importMatch[0], `${importMatch[0].trimEnd()}
677
- ${pluginLine}
706
+ ${importLine}
678
707
  `);
679
708
  } else {
680
- updated = `${pluginLine}
709
+ updated = `${importLine}
681
710
  ${content}`;
682
711
  }
683
712
  await fs3.writeFile(cssFilePath, updated);
@@ -904,7 +933,7 @@ var addCommand = new Command("add").description("Add a component to your project
904
933
  spinner.start();
905
934
  }
906
935
  const templateContent = stripTemplateDirective(await fs3.readFile(sourcePath, "utf-8"));
907
- const rewrittenContent = rewriteTemplateImports(templateContent, targetPath, utilsFilePath, libDir);
936
+ const rewrittenContent = rewriteTemplateImports(templateContent, targetPath, utilsFilePath, libDir, compilerPathConfig);
908
937
  await fs3.writeFile(targetPath, rewrittenContent);
909
938
  allFilesAdded.push({ name: file.name, path: targetPath });
910
939
  }
@@ -914,6 +943,17 @@ var addCommand = new Command("add").description("Add a component to your project
914
943
  }
915
944
  spinner.text = "Updating Tailwind configuration...";
916
945
  const tailwindMajor = detectTailwindMajorVersion(projectRoot);
946
+ if (tailwindMajor >= 4) {
947
+ const idx = allDepsInstalled.indexOf("tailwindcss-animate");
948
+ if (idx !== -1) {
949
+ allDepsInstalled[idx] = "tw-animate-css";
950
+ }
951
+ for (let i = 0; i < allDepsInstalled.length; i++) {
952
+ if (allDepsInstalled[i] === "tailwindcss-animate") {
953
+ allDepsInstalled[i] = "tw-animate-css";
954
+ }
955
+ }
956
+ }
917
957
  const tailwindConfigInfo = tailwindMajor >= 4 ? await ensureTW4Plugin(
918
958
  allDepsInstalled,
919
959
  path3.resolve(projectRoot, config.tailwind?.css || "src/index.css")
@@ -953,14 +993,15 @@ var addCommand = new Command("add").description("Add a component to your project
953
993
  console.log(` ${chalk.green("+")} ${file.path}`);
954
994
  });
955
995
  if (tailwindConfigInfo) {
996
+ const animatePackage = tailwindMajor >= 4 ? "tw-animate-css" : "tailwindcss-animate";
956
997
  console.log();
957
998
  if (tailwindConfigInfo.created) {
958
- console.log(` ${chalk.green("+")} ${tailwindConfigInfo.path} (created with tailwindcss-animate plugin)`);
999
+ console.log(` ${chalk.green("+")} ${tailwindConfigInfo.path} (created with ${animatePackage} plugin)`);
959
1000
  } else if (tailwindConfigInfo.updated) {
960
- console.log(` ${chalk.blue("~")} ${tailwindConfigInfo.path} (updated with tailwindcss-animate plugin)`);
1001
+ console.log(` ${chalk.blue("~")} ${tailwindConfigInfo.path} (updated with ${animatePackage} plugin)`);
961
1002
  } else if (tailwindConfigInfo.skipped) {
962
1003
  console.log(
963
- ` ${chalk.yellow("!")} ${tailwindConfigInfo.path} (could not safely update automatically; add tailwindcss-animate manually)`
1004
+ ` ${chalk.yellow("!")} ${tailwindConfigInfo.path} (could not safely update automatically; add ${animatePackage} manually)`
964
1005
  );
965
1006
  }
966
1007
  }
@@ -1058,6 +1099,10 @@ function getThemeCSS(tailwindMajor, mode, preservedThemeVars = []) {
1058
1099
  --accent-foreground: oklch(0.1459 0.0497 142.4953);
1059
1100
  --destructive: oklch(0.5248 0.1368 20.8317);
1060
1101
  --destructive-foreground: oklch(1 0 0);
1102
+ --success: oklch(0.5882 0.1655 145.39);
1103
+ --success-foreground: oklch(1 0 0);
1104
+ --warning: oklch(0.6365 0.1639 55.49);
1105
+ --warning-foreground: oklch(1 0 0);
1061
1106
  --border: oklch(0.9239 0.0017 145.5613);
1062
1107
  --input: oklch(0.8481 0.0105 145.4823);
1063
1108
  --ring: oklch(0.1459 0.0497 142.4953);
@@ -1080,6 +1125,10 @@ function getThemeCSS(tailwindMajor, mode, preservedThemeVars = []) {
1080
1125
  --accent-foreground: oklch(0.9742 0.0101 131.3574);
1081
1126
  --destructive: oklch(0.2258 0.0524 12.6119);
1082
1127
  --destructive-foreground: oklch(1 0 0);
1128
+ --success: oklch(0.5484 0.1497 145.39);
1129
+ --success-foreground: oklch(1 0 0);
1130
+ --warning: oklch(0.5966 0.1499 55.49);
1131
+ --warning-foreground: oklch(1 0 0);
1083
1132
  --border: oklch(0.1811 0.0128 129.2819);
1084
1133
  --input: oklch(0.2213 0.0193 135.2915);
1085
1134
  --ring: oklch(0.9248 0.0051 145.5339);
@@ -1108,6 +1157,10 @@ function getThemeCSS(tailwindMajor, mode, preservedThemeVars = []) {
1108
1157
  --color-accent-foreground: var(--accent-foreground);
1109
1158
  --color-destructive: var(--destructive);
1110
1159
  --color-destructive-foreground: var(--destructive-foreground);
1160
+ --color-success: var(--success);
1161
+ --color-success-foreground: var(--success-foreground);
1162
+ --color-warning: var(--warning);
1163
+ --color-warning-foreground: var(--warning-foreground);
1111
1164
  --color-border: var(--border);
1112
1165
  --color-input: var(--input);
1113
1166
  --color-ring: var(--ring);
@@ -1187,6 +1240,14 @@ function getTW3ColorExtend() {
1187
1240
  DEFAULT: "var(--destructive)",
1188
1241
  foreground: "var(--destructive-foreground)",
1189
1242
  },
1243
+ success: {
1244
+ DEFAULT: "var(--success)",
1245
+ foreground: "var(--success-foreground)",
1246
+ },
1247
+ warning: {
1248
+ DEFAULT: "var(--warning)",
1249
+ foreground: "var(--warning-foreground)",
1250
+ },
1190
1251
  muted: {
1191
1252
  DEFAULT: "var(--muted)",
1192
1253
  foreground: "var(--muted-foreground)",
@@ -1364,7 +1425,7 @@ async function ensureAtAlias(projectRoot, srcDir, isTypeScript) {
1364
1425
  return { path: configPath, skipped: true };
1365
1426
  }
1366
1427
  }
1367
- var initCommand = new Command2("init").description("Initialize Dinachi UI in your project").option("--skip-install", "Skip package installation").action(async (options) => {
1428
+ var initCommand = new Command2("init").description("Initialize Dinachi UI in your project").option("--skip-install", "Skip package installation").option("-y, --yes", "Accept all defaults without prompting").action(async (options) => {
1368
1429
  console.log(chalk2.bold.cyan("\u{1F3A8} Welcome to Dinachi UI!"));
1369
1430
  console.log();
1370
1431
  const projectRoot = process.cwd();
@@ -1376,28 +1437,40 @@ var initCommand = new Command2("init").description("Initialize Dinachi UI in you
1376
1437
  const projectConfig = detectProjectType();
1377
1438
  console.log(chalk2.gray(`Detected ${projectConfig.framework} project`));
1378
1439
  console.log();
1379
- const response = await prompts2([
1380
- {
1381
- type: "text",
1382
- name: "componentsPath",
1383
- message: "Where would you like to install components?",
1384
- initial: projectConfig.componentsPath
1385
- },
1386
- {
1387
- type: "text",
1388
- name: "utilsPath",
1389
- message: "Where would you like to install utilities?",
1390
- initial: projectConfig.utilsPath
1440
+ let componentsPath;
1441
+ let utilsPath;
1442
+ if (options.yes) {
1443
+ componentsPath = projectConfig.componentsPath;
1444
+ utilsPath = projectConfig.utilsPath;
1445
+ console.log(chalk2.gray(`Components: ${componentsPath}`));
1446
+ console.log(chalk2.gray(`Utilities: ${utilsPath}`));
1447
+ console.log();
1448
+ } else {
1449
+ const response = await prompts2([
1450
+ {
1451
+ type: "text",
1452
+ name: "componentsPath",
1453
+ message: "Where would you like to install components?",
1454
+ initial: projectConfig.componentsPath
1455
+ },
1456
+ {
1457
+ type: "text",
1458
+ name: "utilsPath",
1459
+ message: "Where would you like to install utilities?",
1460
+ initial: projectConfig.utilsPath
1461
+ }
1462
+ ]);
1463
+ if (!response.componentsPath || !response.utilsPath) {
1464
+ console.log(chalk2.red("\u274C Setup cancelled."));
1465
+ process.exit(1);
1391
1466
  }
1392
- ]);
1393
- if (!response.componentsPath || !response.utilsPath) {
1394
- console.log(chalk2.red("\u274C Setup cancelled."));
1395
- process.exit(1);
1467
+ componentsPath = response.componentsPath;
1468
+ utilsPath = response.utilsPath;
1396
1469
  }
1397
1470
  const spinner = ora2("Setting up Dinachi UI...").start();
1398
1471
  try {
1399
- const normalizedComponentsPath = normalizeProjectPath(response.componentsPath, projectRoot);
1400
- const normalizedUtilsPath = normalizeProjectPath(response.utilsPath, projectRoot);
1472
+ const normalizedComponentsPath = normalizeProjectPath(componentsPath, projectRoot);
1473
+ const normalizedUtilsPath = normalizeProjectPath(utilsPath, projectRoot);
1401
1474
  const componentsDirPath = path4.resolve(projectRoot, normalizedComponentsPath);
1402
1475
  const utilsDirPath = path4.resolve(projectRoot, normalizedUtilsPath);
1403
1476
  const utilsFilePath = path4.join(utilsDirPath, "utils.ts");
@@ -1425,7 +1498,7 @@ var initCommand = new Command2("init").description("Initialize Dinachi UI in you
1425
1498
  const configContent = JSON.stringify(
1426
1499
  {
1427
1500
  style: "default",
1428
- rsc: projectConfig.framework === "next.js",
1501
+ rsc: detectRsc(projectRoot, projectConfig.framework),
1429
1502
  tsx: true,
1430
1503
  tailwind: {
1431
1504
  config: projectConfig.tailwindConfig,
@@ -1516,6 +1589,22 @@ var initCommand = new Command2("init").description("Initialize Dinachi UI in you
1516
1589
  process.exit(1);
1517
1590
  }
1518
1591
  });
1592
+ function detectRsc(projectRoot, framework) {
1593
+ const configPath = path4.join(projectRoot, "components.json");
1594
+ if (fs4.existsSync(configPath)) {
1595
+ try {
1596
+ const existing = JSON.parse(fs4.readFileSync(configPath, "utf-8"));
1597
+ if (typeof existing.rsc === "boolean") return existing.rsc;
1598
+ } catch {
1599
+ }
1600
+ }
1601
+ if (framework !== "next.js") return false;
1602
+ const hasAppRouter = fs4.existsSync(path4.join(projectRoot, "app")) || fs4.existsSync(path4.join(projectRoot, "src", "app"));
1603
+ const hasPagesRouter = fs4.existsSync(path4.join(projectRoot, "pages")) || fs4.existsSync(path4.join(projectRoot, "src", "pages"));
1604
+ if (hasAppRouter) return true;
1605
+ if (hasPagesRouter) return false;
1606
+ return true;
1607
+ }
1519
1608
  function detectProjectType() {
1520
1609
  const packageJsonPath = path4.join(process.cwd(), "package.json");
1521
1610
  if (!fs4.existsSync(packageJsonPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dinachi/cli",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "description": "CLI for adding Dinachi UI components to your project",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -19,8 +19,7 @@
19
19
  },
20
20
  "homepage": "https://dinachi.dev",
21
21
  "bin": {
22
- "dinachi": "dist/index.js",
23
- "dinachi-ui": "dist/index.js"
22
+ "dinachi": "dist/index.js"
24
23
  },
25
24
  "files": [
26
25
  "dist",
@@ -1,46 +1,44 @@
1
- import * as React from "react";
2
- import { AlertDialog as BaseAlertDialog } from "@base-ui/react";
3
- import { cn } from "@/lib/utils";
1
+ "use client"
4
2
 
5
- const AlertDialog = BaseAlertDialog.Root;
3
+ import * as React from "react"
4
+ import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog"
5
+ import { cn } from "@/lib/utils"
6
6
 
7
- const AlertDialogTrigger = React.forwardRef<
8
- HTMLButtonElement,
9
- React.ComponentProps<typeof BaseAlertDialog.Trigger>
7
+ const AlertDialog = BaseAlertDialog.Root
8
+ const AlertDialogTrigger = BaseAlertDialog.Trigger
9
+ const AlertDialogPortal = BaseAlertDialog.Portal
10
+
11
+ const AlertDialogBackdrop = React.forwardRef<
12
+ HTMLDivElement,
13
+ React.ComponentProps<typeof BaseAlertDialog.Backdrop>
10
14
  >(({ className, ...props }, ref) => (
11
- <BaseAlertDialog.Trigger
15
+ <BaseAlertDialog.Backdrop
12
16
  ref={ref}
13
17
  className={cn(
14
- "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors",
15
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
16
- "disabled:pointer-events-none disabled:opacity-50",
17
- "bg-primary text-primary-foreground hover:bg-primary/90",
18
- "h-10 px-4 py-2",
18
+ "fixed inset-0 z-50 bg-black/80",
19
+ "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
20
+ "transition-all duration-150",
19
21
  className
20
22
  )}
21
23
  {...props}
22
24
  />
23
- ));
24
- AlertDialogTrigger.displayName = "AlertDialogTrigger";
25
-
26
- const AlertDialogPortal = BaseAlertDialog.Portal;
25
+ ))
26
+ AlertDialogBackdrop.displayName = "AlertDialogBackdrop"
27
27
 
28
- const AlertDialogBackdrop = React.forwardRef<
28
+ const AlertDialogViewport = React.forwardRef<
29
29
  HTMLDivElement,
30
- React.ComponentProps<typeof BaseAlertDialog.Backdrop>
30
+ React.ComponentProps<typeof BaseAlertDialog.Viewport>
31
31
  >(({ className, ...props }, ref) => (
32
- <BaseAlertDialog.Backdrop
32
+ <BaseAlertDialog.Viewport
33
33
  ref={ref}
34
34
  className={cn(
35
- "fixed inset-0 z-50 bg-black/80",
36
- "data-starting-style:opacity-0 data-ending-style:opacity-0",
37
- "transition-all duration-150",
35
+ "fixed inset-0 z-50 flex items-center justify-center overflow-auto",
38
36
  className
39
37
  )}
40
38
  {...props}
41
39
  />
42
- ));
43
- AlertDialogBackdrop.displayName = "AlertDialogBackdrop";
40
+ ))
41
+ AlertDialogViewport.displayName = "AlertDialogViewport"
44
42
 
45
43
  const AlertDialogPopup = React.forwardRef<
46
44
  HTMLDivElement,
@@ -49,16 +47,16 @@ const AlertDialogPopup = React.forwardRef<
49
47
  <BaseAlertDialog.Popup
50
48
  ref={ref}
51
49
  className={cn(
52
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:rounded-lg",
53
- "data-starting-style:scale-95 data-starting-style:opacity-0",
54
- "data-ending-style:scale-95 data-ending-style:opacity-0",
50
+ "w-[95%] max-w-lg gap-4 rounded-lg border bg-background p-6 shadow-lg",
51
+ "data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
52
+ "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
55
53
  "transition-all duration-150",
56
54
  className
57
55
  )}
58
56
  {...props}
59
57
  />
60
- ));
61
- AlertDialogPopup.displayName = "AlertDialogPopup";
58
+ ))
59
+ AlertDialogPopup.displayName = "AlertDialogPopup"
62
60
 
63
61
  const AlertDialogTitle = React.forwardRef<
64
62
  HTMLHeadingElement,
@@ -66,11 +64,11 @@ const AlertDialogTitle = React.forwardRef<
66
64
  >(({ className, ...props }, ref) => (
67
65
  <BaseAlertDialog.Title
68
66
  ref={ref}
69
- className={cn("text-lg font-semibold", className)}
67
+ className={cn("text-lg font-medium leading-none tracking-tight", className)}
70
68
  {...props}
71
69
  />
72
- ));
73
- AlertDialogTitle.displayName = "AlertDialogTitle";
70
+ ))
71
+ AlertDialogTitle.displayName = "AlertDialogTitle"
74
72
 
75
73
  const AlertDialogDescription = React.forwardRef<
76
74
  HTMLParagraphElement,
@@ -81,8 +79,8 @@ const AlertDialogDescription = React.forwardRef<
81
79
  className={cn("text-sm text-muted-foreground", className)}
82
80
  {...props}
83
81
  />
84
- ));
85
- AlertDialogDescription.displayName = "AlertDialogDescription";
82
+ ))
83
+ AlertDialogDescription.displayName = "AlertDialogDescription"
86
84
 
87
85
  const AlertDialogAction = React.forwardRef<
88
86
  HTMLButtonElement,
@@ -91,15 +89,15 @@ const AlertDialogAction = React.forwardRef<
91
89
  <BaseAlertDialog.Close
92
90
  ref={ref}
93
91
  className={cn(
94
- "inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground transition-colors",
92
+ "inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors",
95
93
  "hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
96
94
  "disabled:cursor-not-allowed disabled:opacity-50",
97
95
  className
98
96
  )}
99
97
  {...props}
100
98
  />
101
- ));
102
- AlertDialogAction.displayName = "AlertDialogAction";
99
+ ))
100
+ AlertDialogAction.displayName = "AlertDialogAction"
103
101
 
104
102
  const AlertDialogCancel = React.forwardRef<
105
103
  HTMLButtonElement,
@@ -108,15 +106,15 @@ const AlertDialogCancel = React.forwardRef<
108
106
  <BaseAlertDialog.Close
109
107
  ref={ref}
110
108
  className={cn(
111
- "inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold shadow-sm transition-colors",
109
+ "inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors",
112
110
  "hover:bg-accent hover:text-accent-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
113
111
  "disabled:cursor-not-allowed disabled:opacity-50",
114
112
  className
115
113
  )}
116
114
  {...props}
117
115
  />
118
- ));
119
- AlertDialogCancel.displayName = "AlertDialogCancel";
116
+ ))
117
+ AlertDialogCancel.displayName = "AlertDialogCancel"
120
118
 
121
119
  const AlertDialogHeader = ({
122
120
  className,
@@ -129,8 +127,8 @@ const AlertDialogHeader = ({
129
127
  )}
130
128
  {...props}
131
129
  />
132
- );
133
- AlertDialogHeader.displayName = "AlertDialogHeader";
130
+ )
131
+ AlertDialogHeader.displayName = "AlertDialogHeader"
134
132
 
135
133
  const AlertDialogFooter = ({
136
134
  className,
@@ -138,19 +136,35 @@ const AlertDialogFooter = ({
138
136
  }: React.HTMLAttributes<HTMLDivElement>) => (
139
137
  <div
140
138
  className={cn(
141
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
139
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-1.5",
142
140
  className
143
141
  )}
144
142
  {...props}
145
143
  />
146
- );
147
- AlertDialogFooter.displayName = "AlertDialogFooter";
144
+ )
145
+ AlertDialogFooter.displayName = "AlertDialogFooter"
146
+
147
+ const AlertDialogContent = React.forwardRef<
148
+ HTMLDivElement,
149
+ React.ComponentProps<typeof BaseAlertDialog.Popup>
150
+ >(({ className, children, ...props }, ref) => (
151
+ <AlertDialogPortal>
152
+ <AlertDialogBackdrop />
153
+ <AlertDialogViewport>
154
+ <AlertDialogPopup ref={ref} className={className} {...props}>
155
+ {children}
156
+ </AlertDialogPopup>
157
+ </AlertDialogViewport>
158
+ </AlertDialogPortal>
159
+ ))
160
+ AlertDialogContent.displayName = "AlertDialogContent"
148
161
 
149
162
  export {
150
163
  AlertDialog,
151
164
  AlertDialogTrigger,
152
165
  AlertDialogPortal,
153
166
  AlertDialogBackdrop,
167
+ AlertDialogViewport,
154
168
  AlertDialogPopup,
155
169
  AlertDialogTitle,
156
170
  AlertDialogDescription,
@@ -158,4 +172,5 @@ export {
158
172
  AlertDialogCancel,
159
173
  AlertDialogHeader,
160
174
  AlertDialogFooter,
161
- };
175
+ AlertDialogContent,
176
+ }
@@ -17,9 +17,9 @@ const AutocompleteInput = React.forwardRef<
17
17
  <AutocompletePrimitive.Input
18
18
  ref={ref}
19
19
  className={cn(
20
- "flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm",
20
+ "flex h-10 w-full bg-transparent px-3 py-2 text-sm",
21
21
  "placeholder:text-muted-foreground",
22
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
22
+ "focus:outline-none",
23
23
  "disabled:cursor-not-allowed disabled:opacity-50",
24
24
  className
25
25
  )}
@@ -35,8 +35,8 @@ const AutocompleteTrigger = React.forwardRef<
35
35
  <AutocompletePrimitive.Trigger
36
36
  ref={ref}
37
37
  className={cn(
38
- "inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-3",
39
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
38
+ "inline-flex h-10 items-center justify-center px-3",
39
+ "focus-visible:outline-none",
40
40
  "disabled:pointer-events-none disabled:opacity-50",
41
41
  className
42
42
  )}
@@ -80,7 +80,7 @@ const AutocompleteContent = React.forwardRef<
80
80
  <AutocompletePrimitive.Popup
81
81
  ref={ref}
82
82
  className={cn(
83
- "relative z-50 min-w-48 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
83
+ "relative z-50 min-w-(--anchor-width) overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
84
84
  "origin-(--transform-origin) outline-none",
85
85
  "data-starting-style:animate-in data-starting-style:fade-in-0 data-starting-style:zoom-in-95",
86
86
  "data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95",
@@ -118,8 +118,8 @@ const AutocompleteItem = React.forwardRef<
118
118
  <AutocompletePrimitive.Item
119
119
  ref={ref}
120
120
  className={cn(
121
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
122
- "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
121
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm lg:text-base outline-none",
122
+ "data-highlighted:bg-accent font-normal data-highlighted:text-accent-foreground",
123
123
  "data-disabled:pointer-events-none data-disabled:opacity-50",
124
124
  inset && "pl-8",
125
125
  className