@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.
Files changed (59) hide show
  1. package/libs/components/buttons/button.css +1 -1
  2. package/libs/components/buttons/button.css.map +1 -1
  3. package/libs/components/buttons/button.min.css +2 -2
  4. package/libs/index.cjs +2 -2
  5. package/libs/index.cjs.map +1 -1
  6. package/libs/index.css +1 -1
  7. package/libs/index.css.map +1 -1
  8. package/libs/index.d.cts +1 -6
  9. package/libs/index.d.ts +1 -6
  10. package/libs/index.js +2 -2
  11. package/libs/index.js.map +1 -1
  12. package/package.json +6 -2
  13. package/src/components/README.mdx +1 -1
  14. package/src/components/alert/README.mdx +1 -1
  15. package/src/components/alert/alert.stories.tsx +2 -2
  16. package/src/components/alert/elements/README.mdx +1 -1
  17. package/src/components/alert/elements/dismiss-button.stories.tsx +2 -2
  18. package/src/components/badge/badge.mdx +1 -1
  19. package/src/components/badge/badge.stories.tsx +2 -2
  20. package/src/components/breadcrumbs/README.mdx +91 -0
  21. package/src/components/breadcrumbs/breadcrumb.stories.tsx +2 -2
  22. package/src/components/breadcrumbs/breadcrumb.tsx +92 -87
  23. package/src/components/buttons/README.mdx +1 -1
  24. package/src/components/buttons/button.scss +3 -3
  25. package/src/components/buttons/button.stories.tsx +2 -2
  26. package/src/components/buttons/button.test.tsx +1 -1
  27. package/src/components/cards/card.stories.tsx +2 -2
  28. package/src/components/details/README.mdx +1 -1
  29. package/src/components/details/details.stories.tsx +2 -2
  30. package/src/components/dialog/README.mdx +1 -1
  31. package/src/components/dialog/dialog-modal.stories.tsx +2 -2
  32. package/src/components/dialog/dialog-modal.tsx +1 -1
  33. package/src/components/dialog/dialog.stories.tsx +2 -2
  34. package/src/components/dialog/views/README.mdx +1 -1
  35. package/src/components/dialog/views/dialog-header.stories.tsx +2 -2
  36. package/src/components/form/form.stories.tsx +2 -2
  37. package/src/components/form/input.stories.tsx +2 -2
  38. package/src/components/form/inputs.tsx +18 -24
  39. package/src/components/form/select.stories.tsx +2 -2
  40. package/src/components/fp.test.tsx +52 -50
  41. package/src/components/heading/heading.stories.tsx +2 -2
  42. package/src/components/icons/icon.stories.tsx +1 -1
  43. package/src/components/images/figure.stories.tsx +2 -2
  44. package/src/components/images/img.stories.tsx +2 -2
  45. package/src/components/layout/footer.stories.tsx +10 -19
  46. package/src/components/layout/landmarks.stories.tsx +22 -24
  47. package/src/components/layout/main.stories.tsx +21 -25
  48. package/src/components/link/link.stories.tsx +2 -2
  49. package/src/components/list/list.stories.tsx +2 -2
  50. package/src/components/nav/nav.stories.tsx +2 -2
  51. package/src/components/popover/popover.stories.tsx +2 -2
  52. package/src/components/progress/progress.stories.tsx +1 -1
  53. package/src/components/tag/tag.stories.tsx +2 -2
  54. package/src/components/text/text.stories.tsx +2 -2
  55. package/src/components/text-to-speech/TextToSpeech.stories.tsx +1 -1
  56. package/src/decorators/instructions.tsx +2 -1
  57. package/src/patterns/page/page-header.stories.tsx +2 -2
  58. package/src/styles/buttons/button.css +3 -3
  59. package/src/styles/index.css +3 -3
@@ -1,56 +1,58 @@
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', () => {
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: 'red' }}>
32
+ <FP renderStyles={false} styles={{ backgroundColor: "red" }}>
33
33
  Hello, world!
34
- </FP>,
35
- )
36
- expect(container.firstChild).not.toHaveStyle('background-color: red;')
37
- })
34
+ </FP>
35
+ );
36
+ expect(container.firstChild).not.toHaveStyle("background-color: red;");
37
+ });
38
38
 
