pika-ux 1.0.0-beta.9 → 1.0.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 (33) hide show
  1. package/dist/cli/template-files/pnpm-workspace.yaml +3 -3
  2. package/dist/cli/template-files/src/App.svelte +1 -1
  3. package/package.json +1 -1
  4. package/src/.DS_Store +0 -0
  5. package/src/App.svelte +2 -4
  6. package/src/pika/confirm-dialog/confirm-dialog.svelte +1 -1
  7. package/src/shadcn/dropdown-menu/dropdown-menu-group.svelte +2 -3
  8. package/src/shadcn/dropdown-menu/dropdown-menu-item.svelte +1 -1
  9. package/src/shadcn/dropdown-menu/dropdown-menu-label.svelte +1 -7
  10. package/src/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte +3 -13
  11. package/src/shadcn/dropdown-menu/dropdown-menu-radio-item.svelte +0 -1
  12. package/src/shadcn/dropdown-menu/dropdown-menu-separator.svelte +1 -7
  13. package/src/shadcn/dropdown-menu/dropdown-menu-shortcut.svelte +2 -13
  14. package/src/shadcn/dropdown-menu/dropdown-menu-sub-content.svelte +0 -1
  15. package/src/shadcn/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -2
  16. package/src/shadcn/dropdown-menu/dropdown-menu-trigger.svelte +2 -3
  17. package/src/shadcn/dropdown-menu/index.ts +44 -45
  18. package/src/shadcn/dropdown-menu copy/dropdown-menu-checkbox-item.svelte +41 -0
  19. package/src/shadcn/dropdown-menu copy/dropdown-menu-content.svelte +27 -0
  20. package/src/shadcn/dropdown-menu copy/dropdown-menu-group-heading.svelte +22 -0
  21. package/src/shadcn/dropdown-menu copy/dropdown-menu-group.svelte +7 -0
  22. package/src/shadcn/dropdown-menu copy/dropdown-menu-item.svelte +27 -0
  23. package/src/shadcn/dropdown-menu copy/dropdown-menu-label.svelte +24 -0
  24. package/src/shadcn/dropdown-menu copy/dropdown-menu-radio-group.svelte +16 -0
  25. package/src/shadcn/dropdown-menu copy/dropdown-menu-radio-item.svelte +26 -0
  26. package/src/shadcn/dropdown-menu copy/dropdown-menu-separator.svelte +13 -0
  27. package/src/shadcn/dropdown-menu copy/dropdown-menu-shortcut.svelte +20 -0
  28. package/src/shadcn/dropdown-menu copy/dropdown-menu-sub-content.svelte +16 -0
  29. package/src/shadcn/dropdown-menu copy/dropdown-menu-sub-trigger.svelte +29 -0
  30. package/src/shadcn/dropdown-menu copy/dropdown-menu-trigger.svelte +7 -0
  31. package/src/shadcn/spinner/index.ts +1 -0
  32. package/src/shadcn/spinner/spinner.svelte +9 -0
  33. /package/dist/cli/template-files/src/lib/{Counter.svelte → counter.svelte} +0 -0
@@ -1,8 +1,8 @@
1
1
  catalog:
2
2
  '@iconify-json/ci': ^1.2.2
3
- '@iconify-json/lucide': ^1.2.44
3
+ '@iconify-json/lucide': ^1.2.68
4
4
  '@internationalized/date': ^3.8.1
5
- '@lucide/svelte': ^0.482.0
5
+ '@lucide/svelte': ^0.544.0
6
6
  '@sveltejs/vite-plugin-svelte': ^6.2.0
7
7
  '@tailwindcss/typography': ^0.5.16
8
8
  '@tailwindcss/vite': ^4.1.13
@@ -17,5 +17,5 @@ catalog:
17
17
  tailwindcss: ^4.1.11
18
18
  tw-animate-css: ^1.4.0
19
19
  typescript: ^5.9.2
20
- unplugin-icons: ^22.3.0
20
+ unplugin-icons: ^22.4.1
21
21
  vite: ^7.1.7
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import './app.css';
3
- import Counter from './lib/Counter.svelte';
3
+ import Counter from './lib/counter.svelte';
4
4
  </script>
5
5
 
6
6
  <main class="flex flex-col items-center justify-center h-screen">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pika-ux",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./pika/*": "./src/pika/*",
package/src/.DS_Store CHANGED
Binary file
package/src/App.svelte CHANGED
@@ -1,13 +1,11 @@
1
1
  <script lang="ts">
2
2
  import './app.css';
