@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { expect, screen, userEvent, waitFor, within } from "storybook/test";
|
|
3
4
|
import { Box, Button, DescriptionDetails, DescriptionList, DescriptionTerm, Divider, Flex, Icon, Link, StatusIndicator, Text, Tooltip, } from "../index";
|
|
4
5
|
export default {
|
|
5
6
|
title: "Components/Tooltip",
|
|
@@ -10,6 +11,21 @@ export default {
|
|
|
10
11
|
};
|
|
11
12
|
export const Default = {
|
|
12
13
|
render: () => (_jsx(Flex, { p: "x8", children: _jsx(Tooltip, { tooltip: "I am a Tooltip!", children: _jsx(Button, { "data-testid": "tooltip-trigger", children: "Button" }) }) })),
|
|
14
|
+
play: async ({ canvasElement, step }) => {
|
|
15
|
+
const canvas = within(canvasElement);
|
|
16
|
+
await step("tooltip is not visible before interaction", async () => {
|
|
17
|
+
await expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
|
|
18
|
+
});
|
|
19
|
+
await step("shows tooltip text on hover", async () => {
|
|
20
|
+
await userEvent.hover(canvas.getByTestId("tooltip-trigger"));
|
|
21
|
+
// Radix renders the tooltip in a body portal, so use screen (not canvas)
|
|
22
|
+
await waitFor(() => expect(screen.getByRole("tooltip")).toHaveTextContent("I am a Tooltip!"));
|
|
23
|
+
});
|
|
24
|
+
await step("hides tooltip when moving away", async () => {
|
|
25
|
+
await userEvent.unhover(canvas.getByTestId("tooltip-trigger"));
|
|
26
|
+
await waitFor(() => expect(screen.queryByRole("tooltip")).not.toBeInTheDocument());
|
|
27
|
+
});
|
|
28
|
+
},
|
|
13
29
|
};
|
|
14
30
|
export const WithWrappedText = {
|
|
15
31
|
render: () => (_jsx(Flex, { p: "x8", children: _jsx(Tooltip, { placement: "bottom", tooltip: "I am a Tooltip! I have very long text, and my default max-width is 24em (based on 14px font-size), which is equal to 336px, or approximately 45 characters.", defaultOpen: true, children: _jsx(Button, { children: " Button " }) }) })),
|
|
@@ -9,26 +9,28 @@ declare const MenuButton: import("styled-components/dist/types").IStyledComponen
|
|
|
9
9
|
declare const NavigationItemsList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
|
|
10
10
|
declare const StyledBackLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
|
|
11
11
|
declare const StyledPageTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
|
|
12
|
-
declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
|
+
declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
13
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
14
14
|
}, "as" | keyof import("@reach/dialog").DialogOverlayProps> & import("@reach/dialog").DialogOverlayProps & {
|
|
15
15
|
as?: "div";
|
|
16
|
-
} & import("framer-motion").MotionProps, "ref"> & import("react").RefAttributes<HTMLElement | SVGElement>,
|
|
16
|
+
} & import("framer-motion").MotionProps, "ref"> & import("react").RefAttributes<HTMLElement | SVGElement>, "ref"> & {
|
|
17
|
+
ref?: import("react").Ref<HTMLElement | SVGElement>;
|
|
18
|
+
}, never>> & string & Omit<import("framer-motion").CustomDomComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
19
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
18
20
|
}, "as" | keyof import("@reach/dialog").DialogOverlayProps> & import("@reach/dialog").DialogOverlayProps & {
|
|
19
21
|
as?: "div";
|
|
20
22
|
}>, keyof import("react").Component<any, {}, any>>;
|
|
21
23
|
declare const TileLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
|
|
22
|
-
declare const StyledMenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<{
|
|
23
|
-
children?: import("react").ReactNode
|
|
24
|
+
declare const StyledMenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<{
|
|
25
|
+
children?: import("react").ReactNode;
|
|
24
26
|
value?: string | number | readonly string[];
|
|
25
|
-
slot?: string;
|
|
26
|
-
title?: string;
|
|
27
27
|
property?: string;
|
|
28
28
|
color?: string;
|
|
29
29
|
content?: string;
|
|
30
30
|
translate?: "yes" | "no";
|
|
31
31
|
hidden?: boolean;
|
|
32
|
+
slot?: string;
|
|
33
|
+
title?: string;
|
|
32
34
|
defaultChecked?: boolean;
|
|
33
35
|
defaultValue?: string | number | readonly string[];
|
|
34
36
|
suppressContentEditableWarning?: boolean;
|
|
@@ -37,7 +39,7 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
37
39
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters";
|
|
38
40
|
autoFocus?: boolean;
|
|
39
41
|
className?: string;
|
|
40
|
-
contentEditable?: "inherit" | (boolean | "true" | "false");
|
|
42
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only";
|
|
41
43
|
contextMenu?: string;
|
|
42
44
|
dir?: string;
|
|
43
45
|
draggable?: boolean | "true" | "false";
|
|
@@ -45,7 +47,6 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
45
47
|
id?: string;
|
|
46
48
|
lang?: string;
|
|
47
49
|
nonce?: string;
|
|
48
|
-
placeholder?: string;
|
|
49
50
|
spellCheck?: boolean | "true" | "false";
|
|
50
51
|
tabIndex?: number;
|
|
51
52
|
radioGroup?: string;
|
|
@@ -69,7 +70,7 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
69
70
|
results?: number;
|
|
70
71
|
security?: string;
|
|
71
72
|
unselectable?: "off" | "on";
|
|
72
|
-
inputMode?: "search" | "
|
|
73
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
73
74
|
is?: string;
|
|
74
75
|
exportparts?: string;
|
|
75
76
|
part?: string;
|
|
@@ -85,7 +86,7 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
85
86
|
"aria-colindextext"?: string;
|
|
86
87
|
"aria-colspan"?: number;
|
|
87
88
|
"aria-controls"?: string;
|
|
88
|
-
"aria-current"?: boolean | "
|
|
89
|
+
"aria-current"?: boolean | "page" | "time" | "true" | "false" | "step" | "location" | "date";
|
|
89
90
|
"aria-describedby"?: string;
|
|
90
91
|
"aria-description"?: string;
|
|
91
92
|
"aria-details"?: string;
|
|
@@ -95,7 +96,7 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
95
96
|
"aria-expanded"?: boolean | "true" | "false";
|
|
96
97
|
"aria-flowto"?: string;
|
|
97
98
|
"aria-grabbed"?: boolean | "true" | "false";
|
|
98
|
-
"aria-haspopup"?: boolean | "
|
|
99
|
+
"aria-haspopup"?: boolean | "grid" | "dialog" | "menu" | "true" | "false" | "listbox" | "tree";
|
|
99
100
|
"aria-hidden"?: boolean | "true" | "false";
|
|
100
101
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling";
|
|
101
102
|
"aria-keyshortcuts"?: string;
|
|
@@ -112,7 +113,7 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
112
113
|
"aria-posinset"?: number;
|
|
113
114
|
"aria-pressed"?: boolean | "true" | "false" | "mixed";
|
|
114
115
|
"aria-readonly"?: boolean | "true" | "false";
|
|
115
|
-
"aria-relevant"?: "
|
|
116
|
+
"aria-relevant"?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals";
|
|
116
117
|
"aria-required"?: boolean | "true" | "false";
|
|
117
118
|
"aria-roledescription"?: string;
|
|
118
119
|
"aria-rowcount"?: number;
|
|
@@ -263,9 +264,7 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
263
264
|
onPointerCancel?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
264
265
|
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
265
266
|
onPointerEnter?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
266
|
-
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
267
267
|
onPointerLeave?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
268
|
-
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
269
268
|
onPointerOver?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
270
269
|
onPointerOverCapture?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
271
270
|
onPointerOut?: import("react").PointerEventHandler<HTMLLIElement>;
|
|
@@ -285,5 +284,7 @@ declare const StyledMenuItem: import("styled-components/dist/types").IStyledComp
|
|
|
285
284
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLLIElement>;
|
|
286
285
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLLIElement>;
|
|
287
286
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLLIElement>;
|
|
288
|
-
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLLIElement>,
|
|
287
|
+
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLLIElement>, "ref"> & {
|
|
288
|
+
ref?: import("react").Ref<HTMLLIElement>;
|
|
289
|
+
}, never>> & string & Omit<import("framer-motion").ForwardRefComponent<HTMLLIElement, import("framer-motion").HTMLMotionProps<"li">>, keyof import("react").Component<any, {}, any>>;
|
|
289
290
|
export { Navigation, Header, NavigationItemsList, StyledBackLink, StyledPageTitle, Overlay, TileLink, StylelessButton, MenuItemList, MenuButton, StyledMenuItem, };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
2
|
import { MaxWidthProps } from "styled-system";
|
|
3
3
|
import { StyledBackLink } from "../TopBar.styled";
|
|
4
4
|
interface BackLinkProps extends MaxWidthProps, ComponentProps<typeof StyledBackLink> {
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
to?: string;
|
|
5
7
|
}
|
|
6
8
|
export declare function BackLink({ children, maxWidth, ...props }: BackLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IconName } from "@nulogy/icons";
|
|
2
|
-
import { ComponentProps } from "react";
|
|
2
|
+
import React, { ComponentProps } from "react";
|
|
3
3
|
import { TileLink } from "../TopBar.styled";
|
|
4
4
|
export interface MenuItemLinkProps extends ComponentProps<typeof TileLink> {
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
to?: string;
|
|
5
7
|
title: string;
|
|
6
8
|
description?: string;
|
|
7
9
|
icon: IconName;
|
|
@@ -25,4 +25,4 @@ export const WithACustomMaxWidth = () => (_jsxs(TopBar.Root, { children: [_jsx(T
|
|
|
25
25
|
large: "12ch",
|
|
26
26
|
extraLarge: "16ch",
|
|
27
27
|
}, 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))) })] }));
|
|
28
|
-
export const WithARouterLink = () => (_jsx(BrowserRouter, { children: _jsxs(TopBar.Root, { children: [_jsx(
|
|
28
|
+
export const WithARouterLink = () => (_jsx(BrowserRouter, { children: _jsxs(TopBar.Root, { children: [_jsx(TopBar.BackLink, { as: Link, to: "/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))) })] }) }));
|
|
@@ -28,5 +28,5 @@ export const WithRouterLinks = () => {
|
|
|
28
28
|
...item,
|
|
29
29
|
to: href,
|
|
30
30
|
}));
|
|
31
|
-
return (_jsxs(TopBar.Root, { children: [_jsx(TopBar.BackLink, { href: "#", children: "Cycle counts" }), _jsx(TopBar.PageTitle, { children: "Cycle count #3992" }), _jsx(TopBar.Menu, { defaultOpened: true, children: _jsx(BrowserRouter, { basename: "/", children: routerMenuItems.map((item) => (_jsx(TopBar.MenuItem, { children: _jsx(
|
|
31
|
+
return (_jsxs(TopBar.Root, { children: [_jsx(TopBar.BackLink, { href: "#", children: "Cycle counts" }), _jsx(TopBar.PageTitle, { children: "Cycle count #3992" }), _jsx(TopBar.Menu, { defaultOpened: true, children: _jsx(BrowserRouter, { basename: "/", children: routerMenuItems.map((item) => (_jsx(TopBar.MenuItem, { children: _jsx(TopBar.MenuItemLink, { as: Link, ...item }) }, item.title))) }) })] }));
|
|
32
32
|
};
|
|
@@ -13,6 +13,12 @@ declare const _default: {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
|
16
|
-
export declare const Default:
|
|
16
|
+
export declare const Default: {
|
|
17
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
play: ({ canvasElement, step }: {
|
|
19
|
+
canvasElement: any;
|
|
20
|
+
step: any;
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
};
|
|
17
23
|
export declare const WithALongTitle: () => import("react/jsx-runtime").JSX.Element;
|
|
18
24
|
export declare const WithAnApplicationFrame: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TextProps } from "./Text";
|
|
2
|
-
export declare const Heading1: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" |
|
|
2
|
+
export declare const Heading1: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<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;
|
|
@@ -11,7 +11,7 @@ export declare const Heading1: import("styled-components/dist/types").IStyledCom
|
|
|
11
11
|
}, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
12
12
|
ref?: import("react").Ref<HTMLHeadingElement>;
|
|
13
13
|
}>, never>, TextProps>> & string;
|
|
14
|
-
export declare const Heading2: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" |
|
|
14
|
+
export declare const Heading2: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<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> & {
|
|
15
15
|
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
16
16
|
inline?: boolean;
|
|
17
17
|
compact?: boolean;
|
|
@@ -23,7 +23,7 @@ export declare const Heading2: import("styled-components/dist/types").IStyledCom
|
|
|
23
23
|
}, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
24
24
|
ref?: import("react").Ref<HTMLHeadingElement>;
|
|
25
25
|
}>, never>, never>> & string;
|
|
26
|
-
export declare const Heading3: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" |
|
|
26
|
+
export declare const Heading3: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<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> & {
|
|
27
27
|
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
28
28
|
inline?: boolean;
|
|
29
29
|
compact?: boolean;
|
|
@@ -35,7 +35,7 @@ export declare const Heading3: import("styled-components/dist/types").IStyledCom
|
|
|
35
35
|
}, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
36
36
|
ref?: import("react").Ref<HTMLHeadingElement>;
|
|
37
37
|
}>, never>, never>> & string;
|
|
38
|
-
export declare const Heading4: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" |
|
|
38
|
+
export declare const Heading4: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<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> & {
|
|
39
39
|
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
40
40
|
inline?: boolean;
|
|
41
41
|
compact?: boolean;
|
|
@@ -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
|
};
|