@velastack/patterns 0.0.7 → 0.0.10

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,9 +1,189 @@
1
- import { mkdirSync as f, writeFileSync as _, existsSync as v, rmSync as $, readFileSync as P } from "node:fs";
2
- import r from "node:path";
3
- import { detect as T } from "package-manager-detector";
4
- import { resolveCommand as L } from "package-manager-detector/commands";
5
- import I from "cross-spawn";
6
- const M = `<script lang="ts">
1
+ import { mkdirSync as f, writeFileSync as _, existsSync as g, rmSync as M, readFileSync as T } from "node:fs";
2
+ import l from "node:path";
3
+ import { detect as $ } from "package-manager-detector";
4
+ import { resolveCommand as P } from "package-manager-detector/commands";
5
+ import D from "cross-spawn";
6
+ const k = `<script lang="ts">
7
+ import { cn } from '$lib/utils';
8
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
9
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
10
+ import { getContext } from 'svelte';
11
+ import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
12
+
13
+ let {
14
+ children,
15
+ class: className,
16
+ ...restProps
17
+ }: DropdownMenuPrimitive.ContentProps & {
18
+ portalProps?: DropdownMenuPrimitive.PortalProps;
19
+ } = $props();
20
+
21
+ let { isDesktop } =
22
+ getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);
23
+ <\/script>
24
+
25
+ {#if isDesktop}
26
+ <DropdownMenu.Content class={className} {...restProps}>
27
+ {@render children?.()}
28
+ </DropdownMenu.Content>
29
+ {:else}
30
+ <div class={cn('flex flex-col w-full', className)}>
31
+ {@render children?.()}
32
+ </div>
33
+ {/if}
34
+ `, L = `<script lang="ts">
35
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
36
+ import { getContext } from 'svelte';
37
+ import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
38
+ let { isDesktop } =
39
+ getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);
40
+ let { children, ...restProps } = $props();
41
+ <\/script>
42
+
43
+ {#if isDesktop}
44
+ <DropdownMenu.Group {...restProps}>
45
+ {@render children?.()}
46
+ </DropdownMenu.Group>
47
+ {:else}
48
+ {@render children?.()}
49
+ {/if}
50
+ `, I = `<script lang="ts">
51
+ import { goto } from '$app/navigation';
52
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
53
+ import { Button } from '$lib/components/ui/button';
54
+ import { getContext } from 'svelte';
55
+ import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
56
+ let { children, href = undefined, ...restProps } = $props();
57
+
58
+ const { isDesktop } =
59
+ getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);
60
+
61
+ const handleClick = () => {
62
+ if (restProps.onclick) {
63
+ restProps.onclick();
64
+ } else {
65
+ if (href) {
66
+ goto(href);
67
+ }
68
+ }
69
+ };
70
+ <\/script>
71
+
72
+ {#if isDesktop}
73
+ <DropdownMenu.Item {...restProps} onclick={handleClick}>
74
+ {@render children?.()}
75
+ </DropdownMenu.Item>
76
+ {:else}
77
+ <Button
78
+ class="w-full justify-start md:justify-center md:w-auto"
79
+ variant="ghost"
80
+ {href}
81
+ {...restProps}
82
+ >
83
+ {@render children?.()}
84
+ </Button>
85
+ {/if}
86
+ `, N = `<script lang="ts">
87
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
88
+ import { getContext } from 'svelte';
89
+ import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
90
+ const { isDesktop } =
91
+ getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);
92
+ let { children, ...restProps } = $props();
93
+ <\/script>
94
+
95
+ {#if isDesktop}
96
+ <DropdownMenu.Label {...restProps}>
97
+ {@render children?.()}
98
+ </DropdownMenu.Label>
99
+ {/if}
100
+ `, S = `<script lang="ts">
101
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
102
+ import { getContext } from 'svelte';
103
+ import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
104
+ const { isDesktop } =
105
+ getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);
106
+ let restProps = $props();
107
+ <\/script>
108
+
109
+ {#if isDesktop}
110
+ <DropdownMenu.Separator {...restProps} />
111
+ {/if}
112
+ `, A = `<script lang="ts">
113
+ import { cn } from '$lib/utils';
114
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
115
+ import { getContext } from 'svelte';
116
+ import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
117
+ let { class: className = '', ...restProps } = $props();
118
+
119
+ const { isDesktop } =
120
+ getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);
121
+ <\/script>
122
+
123
+ {#if isDesktop}
124
+ <DropdownMenu.Trigger class={cn('inline-flex', className)} {...restProps} />
125
+ {/if}
126
+ `, E = `<script lang="ts">
127
+ import { page } from '$app/state';
128
+ import { browser } from '$app/environment';
129
+ import { onMount, setContext } from 'svelte';
130
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
131
+ import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
132
+
133
+ let { user, guest } = $props();
134
+
135
+ const breakpoint = 768;
136
+ const breakpointQuery = \`(min-width: \${breakpoint}px)\`;
137
+
138
+ let hasMounted = $state(false);
139
+ let authMenuContext = $state<AuthMenuContext>({ isDesktop: true });
140
+
141
+ setContext(AUTH_MENU_CONTEXT_KEY, authMenuContext);
142
+
143
+ function updateIsDesktop() {
144
+ if (!browser) return;
145
+ authMenuContext.isDesktop = window.matchMedia(breakpointQuery).matches;
146
+ }
147
+
148
+ onMount(() => {
149
+ updateIsDesktop();
150
+ hasMounted = true;
151
+ const mq = window.matchMedia(breakpointQuery);
152
+ const listener = () => (authMenuContext.isDesktop = mq.matches);
153
+ mq.addEventListener('change', listener);
154
+ return () => mq.removeEventListener('change', listener);
155
+ });
156
+ <\/script>
157
+
158
+ {#if page.data.user}
159
+ {#if authMenuContext.isDesktop}
160
+ <DropdownMenu.Root>
161
+ {@render user?.()}
162
+ </DropdownMenu.Root>
163
+ {:else}
164
+ <!-- This prevents the menu from being rendered twice before we know if we're on desktop or not -->
165
+ {#if hasMounted}
166
+ {@render user?.()}
167
+ {/if}
168
+ {/if}
169
+ {:else}
170
+ {@render guest?.()}
171
+ {/if}
172
+ `, F = `export type AuthMenuContext = {
173
+ isDesktop: boolean;
174
+ };
175
+
176
+ export const AUTH_MENU_CONTEXT_KEY = Symbol('auth-menu-context');
177
+ `, H = `import Root from './auth-menu.svelte';
178
+ import Content from './auth-menu-content.svelte';
179
+ import Trigger from './auth-menu-trigger.svelte';
180
+ import Group from './auth-menu-group.svelte';
181
+ import Label from './auth-menu-label.svelte';
182
+ import Separator from './auth-menu-separator.svelte';
183
+ import Item from './auth-menu-item.svelte';
184
+
185
+ export { Root, Content, Trigger, Group, Label, Separator, Item };
186
+ `, U = `<script lang="ts">
7
187
  import type { HTMLAttributes } from 'svelte/elements';
8
188
  import { cn } from '$lib/utils';
9
189
 
@@ -19,7 +199,7 @@ const M = `<script lang="ts">
19
199
  {new Date(value).toLocaleDateString()}
20
200
  {/if}
21
201
  </div>
22
- `, D = `<script lang="ts">
202
+ `, j = `<script lang="ts">
23
203
  import type { HTMLAttributes } from 'svelte/elements';
24
204
  import { cn } from '$lib/utils';
25
205
 
@@ -33,7 +213,7 @@ const M = `<script lang="ts">
33
213
  <div class={cn('flex items-center', className)} {...restProps}>
34
214
  {value ? 'Yes' : 'No'}
35
215
  </div>
36
- `, S = `<script lang="ts">
216
+ `, B = `<script lang="ts">
37
217
  import type { HTMLAttributes } from 'svelte/elements';
38
218
  import { cn } from '$lib/utils';
39
219
 
@@ -49,7 +229,7 @@ const M = `<script lang="ts">
49
229
  {new Date(value).toLocaleDateString()}
50
230
  {/if}
51
231
  </div>
52
- `, k = `<script lang="ts">
232
+ `, R = `<script lang="ts">
53
233
  import type { HTMLAttributes } from 'svelte/elements';
54
234
  import { cn } from '$lib/utils';
55
235
 
@@ -63,7 +243,7 @@ const M = `<script lang="ts">
63
243
  <div class={cn('flex items-center', className)} {...restProps}>
64
244
  {value}
65
245
  </div>
66
- `, F = `<script lang="ts">
246
+ `, O = `<script lang="ts">
67
247
  import type { HTMLAttributes } from 'svelte/elements';
68
248
  import { cn } from '$lib/utils';
69
249
 
@@ -77,7 +257,7 @@ const M = `<script lang="ts">
77
257
  <div class={cn('flex items-center', className)} {...restProps}>
78
258
  {value}
79
259
  </div>
80
- `, N = `<script lang="ts">
260
+ `, z = `<script lang="ts">
81
261
  import FileIcon from '@lucide/svelte/icons/file';
82
262
  import type { HTMLAttributes } from 'svelte/elements';
83
263
  import { cn } from '$lib/utils';
@@ -135,7 +315,7 @@ const M = `<script lang="ts">
135
315
  {/if}
136
316
  {/if}
137
317
  </div>
138
- `, A = `<script lang="ts">
318
+ `, V = `<script lang="ts">
139
319
  import MapPinIcon from '@lucide/svelte/icons/map-pin';
140
320
  import type { HTMLAttributes } from 'svelte/elements';
141
321
  import { cn } from '$lib/utils';
@@ -155,7 +335,7 @@ const M = `<script lang="ts">
155
335
  <span>{value.lat.toFixed(6)}, {value.lon.toFixed(6)}</span>
156
336
  {/if}
157
337
  </div>
158
- `, H = `export { default as AutodateCell } from './autodate.svelte';
338
+ `, W = `export { default as AutodateCell } from './autodate.svelte';
159
339
  export { default as BoolCell } from './bool.svelte';
160
340
  export { default as DateCell } from './date.svelte';
161
341
  export { default as EditorCell } from './editor.svelte';
@@ -169,7 +349,7 @@ export { default as RelationCell } from './relation.svelte';
169
349
  export { default as SelectCell } from './select.svelte';
170
350
  export { default as TextCell } from './text.svelte';
171
351
  export { default as UrlCell } from './url.svelte';
172
- `, B = `<script lang="ts">
352
+ `, Y = `<script lang="ts">
173
353
  import type { HTMLAttributes } from 'svelte/elements';
174
354
  import { cn } from '$lib/utils';
175
355
 
@@ -185,7 +365,7 @@ export { default as UrlCell } from './url.svelte';
185
365
  {JSON.stringify(value)}
186
366
  {/if}
187
367
  </div>
188
- `, j = `<script lang="ts">
368
+ `, K = `<script lang="ts">
189
369
  import type { HTMLAttributes } from 'svelte/elements';
190
370
  import { cn } from '$lib/utils';
191
371
 
@@ -199,7 +379,7 @@ export { default as UrlCell } from './url.svelte';
199
379
  <div class={cn('flex items-center', className)} {...restProps}>
200
380
  {value}
201
381
  </div>
202
- `, R = `<script lang="ts">
382
+ `, X = `<script lang="ts">
203
383
  import type { HTMLAttributes } from 'svelte/elements';
204
384
  import { cn } from '$lib/utils';
205
385
 
@@ -211,7 +391,7 @@ export { default as UrlCell } from './url.svelte';
211
391
  <\/script>
212
392
 
213
393
  <div class={cn('flex items-center', className)} {...restProps}>********</div>
214
- `, E = `<script lang="ts">
394
+ `, G = `<script lang="ts">
215
395
  import type { HTMLAttributes } from 'svelte/elements';
216
396
  import { Badge } from '$lib/components/ui/badge';
217
397
  import { cn } from '$lib/utils';
@@ -249,7 +429,7 @@ export { default as UrlCell } from './url.svelte';
249
429
  {/if}
250
430
  {/if}
251
431
  </div>
252
- `, U = `<script lang="ts">
432
+ `, q = `<script lang="ts">
253
433
  import type { HTMLAttributes } from 'svelte/elements';
254
434
  import { Badge } from '$lib/components/ui/badge';
255
435
  import { cn } from '$lib/utils';
@@ -278,7 +458,7 @@ export { default as UrlCell } from './url.svelte';
278
458
  {/if}
279
459
  {/if}
280
460
  </div>
281
- `, z = `<script lang="ts">
461
+ `, J = `<script lang="ts">
282
462
  import type { HTMLAttributes } from 'svelte/elements';
283
463
  import { cn } from '$lib/utils';
284
464
 
@@ -292,7 +472,7 @@ export { default as UrlCell } from './url.svelte';
292
472
  <div class={cn('flex items-center', className)} {...restProps}>
293
473
  {value}
294
474
  </div>
295
- `, V = `<script lang="ts">
475
+ `, Z = `<script lang="ts">
296
476
  import type { HTMLAttributes } from 'svelte/elements';
297
477
  import { cn } from '$lib/utils';
298
478
 
@@ -314,7 +494,7 @@ export { default as UrlCell } from './url.svelte';
314
494
  <a href={value} {target} {rel}>{value}</a>
315
495
  {/if}
316
496
  </div>
317
- `, O = `<script lang="ts">
497
+ `, Q = `<script lang="ts">
318
498
  import type { HTMLAttributes } from 'svelte/elements';
319
499
  import type { Column } from '@tanstack/table-core';
320
500
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
@@ -373,8 +553,8 @@ export { default as UrlCell } from './url.svelte';
373
553
  </DropdownMenu.Root>
374
554
  </div>
375
555
  {/if}
376
- `, W = `export { default as ColumnHeader } from './column-header.svelte';
377
- `, G = `<script lang="ts" generics="TData, TValue">
556
+ `, tt = `export { default as ColumnHeader } from './column-header.svelte';
557
+ `, nt = `<script lang="ts" generics="TData, TValue">
378
558
  import type { Component } from 'svelte';
379
559
  import { SvelteSet } from 'svelte/reactivity';
380
560
  import type { Column } from '@tanstack/table-core';
@@ -489,8 +669,8 @@ export { default as UrlCell } from './url.svelte';
489
669
  </Command.Root>
490
670
  </Popover.Content>
491
671
  </Popover.Root>
492
- `, J = `export { default as FacetedFilter } from './faceted-filter.svelte';
493
- `, Z = `<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
672
+ `, et = `export { default as FacetedFilter } from './faceted-filter.svelte';
673
+ `, ot = `<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
494
674
  import * as FormPrimitive from 'formsnap';
495
675
  import type { FormPath } from 'sveltekit-superforms';
496
676
  import { cn, type WithElementRef, type WithoutChildren } from '$lib/utils';
@@ -520,7 +700,7 @@ export { default as UrlCell } from './url.svelte';
520
700
  </div>
521
701
  {/snippet}
522
702
  </FormPrimitive.Field>
523
- `, q = `<script lang="ts">
703
+ `, st = `<script lang="ts">
524
704
  import { getContext } from 'svelte';
525
705
  import { fileProxy, filesProxy, type SuperForm } from 'sveltekit-superforms';
526
706
  import { Input } from '$lib/components/ui/input';
@@ -560,7 +740,7 @@ export { default as UrlCell } from './url.svelte';
560
740
  {...props}
561
741
  name={multiple ? \`\${name}+\` : ''}
562
742
  />
563
- `, Y = `<script lang="ts">
743
+ `, it = `<script lang="ts">
564
744
  import { setContext, getContext } from 'svelte';
565
745
  import { type SuperForm } from 'sveltekit-superforms';
566
746
  import { getName } from './shared';
@@ -619,7 +799,7 @@ export { default as UrlCell } from './url.svelte';
619
799
  {/each}
620
800
 
621
801
  {@render input()}
622
- `, K = `<script lang="ts">
802
+ `, rt = `<script lang="ts">
623
803
  import { setContext, getContext } from 'svelte';
624
804
  import { type SuperForm } from 'sveltekit-superforms';
625
805
  import { getName } from './shared';
@@ -656,7 +836,7 @@ export { default as UrlCell } from './url.svelte';
656
836
  {/if}
657
837
 
658
838
  {@render input()}
659
- `, Q = `<script lang="ts">
839
+ `, lt = `<script lang="ts">
660
840
  import { getContext } from 'svelte';
661
841
  import { type SuperForm } from 'sveltekit-superforms';
662
842
  import FileIcon from '@lucide/svelte/icons/file';
@@ -725,12 +905,12 @@ export { default as UrlCell } from './url.svelte';
725
905
  <FileIcon class="w-4 h-4" />
726
906
  </div>
727
907
  {/if}
728
- `, X = `export { default as Field } from './file-field.svelte';
908
+ `, at = `export { default as Field } from './file-field.svelte';
729
909
  export { default as Single } from './file-single.svelte';
730
910
  export { default as Multiple } from './file-multiple.svelte';
731
911
  export { default as Input } from './file-input.svelte';
732
912
  export { default as Thumb } from './file-thumb.svelte';
733
- `, tt = `export function getUrl(file: File | string, collectionId: string, recordId: string, thumb: string) {
913
+ `, pt = `export function getUrl(file: File | string, collectionId: string, recordId: string, thumb: string) {
734
914
  return typeof file === 'string'
735
915
  ? \`/api/files/\${collectionId}/\${recordId}/\${file}?thumb=\${thumb}\`
736
916
  : URL.createObjectURL(file);
@@ -739,7 +919,7 @@ export { default as Thumb } from './file-thumb.svelte';
739
919
  export function getName(file: File | string) {
740
920
  return typeof file === 'string' ? (file.split('/').pop() ?? '') : file.name;
741
921
  }
742
- `, et = `<script lang="ts">
922
+ `, mt = `<script lang="ts">
743
923
  import { cn } from '$lib/utils';
744
924
 
745
925
  let {
@@ -781,8 +961,8 @@ export function getName(file: File | string) {
781
961
  step="0.000001"
782
962
  />
783
963
  </div>
784
- `, nt = `export { default as GeopointInput } from './input.svelte';
785
- `, ot = `<script lang="ts">
964
+ `, ct = `export { default as GeopointInput } from './input.svelte';
965
+ `, ut = `<script lang="ts">
786
966
  import { setContext } from 'svelte';
787
967
  import ToggleMap from './toggle-map.svelte';
788
968
  import Coordinate from './coordinate.svelte';
@@ -848,7 +1028,7 @@ export function getName(file: File | string) {
848
1028
  {/await}
849
1029
  {/if}
850
1030
  </div>
851
- `, it = `<script>
1031
+ `, dt = `<script>
852
1032
  import { Button } from '$lib/components/ui/button';
853
1033
  import MapIcon from '@lucide/svelte/icons/map';
854
1034
  import { getContext } from 'svelte';
@@ -865,8 +1045,8 @@ export function getName(file: File | string) {
865
1045
  >
866
1046
  <MapIcon class="w-4 h-4" />
867
1047
  </Button>
868
- `, st = `export { default as Leaflet } from './leaflet.svelte';
869
- `, lt = `<script lang="ts">
1048
+ `, ft = `export { default as Leaflet } from './leaflet.svelte';
1049
+ `, gt = `<script lang="ts">
870
1050
  import { onMount } from 'svelte';
871
1051
  import L from 'leaflet';
872
1052
  import 'leaflet/dist/leaflet.css';
@@ -1001,7 +1181,7 @@ export function getName(file: File | string) {
1001
1181
  width: 100%;
1002
1182
  }
1003
1183
  </style>
1004
- `, rt = `<script lang="ts">
1184
+ `, vt = `<script lang="ts">
1005
1185
  import type { Snippet } from 'svelte';
1006
1186
  import { cn } from '$lib/utils';
1007
1187
 
@@ -1011,7 +1191,7 @@ export function getName(file: File | string) {
1011
1191
  <span class={cn('bg-secondary text-secondary-foreground px-2 py-1 rounded-sm text-sm', className)}>
1012
1192
  {@render children?.()}
1013
1193
  </span>
1014
- `, at = `<script lang="ts">
1194
+ `, bt = `<script lang="ts">
1015
1195
  import { Popover as PopoverPrimitive } from 'bits-ui';
1016
1196
  import * as Popover from '$lib/components/ui/popover';
1017
1197
 
@@ -1026,7 +1206,7 @@ export function getName(file: File | string) {
1026
1206
  <Popover.Content {...props}>
1027
1207
  {@render children?.()}
1028
1208
  </Popover.Content>
1029
- `, pt = `<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
1209
+ `, ht = `<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
1030
1210
  import * as FormPrimitive from 'formsnap';
1031
1211
  import type { FormPath } from 'sveltekit-superforms';
1032
1212
  import { cn, type WithElementRef, type WithoutChildren } from '$lib/utils';
@@ -1099,13 +1279,13 @@ export function getName(file: File | string) {
1099
1279
  {/snippet}
1100
1280
  </FormPrimitive.Field>
1101
1281
  </Popover.Root>
1102
- `, mt = `export { default as Field } from './field.svelte';
1282
+ `, _t = `export { default as Field } from './field.svelte';
1103
1283
  export { default as Trigger } from './trigger.svelte';
1104
1284
  export { default as Input } from './input.svelte';
1105
1285
  export { default as Content } from './content.svelte';
1106
1286
  export { default as Item } from './item.svelte';
1107
1287
  export { default as Chip } from './chip.svelte';
1108
- `, ct = `<script lang="ts" generics="T extends string">
1288
+ `, xt = `<script lang="ts" generics="T extends string">
1109
1289
  import type { SuperForm } from 'sveltekit-superforms';
1110
1290
  import { getContext, type Snippet } from 'svelte';
1111
1291
 
@@ -1139,7 +1319,7 @@ export { default as Chip } from './chip.svelte';
1139
1319
  {:else}
1140
1320
  {placeholder}
1141
1321
  {/if}
1142
- `, dt = `<script lang="ts">
1322
+ `, Ct = `<script lang="ts">
1143
1323
  import { getContext, type Snippet } from 'svelte';
1144
1324
  import { cn } from '$lib/utils';
1145
1325
  import { Command as CommandPrimitive } from 'bits-ui';
@@ -1178,7 +1358,7 @@ export { default as Chip } from './chip.svelte';
1178
1358
  {label}
1179
1359
  <CheckIcon class={cn('ml-auto', !isSelected(value) && 'text-transparent')} />
1180
1360
  </Command.Item>
1181
- `, ut = `<script lang="ts">
1361
+ `, wt = `<script lang="ts">
1182
1362
  import * as Popover from '$lib/components/ui/popover';
1183
1363
  import { Popover as PopoverPrimitive } from 'bits-ui';
1184
1364
  import { cn } from '$lib/utils';
@@ -1196,8 +1376,8 @@ export { default as Chip } from './chip.svelte';
1196
1376
  {@render children?.()}
1197
1377
  <ChevronDownIcon class="size-4 opacity-50" />
1198
1378
  </Popover.Trigger>
1199
- `, ft = `export { default as Pagination } from './pagination.svelte';
1200
- `, vt = `<script lang="ts">
1379
+ `, yt = `export { default as Pagination } from './pagination.svelte';
1380
+ `, Mt = `<script lang="ts">
1201
1381
  import * as Select from '$lib/components/ui/select';
1202
1382
  import { Button } from '$lib/components/ui/button';
1203
1383
  import ChevronsLeftIcon from '@lucide/svelte/icons/chevrons-left';
@@ -1281,8 +1461,8 @@ export { default as Chip } from './chip.svelte';
1281
1461
  </div>
1282
1462
  </div>
1283
1463
  </div>
1284
- `, gt = `export { default as RowActions } from './row-actions.svelte';
1285
- `, bt = `<script lang="ts">
1464
+ `, Tt = `export { default as RowActions } from './row-actions.svelte';
1465
+ `, $t = `<script lang="ts">
1286
1466
  import { goto } from '$app/navigation';
1287
1467
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
1288
1468
  import { Button } from '$lib/components/ui/button';
@@ -1318,7 +1498,7 @@ export { default as Chip } from './chip.svelte';
1318
1498
  </DropdownMenu.Item>
1319
1499
  </DropdownMenu.Content>
1320
1500
  </DropdownMenu.Root>
1321
- `, ht = {
1501
+ `, Pt = {
1322
1502
  "file-form": ["input", "form"],
1323
1503
  multiselect: ["command", "popover", "button", "badge"],
1324
1504
  geopoint: ["button", "leaflet"],
@@ -1327,8 +1507,9 @@ export { default as Chip } from './chip.svelte';
1327
1507
  "faceted-filter": ["command", "popover", "button", "separator", "badge"],
1328
1508
  pagination: ["button", "select"],
1329
1509
  "row-actions": ["dropdown-menu", "button"],
1330
- leaflet: []
1331
- }, _t = {
1510
+ leaflet: [],
1511
+ "auth-menu": ["dropdown-menu", "button"]
1512
+ }, Dt = {
1332
1513
  "file-form": [],
1333
1514
  multiselect: [],
1334
1515
  geopoint: [],
@@ -1339,203 +1520,212 @@ export { default as Chip } from './chip.svelte';
1339
1520
  "row-actions": [],
1340
1521
  leaflet: ["leaflet", "@types/leaflet"]
1341
1522
  }, x = /* @__PURE__ */ Object.assign({
1342
- "../ui/components/cells/autodate.svelte": M,
1343
- "../ui/components/cells/bool.svelte": D,
1344
- "../ui/components/cells/date.svelte": S,
1345
- "../ui/components/cells/editor.svelte": k,
1346
- "../ui/components/cells/email.svelte": F,
1347
- "../ui/components/cells/file.svelte": N,
1348
- "../ui/components/cells/geoPoint.svelte": A,
1349
- "../ui/components/cells/index.ts": H,
1350
- "../ui/components/cells/json.svelte": B,
1351
- "../ui/components/cells/number.svelte": j,
1352
- "../ui/components/cells/password.svelte": R,
1353
- "../ui/components/cells/relation.svelte": E,
1354
- "../ui/components/cells/select.svelte": U,
1355
- "../ui/components/cells/text.svelte": z,
1356
- "../ui/components/cells/url.svelte": V,
1357
- "../ui/components/column-header/column-header.svelte": O,
1358
- "../ui/components/column-header/index.ts": W,
1359
- "../ui/components/faceted-filter/faceted-filter.svelte": G,
1360
- "../ui/components/faceted-filter/index.ts": J,
1361
- "../ui/components/file-form/file-field.svelte": Z,
1362
- "../ui/components/file-form/file-input.svelte": q,
1363
- "../ui/components/file-form/file-multiple.svelte": Y,
1364
- "../ui/components/file-form/file-single.svelte": K,
1365
- "../ui/components/file-form/file-thumb.svelte": Q,
1366
- "../ui/components/file-form/index.ts": X,
1367
- "../ui/components/file-form/shared.ts": tt,
1368
- "../ui/components/geopoint/coordinate.svelte": et,
1369
- "../ui/components/geopoint/index.ts": nt,
1370
- "../ui/components/geopoint/input.svelte": ot,
1371
- "../ui/components/geopoint/toggle-map.svelte": it,
1372
- "../ui/components/leaflet/index.ts": st,
1373
- "../ui/components/leaflet/leaflet.svelte": lt,
1374
- "../ui/components/multiselect/chip.svelte": rt,
1375
- "../ui/components/multiselect/content.svelte": at,
1376
- "../ui/components/multiselect/field.svelte": pt,
1377
- "../ui/components/multiselect/index.ts": mt,
1378
- "../ui/components/multiselect/input.svelte": ct,
1379
- "../ui/components/multiselect/item.svelte": dt,
1380
- "../ui/components/multiselect/trigger.svelte": ut,
1381
- "../ui/components/pagination/index.ts": ft,
1382
- "../ui/components/pagination/pagination.svelte": vt,
1383
- "../ui/components/row-actions/index.ts": gt,
1384
- "../ui/components/row-actions/row-actions.svelte": bt
1523
+ "../ui/components/auth-menu/auth-menu-content.svelte": k,
1524
+ "../ui/components/auth-menu/auth-menu-group.svelte": L,
1525
+ "../ui/components/auth-menu/auth-menu-item.svelte": I,
1526
+ "../ui/components/auth-menu/auth-menu-label.svelte": N,
1527
+ "../ui/components/auth-menu/auth-menu-separator.svelte": S,
1528
+ "../ui/components/auth-menu/auth-menu-trigger.svelte": A,
1529
+ "../ui/components/auth-menu/auth-menu.svelte": E,
1530
+ "../ui/components/auth-menu/context.ts": F,
1531
+ "../ui/components/auth-menu/index.ts": H,
1532
+ "../ui/components/cells/autodate.svelte": U,
1533
+ "../ui/components/cells/bool.svelte": j,
1534
+ "../ui/components/cells/date.svelte": B,
1535
+ "../ui/components/cells/editor.svelte": R,
1536
+ "../ui/components/cells/email.svelte": O,
1537
+ "../ui/components/cells/file.svelte": z,
1538
+ "../ui/components/cells/geoPoint.svelte": V,
1539
+ "../ui/components/cells/index.ts": W,
1540
+ "../ui/components/cells/json.svelte": Y,
1541
+ "../ui/components/cells/number.svelte": K,
1542
+ "../ui/components/cells/password.svelte": X,
1543
+ "../ui/components/cells/relation.svelte": G,
1544
+ "../ui/components/cells/select.svelte": q,
1545
+ "../ui/components/cells/text.svelte": J,
1546
+ "../ui/components/cells/url.svelte": Z,
1547
+ "../ui/components/column-header/column-header.svelte": Q,
1548
+ "../ui/components/column-header/index.ts": tt,
1549
+ "../ui/components/faceted-filter/faceted-filter.svelte": nt,
1550
+ "../ui/components/faceted-filter/index.ts": et,
1551
+ "../ui/components/file-form/file-field.svelte": ot,
1552
+ "../ui/components/file-form/file-input.svelte": st,
1553
+ "../ui/components/file-form/file-multiple.svelte": it,
1554
+ "../ui/components/file-form/file-single.svelte": rt,
1555
+ "../ui/components/file-form/file-thumb.svelte": lt,
1556
+ "../ui/components/file-form/index.ts": at,
1557
+ "../ui/components/file-form/shared.ts": pt,
1558
+ "../ui/components/geopoint/coordinate.svelte": mt,
1559
+ "../ui/components/geopoint/index.ts": ct,
1560
+ "../ui/components/geopoint/input.svelte": ut,
1561
+ "../ui/components/geopoint/toggle-map.svelte": dt,
1562
+ "../ui/components/leaflet/index.ts": ft,
1563
+ "../ui/components/leaflet/leaflet.svelte": gt,
1564
+ "../ui/components/multiselect/chip.svelte": vt,
1565
+ "../ui/components/multiselect/content.svelte": bt,
1566
+ "../ui/components/multiselect/field.svelte": ht,
1567
+ "../ui/components/multiselect/index.ts": _t,
1568
+ "../ui/components/multiselect/input.svelte": xt,
1569
+ "../ui/components/multiselect/item.svelte": Ct,
1570
+ "../ui/components/multiselect/trigger.svelte": wt,
1571
+ "../ui/components/pagination/index.ts": yt,
1572
+ "../ui/components/pagination/pagination.svelte": Mt,
1573
+ "../ui/components/row-actions/index.ts": Tt,
1574
+ "../ui/components/row-actions/row-actions.svelte": $t
1385
1575
  });
1386
- function xt() {
1576
+ function kt() {
1387
1577
  return [
1388
1578
  ...new Set(
1389
- Object.keys(x).map(y)
1579
+ Object.keys(x).map(C)
1390
1580
  )
1391
1581
  ].filter(Boolean).sort();
1392
1582
  }
1393
- function y(t) {
1394
- const e = t.split("/"), n = e.indexOf("components");
1395
- return e[n + 1] ?? "";
1583
+ function C(t) {
1584
+ const n = t.split("/"), e = n.indexOf("components");
1585
+ return n[e + 1] ?? "";
1396
1586
  }
1397
- function yt(t) {
1398
- const e = t.split("/"), n = e.indexOf("components");
1399
- return e.slice(n + 2).join("/");
1587
+ function Lt(t) {
1588
+ const n = t.split("/"), e = n.indexOf("components");
1589
+ return n.slice(e + 2).join("/");
1400
1590
  }
1401
- function g(t, e) {
1402
- return r.isAbsolute(e) ? e : r.join(t, e);
1591
+ function v(t, n) {
1592
+ return l.isAbsolute(n) ? n : l.join(t, n);
1403
1593
  }
1404
- function h(t, e) {
1405
- f(r.dirname(t), { recursive: !0 }), _(t, e, "utf8");
1594
+ function h(t, n) {
1595
+ f(l.dirname(t), { recursive: !0 }), _(t, n, "utf8");
1406
1596
  }
1407
- function wt(t) {
1408
- v(t) && $(t, { force: !0, recursive: !0 });
1597
+ function It(t) {
1598
+ g(t) && M(t, { force: !0, recursive: !0 });
1409
1599
  }
1410
- async function Ct(t, e, n) {
1411
- var l;
1412
- const o = ((l = await T({ cwd: t })) == null ? void 0 : l.name) ?? "npm", s = L(o, e, n);
1413
- if (!s)
1600
+ async function Nt(t, n, e) {
1601
+ var r;
1602
+ const o = ((r = await $({ cwd: t })) == null ? void 0 : r.name) ?? "npm", i = P(o, n, e);
1603
+ if (!i)
1414
1604
  throw new Error(
1415
- `Unable to resolve ${e} command for ${o}`
1605
+ `Unable to resolve ${n} command for ${o}`
1416
1606
  );
1417
- const i = [...s.args];
1418
- o === "npm" && i.unshift("--yes"), await new Promise((c, p) => {
1419
- const d = I(s.command, i, {
1607
+ const s = [...i.args];
1608
+ o === "npm" && s.unshift("--yes"), await new Promise((c, p) => {
1609
+ const u = D(i.command, s, {
1420
1610
  cwd: t,
1421
1611
  stdio: "inherit"
1422
1612
  });
1423
- d.on("error", p), d.on("exit", (m) => {
1613
+ u.on("error", p), u.on("exit", (m) => {
1424
1614
  if (m === 0) {
1425
1615
  c();
1426
1616
  return;
1427
1617
  }
1428
1618
  p(
1429
- new Error(`${s.command} exited with code ${m ?? "unknown"}`)
1619
+ new Error(`${i.command} exited with code ${m ?? "unknown"}`)
1430
1620
  );
1431
1621
  });
1432
1622
  });
1433
1623
  }
1434
- async function w(t, e, n, o) {
1624
+ async function w(t, n, e, o) {
1435
1625
  if (o != null && o.executeCommand) {
1436
- await o.executeCommand(t, e, n);
1626
+ await o.executeCommand(t, n, e);
1437
1627
  return;
1438
1628
  }
1439
- await Ct(t, e, n);
1629
+ await Nt(t, n, e);
1440
1630
  }
1441
- function $t(t) {
1442
- const e = r.join(t, "package.json");
1443
- if (!v(e))
1631
+ function St(t) {
1632
+ const n = l.join(t, "package.json");
1633
+ if (!g(n))
1444
1634
  return /* @__PURE__ */ new Set();
1445
- const n = JSON.parse(P(e, "utf8"));
1635
+ const e = JSON.parse(T(n, "utf8"));
1446
1636
  return /* @__PURE__ */ new Set([
1447
- ...Object.keys(n.dependencies ?? {}),
1448
- ...Object.keys(n.devDependencies ?? {}),
1449
- ...Object.keys(n.optionalDependencies ?? {}),
1450
- ...Object.keys(n.peerDependencies ?? {})
1637
+ ...Object.keys(e.dependencies ?? {}),
1638
+ ...Object.keys(e.devDependencies ?? {}),
1639
+ ...Object.keys(e.optionalDependencies ?? {}),
1640
+ ...Object.keys(e.peerDependencies ?? {})
1451
1641
  ]);
1452
1642
  }
1453
- async function C(t, e, n) {
1454
- if (e.length === 0)
1643
+ async function y(t, n, e) {
1644
+ if (n.length === 0)
1455
1645
  return [];
1456
- const o = $t(t), s = [...new Set(e)].filter((i) => !o.has(i));
1457
- return s.length === 0 ? [] : (await w(t, "install", s, n), s);
1646
+ const o = St(t), i = [...new Set(n)].filter((s) => !o.has(s));
1647
+ return i.length === 0 ? [] : (await w(t, "install", i, e), i);
1458
1648
  }
1459
1649
  function b(t) {
1460
- return xt().includes(t);
1650
+ return kt().includes(t);
1461
1651
  }
1462
- function Pt(t) {
1652
+ function At(t) {
1463
1653
  return [
1464
1654
  ...new Set(
1465
- t.flatMap((e) => _t[e] ?? [])
1655
+ t.flatMap((n) => Dt[n] ?? [])
1466
1656
  )
1467
1657
  ];
1468
1658
  }
1469
- function Tt(t, e) {
1470
- const n = r.join(e, t);
1471
- f(n, { recursive: !0 });
1472
- for (const [o, s] of Object.entries(x)) {
1473
- if (y(o) !== t)
1659
+ function Et(t, n) {
1660
+ const e = l.join(n, t);
1661
+ f(e, { recursive: !0 });
1662
+ for (const [o, i] of Object.entries(x)) {
1663
+ if (C(o) !== t)
1474
1664
  continue;
1475
- const i = yt(o);
1476
- if (!i)
1665
+ const s = Lt(o);
1666
+ if (!s)
1477
1667
  continue;
1478
- const l = r.join(n, i);
1479
- f(r.dirname(l), { recursive: !0 }), _(l, s, "utf8");
1668
+ const r = l.join(e, s);
1669
+ f(l.dirname(r), { recursive: !0 }), _(r, i, "utf8");
1480
1670
  }
1481
1671
  }
1482
- async function Lt(t, e, n) {
1483
- if (e.length === 0)
1672
+ async function Ft(t, n, e) {
1673
+ if (n.length === 0)
1484
1674
  return { components: [], packages: [] };
1485
- const o = r.join(t, "src", "lib", "components", "ui");
1675
+ const o = l.join(t, "src", "lib", "components", "ui");
1486
1676
  f(o, { recursive: !0 });
1487
- const i = [...new Set(e)].filter(
1488
- (a) => !v(r.join(o, a))
1677
+ const s = [...new Set(n)].filter(
1678
+ (a) => !g(l.join(o, a))
1489
1679
  );
1490
- if (i.length === 0)
1680
+ if (s.length === 0)
1491
1681
  return { components: [], packages: [] };
1492
- const l = new Set(i.filter(b)), c = new Set(
1493
- i.filter((a) => !b(a))
1682
+ const r = new Set(s.filter(b)), c = new Set(
1683
+ s.filter((a) => !b(a))
1494
1684
  );
1495
- for (const a of [...l])
1496
- for (const u of ht[a] ?? [])
1497
- v(r.join(o, u)) || (b(u) ? l.add(u) : c.add(u));
1685
+ for (const a of [...r])
1686
+ for (const d of Pt[a] ?? [])
1687
+ g(l.join(o, d)) || (b(d) ? r.add(d) : c.add(d));
1498
1688
  const p = [];
1499
- for (const a of [...l].sort())
1500
- Tt(a, o), p.push(a), c.delete(a);
1501
- const d = await C(
1689
+ for (const a of [...r].sort())
1690
+ Et(a, o), p.push(a), c.delete(a);
1691
+ const u = await y(
1502
1692
  t,
1503
- Pt([...l]),
1504
- n
1693
+ At([...r]),
1694
+ e
1505
1695
  ), m = [...c].sort();
1506
1696
  return m.length > 0 && (await w(
1507
1697
  t,
1508
1698
  "execute",
1509
1699
  ["shadcn-svelte", "add", "--yes", "--overwrite", ...m],
1510
- n
1700
+ e
1511
1701
  ), p.push(...m)), {
1512
1702
  components: [...new Set(p)],
1513
- packages: d
1703
+ packages: u
1514
1704
  };
1515
1705
  }
1516
- async function Ft(t, e, n) {
1517
- for (const i of t.creates)
1518
- h(g(e.root, i.path), i.content);
1519
- for (const i of t.modifies)
1520
- h(g(e.root, i.path), i.content);
1521
- for (const i of t.deletes)
1522
- wt(g(e.root, i.path));
1523
- const o = await C(
1524
- e.root,
1706
+ async function Ot(t, n, e) {
1707
+ for (const s of t.creates)
1708
+ h(v(n.root, s.path), s.content);
1709
+ for (const s of t.modifies)
1710
+ h(v(n.root, s.path), s.content);
1711
+ for (const s of t.deletes)
1712
+ It(v(n.root, s.path));
1713
+ const o = await y(
1714
+ n.root,
1525
1715
  t.packages,
1526
- n
1527
- ), s = await Lt(
1528
- e.root,
1716
+ e
1717
+ ), i = await Ft(
1718
+ n.root,
1529
1719
  t.components,
1530
- n
1720
+ e
1531
1721
  );
1532
1722
  return {
1533
1723
  ...t,
1534
- components: s.components,
1535
- packages: [.../* @__PURE__ */ new Set([...o, ...s.packages])]
1724
+ components: i.components,
1725
+ packages: [.../* @__PURE__ */ new Set([...o, ...i.packages])]
1536
1726
  };
1537
1727
  }
1538
1728
  export {
1539
- Ft as writeResult
1729
+ Ot as writeResult
1540
1730
  };
1541
- //# sourceMappingURL=write-result-DG5OAbe1.js.map
1731
+ //# sourceMappingURL=write-result-CbUTMeAc.js.map