39
- it('passes through props', async () => {
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
- await userEvent.click(screen.getByRole('button'))
48
- expect(handleClick).toHaveBeenCalled()
49
- })
50
-
51
- it('applies ref', () => {
52
- const ref = React.createRef<HTMLDivElement>()
53
- render(<FP ref={ref}>Hello, world!</FP>)
54
- expect(ref.current).toBeTruthy()
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,5 +1,5 @@
1
- import { StoryObj, Meta } from "@storybook/react";
2
- import { within, expect } from "@storybook/test";
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
+ import { within, expect } from "storybook/test";
3
3
 
4
4
  import Heading from "./heading";
5
5
 
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
 
3
- import { Meta, StoryObj } from "@storybook/react";
3
+ import { Meta, StoryObj } from "@storybook/react-vite";
4
4
 
5
5
  import { Button } from "#components/buttons/button";
6
6
  import { Icon } from "./icon";
@@ -1,5 +1,5 @@
1
- import { StoryObj, Meta } from "@storybook/react";
2
- import { within, expect } from "@storybook/test";
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
+ import { within, expect } from "storybook/test";
3
3
 
4
4
  import Figure from "./figure";
5
5
 
@@ -1,5 +1,5 @@
1
- import { StoryObj, Meta } from "@storybook/react";
2
- import { within, expect } from "@storybook/test";
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
+ import { within, expect } from "storybook/test";
3
3
 
4
4
  import Img from "./img";
5
5
 
@@ -1,34 +1,25 @@
1
- import { StoryObj, Meta } from '@storybook/react'
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
2
  /**
3
3
  * Import testing library dependencies
4
4
  */
5
- import { within, userEvent } from '@storybook/test'
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: 'FP.React Components/Layout/Landmarks',
14
+ title: "FP.React Components/Layout/Landmarks",
16
15
  component: Footer,
17
16
  args: {
18
- children: 'Main Landmark',
19
- // @ts-ignore
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 '@storybook/react'
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
2
  /**
3
3
  * Import testing library dependencies
4
4
  */
5
- import { within, expect } from '@storybook/test'
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 { Header } from './landmarks'
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: 'FP.React Components/Layout/Landmarks',
16
+ title: "FP.React Components/Layout/Landmarks",
18
17
  component: Header,
19
18
  args: {
20
- children: 'Default Header',
21
- // @ts-ignore
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: 'red' },
43
- classNames: 'header-class',
44
- 'data-styles': 'blue',
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('banner')
49
- expect(header).toBeInTheDocument()
50
- const title = canvas.getByRole('heading')
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 '@storybook/react'
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
2
  /**
3
3
  * Import testing library dependencies
4
4
  */
5
- import { within, userEvent, expect } from '@storybook/test'
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: 'FP.React Components/Layout/Landmarks',
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
- // @ts-ignore
26
- 'data-testid': 'main',
23
+ "data-testid": "main",
27
24
  },
28
25
  decorators: [
29
26
  (Story) => (
30
- <div style={{ minHeight: '80vh', display: 'flex' }}>
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('main')
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('main')
85
- expect(main).toBeInTheDocument()
86
- const title = canvas.getByRole('heading')
87
- expect(title).toBeInTheDocument()
88
- expect(title).toHaveTextContent('Header Title')
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 "@storybook/test";
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 "@storybook/test";
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 } from "@storybook/test";
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
+ import { within, expect } from "storybook/test";
3
3
 
4
4
  import React from "react";
5
5
 
@@ -1,5 +1,5 @@
1
- import { StoryObj, Meta } from "@storybook/react";
2
- import { within, expect, userEvent } from "@storybook/test";
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 { StoryObj, Meta } from "@storybook/react";
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
2
 
3
3
  import "../../styles/progress/progress.css";
4
4
 
@@ -1,5 +1,5 @@
1
- import { StoryObj, Meta } from "@storybook/react";
2
- import { within, expect } from "@storybook/test";
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
+ import { within, expect } from "storybook/test";
3
3
 
4
4
  import Tag from "./tag";
5
5
  import "./tag.scss";
@@ -1,5 +1,5 @@
1
- import { StoryObj, Meta } from "@storybook/react";
2
- import { within, expect } from "@storybook/test";
1
+ import { StoryObj, Meta } from "@storybook/react-vite";
2
+ import { within, expect } from "storybook/test";
3
3
 
4
4
  import Text from "./text";
5
5
 
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from "@storybook/react";
1
+ import { Meta, StoryObj } from "@storybook/react-vite";
2
2
  import TextToSpeech from "./TextToSpeech";
3
3
  import "./text-to-speech.scss";
4
4
 
@@ -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 "@storybook/test";
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";
@@ -1,7 +1,7 @@
1
1
  button {
2
- --btn-xs: 0.6rem;
3
- --btn-sm: 0.7rem;
4
- --btn-md: 0.85rem;
2
+ --btn-xs: 0.5rem;
3
+ --btn-sm: 0.625rem;
4
+ --btn-md: 0.75rem;
5
5
  --btn-lg: 1.3125rem;
6
6
  --btn-pill: 100rem;
7
7
  --btn-height: 2.5rem;
@@ -428,9 +428,9 @@ h6:has(span:first-of-type) > span {
428
428
  }
429
429
 
430
430
  button {
431
- --btn-xs: 0.6rem;
432
- --btn-sm: 0.7rem;
433
- --btn-md: 0.85rem;
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;