@aleph-alpha/ui-library 6.4.0 → 6.6.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/dist/system/components/UiFileItem/UiFileItem.vue.d.ts +10 -1
- package/dist/system/components/UiFileItem/index.d.ts +1 -1
- package/dist/system/components/UiFileItem/types.d.ts +81 -5
- package/dist/system/components/UiPopover/UiPopoverContent.vue.d.ts +1 -0
- package/dist/system/components/UiPopover/types.d.ts +6 -0
- package/dist/system/components/core/popover/PopoverContent.vue.d.ts +1 -0
- package/dist/system/components/core/toggle/index.d.ts +1 -1
- package/dist/system/lib.js +12336 -12055
- package/dist/system/patterns/UiFloatActions/UiFloatActionItems.vue.d.ts +21 -174
- package/dist/system/patterns/UiFloatActions/core/FloatingButton.vue.d.ts +36 -0
- package/dist/system/patterns/UiFloatActions/core/FloatingInput.vue.d.ts +19 -0
- package/dist/system/patterns/UiFloatActions/floatActionItemContext.d.ts +3 -1
- package/dist/system/patterns/UiFloatActions/types.d.ts +93 -19
- package/dist/system/patterns/UiLayout/layout-shell.d.ts +117 -252
- package/package.json +2 -2
- package/src/components/UiAccordion/UiAccordion.stories.ts +8 -8
- package/src/components/UiAlert/UiAlert.stories.ts +13 -13
- package/src/components/UiAlertDialog/UiAlertDialog.stories.ts +4 -4
- package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +13 -13
- package/src/components/UiAutocomplete/UiAutocomplete.vue +3 -3
- package/src/components/UiBadge/UiBadge.stories.ts +9 -9
- package/src/components/UiBreadcrumb/UiBreadcrumb.stories.ts +14 -14
- package/src/components/UiButton/UiButton.stories.ts +35 -35
- package/src/components/UiButtonGroup/UiButtonGroup.stories.ts +6 -6
- package/src/components/UiCalendar/UiCalendar.stories.ts +6 -6
- package/src/components/UiCard/UiCard.stories.ts +6 -6
- package/src/components/UiCheckbox/UiCheckbox.stories.ts +30 -30
- package/src/components/UiChip/UiChip.stories.ts +14 -14
- package/src/components/UiChip/UiChip.vue +1 -1
- package/src/components/UiDialog/UiDialog.stories.ts +20 -20
- package/src/components/UiDrawer/UiDrawer.stories.ts +29 -29
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +13 -13
- package/src/components/UiEmpty/UiEmpty.vue +1 -1
- package/src/components/UiFadeMask/UiFadeMask.stories.ts +13 -13
- package/src/components/UiField/UiField.stories.ts +27 -27
- package/src/components/UiFileItem/UiFileItem.vue +114 -9
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +54 -2
- package/src/components/UiFileItem/index.ts +1 -0
- package/src/components/UiFileItem/types.ts +82 -5
- package/src/components/UiFileType/UiFileType.stories.ts +10 -10
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +10 -10
- package/src/components/UiFileUploadBox/UiFileUploadBox.vue +3 -3
- package/src/components/UiIcon/UiIcon.stories.ts +9 -9
- package/src/components/UiInput/UiInput.stories.ts +13 -13
- package/src/components/UiInput/UiInput.vue +1 -1
- package/src/components/UiInputGroup/UiInputGroup.stories.ts +10 -10
- package/src/components/UiItem/UiItem.stories.ts +12 -12
- package/src/components/UiItem/__tests__/UiItem.test.ts +2 -2
- package/src/components/UiKbd/UiKbd.stories.ts +18 -18
- package/src/components/UiKbd/UiKbd.vue +1 -1
- package/src/components/UiLabel/UiLabel.stories.ts +12 -12
- package/src/components/UiLabel/__tests__/UiLabel.test.ts +1 -1
- package/src/components/UiListbox/UiListbox.stories.ts +20 -20
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +94 -94
- package/src/components/UiPopover/UiPopover.stories.ts +168 -27
- package/src/components/UiPopover/UiPopoverContent.vue +2 -0
- package/src/components/UiPopover/__tests__/UiPopover.test.ts +48 -0
- package/src/components/UiPopover/types.ts +7 -0
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +53 -53
- package/src/components/UiRangeCalendar/UiRangeCalendar.stories.ts +6 -6
- package/src/components/UiResizable/UiResizable.stories.ts +40 -40
- package/src/components/UiSelect/UiSelect.stories.ts +14 -14
- package/src/components/UiSeparator/UiSeparator.stories.ts +16 -16
- package/src/components/UiSheet/UiSheet.stories.ts +29 -29
- package/src/components/UiSlider/UiSlider.stories.ts +28 -28
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +6 -6
- package/src/components/UiSnackbar/UiSnackbar.vue +2 -2
- package/src/components/UiSnackbar/UiSnackbarContent.vue +2 -2
- package/src/components/UiSpinner/UiSpinner.stories.ts +8 -8
- package/src/components/UiStepper/UiStepper.stories.ts +6 -6
- package/src/components/UiSwitch/UiSwitch.stories.ts +37 -37
- package/src/components/UiTable/UiTable.stories.ts +4 -4
- package/src/components/UiTabs/UiTabs.stories.ts +64 -64
- package/src/components/UiTagsInput/UiTagsInput.stories.ts +16 -16
- package/src/components/UiTextarea/UiTextarea.stories.ts +20 -20
- package/src/components/UiToggle/UiToggle.stories.ts +26 -26
- package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +31 -31
- package/src/components/UiTooltip/UiTooltip.stories.ts +7 -7
- package/src/components/core/accordion/AccordionContent.vue +1 -1
- package/src/components/core/accordion/AccordionTrigger.vue +1 -1
- package/src/components/core/alert/AlertDescription.vue +1 -1
- package/src/components/core/alert/index.ts +1 -1
- package/src/components/core/alert-dialog/AlertDialogDescription.vue +1 -1
- package/src/components/core/badge/index.ts +2 -2
- package/src/components/core/button/index.ts +3 -3
- package/src/components/core/calendar/Calendar.vue +4 -4
- package/src/components/core/calendar/CalendarCell.vue +1 -1
- package/src/components/core/calendar/CalendarHeading.vue +1 -1
- package/src/components/core/card/CardDescription.vue +1 -1
- package/src/components/core/dialog/DialogDescription.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/DropdownMenuLabel.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuShortcut.vue +1 -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/FieldError.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 +1 -1
- package/src/components/core/field/FieldTitle.vue +1 -1
- package/src/components/core/input/Input.vue +1 -1
- package/src/components/core/input-group/InputGroupText.vue +1 -1
- package/src/components/core/input-group/index.ts +1 -1
- package/src/components/core/item/ItemDescription.vue +1 -1
- package/src/components/core/item/ItemTitle.vue +1 -1
- package/src/components/core/item/index.ts +2 -2
- 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 +1 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/native-select/NativeSelect.vue +1 -1
- package/src/components/core/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/core/navigation-menu/index.ts +1 -1
- package/src/components/core/popover/PopoverContent.vue +9 -3
- package/src/components/core/range-calendar/RangeCalendarCell.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarHeading.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/select/SelectLabel.vue +1 -1
- package/src/components/core/select/SelectTrigger.vue +1 -1
- package/src/components/core/sheet/SheetDescription.vue +1 -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/stepper/StepperDescription.vue +1 -1
- package/src/components/core/stepper/StepperTitle.vue +1 -1
- package/src/components/core/table/Table.vue +1 -1
- package/src/components/core/table/TableCaption.vue +1 -1
- package/src/components/core/table/TableEmpty.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/TagsInputItem.vue +1 -1
- package/src/components/core/textarea/Textarea.vue +1 -1
- package/src/components/core/toggle/index.ts +1 -1
- package/src/components/core/tooltip/TooltipContent.vue +1 -1
- package/src/directives/vHover.stories.ts +17 -17
- package/src/lib/useDevice.stories.ts +29 -29
- package/src/lib/useDrag.stories.ts +14 -14
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +27 -27
- package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +2 -2
- package/src/patterns/UiDataTable/UiDataTableFilterMenu.vue +2 -2
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +3 -3
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnFilter.test.ts +2 -2
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +14 -14
- package/src/patterns/UiFileUpload/UiFileItem.stories.ts +818 -32
- package/src/patterns/UiFileUpload/UiFileUpload.stories.ts +194 -12
- package/src/patterns/UiFloatActions/UiFloatActionItems.vue +226 -76
- package/src/patterns/UiFloatActions/UiFloatActions.stories.ts +1136 -116
- package/src/patterns/UiFloatActions/__tests__/UiFloatActionItems.test.ts +187 -1
- package/src/patterns/UiFloatActions/core/FloatingButton.vue +83 -0
- package/src/patterns/UiFloatActions/core/FloatingInput.vue +53 -0
- package/src/patterns/UiFloatActions/floatActionItemContext.ts +3 -1
- package/src/patterns/UiFloatActions/types.ts +106 -19
- package/src/patterns/UiLayout/UiLayoutContent.stories.ts +17 -17
- package/src/patterns/UiLayout/UiLayoutMobile.stories.ts +4 -4
- package/src/patterns/UiLayout/layout-shell.ts +6 -6
- package/src/patterns/UiProfileCard/UiProfileCard.stories.ts +8 -8
- package/src/patterns/UiProfileCard/profile-card.ts +2 -2
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +6 -6
- package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +1 -1
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +4 -4
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +1 -1
- package/src/patterns/UiSidebar/UiSidebarHeader.vue +1 -1
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +7 -7
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +4 -4
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.stories.ts +1 -1
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +1 -1
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.vue +1 -1
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +3 -3
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +1 -1
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +1 -1
- package/src/patterns/UiSidebar/UiSidebarSub.stories.ts +1 -1
- package/src/patterns/UiTopBar/UiTopBar.stories.ts +24 -24
- package/src/theme/Background.stories.ts +62 -62
- package/src/theme/Border.stories.ts +19 -19
- package/src/theme/BorderRadius.stories.ts +14 -14
- package/src/theme/Extended.stories.ts +26 -26
- package/src/theme/Flex.stories.ts +21 -21
- package/src/theme/Grid.stories.ts +19 -19
- package/src/theme/HoverLayer.stories.ts +26 -26
- package/src/theme/Overlay.stories.ts +14 -14
- package/src/theme/Scrollbar.stories.ts +58 -58
- package/src/theme/Shadow.stories.ts +5 -5
- package/src/theme/Theme.stories.ts +38 -38
|
@@ -129,7 +129,7 @@ onUnmounted(() => window.removeEventListener('keydown', handleKeydown))
|
|
|
129
129
|
<template>
|
|
130
130
|
<div class="flex flex-col gap-3 rounded-lg border p-4">
|
|
131
131
|
<div class="flex items-center justify-between gap-8">
|
|
132
|
-
<span class="body-
|
|
132
|
+
<span class="body-s-regular">Open Command Palette</span>
|
|
133
133
|
<UiKbdGroup>
|
|
134
134
|
<UiKbd>Ctrl</UiKbd>
|
|
135
135
|
<span class="text-content-on-surface-muted">+</span>
|
|
@@ -137,7 +137,7 @@ onUnmounted(() => window.removeEventListener('keydown', handleKeydown))
|
|
|
137
137
|
</UiKbdGroup>
|
|
138
138
|
</div>
|
|
139
139
|
<div class="flex items-center justify-between gap-8">
|
|
140
|
-
<span class="body-
|
|
140
|
+
<span class="body-s-regular">Toggle Help</span>
|
|
141
141
|
<UiKbdGroup>
|
|
142
142
|
<UiKbd>Ctrl</UiKbd>
|
|
143
143
|
<span class="text-content-on-surface-muted">+</span>
|
|
@@ -221,12 +221,12 @@ export const Interactive: Story = {
|
|
|
221
221
|
<div class="flex flex-col items-center gap-6 p-4">
|
|
222
222
|
<div class="text-center gap-y-2">
|
|
223
223
|
<h3 class="heading-s">Interactive Keyboard Shortcuts</h3>
|
|
224
|
-
<p class="body-
|
|
224
|
+
<p class="body-s-regular text-content-on-surface-muted">Try pressing these keyboard shortcuts:</p>
|
|
225
225
|
</div>
|
|
226
226
|
|
|
227
227
|
<div class="flex flex-col gap-3 rounded-lg border p-4 bg-background-surface-muted/30">
|
|
228
228
|
<div class="flex items-center justify-between gap-8">
|
|
229
|
-
<span class="body-
|
|
229
|
+
<span class="body-s-regular">Open Command Palette</span>
|
|
230
230
|
<UiKbdGroup>
|
|
231
231
|
<UiKbd>Ctrl</UiKbd>
|
|
232
232
|
<span class="text-content-on-surface-muted">+</span>
|
|
@@ -234,7 +234,7 @@ export const Interactive: Story = {
|
|
|
234
234
|
</UiKbdGroup>
|
|
235
235
|
</div>
|
|
236
236
|
<div class="flex items-center justify-between gap-8">
|
|
237
|
-
<span class="body-
|
|
237
|
+
<span class="body-s-regular">Toggle Help</span>
|
|
238
238
|
<UiKbdGroup>
|
|
239
239
|
<UiKbd>Ctrl</UiKbd>
|
|
240
240
|
<span class="text-content-on-surface-muted">+</span>
|
|
@@ -242,21 +242,21 @@ export const Interactive: Story = {
|
|
|
242
242
|
</UiKbdGroup>
|
|
243
243
|
</div>
|
|
244
244
|
<div class="flex items-center justify-between gap-8">
|
|
245
|
-
<span class="body-
|
|
245
|
+
<span class="body-s-regular">Close / Dismiss</span>
|
|
246
246
|
<UiKbd>Esc</UiKbd>
|
|
247
247
|
</div>
|
|
248
248
|
</div>
|
|
249
249
|
|
|
250
|
-
<div v-if="lastPressed" class="body-
|
|
250
|
+
<div v-if="lastPressed" class="body-s-regular text-content-on-surface-muted">
|
|
251
251
|
Last pressed: <UiKbd>{{ lastPressed }}</UiKbd>
|
|
252
252
|
</div>
|
|
253
253
|
|
|
254
254
|
<div v-if="showHelp" class="w-full max-w-md rounded-lg border bg-card p-4 shadow-lg">
|
|
255
255
|
<div class="flex items-center justify-between mb-3">
|
|
256
|
-
<h4 class="body-
|
|
256
|
+
<h4 class="body-s-medium">Keyboard Shortcuts Help</h4>
|
|
257
257
|
<UiKbd>Esc</UiKbd>
|
|
258
258
|
</div>
|
|
259
|
-
<div class="gap-y-2 body-
|
|
259
|
+
<div class="gap-y-2 body-s-regular text-content-on-surface-muted">
|
|
260
260
|
<p>Use keyboard shortcuts to navigate quickly through the application.</p>
|
|
261
261
|
<p>Press <UiKbd>Esc</UiKbd> to close this help panel.</p>
|
|
262
262
|
</div>
|
|
@@ -311,7 +311,7 @@ import { UiKbd, UiKbdGroup } from '@aleph-alpha/ui-library'
|
|
|
311
311
|
</script>
|
|
312
312
|
|
|
313
313
|
<template>
|
|
314
|
-
<p class="body-
|
|
314
|
+
<p class="body-s-regular text-content-on-surface-muted">
|
|
315
315
|
Use
|
|
316
316
|
<UiKbdGroup>
|
|
317
317
|
<UiKbd>Ctrl</UiKbd>
|
|
@@ -333,7 +333,7 @@ export const Group: Story = {
|
|
|
333
333
|
},
|
|
334
334
|
template: `
|
|
335
335
|
<div class="flex flex-col items-center gap-4">
|
|
336
|
-
<p class="body-
|
|
336
|
+
<p class="body-s-regular text-content-on-surface-muted">
|
|
337
337
|
Use
|
|
338
338
|
<UiKbdGroup>
|
|
339
339
|
<UiKbd v-bind="args">Ctrl + Shift + P</UiKbd>
|
|
@@ -344,18 +344,18 @@ export const Group: Story = {
|
|
|
344
344
|
<div class="mt-8 w-full max-w-md rounded-lg border bg-background-surface-floating p-4 shadow-lg">
|
|
345
345
|
<div class="flex items-center gap-2 border-b pb-3">
|
|
346
346
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-content-on-surface-muted"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
|
347
|
-
<span class="flex-1 body-
|
|
347
|
+
<span class="flex-1 body-s-regular text-content-on-surface-muted">Type a command or search...</span>
|
|
348
348
|
<UiKbd v-bind="args">Esc</UiKbd>
|
|
349
349
|
</div>
|
|
350
350
|
<div class="pt-3 gap-y-1">
|
|
351
|
-
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-
|
|
351
|
+
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-s-regular hover-layer hover-layer-default cursor-pointer">
|
|
352
352
|
<span>Toggle Sidebar</span>
|
|
353
353
|
<UiKbdGroup>
|
|
354
354
|
<UiKbd v-bind="args">Ctrl</UiKbd>
|
|
355
355
|
<UiKbd v-bind="args">\\</UiKbd>
|
|
356
356
|
</UiKbdGroup>
|
|
357
357
|
</div>
|
|
358
|
-
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-
|
|
358
|
+
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-s-regular hover-layer hover-layer-default cursor-pointer">
|
|
359
359
|
<span>Quick Search</span>
|
|
360
360
|
<UiKbdGroup>
|
|
361
361
|
<UiKbd v-bind="args">Ctrl</UiKbd>
|
|
@@ -363,7 +363,7 @@ export const Group: Story = {
|
|
|
363
363
|
<UiKbd v-bind="args">F</UiKbd>
|
|
364
364
|
</UiKbdGroup>
|
|
365
365
|
</div>
|
|
366
|
-
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-
|
|
366
|
+
<div class="flex items-center justify-between rounded-md px-2 py-1.5 body-s-regular hover-layer hover-layer-default cursor-pointer">
|
|
367
367
|
<span>Go to Line</span>
|
|
368
368
|
<UiKbdGroup>
|
|
369
369
|
<UiKbd v-bind="args">Ctrl</UiKbd>
|
|
@@ -528,17 +528,17 @@ export const Sizes: Story = {
|
|
|
528
528
|
template: `
|
|
529
529
|
<div class="flex items-center gap-4">
|
|
530
530
|
<div class="flex items-center gap-1">
|
|
531
|
-
<span class="label-
|
|
531
|
+
<span class="label-xs-regular text-content-on-surface-muted">sm:</span>
|
|
532
532
|
<UiKbd size="sm">Ctrl</UiKbd>
|
|
533
533
|
<UiKbd size="sm">S</UiKbd>
|
|
534
534
|
</div>
|
|
535
535
|
<div class="flex items-center gap-1">
|
|
536
|
-
<span class="label-
|
|
536
|
+
<span class="label-xs-regular text-content-on-surface-muted">default:</span>
|
|
537
537
|
<UiKbd>Ctrl</UiKbd>
|
|
538
538
|
<UiKbd>S</UiKbd>
|
|
539
539
|
</div>
|
|
540
540
|
<div class="flex items-center gap-1">
|
|
541
|
-
<span class="label-
|
|
541
|
+
<span class="label-xs-regular text-content-on-surface-muted">lg:</span>
|
|
542
542
|
<UiKbd size="lg">Ctrl</UiKbd>
|
|
543
543
|
<UiKbd size="lg">S</UiKbd>
|
|
544
544
|
</div>
|
|
@@ -373,10 +373,10 @@ export const Accessibility: Story = {
|
|
|
373
373
|
|
|
374
374
|
<div class="flex flex-col gap-6">
|
|
375
375
|
<div class="flex flex-col gap-2">
|
|
376
|
-
<h3 class="body-
|
|
376
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
377
377
|
Point <code>for</code> at a real control
|
|
378
378
|
</h3>
|
|
379
|
-
<p class="body-
|
|
379
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
380
380
|
The <code>for</code> attribute must match the <code>id</code> of
|
|
381
381
|
an existing form element. That association is what gives the
|
|
382
382
|
control its accessible name and what makes clicking the label
|
|
@@ -386,10 +386,10 @@ export const Accessibility: Story = {
|
|
|
386
386
|
</div>
|
|
387
387
|
|
|
388
388
|
<div class="flex flex-col gap-2">
|
|
389
|
-
<h3 class="body-
|
|
389
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
390
390
|
Mark required on the control
|
|
391
391
|
</h3>
|
|
392
|
-
<p class="body-
|
|
392
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
393
393
|
Put <code>required</code> on the input so the state is announced,
|
|
394
394
|
and mark any asterisk <code>aria-hidden="true"</code>. A red
|
|
395
395
|
<code>*</code> on its own is colour-dependent (WCAG 1.4.1), and
|
|
@@ -399,10 +399,10 @@ export const Accessibility: Story = {
|
|
|
399
399
|
</div>
|
|
400
400
|
|
|
401
401
|
<div class="flex flex-col gap-2">
|
|
402
|
-
<h3 class="body-
|
|
402
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
403
403
|
Don't put controls inside the label
|
|
404
404
|
</h3>
|
|
405
|
-
<p class="body-
|
|
405
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
406
406
|
Keep the label to text. Nesting a button or link inside it
|
|
407
407
|
creates a control whose activation is ambiguous and can swallow
|
|
408
408
|
clicks meant for the field. Place related actions as siblings
|
|
@@ -411,10 +411,10 @@ export const Accessibility: Story = {
|
|
|
411
411
|
</div>
|
|
412
412
|
|
|
413
413
|
<div class="flex flex-col gap-2">
|
|
414
|
-
<h3 class="body-
|
|
414
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
415
415
|
Disabled needs the <code>group</code> class
|
|
416
416
|
</h3>
|
|
417
|
-
<p class="body-
|
|
417
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
418
418
|
The label dims itself through
|
|
419
419
|
<code>group-data-[disabled=true]</code>, which only matches an
|
|
420
420
|
ancestor carrying the <code>group</code> class. Set
|
|
@@ -425,10 +425,10 @@ export const Accessibility: Story = {
|
|
|
425
425
|
</div>
|
|
426
426
|
|
|
427
427
|
<div class="flex flex-col gap-2">
|
|
428
|
-
<h3 class="body-
|
|
428
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
429
429
|
Enable accessibility theme
|
|
430
430
|
</h3>
|
|
431
|
-
<p class="body-
|
|
431
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
432
432
|
When accessibility is required, enable our accessibility theme.
|
|
433
433
|
This increases contrast and makes sure there are no color
|
|
434
434
|
contrast issues.
|
|
@@ -438,7 +438,7 @@ export const Accessibility: Story = {
|
|
|
438
438
|
|
|
439
439
|
<div class="grid gap-4 md:grid-cols-2">
|
|
440
440
|
<div class="flex flex-col gap-3">
|
|
441
|
-
<h3 class="label-
|
|
441
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
442
442
|
Default
|
|
443
443
|
</h3>
|
|
444
444
|
<div class="flex flex-col gap-4 border border-border-surface-default p-6">
|
|
@@ -454,7 +454,7 @@ export const Accessibility: Story = {
|
|
|
454
454
|
</div>
|
|
455
455
|
|
|
456
456
|
<div class="accessible-theme flex flex-col gap-3">
|
|
457
|
-
<h3 class="label-
|
|
457
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
458
458
|
Accessible
|
|
459
459
|
</h3>
|
|
460
460
|
<div class="flex flex-col gap-4 border border-border-surface-default p-6">
|
|
@@ -30,6 +30,6 @@ describe('UiLabel', () => {
|
|
|
30
30
|
// would silently strip the label's typography and layout.
|
|
31
31
|
const label = container.querySelector('label');
|
|
32
32
|
expect(label).toHaveClass('custom-label-class');
|
|
33
|
-
expect(label).toHaveClass('label-
|
|
33
|
+
expect(label).toHaveClass('label-s-medium');
|
|
34
34
|
});
|
|
35
35
|
});
|
|
@@ -252,7 +252,7 @@ const filteredFruits = computed(() =>
|
|
|
252
252
|
<p
|
|
253
253
|
v-if="filteredFruits.length === 0"
|
|
254
254
|
role="status"
|
|
255
|
-
class="px-3 py-6 text-center label-
|
|
255
|
+
class="px-3 py-6 text-center label-s-regular text-content-on-surface-muted"
|
|
256
256
|
>
|
|
257
257
|
No fruits match "{{ searchTerm }}"
|
|
258
258
|
</p>
|
|
@@ -308,7 +308,7 @@ export const WithFilter: Story = {
|
|
|
308
308
|
<p
|
|
309
309
|
v-if="filteredFruits.length === 0"
|
|
310
310
|
role="status"
|
|
311
|
-
class="px-3 py-6 text-center label-
|
|
311
|
+
class="px-3 py-6 text-center label-s-regular text-content-on-surface-muted"
|
|
312
312
|
>
|
|
313
313
|
No fruits match "{{ searchTerm }}"
|
|
314
314
|
</p>
|
|
@@ -660,7 +660,7 @@ const savedFilters: { value: string; label: string }[] = []
|
|
|
660
660
|
<template>
|
|
661
661
|
<UiListbox v-model="selected" class="w-[220px] p-1">
|
|
662
662
|
<UiListboxContent aria-label="Saved filters" />
|
|
663
|
-
<p class="px-3 py-6 text-center label-
|
|
663
|
+
<p class="px-3 py-6 text-center label-s-regular text-content-on-surface-muted">
|
|
664
664
|
No saved filters yet
|
|
665
665
|
</p>
|
|
666
666
|
</UiListbox>
|
|
@@ -680,7 +680,7 @@ export const EmptyState: Story = {
|
|
|
680
680
|
template: `
|
|
681
681
|
<UiListbox v-model="selected" class="w-[220px] p-1">
|
|
682
682
|
<UiListboxContent aria-label="Saved filters" />
|
|
683
|
-
<p class="px-3 py-6 text-center label-
|
|
683
|
+
<p class="px-3 py-6 text-center label-s-regular text-content-on-surface-muted">
|
|
684
684
|
No saved filters yet
|
|
685
685
|
</p>
|
|
686
686
|
</UiListbox>
|
|
@@ -1084,10 +1084,10 @@ export const Accessibility: Story = {
|
|
|
1084
1084
|
|
|
1085
1085
|
<div class="flex flex-col gap-6">
|
|
1086
1086
|
<div class="flex flex-col gap-2">
|
|
1087
|
-
<h3 class="body-
|
|
1087
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
1088
1088
|
Give the list a meaningful name
|
|
1089
1089
|
</h3>
|
|
1090
|
-
<p class="body-
|
|
1090
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
1091
1091
|
<code>UiListboxContent</code> falls back to the generic name
|
|
1092
1092
|
"Options". Set <code>aria-label</code> (or point
|
|
1093
1093
|
<code>aria-labelledby</code> at a visible heading) so the list is
|
|
@@ -1096,10 +1096,10 @@ export const Accessibility: Story = {
|
|
|
1096
1096
|
</div>
|
|
1097
1097
|
|
|
1098
1098
|
<div class="flex flex-col gap-2">
|
|
1099
|
-
<h3 class="body-
|
|
1099
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
1100
1100
|
Label the filter input
|
|
1101
1101
|
</h3>
|
|
1102
|
-
<p class="body-
|
|
1102
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
1103
1103
|
The placeholder disappears as soon as the user types, so it is not
|
|
1104
1104
|
a label. Give <code>UiListboxFilter</code> its own
|
|
1105
1105
|
<code>aria-label</code>.
|
|
@@ -1107,10 +1107,10 @@ export const Accessibility: Story = {
|
|
|
1107
1107
|
</div>
|
|
1108
1108
|
|
|
1109
1109
|
<div class="flex flex-col gap-2">
|
|
1110
|
-
<h3 class="body-
|
|
1110
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
1111
1111
|
Group related options and label the groups
|
|
1112
1112
|
</h3>
|
|
1113
|
-
<p class="body-
|
|
1113
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
1114
1114
|
Long flat lists are hard to scan and to listen to. Wrap related
|
|
1115
1115
|
options in <code>UiListboxGroup</code> with a
|
|
1116
1116
|
<code>UiListboxGroupLabel</code> so each group is announced with
|
|
@@ -1119,10 +1119,10 @@ export const Accessibility: Story = {
|
|
|
1119
1119
|
</div>
|
|
1120
1120
|
|
|
1121
1121
|
<div class="flex flex-col gap-2">
|
|
1122
|
-
<h3 class="body-
|
|
1122
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
1123
1123
|
Do not rely on the indicator alone
|
|
1124
1124
|
</h3>
|
|
1125
|
-
<p class="body-
|
|
1125
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
1126
1126
|
<code>UiListboxItemIndicator</code> is decorative and hidden from
|
|
1127
1127
|
assistive technology. The selected state is carried by
|
|
1128
1128
|
<code>aria-selected</code> on the option, which the component sets
|
|
@@ -1131,10 +1131,10 @@ export const Accessibility: Story = {
|
|
|
1131
1131
|
</div>
|
|
1132
1132
|
|
|
1133
1133
|
<div class="flex flex-col gap-2">
|
|
1134
|
-
<h3 class="body-
|
|
1134
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
1135
1135
|
Announce the empty and no-results states
|
|
1136
1136
|
</h3>
|
|
1137
|
-
<p class="body-
|
|
1137
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
1138
1138
|
A list that filters down to nothing is silent. Render a short
|
|
1139
1139
|
message in a <code>role="status"</code> region so the outcome is
|
|
1140
1140
|
spoken instead of leaving a blank panel.
|
|
@@ -1142,10 +1142,10 @@ export const Accessibility: Story = {
|
|
|
1142
1142
|
</div>
|
|
1143
1143
|
|
|
1144
1144
|
<div class="flex flex-col gap-2">
|
|
1145
|
-
<h3 class="body-
|
|
1145
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
1146
1146
|
Enable accessibility theme
|
|
1147
1147
|
</h3>
|
|
1148
|
-
<p class="body-
|
|
1148
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
1149
1149
|
When accessibility is required, enable our accessibility theme.
|
|
1150
1150
|
This increases contrast and makes sure there are no color
|
|
1151
1151
|
contrast issues.
|
|
@@ -1155,7 +1155,7 @@ export const Accessibility: Story = {
|
|
|
1155
1155
|
|
|
1156
1156
|
<div class="grid gap-4 md:grid-cols-2">
|
|
1157
1157
|
<div class="flex flex-col gap-3">
|
|
1158
|
-
<h3 class="label-
|
|
1158
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
1159
1159
|
Default
|
|
1160
1160
|
</h3>
|
|
1161
1161
|
<div class="flex min-h-20 items-center justify-center border border-border-surface-default p-6">
|
|
@@ -1191,7 +1191,7 @@ export const Accessibility: Story = {
|
|
|
1191
1191
|
</div>
|
|
1192
1192
|
|
|
1193
1193
|
<div class="accessible-theme flex flex-col gap-3">
|
|
1194
|
-
<h3 class="label-
|
|
1194
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
1195
1195
|
Accessible
|
|
1196
1196
|
</h3>
|
|
1197
1197
|
<div class="flex min-h-20 items-center justify-center border border-border-surface-default p-6">
|
|
@@ -1256,7 +1256,7 @@ function renderKeyboardListbox() {
|
|
|
1256
1256
|
},
|
|
1257
1257
|
template: `
|
|
1258
1258
|
<div class="flex flex-col items-start gap-3">
|
|
1259
|
-
<button type="button" class="rounded-md border border-border-surface-default px-3 py-1.5 label-
|
|
1259
|
+
<button type="button" class="rounded-md border border-border-surface-default px-3 py-1.5 label-s-regular">
|
|
1260
1260
|
Before the list
|
|
1261
1261
|
</button>
|
|
1262
1262
|
<UiListbox v-model="selected" class="w-[220px] p-1">
|
|
@@ -1350,7 +1350,7 @@ function renderFilterListbox() {
|
|
|
1350
1350
|
<p
|
|
1351
1351
|
v-if="matches.length === 0"
|
|
1352
1352
|
role="status"
|
|
1353
|
-
class="px-3 py-6 text-center label-
|
|
1353
|
+
class="px-3 py-6 text-center label-s-regular text-content-on-surface-muted"
|
|
1354
1354
|
>
|
|
1355
1355
|
No food matches "{{ searchTerm }}"
|
|
1356
1356
|
</p>
|