@nulogy/components 16.0.1 → 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 +46 -59
- package/dist/main.js.map +1 -1
- package/dist/main.module.js +46 -59
- 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/BottomSheet.parts.d.ts +2 -2
- package/dist/src/BottomSheet/BottomSheet.styled.d.ts +10 -6
- 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.d.ts +12 -13
- package/dist/src/Box/Box.story.d.ts +22 -44
- package/dist/src/Box/Box.story.js +30 -30
- package/dist/src/BrandedNavBar/DesktopMenu.d.ts +3 -1
- package/dist/src/BrandedNavBar/NavBar.js +2 -2
- 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/DangerButton.d.ts +3 -1
- package/dist/src/Button/IconicButton.story.d.ts +23 -45
- package/dist/src/Button/IconicButton.story.js +27 -25
- package/dist/src/Button/PrimaryButton.d.ts +3 -1
- package/dist/src/Button/QuietButton.d.ts +3 -1
- 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/DateRange/EndTime.d.ts +5 -7
- package/dist/src/DateRange/StartTime.d.ts +5 -7
- 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/DescriptionList/stories/fixtures.d.ts +2 -2
- package/dist/src/DropdownMenu/DropdownMenu.story.d.ts +32 -32
- package/dist/src/DropdownMenu/DropdownMenu.story.js +58 -16
- package/dist/src/DropdownMenu/DropdownMenuContainer.d.ts +1 -1
- package/dist/src/DropdownMenu/DropdownText.d.ts +1 -1
- package/dist/src/FieldLabel/FieldLabel.story.d.ts +2 -4
- package/dist/src/FieldLabel/FieldLabel.story.js +2 -2
- package/dist/src/FieldLabel/HelpText.d.ts +1 -1
- 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.d.ts +6 -2
- 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.d.ts +5 -3
- package/dist/src/Modal/Modal.js +2 -2
- package/dist/src/Modal/Modal.story.d.ts +2 -24
- package/dist/src/Modal/ModalCloseButton.d.ts +4 -2
- package/dist/src/Modal/ModalContent.d.ts +1 -1
- package/dist/src/Navigation/components/AppSwitcher/parts/Item.d.ts +3 -1
- package/dist/src/Navigation/components/AppSwitcher/parts/index.d.ts +15 -7
- package/dist/src/Navigation/components/DesktopNav/parts/MoreMenuItem.d.ts +5 -1
- package/dist/src/Navigation/components/MenuSubItem/parts/styled.d.ts +17 -5
- package/dist/src/Navigation/components/MobileNav/parts/styled.d.ts +10 -4
- package/dist/src/Navigation/components/UserMenu/UserMenu.d.ts +5 -1
- package/dist/src/Navigation/components/UserMenu/parts/styled.d.ts +6 -2
- package/dist/src/Navigation/components/shared/NavigationMenuContent.d.ts +5 -1
- package/dist/src/Navigation/components/shared/NavigationMenuItem.d.ts +3 -1
- package/dist/src/Navigation/components/shared/components.d.ts +35 -9
- 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 +13 -15
- 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/Summary/Summary.d.ts +1 -2
- package/dist/src/Summary/Summary.js +2 -2
- package/dist/src/Summary/SummaryContext.d.ts +3 -1
- package/dist/src/Summary/SummaryContext.js +2 -2
- package/dist/src/Summary/SummaryItem.d.ts +1 -1
- package/dist/src/Summary/SummaryItem.js +2 -2
- package/dist/src/Switcher/Switcher.d.ts +2 -2
- package/dist/src/Switcher/Switcher.js +2 -2
- 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/TabScrollIndicator.d.ts +1 -1
- package/dist/src/Tabs/TabScrollIndicator.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.d.ts +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/TimePicker/TimePickerInput.d.ts +3 -1
- package/dist/src/TimeRange/TimeRange.d.ts +3 -2
- 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/ToastContainer/ToastFunction.js +2 -2
- package/dist/src/Toggle/Toggle.story.d.ts +25 -15
- package/dist/src/Toggle/Toggle.story.js +77 -43
- package/dist/src/Toggle/ToggleButton.js +2 -2
- package/dist/src/Tooltip/Tooltip.story.d.ts +1 -1
- package/dist/src/Tooltip/Tooltip.story.js +16 -0
- package/dist/src/TopBar/TopBar.styled.d.ts +16 -15
- package/dist/src/TopBar/components/BackLink.d.ts +3 -1
- package/dist/src/TopBar/components/MenuItemLink.d.ts +3 -1
- package/dist/src/TopBar/stories/TopBar.backButton.story.js +1 -1
- package/dist/src/TopBar/stories/TopBar.menu.story.js +1 -1
- 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/Headings.d.ts +4 -4
- 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/dist/src/utils/story/dashed.d.ts +1 -3
- package/dist/src/utils/story/resizable.d.ts +4 -2
- package/dist/src/utils/ts/FocusManager.d.ts +1 -1
- package/dist/src/utils/ts/FocusManager.js +2 -2
- package/package.json +25 -34
|
@@ -11,7 +11,7 @@ export declare const OutlinedDd: import("styled-components/dist/types").IStyledC
|
|
|
11
11
|
$outlined: boolean;
|
|
12
12
|
$highlighted?: boolean;
|
|
13
13
|
}>> & string;
|
|
14
|
-
export declare const DashedBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Record<string, unknown> & {
|
|
15
|
-
|
|
14
|
+
export declare const DashedBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Omit<Record<string, unknown>, "ref"> & {
|
|
15
|
+
ref?: unknown;
|
|
16
16
|
}) | (Omit<Record<string, unknown>, "ref"> & React.RefAttributes<React.Component<Record<string, unknown>, any, any>>), import("styled-components/dist/types").BaseObject>> & (string & (Omit<React.ComponentClass<Record<string, unknown>, any>, keyof React.Component<any, {}, any>> | Omit<React.FunctionComponent<Record<string, unknown>>, keyof React.Component<any, {}, any>>));
|
|
17
17
|
export declare const SampleContent: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,54 +6,54 @@ declare const _default: {
|
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
export declare const _DropdownMenu: {
|
|
9
|
-
()
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
name: string;
|
|
11
|
+
play: ({ canvasElement, step }: {
|
|
12
|
+
canvasElement: any;
|
|
13
|
+
step: any;
|
|
14
|
+
}) => Promise<void>;
|
|
13
15
|
};
|
|
14
16
|
export declare const WithCustomTrigger: {
|
|
15
|
-
()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
name: string;
|
|
19
|
+
play: ({ canvasElement, step }: {
|
|
20
|
+
canvasElement: any;
|
|
21
|
+
step: any;
|
|
22
|
+
}) => Promise<void>;
|
|
19
23
|
};
|
|
20
24
|
export declare const WithCustomColors: {
|
|
21
|
-
()
|
|
22
|
-
|
|
23
|
-
name: string;
|
|
24
|
-
};
|
|
25
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
name: string;
|
|
25
27
|
};
|
|
26
28
|
export declare const WithButtonClosingMenu: {
|
|
27
|
-
()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
name: string;
|
|
31
|
+
play: ({ canvasElement, step }: {
|
|
32
|
+
canvasElement: any;
|
|
33
|
+
step: any;
|
|
34
|
+
}) => Promise<void>;
|
|
31
35
|
};
|
|
32
36
|
export declare const WithCustomLink: () => import("react/jsx-runtime").JSX.Element;
|
|
33
37
|
export declare const WithCustomText: () => import("react/jsx-runtime").JSX.Element;
|
|
34
38
|
export declare const SetToDefaultOpen: {
|
|
35
|
-
()
|
|
36
|
-
|
|
37
|
-
name: string;
|
|
38
|
-
};
|
|
39
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
name: string;
|
|
39
41
|
};
|
|
40
42
|
export declare const WithSubmenu: {
|
|
41
|
-
()
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
name: string;
|
|
45
|
+
play: ({ canvasElement, step }: {
|
|
46
|
+
canvasElement: any;
|
|
47
|
+
step: any;
|
|
48
|
+
}) => Promise<void>;
|
|
45
49
|
};
|
|
46
50
|
export declare const WithVisitedLinks: () => import("react/jsx-runtime").JSX.Element;
|
|
47
51
|
export declare const SetToDisabled: {
|
|
48
|
-
()
|
|
49
|
-
|
|
50
|
-
name: string;
|
|
51
|
-
};
|
|
52
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
name: string;
|
|
52
54
|
};
|
|
53
55
|
export declare const WithConditionallyRenderedMenuItems: () => import("react/jsx-runtime").JSX.Element;
|
|
54
56
|
export declare const WithRenderProps: {
|
|
55
|
-
()
|
|
56
|
-
|
|
57
|
-
name: string;
|
|
58
|
-
};
|
|
57
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
name: string;
|
|
59
59
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { expect, screen, userEvent, waitFor, within } from "storybook/test";
|
|
2
3
|
import { DropdownMenu, DropdownLink, DropdownButton, DropdownItem, DropdownText, Button, Flex, Text, Icon, } from "../index";
|
|
3
4
|
const customColors = {
|
|
4
5
|
color: "white",
|
|
@@ -11,35 +12,76 @@ export default {
|
|
|
11
12
|
diffThreshold: 0.4,
|
|
12
13
|
},
|
|
13
14
|
};
|
|
14
|
-
export const _DropdownMenu =
|
|
15
|
-
|
|
15
|
+
export const _DropdownMenu = {
|
|
16
|
+
render: () => (_jsxs(DropdownMenu, { openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: [_jsx(DropdownLink, { href: "/never_been", children: "Dropdown Link" }), _jsx(DropdownButton, { onClick: () => { }, children: "Dropdown Button" })] })),
|
|
16
17
|
name: "DropdownMenu",
|
|
18
|
+
play: async ({ canvasElement, step }) => {
|
|
19
|
+
const canvas = within(canvasElement);
|
|
20
|
+
await step("opens the menu on click", async () => {
|
|
21
|
+
await userEvent.click(canvas.getByLabelText("open dropdown"));
|
|
22
|
+
await waitFor(() => expect(screen.getByText("Dropdown Button")).toBeVisible());
|
|
23
|
+
await expect(canvas.getByLabelText("close dropdown")).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
await step("closes the menu on click", async () => {
|
|
26
|
+
await userEvent.click(canvas.getByLabelText("close dropdown"));
|
|
27
|
+
await waitFor(() => expect(canvas.queryByLabelText("close dropdown")).not.toBeInTheDocument());
|
|
28
|
+
});
|
|
29
|
+
},
|
|
17
30
|
};
|
|
18
|
-
export const WithCustomTrigger =
|
|
19
|
-
|
|
31
|
+
export const WithCustomTrigger = {
|
|
32
|
+
render: () => (_jsxs(DropdownMenu, { openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", trigger: () => _jsx(Button, { children: "Custom Trigger" }), children: [_jsx(DropdownLink, { href: "/never_been", children: "Dropdown Link" }), _jsx(DropdownButton, { onClick: () => { }, children: "Dropdown Button" })] })),
|
|
20
33
|
name: "with custom trigger",
|
|
34
|
+
play: async ({ canvasElement, step }) => {
|
|
35
|
+
const canvas = within(canvasElement);
|
|
36
|
+
await step("opens the menu with a custom trigger", async () => {
|
|
37
|
+
await userEvent.click(canvas.getByLabelText("open dropdown"));
|
|
38
|
+
await waitFor(() => expect(screen.getByText("Dropdown Button")).toBeVisible());
|
|
39
|
+
});
|
|
40
|
+
},
|
|
21
41
|
};
|
|
22
|
-
export const WithCustomColors =
|
|
23
|
-
|
|
42
|
+
export const WithCustomColors = {
|
|
43
|
+
render: () => (_jsxs(DropdownMenu, { defaultOpen: true, backgroundColor: "blackBlue", openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: [_jsx(DropdownLink, { href: "/never_been", ...customColors, children: "Dropdown Link" }), _jsx(DropdownButton, { onClick: () => { }, ...customColors, children: "Dropdown Button" })] })),
|
|
24
44
|
name: "with custom colors",
|
|
25
45
|
};
|
|
26
|
-
export const WithButtonClosingMenu =
|
|
27
|
-
|
|
46
|
+
export const WithButtonClosingMenu = {
|
|
47
|
+
render: () => (_jsx(DropdownMenu, { openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: ({ closeMenu }) => _jsx(DropdownButton, { onClick: closeMenu, children: "Dropdown Button" }) })),
|
|
28
48
|
name: "with button closing menu",
|
|
49
|
+
play: async ({ canvasElement, step }) => {
|
|
50
|
+
const canvas = within(canvasElement);
|
|
51
|
+
await step("opens the menu", async () => {
|
|
52
|
+
await userEvent.click(canvas.getByLabelText("open dropdown"));
|
|
53
|
+
await waitFor(() => expect(screen.getByText("Dropdown Button")).toBeVisible());
|
|
54
|
+
});
|
|
55
|
+
await step("closes the menu using the callback button", async () => {
|
|
56
|
+
await userEvent.click(screen.getByText("Dropdown Button"));
|
|
57
|
+
await waitFor(() => expect(canvas.queryByLabelText("close dropdown")).not.toBeInTheDocument());
|
|
58
|
+
});
|
|
59
|
+
},
|
|
29
60
|
};
|
|
30
61
|
export const WithCustomLink = () => (_jsx(DropdownMenu, { defaultOpen: true, openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: _jsx(DropdownItem, { children: _jsx("a", { href: "/never_been", children: "Custom Link Component" }) }) }));
|
|
31
62
|
export const WithCustomText = () => (_jsx(DropdownMenu, { defaultOpen: true, children: _jsx(DropdownText, { children: "Custom Text" }) }));
|
|
32
|
-
export const SetToDefaultOpen =
|
|
33
|
-
|
|
63
|
+
export const SetToDefaultOpen = {
|
|
64
|
+
render: () => (_jsxs(DropdownMenu, { defaultOpen: true, openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: [_jsx(DropdownLink, { href: "/never_been", children: "Dropdown Link" }), _jsx(DropdownButton, { onClick: () => { }, children: "Dropdown Button" }), _jsx(DropdownItem, { children: _jsx("a", { href: "/never_been", style: { textDecoration: "none" }, children: "Custom Link Component" }) }), _jsx(DropdownText, { children: "Custom Text" })] })),
|
|
34
65
|
name: "set to defaultOpen",
|
|
35
66
|
};
|
|
36
|
-
export const WithSubmenu =
|
|
37
|
-
|
|
67
|
+
export const WithSubmenu = {
|
|
68
|
+
render: () => (_jsxs(DropdownMenu, { openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: [_jsx(DropdownLink, { href: "/never_been", children: "Dropdown Link" }), _jsx(DropdownButton, { onClick: () => { }, children: "Dropdown Button" }), _jsxs(DropdownMenu, { trigger: () => (_jsx(DropdownButton, { children: _jsxs(Flex, { justifyContent: "space-between", children: [_jsx(Text, { children: "Submenu" }), _jsx(Icon, { icon: "rightArrow", title: "right arrow" })] }) })), placement: "left-start", showArrow: false, openOnHover: true, openAriaLabel: "open sub dropdown", closeAriaLabel: "close sub dropdown", children: [_jsx(DropdownButton, { onClick: () => { }, children: "Inner Dropdown Button" }), _jsx(DropdownText, { children: " Inner Custom Text" })] })] })),
|
|
38
69
|
name: "with submenu",
|
|
70
|
+
play: async ({ canvasElement, step }) => {
|
|
71
|
+
const canvas = within(canvasElement);
|
|
72
|
+
await step("opens the menu", async () => {
|
|
73
|
+
await userEvent.click(canvas.getByLabelText("open dropdown"));
|
|
74
|
+
await waitFor(() => expect(screen.getByText("Dropdown Button")).toBeVisible());
|
|
75
|
+
});
|
|
76
|
+
await step("opens the submenu on hover", async () => {
|
|
77
|
+
await userEvent.hover(screen.getByLabelText("open sub dropdown"));
|
|
78
|
+
await waitFor(() => expect(screen.getByText("Inner Dropdown Button")).toBeVisible());
|
|
79
|
+
});
|
|
80
|
+
},
|
|
39
81
|
};
|
|
40
82
|
export const WithVisitedLinks = () => (_jsxs(DropdownMenu, { defaultOpen: true, openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: [_jsx(DropdownLink, { href: "/", children: "Dropdown Link" }), _jsx(DropdownItem, { children: _jsx("a", { href: "/", style: { textDecoration: "none" }, children: "Custom Link Component" }) })] }));
|
|
41
|
-
export const SetToDisabled =
|
|
42
|
-
|
|
83
|
+
export const SetToDisabled = {
|
|
84
|
+
render: () => (_jsxs(DropdownMenu, { disabled: true, openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", children: [_jsx(DropdownLink, { href: "/never_been", children: "Dropdown Link" }), _jsx(DropdownButton, { onClick: () => { }, children: "Dropdown Button" })] })),
|
|
43
85
|
name: "Set to disabled",
|
|
44
86
|
};
|
|
45
87
|
export const WithConditionallyRenderedMenuItems = () => {
|
|
@@ -47,7 +89,7 @@ export const WithConditionallyRenderedMenuItems = () => {
|
|
|
47
89
|
const showItemC = true;
|
|
48
90
|
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownButton, { onClick: () => { }, children: "Item A" }), showItemB && _jsx(DropdownButton, { onClick: () => { }, children: "Conditional Item B" }), showItemC && _jsx(DropdownButton, { onClick: () => { }, children: "Conditional Item C" })] }));
|
|
49
91
|
};
|
|
50
|
-
export const WithRenderProps =
|
|
51
|
-
|
|
92
|
+
export const WithRenderProps = {
|
|
93
|
+
render: () => (_jsx(DropdownMenu, { children: ({ closeMenu, openMenu }) => (_jsxs(_Fragment, { children: [_jsx(DropdownButton, { onClick: (e) => closeMenu(e), children: "Close menu" }), _jsx(DropdownButton, { onClick: (e) => openMenu(e), children: "Open menu" })] })) })),
|
|
52
94
|
name: "With render props",
|
|
53
95
|
};
|
|
@@ -7,5 +7,5 @@ type DropdownMenuContainerProps = {
|
|
|
7
7
|
dataPlacement?: any;
|
|
8
8
|
theme?: DefaultNDSThemeType;
|
|
9
9
|
};
|
|
10
|
-
declare const DropdownMenuContainer:
|
|
10
|
+
declare const DropdownMenuContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("../Box").BoxProps> & import("../Box").BoxProps, DropdownMenuContainerProps>> & string;
|
|
11
11
|
export default DropdownMenuContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TextProps } from "../Type";
|
|
2
|
-
declare const DropdownText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" |
|
|
2
|
+
declare const DropdownText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" | keyof import("react").HTMLAttributes<HTMLParagraphElement> | "disabled" | "inline" | "compact" | keyof import("..").StyledProps> & import("react").HTMLAttributes<HTMLParagraphElement> & {
|
|
3
3
|
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
4
4
|
inline?: boolean;
|
|
5
5
|
compact?: boolean;
|
|
@@ -3,10 +3,8 @@ declare const _default: {
|
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _FieldLabel: {
|
|
6
|
-
()
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
name: string;
|
|
10
8
|
};
|
|
11
9
|
export declare const WithHelpText: () => import("react/jsx-runtime").JSX.Element;
|
|
12
10
|
export declare const WithRequirementText: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,8 +5,8 @@ const helpTextWithLink = (_jsxs(_Fragment, { children: ["I am help text. I can b
|
|
|
5
5
|
export default {
|
|
6
6
|
title: "Components/FieldLabel",
|
|
7
7
|
};
|
|
8
|
-
export const _FieldLabel =
|
|
9
|
-
|
|
8
|
+
export const _FieldLabel = {
|
|
9
|
+
render: () => _jsx(FieldLabel, { labelText: "Default label" }),
|
|
10
10
|
name: "FieldLabel",
|
|
11
11
|
};
|
|
12
12
|
export const WithHelpText = () => _jsx(FieldLabel, { labelText: "Default label", helpText: helpTextWithLink });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const HelpText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" |
|
|
1
|
+
declare const HelpText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" | keyof import("react").HTMLAttributes<HTMLParagraphElement> | "disabled" | "inline" | "compact" | keyof import("..").StyledProps> & import("react").HTMLAttributes<HTMLParagraphElement> & {
|
|
2
2
|
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
3
3
|
inline?: boolean;
|
|
4
4
|
compact?: boolean;
|
|
@@ -4,104 +4,70 @@ declare const _default: {
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _Flex: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const FlexDirectionSetToRowReverse: {
|
|
7
|
-
()
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
7
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
name: string;
|
|
11
9
|
};
|
|
12
10
|
export declare const FlexDirectionSetToColumn: {
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
name: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const FlexDirectionSetToColumnReverse: {
|
|
19
|
-
()
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
23
17
|
};
|
|
24
18
|
export declare const FlexWrapSetToNoWrapDefault: {
|
|
25
|
-
()
|
|
26
|
-
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
19
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
name: string;
|
|
29
21
|
};
|
|
30
22
|
export declare const FlexWrapSetToWrap: {
|
|
31
|
-
()
|
|
32
|
-
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
23
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
name: string;
|
|
35
25
|
};
|
|
36
26
|
export declare const FlexWrapSetToWrapReverse: {
|
|
37
|
-
()
|
|
38
|
-
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
27
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
name: string;
|
|
41
29
|
};
|
|
42
30
|
export declare const JustifyContentSetToFlexStartDefault: {
|
|
43
|
-
()
|
|
44
|
-
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
31
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
name: string;
|
|
47
33
|
};
|
|
48
34
|
export declare const JustifyContentSetToFlexEnd: {
|
|
49
|
-
()
|
|
50
|
-
|
|
51
|
-
name: string;
|
|
52
|
-
};
|
|
35
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
name: string;
|
|
53
37
|
};
|
|
54
38
|
export declare const JustifyContentSetToCenter: {
|
|
55
|
-
()
|
|
56
|
-
|
|
57
|
-
name: string;
|
|
58
|
-
};
|
|
39
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
name: string;
|
|
59
41
|
};
|
|
60
42
|
export declare const JustifyContentSetToSpaceBetween: {
|
|
61
|
-
()
|
|
62
|
-
|
|
63
|
-
name: string;
|
|
64
|
-
};
|
|
43
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
name: string;
|
|
65
45
|
};
|
|
66
46
|
export declare const JustifyContentSetToSpaceAround: {
|
|
67
|
-
()
|
|
68
|
-
|
|
69
|
-
name: string;
|
|
70
|
-
};
|
|
47
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
name: string;
|
|
71
49
|
};
|
|
72
50
|
export declare const JustifyContentSetToSpaceEvenly: {
|
|
73
|
-
()
|
|
74
|
-
|
|
75
|
-
name: string;
|
|
76
|
-
};
|
|
51
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
name: string;
|
|
77
53
|
};
|
|
78
54
|
export declare const AlignItemsSetToStretchDefault: {
|
|
79
|
-
()
|
|
80
|
-
|
|
81
|
-
name: string;
|
|
82
|
-
};
|
|
55
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
name: string;
|
|
83
57
|
};
|
|
84
58
|
export declare const AlignItemsSetToFlexStart: {
|
|
85
|
-
()
|
|
86
|
-
|
|
87
|
-
name: string;
|
|
88
|
-
};
|
|
59
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
name: string;
|
|
89
61
|
};
|
|
90
62
|
export declare const AlignItemsSetToCenter: {
|
|
91
|
-
()
|
|
92
|
-
|
|
93
|
-
name: string;
|
|
94
|
-
};
|
|
63
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
name: string;
|
|
95
65
|
};
|
|
96
66
|
export declare const AlignItemsSetToFlexEnd: {
|
|
97
|
-
()
|
|
98
|
-
|
|
99
|
-
name: string;
|
|
100
|
-
};
|
|
67
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
name: string;
|
|
101
69
|
};
|
|
102
70
|
export declare const WithCustomOrder: {
|
|
103
|
-
()
|
|
104
|
-
|
|
105
|
-
name: string;
|
|
106
|
-
};
|
|
71
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
name: string;
|
|
107
73
|
};
|
|
@@ -15,73 +15,73 @@ export default {
|
|
|
15
15
|
export const _Flex = () => (_jsxs(Flex, { style: {
|
|
16
16
|
boxSizing: "content-box",
|
|
17
17
|
}, padding: "x3", bg: "whiteGrey", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] }));
|
|
18
|
-
export const FlexDirectionSetToRowReverse =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
export const FlexDirectionSetToRowReverse = {
|
|
19
|
+
render: () => (_jsxs(Flex, { style: {
|
|
20
|
+
boxSizing: "content-box",
|
|
21
|
+
}, flexDirection: "row-reverse", padding: "x3", bg: "whiteGrey", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
22
22
|
name: "flexDirection set to row-reverse",
|
|
23
23
|
};
|
|
24
|
-
export const FlexDirectionSetToColumn =
|
|
25
|
-
|
|
24
|
+
export const FlexDirectionSetToColumn = {
|
|
25
|
+
render: () => (_jsxs(Flex, { flexDirection: "column", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
26
26
|
name: "flexDirection set to column",
|
|
27
27
|
};
|
|
28
|
-
export const FlexDirectionSetToColumnReverse =
|
|
29
|
-
|
|
28
|
+
export const FlexDirectionSetToColumnReverse = {
|
|
29
|
+
render: () => (_jsxs(Flex, { flexDirection: "column-reverse", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
30
30
|
name: "flexDirection set to column-reverse",
|
|
31
31
|
};
|
|
32
|
-
export const FlexWrapSetToNoWrapDefault =
|
|
33
|
-
|
|
32
|
+
export const FlexWrapSetToNoWrapDefault = {
|
|
33
|
+
render: () => (_jsx(Box, { width: 500, children: _jsxs(Flex, { flexWrap: "nowrap", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" }), _jsx(StyledBox, { children: "6" }), _jsx(StyledBox, { children: "7" })] }) })),
|
|
34
34
|
name: "flexWrap set to no-wrap (default)",
|
|
35
35
|
};
|
|
36
|
-
export const FlexWrapSetToWrap =
|
|
37
|
-
|
|
36
|
+
export const FlexWrapSetToWrap = {
|
|
37
|
+
render: () => (_jsx(Box, { width: 500, children: _jsxs(Flex, { flexWrap: "wrap", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" }), _jsx(StyledBox, { children: "6" }), _jsx(StyledBox, { children: "7" })] }) })),
|
|
38
38
|
name: "flexWrap set to wrap",
|
|
39
39
|
};
|
|
40
|
-
export const FlexWrapSetToWrapReverse =
|
|
41
|
-
|
|
40
|
+
export const FlexWrapSetToWrapReverse = {
|
|
41
|
+
render: () => (_jsx(Box, { width: 500, children: _jsxs(Flex, { flexWrap: "wrap-reverse", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" }), _jsx(StyledBox, { children: "6" }), _jsx(StyledBox, { children: "7" })] }) })),
|
|
42
42
|
name: "flexWrap set to wrap-reverse",
|
|
43
43
|
};
|
|
44
|
-
export const JustifyContentSetToFlexStartDefault =
|
|
45
|
-
|
|
44
|
+
export const JustifyContentSetToFlexStartDefault = {
|
|
45
|
+
render: () => (_jsxs(Flex, { justifyContent: "flex-start", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
46
46
|
name: "justifyContent set to flex-start (default)",
|
|
47
47
|
};
|
|
48
|
-
export const JustifyContentSetToFlexEnd =
|
|
49
|
-
|
|
48
|
+
export const JustifyContentSetToFlexEnd = {
|
|
49
|
+
render: () => (_jsxs(Flex, { justifyContent: "flex-end", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
50
50
|
name: "justifyContent set to flex-end",
|
|
51
51
|
};
|
|
52
|
-
export const JustifyContentSetToCenter =
|
|
53
|
-
|
|
52
|
+
export const JustifyContentSetToCenter = {
|
|
53
|
+
render: () => (_jsxs(Flex, { justifyContent: "center", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
54
54
|
name: "justifyContent set to center",
|
|
55
55
|
};
|
|
56
|
-
export const JustifyContentSetToSpaceBetween =
|
|
57
|
-
|
|
56
|
+
export const JustifyContentSetToSpaceBetween = {
|
|
57
|
+
render: () => (_jsxs(Flex, { justifyContent: "space-between", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
58
58
|
name: "justifyContent set to space-between",
|
|
59
59
|
};
|
|
60
|
-
export const JustifyContentSetToSpaceAround =
|
|
61
|
-
|
|
60
|
+
export const JustifyContentSetToSpaceAround = {
|
|
61
|
+
render: () => (_jsxs(Flex, { justifyContent: "space-around", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
62
62
|
name: "justifyContent set to space-around",
|
|
63
63
|
};
|
|
64
|
-
export const JustifyContentSetToSpaceEvenly =
|
|
65
|
-
|
|
64
|
+
export const JustifyContentSetToSpaceEvenly = {
|
|
65
|
+
render: () => (_jsxs(Flex, { justifyContent: "space-evenly", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
66
66
|
name: "justifyContent set to space-evenly",
|
|
67
67
|
};
|
|
68
|
-
export const AlignItemsSetToStretchDefault =
|
|
69
|
-
|
|
68
|
+
export const AlignItemsSetToStretchDefault = {
|
|
69
|
+
render: () => (_jsxs(Flex, { alignItems: "stretch", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
70
70
|
name: "alignItems set to stretch (default)",
|
|
71
71
|
};
|
|
72
|
-
export const AlignItemsSetToFlexStart =
|
|
73
|
-
|
|
72
|
+
export const AlignItemsSetToFlexStart = {
|
|
73
|
+
render: () => (_jsxs(Flex, { alignItems: "flex-start", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
74
74
|
name: "alignItems set to flex-start",
|
|
75
75
|
};
|
|
76
|
-
export const AlignItemsSetToCenter =
|
|
77
|
-
|
|
76
|
+
export const AlignItemsSetToCenter = {
|
|
77
|
+
render: () => (_jsxs(Flex, { alignItems: "center", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
78
78
|
name: "alignItems set to center",
|
|
79
79
|
};
|
|
80
|
-
export const AlignItemsSetToFlexEnd =
|
|
81
|
-
|
|
80
|
+
export const AlignItemsSetToFlexEnd = {
|
|
81
|
+
render: () => (_jsxs(Flex, { alignItems: "flex-end", children: [_jsx(StyledBox, { children: "1" }), _jsx(StyledBox, { children: "2" }), _jsx(StyledBox, { children: "3" }), _jsx(StyledBox, { children: "4" }), _jsx(StyledBox, { children: "5" })] })),
|
|
82
82
|
name: "alignItems set to flex-end",
|
|
83
83
|
};
|
|
84
|
-
export const WithCustomOrder =
|
|
85
|
-
|
|
84
|
+
export const WithCustomOrder = {
|
|
85
|
+
render: () => (_jsxs(Flex, { children: [_jsx(StyledBox, { order: 1, children: "1" }), _jsx(StyledBox, { order: 3, children: "2" }), _jsx(StyledBox, { order: 2, children: "3" }), _jsx(StyledBox, { order: 5, children: "4" }), _jsx(StyledBox, { order: 4, children: "5" })] })),
|
|
86
86
|
name: "With custom order",
|
|
87
87
|
};
|
|
@@ -4,27 +4,19 @@ declare const _default: {
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _Form: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const WithoutTitle: {
|
|
7
|
-
()
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
7
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
name: string;
|
|
11
9
|
};
|
|
12
10
|
export declare const WithFormSections: {
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
name: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const WithFormSectionsWithoutTitles: {
|
|
19
|
-
()
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
23
17
|
};
|
|
24
18
|
export declare const DemoForm: {
|
|
25
|
-
()
|
|
26
|
-
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
19
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
name: string;
|
|
29
21
|
};
|
|
30
22
|
export declare const WithAnAction: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,20 +8,20 @@ export default {
|
|
|
8
8
|
title: "Components/Form",
|
|
9
9
|
};
|
|
10
10
|
export const _Form = () => (_jsxs(Form, { title: "New Profile", 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)" })] }));
|
|
11
|
-
export const WithoutTitle =
|
|
12
|
-
|
|
11
|
+
export const WithoutTitle = {
|
|
12
|
+
render: () => (_jsxs(Form, { 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)" })] })),
|
|
13
13
|
name: "Without title",
|
|
14
14
|
};
|
|
15
|
-
export const WithFormSections =
|
|
16
|
-
|
|
15
|
+
export const WithFormSections = {
|
|
16
|
+
render: () => (_jsxs(Form, { title: "New Profile", 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" })] })] })),
|
|
17
17
|
name: "With form sections",
|
|
18
18
|
};
|
|
19
|
-
export const WithFormSectionsWithoutTitles =
|
|
20
|
-
|
|
19
|
+
export const WithFormSectionsWithoutTitles = {
|
|
20
|
+
render: () => (_jsxs(Form, { title: "New Profile", children: [_jsxs(FormSection, { 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, { children: [_jsx(Input, { id: "gender", labelText: "Gender" }), _jsx(Input, { id: "occupation", labelText: "Occupation" })] })] })),
|
|
21
21
|
name: "With form sections without titles",
|
|
22
22
|
};
|
|
23
|
-
export const DemoForm =
|
|
24
|
-
|
|
23
|
+
export const DemoForm = {
|
|
24
|
+
render: () => (_jsx(_Fragment, { children: _jsxs(Form, { title: "Job 324400", children: [_jsxs(Alert, { type: "danger", title: "Errors have occured ...", children: [_jsx(Text, { children: "Instructions and description of errors" }), _jsxs(List, { compact: true, children: [_jsx(ListItem, { children: "Affected field" }), _jsx(ListItem, { children: "Unmet criteria" }), _jsx(ListItem, { children: _jsx("a", { href: "https://nulogy.design/", children: "Affected field" }) })] })] }), _jsxs(FormSection, { title: "Job Information", children: [_jsx(Input, { id: "project", labelText: "Project", placeholder: "Project 128703" }), _jsx(Input, { id: "project-description", labelText: "Project description", requirementText: "(Optional)", helpText: "Project description helps identify the project." }), _jsx(Select, { id: "project-status", labelText: "Project status", options: options }), _jsx(Input, { id: "item-code", labelText: "Item code", defaultValue: "WS2SB6", errorMessage: "Item WS2SB6 does not exist." }), _jsx(Input, { id: "eaches-expected", labelText: "Eaches expected on Job", placeholder: "2 000" }), _jsx(Input, { id: "eaches-remaining", labelText: "Eaches remaining on Project", defaultValue: "18 000", disabled: true }), _jsx(Input, { id: "scheduled-start", labelText: "Scheduled start", placeholder: "MMM-DD-YYYY" }), _jsx(Input, { id: "scheduled-end", labelText: "Scheduled end", placeholder: "MMM-DD-YYYY" }), _jsxs(CheckboxGroup, { labelText: "Line Lead", name: "linelead", requirementText: "(Optional)", children: [_jsx(Checkbox, { value: "christiaan", labelText: "Christiaan Oostenbrug" }), _jsx(Checkbox, { value: "matt", labelText: "Matt Dunn" }), _jsx(Checkbox, { value: "clemens", labelText: "Clemens Park", disabled: true, checked: true }), _jsx(Checkbox, { value: "nikola", labelText: "Nikola Pejcic", disabled: true })] }), _jsxs(RadioGroup, { errorMessage: "Only yes can be selected...", labelText: "Reconcile", name: "settingSelection", defaultValue: "yes", id: "reconcile", children: [_jsx(Radio, { value: "yes", labelText: "Yes" }), _jsx(Radio, { value: "no", labelText: "No" }), _jsx(Radio, { value: "maybe", labelText: "Maybe", disabled: true })] }), _jsx(Toggle, { id: "job-visibility", labelText: "Job Visibility", onText: "Visible", offText: "Hidden" })] }), _jsxs(FormSection, { title: "Rejects", children: [_jsx(Input, { defaultValue: "235432", id: "items", labelText: "Item", errorMessage: "Item 235432 is not a valid entry" }), _jsx(Input, { id: "quantity", labelText: "Quantity" }), _jsx(Toggle, { id: "reject-visibility", labelText: "Reject visibility", onText: "Visible", offText: "Hidden", disabled: true })] })] }) })),
|
|
25
25
|
name: "Demo form",
|
|
26
26
|
};
|
|
27
27
|
export const WithAnAction = () => {
|