3
3
  import Navigation from './lib/docsite/Navigation.svelte';
4
-
5
- // Page components
6
- import GettingStarted from './lib/docsite/pages/GettingStarted.svelte';
7
- import Icons from './lib/docsite/pages/Icons.svelte';
8
4
  import Colors from './lib/docsite/pages/Colors.svelte';
9
5
  import Components from './lib/docsite/pages/Components.svelte';
10
6
  import Button from './lib/docsite/pages/components/Button.svelte';
7
+ import GettingStarted from './lib/docsite/pages/GettingStarted.svelte';
8
+ import Icons from './lib/docsite/pages/Icons.svelte';
11
9
 
12
10
  // Simple routing state
13
11
  let currentPage = $state('getting-started');
@@ -37,7 +37,7 @@
37
37
  }
38
38
  }}
39
39
  >
40
- <Dialog.Content>
40
+ <Dialog.Content class="max-w-xl max-h-[80vh] overflow-hidden flex flex-col">
41
41
  <Dialog.Title>{title ?? 'Confirm'}</Dialog.Title>
42
42
  {confirmQuestion}
43
43
  <Dialog.Footer>
@@ -1,7 +1,6 @@
1
1
  <script lang="ts">
2
- import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
-
4
- let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
5
4
  </script>
6
5
 
7
6
  <DropdownMenuPrimitive.Group bind:ref data-slot="dropdown-menu-group" {...restProps} />
@@ -20,7 +20,7 @@
20
20
  data-inset={inset}
21
21
  data-variant={variant}
22
22
  class={cn(
23
- "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
23
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[variant=destructive]:data-[highlighted]:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
24
24
  className
25
25
  )}
26
26
  {...restProps}
@@ -13,12 +13,6 @@
13
13
  } = $props();
14
14
  </script>
15
15
 
16
- <div
17
- bind:this={ref}
18
- data-slot="dropdown-menu-label"
19
- data-inset={inset}
20
- class={cn('px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8', className)}
21
- {...restProps}
22
- >
16
+ <div bind:this={ref} data-slot="dropdown-menu-label" data-inset={inset} class={cn('px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8', className)} {...restProps}>
23
17
  {@render children?.()}
24
18
  </div>
@@ -1,16 +1,6 @@
1
1
  <script lang="ts">
2
- import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
-
4
- let {
5
- ref = $bindable(null),
6
- value = $bindable(),
7
- ...restProps
8
- }: DropdownMenuPrimitive.RadioGroupProps = $props();
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ let { ref = $bindable(null), value = $bindable(), ...restProps }: DropdownMenuPrimitive.RadioGroupProps = $props();
9
4
  </script>
10
5
 
11
- <DropdownMenuPrimitive.RadioGroup
12
- bind:ref
13
- bind:value
14
- data-slot="dropdown-menu-radio-group"
15
- {...restProps}
16
- />
6
+ <DropdownMenuPrimitive.RadioGroup bind:ref bind:value data-slot="dropdown-menu-radio-group" {...restProps} />
@@ -2,7 +2,6 @@
2
2
  import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
3
  import CircleIcon from '$icons/lucide/circle';
4
4
  import { cn, type WithoutChild } from '../utils.js';
5
-
6
5
  let { ref = $bindable(null), class: className, children: childrenProp, ...restProps }: WithoutChild<DropdownMenuPrimitive.RadioItemProps> = $props();
7
6
  </script>
8
7
 
@@ -1,13 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
3
  import { cn } from '../utils.js';
4
-
5
4
  let { ref = $bindable(null), class: className, ...restProps }: DropdownMenuPrimitive.SeparatorProps = $props();
6
5
  </script>
7
6
 
8
- <DropdownMenuPrimitive.Separator
9
- bind:ref
10
- data-slot="dropdown-menu-separator"
11
- class={cn('bg-border -mx-1 my-1 h-px', className)}
12
- {...restProps}
13
- />
7
+ <DropdownMenuPrimitive.Separator bind:ref data-slot="dropdown-menu-separator" class={cn('bg-border -mx-1 my-1 h-px', className)} {...restProps} />
@@ -1,20 +1,9 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
3
  import { cn, type WithElementRef } from '../utils.js';
4
-
5
- let {
6
- ref = $bindable(null),
7
- class: className,
8
- children,
9
- ...restProps
10
- }: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
4
+ let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
11
5
  </script>
12
6
 
