ui-ingredients 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. package/README.md +4 -0
  2. package/dist/accordion/avatar-context.svelte.js +1 -1
  3. package/dist/alert/alert-anatomy.d.ts +2 -0
  4. package/dist/alert/alert-anatomy.js +3 -0
  5. package/dist/alert/alert-context.d.ts +2 -0
  6. package/dist/alert/alert-context.js +2 -0
  7. package/dist/alert/alert-description.svelte +25 -0
  8. package/dist/alert/alert-description.svelte.d.ts +21 -0
  9. package/dist/alert/alert-indicator.svelte +25 -0
  10. package/dist/alert/alert-indicator.svelte.d.ts +21 -0
  11. package/dist/alert/alert-root.svelte +29 -0
  12. package/dist/alert/alert-root.svelte.d.ts +22 -0
  13. package/dist/alert/alert-title.svelte +25 -0
  14. package/dist/alert/alert-title.svelte.d.ts +21 -0
  15. package/dist/alert/alert.d.ts +4 -0
  16. package/dist/alert/alert.js +4 -0
  17. package/dist/alert/create-alert.svelte.d.ts +8 -0
  18. package/dist/alert/create-alert.svelte.js +31 -0
  19. package/dist/alert/index.d.ts +7 -0
  20. package/dist/alert/index.js +3 -0
  21. package/dist/alert-dialog/alert-dialog-anatomy.d.ts +2 -0
  22. package/dist/alert-dialog/alert-dialog-anatomy.js +3 -0
  23. package/dist/alert-dialog/alert-dialog-backdrop.svelte +49 -0
  24. package/dist/alert-dialog/alert-dialog-backdrop.svelte.d.ts +22 -0
  25. package/dist/alert-dialog/alert-dialog-close-trigger.svelte +32 -0
  26. package/dist/alert-dialog/alert-dialog-close-trigger.svelte.d.ts +21 -0
  27. package/dist/alert-dialog/alert-dialog-content.svelte +41 -0
  28. package/dist/alert-dialog/alert-dialog-content.svelte.d.ts +22 -0
  29. package/dist/alert-dialog/alert-dialog-context.svelte.d.ts +2 -0
  30. package/dist/alert-dialog/alert-dialog-context.svelte.js +2 -0
  31. package/dist/alert-dialog/alert-dialog-description.svelte +32 -0
  32. package/dist/alert-dialog/alert-dialog-description.svelte.d.ts +21 -0
  33. package/dist/alert-dialog/alert-dialog-positioner.svelte +40 -0
  34. package/dist/alert-dialog/alert-dialog-positioner.svelte.d.ts +21 -0
  35. package/dist/alert-dialog/alert-dialog-root.svelte +48 -0
  36. package/dist/alert-dialog/alert-dialog-root.svelte.d.ts +24 -0
  37. package/dist/alert-dialog/alert-dialog-title.svelte +30 -0
  38. package/dist/alert-dialog/alert-dialog-title.svelte.d.ts +21 -0
  39. package/dist/alert-dialog/alert-dialog-trigger.svelte +30 -0
  40. package/dist/alert-dialog/alert-dialog-trigger.svelte.d.ts +21 -0
  41. package/dist/alert-dialog/alert-dialog.d.ts +8 -0
  42. package/dist/alert-dialog/alert-dialog.js +8 -0
  43. package/dist/alert-dialog/create-alert-dialog.svelte.d.ts +8 -0
  44. package/dist/alert-dialog/create-alert-dialog.svelte.js +48 -0
  45. package/dist/alert-dialog/index.d.ts +11 -0
  46. package/dist/alert-dialog/index.js +3 -0
  47. package/dist/breadcrumbs/breadcrumbs-anatomy.d.ts +2 -0
  48. package/dist/breadcrumbs/breadcrumbs-anatomy.js +3 -0
  49. package/dist/breadcrumbs/breadcrumbs-context.svelte.d.ts +2 -0
  50. package/dist/breadcrumbs/breadcrumbs-context.svelte.js +2 -0
  51. package/dist/breadcrumbs/breadcrumbs-item.svelte +25 -0
  52. package/dist/breadcrumbs/breadcrumbs-item.svelte.d.ts +21 -0
  53. package/dist/breadcrumbs/breadcrumbs-link.svelte +33 -0
  54. package/dist/breadcrumbs/breadcrumbs-link.svelte.d.ts +22 -0
  55. package/dist/breadcrumbs/breadcrumbs-list.svelte +25 -0
  56. package/dist/breadcrumbs/breadcrumbs-list.svelte.d.ts +21 -0
  57. package/dist/breadcrumbs/breadcrumbs-root.svelte +29 -0
  58. package/dist/breadcrumbs/breadcrumbs-root.svelte.d.ts +22 -0
  59. package/dist/breadcrumbs/breadcrumbs-separator.svelte +25 -0
  60. package/dist/breadcrumbs/breadcrumbs-separator.svelte.d.ts +21 -0
  61. package/dist/breadcrumbs/breadcrumbs.d.ts +5 -0
  62. package/dist/breadcrumbs/breadcrumbs.js +5 -0
  63. package/dist/breadcrumbs/create-breadcrumbs.d.ts +13 -0
  64. package/dist/breadcrumbs/create-breadcrumbs.js +47 -0
  65. package/dist/breadcrumbs/index.d.ts +8 -0
  66. package/dist/breadcrumbs/index.js +3 -0
  67. package/dist/color-picker/color-picker-anatomy.d.ts +2 -2
  68. package/dist/color-picker/color-picker-context.svelte.js +4 -4
  69. package/dist/combobox/combobox-context.svelte.js +2 -2
  70. package/dist/date-picker/date-picker-anatomy.d.ts +2 -2
  71. package/dist/date-picker/date-picker-context.svelte.js +4 -4
  72. package/dist/dialog/create-dialog.svelte.d.ts +1 -1
  73. package/dist/dialog/create-dialog.svelte.js +1 -0
  74. package/dist/drawer/create-drawer.svelte.d.ts +12 -0
  75. package/dist/drawer/create-drawer.svelte.js +57 -0
  76. package/dist/drawer/drawer-anatomy.d.ts +2 -0
  77. package/dist/drawer/drawer-anatomy.js +3 -0
  78. package/dist/drawer/drawer-backdrop.svelte +45 -0
  79. package/dist/drawer/drawer-backdrop.svelte.d.ts +22 -0
  80. package/dist/drawer/drawer-body.svelte +30 -0
  81. package/dist/drawer/drawer-body.svelte.d.ts +21 -0
  82. package/dist/drawer/drawer-close-trigger.svelte +30 -0
  83. package/dist/drawer/drawer-close-trigger.svelte.d.ts +21 -0
  84. package/dist/drawer/drawer-content.svelte +37 -0
  85. package/dist/drawer/drawer-content.svelte.d.ts +22 -0
  86. package/dist/drawer/drawer-context.svelte.d.ts +2 -0
  87. package/dist/drawer/drawer-context.svelte.js +2 -0
  88. package/dist/drawer/drawer-description.svelte +30 -0
  89. package/dist/drawer/drawer-description.svelte.d.ts +21 -0
  90. package/dist/drawer/drawer-footer.svelte +30 -0
  91. package/dist/drawer/drawer-footer.svelte.d.ts +21 -0
  92. package/dist/drawer/drawer-header.svelte +30 -0
  93. package/dist/drawer/drawer-header.svelte.d.ts +21 -0
  94. package/dist/drawer/drawer-positioner.svelte +36 -0
  95. package/dist/drawer/drawer-positioner.svelte.d.ts +21 -0
  96. package/dist/drawer/drawer-root.svelte +48 -0
  97. package/dist/drawer/drawer-root.svelte.d.ts +24 -0
  98. package/dist/drawer/drawer-title.svelte +30 -0
  99. package/dist/drawer/drawer-title.svelte.d.ts +21 -0
  100. package/dist/drawer/drawer-trigger.svelte +30 -0
  101. package/dist/drawer/drawer-trigger.svelte.d.ts +21 -0
  102. package/dist/drawer/drawer.d.ts +11 -0
  103. package/dist/drawer/drawer.js +11 -0
  104. package/dist/drawer/index.d.ts +14 -0
  105. package/dist/drawer/index.js +3 -0
  106. package/dist/environment-provider/enviroment-provider-context.svelte.d.ts +3 -3
  107. package/dist/field/create-field.svelte.d.ts +8 -7
  108. package/dist/field/create-field.svelte.js +11 -0
  109. package/dist/field/field-anatomy.d.ts +2 -2
  110. package/dist/field/field-anatomy.js +1 -1
  111. package/dist/field/field-required-indicator.svelte +36 -0
  112. package/dist/field/field-required-indicator.svelte.d.ts +21 -0
  113. package/dist/field/field.d.ts +1 -0
  114. package/dist/field/field.js +1 -0
  115. package/dist/field/index.d.ts +1 -0
  116. package/dist/file-upload/file-upload-context.svelte.js +1 -1
  117. package/dist/index.d.ts +4 -0
  118. package/dist/index.js +4 -0
  119. package/dist/menu/menu-context.svelte.js +2 -2
  120. package/dist/segment-group/segment-group-anatomy.d.ts +2 -2
  121. package/dist/segment-group/segment-group-context.svelte.js +1 -1
  122. package/dist/select/select-context.svelte.js +2 -2
  123. package/dist/slider/slider-context.svelte.js +1 -1
  124. package/dist/steps/steps-context.svelte.js +1 -1
  125. package/dist/tags-input/tags-input-context.svelte.js +1 -1
  126. package/dist/timer/timer-context.svelte.js +1 -1
  127. package/dist/toggle/create-toggle.svelte.d.ts +1 -1
  128. package/dist/toggle/create-toggle.svelte.js +3 -0
  129. package/dist/tour/tour-anatomy.d.ts +2 -2
  130. package/dist/tree-view/tree-view-context.svelte.js +3 -3
  131. package/package.json +53 -53
