@ui-sdk/svelte 0.1.0-beta.5 → 0.1.0-beta.7
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/autocomplete/autocomplete-item-text.svelte +31 -8
- package/dist/combobox/combobox-item-text.svelte +31 -8
- package/dist/command/command-item-text.svelte +31 -8
- package/dist/field/field-error.svelte +3 -6
- package/dist/select/select-item-text.svelte +31 -8
- package/dist/shortcuts.svelte.d.ts +2 -1
- package/dist/shortcuts.svelte.js +2 -1
- package/docs/agents.md +4 -2
- package/docs/components/autocomplete.md +5 -0
- package/docs/components/combobox.md +7 -0
- package/docs/components/date-input.md +1 -0
- package/docs/components/date-picker.md +2 -0
- package/docs/components/hover-card.md +5 -0
- package/docs/components/menu.md +7 -1
- package/docs/components/menubar.md +1 -0
- package/docs/components/navigation-menu.md +1 -0
- package/docs/components/number-input.md +1 -0
- package/docs/components/popover.md +5 -0
- package/docs/components/resizable.md +4 -0
- package/docs/components/select.md +5 -0
- package/docs/components/tabs.md +1 -1
- package/docs/components/time-input.md +1 -0
- package/docs/components/tooltip.md +6 -1
- package/docs/components/trigger-menu.md +3 -0
- package/docs/core.md +9 -9
- package/docs/introduction.md +1 -1
- package/docs/llms.txt +2 -2
- package/docs/utilities/shortcuts.md +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ Without text content, it shows the suggestion's label.
|
|
|
9
9
|
autocomplete as autocompletePrimitive,
|
|
10
10
|
type AutocompleteItemTextState,
|
|
11
11
|
} from "@ui-sdk/core/autocomplete"
|
|
12
|
-
import { getContext } from "svelte"
|
|
12
|
+
import { getContext, untrack } from "svelte"
|
|
13
13
|
import { createAttachmentKey, type Attachment } from "svelte/attachments"
|
|
14
14
|
import Part from "../part.svelte"
|
|
15
15
|
import { useHandle } from "../instance.js"
|
|
@@ -30,20 +30,43 @@ Without text content, it shows the suggestion's label.
|
|
|
30
30
|
// can't be read before it renders, as a Vue slot can. Until then, and on
|
|
31
31
|
// the server, the content renders as it is. Content that holds elements
|
|
32
32
|
// stays as it is, and the suggestion's label is what's marked.
|
|
33
|
-
|
|
33
|
+
const key = $derived(item().key)
|
|
34
|
+
// A reused item takes a new key, maybe while a search shows the marked text
|
|
35
|
+
// in place of its content, so its text is read again.
|
|
36
|
+
let text = $derived.by<string | undefined>(() => {
|
|
37
|
+
void key
|
|
38
|
+
return undefined
|
|
39
|
+
})
|
|
34
40
|
const part = useHandlePart(autocomplete, "item-text", () => ({
|
|
35
41
|
id: item().key,
|
|
36
42
|
text: text ?? item().label,
|
|
37
43
|
}))
|
|
44
|
+
// A reused item or a count in its label changes the content without a new
|
|
45
|
+
// snippet, so only the page can tell.
|
|
46
|
+
const searching = $derived(
|
|
47
|
+
text !== undefined && part.state.segments.some((segment) => segment.match)
|
|
48
|
+
)
|
|
38
49
|
const learn: Attachment<HTMLElement> = (el) => {
|
|
39
|
-
if (!children
|
|
50
|
+
if (!children) {
|
|
40
51
|
return
|
|
41
52
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
const read = () => {
|
|
54
|
+
if (searching) {
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
const nodes = [...el.childNodes]
|
|
58
|
+
text = nodes.some((node) => node.nodeType === Node.ELEMENT_NODE)
|
|
59
|
+
? undefined
|
|
60
|
+
: (el.textContent ?? "").replace(/\s+/g, " ").trim()
|
|
45
61
|
}
|
|
46
|
-
|
|
62
|
+
untrack(read)
|
|
63
|
+
const observer = new MutationObserver(read)
|
|
64
|
+
observer.observe(el, {
|
|
65
|
+
childList: true,
|
|
66
|
+
characterData: true,
|
|
67
|
+
subtree: true,
|
|
68
|
+
})
|
|
69
|
+
return () => observer.disconnect()
|
|
47
70
|
}
|
|
48
71
|
const learnKey = createAttachmentKey()
|
|
49
72
|
</script>
|
|
@@ -59,7 +82,7 @@ Without text content, it shows the suggestion's label.
|
|
|
59
82
|
{part}
|
|
60
83
|
props={{
|
|
61
84
|
...rest,
|
|
62
|
-
children:
|
|
85
|
+
children: children && !searching ? children : marked,
|
|
63
86
|
[learnKey]: learn,
|
|
64
87
|
}}
|
|
65
88
|
/>
|
|
@@ -9,7 +9,7 @@ Without text content, it shows the item's label.
|
|
|
9
9
|
combobox as comboboxPrimitive,
|
|
10
10
|
type ComboboxItemTextState,
|
|
11
11
|
} from "@ui-sdk/core/combobox"
|
|
12
|
-
import { getContext } from "svelte"
|
|
12
|
+
import { getContext, untrack } from "svelte"
|
|
13
13
|
import { createAttachmentKey, type Attachment } from "svelte/attachments"
|
|
14
14
|
import Part from "../part.svelte"
|
|
15
15
|
import { useHandle } from "../instance.js"
|
|
@@ -27,20 +27,43 @@ Without text content, it shows the item's label.
|
|
|
27
27
|
// can't be read before it renders, as a Vue slot can. Until then, and on
|
|
28
28
|
// the server, the content renders as it is. Content that holds elements
|
|
29
29
|
// stays as it is, and the item's label is what's marked.
|
|
30
|
-
|
|
30
|
+
const key = $derived(item().key)
|
|
31
|
+
// A reused item takes a new key, maybe while a search shows the marked text
|
|
32
|
+
// in place of its content, so its text is read again.
|
|
33
|
+
let text = $derived.by<string | undefined>(() => {
|
|
34
|
+
void key
|
|
35
|
+
return undefined
|
|
36
|
+
})
|
|
31
37
|
const part = useHandlePart(combobox, "item-text", () => ({
|
|
32
38
|
id: item().key,
|
|
33
39
|
text: text ?? item().label ?? "",
|
|
34
40
|
}))
|
|
41
|
+
// A reused item or a count in its label changes the content without a new
|
|
42
|
+
// snippet, so only the page can tell.
|
|
43
|
+
const searching = $derived(
|
|
44
|
+
text !== undefined && part.state.segments.some((segment) => segment.match)
|
|
45
|
+
)
|
|
35
46
|
const learn: Attachment<HTMLElement> = (el) => {
|
|
36
|
-
if (!children
|
|
47
|
+
if (!children) {
|
|
37
48
|
return
|
|
38
49
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const read = () => {
|
|
51
|
+
if (searching) {
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
const nodes = [...el.childNodes]
|
|
55
|
+
text = nodes.some((node) => node.nodeType === Node.ELEMENT_NODE)
|
|
56
|
+
? undefined
|
|
57
|
+
: (el.textContent ?? "").replace(/\s+/g, " ").trim()
|
|
42
58
|
}
|
|
43
|
-
|
|
59
|
+
untrack(read)
|
|
60
|
+
const observer = new MutationObserver(read)
|
|
61
|
+
observer.observe(el, {
|
|
62
|
+
childList: true,
|
|
63
|
+
characterData: true,
|
|
64
|
+
subtree: true,
|
|
65
|
+
})
|
|
66
|
+
return () => observer.disconnect()
|
|
44
67
|
}
|
|
45
68
|
const learnKey = createAttachmentKey()
|
|
46
69
|
</script>
|
|
@@ -56,7 +79,7 @@ Without text content, it shows the item's label.
|
|
|
56
79
|
{part}
|
|
57
80
|
props={{
|
|
58
81
|
...rest,
|
|
59
|
-
children:
|
|
82
|
+
children: children && !searching ? children : marked,
|
|
60
83
|
[learnKey]: learn,
|
|
61
84
|
}}
|
|
62
85
|
/>
|
|
@@ -9,7 +9,7 @@ Without text content, it shows the command's label.
|
|
|
9
9
|
command as commandPrimitive,
|
|
10
10
|
type CommandItemTextState,
|
|
11
11
|
} from "@ui-sdk/core/command"
|
|
12
|
-
import { getContext } from "svelte"
|
|
12
|
+
import { getContext, untrack } from "svelte"
|
|
13
13
|
import { createAttachmentKey, type Attachment } from "svelte/attachments"
|
|
14
14
|
import Part from "../part.svelte"
|
|
15
15
|
import { useHandle } from "../instance.js"
|
|
@@ -27,20 +27,43 @@ Without text content, it shows the command's label.
|
|
|
27
27
|
// can't be read before it renders, as a Vue slot can. Until then, and on
|
|
28
28
|
// the server, the content renders as it is. Content that holds elements
|
|
29
29
|
// stays as it is, and the command's label is what's marked.
|
|
30
|
-
|
|
30
|
+
const key = $derived(item().key)
|
|
31
|
+
// A reused item takes a new key, maybe while a search shows the marked text
|
|
32
|
+
// in place of its content, so its text is read again.
|
|
33
|
+
let text = $derived.by<string | undefined>(() => {
|
|
34
|
+
void key
|
|
35
|
+
return undefined
|
|
36
|
+
})
|
|
31
37
|
const part = useHandlePart(command, "item-text", () => ({
|
|
32
38
|
id: item().key,
|
|
33
39
|
text: text ?? item().label ?? "",
|
|
34
40
|
}))
|
|
41
|
+
// A reused item or a count in its label changes the content without a new
|
|
42
|
+
// snippet, so only the page can tell.
|
|
43
|
+
const searching = $derived(
|
|
44
|
+
text !== undefined && part.state.segments.some((segment) => segment.match)
|
|
45
|
+
)
|
|
35
46
|
const learn: Attachment<HTMLElement> = (el) => {
|
|
36
|
-
if (!children
|
|
47
|
+
if (!children) {
|
|
37
48
|
return
|
|
38
49
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const read = () => {
|
|
51
|
+
if (searching) {
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
const nodes = [...el.childNodes]
|
|
55
|
+
text = nodes.some((node) => node.nodeType === Node.ELEMENT_NODE)
|
|
56
|
+
? undefined
|
|
57
|
+
: (el.textContent ?? "").replace(/\s+/g, " ").trim()
|
|
42
58
|
}
|
|
43
|
-
|
|
59
|
+
untrack(read)
|
|
60
|
+
const observer = new MutationObserver(read)
|
|
61
|
+
observer.observe(el, {
|
|
62
|
+
childList: true,
|
|
63
|
+
characterData: true,
|
|
64
|
+
subtree: true,
|
|
65
|
+
})
|
|
66
|
+
return () => observer.disconnect()
|
|
44
67
|
}
|
|
45
68
|
const learnKey = createAttachmentKey()
|
|
46
69
|
</script>
|
|
@@ -56,7 +79,7 @@ Without text content, it shows the command's label.
|
|
|
56
79
|
{part}
|
|
57
80
|
props={{
|
|
58
81
|
...rest,
|
|
59
|
-
children:
|
|
82
|
+
children: children && !searching ? children : marked,
|
|
60
83
|
[learnKey]: learn,
|
|
61
84
|
}}
|
|
62
85
|
/>
|
|
@@ -19,13 +19,10 @@ browser's message for the current problem.
|
|
|
19
19
|
|
|
20
20
|
const field = useField()
|
|
21
21
|
const uid = $props.id()
|
|
22
|
-
//
|
|
23
|
-
//
|
|
22
|
+
// Each error is its own part, keyed by a made value. Core gives the first one
|
|
23
|
+
// that shows the id the control points at before the field binds.
|
|
24
24
|
const error = field
|
|
25
|
-
? useHandlePart(field, "error", () => ({
|
|
26
|
-
id: rest.id ?? (match === undefined ? undefined : `ui-sdk-${uid}`),
|
|
27
|
-
match,
|
|
28
|
-
}))
|
|
25
|
+
? useHandlePart(field, "error", () => ({ id: rest.id, value: uid, match }))
|
|
29
26
|
: undefined
|
|
30
27
|
const shown = $derived(
|
|
31
28
|
error ? error.present : fieldOutsideErrorShown({ match })
|
|
@@ -9,7 +9,7 @@ text content, it shows the item's label.
|
|
|
9
9
|
select as selectPrimitive,
|
|
10
10
|
type SelectItemTextState,
|
|
11
11
|
} from "@ui-sdk/core/select"
|
|
12
|
-
import { getContext } from "svelte"
|
|
12
|
+
import { getContext, untrack } from "svelte"
|
|
13
13
|
import { createAttachmentKey, type Attachment } from "svelte/attachments"
|
|
14
14
|
import Part from "../part.svelte"
|
|
15
15
|
import { useHandle } from "../instance.js"
|
|
@@ -27,20 +27,43 @@ text content, it shows the item's label.
|
|
|
27
27
|
// can't be read before it renders, as a Vue slot can. Until then, and on
|
|
28
28
|
// the server, the content renders as it is. Content that holds elements
|
|
29
29
|
// stays as it is, and the item's label is what's marked.
|
|
30
|
-
|
|
30
|
+
const key = $derived(item().key)
|
|
31
|
+
// A reused item takes a new key, maybe while a search shows the marked text
|
|
32
|
+
// in place of its content, so its text is read again.
|
|
33
|
+
let text = $derived.by<string | undefined>(() => {
|
|
34
|
+
void key
|
|
35
|
+
return undefined
|
|
36
|
+
})
|
|
31
37
|
const part = useHandlePart(select, "item-text", () => ({
|
|
32
38
|
id: item().key,
|
|
33
39
|
text: text ?? item().label ?? "",
|
|
34
40
|
}))
|
|
41
|
+
// A reused item or a count in its label changes the content without a new
|
|
42
|
+
// snippet, so only the page can tell.
|
|
43
|
+
const searching = $derived(
|
|
44
|
+
text !== undefined && part.state.segments.some((segment) => segment.match)
|
|
45
|
+
)
|
|
35
46
|
const learn: Attachment<HTMLElement> = (el) => {
|
|
36
|
-
if (!children
|
|
47
|
+
if (!children) {
|
|
37
48
|
return
|
|
38
49
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const read = () => {
|
|
51
|
+
if (searching) {
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
const nodes = [...el.childNodes]
|
|
55
|
+
text = nodes.some((node) => node.nodeType === Node.ELEMENT_NODE)
|
|
56
|
+
? undefined
|
|
57
|
+
: (el.textContent ?? "").replace(/\s+/g, " ").trim()
|
|
42
58
|
}
|
|
43
|
-
|
|
59
|
+
untrack(read)
|
|
60
|
+
const observer = new MutationObserver(read)
|
|
61
|
+
observer.observe(el, {
|
|
62
|
+
childList: true,
|
|
63
|
+
characterData: true,
|
|
64
|
+
subtree: true,
|
|
65
|
+
})
|
|
66
|
+
return () => observer.disconnect()
|
|
44
67
|
}
|
|
45
68
|
const learnKey = createAttachmentKey()
|
|
46
69
|
</script>
|
|
@@ -56,7 +79,7 @@ text content, it shows the item's label.
|
|
|
56
79
|
{part}
|
|
57
80
|
props={{
|
|
58
81
|
...rest,
|
|
59
|
-
children:
|
|
82
|
+
children: children && !searching ? children : marked,
|
|
60
83
|
[learnKey]: learn,
|
|
61
84
|
}}
|
|
62
85
|
/>
|
|
@@ -24,7 +24,8 @@ declare function useShortcut(keys: MaybeGetter<string | null | undefined>, handl
|
|
|
24
24
|
* Keys formatted for this platform, like `⌘S` on Apple platforms and `Ctrl+S`
|
|
25
25
|
* elsewhere, with the matching `aria-keyshortcuts`, as reactive getters. The
|
|
26
26
|
* server and the first client render use the same platform, so hydration
|
|
27
|
-
* matches, and they update after mount. Keys can be a getter.
|
|
27
|
+
* matches, and they update after mount. Keys can be a getter. The text is
|
|
28
|
+
* wrapped in a left-to-right isolate, like `formatShortcut`'s.
|
|
28
29
|
* @stable
|
|
29
30
|
*/
|
|
30
31
|
declare function useShortcutHint(keys: MaybeGetter<string>): {
|
package/dist/shortcuts.svelte.js
CHANGED
|
@@ -25,7 +25,8 @@ function useShortcut(keys, handler, options = {}) {
|
|
|
25
25
|
* Keys formatted for this platform, like `⌘S` on Apple platforms and `Ctrl+S`
|
|
26
26
|
* elsewhere, with the matching `aria-keyshortcuts`, as reactive getters. The
|
|
27
27
|
* server and the first client render use the same platform, so hydration
|
|
28
|
-
* matches, and they update after mount. Keys can be a getter.
|
|
28
|
+
* matches, and they update after mount. Keys can be a getter. The text is
|
|
29
|
+
* wrapped in a left-to-right isolate, like `formatShortcut`'s.
|
|
29
30
|
* @stable
|
|
30
31
|
*/
|
|
31
32
|
function useShortcutHint(keys) {
|
package/docs/agents.md
CHANGED
|
@@ -216,7 +216,7 @@ The [Core guides](./core.md#build-a-component) walk through the code. [All Behav
|
|
|
216
216
|
If your agent supports skills, install `ui-sdk`:
|
|
217
217
|
|
|
218
218
|
```bash
|
|
219
|
-
npx skills add vercel-labs/ui --skill ui-sdk
|
|
219
|
+
npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
It gives the agent a workflow for choosing behaviors, defining a primitive, rendering it and testing it. The same skill ships with `@ui-sdk/core` in `node_modules/@ui-sdk/core/skills/`, so an agent without skills can read it there. [Skills](./agents.md#skills) shows how to use it. You can also work directly from the docs.
|
|
@@ -334,7 +334,7 @@ Help your agent build custom components with @ui-sdk/core.
|
|
|
334
334
|
If your agent supports skills, install it with:
|
|
335
335
|
|
|
336
336
|
```bash
|
|
337
|
-
npx skills add vercel-labs/ui --skill ui-sdk
|
|
337
|
+
npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
338
338
|
```
|
|
339
339
|
|
|
340
340
|
The skill also ships inside `@ui-sdk/core`, at `node_modules/@ui-sdk/core/skills/ui-sdk/SKILL.md`. That copy always matches the version you installed. If your agent doesn't support skills, point it there instead.
|
|
@@ -1029,6 +1029,8 @@ An `allow` that returns `true` without reading `step.confirm` answers yes for th
|
|
|
1029
1029
|
|
|
1030
1030
|
The mark covers its element and everything inside it, for any action. Put it on a form or section to cover every control in it, or on a dialog's content to cover the buttons inside, wherever the dialog renders.
|
|
1031
1031
|
|
|
1032
|
+
A mark on one option of a Select or Combobox counts even while the list is closed, since the agent opens it for a moment to look. A list that renders only some of its options, like a virtualized one, or one filtered by text in its field, shows the agent only those. Mark something that stays on the page instead, like its trigger or a wrapper around it, and every choice in it waits for the person.
|
|
1033
|
+
|
|
1032
1034
|
## Keep Parts of the Page from the Agent
|
|
1033
1035
|
|
|
1034
1036
|
Two more marks change what the agent sees:
|
|
@@ -1506,6 +1506,8 @@ While focus stays in the input, use the content’s `data-modality="keyboard"` w
|
|
|
1506
1506
|
- `data-open`: Present while the suggestions are open.
|
|
1507
1507
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
1508
1508
|
- `data-ending-style`: Present while the list animates out. Style the state you animate to.
|
|
1509
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the suggestions ended up, after flipping away from edges.
|
|
1510
|
+
- `data-align` (`start`, `center`, `end`): How the suggestions line up with the field.
|
|
1509
1511
|
- `data-modality` (`keyboard`, `pointer`): Whether the keyboard or a pointer moves the highlight. Style a focus ring for the keyboard only.
|
|
1510
1512
|
- `data-has-icons`: Present while any suggestion inside holds an icon part, so items without one can line up.
|
|
1511
1513
|
|
|
@@ -1537,6 +1539,9 @@ While focus stays in the input, use the content’s `data-modality="keyboard"` w
|
|
|
1537
1539
|
|
|
1538
1540
|
- `data-closed`: Present while the suggestions are closed, including while they animate out.
|
|
1539
1541
|
- `data-open`: Present while the suggestions are open.
|
|
1542
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the suggestions ended up, after flipping away from edges.
|
|
1543
|
+
- `data-align` (`start`, `center`, `end`): How the suggestions line up with the field.
|
|
1544
|
+
- `data-arrow-clamped`: Present on the arrow when it stops short of the middle of the field, held back by `arrowPadding`.
|
|
1540
1545
|
|
|
1541
1546
|
### AutocompleteItemIcon
|
|
1542
1547
|
`[data-slot="autocomplete-item-icon"]`
|
|
@@ -2776,6 +2776,8 @@ Use `data-highlighted` for the active option and `data-selected` for chosen valu
|
|
|
2776
2776
|
- `data-open`: Present while the list is open.
|
|
2777
2777
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
2778
2778
|
- `data-ending-style`: Present while the list animates out. Style the state you animate to.
|
|
2779
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the list ended up, after flipping away from edges.
|
|
2780
|
+
- `data-align` (`start`, `center`, `end`): How the list lines up with the input.
|
|
2779
2781
|
- `data-modality` (`keyboard`, `pointer`): Whether the keyboard or a pointer moves the highlight. Style a focus ring for the keyboard only.
|
|
2780
2782
|
- `data-has-icons`: Present while any item inside holds an icon part, so items without one can line up.
|
|
2781
2783
|
|
|
@@ -2813,6 +2815,9 @@ Use `data-highlighted` for the active option and `data-selected` for chosen valu
|
|
|
2813
2815
|
|
|
2814
2816
|
- `data-closed`: Present while the list is closed, including while it animates out.
|
|
2815
2817
|
- `data-open`: Present while the list is open.
|
|
2818
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the list ended up, after flipping away from edges.
|
|
2819
|
+
- `data-align` (`start`, `center`, `end`): How the list lines up with the input.
|
|
2820
|
+
- `data-arrow-clamped`: Present on the arrow when it stops short of the middle of the input, held back by `arrowPadding`.
|
|
2816
2821
|
|
|
2817
2822
|
### ComboboxItemIcon
|
|
2818
2823
|
`[data-slot="combobox-item-icon"]`
|
|
@@ -3260,6 +3265,7 @@ The combobox follows the [WAI-ARIA combobox pattern with list autocomplete](http
|
|
|
3260
3265
|
**Default value**
|
|
3261
3266
|
|
|
3262
3267
|
- Shows its label in the input.
|
|
3268
|
+
- Typing inside the label keeps the caret where it is.
|
|
3263
3269
|
|
|
3264
3270
|
**Multiple**
|
|
3265
3271
|
|
|
@@ -3302,6 +3308,7 @@ Also tested:
|
|
|
3302
3308
|
**Enhancements**
|
|
3303
3309
|
|
|
3304
3310
|
- The list is named by the combobox's label.
|
|
3311
|
+
- A click on the label focuses the input and leaves the list closed.
|
|
3305
3312
|
- Filtering matches an item's keywords as well as its label.
|
|
3306
3313
|
- A create option offers the text, and hides when an item's label matches it exactly.
|
|
3307
3314
|
- Enter on the create option calls onCreate with the text.
|
|
@@ -516,5 +516,6 @@ Every line below is an automated test.
|
|
|
516
516
|
- The field's label focuses the first segment.
|
|
517
517
|
- A read-only date takes focus but doesn't change.
|
|
518
518
|
- A disabled date can't be focused.
|
|
519
|
+
- Digits committed through an input method fill the segment.
|
|
519
520
|
|
|
520
521
|
Runs in React, Vue and web components.
|
|
@@ -1034,6 +1034,8 @@ Each part has a `data-slot`, such as `date-picker-input`, and its state attribut
|
|
|
1034
1034
|
- `data-closed`: Present while the popup is closed, including while it animates out.
|
|
1035
1035
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
1036
1036
|
- `data-ending-style`: Present while the popup animates out. Style the state you animate to.
|
|
1037
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the popup ended up, after flipping away from edges.
|
|
1038
|
+
- `data-align` (`start`, `center`, `end`): How the popup lines up with the input.
|
|
1037
1039
|
|
|
1038
1040
|
### DatePickerClear
|
|
1039
1041
|
`[data-slot="date-picker-clear"]`
|
|
@@ -311,12 +311,17 @@ Keep overflow visible around an arrow that extends outside the card. If the body
|
|
|
311
311
|
- `data-open`: Present while the card is open. On a trigger, while it's open from that trigger.
|
|
312
312
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
313
313
|
- `data-ending-style`: Present while the card animates out. Style the state you animate to.
|
|
314
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the card ended up, after flipping away from edges. Set on the arrow too.
|
|
315
|
+
- `data-align` (`start`, `center`, `end`): How the card lines up with its trigger.
|
|
314
316
|
|
|
315
317
|
### HoverCardArrow
|
|
316
318
|
`[data-slot="hover-card-arrow"]`
|
|
317
319
|
|
|
318
320
|
- `data-closed`: Present while the card is closed, including while it animates out.
|
|
319
321
|
- `data-open`: Present while the card is open. On a trigger, while it's open from that trigger.
|
|
322
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the card ended up, after flipping away from edges. Set on the arrow too.
|
|
323
|
+
- `data-align` (`start`, `center`, `end`): How the card lines up with its trigger.
|
|
324
|
+
- `data-arrow-clamped`: Present on the arrow when it stops short of the middle of the trigger, held back by `arrowPadding`.
|
|
320
325
|
|
|
321
326
|
## API Reference
|
|
322
327
|
|
package/docs/components/menu.md
CHANGED
|
@@ -851,7 +851,8 @@ Each part has a `data-slot`, such as `menu-item`, and its state attributes are l
|
|
|
851
851
|
`[data-slot="menu-context-trigger"]`
|
|
852
852
|
|
|
853
853
|
- `data-closed`: Present on an area while the menu isn't open from it.
|
|
854
|
-
- `data-disabled`: Present when the
|
|
854
|
+
- `data-disabled`: Present when the area is disabled.
|
|
855
|
+
- `data-open`: Present on the area that opened the menu, while it's open.
|
|
855
856
|
|
|
856
857
|
### MenuContent
|
|
857
858
|
`[data-slot="menu-content"]`
|
|
@@ -862,12 +863,15 @@ Each part has a `data-slot`, such as `menu-item`, and its state attributes are l
|
|
|
862
863
|
- `data-open`: Present while the menu is open. A submenu trigger has it while its submenu is open.
|
|
863
864
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
864
865
|
- `data-ending-style`: Present while the menu animates out. Style the state you animate to.
|
|
866
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the menu ended up, after flipping away from edges.
|
|
867
|
+
- `data-align` (`start`, `center`, `end`): How the menu lines up with its trigger.
|
|
865
868
|
- `data-has-icons`: Present while any item inside holds an icon part, so items without one can line up.
|
|
866
869
|
|
|
867
870
|
### MenuItem
|
|
868
871
|
`[data-slot="menu-item"]`
|
|
869
872
|
|
|
870
873
|
- `data-disabled`: Present when the item can't be chosen.
|
|
874
|
+
- `data-highlighted`: Present on the item with keyboard focus or under the pointer.
|
|
871
875
|
- `data-has-icon`: Present on an item while it holds an icon part.
|
|
872
876
|
|
|
873
877
|
### MenuCheckboxItem
|
|
@@ -875,6 +879,7 @@ Each part has a `data-slot`, such as `menu-item`, and its state attributes are l
|
|
|
875
879
|
|
|
876
880
|
- `data-checked`: Present on checked checkbox items, and on the radio item that's its group's value.
|
|
877
881
|
- `data-unchecked`: Present on items that aren't checked.
|
|
882
|
+
- `data-highlighted`: Present on the item with keyboard focus or under the pointer.
|
|
878
883
|
|
|
879
884
|
### MenuItemIndicator
|
|
880
885
|
`[data-slot="menu-item-indicator"]`
|
|
@@ -887,6 +892,7 @@ Each part has a `data-slot`, such as `menu-item`, and its state attributes are l
|
|
|
887
892
|
|
|
888
893
|
- `data-checked`: Present on checked checkbox items, and on the radio item that's its group's value.
|
|
889
894
|
- `data-unchecked`: Present on items that aren't checked.
|
|
895
|
+
- `data-highlighted`: Present on the item with keyboard focus or under the pointer.
|
|
890
896
|
|
|
891
897
|
### MenuItemIcon
|
|
892
898
|
`[data-slot="menu-item-icon"]`
|
|
@@ -405,6 +405,7 @@ Every line below is an automated test.
|
|
|
405
405
|
- Enter opens a menu and focuses its first item.
|
|
406
406
|
- Space opens a menu and focuses its first item.
|
|
407
407
|
- Escape closes the menu and focuses its trigger.
|
|
408
|
+
- Escape in a menu reached with ArrowRight returns focus to its trigger.
|
|
408
409
|
- Tab in an open menu closes it and moves past the menubar.
|
|
409
410
|
- A press opens a menu, and a press on its trigger closes it.
|
|
410
411
|
- While a menu is open, pointing at another trigger opens its menu instead.
|
|
@@ -1409,6 +1409,7 @@ Every line below is an automated test.
|
|
|
1409
1409
|
- Tab past the panel's last link moves on to the next trigger.
|
|
1410
1410
|
- Shift+Tab from the panel's first link returns to its trigger.
|
|
1411
1411
|
- Shift+Tab from the item after an open panel goes back into the panel.
|
|
1412
|
+
- Tab from the last item past an open panel leaves the navigation and closes it.
|
|
1412
1413
|
- Escape inside a panel closes it and returns focus to its trigger.
|
|
1413
1414
|
- Escape on an open trigger closes its panel.
|
|
1414
1415
|
- Focus leaving the navigation closes the panel.
|
|
@@ -933,6 +933,7 @@ Every line below is an automated test.
|
|
|
933
933
|
|
|
934
934
|
- Starts with its default value, formatted.
|
|
935
935
|
- ArrowUp and ArrowDown step the value.
|
|
936
|
+
- Full-width digits from an input method commit as a number.
|
|
936
937
|
- Shift with an arrow key steps by the large step.
|
|
937
938
|
- Home and End go to the minimum and the maximum.
|
|
938
939
|
- Stepping stops at the bounds.
|
|
@@ -1177,12 +1177,17 @@ Each part has a `data-slot`, such as `popover-content`, and its state attributes
|
|
|
1177
1177
|
- `data-open`: Present while the popover is open. On a trigger, while it's open from that trigger.
|
|
1178
1178
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
1179
1179
|
- `data-ending-style`: Present while the popover animates out. Style the state you animate to.
|
|
1180
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the popover ended up, after flipping away from edges. Set on the arrow too.
|
|
1181
|
+
- `data-align` (`start`, `center`, `end`): How the popover lines up with its trigger.
|
|
1180
1182
|
|
|
1181
1183
|
### PopoverArrow
|
|
1182
1184
|
`[data-slot="popover-arrow"]`
|
|
1183
1185
|
|
|
1184
1186
|
- `data-closed`: Present while the popover is closed, including while it animates out.
|
|
1185
1187
|
- `data-open`: Present while the popover is open. On a trigger, while it's open from that trigger.
|
|
1188
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the popover ended up, after flipping away from edges. Set on the arrow too.
|
|
1189
|
+
- `data-align` (`start`, `center`, `end`): How the popover lines up with its trigger.
|
|
1190
|
+
- `data-arrow-clamped`: Present on the arrow when it stops short of the middle of the trigger, held back by `arrowPadding`.
|
|
1186
1191
|
|
|
1187
1192
|
## API Reference
|
|
1188
1193
|
|
|
@@ -882,4 +882,8 @@ Every line below is an automated test.
|
|
|
882
882
|
- At a limit, the cursor points the only way a handle can go.
|
|
883
883
|
- A saved layout is there on the first paint.
|
|
884
884
|
|
|
885
|
+
**Touch**
|
|
886
|
+
|
|
887
|
+
- A touch drag that starts beside the handle, in its touch hit area, resizes without scrolling.
|
|
888
|
+
|
|
885
889
|
Runs in React, Vue and web components.
|
|
@@ -1550,6 +1550,8 @@ Each part has a `data-slot`, such as `select-trigger`, and its state attributes
|
|
|
1550
1550
|
- `data-open`: Present while the list is open.
|
|
1551
1551
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
1552
1552
|
- `data-ending-style`: Present while the list animates out. Style the state you animate to.
|
|
1553
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the list ended up, after flipping away from edges.
|
|
1554
|
+
- `data-align` (`start`, `center`, `end`): How the list lines up with the trigger.
|
|
1553
1555
|
- `data-modality` (`keyboard`, `pointer`): Whether the keyboard or a pointer is in use, for focus styles.
|
|
1554
1556
|
- `data-has-icons`: Present while any item inside holds an icon part, so items without one can line up.
|
|
1555
1557
|
|
|
@@ -1594,6 +1596,9 @@ Each part has a `data-slot`, such as `select-trigger`, and its state attributes
|
|
|
1594
1596
|
|
|
1595
1597
|
- `data-closed`: Present while the list is closed, including while it animates out.
|
|
1596
1598
|
- `data-open`: Present while the list is open.
|
|
1599
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the list ended up, after flipping away from edges.
|
|
1600
|
+
- `data-align` (`start`, `center`, `end`): How the list lines up with the trigger.
|
|
1601
|
+
- `data-arrow-clamped`: Present on the arrow when it stops short of the middle of the trigger, held back by `arrowPadding`.
|
|
1597
1602
|
|
|
1598
1603
|
### SelectItemIcon
|
|
1599
1604
|
`[data-slot="select-item-icon"]`
|
package/docs/components/tabs.md
CHANGED
|
@@ -29,7 +29,7 @@ Tabs
|
|
|
29
29
|
└── TabsPanel
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Give each tab and its panel the same unique `value`. Give the list an accessible name. Set `defaultValue` to choose the initial tab; otherwise, the first enabled tab is selected.
|
|
32
|
+
Give each tab and its panel the same unique `value`. Give the list an accessible name. Set `defaultValue` to choose the initial tab; otherwise, the first enabled tab is selected. On the server, panels that render before the list don't know that tab yet, so a layout with the panels first, like a bottom tab bar, needs `defaultValue` or `bind:value` to render its panel before hydration.
|
|
33
33
|
|
|
34
34
|
## Usage
|
|
35
35
|
|
|
@@ -214,5 +214,6 @@ Every line below is an automated test.
|
|
|
214
214
|
- The field's label focuses the first segment.
|
|
215
215
|
- A read-only date takes focus but doesn't change.
|
|
216
216
|
- A disabled date can't be focused.
|
|
217
|
+
- Digits committed through an input method fill the segment.
|
|
217
218
|
|
|
218
219
|
Runs in React, Vue and web components.
|
|
@@ -44,7 +44,7 @@ Tooltip
|
|
|
44
44
|
|
|
45
45
|
Wrap the trigger and its hint in a tooltip. The arrow and the shortcut are optional.
|
|
46
46
|
|
|
47
|
-
The content has the `tooltip` role, and it's in the page from the start, hidden, so it names or describes its trigger before focus reaches it. It names a trigger without a name of its own, like a button with only an icon, and describes any other: one with text, an `aria-label` or a `title`. `type="label"` or `type="description"` overrides the guess. Keep it to plain text: a tooltip can't be focused, so links or buttons inside it can't be reached. For anything interactive, use a [Popover](./popover.md) or a [Hover Card](./hover-card.md).
|
|
47
|
+
The content has the `tooltip` role, and it's in the page from the start, hidden, so it names or describes its trigger before focus reaches it. It names a trigger without a name of its own, like a button with only an icon, and describes any other: one with text, an `aria-label` or a `title`. `type="label"` or `type="description"` overrides the guess. The guess happens in the browser, so server-rendered HTML describes a trigger with only an icon until then. Pass `type="label"` to name it from the first HTML. Keep it to plain text: a tooltip can't be focused, so links or buttons inside it can't be reached. For anything interactive, use a [Popover](./popover.md) or a [Hover Card](./hover-card.md).
|
|
48
48
|
|
|
49
49
|
## Usage
|
|
50
50
|
|
|
@@ -611,12 +611,17 @@ Each part has a `data-slot`, such as `tooltip-content`, and its state attributes
|
|
|
611
611
|
- `data-open`: Present while the tooltip is open.
|
|
612
612
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
613
613
|
- `data-ending-style`: Present while the tooltip animates out. Style the state you animate to.
|
|
614
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the tooltip ended up, after flipping away from edges. Set on the arrow too.
|
|
615
|
+
- `data-align` (`start`, `center`, `end`): How the tooltip lines up with its trigger.
|
|
614
616
|
|
|
615
617
|
### TooltipArrow
|
|
616
618
|
`[data-slot="tooltip-arrow"]`
|
|
617
619
|
|
|
618
620
|
- `data-closed`: Present while the tooltip is closed, including while it animates out.
|
|
619
621
|
- `data-open`: Present while the tooltip is open.
|
|
622
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the tooltip ended up, after flipping away from edges. Set on the arrow too.
|
|
623
|
+
- `data-align` (`start`, `center`, `end`): How the tooltip lines up with its trigger.
|
|
624
|
+
- `data-arrow-clamped`: Present on the arrow when it stops short of the middle of the trigger, held back by `arrowPadding`.
|
|
620
625
|
|
|
621
626
|
## API Reference
|
|
622
627
|
|
|
@@ -870,6 +870,8 @@ Each part has a `data-slot`, such as `trigger-menu-item`, and shows its state th
|
|
|
870
870
|
- `data-closed`: Present while the list is closed, including while it animates out.
|
|
871
871
|
- `data-starting-style`: Present for the first frame. Style the state you animate from.
|
|
872
872
|
- `data-ending-style`: Present while the list animates out. Style the state you animate to.
|
|
873
|
+
- `data-side` (`top`, `right`, `bottom`, `left`): Where the list ended up, after flipping away from edges.
|
|
874
|
+
- `data-align` (`start`, `center`, `end`): How the list lines up with the trigger.
|
|
873
875
|
- `data-open`: Present while the list is open.
|
|
874
876
|
- `data-trigger`: The trigger of the current match, like `@`, while there is one.
|
|
875
877
|
- `data-has-icons`: Present while any item inside holds an icon part, so items without one can line up.
|
|
@@ -1121,6 +1123,7 @@ Every line below is an automated test.
|
|
|
1121
1123
|
|
|
1122
1124
|
- Typing a trigger opens the list with every item.
|
|
1123
1125
|
- Typing after the trigger filters the list.
|
|
1126
|
+
- Text an input method commits filters the list.
|
|
1124
1127
|
- Queries match Unicode letters and ignore accents.
|
|
1125
1128
|
- A trigger mid-word doesn't open.
|
|
1126
1129
|
- A trigger followed by a space doesn't open.
|
package/docs/core.md
CHANGED
|
@@ -2338,7 +2338,7 @@ In a textarea, the arrow keys move between lines first. An entry comes back only
|
|
|
2338
2338
|
|
|
2339
2339
|
Edits to an entry you brought back stay while you move through the others. When `entries` changes, like after a send, it starts again from the newest. Call `history.reset()` to do the same yourself.
|
|
2340
2340
|
|
|
2341
|
-
It leaves the arrow keys alone while a modifier is held, while an input method is composing, while text is selected in a textarea, and on a read-only field. It also leaves them to a popup, like a suggestion menu, while the field's `aria-expanded` is `"true"
|
|
2341
|
+
It leaves the arrow keys alone while a modifier is held, while an input method is composing, while text is selected in a textarea, and on a read-only field. It also leaves them to a popup, like a suggestion menu, while the field's `aria-expanded` is `"true"` or the field has `data-open`, which a Trigger Menu sets on its textarea. On an input, it works for the `text`, `search`, `url` and `tel` types, so a number field keeps its steps.
|
|
2342
2342
|
|
|
2343
2343
|
### Report It as a Change
|
|
2344
2344
|
|
|
@@ -3299,7 +3299,7 @@ keys: slot({
|
|
|
3299
3299
|
|
|
3300
3300
|
Try the shortcut while typing in the note:
|
|
3301
3301
|
|
|
3302
|
-
`formatShortcut` keeps the label in left-to-right order, even on a right-to-left page. For tests, import `setPlatform` from `@ui-sdk/core/testing` and call `setPlatform("apple")` or `setPlatform("other")`.
|
|
3302
|
+
`formatShortcut` keeps the label in left-to-right order, even on a right-to-left page, by wrapping it in two invisible characters. For tests, import `setPlatform` from `@ui-sdk/core/testing` and call `setPlatform("apple")` or `setPlatform("other")`.
|
|
3303
3303
|
|
|
3304
3304
|
## Layers and Positioning
|
|
3305
3305
|
|
|
@@ -4048,8 +4048,8 @@ api: (context) => ({
|
|
|
4048
4048
|
Each cell has a zero-based `row` and `col`. Connect its tab stop, keys and element to the behavior:
|
|
4049
4049
|
|
|
4050
4050
|
```ts
|
|
4051
|
-
seat: slot<{ row: number; col: number }>({
|
|
4052
|
-
props: { row: "number", col: "number" },
|
|
4051
|
+
seat: slot<{ id: string; row: number; col: number }>({
|
|
4052
|
+
props: { id: "string", row: "number", col: "number" },
|
|
4053
4053
|
selects: selects({ active: byCell }),
|
|
4054
4054
|
attrs: (state, { props, api }) => ({
|
|
4055
4055
|
role: "gridcell",
|
|
@@ -8006,7 +8006,7 @@ Set up ui-sdk in this React project. It needs React 19 or newer.
|
|
|
8006
8006
|
|
|
8007
8007
|
1. Install @ui-sdk/react and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
|
|
8008
8008
|
2. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/react/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/react/docs/core.md by heading, and read rendering.md next to it.
|
|
8009
|
-
3. If you support skills, run: npx skills add vercel-labs/ui --skill ui-sdk
|
|
8009
|
+
3. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
8010
8010
|
```
|
|
8011
8011
|
|
|
8012
8012
|
**Vue**
|
|
@@ -8017,7 +8017,7 @@ Set up ui-sdk in this Vue project. It needs Vue 3.5 or newer.
|
|
|
8017
8017
|
1. Install @ui-sdk/vue and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
|
|
8018
8018
|
2. If it's a Nuxt 4 or newer app, add "@ui-sdk/vue" to modules in nuxt.config.ts.
|
|
8019
8019
|
3. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/vue/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/vue/docs/core.md by heading, and read rendering.md next to it.
|
|
8020
|
-
4. If you support skills, run: npx skills add vercel-labs/ui --skill ui-sdk
|
|
8020
|
+
4. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
8021
8021
|
```
|
|
8022
8022
|
|
|
8023
8023
|
**Svelte**
|
|
@@ -8027,7 +8027,7 @@ Set up ui-sdk in this Svelte project. It needs Svelte 5.33 or newer.
|
|
|
8027
8027
|
|
|
8028
8028
|
1. Install @ui-sdk/svelte and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
|
|
8029
8029
|
2. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/svelte/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/svelte/docs/core.md by heading, and read rendering.md next to it.
|
|
8030
|
-
3. If you support skills, run: npx skills add vercel-labs/ui --skill ui-sdk
|
|
8030
|
+
3. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
8031
8031
|
```
|
|
8032
8032
|
|
|
8033
8033
|
**Solid**
|
|
@@ -8037,7 +8037,7 @@ Set up ui-sdk in this Solid project. It needs Solid 2: solid-js and @solidjs/web
|
|
|
8037
8037
|
|
|
8038
8038
|
1. Install @ui-sdk/solid and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
|
|
8039
8039
|
2. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/solid/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/solid/docs/core.md by heading, and read rendering.md next to it.
|
|
8040
|
-
3. If you support skills, run: npx skills add vercel-labs/ui --skill ui-sdk
|
|
8040
|
+
3. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
8041
8041
|
```
|
|
8042
8042
|
|
|
8043
8043
|
**Web Components**
|
|
@@ -8047,7 +8047,7 @@ Set up ui-sdk in this Web Components project. Each component registers its tags
|
|
|
8047
8047
|
|
|
8048
8048
|
1. Install @ui-sdk/web and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
|
|
8049
8049
|
2. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/web/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/web/docs/core.md by heading, and read rendering.md next to it.
|
|
8050
|
-
3. If you support skills, run: npx skills add vercel-labs/ui --skill ui-sdk
|
|
8050
|
+
3. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
8051
8051
|
```
|
|
8052
8052
|
|
|
8053
8053
|
Then ask your agent to build a component:
|
package/docs/introduction.md
CHANGED
|
@@ -17,7 +17,7 @@ Set up ui-sdk in this Svelte project. It needs Svelte 5.33 or newer.
|
|
|
17
17
|
|
|
18
18
|
1. Install @ui-sdk/svelte and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
|
|
19
19
|
2. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/svelte/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/svelte/docs/core.md by heading, and read rendering.md next to it.
|
|
20
|
-
3. If you support skills, run: npx skills add vercel-labs/ui --skill ui-sdk
|
|
20
|
+
3. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
It installs ui-sdk and points your `AGENTS.md` at the docs that ship with the packages.
|
package/docs/llms.txt
CHANGED
|
@@ -24,7 +24,7 @@ Set up ui-sdk in this Svelte project. It needs Svelte 5.33 or newer.
|
|
|
24
24
|
|
|
25
25
|
1. Install @ui-sdk/svelte and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
|
|
26
26
|
2. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/svelte/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/svelte/docs/core.md by heading, and read rendering.md next to it.
|
|
27
|
-
3. If you support skills, run: npx skills add vercel-labs/ui --skill ui-sdk
|
|
27
|
+
3. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
It installs ui-sdk and points your `AGENTS.md` at the docs that ship with the packages.
|
|
@@ -1442,7 +1442,7 @@ Call the helper in the component's script. It unregisters when the component goe
|
|
|
1442
1442
|
|
|
1443
1443
|
Its fields are reactive getters. Read `hint.text` and `hint.ariaKeyshortcuts` in markup.
|
|
1444
1444
|
|
|
1445
|
-
Outside rendering, use `formatShortcut` for display text or `ariaKeyshortcuts` for the ARIA value, from the same entry.
|
|
1445
|
+
Outside rendering, use `formatShortcut` for display text or `ariaKeyshortcuts` for the ARIA value, from the same entry. The hint's text and `formatShortcut` both keep their left-to-right order on a right-to-left page, because two invisible characters wrap the text. Compare the original keys, not the formatted hint.
|
|
1446
1446
|
|
|
1447
1447
|
#### While Someone Is Typing
|
|
1448
1448
|
|
|
@@ -65,7 +65,7 @@ Call the helper in the component's script. It unregisters when the component goe
|
|
|
65
65
|
|
|
66
66
|
Its fields are reactive getters. Read `hint.text` and `hint.ariaKeyshortcuts` in markup.
|
|
67
67
|
|
|
68
|
-
Outside rendering, use `formatShortcut` for display text or `ariaKeyshortcuts` for the ARIA value, from the same entry.
|
|
68
|
+
Outside rendering, use `formatShortcut` for display text or `ariaKeyshortcuts` for the ARIA value, from the same entry. The hint's text and `formatShortcut` both keep their left-to-right order on a right-to-left page, because two invisible characters wrap the text. Compare the original keys, not the formatted hint.
|
|
69
69
|
|
|
70
70
|
## While Someone Is Typing
|
|
71
71
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui-sdk/svelte",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.7",
|
|
4
4
|
"description": "UI SDK for Svelte.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svelte",
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
],
|
|
382
382
|
"peerDependencies": {
|
|
383
383
|
"svelte": ">=5.33",
|
|
384
|
-
"@ui-sdk/core": "^0.1.0-beta.
|
|
384
|
+
"@ui-sdk/core": "^0.1.0-beta.7"
|
|
385
385
|
},
|
|
386
386
|
"devDependencies": {
|
|
387
387
|
"@sveltejs/package": "^2.5.8",
|
|
@@ -393,7 +393,7 @@
|
|
|
393
393
|
"typescript": "~5.9.3",
|
|
394
394
|
"vite": "^8.3.3",
|
|
395
395
|
"vitest": "^5.0.3",
|
|
396
|
-
"@ui-sdk/core": "0.1.0-beta.
|
|
396
|
+
"@ui-sdk/core": "0.1.0-beta.7"
|
|
397
397
|
},
|
|
398
398
|
"scripts": {
|
|
399
399
|
"build": "node ../../scripts/build/build-svelte-package.mjs",
|