@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
package/dist/src/Icon/Icon.d.ts
CHANGED
|
@@ -10,7 +10,11 @@ export interface IconProps extends SpaceProps {
|
|
|
10
10
|
focusable?: boolean;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
}
|
|
13
|
-
declare const Icon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<IconProps & React.RefAttributes<SVGSVGElement>,
|
|
13
|
+
declare const Icon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<IconProps & React.RefAttributes<SVGSVGElement>, "ref"> & {
|
|
14
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
15
|
+
}, IconProps>> & string & Omit<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>, keyof React.Component<any, {}, any>>;
|
|
14
16
|
export declare const InlineIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
15
|
-
export declare const InputIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<IconProps & React.RefAttributes<SVGSVGElement>,
|
|
17
|
+
export declare const InputIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<Omit<IconProps & React.RefAttributes<SVGSVGElement>, "ref"> & {
|
|
18
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
19
|
+
}, keyof IconProps> & IconProps, PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>>> & string;
|
|
16
20
|
export default Icon;
|
|
@@ -3,38 +3,26 @@ declare const _default: {
|
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const BasicIcon: {
|
|
6
|
-
()
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
name: string;
|
|
10
8
|
};
|
|
11
9
|
export declare const _InlineIcon: {
|
|
12
|
-
()
|
|
13
|
-
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
10
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
name: string;
|
|
16
12
|
};
|
|
17
13
|
export declare const WithAColor: {
|
|
18
|
-
()
|
|
19
|
-
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
14
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
name: string;
|
|
22
16
|
};
|
|
23
17
|
export declare const WithASize: {
|
|
24
|
-
()
|
|
25
|
-
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
18
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
name: string;
|
|
28
20
|
};
|
|
29
21
|
export declare const WithAddedMargin: {
|
|
30
|
-
()
|
|
31
|
-
|
|
32
|
-
name: string;
|
|
33
|
-
};
|
|
22
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
name: string;
|
|
34
24
|
};
|
|
35
25
|
export declare const WithAccessibilityTitle: {
|
|
36
|
-
()
|
|
37
|
-
|
|
38
|
-
name: string;
|
|
39
|
-
};
|
|
26
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
name: string;
|
|
40
28
|
};
|
|
@@ -8,30 +8,30 @@ const IconCode = ({ icon }) => (_jsxs("code", { children: ["<Icon icon=\"", _jsx
|
|
|
8
8
|
export default {
|
|
9
9
|
title: "Components/Icon",
|
|
10
10
|
};
|
|
11
|
-
export const BasicIcon =
|
|
12
|
-
|
|
11
|
+
export const BasicIcon = {
|
|
12
|
+
render: () => (_jsx(_Fragment, { children: iconNames.map((iconName) => (_jsxs(Flex, { my: "x2", children: [_jsx(Icon, { mr: "20px", icon: iconName }), _jsx(IconCode, { icon: iconName })] }, iconName))) })),
|
|
13
13
|
name: "Icon",
|
|
14
14
|
};
|
|
15
|
-
export const _InlineIcon =
|
|
16
|
-
|
|
15
|
+
export const _InlineIcon = {
|
|
16
|
+
render: () => (_jsx(_Fragment, { children: [1, 2, 3, 4].map((size) => (_jsxs("p", { style: { fontSize: `${size}em` }, children: ["@", size, "em: \u00A0", iconSubset.map((iconName) => (_jsx(InlineIcon, { icon: iconName }, iconName)))] }, size))) })),
|
|
17
17
|
name: "InlineIcon",
|
|
18
18
|
};
|
|
19
|
-
export const WithAColor =
|
|
20
|
-
|
|
19
|
+
export const WithAColor = {
|
|
20
|
+
render: () => (_jsx(_Fragment, { children: ["red", "yellow", "green", "blue", "blackBlue"].map((color) => (_jsx(Box, { children: iconSubset.map((iconName) => (_jsx(Icon, { icon: iconName, color: color }, iconName))) }, color))) })),
|
|
21
21
|
name: "With a color",
|
|
22
22
|
};
|
|
23
|
-
export const WithASize =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
23
|
+
export const WithASize = {
|
|
24
|
+
render: () => {
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
return (_jsx(_Fragment, { children: [theme.space.x1, theme.space.x2, theme.space.x3].map((size) => (_jsx(Box, { children: iconSubset.map((iconName) => (_jsx(Icon, { icon: iconName, size: size }, iconName))) }, size))) }));
|
|
27
|
+
},
|
|
28
28
|
name: "With a size",
|
|
29
29
|
};
|
|
30
|
-
export const WithAddedMargin =
|
|
31
|
-
|
|
30
|
+
export const WithAddedMargin = {
|
|
31
|
+
render: () => (_jsxs(Box, { m: "x3", children: [_jsx(Box, { style: { display: "inline-block" }, m: "x3", bg: "lightGrey", children: _jsx(Icon, { m: "x2", icon: "delete" }) }), _jsx(Box, { style: { display: "inline-block" }, m: "x3", bg: "lightGrey", children: _jsx(Icon, { mt: "x2", icon: "delete" }) }), _jsx(Box, { style: { display: "inline-block" }, m: "x3", bg: "lightGrey", children: _jsx(Icon, { mr: "x2", icon: "delete" }) }), _jsx(Box, { style: { display: "inline-block" }, m: "x3", bg: "lightGrey", children: _jsx(Icon, { mb: "x2", icon: "delete" }) }), _jsx(Box, { style: { display: "inline-block" }, m: "x3", bg: "lightGrey", children: _jsx(Icon, { ml: "x2", icon: "delete" }) }), _jsx(Box, { style: { display: "inline-block" }, m: "x3", bg: "lightGrey", children: _jsx(Icon, { mx: "x2", icon: "delete" }) }), _jsx(Box, { style: { display: "inline-block" }, m: "x3", bg: "lightGrey", children: _jsx(Icon, { my: "x2", icon: "delete" }) })] })),
|
|
32
32
|
name: "With added margin",
|
|
33
33
|
};
|
|
34
|
-
export const WithAccessibilityTitle =
|
|
35
|
-
|
|
34
|
+
export const WithAccessibilityTitle = {
|
|
35
|
+
render: () => (_jsxs(_Fragment, { children: [_jsxs(Flex, { p: "x2", children: [_jsx(Icon, { icon: "user", title: "User account" }), " This has a title attribute so it will be read by assistive devices."] }), _jsxs(Flex, { p: "x2", children: [_jsx(Icon, { icon: "user" }), " This doesn't have a title attribute, so it has aria-hidden set true instead."] })] })),
|
|
36
36
|
name: "With accessibility title",
|
|
37
37
|
};
|
|
@@ -4,52 +4,36 @@ declare const _default: {
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _Input: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const WithAllProps: {
|
|
7
|
-
()
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
7
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
name: string;
|
|
11
9
|
};
|
|
12
10
|
export declare const SetToDisabled: {
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
name: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const WithErrorMessage: {
|
|
19
|
-
()
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
23
17
|
};
|
|
24
18
|
export declare const WithErrorList: {
|
|
25
|
-
()
|
|
26
|
-
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
19
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
name: string;
|
|
29
21
|
};
|
|
30
22
|
export declare const WithCustomId: {
|
|
31
|
-
()
|
|
32
|
-
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
23
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
name: string;
|
|
35
25
|
};
|
|
36
26
|
export declare const SetToRequired: {
|
|
37
|
-
()
|
|
38
|
-
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
27
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
name: string;
|
|
41
29
|
};
|
|
42
30
|
export declare const WithAAffixPrefixAndSuffix: {
|
|
43
|
-
()
|
|
44
|
-
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
31
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
name: string;
|
|
47
33
|
};
|
|
48
34
|
export declare const WithAnIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
49
35
|
export declare const WithIconTooltips: () => import("react/jsx-runtime").JSX.Element;
|
|
50
36
|
export declare const UsingRefToControlFocus: {
|
|
51
|
-
()
|
|
52
|
-
|
|
53
|
-
name: string;
|
|
54
|
-
};
|
|
37
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
name: string;
|
|
55
39
|
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from "react";
|
|
3
|
-
import { action } from "
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
4
|
import { Input, Form, FormSection, PrimaryButton, Button, Flex, Heading4 } from "../index";
|
|
5
5
|
const errorList = ["Error message 1", "Error message 2"];
|
|
6
6
|
export default {
|
|
7
7
|
title: "Components/Input",
|
|
8
8
|
};
|
|
9
9
|
export const _Input = () => _jsx(Input, { labelText: "Input", onChange: action("value changed"), onBlur: action("blurred") });
|
|
10
|
-
export const WithAllProps =
|
|
11
|
-
|
|
10
|
+
export const WithAllProps = {
|
|
11
|
+
render: () => (_jsx(Input, { placeholder: "Placeholder", p: "x3", labelText: "Input", helpText: "Additional help text", requirementText: "Required", onChange: action("value changed"), onBlur: action("blurred"), required: true })),
|
|
12
12
|
name: "with all props",
|
|
13
13
|
};
|
|
14
|
-
export const SetToDisabled =
|
|
15
|
-
|
|
14
|
+
export const SetToDisabled = {
|
|
15
|
+
render: () => _jsx(Input, { labelText: "Set to disabled", disabled: true, onBlur: action("blurred"), value: "Disabled" }),
|
|
16
16
|
name: "set to disabled",
|
|
17
17
|
};
|
|
18
|
-
export const WithErrorMessage =
|
|
19
|
-
|
|
18
|
+
export const WithErrorMessage = {
|
|
19
|
+
render: () => (_jsx(Input, { labelText: "Label", errorMessage: "Error message", onChange: action("value changed"), onBlur: action("blurred") })),
|
|
20
20
|
name: "with error message",
|
|
21
21
|
};
|
|
22
|
-
export const WithErrorList =
|
|
23
|
-
|
|
22
|
+
export const WithErrorList = {
|
|
23
|
+
render: () => (_jsx(Input, { labelText: "Label", errorMessage: "Error message", errorList: errorList, onChange: action("value changed"), onBlur: action("blurred") })),
|
|
24
24
|
name: "with error list ",
|
|
25
25
|
};
|
|
26
|
-
export const WithCustomId =
|
|
27
|
-
|
|
26
|
+
export const WithCustomId = {
|
|
27
|
+
render: () => (_jsx(Input, { id: "my-own-id", labelText: "Label", onChange: action("value changed"), onBlur: action("blurred") })),
|
|
28
28
|
name: "with custom ID",
|
|
29
29
|
};
|
|
30
|
-
export const SetToRequired =
|
|
31
|
-
|
|
30
|
+
export const SetToRequired = {
|
|
31
|
+
render: () => (_jsx(_Fragment, { children: _jsxs(Form, { title: "Required field example", children: [_jsx(Input, { required: true, labelText: "Label", onChange: action("value changed"), onBlur: action("blurred") }), _jsx(PrimaryButton, { children: "Send" })] }) })),
|
|
32
32
|
name: "set to required",
|
|
33
33
|
};
|
|
34
|
-
export const WithAAffixPrefixAndSuffix =
|
|
35
|
-
|
|
34
|
+
export const WithAAffixPrefixAndSuffix = {
|
|
35
|
+
render: () => (_jsxs(_Fragment, { children: [_jsxs(Form, { title: "Suffix", mb: "x6", children: [_jsxs(FormSection, { children: [_jsx(Input, { suffix: "Eaches" }), _jsx(Input, { suffix: "Pallets and boxes" })] }), _jsxs(FormSection, { title: "With Custom Width", children: [_jsx(Input, { suffix: "Eaches", suffixWidth: "360px", prefixAlignment: "right" }), _jsx(Input, { suffix: "Pallets and boxes", suffixWidth: "360px" })] })] }), _jsxs(Form, { title: "Prefix", mb: "x6", children: [_jsxs(FormSection, { children: [_jsx(Input, { prefix: "Eaches" }), _jsx(Input, { prefix: "Pallets and boxes" })] }), _jsxs(FormSection, { title: "With Custom Width", children: [_jsx(Input, { prefix: "Eaches", prefixWidth: "360px" }), _jsx(Input, { prefix: "Pallets and boxes", prefixWidth: "360px" })] }), _jsxs(FormSection, { title: "With right alignment", children: [_jsx(Input, { prefix: "Eaches", prefixWidth: "360px", prefixAlignment: "right" }), _jsx(Input, { prefix: "Pallets and boxes", prefixWidth: "360px", prefixAlignment: "right" })] })] }), _jsx(Form, { title: "Prefix and Suffix", mb: "x6", children: _jsx(Input, { prefix: "Quantity", suffix: "Eaches" }) })] })),
|
|
36
36
|
name: "with a affix (prefix and suffix)",
|
|
37
37
|
};
|
|
38
38
|
export const WithAnIcon = () => (_jsxs(Flex, { flexDirection: "column", gap: "x2", children: [_jsx(Input, { maxWidth: "320px", inputWidth: "320px", iconLeft: "search", placeholder: "Search by SKU", labelText: "Left Icon" }), _jsx(Input, { maxWidth: "320px", inputWidth: "320px", iconRight: "barcode", placeholder: "Search by SKU", labelText: "Right Icon" }), _jsx(Input, { maxWidth: "320px", inputWidth: "320px", iconRight: "barcode", iconLeft: "search", placeholder: "Search by SKU", labelText: "Left and right icons" }), _jsx(Input, { maxWidth: "320px", inputWidth: "320px", iconLeft: "search", iconLeftSize: "x2", placeholder: "Search by SKU", labelText: "Custom icon size" })] }));
|
|
@@ -48,13 +48,13 @@ export const WithIconTooltips = () => (_jsxs(Flex, { flexDirection: "column", ga
|
|
|
48
48
|
placement: "top",
|
|
49
49
|
maxWidth: "150px",
|
|
50
50
|
}, placeholder: "Enter your access number", labelText: "Different placements (top and bottom)" })] }));
|
|
51
|
-
export const UsingRefToControlFocus =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
|
|
51
|
+
export const UsingRefToControlFocus = {
|
|
52
|
+
render: () => {
|
|
53
|
+
const ref = useRef(null);
|
|
54
|
+
const handleClick = () => {
|
|
55
|
+
ref.current.focus();
|
|
56
|
+
};
|
|
57
|
+
return (_jsxs(_Fragment, { children: [_jsx(Input, { id: "my-own-id", ref: ref, labelText: "Label", onChange: action("value changed"), onBlur: action("blurred") }), _jsx(Button, { onClick: handleClick, children: "Focus the Input" })] }));
|
|
58
|
+
},
|
|
59
59
|
name: "using ref to control focus",
|
|
60
60
|
};
|
|
@@ -3,52 +3,36 @@ declare const _default: {
|
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _Link: {
|
|
6
|
-
()
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
name: string;
|
|
10
8
|
};
|
|
11
9
|
export declare const WithCustomFontSize: {
|
|
12
|
-
()
|
|
13
|
-
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
10
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
name: string;
|
|
16
12
|
};
|
|
17
13
|
export declare const WithoutUnderline: {
|
|
18
|
-
()
|
|
19
|
-
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
14
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
name: string;
|
|
22
16
|
};
|
|
23
17
|
export declare const WithADifferentColor: {
|
|
24
|
-
()
|
|
25
|
-
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
18
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
name: string;
|
|
28
20
|
};
|
|
29
21
|
export declare const WithADifferentFontSize: () => import("react/jsx-runtime").JSX.Element;
|
|
30
22
|
export declare const AsAButton: {
|
|
31
|
-
()
|
|
32
|
-
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
23
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
name: string;
|
|
35
25
|
};
|
|
36
26
|
export declare const _ReactRouterLink: {
|
|
37
|
-
()
|
|
38
|
-
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
27
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
name: string;
|
|
41
29
|
};
|
|
42
30
|
export declare const WithAppTag: {
|
|
43
|
-
()
|
|
44
|
-
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
31
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
name: string;
|
|
47
33
|
};
|
|
48
34
|
export declare const OpenInNewTab: () => import("react/jsx-runtime").JSX.Element;
|
|
49
35
|
export declare const OpenInNewTabWithAppTag: {
|
|
50
|
-
()
|
|
51
|
-
|
|
52
|
-
name: string;
|
|
53
|
-
};
|
|
36
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
name: string;
|
|
54
38
|
};
|
|
@@ -4,38 +4,37 @@ import { Link } from "../index";
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Components/Link",
|
|
6
6
|
};
|
|
7
|
-
export const _Link =
|
|
8
|
-
|
|
7
|
+
export const _Link = {
|
|
8
|
+
render: () => _jsx(Link, { href: "http://nulogy.design", children: "Link" }),
|
|
9
9
|
name: "Link ",
|
|
10
10
|
};
|
|
11
|
-
export const WithCustomFontSize =
|
|
12
|
-
|
|
11
|
+
export const WithCustomFontSize = {
|
|
12
|
+
render: () => (_jsx(Link, { href: "http://nulogy.design", fontSize: "small", children: "Link" })),
|
|
13
13
|
name: "with custom font size",
|
|
14
14
|
};
|
|
15
|
-
export const WithoutUnderline =
|
|
16
|
-
|
|
15
|
+
export const WithoutUnderline = {
|
|
16
|
+
render: () => (_jsx(Link, { underline: false, href: "http://nulogy.design", children: "Link" })),
|
|
17
17
|
name: "Without underline",
|
|
18
18
|
};
|
|
19
|
-
export const WithADifferentColor =
|
|
20
|
-
|
|
19
|
+
export const WithADifferentColor = {
|
|
20
|
+
render: () => (_jsx(Link, { color: "black", hover: "red", href: "http://nulogy.design", children: "Link" })),
|
|
21
21
|
name: "With a different color",
|
|
22
22
|
};
|
|
23
23
|
export const WithADifferentFontSize = () => (_jsx(Link, { fontSize: "large", href: "http://nulogy.design", children: "Link" }));
|
|
24
|
-
export const AsAButton =
|
|
25
|
-
|
|
24
|
+
export const AsAButton = {
|
|
25
|
+
render: () => _jsx(Link, { as: "button", children: "Link" }),
|
|
26
26
|
name: "As a <button>",
|
|
27
27
|
};
|
|
28
|
-
export const _ReactRouterLink =
|
|
29
|
-
|
|
28
|
+
export const _ReactRouterLink = {
|
|
29
|
+
render: () => (_jsx(BrowserRouter, { children: _jsx(Link, { as: ReactRouterLink, to: "/place", children: "Link" }) })),
|
|
30
30
|
name: "with react router",
|
|
31
31
|
};
|
|
32
|
-
export const WithAppTag =
|
|
33
|
-
|
|
34
|
-
// This story is referenced in the AppTag story. If you change the name, update the URL in the AppTag story.
|
|
32
|
+
export const WithAppTag = {
|
|
33
|
+
render: () => (_jsx(Link, { href: "#production-scheduling", forApp: "production-scheduling", children: "POLI-120392" })),
|
|
35
34
|
name: "With AppTag",
|
|
36
35
|
};
|
|
37
36
|
export const OpenInNewTab = () => (_jsx(Link, { href: "#production-scheduling", openInNewTab: true, children: "POLI-120392" }));
|
|
38
|
-
export const OpenInNewTabWithAppTag =
|
|
39
|
-
|
|
37
|
+
export const OpenInNewTabWithAppTag = {
|
|
38
|
+
render: () => (_jsx(Link, { href: "#production-scheduling", forApp: "production-scheduling", openInNewTab: true, children: "POLI-120392" })),
|
|
40
39
|
name: "Open in new tab with AppTag",
|
|
41
40
|
};
|
|
@@ -4,26 +4,18 @@ declare const _default: {
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const _List: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const WithCustomColour: {
|
|
7
|
-
()
|
|
8
|
-
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
7
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
name: string;
|
|
11
9
|
};
|
|
12
10
|
export declare const WithCustomFontSizeAndLineHeight: {
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
name: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const WithCompactSpacing: {
|
|
19
|
-
()
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
name: string;
|
|
23
17
|
};
|
|
24
18
|
export declare const WithLeftAlignment: {
|
|
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: "Components/List",
|
|
5
5
|
};
|
|
6
6
|
export const _List = () => (_jsxs(List, { children: [_jsx(ListItem, { children: "List Item 1" }), _jsx(ListItem, { children: "List Item 2 that is really really really really really really really really really long" }), _jsx(ListItem, { children: "List Item 3" })] }));
|
|
7
|
-
export const WithCustomColour =
|
|
8
|
-
|
|
7
|
+
export const WithCustomColour = {
|
|
8
|
+
render: () => (_jsxs(List, { color: "red", children: [_jsx(ListItem, { children: "List Item 1" }), _jsx(ListItem, { children: "List Item 2 that is really really really really really really really really really long" }), _jsx(ListItem, { children: "List Item 3" })] })),
|
|
9
9
|
name: "With custom colour",
|
|
10
10
|
};
|
|
11
|
-
export const WithCustomFontSizeAndLineHeight =
|
|
12
|
-
|
|
11
|
+
export const WithCustomFontSizeAndLineHeight = {
|
|
12
|
+
render: () => (_jsxs(List, { fontSize: "small", lineHeight: "smallTextBase", children: [_jsx(ListItem, { children: "List Item 1" }), _jsx(ListItem, { children: "List Item 2 that is really really really really really really really really really long" }), _jsx(ListItem, { fontSize: "large", children: "Larger List Item 3" })] })),
|
|
13
13
|
name: "With custom font size and line height",
|
|
14
14
|
};
|
|
15
|
-
export const WithCompactSpacing =
|
|
16
|
-
|
|
15
|
+
export const WithCompactSpacing = {
|
|
16
|
+
render: () => (_jsxs(List, { compact: true, children: [_jsx(ListItem, { children: "List Item 1" }), _jsx(ListItem, { children: "List Item 2 that is really really really really really really really really really long" }), _jsx(ListItem, { children: "List Item 3" })] })),
|
|
17
17
|
name: "With compact spacing",
|
|
18
18
|
};
|
|
19
|
-
export const WithLeftAlignment =
|
|
20
|
-
|
|
19
|
+
export const WithLeftAlignment = {
|
|
20
|
+
render: () => (_jsxs(List, { leftAlign: true, children: [_jsx(ListItem, { children: "List Item 1" }), _jsx(ListItem, { children: "List Item 2 that is really really really really really really really really really long" }), _jsx(ListItem, { children: "List Item 3" })] })),
|
|
21
21
|
name: "With left alignment",
|
|
22
22
|
};
|
|
@@ -5,14 +5,10 @@ export default _default;
|
|
|
5
5
|
export declare const Active: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const Inactive: () => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const PageExampleActive: {
|
|
8
|
-
()
|
|
9
|
-
|
|
10
|
-
name: string;
|
|
11
|
-
};
|
|
8
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
name: string;
|
|
12
10
|
};
|
|
13
11
|
export declare const PageExampleInactive: {
|
|
14
|
-
()
|
|
15
|
-
|
|
16
|
-
name: string;
|
|
17
|
-
};
|
|
12
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
name: string;
|
|
18
14
|
};
|
|
@@ -6,11 +6,11 @@ export default {
|
|
|
6
6
|
};
|
|
7
7
|
export const Active = () => _jsx(LoadingAnimation, { children: "Example" });
|
|
8
8
|
export const Inactive = () => _jsx(LoadingAnimation, { inactive: true, children: "Example" });
|
|
9
|
-
export const PageExampleActive =
|
|
10
|
-
|
|
9
|
+
export const PageExampleActive = {
|
|
10
|
+
render: () => (_jsxs(Overlay, { flexDirection: "column", m: { extraSmall: "x2", small: "x3" }, children: [_jsxs(Flex, { flexGrow: 2, flexDirection: "column", justifyContent: "center", margin: "auto", mb: "x4", children: [_jsx(Text, { mb: "x2", fontWeight: "medium", textAlign: "right", children: "1/4" }), _jsx(Box, { mb: "x1", children: _jsx(LoadingAnimation, {}) }), _jsx(Text, { fontSize: "small", color: "darkGrey", children: "Applying action ..." })] }), _jsxs(Flex, { justifyContent: "center", mb: "x1", children: [_jsx(ControlIcon, { icon: "refresh", disabled: true, mr: "x1", label: "Retry" }), _jsx(ControlIcon, { icon: "close", label: "Abort" })] })] })),
|
|
11
11
|
name: "Page example - active",
|
|
12
12
|
};
|
|
13
|
-
export const PageExampleInactive =
|
|
14
|
-
|
|
13
|
+
export const PageExampleInactive = {
|
|
14
|
+
render: () => (_jsxs(Overlay, { flexDirection: "column", m: { extraSmall: "x2", small: "x3" }, children: [_jsxs(Flex, { flexGrow: 2, flexDirection: "column", justifyContent: "center", margin: "auto", mb: "x4", children: [_jsx(Text, { mb: "x2", fontWeight: "medium", color: "grey", textAlign: "right", children: "1/4" }), _jsx(Box, { mb: "x1", children: _jsx(LoadingAnimation, { inactive: true }) }), _jsx(Text, { fontSize: "small", color: "grey", children: "Applying action ..." })] }), _jsx(Alert, { type: "warning", mb: "x2", position: "absolute", bottom: "x8", children: "This action takes longer than expected. Try again..." }), _jsxs(Flex, { justifyContent: "center", mb: "x1", children: [_jsx(ControlIcon, { icon: "refresh", mr: "x1", label: "Retry" }), _jsx(ControlIcon, { icon: "close", label: "Abort" })] })] })),
|
|
15
15
|
name: "Page example - inactive",
|
|
16
16
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type ModalProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
3
4
|
isOpen?: boolean;
|
|
4
5
|
title?: string;
|
|
5
6
|
ariaLabel?: string;
|
|
@@ -19,7 +20,8 @@ type ModalProps = {
|
|
|
19
20
|
footerContent?: React.ReactNode;
|
|
20
21
|
parentSelector?: (...args: any) => HTMLElement;
|
|
21
22
|
};
|
|
22
|
-
declare
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
declare function Modal({ isOpen, shouldFocusAfterRender, shouldReturnFocusAfterClose, maxWidth, ariaHideApp, children, title, onRequestClose, onAfterOpen, ariaLabel, ariaDescribedBy, portalClassName, overlayClassName, className, id, appElement, footerContent, closeAriaLabel, parentSelector, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare namespace Modal {
|
|
25
|
+
var setAppElement: any;
|
|
26
|
+
}
|
|
25
27
|
export default Modal;
|
package/dist/src/Modal/Modal.js
CHANGED
|
@@ -56,7 +56,7 @@ const StyledReactModal = styled(ReactModal)(({ maxWidth }) => ({
|
|
|
56
56
|
WebkitFontSmoothing: "antialiased",
|
|
57
57
|
MozOsxFontSmoothing: "grayscale",
|
|
58
58
|
}));
|
|
59
|
-
|
|
59
|
+
function Modal({ isOpen = true, shouldFocusAfterRender = true, shouldReturnFocusAfterClose = true, maxWidth = "624px", ariaHideApp = true, children, title, onRequestClose, onAfterOpen, ariaLabel, ariaDescribedBy, portalClassName, overlayClassName, className, id, appElement, footerContent, closeAriaLabel, parentSelector, }) {
|
|
60
60
|
const modalHasHeader = Boolean(onRequestClose || title);
|
|
61
61
|
const themeContext = useContext(ThemeContext);
|
|
62
62
|
return (_jsx(StyledReactModal, { maxWidth: maxWidth, contentLabel: ariaLabel, onRequestClose: onRequestClose, onAfterOpen: onAfterOpen, shouldFocusAfterRender: shouldFocusAfterRender, shouldReturnFocusAfterClose: shouldReturnFocusAfterClose, isOpen: isOpen, portalClassName: portalClassName, overlayClassName: overlayClassName, className: className, id: id, aria: {
|
|
@@ -65,7 +65,7 @@ const Modal = ({ isOpen = true, shouldFocusAfterRender = true, shouldReturnFocus
|
|
|
65
65
|
}, shouldCloseOnOverlayClick: true, shouldCloseOnEsc: true, style: {
|
|
66
66
|
overlay: overlayStyle(themeContext),
|
|
67
67
|
}, appElement: appElement, ariaHideApp: ariaHideApp, parentSelector: parentSelector, children: _jsx(ModalWrapper, { closeAriaLabel: closeAriaLabel, modalHasHeader: modalHasHeader, title: title, onRequestClose: onRequestClose, footerContent: footerContent, children: children }) }));
|
|
68
|
-
}
|
|
68
|
+
}
|
|
69
69
|
function ModalWrapper({ modalHasHeader, title, onRequestClose, closeAriaLabel, children, footerContent, }) {
|
|
70
70
|
const theme = useTheme();
|
|
71
71
|
useScrollLock();
|
|
@@ -1,30 +1,8 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import React from "react";
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
3
2
|
import { Modal as NDSModal } from "../index";
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
|
-
component:
|
|
7
|
-
isOpen?: boolean;
|
|
8
|
-
title?: string;
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
onRequestClose?: (...args: any[]) => any;
|
|
11
|
-
closeAriaLabel?: string;
|
|
12
|
-
onAfterOpen?: (...args: any[]) => any;
|
|
13
|
-
shouldFocusAfterRender?: boolean;
|
|
14
|
-
shouldReturnFocusAfterClose?: boolean;
|
|
15
|
-
ariaDescribedBy?: string;
|
|
16
|
-
maxWidth?: string;
|
|
17
|
-
portalClassName?: string;
|
|
18
|
-
overlayClassName?: string;
|
|
19
|
-
className?: string;
|
|
20
|
-
id?: string;
|
|
21
|
-
appElement?: JSX.Element;
|
|
22
|
-
ariaHideApp?: boolean;
|
|
23
|
-
footerContent?: React.ReactNode;
|
|
24
|
-
parentSelector?: (...args: any) => HTMLElement;
|
|
25
|
-
}>> & {
|
|
26
|
-
setAppElement: (element: string | HTMLElement) => void;
|
|
27
|
-
};
|
|
5
|
+
component: typeof NDSModal;
|
|
28
6
|
args: {
|
|
29
7
|
ariaHideApp: false;
|
|
30
8
|
};
|