@@ -1,2 +1,2 @@
1
- export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"area" | "label" | "view" | "root" | "control" | "content" | "trigger" | "positioner" | "areaThumb" | "valueText" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect">;
2
- export declare const parts: Record<"area" | "label" | "view" | "root" | "control" | "content" | "trigger" | "positioner" | "areaThumb" | "valueText" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect", import("@zag-js/anatomy").AnatomyPart>;
1
+ export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"area" | "label" | "view" | "content" | "trigger" | "positioner" | "root" | "control" | "areaThumb" | "valueText" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect">;
2
+ export declare const parts: Record<"area" | "label" | "view" | "content" | "trigger" | "positioner" | "root" | "control" | "areaThumb" | "valueText" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect", import("@zag-js/anatomy").AnatomyPart>;
@@ -1,6 +1,6 @@
1
1
  import { createContext } from '../create-context.svelte.js';
2
2
  export const [getColorPickerContext, setColorPickerContext] = createContext('ColorPicker');
3
- export const [getColorPickerAreaPropsContext, setColorPickerAreaPropsContext] = createContext('ColorPickerArea');
4
- export const [getColorPickerSwatchPropsContext, setColorPickerSwatchPropsContext,] = createContext('ColorPickerSwatch');
5
- export const [getColorPickerFormatPropsContext, setColorPickerFormatPropsContext,] = createContext('ColorPicker__format', false);
6
- export const [getColorPickerChannelPropsContext, setColorPickerChannelPropsContext,] = createContext('ColorPickerChannel');
3
+ export const [getColorPickerAreaPropsContext, setColorPickerAreaPropsContext] = createContext('ColorPickerArea [PROPS]');
4
+ export const [getColorPickerSwatchPropsContext, setColorPickerSwatchPropsContext,] = createContext('ColorPickerSwatch [PROPS]');
5
+ export const [getColorPickerFormatPropsContext, setColorPickerFormatPropsContext,] = createContext('ColorPickerFormat [PROPS]', false);
6
+ export const [getColorPickerChannelPropsContext, setColorPickerChannelPropsContext,] = createContext('ColorPickerChannel [PROPS]');
@@ -1,4 +1,4 @@
1
1
  import { createContext } from '../create-context.svelte.js';
