@ark-ui/svelte 5.0.0 → 5.0.2

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.
@@ -1,8 +1,9 @@
1
1
  <script module lang="ts">
2
2
  import type { Snippet } from 'svelte'
3
+ import type { UseAccordionItemContext } from './use-accordion-item-context'
3
4
 
4
5
  export interface AccordionItemContextProps {
5
- render: Snippet
6
+ render: Snippet<[UseAccordionItemContext]>
6
7
  }
7
8
  </script>
8
9
 
@@ -15,4 +16,4 @@
15
16
  AccordionItemProvider(itemState)
16
17
  </script>
17
18
 
18
- {@render render()}
19
+ {@render render(itemState)}
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { UseAccordionItemContext } from './use-accordion-item-context';
2
3
  export interface AccordionItemContextProps {
3
- render: Snippet;
4
+ render: Snippet<[UseAccordionItemContext]>;
4
5
  }
5
6
  declare const AccordionItemContext: import("svelte").Component<AccordionItemContextProps, {}, "">;
6
7
  type AccordionItemContext = ReturnType<typeof AccordionItemContext>;
@@ -7,7 +7,13 @@
7
7
 
8
8
  type Props = HTMLProps<T> &
9
9
  PolymorphicProps<T> & {
10
+ /**
11
+ * The HTML tag of the component.
12
+ */
10
13
  as: T
14
+ /**
15
+ * The bindable ref of the component.
16
+ */
11
17
  ref?: Element | null
12
18
  }
13
19
 
