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,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsItemProps = ComponentProps<typeof DropdownMenu.Item>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsItemProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, children, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<DropdownMenu.Item
|
|
15
|
+
class={['sve-dropdown-item', cls].filter(Boolean).join(' ')}
|
|
16
|
+
{children}
|
|
17
|
+
{...rest}
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
:global(.sve-dropdown-item) {
|
|
22
|
+
cursor: default;
|
|
23
|
+
padding: var(--sve-space-1) var(--sve-space-2);
|
|
24
|
+
border-radius: var(--sve-radius-sm);
|
|
25
|
+
font-size: var(--sve-font-size-sm);
|
|
26
|
+
color: var(--sve-color-default-foreground, #1a202c);
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:global(.sve-dropdown-item[data-highlighted]) {
|
|
31
|
+
background-color: var(--sve-color-primary-surface, #fff5f5);
|
|
32
|
+
color: var(--sve-color-default-foreground, #1a202c);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:global(.sve-dropdown-item[data-disabled]) {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
cursor: not-allowed;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenu } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsItemProps = ComponentProps<typeof DropdownMenu.Item>;
|
|
4
|
+
interface Props extends Omit<BitsItemProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DropdownMenuItem: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DropdownMenuItem = ReturnType<typeof DropdownMenuItem>;
|
|
9
|
+
export default DropdownMenuItem;
|
|
10
|
+
//# sourceMappingURL=DropdownMenuItem.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenuItem.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/DropdownMenu/DropdownMenuItem.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAE9D,UAAU,KAAM,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgBH,QAAA,MAAM,gBAAgB,2CAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsGroupHeadingProps = ComponentProps<typeof DropdownMenu.GroupHeading>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsGroupHeadingProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, children, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<!--
|
|
15
|
+
DropdownMenuLabel uses GroupHeading from bits-ui — this is the semantic
|
|
16
|
+
label element for a group of menu items, not the generic Label component.
|
|
17
|
+
-->
|
|
18
|
+
<DropdownMenu.GroupHeading
|
|
19
|
+
class={['sve-dropdown-label', cls].filter(Boolean).join(' ')}
|
|
20
|
+
{children}
|
|
21
|
+
{...rest}
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<style>
|
|
25
|
+
:global(.sve-dropdown-label) {
|
|
26
|
+
padding: var(--sve-space-1) var(--sve-space-2);
|
|
27
|
+
font-size: var(--sve-font-size-xs);
|
|
28
|
+
font-weight: var(--sve-font-weight-bold);
|
|
29
|
+
color: var(--sve-color-default-foreground, #1a202c);
|
|
30
|
+
opacity: 0.6;
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
letter-spacing: 0.05em;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenu } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsGroupHeadingProps = ComponentProps<typeof DropdownMenu.GroupHeading>;
|
|
4
|
+
interface Props extends Omit<BitsGroupHeadingProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DropdownMenuLabel: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DropdownMenuLabel = ReturnType<typeof DropdownMenuLabel>;
|
|
9
|
+
export default DropdownMenuLabel;
|
|
10
|
+
//# sourceMappingURL=DropdownMenuLabel.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenuLabel.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/DropdownMenu/DropdownMenuLabel.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;AAE9E,UAAU,KAAM,SAAQ,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiBH,QAAA,MAAM,iBAAiB,2CAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsSeparatorProps = ComponentProps<typeof DropdownMenu.Separator>;
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<BitsSeparatorProps, 'class'> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { class: cls, ...rest }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<DropdownMenu.Separator
|
|
15
|
+
class={['sve-dropdown-separator', cls].filter(Boolean).join(' ')}
|
|
16
|
+
{...rest}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
:global(.sve-dropdown-separator) {
|
|
21
|
+
height: 1px;
|
|
22
|
+
background-color: var(--sve-color-default-border, #e5e7eb);
|
|
23
|
+
margin: var(--sve-space-1) 0;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenu } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsSeparatorProps = ComponentProps<typeof DropdownMenu.Separator>;
|
|
4
|
+
interface Props extends Omit<BitsSeparatorProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DropdownMenuSeparator: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type DropdownMenuSeparator = ReturnType<typeof DropdownMenuSeparator>;
|
|
9
|
+
export default DropdownMenuSeparator;
|
|
10
|
+
//# sourceMappingURL=DropdownMenuSeparator.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenuSeparator.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/DropdownMenu/DropdownMenuSeparator.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AAExE,UAAU,KAAM,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgBH,QAAA,MAAM,qBAAqB,2CAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DropdownMenu namespace — sve-ui styled wrappers over bits-ui DropdownMenu primitives.
|
|
3
|
+
*
|
|
4
|
+
* Root, Trigger, Sub, SubTrigger, SubContent, CheckboxItem, RadioItem, RadioGroup:
|
|
5
|
+
* re-exported as-is (behavior-only, Bits UI owns ARIA + keyboard).
|
|
6
|
+
* Content, Item, Separator, Group, Label: styled wrappers adding --sve-* token styles.
|
|
7
|
+
* Content wraps Portal + Bits Content internally (consumers don't manage portaling).
|
|
8
|
+
*
|
|
9
|
+
* Confirmed Bits UI 2.x API:
|
|
10
|
+
* import { DropdownMenu } from 'bits-ui'
|
|
11
|
+
* DropdownMenu.Root / Trigger / Content / Item / Separator / Group /
|
|
12
|
+
* GroupHeading / Sub / SubTrigger / SubContent / CheckboxItem / RadioItem /
|
|
13
|
+
* RadioGroup / Portal
|
|
14
|
+
*/
|
|
15
|
+
import type { Component } from 'svelte';
|
|
16
|
+
import type { DropdownMenuRootProps, DropdownMenuTriggerProps, DropdownMenuSubProps, DropdownMenuSubTriggerProps, DropdownMenuSubContentProps, DropdownMenuCheckboxItemProps, DropdownMenuRadioItemProps, DropdownMenuRadioGroupProps, DropdownMenuArrowProps } from 'bits-ui';
|
|
17
|
+
export declare const Root: Component<DropdownMenuRootProps>;
|
|
18
|
+
export declare const Trigger: Component<DropdownMenuTriggerProps>;
|
|
19
|
+
export declare const Sub: Component<DropdownMenuSubProps>;
|
|
20
|
+
export declare const SubTrigger: Component<DropdownMenuSubTriggerProps>;
|
|
21
|
+
export declare const SubContent: Component<DropdownMenuSubContentProps>;
|
|
22
|
+
export declare const CheckboxItem: Component<DropdownMenuCheckboxItemProps>;
|
|
23
|
+
export declare const RadioItem: Component<DropdownMenuRadioItemProps>;
|
|
24
|
+
export declare const RadioGroup: Component<DropdownMenuRadioGroupProps>;
|
|
25
|
+
export declare const Arrow: Component<DropdownMenuArrowProps>;
|
|
26
|
+
export { default as Content } from './DropdownMenuContent.svelte';
|
|
27
|
+
export { default as Item } from './DropdownMenuItem.svelte';
|
|
28
|
+
export { default as Separator } from './DropdownMenuSeparator.svelte';
|
|
29
|
+
export { default as Group } from './DropdownMenuGroup.svelte';
|
|
30
|
+
export { default as Label } from './DropdownMenuLabel.svelte';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/DropdownMenu/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,IAAI,EAAE,SAAS,CAAC,qBAAqB,CAA6D,CAAC;AAChH,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,wBAAwB,CAAmE,CAAC;AAC5H,eAAO,MAAM,GAAG,EAAE,SAAS,CAAC,oBAAoB,CAA2D,CAAC;AAC5G,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,2BAA2B,CAAyE,CAAC;AACxI,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,2BAA2B,CAAyE,CAAC;AACxI,eAAO,MAAM,YAAY,EAAE,SAAS,CAAC,6BAA6B,CAA6E,CAAC;AAChJ,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,0BAA0B,CAAuE,CAAC;AACpI,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,2BAA2B,CAAyE,CAAC;AAGxI,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,sBAAsB,CAA+D,CAAC;AAGpH,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DropdownMenu namespace — sve-ui styled wrappers over bits-ui DropdownMenu primitives.
|
|
3
|
+
*
|
|
4
|
+
* Root, Trigger, Sub, SubTrigger, SubContent, CheckboxItem, RadioItem, RadioGroup:
|
|
5
|
+
* re-exported as-is (behavior-only, Bits UI owns ARIA + keyboard).
|
|
6
|
+
* Content, Item, Separator, Group, Label: styled wrappers adding --sve-* token styles.
|
|
7
|
+
* Content wraps Portal + Bits Content internally (consumers don't manage portaling).
|
|
8
|
+
*
|
|
9
|
+
* Confirmed Bits UI 2.x API:
|
|
10
|
+
* import { DropdownMenu } from 'bits-ui'
|
|
11
|
+
* DropdownMenu.Root / Trigger / Content / Item / Separator / Group /
|
|
12
|
+
* GroupHeading / Sub / SubTrigger / SubContent / CheckboxItem / RadioItem /
|
|
13
|
+
* RadioGroup / Portal
|
|
14
|
+
*/
|
|
15
|
+
import { DropdownMenu as BitsDropdownMenu } from 'bits-ui';
|
|
16
|
+
// Behavior re-exports — cast to portable Component types to avoid referencing
|
|
17
|
+
// bits-ui internal types (OnChangeFn) in the exported declaration.
|
|
18
|
+
export const Root = BitsDropdownMenu.Root;
|
|
19
|
+
export const Trigger = BitsDropdownMenu.Trigger;
|
|
20
|
+
export const Sub = BitsDropdownMenu.Sub;
|
|
21
|
+
export const SubTrigger = BitsDropdownMenu.SubTrigger;
|
|
22
|
+
export const SubContent = BitsDropdownMenu.SubContent;
|
|
23
|
+
export const CheckboxItem = BitsDropdownMenu.CheckboxItem;
|
|
24
|
+
export const RadioItem = BitsDropdownMenu.RadioItem;
|
|
25
|
+
export const RadioGroup = BitsDropdownMenu.RadioGroup;
|
|
26
|
+
// Arrow: bits-ui floating-ui arrow for visual pointer; positioning is automatic.
|
|
27
|
+
export const Arrow = BitsDropdownMenu.Arrow;
|
|
28
|
+
// Styled wrappers
|
|
29
|
+
export { default as Content } from './DropdownMenuContent.svelte';
|
|
30
|
+
export { default as Item } from './DropdownMenuItem.svelte';
|
|
31
|
+
export { default as Separator } from './DropdownMenuSeparator.svelte';
|
|
32
|
+
export { default as Group } from './DropdownMenuGroup.svelte';
|
|
33
|
+
export { default as Label } from './DropdownMenuLabel.svelte';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
type Size = 'sm' | 'md' | 'lg';
|
|
7
|
+
type Weight = 'normal' | 'medium' | 'bold';
|
|
8
|
+
type Color = 'inherit' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'default';
|
|
9
|
+
|
|
10
|
+
interface Props extends Omit<HTMLAttributes<HTMLHeadingElement>, 'class'> {
|
|
11
|
+
level?: Level;
|
|
12
|
+
size?: Size;
|
|
13
|
+
weight?: Weight;
|
|
14
|
+
color?: Color;
|
|
15
|
+
class?: string;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
level = 2,
|
|
21
|
+
size,
|
|
22
|
+
weight = 'bold',
|
|
23
|
+
color = 'inherit',
|
|
24
|
+
class: cls,
|
|
25
|
+
children,
|
|
26
|
+
...rest
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
|
|
29
|
+
const tag = $derived(`h${level}` as const);
|
|
30
|
+
|
|
31
|
+
const className = $derived(
|
|
32
|
+
[
|
|
33
|
+
'sve-heading',
|
|
34
|
+
size ? `sve-heading--${size}` : '',
|
|
35
|
+
weight ? `sve-heading--${weight}` : '',
|
|
36
|
+
color !== 'inherit' ? `sve-c-${color}` : '',
|
|
37
|
+
cls ?? '',
|
|
38
|
+
]
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join(' ')
|
|
41
|
+
);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<svelte:element this={tag} class={className} {...rest}>
|
|
45
|
+
{@render children?.()}
|
|
46
|
+
</svelte:element>
|
|
47
|
+
|
|
48
|
+
<style>
|
|
49
|
+
.sve-heading {
|
|
50
|
+
font-family: var(--sve-font-family-sans);
|
|
51
|
+
line-height: var(--sve-line-height-tight);
|
|
52
|
+
margin: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* --- Sizes --- */
|
|
56
|
+
.sve-heading--sm { font-size: var(--sve-font-size-sm); }
|
|
57
|
+
.sve-heading--md { font-size: var(--sve-font-size-md); }
|
|
58
|
+
.sve-heading--lg { font-size: var(--sve-font-size-lg); }
|
|
59
|
+
|
|
60
|
+
/* --- Weights --- */
|
|
61
|
+
.sve-heading--normal { font-weight: var(--sve-font-weight-normal); }
|
|
62
|
+
.sve-heading--medium { font-weight: var(--sve-font-weight-medium); }
|
|
63
|
+
.sve-heading--bold { font-weight: var(--sve-font-weight-bold); }
|
|
64
|
+
|
|
65
|
+
/* --- Semantic colors --- */
|
|
66
|
+
.sve-c-primary { color: var(--sve-color-primary); }
|
|
67
|
+
.sve-c-secondary { color: var(--sve-color-secondary); }
|
|
68
|
+
.sve-c-success { color: var(--sve-color-success); }
|
|
69
|
+
.sve-c-warning { color: var(--sve-color-warning-foreground); }
|
|
70
|
+
.sve-c-danger { color: var(--sve-color-danger); }
|
|
71
|
+
.sve-c-default { color: var(--sve-color-default-foreground); }
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
type Size = 'sm' | 'md' | 'lg';
|
|
5
|
+
type Weight = 'normal' | 'medium' | 'bold';
|
|
6
|
+
type Color = 'inherit' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'default';
|
|
7
|
+
interface Props extends Omit<HTMLAttributes<HTMLHeadingElement>, 'class'> {
|
|
8
|
+
level?: Level;
|
|
9
|
+
size?: Size;
|
|
10
|
+
weight?: Weight;
|
|
11
|
+
color?: Color;
|
|
12
|
+
class?: string;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
}
|
|
15
|
+
declare const Heading: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type Heading = ReturnType<typeof Heading>;
|
|
17
|
+
export default Heading;
|
|
18
|
+
//# sourceMappingURL=Heading.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Heading.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Heading/Heading.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACnC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/B,KAAK,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC3C,KAAK,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEhG,UAAU,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACvE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA2CH,QAAA,MAAM,OAAO,2CAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineVariants } from '../../internal/variants';
|
|
3
|
+
|
|
4
|
+
type Size = 'sm' | 'md' | 'lg';
|
|
5
|
+
type Variant = 'outline' | 'filled';
|
|
6
|
+
|
|
7
|
+
export const inputVariants = defineVariants({
|
|
8
|
+
base: 'sve-input',
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
outline: 'sve-input--outline',
|
|
12
|
+
filled: 'sve-input--filled',
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: 'sve-input--sm',
|
|
16
|
+
md: 'sve-input--md',
|
|
17
|
+
lg: 'sve-input--lg',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: 'outline',
|
|
22
|
+
size: 'md',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type { Size, Variant };
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<script lang="ts">
|
|
30
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
31
|
+
|
|
32
|
+
interface Props extends Omit<HTMLInputAttributes, 'class' | 'size'> {
|
|
33
|
+
size?: Size;
|
|
34
|
+
variant?: Variant;
|
|
35
|
+
invalid?: boolean;
|
|
36
|
+
class?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let {
|
|
40
|
+
size,
|
|
41
|
+
variant,
|
|
42
|
+
invalid = false,
|
|
43
|
+
class: cls,
|
|
44
|
+
value = $bindable(),
|
|
45
|
+
...rest
|
|
46
|
+
}: Props = $props();
|
|
47
|
+
|
|
48
|
+
const className = $derived(
|
|
49
|
+
inputVariants({
|
|
50
|
+
size,
|
|
51
|
+
variant,
|
|
52
|
+
class: [cls, invalid ? 'sve-input--invalid' : ''].filter(Boolean).join(' ') || undefined,
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<!--
|
|
58
|
+
Accessibility: consumers MUST associate a label via one of:
|
|
59
|
+
- <label for="..."> matching the input's forwarded `id` prop
|
|
60
|
+
- aria-labelledby pointing to a visible label element
|
|
61
|
+
Both approaches work through the spread `{...rest}`.
|
|
62
|
+
`aria-invalid` is wired automatically via the `invalid` prop.
|
|
63
|
+
-->
|
|
64
|
+
<input
|
|
65
|
+
class={className}
|
|
66
|
+
aria-invalid={invalid ? true : undefined}
|
|
67
|
+
bind:value
|
|
68
|
+
{...rest}
|
|
69
|
+
/>
|
|
70
|
+
|
|
71
|
+
<style>
|
|
72
|
+
.sve-input {
|
|
73
|
+
display: block;
|
|
74
|
+
width: 100%;
|
|
75
|
+
border-radius: var(--sve-radius-md);
|
|
76
|
+
border: 1px solid transparent;
|
|
77
|
+
font-family: var(--sve-font-family-sans);
|
|
78
|
+
font-size: var(--sve-font-size-md);
|
|
79
|
+
line-height: var(--sve-line-height-normal);
|
|
80
|
+
/* Suppress the default browser outline; we render our own focus-visible ring below */
|
|
81
|
+
outline: none;
|
|
82
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
83
|
+
background-color: transparent;
|
|
84
|
+
color: var(--sve-color-default-foreground);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* --- Sizes --- */
|
|
88
|
+
.sve-input--sm {
|
|
89
|
+
padding: var(--sve-space-1) var(--sve-space-2);
|
|
90
|
+
font-size: var(--sve-font-size-sm);
|
|
91
|
+
height: 2rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.sve-input--md {
|
|
95
|
+
padding: var(--sve-space-2) var(--sve-space-3);
|
|
96
|
+
height: 2.5rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.sve-input--lg {
|
|
100
|
+
padding: var(--sve-space-3) var(--sve-space-4);
|
|
101
|
+
font-size: var(--sve-font-size-lg);
|
|
102
|
+
height: 3rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* --- Focus-visible ring (respects high-contrast mode via outline) --- */
|
|
106
|
+
.sve-input:focus-visible {
|
|
107
|
+
outline: 2px solid var(--sve-color-primary);
|
|
108
|
+
outline-offset: 1px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* --- Outline variant --- */
|
|
112
|
+
.sve-input--outline {
|
|
113
|
+
background-color: transparent;
|
|
114
|
+
border-color: var(--sve-color-default-border);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.sve-input--outline:focus-visible {
|
|
118
|
+
border-color: var(--sve-color-primary-border);
|
|
119
|
+
box-shadow: 0 0 0 3px var(--sve-color-primary-surface);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* --- Filled variant --- */
|
|
123
|
+
.sve-input--filled {
|
|
124
|
+
background-color: var(--sve-color-default-surface);
|
|
125
|
+
border-color: transparent;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.sve-input--filled:focus-visible {
|
|
129
|
+
background-color: var(--sve-color-default-surface);
|
|
130
|
+
border-color: var(--sve-color-primary-border);
|
|
131
|
+
box-shadow: 0 0 0 3px var(--sve-color-primary-surface);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* --- Invalid state --- */
|
|
135
|
+
.sve-input--invalid {
|
|
136
|
+
border-color: var(--sve-color-danger-border);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.sve-input--invalid:focus-visible {
|
|
140
|
+
border-color: var(--sve-color-danger);
|
|
141
|
+
box-shadow: 0 0 0 3px var(--sve-color-danger-surface);
|
|
142
|
+
outline-color: var(--sve-color-danger);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* --- Disabled state --- */
|
|
146
|
+
.sve-input:disabled {
|
|
147
|
+
opacity: 0.5;
|
|
148
|
+
cursor: not-allowed;
|
|
149
|
+
pointer-events: none;
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type Size = 'sm' | 'md' | 'lg';
|
|
2
|
+
type Variant = 'outline' | 'filled';
|
|
3
|
+
export declare const inputVariants: (props?: import("../../internal/variants").VariantProps<{
|
|
4
|
+
variant: {
|
|
5
|
+
outline: string;
|
|
6
|
+
filled: string;
|
|
7
|
+
};
|
|
8
|
+
size: {
|
|
9
|
+
sm: string;
|
|
10
|
+
md: string;
|
|
11
|
+
lg: string;
|
|
12
|
+
};
|
|
13
|
+
}> | undefined) => string;
|
|
14
|
+
export type { Size, Variant };
|
|
15
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
16
|
+
interface Props extends Omit<HTMLInputAttributes, 'class' | 'size'> {
|
|
17
|
+
size?: Size;
|
|
18
|
+
variant?: Variant;
|
|
19
|
+
invalid?: boolean;
|
|
20
|
+
class?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const Input: import("svelte").Component<Props, {}, "value">;
|
|
23
|
+
type Input = ReturnType<typeof Input>;
|
|
24
|
+
export default Input;
|
|
25
|
+
//# sourceMappingURL=Input.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Input/Input.svelte.ts"],"names":[],"mappings":"AAKE,KAAK,IAAI,GAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAClC,KAAK,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpC,eAAO,MAAM,aAAa;;;;;;;;;;yBAiBxB,CAAC;AAEH,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,UAAU,KAAM,SAAQ,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,CAAC;IACjE,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgCH,QAAA,MAAM,KAAK,gDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Popover } from 'bits-ui';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type BitsContentProps = ComponentProps<typeof Popover.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
|
+
PopoverContent renders via a Portal (managed by bits-ui) that wraps:
|
|
16
|
+
Popover.Content — the floating panel with ARIA and positioning via Bits UI.
|
|
17
|
+
|
|
18
|
+
Portal defaults to document.body, keeping z-index stacking clean.
|
|
19
|
+
-->
|
|
20
|
+
<Popover.Portal>
|
|
21
|
+
<Popover.Content
|
|
22
|
+
class={['sve-popover-content', cls].filter(Boolean).join(' ')}
|
|
23
|
+
{children}
|
|
24
|
+
{...rest}
|
|
25
|
+
/>
|
|
26
|
+
</Popover.Portal>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
:global(.sve-popover-content) {
|
|
30
|
+
background-color: var(--sve-color-default-surface, #fff);
|
|
31
|
+
border: 1px solid var(--sve-color-default-border, #e5e7eb);
|
|
32
|
+
border-radius: var(--sve-radius-md);
|
|
33
|
+
box-shadow: var(--sve-shadow-md);
|
|
34
|
+
padding: var(--sve-space-4);
|
|
35
|
+
/* z-index convention: Dialog overlay=50/content=51, Dropdown/Popover=60, Tooltip=70 */
|
|
36
|
+
z-index: 60;
|
|
37
|
+
min-width: 10rem;
|
|
38
|
+
max-width: 20rem;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Popover } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type BitsContentProps = ComponentProps<typeof Popover.Content>;
|
|
4
|
+
interface Props extends Omit<BitsContentProps, 'class'> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const PopoverContent: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type PopoverContent = ReturnType<typeof PopoverContent>;
|
|
9
|
+
export default PopoverContent;
|
|
10
|
+
//# sourceMappingURL=PopoverContent.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverContent.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Popover/PopoverContent.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3C,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/D,UAAU,KAAM,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmBH,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover namespace — sve-ui styled wrappers over bits-ui Popover primitives.
|
|
3
|
+
*
|
|
4
|
+
* Root, Trigger, Close: re-exported as-is (behavior-only, Bits UI owns ARIA + positioning).
|
|
5
|
+
* Content: styled wrapper adding --sve-* token styles.
|
|
6
|
+
* Content wraps Portal + Bits Content internally (consumers don't manage portaling).
|
|
7
|
+
* Arrow: re-exported as-is for consumers who want a pointer arrow on the popover.
|
|
8
|
+
*
|
|
9
|
+
* Confirmed Bits UI 2.x API:
|
|
10
|
+
* import { Popover } from 'bits-ui'
|
|
11
|
+
* Popover.Root / Trigger / Close / Content / Arrow / Portal
|
|
12
|
+
*/
|
|
13
|
+
import type { Component } from 'svelte';
|
|
14
|
+
import type { PopoverRootProps, PopoverTriggerProps, PopoverCloseProps, PopoverArrowProps } from 'bits-ui';
|
|
15
|
+
export declare const Root: Component<PopoverRootProps>;
|
|
16
|
+
export declare const Trigger: Component<PopoverTriggerProps>;
|
|
17
|
+
export declare const Close: Component<PopoverCloseProps>;
|
|
18
|
+
export declare const Arrow: Component<PopoverArrowProps>;
|
|
19
|
+
export { default as Content } from './PopoverContent.svelte';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Popover/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,IAAI,EAAE,SAAS,CAAC,gBAAgB,CAAmD,CAAC;AACjG,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,mBAAmB,CAAyD,CAAC;AAC7G,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAqD,CAAC;AAErG,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAqD,CAAC;AAErG,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover namespace — sve-ui styled wrappers over bits-ui Popover primitives.
|
|
3
|
+
*
|
|
4
|
+
* Root, Trigger, Close: re-exported as-is (behavior-only, Bits UI owns ARIA + positioning).
|
|
5
|
+
* Content: styled wrapper adding --sve-* token styles.
|
|
6
|
+
* Content wraps Portal + Bits Content internally (consumers don't manage portaling).
|
|
7
|
+
* Arrow: re-exported as-is for consumers who want a pointer arrow on the popover.
|
|
8
|
+
*
|
|
9
|
+
* Confirmed Bits UI 2.x API:
|
|
10
|
+
* import { Popover } from 'bits-ui'
|
|
11
|
+
* Popover.Root / Trigger / Close / Content / Arrow / Portal
|
|
12
|
+
*/
|
|
13
|
+
import { Popover as BitsPopover } from 'bits-ui';
|
|
14
|
+
// Behavior re-exports — cast to portable Component types to avoid referencing
|
|
15
|
+
// bits-ui internal types (OnChangeFn) in the exported declaration.
|
|
16
|
+
export const Root = BitsPopover.Root;
|
|
17
|
+
export const Trigger = BitsPopover.Trigger;
|
|
18
|
+
export const Close = BitsPopover.Close;
|
|
19
|
+
// Arrow: bits-ui floating-ui arrow for visual pointer; positioning is automatic.
|
|
20
|
+
export const Arrow = BitsPopover.Arrow;
|
|
21
|
+
export { default as Content } from './PopoverContent.svelte';
|