@nulogy/components 16.0.2 → 16.0.3
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/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/main.module.js +1 -0
- package/dist/main.module.js.map +1 -1
- package/dist/src/Alert/Alert.story.d.ts +1 -1
- package/dist/src/Alert/Alert.story.js +11 -0
- package/dist/src/AppTag/stories/AppTag.story.d.ts +2 -2
- package/dist/src/AppTag/stories/AppTag.story.js +6 -4
- package/dist/src/AppTag/stories/AppTag.usecases.story.d.ts +13 -10
- package/dist/src/AppTag/stories/AppTag.usecases.story.js +71 -51
- package/dist/src/AsyncSelect/AsyncSelect.story.d.ts +17 -13
- package/dist/src/AsyncSelect/AsyncSelect.story.js +46 -23
- package/dist/src/BottomSheet/stories/BottomSheet.actions.story.d.ts +8 -1
- package/dist/src/BottomSheet/stories/BottomSheet.actions.story.js +22 -3
- package/dist/src/BottomSheet/stories/BottomSheet.features.story.d.ts +9 -2
- package/dist/src/BottomSheet/stories/BottomSheet.features.story.js +27 -12
- package/dist/src/BottomSheet/stories/BottomSheet.story.d.ts +7 -1
- package/dist/src/BottomSheet/stories/BottomSheet.story.js +20 -3
- package/dist/src/Box/Box.story.d.ts +22 -44
- package/dist/src/Box/Box.story.js +30 -30
- package/dist/src/BrandedNavBar/NavBar.story.d.ts +16 -28
- package/dist/src/BrandedNavBar/NavBar.story.js +41 -35
- package/dist/src/BrandedNavBar/SmallNavBar.story.d.ts +1 -1
- package/dist/src/Breadcrumbs/Breadcrumbs.story.d.ts +4 -8
- package/dist/src/Breadcrumbs/Breadcrumbs.story.js +4 -4
- package/dist/src/Button/Button.story.d.ts +14 -28
- package/dist/src/Button/Button.story.js +14 -14
- package/dist/src/Button/ControlIcon.story.js +1 -1
- package/dist/src/Button/IconicButton.story.d.ts +23 -45
- package/dist/src/Button/IconicButton.story.js +27 -25
- package/dist/src/ButtonGroup/ButtonGroup.story.d.ts +13 -23
- package/dist/src/ButtonGroup/ButtonGroup.story.js +10 -10
- package/dist/src/Card/Card.story.d.ts +3 -5
- package/dist/src/Card/Card.story.js +9 -7
- package/dist/src/Checkbox/Checkbox.story.d.ts +18 -34
- package/dist/src/Checkbox/Checkbox.story.js +28 -24
- package/dist/src/Checkbox/CheckboxGroup.story.d.ts +10 -20
- package/dist/src/Checkbox/CheckboxGroup.story.js +10 -10
- package/dist/src/DatePickers/stories/DatePicker.story.d.ts +9 -2
- package/dist/src/DatePickers/stories/DatePicker.story.js +43 -2
- package/dist/src/DatePickers/stories/MonthPicker.story.d.ts +8 -1
- package/dist/src/DatePickers/stories/MonthPicker.story.js +21 -2
- package/dist/src/DatePickers/stories/WeekPicker.story.d.ts +32 -4
- package/dist/src/DatePickers/stories/WeekPicker.story.js +57 -8
- package/dist/src/DateRange/DateRange.story.d.ts +16 -2
- package/dist/src/DateRange/DateRange.story.js +41 -3
- package/dist/src/DescriptionList/stories/DescriptionList.column.story.d.ts +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.column.story.js +10 -8
- package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.d.ts +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.layout.story.d.ts +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.layout.story.js +12 -10
- package/dist/src/DescriptionList/stories/DescriptionList.playground.story.d.ts +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.story.d.ts +1 -0
- package/dist/src/DescriptionList/stories/DescriptionList.story.js +3 -0
- package/dist/src/DropdownMenu/DropdownMenu.story.d.ts +32 -32
- package/dist/src/DropdownMenu/DropdownMenu.story.js +58 -16
- package/dist/src/FieldLabel/FieldLabel.story.d.ts +2 -4
- package/dist/src/FieldLabel/FieldLabel.story.js +2 -2
- package/dist/src/Flex/Flex.story.d.ts +34 -68
- package/dist/src/Flex/Flex.story.js +36 -36
- package/dist/src/Form/Form.story.d.ts +8 -16
- package/dist/src/Form/Form.story.js +8 -8
- package/dist/src/Icon/Icon.story.d.ts +12 -24
- package/dist/src/Icon/Icon.story.js +15 -15
- package/dist/src/Input/Input.story.d.ts +16 -32
- package/dist/src/Input/Input.story.js +23 -23
- package/dist/src/Layout/Page.applicationFrame.story.d.ts +1 -1
- package/dist/src/Layout/Page.story.d.ts +1 -1
- package/dist/src/Layout/Sidebar.story.d.ts +1 -1
- package/dist/src/Link/Link.story.d.ts +16 -32
- package/dist/src/Link/Link.story.js +16 -17
- package/dist/src/List/List.story.d.ts +8 -16
- package/dist/src/List/List.story.js +8 -8
- package/dist/src/LoadingAnimation/LoadingAnimation.story.d.ts +4 -8
- package/dist/src/LoadingAnimation/LoadingAnimation.story.js +4 -4
- package/dist/src/MaybeTooltip/MaybeTooltip.story.d.ts +1 -1
- package/dist/src/Modal/Modal.story.d.ts +1 -1
- package/dist/src/Navigation/stories/Navigation.appSwitcher.story.d.ts +8 -1
- package/dist/src/Navigation/stories/Navigation.appSwitcher.story.js +19 -1
- package/dist/src/Navigation/stories/Navigation.logos.story.d.ts +2 -4
- package/dist/src/Navigation/stories/Navigation.logos.story.js +4 -4
- package/dist/src/Navigation/stories/Navigation.story.d.ts +7 -1
- package/dist/src/Navigation/stories/Navigation.story.js +145 -136
- package/dist/src/Navigation/stories/Navigation.userMenu.story.d.ts +8 -1
- package/dist/src/Navigation/stories/Navigation.userMenu.story.js +22 -1
- package/dist/src/Overlay/Overlay.story.d.ts +2 -4
- package/dist/src/Overlay/Overlay.story.js +2 -2
- package/dist/src/Pagination/Pagination.story.d.ts +14 -13
- package/dist/src/Pagination/Pagination.story.js +32 -11
- package/dist/src/Radio/Radio.story.d.ts +1 -1
- package/dist/src/Radio/Radio.story.js +44 -1
- package/dist/src/Radio/RadioGroup.story.d.ts +29 -21
- package/dist/src/Radio/RadioGroup.story.js +67 -14
- package/dist/src/RangeContainer/RangeContainer.story.d.ts +2 -4
- package/dist/src/RangeContainer/RangeContainer.story.js +2 -2
- package/dist/src/Select/Select.story.d.ts +37 -65
- package/dist/src/Select/Select.story.js +93 -49
- package/dist/src/StatusIndicator/StatusIndicator.story.d.ts +4 -8
- package/dist/src/StatusIndicator/StatusIndicator.story.js +4 -4
- package/dist/src/Switcher/Switcher.story.d.ts +8 -1
- package/dist/src/Switcher/Switcher.story.js +13 -1
- package/dist/src/Table/stories/BaseTable.story.d.ts +1 -1
- package/dist/src/Table/stories/BaseTable.story.js +1 -1
- package/dist/src/Table/stories/CustomContent.story.js +1 -1
- package/dist/src/Table/stories/Density.story.d.ts +4 -8
- package/dist/src/Table/stories/Density.story.js +4 -4
- package/dist/src/Table/stories/SortingColumnHeader.story.d.ts +1 -1
- package/dist/src/Table/stories/SortingColumnHeader.story.js +1 -1
- package/dist/src/Table/stories/Table.story.d.ts +1 -1
- package/dist/src/Table/stories/Table.story.js +37 -1
- package/dist/src/Table/stories/TableWithCustomSorting.story.d.ts +2 -4
- package/dist/src/Table/stories/TableWithCustomSorting.story.js +2 -2
- package/dist/src/Table/stories/TableWithExpandableRows.story.d.ts +4 -8
- package/dist/src/Table/stories/TableWithExpandableRows.story.js +5 -5
- package/dist/src/Table/stories/TableWithFiltering.story.d.ts +8 -8
- package/dist/src/Table/stories/TableWithFiltering.story.js +15 -4
- package/dist/src/Table/stories/TableWithSelectableRows.story.d.ts +8 -8
- package/dist/src/Table/stories/TableWithSelectableRows.story.js +22 -5
- package/dist/src/Table/stories/TableWithServerSidePagination.story.d.ts +2 -4
- package/dist/src/Table/stories/TableWithServerSidePagination.story.js +2 -2
- package/dist/src/Tabs/Tabs.story.d.ts +33 -33
- package/dist/src/Tabs/Tabs.story.js +52 -16
- package/dist/src/Textarea/Textarea.story.js +1 -1
- package/dist/src/TimePicker/TimePicker.js +2 -0
- package/dist/src/TimePicker/TimePicker.story.d.ts +24 -40
- package/dist/src/TimePicker/TimePicker.story.js +40 -27
- package/dist/src/TimeRange/TimeRange.story.d.ts +14 -20
- package/dist/src/TimeRange/TimeRange.story.js +34 -20
- package/dist/src/Toast/Toast.story.d.ts +24 -25
- package/dist/src/Toast/Toast.story.js +170 -142
- package/dist/src/ToastContainer/ToastContainer.story.d.ts +8 -1
- package/dist/src/ToastContainer/ToastContainer.story.js +13 -1
- package/dist/src/Toggle/Toggle.story.d.ts +25 -15
- package/dist/src/Toggle/Toggle.story.js +77 -43
- package/dist/src/Tooltip/Tooltip.story.d.ts +1 -1
- package/dist/src/Tooltip/Tooltip.story.js +16 -0
- package/dist/src/TopBar/stories/TopBar.story.d.ts +7 -1
- package/dist/src/TopBar/stories/TopBar.story.js +18 -1
- package/dist/src/TruncatedText/TruncatedText.story.d.ts +29 -34
- package/dist/src/TruncatedText/TruncatedText.story.js +46 -19
- package/dist/src/Type/Text.story.d.ts +10 -20
- package/dist/src/Type/Text.story.js +10 -10
- package/dist/src/Validation/InlineValidation.story.d.ts +6 -12
- package/dist/src/Validation/InlineValidation.story.js +6 -6
- package/dist/src/VisualTests/Select.story.d.ts +12 -24
- package/dist/src/VisualTests/Select.story.js +19 -19
- package/dist/src/pages/ErrorPage.story.d.ts +3 -5
- package/dist/src/pages/ErrorPage.story.js +10 -10
- package/dist/src/pages/LoginPage.story.d.ts +8 -16
- package/dist/src/pages/LoginPage.story.js +8 -8
- package/package.json +15 -23
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { expect, screen, userEvent, waitFor, within } from "storybook/test";
|
|
2
3
|
import { FormSection } from "../../Form";
|
|
3
4
|
import { Input } from "../../Input";
|
|
4
5
|
import { ApplicationFrame, Page } from "../../Layout";
|
|
@@ -20,6 +21,22 @@ export default {
|
|
|
20
21
|
},
|
|
21
22
|
},
|
|
22
23
|
};
|
|
23
|
-
export const Default =
|
|
24
|
+
export const Default = {
|
|
25
|
+
render: () => (_jsxs(TopBar.Root, { children: [_jsx(TopBar.BackLink, { href: "/cycle-counts", children: "Cycle counts" }), _jsx(TopBar.PageTitle, { children: "Cycle count #3992" }), _jsx(TopBar.Menu, { children: menuItems.map((props) => (_jsx(TopBar.MenuItem, { children: _jsx(TopBar.MenuItemLink, { ...props }) }, props.title))) })] })),
|
|
26
|
+
play: async ({ canvasElement, step }) => {
|
|
27
|
+
const canvas = within(canvasElement);
|
|
28
|
+
await step("opens menu when menu button is clicked", async () => {
|
|
29
|
+
await userEvent.click(canvas.getByTestId("topbar-menu-button"));
|
|
30
|
+
await expect(screen.getByTestId("topbar-menu")).toBeVisible();
|
|
31
|
+
});
|
|
32
|
+
await step("displays correct number of menu items", async () => {
|
|
33
|
+
await expect(screen.getAllByTestId("topbar-menu-item")).toHaveLength(9);
|
|
34
|
+
});
|
|
35
|
+
await step("closes menu when clicking outside", async () => {
|
|
36
|
+
await userEvent.click(screen.getByTestId("topbar-menu-overlay"));
|
|
37
|
+
await waitFor(() => expect(screen.queryByTestId("topbar-menu")).not.toBeInTheDocument());
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
};
|
|
24
41
|
export const WithALongTitle = () => (_jsxs(TopBar.Root, { children: [_jsx(TopBar.BackLink, { href: "/cycle-counts", children: "Previous page title" }), _jsx(TopBar.PageTitle, { children: "A long title that can not fit on smaller screens" }), _jsx(TopBar.Menu, { children: menuItems.map((props) => (_jsx(TopBar.MenuItem, { children: _jsx(TopBar.MenuItemLink, { ...props }) }, props.title))) })] }));
|
|
25
42
|
export const WithAnApplicationFrame = () => (_jsx(ApplicationFrame, { navBar: _jsxs(TopBar.Root, { children: [_jsx(TopBar.BackLink, { href: "/cycle-counts", children: "Cycle counts" }), _jsx(TopBar.PageTitle, { children: "Cycle count #3992" }), _jsx(TopBar.Menu, { children: menuItems.map((props) => (_jsx(TopBar.MenuItem, { children: _jsx(TopBar.MenuItemLink, { ...props }) }, props.title))) })] }), children: _jsxs(Page, { fullHeight: true, children: [_jsxs(FormSection, { title: "Personal Information", children: [_jsx(Input, { id: "name", labelText: "Name" }), _jsx(Input, { id: "birthdate", placeholder: "DD-MM-YYYY", labelText: "Date of birth", requirementText: "(Optional)", helpText: "Enter a date below" }), _jsx(Input, { id: "birthplace", labelText: "Place of birth", requirementText: "(Optional)" })] }), _jsxs(FormSection, { title: "General Information", children: [_jsx(Input, { id: "gender", labelText: "Gender" }), _jsx(Input, { id: "occupation", labelText: "Occupation" })] }), _jsxs(FormSection, { title: "Personal Information", children: [_jsx(Input, { id: "name", labelText: "Name" }), _jsx(Input, { id: "birthdate", placeholder: "DD-MM-YYYY", labelText: "Date of birth", requirementText: "(Optional)", helpText: "Enter a date below" }), _jsx(Input, { id: "birthplace", labelText: "Place of birth", requirementText: "(Optional)" })] }), _jsxs(FormSection, { title: "General Information", children: [_jsx(Input, { id: "gender", labelText: "Gender" }), _jsx(Input, { id: "occupation", labelText: "Occupation" })] }), _jsxs(FormSection, { title: "Personal Information", children: [_jsx(Input, { id: "name", labelText: "Name" }), _jsx(Input, { id: "birthdate", placeholder: "DD-MM-YYYY", labelText: "Date of birth", requirementText: "(Optional)", helpText: "Enter a date below" }), _jsx(Input, { id: "birthplace", labelText: "Place of birth", requirementText: "(Optional)" })] }), _jsxs(FormSection, { title: "General Information", children: [_jsx(Input, { id: "gender", labelText: "Gender" }), _jsx(Input, { id: "occupation", labelText: "Occupation" })] })] }) }));
|
|
@@ -3,54 +3,49 @@ declare const _default: {
|
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _TruncatedText: {
|
|
6
|
-
()
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
name: string;
|
|
8
|
+
play: ({ canvasElement, step }: {
|
|
9
|
+
canvasElement: any;
|
|
10
|
+
step: any;
|
|
11
|
+
}) => Promise<void>;
|
|
10
12
|
};
|
|
11
13
|
export declare const WithoutTooltip: {
|
|
12
|
-
()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
name: string;
|
|
16
|
+
play: ({ canvasElement, step }: {
|
|
17
|
+
canvasElement: any;
|
|
18
|
+
step: any;
|
|
19
|
+
}) => Promise<void>;
|
|
16
20
|
};
|
|
17
21
|
export declare const UnderMaxCharacters: {
|
|
18
|
-
()
|
|
19
|
-
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
22
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
name: string;
|
|
22
24
|
};
|
|
23
25
|
export declare const WithMaxCharacters10: {
|
|
24
|
-
()
|
|
25
|
-
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
26
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
name: string;
|
|
28
28
|
};
|
|
29
29
|
export declare const WithCustomTruncationIndicator: {
|
|
30
|
-
()
|
|
31
|
-
|
|
32
|
-
name: string;
|
|
33
|
-
};
|
|
30
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
name: string;
|
|
34
32
|
};
|
|
35
33
|
export declare const AsTitle: {
|
|
36
|
-
()
|
|
37
|
-
|
|
38
|
-
name: string;
|
|
39
|
-
};
|
|
34
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
name: string;
|
|
40
36
|
};
|
|
41
37
|
export declare const FullWidth: {
|
|
42
|
-
()
|
|
43
|
-
|
|
44
|
-
name: string;
|
|
45
|
-
};
|
|
38
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
name: string;
|
|
46
40
|
};
|
|
47
41
|
export declare const WithoutChildren: {
|
|
48
|
-
()
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
name: string;
|
|
44
|
+
play: ({ canvasElement }: {
|
|
45
|
+
canvasElement: any;
|
|
46
|
+
}) => Promise<void>;
|
|
52
47
|
};
|
|
53
48
|
export declare const TooltipInsideModal: {
|
|
54
|
-
()
|
|
55
|
-
|
|
49
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
name: string;
|
|
56
51
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { expect, screen, userEvent, waitFor, within } from "storybook/test";
|
|
2
3
|
import { Heading1 } from "../Type";
|
|
3
4
|
import { Box } from "../Box";
|
|
4
5
|
import { Modal } from "../Modal";
|
|
@@ -6,39 +7,65 @@ import { TruncatedText } from ".";
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "Components/TruncatedText",
|
|
8
9
|
};
|
|
9
|
-
export const _TruncatedText =
|
|
10
|
-
|
|
10
|
+
export const _TruncatedText = {
|
|
11
|
+
render: () => _jsx(TruncatedText, { fontSize: "small", children: "Special instructions are provided for the shipment" }),
|
|
11
12
|
name: "TruncatedText",
|
|
13
|
+
play: async ({ canvasElement, step }) => {
|
|
14
|
+
const canvas = within(canvasElement);
|
|
15
|
+
await step("shows the truncated text", async () => {
|
|
16
|
+
await expect(canvas.getByTestId("truncated-text")).toHaveTextContent("Special instructions...");
|
|
17
|
+
});
|
|
18
|
+
await step("shows a tooltip with full content on hover", async () => {
|
|
19
|
+
await userEvent.hover(canvas.getByTestId("truncated-text"));
|
|
20
|
+
await waitFor(() => expect(screen.getByRole("tooltip")).toHaveTextContent("Special instructions are provided for the shipment"));
|
|
21
|
+
});
|
|
22
|
+
},
|
|
12
23
|
};
|
|
13
|
-
export const WithoutTooltip =
|
|
14
|
-
|
|
24
|
+
export const WithoutTooltip = {
|
|
25
|
+
render: () => _jsx(TruncatedText, { showTooltip: false, children: "Special instructions are provided for the shipment" }),
|
|
15
26
|
name: "without tooltip",
|
|
27
|
+
play: async ({ canvasElement, step }) => {
|
|
28
|
+
const canvas = within(canvasElement);
|
|
29
|
+
await step("shows the truncated text", async () => {
|
|
30
|
+
await expect(canvas.getByTestId("truncated-text")).toHaveTextContent("Special instructions...");
|
|
31
|
+
});
|
|
32
|
+
await step("does not show a tooltip on hover", async () => {
|
|
33
|
+
await userEvent.hover(canvas.getByTestId("truncated-text"));
|
|
34
|
+
await expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
|
|
35
|
+
});
|
|
36
|
+
},
|
|
16
37
|
};
|
|
17
|
-
export const UnderMaxCharacters =
|
|
18
|
-
|
|
38
|
+
export const UnderMaxCharacters = {
|
|
39
|
+
render: () => _jsx(TruncatedText, { children: "Item is available" }),
|
|
19
40
|
name: "under max characters",
|
|
20
41
|
};
|
|
21
|
-
export const WithMaxCharacters10 =
|
|
22
|
-
|
|
42
|
+
export const WithMaxCharacters10 = {
|
|
43
|
+
render: () => _jsx(TruncatedText, { maxCharacters: 10, children: "Item is available" }),
|
|
23
44
|
name: "with max characters 10",
|
|
24
45
|
};
|
|
25
|
-
export const WithCustomTruncationIndicator =
|
|
26
|
-
|
|
46
|
+
export const WithCustomTruncationIndicator = {
|
|
47
|
+
render: () => _jsx(TruncatedText, { indicator: " + 2...", children: "Special instructions are provided for the shipment" }),
|
|
27
48
|
name: "with custom truncation indicator",
|
|
28
49
|
};
|
|
29
|
-
export const AsTitle =
|
|
30
|
-
|
|
50
|
+
export const AsTitle = {
|
|
51
|
+
render: () => (_jsx(TruncatedText, { element: _jsx(Heading1, {}), children: "Special instructions are provided for the shipment" })),
|
|
31
52
|
name: "as title",
|
|
32
53
|
};
|
|
33
|
-
export const FullWidth =
|
|
34
|
-
|
|
54
|
+
export const FullWidth = {
|
|
55
|
+
render: () => (_jsxs(Box, { width: "200px", children: [_jsx(TruncatedText, { fullWidth: true, children: "Special instructions are truncated because there is not enough space to show them." }), _jsx(TruncatedText, { fullWidth: true, children: "Instructions fit here." })] })),
|
|
35
56
|
name: "full width",
|
|
36
57
|
};
|
|
37
|
-
export const WithoutChildren =
|
|
38
|
-
|
|
58
|
+
export const WithoutChildren = {
|
|
59
|
+
render: () => (_jsxs(Box, { children: [_jsx(Heading1, { children: "No text should appear after this sentence, neither should the page crash." }), _jsx(TruncatedText, { children: null }), _jsx(TruncatedText, { children: undefined }), _jsx(TruncatedText, {})] })),
|
|
39
60
|
name: "Without children",
|
|
61
|
+
play: async ({ canvasElement }) => {
|
|
62
|
+
const canvas = within(canvasElement);
|
|
63
|
+
await expect(canvas.getAllByTestId("truncated-text")[0]).toBeInTheDocument();
|
|
64
|
+
},
|
|
40
65
|
};
|
|
41
|
-
export const TooltipInsideModal =
|
|
42
|
-
|
|
66
|
+
export const TooltipInsideModal = {
|
|
67
|
+
render: () => {
|
|
68
|
+
return (_jsx(Modal, { title: "Modal Title", children: _jsx(TruncatedText, { tooltipProps: { defaultOpen: true }, children: "The point of this test is to see if the tooltip is visible and shown over the modal and its overlay" }) }));
|
|
69
|
+
},
|
|
70
|
+
name: "Tooltip inside modal",
|
|
43
71
|
};
|
|
44
|
-
TooltipInsideModal.storyName = "Tooltip inside modal";
|
|
@@ -4,32 +4,22 @@ declare const _default: {
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _Text: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const WithAColor: {
|
|
7
|
-
()
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
7
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
name: string;
|
|
11
9
|
};
|
|
12
10
|
export declare const WithASize: {
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
name: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const WithACustomMargin: {
|
|
19
|
-
()
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
23
17
|
};
|
|
24
18
|
export declare const SetToInline: {
|
|
25
|
-
()
|
|
26
|
-
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
19
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
name: string;
|
|
29
21
|
};
|
|
30
22
|
export declare const SetToDisabled: {
|
|
31
|
-
()
|
|
32
|
-
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
23
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
name: string;
|
|
35
25
|
};
|
|
@@ -5,23 +5,23 @@ export default {
|
|
|
5
5
|
title: "Components/Text",
|
|
6
6
|
};
|
|
7
7
|
export const _Text = () => _jsx(Text, { children: "Default text" });
|
|
8
|
-
export const WithAColor =
|
|
9
|
-
|
|
8
|
+
export const WithAColor = {
|
|
9
|
+
render: () => _jsx(Text, { color: "blue", children: "Blue text" }),
|
|
10
10
|
name: "With a color",
|
|
11
11
|
};
|
|
12
|
-
export const WithASize =
|
|
13
|
-
|
|
12
|
+
export const WithASize = {
|
|
13
|
+
render: () => (_jsxs(_Fragment, { children: [_jsx(Box, { bg: "whiteGrey", p: "x2", mb: "x3", children: _jsx(Text, { children: "Default (16px/24px)" }) }), _jsxs(Box, { bg: "whiteGrey", p: "x2", mb: "x3", children: [_jsx(Text, { fontSize: "small", lineHeight: "smallTextBase", children: "Small (14px/24px)" }), _jsx(Text, { fontSize: "small", lineHeight: "smallTextCompressed", children: "Small Compressed (14px/16px)" })] }), _jsx(Box, { bg: "whiteGrey", p: "x2", mb: "x3", children: _jsx(Text, { fontSize: "smaller", lineHeight: "smallerText", children: "Smaller (12px/16px)" }) })] })),
|
|
14
14
|
name: "With a size",
|
|
15
15
|
};
|
|
16
|
-
export const WithACustomMargin =
|
|
17
|
-
|
|
16
|
+
export const WithACustomMargin = {
|
|
17
|
+
render: () => (_jsxs(_Fragment, { children: [_jsx(Text, { mb: "x3", children: "Text 24px bottom margin." }), _jsx(Text, { children: "Text with default (0px) bottom margin." })] })),
|
|
18
18
|
name: "With a custom margin",
|
|
19
19
|
};
|
|
20
|
-
export const SetToInline =
|
|
21
|
-
|
|
20
|
+
export const SetToInline = {
|
|
21
|
+
render: () => (_jsxs(_Fragment, { children: [_jsx(Text, { inline: true, mr: "x1", children: "Inline text" }), _jsx(Text, { inline: true, children: "Inline text" })] })),
|
|
22
22
|
name: "Set to inline",
|
|
23
23
|
};
|
|
24
|
-
export const SetToDisabled =
|
|
25
|
-
|
|
24
|
+
export const SetToDisabled = {
|
|
25
|
+
render: () => (_jsxs(_Fragment, { children: [_jsx(Box, { bg: "white", p: "x2", m: "x2", children: _jsx(Text, { disabled: true, children: "Disabled text" }) }), _jsx(Box, { bg: "darkBlue", p: "x2", m: "x2", children: _jsx(Text, { color: "white", disabled: true, children: "Disabled text" }) }), _jsx(Box, { bg: "black", p: "x2", m: "x2", children: _jsx(Text, { color: "white", disabled: true, children: "Disabled text" }) })] })),
|
|
26
26
|
name: "Set to disabled",
|
|
27
27
|
};
|
|
@@ -4,20 +4,14 @@ declare const _default: {
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _InlineValidation: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const WithListItems: {
|
|
7
|
-
()
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
7
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
name: string;
|
|
11
9
|
};
|
|
12
10
|
export declare const WithOnlyListItems: {
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
name: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const WithCustomContent: {
|
|
19
|
-
()
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
23
17
|
};
|
|
@@ -5,15 +5,15 @@ export default {
|
|
|
5
5
|
title: "Components/Inline Validation",
|
|
6
6
|
};
|
|
7
7
|
export const _InlineValidation = () => _jsx(InlineValidation, { errorMessage: "Something has gone wrong" });
|
|
8
|
-
export const WithListItems =
|
|
9
|
-
|
|
8
|
+
export const WithListItems = {
|
|
9
|
+
render: () => _jsx(InlineValidation, { errorMessage: "Something has gone wrong", errorList: errorList }),
|
|
10
10
|
name: "with list items",
|
|
11
11
|
};
|
|
12
|
-
export const WithOnlyListItems =
|
|
13
|
-
|
|
12
|
+
export const WithOnlyListItems = {
|
|
13
|
+
render: () => _jsx(InlineValidation, { errorList: errorList }),
|
|
14
14
|
name: "with only list items",
|
|
15
15
|
};
|
|
16
|
-
export const WithCustomContent =
|
|
17
|
-
|
|
16
|
+
export const WithCustomContent = {
|
|
17
|
+
render: () => (_jsx(InlineValidation, { errorMessage: "Something has gone wrong.", children: _jsxs(List, { compact: true, leftAlign: true, children: [_jsx(ListItem, { children: "Entry must be at least 3 characters long." }), _jsx(ListItem, { children: "Entry must contain a number" }), _jsx(ListItem, { children: _jsx(Link, { href: "https://nulogy.design/", children: "Custom Link" }) })] }) })),
|
|
18
18
|
name: "with custom content",
|
|
19
19
|
};
|
|
@@ -3,38 +3,26 @@ declare const _default: {
|
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const WithADefaultValue: {
|
|
6
|
-
()
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
name: string;
|
|
10
8
|
};
|
|
11
9
|
export declare const WithABlankValue: {
|
|
12
|
-
()
|
|
13
|
-
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
10
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
name: string;
|
|
16
12
|
};
|
|
17
13
|
export declare const WithAnOptionSelected: {
|
|
18
|
-
()
|
|
19
|
-
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
14
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
name: string;
|
|
22
16
|
};
|
|
23
17
|
export declare const WithWrappingText: {
|
|
24
|
-
()
|
|
25
|
-
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
18
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
name: string;
|
|
28
20
|
};
|
|
29
21
|
export declare const TestMultiselectOverflow: {
|
|
30
|
-
()
|
|
31
|
-
|
|
32
|
-
name: string;
|
|
33
|
-
};
|
|
22
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
name: string;
|
|
34
24
|
};
|
|
35
25
|
export declare const WithANullValue: {
|
|
36
|
-
()
|
|
37
|
-
|
|
38
|
-
name: string;
|
|
39
|
-
};
|
|
26
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
name: string;
|
|
40
28
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { action } from "
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
3
|
import { Select } from "../index";
|
|
4
4
|
import { Box } from "../Box";
|
|
5
5
|
const options = [
|
|
@@ -33,33 +33,33 @@ const wrappingOptions = [
|
|
|
33
33
|
export default {
|
|
34
34
|
title: "VisualTests/Select",
|
|
35
35
|
};
|
|
36
|
-
export const WithADefaultValue =
|
|
37
|
-
|
|
36
|
+
export const WithADefaultValue = {
|
|
37
|
+
render: () => (_jsx(Select, { defaultValue: options[0].value, placeholder: "Please select inventory status", onChange: action("selection changed"), onBlur: action("blurred"), options: options, labelText: "Inventory status", onInputChange: action("typed input value changed") })),
|
|
38
38
|
name: "with a defaultValue",
|
|
39
39
|
};
|
|
40
|
-
export const WithABlankValue =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
40
|
+
export const WithABlankValue = {
|
|
41
|
+
render: () => {
|
|
42
|
+
const optionsWithBlank = [{ value: null, label: "" }, ...options];
|
|
43
|
+
return (_jsx(Select, { placeholder: "Please select inventory status", onChange: action("selection changed"), onBlur: action("blurred"), options: optionsWithBlank, labelText: "Inventory status", onInputChange: action("typed input value changed") }));
|
|
44
|
+
},
|
|
45
45
|
name: "with a blank value",
|
|
46
46
|
};
|
|
47
|
-
export const WithAnOptionSelected =
|
|
48
|
-
|
|
47
|
+
export const WithAnOptionSelected = {
|
|
48
|
+
render: () => (_jsxs(_Fragment, { children: [_jsx(Select, { value: options[0].value, placeholder: "Please select inventory status", options: options, labelText: "Inventory status", onChange: action("selection changed"), onBlur: action("blurred"), onInputChange: action("typed input value changed") }), _jsx("br", {}), _jsx(Select, { value: options[0].value, placeholder: "Please select inventory status", options: options, labelText: "Inventory status", initialIsOpen: true, onChange: action("selection changed"), onBlur: action("blurred"), onInputChange: action("typed input value changed") })] })),
|
|
49
49
|
name: "with an option selected",
|
|
50
50
|
};
|
|
51
|
-
export const WithWrappingText =
|
|
52
|
-
|
|
51
|
+
export const WithWrappingText = {
|
|
52
|
+
render: () => (_jsx(Select, { initialIsOpen: true, value: options[0].value, placeholder: "Please select inventory status", options: wrappingOptions, labelText: "Inventory status", onChange: action("selection changed"), onBlur: action("blurred"), onInputChange: action("typed input value changed") })),
|
|
53
53
|
name: "With wrapping text",
|
|
54
54
|
};
|
|
55
|
-
export const TestMultiselectOverflow =
|
|
56
|
-
|
|
55
|
+
export const TestMultiselectOverflow = {
|
|
56
|
+
render: () => (_jsxs(_Fragment, { children: [_jsx(Select, { defaultValue: ["accepted", "assigned"], noOptionsMessage: () => "No options", placeholder: "Please select inventory status", options: options, labelText: "Inventory status", onChange: action("selection changed"), onBlur: action("blurred"), multiselect: true, onInputChange: action("typed input value changed") }), _jsx(Box, { width: "300px", children: _jsx(Select, { defaultValue: partnerCompanyName.map((item) => item.value), noOptionsMessage: () => "No options", placeholder: "Please select inventory status", options: partnerCompanyName, labelText: "PCN", onChange: action("selection changed"), onBlur: action("blurred"), multiselect: true, onInputChange: action("typed input value changed") }) }), _jsx(Box, { width: "400px", children: _jsx(Select, { defaultValue: options.map((item) => item.value), noOptionsMessage: () => "No options", placeholder: "Please select inventory status", options: options, labelText: "Inventory status", onChange: action("selection changed"), onBlur: action("blurred"), multiselect: true, onInputChange: action("typed input value changed") }) })] })),
|
|
57
57
|
name: "test multiselect overflow",
|
|
58
58
|
};
|
|
59
|
-
export const WithANullValue =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
63
|
-
|
|
59
|
+
export const WithANullValue = {
|
|
60
|
+
render: () => {
|
|
61
|
+
const optionsWithBlank = [{ value: null, label: "Nullable" }, { value: null, label: "Other null" }, ...options];
|
|
62
|
+
return (_jsx(Select, { defaultValue: null, placeholder: "Please select inventory status", onChange: action("selection changed"), onBlur: action("blurred"), options: optionsWithBlank, labelText: "Inventory status", onInputChange: action("typed input value changed") }));
|
|
63
|
+
},
|
|
64
64
|
name: "with a null value",
|
|
65
65
|
};
|
|
@@ -3,7 +3,7 @@ declare const _default: {
|
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Static: {
|
|
6
|
-
()
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
parameters: {
|
|
8
8
|
chromatic: {
|
|
9
9
|
disable: boolean;
|
|
@@ -12,9 +12,7 @@ export declare const Static: {
|
|
|
12
12
|
};
|
|
13
13
|
export declare const Base: () => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const WithALink: {
|
|
15
|
-
()
|
|
16
|
-
|
|
17
|
-
name: string;
|
|
18
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
19
17
|
};
|
|
20
18
|
export declare const Maintenance: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,18 +7,18 @@ const ErrorPageAlertWidth = "432px";
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Pages/ErrorPage",
|
|
9
9
|
};
|
|
10
|
-
export const Static =
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export const Static = {
|
|
11
|
+
render: () => (_jsxs(Text, { children: ["For non-React, static HTML error pages see the Nulogy error pages repository", " ", _jsx(Link, { href: "https://github.com/nulogy/error-pages", children: "on GitHub" }), " or preview them", " ", _jsx(Link, { href: "https://nulogy.github.io/error-pages/", children: "here" }), "."] })),
|
|
12
|
+
parameters: {
|
|
13
|
+
chromatic: { disable: true },
|
|
14
|
+
},
|
|
13
15
|
};
|
|
14
16
|
export const Base = () => (_jsx(Flex, { height: "100vh", flexDirection: "column", pt: "x3", pr: "x2", pb: "x2", pl: "x2", children: _jsx(Flex, { flexGrow: 1, maxWidth: ErrorPageWidth, m: "0 auto", children: _jsxs(Flex, { width: "100%", flexDirection: { extraSmall: "column", large: "row" }, alignItems: "center", children: [_jsx(Box, { mb: { extraSmall: "x5", small: "x4", large: 0 }, mt: { extraSmall: "x2", small: "80px", large: 0 }, mr: { extraSmall: 0, large: "x3" }, children: _jsx(Branding, { size: "large" }) }), _jsx(Box, { maxWidth: ErrorPageAlertWidth, children: _jsx(Alert, { type: "danger", title: "We're sorry, but something went wrong.", children: "We've been notified about this issue and we'll take a look at it shortly." }) })] }) }) }));
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
21
|
-
WithALink.story = {
|
|
17
|
+
export const WithALink = {
|
|
18
|
+
render: () => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
return (_jsx(Flex, { height: "100vh", flexDirection: "column", pt: "x3", pr: "x2", pb: "x2", pl: "x2", children: _jsx(Flex, { flexGrow: 1, maxWidth: ErrorPageWidth, m: "0 auto", children: _jsxs(Flex, { width: "100%", flexDirection: { extraSmall: "column", large: "row" }, alignItems: "center", children: [_jsx(Box, { mb: { extraSmall: "x5", small: "x4", large: 0 }, mt: { extraSmall: "x2", small: "80px", large: `-${theme.space.x4}` }, mr: { extraSmall: 0, large: "x3" }, children: _jsx(Branding, { size: "large" }) }), _jsxs(Box, { maxWidth: ErrorPageAlertWidth, children: [_jsx(Alert, { type: "danger", title: "We're sorry, but something went wrong.", mb: "x2", children: "We've been notified about this issue and we'll take a look at it shortly." }), _jsx(Link, { href: "/", children: "Back to homepage" })] })] }) }) }));
|
|
21
|
+
},
|
|
22
22
|
name: "With a link",
|
|
23
23
|
};
|
|
24
24
|
export const Maintenance = () => (_jsx(Flex, { height: "100vh", flexDirection: "column", pt: "x3", pr: "x2", pb: "x2", pl: "x2", children: _jsx(Flex, { flexGrow: 1, maxWidth: ErrorPageWidth, m: "0 auto", children: _jsxs(Flex, { width: "100%", flexDirection: { extraSmall: "column", large: "row" }, alignItems: "center", children: [_jsx(Box, { mb: { extraSmall: "x5", small: "x4", large: 0 }, mt: { extraSmall: "x2", small: "80px", large: 0 }, mr: { extraSmall: 0, large: "x3" }, children: _jsx(Branding, { size: "large" }) }), _jsx(Box, { maxWidth: ErrorPageAlertWidth, children: _jsx(Alert, { children: "We are currently adding new features to Nulogy Quality Control. We should be online shortly." }) })] }) }) }));
|
|
@@ -4,26 +4,18 @@ declare const _default: {
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Base: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const WithRememberMe: {
|
|
7
|
-
()
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
7
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
name: string;
|
|
11
9
|
};
|
|
12
10
|
export declare const WithForgotPasswordLink: {
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
name: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const WithError: {
|
|
19
|
-
()
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
23
17
|
};
|
|
24
18
|
export declare const WithErrorAndNoAdditionalText: {
|
|
25
|
-
()
|
|
26
|
-
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
19
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
name: string;
|
|
29
21
|
};
|
|
@@ -4,19 +4,19 @@ export default {
|
|
|
4
4
|
title: "Pages/LoginPage",
|
|
5
5
|
};
|
|
6
6
|
export const Base = () => (_jsx(Flex, { minHeight: "100vh", justifyContent: "center", flexDirection: "column", alignItems: "center", bg: { extraSmall: "white", small: "whiteGrey" }, width: "100%", children: _jsx(Flex, { width: "100%", maxWidth: "384px", alignItems: "center", justifyContent: "center", flexGrow: 1, children: _jsxs(Flex, { height: { extraSmall: "100%", small: "auto" }, maxWidth: "384px", width: "100%", borderRadius: { extraSmall: null, small: "medium" }, boxShadow: { extraSmall: null, small: "small" }, px: { extraSmall: "x2", small: "x4" }, py: { extraSmall: "x3", small: "x5" }, bg: "white", my: "x2", flexDirection: "column", alignItems: "center", children: [_jsx(Box, { mb: "x2", width: "100%", children: _jsx(Branding, { withLine: true, size: "large", subtext: "Logo Subtext", alignment: "center" }) }), _jsx(Text, { color: "darkGrey", fontSize: "small", lineHeight: "smallTextBase", mb: "x4", children: "Additional Text" }), _jsxs(Form, { children: [_jsx(Input, { labelText: "Email" }), _jsx(Input, { type: "password", labelText: "Password" }), _jsx(PrimaryButton, { fullWidth: true, children: "Sign In" })] })] }) }) }));
|
|
7
|
-
export const WithRememberMe =
|
|
8
|
-
|
|
7
|
+
export const WithRememberMe = {
|
|
8
|
+
render: () => (_jsx(Flex, { minHeight: "100vh", justifyContent: "center", flexDirection: "column", alignItems: "center", bg: { extraSmall: "white", small: "whiteGrey" }, width: "100%", children: _jsx(Flex, { width: "100%", maxWidth: "384px", alignItems: "center", justifyContent: "center", flexGrow: 1, children: _jsxs(Flex, { height: { extraSmall: "100%", small: "auto" }, maxWidth: "384px", width: "100%", borderRadius: { extraSmall: null, small: "medium" }, boxShadow: { extraSmall: null, small: "small" }, px: { extraSmall: "x2", small: "x4" }, py: { extraSmall: "x3", small: "x5" }, bg: "white", my: "x2", flexDirection: "column", alignItems: "center", children: [_jsx(Box, { mb: "x2", width: "100%", children: _jsx(Branding, { withLine: true, size: "large", subtext: "Logo Subtext", alignment: "center" }) }), _jsx(Text, { color: "darkGrey", fontSize: "small", lineHeight: "smallTextBase", mb: "x4", children: "Additional Text" }), _jsxs("form", { style: { width: "100%" }, children: [_jsx(Input, { mb: "x3", labelText: "Email" }), _jsx(Input, { type: "password", labelText: "Password" }), _jsx(Checkbox, { mb: "x3", labelText: "Remember me" }), _jsx(PrimaryButton, { fullWidth: true, children: "Sign In" })] })] }) }) })),
|
|
9
9
|
name: "with remember me",
|
|
10
10
|
};
|
|
11
|
-
export const WithForgotPasswordLink =
|
|
12
|
-
|
|
11
|
+
export const WithForgotPasswordLink = {
|
|
12
|
+
render: () => (_jsx(Flex, { minHeight: "100vh", justifyContent: "center", flexDirection: "column", alignItems: "center", bg: { extraSmall: "white", small: "whiteGrey" }, width: "100%", children: _jsx(Flex, { width: "100%", maxWidth: "384px", alignItems: "center", justifyContent: "center", flexGrow: 1, children: _jsxs(Flex, { height: { extraSmall: "100%", small: "auto" }, maxWidth: "384px", width: "100%", borderRadius: { extraSmall: null, small: "medium" }, boxShadow: { extraSmall: null, small: "small" }, px: { extraSmall: "x2", small: "x4" }, py: { extraSmall: "x3", small: "x5" }, bg: "white", my: "x2", flexDirection: "column", alignItems: "center", children: [_jsx(Box, { mb: "x2", width: "100%", children: _jsx(Branding, { withLine: true, size: "large", subtext: "Logo Subtext", alignment: "center" }) }), _jsx(Text, { color: "darkGrey", fontSize: "small", lineHeight: "smallTextBase", mb: "x4", children: "Additional Text" }), _jsxs(Form, { style: { width: "100%" }, children: [_jsx(Input, { labelText: "Email" }), _jsx(Input, { type: "password", labelText: "Password" }), _jsx(PrimaryButton, { fullWidth: true, children: "Sign In" })] }), _jsx(Box, { py: "x1", mt: "x1", children: _jsx(Link, { href: "/", children: "Forgot your password?" }) })] }) }) })),
|
|
13
13
|
name: "with forgot password link",
|
|
14
14
|
};
|
|
15
|
-
export const WithError =
|
|
16
|
-
|
|
15
|
+
export const WithError = {
|
|
16
|
+
render: () => (_jsx(Flex, { minHeight: "100vh", justifyContent: "center", flexDirection: "column", alignItems: "center", bg: { extraSmall: "white", small: "whiteGrey" }, width: "100%", children: _jsx(Flex, { width: "100%", maxWidth: "384px", alignItems: "center", justifyContent: "center", flexGrow: 1, children: _jsxs(Flex, { height: { extraSmall: "100%", small: "auto" }, maxWidth: "384px", width: "100%", borderRadius: { extraSmall: null, small: "medium" }, boxShadow: { extraSmall: null, small: "small" }, px: { extraSmall: "x2", small: "x4" }, py: { extraSmall: "x3", small: "x5" }, bg: "white", my: "x2", flexDirection: "column", alignItems: "center", children: [_jsx(Box, { mb: "x2", width: "100%", children: _jsx(Branding, { withLine: true, size: "large", subtext: "Logo Subtext", alignment: "center" }) }), _jsx(Text, { fontSize: "small", lineHeight: "smallTextBase", mb: "x4", children: "Additional Text" }), _jsx(Alert, { mb: "x4", width: "100%", type: "danger", children: "text" }), _jsxs(Form, { style: { width: "100%" }, children: [_jsx(Input, { labelText: "Email" }), _jsx(Input, { type: "password", labelText: "Password" }), _jsx(PrimaryButton, { fullWidth: true, children: "Sign In" })] })] }) }) })),
|
|
17
17
|
name: "with error",
|
|
18
18
|
};
|
|
19
|
-
export const WithErrorAndNoAdditionalText =
|
|
20
|
-
|
|
19
|
+
export const WithErrorAndNoAdditionalText = {
|
|
20
|
+
render: () => (_jsx(Flex, { minHeight: "100vh", justifyContent: "center", flexDirection: "column", alignItems: "center", bg: { extraSmall: "white", small: "whiteGrey" }, width: "100%", children: _jsx(Flex, { width: "100%", maxWidth: "384px", alignItems: "center", justifyContent: "center", flexGrow: 1, children: _jsxs(Flex, { height: { extraSmall: "100%", small: "auto" }, maxWidth: "384px", width: "100%", borderRadius: { extraSmall: null, small: "medium" }, boxShadow: { extraSmall: null, small: "small" }, px: { extraSmall: "x2", small: "x4" }, py: { extraSmall: "x3", small: "x5" }, bg: "white", my: "x2", flexDirection: "column", alignItems: "center", children: [_jsx(Box, { mb: "x4", width: "100%", children: _jsx(Branding, { withLine: true, size: "large", subtext: "Logo Subtext", alignment: "center" }) }), _jsx(Alert, { mb: "x4", width: "100%", type: "danger", children: "text" }), _jsxs(Form, { children: [_jsx(Input, { labelText: "Email" }), _jsx(Input, { type: "password", labelText: "Password" }), _jsx(PrimaryButton, { fullWidth: true, children: "Sign In" })] })] }) }) })),
|
|
21
21
|
name: "with error and no additional text",
|
|
22
22
|
};
|