@nucel/ui 0.1.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.
- package/README.md +235 -0
- package/package.json +88 -0
- package/src/lib/components/ui/Backdrop.svelte +19 -0
- package/src/lib/components/ui/CountBadge.svelte +40 -0
- package/src/lib/components/ui/EmptyState.svelte +68 -0
- package/src/lib/components/ui/KbdShortcut.svelte +20 -0
- package/src/lib/components/ui/MarkdownRenderer.svelte +85 -0
- package/src/lib/components/ui/ProgressRing.svelte +61 -0
- package/src/lib/components/ui/ProviderIcon.svelte +57 -0
- package/src/lib/components/ui/ReviewBadge.svelte +54 -0
- package/src/lib/components/ui/Sparkline.svelte +61 -0
- package/src/lib/components/ui/StatusBadge.svelte +32 -0
- package/src/lib/components/ui/StatusDot.svelte +65 -0
- package/src/lib/components/ui/TabBar.svelte +127 -0
- package/src/lib/components/ui/VerticalSeparator.svelte +9 -0
- package/src/lib/components/ui/accordion/accordion-content.svelte +22 -0
- package/src/lib/components/ui/accordion/accordion-item.svelte +17 -0
- package/src/lib/components/ui/accordion/accordion-trigger.svelte +32 -0
- package/src/lib/components/ui/accordion/accordion.svelte +16 -0
- package/src/lib/components/ui/accordion/index.ts +16 -0
- package/src/lib/components/ui/avatar/avatar-fallback.svelte +17 -0
- package/src/lib/components/ui/avatar/avatar-image.svelte +17 -0
- package/src/lib/components/ui/avatar/avatar.svelte +19 -0
- package/src/lib/components/ui/avatar/index.ts +13 -0
- package/src/lib/components/ui/badge/badge.svelte +49 -0
- package/src/lib/components/ui/badge/index.ts +2 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +20 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +31 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +27 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +21 -0
- package/src/lib/components/ui/breadcrumb/index.ts +25 -0
- package/src/lib/components/ui/button/button.svelte +82 -0
- package/src/lib/components/ui/button/index.ts +17 -0
- package/src/lib/components/ui/card/card-action.svelte +20 -0
- package/src/lib/components/ui/card/card-content.svelte +15 -0
- package/src/lib/components/ui/card/card-description.svelte +20 -0
- package/src/lib/components/ui/card/card-footer.svelte +20 -0
- package/src/lib/components/ui/card/card-header.svelte +23 -0
- package/src/lib/components/ui/card/card-title.svelte +20 -0
- package/src/lib/components/ui/card/card.svelte +23 -0
- package/src/lib/components/ui/card/index.ts +25 -0
- package/src/lib/components/ui/collapsible/collapsible-content.svelte +7 -0
- package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +7 -0
- package/src/lib/components/ui/collapsible/collapsible.svelte +11 -0
- package/src/lib/components/ui/collapsible/index.ts +13 -0
- package/src/lib/components/ui/dialog/dialog-close.svelte +7 -0
- package/src/lib/components/ui/dialog/dialog-content.svelte +45 -0
- package/src/lib/components/ui/dialog/dialog-description.svelte +17 -0
- package/src/lib/components/ui/dialog/dialog-footer.svelte +20 -0
- package/src/lib/components/ui/dialog/dialog-header.svelte +20 -0
- package/src/lib/components/ui/dialog/dialog-overlay.svelte +20 -0
- package/src/lib/components/ui/dialog/dialog-portal.svelte +7 -0
- package/src/lib/components/ui/dialog/dialog-title.svelte +17 -0
- package/src/lib/components/ui/dialog/dialog-trigger.svelte +7 -0
- package/src/lib/components/ui/dialog/dialog.svelte +7 -0
- package/src/lib/components/ui/dialog/index.ts +34 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +41 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +29 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +31 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/index.ts +54 -0
- package/src/lib/components/ui/input/index.ts +7 -0
- package/src/lib/components/ui/input/input.svelte +52 -0
- package/src/lib/components/ui/label/index.ts +7 -0
- package/src/lib/components/ui/label/label.svelte +20 -0
- package/src/lib/components/ui/navigation-menu/index.ts +28 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu-content.svelte +21 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu-indicator.svelte +22 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu-item.svelte +17 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu-link.svelte +20 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu-list.svelte +17 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu-trigger.svelte +34 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu-viewport.svelte +22 -0
- package/src/lib/components/ui/navigation-menu/navigation-menu.svelte +32 -0
- package/src/lib/components/ui/progress/index.ts +1 -0
- package/src/lib/components/ui/progress/progress.svelte +33 -0
- package/src/lib/components/ui/scroll-area/index.ts +10 -0
- package/src/lib/components/ui/scroll-area/scroll-area-scrollbar.svelte +31 -0
- package/src/lib/components/ui/scroll-area/scroll-area.svelte +43 -0
- package/src/lib/components/ui/select/index.ts +37 -0
- package/src/lib/components/ui/select/select-content.svelte +45 -0
- package/src/lib/components/ui/select/select-group-heading.svelte +21 -0
- package/src/lib/components/ui/select/select-group.svelte +7 -0
- package/src/lib/components/ui/select/select-item.svelte +38 -0
- package/src/lib/components/ui/select/select-label.svelte +20 -0
- package/src/lib/components/ui/select/select-portal.svelte +7 -0
- package/src/lib/components/ui/select/select-scroll-down-button.svelte +20 -0
- package/src/lib/components/ui/select/select-scroll-up-button.svelte +20 -0
- package/src/lib/components/ui/select/select-separator.svelte +18 -0
- package/src/lib/components/ui/select/select-trigger.svelte +29 -0
- package/src/lib/components/ui/select/select.svelte +11 -0
- package/src/lib/components/ui/separator/index.ts +7 -0
- package/src/lib/components/ui/separator/separator.svelte +21 -0
- package/src/lib/components/ui/sheet/index.ts +34 -0
- package/src/lib/components/ui/sheet/sheet-close.svelte +7 -0
- package/src/lib/components/ui/sheet/sheet-content.svelte +62 -0
- package/src/lib/components/ui/sheet/sheet-description.svelte +17 -0
- package/src/lib/components/ui/sheet/sheet-footer.svelte +20 -0
- package/src/lib/components/ui/sheet/sheet-header.svelte +20 -0
- package/src/lib/components/ui/sheet/sheet-overlay.svelte +20 -0
- package/src/lib/components/ui/sheet/sheet-portal.svelte +7 -0
- package/src/lib/components/ui/sheet/sheet-title.svelte +17 -0
- package/src/lib/components/ui/sheet/sheet-trigger.svelte +7 -0
- package/src/lib/components/ui/sheet/sheet.svelte +7 -0
- package/src/lib/components/ui/skeleton/index.ts +1 -0
- package/src/lib/components/ui/skeleton/skeleton.svelte +17 -0
- package/src/lib/components/ui/sonner/index.ts +1 -0
- package/src/lib/components/ui/sonner/sonner.svelte +10 -0
- package/src/lib/components/ui/tabs/index.ts +16 -0
- package/src/lib/components/ui/tabs/tabs-content.svelte +17 -0
- package/src/lib/components/ui/tabs/tabs-list.svelte +16 -0
- package/src/lib/components/ui/tabs/tabs-trigger.svelte +20 -0
- package/src/lib/components/ui/tabs/tabs.svelte +19 -0
- package/src/lib/components/ui/textarea/index.ts +7 -0
- package/src/lib/components/ui/textarea/textarea.svelte +23 -0
- package/src/lib/components/ui/toggle/index.ts +13 -0
- package/src/lib/components/ui/toggle/toggle.svelte +52 -0
- package/src/lib/components/ui/toggle-group/index.ts +10 -0
- package/src/lib/components/ui/toggle-group/toggle-group-item.svelte +35 -0
- package/src/lib/components/ui/toggle-group/toggle-group.svelte +65 -0
- package/src/lib/components/ui/tooltip/index.ts +19 -0
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +52 -0
- package/src/lib/components/ui/tooltip/tooltip-portal.svelte +7 -0
- package/src/lib/components/ui/tooltip/tooltip-provider.svelte +7 -0
- package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +7 -0
- package/src/lib/components/ui/tooltip/tooltip.svelte +7 -0
- package/src/lib/index.ts +244 -0
- package/src/lib/utils/cn.test.ts +993 -0
- package/src/lib/utils/cn.ts +6 -0
- package/src/lib/utils.ts +12 -0
- package/src/styles.css +127 -0
|
@@ -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.CheckboxGroupProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.CheckboxGroup
|
|
12
|
+
bind:ref
|
|
13
|
+
bind:value
|
|
14
|
+
data-slot="dropdown-menu-checkbox-group"
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
4
|
+
import MinusIcon from '@lucide/svelte/icons/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 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
>
|
|
31
|
+
{#snippet children({ checked, indeterminate })}
|
|
32
|
+
<span class="pointer-events-none absolute start-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,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
3
|
+
import DropdownMenuPortal from './dropdown-menu-portal.svelte';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
5
|
+
import type { ComponentProps } from 'svelte';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
sideOffset = 4,
|
|
10
|
+
portalProps,
|
|
11
|
+
class: className,
|
|
12
|
+
...restProps
|
|
13
|
+
}: DropdownMenuPrimitive.ContentProps & {
|
|
14
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DropdownMenuPortal>>;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<DropdownMenuPortal {...portalProps}>
|
|
19
|
+
<DropdownMenuPrimitive.Content
|
|
20
|
+
bind:ref
|
|
21
|
+
data-slot="dropdown-menu-content"
|
|
22
|
+
{sideOffset}
|
|
23
|
+
class={cn(
|
|
24
|
+
'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-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none',
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
{...restProps}
|
|
28
|
+
/>
|
|
29
|
+
</DropdownMenuPortal>
|
|
@@ -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]:ps-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 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
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]:ps-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,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import CircleIcon from '@lucide/svelte/icons/circle';
|
|
4
|
+
import { cn, type WithoutChild } from '../../../utils.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children: childrenProp,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithoutChild<DropdownMenuPrimitive.RadioItemProps> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<DropdownMenuPrimitive.RadioItem
|
|
15
|
+
bind:ref
|
|
16
|
+
data-slot="dropdown-menu-radio-item"
|
|
17
|
+
class={cn(
|
|
18
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
>
|
|
23
|
+
{#snippet children({ checked })}
|
|
24
|
+
<span class="pointer-events-none absolute start-2 flex size-3.5 items-center justify-center">
|
|
25
|
+
{#if checked}
|
|
26
|
+
<CircleIcon class="size-2 fill-current" />
|
|
27
|
+
{/if}
|
|
28
|
+
</span>
|
|
29
|
+
{@render childrenProp?.({ checked })}
|
|
30
|
+
{/snippet}
|
|
31
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DropdownMenuPrimitive.SeparatorProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DropdownMenuPrimitive.Separator
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dropdown-menu-separator"
|
|
15
|
+
class={cn('bg-border -mx-1 my-1 h-px', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -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 ms-auto text-xs tracking-widest', className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</span>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DropdownMenuPrimitive.SubContentProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DropdownMenuPrimitive.SubContent
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dropdown-menu-sub-content"
|
|
15
|
+
class={cn(
|
|
16
|
+
'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-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import ChevronRightIcon from '@lucide/svelte/icons/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 [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
<ChevronRightIcon class="ms-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,54 @@
|
|
|
1
|
+
import Root from './dropdown-menu.svelte';
|
|
2
|
+
import Sub from './dropdown-menu-sub.svelte';
|
|
3
|
+
import CheckboxGroup from './dropdown-menu-checkbox-group.svelte';
|
|
4
|
+
import CheckboxItem from './dropdown-menu-checkbox-item.svelte';
|
|
5
|
+
import Content from './dropdown-menu-content.svelte';
|
|
6
|
+
import Group from './dropdown-menu-group.svelte';
|
|
7
|
+
import Item from './dropdown-menu-item.svelte';
|
|
8
|
+
import Label from './dropdown-menu-label.svelte';
|
|
9
|
+
import RadioGroup from './dropdown-menu-radio-group.svelte';
|
|
10
|
+
import RadioItem from './dropdown-menu-radio-item.svelte';
|
|
11
|
+
import Separator from './dropdown-menu-separator.svelte';
|
|
12
|
+
import Shortcut from './dropdown-menu-shortcut.svelte';
|
|
13
|
+
import Trigger from './dropdown-menu-trigger.svelte';
|
|
14
|
+
import SubContent from './dropdown-menu-sub-content.svelte';
|
|
15
|
+
import SubTrigger from './dropdown-menu-sub-trigger.svelte';
|
|
16
|
+
import GroupHeading from './dropdown-menu-group-heading.svelte';
|
|
17
|
+
import Portal from './dropdown-menu-portal.svelte';
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
CheckboxGroup,
|
|
21
|
+
CheckboxItem,
|
|
22
|
+
Content,
|
|
23
|
+
Portal,
|
|
24
|
+
Root as DropdownMenu,
|
|
25
|
+
CheckboxGroup as DropdownMenuCheckboxGroup,
|
|
26
|
+
CheckboxItem as DropdownMenuCheckboxItem,
|
|
27
|
+
Content as DropdownMenuContent,
|
|
28
|
+
Portal as DropdownMenuPortal,
|
|
29
|
+
Group as DropdownMenuGroup,
|
|
30
|
+
Item as DropdownMenuItem,
|
|
31
|
+
Label as DropdownMenuLabel,
|
|
32
|
+
RadioGroup as DropdownMenuRadioGroup,
|
|
33
|
+
RadioItem as DropdownMenuRadioItem,
|
|
34
|
+
Separator as DropdownMenuSeparator,
|
|
35
|
+
Shortcut as DropdownMenuShortcut,
|
|
36
|
+
Sub as DropdownMenuSub,
|
|
37
|
+
SubContent as DropdownMenuSubContent,
|
|
38
|
+
SubTrigger as DropdownMenuSubTrigger,
|
|
39
|
+
Trigger as DropdownMenuTrigger,
|
|
40
|
+
GroupHeading as DropdownMenuGroupHeading,
|
|
41
|
+
Group,
|
|
42
|
+
GroupHeading,
|
|
43
|
+
Item,
|
|
44
|
+
Label,
|
|
45
|
+
RadioGroup,
|
|
46
|
+
RadioItem,
|
|
47
|
+
Root,
|
|
48
|
+
Separator,
|
|
49
|
+
Shortcut,
|
|
50
|
+
Sub,
|
|
51
|
+
SubContent,
|
|
52
|
+
SubTrigger,
|
|
53
|
+
Trigger,
|
|
54
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLInputAttributes, HTMLInputTypeAttribute } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
type InputType = Exclude<HTMLInputTypeAttribute, 'file'>;
|
|
6
|
+
|
|
7
|
+
type Props = WithElementRef<
|
|
8
|
+
Omit<HTMLInputAttributes, 'type'> &
|
|
9
|
+
({ type: 'file'; files?: FileList } | { type?: InputType; files?: undefined })
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
ref = $bindable(null),
|
|
14
|
+
value = $bindable(),
|
|
15
|
+
type,
|
|
16
|
+
files = $bindable(),
|
|
17
|
+
class: className,
|
|
18
|
+
'data-slot': dataSlot = 'input',
|
|
19
|
+
...restProps
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
{#if type === 'file'}
|
|
24
|
+
<input
|
|
25
|
+
bind:this={ref}
|
|
26
|
+
data-slot={dataSlot}
|
|
27
|
+
class={cn(
|
|
28
|
+
'selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
29
|
+
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
|
30
|
+
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
type="file"
|
|
34
|
+
bind:files
|
|
35
|
+
bind:value
|
|
36
|
+
{...restProps}
|
|
37
|
+
/>
|
|
38
|
+
{:else}
|
|
39
|
+
<input
|
|
40
|
+
bind:this={ref}
|
|
41
|
+
data-slot={dataSlot}
|
|
42
|
+
class={cn(
|
|
43
|
+
'border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
44
|
+
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
|
45
|
+
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{type}
|
|
49
|
+
bind:value
|
|
50
|
+
{...restProps}
|
|
51
|
+
/>
|
|
52
|
+
{/if}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Label as LabelPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: LabelPrimitive.RootProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<LabelPrimitive.Root
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="label"
|
|
15
|
+
class={cn(
|
|
16
|
+
'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Root from './navigation-menu.svelte';
|
|
2
|
+
import Content from './navigation-menu-content.svelte';
|
|
3
|
+
import Indicator from './navigation-menu-indicator.svelte';
|
|
4
|
+
import Item from './navigation-menu-item.svelte';
|
|
5
|
+
import Link from './navigation-menu-link.svelte';
|
|
6
|
+
import List from './navigation-menu-list.svelte';
|
|
7
|
+
import Trigger from './navigation-menu-trigger.svelte';
|
|
8
|
+
import Viewport from './navigation-menu-viewport.svelte';
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
Root,
|
|
12
|
+
Content,
|
|
13
|
+
Indicator,
|
|
14
|
+
Item,
|
|
15
|
+
Link,
|
|
16
|
+
List,
|
|
17
|
+
Trigger,
|
|
18
|
+
Viewport,
|
|
19
|
+
//
|
|
20
|
+
Root as NavigationMenuRoot,
|
|
21
|
+
Content as NavigationMenuContent,
|
|
22
|
+
Indicator as NavigationMenuIndicator,
|
|
23
|
+
Item as NavigationMenuItem,
|
|
24
|
+
Link as NavigationMenuLink,
|
|
25
|
+
List as NavigationMenuList,
|
|
26
|
+
Trigger as NavigationMenuTrigger,
|
|
27
|
+
Viewport as NavigationMenuViewport,
|
|
28
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: NavigationMenuPrimitive.ContentProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<NavigationMenuPrimitive.Content
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="navigation-menu-content"
|
|
15
|
+
class={cn(
|
|
16
|
+
'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-end-52 data-[motion=from-start]:slide-in-from-start-52 data-[motion=to-end]:slide-out-to-end-52 data-[motion=to-start]:slide-out-to-start-52 start-0 top-0 w-full p-2 pe-2.5 md:absolute md:w-auto',
|
|
17
|
+
'group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none',
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
/>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: NavigationMenuPrimitive.IndicatorProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<NavigationMenuPrimitive.Indicator
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="navigation-menu-indicator"
|
|
15
|
+
class={cn(
|
|
16
|
+
'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
<div class="bg-border rounded-ts-sm relative top-[60%] h-2 w-2 rotate-45 shadow-md"></div>
|
|
22
|
+
</NavigationMenuPrimitive.Indicator>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: NavigationMenuPrimitive.ItemProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<NavigationMenuPrimitive.Item
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="navigation-menu-item"
|
|
15
|
+
class={cn('relative', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: NavigationMenuPrimitive.LinkProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<NavigationMenuPrimitive.Link
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="navigation-menu-link"
|
|
15
|
+
class={cn(
|
|
16
|
+
"data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: NavigationMenuPrimitive.ListProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<NavigationMenuPrimitive.List
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="navigation-menu-list"
|
|
15
|
+
class={cn('group flex flex-1 list-none items-center justify-center gap-1', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|