@fpkit/acss 0.5.8 → 0.5.10
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/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/index.cjs +2 -2
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +1 -6
- package/libs/index.d.ts +1 -6
- package/libs/index.js +2 -2
- package/libs/index.js.map +1 -1
- package/package.json +6 -2
- package/src/components/README.mdx +1 -1
- package/src/components/alert/README.mdx +1 -1
- package/src/components/alert/alert.stories.tsx +2 -2
- package/src/components/alert/elements/README.mdx +1 -1
- package/src/components/alert/elements/dismiss-button.stories.tsx +2 -2
- package/src/components/badge/badge.mdx +1 -1
- package/src/components/badge/badge.stories.tsx +2 -2
- package/src/components/breadcrumbs/README.mdx +91 -0
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +2 -2
- package/src/components/breadcrumbs/breadcrumb.tsx +92 -87
- package/src/components/buttons/README.mdx +1 -1
- package/src/components/buttons/button.scss +3 -3
- package/src/components/buttons/button.stories.tsx +2 -2
- package/src/components/buttons/button.test.tsx +1 -1
- package/src/components/cards/card.stories.tsx +2 -2
- package/src/components/details/README.mdx +1 -1
- package/src/components/details/details.stories.tsx +2 -2
- package/src/components/dialog/README.mdx +1 -1
- package/src/components/dialog/dialog-modal.stories.tsx +2 -2
- package/src/components/dialog/dialog-modal.tsx +1 -1
- package/src/components/dialog/dialog.stories.tsx +2 -2
- package/src/components/dialog/views/README.mdx +1 -1
- package/src/components/dialog/views/dialog-header.stories.tsx +2 -2
- package/src/components/form/form.stories.tsx +2 -2
- package/src/components/form/input.stories.tsx +2 -2
- package/src/components/form/inputs.tsx +18 -24
- package/src/components/form/select.stories.tsx +2 -2
- package/src/components/fp.test.tsx +52 -50
- package/src/components/heading/heading.stories.tsx +2 -2
- package/src/components/icons/icon.stories.tsx +1 -1
- package/src/components/images/figure.stories.tsx +2 -2
- package/src/components/images/img.stories.tsx +2 -2
- package/src/components/layout/footer.stories.tsx +10 -19
- package/src/components/layout/landmarks.stories.tsx +22 -24
- package/src/components/layout/main.stories.tsx +21 -25
- package/src/components/link/link.stories.tsx +2 -2
- package/src/components/list/list.stories.tsx +2 -2
- package/src/components/nav/nav.stories.tsx +2 -2
- package/src/components/popover/popover.stories.tsx +2 -2
- package/src/components/progress/progress.stories.tsx +1 -1
- package/src/components/tag/tag.stories.tsx +2 -2
- package/src/components/text/text.stories.tsx +2 -2
- package/src/components/text-to-speech/TextToSpeech.stories.tsx +1 -1
- package/src/decorators/instructions.tsx +2 -1
- package/src/patterns/page/page-header.stories.tsx +2 -2
- package/src/styles/buttons/button.css +3 -3
- package/src/styles/index.css +3 -3
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { render, screen } from
|
|
3
|
-
import FP from
|
|
4
|
-
import jest from
|
|
5
|
-
import { userEvent } from
|
|
6
|
-
|
|
7
|
-
describe(
|
|
8
|
-
it(
|
|
9
|
-
const { container } = render(<FP />)
|
|
10
|
-
expect(container.firstChild).toMatchSnapshot()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it(
|
|
14
|
-
const { container } = render(<FP as="span">Span</FP>)
|
|
15
|
-
const span = container.querySelector(
|
|
16
|
-
expect(span).toBeInTheDocument()
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it(
|
|
20
|
-
const { container } = render(<FP>Hello, world!</FP>)
|
|
21
|
-
expect(container.firstChild).toHaveTextContent(
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it(
|
|
25
|
-
const style = { backgroundColor:
|
|
26
|
-
const { container } = render(<FP styles={style}>Hello, world!</FP>)
|
|
27
|
-
expect(container.firstChild).toHaveStyle(style)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it(
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import FP from "../components/fp";
|
|
4
|
+
import jest from "jest-mock";
|
|
5
|
+
import { userEvent } from "storybook/test";
|
|
6
|
+
|
|
7
|
+
describe("FP component", () => {
|
|
8
|
+
it("renders a div by default", () => {
|
|
9
|
+
const { container } = render(<FP />);
|
|
10
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("renders a span when specified", () => {
|
|
14
|
+
const { container } = render(<FP as="span">Span</FP>);
|
|
15
|
+
const span = container.querySelector("span");
|
|
16
|
+
expect(span).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("renders children", () => {
|
|
20
|
+
const { container } = render(<FP>Hello, world!</FP>);
|
|
21
|
+
expect(container.firstChild).toHaveTextContent("Hello, world!");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("applies styles", () => {
|
|
25
|
+
const style = { backgroundColor: "red;" };
|
|
26
|
+
const { container } = render(<FP styles={style}>Hello, world!</FP>);
|
|
27
|
+
expect(container.firstChild).toHaveStyle(style);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("does not render styles when renderStyles is false", () => {
|
|
31
31
|
const { container } = render(
|
|
32
|
-
<FP renderStyles={false} styles={{ backgroundColor:
|
|
32
|
+
<FP renderStyles={false} styles={{ backgroundColor: "red" }}>
|
|
33
33
|
Hello, world!
|
|
34
|
-
</FP
|
|
35
|
-
)
|
|
36
|
-
expect(container.firstChild).not.toHaveStyle(
|
|
37
|
-
})
|
|
34
|
+
</FP>
|
|
35
|
+
);
|
|
36
|
+
expect(container.firstChild).not.toHaveStyle("background-color: red;");
|
|
37
|
+
});
|
|
38
38
|
|
|
39
|
-
it(
|
|
40
|
-
const handleClick = jest.fn()
|
|
39
|
+
it("passes through props", async () => {
|
|
40
|
+
const handleClick = jest.fn();
|
|
41
41
|
const { container } = render(
|
|
42
42
|
<FP as="button" onClick={handleClick}>
|
|
43
43
|
Hello, world!
|
|
44
|
-
</FP
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
</FP>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
48
|
+
|
|
49
|
+
await userEvent.click(screen.getByRole("button"));
|
|
50
|
+
expect(handleClick).toHaveBeenCalled();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("applies ref", () => {
|
|
54
|
+
const ref = React.createRef<HTMLDivElement>();
|
|
55
|
+
render(<FP ref={ref}>Hello, world!</FP>);
|
|
56
|
+
expect(ref.current).toBeTruthy();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react-vite";
|
|
2
2
|
/**
|
|
3
3
|
* Import testing library dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { within, userEvent } from
|
|
5
|
+
// import { within, userEvent } from "storybook/test";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Import jest matchers
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
import { Footer } from './landmarks'
|
|
11
|
+
import { Footer } from "./landmarks";
|
|
13
12
|
|
|
14
13
|
const meta: Meta<typeof Footer> = {
|
|
15
|
-
title:
|
|
14
|
+
title: "FP.React Components/Layout/Landmarks",
|
|
16
15
|
component: Footer,
|
|
17
16
|
args: {
|
|
18
|
-
children:
|
|
19
|
-
|
|
20
|
-
'data-testid': 'main',
|
|
17
|
+
children: "Main Landmark",
|
|
18
|
+
"data-testid": "main",
|
|
21
19
|
},
|
|
22
|
-
} as Meta
|
|
23
|
-
|
|
24
|
-
const mainChildren = () => (
|
|
25
|
-
<>
|
|
26
|
-
<h2>Header Title</h2>
|
|
27
|
-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Vero, unde?</p>
|
|
28
|
-
</>
|
|
29
|
-
)
|
|
20
|
+
} as Meta;
|
|
30
21
|
|
|
31
|
-
export default meta
|
|
32
|
-
type Story = StoryObj<typeof Footer
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof Footer>;
|
|
33
24
|
|
|
34
|
-
export const BasicFooter: Story = {}
|
|
25
|
+
export const BasicFooter: Story = {};
|
|
@@ -1,54 +1,52 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react-vite";
|
|
2
2
|
/**
|
|
3
3
|
* Import testing library dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { within, expect } from
|
|
5
|
+
import { within, expect } from "storybook/test";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Import jest matchers
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { Header } from "./landmarks";
|
|
11
12
|
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
import Img from '#components/images/img'
|
|
13
|
+
import Img from "#components/images/img";
|
|
15
14
|
|
|
16
15
|
const meta: Meta<typeof Header> = {
|
|
17
|
-
title:
|
|
16
|
+
title: "FP.React Components/Layout/Landmarks",
|
|
18
17
|
component: Header,
|
|
19
18
|
args: {
|
|
20
|
-
children:
|
|
21
|
-
|
|
22
|
-
'data-testid': 'banner',
|
|
19
|
+
children: "Default Header",
|
|
20
|
+
"data-testid": "banner",
|
|
23
21
|
},
|
|
24
|
-
} as Meta
|
|
22
|
+
} as Meta;
|
|
25
23
|
|
|
26
24
|
const headerChildren = () => (
|
|
27
25
|
<>
|
|
28
26
|
<h2>Header Title</h2>
|
|
29
27
|
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Vero, unde?</p>
|
|
30
28
|
</>
|
|
31
|
-
)
|
|
29
|
+
);
|
|
32
30
|
|
|
33
|
-
export default meta
|
|
34
|
-
type Story = StoryObj<typeof Header
|
|
31
|
+
export default meta;
|
|
32
|
+
type Story = StoryObj<typeof Header>;
|
|
35
33
|
|
|
36
|
-
export const LandmarkDefault: Story = {}
|
|
34
|
+
export const LandmarkDefault: Story = {};
|
|
37
35
|
|
|
38
36
|
export const HeroHeader: Story = {
|
|
39
37
|
args: {
|
|
40
38
|
children: headerChildren(),
|
|
41
39
|
headerBackground: <Img src="https://picsum.photos/2000/1000" alt="" />,
|
|
42
|
-
styles: { color:
|
|
43
|
-
classNames:
|
|
44
|
-
|
|
40
|
+
styles: { color: "red" },
|
|
41
|
+
classNames: "header-class",
|
|
42
|
+
"data-styles": "blue",
|
|
45
43
|
},
|
|
46
44
|
play: async ({ canvasElement }) => {
|
|
47
|
-
const canvas = within(canvasElement)
|
|
48
|
-
const header = canvas.getByRole(
|
|
49
|
-
expect(header).toBeInTheDocument()
|
|
50
|
-
const title = canvas.getByRole(
|
|
51
|
-
expect(title).toBeInTheDocument()
|
|
52
|
-
expect(title).toHaveTextContent(/header title/i)
|
|
45
|
+
const canvas = within(canvasElement);
|
|
46
|
+
const header = canvas.getByRole("banner");
|
|
47
|
+
expect(header).toBeInTheDocument();
|
|
48
|
+
const title = canvas.getByRole("heading");
|
|
49
|
+
expect(title).toBeInTheDocument();
|
|
50
|
+
expect(title).toHaveTextContent(/header title/i);
|
|
53
51
|
},
|
|
54
|
-
} as Story
|
|
52
|
+
} as Story;
|
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react-vite";
|
|
2
2
|
/**
|
|
3
3
|
* Import testing library dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { within,
|
|
5
|
+
import { within, expect } from "storybook/test";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Import jest matchers
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
import { Main } from './landmarks'
|
|
11
|
+
import { Main } from "./landmarks";
|
|
13
12
|
|
|
14
13
|
const meta: Meta<typeof Main> = {
|
|
15
|
-
title:
|
|
14
|
+
title: "FP.React Components/Layout/Landmarks",
|
|
16
15
|
component: Main,
|
|
17
16
|
args: {
|
|
18
|
-
// @ts-ignore
|
|
19
17
|
children: (
|
|
20
18
|
<section>
|
|
21
19
|
The main HTML element represents the dominant content of the body of a
|
|
22
20
|
document.
|
|
23
21
|
</section>
|
|
24
22
|
),
|
|
25
|
-
|
|
26
|
-
'data-testid': 'main',
|
|
23
|
+
"data-testid": "main",
|
|
27
24
|
},
|
|
28
25
|
decorators: [
|
|
29
26
|
(Story) => (
|
|
30
|
-
<div style={{ minHeight:
|
|
27
|
+
<div style={{ minHeight: "80vh", display: "flex" }}>
|
|
31
28
|
<Story />
|
|
32
29
|
</div>
|
|
33
30
|
),
|
|
34
31
|
],
|
|
35
|
-
} as Meta
|
|
32
|
+
} as Meta;
|
|
36
33
|
|
|
37
34
|
const mainChildren = () => (
|
|
38
35
|
<>
|
|
@@ -61,30 +58,29 @@ const mainChildren = () => (
|
|
|
61
58
|
</aside>
|
|
62
59
|
</section>
|
|
63
60
|
</>
|
|
64
|
-
)
|
|
61
|
+
);
|
|
65
62
|
|
|
66
|
-
export default meta
|
|
67
|
-
type Story = StoryObj<typeof Main
|
|
63
|
+
export default meta;
|
|
64
|
+
type Story = StoryObj<typeof Main>;
|
|
68
65
|
|
|
69
66
|
export const MainLandmark: Story = {
|
|
70
67
|
play: async ({ canvasElement }) => {
|
|
71
|
-
const canvas = within(canvasElement)
|
|
72
|
-
const main = canvas.getByRole(
|
|
73
|
-
expect(main).toBeInTheDocument()
|
|
68
|
+
const canvas = within(canvasElement);
|
|
69
|
+
const main = canvas.getByRole("main");
|
|
70
|
+
expect(main).toBeInTheDocument();
|
|
74
71
|
},
|
|
75
|
-
}
|
|
72
|
+
};
|
|
76
73
|
|
|
77
74
|
export const MainArticles: Story = {
|
|
78
75
|
args: {
|
|
79
|
-
// @ts-ignore
|
|
80
76
|
children: mainChildren(),
|
|
81
77
|
},
|
|
82
78
|
play: async ({ canvasElement }) => {
|
|
83
|
-
const canvas = within(canvasElement)
|
|
84
|
-
const main = canvas.getByRole(
|
|
85
|
-
expect(main).toBeInTheDocument()
|
|
86
|
-
const title = canvas.getByRole(
|
|
87
|
-
expect(title).toBeInTheDocument()
|
|
88
|
-
expect(title).toHaveTextContent(
|
|
79
|
+
const canvas = within(canvasElement);
|
|
80
|
+
const main = canvas.getByRole("main");
|
|
81
|
+
expect(main).toBeInTheDocument();
|
|
82
|
+
const title = canvas.getByRole("heading");
|
|
83
|
+
expect(title).toBeInTheDocument();
|
|
84
|
+
expect(title).toHaveTextContent("Header Title");
|
|
89
85
|
},
|
|
90
|
-
}
|
|
86
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StoryObj, Meta } from "@storybook/react";
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react-vite";
|
|
2
2
|
|
|
3
|
-
import { within, expect } from "
|
|
3
|
+
import { within, expect } from "storybook/test";
|
|
4
4
|
|
|
5
5
|
import Link from "./link";
|
|
6
6
|
import "../../styles/link/link.css";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import { StoryObj, Meta } from "@storybook/react";
|
|
3
|
+
import { StoryObj, Meta } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
|
-
// import { within, userEvent } from "
|
|
5
|
+
// import { within, userEvent } from "storybook/test";
|
|
6
6
|
|
|
7
7
|
import List from "./list";
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
-
import { within, expect, userEvent } from "
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react-vite";
|
|
2
|
+
import { within, expect, userEvent } from "storybook/test";
|
|
3
3
|
|
|
4
4
|
import Popover from "./popover";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StoryFn } from "@storybook/react";
|
|
1
|
+
import { StoryFn } from "@storybook/react-vite";
|
|
2
2
|
import UI from "#components/ui";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -42,3 +42,4 @@ export const WithInstructions =
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export default WithInstructions;
|
|
45
|
+
WithInstructions.displayName = "WithInstructions";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
-
// import { within, userEvent, screen } from "
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react-vite";
|
|
2
|
+
// import { within, userEvent, screen } from "storybook/test";
|
|
3
3
|
|
|
4
4
|
import PageHeader, { HeaderVariants } from "./page-header.js";
|
|
5
5
|
import { Img } from "#components/images/img";
|
package/src/styles/index.css
CHANGED
|
@@ -428,9 +428,9 @@ h6:has(span:first-of-type) > span {
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
button {
|
|
431
|
-
--btn-xs: 0.
|
|
432
|
-
--btn-sm: 0.
|
|
433
|
-
--btn-md: 0.
|
|
431
|
+
--btn-xs: 0.5rem;
|
|
432
|
+
--btn-sm: 0.625rem;
|
|
433
|
+
--btn-md: 0.75rem;
|
|
434
434
|
--btn-lg: 1.3125rem;
|
|
435
435
|
--btn-pill: 100rem;
|
|
436
436
|
--btn-height: 2.5rem;
|