@fpkit/acss 0.5.4 → 0.5.6
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-PWVRDQ3R.js +8 -0
- package/libs/chunk-PWVRDQ3R.js.map +1 -0
- package/libs/chunk-SVS4MX3U.cjs +31 -0
- package/libs/chunk-SVS4MX3U.cjs.map +1 -0
- package/libs/{icons-2f29127c.d.ts → icons-31ace3de.d.ts} +87 -81
- 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 +42 -42
- package/libs/index.cjs.map +1 -1
- package/libs/index.d.cts +59 -29
- package/libs/index.d.ts +59 -29
- package/libs/index.js +7 -7
- package/libs/index.js.map +1 -1
- package/package.json +4 -3
- package/src/components/README.mdx +84 -0
- package/src/components/alert/README.mdx +86 -0
- package/src/components/alert/alert.mdx +74 -0
- package/src/components/alert/alert.scss +80 -0
- package/src/components/alert/alert.stories.tsx +132 -0
- package/src/components/alert/alert.tsx +154 -0
- package/src/components/alert/elements/README.mdx +77 -0
- package/src/components/alert/elements/dismiss-button.stories.tsx +31 -0
- package/src/components/alert/elements/dismiss-button.tsx +28 -0
- package/src/components/badge/badge.mdx +124 -0
- package/src/components/badge/badge.scss +4 -4
- 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 +41 -15
- package/src/components/buttons/button.stories.tsx +8 -1
- package/src/components/buttons/button.test.tsx +72 -72
- package/src/components/cards/card.stories.tsx +15 -15
- package/src/components/details/details.scss +26 -6
- package/src/components/details/details.stories.tsx +33 -30
- package/src/components/details/details.tsx +17 -17
- package/src/components/dialog/README.mdx +187 -0
- package/src/components/dialog/dialog-modal.stories.tsx +113 -0
- package/src/components/dialog/dialog-modal.tsx +111 -0
- package/src/components/dialog/dialog.scss +76 -0
- package/src/components/dialog/dialog.stories.tsx +116 -0
- package/src/components/dialog/dialog.tsx +128 -0
- package/src/components/dialog/hooks/useClickOutside.ts +33 -0
- package/src/components/dialog/views/README.mdx +182 -0
- package/src/components/dialog/views/dialog-footer.tsx +45 -0
- package/src/components/dialog/views/dialog-header.stories.tsx +42 -0
- package/src/components/dialog/views/dialog-header.tsx +61 -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/add.tsx +14 -14
- package/src/components/icons/components/alert-solid.tsx +36 -0
- package/src/components/icons/components/alert-square-solid.tsx +36 -0
- package/src/components/icons/components/info-solid.tsx +40 -0
- package/src/components/icons/components/info.tsx +36 -0
- package/src/components/icons/components/question-solid.tsx +36 -0
- package/src/components/icons/components/success-solid.tsx +36 -0
- package/src/components/icons/components/svg.tsx +0 -1
- package/src/components/icons/components/warn-solid.tsx +36 -0
- package/src/components/icons/icon.scss +1 -3
- package/src/components/icons/icon.stories.tsx +87 -78
- package/src/components/icons/icon.tsx +57 -52
- package/src/components/icons/index.ts +36 -29
- 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/components/ui.tsx +28 -25
- package/src/decorators/instructions.tsx +44 -0
- package/src/hooks/useDialogClickHandler.ts +26 -0
- package/src/index.scss +23 -22
- package/src/index.ts +31 -30
- package/src/patterns/page/page-header.stories.tsx +17 -21
- package/src/sass/_globals.scss +14 -32
- package/src/sass/_styles.scss +2 -1
- package/src/sass/styles/_colors.scss +13 -0
- package/src/styles/alert/alert.css +68 -0
- package/src/styles/alert/alert.css.map +1 -0
- package/src/styles/badge/badge.css +3 -3
- 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 +19 -4
- package/src/styles/details/details.css.map +1 -1
- package/src/styles/dialog/dialog.css +76 -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 +213 -60
- 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/libs/components/badge/badge.css +0 -1
- package/libs/components/badge/badge.css.map +0 -1
- package/libs/components/badge/badge.min.css +0 -3
- package/libs/components/breadcrumbs/breadcrumb.css +0 -1
- package/libs/components/breadcrumbs/breadcrumb.css.map +0 -1
- package/libs/components/breadcrumbs/breadcrumb.min.css +0 -3
- package/libs/components/buttons/button.css +0 -1
- package/libs/components/buttons/button.css.map +0 -1
- package/libs/components/buttons/button.min.css +0 -3
- package/libs/components/cards/card-style.css +0 -1
- package/libs/components/cards/card-style.css.map +0 -1
- package/libs/components/cards/card-style.min.css +0 -3
- package/libs/components/cards/card.css +0 -1
- package/libs/components/cards/card.css.map +0 -1
- package/libs/components/cards/card.min.css +0 -3
- package/libs/components/details/details.css +0 -1
- package/libs/components/details/details.css.map +0 -1
- package/libs/components/details/details.min.css +0 -3
- package/libs/components/form/form.css +0 -1
- package/libs/components/form/form.css.map +0 -1
- package/libs/components/form/form.min.css +0 -3
- package/libs/components/icons/icon.css +0 -1
- package/libs/components/icons/icon.css.map +0 -1
- package/libs/components/icons/icon.min.css +0 -3
- package/libs/components/images/img.css +0 -1
- package/libs/components/images/img.css.map +0 -1
- package/libs/components/images/img.min.css +0 -3
- package/libs/components/layout/landmarks.css +0 -1
- package/libs/components/layout/landmarks.css.map +0 -1
- package/libs/components/layout/landmarks.min.css +0 -3
- package/libs/components/link/link.css +0 -1
- package/libs/components/link/link.css.map +0 -1
- package/libs/components/link/link.min.css +0 -3
- package/libs/components/nav/nav.css +0 -1
- package/libs/components/nav/nav.css.map +0 -1
- package/libs/components/nav/nav.min.css +0 -3
- package/libs/components/progress/progress.css +0 -1
- package/libs/components/progress/progress.css.map +0 -1
- package/libs/components/progress/progress.min.css +0 -3
- package/libs/components/styles/index.css +0 -1
- package/libs/components/styles/index.css.map +0 -1
- package/libs/components/styles/index.min.css +0 -3
- package/libs/components/tag/tag.css +0 -1
- package/libs/components/tag/tag.css.map +0 -1
- package/libs/components/tag/tag.min.css +0 -3
- package/libs/components/text-to-speech/text-to-speech.css +0 -1
- package/libs/components/text-to-speech/text-to-speech.css.map +0 -1
- package/libs/components/text-to-speech/text-to-speech.min.css +0 -3
- package/libs/index.css +0 -1
- package/libs/index.css.map +0 -1
- package/src/components/readme.stories.mdx +0 -7
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
|
+
|
|
4
|
+
import DialogHeader from "./dialog-header";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof DialogHeader> = {
|
|
7
|
+
title: "FP.REACT Components/Dialog/Views/DialogHeader",
|
|
8
|
+
component: DialogHeader,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
actions: { argTypesRegex: "^on.*" },
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component:
|
|
15
|
+
"DialogHeader component - A header component for dialog/modal windows that displays a title and optional close button.",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
children: "Dialog Header",
|
|
21
|
+
},
|
|
22
|
+
} as Meta;
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof DialogHeader>;
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
dialogTitle: "Default Dialog ",
|
|
30
|
+
},
|
|
31
|
+
play: async ({ canvasElement }) => {
|
|
32
|
+
const canvas = within(canvasElement);
|
|
33
|
+
expect(canvas.getByText(/default dialog/i)).toBeInTheDocument();
|
|
34
|
+
},
|
|
35
|
+
} as Story;
|
|
36
|
+
|
|
37
|
+
export const WithCloseButton: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
dialogTitle: "Dialog Header with Close",
|
|
40
|
+
onClose: () => {},
|
|
41
|
+
},
|
|
42
|
+
} as Story;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import UI from "#components/ui";
|
|
3
|
+
import Heading from "#components/heading/heading";
|
|
4
|
+
import Button from "#components/buttons/button";
|
|
5
|
+
import Icon from "#components/icons/icon";
|
|
6
|
+
|
|
7
|
+
export type DialogHeaderProps = {
|
|
8
|
+
dialogTitle: string;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
} & React.ComponentProps<typeof Heading>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* DialogHeader component displays the header section of a dialog with a title and close button.
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @param {Object} props - Component props
|
|
17
|
+
* @param {string} props.dialogTitle - The title text to display in the dialog header
|
|
18
|
+
* @param {() => void} props.onClick - Callback function triggered when close button is clicked
|
|
19
|
+
* @param {string} [props.type='h3'] - Heading type/level to use for the title
|
|
20
|
+
* @returns {JSX.Element} A dialog header with title and close button
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```jsx
|
|
24
|
+
* <DialogHeader
|
|
25
|
+
* dialogTitle="Confirm Action"
|
|
26
|
+
* onClick={() => setIsOpen(false)}
|
|
27
|
+
* type="h2"
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const DialogHeader = ({
|
|
33
|
+
dialogTitle,
|
|
34
|
+
onClick,
|
|
35
|
+
type = "h3",
|
|
36
|
+
}: DialogHeaderProps): JSX.Element => {
|
|
37
|
+
const handleClose = () => {
|
|
38
|
+
onClick();
|
|
39
|
+
};
|
|
40
|
+
return (
|
|
41
|
+
<UI as="div" classes="dialog-header">
|
|
42
|
+
<Heading type={type} className="dialog-title">
|
|
43
|
+
{dialogTitle || "Dialog"}
|
|
44
|
+
</Heading>
|
|
45
|
+
<Button
|
|
46
|
+
type="button"
|
|
47
|
+
onClick={handleClose}
|
|
48
|
+
className="dialog-close"
|
|
49
|
+
aria-label="Close dialog"
|
|
50
|
+
data-btn="icon"
|
|
51
|
+
>
|
|
52
|
+
<Icon>
|
|
53
|
+
<Icon.Remove size={16} />
|
|
54
|
+
</Icon>
|
|
55
|
+
</Button>
|
|
56
|
+
</UI>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default React.memo(DialogHeader);
|
|
61
|
+
DialogHeader.displayName = "DialogHeader";
|
|
@@ -1,28 +1,28 @@
|
|
|
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 './form.scss'
|
|
4
|
+
import Form from "./form";
|
|
5
|
+
import "./form.scss";
|
|
7
6
|
|
|
8
7
|
const meta: Meta<typeof Form> = {
|
|
9
|
-
title:
|
|
8
|
+
title: "FP.REACT Forms/Examples",
|
|
9
|
+
tags: ["beta"],
|
|
10
10
|
component: Form,
|
|
11
11
|
parameters: {
|
|
12
12
|
docs: {
|
|
13
13
|
description: {
|
|
14
|
-
component:
|
|
14
|
+
component: "Form description here...",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
args: {
|
|
19
|
-
children:
|
|
20
|
-
name:
|
|
19
|
+
children: "Link",
|
|
20
|
+
name: "my-form",
|
|
21
21
|
},
|
|
22
|
-
} as Story
|
|
22
|
+
} as Story;
|
|
23
23
|
|
|
24
|
-
export default meta
|
|
25
|
-
type Story = StoryObj<typeof Form
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof Form>;
|
|
26
26
|
|
|
27
27
|
export const FormComponent: Story = {
|
|
28
28
|
args: {
|
|
@@ -42,8 +42,8 @@ export const FormComponent: Story = {
|
|
|
42
42
|
),
|
|
43
43
|
},
|
|
44
44
|
play: async ({ canvasElement }) => {
|
|
45
|
-
const canvas = within(canvasElement)
|
|
46
|
-
const form = canvas.getByRole(
|
|
47
|
-
await expect(form).toBeInTheDocument()
|
|
45
|
+
const canvas = within(canvasElement);
|
|
46
|
+
const form = canvas.getByRole("form");
|
|
47
|
+
await expect(form).toBeInTheDocument();
|
|
48
48
|
},
|
|
49
|
-
} as Story
|
|
49
|
+
} as Story;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, userEvent, expect } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, userEvent, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import './form.scss'
|
|
4
|
+
import Input from "./inputs";
|
|
5
|
+
import "./form.scss";
|
|
7
6
|
|
|
8
7
|
const meta: Meta<typeof Input> = {
|
|
9
|
-
title:
|
|
8
|
+
title: "FP.REACT Forms/Inputs",
|
|
10
9
|
component: Input,
|
|
10
|
+
tags: ["rc"],
|
|
11
11
|
args: {},
|
|
12
12
|
parameters: {
|
|
13
13
|
docs: {
|
|
@@ -17,18 +17,18 @@ const meta: Meta<typeof Input> = {
|
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
-
} as Story
|
|
20
|
+
} as Story;
|
|
21
21
|
|
|
22
|
-
export default meta
|
|
23
|
-
type Story = StoryObj<typeof Input
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof Input>;
|
|
24
24
|
|
|
25
25
|
export const InputComponent: Story = {
|
|
26
26
|
args: {},
|
|
27
27
|
play: async ({ canvasElement }) => {
|
|
28
|
-
const canvas = within(canvasElement)
|
|
29
|
-
expect(canvas.getByRole(
|
|
28
|
+
const canvas = within(canvasElement);
|
|
29
|
+
expect(canvas.getByRole("textbox")).toBeInTheDocument();
|
|
30
30
|
},
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
|
|
33
33
|
//required input story
|
|
34
34
|
export const RequiredInput: Story = {
|
|
@@ -41,32 +41,32 @@ export const RequiredInput: Story = {
|
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
args: {
|
|
44
|
-
type:
|
|
44
|
+
type: "text",
|
|
45
45
|
required: true,
|
|
46
|
-
placeholder:
|
|
46
|
+
placeholder: "This Field is required (placeholder)",
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
play: async ({ canvasElement }) => {
|
|
50
|
-
const canvas = within(canvasElement)
|
|
51
|
-
const input = canvas.getByRole(
|
|
52
|
-
expect(input).toBeRequired()
|
|
50
|
+
const canvas = within(canvasElement);
|
|
51
|
+
const input = canvas.getByRole("textbox");
|
|
52
|
+
expect(input).toBeRequired();
|
|
53
53
|
|
|
54
|
-
await userEvent.type(input,
|
|
55
|
-
expect(input).toBeValid()
|
|
54
|
+
await userEvent.type(input, "test");
|
|
55
|
+
expect(input).toBeValid();
|
|
56
56
|
|
|
57
|
-
await userEvent.clear(input)
|
|
57
|
+
await userEvent.clear(input);
|
|
58
58
|
|
|
59
|
-
userEvent.type(input,
|
|
60
|
-
expect(input).toBeInvalid()
|
|
59
|
+
userEvent.type(input, "\n");
|
|
60
|
+
expect(input).toBeInvalid();
|
|
61
61
|
},
|
|
62
|
-
} as Story
|
|
62
|
+
} as Story;
|
|
63
63
|
|
|
64
64
|
export const DefaultRequired: Story = {
|
|
65
65
|
args: {
|
|
66
|
-
type:
|
|
66
|
+
type: "text",
|
|
67
67
|
required: true,
|
|
68
68
|
},
|
|
69
|
-
} as Story
|
|
69
|
+
} as Story;
|
|
70
70
|
|
|
71
71
|
export const InputDisabled: Story = {
|
|
72
72
|
parameters: {
|
|
@@ -78,78 +78,78 @@ export const InputDisabled: Story = {
|
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
80
|
args: {
|
|
81
|
-
type:
|
|
81
|
+
type: "text",
|
|
82
82
|
isDisabled: true,
|
|
83
83
|
},
|
|
84
|
-
} as Story
|
|
84
|
+
} as Story;
|
|
85
85
|
|
|
86
86
|
export const EmailInput: Story = {
|
|
87
87
|
args: {
|
|
88
|
-
type:
|
|
88
|
+
type: "email",
|
|
89
89
|
},
|
|
90
90
|
play: async ({ canvasElement }) => {
|
|
91
|
-
const canvas = within(canvasElement)
|
|
92
|
-
const input = canvas.getByRole(
|
|
93
|
-
expect(input).toHaveAttribute(
|
|
91
|
+
const canvas = within(canvasElement);
|
|
92
|
+
const input = canvas.getByRole("textbox");
|
|
93
|
+
expect(input).toHaveAttribute("type", "email");
|
|
94
94
|
|
|
95
|
-
await userEvent.type(input,
|
|
96
|
-
expect(input).toHaveValue(
|
|
95
|
+
await userEvent.type(input, "test@example.com");
|
|
96
|
+
expect(input).toHaveValue("test@example.com");
|
|
97
97
|
},
|
|
98
|
-
} as Story
|
|
98
|
+
} as Story;
|
|
99
99
|
|
|
100
100
|
export const PasswordInput: Story = {
|
|
101
101
|
args: {
|
|
102
|
-
type:
|
|
102
|
+
type: "password",
|
|
103
103
|
},
|
|
104
104
|
play: async ({ canvasElement }) => {
|
|
105
|
-
const canvas = within(canvasElement)
|
|
106
|
-
const input = canvas.getByPlaceholderText(/password/i)
|
|
107
|
-
expect(input).toHaveAttribute(
|
|
105
|
+
const canvas = within(canvasElement);
|
|
106
|
+
const input = canvas.getByPlaceholderText(/password/i);
|
|
107
|
+
expect(input).toHaveAttribute("type", "password");
|
|
108
108
|
|
|
109
|
-
await userEvent.type(input,
|
|
110
|
-
expect(input).toHaveValue(
|
|
109
|
+
await userEvent.type(input, "password");
|
|
110
|
+
expect(input).toHaveValue("password");
|
|
111
111
|
},
|
|
112
|
-
} as Story
|
|
112
|
+
} as Story;
|
|
113
113
|
|
|
114
114
|
export const SearchInput: Story = {
|
|
115
115
|
args: {
|
|
116
|
-
type:
|
|
116
|
+
type: "search",
|
|
117
117
|
},
|
|
118
118
|
play: async ({ canvasElement }) => {
|
|
119
|
-
const canvas = within(canvasElement)
|
|
120
|
-
const input = canvas.getByRole(
|
|
121
|
-
expect(input).toHaveAttribute(
|
|
119
|
+
const canvas = within(canvasElement);
|
|
120
|
+
const input = canvas.getByRole("searchbox");
|
|
121
|
+
expect(input).toHaveAttribute("type", "search");
|
|
122
122
|
|
|
123
|
-
await userEvent.type(input,
|
|
124
|
-
expect(input).toHaveValue(
|
|
123
|
+
await userEvent.type(input, "search term");
|
|
124
|
+
expect(input).toHaveValue("search term");
|
|
125
125
|
},
|
|
126
|
-
} as Story
|
|
126
|
+
} as Story;
|
|
127
127
|
|
|
128
128
|
export const TelInput: Story = {
|
|
129
129
|
args: {
|
|
130
|
-
type:
|
|
130
|
+
type: "tel",
|
|
131
131
|
},
|
|
132
132
|
play: async ({ canvasElement }) => {
|
|
133
|
-
const canvas = within(canvasElement)
|
|
134
|
-
const input = canvas.getByRole(
|
|
135
|
-
expect(input).toHaveAttribute(
|
|
133
|
+
const canvas = within(canvasElement);
|
|
134
|
+
const input = canvas.getByRole("textbox");
|
|
135
|
+
expect(input).toHaveAttribute("type", "tel");
|
|
136
136
|
|
|
137
|
-
await userEvent.type(input,
|
|
138
|
-
expect(input).toHaveValue(
|
|
137
|
+
await userEvent.type(input, "1234567890");
|
|
138
|
+
expect(input).toHaveValue("1234567890");
|
|
139
139
|
},
|
|
140
|
-
} as Story
|
|
140
|
+
} as Story;
|
|
141
141
|
|
|
142
142
|
// URL text input story
|
|
143
143
|
export const UrlInput: Story = {
|
|
144
144
|
args: {
|
|
145
|
-
type:
|
|
145
|
+
type: "url",
|
|
146
146
|
},
|
|
147
147
|
play: async ({ canvasElement }) => {
|
|
148
|
-
const canvas = within(canvasElement)
|
|
149
|
-
const input = canvas.getByRole(
|
|
150
|
-
expect(input).toHaveAttribute(
|
|
148
|
+
const canvas = within(canvasElement);
|
|
149
|
+
const input = canvas.getByRole("textbox");
|
|
150
|
+
expect(input).toHaveAttribute("type", "url");
|
|
151
151
|
|
|
152
|
-
await userEvent.type(input,
|
|
153
|
-
expect(input).toHaveValue(
|
|
152
|
+
await userEvent.type(input, "https://example.com");
|
|
153
|
+
expect(input).toHaveValue("https://example.com");
|
|
154
154
|
},
|
|
155
|
-
} as Story
|
|
155
|
+
} as Story;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within,
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import React from 'react'
|
|
4
|
+
import Select from "./select";
|
|
5
|
+
import React from "react";
|
|
7
6
|
const meta: Meta<typeof Select> = {
|
|
8
|
-
title:
|
|
7
|
+
title: "FP.REACT Forms/Select",
|
|
8
|
+
tags: ["rc"],
|
|
9
9
|
component: Select,
|
|
10
10
|
parameters: {
|
|
11
11
|
docs: {
|
|
12
12
|
description: {
|
|
13
|
-
component:
|
|
13
|
+
component: "Base select/Combobox component",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
args: {
|
|
18
|
-
// @ts-ignore
|
|
19
18
|
children: (
|
|
20
19
|
<>
|
|
21
20
|
<Select.Option selectValue="value" selectLabel="Option 1" />
|
|
@@ -24,15 +23,23 @@ const meta: Meta<typeof Select> = {
|
|
|
24
23
|
</>
|
|
25
24
|
),
|
|
26
25
|
},
|
|
27
|
-
} as Story
|
|
26
|
+
} as Story;
|
|
28
27
|
|
|
29
|
-
export default meta
|
|
30
|
-
type Story = StoryObj<typeof Select
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof Select>;
|
|
31
30
|
|
|
32
31
|
export const SelectComponent: Story = {
|
|
33
|
-
args: {
|
|
32
|
+
args: {
|
|
33
|
+
children: (
|
|
34
|
+
<>
|
|
35
|
+
<Select.Option selectValue="value" selectLabel="Option 1" />
|
|
36
|
+
<Select.Option selectValue="value" selectLabel="Option 2" />
|
|
37
|
+
<Select.Option selectValue="value" selectLabel="Option 3" />
|
|
38
|
+
</>
|
|
39
|
+
),
|
|
40
|
+
},
|
|
34
41
|
play: async ({ canvasElement }) => {
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
const canvas = within(canvasElement);
|
|
43
|
+
expect(canvas.getByRole("combobox")).toBeInTheDocument();
|
|
37
44
|
},
|
|
38
|
-
}
|
|
45
|
+
} as Story;
|
|
@@ -1,75 +1,74 @@
|
|
|
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 Heading from './heading'
|
|
4
|
+
import Heading from "./heading";
|
|
6
5
|
|
|
7
6
|
const meta: Meta<typeof Heading> = {
|
|
8
|
-
title:
|
|
7
|
+
title: "FP.REACT Components/Heading",
|
|
9
8
|
component: Heading,
|
|
9
|
+
tags: ["version:1.0.0"],
|
|
10
10
|
parameters: {
|
|
11
|
-
actions: { argTypesRegex:
|
|
11
|
+
actions: { argTypesRegex: "^on.*" },
|
|
12
12
|
docs: {
|
|
13
13
|
description: {
|
|
14
|
-
component:
|
|
14
|
+
component: "Heading description here...",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
args: {
|
|
19
|
-
|
|
20
|
-
children: 'Default title',
|
|
19
|
+
children: "Default title",
|
|
21
20
|
},
|
|
22
|
-
} as Story
|
|
21
|
+
} as Story;
|
|
23
22
|
|
|
24
|
-
export default meta
|
|
25
|
-
type Story = StoryObj<typeof Heading
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof Heading>;
|
|
26
25
|
|
|
27
26
|
export const HeadingComponent: Story = {
|
|
28
27
|
args: {},
|
|
29
28
|
play: async ({ canvasElement }) => {
|
|
30
|
-
const canvas = within(canvasElement)
|
|
31
|
-
expect(canvas.getByText(/default title/i)).toBeInTheDocument()
|
|
29
|
+
const canvas = within(canvasElement);
|
|
30
|
+
expect(canvas.getByText(/default title/i)).toBeInTheDocument();
|
|
32
31
|
},
|
|
33
|
-
}
|
|
32
|
+
};
|
|
34
33
|
|
|
35
34
|
export const HeadingOne: Story = {
|
|
36
35
|
args: {
|
|
37
|
-
type:
|
|
38
|
-
children:
|
|
36
|
+
type: "h1",
|
|
37
|
+
children: "Heading One",
|
|
39
38
|
},
|
|
40
|
-
} as Story
|
|
39
|
+
} as Story;
|
|
41
40
|
|
|
42
41
|
export const HeadingTwo: Story = {
|
|
43
42
|
args: {
|
|
44
|
-
type:
|
|
45
|
-
children:
|
|
43
|
+
type: "h2",
|
|
44
|
+
children: "Heading Two",
|
|
46
45
|
},
|
|
47
|
-
} as Story
|
|
46
|
+
} as Story;
|
|
48
47
|
|
|
49
48
|
export const HeadingThree: Story = {
|
|
50
49
|
args: {
|
|
51
|
-
type:
|
|
52
|
-
children:
|
|
50
|
+
type: "h3",
|
|
51
|
+
children: "Heading Three",
|
|
53
52
|
},
|
|
54
|
-
} as Story
|
|
53
|
+
} as Story;
|
|
55
54
|
|
|
56
55
|
export const HeadingFour: Story = {
|
|
57
56
|
args: {
|
|
58
|
-
type:
|
|
59
|
-
children:
|
|
57
|
+
type: "h4",
|
|
58
|
+
children: "Heading Four",
|
|
60
59
|
},
|
|
61
|
-
} as Story
|
|
60
|
+
} as Story;
|
|
62
61
|
|
|
63
62
|
export const HeadingFive: Story = {
|
|
64
63
|
args: {
|
|
65
|
-
type:
|
|
66
|
-
children:
|
|
64
|
+
type: "h5",
|
|
65
|
+
children: "Heading Five",
|
|
67
66
|
},
|
|
68
|
-
} as Story
|
|
67
|
+
} as Story;
|
|
69
68
|
|
|
70
69
|
export const HeadingSix: Story = {
|
|
71
70
|
args: {
|
|
72
|
-
type:
|
|
73
|
-
children:
|
|
71
|
+
type: "h6",
|
|
72
|
+
children: "Heading Six",
|
|
74
73
|
},
|
|
75
|
-
} as Story
|
|
74
|
+
} as Story;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import { IconProps } from
|
|
4
|
-
import Svg from
|
|
3
|
+
import { IconProps } from "../types";
|
|
4
|
+
import Svg from "./svg";
|
|
5
5
|
|
|
6
6
|
const defaultStyles = {
|
|
7
7
|
...Svg.styles,
|
|
8
|
-
fill:
|
|
9
|
-
}
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
};
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Add Icon component
|
|
@@ -16,14 +16,14 @@ const defaultStyles = {
|
|
|
16
16
|
* @returns {JSX.Element} - Rendered component
|
|
17
17
|
*/
|
|
18
18
|
export const Add = ({
|
|
19
|
-
fill =
|
|
19
|
+
fill = "gray",
|
|
20
20
|
size = 24,
|
|
21
|
-
role =
|
|
22
|
-
alt =
|
|
21
|
+
role = "img",
|
|
22
|
+
alt = "Add icon",
|
|
23
23
|
...props
|
|
24
24
|
}: Pick<
|
|
25
25
|
IconProps,
|
|
26
|
-
|
|
26
|
+
"strokeColor" | "fill" | "styles" | "size" | "role" | "alt"
|
|
27
27
|
>): JSX.Element => {
|
|
28
28
|
return (
|
|
29
29
|
<Svg size={size} role={role} alt={alt} {...props}>
|
|
@@ -34,9 +34,9 @@ export const Add = ({
|
|
|
34
34
|
/>
|
|
35
35
|
</g>
|
|
36
36
|
</Svg>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
39
|
|
|
40
|
-
export default Add
|
|
41
|
-
Add.styles = defaultStyles
|
|
42
|
-
Add.displayName =
|
|
40
|
+
export default Add;
|
|
41
|
+
Add.styles = defaultStyles;
|
|
42
|
+
Add.displayName = "Add";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { IconProps } from "../types";
|
|
4
|
+
import Svg from "./svg";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Add Icon component
|
|
8
|
+
* @param {string} fill - Icon fill color (default: 'currentColor')
|
|
9
|
+
* @param {string} size - Icon size (default: '24')
|
|
10
|
+
* @param {IconProps} props - Other icon properties
|
|
11
|
+
* @returns {JSX.Element} - Rendered component
|
|
12
|
+
*/
|
|
13
|
+
export const AlertSolid = ({
|
|
14
|
+
fill = "currentColor",
|
|
15
|
+
size = 24,
|
|
16
|
+
role = "img",
|
|
17
|
+
alt = "Add icon",
|
|
18
|
+
...props
|
|
19
|
+
}: Pick<
|
|
20
|
+
IconProps,
|
|
21
|
+
"strokeColor" | "fill" | "styles" | "size" | "role" | "alt"
|
|
22
|
+
>): JSX.Element => {
|
|
23
|
+
return (
|
|
24
|
+
<Svg size={size} role={role} alt={alt} {...props}>
|
|
25
|
+
<g fill={fill}>
|
|
26
|
+
<path
|
|
27
|
+
d="M23.707,6.736,17.263.293A1,1,0,0,0,16.556,0H7.444a1,1,0,0,0-.707.293L.293,6.736A1,1,0,0,0,0,7.443v9.114a1,1,0,0,0,.293.707l6.444,6.443A1,1,0,0,0,7.444,24h9.112a1,1,0,0,0,.707-.293l6.444-6.443A1,1,0,0,0,24,16.557V7.443A1,1,0,0,0,23.707,6.736ZM13.645,5,13,14H11l-.608-9ZM12,20a2,2,0,1,1,2-2A2,2,0,0,1,12,20Z"
|
|
28
|
+
fill={fill}
|
|
29
|
+
/>
|
|
30
|
+
</g>
|
|
31
|
+
</Svg>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default AlertSolid;
|
|
36
|
+
AlertSolid.displayName = "AlertSolid";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { IconProps } from "../types";
|
|
4
|
+
import Svg from "./svg";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Add Icon component
|
|
8
|
+
* @param {string} fill - Icon fill color (default: 'currentColor')
|
|
9
|
+
* @param {string} size - Icon size (default: '24')
|
|
10
|
+
* @param {IconProps} props - Other icon properties
|
|
11
|
+
* @returns {JSX.Element} - Rendered component
|
|
12
|
+
*/
|
|
13
|
+
export const AlertSquareSolid = ({
|
|
14
|
+
fill = "currentColor",
|
|
15
|
+
size = 24,
|
|
16
|
+
role = "img",
|
|
17
|
+
alt = "Add icon",
|
|
18
|
+
...props
|
|
19
|
+
}: Pick<
|
|
20
|
+
IconProps,
|
|
21
|
+
"strokeColor" | "fill" | "styles" | "size" | "role" | "alt"
|
|
22
|
+
>): JSX.Element => {
|
|
23
|
+
return (
|
|
24
|
+
<Svg size={size} role={role} alt={alt} {...props}>
|
|
25
|
+
<g fill={fill}>
|
|
26
|
+
<path
|
|
27
|
+
d="M20,1H4c-1.654,0-3,1.346-3,3V20c0,1.654,1.346,3,3,3H20c1.654,0,3-1.346,3-3V4c0-1.654-1.346-3-3-3ZM11,7c0-.553,.448-1,1-1s1,.447,1,1v6c0,.553-.448,1-1,1s-1-.447-1-1V7Zm1,11.5c-.69,0-1.25-.56-1.25-1.25s.56-1.25,1.25-1.25,1.25,.56,1.25,1.25-.56,1.25-1.25,1.25Z"
|
|
28
|
+
fill={fill}
|
|
29
|
+
></path>
|
|
30
|
+
</g>
|
|
31
|
+
</Svg>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default AlertSquareSolid;
|
|
36
|
+
AlertSquareSolid.displayName = "AlertSquareSolid";
|