@sprawlify/svelte 0.0.109 → 0.0.110
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/components/alert-dialog/alert-dialog-anatomy.d.ts +2 -2
- package/dist/components/anatomy.d.ts +1 -1
- package/dist/components/anatomy.js +1 -1
- package/dist/components/carousel/carousel-anatomy.d.ts +1 -1
- package/dist/components/checkbox/checkbox-anatomy.d.ts +1 -1
- package/dist/components/color-picker/color-picker-anatomy.d.ts +1 -1
- package/dist/components/combobox/combobox-anatomy.d.ts +1 -1
- package/dist/components/drawer/drawer-anatomy.d.ts +1 -0
- package/dist/components/drawer/drawer-anatomy.js +1 -0
- package/dist/components/{bottom-sheet/bottom-sheet-backdrop.svelte → drawer/drawer-backdrop.svelte} +7 -7
- package/dist/components/drawer/drawer-backdrop.svelte.d.ts +9 -0
- package/dist/components/drawer/drawer-close-trigger.svelte +19 -0
- package/dist/components/drawer/drawer-close-trigger.svelte.d.ts +8 -0
- package/dist/components/{bottom-sheet/bottom-sheet-content.svelte → drawer/drawer-content.svelte} +8 -8
- package/dist/components/drawer/drawer-content.svelte.d.ts +10 -0
- package/dist/components/drawer/drawer-context.svelte +18 -0
- package/dist/components/drawer/drawer-context.svelte.d.ts +8 -0
- package/dist/components/drawer/drawer-grabber-indicator.svelte +20 -0
- package/dist/components/drawer/drawer-grabber-indicator.svelte.d.ts +8 -0
- package/dist/components/drawer/drawer-grabber.svelte +19 -0
- package/dist/components/drawer/drawer-grabber.svelte.d.ts +8 -0
- package/dist/components/{bottom-sheet/bottom-sheet-root-provider.svelte → drawer/drawer-root-provider.svelte} +7 -7
- package/dist/components/drawer/drawer-root-provider.svelte.d.ts +11 -0
- package/dist/components/{bottom-sheet/bottom-sheet-root.svelte → drawer/drawer-root.svelte} +10 -10
- package/dist/components/drawer/drawer-root.svelte.d.ts +11 -0
- package/dist/components/drawer/drawer-title.svelte +19 -0
- package/dist/components/drawer/drawer-title.svelte.d.ts +8 -0
- package/dist/components/drawer/drawer-trigger.svelte +29 -0
- package/dist/components/drawer/drawer-trigger.svelte.d.ts +8 -0
- package/dist/components/drawer/drawer.d.ts +11 -0
- package/dist/components/drawer/drawer.js +10 -0
- package/dist/components/drawer/index.d.ts +15 -0
- package/dist/components/drawer/index.js +14 -0
- package/dist/components/drawer/use-drawer-context.d.ts +4 -0
- package/dist/components/drawer/use-drawer-context.js +4 -0
- package/dist/components/drawer/use-drawer.svelte.d.ts +9 -0
- package/dist/components/{bottom-sheet/use-bottom-sheet.svelte.js → drawer/use-drawer.svelte.js} +4 -4
- package/dist/components/listbox/listbox-anatomy.d.ts +1 -1
- package/dist/components/tour/tour-anatomy.d.ts +1 -1
- package/package.json +7 -7
- package/dist/components/bottom-sheet/bottom-sheet-anatomy.d.ts +0 -1
- package/dist/components/bottom-sheet/bottom-sheet-anatomy.js +0 -1
- package/dist/components/bottom-sheet/bottom-sheet-backdrop.svelte.d.ts +0 -9
- package/dist/components/bottom-sheet/bottom-sheet-close-trigger.svelte +0 -19
- package/dist/components/bottom-sheet/bottom-sheet-close-trigger.svelte.d.ts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet-content.svelte.d.ts +0 -10
- package/dist/components/bottom-sheet/bottom-sheet-context.svelte +0 -18
- package/dist/components/bottom-sheet/bottom-sheet-context.svelte.d.ts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet-grabber-indicator.svelte +0 -20
- package/dist/components/bottom-sheet/bottom-sheet-grabber-indicator.svelte.d.ts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet-grabber.svelte +0 -19
- package/dist/components/bottom-sheet/bottom-sheet-grabber.svelte.d.ts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet-root-provider.svelte.d.ts +0 -11
- package/dist/components/bottom-sheet/bottom-sheet-root.svelte.d.ts +0 -11
- package/dist/components/bottom-sheet/bottom-sheet-title.svelte +0 -19
- package/dist/components/bottom-sheet/bottom-sheet-title.svelte.d.ts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet-trigger.svelte +0 -29
- package/dist/components/bottom-sheet/bottom-sheet-trigger.svelte.d.ts +0 -8
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -11
- package/dist/components/bottom-sheet/bottom-sheet.js +0 -10
- package/dist/components/bottom-sheet/index.d.ts +0 -15
- package/dist/components/bottom-sheet/index.js +0 -14
- package/dist/components/bottom-sheet/use-bottom-sheet-context.d.ts +0 -4
- package/dist/components/bottom-sheet/use-bottom-sheet-context.js +0 -4
- package/dist/components/bottom-sheet/use-bottom-sheet.svelte.d.ts +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const alertDialogAnatomy: import("@sprawlify/primitives/anatomy").Anatomy<"description" | "title" | "content" | "trigger" | "
|
|
2
|
-
export declare const parts: Record<"description" | "title" | "content" | "trigger" | "
|
|
1
|
+
export declare const alertDialogAnatomy: import("@sprawlify/primitives/anatomy").Anatomy<"description" | "title" | "content" | "trigger" | "positioner" | "closeTrigger" | "backdrop">;
|
|
2
|
+
export declare const parts: Record<"description" | "title" | "content" | "trigger" | "positioner" | "closeTrigger" | "backdrop", import("@sprawlify/primitives/anatomy").AnatomyPart>;
|
|
@@ -4,7 +4,7 @@ export { alertDialogAnatomy } from "./alert-dialog/alert-dialog-anatomy";
|
|
|
4
4
|
export { angleSliderAnatomy } from "./angle-slider/angle-slider-anatomy";
|
|
5
5
|
export { aspectRatioAnatomy } from "./aspect-ratio/aspect-ratio-anatomy";
|
|
6
6
|
export { avatarAnatomy } from "./avatar/avatar-anatomy";
|
|
7
|
-
export {
|
|
7
|
+
export { drawerAnatomy } from "./drawer/drawer-anatomy";
|
|
8
8
|
export { carouselAnatomy } from "./carousel/carousel-anatomy";
|
|
9
9
|
export { checkboxAnatomy } from "./checkbox/checkbox-anatomy";
|
|
10
10
|
export { clipboardAnatomy } from "./clipboard/clipboard-anatomy";
|
|
@@ -4,7 +4,7 @@ export { alertDialogAnatomy } from "./alert-dialog/alert-dialog-anatomy";
|
|
|
4
4
|
export { angleSliderAnatomy } from "./angle-slider/angle-slider-anatomy";
|
|
5
5
|
export { aspectRatioAnatomy } from "./aspect-ratio/aspect-ratio-anatomy";
|
|
6
6
|
export { avatarAnatomy } from "./avatar/avatar-anatomy";
|
|
7
|
-
export {
|
|
7
|
+
export { drawerAnatomy } from "./drawer/drawer-anatomy";
|
|
8
8
|
export { carouselAnatomy } from "./carousel/carousel-anatomy";
|
|
9
9
|
export { checkboxAnatomy } from "./checkbox/checkbox-anatomy";
|
|
10
10
|
export { clipboardAnatomy } from "./clipboard/clipboard-anatomy";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const carouselAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"root" | "
|
|
1
|
+
export declare const carouselAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"root" | "control" | "indicator" | "itemGroup" | "item" | "nextTrigger" | "prevTrigger" | "indicatorGroup" | "autoplayTrigger" | "progressText" | "autoplayIndicator">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const checkboxAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "root" | "
|
|
1
|
+
export declare const checkboxAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "root" | "control" | "indicator" | "group">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const colorPickerAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "area" | "view" | "content" | "trigger" | "positioner" | "root" | "control" | "valueText" | "
|
|
1
|
+
export declare const colorPickerAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "area" | "view" | "content" | "trigger" | "positioner" | "root" | "control" | "valueText" | "areaThumb" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const comboboxAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "input" | "content" | "trigger" | "positioner" | "root" | "control" | "
|
|
1
|
+
export declare const comboboxAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "input" | "content" | "trigger" | "positioner" | "root" | "control" | "itemGroup" | "item" | "clearTrigger" | "list" | "itemText" | "itemIndicator" | "itemGroupLabel" | "empty">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anatomy as drawerAnatomy } from "@sprawlify/primitives/machines/drawer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anatomy as drawerAnatomy } from "@sprawlify/primitives/machines/drawer";
|
package/dist/components/{bottom-sheet/bottom-sheet-backdrop.svelte → drawer/drawer-backdrop.svelte}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface DrawerBackdropBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
5
5
|
ref?: Element | null
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface DrawerBackdropProps extends Assign<HTMLProps<'div'>, DrawerBackdropBaseProps> {}
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
import { mergeProps } from '../../core'
|
|
13
13
|
import { Sprawlify } from '../factory'
|
|
14
14
|
import { usePresence } from '../presence'
|
|
15
|
-
import {
|
|
15
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
16
16
|
|
|
17
|
-
let { ref = $bindable(null), ...props }:
|
|
17
|
+
let { ref = $bindable(null), ...props }: DrawerBackdropProps = $props()
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const drawer = useDrawerContext()
|
|
20
20
|
const renderStrategyProps = useRenderStrategyPropsContext()
|
|
21
21
|
|
|
22
|
-
const presence = usePresence(() => ({ ...renderStrategyProps, present:
|
|
23
|
-
const mergedProps = $derived(mergeProps(
|
|
22
|
+
const presence = usePresence(() => ({ ...renderStrategyProps, present: drawer().open }))
|
|
23
|
+
const mergedProps = $derived(mergeProps(drawer().getBackdropProps(), presence().getPresenceProps(), props))
|
|
24
24
|
|
|
25
25
|
function setNode(node: Element | null) {
|
|
26
26
|
presence().setNode(node)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface DrawerBackdropBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
+
ref?: Element | null;
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerBackdropProps extends Assign<HTMLProps<'div'>, DrawerBackdropBaseProps> {
|
|
6
|
+
}
|
|
7
|
+
declare const DrawerBackdrop: import("svelte").Component<DrawerBackdropProps, {}, "ref">;
|
|
8
|
+
type DrawerBackdrop = ReturnType<typeof DrawerBackdrop>;
|
|
9
|
+
export default DrawerBackdrop;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
|
|
4
|
+
export interface DrawerCloseTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {}
|
|
5
|
+
export interface DrawerCloseTriggerProps extends Assign<HTMLProps<'button'>, DrawerCloseTriggerBaseProps> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { mergeProps } from '../../core'
|
|
10
|
+
import { Sprawlify } from '../factory'
|
|
11
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
12
|
+
|
|
13
|
+
let { ref = $bindable(null), ...props }: DrawerCloseTriggerProps = $props()
|
|
14
|
+
|
|
15
|
+
const drawer = useDrawerContext()
|
|
16
|
+
const mergedProps = $derived(mergeProps(drawer().getCloseTriggerProps(), props))
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Sprawlify as="button" bind:ref {...mergedProps} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface DrawerCloseTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {
|
|
3
|
+
}
|
|
4
|
+
export interface DrawerCloseTriggerProps extends Assign<HTMLProps<'button'>, DrawerCloseTriggerBaseProps> {
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerCloseTrigger: import("svelte").Component<DrawerCloseTriggerProps, {}, "ref">;
|
|
7
|
+
type DrawerCloseTrigger = ReturnType<typeof DrawerCloseTrigger>;
|
|
8
|
+
export default DrawerCloseTrigger;
|
package/dist/components/{bottom-sheet/bottom-sheet-content.svelte → drawer/drawer-content.svelte}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
-
import type { ContentProps } from '@sprawlify/primitives/machines/
|
|
3
|
+
import type { ContentProps } from '@sprawlify/primitives/machines/drawer'
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface DrawerContentBaseProps extends PolymorphicProps<'div'>, ContentProps, RefAttribute {
|
|
6
6
|
ref?: Element | null
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
9
|
-
extends Assign<Omit<HTMLProps<'div'>, 'draggable'>,
|
|
8
|
+
export interface DrawerContentProps
|
|
9
|
+
extends Assign<Omit<HTMLProps<'div'>, 'draggable'>, DrawerContentBaseProps> {}
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<script lang="ts">
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
import { Sprawlify } from '../factory'
|
|
15
15
|
import { usePresenceContext } from '../presence'
|
|
16
16
|
import { createSplitProps } from '../../utils/create-split-props'
|
|
17
|
-
import {
|
|
17
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
18
18
|
|
|
19
|
-
let { ref = $bindable(null), ...props }:
|
|
19
|
+
let { ref = $bindable(null), ...props }: DrawerContentProps = $props()
|
|
20
20
|
|
|
21
21
|
const [contentProps, localProps] = $derived(createSplitProps<ContentProps>()(props, ['draggable']))
|
|
22
|
-
const
|
|
22
|
+
const drawer = useDrawerContext()
|
|
23
23
|
const presence = usePresenceContext()
|
|
24
24
|
const mergedProps = $derived(
|
|
25
25
|
mergeProps(
|
|
26
|
-
|
|
26
|
+
drawer().getContentProps({ draggable: true, ...contentProps }),
|
|
27
27
|
presence().getPresenceProps(),
|
|
28
28
|
localProps,
|
|
29
29
|
),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
import type { ContentProps } from '@sprawlify/primitives/machines/drawer';
|
|
3
|
+
export interface DrawerContentBaseProps extends PolymorphicProps<'div'>, ContentProps, RefAttribute {
|
|
4
|
+
ref?: Element | null;
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerContentProps extends Assign<Omit<HTMLProps<'div'>, 'draggable'>, DrawerContentBaseProps> {
|
|
7
|
+
}
|
|
8
|
+
declare const DrawerContent: import("svelte").Component<DrawerContentProps, {}, "ref">;
|
|
9
|
+
type DrawerContent = ReturnType<typeof DrawerContent>;
|
|
10
|
+
export default DrawerContent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { UseDrawerContext } from './use-drawer-context'
|
|
4
|
+
|
|
5
|
+
export interface DrawerContextProps {
|
|
6
|
+
children: Snippet<[UseDrawerContext]>
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
12
|
+
|
|
13
|
+
const { children }: DrawerContextProps = $props()
|
|
14
|
+
|
|
15
|
+
const drawer = useDrawerContext()
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{@render children(drawer)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { UseDrawerContext } from './use-drawer-context';
|
|
3
|
+
export interface DrawerContextProps {
|
|
4
|
+
children: Snippet<[UseDrawerContext]>;
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerContext: import("svelte").Component<DrawerContextProps, {}, "">;
|
|
7
|
+
type DrawerContext = ReturnType<typeof DrawerContext>;
|
|
8
|
+
export default DrawerContext;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
|
|
4
|
+
export interface DrawerGrabberIndicatorBaseProps extends PolymorphicProps<'div'>, RefAttribute {}
|
|
5
|
+
export interface DrawerGrabberIndicatorProps
|
|
6
|
+
extends Assign<HTMLProps<'div'>, DrawerGrabberIndicatorBaseProps> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { mergeProps } from '../../core'
|
|
11
|
+
import { Sprawlify } from '../factory'
|
|
12
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
13
|
+
|
|
14
|
+
let { ref = $bindable(null), ...props }: DrawerGrabberIndicatorProps = $props()
|
|
15
|
+
|
|
16
|
+
const drawer = useDrawerContext()
|
|
17
|
+
const mergedProps = $derived(mergeProps(drawer().getGrabberIndicatorProps(), props))
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<Sprawlify as="div" bind:ref {...mergedProps} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface DrawerGrabberIndicatorBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
+
}
|
|
4
|
+
export interface DrawerGrabberIndicatorProps extends Assign<HTMLProps<'div'>, DrawerGrabberIndicatorBaseProps> {
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerGrabberIndicator: import("svelte").Component<DrawerGrabberIndicatorProps, {}, "ref">;
|
|
7
|
+
type DrawerGrabberIndicator = ReturnType<typeof DrawerGrabberIndicator>;
|
|
8
|
+
export default DrawerGrabberIndicator;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
|
|
4
|
+
export interface DrawerGrabberBaseProps extends PolymorphicProps<'div'>, RefAttribute {}
|
|
5
|
+
export interface DrawerGrabberProps extends Assign<HTMLProps<'div'>, DrawerGrabberBaseProps> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { mergeProps } from '../../core'
|
|
10
|
+
import { Sprawlify } from '../factory'
|
|
11
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
12
|
+
|
|
13
|
+
let { ref = $bindable(null), ...props }: DrawerGrabberProps = $props()
|
|
14
|
+
|
|
15
|
+
const drawer = useDrawerContext()
|
|
16
|
+
const mergedProps = $derived(mergeProps(drawer().getGrabberProps(), props))
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Sprawlify as="div" bind:ref {...mergedProps} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface DrawerGrabberBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
+
}
|
|
4
|
+
export interface DrawerGrabberProps extends Assign<HTMLProps<'div'>, DrawerGrabberBaseProps> {
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerGrabber: import("svelte").Component<DrawerGrabberProps, {}, "ref">;
|
|
7
|
+
type DrawerGrabber = ReturnType<typeof DrawerGrabber>;
|
|
8
|
+
export default DrawerGrabber;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
|
-
import type {
|
|
3
|
+
import type { UseDrawerReturn } from './use-drawer.svelte'
|
|
4
4
|
|
|
5
|
-
export interface
|
|
6
|
-
value:
|
|
5
|
+
export interface DrawerRootProviderBaseProps {
|
|
6
|
+
value: UseDrawerReturn
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface DrawerRootProviderProps extends DrawerRootProviderBaseProps {
|
|
9
9
|
children?: Snippet
|
|
10
10
|
}
|
|
11
11
|
</script>
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
import { RenderStrategyPropsProvider, splitRenderStrategyProps } from '../../utils/render-strategy'
|
|
15
15
|
import { PresenceProvider, usePresence } from '../presence'
|
|
16
16
|
import { splitPresenceProps } from '../presence/split-presence-props.svelte'
|
|
17
|
-
import {
|
|
17
|
+
import { DrawerSheetProvider } from './use-drawer-context'
|
|
18
18
|
|
|
19
|
-
let { value, children, ...props }:
|
|
19
|
+
let { value, children, ...props }: DrawerRootProviderProps = $props()
|
|
20
20
|
|
|
21
21
|
const [presenceProps] = $derived(splitPresenceProps(props))
|
|
22
22
|
const [renderStrategyProps] = $derived(splitRenderStrategyProps(presenceProps))
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
const presence = usePresence(() => presenceMachineProps)
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
DrawerSheetProvider(value)
|
|
32
32
|
RenderStrategyPropsProvider(() => renderStrategyProps)
|
|
33
33
|
PresenceProvider(presence)
|
|
34
34
|
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { UseDrawerReturn } from './use-drawer.svelte';
|
|
3
|
+
export interface DrawerRootProviderBaseProps {
|
|
4
|
+
value: UseDrawerReturn;
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerRootProviderProps extends DrawerRootProviderBaseProps {
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
declare const DrawerRootProvider: import("svelte").Component<DrawerRootProviderProps, {}, "">;
|
|
10
|
+
type DrawerRootProvider = ReturnType<typeof DrawerRootProvider>;
|
|
11
|
+
export default DrawerRootProvider;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
3
|
import type { UsePresenceProps } from '../presence'
|
|
4
|
-
import type {
|
|
4
|
+
import type { UseDrawerProps } from './use-drawer.svelte'
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
export interface
|
|
6
|
+
export interface DrawerRootBaseProps extends UseDrawerProps, UsePresenceProps {}
|
|
7
|
+
export interface DrawerRootProps extends DrawerRootBaseProps {
|
|
8
8
|
children?: Snippet
|
|
9
9
|
}
|
|
10
10
|
</script>
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
import { PresenceProvider, usePresence } from '../presence'
|
|
14
14
|
import { splitPresenceProps } from '../presence/split-presence-props.svelte'
|
|
15
15
|
import { RenderStrategyPropsProvider, splitRenderStrategyProps } from '../../utils/render-strategy'
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { DrawerSheetProvider } from './use-drawer-context'
|
|
17
|
+
import { useDrawer } from './use-drawer.svelte'
|
|
18
18
|
|
|
19
|
-
let { open = $bindable(), children, ...props }:
|
|
19
|
+
let { open = $bindable(), children, ...props }: DrawerRootProps = $props()
|
|
20
20
|
|
|
21
21
|
const providedId = $props.id()
|
|
22
22
|
|
|
23
23
|
const [presenceProps, localProps] = $derived(splitPresenceProps(props))
|
|
24
24
|
const [renderStrategyProps] = $derived(splitRenderStrategyProps(presenceProps))
|
|
25
25
|
|
|
26
|
-
const machineProps = $derived.by<
|
|
26
|
+
const machineProps = $derived.by<UseDrawerProps>(() => {
|
|
27
27
|
return {
|
|
28
28
|
...localProps,
|
|
29
29
|
id: localProps.id ?? providedId,
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
}
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const drawer = useDrawer(() => machineProps)
|
|
39
39
|
|
|
40
40
|
const presenceMachineProps = $derived.by<UsePresenceProps>(() => ({
|
|
41
41
|
...presenceProps,
|
|
42
|
-
present:
|
|
42
|
+
present: drawer().open,
|
|
43
43
|
}))
|
|
44
44
|
|
|
45
45
|
const presence = usePresence(() => presenceMachineProps)
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
DrawerSheetProvider(drawer)
|
|
48
48
|
RenderStrategyPropsProvider(() => renderStrategyProps)
|
|
49
49
|
PresenceProvider(presence)
|
|
50
50
|
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { UsePresenceProps } from '../presence';
|
|
3
|
+
import type { UseDrawerProps } from './use-drawer.svelte';
|
|
4
|
+
export interface DrawerRootBaseProps extends UseDrawerProps, UsePresenceProps {
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerRootProps extends DrawerRootBaseProps {
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
declare const DrawerRoot: import("svelte").Component<DrawerRootProps, {}, "open">;
|
|
10
|
+
type DrawerRoot = ReturnType<typeof DrawerRoot>;
|
|
11
|
+
export default DrawerRoot;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
|
|
4
|
+
export interface DrawerTitleBaseProps extends PolymorphicProps<'h2'>, RefAttribute {}
|
|
5
|
+
export interface DrawerTitleProps extends Assign<HTMLProps<'h2'>, DrawerTitleBaseProps> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { mergeProps } from '../../core'
|
|
10
|
+
import { Sprawlify } from '../factory'
|
|
11
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
12
|
+
|
|
13
|
+
let { ref = $bindable(null), ...props }: DrawerTitleProps = $props()
|
|
14
|
+
|
|
15
|
+
const drawer = useDrawerContext()
|
|
16
|
+
const mergedProps = $derived(mergeProps(drawer().getTitleProps(), props))
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Sprawlify as="h2" bind:ref {...mergedProps} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface DrawerTitleBaseProps extends PolymorphicProps<'h2'>, RefAttribute {
|
|
3
|
+
}
|
|
4
|
+
export interface DrawerTitleProps extends Assign<HTMLProps<'h2'>, DrawerTitleBaseProps> {
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerTitle: import("svelte").Component<DrawerTitleProps, {}, "ref">;
|
|
7
|
+
type DrawerTitle = ReturnType<typeof DrawerTitle>;
|
|
8
|
+
export default DrawerTitle;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
|
|
4
|
+
export interface DrawerTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {}
|
|
5
|
+
export interface DrawerTriggerProps extends Assign<HTMLProps<'button'>, DrawerTriggerBaseProps> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { mergeProps } from '../../core'
|
|
10
|
+
import { Sprawlify } from '../factory'
|
|
11
|
+
import { usePresenceContext } from '../presence'
|
|
12
|
+
import { useDrawerContext } from './use-drawer-context'
|
|
13
|
+
|
|
14
|
+
let { ref = $bindable(null), ...props }: DrawerTriggerProps = $props()
|
|
15
|
+
|
|
16
|
+
const drawer = useDrawerContext()
|
|
17
|
+
const presence = usePresenceContext()
|
|
18
|
+
const mergedProps = $derived(
|
|
19
|
+
mergeProps(
|
|
20
|
+
{
|
|
21
|
+
...drawer().getTriggerProps(),
|
|
22
|
+
'aria-controls': presence().unmounted ? undefined : drawer().getTriggerProps()['aria-controls'],
|
|
23
|
+
},
|
|
24
|
+
props,
|
|
25
|
+
),
|
|
26
|
+
)
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<Sprawlify as="button" bind:ref {...mergedProps} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface DrawerTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {
|
|
3
|
+
}
|
|
4
|
+
export interface DrawerTriggerProps extends Assign<HTMLProps<'button'>, DrawerTriggerBaseProps> {
|
|
5
|
+
}
|
|
6
|
+
declare const DrawerTrigger: import("svelte").Component<DrawerTriggerProps, {}, "ref">;
|
|
7
|
+
type DrawerTrigger = ReturnType<typeof DrawerTrigger>;
|
|
8
|
+
export default DrawerTrigger;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { OpenChangeDetails } from "@sprawlify/primitives/machines/drawer";
|
|
2
|
+
export { default as Backdrop, type DrawerBackdropBaseProps as BackdropBaseProps, type DrawerBackdropProps as BackdropProps, } from "./drawer-backdrop.svelte";
|
|
3
|
+
export { default as CloseTrigger, type DrawerCloseTriggerBaseProps as CloseTriggerBaseProps, type DrawerCloseTriggerProps as CloseTriggerProps, } from "./drawer-close-trigger.svelte";
|
|
4
|
+
export { default as Content, type DrawerContentBaseProps as ContentBaseProps, type DrawerContentProps as ContentProps, } from "./drawer-content.svelte";
|
|
5
|
+
export { default as Context, type DrawerContextProps as ContextProps, } from "./drawer-context.svelte";
|
|
6
|
+
export { default as Grabber, type DrawerGrabberBaseProps as GrabberBaseProps, type DrawerGrabberProps as GrabberProps, } from "./drawer-grabber.svelte";
|
|
7
|
+
export { default as GrabberIndicator, type DrawerGrabberIndicatorBaseProps as GrabberIndicatorBaseProps, type DrawerGrabberIndicatorProps as GrabberIndicatorProps, } from "./drawer-grabber-indicator.svelte";
|
|
8
|
+
export { default as Root, type DrawerRootBaseProps as RootBaseProps, type DrawerRootProps as RootProps, } from "./drawer-root.svelte";
|
|
9
|
+
export { default as RootProvider, type DrawerRootProviderBaseProps as RootProviderBaseProps, type DrawerRootProviderProps as RootProviderProps, } from "./drawer-root-provider.svelte";
|
|
10
|
+
export { default as Title, type DrawerTitleBaseProps as TitleBaseProps, type DrawerTitleProps as TitleProps, } from "./drawer-title.svelte";
|
|
11
|
+
export { default as Trigger, type DrawerTriggerBaseProps as TriggerBaseProps, type DrawerTriggerProps as TriggerProps, } from "./drawer-trigger.svelte";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Backdrop, } from "./drawer-backdrop.svelte";
|
|
2
|
+
export { default as CloseTrigger, } from "./drawer-close-trigger.svelte";
|
|
3
|
+
export { default as Content, } from "./drawer-content.svelte";
|
|
4
|
+
export { default as Context, } from "./drawer-context.svelte";
|
|
5
|
+
export { default as Grabber, } from "./drawer-grabber.svelte";
|
|
6
|
+
export { default as GrabberIndicator, } from "./drawer-grabber-indicator.svelte";
|
|
7
|
+
export { default as Root, } from "./drawer-root.svelte";
|
|
8
|
+
export { default as RootProvider, } from "./drawer-root-provider.svelte";
|
|
9
|
+
export { default as Title, } from "./drawer-title.svelte";
|
|
10
|
+
export { default as Trigger, } from "./drawer-trigger.svelte";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { OpenChangeDetails as DrawerOpenChangeDetails } from "@sprawlify/primitives/machines/drawer";
|
|
2
|
+
export { default as DrawerBackdrop, type DrawerBackdropBaseProps, type DrawerBackdropProps, } from "./drawer-backdrop.svelte";
|
|
3
|
+
export { default as DrawerCloseTrigger, type DrawerCloseTriggerBaseProps, type DrawerCloseTriggerProps, } from "./drawer-close-trigger.svelte";
|
|
4
|
+
export { default as DrawerContent, type DrawerContentBaseProps, type DrawerContentProps, } from "./drawer-content.svelte";
|
|
5
|
+
export { default as DrawerContext, type DrawerContextProps } from "./drawer-context.svelte";
|
|
6
|
+
export { default as DrawerGrabber, type DrawerGrabberBaseProps, type DrawerGrabberProps, } from "./drawer-grabber.svelte";
|
|
7
|
+
export { default as DrawerGrabberIndicator, type DrawerGrabberIndicatorBaseProps, type DrawerGrabberIndicatorProps, } from "./drawer-grabber-indicator.svelte";
|
|
8
|
+
export { default as DrawerRoot, type DrawerRootBaseProps, type DrawerRootProps, } from "./drawer-root.svelte";
|
|
9
|
+
export { default as DrawerRootProvider, type DrawerRootProviderBaseProps, type DrawerRootProviderProps, } from "./drawer-root-provider.svelte";
|
|
10
|
+
export { default as DrawerTitle, type DrawerTitleBaseProps, type DrawerTitleProps, } from "./drawer-title.svelte";
|
|
11
|
+
export { default as DrawerTrigger, type DrawerTriggerBaseProps, type DrawerTriggerProps, } from "./drawer-trigger.svelte";
|
|
12
|
+
export { drawerAnatomy } from "./drawer-anatomy";
|
|
13
|
+
export { useDrawerContext, type UseDrawerContext } from "./use-drawer-context";
|
|
14
|
+
export { useDrawer, type UseDrawerProps, type UseDrawerReturn } from "./use-drawer.svelte";
|
|
15
|
+
export * as Drawer from "./drawer";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as DrawerBackdrop, } from "./drawer-backdrop.svelte";
|
|
2
|
+
export { default as DrawerCloseTrigger, } from "./drawer-close-trigger.svelte";
|
|
3
|
+
export { default as DrawerContent, } from "./drawer-content.svelte";
|
|
4
|
+
export { default as DrawerContext } from "./drawer-context.svelte";
|
|
5
|
+
export { default as DrawerGrabber, } from "./drawer-grabber.svelte";
|
|
6
|
+
export { default as DrawerGrabberIndicator, } from "./drawer-grabber-indicator.svelte";
|
|
7
|
+
export { default as DrawerRoot, } from "./drawer-root.svelte";
|
|
8
|
+
export { default as DrawerRootProvider, } from "./drawer-root-provider.svelte";
|
|
9
|
+
export { default as DrawerTitle, } from "./drawer-title.svelte";
|
|
10
|
+
export { default as DrawerTrigger, } from "./drawer-trigger.svelte";
|
|
11
|
+
export { drawerAnatomy } from "./drawer-anatomy";
|
|
12
|
+
export { useDrawerContext } from "./use-drawer-context";
|
|
13
|
+
export { useDrawer } from "./use-drawer.svelte";
|
|
14
|
+
export * as Drawer from "./drawer";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UseDrawerReturn } from "./use-drawer.svelte";
|
|
2
|
+
export interface UseDrawerContext extends UseDrawerReturn {
|
|
3
|
+
}
|
|
4
|
+
export declare const DrawerSheetProvider: (opts: UseDrawerContext) => void, useDrawerContext: (fallback?: UseDrawerContext | undefined) => UseDrawerContext;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Accessor, Optional } from "../../types";
|
|
2
|
+
import * as drawer from "@sprawlify/primitives/machines/drawer";
|
|
3
|
+
import { type PropTypes } from "../../core";
|
|
4
|
+
import { type MaybeFunction } from "@sprawlify/primitives/utils";
|
|
5
|
+
export interface UseDrawerProps extends Optional<Omit<drawer.Props, "getRootNode" | "dir">, "id"> {
|
|
6
|
+
}
|
|
7
|
+
export interface UseDrawerReturn extends Accessor<drawer.Api<PropTypes>> {
|
|
8
|
+
}
|
|
9
|
+
export declare const useDrawer: (props: MaybeFunction<UseDrawerProps>) => UseDrawerReturn;
|
package/dist/components/{bottom-sheet/use-bottom-sheet.svelte.js → drawer/use-drawer.svelte.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEnvironmentContext } from "../../providers/environment";
|
|
2
2
|
import { useLocaleContext } from "../../providers/locale";
|
|
3
|
-
import * as
|
|
3
|
+
import * as drawer from "@sprawlify/primitives/machines/drawer";
|
|
4
4
|
import { normalizeProps, useMachine } from "../../core";
|
|
5
5
|
import { runIfFn } from "@sprawlify/primitives/utils";
|
|
6
|
-
export const
|
|
6
|
+
export const useDrawer = (props) => {
|
|
7
7
|
const env = useEnvironmentContext();
|
|
8
8
|
const locale = useLocaleContext();
|
|
9
9
|
const machineProps = $derived.by(() => {
|
|
@@ -14,7 +14,7 @@ export const useBottomSheet = (props) => {
|
|
|
14
14
|
...resolvedProps,
|
|
15
15
|
};
|
|
16
16
|
});
|
|
17
|
-
const service = useMachine(
|
|
18
|
-
const api = $derived(
|
|
17
|
+
const service = useMachine(drawer.machine, () => machineProps);
|
|
18
|
+
const api = $derived(drawer.connect(service, normalizeProps));
|
|
19
19
|
return () => api;
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const listboxAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "input" | "content" | "root" | "
|
|
1
|
+
export declare const listboxAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"label" | "input" | "content" | "root" | "itemGroup" | "item" | "valueText" | "itemText" | "itemIndicator" | "itemGroupLabel" | "empty">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tourAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"description" | "title" | "content" | "
|
|
1
|
+
export declare const tourAnatomy: import("@sprawlify/primitives/anatomy").AnatomyInstance<"description" | "title" | "content" | "positioner" | "closeTrigger" | "backdrop" | "control" | "progressText" | "actionTrigger" | "arrow" | "arrowTip" | "spotlight">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprawlify/svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"description": "Svelte wrapper for primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "sprawlify <npm@sprawlify.com>",
|
|
@@ -46,11 +46,6 @@
|
|
|
46
46
|
"svelte": "./dist/components/avatar/index.js",
|
|
47
47
|
"default": "./dist/components/avatar/index.js"
|
|
48
48
|
},
|
|
49
|
-
"./bottom-sheet": {
|
|
50
|
-
"types": "./dist/components/bottom-sheet/index.d.ts",
|
|
51
|
-
"svelte": "./dist/components/bottom-sheet/index.js",
|
|
52
|
-
"default": "./dist/components/bottom-sheet/index.js"
|
|
53
|
-
},
|
|
54
49
|
"./carousel": {
|
|
55
50
|
"types": "./dist/components/carousel/index.d.ts",
|
|
56
51
|
"svelte": "./dist/components/carousel/index.js",
|
|
@@ -106,6 +101,11 @@
|
|
|
106
101
|
"svelte": "./dist/components/download-trigger/index.js",
|
|
107
102
|
"default": "./dist/components/download-trigger/index.js"
|
|
108
103
|
},
|
|
104
|
+
"./drawer": {
|
|
105
|
+
"types": "./dist/components/drawer/index.d.ts",
|
|
106
|
+
"svelte": "./dist/components/drawer/index.js",
|
|
107
|
+
"default": "./dist/components/drawer/index.js"
|
|
108
|
+
},
|
|
109
109
|
"./dropdown-menu": {
|
|
110
110
|
"types": "./dist/components/dropdown-menu/index.d.ts",
|
|
111
111
|
"svelte": "./dist/components/dropdown-menu/index.js",
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
"access": "public"
|
|
342
342
|
},
|
|
343
343
|
"dependencies": {
|
|
344
|
-
"@sprawlify/primitives": "0.0.
|
|
344
|
+
"@sprawlify/primitives": "0.0.110"
|
|
345
345
|
},
|
|
346
346
|
"peerDependencies": {
|
|
347
347
|
"svelte": "^5.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { anatomy as bottomSheetAnatomy } from "@sprawlify/primitives/machines/bottom-sheet";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { anatomy as bottomSheetAnatomy } from "@sprawlify/primitives/machines/bottom-sheet";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
-
export interface BottomSheetBackdropBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
-
ref?: Element | null;
|
|
4
|
-
}
|
|
5
|
-
export interface BottomSheetBackdropProps extends Assign<HTMLProps<'div'>, BottomSheetBackdropBaseProps> {
|
|
6
|
-
}
|
|
7
|
-
declare const BottomSheetBackdrop: import("svelte").Component<BottomSheetBackdropProps, {}, "ref">;
|
|
8
|
-
type BottomSheetBackdrop = ReturnType<typeof BottomSheetBackdrop>;
|
|
9
|
-
export default BottomSheetBackdrop;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
-
|
|
4
|
-
export interface BottomSheetCloseTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {}
|
|
5
|
-
export interface BottomSheetCloseTriggerProps extends Assign<HTMLProps<'button'>, BottomSheetCloseTriggerBaseProps> {}
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '../../core'
|
|
10
|
-
import { Sprawlify } from '../factory'
|
|
11
|
-
import { useBottomSheetContext } from './use-bottom-sheet-context'
|
|
12
|
-
|
|
13
|
-
let { ref = $bindable(null), ...props }: BottomSheetCloseTriggerProps = $props()
|
|
14
|
-
|
|
15
|
-
const bottomSheet = useBottomSheetContext()
|
|
16
|
-
const mergedProps = $derived(mergeProps(bottomSheet().getCloseTriggerProps(), props))
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<Sprawlify as="button" bind:ref {...mergedProps} />
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
-
export interface BottomSheetCloseTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {
|
|
3
|
-
}
|
|
4
|
-
export interface BottomSheetCloseTriggerProps extends Assign<HTMLProps<'button'>, BottomSheetCloseTriggerBaseProps> {
|
|
5
|
-
}
|
|
6
|
-
declare const BottomSheetCloseTrigger: import("svelte").Component<BottomSheetCloseTriggerProps, {}, "ref">;
|
|
7
|
-
type BottomSheetCloseTrigger = ReturnType<typeof BottomSheetCloseTrigger>;
|
|
8
|
-
export default BottomSheetCloseTrigger;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
-
import type { ContentProps } from '@sprawlify/primitives/machines/bottom-sheet';
|
|
3
|
-
export interface BottomSheetContentBaseProps extends PolymorphicProps<'div'>, ContentProps, RefAttribute {
|
|
4
|
-
ref?: Element | null;
|
|
5
|
-
}
|
|
6
|
-
export interface BottomSheetContentProps extends Assign<Omit<HTMLProps<'div'>, 'draggable'>, BottomSheetContentBaseProps> {
|
|
7
|
-
}
|
|
8
|
-
declare const BottomSheetContent: import("svelte").Component<BottomSheetContentProps, {}, "ref">;
|
|
9
|
-
type BottomSheetContent = ReturnType<typeof BottomSheetContent>;
|
|
10
|
-
export default BottomSheetContent;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte'
|
|
3
|
-
import type { UseBottomSheetContext } from './use-bottom-sheet-context'
|
|
4
|
-
|
|
5
|
-
export interface BottomSheetContextProps {
|
|
6
|
-
children: Snippet<[UseBottomSheetContext]>
|
|
7
|
-
}
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<script lang="ts">
|
|
11
|
-
import { useBottomSheetContext } from './use-bottom-sheet-context'
|
|
12
|
-
|
|
13
|
-
const { children }: BottomSheetContextProps = $props()
|
|
14
|
-
|
|
15
|
-
const bottomSheet = useBottomSheetContext()
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
{@render children(bottomSheet)}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { UseBottomSheetContext } from './use-bottom-sheet-context';
|
|
3
|
-
export interface BottomSheetContextProps {
|
|
4
|
-
children: Snippet<[UseBottomSheetContext]>;
|
|
5
|
-
}
|
|
6
|
-
declare const BottomSheetContext: import("svelte").Component<BottomSheetContextProps, {}, "">;
|
|
7
|
-
type BottomSheetContext = ReturnType<typeof BottomSheetContext>;
|
|
8
|
-
export default BottomSheetContext;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
-
|
|
4
|
-
export interface BottomSheetGrabberIndicatorBaseProps extends PolymorphicProps<'div'>, RefAttribute {}
|
|
5
|
-
export interface BottomSheetGrabberIndicatorProps
|
|
6
|
-
extends Assign<HTMLProps<'div'>, BottomSheetGrabberIndicatorBaseProps> {}
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
import { mergeProps } from '../../core'
|
|
11
|
-
import { Sprawlify } from '../factory'
|
|
12
|
-
import { useBottomSheetContext } from './use-bottom-sheet-context'
|
|
13
|
-
|
|
14
|
-
let { ref = $bindable(null), ...props }: BottomSheetGrabberIndicatorProps = $props()
|
|
15
|
-
|
|
16
|
-
const bottomSheet = useBottomSheetContext()
|
|
17
|
-
const mergedProps = $derived(mergeProps(bottomSheet().getGrabberIndicatorProps(), props))
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<Sprawlify as="div" bind:ref {...mergedProps} />
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
-
export interface BottomSheetGrabberIndicatorBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
-
}
|
|
4
|
-
export interface BottomSheetGrabberIndicatorProps extends Assign<HTMLProps<'div'>, BottomSheetGrabberIndicatorBaseProps> {
|
|
5
|
-
}
|
|
6
|
-
declare const BottomSheetGrabberIndicator: import("svelte").Component<BottomSheetGrabberIndicatorProps, {}, "ref">;
|
|
7
|
-
type BottomSheetGrabberIndicator = ReturnType<typeof BottomSheetGrabberIndicator>;
|
|
8
|
-
export default BottomSheetGrabberIndicator;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
-
|
|
4
|
-
export interface BottomSheetGrabberBaseProps extends PolymorphicProps<'div'>, RefAttribute {}
|
|
5
|
-
export interface BottomSheetGrabberProps extends Assign<HTMLProps<'div'>, BottomSheetGrabberBaseProps> {}
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '../../core'
|
|
10
|
-
import { Sprawlify } from '../factory'
|
|
11
|
-
import { useBottomSheetContext } from './use-bottom-sheet-context'
|
|
12
|
-
|
|
13
|
-
let { ref = $bindable(null), ...props }: BottomSheetGrabberProps = $props()
|
|
14
|
-
|
|
15
|
-
const bottomSheet = useBottomSheetContext()
|
|
16
|
-
const mergedProps = $derived(mergeProps(bottomSheet().getGrabberProps(), props))
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<Sprawlify as="div" bind:ref {...mergedProps} />
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
-
export interface BottomSheetGrabberBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
-
}
|
|
4
|
-
export interface BottomSheetGrabberProps extends Assign<HTMLProps<'div'>, BottomSheetGrabberBaseProps> {
|
|
5
|
-
}
|
|
6
|
-
declare const BottomSheetGrabber: import("svelte").Component<BottomSheetGrabberProps, {}, "ref">;
|
|
7
|
-
type BottomSheetGrabber = ReturnType<typeof BottomSheetGrabber>;
|
|
8
|
-
export default BottomSheetGrabber;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { UseBottomSheetReturn } from './use-bottom-sheet.svelte';
|
|
3
|
-
export interface BottomSheetRootProviderBaseProps {
|
|
4
|
-
value: UseBottomSheetReturn;
|
|
5
|
-
}
|
|
6
|
-
export interface BottomSheetRootProviderProps extends BottomSheetRootProviderBaseProps {
|
|
7
|
-
children?: Snippet;
|
|
8
|
-
}
|
|
9
|
-
declare const BottomSheetRootProvider: import("svelte").Component<BottomSheetRootProviderProps, {}, "">;
|
|
10
|
-
type BottomSheetRootProvider = ReturnType<typeof BottomSheetRootProvider>;
|
|
11
|
-
export default BottomSheetRootProvider;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { UsePresenceProps } from '../presence';
|
|
3
|
-
import type { UseBottomSheetProps } from './use-bottom-sheet.svelte';
|
|
4
|
-
export interface BottomSheetRootBaseProps extends UseBottomSheetProps, UsePresenceProps {
|
|
5
|
-
}
|
|
6
|
-
export interface BottomSheetRootProps extends BottomSheetRootBaseProps {
|
|
7
|
-
children?: Snippet;
|
|
8
|
-
}
|
|
9
|
-
declare const BottomSheetRoot: import("svelte").Component<BottomSheetRootProps, {}, "open">;
|
|
10
|
-
type BottomSheetRoot = ReturnType<typeof BottomSheetRoot>;
|
|
11
|
-
export default BottomSheetRoot;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
-
|
|
4
|
-
export interface BottomSheetTitleBaseProps extends PolymorphicProps<'h2'>, RefAttribute {}
|
|
5
|
-
export interface BottomSheetTitleProps extends Assign<HTMLProps<'h2'>, BottomSheetTitleBaseProps> {}
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '../../core'
|
|
10
|
-
import { Sprawlify } from '../factory'
|
|
11
|
-
import { useBottomSheetContext } from './use-bottom-sheet-context'
|
|
12
|
-
|
|
13
|
-
let { ref = $bindable(null), ...props }: BottomSheetTitleProps = $props()
|
|
14
|
-
|
|
15
|
-
const bottomSheet = useBottomSheetContext()
|
|
16
|
-
const mergedProps = $derived(mergeProps(bottomSheet().getTitleProps(), props))
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<Sprawlify as="h2" bind:ref {...mergedProps} />
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
-
export interface BottomSheetTitleBaseProps extends PolymorphicProps<'h2'>, RefAttribute {
|
|
3
|
-
}
|
|
4
|
-
export interface BottomSheetTitleProps extends Assign<HTMLProps<'h2'>, BottomSheetTitleBaseProps> {
|
|
5
|
-
}
|
|
6
|
-
declare const BottomSheetTitle: import("svelte").Component<BottomSheetTitleProps, {}, "ref">;
|
|
7
|
-
type BottomSheetTitle = ReturnType<typeof BottomSheetTitle>;
|
|
8
|
-
export default BottomSheetTitle;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
-
|
|
4
|
-
export interface BottomSheetTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {}
|
|
5
|
-
export interface BottomSheetTriggerProps extends Assign<HTMLProps<'button'>, BottomSheetTriggerBaseProps> {}
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '../../core'
|
|
10
|
-
import { Sprawlify } from '../factory'
|
|
11
|
-
import { usePresenceContext } from '../presence'
|
|
12
|
-
import { useBottomSheetContext } from './use-bottom-sheet-context'
|
|
13
|
-
|
|
14
|
-
let { ref = $bindable(null), ...props }: BottomSheetTriggerProps = $props()
|
|
15
|
-
|
|
16
|
-
const bottomSheet = useBottomSheetContext()
|
|
17
|
-
const presence = usePresenceContext()
|
|
18
|
-
const mergedProps = $derived(
|
|
19
|
-
mergeProps(
|
|
20
|
-
{
|
|
21
|
-
...bottomSheet().getTriggerProps(),
|
|
22
|
-
'aria-controls': presence().unmounted ? undefined : bottomSheet().getTriggerProps()['aria-controls'],
|
|
23
|
-
},
|
|
24
|
-
props,
|
|
25
|
-
),
|
|
26
|
-
)
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<Sprawlify as="button" bind:ref {...mergedProps} />
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
-
export interface BottomSheetTriggerBaseProps extends PolymorphicProps<'button'>, RefAttribute {
|
|
3
|
-
}
|
|
4
|
-
export interface BottomSheetTriggerProps extends Assign<HTMLProps<'button'>, BottomSheetTriggerBaseProps> {
|
|
5
|
-
}
|
|
6
|
-
declare const BottomSheetTrigger: import("svelte").Component<BottomSheetTriggerProps, {}, "ref">;
|
|
7
|
-
type BottomSheetTrigger = ReturnType<typeof BottomSheetTrigger>;
|
|
8
|
-
export default BottomSheetTrigger;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type { OpenChangeDetails } from "@sprawlify/primitives/machines/bottom-sheet";
|
|
2
|
-
export { default as Backdrop, type BottomSheetBackdropBaseProps as BackdropBaseProps, type BottomSheetBackdropProps as BackdropProps, } from "./bottom-sheet-backdrop.svelte";
|
|
3
|
-
export { default as CloseTrigger, type BottomSheetCloseTriggerBaseProps as CloseTriggerBaseProps, type BottomSheetCloseTriggerProps as CloseTriggerProps, } from "./bottom-sheet-close-trigger.svelte";
|
|
4
|
-
export { default as Content, type BottomSheetContentBaseProps as ContentBaseProps, type BottomSheetContentProps as ContentProps, } from "./bottom-sheet-content.svelte";
|
|
5
|
-
export { default as Context, type BottomSheetContextProps as ContextProps, } from "./bottom-sheet-context.svelte";
|
|
6
|
-
export { default as Grabber, type BottomSheetGrabberBaseProps as GrabberBaseProps, type BottomSheetGrabberProps as GrabberProps, } from "./bottom-sheet-grabber.svelte";
|
|
7
|
-
export { default as GrabberIndicator, type BottomSheetGrabberIndicatorBaseProps as GrabberIndicatorBaseProps, type BottomSheetGrabberIndicatorProps as GrabberIndicatorProps, } from "./bottom-sheet-grabber-indicator.svelte";
|
|
8
|
-
export { default as Root, type BottomSheetRootBaseProps as RootBaseProps, type BottomSheetRootProps as RootProps, } from "./bottom-sheet-root.svelte";
|
|
9
|
-
export { default as RootProvider, type BottomSheetRootProviderBaseProps as RootProviderBaseProps, type BottomSheetRootProviderProps as RootProviderProps, } from "./bottom-sheet-root-provider.svelte";
|
|
10
|
-
export { default as Title, type BottomSheetTitleBaseProps as TitleBaseProps, type BottomSheetTitleProps as TitleProps, } from "./bottom-sheet-title.svelte";
|
|
11
|
-
export { default as Trigger, type BottomSheetTriggerBaseProps as TriggerBaseProps, type BottomSheetTriggerProps as TriggerProps, } from "./bottom-sheet-trigger.svelte";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as Backdrop, } from "./bottom-sheet-backdrop.svelte";
|
|
2
|
-
export { default as CloseTrigger, } from "./bottom-sheet-close-trigger.svelte";
|
|
3
|
-
export { default as Content, } from "./bottom-sheet-content.svelte";
|
|
4
|
-
export { default as Context, } from "./bottom-sheet-context.svelte";
|
|
5
|
-
export { default as Grabber, } from "./bottom-sheet-grabber.svelte";
|
|
6
|
-
export { default as GrabberIndicator, } from "./bottom-sheet-grabber-indicator.svelte";
|
|
7
|
-
export { default as Root, } from "./bottom-sheet-root.svelte";
|
|
8
|
-
export { default as RootProvider, } from "./bottom-sheet-root-provider.svelte";
|
|
9
|
-
export { default as Title, } from "./bottom-sheet-title.svelte";
|
|
10
|
-
export { default as Trigger, } from "./bottom-sheet-trigger.svelte";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type { OpenChangeDetails as BottomSheetOpenChangeDetails } from "@sprawlify/primitives/machines/bottom-sheet";
|
|
2
|
-
export { default as BottomSheetBackdrop, type BottomSheetBackdropBaseProps, type BottomSheetBackdropProps, } from "./bottom-sheet-backdrop.svelte";
|
|
3
|
-
export { default as BottomSheetCloseTrigger, type BottomSheetCloseTriggerBaseProps, type BottomSheetCloseTriggerProps, } from "./bottom-sheet-close-trigger.svelte";
|
|
4
|
-
export { default as BottomSheetContent, type BottomSheetContentBaseProps, type BottomSheetContentProps, } from "./bottom-sheet-content.svelte";
|
|
5
|
-
export { default as BottomSheetContext, type BottomSheetContextProps, } from "./bottom-sheet-context.svelte";
|
|
6
|
-
export { default as BottomSheetGrabber, type BottomSheetGrabberBaseProps, type BottomSheetGrabberProps, } from "./bottom-sheet-grabber.svelte";
|
|
7
|
-
export { default as BottomSheetGrabberIndicator, type BottomSheetGrabberIndicatorBaseProps, type BottomSheetGrabberIndicatorProps, } from "./bottom-sheet-grabber-indicator.svelte";
|
|
8
|
-
export { default as BottomSheetRoot, type BottomSheetRootBaseProps, type BottomSheetRootProps, } from "./bottom-sheet-root.svelte";
|
|
9
|
-
export { default as BottomSheetRootProvider, type BottomSheetRootProviderBaseProps, type BottomSheetRootProviderProps, } from "./bottom-sheet-root-provider.svelte";
|
|
10
|
-
export { default as BottomSheetTitle, type BottomSheetTitleBaseProps, type BottomSheetTitleProps, } from "./bottom-sheet-title.svelte";
|
|
11
|
-
export { default as BottomSheetTrigger, type BottomSheetTriggerBaseProps, type BottomSheetTriggerProps, } from "./bottom-sheet-trigger.svelte";
|
|
12
|
-
export { bottomSheetAnatomy } from "./bottom-sheet-anatomy";
|
|
13
|
-
export { useBottomSheetContext, type UseBottomSheetContext } from "./use-bottom-sheet-context";
|
|
14
|
-
export { useBottomSheet, type UseBottomSheetProps, type UseBottomSheetReturn, } from "./use-bottom-sheet.svelte";
|
|
15
|
-
export * as BottomSheet from "./bottom-sheet";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { default as BottomSheetBackdrop, } from "./bottom-sheet-backdrop.svelte";
|
|
2
|
-
export { default as BottomSheetCloseTrigger, } from "./bottom-sheet-close-trigger.svelte";
|
|
3
|
-
export { default as BottomSheetContent, } from "./bottom-sheet-content.svelte";
|
|
4
|
-
export { default as BottomSheetContext, } from "./bottom-sheet-context.svelte";
|
|
5
|
-
export { default as BottomSheetGrabber, } from "./bottom-sheet-grabber.svelte";
|
|
6
|
-
export { default as BottomSheetGrabberIndicator, } from "./bottom-sheet-grabber-indicator.svelte";
|
|
7
|
-
export { default as BottomSheetRoot, } from "./bottom-sheet-root.svelte";
|
|
8
|
-
export { default as BottomSheetRootProvider, } from "./bottom-sheet-root-provider.svelte";
|
|
9
|
-
export { default as BottomSheetTitle, } from "./bottom-sheet-title.svelte";
|
|
10
|
-
export { default as BottomSheetTrigger, } from "./bottom-sheet-trigger.svelte";
|
|
11
|
-
export { bottomSheetAnatomy } from "./bottom-sheet-anatomy";
|
|
12
|
-
export { useBottomSheetContext } from "./use-bottom-sheet-context";
|
|
13
|
-
export { useBottomSheet, } from "./use-bottom-sheet.svelte";
|
|
14
|
-
export * as BottomSheet from "./bottom-sheet";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { UseBottomSheetReturn } from "./use-bottom-sheet.svelte";
|
|
2
|
-
export interface UseBottomSheetContext extends UseBottomSheetReturn {
|
|
3
|
-
}
|
|
4
|
-
export declare const BottomSheetProvider: (opts: UseBottomSheetContext) => void, useBottomSheetContext: (fallback?: UseBottomSheetContext | undefined) => UseBottomSheetContext;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Accessor, Optional } from "../../types";
|
|
2
|
-
import * as bottomSheet from "@sprawlify/primitives/machines/bottom-sheet";
|
|
3
|
-
import { type PropTypes } from "../../core";
|
|
4
|
-
import { type MaybeFunction } from "@sprawlify/primitives/utils";
|
|
5
|
-
export interface UseBottomSheetProps extends Optional<Omit<bottomSheet.Props, "getRootNode" | "dir">, "id"> {
|
|
6
|
-
}
|
|
7
|
-
export interface UseBottomSheetReturn extends Accessor<bottomSheet.Api<PropTypes>> {
|
|
8
|
-
}
|
|
9
|
-
export declare const useBottomSheet: (props: MaybeFunction<UseBottomSheetProps>) => UseBottomSheetReturn;
|