2
2
  export const [getComboboxContext, setComboboxContext] = createContext('Combobox');
3
- export const [getComboboxItemPropsContext, setComboboxItemPropsContext] = createContext('ComboboxItem');
4
- export const [getComboboxItemGroupPropsContext, setComboboxItemGroupPropsContext,] = createContext('ComboboxItemGroup');
3
+ export const [getComboboxItemPropsContext, setComboboxItemPropsContext] = createContext('ComboboxItem [PROPS]');
4
+ export const [getComboboxItemGroupPropsContext, setComboboxItemGroupPropsContext,] = createContext('ComboboxItemGroup [PROPS]');
@@ -1,2 +1,2 @@
1
- export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"input" | "label" | "table" | "view" | "root" | "control" | "content" | "trigger" | "positioner" | "clearTrigger" | "monthSelect" | "nextTrigger" | "prevTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewTrigger" | "viewControl" | "yearSelect" | "presetTrigger">;
2
- export declare const parts: Record<"input" | "label" | "table" | "view" | "root" | "control" | "content" | "trigger" | "positioner" | "clearTrigger" | "monthSelect" | "nextTrigger" | "prevTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewTrigger" | "viewControl" | "yearSelect" | "presetTrigger", import("@zag-js/anatomy").AnatomyPart>;
1
+ export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"input" | "label" | "table" | "view" | "content" | "trigger" | "positioner" | "root" | "control" | "clearTrigger" | "monthSelect" | "nextTrigger" | "prevTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewTrigger" | "viewControl" | "yearSelect" | "presetTrigger">;
2
+ export declare const parts: Record<"input" | "label" | "table" | "view" | "content" | "trigger" | "positioner" | "root" | "control" | "clearTrigger" | "monthSelect" | "nextTrigger" | "prevTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewTrigger" | "viewControl" | "yearSelect" | "presetTrigger", import("@zag-js/anatomy").AnatomyPart>;
@@ -1,6 +1,6 @@
1
1
  import { createContext } from '../create-context.svelte.js';