13
- <span
14
- bind:this={ref}
15
- data-slot="dropdown-menu-shortcut"
16
- class={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
17
- {...restProps}
18
- >
7
+ <span bind:this={ref} data-slot="dropdown-menu-shortcut" class={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} {...restProps}>
19
8
  {@render children?.()}
20
9
  </span>
@@ -1,7 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
3
  import { cn } from '../utils.js';
4
-
5
4
  let { ref = $bindable(null), class: className, ...restProps }: DropdownMenuPrimitive.SubContentProps = $props();
6
5
  </script>
7
6
 
@@ -2,7 +2,6 @@
2
2
  import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
3
  import ChevronRightIcon from '$icons/lucide/chevron-right';
4
4
  import { cn } from '../utils.js';
5
-
6
5
  let {
7
6
  ref = $bindable(null),
8
7
  class: className,
@@ -19,7 +18,7 @@
19
18
  data-slot="dropdown-menu-sub-trigger"
20
19
  data-inset={inset}
21
20
  class={cn(
22
- "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
21
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
23
22
  className
24
23
  )}
25
24
  {...restProps}
@@ -1,7 +1,6 @@
1
1
  <script lang="ts">
2
- import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
-
4
- let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.TriggerProps = $props();
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.TriggerProps = $props();
5
4
  </script>
6
5
 
7
6
  <DropdownMenuPrimitive.Trigger bind:ref data-slot="dropdown-menu-trigger" {...restProps} />
@@ -1,49 +1,48 @@
1
- import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
2
- import CheckboxItem from "./dropdown-menu-checkbox-item.svelte";
3
- import Content from "./dropdown-menu-content.svelte";
4
- import Group from "./dropdown-menu-group.svelte";
5
- import Item from "./dropdown-menu-item.svelte";
6
- import Label from "./dropdown-menu-label.svelte";
7
- import RadioGroup from "./dropdown-menu-radio-group.svelte";
8
- import RadioItem from "./dropdown-menu-radio-item.svelte";
9
- import Separator from "./dropdown-menu-separator.svelte";
10
- import Shortcut from "./dropdown-menu-shortcut.svelte";
11
- import Trigger from "./dropdown-menu-trigger.svelte";
12
- import SubContent from "./dropdown-menu-sub-content.svelte";
13
- import SubTrigger from "./dropdown-menu-sub-trigger.svelte";
14
- import GroupHeading from "./dropdown-menu-group-heading.svelte";
1
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
2
+ import CheckboxItem from './dropdown-menu-checkbox-item.svelte';
3
+ import Content from './dropdown-menu-content.svelte';
4
+ import Group from './dropdown-menu-group.svelte';
5
+ import Item from './dropdown-menu-item.svelte';
6
+ import Label from './dropdown-menu-label.svelte';
7
+ import RadioGroup from './dropdown-menu-radio-group.svelte';
8
+ import RadioItem from './dropdown-menu-radio-item.svelte';
9
+ import Separator from './dropdown-menu-separator.svelte';
10
+ import Shortcut from './dropdown-menu-shortcut.svelte';
11
+ import Trigger from './dropdown-menu-trigger.svelte';
12
+ import SubContent from './dropdown-menu-sub-content.svelte';
13
+ import SubTrigger from './dropdown-menu-sub-trigger.svelte';
14
+ import GroupHeading from './dropdown-menu-group-heading.svelte';
15
15
  const Sub = DropdownMenuPrimitive.Sub;
16
16
  const Root = DropdownMenuPrimitive.Root;
17
-
18
17
  export {
19
- CheckboxItem,
20
- Content,
21
- Root as DropdownMenu,
22
- CheckboxItem as DropdownMenuCheckboxItem,
23
- Content as DropdownMenuContent,
24
- Group as DropdownMenuGroup,
25
- Item as DropdownMenuItem,
26
- Label as DropdownMenuLabel,
27
- RadioGroup as DropdownMenuRadioGroup,
28
- RadioItem as DropdownMenuRadioItem,
29
- Separator as DropdownMenuSeparator,
30
- Shortcut as DropdownMenuShortcut,
31
- Sub as DropdownMenuSub,
32
- SubContent as DropdownMenuSubContent,
33
- SubTrigger as DropdownMenuSubTrigger,
34
- Trigger as DropdownMenuTrigger,
35
- GroupHeading as DropdownMenuGroupHeading,
36
- Group,
37
- GroupHeading,
38
- Item,
39
- Label,
40
- RadioGroup,
41
- RadioItem,
42
- Root,
43
- Separator,
44
- Shortcut,
45
- Sub,
46
- SubContent,
47
- SubTrigger,
48
- Trigger,
18
+ CheckboxItem,
19
+ Content,
20
+ Root as DropdownMenu,
21
+ CheckboxItem as DropdownMenuCheckboxItem,
22
+ Content as DropdownMenuContent,
23
+ Group as DropdownMenuGroup,
24
+ Item as DropdownMenuItem,
25
+ Label as DropdownMenuLabel,
26
+ RadioGroup as DropdownMenuRadioGroup,
27
+ RadioItem as DropdownMenuRadioItem,
28
+ Separator as DropdownMenuSeparator,
29
+ Shortcut as DropdownMenuShortcut,
30
+ Sub as DropdownMenuSub,
31
+ SubContent as DropdownMenuSubContent,
32
+ SubTrigger as DropdownMenuSubTrigger,
33
+ Trigger as DropdownMenuTrigger,
34
+ GroupHeading as DropdownMenuGroupHeading,
35
+ Group,
36
+ GroupHeading,
37
+ Item,
38
+ Label,
39
+ RadioGroup,
40
+ RadioItem,
41
+ Root,
42
+ Separator,
43
+ Shortcut,
44
+ Sub,
45
+ SubContent,
46
+ SubTrigger,
47
+ Trigger
49
48
  };
@@ -0,0 +1,41 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import CheckIcon from '$icons/lucide/check';
4
+ import MinusIcon from '$icons/lucide/minus';
5
+ import { cn, type WithoutChildrenOrChild } from '../utils.js';
6
+ import type { Snippet } from 'svelte';
7
+
8
+ let {
9
+ ref = $bindable(null),
10
+ checked = $bindable(false),
11
+ indeterminate = $bindable(false),
12
+ class: className,
13
+ children: childrenProp,
14
+ ...restProps
15
+ }: WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
16
+ children?: Snippet;
17
+ } = $props();
18
+ </script>
19
+
20
+ <DropdownMenuPrimitive.CheckboxItem
21
+ bind:ref
22
+ bind:checked
23
+ bind:indeterminate
24
+ data-slot="dropdown-menu-checkbox-item"
25
+ class={cn(
26
+ "focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
27
+ className
28
+ )}
29
+ {...restProps}
30
+ >
31
+ {#snippet children({ checked, indeterminate })}
32
+ <span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
33
+ {#if indeterminate}
34
+ <MinusIcon class="size-4" />
35
+ {:else}
36
+ <CheckIcon class={cn('size-4', !checked && 'text-transparent')} />
37
+ {/if}
38
+ </span>
39
+ {@render childrenProp?.()}
40
+ {/snippet}
41
+ </DropdownMenuPrimitive.CheckboxItem>
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import { cn } from '../utils.js';
3
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ sideOffset = 4,
8
+ portalProps,
9
+ class: className,
10
+ ...restProps
11
+ }: DropdownMenuPrimitive.ContentProps & {
12
+ portalProps?: DropdownMenuPrimitive.PortalProps;
13
+ } = $props();
14
+ </script>
15
+
16
+ <DropdownMenuPrimitive.Portal {...portalProps}>
17
+ <DropdownMenuPrimitive.Content
18
+ bind:ref
19
+ data-slot="dropdown-menu-content"
20
+ {sideOffset}
21
+ class={cn(
22
+ 'bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--bits-dropdown-menu-content-available-height) origin-(--bits-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md outline-none',
23
+ className
24
+ )}
25
+ {...restProps}
26
+ />
27
+ </DropdownMenuPrimitive.Portal>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+ import type { ComponentProps } from 'svelte';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ inset,
10
+ ...restProps
11
+ }: ComponentProps<typeof DropdownMenuPrimitive.GroupHeading> & {
12
+ inset?: boolean;
13
+ } = $props();
14
+ </script>
15
+
16
+ <DropdownMenuPrimitive.GroupHeading
17
+ bind:ref
18
+ data-slot="dropdown-menu-group-heading"
19
+ data-inset={inset}
20
+ class={cn('px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8', className)}
21
+ {...restProps}
22
+ />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+
4
+ let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
5
+ </script>
6
+
7
+ <DropdownMenuPrimitive.Group bind:ref data-slot="dropdown-menu-group" {...restProps} />
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import { cn } from '../utils.js';
3
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ inset,
9
+ variant = 'default',
10
+ ...restProps
11
+ }: DropdownMenuPrimitive.ItemProps & {
12
+ inset?: boolean;
13
+ variant?: 'default' | 'destructive';
14
+ } = $props();
15
+ </script>
16
+
17
+ <DropdownMenuPrimitive.Item
18
+ bind:ref
19
+ data-slot="dropdown-menu-item"
20
+ data-inset={inset}
21
+ data-variant={variant}
22
+ class={cn(
23
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
24
+ className
25
+ )}
26
+ {...restProps}
27
+ />
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ inset,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
12
+ inset?: boolean;
13
+ } = $props();
14
+ </script>
15
+
16
+ <div
17
+ bind:this={ref}
18
+ data-slot="dropdown-menu-label"
19
+ data-inset={inset}
20
+ class={cn('px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8', className)}
21
+ {...restProps}
22
+ >
23
+ {@render children?.()}
24
+ </div>
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+
4
+ let {
5
+ ref = $bindable(null),
6
+ value = $bindable(),
7
+ ...restProps
8
+ }: DropdownMenuPrimitive.RadioGroupProps = $props();
9
+ </script>
10
+
11
+ <DropdownMenuPrimitive.RadioGroup
12
+ bind:ref
13
+ bind:value
14
+ data-slot="dropdown-menu-radio-group"
15
+ {...restProps}
16
+ />
@@ -0,0 +1,26 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import CircleIcon from '$icons/lucide/circle';
4
+ import { cn, type WithoutChild } from '../utils.js';
5
+
6
+ let { ref = $bindable(null), class: className, children: childrenProp, ...restProps }: WithoutChild<DropdownMenuPrimitive.RadioItemProps> = $props();
7
+ </script>
8
+
9
+ <DropdownMenuPrimitive.RadioItem
10
+ bind:ref
11
+ data-slot="dropdown-menu-radio-item"
12
+ class={cn(
13
+ "focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
14
+ className
15
+ )}
16
+ {...restProps}
17
+ >
18
+ {#snippet children({ checked })}
19
+ <span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
20
+ {#if checked}
21
+ <CircleIcon class="size-2 fill-current" />
22
+ {/if}
23
+ </span>
24
+ {@render childrenProp?.({ checked })}
25
+ {/snippet}
26
+ </DropdownMenuPrimitive.RadioItem>
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let { ref = $bindable(null), class: className, ...restProps }: DropdownMenuPrimitive.SeparatorProps = $props();
6
+ </script>
7
+
8
+ <DropdownMenuPrimitive.Separator
9
+ bind:ref
10
+ data-slot="dropdown-menu-separator"
11
+ class={cn('bg-border -mx-1 my-1 h-px', className)}
12
+ {...restProps}
13
+ />
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="dropdown-menu-shortcut"
16
+ class={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </span>
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '../utils.js';
4
+
5
+ let { ref = $bindable(null), class: className, ...restProps }: DropdownMenuPrimitive.SubContentProps = $props();
6
+ </script>
7
+
8
+ <DropdownMenuPrimitive.SubContent
9
+ bind:ref
10
+ data-slot="dropdown-menu-sub-content"
11
+ class={cn(
12
+ 'bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--bits-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg',
13
+ className
14
+ )}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import ChevronRightIcon from '$icons/lucide/chevron-right';
4
+ import { cn } from '../utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ inset,
10
+ children,
11
+ ...restProps
12
+ }: DropdownMenuPrimitive.SubTriggerProps & {
13
+ inset?: boolean;
14
+ } = $props();
15
+ </script>
16
+
17
+ <DropdownMenuPrimitive.SubTrigger
18
+ bind:ref
19
+ data-slot="dropdown-menu-sub-trigger"
20
+ data-inset={inset}
21
+ class={cn(
22
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
23
+ className
24
+ )}
25
+ {...restProps}
26
+ >
27
+ {@render children?.()}
28
+ <ChevronRightIcon class="ml-auto size-4" />
29
+ </DropdownMenuPrimitive.SubTrigger>
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+
4
+ let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <DropdownMenuPrimitive.Trigger bind:ref data-slot="dropdown-menu-trigger" {...restProps} />
@@ -0,0 +1 @@
1
+ export { default as Spinner } from './spinner.svelte';
@@ -0,0 +1,9 @@
1
+ <script lang="ts">
2
+ import { cn } from '../utils.js';
3
+ import Loader2Icon from '$icons/lucide/loader-circle';
4
+ import type { ComponentProps } from 'svelte';
5
+ type Props = ComponentProps<typeof Loader2Icon>;
6
+ let { class: className, ...restProps }: Props = $props();
7
+ </script>
8
+
9
+ <Loader2Icon role="status" aria-label="Loading" class={cn('size-4 animate-spin', className)} {...restProps} />