Fix Storybook a11y violations
This commit is contained in:
@@ -149,7 +149,15 @@ const routingColumns: DataTableColumn<RoutingLaneRow>[] = [
|
|||||||
accessor: "state",
|
accessor: "state",
|
||||||
cell: (row) => (
|
cell: (row) => (
|
||||||
<div className="flex flex-wrap items-center gap-3">
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
<Badge size="sm" tone={getStateTone(row.state)} variant="solid">
|
<Badge
|
||||||
|
size="sm"
|
||||||
|
style={{
|
||||||
|
backgroundColor: "var(--color-background)",
|
||||||
|
color: "var(--color-foreground)"
|
||||||
|
}}
|
||||||
|
tone={getStateTone(row.state)}
|
||||||
|
variant="outline"
|
||||||
|
>
|
||||||
{row.state}
|
{row.state}
|
||||||
</Badge>
|
</Badge>
|
||||||
<span className="text-xs uppercase tracking-[var(--tracking-caps)] text-[var(--color-muted-foreground)]">
|
<span className="text-xs uppercase tracking-[var(--tracking-caps)] text-[var(--color-muted-foreground)]">
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const Playground: Story = {
|
|||||||
render: () => (
|
render: () => (
|
||||||
<div className="w-[320px]">
|
<div className="w-[320px]">
|
||||||
<Select defaultValue="editorial">
|
<Select defaultValue="editorial">
|
||||||
<SelectTrigger>
|
<SelectTrigger aria-label="Review lane">
|
||||||
<SelectValue placeholder="Choose a review lane" />
|
<SelectValue placeholder="Choose a review lane" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
|
|||||||
@@ -31,7 +31,14 @@ export default meta;
|
|||||||
|
|
||||||
type Story = StoryObj<typeof meta>;
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
export const Playground: Story = {};
|
export const Playground: Story = {
|
||||||
|
render: (args) => (
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<Switch id="switch-playground" {...args} />
|
||||||
|
<Label htmlFor="switch-playground">Live publishing</Label>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
export const States: Story = {
|
export const States: Story = {
|
||||||
render: () => (
|
render: () => (
|
||||||
|
|||||||
@@ -125,7 +125,11 @@ function SkinPanel({
|
|||||||
<span className="text-sm font-medium text-[var(--color-foreground)]">
|
<span className="text-sm font-medium text-[var(--color-foreground)]">
|
||||||
Preview controls
|
Preview controls
|
||||||
</span>
|
</span>
|
||||||
<Switch checked={enabled} onCheckedChange={setEnabled} />
|
<Switch
|
||||||
|
aria-label={`${skinDetails[name].label} preview controls`}
|
||||||
|
checked={enabled}
|
||||||
|
onCheckedChange={setEnabled}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Input
|
<Input
|
||||||
aria-label={`${name} skin search`}
|
aria-label={`${name} skin search`}
|
||||||
|
|||||||
@@ -112,12 +112,19 @@ function ComparisonCell({
|
|||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="grid gap-3">
|
<CardContent className="grid gap-3">
|
||||||
<Input defaultValue="Launch notes approved" readOnly />
|
<Input
|
||||||
|
aria-label={`${motionPack} ${skin} release note status`}
|
||||||
|
defaultValue="Launch notes approved"
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
<div className="flex items-center justify-between gap-3">
|
<div className="flex items-center justify-between gap-3">
|
||||||
<span className="text-sm text-[var(--color-muted-foreground)]">
|
<span className="text-sm text-[var(--color-muted-foreground)]">
|
||||||
Quiet notifications
|
Quiet notifications
|
||||||
</span>
|
</span>
|
||||||
<Switch checked />
|
<Switch
|
||||||
|
aria-label={`${motionPack} ${skin} quiet notifications`}
|
||||||
|
checked
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap gap-3">
|
<div className="flex flex-wrap gap-3">
|
||||||
<Button>Primary</Button>
|
<Button>Primary</Button>
|
||||||
|
|||||||
@@ -164,7 +164,7 @@
|
|||||||
);
|
);
|
||||||
--ui-button-primary-bg: color-mix(in oklch, var(--color-primary) 72%, white 28%);
|
--ui-button-primary-bg: color-mix(in oklch, var(--color-primary) 72%, white 28%);
|
||||||
--ui-button-primary-hover-bg: color-mix(in oklch, var(--color-primary) 78%, white 22%);
|
--ui-button-primary-hover-bg: color-mix(in oklch, var(--color-primary) 78%, white 22%);
|
||||||
--ui-button-primary-fg: var(--color-primary-foreground);
|
--ui-button-primary-fg: var(--color-foreground);
|
||||||
--ui-button-primary-border: color-mix(in oklch, white 28%, var(--color-primary));
|
--ui-button-primary-border: color-mix(in oklch, white 28%, var(--color-primary));
|
||||||
--ui-button-primary-shadow: 0 16px 34px oklch(0.24 0.06 250 / 0.18);
|
--ui-button-primary-shadow: 0 16px 34px oklch(0.24 0.06 250 / 0.18);
|
||||||
--ui-button-secondary-bg: color-mix(in oklch, var(--color-secondary) 52%, transparent);
|
--ui-button-secondary-bg: color-mix(in oklch, var(--color-secondary) 52%, transparent);
|
||||||
|
|||||||
Reference in New Issue
Block a user