sve-ui 0.1.1 → 0.2.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/dist/ThemeProvider.svelte +46 -0
- package/dist/ThemeProvider.svelte.d.ts +12 -0
- package/dist/ThemeProvider.svelte.d.ts.map +1 -0
- package/dist/components/Alert/AlertDescription.svelte +31 -0
- package/dist/components/Alert/AlertDescription.svelte.d.ts +10 -0
- package/dist/components/Alert/AlertDescription.svelte.d.ts.map +1 -0
- package/dist/components/Alert/AlertRoot.svelte +103 -0
- package/dist/components/Alert/AlertRoot.svelte.d.ts +29 -0
- package/dist/components/Alert/AlertRoot.svelte.d.ts.map +1 -0
- package/dist/components/Alert/AlertTitle.svelte +34 -0
- package/dist/components/Alert/AlertTitle.svelte.d.ts +12 -0
- package/dist/components/Alert/AlertTitle.svelte.d.ts.map +1 -0
- package/dist/components/Alert/index.d.ts +11 -0
- package/dist/components/Alert/index.d.ts.map +1 -0
- package/dist/components/Alert/index.js +10 -0
- package/dist/components/Avatar/AvatarFallback.svelte +33 -0
- package/dist/components/Avatar/AvatarFallback.svelte.d.ts +12 -0
- package/dist/components/Avatar/AvatarFallback.svelte.d.ts.map +1 -0
- package/dist/components/Avatar/AvatarImage.svelte +27 -0
- package/dist/components/Avatar/AvatarImage.svelte.d.ts +12 -0
- package/dist/components/Avatar/AvatarImage.svelte.d.ts.map +1 -0
- package/dist/components/Avatar/AvatarRoot.svelte +67 -0
- package/dist/components/Avatar/AvatarRoot.svelte.d.ts +16 -0
- package/dist/components/Avatar/AvatarRoot.svelte.d.ts.map +1 -0
- package/dist/components/Avatar/index.d.ts +15 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Avatar/index.js +14 -0
- package/dist/components/Badge/Badge.svelte +125 -0
- package/dist/components/Badge/Badge.svelte.d.ts +37 -0
- package/dist/components/Badge/Badge.svelte.d.ts.map +1 -0
- package/dist/components/Button/Button.svelte +296 -112
- package/dist/components/Button/Button.svelte.d.ts +34 -48
- package/dist/components/Button/Button.svelte.d.ts.map +1 -0
- package/dist/components/Card/CardContent.svelte +33 -0
- package/dist/components/Card/CardContent.svelte.d.ts +10 -0
- package/dist/components/Card/CardContent.svelte.d.ts.map +1 -0
- package/dist/components/Card/CardFooter.svelte +33 -0
- package/dist/components/Card/CardFooter.svelte.d.ts +10 -0
- package/dist/components/Card/CardFooter.svelte.d.ts.map +1 -0
- package/dist/components/Card/CardHeader.svelte +33 -0
- package/dist/components/Card/CardHeader.svelte.d.ts +10 -0
- package/dist/components/Card/CardHeader.svelte.d.ts.map +1 -0
- package/dist/components/Card/CardRoot.svelte +91 -0
- package/dist/components/Card/CardRoot.svelte.d.ts +28 -0
- package/dist/components/Card/CardRoot.svelte.d.ts.map +1 -0
- package/dist/components/Card/index.d.ts +13 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Card/index.js +12 -0
- package/dist/components/Dialog/DialogContent.svelte +47 -0
- package/dist/components/Dialog/DialogContent.svelte.d.ts +10 -0
- package/dist/components/Dialog/DialogContent.svelte.d.ts.map +1 -0
- package/dist/components/Dialog/DialogDescription.svelte +29 -0
- package/dist/components/Dialog/DialogDescription.svelte.d.ts +10 -0
- package/dist/components/Dialog/DialogDescription.svelte.d.ts.map +1 -0
- package/dist/components/Dialog/DialogOverlay.svelte +32 -0
- package/dist/components/Dialog/DialogOverlay.svelte.d.ts +10 -0
- package/dist/components/Dialog/DialogOverlay.svelte.d.ts.map +1 -0
- package/dist/components/Dialog/DialogTitle.svelte +30 -0
- package/dist/components/Dialog/DialogTitle.svelte.d.ts +10 -0
- package/dist/components/Dialog/DialogTitle.svelte.d.ts.map +1 -0
- package/dist/components/Dialog/index.d.ts +21 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Dialog/index.js +22 -0
- package/dist/components/DropdownMenu/DropdownMenuContent.svelte +40 -0
- package/dist/components/DropdownMenu/DropdownMenuContent.svelte.d.ts +10 -0
- package/dist/components/DropdownMenu/DropdownMenuContent.svelte.d.ts.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuGroup.svelte +18 -0
- package/dist/components/DropdownMenu/DropdownMenuGroup.svelte.d.ts +10 -0
- package/dist/components/DropdownMenu/DropdownMenuGroup.svelte.d.ts.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.svelte +40 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.svelte.d.ts +10 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.svelte.d.ts.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuLabel.svelte +34 -0
- package/dist/components/DropdownMenu/DropdownMenuLabel.svelte.d.ts +10 -0
- package/dist/components/DropdownMenu/DropdownMenuLabel.svelte.d.ts.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.svelte +25 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.svelte.d.ts +10 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.svelte.d.ts.map +1 -0
- package/dist/components/DropdownMenu/index.d.ts +31 -0
- package/dist/components/DropdownMenu/index.d.ts.map +1 -0
- package/dist/components/DropdownMenu/index.js +33 -0
- package/dist/components/Heading/Heading.svelte +72 -0
- package/dist/components/Heading/Heading.svelte.d.ts +18 -0
- package/dist/components/Heading/Heading.svelte.d.ts.map +1 -0
- package/dist/components/Input/Input.svelte +151 -0
- package/dist/components/Input/Input.svelte.d.ts +25 -0
- package/dist/components/Input/Input.svelte.d.ts.map +1 -0
- package/dist/components/Popover/PopoverContent.svelte +40 -0
- package/dist/components/Popover/PopoverContent.svelte.d.ts +10 -0
- package/dist/components/Popover/PopoverContent.svelte.d.ts.map +1 -0
- package/dist/components/Popover/index.d.ts +20 -0
- package/dist/components/Popover/index.d.ts.map +1 -0
- package/dist/components/Popover/index.js +21 -0
- package/dist/components/Spinner/Spinner.svelte +82 -0
- package/dist/components/Spinner/Spinner.svelte.d.ts +13 -0
- package/dist/components/Spinner/Spinner.svelte.d.ts.map +1 -0
- package/dist/components/Text/Text.svelte +84 -45
- package/dist/components/Text/Text.svelte.d.ts +20 -44
- package/dist/components/Text/Text.svelte.d.ts.map +1 -0
- package/dist/components/Tooltip/TooltipContent.svelte +41 -0
- package/dist/components/Tooltip/TooltipContent.svelte.d.ts +10 -0
- package/dist/components/Tooltip/TooltipContent.svelte.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +19 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.js +20 -0
- package/dist/context.d.ts +14 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +16 -0
- package/dist/index.d.ts +29 -19
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -10
- package/dist/internal/variants.d.ts +44 -0
- package/dist/internal/variants.d.ts.map +1 -0
- package/dist/internal/variants.js +54 -0
- package/dist/theme/breakpoints.d.ts +1 -0
- package/dist/theme/breakpoints.d.ts.map +1 -0
- package/dist/theme/index.d.ts +12 -182
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +13 -19
- package/dist/theme/palette.d.ts +153 -0
- package/dist/theme/palette.d.ts.map +1 -0
- package/dist/theme/palette.js +85 -0
- package/dist/theme/radius.d.ts +1 -0
- package/dist/theme/radius.d.ts.map +1 -0
- package/dist/theme/sizes.d.ts +1 -0
- package/dist/theme/sizes.d.ts.map +1 -0
- package/dist/theme/spacing.d.ts +1 -0
- package/dist/theme/spacing.d.ts.map +1 -0
- package/dist/theme/theme.css +268 -0
- package/dist/theme/tokens.d.ts +108 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/theme/tokens.js +236 -0
- package/dist/theme/typography.d.ts +1 -0
- package/dist/theme/typography.d.ts.map +1 -0
- package/package.json +74 -67
- package/README.md +0 -94
- package/dist/components/Box/Box.svelte +0 -48
- package/dist/components/Box/Box.svelte.d.ts +0 -160
- package/dist/components/Center/Center.svelte +0 -15
- package/dist/components/Center/Center.svelte.d.ts +0 -25
- package/dist/components/Circle/Circle.svelte +0 -9
- package/dist/components/Circle/Circle.svelte.d.ts +0 -34
- package/dist/components/CodeExample/CodeExample.svelte +0 -128
- package/dist/components/CodeExample/CodeExample.svelte.d.ts +0 -46
- package/dist/components/Flex/Flex.svelte +0 -26
- package/dist/components/Flex/Flex.svelte.d.ts +0 -34
- package/dist/components/Grid/Grid.svelte +0 -16
- package/dist/components/Grid/Grid.svelte.d.ts +0 -44
- package/dist/components/GridItem/GridItem.svelte +0 -22
- package/dist/components/GridItem/GridItem.svelte.d.ts +0 -29
- package/dist/components/Loaders/DotPulse.svelte +0 -62
- package/dist/components/Loaders/DotPulse.svelte.d.ts +0 -40
- package/dist/components/Loaders/DotSpinner.svelte +0 -121
- package/dist/components/Loaders/DotSpinner.svelte.d.ts +0 -40
- package/dist/components/Loaders/DotWave.svelte +0 -67
- package/dist/components/Loaders/DotWave.svelte.d.ts +0 -40
- package/dist/components/Spacer/Spacer.svelte +0 -5
- package/dist/components/Spacer/Spacer.svelte.d.ts +0 -21
- package/dist/components/Square/Square.svelte +0 -17
- package/dist/components/Square/Square.svelte.d.ts +0 -34
- /package/{LICENCE → LICENSE} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
class: cls,
|
|
12
|
+
children,
|
|
13
|
+
...rest
|
|
14
|
+
}: Props = $props();
|
|
15
|
+
|
|
16
|
+
const className = $derived(
|
|
17
|
+
['sve-card__content', cls].filter(Boolean).join(' ')
|
|
18
|
+
);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class={className} {...rest}>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.sve-card__content {
|
|
27
|
+
padding: var(--sve-space-6);
|
|
28
|
+
flex: 1;
|
|
29
|
+
color: var(--sve-color-default-foreground);
|
|
30
|
+
font-size: var(--sve-font-size-md);
|
|
31
|
+
line-height: var(--sve-line-height-normal);
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const CardContent: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type CardContent = ReturnType<typeof CardContent>;
|
|
9
|
+
export default CardContent;
|
|
10
|
+
//# sourceMappingURL=CardContent.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardContent.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Card/CardContent.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAyBH,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
class: cls,
|
|
12
|
+
children,
|
|
13
|
+
...rest
|
|
14
|
+
}: Props = $props();
|
|
15
|
+
|
|
16
|
+
const className = $derived(
|
|
17
|
+
['sve-card__footer', cls].filter(Boolean).join(' ')
|
|
18
|
+
);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class={className} {...rest}>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.sve-card__footer {
|
|
27
|
+
padding: var(--sve-space-4) var(--sve-space-6);
|
|
28
|
+
border-top: 1px solid var(--sve-color-default-border);
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--sve-space-3);
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const CardFooter: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type CardFooter = ReturnType<typeof CardFooter>;
|
|
9
|
+
export default CardFooter;
|
|
10
|
+
//# sourceMappingURL=CardFooter.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardFooter.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Card/CardFooter.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAyBH,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
class: cls,
|
|
12
|
+
children,
|
|
13
|
+
...rest
|
|
14
|
+
}: Props = $props();
|
|
15
|
+
|
|
16
|
+
const className = $derived(
|
|
17
|
+
['sve-card__header', cls].filter(Boolean).join(' ')
|
|
18
|
+
);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class={className} {...rest}>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.sve-card__header {
|
|
27
|
+
padding: var(--sve-space-4) var(--sve-space-6);
|
|
28
|
+
border-bottom: 1px solid var(--sve-color-default-border);
|
|
29
|
+
font-weight: var(--sve-font-weight-medium);
|
|
30
|
+
font-size: var(--sve-font-size-md);
|
|
31
|
+
color: var(--sve-color-default-foreground);
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const CardHeader: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type CardHeader = ReturnType<typeof CardHeader>;
|
|
9
|
+
export default CardHeader;
|
|
10
|
+
//# sourceMappingURL=CardHeader.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardHeader.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Card/CardHeader.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAyBH,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineVariants } from '../../internal/variants';
|
|
3
|
+
|
|
4
|
+
type Variant = 'elevated' | 'outlined' | 'filled';
|
|
5
|
+
type Padding = '2' | '4' | '6' | '8';
|
|
6
|
+
|
|
7
|
+
export const cardVariants = defineVariants({
|
|
8
|
+
base: 'sve-card',
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
elevated: 'sve-card--elevated',
|
|
12
|
+
outlined: 'sve-card--outlined',
|
|
13
|
+
filled: 'sve-card--filled',
|
|
14
|
+
},
|
|
15
|
+
padding: {
|
|
16
|
+
'2': 'sve-card--p2',
|
|
17
|
+
'4': 'sve-card--p4',
|
|
18
|
+
'6': 'sve-card--p6',
|
|
19
|
+
'8': 'sve-card--p8',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: 'elevated',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type { Variant, Padding };
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<script lang="ts">
|
|
31
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
32
|
+
import type { Snippet } from 'svelte';
|
|
33
|
+
|
|
34
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
35
|
+
variant?: Variant;
|
|
36
|
+
padding?: Padding;
|
|
37
|
+
class?: string;
|
|
38
|
+
children?: Snippet;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let {
|
|
42
|
+
variant,
|
|
43
|
+
padding,
|
|
44
|
+
class: cls,
|
|
45
|
+
children,
|
|
46
|
+
...rest
|
|
47
|
+
}: Props = $props();
|
|
48
|
+
|
|
49
|
+
const className = $derived(
|
|
50
|
+
cardVariants({ variant, padding, class: cls })
|
|
51
|
+
);
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<div class={className} {...rest}>
|
|
55
|
+
{@render children?.()}
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.sve-card {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
border-radius: var(--sve-radius-lg);
|
|
63
|
+
font-family: var(--sve-font-family-sans);
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* --- Variants --- */
|
|
68
|
+
.sve-card--elevated {
|
|
69
|
+
background-color: var(--sve-color-default-surface);
|
|
70
|
+
box-shadow: var(--sve-shadow-md);
|
|
71
|
+
border: 1px solid transparent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.sve-card--outlined {
|
|
75
|
+
background-color: var(--sve-color-default-surface);
|
|
76
|
+
border: 1px solid var(--sve-color-default-border);
|
|
77
|
+
box-shadow: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.sve-card--filled {
|
|
81
|
+
background-color: var(--sve-color-default);
|
|
82
|
+
border: 1px solid transparent;
|
|
83
|
+
box-shadow: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* --- Padding --- */
|
|
87
|
+
.sve-card--p2 { padding: var(--sve-space-2); }
|
|
88
|
+
.sve-card--p4 { padding: var(--sve-space-4); }
|
|
89
|
+
.sve-card--p6 { padding: var(--sve-space-6); }
|
|
90
|
+
.sve-card--p8 { padding: var(--sve-space-8); }
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type Variant = 'elevated' | 'outlined' | 'filled';
|
|
2
|
+
type Padding = '2' | '4' | '6' | '8';
|
|
3
|
+
export declare const cardVariants: (props?: import("../../internal/variants").VariantProps<{
|
|
4
|
+
variant: {
|
|
5
|
+
elevated: string;
|
|
6
|
+
outlined: string;
|
|
7
|
+
filled: string;
|
|
8
|
+
};
|
|
9
|
+
padding: {
|
|
10
|
+
'2': string;
|
|
11
|
+
'4': string;
|
|
12
|
+
'6': string;
|
|
13
|
+
'8': string;
|
|
14
|
+
};
|
|
15
|
+
}> | undefined) => string;
|
|
16
|
+
export type { Variant, Padding };
|
|
17
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
18
|
+
import type { Snippet } from 'svelte';
|
|
19
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
|
|
20
|
+
variant?: Variant;
|
|
21
|
+
padding?: Padding;
|
|
22
|
+
class?: string;
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
}
|
|
25
|
+
declare const CardRoot: import("svelte").Component<Props, {}, "">;
|
|
26
|
+
type CardRoot = ReturnType<typeof CardRoot>;
|
|
27
|
+
export default CardRoot;
|
|
28
|
+
//# sourceMappingURL=CardRoot.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardRoot.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Card/CardRoot.svelte.ts"],"names":[],"mappings":"AAKE,KAAK,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAClD,KAAK,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAErC,eAAO,MAAM,YAAY;;;;;;;;;;;;yBAkBvB,CAAC;AAEH,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAGnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA6BH,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card namespace — composable surface container.
|
|
3
|
+
*
|
|
4
|
+
* Root: styled card surface with variant + padding props.
|
|
5
|
+
* Header: styled header section with bottom border.
|
|
6
|
+
* Content: styled content body.
|
|
7
|
+
* Footer: styled footer section with top border.
|
|
8
|
+
*/
|
|
9
|
+
export { default as Root } from './CardRoot.svelte';
|
|
10
|
+
export { default as Header } from './CardHeader.svelte';
|
|
11
|
+
export { default as Content } from './CardContent.svelte';
|
|
12
|
+
export { default as Footer } from './CardFooter.svelte';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Card/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card namespace — composable surface container.
|
|
3
|
+
*
|
|
4
|
+
* Root: styled card surface with variant + padding props.
|
|
5
|
+
* Header: styled header section with bottom border.
|
|
6
|
+
* Content: styled content body.
|
|
7
|
+
* Footer: styled footer section with top border.
|
|
8
|
+
*/
|
|
9
|
+
export { default as Root } from './CardRoot.svelte';
|
|
10
|
+
export { default as Header } from './CardHeader.svelte';
|
|
11
|
+
export { default as Content } from './CardContent.svelte';
|
|
12
|
+
export { default as Footer } from './CardFooter.svelte';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
import DialogOverlay from './DialogOverlay.svelte';
|
|
5
|
+
|
|
6
|
+
type BitsContentProps = ComponentProps<typeof Dialog.Content>;
|
|
7
|
+
|
|
8
|
+
interface Props extends Omit<BitsContentProps, 'class'> {
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { class: cls, children, ...rest }: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<!--
|
|
16
|
+
DialogContent renders a Portal (managed by bits-ui) that wraps:
|
|
17
|
+
1. DialogOverlay — the backdrop
|
|
18
|
+
2. Dialog.Content — the panel with focus trap, ARIA, ESC handling via Bits UI
|
|
19
|
+
|
|
20
|
+
Portal defaults to document.body, keeping z-index stacking clean.
|
|
21
|
+
-->
|
|
22
|
+
<Dialog.Portal>
|
|
23
|
+
<DialogOverlay />
|
|
24
|
+
<Dialog.Content
|
|
25
|
+
class={['sve-dialog-content', cls].filter(Boolean).join(' ')}
|
|
26
|
+
{children}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
</Dialog.Portal>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
:global(.sve-dialog-content) {
|
|
33
|
+
position: fixed;
|
|
34
|
+
left: 50%;
|
|
35
|
+
top: 50%;
|
|
36
|
+
z-index: 51;
|
|
37
|
+
transform: translate(-50%, -50%);
|
|
38
|
+
width: min(90vw, 28rem);
|
|
39
|
+
max-height: 85vh;
|
|
40
|
+
overflow-y: auto;
|
|
41
|
+
background-color: var(--sve-color-default-surface, #fff);
|
|
42
|
+
border-radius: var(--sve-radius-lg);
|
|
43
|
+
box-shadow: var(--sve-shadow-md);
|
|
44
|
+
padding: var(--sve-space-6);
|
|
45
|
+
outline: none;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dialog } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsContentProps = ComponentProps<typeof Dialog.Content>;
|
|
4
|
+
interface Props extends Omit<BitsContentProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DialogContent: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DialogContent = ReturnType<typeof DialogContent>;
|
|
9
|
+
export default DialogContent;
|
|
10
|
+
//# sourceMappingURL=DialogContent.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogContent.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Dialog/DialogContent.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAI3C,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;AAE9D,UAAU,KAAM,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqBH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsDescriptionProps = ComponentProps<typeof Dialog.Description>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsDescriptionProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, children, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Dialog.Description
|
|
15
|
+
class={['sve-dialog-description', cls].filter(Boolean).join(' ')}
|
|
16
|
+
{children}
|
|
17
|
+
{...rest}
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
:global(.sve-dialog-description) {
|
|
22
|
+
font-family: var(--sve-font-family-sans);
|
|
23
|
+
font-size: var(--sve-font-size-sm);
|
|
24
|
+
line-height: var(--sve-line-height-relaxed);
|
|
25
|
+
color: var(--sve-color-default-foreground);
|
|
26
|
+
margin: 0 0 var(--sve-space-4);
|
|
27
|
+
opacity: 0.75;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dialog } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsDescriptionProps = ComponentProps<typeof Dialog.Description>;
|
|
4
|
+
interface Props extends Omit<BitsDescriptionProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DialogDescription: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DialogDescription = ReturnType<typeof DialogDescription>;
|
|
9
|
+
export default DialogDescription;
|
|
10
|
+
//# sourceMappingURL=DialogDescription.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogDescription.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Dialog/DialogDescription.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,oBAAoB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;AAEtE,UAAU,KAAM,SAAQ,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgBH,QAAA,MAAM,iBAAiB,2CAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsOverlayProps = ComponentProps<typeof Dialog.Overlay>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsOverlayProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<!--
|
|
15
|
+
Styled wrapper over bits-ui Dialog.Overlay.
|
|
16
|
+
data-slot="dialog-overlay" is used by tests and consumers for targeting.
|
|
17
|
+
No children forwarded — the overlay is a purely visual backdrop element.
|
|
18
|
+
-->
|
|
19
|
+
<Dialog.Overlay
|
|
20
|
+
class={['sve-dialog-overlay', cls].filter(Boolean).join(' ')}
|
|
21
|
+
data-slot="dialog-overlay"
|
|
22
|
+
{...rest}
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
:global(.sve-dialog-overlay) {
|
|
27
|
+
position: fixed;
|
|
28
|
+
inset: 0;
|
|
29
|
+
z-index: 50;
|
|
30
|
+
background-color: var(--sve-color-overlay);
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dialog } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsOverlayProps = ComponentProps<typeof Dialog.Overlay>;
|
|
4
|
+
interface Props extends Omit<BitsOverlayProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DialogOverlay: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DialogOverlay = ReturnType<typeof DialogOverlay>;
|
|
9
|
+
export default DialogOverlay;
|
|
10
|
+
//# sourceMappingURL=DialogOverlay.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogOverlay.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Dialog/DialogOverlay.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;AAE9D,UAAU,KAAM,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiBH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsTitleProps = ComponentProps<typeof Dialog.Title>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsTitleProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, level, children, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Dialog.Title
|
|
15
|
+
class={['sve-dialog-title', cls].filter(Boolean).join(' ')}
|
|
16
|
+
{level}
|
|
17
|
+
{children}
|
|
18
|
+
{...rest}
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
:global(.sve-dialog-title) {
|
|
23
|
+
font-family: var(--sve-font-family-sans);
|
|
24
|
+
font-size: var(--sve-font-size-lg);
|
|
25
|
+
font-weight: var(--sve-font-weight-bold);
|
|
26
|
+
line-height: var(--sve-line-height-tight);
|
|
27
|
+
color: var(--sve-color-default-foreground);
|
|
28
|
+
margin: 0 0 var(--sve-space-2);
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dialog } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsTitleProps = ComponentProps<typeof Dialog.Title>;
|
|
4
|
+
interface Props extends Omit<BitsTitleProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DialogTitle: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DialogTitle = ReturnType<typeof DialogTitle>;
|
|
9
|
+
export default DialogTitle;
|
|
10
|
+
//# sourceMappingURL=DialogTitle.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogTitle.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Dialog/DialogTitle.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AAE1D,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgBH,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dialog namespace — sve-ui styled wrappers over bits-ui Dialog primitives.
|
|
3
|
+
*
|
|
4
|
+
* Root, Trigger, Close: re-exported as-is (behavior-only, Bits UI owns ARIA + focus).
|
|
5
|
+
* Overlay, Content, Title, Description: styled wrappers adding --sve-* token styles.
|
|
6
|
+
* Content wraps Portal + Bits Content internally (consumers don't manage portaling).
|
|
7
|
+
*
|
|
8
|
+
* Confirmed Bits UI 2.18.1 API:
|
|
9
|
+
* import { Dialog } from 'bits-ui'
|
|
10
|
+
* Dialog.Root / Dialog.Trigger / Dialog.Close / Dialog.Portal /
|
|
11
|
+
* Dialog.Overlay / Dialog.Content / Dialog.Title / Dialog.Description
|
|
12
|
+
*/
|
|
13
|
+
import { Dialog as BitsDialog } from 'bits-ui';
|
|
14
|
+
export declare const Root: import("svelte").Component<import("bits-ui").AlertDialogRootPropsWithoutHTML, {}, "open">;
|
|
15
|
+
export declare const Trigger: import("svelte").Component<BitsDialog.TriggerProps, {}, "ref">;
|
|
16
|
+
export declare const Close: import("svelte").Component<BitsDialog.TriggerProps, {}, "ref">;
|
|
17
|
+
export { default as Overlay } from './DialogOverlay.svelte';
|
|
18
|
+
export { default as Content } from './DialogContent.svelte';
|
|
19
|
+
export { default as Title } from './DialogTitle.svelte';
|
|
20
|
+
export { default as Description } from './DialogDescription.svelte';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Dialog/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAG/C,eAAO,MAAM,IAAI,2FAAkB,CAAC;AACpC,eAAO,MAAM,OAAO,gEAAqB,CAAC;AAC1C,eAAO,MAAM,KAAK,gEAAmB,CAAC;AAGtC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dialog namespace — sve-ui styled wrappers over bits-ui Dialog primitives.
|
|
3
|
+
*
|
|
4
|
+
* Root, Trigger, Close: re-exported as-is (behavior-only, Bits UI owns ARIA + focus).
|
|
5
|
+
* Overlay, Content, Title, Description: styled wrappers adding --sve-* token styles.
|
|
6
|
+
* Content wraps Portal + Bits Content internally (consumers don't manage portaling).
|
|
7
|
+
*
|
|
8
|
+
* Confirmed Bits UI 2.18.1 API:
|
|
9
|
+
* import { Dialog } from 'bits-ui'
|
|
10
|
+
* Dialog.Root / Dialog.Trigger / Dialog.Close / Dialog.Portal /
|
|
11
|
+
* Dialog.Overlay / Dialog.Content / Dialog.Title / Dialog.Description
|
|
12
|
+
*/
|
|
13
|
+
import { Dialog as BitsDialog } from 'bits-ui';
|
|
14
|
+
// Behavior-only re-exports from bits-ui (no styling needed)
|
|
15
|
+
export const Root = BitsDialog.Root;
|
|
16
|
+
export const Trigger = BitsDialog.Trigger;
|
|
17
|
+
export const Close = BitsDialog.Close;
|
|
18
|
+
// Styled presentational wrappers
|
|
19
|
+
export { default as Overlay } from './DialogOverlay.svelte';
|
|
20
|
+
export { default as Content } from './DialogContent.svelte';
|
|
21
|
+
export { default as Title } from './DialogTitle.svelte';
|
|
22
|
+
export { default as Description } from './DialogDescription.svelte';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsContentProps = ComponentProps<typeof DropdownMenu.Content>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsContentProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, children, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<!--
|
|
15
|
+
DropdownMenuContent renders via a Portal (managed by bits-ui) that wraps:
|
|
16
|
+
DropdownMenu.Content — the panel with ARIA and keyboard handling via Bits UI.
|
|
17
|
+
|
|
18
|
+
Portal defaults to document.body, keeping z-index stacking clean.
|
|
19
|
+
-->
|
|
20
|
+
<DropdownMenu.Portal>
|
|
21
|
+
<DropdownMenu.Content
|
|
22
|
+
class={['sve-dropdown-content', cls].filter(Boolean).join(' ')}
|
|
23
|
+
{children}
|
|
24
|
+
{...rest}
|
|
25
|
+
/>
|
|
26
|
+
</DropdownMenu.Portal>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
:global(.sve-dropdown-content) {
|
|
30
|
+
box-shadow: var(--sve-shadow-md);
|
|
31
|
+
background-color: var(--sve-color-default-surface, #fff);
|
|
32
|
+
border: 1px solid var(--sve-color-default-border, #e5e7eb);
|
|
33
|
+
border-radius: var(--sve-radius-md);
|
|
34
|
+
padding: var(--sve-space-1);
|
|
35
|
+
/* z-index convention: Dialog overlay=50/content=51, Dropdown/Popover=60, Tooltip=70 */
|
|
36
|
+
z-index: 60;
|
|
37
|
+
min-width: 8rem;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenu } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsContentProps = ComponentProps<typeof DropdownMenu.Content>;
|
|
4
|
+
interface Props extends Omit<BitsContentProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DropdownMenuContent: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DropdownMenuContent = ReturnType<typeof DropdownMenuContent>;
|
|
9
|
+
export default DropdownMenuContent;
|
|
10
|
+
//# sourceMappingURL=DropdownMenuContent.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenuContent.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/DropdownMenu/DropdownMenuContent.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;AAEpE,UAAU,KAAM,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmBH,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsGroupProps = ComponentProps<typeof DropdownMenu.Group>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsGroupProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, children, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<DropdownMenu.Group
|
|
15
|
+
class={['sve-dropdown-group', cls].filter(Boolean).join(' ')}
|
|
16
|
+
{children}
|
|
17
|
+
{...rest}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenu } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsGroupProps = ComponentProps<typeof DropdownMenu.Group>;
|
|
4
|
+
interface Props extends Omit<BitsGroupProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DropdownMenuGroup: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DropdownMenuGroup = ReturnType<typeof DropdownMenuGroup>;
|
|
9
|
+
export default DropdownMenuGroup;
|
|
10
|
+
//# sourceMappingURL=DropdownMenuGroup.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenuGroup.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/DropdownMenu/DropdownMenuGroup.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAEhE,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAcH,QAAA,MAAM,iBAAiB,2CAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|