@aleph-alpha/ui-library 5.3.0 → 5.4.0
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/config.d.ts +29 -3
- package/config.js +91 -3
- package/dist/system/components/UiTooltip/UiTooltip.vue.d.ts +1 -0
- package/dist/system/components/UiTooltip/types.d.ts +8 -0
- package/dist/system/components/core/tooltip/TooltipContent.vue.d.ts +2 -0
- package/dist/system/lib.js +4266 -4161
- package/dist/system/patterns/UiDataTable/UiDataTableFilterMenu.vue.d.ts +24 -0
- package/dist/system/patterns/UiDataTable/constants.d.ts +10 -0
- package/dist/system/patterns/UiDataTable/index.d.ts +1 -0
- package/dist/system/patterns/UiDataTable/types.d.ts +23 -1
- package/dist/system/patterns/UiFloatActions/UiFloatActions.vue.d.ts +3 -1
- package/docs/public-docs/getting-started-designers.md +3 -1
- package/docs/public-docs/quick-start.md +43 -0
- package/package.json +1 -1
- package/src/components/UiAccordion/UiAccordion.stories.ts +2 -2
- package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +2 -2
- package/src/components/UiAutocomplete/UiAutocomplete.vue +6 -6
- package/src/components/UiBadge/UiBadge.stories.ts +9 -9
- package/src/components/UiButton/UiButton.stories.ts +5 -5
- package/src/components/UiCheckbox/UiCheckbox.stories.ts +7 -9
- package/src/components/UiChip/UiChip.vue +1 -1
- package/src/components/UiDrawer/UiDrawer.stories.ts +2 -2
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +6 -6
- package/src/components/UiEmpty/UiEmpty.vue +2 -2
- package/src/components/UiField/UiField.stories.ts +6 -6
- package/src/components/UiField/UiFieldLabelInfo.vue +1 -1
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +2 -2
- package/src/components/UiFileUploadBox/UiFileUploadBox.vue +2 -2
- package/src/components/UiInput/UiInput.vue +3 -3
- package/src/components/UiKbd/UiKbd.stories.ts +14 -14
- package/src/components/UiKbd/UiKbd.vue +1 -1
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +66 -66
- package/src/components/UiPopover/UiPopover.stories.ts +20 -20
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +24 -24
- package/src/components/UiResizable/UiResizable.stories.ts +15 -14
- package/src/components/UiSelect/UiSelect.stories.ts +1 -1
- package/src/components/UiSeparator/UiSeparator.stories.ts +6 -6
- package/src/components/UiSheet/UiSheet.stories.ts +14 -14
- package/src/components/UiSlider/UiSlider.stories.ts +8 -8
- package/src/components/UiSpinner/UiSpinner.stories.ts +8 -8
- package/src/components/UiSwitch/UiSwitch.stories.ts +4 -4
- package/src/components/UiTabs/UiTabs.stories.ts +46 -46
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +5 -3
- package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +14 -14
- package/src/components/UiTooltip/UiTooltip.stories.ts +3 -3
- package/src/components/UiTooltip/UiTooltip.vue +2 -0
- package/src/components/UiTooltip/types.ts +9 -0
- package/src/components/core/accordion/AccordionContent.vue +1 -1
- package/src/components/core/accordion/AccordionTrigger.vue +2 -2
- package/src/components/core/alert/AlertDescription.vue +1 -1
- package/src/components/core/alert/index.ts +1 -1
- package/src/components/core/badge/index.ts +1 -1
- package/src/components/core/button/index.ts +2 -2
- package/src/components/core/calendar/Calendar.vue +4 -4
- package/src/components/core/calendar/CalendarCell.vue +1 -1
- package/src/components/core/calendar/CalendarCellTrigger.vue +2 -2
- package/src/components/core/calendar/CalendarHeadCell.vue +1 -1
- package/src/components/core/card/CardDescription.vue +1 -1
- package/src/components/core/checkbox/Checkbox.vue +1 -1
- package/src/components/core/drawer/DrawerDescription.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuLabel.vue +1 -3
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuShortcut.vue +4 -1
- package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/src/components/core/field/FieldDescription.vue +1 -1
- package/src/components/core/field/FieldLabel.vue +1 -1
- package/src/components/core/field/FieldLegend.vue +2 -2
- package/src/components/core/field/FieldSeparator.vue +2 -2
- package/src/components/core/input/Input.vue +2 -2
- package/src/components/core/item/index.ts +1 -1
- package/src/components/core/kbd/Kbd.vue +1 -1
- package/src/components/core/label/Label.vue +1 -1
- package/src/components/core/listbox/ListboxFilter.vue +1 -1
- package/src/components/core/listbox/ListboxGroupLabel.vue +4 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/native-select/NativeSelect.vue +3 -3
- package/src/components/core/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/core/navigation-menu/index.ts +1 -1
- package/src/components/core/radio-group/RadioGroupItem.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarCell.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarCellTrigger.vue +2 -2
- package/src/components/core/range-calendar/RangeCalendarHeadCell.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/select/SelectLabel.vue +6 -1
- package/src/components/core/select/SelectTrigger.vue +1 -1
- package/src/components/core/sheet/SheetDescription.vue +3 -1
- package/src/components/core/sidebar/SidebarGroupContent.vue +1 -1
- package/src/components/core/sidebar/SidebarGroupLabel.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuBadge.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
- package/src/components/core/sidebar/index.ts +4 -4
- package/src/components/core/slider/Slider.vue +3 -3
- package/src/components/core/stepper/StepperDescription.vue +1 -1
- package/src/components/core/switch/Switch.vue +1 -1
- package/src/components/core/table/Table.vue +1 -1
- package/src/components/core/table/TableCaption.vue +3 -1
- package/src/components/core/table/TableEmpty.vue +1 -1
- package/src/components/core/tabs/TabsList.vue +1 -1
- package/src/components/core/tabs/TabsTrigger.vue +1 -1
- package/src/components/core/tags-input/TagsInput.vue +1 -1
- package/src/components/core/tags-input/TagsInputInput.vue +1 -1
- package/src/components/core/tags-input/TagsInputItem.vue +1 -1
- package/src/components/core/tags-input/TagsInputItemDelete.vue +1 -1
- package/src/components/core/textarea/Textarea.vue +1 -1
- package/src/components/core/toggle/index.ts +3 -3
- package/src/components/core/toggle-group/index.ts +2 -2
- package/src/components/core/tooltip/TooltipContent.vue +10 -4
- package/src/lib/useDrag.stories.ts +12 -12
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +420 -10
- package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +1 -1
- package/src/patterns/UiDataTable/UiDataTableFilterMenu.vue +91 -0
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +1 -1
- package/src/patterns/UiDataTable/constants.ts +12 -0
- package/src/patterns/UiDataTable/index.ts +1 -0
- package/src/patterns/UiDataTable/types.ts +24 -0
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +8 -8
- package/src/patterns/UiDatePicker/UiDatePicker.vue +1 -1
- package/src/patterns/UiFloatActions/UiFloatActionItems.vue +11 -4
- package/src/patterns/UiFloatActions/UiFloatActions.stories.ts +416 -377
- package/src/patterns/UiFloatActions/UiFloatActions.vue +6 -2
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +2 -2
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +5 -5
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UiDataTableFilterMenuProps } from './types';
|
|
2
|
+
declare const _default: <TData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:open"> & ({
|
|
6
|
+
open?: boolean;
|
|
7
|
+
} & UiDataTableFilterMenuProps<TData>) & Partial<{}>> & import('vue').PublicProps;
|
|
8
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
9
|
+
attrs: any;
|
|
10
|
+
slots: Readonly<{
|
|
11
|
+
/** Filter controls, usually a form with inputs and checkbox groups. */
|
|
12
|
+
default(): unknown;
|
|
13
|
+
}> & {
|
|
14
|
+
/** Filter controls, usually a form with inputs and checkbox groups. */
|
|
15
|
+
default(): unknown;
|
|
16
|
+
};
|
|
17
|
+
emit: (evt: "update:open", value: boolean) => void;
|
|
18
|
+
}>) => import('vue').VNode & {
|
|
19
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_PrettifyLocal<T> = {
|
|
23
|
+
[K in keyof T]: T[K];
|
|
24
|
+
} & {};
|
|
@@ -21,6 +21,9 @@ 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
|
+
/** UiDataTableFilterMenu */
|
|
25
|
+
readonly filters: "Filters";
|
|
26
|
+
readonly toggleFilters: "Toggle Filters";
|
|
24
27
|
/** UiDataTableColumnFilter */
|
|
25
28
|
readonly columns: "Columns";
|
|
26
29
|
readonly toggleColumns: "Toggle columns";
|
|
@@ -66,3 +69,10 @@ export interface ColumnFilterLabels {
|
|
|
66
69
|
/** Dropdown section label. */
|
|
67
70
|
columnVisibility?: string;
|
|
68
71
|
}
|
|
72
|
+
/** Labels for UiDataTableFilterMenu */
|
|
73
|
+
export interface FilterMenuLabels {
|
|
74
|
+
/** Visible label for the trigger button. */
|
|
75
|
+
filters?: string;
|
|
76
|
+
/** Accessible label for the trigger button. */
|
|
77
|
+
toggleFilters?: string;
|
|
78
|
+
}
|
|
@@ -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 { default as UiDataTableFilterMenu } from './UiDataTableFilterMenu.vue';
|
|
6
7
|
export type { Column, ColumnDef, Row, Table } from '@tanstack/vue-table';
|
|
7
8
|
export * from './types';
|
|
8
9
|
export * from './constants';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Column, ColumnDef, Row, Table } from '@tanstack/vue-table';
|
|
2
|
-
import { ColumnHeaderLabels, ColumnFilterLabels, PaginationLabels } from './constants';
|
|
2
|
+
import { ColumnHeaderLabels, ColumnFilterLabels, FilterMenuLabels, 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.
|
|
@@ -119,3 +119,25 @@ export type UiDataTableColumnFilterProps<TData> = {
|
|
|
119
119
|
*/
|
|
120
120
|
labels?: ColumnFilterLabels;
|
|
121
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* Props for the UiDataTableFilterMenu component.
|
|
124
|
+
*/
|
|
125
|
+
export type UiDataTableFilterMenuProps<TData> = {
|
|
126
|
+
/**
|
|
127
|
+
* The TanStack Table instance. Optional — the menu only hosts filter controls
|
|
128
|
+
* passed via the default slot and does not read from the table directly.
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
table?: Table<TData>;
|
|
132
|
+
/**
|
|
133
|
+
* Number of filters currently applied. When greater than `0`, a count badge is
|
|
134
|
+
* shown next to the label and the trigger stays visually filled (active).
|
|
135
|
+
* @default 0
|
|
136
|
+
*/
|
|
137
|
+
activeCount?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Custom labels for i18n support.
|
|
140
|
+
* Partial object that merges with defaults.
|
|
141
|
+
*/
|
|
142
|
+
labels?: FilterMenuLabels;
|
|
143
|
+
};
|
|
@@ -25,6 +25,8 @@ See Figma documentation for more details on how to manage libraries in [Add or r
|
|
|
25
25
|
|
|
26
26
|
With the library enabled on the file, open the **Style and variables** picker in the **right sidebar** on properties such as fill, stroke, spacing, and typography to apply **variables** and **styles** from the design system.
|
|
27
27
|
|
|
28
|
+
All components come preconfigured with our semantic tokens for color, padding and typography styles. Unless there is a specific need to change the values, please use the default settings. In the event that the spacing values need to be adjusted, please choose from the predefined spacing tokens instead of raw values.
|
|
29
|
+
|
|
28
30
|
## Contribution Model
|
|
29
31
|
|
|
30
|
-
See the [Contribution Model](/contributing-to-platform/) for how design and engineering changes flow into the design system.
|
|
32
|
+
See the [Contribution Model](/contributing-to-platform/) for how design and engineering changes flow into the design system.
|
|
@@ -222,6 +222,49 @@ Run your dev server (e.g. `pnpm dev`) and open the app. The button and badge sho
|
|
|
222
222
|
|
|
223
223
|
---
|
|
224
224
|
|
|
225
|
+
## Typography
|
|
226
|
+
|
|
227
|
+
Style text with the design-system typography utilities — **never** raw UnoCSS/Tailwind font-size classes. Each utility is generated from the typography design tokens and sets `font-family`, `font-size`, `font-weight`, and `line-height` together, so text stays correct when the tokens or root font size change.
|
|
228
|
+
|
|
229
|
+
!!! danger "Do not use raw `text-*` size classes"
|
|
230
|
+
The library intentionally does **not** treat `text-xs`, `text-sm`, `text-base`, `text-lg`, or `text-xl` as design-system typography, and `text-md` is not a real class at all (it silently does nothing). AI assistants and contributors must use the named utilities below instead. This keeps generated code aligned with the design system.
|
|
231
|
+
|
|
232
|
+
### Available utilities
|
|
233
|
+
|
|
234
|
+
| Group | Utilities | Use for |
|
|
235
|
+
|-------|-----------|---------|
|
|
236
|
+
| Labels | `label-12-*`, `label-14-*`, `label-16-*` (`-regular` \| `-medium` \| `-bold`; `-regular` also aliased as `-normal`) | UI / inline element text: buttons, menu items, form labels, badges, table cells |
|
|
237
|
+
| Body | `body-14-*`, `body-16-*` (`-regular` \| `-medium` \| `-bold`) | Paragraphs and prose / descriptions |
|
|
238
|
+
| Headings | `heading-s`, `heading-m`, `heading-l`, `heading-xl`, `heading-2xl` (one class each, no weight suffix) | Section and page headings |
|
|
239
|
+
|
|
240
|
+
### Replace raw sizes with tokens
|
|
241
|
+
|
|
242
|
+
| Raw class (avoid) | Size | Use instead |
|
|
243
|
+
|-------------------|------|-------------|
|
|
244
|
+
| `text-xs` | 12px | `label-12-regular` (or `-medium` / `-bold`) |
|
|
245
|
+
| `text-sm` | 14px | `body-14-regular` for prose, `label-14-*` for UI text |
|
|
246
|
+
| `text-base` / `text-md` | 16px | `body-16-regular` for prose, `label-16-*` for UI text |
|
|
247
|
+
| `text-lg` / `text-xl` | 18–20px | `heading-s` |
|
|
248
|
+
| `text-2xl` | 24px | `heading-m` |
|
|
249
|
+
|
|
250
|
+
When a raw class is paired with a weight (e.g. `text-sm font-medium`), collapse both into a single token that already carries the weight (`label-14-medium`) rather than keeping a separate `font-*` class. For headings, drop the `font-*` class entirely — the `heading-*` utility owns its weight.
|
|
251
|
+
|
|
252
|
+
```html
|
|
253
|
+
<!-- Don't: raw sizes + separate weight -->
|
|
254
|
+
<h3 class="text-lg font-medium">Account</h3>
|
|
255
|
+
<p class="text-sm text-muted-foreground">Manage your settings.</p>
|
|
256
|
+
<label class="text-sm font-medium">Email</label>
|
|
257
|
+
|
|
258
|
+
<!-- Do: design-system typography utilities -->
|
|
259
|
+
<h3 class="heading-s">Account</h3>
|
|
260
|
+
<p class="body-14-regular text-muted-foreground">Manage your settings.</p>
|
|
261
|
+
<label class="label-14-medium">Email</label>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Browse the live examples under **CSS utility → Typography** in [Storybook](https://dev.aleph-alpha.de/ui-library).
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
225
268
|
## Dark mode
|
|
226
269
|
|
|
227
270
|
The library supports dark mode via the `html.dark` class. Toggle it on the document element:
|
package/package.json
CHANGED
|
@@ -440,7 +440,7 @@ function closeAll() {
|
|
|
440
440
|
<template>
|
|
441
441
|
<div class="gap-y-4">
|
|
442
442
|
<div class="flex items-center gap-4">
|
|
443
|
-
<p class="
|
|
443
|
+
<p class="body-14-regular">Current: <strong>{{ activeItem ?? 'none' }}</strong></p>
|
|
444
444
|
<UiButton size="sm" @click="goToDetails">Go to Details</UiButton>
|
|
445
445
|
<UiButton size="sm" variant="secondary" @click="closeAll">Close All</UiButton>
|
|
446
446
|
</div>
|
|
@@ -500,7 +500,7 @@ export const Controlled: Story = {
|
|
|
500
500
|
template: `
|
|
501
501
|
<div class="gap-y-4">
|
|
502
502
|
<div class="flex items-center gap-4">
|
|
503
|
-
<p class="
|
|
503
|
+
<p class="body-14-regular">Current: <strong>{{ activeItem ?? 'none' }}</strong></p>
|
|
504
504
|
<UiButton size="sm" @click="goToDetails">Go to Details</UiButton>
|
|
505
505
|
<UiButton size="sm" variant="secondary" @click="closeAll">Close All</UiButton>
|
|
506
506
|
</div>
|
|
@@ -138,7 +138,7 @@ export const Multiple: Story = {
|
|
|
138
138
|
placeholder="Search fruits"
|
|
139
139
|
class="w-[220px]"
|
|
140
140
|
/>
|
|
141
|
-
<div class="
|
|
141
|
+
<div class="label-12-regular text-content-on-surface-secondary">
|
|
142
142
|
Selected: {{ value.join(', ') || 'None' }}
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
@@ -175,7 +175,7 @@ export const WithSlots: Story = {
|
|
|
175
175
|
<template #item="{ option, selected }">
|
|
176
176
|
<div class="flex min-w-0 flex-1 items-center justify-between gap-2">
|
|
177
177
|
<span class="truncate">{{ option.label }}</span>
|
|
178
|
-
<span v-if="selected" class="
|
|
178
|
+
<span v-if="selected" class="label-12-regular text-content-on-surface-muted">Selected</span>
|
|
179
179
|
</div>
|
|
180
180
|
</template>
|
|
181
181
|
</UiAutocomplete>
|
|
@@ -143,7 +143,7 @@ const inputSlotProps = computed(() => ({
|
|
|
143
143
|
|
|
144
144
|
const shellClasses = computed(() =>
|
|
145
145
|
cn(
|
|
146
|
-
'border-input data-[placeholder]:bg-background-input-default [&:not([data-placeholder])]:border-border-surface-focus-ring
|
|
146
|
+
'border-input data-[placeholder]:bg-background-input-default [&:not([data-placeholder])]:border-border-surface-focus-ring ui-focus-ring-within aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-full min-w-0 items-center gap-2 rounded-md border bg-accent px-3 py-2 label-14-regular transition-[color,box-shadow]',
|
|
147
147
|
props.disabled && 'pointer-events-none cursor-not-allowed opacity-50',
|
|
148
148
|
),
|
|
149
149
|
);
|
|
@@ -322,7 +322,7 @@ provideUiAutocompleteContext({
|
|
|
322
322
|
v-if="props.startIcon"
|
|
323
323
|
:name="props.startIcon"
|
|
324
324
|
:size="16"
|
|
325
|
-
class="text-muted
|
|
325
|
+
class="text-content-on-surface-muted shrink-0"
|
|
326
326
|
/>
|
|
327
327
|
|
|
328
328
|
<div class="relative flex min-w-0 flex-1 items-center">
|
|
@@ -346,7 +346,7 @@ provideUiAutocompleteContext({
|
|
|
346
346
|
"
|
|
347
347
|
:disabled="props.disabled"
|
|
348
348
|
:required="props.required && selectedValues.length === 0"
|
|
349
|
-
class="placeholder:text-muted
|
|
349
|
+
class="placeholder:text-content-on-surface-muted min-w-0 bg-transparent outline-none disabled:cursor-not-allowed"
|
|
350
350
|
:class="
|
|
351
351
|
showSelectionDisplay
|
|
352
352
|
? 'absolute inset-0 size-full cursor-text opacity-0'
|
|
@@ -362,7 +362,7 @@ provideUiAutocompleteContext({
|
|
|
362
362
|
|
|
363
363
|
<button
|
|
364
364
|
type="button"
|
|
365
|
-
class="text-muted
|
|
365
|
+
class="text-content-on-surface-muted flex size-5 shrink-0 items-center justify-center rounded-sm outline-none"
|
|
366
366
|
:disabled="props.disabled"
|
|
367
367
|
:aria-expanded="openState"
|
|
368
368
|
aria-haspopup="listbox"
|
|
@@ -414,7 +414,7 @@ provideUiAutocompleteContext({
|
|
|
414
414
|
"
|
|
415
415
|
:data-state="isSelected(option.value) ? 'checked' : 'unchecked'"
|
|
416
416
|
tabindex="-1"
|
|
417
|
-
class="hover-layer hover-layer-default focus:text-foreground data-[highlighted]:bg-background-surface-muted-subtle data-[highlighted]:text-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pl-2
|
|
417
|
+
class="hover-layer hover-layer-default focus:text-foreground data-[highlighted]:bg-background-surface-muted-subtle data-[highlighted]:text-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pl-2 label-14-regular outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
418
418
|
:class="{
|
|
419
419
|
'pr-12': props.showIndicator,
|
|
420
420
|
'pr-2': !props.showIndicator,
|
|
@@ -453,7 +453,7 @@ provideUiAutocompleteContext({
|
|
|
453
453
|
|
|
454
454
|
<div
|
|
455
455
|
v-if="hasInternalOptions && filteredOptions.length === 0"
|
|
456
|
-
class="text-muted
|
|
456
|
+
class="text-content-on-surface-muted px-2 py-1.5 label-14-regular"
|
|
457
457
|
>
|
|
458
458
|
{{ props.emptyText }}
|
|
459
459
|
</div>
|
|
@@ -248,17 +248,17 @@ export const Numbers: Story = {
|
|
|
248
248
|
class="grid min-w-[920px] gap-x-4 gap-y-3"
|
|
249
249
|
:style="{ gridTemplateColumns: '120px repeat(' + variants.length + ', minmax(0, 1fr))' }"
|
|
250
250
|
>
|
|
251
|
-
<div class="
|
|
251
|
+
<div class="label-12-medium text-content-on-surface-muted">Variant</div>
|
|
252
252
|
<div
|
|
253
253
|
v-for="variant in variants"
|
|
254
254
|
:key="variant.key"
|
|
255
|
-
class="
|
|
255
|
+
class="label-12-medium text-content-on-surface-muted"
|
|
256
256
|
>
|
|
257
257
|
{{ variant.label }}
|
|
258
258
|
</div>
|
|
259
259
|
|
|
260
260
|
<template v-for="state in states" :key="state.key">
|
|
261
|
-
<div class="
|
|
261
|
+
<div class="label-12-medium text-content-on-surface-muted">
|
|
262
262
|
{{ state.label }}
|
|
263
263
|
</div>
|
|
264
264
|
|
|
@@ -297,17 +297,17 @@ export const Sizes: Story = {
|
|
|
297
297
|
class="grid min-w-[920px] items-center gap-x-4 gap-y-3"
|
|
298
298
|
:style="{ gridTemplateColumns: '120px repeat(' + variants.length + ', minmax(0, 1fr))' }"
|
|
299
299
|
>
|
|
300
|
-
<div class="
|
|
300
|
+
<div class="label-12-medium text-content-on-surface-muted">Size</div>
|
|
301
301
|
<div
|
|
302
302
|
v-for="variant in variants"
|
|
303
303
|
:key="variant.key"
|
|
304
|
-
class="
|
|
304
|
+
class="label-12-medium text-content-on-surface-muted"
|
|
305
305
|
>
|
|
306
306
|
{{ variant.label }}
|
|
307
307
|
</div>
|
|
308
308
|
|
|
309
309
|
<template v-for="size in sizes" :key="size.key">
|
|
310
|
-
<div class="
|
|
310
|
+
<div class="label-12-medium text-content-on-surface-muted">
|
|
311
311
|
{{ size.label }}
|
|
312
312
|
</div>
|
|
313
313
|
|
|
@@ -356,17 +356,17 @@ export const AllVariants: Story = {
|
|
|
356
356
|
class="grid min-w-[920px] items-center gap-x-4 gap-y-3"
|
|
357
357
|
:style="{ gridTemplateColumns: '160px repeat(' + variants.length + ', minmax(0, 1fr))' }"
|
|
358
358
|
>
|
|
359
|
-
<div class="
|
|
359
|
+
<div class="label-12-medium text-content-on-surface-muted">Variant</div>
|
|
360
360
|
<div
|
|
361
361
|
v-for="variant in variants"
|
|
362
362
|
:key="variant.key"
|
|
363
|
-
class="
|
|
363
|
+
class="label-12-medium text-content-on-surface-muted"
|
|
364
364
|
>
|
|
365
365
|
{{ variant.label }}
|
|
366
366
|
</div>
|
|
367
367
|
|
|
368
368
|
<template v-for="row in rows" :key="row.key">
|
|
369
|
-
<div class="
|
|
369
|
+
<div class="label-12-medium text-content-on-surface-muted">
|
|
370
370
|
{{ row.label }}
|
|
371
371
|
</div>
|
|
372
372
|
|
|
@@ -1323,15 +1323,15 @@ export const AllVariantsAndSizes: Story = {
|
|
|
1323
1323
|
</colgroup>
|
|
1324
1324
|
<thead>
|
|
1325
1325
|
<tr>
|
|
1326
|
-
<th class="label-12-medium text-muted
|
|
1327
|
-
<th class="label-12-medium text-muted
|
|
1328
|
-
<th class="label-12-medium text-muted
|
|
1329
|
-
<th class="label-12-medium text-muted
|
|
1326
|
+
<th class="label-12-medium text-content-on-surface-muted border border-border-surface-default px-3 py-2 text-center">Size</th>
|
|
1327
|
+
<th class="label-12-medium text-content-on-surface-muted border border-border-surface-default px-3 py-2 text-center">Default</th>
|
|
1328
|
+
<th class="label-12-medium text-content-on-surface-muted border border-border-surface-default px-3 py-2 text-center">Loading</th>
|
|
1329
|
+
<th class="label-12-medium text-content-on-surface-muted border border-border-surface-default px-3 py-2 text-center">Disabled</th>
|
|
1330
1330
|
</tr>
|
|
1331
1331
|
</thead>
|
|
1332
1332
|
<tbody>
|
|
1333
1333
|
<tr v-for="row in rowsFor(variant)" :key="row.size" class="align-middle">
|
|
1334
|
-
<td class="label-12-medium text-muted
|
|
1334
|
+
<td class="label-12-medium text-content-on-surface-muted border border-border-surface-default px-3 py-2 text-center whitespace-nowrap">{{ row.size }}</td>
|
|
1335
1335
|
<td class="border border-border-surface-default px-3 py-2 text-center">
|
|
1336
1336
|
<UiButton :variant="variant" :size="row.size" aria-label="Close">
|
|
1337
1337
|
<template v-if="row.isIcon"><UiIcon name="x" /></template>
|
|
@@ -245,7 +245,7 @@ const checked = ref(true)
|
|
|
245
245
|
<label for="terms-2" class="body-14-medium">
|
|
246
246
|
Accept terms and conditions
|
|
247
247
|
</label>
|
|
248
|
-
<p class="body-14-regular text-muted
|
|
248
|
+
<p class="body-14-regular text-content-on-surface-muted">
|
|
249
249
|
By clicking this checkbox, you agree to the terms and conditions.
|
|
250
250
|
</p>
|
|
251
251
|
</div>
|
|
@@ -268,7 +268,7 @@ export const WithDescription: Story = {
|
|
|
268
268
|
<label for="terms-2" class="body-14-medium">
|
|
269
269
|
Accept terms and conditions
|
|
270
270
|
</label>
|
|
271
|
-
<p class="body-14-regular text-muted
|
|
271
|
+
<p class="body-14-regular text-content-on-surface-muted">
|
|
272
272
|
By clicking this checkbox, you agree to the terms and conditions.
|
|
273
273
|
</p>
|
|
274
274
|
</div>
|
|
@@ -333,19 +333,18 @@ const enabled = ref(true)
|
|
|
333
333
|
|
|
334
334
|
<template>
|
|
335
335
|
<label
|
|
336
|
-
class="hover:bg-accent/50 flex items-start gap-3 rounded-lg border p-3 has-[[aria-checked=true]]:border-
|
|
336
|
+
class="hover:bg-accent/50 flex items-start gap-3 rounded-lg border p-3 has-[[aria-checked=true]]:border-border-input-default has-[[aria-checked=true]]:bg-background-surface-secondary dark:has-[[aria-checked=true]]:border-blue-900 dark:has-[[aria-checked=true]]:bg-blue-950"
|
|
337
337
|
>
|
|
338
338
|
<UiCheckbox
|
|
339
339
|
id="notifications"
|
|
340
340
|
name="notifications"
|
|
341
341
|
v-model="enabled"
|
|
342
|
-
class="data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-white dark:data-[state=checked]:border-blue-700 dark:data-[state=checked]:bg-blue-700"
|
|
343
342
|
/>
|
|
344
343
|
<div class="grid gap-1.5 font-normal">
|
|
345
344
|
<p class="body-14-medium leading-none">
|
|
346
345
|
Enable notifications
|
|
347
346
|
</p>
|
|
348
|
-
<p class="body-14-regular text-muted
|
|
347
|
+
<p class="body-14-regular text-content-on-surface-muted">
|
|
349
348
|
You can enable or disable notifications at any time.
|
|
350
349
|
</p>
|
|
351
350
|
</div>
|
|
@@ -364,20 +363,19 @@ export const Card: Story = {
|
|
|
364
363
|
return { args, enabled };
|
|
365
364
|
},
|
|
366
365
|
template: `<label
|
|
367
|
-
class="
|
|
366
|
+
class="flex items-start gap-3 rounded-lg border p-3 has-[[aria-checked=true]]:border-border-input-default has-[[aria-checked=true]]:bg-background-surface-muted dark:has-[[aria-checked=true]]:border-blue-900 dark:has-[[aria-checked=true]]:bg-blue-950"
|
|
368
367
|
>
|
|
369
368
|
<UiCheckbox
|
|
370
369
|
id="notifications"
|
|
371
370
|
name="notifications"
|
|
372
371
|
v-model="enabled"
|
|
373
372
|
:disabled="args.disabled"
|
|
374
|
-
class="data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-white dark:data-[state=checked]:border-blue-700 dark:data-[state=checked]:bg-blue-700"
|
|
375
373
|
/>
|
|
376
374
|
<div class="grid gap-1.5 font-normal">
|
|
377
|
-
<p class="body-14-medium leading-none">
|
|
375
|
+
<p class="body-14-medium leading-none text-content-on-surface-primary">
|
|
378
376
|
Enable notifications
|
|
379
377
|
</p>
|
|
380
|
-
<p class="body-14-regular text-muted
|
|
378
|
+
<p class="body-14-regular text-content-on-surface-muted">
|
|
381
379
|
You can enable or disable notifications at any time.
|
|
382
380
|
</p>
|
|
383
381
|
</div>
|
|
@@ -136,7 +136,7 @@ const removableChipClass = computed(() =>
|
|
|
136
136
|
<button
|
|
137
137
|
data-slot="chip-remove"
|
|
138
138
|
type="button"
|
|
139
|
-
class="inline-flex size-5 items-center justify-center rounded-full outline-none hover-layer hover-layer-default
|
|
139
|
+
class="inline-flex size-5 items-center justify-center rounded-full outline-none hover-layer hover-layer-default ui-focus-ring disabled:pointer-events-none"
|
|
140
140
|
:aria-label="props.removeLabel"
|
|
141
141
|
:disabled="props.disabled"
|
|
142
142
|
@click="removeChip"
|
|
@@ -258,7 +258,7 @@ import {
|
|
|
258
258
|
|
|
259
259
|
<template>
|
|
260
260
|
<div class="gap-y-4">
|
|
261
|
-
<p class="body-14-regular text-muted
|
|
261
|
+
<p class="body-14-regular text-content-on-surface-muted">
|
|
262
262
|
Non-modal drawer: you can still interact with the page while it is open.
|
|
263
263
|
</p>
|
|
264
264
|
<UiDrawer :modal="false">
|
|
@@ -304,7 +304,7 @@ export const NonModal: Story = {
|
|
|
304
304
|
},
|
|
305
305
|
template: `
|
|
306
306
|
<div class="gap-y-4">
|
|
307
|
-
<p class="body-14-regular text-muted
|
|
307
|
+
<p class="body-14-regular text-content-on-surface-muted">
|
|
308
308
|
Non-modal drawer: you can still interact with the page while it is open.
|
|
309
309
|
</p>
|
|
310
310
|
<UiDrawer :modal="false">
|
|
@@ -1056,10 +1056,10 @@ const open = ref(false)
|
|
|
1056
1056
|
<UiAvatarFallback>CN</UiAvatarFallback>
|
|
1057
1057
|
</UiAvatar>
|
|
1058
1058
|
<div class="flex flex-col items-start overflow-hidden">
|
|
1059
|
-
<span class="truncate
|
|
1060
|
-
<span class="truncate
|
|
1059
|
+
<span class="truncate label-14-medium">Sofia Davis</span>
|
|
1060
|
+
<span class="truncate label-12-regular text-content-on-surface-muted font-normal">sofia@example.com</span>
|
|
1061
1061
|
</div>
|
|
1062
|
-
<UiIcon name="chevrons-up-down" :size="16" class="shrink-0 text-muted
|
|
1062
|
+
<UiIcon name="chevrons-up-down" :size="16" class="shrink-0 text-content-on-surface-muted" />
|
|
1063
1063
|
</UiButton>
|
|
1064
1064
|
</UiDropdownMenuTrigger>
|
|
1065
1065
|
<UiDropdownMenuContent class="w-56" align="start">
|
|
@@ -1114,10 +1114,10 @@ export const WithAvatarTrigger: Story = {
|
|
|
1114
1114
|
<UiAvatarFallback>CN</UiAvatarFallback>
|
|
1115
1115
|
</UiAvatar>
|
|
1116
1116
|
<div class="flex flex-col items-start overflow-hidden">
|
|
1117
|
-
<span class="truncate
|
|
1118
|
-
<span class="truncate
|
|
1117
|
+
<span class="truncate label-14-medium">Sofia Davis</span>
|
|
1118
|
+
<span class="truncate label-12-regular text-content-on-surface-muted font-normal">sofia@example.com</span>
|
|
1119
1119
|
</div>
|
|
1120
|
-
<UiIcon name="chevrons-up-down" :size="16" class="shrink-0 text-muted
|
|
1120
|
+
<UiIcon name="chevrons-up-down" :size="16" class="shrink-0 text-content-on-surface-muted" />
|
|
1121
1121
|
</UiButton>
|
|
1122
1122
|
</UiDropdownMenuTrigger>
|
|
1123
1123
|
<UiDropdownMenuContent class="w-56" align="start">
|
|
@@ -15,7 +15,7 @@ const props = withDefaults(defineProps<UiEmptyProps>(), {
|
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
17
|
<div class="flex flex-col items-center justify-center py-12 text-center">
|
|
18
|
-
<div class="mb-4 text-muted
|
|
18
|
+
<div class="mb-4 text-content-on-surface-muted" aria-hidden="true">
|
|
19
19
|
<component :is="props.icon" v-if="props.icon" class="size-12" />
|
|
20
20
|
<UiIcon v-else name="inbox" :size="48" />
|
|
21
21
|
</div>
|
|
@@ -26,7 +26,7 @@ const props = withDefaults(defineProps<UiEmptyProps>(), {
|
|
|
26
26
|
|
|
27
27
|
<p
|
|
28
28
|
v-if="props.description"
|
|
29
|
-
class="body-14-regular max-w-sm text-muted
|
|
29
|
+
class="body-14-regular max-w-sm text-content-on-surface-muted"
|
|
30
30
|
>
|
|
31
31
|
{{ props.description }}
|
|
32
32
|
</p>
|
|
@@ -1331,7 +1331,7 @@ const plan = ref('pro')
|
|
|
1331
1331
|
<UiField orientation="responsive">
|
|
1332
1332
|
<UiRadioGroupItem id="plan-free" value="free" />
|
|
1333
1333
|
<UiFieldContent>
|
|
1334
|
-
<label for="plan-free" class="
|
|
1334
|
+
<label for="plan-free" class="label-14-medium">Free</label>
|
|
1335
1335
|
<UiFieldDescription>Basic features for personal use.</UiFieldDescription>
|
|
1336
1336
|
</UiFieldContent>
|
|
1337
1337
|
</UiField>
|
|
@@ -1339,7 +1339,7 @@ const plan = ref('pro')
|
|
|
1339
1339
|
<UiField orientation="responsive">
|
|
1340
1340
|
<UiRadioGroupItem id="plan-pro" value="pro" />
|
|
1341
1341
|
<UiFieldContent>
|
|
1342
|
-
<label for="plan-pro" class="
|
|
1342
|
+
<label for="plan-pro" class="label-14-medium">Pro</label>
|
|
1343
1343
|
<UiFieldDescription>Everything you need for work.</UiFieldDescription>
|
|
1344
1344
|
</UiFieldContent>
|
|
1345
1345
|
</UiField>
|
|
@@ -1347,7 +1347,7 @@ const plan = ref('pro')
|
|
|
1347
1347
|
<UiField orientation="responsive" data-disabled="true">
|
|
1348
1348
|
<UiRadioGroupItem id="plan-enterprise" value="enterprise" disabled />
|
|
1349
1349
|
<UiFieldContent>
|
|
1350
|
-
<label for="plan-enterprise" class="
|
|
1350
|
+
<label for="plan-enterprise" class="label-14-medium text-content-on-surface-muted">Enterprise</label>
|
|
1351
1351
|
<UiFieldDescription>Contact sales for pricing.</UiFieldDescription>
|
|
1352
1352
|
</UiFieldContent>
|
|
1353
1353
|
</UiField>
|
|
@@ -1386,7 +1386,7 @@ export const RadioGroupInFieldSet: Story = {
|
|
|
1386
1386
|
<UiField orientation="responsive">
|
|
1387
1387
|
<UiRadioGroupItem id="plan-free" value="free" />
|
|
1388
1388
|
<UiFieldContent>
|
|
1389
|
-
<label for="plan-free" class="
|
|
1389
|
+
<label for="plan-free" class="label-14-medium">Free</label>
|
|
1390
1390
|
<UiFieldDescription>Basic features for personal use.</UiFieldDescription>
|
|
1391
1391
|
</UiFieldContent>
|
|
1392
1392
|
</UiField>
|
|
@@ -1394,7 +1394,7 @@ export const RadioGroupInFieldSet: Story = {
|
|
|
1394
1394
|
<UiField orientation="responsive">
|
|
1395
1395
|
<UiRadioGroupItem id="plan-pro" value="pro" />
|
|
1396
1396
|
<UiFieldContent>
|
|
1397
|
-
<label for="plan-pro" class="
|
|
1397
|
+
<label for="plan-pro" class="label-14-medium">Pro</label>
|
|
1398
1398
|
<UiFieldDescription>Everything you need for work.</UiFieldDescription>
|
|
1399
1399
|
</UiFieldContent>
|
|
1400
1400
|
</UiField>
|
|
@@ -1402,7 +1402,7 @@ export const RadioGroupInFieldSet: Story = {
|
|
|
1402
1402
|
<UiField orientation="responsive" data-disabled="true">
|
|
1403
1403
|
<UiRadioGroupItem id="plan-enterprise" value="enterprise" disabled />
|
|
1404
1404
|
<UiFieldContent>
|
|
1405
|
-
<label for="plan-enterprise" class="
|
|
1405
|
+
<label for="plan-enterprise" class="label-14-medium text-content-on-surface-muted">Enterprise</label>
|
|
1406
1406
|
<UiFieldDescription>Contact sales for pricing.</UiFieldDescription>
|
|
1407
1407
|
</UiFieldContent>
|
|
1408
1408
|
</UiField>
|
|
@@ -83,7 +83,7 @@ function onError(e: { message: string }) {
|
|
|
83
83
|
@error="onError"
|
|
84
84
|
/>
|
|
85
85
|
<p v-if="lastError" class="body-14-regular text-destructive">{{ lastError }}</p>
|
|
86
|
-
<p v-if="names.length" class="body-14-regular text-muted
|
|
86
|
+
<p v-if="names.length" class="body-14-regular text-content-on-surface-muted">Selected: {{ names.join(', ') }}</p>
|
|
87
87
|
</div>
|
|
88
88
|
</template>`;
|
|
89
89
|
|
|
@@ -110,7 +110,7 @@ export const Default: Story = {
|
|
|
110
110
|
<div class="max-w-md gap-y-2">
|
|
111
111
|
<UiFileUploadBox v-bind="args" @update:files="onFiles" @error="onError" />
|
|
112
112
|
<p v-if="lastError" class="body-14-regular text-destructive">{{ lastError }}</p>
|
|
113
|
-
<p v-if="names.length" class="body-14-regular text-muted
|
|
113
|
+
<p v-if="names.length" class="body-14-regular text-content-on-surface-muted">Selected: {{ names.join(', ') }}</p>
|
|
114
114
|
</div>
|
|
115
115
|
`,
|
|
116
116
|
}),
|
|
@@ -150,7 +150,7 @@ function processFileList(fileList: FileList) {
|
|
|
150
150
|
<div
|
|
151
151
|
:class="
|
|
152
152
|
cn(
|
|
153
|
-
'border-border-surface-default bg-background-surface-modal focus-
|
|
153
|
+
'border-border-surface-default bg-background-surface-modal ui-focus-ring relative flex cursor-pointer flex-col items-center justify-center gap-4 rounded-lg border border-dashed p-8 text-center transition-colors',
|
|
154
154
|
isDragging && 'border-1 border-border-surface-focus-ring',
|
|
155
155
|
disabled && 'cursor-not-allowed opacity-50',
|
|
156
156
|
)
|
|
@@ -231,7 +231,7 @@ function processFileList(fileList: FileList) {
|
|
|
231
231
|
<slot name="footer">
|
|
232
232
|
<div
|
|
233
233
|
v-if="showFooter"
|
|
234
|
-
class="text-muted
|
|
234
|
+
class="text-content-on-surface-muted flex flex-wrap items-center justify-between gap-2 label-12-regular"
|
|
235
235
|
>
|
|
236
236
|
<span v-if="supportedTypesLabel?.trim()">{{
|
|
237
237
|
supportedTypesLabel
|
|
@@ -61,7 +61,7 @@ function handleFilesChange(e: Event) {
|
|
|
61
61
|
<div
|
|
62
62
|
v-if="isFile"
|
|
63
63
|
v-bind="attrs"
|
|
64
|
-
class="flex h-9 w-full min-w-0 items-center gap-2 rounded-md border border-input bg-background-input-default px-1 transition-[color] outline-none
|
|
64
|
+
class="flex h-9 w-full min-w-0 items-center gap-2 rounded-md border border-input bg-background-input-default px-1 transition-[color] outline-none ui-focus-ring-within aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
65
65
|
:class="{
|
|
66
66
|
'pointer-events-none cursor-not-allowed opacity-50': props.disabled,
|
|
67
67
|
}"
|
|
@@ -84,8 +84,8 @@ function handleFilesChange(e: Event) {
|
|
|
84
84
|
</label>
|
|
85
85
|
</UiButton>
|
|
86
86
|
<span
|
|
87
|
-
class="placeholder:text-muted
|
|
88
|
-
:class="{ 'text-muted
|
|
87
|
+
class="placeholder:text-content-on-surface-muted flex-1 truncate pr-2 label-16-regular md:label-14-regular"
|
|
88
|
+
:class="{ 'text-content-on-surface-muted': fileDisplayValue === '' }"
|
|
89
89
|
:aria-controls="fileInputId"
|
|
90
90
|
>
|
|
91
91
|
{{ fileDisplayValue || filePlaceholder }}
|