@@ -2,7 +2,13 @@ import type { HTMLProps, PolymorphicProps } from '../../types';
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
3
  declare class __sveltets_Render<T extends keyof SvelteHTMLElements> {
4
4
  props(): HTMLProps<T> & PolymorphicProps<T> & {
5
+ /**
6
+ * The HTML tag of the component.
7
+ */
5
8
  as: T;
9
+ /**
10
+ * The bindable ref of the component.
11
+ */
6
12
  ref?: Element | null;
7
13
  };
8
14
  events(): {};
@@ -4,6 +4,7 @@ export { default as ListboxContent, type ListboxContentBaseProps, type ListboxCo
4
4
  export { default as ListboxContext, type ListboxContextProps } from './listbox-context.svelte';
5
5
  export { default as ListboxInput, type ListboxInputBaseProps, type ListboxInputProps } from './listbox-input.svelte';
6
6
  export { default as ListboxItem, type ListboxItemBaseProps, type ListboxItemProps } from './listbox-item.svelte';
7
+ export { default as ListboxItemContext, type ListboxItemContextProps } from './listbox-item-context.svelte';
7
8
  export { default as ListboxItemGroup, type ListboxItemGroupBaseProps, type ListboxItemGroupProps, } from './listbox-item-group.svelte';
8
9
  export { default as ListboxItemGroupLabel, type ListboxItemGroupLabelBaseProps, type ListboxItemGroupLabelProps, } from './listbox-item-group-label.svelte';
9
10
  export { default as ListboxItemIndicator, type ListboxItemIndicatorBaseProps, type ListboxItemIndicatorProps, } from './listbox-item-indicator.svelte';
@@ -3,6 +3,7 @@ export { default as ListboxContent, } from './listbox-content.svelte';
3
3
  export { default as ListboxContext } from './listbox-context.svelte';
4
4
  export { default as ListboxInput } from './listbox-input.svelte';
5
5
  export { default as ListboxItem } from './listbox-item.svelte';
6
+ export { default as ListboxItemContext } from './listbox-item-context.svelte';
6
7
  export { default as ListboxItemGroup, } from './listbox-item-group.svelte';
7
8
  export { default as ListboxItemGroupLabel, } from './listbox-item-group-label.svelte';
8
9
  export { default as ListboxItemIndicator, } from './listbox-item-indicator.svelte';
@@ -0,0 +1,18 @@
1
+ <script module lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
4
+ export interface ListboxItemContextProps {
5
+ render: Snippet<[UseListboxItemContext]>
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import type { UseListboxItemContext } from './use-listbox-item-context.js'
11
+ import { useListboxItemContext } from './use-listbox-item-context.js'
12
+
13
+ let { render }: ListboxItemContextProps = $props()
14
+
15
+ const context = useListboxItemContext()
16
+ </script>
17
+
18
+ {@render render(context)}
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ export interface ListboxItemContextProps {
3
+ render: Snippet<[UseListboxItemContext]>;
4
+ }
5
+ import type { UseListboxItemContext } from './use-listbox-item-context.js';
6
+ declare const ListboxItemContext: import("svelte").Component<ListboxItemContextProps, {}, "">;
7
+ type ListboxItemContext = ReturnType<typeof ListboxItemContext>;
8
+ export default ListboxItemContext;
@@ -2,6 +2,7 @@ export { default as Content, type ListboxContentBaseProps as ContentBaseProps, t
2
2
  export { default as Context, type ListboxContextProps as ContextProps } from './listbox-context.svelte';
3
3
  export { default as Input, type ListboxInputBaseProps as InputBaseProps, type ListboxInputProps as InputProps, } from './listbox-input.svelte';
4
4
  export { default as Item, type ListboxItemBaseProps as ItemBaseProps, type ListboxItemProps as ItemProps, } from './listbox-item.svelte';
5
+ export { default as ItemContext, type ListboxItemContextProps as ItemContextProps } from './listbox-item-context.svelte';
5
6
  export { default as ItemGroup, type ListboxItemGroupBaseProps as ItemGroupBaseProps, type ListboxItemGroupProps as ItemGroupProps, } from './listbox-item-group.svelte';
6
7
  export { default as ItemGroupLabel, type ListboxItemGroupLabelBaseProps as ItemGroupLabelBaseProps, type ListboxItemGroupLabelProps as ItemGroupLabelProps, } from './listbox-item-group-label.svelte';
7
8
  export { default as ItemIndicator, type ListboxItemIndicatorBaseProps as ItemIndicatorBaseProps, type ListboxItemIndicatorProps as ItemIndicatorProps, } from './listbox-item-indicator.svelte';
@@ -2,6 +2,7 @@ export { default as Content, } from './listbox-content.svelte';
2
2
  export { default as Context } from './listbox-context.svelte';
3
3
  export { default as Input, } from './listbox-input.svelte';
4
4
  export { default as Item, } from './listbox-item.svelte';
5
+ export { default as ItemContext } from './listbox-item-context.svelte';
5
6
  export { default as ItemGroup, } from './listbox-item-group.svelte';
6
7
  export { default as ItemGroupLabel, } from './listbox-item-group-label.svelte';
7
8
  export { default as ItemIndicator, } from './listbox-item-indicator.svelte';
package/dist/types.d.ts CHANGED
@@ -8,7 +8,13 @@ export type HTMLTag = keyof SvelteHTMLElements;
8
8
  export type PropsFn<T extends HTMLTag> = (props?: HTMLProps<T>) => HTMLAttributes<HTMLElement>;
9
9
  export type HTMLProps<T extends HTMLTag> = SvelteHTMLElements[T];
10
10
  export type PolymorphicProps<T extends HTMLTag> = {
11
+ /**
12
+ * The children snippet of the component.
13
+ */
11
14
  children?: Snippet;
15
+ /**
16
+ * Use the provided child element as the default rendered element, combining their props and behavior.
17
+ */
12
18
  asChild?: Snippet<[PropsFn<T>]>;
13
19
  };
14
20
  export interface RefAttribute<T extends Element = Element> {
package/package.json CHANGED
@@ -1,11 +1,50 @@
1
1
  {
2
2
  "name": "@ark-ui/svelte",
3
3
  "type": "module",
4
- "version": "5.0.0",
4
+ "version": "5.0.2",
5
5
  "description": "A collection of unstyled, accessible UI components for Svelte",
6
6
  "keywords": [
7
+ "accordion",
8
+ "angle slider",
7
9
  "avatar",
8
- "svelte"
10
+ "carousel",
11
+ "checkbox",
12
+ "clipboard",
13
+ "collapsible",
14
+ "color picker",
15
+ "combobox",
16
+ "date picker",
17
+ "dialog",
18
+ "editable",
19
+ "field",
20
+ "fieldset",
21
+ "file upload",
22
+ "frame",
23
+ "hover card",
24
+ "menu",
25
+ "number input",
26
+ "pagination",
27
+ "pin input",
28
+ "popover",
29
+ "portal",
30
+ "progress",
31
+ "radio group",
32
+ "rating group",
33
+ "segment group",
34
+ "select",
35
+ "signature pad",
36
+ "slider",
37
+ "splitter",
38
+ "switch",
39
+ "tabs",
40
+ "tags input",
41
+ "time picker",
42
+ "timer",
43
+ "toast",
44
+ "toggle group",
45
+ "tooltip",
46
+ "tree view",
47
+ "password input"
9
48
  ],
10
49
  "license": "MIT",
11
50
  "homepage": "https://ark-ui.com",
@@ -81,63 +120,63 @@
81
120
  "sideEffects": false,
82
121
  "dependencies": {
83
122
  "@internationalized/date": "3.8.2",
84
- "@zag-js/accordion": "1.17.0",
85
- "@zag-js/angle-slider": "1.17.0",
86
- "@zag-js/anatomy": "1.17.0",
87
- "@zag-js/auto-resize": "1.17.0",
88
- "@zag-js/avatar": "1.17.0",
89
- "@zag-js/carousel": "1.17.0",
90
- "@zag-js/checkbox": "1.17.0",
91
- "@zag-js/clipboard": "1.17.0",
92
- "@zag-js/collapsible": "1.17.0",
93
- "@zag-js/collection": "1.17.0",
94
- "@zag-js/color-picker": "1.17.0",
95
- "@zag-js/color-utils": "1.17.0",
96
- "@zag-js/combobox": "1.17.0",
97
- "@zag-js/core": "1.17.0",
98
- "@zag-js/date-picker": "1.17.0",
99
- "@zag-js/date-utils": "1.17.0",
100
- "@zag-js/dialog": "1.17.0",
101
- "@zag-js/dom-query": "1.17.0",
102
- "@zag-js/editable": "1.17.0",
103
- "@zag-js/file-upload": "1.17.0",
104
- "@zag-js/file-utils": "1.17.0",
105
- "@zag-js/focus-trap": "1.17.0",
106
- "@zag-js/floating-panel": "1.17.0",
107
- "@zag-js/highlight-word": "1.17.0",
108
- "@zag-js/hover-card": "1.17.0",
109
- "@zag-js/i18n-utils": "1.17.0",
110
- "@zag-js/listbox": "1.17.0",
111
- "@zag-js/menu": "1.17.0",
112
- "@zag-js/number-input": "1.17.0",
113
- "@zag-js/pagination": "1.17.0",
114
- "@zag-js/password-input": "1.17.0",
115
- "@zag-js/pin-input": "1.17.0",
116
- "@zag-js/popover": "1.17.0",
117
- "@zag-js/presence": "1.17.0",
118
- "@zag-js/progress": "1.17.0",
119
- "@zag-js/qr-code": "1.17.0",
120
- "@zag-js/radio-group": "1.17.0",
121
- "@zag-js/rating-group": "1.17.0",
122
- "@zag-js/svelte": "1.17.0",
123
- "@zag-js/select": "1.17.0",
124
- "@zag-js/signature-pad": "1.17.0",
125
- "@zag-js/slider": "1.17.0",
126
- "@zag-js/splitter": "1.17.0",
127
- "@zag-js/steps": "1.17.0",
128
- "@zag-js/switch": "1.17.0",
129
- "@zag-js/tabs": "1.17.0",
130
- "@zag-js/tags-input": "1.17.0",
131
- "@zag-js/time-picker": "1.17.0",
132
- "@zag-js/timer": "1.17.0",
133
- "@zag-js/toast": "1.17.0",
134
- "@zag-js/toggle": "1.17.0",
135
- "@zag-js/toggle-group": "1.17.0",
136
- "@zag-js/tooltip": "1.17.0",
137
- "@zag-js/tour": "1.17.0",
138
- "@zag-js/tree-view": "1.17.0",
139
- "@zag-js/types": "1.17.0",
140
- "@zag-js/utils": "1.17.0"
123
+ "@zag-js/accordion": "1.17.2",
124
+ "@zag-js/angle-slider": "1.17.2",
125
+ "@zag-js/anatomy": "1.17.2",
126
+ "@zag-js/auto-resize": "1.17.2",
127
+ "@zag-js/avatar": "1.17.2",
128
+ "@zag-js/carousel": "1.17.2",
129
+ "@zag-js/checkbox": "1.17.2",
130
+ "@zag-js/clipboard": "1.17.2",
131
+ "@zag-js/collapsible": "1.17.2",
132
+ "@zag-js/collection": "1.17.2",
133
+ "@zag-js/color-picker": "1.17.2",
134
+ "@zag-js/color-utils": "1.17.2",
135
+ "@zag-js/combobox": "1.17.2",
136
+ "@zag-js/core": "1.17.2",
137
+ "@zag-js/date-picker": "1.17.2",
138
+ "@zag-js/date-utils": "1.17.2",
139
+ "@zag-js/dialog": "1.17.2",
140
+ "@zag-js/dom-query": "1.17.2",
141
+ "@zag-js/editable": "1.17.2",
142
+ "@zag-js/file-upload": "1.17.2",
143
+ "@zag-js/file-utils": "1.17.2",
144
+ "@zag-js/focus-trap": "1.17.2",
145
+ "@zag-js/floating-panel": "1.17.2",
146
+ "@zag-js/highlight-word": "1.17.2",
147
+ "@zag-js/hover-card": "1.17.2",
148
+ "@zag-js/i18n-utils": "1.17.2",
149
+ "@zag-js/listbox": "1.17.2",
150
+ "@zag-js/menu": "1.17.2",
151
+ "@zag-js/number-input": "1.17.2",
152
+ "@zag-js/pagination": "1.17.2",
153
+ "@zag-js/password-input": "1.17.2",
154
+ "@zag-js/pin-input": "1.17.2",
155
+ "@zag-js/popover": "1.17.2",
156
+ "@zag-js/presence": "1.17.2",
157
+ "@zag-js/progress": "1.17.2",
158
+ "@zag-js/qr-code": "1.17.2",
159
+ "@zag-js/radio-group": "1.17.2",
160
+ "@zag-js/rating-group": "1.17.2",
161
+ "@zag-js/svelte": "1.17.2",
162
+ "@zag-js/select": "1.17.2",
163
+ "@zag-js/signature-pad": "1.17.2",
164
+ "@zag-js/slider": "1.17.2",
165
+ "@zag-js/splitter": "1.17.2",
166
+ "@zag-js/steps": "1.17.2",
167
+ "@zag-js/switch": "1.17.2",
168
+ "@zag-js/tabs": "1.17.2",
169
+ "@zag-js/tags-input": "1.17.2",
170
+ "@zag-js/time-picker": "1.17.2",
171
+ "@zag-js/timer": "1.17.2",
172
+ "@zag-js/toast": "1.17.2",
173
+ "@zag-js/toggle": "1.17.2",
174
+ "@zag-js/toggle-group": "1.17.2",
175
+ "@zag-js/tooltip": "1.17.2",
176
+ "@zag-js/tour": "1.17.2",
177
+ "@zag-js/tree-view": "1.17.2",
178
+ "@zag-js/types": "1.17.2",
179
+ "@zag-js/utils": "1.17.2"
141
180
  },
142
181
  "devDependencies": {
143
182
  "@storybook/addon-a11y": "9.0.10",
@@ -146,6 +185,7 @@
146
185
  "@sveltejs/kit": "2.21.5",
147
186
  "@sveltejs/package": "2.3.11",
148
187
  "@sveltejs/vite-plugin-svelte": "5.1.0",
188
+ "@tanstack/svelte-form": "1.12.3",
149
189
  "@testing-library/jest-dom": "6.6.3",
150
190
  "@testing-library/svelte": "5.2.8",
151
191
  "@testing-library/user-event": "14.6.1",