@altimateai/ui-components 0.0.35 → 0.0.37-beta.1
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/CoachForm.js +4 -4
- package/dist/Form.js +1887 -2033
- package/dist/Stack.js +2 -2
- package/dist/lineage/index.js +1 -1
- package/dist/main.js +75 -75
- package/dist/shadcn/index.d.ts +30 -35
- package/dist/shadcn/index.js +10 -14
- package/dist/storybook/Select.stories.tsx +318 -0
- package/dist/storybook/Tabs.stories.tsx +7 -7
- package/package.json +2 -2
- package/dist/storybook/Combobox.stories.tsx +0 -650
|
@@ -9,8 +9,10 @@ import {
|
|
|
9
9
|
SelectLabel,
|
|
10
10
|
SelectSeparator,
|
|
11
11
|
NativeSelect,
|
|
12
|
+
Combobox,
|
|
12
13
|
} from "../shadcn";
|
|
13
14
|
import { DatabaseIcon } from "@ac-assets/icons";
|
|
15
|
+
import { useState } from "react";
|
|
14
16
|
|
|
15
17
|
export default {
|
|
16
18
|
title: "Shadcn/Components/Select",
|
|
@@ -143,3 +145,319 @@ export const NativeSelectExample: StoryFn = () => {
|
|
|
143
145
|
</div>
|
|
144
146
|
);
|
|
145
147
|
};
|
|
148
|
+
|
|
149
|
+
export const ComboboxExample: StoryFn = () => {
|
|
150
|
+
const options = [
|
|
151
|
+
{ value: "react", label: "React" },
|
|
152
|
+
{ value: "vue", label: "Vue" },
|
|
153
|
+
{ value: "angular", label: "Angular" },
|
|
154
|
+
{ value: "svelte", label: "Svelte" },
|
|
155
|
+
{ value: "nextjs", label: "Next.js" },
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
const [value, setValue] = useState("");
|
|
159
|
+
|
|
160
|
+
const handleChange = (newValue: string | string[]) => {
|
|
161
|
+
setValue(newValue as string);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<div className="al-flex al-flex-col al-gap-4 al-justify-start al-items-start">
|
|
166
|
+
<h3 className="al-text-lg al-font-medium">Single Select</h3>
|
|
167
|
+
<Combobox
|
|
168
|
+
options={options}
|
|
169
|
+
value={value}
|
|
170
|
+
onChange={handleChange}
|
|
171
|
+
placeholder="Select framework..."
|
|
172
|
+
/>
|
|
173
|
+
|
|
174
|
+
<Combobox
|
|
175
|
+
options={options}
|
|
176
|
+
value={value}
|
|
177
|
+
onChange={handleChange}
|
|
178
|
+
placeholder="Custom width..."
|
|
179
|
+
buttonProps={{ className: "al-w-[300px]" }}
|
|
180
|
+
/>
|
|
181
|
+
|
|
182
|
+
<Combobox
|
|
183
|
+
options={options}
|
|
184
|
+
value={value}
|
|
185
|
+
onChange={handleChange}
|
|
186
|
+
placeholder="With icon..."
|
|
187
|
+
icon={<DatabaseIcon className="al-mr-2" />}
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const ComboboxMultiSelectExample: StoryFn = () => {
|
|
194
|
+
const options = [
|
|
195
|
+
{ value: "react", label: "React" },
|
|
196
|
+
{ value: "vue", label: "Vue" },
|
|
197
|
+
{ value: "angular", label: "Angular" },
|
|
198
|
+
{ value: "svelte", label: "Svelte" },
|
|
199
|
+
{ value: "nextjs", label: "Next.js" },
|
|
200
|
+
{ value: "remix", label: "Remix" },
|
|
201
|
+
{ value: "gatsby", label: "Gatsby" },
|
|
202
|
+
{ value: "ember", label: "Ember.js" },
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
const [selectedValues, setSelectedValues] = useState<string[]>([]);
|
|
206
|
+
const [selectedValuesWithApply, setSelectedValuesWithApply] = useState<string[]>([
|
|
207
|
+
"react",
|
|
208
|
+
"vue",
|
|
209
|
+
]);
|
|
210
|
+
|
|
211
|
+
const handleMultiSelectChange = (newValue: string | string[]) => {
|
|
212
|
+
setSelectedValues(Array.isArray(newValue) ? newValue : []);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const handleMultiSelectWithApplyChange = (newValue: string | string[]) => {
|
|
216
|
+
setSelectedValuesWithApply(Array.isArray(newValue) ? newValue : []);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
return (
|
|
220
|
+
<div className="al-flex al-flex-col al-gap-8 al-justify-start al-items-start">
|
|
221
|
+
<div className="al-flex al-flex-col al-gap-4">
|
|
222
|
+
<h3 className="al-text-lg al-font-medium">Multi-Select (Auto-Apply)</h3>
|
|
223
|
+
<p className="al-text-sm al-text-muted-foreground">
|
|
224
|
+
Changes are applied immediately when selecting/deselecting options
|
|
225
|
+
</p>
|
|
226
|
+
<Combobox
|
|
227
|
+
options={options}
|
|
228
|
+
value={selectedValues}
|
|
229
|
+
onChange={handleMultiSelectChange}
|
|
230
|
+
placeholder="Select frameworks..."
|
|
231
|
+
multiSelect={true}
|
|
232
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
233
|
+
/>
|
|
234
|
+
<div className="al-text-sm">
|
|
235
|
+
Selected: {selectedValues.length > 0 ? selectedValues.join(", ") : "None"}
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<div className="al-flex al-flex-col al-gap-4">
|
|
240
|
+
<h3 className="al-text-lg al-font-medium">Multi-Select with Apply Button</h3>
|
|
241
|
+
<p className="al-text-sm al-text-muted-foreground">
|
|
242
|
+
Changes are only applied when clicking the Apply button
|
|
243
|
+
</p>
|
|
244
|
+
<Combobox
|
|
245
|
+
options={options}
|
|
246
|
+
value={selectedValuesWithApply}
|
|
247
|
+
onChange={handleMultiSelectWithApplyChange}
|
|
248
|
+
placeholder="Select frameworks..."
|
|
249
|
+
multiSelect={true}
|
|
250
|
+
showApplyButton={true}
|
|
251
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
252
|
+
/>
|
|
253
|
+
<div className="al-text-sm">
|
|
254
|
+
Selected:{" "}
|
|
255
|
+
{selectedValuesWithApply.length > 0 ? selectedValuesWithApply.join(", ") : "None"}
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<div className="al-flex al-flex-col al-gap-4">
|
|
260
|
+
<h3 className="al-text-lg al-font-medium">Columns Selector Example</h3>
|
|
261
|
+
<p className="al-text-sm al-text-muted-foreground">
|
|
262
|
+
Similar to the UI shown in the screenshot
|
|
263
|
+
</p>
|
|
264
|
+
<ComboboxColumnsExample />
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
// Example that matches the UI in the screenshot
|
|
271
|
+
const ComboboxColumnsExample = () => {
|
|
272
|
+
const options = [
|
|
273
|
+
{ value: "est_cost", label: "Est. Cost" },
|
|
274
|
+
{ value: "exec_time", label: "Exec. Time" },
|
|
275
|
+
{ value: "insights", label: "Insights" },
|
|
276
|
+
{ value: "query_hash", label: "Query Hash" },
|
|
277
|
+
{ value: "query_text", label: "Query Text" },
|
|
278
|
+
{ value: "query_type", label: "Query Type" },
|
|
279
|
+
{ value: "timestamp", label: "Timestamp" },
|
|
280
|
+
{ value: "user", label: "User" },
|
|
281
|
+
];
|
|
282
|
+
|
|
283
|
+
const [selectedColumns, setSelectedColumns] = useState<string[]>([
|
|
284
|
+
"est_cost",
|
|
285
|
+
"exec_time",
|
|
286
|
+
"insights",
|
|
287
|
+
"query_hash",
|
|
288
|
+
"query_text",
|
|
289
|
+
"query_type",
|
|
290
|
+
"timestamp",
|
|
291
|
+
"user",
|
|
292
|
+
]);
|
|
293
|
+
|
|
294
|
+
const handleColumnsChange = (newValue: string | string[]) => {
|
|
295
|
+
setSelectedColumns(Array.isArray(newValue) ? newValue : []);
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
return (
|
|
299
|
+
<Combobox
|
|
300
|
+
options={options}
|
|
301
|
+
value={selectedColumns}
|
|
302
|
+
onChange={handleColumnsChange}
|
|
303
|
+
placeholder="Columns"
|
|
304
|
+
multiSelect={true}
|
|
305
|
+
showApplyButton={true}
|
|
306
|
+
buttonProps={{ className: "al-w-[200px]" }}
|
|
307
|
+
/>
|
|
308
|
+
);
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export const ComboboxAdvancedExample: StoryFn = () => {
|
|
312
|
+
const options = [
|
|
313
|
+
{ value: "react", label: "React" },
|
|
314
|
+
{ value: "vue", label: "Vue" },
|
|
315
|
+
{ value: "angular", label: "Angular" },
|
|
316
|
+
{ value: "svelte", label: "Svelte" },
|
|
317
|
+
{ value: "nextjs", label: "Next.js" },
|
|
318
|
+
{ value: "remix", label: "Remix" },
|
|
319
|
+
{ value: "gatsby", label: "Gatsby" },
|
|
320
|
+
{ value: "ember", label: "Ember.js" },
|
|
321
|
+
];
|
|
322
|
+
|
|
323
|
+
const [singleValue, setSingleValue] = useState("");
|
|
324
|
+
const [multiValue, setMultiValue] = useState<string[]>(["react", "vue"]);
|
|
325
|
+
const [clearableValue, setClearableValue] = useState("angular");
|
|
326
|
+
const [multiClearableValue, setMultiClearableValue] = useState<string[]>(["nextjs", "remix"]);
|
|
327
|
+
const [multiApplyValue, setMultiApplyValue] = useState<string[]>(["gatsby", "ember"]);
|
|
328
|
+
|
|
329
|
+
return (
|
|
330
|
+
<div className="al-flex al-flex-col al-gap-8 al-justify-start al-items-start">
|
|
331
|
+
<div className="al-flex al-flex-col al-gap-4">
|
|
332
|
+
<h3 className="al-text-lg al-font-medium">Search Placeholders</h3>
|
|
333
|
+
<p className="al-text-sm al-text-muted-foreground">Different search placeholder examples</p>
|
|
334
|
+
|
|
335
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
336
|
+
<label className="al-text-sm al-font-medium">Default Search Placeholder</label>
|
|
337
|
+
<Combobox
|
|
338
|
+
options={options}
|
|
339
|
+
value={singleValue}
|
|
340
|
+
onChange={value => setSingleValue(value as string)}
|
|
341
|
+
placeholder="Select framework..."
|
|
342
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
343
|
+
/>
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
347
|
+
<label className="al-text-sm al-font-medium">Custom Search Placeholder</label>
|
|
348
|
+
<Combobox
|
|
349
|
+
options={options}
|
|
350
|
+
value={singleValue}
|
|
351
|
+
onChange={value => setSingleValue(value as string)}
|
|
352
|
+
placeholder="Select framework..."
|
|
353
|
+
searchPlaceholder="Type to find frameworks..."
|
|
354
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
355
|
+
/>
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
359
|
+
<label className="al-text-sm al-font-medium">Empty Search Placeholder</label>
|
|
360
|
+
<Combobox
|
|
361
|
+
options={options}
|
|
362
|
+
value={singleValue}
|
|
363
|
+
onChange={value => setSingleValue(value as string)}
|
|
364
|
+
placeholder="Select framework..."
|
|
365
|
+
searchPlaceholder=""
|
|
366
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
367
|
+
/>
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
<div className="al-flex al-flex-col al-gap-4">
|
|
372
|
+
<h3 className="al-text-lg al-font-medium">Clear Button Examples</h3>
|
|
373
|
+
<p className="al-text-sm al-text-muted-foreground">
|
|
374
|
+
Demonstrating showClearButton prop with different configurations
|
|
375
|
+
</p>
|
|
376
|
+
|
|
377
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
378
|
+
<label className="al-text-sm al-font-medium">
|
|
379
|
+
Single Select - No Clear Button (Default)
|
|
380
|
+
</label>
|
|
381
|
+
<Combobox
|
|
382
|
+
options={options}
|
|
383
|
+
value={clearableValue}
|
|
384
|
+
onChange={value => setClearableValue(value as string)}
|
|
385
|
+
placeholder="Select framework..."
|
|
386
|
+
searchPlaceholder="Search frameworks..."
|
|
387
|
+
showClearButton={false}
|
|
388
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
389
|
+
/>
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
393
|
+
<label className="al-text-sm al-font-medium">Single Select - With Clear Button</label>
|
|
394
|
+
<Combobox
|
|
395
|
+
options={options}
|
|
396
|
+
value={clearableValue}
|
|
397
|
+
onChange={value => setClearableValue(value as string)}
|
|
398
|
+
placeholder="Select framework..."
|
|
399
|
+
searchPlaceholder="Search frameworks..."
|
|
400
|
+
showClearButton={true}
|
|
401
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
402
|
+
/>
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
406
|
+
<label className="al-text-sm al-font-medium">Multi Select - No Clear Button</label>
|
|
407
|
+
<Combobox
|
|
408
|
+
options={options}
|
|
409
|
+
value={multiValue}
|
|
410
|
+
onChange={value => setMultiValue(value as string[])}
|
|
411
|
+
placeholder="Select frameworks..."
|
|
412
|
+
searchPlaceholder="Find your frameworks..."
|
|
413
|
+
multiSelect={true}
|
|
414
|
+
showClearButton={false}
|
|
415
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
416
|
+
/>
|
|
417
|
+
<div className="al-text-sm">
|
|
418
|
+
Selected: {multiValue.length > 0 ? multiValue.join(", ") : "None"}
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
423
|
+
<label className="al-text-sm al-font-medium">Multi Select - With Clear Button</label>
|
|
424
|
+
<Combobox
|
|
425
|
+
options={options}
|
|
426
|
+
value={multiClearableValue}
|
|
427
|
+
onChange={value => setMultiClearableValue(value as string[])}
|
|
428
|
+
placeholder="Select frameworks..."
|
|
429
|
+
searchPlaceholder="Find your frameworks..."
|
|
430
|
+
multiSelect={true}
|
|
431
|
+
showClearButton={true}
|
|
432
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
433
|
+
/>
|
|
434
|
+
<div className="al-text-sm">
|
|
435
|
+
Selected: {multiClearableValue.length > 0 ? multiClearableValue.join(", ") : "None"}
|
|
436
|
+
</div>
|
|
437
|
+
</div>
|
|
438
|
+
|
|
439
|
+
<div className="al-flex al-flex-col al-gap-2">
|
|
440
|
+
<label className="al-text-sm al-font-medium">
|
|
441
|
+
Multi Select - With Apply Button & Clear Button
|
|
442
|
+
</label>
|
|
443
|
+
<Combobox
|
|
444
|
+
options={options}
|
|
445
|
+
value={multiApplyValue}
|
|
446
|
+
onChange={value => setMultiApplyValue(value as string[])}
|
|
447
|
+
placeholder="Select frameworks..."
|
|
448
|
+
searchPlaceholder="Filter options..."
|
|
449
|
+
multiSelect={true}
|
|
450
|
+
showApplyButton={true}
|
|
451
|
+
showClearButton={true}
|
|
452
|
+
buttonProps={{ className: "al-w-[250px]" }}
|
|
453
|
+
/>
|
|
454
|
+
<div className="al-text-sm">
|
|
455
|
+
Selected: {multiApplyValue.length > 0 ? multiApplyValue.join(", ") : "None"}
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
);
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
// Example that matches the UI in the screenshot
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
},
|
|
13
13
|
} as Meta;
|
|
14
14
|
|
|
15
|
-
export const Default: StoryFn = args => (
|
|
15
|
+
export const Default: StoryFn = (args) => (
|
|
16
16
|
<Tabs defaultValue="tab1" {...args}>
|
|
17
17
|
<TabsList>
|
|
18
18
|
<TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
@@ -28,7 +28,7 @@ Default.args = {
|
|
|
28
28
|
variant: "default",
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export const Underlined: StoryFn = args => (
|
|
31
|
+
export const Underlined: StoryFn = (args) => (
|
|
32
32
|
<Tabs defaultValue="overview" variant="underlined" {...args}>
|
|
33
33
|
<TabsList>
|
|
34
34
|
<TabsTrigger value="overview">Overview</TabsTrigger>
|
|
@@ -56,7 +56,7 @@ export const Underlined: StoryFn = args => (
|
|
|
56
56
|
</Tabs>
|
|
57
57
|
);
|
|
58
58
|
|
|
59
|
-
export const WithRichContent: StoryFn = args => (
|
|
59
|
+
export const WithRichContent: StoryFn = (args) => (
|
|
60
60
|
<Tabs defaultValue="profile" variant="underlined" {...args}>
|
|
61
61
|
<TabsList>
|
|
62
62
|
<TabsTrigger value="profile">Profile</TabsTrigger>
|
|
@@ -103,7 +103,7 @@ export const WithRichContent: StoryFn = args => (
|
|
|
103
103
|
</Tabs>
|
|
104
104
|
);
|
|
105
105
|
|
|
106
|
-
export const ManyTabs: StoryFn = args => (
|
|
106
|
+
export const ManyTabs: StoryFn = (args) => (
|
|
107
107
|
<Tabs defaultValue="home" variant="underlined" {...args}>
|
|
108
108
|
<TabsList>
|
|
109
109
|
<TabsTrigger value="home">Home</TabsTrigger>
|
|
@@ -120,7 +120,7 @@ export const ManyTabs: StoryFn = args => (
|
|
|
120
120
|
</Tabs>
|
|
121
121
|
);
|
|
122
122
|
|
|
123
|
-
export const LongLabels: StoryFn = args => (
|
|
123
|
+
export const LongLabels: StoryFn = (args) => (
|
|
124
124
|
<Tabs defaultValue="dashboard" variant="underlined" {...args}>
|
|
125
125
|
<TabsList>
|
|
126
126
|
<TabsTrigger value="dashboard">Dashboard Overview</TabsTrigger>
|
|
@@ -133,7 +133,7 @@ export const LongLabels: StoryFn = args => (
|
|
|
133
133
|
</Tabs>
|
|
134
134
|
);
|
|
135
135
|
|
|
136
|
-
export const MinimalContent: StoryFn = args => (
|
|
136
|
+
export const MinimalContent: StoryFn = (args) => (
|
|
137
137
|
<Tabs defaultValue="a" variant="underlined" {...args}>
|
|
138
138
|
<TabsList>
|
|
139
139
|
<TabsTrigger value="a">Tab A</TabsTrigger>
|
|
@@ -144,4 +144,4 @@ export const MinimalContent: StoryFn = args => (
|
|
|
144
144
|
<TabsContent value="b">B</TabsContent>
|
|
145
145
|
<TabsContent value="c">C</TabsContent>
|
|
146
146
|
</Tabs>
|
|
147
|
-
);
|
|
147
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altimateai/ui-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37-beta.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/AltimateAI/altimate-components.git"
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
"react": "^17.0.0 || ^18.0.0",
|
|
53
53
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|