2
2
  export const [getDatePickerContext, setDatePickerContext] = createContext('DatePicker');
3
- export const [getDatePickerViewPropsContext, setDatePickerViewPropsContext] = createContext('DatePickerView');
4
- export const [getDatePickerTablePropsContext, setDatePickerTablePropsContext] = createContext('DatePickerTable');
5
- export const [getDatePickerTableCellPropsContext, setDatePickerTableCellPropsContext,] = createContext('DatePickerTableCell');
6
- export const [getDatePickerDayTableCellPropsContext, setDatePickerDayTableCellPropsContext,] = createContext('DatePickerDayTableCell');
3
+ export const [getDatePickerViewPropsContext, setDatePickerViewPropsContext] = createContext('DatePickerView [PROPS]');
4
+ export const [getDatePickerTablePropsContext, setDatePickerTablePropsContext] = createContext('DatePickerTable [PROPS]');
5
+ export const [getDatePickerTableCellPropsContext, setDatePickerTableCellPropsContext,] = createContext('DatePickerTableCell [PROPS]');
6
+ export const [getDatePickerDayTableCellPropsContext, setDatePickerDayTableCellPropsContext,] = createContext('DatePickerDayTableCell [PROPS]');
@@ -1,5 +1,5 @@
1
1
  import * as dialog from '@zag-js/dialog';
2
- export interface CreateDialogProps extends Omit<dialog.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
2
+ export interface CreateDialogProps extends Omit<dialog.Context, 'id' | 'dir' | 'role' | 'getRootNode' | 'open.controlled'> {
3
3
  id?: string;
4
4
  openControlled?: boolean;
5
5
  }
