@dillingerstaffing/strand-ui 0.1.0 → 0.2.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/LICENSE +21 -0
- package/dist/components/Alert/Alert.d.ts +16 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -0
- package/dist/components/Alert/index.d.ts +3 -0
- package/dist/components/Alert/index.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +16 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +18 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/index.d.ts +3 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +16 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb/index.d.ts +3 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +22 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +12 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +20 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Container/Container.d.ts +10 -0
- package/dist/components/Container/Container.d.ts.map +1 -0
- package/dist/components/Container/index.d.ts +3 -0
- package/dist/components/Container/index.d.ts.map +1 -0
- package/dist/components/DataReadout/DataReadout.d.ts +12 -0
- package/dist/components/DataReadout/DataReadout.d.ts.map +1 -0
- package/dist/components/DataReadout/index.d.ts +3 -0
- package/dist/components/DataReadout/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +20 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/index.d.ts +3 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Divider/Divider.d.ts +13 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/index.d.ts +3 -0
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/FormField/FormField.d.ts +22 -0
- package/dist/components/FormField/FormField.d.ts.map +1 -0
- package/dist/components/FormField/index.d.ts +3 -0
- package/dist/components/FormField/index.d.ts.map +1 -0
- package/dist/components/Grid/Grid.d.ts +12 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Grid/index.d.ts +3 -0
- package/dist/components/Grid/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +18 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Link/Link.d.ts +12 -0
- package/dist/components/Link/Link.d.ts.map +1 -0
- package/dist/components/Link/index.d.ts +3 -0
- package/dist/components/Link/index.d.ts.map +1 -0
- package/dist/components/Nav/Nav.d.ts +19 -0
- package/dist/components/Nav/Nav.d.ts.map +1 -0
- package/dist/components/Nav/index.d.ts +3 -0
- package/dist/components/Nav/index.d.ts.map +1 -0
- package/dist/components/Progress/Progress.d.ts +14 -0
- package/dist/components/Progress/Progress.d.ts.map +1 -0
- package/dist/components/Progress/index.d.ts +3 -0
- package/dist/components/Progress/index.d.ts.map +1 -0
- package/dist/components/Radio/Radio.d.ts +22 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Section/Section.d.ts +12 -0
- package/dist/components/Section/Section.d.ts.map +1 -0
- package/dist/components/Section/index.d.ts +3 -0
- package/dist/components/Section/index.d.ts.map +1 -0
- package/dist/components/Select/Select.d.ts +24 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +14 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/Skeleton/index.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +20 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Slider/index.d.ts +3 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.d.ts +10 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/index.d.ts +3 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Stack/Stack.d.ts +18 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Stack/index.d.ts +3 -0
- package/dist/components/Stack/index.d.ts.map +1 -0
- package/dist/components/Switch/Switch.d.ts +18 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +24 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +19 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tag/Tag.d.ts +18 -0
- package/dist/components/Tag/Tag.d.ts.map +1 -0
- package/dist/components/Tag/index.d.ts +3 -0
- package/dist/components/Tag/index.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +22 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea/index.d.ts +3 -0
- package/dist/components/Textarea/index.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts +33 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/css/strand-ui.css +2464 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/package.json +25 -11
- package/src/__tests__/build-output.test.ts +200 -0
- package/src/__tests__/design-language.test.ts +137 -0
- package/src/__tests__/static.test.tsx +60 -0
- package/src/components/Alert/Alert.css +75 -0
- package/src/components/Alert/Alert.test.tsx +92 -0
- package/src/components/Alert/Alert.tsx +59 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Avatar/Avatar.css +55 -0
- package/src/components/Avatar/Avatar.test.tsx +123 -0
- package/src/components/Avatar/Avatar.tsx +67 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Badge/Badge.css +72 -0
- package/src/components/Badge/Badge.test.tsx +121 -0
- package/src/components/Badge/Badge.tsx +92 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Breadcrumb/Breadcrumb.css +50 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +107 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +59 -0
- package/src/components/Breadcrumb/index.ts +2 -0
- package/src/components/Button/Button.css +195 -0
- package/src/components/Button/Button.test.tsx +171 -0
- package/src/components/Button/Button.tsx +78 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Card/Card.css +68 -0
- package/src/components/Card/Card.test.tsx +90 -0
- package/src/components/Card/Card.tsx +41 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.css +97 -0
- package/src/components/Checkbox/Checkbox.test.tsx +92 -0
- package/src/components/Checkbox/Checkbox.tsx +137 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/Container/Container.css +25 -0
- package/src/components/Container/Container.test.tsx +82 -0
- package/src/components/Container/Container.tsx +37 -0
- package/src/components/Container/index.ts +2 -0
- package/src/components/DataReadout/DataReadout.css +30 -0
- package/src/components/DataReadout/DataReadout.test.tsx +105 -0
- package/src/components/DataReadout/DataReadout.tsx +29 -0
- package/src/components/DataReadout/index.ts +2 -0
- package/src/components/Dialog/Dialog.css +81 -0
- package/src/components/Dialog/Dialog.test.tsx +203 -0
- package/src/components/Dialog/Dialog.tsx +179 -0
- package/src/components/Dialog/index.ts +2 -0
- package/src/components/Divider/Divider.css +44 -0
- package/src/components/Divider/Divider.test.tsx +86 -0
- package/src/components/Divider/Divider.tsx +81 -0
- package/src/components/Divider/index.ts +2 -0
- package/src/components/FormField/FormField.css +47 -0
- package/src/components/FormField/FormField.test.tsx +99 -0
- package/src/components/FormField/FormField.tsx +79 -0
- package/src/components/FormField/index.ts +2 -0
- package/src/components/Grid/Grid.css +27 -0
- package/src/components/Grid/Grid.test.tsx +86 -0
- package/src/components/Grid/Grid.tsx +45 -0
- package/src/components/Grid/index.ts +2 -0
- package/src/components/Input/Input.css +87 -0
- package/src/components/Input/Input.test.tsx +95 -0
- package/src/components/Input/Input.tsx +69 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/Link/Link.css +30 -0
- package/src/components/Link/Link.test.tsx +88 -0
- package/src/components/Link/Link.tsx +31 -0
- package/src/components/Link/index.ts +2 -0
- package/src/components/Nav/Nav.css +179 -0
- package/src/components/Nav/Nav.test.tsx +174 -0
- package/src/components/Nav/Nav.tsx +101 -0
- package/src/components/Nav/index.ts +2 -0
- package/src/components/Progress/Progress.css +93 -0
- package/src/components/Progress/Progress.test.tsx +93 -0
- package/src/components/Progress/Progress.tsx +104 -0
- package/src/components/Progress/index.ts +2 -0
- package/src/components/Radio/Radio.css +98 -0
- package/src/components/Radio/Radio.test.tsx +80 -0
- package/src/components/Radio/Radio.tsx +72 -0
- package/src/components/Radio/index.ts +2 -0
- package/src/components/Section/Section.css +28 -0
- package/src/components/Section/Section.test.tsx +100 -0
- package/src/components/Section/Section.tsx +41 -0
- package/src/components/Section/index.ts +2 -0
- package/src/components/Select/Select.css +75 -0
- package/src/components/Select/Select.test.tsx +99 -0
- package/src/components/Select/Select.tsx +78 -0
- package/src/components/Select/index.ts +2 -0
- package/src/components/Skeleton/Skeleton.css +52 -0
- package/src/components/Skeleton/Skeleton.test.tsx +96 -0
- package/src/components/Skeleton/Skeleton.tsx +55 -0
- package/src/components/Skeleton/index.ts +2 -0
- package/src/components/Slider/Slider.css +107 -0
- package/src/components/Slider/Slider.test.tsx +85 -0
- package/src/components/Slider/Slider.tsx +66 -0
- package/src/components/Slider/index.ts +2 -0
- package/src/components/Spinner/Spinner.css +61 -0
- package/src/components/Spinner/Spinner.test.tsx +56 -0
- package/src/components/Spinner/Spinner.tsx +38 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Stack/Stack.css +71 -0
- package/src/components/Stack/Stack.test.tsx +130 -0
- package/src/components/Stack/Stack.tsx +77 -0
- package/src/components/Stack/index.ts +2 -0
- package/src/components/Switch/Switch.css +94 -0
- package/src/components/Switch/Switch.test.tsx +98 -0
- package/src/components/Switch/Switch.tsx +80 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Table/Table.css +83 -0
- package/src/components/Table/Table.test.tsx +134 -0
- package/src/components/Table/Table.tsx +102 -0
- package/src/components/Table/index.ts +2 -0
- package/src/components/Tabs/Tabs.css +51 -0
- package/src/components/Tabs/Tabs.test.tsx +164 -0
- package/src/components/Tabs/Tabs.tsx +126 -0
- package/src/components/Tabs/index.ts +2 -0
- package/src/components/Tag/Tag.css +98 -0
- package/src/components/Tag/Tag.test.tsx +112 -0
- package/src/components/Tag/Tag.tsx +73 -0
- package/src/components/Tag/index.ts +2 -0
- package/src/components/Textarea/Textarea.css +80 -0
- package/src/components/Textarea/Textarea.test.tsx +89 -0
- package/src/components/Textarea/Textarea.tsx +102 -0
- package/src/components/Textarea/index.ts +2 -0
- package/src/components/Toast/Toast.css +103 -0
- package/src/components/Toast/Toast.test.tsx +219 -0
- package/src/components/Toast/Toast.tsx +177 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/Tooltip/Tooltip.css +63 -0
- package/src/components/Tooltip/Tooltip.test.tsx +196 -0
- package/src/components/Tooltip/Tooltip.tsx +89 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/index.ts +99 -0
- package/src/static.css +47 -0
- package/src/test-setup.ts +7 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { render, fireEvent } from "@testing-library/preact";
|
|
3
|
+
import { Tabs } from "./Tabs.js";
|
|
4
|
+
|
|
5
|
+
const sampleTabs = [
|
|
6
|
+
{ id: "one", label: "Tab One", content: <div>Content One</div> },
|
|
7
|
+
{ id: "two", label: "Tab Two", content: <div>Content Two</div> },
|
|
8
|
+
{ id: "three", label: "Tab Three", content: <div>Content Three</div> },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
describe("Tabs", () => {
|
|
12
|
+
// ── Structure ──
|
|
13
|
+
|
|
14
|
+
it("renders tablist role", () => {
|
|
15
|
+
const { getByRole } = render(
|
|
16
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={() => {}} />,
|
|
17
|
+
);
|
|
18
|
+
expect(getByRole("tablist")).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("renders tab buttons for each tab", () => {
|
|
22
|
+
const { getAllByRole } = render(
|
|
23
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={() => {}} />,
|
|
24
|
+
);
|
|
25
|
+
expect(getAllByRole("tab")).toHaveLength(3);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// ── Active state ──
|
|
29
|
+
|
|
30
|
+
it("active tab has aria-selected true", () => {
|
|
31
|
+
const { getAllByRole } = render(
|
|
32
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={() => {}} />,
|
|
33
|
+
);
|
|
34
|
+
const tabs = getAllByRole("tab");
|
|
35
|
+
expect(tabs[0]).toHaveAttribute("aria-selected", "true");
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("inactive tabs have aria-selected false", () => {
|
|
39
|
+
const { getAllByRole } = render(
|
|
40
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={() => {}} />,
|
|
41
|
+
);
|
|
42
|
+
const tabs = getAllByRole("tab");
|
|
43
|
+
expect(tabs[1]).toHaveAttribute("aria-selected", "false");
|
|
44
|
+
expect(tabs[2]).toHaveAttribute("aria-selected", "false");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("active tab has tabindex 0, inactive tabs have tabindex -1", () => {
|
|
48
|
+
const { getAllByRole } = render(
|
|
49
|
+
<Tabs tabs={sampleTabs} activeTab="two" onChange={() => {}} />,
|
|
50
|
+
);
|
|
51
|
+
const tabs = getAllByRole("tab");
|
|
52
|
+
expect(tabs[0]).toHaveAttribute("tabindex", "-1");
|
|
53
|
+
expect(tabs[1]).toHaveAttribute("tabindex", "0");
|
|
54
|
+
expect(tabs[2]).toHaveAttribute("tabindex", "-1");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// ── Interaction ──
|
|
58
|
+
|
|
59
|
+
it("clicking tab calls onChange with the tab id", () => {
|
|
60
|
+
const onChange = vi.fn();
|
|
61
|
+
const { getAllByRole } = render(
|
|
62
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={onChange} />,
|
|
63
|
+
);
|
|
64
|
+
fireEvent.click(getAllByRole("tab")[1]);
|
|
65
|
+
expect(onChange).toHaveBeenCalledWith("two");
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// ── Panels ──
|
|
69
|
+
|
|
70
|
+
it("active panel is visible", () => {
|
|
71
|
+
const { getByText } = render(
|
|
72
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={() => {}} />,
|
|
73
|
+
);
|
|
74
|
+
expect(getByText("Content One").closest("[role='tabpanel']")).not.toHaveAttribute("hidden");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("inactive panels are hidden", () => {
|
|
78
|
+
const { getByText } = render(
|
|
79
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={() => {}} />,
|
|
80
|
+
);
|
|
81
|
+
expect(getByText("Content Two").closest("[role='tabpanel']")).toHaveAttribute("hidden");
|
|
82
|
+
expect(getByText("Content Three").closest("[role='tabpanel']")).toHaveAttribute("hidden");
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("tabpanel has aria-labelledby pointing to its tab", () => {
|
|
86
|
+
const { getAllByRole } = render(
|
|
87
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={() => {}} />,
|
|
88
|
+
);
|
|
89
|
+
const panels = getAllByRole("tabpanel", { hidden: true });
|
|
90
|
+
expect(panels[0]).toHaveAttribute("aria-labelledby", "tab-one");
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// ── Keyboard navigation ──
|
|
94
|
+
|
|
95
|
+
it("ArrowRight moves to next tab", () => {
|
|
96
|
+
const onChange = vi.fn();
|
|
97
|
+
const { getAllByRole } = render(
|
|
98
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={onChange} />,
|
|
99
|
+
);
|
|
100
|
+
fireEvent.keyDown(getAllByRole("tab")[0], { key: "ArrowRight" });
|
|
101
|
+
expect(onChange).toHaveBeenCalledWith("two");
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("ArrowLeft moves to previous tab", () => {
|
|
105
|
+
const onChange = vi.fn();
|
|
106
|
+
const { getAllByRole } = render(
|
|
107
|
+
<Tabs tabs={sampleTabs} activeTab="two" onChange={onChange} />,
|
|
108
|
+
);
|
|
109
|
+
fireEvent.keyDown(getAllByRole("tab")[1], { key: "ArrowLeft" });
|
|
110
|
+
expect(onChange).toHaveBeenCalledWith("one");
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("ArrowRight wraps to first tab from last", () => {
|
|
114
|
+
const onChange = vi.fn();
|
|
115
|
+
const { getAllByRole } = render(
|
|
116
|
+
<Tabs tabs={sampleTabs} activeTab="three" onChange={onChange} />,
|
|
117
|
+
);
|
|
118
|
+
fireEvent.keyDown(getAllByRole("tab")[2], { key: "ArrowRight" });
|
|
119
|
+
expect(onChange).toHaveBeenCalledWith("one");
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("ArrowLeft wraps to last tab from first", () => {
|
|
123
|
+
const onChange = vi.fn();
|
|
124
|
+
const { getAllByRole } = render(
|
|
125
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={onChange} />,
|
|
126
|
+
);
|
|
127
|
+
fireEvent.keyDown(getAllByRole("tab")[0], { key: "ArrowLeft" });
|
|
128
|
+
expect(onChange).toHaveBeenCalledWith("three");
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it("Home moves focus to first tab", () => {
|
|
132
|
+
const onChange = vi.fn();
|
|
133
|
+
const { getAllByRole } = render(
|
|
134
|
+
<Tabs tabs={sampleTabs} activeTab="three" onChange={onChange} />,
|
|
135
|
+
);
|
|
136
|
+
fireEvent.keyDown(getAllByRole("tab")[2], { key: "Home" });
|
|
137
|
+
expect(onChange).toHaveBeenCalledWith("one");
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it("End moves focus to last tab", () => {
|
|
141
|
+
const onChange = vi.fn();
|
|
142
|
+
const { getAllByRole } = render(
|
|
143
|
+
<Tabs tabs={sampleTabs} activeTab="one" onChange={onChange} />,
|
|
144
|
+
);
|
|
145
|
+
fireEvent.keyDown(getAllByRole("tab")[0], { key: "End" });
|
|
146
|
+
expect(onChange).toHaveBeenCalledWith("three");
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// ── Custom className ──
|
|
150
|
+
|
|
151
|
+
it("merges custom className", () => {
|
|
152
|
+
const { container } = render(
|
|
153
|
+
<Tabs
|
|
154
|
+
tabs={sampleTabs}
|
|
155
|
+
activeTab="one"
|
|
156
|
+
onChange={() => {}}
|
|
157
|
+
className="custom"
|
|
158
|
+
/>,
|
|
159
|
+
);
|
|
160
|
+
const root = container.firstElementChild as HTMLElement;
|
|
161
|
+
expect(root.className).toContain("strand-tabs");
|
|
162
|
+
expect(root.className).toContain("custom");
|
|
163
|
+
});
|
|
164
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
import type { ComponentChildren, JSX } from "preact";
|
|
4
|
+
import { forwardRef } from "preact/compat";
|
|
5
|
+
import { useRef, useCallback } from "preact/hooks";
|
|
6
|
+
|
|
7
|
+
export interface TabItem {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
content: ComponentChildren;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TabsProps
|
|
14
|
+
extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
15
|
+
/** Tab definitions */
|
|
16
|
+
tabs: TabItem[];
|
|
17
|
+
/** Currently active tab id (controlled) */
|
|
18
|
+
activeTab: string;
|
|
19
|
+
/** Called when active tab changes */
|
|
20
|
+
onChange: (id: string) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Tabs = forwardRef<HTMLDivElement, TabsProps>(
|
|
24
|
+
({ tabs, activeTab, onChange, className = "", ...rest }, ref) => {
|
|
25
|
+
const tablistRef = useRef<HTMLDivElement>(null);
|
|
26
|
+
|
|
27
|
+
const classes = ["strand-tabs", className].filter(Boolean).join(" ");
|
|
28
|
+
|
|
29
|
+
const focusAndSelect = useCallback(
|
|
30
|
+
(index: number) => {
|
|
31
|
+
const tab = tabs[index];
|
|
32
|
+
if (tab) {
|
|
33
|
+
onChange(tab.id);
|
|
34
|
+
const buttons =
|
|
35
|
+
tablistRef.current?.querySelectorAll<HTMLButtonElement>(
|
|
36
|
+
'[role="tab"]',
|
|
37
|
+
);
|
|
38
|
+
buttons?.[index]?.focus();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
[tabs, onChange],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const handleKeyDown = useCallback(
|
|
45
|
+
(e: KeyboardEvent) => {
|
|
46
|
+
const currentIndex = tabs.findIndex((t) => t.id === activeTab);
|
|
47
|
+
let nextIndex: number | null = null;
|
|
48
|
+
|
|
49
|
+
switch (e.key) {
|
|
50
|
+
case "ArrowRight":
|
|
51
|
+
nextIndex = (currentIndex + 1) % tabs.length;
|
|
52
|
+
break;
|
|
53
|
+
case "ArrowLeft":
|
|
54
|
+
nextIndex = (currentIndex - 1 + tabs.length) % tabs.length;
|
|
55
|
+
break;
|
|
56
|
+
case "Home":
|
|
57
|
+
nextIndex = 0;
|
|
58
|
+
break;
|
|
59
|
+
case "End":
|
|
60
|
+
nextIndex = tabs.length - 1;
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
focusAndSelect(nextIndex);
|
|
68
|
+
},
|
|
69
|
+
[tabs, activeTab, focusAndSelect],
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div ref={ref} className={classes} {...rest}>
|
|
74
|
+
<div
|
|
75
|
+
ref={tablistRef}
|
|
76
|
+
role="tablist"
|
|
77
|
+
onKeyDown={handleKeyDown}
|
|
78
|
+
>
|
|
79
|
+
{tabs.map((tab) => {
|
|
80
|
+
const isActive = tab.id === activeTab;
|
|
81
|
+
const buttonClasses = [
|
|
82
|
+
"strand-tabs__tab",
|
|
83
|
+
isActive && "strand-tabs__tab--active",
|
|
84
|
+
]
|
|
85
|
+
.filter(Boolean)
|
|
86
|
+
.join(" ");
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<button
|
|
90
|
+
key={tab.id}
|
|
91
|
+
id={`tab-${tab.id}`}
|
|
92
|
+
role="tab"
|
|
93
|
+
type="button"
|
|
94
|
+
className={buttonClasses}
|
|
95
|
+
aria-selected={isActive ? "true" : "false"}
|
|
96
|
+
aria-controls={`panel-${tab.id}`}
|
|
97
|
+
tabIndex={isActive ? 0 : -1}
|
|
98
|
+
onClick={() => onChange(tab.id)}
|
|
99
|
+
>
|
|
100
|
+
{tab.label}
|
|
101
|
+
</button>
|
|
102
|
+
);
|
|
103
|
+
})}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
{tabs.map((tab) => {
|
|
107
|
+
const isActive = tab.id === activeTab;
|
|
108
|
+
return (
|
|
109
|
+
<div
|
|
110
|
+
key={tab.id}
|
|
111
|
+
id={`panel-${tab.id}`}
|
|
112
|
+
role="tabpanel"
|
|
113
|
+
aria-labelledby={`tab-${tab.id}`}
|
|
114
|
+
hidden={!isActive}
|
|
115
|
+
tabIndex={0}
|
|
116
|
+
>
|
|
117
|
+
{tab.content}
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
})}
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
Tabs.displayName = "Tabs";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
/* ── Base ── */
|
|
4
|
+
.strand-tag {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--strand-space-1);
|
|
8
|
+
padding: var(--strand-space-1) var(--strand-space-2);
|
|
9
|
+
border-radius: var(--strand-radius-sm);
|
|
10
|
+
font-family: var(--strand-font-sans);
|
|
11
|
+
font-size: var(--strand-text-xs);
|
|
12
|
+
font-weight: var(--strand-weight-medium);
|
|
13
|
+
line-height: var(--strand-leading-snug);
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
border: 1px solid transparent;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ── Solid variant ── */
|
|
19
|
+
.strand-tag--solid.strand-tag--default {
|
|
20
|
+
background: var(--strand-surface-recessed);
|
|
21
|
+
color: var(--strand-gray-600);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.strand-tag--solid.strand-tag--teal {
|
|
25
|
+
background: rgba(20, 184, 166, 0.1);
|
|
26
|
+
color: var(--strand-on-teal-tint);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.strand-tag--solid.strand-tag--blue {
|
|
30
|
+
background: var(--strand-blue-glow);
|
|
31
|
+
color: var(--strand-blue-deep);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.strand-tag--solid.strand-tag--amber {
|
|
35
|
+
background: rgba(245, 158, 11, 0.1);
|
|
36
|
+
color: var(--strand-on-amber-tint);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.strand-tag--solid.strand-tag--red {
|
|
40
|
+
background: rgba(239, 68, 68, 0.1);
|
|
41
|
+
color: var(--strand-on-red-tint);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ── Outlined variant ── */
|
|
45
|
+
.strand-tag--outlined {
|
|
46
|
+
background: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.strand-tag--outlined.strand-tag--default {
|
|
50
|
+
border-color: var(--strand-gray-200);
|
|
51
|
+
color: var(--strand-gray-600);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.strand-tag--outlined.strand-tag--teal {
|
|
55
|
+
border-color: var(--strand-teal-vital);
|
|
56
|
+
color: var(--strand-on-teal-tint);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.strand-tag--outlined.strand-tag--blue {
|
|
60
|
+
border-color: var(--strand-blue-primary);
|
|
61
|
+
color: var(--strand-blue-deep);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.strand-tag--outlined.strand-tag--amber {
|
|
65
|
+
border-color: var(--strand-amber-caution);
|
|
66
|
+
color: var(--strand-on-amber-tint);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.strand-tag--outlined.strand-tag--red {
|
|
70
|
+
border-color: var(--strand-red-alert);
|
|
71
|
+
color: var(--strand-on-red-tint);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ── Remove button ── */
|
|
75
|
+
.strand-tag__remove {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
padding: 0;
|
|
80
|
+
border: none;
|
|
81
|
+
background: none;
|
|
82
|
+
color: currentColor;
|
|
83
|
+
opacity: 0.6;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
border-radius: var(--strand-radius-sm);
|
|
86
|
+
transition: opacity var(--strand-duration-fast) var(--strand-ease-out-quart);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.strand-tag__remove:hover {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ── Reduced motion ── */
|
|
94
|
+
@media (prefers-reduced-motion: reduce) {
|
|
95
|
+
.strand-tag__remove {
|
|
96
|
+
transition: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { render, fireEvent } from "@testing-library/preact";
|
|
3
|
+
import { Tag } from "./Tag.js";
|
|
4
|
+
|
|
5
|
+
describe("Tag", () => {
|
|
6
|
+
// ── Rendering ──
|
|
7
|
+
|
|
8
|
+
it("renders children text", () => {
|
|
9
|
+
const { getByText } = render(<Tag>Active</Tag>);
|
|
10
|
+
expect(getByText("Active")).toBeTruthy();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("renders as a span element", () => {
|
|
14
|
+
const { container } = render(<Tag>Test</Tag>);
|
|
15
|
+
expect(container.querySelector("span.strand-tag")).toBeTruthy();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// ── Variants ──
|
|
19
|
+
|
|
20
|
+
it("applies solid variant class by default", () => {
|
|
21
|
+
const { container } = render(<Tag>Test</Tag>);
|
|
22
|
+
const tag = container.querySelector(".strand-tag");
|
|
23
|
+
expect(tag?.className).toContain("strand-tag--solid");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("applies outlined variant class", () => {
|
|
27
|
+
const { container } = render(<Tag variant="outlined">Test</Tag>);
|
|
28
|
+
const tag = container.querySelector(".strand-tag");
|
|
29
|
+
expect(tag?.className).toContain("strand-tag--outlined");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// ── Status colors ──
|
|
33
|
+
|
|
34
|
+
it("applies default status class by default", () => {
|
|
35
|
+
const { container } = render(<Tag>Test</Tag>);
|
|
36
|
+
const tag = container.querySelector(".strand-tag");
|
|
37
|
+
expect(tag?.className).toContain("strand-tag--default");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("applies teal status class", () => {
|
|
41
|
+
const { container } = render(<Tag status="teal">Test</Tag>);
|
|
42
|
+
const tag = container.querySelector(".strand-tag");
|
|
43
|
+
expect(tag?.className).toContain("strand-tag--teal");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("applies blue status class", () => {
|
|
47
|
+
const { container } = render(<Tag status="blue">Test</Tag>);
|
|
48
|
+
const tag = container.querySelector(".strand-tag");
|
|
49
|
+
expect(tag?.className).toContain("strand-tag--blue");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("applies amber status class", () => {
|
|
53
|
+
const { container } = render(<Tag status="amber">Test</Tag>);
|
|
54
|
+
const tag = container.querySelector(".strand-tag");
|
|
55
|
+
expect(tag?.className).toContain("strand-tag--amber");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("applies red status class", () => {
|
|
59
|
+
const { container } = render(<Tag status="red">Test</Tag>);
|
|
60
|
+
const tag = container.querySelector(".strand-tag");
|
|
61
|
+
expect(tag?.className).toContain("strand-tag--red");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ── Removable ──
|
|
65
|
+
|
|
66
|
+
it("shows remove button when removable", () => {
|
|
67
|
+
const { getByLabelText } = render(<Tag removable>Test</Tag>);
|
|
68
|
+
expect(getByLabelText("Remove")).toBeTruthy();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("does not show remove button when not removable", () => {
|
|
72
|
+
const { queryByLabelText } = render(<Tag>Test</Tag>);
|
|
73
|
+
expect(queryByLabelText("Remove")).toBeNull();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("calls onRemove when remove button is clicked", () => {
|
|
77
|
+
const onRemove = vi.fn();
|
|
78
|
+
const { getByLabelText } = render(
|
|
79
|
+
<Tag removable onRemove={onRemove}>Test</Tag>,
|
|
80
|
+
);
|
|
81
|
+
fireEvent.click(getByLabelText("Remove"));
|
|
82
|
+
expect(onRemove).toHaveBeenCalledTimes(1);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// ── Custom className ──
|
|
86
|
+
|
|
87
|
+
it("merges custom className with component classes", () => {
|
|
88
|
+
const { container } = render(<Tag className="custom">Test</Tag>);
|
|
89
|
+
const tag = container.querySelector(".strand-tag");
|
|
90
|
+
expect(tag?.className).toContain("strand-tag");
|
|
91
|
+
expect(tag?.className).toContain("custom");
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// ── Typography ──
|
|
95
|
+
|
|
96
|
+
it("uses xs font size class", () => {
|
|
97
|
+
const { container } = render(<Tag>Test</Tag>);
|
|
98
|
+
const tag = container.querySelector(".strand-tag");
|
|
99
|
+
expect(tag).toBeTruthy();
|
|
100
|
+
// Font size is applied via CSS class .strand-tag which uses --strand-text-xs
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// ── Forwarded props ──
|
|
104
|
+
|
|
105
|
+
it("forwards additional props", () => {
|
|
106
|
+
const { container } = render(
|
|
107
|
+
<Tag data-testid="my-tag" id="tag-1">Test</Tag>,
|
|
108
|
+
);
|
|
109
|
+
const tag = container.querySelector(".strand-tag");
|
|
110
|
+
expect(tag?.getAttribute("id")).toBe("tag-1");
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
import type { ComponentChildren, JSX } from "preact";
|
|
4
|
+
import { forwardRef } from "preact/compat";
|
|
5
|
+
|
|
6
|
+
export interface TagProps
|
|
7
|
+
extends Omit<JSX.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
8
|
+
/** Visual style variant */
|
|
9
|
+
variant?: "solid" | "outlined";
|
|
10
|
+
/** Color status */
|
|
11
|
+
status?: "default" | "teal" | "blue" | "amber" | "red";
|
|
12
|
+
/** Show remove button */
|
|
13
|
+
removable?: boolean;
|
|
14
|
+
/** Called when remove button is clicked */
|
|
15
|
+
onRemove?: () => void;
|
|
16
|
+
/** Tag text content */
|
|
17
|
+
children?: ComponentChildren;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Tag = forwardRef<HTMLSpanElement, TagProps>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
variant = "solid",
|
|
24
|
+
status = "default",
|
|
25
|
+
removable = false,
|
|
26
|
+
onRemove,
|
|
27
|
+
className = "",
|
|
28
|
+
children,
|
|
29
|
+
...rest
|
|
30
|
+
},
|
|
31
|
+
ref,
|
|
32
|
+
) => {
|
|
33
|
+
const classes = [
|
|
34
|
+
"strand-tag",
|
|
35
|
+
`strand-tag--${variant}`,
|
|
36
|
+
`strand-tag--${status}`,
|
|
37
|
+
className,
|
|
38
|
+
]
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join(" ");
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<span ref={ref} className={classes} {...rest}>
|
|
44
|
+
<span className="strand-tag__text">{children}</span>
|
|
45
|
+
{removable && (
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
className="strand-tag__remove"
|
|
49
|
+
aria-label="Remove"
|
|
50
|
+
onClick={onRemove}
|
|
51
|
+
>
|
|
52
|
+
<svg
|
|
53
|
+
width="12"
|
|
54
|
+
height="12"
|
|
55
|
+
viewBox="0 0 12 12"
|
|
56
|
+
fill="none"
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
>
|
|
59
|
+
<path
|
|
60
|
+
d="M3 3l6 6M9 3l-6 6"
|
|
61
|
+
stroke="currentColor"
|
|
62
|
+
stroke-width="1.5"
|
|
63
|
+
stroke-linecap="round"
|
|
64
|
+
/>
|
|
65
|
+
</svg>
|
|
66
|
+
</button>
|
|
67
|
+
)}
|
|
68
|
+
</span>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
Tag.displayName = "Tag";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
/* ── Base ── */
|
|
4
|
+
.strand-textarea {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
background: var(--strand-surface-elevated);
|
|
9
|
+
border: 1px solid var(--strand-gray-200);
|
|
10
|
+
border-radius: var(--strand-radius-md);
|
|
11
|
+
transition:
|
|
12
|
+
border-color var(--strand-duration-fast) var(--strand-ease-out-quart),
|
|
13
|
+
box-shadow var(--strand-duration-fast) var(--strand-ease-out-quart);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.strand-textarea:focus-within {
|
|
17
|
+
border-color: var(--strand-blue-primary);
|
|
18
|
+
box-shadow: var(--strand-focus-ring);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* ── Field ── */
|
|
22
|
+
.strand-textarea__field {
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-height: 80px;
|
|
25
|
+
padding: var(--strand-space-3) var(--strand-space-4);
|
|
26
|
+
background: transparent;
|
|
27
|
+
border: none;
|
|
28
|
+
font-family: var(--strand-font-sans);
|
|
29
|
+
font-size: var(--strand-text-base);
|
|
30
|
+
color: var(--strand-gray-900);
|
|
31
|
+
outline: none;
|
|
32
|
+
resize: vertical;
|
|
33
|
+
line-height: var(--strand-leading-normal);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.strand-textarea__field::placeholder {
|
|
37
|
+
color: var(--strand-gray-400);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ── Auto-resize ── */
|
|
41
|
+
.strand-textarea--auto-resize .strand-textarea__field {
|
|
42
|
+
resize: none;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ── Character count ── */
|
|
47
|
+
.strand-textarea__count {
|
|
48
|
+
align-self: flex-end;
|
|
49
|
+
padding: var(--strand-space-1) var(--strand-space-3) var(--strand-space-2);
|
|
50
|
+
font-family: var(--strand-font-sans);
|
|
51
|
+
font-size: var(--strand-text-xs);
|
|
52
|
+
color: var(--strand-gray-500);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* ── Error ── */
|
|
56
|
+
.strand-textarea--error {
|
|
57
|
+
border-color: var(--strand-red-alert);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.strand-textarea--error:focus-within {
|
|
61
|
+
border-color: var(--strand-red-alert);
|
|
62
|
+
box-shadow: var(--strand-focus-ring-error);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ── Disabled ── */
|
|
66
|
+
.strand-textarea--disabled {
|
|
67
|
+
opacity: 0.4;
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.strand-textarea--disabled .strand-textarea__field {
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ── Reduced motion ── */
|
|
76
|
+
@media (prefers-reduced-motion: reduce) {
|
|
77
|
+
.strand-textarea {
|
|
78
|
+
transition: none;
|
|
79
|
+
}
|
|
80
|
+
}
|