create-nala 3.0.4 → 3.1.1

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.
@@ -1,14 +1,48 @@
1
1
  <script lang="ts" setup>
2
2
  import type { ToasterProps } from "vue-sonner"
3
- import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, XIcon } from "@lucide/vue"
3
+ import { CheckCircle2, Info, Loader2, AlertCircle, AlertTriangle } from "@lucide/vue"
4
4
  import { Toaster as Sonner } from "vue-sonner"
5
5
  import { cn } from "@/lib/utils"
6
6
 
7
- const props = defineProps<ToasterProps>()
7
+ const props = withDefaults(defineProps<ToasterProps>(), {
8
+ position: "top-right",
9
+ richColors: false,
10
+ })
11
+
12
+ const defaultToastOptions = {
13
+ classes: {
14
+ toast:
15
+ 'group toast flex items-center gap-3 w-full bg-card/95 text-foreground border border-border/80 shadow-lg backdrop-blur-md px-4 py-3 rounded-lg text-xs transition-all',
16
+ title: 'text-xs font-semibold text-foreground tracking-tight',
17
+ description: '!text-zinc-600 dark:!text-zinc-300 text-[11.5px] leading-relaxed mt-0.5 font-normal',
18
+ actionButton:
19
+ 'bg-primary text-primary-foreground text-[11px] font-medium px-2.5 py-1 rounded shadow-2xs hover:bg-primary/90 transition-colors',
20
+ cancelButton:
21
+ 'bg-muted text-muted-foreground text-[11px] font-medium px-2.5 py-1 rounded hover:bg-muted/80 transition-colors',
22
+ success:
23
+ '!border-emerald-500/30 !bg-emerald-500/[0.04] dark:!bg-emerald-950/[0.2] !text-foreground',
24
+ info:
25
+ '!border-blue-500/30 !bg-blue-500/[0.04] dark:!bg-blue-950/[0.2] !text-foreground',
26
+ warning:
27
+ '!border-amber-500/30 !bg-amber-500/[0.04] dark:!bg-amber-950/[0.2] !text-foreground',
28
+ error:
29
+ '!border-rose-500/30 !bg-rose-500/[0.04] dark:!bg-rose-950/[0.2] !text-foreground',
30
+ },
31
+ }
32
+
33
+ const computedToastOptions = computed(() => ({
34
+ ...defaultToastOptions,
35
+ ...props.toastOptions,
36
+ classes: {
37
+ ...defaultToastOptions.classes,
38
+ ...props.toastOptions?.classes,
39
+ },
40
+ }))
8
41
  </script>
9
42
 
10
43
  <template>
11
44
  <Sonner
45
+ v-bind="props"
12
46
  :class="cn('toaster group', props.class)"
13
47
  :style="{
14
48
  '--normal-bg': 'var(--popover)',
@@ -16,27 +50,23 @@ const props = defineProps<ToasterProps>()
16
50
  '--normal-border': 'var(--border)',
17
51
  '--border-radius': 'var(--radius)',
18
52
  }"
19
- v-bind="props"
53
+ :toast-options="computedToastOptions"
54
+ :close-button="false"
20
55
  >
21
56
  <template #success-icon>
22
- <CircleCheckIcon class="size-4" />
57
+ <CheckCircle2 class="h-4 w-4 text-emerald-500 shrink-0" />
23
58
  </template>
24
59
  <template #info-icon>
25
- <InfoIcon class="size-4" />
60
+ <Info class="h-4 w-4 text-blue-500 shrink-0" />
26
61
  </template>
27
62
  <template #warning-icon>
28
- <TriangleAlertIcon class="size-4" />
63
+ <AlertTriangle class="h-4 w-4 text-amber-500 shrink-0" />
29
64
  </template>
30
65
  <template #error-icon>
31
- <OctagonXIcon class="size-4" />
66
+ <AlertCircle class="h-4 w-4 text-rose-500 shrink-0" />
32
67
  </template>
33
68
  <template #loading-icon>
34
- <div>
35
- <Loader2Icon class="size-4 animate-spin" />
36
- </div>
37
- </template>
38
- <template #close-icon>
39
- <XIcon class="size-4" />
69
+ <Loader2 class="h-4 w-4 text-primary animate-spin shrink-0" />
40
70
  </template>
41
71
  </Sonner>
42
72
  </template>
@@ -1,21 +1,27 @@
1
1
  {
2
- "extends": "@vue/tsconfig/tsconfig.dom.json",
3
2
  "compilerOptions": {
4
3
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "types": [
6
- "vite/client",
7
- "vitest/globals"
8
- ],
9
- "allowArbitraryExtensions": true,
10
- /* Linting */
4
+ /* Target must match vite's esbuild target */
5
+ "target": "ES2022",
6
+ "module": "ESNext",
7
+ "moduleResolution": "Bundler",
8
+ "useDefineForClassFields": true,
9
+ /* DOM lib for browser APIs */
10
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
11
+ "jsx": "preserve",
12
+ "jsxImportSource": "vue",
13
+ /* Type checking */
14
+ "strict": true,
15
+ "noFallthroughCasesInSwitch": true,
11
16
  "noUnusedLocals": true,
12
17
  "noUnusedParameters": true,
13
18
  "erasableSyntaxOnly": true,
14
- "noFallthroughCasesInSwitch": true,
19
+ "allowArbitraryExtensions": true,
20
+ "resolveJsonModule": true,
21
+ "isolatedModules": true,
22
+ "skipLibCheck": true,
15
23
  "paths": {
16
- "@/*": [
17
- "./src/*"
18
- ]
24
+ "@/*": ["./src/*"]
19
25
  }
20
26
  },
21
27
  "include": [