@opencode/ui 2.0.22 → 2.0.23
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/data-display/accordion/accordion.d.ts +3 -1
- package/dist/feedback/toast/toast.d.ts +3 -2
- package/dist/i18n/en.d.ts +4 -0
- package/dist/icons/catalog.d.ts +253 -0
- package/dist/icons/icon/additional-icons.d.ts +1 -0
- package/dist/icons/icon/icon.d.ts +1 -237
- package/package.json +5 -1
- package/src/data-display/accordion/accordion.tsx +16 -2
- package/src/feedback/toast/toast.tsx +32 -6
- package/src/i18n/en.ts +9 -0
- package/src/icons/catalog.ts +269 -0
- package/src/icons/icon/additional-icons.ts +1 -0
- package/src/icons/icon/icon.tsx +10 -250
- package/src/navigation/tabs/tabs.css +1 -50
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Content, Header, Item, Root, Trigger } from "@kobalte/core/accordion";
|
|
2
2
|
import type { ComponentProps, ParentProps } from "solid-js";
|
|
3
|
-
export interface AccordionProps extends ComponentProps<typeof Root> {
|
|
3
|
+
export interface AccordionProps extends Omit<ComponentProps<typeof Root>, "value"> {
|
|
4
|
+
/** Controlled expanded items. Kobalte reads this iterable into its own selection; it never mutates this array. */
|
|
5
|
+
value?: readonly string[];
|
|
4
6
|
}
|
|
5
7
|
export interface AccordionItemProps extends ComponentProps<typeof Item> {
|
|
6
8
|
}
|
|
@@ -32,7 +32,7 @@ export declare const toaster: {
|
|
|
32
32
|
duration?: number;
|
|
33
33
|
persistent?: boolean;
|
|
34
34
|
/** Reactive value the toast's height depends on; sonner re-measures when it changes. */
|
|
35
|
-
resize?: () =>
|
|
35
|
+
resize?: () => void;
|
|
36
36
|
}): number;
|
|
37
37
|
dismiss(toastId?: number): string | number | undefined;
|
|
38
38
|
};
|
|
@@ -44,7 +44,8 @@ export interface ToastAction {
|
|
|
44
44
|
export interface ToastOptions {
|
|
45
45
|
title?: string;
|
|
46
46
|
description?: string;
|
|
47
|
-
|
|
47
|
+
/** An element, or a render function the toast calls under its own owner, for icons created from imperative code. */
|
|
48
|
+
icon?: JSX.Element | (() => JSX.Element);
|
|
48
49
|
variant?: "default" | "success" | "error" | "loading";
|
|
49
50
|
duration?: number;
|
|
50
51
|
persistent?: boolean;
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -98,6 +98,7 @@ declare const source: {
|
|
|
98
98
|
"ui.messagePart.questions.dismissed": string;
|
|
99
99
|
"ui.messagePart.compaction": string;
|
|
100
100
|
"ui.messagePart.compaction.started": string;
|
|
101
|
+
"ui.messagePart.compaction.queued": string;
|
|
101
102
|
"ui.messagePart.compaction.running": string;
|
|
102
103
|
"ui.messagePart.compaction.failed": string;
|
|
103
104
|
"ui.messagePart.compaction.cancelled": string;
|
|
@@ -219,12 +220,15 @@ declare const source: {
|
|
|
219
220
|
"ui.message.copyMessage": string;
|
|
220
221
|
"ui.message.forkMessage": string;
|
|
221
222
|
"ui.message.revertMessage": string;
|
|
223
|
+
"ui.message.moveToQueue": string;
|
|
224
|
+
"ui.message.deletePending": string;
|
|
222
225
|
"ui.message.copyResponse": string;
|
|
223
226
|
"ui.message.copied": string;
|
|
224
227
|
"ui.message.thought": string;
|
|
225
228
|
"ui.message.duration.seconds": string;
|
|
226
229
|
"ui.message.duration.minutesSeconds": string;
|
|
227
230
|
"ui.message.interrupted": string;
|
|
231
|
+
"ui.message.modelVariant": string;
|
|
228
232
|
"ui.sessionTimeline.notice.model": string;
|
|
229
233
|
"ui.sessionTimeline.notice.modelSwitched": string;
|
|
230
234
|
"ui.sessionTimeline.notice.agentChanged": string;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { additionalIcons } from "./icon/additional-icons";
|
|
2
|
+
declare const icons: {
|
|
3
|
+
lock: {
|
|
4
|
+
viewBox: string;
|
|
5
|
+
body: string;
|
|
6
|
+
};
|
|
7
|
+
globe: {
|
|
8
|
+
viewBox: string;
|
|
9
|
+
body: string;
|
|
10
|
+
};
|
|
11
|
+
"select-element": {
|
|
12
|
+
viewBox: string;
|
|
13
|
+
body: string;
|
|
14
|
+
};
|
|
15
|
+
flask: {
|
|
16
|
+
viewBox: string;
|
|
17
|
+
body: string;
|
|
18
|
+
};
|
|
19
|
+
edit: {
|
|
20
|
+
viewBox: string;
|
|
21
|
+
body: string;
|
|
22
|
+
};
|
|
23
|
+
"folder-add-left": {
|
|
24
|
+
viewBox: string;
|
|
25
|
+
body: string;
|
|
26
|
+
};
|
|
27
|
+
folder: {
|
|
28
|
+
viewBox: string;
|
|
29
|
+
body: string;
|
|
30
|
+
};
|
|
31
|
+
branch: {
|
|
32
|
+
viewBox: string;
|
|
33
|
+
body: string;
|
|
34
|
+
};
|
|
35
|
+
"branch-out": {
|
|
36
|
+
viewBox: string;
|
|
37
|
+
body: string;
|
|
38
|
+
};
|
|
39
|
+
"grid-plus": {
|
|
40
|
+
viewBox: string;
|
|
41
|
+
body: string;
|
|
42
|
+
};
|
|
43
|
+
help: {
|
|
44
|
+
viewBox: string;
|
|
45
|
+
body: string;
|
|
46
|
+
};
|
|
47
|
+
info: {
|
|
48
|
+
viewBox: string;
|
|
49
|
+
body: string;
|
|
50
|
+
};
|
|
51
|
+
"circle-exclamation": {
|
|
52
|
+
viewBox: string;
|
|
53
|
+
body: string;
|
|
54
|
+
};
|
|
55
|
+
"circle-xmark": {
|
|
56
|
+
viewBox: string;
|
|
57
|
+
body: string;
|
|
58
|
+
};
|
|
59
|
+
"sidebar-right": {
|
|
60
|
+
viewBox: string;
|
|
61
|
+
body: string;
|
|
62
|
+
};
|
|
63
|
+
status: {
|
|
64
|
+
viewBox: string;
|
|
65
|
+
body: string;
|
|
66
|
+
};
|
|
67
|
+
"status-active": {
|
|
68
|
+
viewBox: string;
|
|
69
|
+
body: string;
|
|
70
|
+
};
|
|
71
|
+
"magnifying-glass": {
|
|
72
|
+
viewBox: string;
|
|
73
|
+
body: string;
|
|
74
|
+
};
|
|
75
|
+
menu: {
|
|
76
|
+
viewBox: string;
|
|
77
|
+
body: string;
|
|
78
|
+
};
|
|
79
|
+
plus: {
|
|
80
|
+
viewBox: string;
|
|
81
|
+
body: string;
|
|
82
|
+
};
|
|
83
|
+
"settings-gear": {
|
|
84
|
+
viewBox: string;
|
|
85
|
+
body: string;
|
|
86
|
+
};
|
|
87
|
+
"chevron-down": {
|
|
88
|
+
viewBox: string;
|
|
89
|
+
body: string;
|
|
90
|
+
};
|
|
91
|
+
collapse: {
|
|
92
|
+
viewBox: string;
|
|
93
|
+
body: string;
|
|
94
|
+
};
|
|
95
|
+
check: {
|
|
96
|
+
viewBox: string;
|
|
97
|
+
body: string;
|
|
98
|
+
};
|
|
99
|
+
monitor: {
|
|
100
|
+
viewBox: string;
|
|
101
|
+
body: string;
|
|
102
|
+
};
|
|
103
|
+
"workspace-new": {
|
|
104
|
+
viewBox: string;
|
|
105
|
+
body: string;
|
|
106
|
+
};
|
|
107
|
+
"workspace-isolated": {
|
|
108
|
+
viewBox: string;
|
|
109
|
+
body: string;
|
|
110
|
+
};
|
|
111
|
+
workspace: {
|
|
112
|
+
viewBox: string;
|
|
113
|
+
body: string;
|
|
114
|
+
};
|
|
115
|
+
"outline-worktree": {
|
|
116
|
+
viewBox: string;
|
|
117
|
+
body: string;
|
|
118
|
+
};
|
|
119
|
+
"outline-trash": {
|
|
120
|
+
viewBox: string;
|
|
121
|
+
body: string;
|
|
122
|
+
};
|
|
123
|
+
close: {
|
|
124
|
+
viewBox: string;
|
|
125
|
+
body: string;
|
|
126
|
+
};
|
|
127
|
+
"xmark-small": {
|
|
128
|
+
viewBox: string;
|
|
129
|
+
body: string;
|
|
130
|
+
};
|
|
131
|
+
"outline-xmark": {
|
|
132
|
+
viewBox: string;
|
|
133
|
+
body: string;
|
|
134
|
+
};
|
|
135
|
+
"outline-chevron-down": {
|
|
136
|
+
viewBox: string;
|
|
137
|
+
body: string;
|
|
138
|
+
};
|
|
139
|
+
"outline-dots": {
|
|
140
|
+
viewBox: string;
|
|
141
|
+
body: string;
|
|
142
|
+
};
|
|
143
|
+
expand: {
|
|
144
|
+
viewBox: string;
|
|
145
|
+
body: string;
|
|
146
|
+
};
|
|
147
|
+
filetree: {
|
|
148
|
+
viewBox: string;
|
|
149
|
+
body: string;
|
|
150
|
+
};
|
|
151
|
+
split: {
|
|
152
|
+
viewBox: string;
|
|
153
|
+
body: string;
|
|
154
|
+
};
|
|
155
|
+
unified: {
|
|
156
|
+
viewBox: string;
|
|
157
|
+
body: string;
|
|
158
|
+
};
|
|
159
|
+
review: {
|
|
160
|
+
viewBox: string;
|
|
161
|
+
body: string;
|
|
162
|
+
};
|
|
163
|
+
"window-analytics": {
|
|
164
|
+
viewBox: string;
|
|
165
|
+
body: string;
|
|
166
|
+
};
|
|
167
|
+
"graduation-cap": {
|
|
168
|
+
viewBox: string;
|
|
169
|
+
body: string;
|
|
170
|
+
};
|
|
171
|
+
"code-slash": {
|
|
172
|
+
viewBox: string;
|
|
173
|
+
body: string;
|
|
174
|
+
};
|
|
175
|
+
trash: {
|
|
176
|
+
viewBox: string;
|
|
177
|
+
body: string;
|
|
178
|
+
};
|
|
179
|
+
"outline-sliders": {
|
|
180
|
+
viewBox: string;
|
|
181
|
+
body: string;
|
|
182
|
+
};
|
|
183
|
+
"outline-copy": {
|
|
184
|
+
viewBox: string;
|
|
185
|
+
body: string;
|
|
186
|
+
};
|
|
187
|
+
"arrow-up-right": {
|
|
188
|
+
viewBox: string;
|
|
189
|
+
body: string;
|
|
190
|
+
};
|
|
191
|
+
"outline-square-arrow": {
|
|
192
|
+
viewBox: string;
|
|
193
|
+
body: string;
|
|
194
|
+
};
|
|
195
|
+
"outline-arrow-to-corner-top-right": {
|
|
196
|
+
viewBox: string;
|
|
197
|
+
body: string;
|
|
198
|
+
};
|
|
199
|
+
"outline-hexagonal-warning": {
|
|
200
|
+
viewBox: string;
|
|
201
|
+
body: string;
|
|
202
|
+
};
|
|
203
|
+
"outline-share": {
|
|
204
|
+
viewBox: string;
|
|
205
|
+
body: string;
|
|
206
|
+
};
|
|
207
|
+
"outline-eye": {
|
|
208
|
+
viewBox: string;
|
|
209
|
+
body: string;
|
|
210
|
+
};
|
|
211
|
+
"outline-eye-slash": {
|
|
212
|
+
viewBox: string;
|
|
213
|
+
body: string;
|
|
214
|
+
};
|
|
215
|
+
refresh: {
|
|
216
|
+
viewBox: string;
|
|
217
|
+
body: string;
|
|
218
|
+
};
|
|
219
|
+
reset: {
|
|
220
|
+
viewBox: string;
|
|
221
|
+
body: string;
|
|
222
|
+
};
|
|
223
|
+
"outline-reset": {
|
|
224
|
+
viewBox: string;
|
|
225
|
+
body: string;
|
|
226
|
+
};
|
|
227
|
+
"fill-triangle-down": {
|
|
228
|
+
viewBox: string;
|
|
229
|
+
body: string;
|
|
230
|
+
};
|
|
231
|
+
archive: {
|
|
232
|
+
viewBox: string;
|
|
233
|
+
body: string;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
/** Icon names derived from the shared artwork, with no UI or runtime dependencies. */
|
|
237
|
+
export type IconName = keyof typeof icons | keyof typeof additionalIcons;
|
|
238
|
+
/** The artwork catalog's names, in sprite order. */
|
|
239
|
+
export declare function iconNames(): IconName[];
|
|
240
|
+
/**
|
|
241
|
+
* Narrows a name against the shared artwork catalog.
|
|
242
|
+
* @param name - A name supplied by a caller, including names unknown to this build.
|
|
243
|
+
*/
|
|
244
|
+
export declare function isIconName(name: string): name is IconName;
|
|
245
|
+
/**
|
|
246
|
+
* The SVG body and viewport for a known catalog name, with primary artwork taking precedence.
|
|
247
|
+
* @param name - A name validated by the type or by `isIconName`.
|
|
248
|
+
*/
|
|
249
|
+
export declare function getIcon(name: IconName): {
|
|
250
|
+
viewBox: string;
|
|
251
|
+
body: string;
|
|
252
|
+
};
|
|
253
|
+
export {};
|
|
@@ -1,244 +1,8 @@
|
|
|
1
1
|
import { type ComponentProps } from "solid-js";
|
|
2
|
-
import {
|
|
2
|
+
import { type IconName } from "../catalog";
|
|
3
3
|
import "./icon.css";
|
|
4
|
-
declare const icons: {
|
|
5
|
-
lock: {
|
|
6
|
-
viewBox: string;
|
|
7
|
-
body: string;
|
|
8
|
-
};
|
|
9
|
-
globe: {
|
|
10
|
-
viewBox: string;
|
|
11
|
-
body: string;
|
|
12
|
-
};
|
|
13
|
-
"select-element": {
|
|
14
|
-
viewBox: string;
|
|
15
|
-
body: string;
|
|
16
|
-
};
|
|
17
|
-
flask: {
|
|
18
|
-
viewBox: string;
|
|
19
|
-
body: string;
|
|
20
|
-
};
|
|
21
|
-
edit: {
|
|
22
|
-
viewBox: string;
|
|
23
|
-
body: string;
|
|
24
|
-
};
|
|
25
|
-
"folder-add-left": {
|
|
26
|
-
viewBox: string;
|
|
27
|
-
body: string;
|
|
28
|
-
};
|
|
29
|
-
folder: {
|
|
30
|
-
viewBox: string;
|
|
31
|
-
body: string;
|
|
32
|
-
};
|
|
33
|
-
branch: {
|
|
34
|
-
viewBox: string;
|
|
35
|
-
body: string;
|
|
36
|
-
};
|
|
37
|
-
"branch-out": {
|
|
38
|
-
viewBox: string;
|
|
39
|
-
body: string;
|
|
40
|
-
};
|
|
41
|
-
"grid-plus": {
|
|
42
|
-
viewBox: string;
|
|
43
|
-
body: string;
|
|
44
|
-
};
|
|
45
|
-
help: {
|
|
46
|
-
viewBox: string;
|
|
47
|
-
body: string;
|
|
48
|
-
};
|
|
49
|
-
info: {
|
|
50
|
-
viewBox: string;
|
|
51
|
-
body: string;
|
|
52
|
-
};
|
|
53
|
-
"circle-exclamation": {
|
|
54
|
-
viewBox: string;
|
|
55
|
-
body: string;
|
|
56
|
-
};
|
|
57
|
-
"circle-xmark": {
|
|
58
|
-
viewBox: string;
|
|
59
|
-
body: string;
|
|
60
|
-
};
|
|
61
|
-
"sidebar-right": {
|
|
62
|
-
viewBox: string;
|
|
63
|
-
body: string;
|
|
64
|
-
};
|
|
65
|
-
status: {
|
|
66
|
-
viewBox: string;
|
|
67
|
-
body: string;
|
|
68
|
-
};
|
|
69
|
-
"status-active": {
|
|
70
|
-
viewBox: string;
|
|
71
|
-
body: string;
|
|
72
|
-
};
|
|
73
|
-
"magnifying-glass": {
|
|
74
|
-
viewBox: string;
|
|
75
|
-
body: string;
|
|
76
|
-
};
|
|
77
|
-
menu: {
|
|
78
|
-
viewBox: string;
|
|
79
|
-
body: string;
|
|
80
|
-
};
|
|
81
|
-
plus: {
|
|
82
|
-
viewBox: string;
|
|
83
|
-
body: string;
|
|
84
|
-
};
|
|
85
|
-
"settings-gear": {
|
|
86
|
-
viewBox: string;
|
|
87
|
-
body: string;
|
|
88
|
-
};
|
|
89
|
-
"chevron-down": {
|
|
90
|
-
viewBox: string;
|
|
91
|
-
body: string;
|
|
92
|
-
};
|
|
93
|
-
collapse: {
|
|
94
|
-
viewBox: string;
|
|
95
|
-
body: string;
|
|
96
|
-
};
|
|
97
|
-
check: {
|
|
98
|
-
viewBox: string;
|
|
99
|
-
body: string;
|
|
100
|
-
};
|
|
101
|
-
monitor: {
|
|
102
|
-
viewBox: string;
|
|
103
|
-
body: string;
|
|
104
|
-
};
|
|
105
|
-
"workspace-new": {
|
|
106
|
-
viewBox: string;
|
|
107
|
-
body: string;
|
|
108
|
-
};
|
|
109
|
-
"workspace-isolated": {
|
|
110
|
-
viewBox: string;
|
|
111
|
-
body: string;
|
|
112
|
-
};
|
|
113
|
-
workspace: {
|
|
114
|
-
viewBox: string;
|
|
115
|
-
body: string;
|
|
116
|
-
};
|
|
117
|
-
"outline-worktree": {
|
|
118
|
-
viewBox: string;
|
|
119
|
-
body: string;
|
|
120
|
-
};
|
|
121
|
-
"outline-trash": {
|
|
122
|
-
viewBox: string;
|
|
123
|
-
body: string;
|
|
124
|
-
};
|
|
125
|
-
close: {
|
|
126
|
-
viewBox: string;
|
|
127
|
-
body: string;
|
|
128
|
-
};
|
|
129
|
-
"xmark-small": {
|
|
130
|
-
viewBox: string;
|
|
131
|
-
body: string;
|
|
132
|
-
};
|
|
133
|
-
"outline-xmark": {
|
|
134
|
-
viewBox: string;
|
|
135
|
-
body: string;
|
|
136
|
-
};
|
|
137
|
-
"outline-chevron-down": {
|
|
138
|
-
viewBox: string;
|
|
139
|
-
body: string;
|
|
140
|
-
};
|
|
141
|
-
"outline-dots": {
|
|
142
|
-
viewBox: string;
|
|
143
|
-
body: string;
|
|
144
|
-
};
|
|
145
|
-
expand: {
|
|
146
|
-
viewBox: string;
|
|
147
|
-
body: string;
|
|
148
|
-
};
|
|
149
|
-
filetree: {
|
|
150
|
-
viewBox: string;
|
|
151
|
-
body: string;
|
|
152
|
-
};
|
|
153
|
-
split: {
|
|
154
|
-
viewBox: string;
|
|
155
|
-
body: string;
|
|
156
|
-
};
|
|
157
|
-
unified: {
|
|
158
|
-
viewBox: string;
|
|
159
|
-
body: string;
|
|
160
|
-
};
|
|
161
|
-
review: {
|
|
162
|
-
viewBox: string;
|
|
163
|
-
body: string;
|
|
164
|
-
};
|
|
165
|
-
"window-analytics": {
|
|
166
|
-
viewBox: string;
|
|
167
|
-
body: string;
|
|
168
|
-
};
|
|
169
|
-
"graduation-cap": {
|
|
170
|
-
viewBox: string;
|
|
171
|
-
body: string;
|
|
172
|
-
};
|
|
173
|
-
"code-slash": {
|
|
174
|
-
viewBox: string;
|
|
175
|
-
body: string;
|
|
176
|
-
};
|
|
177
|
-
trash: {
|
|
178
|
-
viewBox: string;
|
|
179
|
-
body: string;
|
|
180
|
-
};
|
|
181
|
-
"outline-sliders": {
|
|
182
|
-
viewBox: string;
|
|
183
|
-
body: string;
|
|
184
|
-
};
|
|
185
|
-
"outline-copy": {
|
|
186
|
-
viewBox: string;
|
|
187
|
-
body: string;
|
|
188
|
-
};
|
|
189
|
-
"arrow-up-right": {
|
|
190
|
-
viewBox: string;
|
|
191
|
-
body: string;
|
|
192
|
-
};
|
|
193
|
-
"outline-square-arrow": {
|
|
194
|
-
viewBox: string;
|
|
195
|
-
body: string;
|
|
196
|
-
};
|
|
197
|
-
"outline-arrow-to-corner-top-right": {
|
|
198
|
-
viewBox: string;
|
|
199
|
-
body: string;
|
|
200
|
-
};
|
|
201
|
-
"outline-hexagonal-warning": {
|
|
202
|
-
viewBox: string;
|
|
203
|
-
body: string;
|
|
204
|
-
};
|
|
205
|
-
"outline-share": {
|
|
206
|
-
viewBox: string;
|
|
207
|
-
body: string;
|
|
208
|
-
};
|
|
209
|
-
"outline-eye": {
|
|
210
|
-
viewBox: string;
|
|
211
|
-
body: string;
|
|
212
|
-
};
|
|
213
|
-
"outline-eye-slash": {
|
|
214
|
-
viewBox: string;
|
|
215
|
-
body: string;
|
|
216
|
-
};
|
|
217
|
-
refresh: {
|
|
218
|
-
viewBox: string;
|
|
219
|
-
body: string;
|
|
220
|
-
};
|
|
221
|
-
reset: {
|
|
222
|
-
viewBox: string;
|
|
223
|
-
body: string;
|
|
224
|
-
};
|
|
225
|
-
"outline-reset": {
|
|
226
|
-
viewBox: string;
|
|
227
|
-
body: string;
|
|
228
|
-
};
|
|
229
|
-
"fill-triangle-down": {
|
|
230
|
-
viewBox: string;
|
|
231
|
-
body: string;
|
|
232
|
-
};
|
|
233
|
-
archive: {
|
|
234
|
-
viewBox: string;
|
|
235
|
-
body: string;
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
type IconName = keyof typeof icons | keyof typeof additionalIcons;
|
|
239
4
|
export interface IconProps extends ComponentProps<"svg"> {
|
|
240
5
|
name: IconName | (string & {});
|
|
241
6
|
size?: "small" | "normal" | "large";
|
|
242
7
|
}
|
|
243
8
|
export declare function Icon(props: IconProps): import("solid-js").JSX.Element;
|
|
244
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencode/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -76,6 +76,10 @@
|
|
|
76
76
|
"types": "./dist/icons/icon/icon.d.ts",
|
|
77
77
|
"import": "./src/icons/icon/icon.tsx"
|
|
78
78
|
},
|
|
79
|
+
"./icons/catalog": {
|
|
80
|
+
"types": "./dist/icons/catalog.d.ts",
|
|
81
|
+
"import": "./src/icons/catalog.ts"
|
|
82
|
+
},
|
|
79
83
|
"./icon-button": {
|
|
80
84
|
"types": "./dist/actions/icon-button/icon-button.d.ts",
|
|
81
85
|
"import": "./src/actions/icon-button/icon-button.tsx"
|
|
@@ -2,17 +2,27 @@ import { Content, Header, Item, Root, Trigger } from "@kobalte/core/accordion"
|
|
|
2
2
|
import { splitProps } from "solid-js"
|
|
3
3
|
import type { ComponentProps, ParentProps } from "solid-js"
|
|
4
4
|
|
|
5
|
-
export interface AccordionProps extends ComponentProps<typeof Root> {
|
|
5
|
+
export interface AccordionProps extends Omit<ComponentProps<typeof Root>, "value"> {
|
|
6
|
+
/** Controlled expanded items. Kobalte reads this iterable into its own selection; it never mutates this array. */
|
|
7
|
+
value?: readonly string[]
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
export interface AccordionItemProps extends ComponentProps<typeof Item> {}
|
|
11
|
+
|
|
7
12
|
export interface AccordionHeaderProps extends ComponentProps<typeof Header> {}
|
|
13
|
+
|
|
8
14
|
export interface AccordionTriggerProps extends ComponentProps<typeof Trigger> {}
|
|
15
|
+
|
|
9
16
|
export interface AccordionContentProps extends ComponentProps<typeof Content> {}
|
|
10
17
|
|
|
11
18
|
function AccordionRoot(props: AccordionProps) {
|
|
12
|
-
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
19
|
+
const [split, rest] = splitProps(props, ["class", "classList", "value"])
|
|
20
|
+
|
|
21
|
+
// SAFETY: Kobalte's createMultipleSelectionState copies selectedKeys into a Selection before changing it.
|
|
13
22
|
return (
|
|
14
23
|
<Root
|
|
15
24
|
{...rest}
|
|
25
|
+
value={split.value as string[] | undefined}
|
|
16
26
|
data-component="accordion"
|
|
17
27
|
classList={{
|
|
18
28
|
...split.classList,
|
|
@@ -24,6 +34,7 @@ function AccordionRoot(props: AccordionProps) {
|
|
|
24
34
|
|
|
25
35
|
function AccordionItem(props: AccordionItemProps) {
|
|
26
36
|
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
37
|
+
|
|
27
38
|
return (
|
|
28
39
|
<Item
|
|
29
40
|
{...rest}
|
|
@@ -38,6 +49,7 @@ function AccordionItem(props: AccordionItemProps) {
|
|
|
38
49
|
|
|
39
50
|
function AccordionHeader(props: ParentProps<AccordionHeaderProps>) {
|
|
40
51
|
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
52
|
+
|
|
41
53
|
return (
|
|
42
54
|
<Header
|
|
43
55
|
{...rest}
|
|
@@ -54,6 +66,7 @@ function AccordionHeader(props: ParentProps<AccordionHeaderProps>) {
|
|
|
54
66
|
|
|
55
67
|
function AccordionTrigger(props: ParentProps<AccordionTriggerProps>) {
|
|
56
68
|
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
69
|
+
|
|
57
70
|
return (
|
|
58
71
|
<Trigger
|
|
59
72
|
{...rest}
|
|
@@ -70,6 +83,7 @@ function AccordionTrigger(props: ParentProps<AccordionTriggerProps>) {
|
|
|
70
83
|
|
|
71
84
|
function AccordionContent(props: ParentProps<AccordionContentProps>) {
|
|
72
85
|
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
86
|
+
|
|
73
87
|
return (
|
|
74
88
|
<Content
|
|
75
89
|
{...rest}
|