@fpkit/acss 0.5.3 → 0.5.5
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/chunk-QHIABQNQ.js +8 -0
- package/libs/chunk-QHIABQNQ.js.map +1 -0
- package/libs/chunk-ZOHIKF6I.cjs +31 -0
- package/libs/chunk-ZOHIKF6I.cjs.map +1 -0
- package/libs/components/breadcrumbs/breadcrumb.css +1 -1
- package/libs/components/breadcrumbs/breadcrumb.min.css +1 -1
- 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/components/details/details.css +1 -1
- package/libs/components/details/details.css.map +1 -1
- package/libs/components/details/details.min.css +2 -2
- package/libs/components/dialog/dialog.css +1 -0
- package/libs/components/dialog/dialog.css.map +1 -0
- package/libs/components/dialog/dialog.min.css +3 -0
- package/libs/components/icons/icon.css +1 -1
- package/libs/components/icons/icon.css.map +1 -1
- package/libs/components/icons/icon.min.css +2 -2
- package/libs/{icons-2f29127c.d.ts → icons-1f5afc0c.d.ts} +1 -32
- package/libs/icons.cjs +2 -2
- package/libs/icons.d.cts +1 -1
- package/libs/icons.d.ts +1 -1
- package/libs/icons.js +1 -1
- package/libs/index.cjs +39 -39
- 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 +27 -28
- package/libs/index.d.ts +27 -28
- package/libs/index.js +6 -6
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/alert-dialog/alert-dialog.stories.tsx +35 -0
- package/src/components/alert-dialog/alert-dialog.tsx +76 -0
- package/src/components/badge/badge.stories.tsx +21 -23
- package/src/components/breadcrumbs/breadcrumb.scss +2 -2
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +42 -47
- package/src/components/buttons/button.scss +40 -15
- package/src/components/buttons/button.stories.tsx +8 -1
- package/src/components/cards/card.stories.tsx +15 -15
- package/src/components/details/details.scss +6 -5
- package/src/components/details/details.stories.tsx +33 -30
- package/src/components/details/details.tsx +17 -17
- package/src/components/dialog/dialog.scss +61 -0
- package/src/components/dialog/dialog.stories.tsx +61 -0
- package/src/components/dialog/dialog.tsx +83 -0
- package/src/components/dialog/view/dialog-header.stories.tsx +43 -0
- package/src/components/dialog/view/dialog-header.tsx +32 -0
- package/src/components/form/form.stories.tsx +16 -16
- package/src/components/form/input.stories.tsx +62 -62
- package/src/components/form/select.stories.tsx +22 -15
- package/src/components/heading/heading.stories.tsx +32 -33
- package/src/components/heading/heading.tsx +1 -1
- package/src/components/icons/components/svg.tsx +0 -1
- package/src/components/icons/icon.scss +1 -3
- package/src/components/icons/icon.stories.tsx +45 -78
- package/src/components/icons/icon.tsx +0 -11
- package/src/components/icons/types.ts +1 -1
- package/src/components/images/figure.stories.tsx +13 -13
- package/src/components/images/img.stories.tsx +12 -12
- package/src/components/link/link.stories.tsx +32 -35
- package/src/components/link/link.tsx +27 -14
- package/src/components/list/list.stories.tsx +16 -16
- package/src/components/modal/dialog.tsx +13 -12
- package/src/components/modal/modal.tsx +28 -30
- package/src/components/nav/nav.stories.tsx +25 -24
- package/src/components/popover/popover.stories.tsx +17 -18
- package/src/components/progress/progress.stories.tsx +14 -20
- package/src/components/tag/tag.stories.tsx +17 -18
- package/src/components/text/text.stories.tsx +28 -29
- package/src/components/text-to-speech/TextToSpeech.stories.tsx +100 -101
- package/src/index.scss +22 -21
- package/src/index.ts +31 -30
- package/src/patterns/page/page-header.stories.tsx +17 -21
- package/src/sass/_globals.scss +7 -31
- package/src/sass/_styles.scss +2 -1
- package/src/sass/styles/_colors.scss +13 -0
- package/src/styles/breadcrumbs/breadcrumb.css +1 -1
- package/src/styles/buttons/button.css +25 -2
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/details/details.css +5 -3
- package/src/styles/details/details.css.map +1 -1
- package/src/styles/dialog/dialog.css +61 -0
- package/src/styles/dialog/dialog.css.map +1 -0
- package/src/styles/icons/icon.css +1 -3
- package/src/styles/icons/icon.css.map +1 -1
- package/src/styles/index.css +107 -30
- package/src/styles/index.css.map +1 -1
- package/libs/chunk-TBM2QIVT.js +0 -8
- package/libs/chunk-TBM2QIVT.js.map +0 -1
- package/libs/chunk-VAH6X2DZ.cjs +0 -31
- package/libs/chunk-VAH6X2DZ.cjs.map +0 -1
- package/src/components/readme.stories.mdx +0 -7
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import UI from
|
|
2
|
-
import React from
|
|
1
|
+
import UI from "../ui";
|
|
2
|
+
import React from "react";
|
|
3
3
|
|
|
4
4
|
export type LinkProps = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
href?: string;
|
|
6
|
+
|
|
7
|
+
target?: string;
|
|
8
|
+
|
|
9
|
+
rel?: string;
|
|
10
|
+
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
|
|
13
|
+
styles?: React.CSSProperties;
|
|
14
|
+
|
|
15
|
+
prefetch?: boolean;
|
|
16
|
+
|
|
17
|
+
btnStyle?: string;
|
|
18
|
+
|
|
19
|
+
onPointerDown?: (event: React.PointerEvent<HTMLAnchorElement>) => void;
|
|
7
20
|
} & React.ComponentProps<typeof UI> &
|
|
8
|
-
React.ComponentProps<
|
|
21
|
+
React.ComponentProps<"a">;
|
|
9
22
|
|
|
10
23
|
export const Link = ({
|
|
11
24
|
href,
|
|
@@ -18,14 +31,14 @@ export const Link = ({
|
|
|
18
31
|
onPointerDown,
|
|
19
32
|
...props
|
|
20
33
|
}: LinkProps) => {
|
|
21
|
-
let relValue = rel
|
|
34
|
+
let relValue = rel;
|
|
22
35
|
|
|
23
|
-
if (target ===
|
|
24
|
-
relValue = `noopener noreferrer ${prefetch ?
|
|
36
|
+
if (target === "_blank")
|
|
37
|
+
relValue = `noopener noreferrer ${prefetch ? "prefetch" : ""}`;
|
|
25
38
|
|
|
26
39
|
const handleOnpointerDown = (e: React.PointerEvent<HTMLAnchorElement>) => {
|
|
27
|
-
if (onPointerDown) onPointerDown?.(e)
|
|
28
|
-
}
|
|
40
|
+
if (onPointerDown) onPointerDown?.(e);
|
|
41
|
+
};
|
|
29
42
|
|
|
30
43
|
return (
|
|
31
44
|
<UI
|
|
@@ -41,8 +54,8 @@ export const Link = ({
|
|
|
41
54
|
>
|
|
42
55
|
{children}
|
|
43
56
|
</UI>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
46
59
|
|
|
47
|
-
export default Link
|
|
48
|
-
Link.displayName =
|
|
60
|
+
export default Link;
|
|
61
|
+
Link.displayName = "Link";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
|
|
3
|
-
import { StoryObj, Meta } from
|
|
3
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
4
4
|
|
|
5
|
-
import { within, userEvent } from
|
|
5
|
+
// import { within, userEvent } from "@storybook/test";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import List from './list'
|
|
7
|
+
import List from "./list";
|
|
9
8
|
|
|
10
9
|
const meta: Meta<typeof List> = {
|
|
11
|
-
title:
|
|
10
|
+
title: "FP.React Components/List",
|
|
11
|
+
tags: ["version:1.0.0"],
|
|
12
12
|
component: List,
|
|
13
|
-
} as Meta
|
|
13
|
+
} as Meta;
|
|
14
14
|
|
|
15
15
|
const listElm = (
|
|
16
16
|
<>
|
|
@@ -18,10 +18,10 @@ const listElm = (
|
|
|
18
18
|
<List.ListItem>About</List.ListItem>
|
|
19
19
|
<List.ListItem>Contact</List.ListItem>
|
|
20
20
|
</>
|
|
21
|
-
)
|
|
21
|
+
);
|
|
22
22
|
|
|
23
|
-
export default meta
|
|
24
|
-
type Story = StoryObj<typeof List
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof List>;
|
|
25
25
|
|
|
26
26
|
export const DefaultList: Story = {
|
|
27
27
|
args: {
|
|
@@ -33,25 +33,25 @@ export const DefaultList: Story = {
|
|
|
33
33
|
control: false,
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
|
-
} as Story
|
|
36
|
+
} as Story;
|
|
37
37
|
|
|
38
38
|
export const UnstyledList: Story = {
|
|
39
39
|
args: {
|
|
40
40
|
...DefaultList.args,
|
|
41
|
-
role:
|
|
41
|
+
role: "list",
|
|
42
42
|
},
|
|
43
43
|
parameters: {
|
|
44
44
|
docs: {
|
|
45
45
|
description: {
|
|
46
|
-
story:
|
|
46
|
+
story: "Another description `on the story`, with some markdown",
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
|
-
} as Story
|
|
50
|
+
} as Story;
|
|
51
51
|
|
|
52
52
|
export const InlineList: Story = {
|
|
53
53
|
args: {
|
|
54
54
|
...UnstyledList.args,
|
|
55
|
-
|
|
55
|
+
"data-list": "inline",
|
|
56
56
|
},
|
|
57
|
-
} as Story
|
|
57
|
+
} as Story;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import UI from
|
|
2
|
-
import React from
|
|
1
|
+
import UI from "../ui";
|
|
2
|
+
import React from "react";
|
|
3
3
|
|
|
4
4
|
export type DialogProps = {
|
|
5
5
|
/**
|
|
6
6
|
* React ref for dialog element
|
|
7
7
|
*/
|
|
8
|
-
modalRef: React.RefObject<HTMLDialogElement
|
|
8
|
+
modalRef: React.RefObject<HTMLDialogElement>;
|
|
9
9
|
/**
|
|
10
10
|
* Handle close modal event
|
|
11
11
|
*/
|
|
12
|
-
closeModal?: (e: React.SyntheticEvent<HTMLDialogElement>) => void
|
|
12
|
+
closeModal?: (e: React.SyntheticEvent<HTMLDialogElement>) => void;
|
|
13
13
|
/**
|
|
14
14
|
* open modal on mount
|
|
15
15
|
*/
|
|
16
|
-
openOnMount?: boolean
|
|
17
|
-
} & React.ComponentProps<typeof UI
|
|
16
|
+
openOnMount?: boolean;
|
|
17
|
+
} & React.ComponentProps<typeof UI>;
|
|
18
18
|
/**
|
|
19
19
|
* Dialog component
|
|
20
20
|
*/
|
|
21
|
-
export const
|
|
21
|
+
export const ModalDialog = ({
|
|
22
22
|
id,
|
|
23
23
|
children,
|
|
24
24
|
classes,
|
|
@@ -28,9 +28,9 @@ export const Dialog = ({
|
|
|
28
28
|
}: DialogProps) => {
|
|
29
29
|
const handleCloseModal = (e: React.SyntheticEvent<HTMLDialogElement>) => {
|
|
30
30
|
if (e.currentTarget === e.target) {
|
|
31
|
-
e.currentTarget.close()
|
|
31
|
+
e.currentTarget.close();
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<UI
|
|
@@ -44,7 +44,8 @@ export const Dialog = ({
|
|
|
44
44
|
>
|
|
45
45
|
{children}
|
|
46
46
|
</UI>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
export default React.memo(ModalDialog);
|
|
51
|
+
ModalDialog.displayName = "Dialog";
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ComponentProps } from
|
|
3
|
-
import { Button } from
|
|
4
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentProps } from "../../types";
|
|
3
|
+
import { Button } from "../buttons/button";
|
|
4
|
+
import { ModalDialog } from "./dialog";
|
|
5
5
|
|
|
6
6
|
export interface ModalProps extends ComponentProps {
|
|
7
7
|
/**
|
|
8
8
|
* The child component/content for open button
|
|
9
9
|
*/
|
|
10
|
-
openChild?: React.ReactNode
|
|
10
|
+
openChild?: React.ReactNode;
|
|
11
11
|
/**
|
|
12
12
|
* The child component/content for close button
|
|
13
13
|
*/
|
|
14
|
-
closeChild?: React.ReactNode
|
|
14
|
+
closeChild?: React.ReactNode;
|
|
15
15
|
/**
|
|
16
16
|
* The child component/content for modal header
|
|
17
17
|
*/
|
|
18
|
-
modalHeader?: React.ReactNode
|
|
18
|
+
modalHeader?: React.ReactNode;
|
|
19
19
|
/**
|
|
20
20
|
* The child component/content for modal footer
|
|
21
21
|
*/
|
|
22
|
-
modalFooter?: React.ReactNode
|
|
22
|
+
modalFooter?: React.ReactNode;
|
|
23
23
|
/**
|
|
24
24
|
* The child component/content for modal body
|
|
25
25
|
*/
|
|
26
|
-
children: React.ReactNode
|
|
26
|
+
children: React.ReactNode;
|
|
27
27
|
/**
|
|
28
28
|
* Open modal on mount when set to true
|
|
29
29
|
*/
|
|
30
|
-
showOpen?: boolean
|
|
30
|
+
showOpen?: boolean;
|
|
31
31
|
}
|
|
32
32
|
export const Modal = ({
|
|
33
33
|
openChild,
|
|
@@ -38,24 +38,22 @@ export const Modal = ({
|
|
|
38
38
|
showOpen = false,
|
|
39
39
|
...props
|
|
40
40
|
}: ModalProps) => {
|
|
41
|
-
const dialogRef = React.useRef<HTMLDialogElement>(null)
|
|
41
|
+
const dialogRef = React.useRef<HTMLDialogElement>(null);
|
|
42
42
|
const openModal = (): void => {
|
|
43
43
|
if (dialogRef.current) {
|
|
44
|
-
if(showOpen)
|
|
45
|
-
dialogRef.current.
|
|
46
|
-
else
|
|
47
|
-
dialogRef.current.showModal()
|
|
44
|
+
if (showOpen) dialogRef.current.show();
|
|
45
|
+
else dialogRef.current.showModal();
|
|
48
46
|
}
|
|
49
|
-
}
|
|
47
|
+
};
|
|
50
48
|
const closeModal = () => {
|
|
51
49
|
if (dialogRef.current) {
|
|
52
|
-
dialogRef.current.close()
|
|
50
|
+
dialogRef.current.close();
|
|
53
51
|
}
|
|
54
|
-
}
|
|
52
|
+
};
|
|
55
53
|
|
|
56
54
|
return (
|
|
57
55
|
<>
|
|
58
|
-
<
|
|
56
|
+
<ModalDialog modalRef={dialogRef} openOnMount={showOpen} {...props}>
|
|
59
57
|
<section>
|
|
60
58
|
{modalHeader}
|
|
61
59
|
{children}
|
|
@@ -64,22 +62,22 @@ export const Modal = ({
|
|
|
64
62
|
<Button
|
|
65
63
|
type="button"
|
|
66
64
|
pointerDown={() => {
|
|
67
|
-
closeModal()
|
|
65
|
+
closeModal();
|
|
68
66
|
}}
|
|
69
67
|
>
|
|
70
|
-
{closeChild ||
|
|
71
|
-
</Button>{
|
|
68
|
+
{closeChild || "Close"}
|
|
69
|
+
</Button>{" "}
|
|
72
70
|
</div>
|
|
73
71
|
)}
|
|
74
72
|
</section>
|
|
75
|
-
</
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
</ModalDialog>
|
|
74
|
+
{!showOpen && (
|
|
75
|
+
<Button type="button" pointerDown={openModal}>
|
|
76
|
+
{openChild || "Open Modal"}
|
|
77
|
+
</Button>
|
|
80
78
|
)}
|
|
81
79
|
</>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
84
82
|
|
|
85
|
-
Modal.displayName =
|
|
83
|
+
Modal.displayName = "Modal";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, expect } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
import React from
|
|
4
|
+
import React from "react";
|
|
5
5
|
|
|
6
|
-
import Nav from
|
|
7
|
-
import Link from
|
|
6
|
+
import Nav from "./nav";
|
|
7
|
+
import Link from "../link/link";
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof Nav> = {
|
|
10
|
-
title:
|
|
10
|
+
title: "FP.REACT Components/Nav",
|
|
11
11
|
component: Nav,
|
|
12
|
+
tags: ["rc"],
|
|
12
13
|
parameters: {
|
|
13
|
-
actions: { argTypesRegex:
|
|
14
|
+
actions: { argTypesRegex: "^on.*" },
|
|
14
15
|
docs: {
|
|
15
16
|
description: {
|
|
16
|
-
component:
|
|
17
|
+
component: "Nav description here...",
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
20
|
},
|
|
@@ -28,22 +29,22 @@ const meta: Meta<typeof Nav> = {
|
|
|
28
29
|
</Nav.Item>
|
|
29
30
|
</Nav.List>
|
|
30
31
|
),
|
|
31
|
-
id:
|
|
32
|
-
classes:
|
|
32
|
+
id: "nav",
|
|
33
|
+
classes: "nav",
|
|
33
34
|
},
|
|
34
|
-
} as Story
|
|
35
|
+
} as Story;
|
|
35
36
|
|
|
36
|
-
export default meta
|
|
37
|
-
type Story = StoryObj<typeof Nav
|
|
37
|
+
export default meta;
|
|
38
|
+
type Story = StoryObj<typeof Nav>;
|
|
38
39
|
|
|
39
40
|
export const NavComponent: Story = {
|
|
40
41
|
args: {},
|
|
41
42
|
play: async ({ canvasElement }) => {
|
|
42
|
-
const canvas = within(canvasElement)
|
|
43
|
-
expect(canvas.getAllByRole(
|
|
44
|
-
expect(canvas.getByText(/link 1/i)).toBeInTheDocument()
|
|
43
|
+
const canvas = within(canvasElement);
|
|
44
|
+
expect(canvas.getAllByRole("link")).toHaveLength(2);
|
|
45
|
+
expect(canvas.getByText(/link 1/i)).toBeInTheDocument();
|
|
45
46
|
},
|
|
46
|
-
}
|
|
47
|
+
};
|
|
47
48
|
|
|
48
49
|
export const NavSection: Story = {
|
|
49
50
|
args: {
|
|
@@ -57,11 +58,11 @@ export const NavSection: Story = {
|
|
|
57
58
|
),
|
|
58
59
|
},
|
|
59
60
|
play: async ({ canvasElement }) => {
|
|
60
|
-
const canvas = within(canvasElement)
|
|
61
|
-
expect(canvas.getByText(
|
|
62
|
-
expect(canvas.getByText(
|
|
61
|
+
const canvas = within(canvasElement);
|
|
62
|
+
expect(canvas.getByText("Link 1")).toBeInTheDocument();
|
|
63
|
+
expect(canvas.getByText("Link 2")).toBeInTheDocument();
|
|
63
64
|
},
|
|
64
|
-
} as Story
|
|
65
|
+
} as Story;
|
|
65
66
|
|
|
66
67
|
export const NavBlock: Story = {
|
|
67
68
|
args: {
|
|
@@ -75,12 +76,12 @@ export const NavBlock: Story = {
|
|
|
75
76
|
</>
|
|
76
77
|
),
|
|
77
78
|
},
|
|
78
|
-
} as Story
|
|
79
|
+
} as Story;
|
|
79
80
|
|
|
80
81
|
export const MultipleNavs: Story = {
|
|
81
82
|
args: {
|
|
82
83
|
...NavSection.args,
|
|
83
|
-
classes:
|
|
84
|
+
classes: "navbar",
|
|
84
85
|
children: (
|
|
85
86
|
<>
|
|
86
87
|
<Nav.List>
|
|
@@ -94,4 +95,4 @@ export const MultipleNavs: Story = {
|
|
|
94
95
|
</>
|
|
95
96
|
),
|
|
96
97
|
},
|
|
97
|
-
} as Story
|
|
98
|
+
} as Story;
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, expect, userEvent } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect, userEvent } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import Popover from './popover'
|
|
6
|
-
import { getByText } from '@testing-library/react'
|
|
4
|
+
import Popover from "./popover";
|
|
7
5
|
|
|
8
6
|
const meta: Meta<typeof Popover> = {
|
|
9
|
-
title:
|
|
7
|
+
title: "FP.React Components/Basic Popover",
|
|
10
8
|
component: Popover,
|
|
9
|
+
tags: ["experimental"],
|
|
11
10
|
args: {
|
|
12
|
-
children:
|
|
13
|
-
popoverTrigger:
|
|
11
|
+
children: "Hi, I am a popover.",
|
|
12
|
+
popoverTrigger: "Hover here",
|
|
14
13
|
styles: Popover.styles,
|
|
15
14
|
},
|
|
16
|
-
} as Meta
|
|
15
|
+
} as Meta;
|
|
17
16
|
|
|
18
|
-
export default meta
|
|
19
|
-
type Story = StoryObj<typeof Popover
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof Popover>;
|
|
20
19
|
|
|
21
20
|
export const PopoverComponent: Story = {
|
|
22
21
|
args: {},
|
|
23
22
|
play: async ({ canvasElement }) => {
|
|
24
|
-
const canvas = within(canvasElement)
|
|
25
|
-
expect(await canvas.queryByText(
|
|
26
|
-
userEvent.hover(canvas.getByText(
|
|
27
|
-
expect(await canvas.findByText(
|
|
28
|
-
await userEvent.unhover(canvas.getByText(
|
|
29
|
-
expect(canvas.queryByText(
|
|
23
|
+
const canvas = within(canvasElement);
|
|
24
|
+
expect(await canvas.queryByText("Hover here")).toBeInTheDocument();
|
|
25
|
+
userEvent.hover(canvas.getByText("Hover here"));
|
|
26
|
+
expect(await canvas.findByText("Hi, I am a popover.")).toBeInTheDocument();
|
|
27
|
+
await userEvent.unhover(canvas.getByText("Hover here"));
|
|
28
|
+
expect(canvas.queryByText("Hi, I am a popover.")).not.toBeInTheDocument();
|
|
30
29
|
},
|
|
31
|
-
}
|
|
30
|
+
};
|
|
@@ -1,51 +1,45 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, userEvent, screen } from '@storybook/test'
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
3
2
|
|
|
3
|
+
import "../../styles/progress/progress.css";
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import Progress from './progress'
|
|
5
|
+
import Progress from "./progress";
|
|
8
6
|
|
|
9
7
|
const meta: Meta<typeof Progress> = {
|
|
10
|
-
title:
|
|
8
|
+
title: "FP.React Components/Progress",
|
|
11
9
|
component: Progress,
|
|
12
|
-
|
|
10
|
+
tags: ["experimental"],
|
|
13
11
|
decorators: [
|
|
14
12
|
(Story) => (
|
|
15
|
-
<div style={{ minWidth:
|
|
13
|
+
<div style={{ minWidth: "500px", height: "100%" }}>
|
|
16
14
|
<Story />
|
|
17
15
|
</div>
|
|
18
16
|
),
|
|
19
17
|
],
|
|
20
|
-
} as Meta
|
|
18
|
+
} as Meta;
|
|
21
19
|
|
|
22
|
-
export default meta
|
|
23
|
-
type Story = StoryObj<typeof Progress
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof Progress>;
|
|
24
22
|
|
|
25
23
|
export const ProgressComponent: Story = {
|
|
26
|
-
name:
|
|
24
|
+
name: "Progress Bar",
|
|
27
25
|
args: {
|
|
28
26
|
isBusy: true,
|
|
29
27
|
},
|
|
30
|
-
|
|
31
|
-
const canvas = within(canvasElement)
|
|
32
|
-
//expect(canvas).toBeInTheDocument()
|
|
33
|
-
},
|
|
34
|
-
} as Story
|
|
28
|
+
} as Story;
|
|
35
29
|
|
|
36
30
|
export const ProgressIndicator: Story = {
|
|
37
31
|
args: {
|
|
38
32
|
value: 3,
|
|
39
33
|
max: 10,
|
|
40
34
|
},
|
|
41
|
-
} as Story
|
|
35
|
+
} as Story;
|
|
42
36
|
|
|
43
37
|
export const RedProgress: Story = {
|
|
44
38
|
args: {
|
|
45
39
|
...ProgressIndicator.args,
|
|
46
40
|
styles: {
|
|
47
|
-
|
|
41
|
+
"--progress-color": "red",
|
|
48
42
|
},
|
|
49
43
|
value: 7,
|
|
50
44
|
},
|
|
51
|
-
} as Story
|
|
45
|
+
} as Story;
|
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, expect } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import './tag.scss'
|
|
4
|
+
import Tag from "./tag";
|
|
5
|
+
import "./tag.scss";
|
|
7
6
|
|
|
8
7
|
const meta: Meta<typeof Tag> = {
|
|
9
|
-
title:
|
|
8
|
+
title: "FP.React Components/Tag",
|
|
10
9
|
component: Tag,
|
|
10
|
+
tags: ["beta"],
|
|
11
11
|
args: {
|
|
12
|
-
|
|
13
|
-
children: 'Basic Tag',
|
|
12
|
+
children: "Basic Tag",
|
|
14
13
|
// styles: Tag.styles,
|
|
15
14
|
},
|
|
16
|
-
} as Meta
|
|
15
|
+
} as Meta;
|
|
17
16
|
|
|
18
|
-
export default meta
|
|
19
|
-
type Story = StoryObj<typeof Tag
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof Tag>;
|
|
20
19
|
|
|
21
20
|
export const TagComponent: Story = {
|
|
22
21
|
args: {},
|
|
23
22
|
play: async ({ canvasElement }) => {
|
|
24
|
-
const canvas = within(canvasElement)
|
|
25
|
-
expect(canvas.queryByText(/basic tag/i)).toBeInTheDocument()
|
|
23
|
+
const canvas = within(canvasElement);
|
|
24
|
+
expect(canvas.queryByText(/basic tag/i)).toBeInTheDocument();
|
|
26
25
|
},
|
|
27
|
-
}
|
|
26
|
+
};
|
|
28
27
|
|
|
29
28
|
export const Beta: Story = {
|
|
30
29
|
args: {
|
|
31
|
-
|
|
30
|
+
"data-tag": "beta",
|
|
32
31
|
},
|
|
33
|
-
} as Story
|
|
32
|
+
} as Story;
|
|
34
33
|
|
|
35
34
|
export const Production: Story = {
|
|
36
35
|
args: {
|
|
37
|
-
|
|
36
|
+
"data-tag": "production",
|
|
38
37
|
},
|
|
39
|
-
} as Story
|
|
38
|
+
} as Story;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, expect} from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import Text from './text'
|
|
4
|
+
import Text from "./text";
|
|
6
5
|
|
|
7
6
|
const meta: Meta<typeof Text> = {
|
|
8
|
-
title:
|
|
7
|
+
title: "FP.REACT Components/Text",
|
|
9
8
|
component: Text,
|
|
9
|
+
tags: ["version:1.0.0"],
|
|
10
10
|
args: {
|
|
11
|
-
// @ts-ignore
|
|
12
11
|
children:
|
|
13
|
-
|
|
12
|
+
"Exercitation non voluptate fugiat amet dolor tempor consectetur. Eu esse adipisicing laboris duis et velit in quis et sunt pariatur tempor laborum nisi. Et id amet ullamco culpa irure nulla esse dolore velit esse.",
|
|
14
13
|
},
|
|
15
|
-
} as Story
|
|
14
|
+
} as Story;
|
|
16
15
|
|
|
17
|
-
export default meta
|
|
18
|
-
type Story = StoryObj<typeof Text
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof Text>;
|
|
19
18
|
|
|
20
19
|
export const ParagraphText: Story = {
|
|
21
20
|
args: {},
|
|
@@ -23,45 +22,45 @@ export const ParagraphText: Story = {
|
|
|
23
22
|
// const canvas = within(canvasElement)
|
|
24
23
|
// expect(canvas.getByText(/link/i)).toBeInTheDocument()
|
|
25
24
|
// },
|
|
26
|
-
}
|
|
25
|
+
};
|
|
27
26
|
|
|
28
27
|
export const span: Story = {
|
|
29
28
|
args: {
|
|
30
|
-
as:
|
|
31
|
-
children:
|
|
29
|
+
as: "span",
|
|
30
|
+
children: "Heading Text",
|
|
32
31
|
},
|
|
33
32
|
play: async ({ canvasElement }) => {
|
|
34
|
-
const canvas = within(canvasElement)
|
|
35
|
-
expect(canvas.getByText(/heading/i)).toBeInTheDocument()
|
|
33
|
+
const canvas = within(canvasElement);
|
|
34
|
+
expect(canvas.getByText(/heading/i)).toBeInTheDocument();
|
|
36
35
|
},
|
|
37
|
-
} as Story
|
|
36
|
+
} as Story;
|
|
38
37
|
|
|
39
38
|
export const Blockquote: Story = {
|
|
40
39
|
args: {
|
|
41
|
-
as:
|
|
40
|
+
as: "blockquote",
|
|
42
41
|
children:
|
|
43
|
-
|
|
42
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.",
|
|
44
43
|
},
|
|
45
|
-
} as Story
|
|
44
|
+
} as Story;
|
|
46
45
|
|
|
47
46
|
export const Strong: Story = {
|
|
48
47
|
args: {
|
|
49
|
-
as:
|
|
50
|
-
children:
|
|
48
|
+
as: "strong",
|
|
49
|
+
children: "Emphasis Text",
|
|
51
50
|
},
|
|
52
51
|
play: async ({ canvasElement }) => {
|
|
53
|
-
const canvas = within(canvasElement)
|
|
54
|
-
expect(canvas.getByText(/emphasis/i)).toBeInTheDocument()
|
|
52
|
+
const canvas = within(canvasElement);
|
|
53
|
+
expect(canvas.getByText(/emphasis/i)).toBeInTheDocument();
|
|
55
54
|
},
|
|
56
|
-
} as Story
|
|
55
|
+
} as Story;
|
|
57
56
|
|
|
58
57
|
export const Code: Story = {
|
|
59
58
|
args: {
|
|
60
|
-
as:
|
|
61
|
-
children:
|
|
59
|
+
as: "code",
|
|
60
|
+
children: "Code Text",
|
|
62
61
|
},
|
|
63
62
|
play: async ({ canvasElement }) => {
|
|
64
|
-
const canvas = within(canvasElement)
|
|
65
|
-
expect(canvas.getByText(/code/i)).toBeInTheDocument()
|
|
63
|
+
const canvas = within(canvasElement);
|
|
64
|
+
expect(canvas.getByText(/code/i)).toBeInTheDocument();
|
|
66
65
|
},
|
|
67
|
-
} as Story
|
|
66
|
+
} as Story;
|