@@ -10,6 +10,7 @@ export function createDialog(props) {
10
10
  const context = reflect(() => ({
11
11
  id,
12
12
  dir: locale?.dir,
13
+ role: 'dialog',
13
14
  ...props,
14
15
  getRootNode: environment?.getRootNode,
15
16
  'open.controlled': props.openControlled,
@@ -0,0 +1,12 @@
1
+ import * as dialog from '@zag-js/dialog';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ export interface CreateDrawerProps extends Omit<dialog.Context, 'id' | 'dir' | 'role' | 'getRootNode' | 'open.controlled'> {
4
+ id?: string;
5
+ openControlled?: boolean;
6
+ }
7
+ export interface CreateDrawerReturn extends dialog.Api {
8
+ getBodyProps(): HTMLAttributes<HTMLElement>;
9
+ getFooterProps(): HTMLAttributes<HTMLElement>;
10
+ getHeaderProps(): HTMLAttributes<HTMLElement>;
11
+ }
12
+ export declare function createDrawer(props: CreateDrawerProps): CreateDrawerReturn;
@@ -0,0 +1,57 @@
1
+ import { getEnvironmentContext } from '../environment-provider/enviroment-provider-context.svelte.js';
2
+ import { getLocaleContext } from '../locale-provider/local-provider-context.svelte.js';
3
+ import { mergeProps } from '../merge-props.js';
4
+ import * as dialog from '@zag-js/dialog';
5
+ import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
6
+ import { uid } from 'uid';
7
+ import { parts } from './drawer-anatomy.js';
8
+ export function createDrawer(props) {
9
+ const locale = getLocaleContext();
10
+ const environment = getEnvironmentContext();
11
+ const id = uid();
12
+ const context = reflect(() => ({
13
+ id,
14
+ dir: locale?.dir,
15
+ role: 'dialog',
16
+ ...props,
17
+ getRootNode: environment?.getRootNode,
18
+ 'open.controlled': props.openControlled,
19
+ }));
20
+ const [state, send] = useMachine(dialog.machine(context), { context });
21
+ return reflect(() => {
22
+ const o = dialog.connect(state, send, normalizeProps);
23
+ return {
24
+ ...o,
25
+ getBackdropProps() {
26
+ return mergeProps(o.getBackdropProps(), parts.backdrop.attrs);
27
+ },
28
+ getCloseTriggerProps() {
29
+ return mergeProps(o.getCloseTriggerProps(), parts.closeTrigger.attrs);
30
+ },
31
+ getContentProps() {
32
+ return mergeProps(o.getContentProps(), parts.content.attrs);
33
+ },
34
+ getDescriptionProps() {
35
+ return mergeProps(o.getDescriptionProps(), parts.description.attrs);
36
+ },
37
+ getPositionerProps() {
38
+ return mergeProps(o.getPositionerProps(), parts.positioner.attrs);
39
+ },
40
+ getTitleProps() {
41
+ return mergeProps(o.getTitleProps(), parts.title.attrs);
42
+ },
43
+ getTriggerProps() {
44
+ return mergeProps(o.getTriggerProps(), parts.trigger.attrs);
45
+ },
46
+ getBodyProps() {
47
+ return { ...parts.body.attrs };
48
+ },
49
+ getFooterProps() {
50
+ return { ...parts.footer.attrs };
51
+ },
52
+ getHeaderProps() {
53
+ return { ...parts.header.attrs };
54
+ },
55
+ };
56
+ });
57
+ }
@@ -0,0 +1,2 @@
1
+ export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"body" | "footer" | "header" | "title" | "content" | "trigger" | "backdrop" | "positioner" | "description" | "closeTrigger">;
2
+ export declare const parts: Record<"body" | "footer" | "header" | "title" | "content" | "trigger" | "backdrop" | "positioner" | "description" | "closeTrigger", import("@zag-js/anatomy").AnatomyPart>;
@@ -0,0 +1,3 @@
1
+ import { anatomy as _ } from '@zag-js/dialog';
2
+ export const anatomy = _.rename('drawer').extendWith('body', 'footer', 'header');
3
+ export const parts = anatomy.build();
@@ -0,0 +1,45 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+ import type {Action} from 'svelte/action';
4
+
5
+ export interface DrawerBackdropProps
6
+ extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {createPresence} from '../presence/create-presence.svelte.js';
12
+ import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
13
+ import {reflect} from '@zag-js/svelte';
14
+ import {getDrawerContext} from './drawer-context.svelte.js';
15
+
16
+ let {
17
+ ref = $bindable(null),
18
+ asChild,
19
+ children,
20
+ ...props
21
+ }: DrawerBackdropProps = $props();
22
+
23
+ let drawer = getDrawerContext();
24
+ let presenceStrategyProps = getPresenceStrategyPropsContext();
25
+ let presence = createPresence(
26
+ reflect(() => ({
27
+ ...presenceStrategyProps,
28
+ present: drawer.open,
29
+ })),
30
+ );
31
+
32
+ let mergedProps = $derived(
33
+ mergeProps(drawer.getBackdropProps(), presence.getPresenceProps(), props),
34
+ );
35
+ </script>
36
+
37
+ {#if presence.mounted}
38
+ {#if asChild}
39
+ {@render asChild(presence.setReference, mergedProps)}
40
+ {:else}
41
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
42
+ {@render children?.()}
43
+ </div>
44
+ {/if}
45
+ {/if}
@@ -0,0 +1,22 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ import type { Action } from 'svelte/action';
3
+ export interface DrawerBackdropProps extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {
4
+ }
5
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
6
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
7
+ $$bindings?: Bindings;
8
+ } & Exports;
9
+ (internal: unknown, props: Props & {
10
+ $$events?: Events;
11
+ $$slots?: Slots;
12
+ }): Exports & {
13
+ $set?: any;
14
+ $on?: any;
15
+ };
16
+ z_$$bindings?: Bindings;
17
+ }
18
+ declare const DrawerBackdrop: $$__sveltets_2_IsomorphicComponent<DrawerBackdropProps, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, "ref">;
21
+ type DrawerBackdrop = InstanceType<typeof DrawerBackdrop>;
22
+ export default DrawerBackdrop;
@@ -0,0 +1,30 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+
4
+ export interface DrawerBodyProps
5
+ extends HtmlIngredientProps<'div', HTMLDivElement> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '../merge-props.js';
10
+ import {getDrawerContext} from './drawer-context.svelte.js';
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ asChild,
15
+ children,
16
+ ...props
17
+ }: DrawerBodyProps = $props();
18
+
19
+ let drawer = getDrawerContext();
20
+
21
+ let mergedProps = $derived(mergeProps(drawer.getBodyProps(), props));
22
+ </script>
23
+
24
+ {#if asChild}
25
+ {@render asChild(mergedProps)}
26
+ {:else}
27
+ <div bind:this={ref} {...mergedProps}>
28
+ {@render children?.()}
29
+ </div>
30
+ {/if}
@@ -0,0 +1,21 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ export interface DrawerBodyProps extends HtmlIngredientProps<'div', HTMLDivElement> {
3
+ }
4
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
14
+ };
15
+ z_$$bindings?: Bindings;
16
+ }
17
+ declare const DrawerBody: $$__sveltets_2_IsomorphicComponent<DrawerBodyProps, {
18
+ [evt: string]: CustomEvent<any>;
19
+ }, {}, {}, "ref">;
20
+ type DrawerBody = InstanceType<typeof DrawerBody>;
21
+ export default DrawerBody;
@@ -0,0 +1,30 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+
4
+ export interface DrawerCloseTriggerProps
5
+ extends HtmlIngredientProps<'button', HTMLButtonElement> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '../merge-props.js';
10
+ import {getDrawerContext} from './drawer-context.svelte.js';
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ asChild,
15
+ children,
16
+ ...props
17
+ }: DrawerCloseTriggerProps = $props();
18
+
19
+ let drawer = getDrawerContext();
20
+
21
+ let mergedProps = $derived(mergeProps(drawer.getCloseTriggerProps(), props));
22
+ </script>
23
+
24
+ {#if asChild}
25
+ {@render asChild(mergedProps)}
26
+ {:else}
27
+ <button bind:this={ref} type="button" {...mergedProps}>
28
+ {@render children?.()}
29
+ </button>
30
+ {/if}
@@ -0,0 +1,21 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ export interface DrawerCloseTriggerProps extends HtmlIngredientProps<'button', HTMLButtonElement> {
3
+ }
4
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
14
+ };
15
+ z_$$bindings?: Bindings;
16
+ }
17
+ declare const DrawerCloseTrigger: $$__sveltets_2_IsomorphicComponent<DrawerCloseTriggerProps, {
18
+ [evt: string]: CustomEvent<any>;
19
+ }, {}, {}, "ref">;
20
+ type DrawerCloseTrigger = InstanceType<typeof DrawerCloseTrigger>;
21
+ export default DrawerCloseTrigger;
@@ -0,0 +1,37 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+ import type {Action} from 'svelte/action';
4
+
5
+ export interface DrawerContentProps
6
+ extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {getPresenceContext} from '../presence/presence-context.svelte.js';
12
+ import {getDrawerContext} from './drawer-context.svelte.js';
13
+
14
+ let {
15
+ ref = $bindable(null),
16
+ asChild,
17
+ children,
18
+ ...props
19
+ }: DrawerContentProps = $props();
20
+
21
+ let drawer = getDrawerContext();
22
+ let presence = getPresenceContext();
23
+
24
+ let mergedProps = $derived(
25
+ mergeProps(drawer.getContentProps(), presence.getPresenceProps(), props),
26
+ );
27
+ </script>
28
+
29
+ {#if presence.mounted}
30
+ {#if asChild}
31
+ {@render asChild(presence.setReference, mergedProps)}
32
+ {:else}
33
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
34
+ {@render children?.()}
35
+ </div>
36
+ {/if}
37
+ {/if}
@@ -0,0 +1,22 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ import type { Action } from 'svelte/action';
3
+ export interface DrawerContentProps extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {
4
+ }
5
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
6
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
7
+ $$bindings?: Bindings;
8
+ } & Exports;
9
+ (internal: unknown, props: Props & {
10
+ $$events?: Events;
11
+ $$slots?: Slots;
12
+ }): Exports & {
13
+ $set?: any;
14
+ $on?: any;
15
+ };
16
+ z_$$bindings?: Bindings;
17
+ }
18
+ declare const DrawerContent: $$__sveltets_2_IsomorphicComponent<DrawerContentProps, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, "ref">;
21
+ type DrawerContent = InstanceType<typeof DrawerContent>;
22
+ export default DrawerContent;
@@ -0,0 +1,2 @@
1
+ import type { CreateDrawerReturn } from './create-drawer.svelte.js';
2
+ export declare const getDrawerContext: () => CreateDrawerReturn, setDrawerContext: (context: CreateDrawerReturn | (() => CreateDrawerReturn)) => void;
@@ -0,0 +1,2 @@
1
+ import { createContext } from '../create-context.svelte.js';
2
+ export const [getDrawerContext, setDrawerContext] = createContext('Drawer');
@@ -0,0 +1,30 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+
4
+ export interface DrawerDescriptionProps
5
+ extends HtmlIngredientProps<'p', HTMLParagraphElement> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '../merge-props.js';
10
+ import {getDrawerContext} from './drawer-context.svelte.js';
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ asChild,
15
+ children,
16
+ ...props
17
+ }: DrawerDescriptionProps = $props();
18
+
19
+ let drawer = getDrawerContext();
20
+
21
+ let mergedProps = $derived(mergeProps(drawer.getDescriptionProps(), props));
22
+ </script>
23
+
24
+ {#if asChild}
25
+ {@render asChild(mergedProps)}
26
+ {:else}
27
+ <p bind:this={ref} {...mergedProps}>
28
+ {@render children?.()}
29
+ </p>
30
+ {/if}
@@ -0,0 +1,21 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ export interface DrawerDescriptionProps extends HtmlIngredientProps<'p', HTMLParagraphElement> {
3
+ }
4
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
14
+ };
15
+ z_$$bindings?: Bindings;
16
+ }
17
+ declare const DrawerDescription: $$__sveltets_2_IsomorphicComponent<DrawerDescriptionProps, {
18
+ [evt: string]: CustomEvent<any>;
19
+ }, {}, {}, "ref">;
20
+ type DrawerDescription = InstanceType<typeof DrawerDescription>;
21
+ export default DrawerDescription;
@@ -0,0 +1,30 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+
4
+ export interface DrawerFooterProps
5
+ extends HtmlIngredientProps<'div', HTMLDivElement> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '../merge-props.js';
10
+ import {getDrawerContext} from './drawer-context.svelte.js';
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ asChild,
15
+ children,
16
+ ...props
17
+ }: DrawerFooterProps = $props();
18
+
19
+ let drawer = getDrawerContext();
20
+
21
+ let mergedProps = $derived(mergeProps(drawer.getFooterProps(), props));
22
+ </script>
23
+
24
+ {#if asChild}
25
+ {@render asChild(mergedProps)}
26
+ {:else}
27
+ <div bind:this={ref} {...mergedProps}>
28
+ {@render children?.()}
29
+ </div>
30
+ {/if}
@@ -0,0 +1,21 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ export interface DrawerFooterProps extends HtmlIngredientProps<'div', HTMLDivElement> {
3
+ }
4
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
14
+ };
15
+ z_$$bindings?: Bindings;
16
+ }
17
+ declare const DrawerFooter: $$__sveltets_2_IsomorphicComponent<DrawerFooterProps, {
18
+ [evt: string]: CustomEvent<any>;
19
+ }, {}, {}, "ref">;
20
+ type DrawerFooter = InstanceType<typeof DrawerFooter>;
21
+ export default DrawerFooter;
@@ -0,0 +1,30 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+
4
+ export interface DrawerHeaderProps
5
+ extends HtmlIngredientProps<'div', HTMLDivElement> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '../merge-props.js';
10
+ import {getDrawerContext} from './drawer-context.svelte.js';
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ asChild,
15
+ children,
16
+ ...props
17
+ }: DrawerHeaderProps = $props();
18
+
19
+ let drawer = getDrawerContext();
20
+
21
+ let mergedProps = $derived(mergeProps(drawer.getHeaderProps(), props));
22
+ </script>
23
+
24
+ {#if asChild}
25
+ {@render asChild(mergedProps)}
26
+ {:else}
27
+ <div bind:this={ref} {...mergedProps}>
28
+ {@render children?.()}
29
+ </div>
30
+ {/if}
@@ -0,0 +1,21 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ export interface DrawerHeaderProps extends HtmlIngredientProps<'div', HTMLDivElement> {
3
+ }
4
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
14
+ };
15
+ z_$$bindings?: Bindings;
16
+ }
17
+ declare const DrawerHeader: $$__sveltets_2_IsomorphicComponent<DrawerHeaderProps, {
18
+ [evt: string]: CustomEvent<any>;
19
+ }, {}, {}, "ref">;
20
+ type DrawerHeader = InstanceType<typeof DrawerHeader>;
21
+ export default DrawerHeader;
@@ -0,0 +1,36 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+
4
+ export interface DrawerPositionerProps
5
+ extends HtmlIngredientProps<'div', HTMLDivElement> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '../merge-props.js';
10
+ import {getPresenceContext} from '../presence/presence-context.svelte.js';
11
+ import {getDrawerContext} from './drawer-context.svelte.js';
12
+
13
+ let {
14
+ ref = $bindable(null),
15
+ asChild,
16
+ children,
17
+ ...props
18
+ }: DrawerPositionerProps = $props();
19
+
20
+ let drawer = getDrawerContext();
21
+ let presence = getPresenceContext();
22
+
23
+ let mergedProps = $derived(
24
+ mergeProps(drawer.getPositionerProps(), presence.getPresenceProps(), props),
25
+ );
26
+ </script>
27
+
28
+ {#if presence.mounted}
29
+ {#if asChild}
30
+ {@render asChild(mergedProps)}
31
+ {:else}
32
+ <div bind:this={ref} {...mergedProps}>
33
+ {@render children?.()}
34
+ </div>
35
+ {/if}
36
+ {/if}
@@ -0,0 +1,21 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ export interface DrawerPositionerProps extends HtmlIngredientProps<'div', HTMLDivElement> {
3
+ }
4
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
14
+ };
15
+ z_$$bindings?: Bindings;
16
+ }
17
+ declare const DrawerPositioner: $$__sveltets_2_IsomorphicComponent<DrawerPositionerProps, {
18
+ [evt: string]: CustomEvent<any>;
19
+ }, {}, {}, "ref">;
20
+ type DrawerPositioner = InstanceType<typeof DrawerPositioner>;
21
+ export default DrawerPositioner;