@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,95 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { render, fireEvent } from "@testing-library/preact";
|
|
3
|
+
import { Input } from "./Input.js";
|
|
4
|
+
|
|
5
|
+
describe("Input", () => {
|
|
6
|
+
it("renders an input element", () => {
|
|
7
|
+
const { getByRole } = render(<Input aria-label="Name" />);
|
|
8
|
+
expect(getByRole("textbox")).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("defaults to type text", () => {
|
|
12
|
+
const { getByRole } = render(<Input aria-label="Name" />);
|
|
13
|
+
expect(getByRole("textbox")).toHaveAttribute("type", "text");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("accepts type email", () => {
|
|
17
|
+
const { container } = render(<Input type="email" aria-label="Email" />);
|
|
18
|
+
expect(container.querySelector("input")).toHaveAttribute("type", "email");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("accepts type password", () => {
|
|
22
|
+
const { container } = render(<Input type="password" aria-label="Password" />);
|
|
23
|
+
expect(container.querySelector("input")).toHaveAttribute("type", "password");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("accepts type number", () => {
|
|
27
|
+
const { container } = render(<Input type="number" aria-label="Count" />);
|
|
28
|
+
expect(container.querySelector("input")).toHaveAttribute("type", "number");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("accepts type search", () => {
|
|
32
|
+
const { getByRole } = render(<Input type="search" aria-label="Search" />);
|
|
33
|
+
expect(getByRole("searchbox")).toBeTruthy();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("renders placeholder text", () => {
|
|
37
|
+
const { getByPlaceholderText } = render(
|
|
38
|
+
<Input placeholder="Enter name" aria-label="Name" />
|
|
39
|
+
);
|
|
40
|
+
expect(getByPlaceholderText("Enter name")).toBeTruthy();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("calls onChange when value changes", () => {
|
|
44
|
+
const onChange = vi.fn();
|
|
45
|
+
const { getByRole } = render(
|
|
46
|
+
<Input aria-label="Name" onChange={onChange} />
|
|
47
|
+
);
|
|
48
|
+
fireEvent.input(getByRole("textbox"), { target: { value: "hello" } });
|
|
49
|
+
expect(onChange).toHaveBeenCalled();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("sets disabled attribute", () => {
|
|
53
|
+
const { getByRole } = render(<Input aria-label="Name" disabled />);
|
|
54
|
+
expect(getByRole("textbox")).toBeDisabled();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("applies error class when error prop is true", () => {
|
|
58
|
+
const { container } = render(<Input aria-label="Name" error />);
|
|
59
|
+
expect(container.querySelector(".strand-input--error")).toBeTruthy();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("sets aria-invalid when error is true", () => {
|
|
63
|
+
const { getByRole } = render(<Input aria-label="Name" error />);
|
|
64
|
+
expect(getByRole("textbox")).toHaveAttribute("aria-invalid", "true");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("renders leading addon", () => {
|
|
68
|
+
const { container } = render(
|
|
69
|
+
<Input aria-label="Amount" leadingAddon={<span>$</span>} />
|
|
70
|
+
);
|
|
71
|
+
expect(container.querySelector(".strand-input__leading")).toBeTruthy();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("renders trailing addon", () => {
|
|
75
|
+
const { container } = render(
|
|
76
|
+
<Input aria-label="Weight" trailingAddon={<span>kg</span>} />
|
|
77
|
+
);
|
|
78
|
+
expect(container.querySelector(".strand-input__trailing")).toBeTruthy();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("merges custom className", () => {
|
|
82
|
+
const { container } = render(
|
|
83
|
+
<Input aria-label="Name" className="custom" />
|
|
84
|
+
);
|
|
85
|
+
expect(container.querySelector(".strand-input")?.className).toContain("custom");
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("forwards ref to input element", () => {
|
|
89
|
+
let inputEl: HTMLInputElement | null = null;
|
|
90
|
+
render(
|
|
91
|
+
<Input aria-label="Name" ref={(el: HTMLInputElement | null) => { inputEl = el; }} />
|
|
92
|
+
);
|
|
93
|
+
expect(inputEl).toBeInstanceOf(HTMLInputElement);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
import type { JSX, ComponentChildren } from "preact";
|
|
4
|
+
import { forwardRef } from "preact/compat";
|
|
5
|
+
|
|
6
|
+
export interface InputProps
|
|
7
|
+
extends Omit<JSX.HTMLAttributes<HTMLInputElement>, "size"> {
|
|
8
|
+
/** Input type */
|
|
9
|
+
type?: "text" | "email" | "password" | "search" | "number";
|
|
10
|
+
/** Show error styling */
|
|
11
|
+
error?: boolean;
|
|
12
|
+
/** Element rendered before the input */
|
|
13
|
+
leadingAddon?: ComponentChildren;
|
|
14
|
+
/** Element rendered after the input */
|
|
15
|
+
trailingAddon?: ComponentChildren;
|
|
16
|
+
/** Disabled state */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
type = "text",
|
|
24
|
+
error = false,
|
|
25
|
+
leadingAddon,
|
|
26
|
+
trailingAddon,
|
|
27
|
+
className = "",
|
|
28
|
+
disabled,
|
|
29
|
+
...rest
|
|
30
|
+
},
|
|
31
|
+
ref,
|
|
32
|
+
) => {
|
|
33
|
+
const wrapperClasses = [
|
|
34
|
+
"strand-input",
|
|
35
|
+
error && "strand-input--error",
|
|
36
|
+
disabled && "strand-input--disabled",
|
|
37
|
+
leadingAddon && "strand-input--has-leading",
|
|
38
|
+
trailingAddon && "strand-input--has-trailing",
|
|
39
|
+
className,
|
|
40
|
+
]
|
|
41
|
+
.filter(Boolean)
|
|
42
|
+
.join(" ");
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className={wrapperClasses}>
|
|
46
|
+
{leadingAddon && (
|
|
47
|
+
<span className="strand-input__leading" aria-hidden="true">
|
|
48
|
+
{leadingAddon}
|
|
49
|
+
</span>
|
|
50
|
+
)}
|
|
51
|
+
<input
|
|
52
|
+
ref={ref}
|
|
53
|
+
type={type}
|
|
54
|
+
className="strand-input__field"
|
|
55
|
+
disabled={disabled}
|
|
56
|
+
aria-invalid={error ? "true" : undefined}
|
|
57
|
+
{...rest}
|
|
58
|
+
/>
|
|
59
|
+
{trailingAddon && (
|
|
60
|
+
<span className="strand-input__trailing" aria-hidden="true">
|
|
61
|
+
{trailingAddon}
|
|
62
|
+
</span>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
Input.displayName = "Input";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
.strand-link {
|
|
4
|
+
color: var(--strand-blue-primary);
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
font-family: var(--strand-font-sans);
|
|
7
|
+
background-image: linear-gradient(currentColor, currentColor);
|
|
8
|
+
background-position: 0% 100%;
|
|
9
|
+
background-repeat: no-repeat;
|
|
10
|
+
background-size: 0% 1px;
|
|
11
|
+
transition: background-size var(--strand-duration-normal) var(--strand-ease-out-expo);
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.strand-link:hover {
|
|
16
|
+
background-size: 100% 1px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ── Focus ring ── */
|
|
20
|
+
.strand-link:focus-visible {
|
|
21
|
+
outline: 2px solid var(--strand-blue-primary);
|
|
22
|
+
outline-offset: 2px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* ── Reduced motion ── */
|
|
26
|
+
@media (prefers-reduced-motion: reduce) {
|
|
27
|
+
.strand-link {
|
|
28
|
+
transition: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { render } from "@testing-library/preact";
|
|
3
|
+
import { Link } from "./Link.js";
|
|
4
|
+
|
|
5
|
+
describe("Link", () => {
|
|
6
|
+
// ── Rendering ──
|
|
7
|
+
|
|
8
|
+
it("renders an anchor element", () => {
|
|
9
|
+
const { getByRole } = render(<Link href="/about">About</Link>);
|
|
10
|
+
expect(getByRole("link").tagName).toBe("A");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("has the correct href attribute", () => {
|
|
14
|
+
const { getByRole } = render(<Link href="/about">About</Link>);
|
|
15
|
+
expect(getByRole("link")).toHaveAttribute("href", "/about");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("applies blue color class", () => {
|
|
19
|
+
const { getByRole } = render(<Link href="/about">About</Link>);
|
|
20
|
+
expect(getByRole("link").className).toContain("strand-link");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("renders children text", () => {
|
|
24
|
+
const { getByRole } = render(<Link href="/about">About Us</Link>);
|
|
25
|
+
expect(getByRole("link")).toHaveTextContent("About Us");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// ── External ──
|
|
29
|
+
|
|
30
|
+
it("adds target _blank when external", () => {
|
|
31
|
+
const { getByRole } = render(
|
|
32
|
+
<Link href="https://example.com" external>
|
|
33
|
+
External
|
|
34
|
+
</Link>,
|
|
35
|
+
);
|
|
36
|
+
expect(getByRole("link")).toHaveAttribute("target", "_blank");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("adds rel noopener noreferrer when external", () => {
|
|
40
|
+
const { getByRole } = render(
|
|
41
|
+
<Link href="https://example.com" external>
|
|
42
|
+
External
|
|
43
|
+
</Link>,
|
|
44
|
+
);
|
|
45
|
+
expect(getByRole("link")).toHaveAttribute("rel", "noopener noreferrer");
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("does not add target or rel when not external", () => {
|
|
49
|
+
const { getByRole } = render(<Link href="/about">About</Link>);
|
|
50
|
+
const link = getByRole("link");
|
|
51
|
+
expect(link).not.toHaveAttribute("target");
|
|
52
|
+
expect(link).not.toHaveAttribute("rel");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// ── Custom className ──
|
|
56
|
+
|
|
57
|
+
it("merges custom className with component class", () => {
|
|
58
|
+
const { getByRole } = render(
|
|
59
|
+
<Link href="/about" className="custom">
|
|
60
|
+
About
|
|
61
|
+
</Link>,
|
|
62
|
+
);
|
|
63
|
+
const link = getByRole("link");
|
|
64
|
+
expect(link.className).toContain("strand-link");
|
|
65
|
+
expect(link.className).toContain("custom");
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// ── No text-decoration ──
|
|
69
|
+
|
|
70
|
+
it("does not have text-decoration class (relies on CSS reset)", () => {
|
|
71
|
+
const { getByRole } = render(<Link href="/about">About</Link>);
|
|
72
|
+
expect(getByRole("link").className).not.toContain("text-decoration");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// ── Accessibility ──
|
|
76
|
+
|
|
77
|
+
it("forwards additional props", () => {
|
|
78
|
+
const { getByRole } = render(
|
|
79
|
+
<Link href="/about" aria-label="Go to about page">
|
|
80
|
+
About
|
|
81
|
+
</Link>,
|
|
82
|
+
);
|
|
83
|
+
expect(getByRole("link")).toHaveAttribute(
|
|
84
|
+
"aria-label",
|
|
85
|
+
"Go to about page",
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
import type { JSX } from "preact";
|
|
4
|
+
import { forwardRef } from "preact/compat";
|
|
5
|
+
|
|
6
|
+
export interface LinkProps extends JSX.HTMLAttributes<HTMLAnchorElement> {
|
|
7
|
+
/** URL destination */
|
|
8
|
+
href: string;
|
|
9
|
+
/** Opens in new tab with rel="noopener noreferrer" */
|
|
10
|
+
external?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Link = forwardRef<HTMLAnchorElement, LinkProps>(
|
|
14
|
+
({ href, external = false, className = "", children, ...rest }, ref) => {
|
|
15
|
+
const classes = ["strand-link", className].filter(Boolean).join(" ");
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<a
|
|
19
|
+
ref={ref}
|
|
20
|
+
href={href}
|
|
21
|
+
className={classes}
|
|
22
|
+
{...(external && { target: "_blank", rel: "noopener noreferrer" })}
|
|
23
|
+
{...rest}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</a>
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
Link.displayName = "Link";
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*! Strand UI | MIT License | dillingerstaffing.com */
|
|
2
|
+
|
|
3
|
+
/* ── Nav bar ── */
|
|
4
|
+
.strand-nav {
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 64px;
|
|
8
|
+
background: var(--strand-surface-elevated);
|
|
9
|
+
border-bottom: 1px solid var(--strand-gray-200);
|
|
10
|
+
font-family: var(--strand-font-sans);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ── Inner layout ── */
|
|
14
|
+
.strand-nav__inner {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
height: 100%;
|
|
18
|
+
padding: 0 var(--strand-space-6);
|
|
19
|
+
max-width: 1280px;
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ── Logo ── */
|
|
24
|
+
.strand-nav__logo {
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
margin-right: var(--strand-space-8);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* ── Desktop items ── */
|
|
30
|
+
.strand-nav__items {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: var(--strand-space-6);
|
|
34
|
+
flex: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ── Links ── */
|
|
38
|
+
.strand-nav__link {
|
|
39
|
+
color: var(--strand-gray-600);
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
font-size: var(--strand-text-sm);
|
|
42
|
+
font-weight: var(--strand-weight-medium);
|
|
43
|
+
transition: color var(--strand-duration-fast) var(--strand-ease-out-quart);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.strand-nav__link:hover {
|
|
47
|
+
color: var(--strand-gray-900);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.strand-nav__link:focus-visible {
|
|
51
|
+
outline: 2px solid var(--strand-blue-primary);
|
|
52
|
+
outline-offset: 2px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.strand-nav__link--active {
|
|
56
|
+
color: var(--strand-blue-primary);
|
|
57
|
+
font-weight: var(--strand-weight-medium);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ── Actions ── */
|
|
61
|
+
.strand-nav__actions {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: var(--strand-space-3);
|
|
65
|
+
margin-left: auto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ── Hamburger ── */
|
|
69
|
+
.strand-nav__hamburger {
|
|
70
|
+
display: none;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
width: 40px;
|
|
74
|
+
height: 40px;
|
|
75
|
+
margin-left: auto;
|
|
76
|
+
padding: 0;
|
|
77
|
+
border: none;
|
|
78
|
+
border-radius: var(--strand-radius-md);
|
|
79
|
+
background: transparent;
|
|
80
|
+
color: var(--strand-gray-600);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
transition: background var(--strand-duration-fast) var(--strand-ease-out-quart);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.strand-nav__hamburger:hover {
|
|
86
|
+
background: var(--strand-gray-200);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.strand-nav__hamburger:focus-visible {
|
|
90
|
+
outline: 2px solid var(--strand-blue-primary);
|
|
91
|
+
outline-offset: 2px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.strand-nav__hamburger-icon {
|
|
95
|
+
display: block;
|
|
96
|
+
width: 20px;
|
|
97
|
+
height: 2px;
|
|
98
|
+
background: currentColor;
|
|
99
|
+
position: relative;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.strand-nav__hamburger-icon::before,
|
|
103
|
+
.strand-nav__hamburger-icon::after {
|
|
104
|
+
content: "";
|
|
105
|
+
position: absolute;
|
|
106
|
+
left: 0;
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 2px;
|
|
109
|
+
background: currentColor;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.strand-nav__hamburger-icon::before {
|
|
113
|
+
top: -6px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.strand-nav__hamburger-icon::after {
|
|
117
|
+
top: 6px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* ── Mobile menu ── */
|
|
121
|
+
.strand-nav__mobile-menu {
|
|
122
|
+
display: none;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
width: 100%;
|
|
125
|
+
padding: var(--strand-space-4) var(--strand-space-6);
|
|
126
|
+
background: var(--strand-surface-elevated);
|
|
127
|
+
border-bottom: 1px solid var(--strand-gray-200);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.strand-nav__mobile-link {
|
|
131
|
+
display: block;
|
|
132
|
+
padding: var(--strand-space-3) 0;
|
|
133
|
+
color: var(--strand-gray-600);
|
|
134
|
+
text-decoration: none;
|
|
135
|
+
font-size: var(--strand-text-sm);
|
|
136
|
+
font-weight: var(--strand-weight-medium);
|
|
137
|
+
transition: color var(--strand-duration-fast) var(--strand-ease-out-quart);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.strand-nav__mobile-link:hover {
|
|
141
|
+
color: var(--strand-gray-900);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.strand-nav__mobile-link--active {
|
|
145
|
+
color: var(--strand-blue-primary);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* ── Responsive ── */
|
|
149
|
+
@media (max-width: 767px) {
|
|
150
|
+
.strand-nav__items {
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.strand-nav__actions {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.strand-nav__hamburger {
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.strand-nav__mobile-menu {
|
|
163
|
+
display: flex;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.strand-nav {
|
|
167
|
+
height: auto;
|
|
168
|
+
min-height: 64px;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* ── Reduced motion ── */
|
|
173
|
+
@media (prefers-reduced-motion: reduce) {
|
|
174
|
+
.strand-nav__link,
|
|
175
|
+
.strand-nav__mobile-link,
|
|
176
|
+
.strand-nav__hamburger {
|
|
177
|
+
transition: none;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { render, fireEvent } from "@testing-library/preact";
|
|
3
|
+
import { Nav } from "./Nav.js";
|
|
4
|
+
|
|
5
|
+
const sampleItems = [
|
|
6
|
+
{ label: "Home", href: "/", active: true },
|
|
7
|
+
{ label: "About", href: "/about" },
|
|
8
|
+
{ label: "Contact", href: "/contact" },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
describe("Nav", () => {
|
|
12
|
+
// ── Rendering ──
|
|
13
|
+
|
|
14
|
+
it("renders a nav element", () => {
|
|
15
|
+
const { container } = render(<Nav items={sampleItems} />);
|
|
16
|
+
expect(container.querySelector("nav")).toBeTruthy();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("has aria-label Main navigation", () => {
|
|
20
|
+
const { getByRole } = render(<Nav items={sampleItems} />);
|
|
21
|
+
expect(getByRole("navigation")).toHaveAttribute(
|
|
22
|
+
"aria-label",
|
|
23
|
+
"Main navigation",
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("renders logo content", () => {
|
|
28
|
+
const { getByText } = render(
|
|
29
|
+
<Nav logo={<span>MyLogo</span>} items={sampleItems} />,
|
|
30
|
+
);
|
|
31
|
+
expect(getByText("MyLogo")).toBeTruthy();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("renders navigation items", () => {
|
|
35
|
+
const { getByText } = render(<Nav items={sampleItems} />);
|
|
36
|
+
expect(getByText("Home")).toBeTruthy();
|
|
37
|
+
expect(getByText("About")).toBeTruthy();
|
|
38
|
+
expect(getByText("Contact")).toBeTruthy();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("renders item hrefs", () => {
|
|
42
|
+
const { getByText } = render(<Nav items={sampleItems} />);
|
|
43
|
+
expect(getByText("Home").closest("a")).toHaveAttribute("href", "/");
|
|
44
|
+
expect(getByText("About").closest("a")).toHaveAttribute(
|
|
45
|
+
"href",
|
|
46
|
+
"/about",
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// ── Active item ──
|
|
51
|
+
|
|
52
|
+
it("active item has active class", () => {
|
|
53
|
+
const { getByText } = render(<Nav items={sampleItems} />);
|
|
54
|
+
const homeLink = getByText("Home").closest("a")!;
|
|
55
|
+
expect(homeLink.className).toContain("strand-nav__link--active");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("active item has aria-current page", () => {
|
|
59
|
+
const { getByText } = render(<Nav items={sampleItems} />);
|
|
60
|
+
const homeLink = getByText("Home").closest("a")!;
|
|
61
|
+
expect(homeLink).toHaveAttribute("aria-current", "page");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("inactive item does not have active class", () => {
|
|
65
|
+
const { getByText } = render(<Nav items={sampleItems} />);
|
|
66
|
+
const aboutLink = getByText("About").closest("a")!;
|
|
67
|
+
expect(aboutLink.className).not.toContain("strand-nav__link--active");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// ── Actions ──
|
|
71
|
+
|
|
72
|
+
it("renders actions content", () => {
|
|
73
|
+
const { getByText } = render(
|
|
74
|
+
<Nav
|
|
75
|
+
items={sampleItems}
|
|
76
|
+
actions={<button type="button">Sign In</button>}
|
|
77
|
+
/>,
|
|
78
|
+
);
|
|
79
|
+
expect(getByText("Sign In")).toBeTruthy();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// ── Hamburger ──
|
|
83
|
+
|
|
84
|
+
it("hamburger button has aria-expanded false initially", () => {
|
|
85
|
+
const { container } = render(<Nav items={sampleItems} />);
|
|
86
|
+
const hamburger = container.querySelector(".strand-nav__hamburger")!;
|
|
87
|
+
expect(hamburger).toHaveAttribute("aria-expanded", "false");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("hamburger button has aria-label Menu", () => {
|
|
91
|
+
const { container } = render(<Nav items={sampleItems} />);
|
|
92
|
+
const hamburger = container.querySelector(".strand-nav__hamburger")!;
|
|
93
|
+
expect(hamburger).toHaveAttribute("aria-label", "Menu");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("clicking hamburger toggles menu and updates aria attributes", () => {
|
|
97
|
+
const { container } = render(<Nav items={sampleItems} />);
|
|
98
|
+
const hamburger = container.querySelector(
|
|
99
|
+
".strand-nav__hamburger",
|
|
100
|
+
) as HTMLButtonElement;
|
|
101
|
+
|
|
102
|
+
// Initially closed
|
|
103
|
+
expect(hamburger).toHaveAttribute("aria-expanded", "false");
|
|
104
|
+
expect(hamburger).toHaveAttribute("aria-label", "Menu");
|
|
105
|
+
expect(
|
|
106
|
+
container.querySelector(".strand-nav__mobile-menu"),
|
|
107
|
+
).toBeNull();
|
|
108
|
+
|
|
109
|
+
// Open
|
|
110
|
+
fireEvent.click(hamburger);
|
|
111
|
+
expect(hamburger).toHaveAttribute("aria-expanded", "true");
|
|
112
|
+
expect(hamburger).toHaveAttribute("aria-label", "Close menu");
|
|
113
|
+
expect(
|
|
114
|
+
container.querySelector(".strand-nav__mobile-menu"),
|
|
115
|
+
).toBeTruthy();
|
|
116
|
+
|
|
117
|
+
// Close
|
|
118
|
+
fireEvent.click(hamburger);
|
|
119
|
+
expect(hamburger).toHaveAttribute("aria-expanded", "false");
|
|
120
|
+
expect(hamburger).toHaveAttribute("aria-label", "Menu");
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("mobile menu renders items when open", () => {
|
|
124
|
+
const { container, getByText } = render(<Nav items={sampleItems} />);
|
|
125
|
+
const hamburger = container.querySelector(
|
|
126
|
+
".strand-nav__hamburger",
|
|
127
|
+
) as HTMLButtonElement;
|
|
128
|
+
fireEvent.click(hamburger);
|
|
129
|
+
|
|
130
|
+
const mobileMenu = container.querySelector(".strand-nav__mobile-menu")!;
|
|
131
|
+
expect(mobileMenu).toBeTruthy();
|
|
132
|
+
// Items appear in both desktop and mobile, check mobile menu has them
|
|
133
|
+
const mobileLinks = mobileMenu.querySelectorAll(".strand-nav__mobile-link");
|
|
134
|
+
expect(mobileLinks.length).toBe(3);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("mobile active item has active class", () => {
|
|
138
|
+
const { container } = render(<Nav items={sampleItems} />);
|
|
139
|
+
const hamburger = container.querySelector(
|
|
140
|
+
".strand-nav__hamburger",
|
|
141
|
+
) as HTMLButtonElement;
|
|
142
|
+
fireEvent.click(hamburger);
|
|
143
|
+
|
|
144
|
+
const mobileMenu = container.querySelector(".strand-nav__mobile-menu")!;
|
|
145
|
+
const activeLink = mobileMenu.querySelector(
|
|
146
|
+
".strand-nav__mobile-link--active",
|
|
147
|
+
);
|
|
148
|
+
expect(activeLink).toBeTruthy();
|
|
149
|
+
expect(activeLink!.textContent).toBe("Home");
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// ── Custom className ──
|
|
153
|
+
|
|
154
|
+
it("merges custom className", () => {
|
|
155
|
+
const { getByRole } = render(
|
|
156
|
+
<Nav items={sampleItems} className="custom-nav" />,
|
|
157
|
+
);
|
|
158
|
+
const nav = getByRole("navigation");
|
|
159
|
+
expect(nav.className).toContain("strand-nav");
|
|
160
|
+
expect(nav.className).toContain("custom-nav");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// ── Empty states ──
|
|
164
|
+
|
|
165
|
+
it("renders without items", () => {
|
|
166
|
+
const { getByRole } = render(<Nav />);
|
|
167
|
+
expect(getByRole("navigation")).toBeTruthy();
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it("renders without logo", () => {
|
|
171
|
+
const { container } = render(<Nav items={sampleItems} />);
|
|
172
|
+
expect(container.querySelector(".strand-nav__logo")).toBeNull();
|
|
173
|
+
});
|
|
174
|
+
});
|