@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
|
@@ -829,10 +829,10 @@ export const Accessibility: Story = {
|
|
|
829
829
|
|
|
830
830
|
<div class="flex flex-col gap-6">
|
|
831
831
|
<div class="flex flex-col gap-2">
|
|
832
|
-
<h3 class="body-
|
|
832
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
833
833
|
Requirements
|
|
834
834
|
</h3>
|
|
835
|
-
<ul class="body-
|
|
835
|
+
<ul class="body-m-regular flex list-disc flex-col gap-1 pl-6 text-content-on-surface-primary">
|
|
836
836
|
<li>
|
|
837
837
|
The drop zone reads as an interactive target at rest, not only
|
|
838
838
|
while a file is dragged over it
|
|
@@ -842,16 +842,18 @@ export const Accessibility: Story = {
|
|
|
842
842
|
survives without colour
|
|
843
843
|
</li>
|
|
844
844
|
<li>
|
|
845
|
-
Progress, success and error are each distinguishable
|
|
846
|
-
and text, never by colour alone
|
|
845
|
+
Progress, processing, success and error are each distinguishable
|
|
846
|
+
by icon and text, never by colour alone. Processing keeps the
|
|
847
|
+
neutral badge and says so in text
|
|
847
848
|
</li>
|
|
848
849
|
<li>
|
|
849
850
|
Error text sits in the row it belongs to and stays legible at
|
|
850
851
|
the small size
|
|
851
852
|
</li>
|
|
852
853
|
<li>
|
|
853
|
-
Remove and
|
|
854
|
-
well as pointer
|
|
854
|
+
Remove and the multi-file chevron stay comfortable targets for
|
|
855
|
+
touch as well as pointer. The chevron opens a list where each
|
|
856
|
+
file keeps the icon for its type
|
|
855
857
|
</li>
|
|
856
858
|
<li>
|
|
857
859
|
Focus is clearly visible on the picker, on each file row and on
|
|
@@ -861,10 +863,10 @@ export const Accessibility: Story = {
|
|
|
861
863
|
</div>
|
|
862
864
|
|
|
863
865
|
<div class="flex flex-col gap-2">
|
|
864
|
-
<h3 class="body-
|
|
866
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
865
867
|
Enable accessibility theme
|
|
866
868
|
</h3>
|
|
867
|
-
<p class="body-
|
|
869
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
868
870
|
When accessibility is required, enable our accessibility theme.
|
|
869
871
|
This increases contrast and ensures there are no color contrast
|
|
870
872
|
issues.
|
|
@@ -874,28 +876,62 @@ export const Accessibility: Story = {
|
|
|
874
876
|
|
|
875
877
|
<div class="grid gap-4 md:grid-cols-2">
|
|
876
878
|
<div class="flex flex-col gap-3">
|
|
877
|
-
<h3 class="label-
|
|
879
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
878
880
|
Default
|
|
879
881
|
</h3>
|
|
880
|
-
<div class="flex min-h-20 flex-col justify-center border border-border-surface-default p-6">
|
|
882
|
+
<div class="flex min-h-20 flex-col justify-center gap-3 border border-border-surface-default p-6">
|
|
883
|
+
<UiFileItem
|
|
884
|
+
filename="Filename.pdf"
|
|
885
|
+
type-label="PDF"
|
|
886
|
+
processing
|
|
887
|
+
processing-label="Processing…"
|
|
888
|
+
remove-label="Remove Filename.pdf"
|
|
889
|
+
/>
|
|
881
890
|
<UiFileItem
|
|
882
891
|
filename="Filename"
|
|
883
892
|
error="Upload failed"
|
|
884
893
|
remove-label="Remove Filename"
|
|
885
894
|
/>
|
|
895
|
+
<UiFileItem
|
|
896
|
+
filename="Attached documents"
|
|
897
|
+
type-label="2 files"
|
|
898
|
+
expand-label="Show attached documents"
|
|
899
|
+
:removable="false"
|
|
900
|
+
:items="[
|
|
901
|
+
{ filename: 'Plan.pdf', typeLabel: 'PDF', sizeLabel: '12 MB' },
|
|
902
|
+
{ filename: 'Notes.md', typeLabel: 'MD', sizeLabel: '12 KB' },
|
|
903
|
+
]"
|
|
904
|
+
/>
|
|
886
905
|
</div>
|
|
887
906
|
</div>
|
|
888
907
|
|
|
889
908
|
<div class="accessible-theme flex flex-col gap-3">
|
|
890
|
-
<h3 class="label-
|
|
909
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
891
910
|
Accessible
|
|
892
911
|
</h3>
|
|
893
|
-
<div class="flex min-h-20 flex-col justify-center border border-border-surface-default p-6">
|
|
912
|
+
<div class="flex min-h-20 flex-col justify-center gap-3 border border-border-surface-default p-6">
|
|
913
|
+
<UiFileItem
|
|
914
|
+
filename="Filename.pdf"
|
|
915
|
+
type-label="PDF"
|
|
916
|
+
processing
|
|
917
|
+
processing-label="Processing…"
|
|
918
|
+
remove-label="Remove Filename.pdf"
|
|
919
|
+
/>
|
|
894
920
|
<UiFileItem
|
|
895
921
|
filename="Filename"
|
|
896
922
|
error="Upload failed"
|
|
897
923
|
remove-label="Remove Filename"
|
|
898
924
|
/>
|
|
925
|
+
<UiFileItem
|
|
926
|
+
filename="Attached documents"
|
|
927
|
+
type-label="2 files"
|
|
928
|
+
expand-label="Show attached documents"
|
|
929
|
+
:removable="false"
|
|
930
|
+
:items="[
|
|
931
|
+
{ filename: 'Plan.pdf', typeLabel: 'PDF', sizeLabel: '12 MB' },
|
|
932
|
+
{ filename: 'Notes.md', typeLabel: 'MD', sizeLabel: '12 KB' },
|
|
933
|
+
]"
|
|
934
|
+
/>
|
|
899
935
|
</div>
|
|
900
936
|
</div>
|
|
901
937
|
</div>
|
|
@@ -1343,3 +1379,149 @@ export const DialogIntegration: Story = {
|
|
|
1343
1379
|
);
|
|
1344
1380
|
},
|
|
1345
1381
|
};
|
|
1382
|
+
|
|
1383
|
+
const patternFiles = [
|
|
1384
|
+
{
|
|
1385
|
+
id: 'plan',
|
|
1386
|
+
filename: '26_Business_Plan_2026.pdf',
|
|
1387
|
+
typeLabel: 'PDF',
|
|
1388
|
+
sizeLabel: '12 MB',
|
|
1389
|
+
removeLabel: 'Remove 26_Business_Plan_2026.pdf',
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
id: 'notes',
|
|
1393
|
+
filename: 'Last_weeks_memory.md',
|
|
1394
|
+
typeLabel: 'MD',
|
|
1395
|
+
sizeLabel: '12 KB',
|
|
1396
|
+
removeLabel: 'Remove Last_weeks_memory.md',
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
id: 'sheet',
|
|
1400
|
+
filename: 'Tabular_analysis.csv',
|
|
1401
|
+
typeLabel: 'CSV',
|
|
1402
|
+
sizeLabel: '12 MB',
|
|
1403
|
+
removeLabel: 'Remove Tabular_analysis.csv',
|
|
1404
|
+
},
|
|
1405
|
+
];
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* File rows the pattern renders after a pick: a processing file, and a multi
|
|
1409
|
+
* row whose chevron lists each file with the icon for its type. Hidden
|
|
1410
|
+
* test-only story.
|
|
1411
|
+
*/
|
|
1412
|
+
export const FileListStates: Story = {
|
|
1413
|
+
name: 'test - File List States',
|
|
1414
|
+
tags: ['!dev', '!autodocs'],
|
|
1415
|
+
parameters: {
|
|
1416
|
+
chromatic: { disableSnapshot: true },
|
|
1417
|
+
controls: { disable: true },
|
|
1418
|
+
docs: {
|
|
1419
|
+
description: {
|
|
1420
|
+
story:
|
|
1421
|
+
'Processing status and the multi-file disclosure used beside the uploader.',
|
|
1422
|
+
},
|
|
1423
|
+
},
|
|
1424
|
+
},
|
|
1425
|
+
render: () => ({
|
|
1426
|
+
components: { UiFileItem },
|
|
1427
|
+
setup() {
|
|
1428
|
+
return { files: patternFiles };
|
|
1429
|
+
},
|
|
1430
|
+
template: `
|
|
1431
|
+
<ul class="flex flex-col gap-2" aria-label="Selected files">
|
|
1432
|
+
<li>
|
|
1433
|
+
<UiFileItem
|
|
1434
|
+
filename="Quarterly report.pdf"
|
|
1435
|
+
type-label="PDF"
|
|
1436
|
+
processing
|
|
1437
|
+
processing-label="Processing…"
|
|
1438
|
+
remove-label="Remove Quarterly report.pdf"
|
|
1439
|
+
/>
|
|
1440
|
+
</li>
|
|
1441
|
+
<li>
|
|
1442
|
+
<UiFileItem
|
|
1443
|
+
filename="Attached documents"
|
|
1444
|
+
type-label="3 files"
|
|
1445
|
+
expand-label="Show attached documents"
|
|
1446
|
+
list-label="Attached files"
|
|
1447
|
+
:items="files"
|
|
1448
|
+
:removable="false"
|
|
1449
|
+
/>
|
|
1450
|
+
</li>
|
|
1451
|
+
</ul>
|
|
1452
|
+
`,
|
|
1453
|
+
}),
|
|
1454
|
+
play: async ({ canvasElement, step }) => {
|
|
1455
|
+
// Scenario (UiFileUpload): the list beside the drop zone includes a file
|
|
1456
|
+
// that is still processing and a group of mixed types. Assistive tech hears
|
|
1457
|
+
// the processing status, and opening the group shows each file's own icon.
|
|
1458
|
+
const canvas = within(canvasElement);
|
|
1459
|
+
const body = within(document.body);
|
|
1460
|
+
|
|
1461
|
+
await step(
|
|
1462
|
+
'screen-reader: a processing file is a status named with the file and the label (WCAG 4.1.3)',
|
|
1463
|
+
async () => {
|
|
1464
|
+
await expect(canvas.getByRole('status')).toHaveAccessibleName(
|
|
1465
|
+
'Quarterly report.pdf, PDF, Processing…',
|
|
1466
|
+
);
|
|
1467
|
+
await expect(canvas.queryByRole('progressbar')).not.toBeInTheDocument();
|
|
1468
|
+
},
|
|
1469
|
+
);
|
|
1470
|
+
|
|
1471
|
+
await step(
|
|
1472
|
+
'keyboard: Tab reaches the group chevron and Enter opens it (WCAG 2.1.1)',
|
|
1473
|
+
async () => {
|
|
1474
|
+
const chevron = canvas.getByRole('button', {
|
|
1475
|
+
name: 'Show attached documents',
|
|
1476
|
+
});
|
|
1477
|
+
await userEvent.tab();
|
|
1478
|
+
await userEvent.tab();
|
|
1479
|
+
await expect(chevron).toHaveFocus();
|
|
1480
|
+
await userEvent.keyboard('{Enter}');
|
|
1481
|
+
await expect(chevron).toHaveAttribute('aria-expanded', 'true');
|
|
1482
|
+
},
|
|
1483
|
+
);
|
|
1484
|
+
|
|
1485
|
+
await step(
|
|
1486
|
+
'interaction: the list groups each file under the icon for its type',
|
|
1487
|
+
async () => {
|
|
1488
|
+
const list = await body.findByRole('list', { name: 'Attached files' });
|
|
1489
|
+
// The panel fades and zooms in, so the type labels are in the DOM a
|
|
1490
|
+
// frame before they are visible.
|
|
1491
|
+
await waitFor(async () => {
|
|
1492
|
+
await expect(list).toBeVisible();
|
|
1493
|
+
});
|
|
1494
|
+
const tones = Array.from(
|
|
1495
|
+
list.querySelectorAll('[data-slot="file-type"]'),
|
|
1496
|
+
).map((badge) => badge.getAttribute('data-tone'));
|
|
1497
|
+
await expect(tones).toEqual([
|
|
1498
|
+
'accent-pink',
|
|
1499
|
+
'accent-soft',
|
|
1500
|
+
'accent-yellow',
|
|
1501
|
+
]);
|
|
1502
|
+
for (const label of ['PDF', 'MD', 'CSV']) {
|
|
1503
|
+
await waitFor(async () => {
|
|
1504
|
+
await expect(within(list).getByText(label)).toBeVisible();
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
},
|
|
1508
|
+
);
|
|
1509
|
+
|
|
1510
|
+
await step(
|
|
1511
|
+
'screen-reader: each file in the group exposes its filename (WCAG 4.1.2)',
|
|
1512
|
+
async () => {
|
|
1513
|
+
const list = body.getByRole('list', { name: 'Attached files' });
|
|
1514
|
+
await expect(
|
|
1515
|
+
within(list).getByLabelText('Last_weeks_memory.md'),
|
|
1516
|
+
).toHaveTextContent('Last_weeks_memory');
|
|
1517
|
+
},
|
|
1518
|
+
);
|
|
1519
|
+
|
|
1520
|
+
await step('keyboard: Escape closes the file list', async () => {
|
|
1521
|
+
await userEvent.keyboard('{Escape}');
|
|
1522
|
+
await expect(
|
|
1523
|
+
canvas.getByRole('button', { name: 'Show attached documents' }),
|
|
1524
|
+
).toHaveAttribute('aria-expanded', 'false');
|
|
1525
|
+
});
|
|
1526
|
+
},
|
|
1527
|
+
};
|