@aleph-alpha/ui-library 2.6.0 → 2.6.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.
- package/dist/system/components/UiFileUploadBox/types.d.ts +1 -1
- package/dist/system/lib.js +2424 -2437
- package/dist/system/patterns/UiDataTable/UiDataTableToolbar.vue.d.ts +23 -12
- package/dist/system/patterns/UiDataTable/constants.d.ts +0 -13
- package/dist/system/patterns/UiDataTable/index.d.ts +1 -0
- package/dist/system/patterns/UiDataTable/types.d.ts +1 -28
- package/package.json +1 -1
- package/src/components/UiCodeBlock/UiCodeBlock.vue +17 -3
- package/src/components/UiCodeBlock/__tests__/UiCodeBlock.test.ts +21 -0
- package/src/components/UiFileItem/UiFileItem.stories.ts +1 -5
- package/src/components/UiFileUploadBox/types.ts +1 -1
- package/src/components/UiItem/UiItem.stories.ts +8 -11
- package/src/components/UiSelect/UiSelect.stories.ts +20 -20
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +186 -118
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +1 -1
- package/src/patterns/UiDataTable/UiDataTableToolbar.vue +17 -58
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnFilter.test.ts +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTableToolbar.test.ts +26 -201
- package/src/patterns/UiDataTable/constants.ts +0 -15
- package/src/patterns/UiDataTable/index.ts +1 -0
- package/src/patterns/UiDataTable/types.ts +0 -29
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}>
|
|
9
|
-
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: Readonly<{
|
|
4
|
+
/** Primary controls, usually search and column filters. */
|
|
5
|
+
default(): unknown;
|
|
6
|
+
/** Trailing controls, usually view options or reset actions. */
|
|
7
|
+
actions(): unknown;
|
|
8
|
+
}> & {
|
|
9
|
+
/** Primary controls, usually search and column filters. */
|
|
10
|
+
default(): unknown;
|
|
11
|
+
/** Trailing controls, usually view options or reset actions. */
|
|
12
|
+
actions(): unknown;
|
|
13
|
+
};
|
|
14
|
+
refs: {};
|
|
15
|
+
rootEl: HTMLDivElement;
|
|
10
16
|
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
11
20
|
export default _default;
|
|
12
|
-
type
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -21,10 +21,6 @@ export declare const DATA_TABLE_LABELS: {
|
|
|
21
21
|
readonly goToLastPage: "Go to last page";
|
|
22
22
|
readonly pageOf: (page: number, total: number) => string;
|
|
23
23
|
readonly rowsSelected: (selected: number, total: number) => string;
|
|
24
|
-
/** UiDataTableToolbar */
|
|
25
|
-
readonly filterPlaceholder: "Search...";
|
|
26
|
-
readonly searchAllColumns: "Search all columns";
|
|
27
|
-
readonly filterByColumn: (column: string) => string;
|
|
28
24
|
/** UiDataTableColumnFilter */
|
|
29
25
|
readonly columns: "Columns";
|
|
30
26
|
readonly toggleColumns: "Toggle columns";
|
|
@@ -61,15 +57,6 @@ export interface PaginationLabels {
|
|
|
61
57
|
/** Function to generate selection count text */
|
|
62
58
|
rowsSelected?: (selected: number, total: number) => string;
|
|
63
59
|
}
|
|
64
|
-
/** Labels for UiDataTableToolbar */
|
|
65
|
-
export interface ToolbarLabels {
|
|
66
|
-
/** Placeholder text for filter input */
|
|
67
|
-
filterPlaceholder?: string;
|
|
68
|
-
/** Aria label for global search input */
|
|
69
|
-
searchAllColumns?: string;
|
|
70
|
-
/** Function to generate aria label for column filter */
|
|
71
|
-
filterByColumn?: (column: string) => string;
|
|
72
|
-
}
|
|
73
60
|
/** Labels for UiDataTableColumnFilter */
|
|
74
61
|
export interface ColumnFilterLabels {
|
|
75
62
|
/** Visible label for the trigger button. */
|
|
@@ -3,6 +3,7 @@ export { default as UiDataTableColumnFilter } from './UiDataTableColumnFilter.vu
|
|
|
3
3
|
export { default as UiDataTableColumnHeader } from './UiDataTableColumnHeader.vue';
|
|
4
4
|
export { default as UiDataTablePagination } from './UiDataTablePagination.vue';
|
|
5
5
|
export { default as UiDataTableToolbar } from './UiDataTableToolbar.vue';
|
|
6
|
+
export type { Column, ColumnDef, Row, Table } from '@tanstack/vue-table';
|
|
6
7
|
export * from './types';
|
|
7
8
|
export * from './constants';
|
|
8
9
|
export * from '../../lib/useDrag';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Column, ColumnDef, Row, Table } from '@tanstack/vue-table';
|
|
2
|
-
import { ColumnHeaderLabels, ColumnFilterLabels, PaginationLabels
|
|
2
|
+
import { ColumnHeaderLabels, ColumnFilterLabels, PaginationLabels } from './constants';
|
|
3
3
|
/**
|
|
4
4
|
* A feature-rich data table with sorting, filtering, and pagination.
|
|
5
5
|
* Use for displaying and managing large datasets with interactive features.
|
|
@@ -104,33 +104,6 @@ export type UiDataTablePaginationProps<TData> = {
|
|
|
104
104
|
*/
|
|
105
105
|
labels?: PaginationLabels;
|
|
106
106
|
};
|
|
107
|
-
/**
|
|
108
|
-
* Props for the UiDataTableToolbar component.
|
|
109
|
-
*/
|
|
110
|
-
export type UiDataTableToolbarProps<TData> = {
|
|
111
|
-
/**
|
|
112
|
-
* The TanStack Table instance.
|
|
113
|
-
* @internal
|
|
114
|
-
*/
|
|
115
|
-
table: Table<TData>;
|
|
116
|
-
/** Filter a specific column by its accessor key. */
|
|
117
|
-
filterColumn?: string;
|
|
118
|
-
/**
|
|
119
|
-
* Enable global search across all columns (takes precedence over filterColumn).
|
|
120
|
-
* @default false
|
|
121
|
-
*/
|
|
122
|
-
globalFilter?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Placeholder text for the filter input.
|
|
125
|
-
* @default "Search..."
|
|
126
|
-
*/
|
|
127
|
-
filterPlaceholder?: string;
|
|
128
|
-
/**
|
|
129
|
-
* Custom labels for i18n support.
|
|
130
|
-
* Partial object that merges with defaults.
|
|
131
|
-
*/
|
|
132
|
-
labels?: ToolbarLabels;
|
|
133
|
-
};
|
|
134
107
|
/**
|
|
135
108
|
* Props for the UiDataTableColumnFilter component.
|
|
136
109
|
*/
|
package/package.json
CHANGED
|
@@ -28,6 +28,13 @@ const isCopied = ref(false);
|
|
|
28
28
|
|
|
29
29
|
const { copy } = useClipboard();
|
|
30
30
|
|
|
31
|
+
const TOKEN_COLOR_CONTENT_ON_SURFACE_PRIMARY =
|
|
32
|
+
'oklch(var(--content-on-surface-primary))';
|
|
33
|
+
const shikiTokenColorOverrides = {
|
|
34
|
+
'#E36209': TOKEN_COLOR_CONTENT_ON_SURFACE_PRIMARY,
|
|
35
|
+
'#FFAB70': TOKEN_COLOR_CONTENT_ON_SURFACE_PRIMARY,
|
|
36
|
+
} as const;
|
|
37
|
+
|
|
31
38
|
const headerLabel = computed(() => props.filename || props.language);
|
|
32
39
|
const showHeader = computed(
|
|
33
40
|
() => headerLabel.value !== 'text' || props.showCopyButton,
|
|
@@ -35,6 +42,13 @@ const showHeader = computed(
|
|
|
35
42
|
|
|
36
43
|
let highlightRequestId = 0;
|
|
37
44
|
|
|
45
|
+
function normalizeShikiTokenColors(html: string) {
|
|
46
|
+
return Object.entries(shikiTokenColorOverrides).reduce(
|
|
47
|
+
(nextHtml, [from, to]) => nextHtml.replaceAll(from, to),
|
|
48
|
+
html,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
38
52
|
async function highlightCode() {
|
|
39
53
|
const requestId = ++highlightRequestId;
|
|
40
54
|
isHighlighted.value = false;
|
|
@@ -47,7 +61,7 @@ async function highlightCode() {
|
|
|
47
61
|
},
|
|
48
62
|
});
|
|
49
63
|
if (requestId !== highlightRequestId) return;
|
|
50
|
-
highlightedHtml.value = html;
|
|
64
|
+
highlightedHtml.value = normalizeShikiTokenColors(html);
|
|
51
65
|
isHighlighted.value = true;
|
|
52
66
|
} catch {
|
|
53
67
|
if (requestId !== highlightRequestId) return;
|
|
@@ -60,7 +74,7 @@ async function highlightCode() {
|
|
|
60
74
|
},
|
|
61
75
|
});
|
|
62
76
|
if (requestId !== highlightRequestId) return;
|
|
63
|
-
highlightedHtml.value = html;
|
|
77
|
+
highlightedHtml.value = normalizeShikiTokenColors(html);
|
|
64
78
|
isHighlighted.value = true;
|
|
65
79
|
} catch {
|
|
66
80
|
if (requestId !== highlightRequestId) return;
|
|
@@ -107,7 +121,7 @@ onUnmounted(() => {
|
|
|
107
121
|
v-if="showHeader"
|
|
108
122
|
class="flex items-center justify-between border-b border-border bg-background-surface-muted px-4 py-2"
|
|
109
123
|
>
|
|
110
|
-
<span class="font-mono text-sm text-
|
|
124
|
+
<span class="font-mono text-sm text-content-on-surface-secondary">
|
|
111
125
|
{{ headerLabel !== 'text' ? headerLabel : '' }}
|
|
112
126
|
</span>
|
|
113
127
|
<UiButton
|
|
@@ -58,6 +58,27 @@ describe('UiCodeBlock', () => {
|
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
+
test('normalizes low-contrast Shiki token colors to theme tokens', async () => {
|
|
62
|
+
const { codeToHtml } = await import('shiki');
|
|
63
|
+
vi.mocked(codeToHtml).mockResolvedValueOnce(
|
|
64
|
+
'<pre class="shiki shiki-themes github-light github-dark"><code><span class="line"><span style="color:#E36209;--shiki-dark:#FFAB70">columns</span></span></code></pre>',
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const { container } = render(UiCodeBlock, {
|
|
68
|
+
props: { code: 'columns', language: 'typescript' },
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
await waitFor(() => {
|
|
72
|
+
expect(container.querySelector('.shiki')).toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
expect(container.innerHTML).toContain(
|
|
76
|
+
'oklch(var(--content-on-surface-primary))',
|
|
77
|
+
);
|
|
78
|
+
expect(container.innerHTML).not.toContain('#E36209');
|
|
79
|
+
expect(container.innerHTML).not.toContain('#FFAB70');
|
|
80
|
+
});
|
|
81
|
+
|
|
61
82
|
test('shows language label in header', async () => {
|
|
62
83
|
const { getByText } = render(UiCodeBlock, {
|
|
63
84
|
props: { code: 'print("hi")', language: 'python' },
|
|
@@ -5,15 +5,11 @@ import UiFileItem from './UiFileItem.vue';
|
|
|
5
5
|
* `UiFileItem` is a single-row primitive that represents a file with
|
|
6
6
|
* optional progress, error, and a remove control. Use it inside file-upload
|
|
7
7
|
* flows or attachment lists; for the full uploader, see `UiFileUpload` pattern.
|
|
8
|
-
*
|
|
9
|
-
* Beta until the `background/accent/{pink,yellow}` design tokens are synced
|
|
10
|
-
* from Figma into `tokens.json` — the file-type badge currently sources them
|
|
11
|
-
* from static fallbacks in `config.js` (see `getStaticTokenVars`).
|
|
12
8
|
*/
|
|
13
9
|
const meta: Meta<typeof UiFileItem> = {
|
|
14
10
|
title: 'Components/UiFileItem',
|
|
15
11
|
component: UiFileItem,
|
|
16
|
-
tags: ['autodocs'
|
|
12
|
+
tags: ['autodocs'],
|
|
17
13
|
args: {
|
|
18
14
|
filename: 'document.pdf',
|
|
19
15
|
typeLabel: 'PDF',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Drop zone + file picker for selecting files with optional type/size validation.
|
|
3
3
|
*
|
|
4
4
|
* **Emits:** see {@link UiFileUploadBoxEmits}.
|
|
5
|
-
* @category
|
|
5
|
+
* @category Form Inputs
|
|
6
6
|
* @useCases file upload area, drag and drop attachments
|
|
7
7
|
* @keywords file, upload, drag, drop, attachment
|
|
8
8
|
* @related UiFileItem, UiButton
|
|
@@ -162,7 +162,7 @@ const customSlotsTemplate = `
|
|
|
162
162
|
<UiItem variant="hover-action">
|
|
163
163
|
<template #icon>
|
|
164
164
|
<UiAvatar>
|
|
165
|
-
<UiAvatarImage src="https://i.pravatar.cc/150?u=ui-item" />
|
|
165
|
+
<UiAvatarImage src="https://i.pravatar.cc/150?u=ui-item" alt="User avatar" />
|
|
166
166
|
<UiAvatarFallback>AR</UiAvatarFallback>
|
|
167
167
|
</UiAvatar>
|
|
168
168
|
</template>
|
|
@@ -170,11 +170,8 @@ const customSlotsTemplate = `
|
|
|
170
170
|
<template #content>
|
|
171
171
|
<div class="flex items-center gap-2">
|
|
172
172
|
<span class="body-14-medium">Custom Content</span>
|
|
173
|
-
<span class="rounded-sm bg-background-surface-muted px-1.5 label-12-medium text-content-on-surface-muted">
|
|
174
|
-
Beta
|
|
175
|
-
</span>
|
|
176
173
|
</div>
|
|
177
|
-
<p class="body-14-regular text-content-on-surface-
|
|
174
|
+
<p class="body-14-regular text-content-on-surface-secondary">
|
|
178
175
|
Content, media, and action slots can be fully composed.
|
|
179
176
|
</p>
|
|
180
177
|
</template>
|
|
@@ -262,7 +259,7 @@ const mediaTemplate = `
|
|
|
262
259
|
<UiItem variant="hover">
|
|
263
260
|
<UiItemMedia>
|
|
264
261
|
<UiAvatar>
|
|
265
|
-
<UiAvatarImage src="https://i.pravatar.cc/150?u=media-avatar" />
|
|
262
|
+
<UiAvatarImage src="https://i.pravatar.cc/150?u=media-avatar" alt="Media avatar" />
|
|
266
263
|
<UiAvatarFallback>MA</UiAvatarFallback>
|
|
267
264
|
</UiAvatar>
|
|
268
265
|
</UiItemMedia>
|
|
@@ -373,7 +370,7 @@ const asLinkTemplate = `
|
|
|
373
370
|
const allVariantsTemplate = `
|
|
374
371
|
<div class="flex w-full flex-row justify-between gap-6">
|
|
375
372
|
<UiItemGroup class="flex flex-col gap-2">
|
|
376
|
-
<div class="label-12-medium text-content-on-surface-
|
|
373
|
+
<div class="label-12-medium text-content-on-surface-secondary">Default Variant</div>
|
|
377
374
|
<UiItem title="Default size" description="Standard spacing without row hover." />
|
|
378
375
|
<UiItemSeparator />
|
|
379
376
|
<UiItem size="sm" title="Small size" description="Compact spacing without row hover." />
|
|
@@ -382,7 +379,7 @@ const allVariantsTemplate = `
|
|
|
382
379
|
</UiItemGroup>
|
|
383
380
|
|
|
384
381
|
<UiItemGroup class="flex flex-col gap-2">
|
|
385
|
-
<div class="label-12-medium text-content-on-surface-
|
|
382
|
+
<div class="label-12-medium text-content-on-surface-secondary">Active Variant</div>
|
|
386
383
|
<UiItem variant="active" title="Default size" description="Active indicator and background." />
|
|
387
384
|
<UiItemSeparator />
|
|
388
385
|
<UiItem variant="active" size="sm" title="Small size" description="Compact active row." />
|
|
@@ -391,7 +388,7 @@ const allVariantsTemplate = `
|
|
|
391
388
|
</UiItemGroup>
|
|
392
389
|
|
|
393
390
|
<UiItemGroup class="flex flex-col gap-2">
|
|
394
|
-
<div class="label-12-medium text-content-on-surface-
|
|
391
|
+
<div class="label-12-medium text-content-on-surface-secondary">Outline Variant</div>
|
|
395
392
|
<UiItem variant="outline" title="Default size" description="Inset outline keeps height stable." />
|
|
396
393
|
<UiItemSeparator />
|
|
397
394
|
<UiItem variant="outline" size="sm" title="Small size" description="Compact outlined row." />
|
|
@@ -400,7 +397,7 @@ const allVariantsTemplate = `
|
|
|
400
397
|
</UiItemGroup>
|
|
401
398
|
|
|
402
399
|
<UiItemGroup class="flex flex-col gap-2">
|
|
403
|
-
<div class="label-12-medium text-content-on-surface-
|
|
400
|
+
<div class="label-12-medium text-content-on-surface-secondary">Hover Variant</div>
|
|
404
401
|
<UiItem variant="hover" title="Default size" description="Only row hover feedback." />
|
|
405
402
|
<UiItemSeparator />
|
|
406
403
|
<UiItem variant="hover" size="sm" title="Small size" description="Compact row hover feedback." />
|
|
@@ -409,7 +406,7 @@ const allVariantsTemplate = `
|
|
|
409
406
|
</UiItemGroup>
|
|
410
407
|
|
|
411
408
|
<UiItemGroup class="flex flex-col gap-2">
|
|
412
|
-
<div class="label-12-medium text-content-on-surface-
|
|
409
|
+
<div class="label-12-medium text-content-on-surface-secondary">Hover Action Variant</div>
|
|
413
410
|
<UiItem variant="hover-action" title="Default size" description="Row hover plus action hover." />
|
|
414
411
|
<UiItemSeparator />
|
|
415
412
|
<UiItem variant="hover-action" size="sm" title="Small size" description="Compact row and action hover." />
|
|
@@ -59,7 +59,7 @@ const value = ref('')
|
|
|
59
59
|
|
|
60
60
|
<template>
|
|
61
61
|
<UiSelect v-model="value">
|
|
62
|
-
<UiSelectTrigger>
|
|
62
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
63
63
|
<UiSelectValue placeholder="Select a fruit" />
|
|
64
64
|
</UiSelectTrigger>
|
|
65
65
|
<UiSelectContent>
|
|
@@ -89,7 +89,7 @@ export const Default: Story = {
|
|
|
89
89
|
},
|
|
90
90
|
template: `
|
|
91
91
|
<UiSelect v-model="value" v-bind="args">
|
|
92
|
-
<UiSelectTrigger>
|
|
92
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
93
93
|
<UiSelectValue placeholder="Select a fruit" />
|
|
94
94
|
</UiSelectTrigger>
|
|
95
95
|
<UiSelectContent>
|
|
@@ -129,7 +129,7 @@ const value = ref('')
|
|
|
129
129
|
|
|
130
130
|
<template>
|
|
131
131
|
<UiSelect v-model="value">
|
|
132
|
-
<UiSelectTrigger>
|
|
132
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
133
133
|
<UiSelectValue placeholder="Select a food" />
|
|
134
134
|
</UiSelectTrigger>
|
|
135
135
|
<UiSelectContent>
|
|
@@ -171,7 +171,7 @@ export const WithGroups: Story = {
|
|
|
171
171
|
},
|
|
172
172
|
template: `
|
|
173
173
|
<UiSelect v-model="value" v-bind="args">
|
|
174
|
-
<UiSelectTrigger>
|
|
174
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
175
175
|
<UiSelectValue placeholder="Select a food" />
|
|
176
176
|
</UiSelectTrigger>
|
|
177
177
|
<UiSelectContent>
|
|
@@ -216,7 +216,7 @@ const value = ref('')
|
|
|
216
216
|
|
|
217
217
|
<template>
|
|
218
218
|
<UiSelect v-model="value">
|
|
219
|
-
<UiSelectTrigger>
|
|
219
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
220
220
|
<UiSelectValue placeholder="Select a plan" />
|
|
221
221
|
</UiSelectTrigger>
|
|
222
222
|
<UiSelectContent>
|
|
@@ -245,7 +245,7 @@ export const WithDisabledItems: Story = {
|
|
|
245
245
|
},
|
|
246
246
|
template: `
|
|
247
247
|
<UiSelect v-model="value" v-bind="args">
|
|
248
|
-
<UiSelectTrigger>
|
|
248
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
249
249
|
<UiSelectValue placeholder="Select a plan" />
|
|
250
250
|
</UiSelectTrigger>
|
|
251
251
|
<UiSelectContent>
|
|
@@ -281,7 +281,7 @@ const value = ref('')
|
|
|
281
281
|
|
|
282
282
|
<template>
|
|
283
283
|
<UiSelect v-model="value">
|
|
284
|
-
<UiSelectTrigger class="w-[220px]">
|
|
284
|
+
<UiSelectTrigger ariaLabel="Select option" class="w-[220px]">
|
|
285
285
|
<UiSelectValue placeholder="Select chart type" />
|
|
286
286
|
</UiSelectTrigger>
|
|
287
287
|
<UiSelectContent>
|
|
@@ -327,7 +327,7 @@ export const WithIcons: Story = {
|
|
|
327
327
|
},
|
|
328
328
|
template: `
|
|
329
329
|
<UiSelect v-model="value" v-bind="args">
|
|
330
|
-
<UiSelectTrigger class="w-[220px]">
|
|
330
|
+
<UiSelectTrigger ariaLabel="Select option" class="w-[220px]">
|
|
331
331
|
<UiSelectValue placeholder="Select chart type" />
|
|
332
332
|
</UiSelectTrigger>
|
|
333
333
|
<UiSelectContent>
|
|
@@ -377,7 +377,7 @@ const value = ref('')
|
|
|
377
377
|
|
|
378
378
|
<template>
|
|
379
379
|
<UiSelect v-model="value" :disabled="true">
|
|
380
|
-
<UiSelectTrigger>
|
|
380
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
381
381
|
<UiSelectValue placeholder="Select an option" />
|
|
382
382
|
</UiSelectTrigger>
|
|
383
383
|
<UiSelectContent>
|
|
@@ -405,7 +405,7 @@ export const Disabled: Story = {
|
|
|
405
405
|
},
|
|
406
406
|
template: `
|
|
407
407
|
<UiSelect v-model="value" :disabled="true">
|
|
408
|
-
<UiSelectTrigger>
|
|
408
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
409
409
|
<UiSelectValue placeholder="Select an option" />
|
|
410
410
|
</UiSelectTrigger>
|
|
411
411
|
<UiSelectContent>
|
|
@@ -442,7 +442,7 @@ const value2 = ref('')
|
|
|
442
442
|
<template>
|
|
443
443
|
<div class="flex items-center gap-4">
|
|
444
444
|
<UiSelect v-model="value">
|
|
445
|
-
<UiSelectTrigger size="sm">
|
|
445
|
+
<UiSelectTrigger ariaLabel="Select option" size="sm">
|
|
446
446
|
<UiSelectValue placeholder="Small" />
|
|
447
447
|
</UiSelectTrigger>
|
|
448
448
|
<UiSelectContent>
|
|
@@ -451,7 +451,7 @@ const value2 = ref('')
|
|
|
451
451
|
</UiSelectContent>
|
|
452
452
|
</UiSelect>
|
|
453
453
|
<UiSelect v-model="value2">
|
|
454
|
-
<UiSelectTrigger size="default">
|
|
454
|
+
<UiSelectTrigger ariaLabel="Select option" size="default">
|
|
455
455
|
<UiSelectValue placeholder="Default" />
|
|
456
456
|
</UiSelectTrigger>
|
|
457
457
|
<UiSelectContent>
|
|
@@ -482,7 +482,7 @@ export const Sizes: Story = {
|
|
|
482
482
|
template: `
|
|
483
483
|
<div class="flex items-center gap-4">
|
|
484
484
|
<UiSelect v-model="value">
|
|
485
|
-
<UiSelectTrigger size="sm">
|
|
485
|
+
<UiSelectTrigger ariaLabel="Select option" size="sm">
|
|
486
486
|
<UiSelectValue placeholder="Small" />
|
|
487
487
|
</UiSelectTrigger>
|
|
488
488
|
<UiSelectContent>
|
|
@@ -491,7 +491,7 @@ export const Sizes: Story = {
|
|
|
491
491
|
</UiSelectContent>
|
|
492
492
|
</UiSelect>
|
|
493
493
|
<UiSelect v-model="value2">
|
|
494
|
-
<UiSelectTrigger size="default">
|
|
494
|
+
<UiSelectTrigger ariaLabel="Select option" size="default">
|
|
495
495
|
<UiSelectValue placeholder="Default" />
|
|
496
496
|
</UiSelectTrigger>
|
|
497
497
|
<UiSelectContent>
|
|
@@ -526,7 +526,7 @@ const value = ref('banana')
|
|
|
526
526
|
|
|
527
527
|
<template>
|
|
528
528
|
<UiSelect v-model="value">
|
|
529
|
-
<UiSelectTrigger>
|
|
529
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
530
530
|
<UiSelectValue placeholder="Select a fruit" />
|
|
531
531
|
</UiSelectTrigger>
|
|
532
532
|
<UiSelectContent>
|
|
@@ -557,7 +557,7 @@ const value = ref<string[]>([])
|
|
|
557
557
|
stretching the trigger when more items are selected.
|
|
558
558
|
-->
|
|
559
559
|
<UiSelect v-model="value" :multiple="true">
|
|
560
|
-
<UiSelectTrigger class="w-[220px]">
|
|
560
|
+
<UiSelectTrigger ariaLabel="Select option" class="w-[220px]">
|
|
561
561
|
<UiSelectValue placeholder="Select fruits" />
|
|
562
562
|
</UiSelectTrigger>
|
|
563
563
|
<UiSelectContent>
|
|
@@ -593,7 +593,7 @@ export const Multiple: Story = {
|
|
|
593
593
|
template: `
|
|
594
594
|
<div class="flex flex-col gap-3">
|
|
595
595
|
<UiSelect v-model="value" :multiple="true">
|
|
596
|
-
<UiSelectTrigger class="w-[220px]">
|
|
596
|
+
<UiSelectTrigger ariaLabel="Select option" class="w-[220px]">
|
|
597
597
|
<UiSelectValue placeholder="Select fruits" />
|
|
598
598
|
</UiSelectTrigger>
|
|
599
599
|
<UiSelectContent>
|
|
@@ -632,7 +632,7 @@ const value = ref<string[]>(['banana', 'mango'])
|
|
|
632
632
|
|
|
633
633
|
<template>
|
|
634
634
|
<UiSelect v-model="value" :multiple="true">
|
|
635
|
-
<UiSelectTrigger class="w-[260px]">
|
|
635
|
+
<UiSelectTrigger ariaLabel="Select option" class="w-[260px]">
|
|
636
636
|
<UiSelectValue placeholder="Select fruits" />
|
|
637
637
|
</UiSelectTrigger>
|
|
638
638
|
<UiSelectContent>
|
|
@@ -664,7 +664,7 @@ export const MultipleWithDefaultValue: Story = {
|
|
|
664
664
|
},
|
|
665
665
|
template: `
|
|
666
666
|
<UiSelect v-model="value" :multiple="true">
|
|
667
|
-
<UiSelectTrigger class="w-[260px]">
|
|
667
|
+
<UiSelectTrigger ariaLabel="Select option" class="w-[260px]">
|
|
668
668
|
<UiSelectValue placeholder="Select fruits" />
|
|
669
669
|
</UiSelectTrigger>
|
|
670
670
|
<UiSelectContent>
|
|
@@ -704,7 +704,7 @@ export const WithDefaultValue: Story = {
|
|
|
704
704
|
},
|
|
705
705
|
template: `
|
|
706
706
|
<UiSelect v-model="value">
|
|
707
|
-
<UiSelectTrigger>
|
|
707
|
+
<UiSelectTrigger ariaLabel="Select option">
|
|
708
708
|
<UiSelectValue placeholder="Select a fruit" />
|
|
709
709
|
</UiSelectTrigger>
|
|
710
710
|
<UiSelectContent>
|