@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
|
@@ -11,7 +11,7 @@ const props = defineProps<{
|
|
|
11
11
|
<div data-slot="table-container" class="relative w-full overflow-auto">
|
|
12
12
|
<table
|
|
13
13
|
data-slot="table"
|
|
14
|
-
:class="cn('w-full caption-bottom label-
|
|
14
|
+
:class="cn('w-full caption-bottom label-s-regular', props.class)"
|
|
15
15
|
>
|
|
16
16
|
<slot />
|
|
17
17
|
</table>
|
|
@@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
19
19
|
data-slot="tabs-trigger"
|
|
20
20
|
:class="
|
|
21
21
|
cn(
|
|
22
|
-
'hover:bg-background-surface-secondary data-[state=active]:bg-background-surface-secondary ui-focus-ring text-foreground dark:text-content-on-surface-muted inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 label-
|
|
22
|
+
'hover:bg-background-surface-secondary data-[state=active]:bg-background-surface-secondary ui-focus-ring text-foreground dark:text-content-on-surface-muted inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 label-s-medium whitespace-nowrap transition-[color,background-color] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
23
23
|
props.class,
|
|
24
24
|
)
|
|
25
25
|
"
|
|
@@ -24,7 +24,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
24
24
|
// The root is a `div`, so `disabled:` variants can never match it —
|
|
25
25
|
// reka marks the disabled state with `data-disabled` instead. Dimming
|
|
26
26
|
// stays on the tags themselves so the opacity does not compound.
|
|
27
|
-
'border-input ui-focus-ring-within flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-background-input-default px-3 py-1 label-
|
|
27
|
+
'border-input ui-focus-ring-within flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-background-input-default px-3 py-1 label-s-regular shadow-xs transition-[color,box-shadow] data-[disabled]:cursor-not-allowed',
|
|
28
28
|
props.class,
|
|
29
29
|
)
|
|
30
30
|
"
|
|
@@ -31,7 +31,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
31
31
|
cn(
|
|
32
32
|
// `h-7` (28px) rather than 24px so the delete control inside can reach
|
|
33
33
|
// its own 24px minimum touch target (WCAG 2.5.8) without overflowing.
|
|
34
|
-
'bg-secondary text-secondary-foreground data-[state=active]:border-ring data-[state=active]:ring-ring/50 inline-flex h-7 shrink-0 items-center gap-1 rounded-sm border px-1 label-
|
|
34
|
+
'bg-secondary text-secondary-foreground data-[state=active]:border-ring data-[state=active]:ring-ring/50 inline-flex h-7 shrink-0 items-center gap-1 rounded-sm border px-1 label-xs-medium transition-[color,box-shadow] data-[state=active]:ring-[3px] [&[data-disabled]]:opacity-50 [&>button]:shrink-0',
|
|
35
35
|
props.class,
|
|
36
36
|
)
|
|
37
37
|
"
|
|
@@ -25,7 +25,7 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
|
25
25
|
data-slot="textarea"
|
|
26
26
|
:class="
|
|
27
27
|
cn(
|
|
28
|
-
'border-input placeholder:text-content-on-surface-muted ui-focus-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-background-input-default px-3 py-2 label-
|
|
28
|
+
'border-input placeholder:text-content-on-surface-muted ui-focus-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-background-input-default px-3 py-2 label-m-regular shadow-xs transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:label-s-regular',
|
|
29
29
|
props.class,
|
|
30
30
|
)
|
|
31
31
|
"
|
|
@@ -12,7 +12,7 @@ export { default as Toggle } from './Toggle.vue';
|
|
|
12
12
|
* fill rather than the same wash.
|
|
13
13
|
*/
|
|
14
14
|
export const toggleBaseClasses =
|
|
15
|
-
'inline-flex items-center justify-center gap-2 label-
|
|
15
|
+
'inline-flex items-center justify-center gap-2 label-s-medium transition-colors ui-focus-ring hover-layer hover-layer-subtle disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-transparent text-content-on-surface-primary';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* The variants themselves, shared with the toggle group so the two cannot drift
|
|
@@ -35,7 +35,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
35
35
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
36
36
|
:class="
|
|
37
37
|
cn(
|
|
38
|
-
'z-50 overflow-hidden rounded-md bg-inverse px-3 py-1.5 label-
|
|
38
|
+
'z-50 overflow-hidden rounded-md bg-inverse px-3 py-1.5 label-xs-regular text-inverse-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
39
39
|
props.class,
|
|
40
40
|
)
|
|
41
41
|
"
|
|
@@ -32,15 +32,15 @@ const VHoverDemo = defineComponent({
|
|
|
32
32
|
|
|
33
33
|
<div class="mb-6">
|
|
34
34
|
<h2 class="heading-s text-content-on-surface-primary mb-1">v-hover</h2>
|
|
35
|
-
<p class="body-
|
|
36
|
-
Registers as <code class="label-
|
|
37
|
-
<code class="label-
|
|
38
|
-
Injects a single overlay layer; visible on <code class="label-
|
|
39
|
-
<code class="label-
|
|
35
|
+
<p class="body-s-regular text-content-on-surface-muted max-w-2xl">
|
|
36
|
+
Registers as <code class="label-xs-medium">v-hover</code> when using
|
|
37
|
+
<code class="label-xs-medium">app.directive('hover', vHover)</code> from the library install.
|
|
38
|
+
Injects a single overlay layer; visible on <code class="label-xs-medium">:hover</code> when
|
|
39
|
+
<code class="label-xs-medium">@media (hover: hover)</code> and on <code class="label-xs-medium">:focus-visible</code>.
|
|
40
40
|
Variants map to
|
|
41
|
-
<code class="label-
|
|
42
|
-
<code class="label-
|
|
43
|
-
<code class="label-
|
|
41
|
+
<code class="label-xs-medium">--overlay-hover-subtle</code>,
|
|
42
|
+
<code class="label-xs-medium">--overlay-hover-default</code>, and
|
|
43
|
+
<code class="label-xs-medium">--overlay-hover-strong</code>.
|
|
44
44
|
Hover or Tab+focus each tile to compare intensity.
|
|
45
45
|
</p>
|
|
46
46
|
</div>
|
|
@@ -50,15 +50,15 @@ const VHoverDemo = defineComponent({
|
|
|
50
50
|
<button
|
|
51
51
|
type="button"
|
|
52
52
|
v-hover="'subtle'"
|
|
53
|
-
class="h-24 w-40 rounded-md bg-background-surface-secondary body-
|
|
53
|
+
class="h-24 w-40 rounded-md bg-background-surface-secondary body-s-medium text-content-on-surface-primary flex items-center justify-center border border-border-surface-default shadow-xs"
|
|
54
54
|
>
|
|
55
55
|
subtle
|
|
56
56
|
</button>
|
|
57
57
|
<div class="text-center">
|
|
58
|
-
<span class="label-
|
|
58
|
+
<span class="label-xs-medium text-content-on-surface-primary block">subtle</span>
|
|
59
59
|
<button
|
|
60
60
|
type="button"
|
|
61
|
-
class="copy-btn label-
|
|
61
|
+
class="copy-btn label-xs-regular text-content-on-surface-muted block mt-0.5 px-1 py-0.5 rounded border-0 bg-transparent"
|
|
62
62
|
@click="copyVHover('subtle', $event)"
|
|
63
63
|
><code>v-hover="'subtle'"</code></button>
|
|
64
64
|
</div>
|
|
@@ -68,15 +68,15 @@ const VHoverDemo = defineComponent({
|
|
|
68
68
|
<button
|
|
69
69
|
type="button"
|
|
70
70
|
v-hover="'default'"
|
|
71
|
-
class="h-24 w-40 rounded-md bg-background-surface-secondary body-
|
|
71
|
+
class="h-24 w-40 rounded-md bg-background-surface-secondary body-s-medium text-content-on-surface-primary flex items-center justify-center border border-border-surface-default shadow-xs"
|
|
72
72
|
>
|
|
73
73
|
default
|
|
74
74
|
</button>
|
|
75
75
|
<div class="text-center">
|
|
76
|
-
<span class="label-
|
|
76
|
+
<span class="label-xs-medium text-content-on-surface-primary block">default</span>
|
|
77
77
|
<button
|
|
78
78
|
type="button"
|
|
79
|
-
class="copy-btn label-
|
|
79
|
+
class="copy-btn label-xs-regular text-content-on-surface-muted block mt-0.5 px-1 py-0.5 rounded border-0 bg-transparent"
|
|
80
80
|
@click="copyVHover('default', $event)"
|
|
81
81
|
><code>v-hover="'default'"</code></button>
|
|
82
82
|
</div>
|
|
@@ -86,15 +86,15 @@ const VHoverDemo = defineComponent({
|
|
|
86
86
|
<button
|
|
87
87
|
type="button"
|
|
88
88
|
v-hover="'strong'"
|
|
89
|
-
class="h-24 w-40 rounded-md bg-background-surface-secondary body-
|
|
89
|
+
class="h-24 w-40 rounded-md bg-background-surface-secondary body-s-medium text-content-on-surface-primary flex items-center justify-center border border-border-surface-default shadow-xs"
|
|
90
90
|
>
|
|
91
91
|
strong
|
|
92
92
|
</button>
|
|
93
93
|
<div class="text-center">
|
|
94
|
-
<span class="label-
|
|
94
|
+
<span class="label-xs-medium text-content-on-surface-primary block">strong</span>
|
|
95
95
|
<button
|
|
96
96
|
type="button"
|
|
97
|
-
class="copy-btn label-
|
|
97
|
+
class="copy-btn label-xs-regular text-content-on-surface-muted block mt-0.5 px-1 py-0.5 rounded border-0 bg-transparent"
|
|
98
98
|
@click="copyVHover('strong', $event)"
|
|
99
99
|
><code>v-hover="'strong'"</code></button>
|
|
100
100
|
</div>
|
|
@@ -161,29 +161,29 @@ const { device, screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
161
161
|
template: `
|
|
162
162
|
<div class="grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)]">
|
|
163
163
|
<section class="rounded-lg border border-border-surface-default bg-background-surface-primary p-4 shadow-xs">
|
|
164
|
-
<h2 class="label-
|
|
165
|
-
<p class="body-
|
|
164
|
+
<h2 class="label-s-medium text-content-on-surface-primary">Live viewport</h2>
|
|
165
|
+
<p class="body-s-regular text-content-on-surface-muted mt-1">
|
|
166
166
|
Resize the preview iframe to see screen size and breakpoint data update.
|
|
167
167
|
</p>
|
|
168
168
|
|
|
169
169
|
<dl class="mt-4 grid grid-cols-2 gap-3">
|
|
170
170
|
<div class="rounded-md bg-background-surface-muted p-3">
|
|
171
|
-
<dt class="label-
|
|
172
|
-
<dd class="body-
|
|
171
|
+
<dt class="label-xs-medium text-content-on-surface-muted">screenSize</dt>
|
|
172
|
+
<dd class="body-s-medium text-content-on-surface-primary">
|
|
173
173
|
{{ screenSize.width ?? 'unknown' }} x {{ screenSize.height ?? 'unknown' }}
|
|
174
174
|
</dd>
|
|
175
175
|
</div>
|
|
176
176
|
<div class="rounded-md bg-background-surface-muted p-3">
|
|
177
|
-
<dt class="label-
|
|
178
|
-
<dd class="body-
|
|
177
|
+
<dt class="label-xs-medium text-content-on-surface-muted">breakpoint</dt>
|
|
178
|
+
<dd class="body-s-medium text-content-on-surface-primary">{{ breakpoint }}</dd>
|
|
179
179
|
</div>
|
|
180
180
|
<div class="rounded-md bg-background-surface-muted p-3">
|
|
181
|
-
<dt class="label-
|
|
182
|
-
<dd class="body-
|
|
181
|
+
<dt class="label-xs-medium text-content-on-surface-muted">isMobile</dt>
|
|
182
|
+
<dd class="body-s-medium text-content-on-surface-primary">{{ isMobile }}</dd>
|
|
183
183
|
</div>
|
|
184
184
|
<div class="rounded-md bg-background-surface-muted p-3">
|
|
185
|
-
<dt class="label-
|
|
186
|
-
<dd class="body-
|
|
185
|
+
<dt class="label-xs-medium text-content-on-surface-muted">isDesktop</dt>
|
|
186
|
+
<dd class="body-s-medium text-content-on-surface-primary">{{ isDesktop }}</dd>
|
|
187
187
|
</div>
|
|
188
188
|
</dl>
|
|
189
189
|
|
|
@@ -193,10 +193,10 @@ const { device, screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
193
193
|
:key="label"
|
|
194
194
|
class="grid grid-cols-[8rem_1fr] border-b border-border-surface-default last:border-b-0"
|
|
195
195
|
>
|
|
196
|
-
<span class="label-
|
|
196
|
+
<span class="label-xs-medium bg-background-surface-muted px-3 py-2 text-content-on-surface-muted">
|
|
197
197
|
{{ label }}
|
|
198
198
|
</span>
|
|
199
|
-
<span class="body-
|
|
199
|
+
<span class="body-s-regular px-3 py-2 text-content-on-surface-primary">
|
|
200
200
|
{{ value }}
|
|
201
201
|
</span>
|
|
202
202
|
</div>
|
|
@@ -204,8 +204,8 @@ const { device, screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
204
204
|
</section>
|
|
205
205
|
|
|
206
206
|
<section class="rounded-lg border border-border-surface-default bg-background-surface-primary p-4 shadow-xs">
|
|
207
|
-
<h2 class="label-
|
|
208
|
-
<p class="body-
|
|
207
|
+
<h2 class="label-s-medium text-content-on-surface-primary">User-agent examples</h2>
|
|
208
|
+
<p class="body-s-regular text-content-on-surface-muted mt-1">
|
|
209
209
|
Pass <code>userAgent</code> during SSR to derive device data without touching browser APIs.
|
|
210
210
|
</p>
|
|
211
211
|
|
|
@@ -215,15 +215,15 @@ const { device, screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
215
215
|
:key="example.label"
|
|
216
216
|
class="rounded-md border border-border-surface-default p-3"
|
|
217
217
|
>
|
|
218
|
-
<h3 class="label-
|
|
218
|
+
<h3 class="label-s-medium text-content-on-surface-primary">{{ example.label }}</h3>
|
|
219
219
|
<dl class="mt-3 grid gap-1">
|
|
220
220
|
<div
|
|
221
221
|
v-for="[label, value] in example.rows"
|
|
222
222
|
:key="label"
|
|
223
223
|
class="flex justify-between gap-4"
|
|
224
224
|
>
|
|
225
|
-
<dt class="label-
|
|
226
|
-
<dd class="body-
|
|
225
|
+
<dt class="label-xs-medium text-content-on-surface-muted">{{ label }}</dt>
|
|
226
|
+
<dd class="body-s-regular text-content-on-surface-primary">{{ value }}</dd>
|
|
227
227
|
</div>
|
|
228
228
|
</dl>
|
|
229
229
|
</article>
|
|
@@ -311,8 +311,8 @@ const { screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
311
311
|
template: `
|
|
312
312
|
<div class="rounded-lg border border-border-surface-default bg-background-surface-primary p-4 shadow-xs">
|
|
313
313
|
<div class="mb-4">
|
|
314
|
-
<h2 class="label-
|
|
315
|
-
<p class="body-
|
|
314
|
+
<h2 class="label-s-medium text-content-on-surface-primary">Live device detector</h2>
|
|
315
|
+
<p class="body-s-regular text-content-on-surface-muted mt-1">
|
|
316
316
|
Drag the resize handle. The left panel acts as a local viewport and dispatches
|
|
317
317
|
resize updates to <code>useDevice()</code>.
|
|
318
318
|
</p>
|
|
@@ -329,11 +329,11 @@ const { screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
329
329
|
>
|
|
330
330
|
<div class="flex h-full min-w-0 flex-col gap-4 overflow-auto p-4">
|
|
331
331
|
<div class="rounded-md bg-background-surface-muted p-3">
|
|
332
|
-
<span class="label-
|
|
332
|
+
<span class="label-xs-medium text-content-on-surface-muted">Resizable viewport</span>
|
|
333
333
|
<p class="heading-s text-content-on-surface-primary">
|
|
334
334
|
{{ screenSize.width ?? 'unknown' }}px
|
|
335
335
|
</p>
|
|
336
|
-
<p class="body-
|
|
336
|
+
<p class="body-s-regular text-content-on-surface-muted">
|
|
337
337
|
Panel size: {{ detectorPanelSize }}%
|
|
338
338
|
</p>
|
|
339
339
|
</div>
|
|
@@ -352,8 +352,8 @@ const { screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
352
352
|
:key="label"
|
|
353
353
|
class="flex justify-between gap-4 rounded-md bg-background-surface-muted px-3 py-2"
|
|
354
354
|
>
|
|
355
|
-
<dt class="label-
|
|
356
|
-
<dd class="body-
|
|
355
|
+
<dt class="label-xs-medium text-content-on-surface-muted">{{ label }}</dt>
|
|
356
|
+
<dd class="body-s-regular text-content-on-surface-primary">{{ value }}</dd>
|
|
357
357
|
</div>
|
|
358
358
|
</dl>
|
|
359
359
|
</UiAccordionContent>
|
|
@@ -368,8 +368,8 @@ const { screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
368
368
|
:key="label"
|
|
369
369
|
class="flex justify-between gap-4 rounded-md bg-background-surface-muted px-3 py-2"
|
|
370
370
|
>
|
|
371
|
-
<dt class="label-
|
|
372
|
-
<dd class="body-
|
|
371
|
+
<dt class="label-xs-medium text-content-on-surface-muted">{{ label }}</dt>
|
|
372
|
+
<dd class="body-s-regular text-content-on-surface-primary">{{ value }}</dd>
|
|
373
373
|
</div>
|
|
374
374
|
</dl>
|
|
375
375
|
</UiAccordionContent>
|
|
@@ -378,7 +378,7 @@ const { screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
378
378
|
<UiAccordionItem value="user-agent">
|
|
379
379
|
<UiAccordionTrigger>Raw user agent</UiAccordionTrigger>
|
|
380
380
|
<UiAccordionContent>
|
|
381
|
-
<p class="body-
|
|
381
|
+
<p class="body-s-regular break-all rounded-md bg-background-surface-muted p-3 text-content-on-surface-primary">
|
|
382
382
|
{{ userAgent || 'unknown' }}
|
|
383
383
|
</p>
|
|
384
384
|
</UiAccordionContent>
|
|
@@ -391,12 +391,12 @@ const { screenSize, breakpoint, isMobile, isDesktop } = useDevice();
|
|
|
391
391
|
|
|
392
392
|
<UiResizablePanel :default-size="50" :min-size="25">
|
|
393
393
|
<div class="flex h-full flex-col justify-center gap-3 p-4">
|
|
394
|
-
<h3 class="label-
|
|
395
|
-
<p class="body-
|
|
394
|
+
<h3 class="label-s-medium text-content-on-surface-primary">Resize detector</h3>
|
|
395
|
+
<p class="body-s-regular text-content-on-surface-muted">
|
|
396
396
|
This panel is only here to give the detector panel room to grow and shrink.
|
|
397
397
|
Crossing 640px flips the detector between mobile and desktop.
|
|
398
398
|
</p>
|
|
399
|
-
<p class="body-
|
|
399
|
+
<p class="body-s-regular rounded-md bg-background-surface-muted p-3 text-content-on-surface-primary">
|
|
400
400
|
Current detector width: {{ detectorWidth }}px
|
|
401
401
|
</p>
|
|
402
402
|
</div>
|
|
@@ -130,7 +130,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
130
130
|
|
|
131
131
|
<template>
|
|
132
132
|
<div class="max-w-md space-y-3">
|
|
133
|
-
<p class="text-content-on-surface-muted body-
|
|
133
|
+
<p class="text-content-on-surface-muted body-s-regular">
|
|
134
134
|
Drag an item over another item. The helper keeps the native drag data,
|
|
135
135
|
creates an empty bordered ghost, and reorders on drop.
|
|
136
136
|
</p>
|
|
@@ -140,7 +140,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
140
140
|
:key="item.id"
|
|
141
141
|
draggable="true"
|
|
142
142
|
:class="[
|
|
143
|
-
'rounded-md border border-border-surface-default bg-background-surface-primary px-3 py-2 body-
|
|
143
|
+
'rounded-md border border-border-surface-default bg-background-surface-primary px-3 py-2 body-s-regular transition-[border-color,opacity,transform]',
|
|
144
144
|
draggedItemId === item.id ? 'opacity-50' : undefined,
|
|
145
145
|
activeItemId === item.id ? 'border-border-surface-focus-ring' : undefined,
|
|
146
146
|
]"
|
|
@@ -152,12 +152,12 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
152
152
|
{{ item.label }}
|
|
153
153
|
</div>
|
|
154
154
|
</div>
|
|
155
|
-
<div class="text-content-on-surface-muted grid gap-1 label-
|
|
155
|
+
<div class="text-content-on-surface-muted grid gap-1 label-xs-regular">
|
|
156
156
|
<span>Dragged item: {{ draggedItem?.label ?? 'none' }}</span>
|
|
157
157
|
<span>Active item: {{ activeItem?.label ?? 'none' }}</span>
|
|
158
158
|
<span>Original order: {{ originalItems?.map((item) => item.id).join(' -> ') ?? 'none' }}</span>
|
|
159
159
|
</div>
|
|
160
|
-
<pre class="rounded-md bg-background-surface-muted p-3 label-
|
|
160
|
+
<pre class="rounded-md bg-background-surface-muted p-3 label-xs-regular">{{ items.map((item) => item.id).join(' -> ') }}</pre>
|
|
161
161
|
</div>
|
|
162
162
|
</template>`,
|
|
163
163
|
},
|
|
@@ -201,7 +201,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
201
201
|
},
|
|
202
202
|
template: `
|
|
203
203
|
<div class="max-w-md space-y-3">
|
|
204
|
-
<p class="text-content-on-surface-muted body-
|
|
204
|
+
<p class="text-content-on-surface-muted body-s-regular">
|
|
205
205
|
Drag an item over another item. The helper keeps the native drag data,
|
|
206
206
|
creates an empty bordered ghost, and reorders on drop.
|
|
207
207
|
</p>
|
|
@@ -211,7 +211,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
211
211
|
:key="item.id"
|
|
212
212
|
draggable="true"
|
|
213
213
|
:class="[
|
|
214
|
-
'rounded-md border border-border-surface-default bg-background-surface-primary px-3 py-2 body-
|
|
214
|
+
'rounded-md border border-border-surface-default bg-background-surface-primary px-3 py-2 body-s-regular transition-[border-color,opacity,transform]',
|
|
215
215
|
draggedItemId === item.id ? 'opacity-50' : undefined,
|
|
216
216
|
activeItemId === item.id ? 'border-border-surface-focus-ring' : undefined,
|
|
217
217
|
]"
|
|
@@ -223,12 +223,12 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
223
223
|
{{ item.label }}
|
|
224
224
|
</div>
|
|
225
225
|
</div>
|
|
226
|
-
<div class="text-content-on-surface-muted grid gap-1 label-
|
|
226
|
+
<div class="text-content-on-surface-muted grid gap-1 label-xs-regular">
|
|
227
227
|
<span>Dragged item: {{ draggedItem?.label ?? 'none' }}</span>
|
|
228
228
|
<span>Active item: {{ activeItem?.label ?? 'none' }}</span>
|
|
229
229
|
<span>Original order: {{ originalItems?.map((item) => item.id).join(' -> ') ?? 'none' }}</span>
|
|
230
230
|
</div>
|
|
231
|
-
<pre class="rounded-md bg-background-surface-muted p-3 label-
|
|
231
|
+
<pre class="rounded-md bg-background-surface-muted p-3 label-xs-regular">{{ items.map((item) => item.id).join(' -> ') }}</pre>
|
|
232
232
|
</div>
|
|
233
233
|
`,
|
|
234
234
|
}),
|
|
@@ -239,7 +239,7 @@ export const VerticalCards: Story = {
|
|
|
239
239
|
setup: setupCardDragStory,
|
|
240
240
|
template: `
|
|
241
241
|
<div class="max-w-lg space-y-3">
|
|
242
|
-
<p class="text-content-on-surface-muted body-
|
|
242
|
+
<p class="text-content-on-surface-muted body-s-regular">
|
|
243
243
|
Vertical card sorting with model-backed drop handling.
|
|
244
244
|
</p>
|
|
245
245
|
<div class="space-y-3">
|
|
@@ -257,8 +257,8 @@ export const VerticalCards: Story = {
|
|
|
257
257
|
@drop="onDrop($event, item.id)"
|
|
258
258
|
@dragend="resetDragState"
|
|
259
259
|
>
|
|
260
|
-
<h3 class="label-
|
|
261
|
-
<p class="text-content-on-surface-muted mt-1 body-
|
|
260
|
+
<h3 class="label-s-medium text-content-on-surface-primary">{{ item.label }}</h3>
|
|
261
|
+
<p class="text-content-on-surface-muted mt-1 body-s-regular">{{ item.description }}</p>
|
|
262
262
|
</article>
|
|
263
263
|
</div>
|
|
264
264
|
</div>
|
|
@@ -271,7 +271,7 @@ export const GridCards: Story = {
|
|
|
271
271
|
setup: setupCardDragStory,
|
|
272
272
|
template: `
|
|
273
273
|
<div class="max-w-3xl space-y-3">
|
|
274
|
-
<p class="text-content-on-surface-muted body-
|
|
274
|
+
<p class="text-content-on-surface-muted body-s-regular">
|
|
275
275
|
Grid card sorting uses the same active-item model and default drop reorder.
|
|
276
276
|
</p>
|
|
277
277
|
<div class="grid gap-3 sm:grid-cols-2">
|
|
@@ -289,8 +289,8 @@ export const GridCards: Story = {
|
|
|
289
289
|
@drop="onDrop($event, item.id)"
|
|
290
290
|
@dragend="resetDragState"
|
|
291
291
|
>
|
|
292
|
-
<h3 class="label-
|
|
293
|
-
<p class="text-content-on-surface-muted mt-2 body-
|
|
292
|
+
<h3 class="label-s-medium text-content-on-surface-primary">{{ item.label }}</h3>
|
|
293
|
+
<p class="text-content-on-surface-muted mt-2 body-s-regular">{{ item.description }}</p>
|
|
294
294
|
</article>
|
|
295
295
|
</div>
|
|
296
296
|
</div>
|
|
@@ -727,7 +727,7 @@ function handleColumnOrderChange(nextOrder: string[]) {
|
|
|
727
727
|
draggable-columns
|
|
728
728
|
:on-column-order-change="handleColumnOrderChange"
|
|
729
729
|
/>
|
|
730
|
-
<p class="body-
|
|
730
|
+
<p class="body-s-regular text-content-on-surface-muted">
|
|
731
731
|
Drag a column header to reorder columns.
|
|
732
732
|
<span v-if="columnOrder.length">
|
|
733
733
|
Current order: {{ columnOrder.join(', ') }}
|
|
@@ -821,7 +821,7 @@ const columns: ColumnDef<Payment>[] = [
|
|
|
821
821
|
<template>
|
|
822
822
|
<UiDataTable :data="data" :columns="columns" :get-row-can-expand="() => true">
|
|
823
823
|
<template #expanded-row="{ row }">
|
|
824
|
-
<div class="body-
|
|
824
|
+
<div class="body-s-regular rounded-md bg-background-surface-muted p-4">
|
|
825
825
|
Payment {{ row.original.id }} belongs to {{ row.original.email }}.
|
|
826
826
|
</div>
|
|
827
827
|
</template>
|
|
@@ -1231,7 +1231,7 @@ export const WithDraggableColumns: Story = {
|
|
|
1231
1231
|
v-bind="args"
|
|
1232
1232
|
:on-column-order-change="handleColumnOrderChange"
|
|
1233
1233
|
/>
|
|
1234
|
-
<p class="body-
|
|
1234
|
+
<p class="body-s-regular text-content-on-surface-muted">
|
|
1235
1235
|
Drag a column header to reorder columns.
|
|
1236
1236
|
<span v-if="columnOrder.length">
|
|
1237
1237
|
Current order: {{ columnOrder.join(', ') }}
|
|
@@ -1269,7 +1269,7 @@ export const WithExpandableRows: Story = {
|
|
|
1269
1269
|
template: `
|
|
1270
1270
|
<UiDataTable v-bind="args">
|
|
1271
1271
|
<template #expanded-row="{ row }">
|
|
1272
|
-
<div class="body-
|
|
1272
|
+
<div class="body-s-regular rounded-md bg-background-surface-muted p-4">
|
|
1273
1273
|
<p class="font-medium">Payment {{ row.original.id }}</p>
|
|
1274
1274
|
<p class="text-content-on-surface-muted">
|
|
1275
1275
|
Customer: {{ row.original.email }} - Status: {{ row.original.status }}
|
|
@@ -1920,7 +1920,7 @@ const cellFormattingColumns: ColumnDef<Payment>[] = [
|
|
|
1920
1920
|
cell: ({ row }) =>
|
|
1921
1921
|
h(
|
|
1922
1922
|
'div',
|
|
1923
|
-
{ class: 'body-
|
|
1923
|
+
{ class: 'body-s-regular font-mono lowercase' },
|
|
1924
1924
|
row.getValue('email'),
|
|
1925
1925
|
),
|
|
1926
1926
|
size: 250,
|
|
@@ -1990,7 +1990,7 @@ const columns: ColumnDef<Payment>[] = [
|
|
|
1990
1990
|
header: 'Email',
|
|
1991
1991
|
// Monospace font for emails
|
|
1992
1992
|
cell: ({ row }) => h('div', {
|
|
1993
|
-
class: 'body-
|
|
1993
|
+
class: 'body-s-regular font-mono lowercase'
|
|
1994
1994
|
}, row.getValue('email')),
|
|
1995
1995
|
},
|
|
1996
1996
|
{
|
|
@@ -2103,7 +2103,7 @@ const clickedRow = ref<Payment | null>(null);
|
|
|
2103
2103
|
:columns="columns"
|
|
2104
2104
|
:on-row-click="(row) => (clickedRow = row)"
|
|
2105
2105
|
/>
|
|
2106
|
-
<div v-if="clickedRow" class="body-
|
|
2106
|
+
<div v-if="clickedRow" class="body-s-regular mt-4 rounded border p-3">
|
|
2107
2107
|
Clicked: {{ clickedRow.email }} - {{ clickedRow.status }}
|
|
2108
2108
|
</div>
|
|
2109
2109
|
</template>`;
|
|
@@ -2135,10 +2135,10 @@ export const WithRowClick: Story = {
|
|
|
2135
2135
|
template: `
|
|
2136
2136
|
<div>
|
|
2137
2137
|
<UiDataTable v-bind="args" :on-row-click="handleRowClick" />
|
|
2138
|
-
<div v-if="clickedRow" class="body-
|
|
2138
|
+
<div v-if="clickedRow" class="body-s-regular mt-4 rounded border p-3">
|
|
2139
2139
|
Clicked: <strong>{{ clickedRow.email }}</strong> - {{ clickedRow.status }} - {{ new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(clickedRow.amount) }}
|
|
2140
2140
|
</div>
|
|
2141
|
-
<div v-else class="body-
|
|
2141
|
+
<div v-else class="body-s-regular text-content-on-surface-muted mt-4">Click a row to see its data</div>
|
|
2142
2142
|
</div>
|
|
2143
2143
|
`,
|
|
2144
2144
|
}),
|
|
@@ -2604,10 +2604,10 @@ export const Accessibility: Story = {
|
|
|
2604
2604
|
|
|
2605
2605
|
<div class="flex flex-col gap-6">
|
|
2606
2606
|
<div class="flex flex-col gap-2">
|
|
2607
|
-
<h3 class="body-
|
|
2607
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2608
2608
|
Give every column a clear, unique header
|
|
2609
2609
|
</h3>
|
|
2610
|
-
<p class="body-
|
|
2610
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2611
2611
|
Column headers are exposed as <code>columnheader</code> cells and
|
|
2612
2612
|
become the accessible name for the data in that column. Keep them
|
|
2613
2613
|
concise and descriptive so screen-reader users can understand the
|
|
@@ -2616,10 +2616,10 @@ export const Accessibility: Story = {
|
|
|
2616
2616
|
</div>
|
|
2617
2617
|
|
|
2618
2618
|
<div class="flex flex-col gap-2">
|
|
2619
|
-
<h3 class="body-
|
|
2619
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2620
2620
|
Label sort controls and selection checkboxes
|
|
2621
2621
|
</h3>
|
|
2622
|
-
<p class="body-
|
|
2622
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2623
2623
|
Sortable headers use <code>UiDataTableColumnHeader</code>, whose
|
|
2624
2624
|
button announces the column and its current sort state (for
|
|
2625
2625
|
example, "Status, sorted ascending"). Selection checkboxes need a
|
|
@@ -2629,10 +2629,10 @@ export const Accessibility: Story = {
|
|
|
2629
2629
|
</div>
|
|
2630
2630
|
|
|
2631
2631
|
<div class="flex flex-col gap-2">
|
|
2632
|
-
<h3 class="body-
|
|
2632
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2633
2633
|
Expandable rows
|
|
2634
2634
|
</h3>
|
|
2635
|
-
<p class="body-
|
|
2635
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2636
2636
|
Give the expand toggle a real button with an
|
|
2637
2637
|
<code>aria-expanded</code> state and a label that reflects the
|
|
2638
2638
|
action ("Expand row" / "Collapse row"). The expanded content is
|
|
@@ -2642,10 +2642,10 @@ export const Accessibility: Story = {
|
|
|
2642
2642
|
</div>
|
|
2643
2643
|
|
|
2644
2644
|
<div class="flex flex-col gap-2">
|
|
2645
|
-
<h3 class="body-
|
|
2645
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2646
2646
|
Column visibility checklist
|
|
2647
2647
|
</h3>
|
|
2648
|
-
<p class="body-
|
|
2648
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2649
2649
|
The column menu exposes each column as a checkable menu item so
|
|
2650
2650
|
assistive tech announces its checked state and lets users toggle
|
|
2651
2651
|
columns from the keyboard. Give the trigger a clear accessible
|
|
@@ -2655,10 +2655,10 @@ export const Accessibility: Story = {
|
|
|
2655
2655
|
</div>
|
|
2656
2656
|
|
|
2657
2657
|
<div class="flex flex-col gap-2">
|
|
2658
|
-
<h3 class="body-
|
|
2658
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2659
2659
|
Row actions and filter menus
|
|
2660
2660
|
</h3>
|
|
2661
|
-
<p class="body-
|
|
2661
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2662
2662
|
Row action and filter popovers are menus: the trigger needs an
|
|
2663
2663
|
accessible name (for example "Open menu" or "Toggle Filters"),
|
|
2664
2664
|
opens on Enter/Space, and its items are reachable with the arrow
|
|
@@ -2669,10 +2669,10 @@ export const Accessibility: Story = {
|
|
|
2669
2669
|
</div>
|
|
2670
2670
|
|
|
2671
2671
|
<div class="flex flex-col gap-2">
|
|
2672
|
-
<h3 class="body-
|
|
2672
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2673
2673
|
Draggable columns
|
|
2674
2674
|
</h3>
|
|
2675
|
-
<p class="body-
|
|
2675
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2676
2676
|
Reordering must not rely on a pointer alone. A draggable header is
|
|
2677
2677
|
focusable and can be moved with the Arrow Left / Arrow Right keys,
|
|
2678
2678
|
and a focus indicator marks the column being moved so keyboard and
|
|
@@ -2681,10 +2681,10 @@ export const Accessibility: Story = {
|
|
|
2681
2681
|
</div>
|
|
2682
2682
|
|
|
2683
2683
|
<div class="flex flex-col gap-2">
|
|
2684
|
-
<h3 class="body-
|
|
2684
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2685
2685
|
Clickable rows and pagination
|
|
2686
2686
|
</h3>
|
|
2687
|
-
<p class="body-
|
|
2687
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2688
2688
|
When rows are clickable, keep the real action on a focusable
|
|
2689
2689
|
control inside the row so it is keyboard operable, and let clicks
|
|
2690
2690
|
on nested buttons, links, or checkboxes take priority over the row
|
|
@@ -2694,10 +2694,10 @@ export const Accessibility: Story = {
|
|
|
2694
2694
|
</div>
|
|
2695
2695
|
|
|
2696
2696
|
<div class="flex flex-col gap-2">
|
|
2697
|
-
<h3 class="body-
|
|
2697
|
+
<h3 class="body-m-medium text-content-on-surface-primary">
|
|
2698
2698
|
Enable the accessibility theme
|
|
2699
2699
|
</h3>
|
|
2700
|
-
<p class="body-
|
|
2700
|
+
<p class="body-m-regular text-content-on-surface-primary">
|
|
2701
2701
|
When accessibility is required, enable our accessibility theme. It
|
|
2702
2702
|
increases contrast so table text and controls meet color-contrast
|
|
2703
2703
|
requirements.
|
|
@@ -2707,7 +2707,7 @@ export const Accessibility: Story = {
|
|
|
2707
2707
|
|
|
2708
2708
|
<div class="grid gap-4 md:grid-cols-2">
|
|
2709
2709
|
<div class="flex flex-col gap-3">
|
|
2710
|
-
<h3 class="label-
|
|
2710
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
2711
2711
|
Default
|
|
2712
2712
|
</h3>
|
|
2713
2713
|
<div class="border border-border-surface-default p-4">
|
|
@@ -2716,7 +2716,7 @@ export const Accessibility: Story = {
|
|
|
2716
2716
|
</div>
|
|
2717
2717
|
|
|
2718
2718
|
<div class="accessible-theme flex flex-col gap-3">
|
|
2719
|
-
<h3 class="label-
|
|
2719
|
+
<h3 class="label-m-medium text-center text-content-on-surface-primary">
|
|
2720
2720
|
Accessible
|
|
2721
2721
|
</h3>
|
|
2722
2722
|
<div class="border border-border-surface-default p-4">
|