@nulogy/components 15.2.2 → 15.3.0
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 +53137 -54186
- package/dist/main.module.js +5928 -6978
- package/dist/src/Alert/Alert.js +2 -14
- package/dist/src/AppTag/components/LogoWrapper.d.ts +0 -1
- package/dist/src/AppTag/components/NulogyLogo.js +2 -14
- package/dist/src/AsyncSelect/AsyncSelect.graphql.story.js +4 -13
- package/dist/src/AsyncSelect/AsyncSelect.js +14 -16
- package/dist/src/AsyncSelect/AsyncSelectComponents.js +9 -21
- package/dist/src/AsyncSelect/fixtures.js +4 -13
- package/dist/src/Banner/Banner.js +1 -15
- package/dist/src/BottomSheet/BottomSheet.js +2 -15
- package/dist/src/BottomSheet/BottomSheet.parts.d.ts +2 -2
- package/dist/src/BottomSheet/BottomSheet.parts.js +8 -22
- package/dist/src/BottomSheet/BottomSheet.styled.d.ts +4 -5
- package/dist/src/Box/Box.d.ts +12 -4
- package/dist/src/BrandedNavBar/DesktopMenu.js +22 -36
- package/dist/src/BrandedNavBar/MenuTrigger.js +4 -16
- package/dist/src/BrandedNavBar/MenuTriggerButton.js +8 -22
- package/dist/src/BrandedNavBar/MobileMenu.js +28 -35
- package/dist/src/BrandedNavBar/NavBar.js +7 -21
- package/dist/src/BrandedNavBar/NavBar.story.js +1 -1
- package/dist/src/BrandedNavBar/NavBarBackground.d.ts +0 -1
- package/dist/src/BrandedNavBar/NavBarDropdownMenu.js +14 -8
- package/dist/src/BrandedNavBar/SmallNavBar.js +4 -16
- package/dist/src/BrandedNavBar/SmallNavBar.story.js +1 -1
- package/dist/src/BrandedNavBar/SubMenuTrigger.js +4 -16
- package/dist/src/BrandedNavBar/SubMenuTriggerButton.js +2 -14
- package/dist/src/BrandedNavBar/renderSubMenuItems.js +7 -17
- package/dist/src/Branding/Branding.js +2 -14
- package/dist/src/Branding/BrandingText.d.ts +0 -1
- package/dist/src/Branding/LettermarkLogo.js +2 -14
- package/dist/src/Branding/WordmarkLogo.js +2 -14
- package/dist/src/Breadcrumbs/Breadcrumbs.js +2 -14
- package/dist/src/Breadcrumbs/BreadcrumbsList.d.ts +0 -1
- package/dist/src/Breadcrumbs/BreadcrumbsListItem.d.ts +0 -1
- package/dist/src/Button/Button.js +2 -14
- package/dist/src/Button/CloseButton.js +1 -1
- package/dist/src/Button/ControlIcon.js +2 -16
- package/dist/src/Button/DangerButton.d.ts +0 -1
- package/dist/src/Button/IconicButton.js +55 -73
- package/dist/src/Button/PrimaryButton.d.ts +0 -1
- package/dist/src/Button/QuietButton.d.ts +0 -1
- package/dist/src/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/dist/src/ButtonGroup/ButtonGroup.js +8 -2
- package/dist/src/Card/Card.js +2 -14
- package/dist/src/Card/Card.story.js +1 -1
- package/dist/src/Card/CardSet.d.ts +0 -1
- package/dist/src/Checkbox/Checkbox.js +20 -6
- package/dist/src/Checkbox/Checkbox.story.js +4 -1
- package/dist/src/Checkbox/CheckboxGroup.js +4 -16
- package/dist/src/DatePickers/DatePicker.js +2 -14
- package/dist/src/DatePickers/MonthPicker.js +2 -14
- package/dist/src/DatePickers/WeekPicker.js +10 -17
- package/dist/src/DatePickers/custom/weekPickerStyles.d.ts +0 -1
- package/dist/src/DatePickers/shared/components/BasePicker.js +9 -15
- package/dist/src/DatePickers/shared/components/DatePickerInput.js +2 -13
- package/dist/src/DatePickers/shared/styles.d.ts +0 -1
- package/dist/src/DatePickers/shared/types.d.ts +0 -1
- package/dist/src/DatePickers/stories/WeekPicker.story.js +1 -1
- package/dist/src/DateRange/DateRange.js +36 -22
- package/dist/src/DateRange/DateRangeStyles.d.ts +0 -1
- package/dist/src/DateRange/EndTime.d.ts +3 -4
- package/dist/src/DateRange/StartTime.d.ts +3 -4
- package/dist/src/Decorations/index.js +1 -1
- package/dist/src/DescriptionList/DescriptionList.js +1 -13
- package/dist/src/DescriptionList/DescriptionList.parts.d.ts +0 -1
- package/dist/src/DescriptionList/DescriptionList.parts.js +156 -77
- package/dist/src/DescriptionList/DescriptionListContext.js +1 -15
- package/dist/src/DescriptionList/stories/DescriptionList.playground.story.js +8 -5
- package/dist/src/DescriptionList/stories/fixtures.d.ts +2 -2
- package/dist/src/Divider/Divider.d.ts +0 -1
- package/dist/src/DropdownMenu/DropdownItem.d.ts +0 -1
- package/dist/src/DropdownMenu/DropdownMenu.js +13 -17
- package/dist/src/DropdownMenu/DropdownMenu.story.js +2 -2
- package/dist/src/DropdownMenu/DropdownMenuContainer.d.ts +0 -1
- package/dist/src/DropdownMenu/DropdownMenuContainer.js +10 -1
- package/dist/src/DropdownMenu/DropdownText.d.ts +1 -2
- package/dist/src/FieldLabel/FieldLabel.js +2 -14
- package/dist/src/FieldLabel/HelpText.d.ts +1 -2
- package/dist/src/FieldLabel/LabelText.d.ts +0 -1
- package/dist/src/FieldLabel/MaybeFieldLabel.js +1 -15
- package/dist/src/FieldLabel/RequirementText.js +1 -1
- package/dist/src/Flex/Flex.d.ts +0 -1
- package/dist/src/Flex/Flex.story.js +3 -17
- package/dist/src/Form/Field.d.ts +0 -1
- package/dist/src/Form/Fieldset.d.ts +0 -1
- package/dist/src/Form/Form.js +3 -17
- package/dist/src/Form/FormSection.js +3 -17
- package/dist/src/Icon/Icon.js +9 -24
- package/dist/src/Icon/LoadingIcon.js +2 -14
- package/dist/src/Input/Input.js +3 -15
- package/dist/src/Input/InputField.js +4 -16
- package/dist/src/Input/Prefix.js +2 -16
- package/dist/src/Input/Suffix.js +2 -14
- package/dist/src/Layout/ApplicationFrame.js +2 -14
- package/dist/src/Layout/Header.js +4 -17
- package/dist/src/Layout/Page.applicationFrame.story.d.ts +8 -3
- package/dist/src/Layout/Page.applicationFrame.story.js +26 -12
- package/dist/src/Layout/Page.d.ts +2 -2
- package/dist/src/Layout/Page.js +5 -19
- package/dist/src/Layout/Page.story.d.ts +10 -5
- package/dist/src/Layout/Page.story.js +54 -20
- package/dist/src/Layout/Sidebar.js +4 -18
- package/dist/src/Layout/Sidebar.story.js +16 -30
- package/dist/src/Link/Link.js +13 -21
- package/dist/src/List/List.d.ts +0 -1
- package/dist/src/MaybeTooltip/MaybeTooltip.d.ts +14 -0
- package/dist/src/{TruncatedText/components → MaybeTooltip}/MaybeTooltip.js +4 -1
- package/dist/src/MaybeTooltip/MaybeTooltip.story.d.ts +12 -0
- package/dist/src/MaybeTooltip/MaybeTooltip.story.js +23 -0
- package/dist/src/Modal/Modal.story.js +1 -1
- package/dist/src/Modal/ModalCloseButton.d.ts +0 -1
- package/dist/src/Modal/ModalFooter.d.ts +0 -1
- package/dist/src/Modal/ModalHeader.d.ts +0 -1
- package/dist/src/NDSProvider/ComponentVariantContext.js +1 -1
- package/dist/src/NDSProvider/GlobalStyles.d.ts +0 -1
- package/dist/src/NDSProvider/ModalStyleOverride.d.ts +0 -1
- package/dist/src/NDSProvider/Reset.d.ts +0 -1
- package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.d.ts +2 -1
- package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.js +3 -1
- package/dist/src/NavBarSearch/NavBarSearch.js +2 -14
- package/dist/src/Navigation/Navigation.js +3 -16
- package/dist/src/Navigation/components/AppSwitcher/NulogyAppSwitcher.js +6 -3
- package/dist/src/Navigation/components/AppSwitcher/parts/Item.js +1 -15
- package/dist/src/Navigation/components/AppSwitcher/parts/Link.js +2 -16
- package/dist/src/Navigation/components/AppSwitcher/parts/index.d.ts +4 -5
- package/dist/src/Navigation/components/DesktopNav/DesktopNav.js +2 -2
- package/dist/src/Navigation/components/MenuSubItem/MenuSubItem.js +4 -5
- package/dist/src/Navigation/components/MenuSubItem/parts/styled.d.ts +0 -1
- package/dist/src/Navigation/components/MenuSubItem/parts/styled.js +49 -7
- package/dist/src/Navigation/components/MobileNav/MobileNav.js +2 -2
- package/dist/src/Navigation/components/MobileNav/parts/MobileMenuItem.js +12 -21
- package/dist/src/Navigation/components/MobileNav/parts/styled.d.ts +1 -2
- package/dist/src/Navigation/components/MobileNav/parts/styled.js +35 -4
- package/dist/src/Navigation/components/NulogyLogo/SvgNulogyLogo.js +1 -1
- package/dist/src/Navigation/components/UserMenu/UserMenu.d.ts +0 -1
- package/dist/src/Navigation/components/UserMenu/parts/Header.js +1 -1
- package/dist/src/Navigation/components/UserMenu/parts/Item.js +7 -16
- package/dist/src/Navigation/components/UserMenu/parts/MobileItem.js +7 -16
- package/dist/src/Navigation/components/UserMenu/parts/styled.d.ts +0 -1
- package/dist/src/Navigation/components/UserMenu/parts/styled.js +43 -18
- package/dist/src/Navigation/components/shared/NavigationLogo.js +4 -16
- package/dist/src/Navigation/components/shared/NavigationLogoLink.js +2 -14
- package/dist/src/Navigation/components/shared/NavigationMenuContent.d.ts +0 -1
- package/dist/src/Navigation/components/shared/NavigationMenuItem.js +10 -24
- package/dist/src/Navigation/components/shared/components.d.ts +0 -1
- package/dist/src/Navigation/components/shared/components.js +29 -5
- package/dist/src/Navigation/hooks/useResponsiveMenu.d.ts +0 -1
- package/dist/src/Navigation/stories/Navigation.mobileVisibility.story.js +21 -9
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo2.js +1 -1
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo3.js +1 -1
- package/dist/src/Navigation/stories/fixtures/logos/Customlogo1.js +1 -1
- package/dist/src/Overlay/Overlay.d.ts +0 -1
- package/dist/src/Pagination/PageNumber.d.ts +0 -1
- package/dist/src/Pagination/Pagination.js +3 -16
- package/dist/src/Pagination/PaginationButton.d.ts +0 -1
- package/dist/src/Popper/Popper.js +29 -6
- package/dist/src/Primitives/index.d.ts +0 -1
- package/dist/src/Radio/Radio.js +11 -18
- package/dist/src/Radio/Radio.story.d.ts +135 -129
- package/dist/src/Radio/Radio.story.js +8 -8
- package/dist/src/Radio/RadioGroup.js +4 -16
- package/dist/src/RangeContainer/RangeContainer.js +6 -15
- package/dist/src/Select/MenuList.js +13 -18
- package/dist/src/Select/Select.d.ts +1 -1
- package/dist/src/Select/Select.js +16 -17
- package/dist/src/Select/Select.story.d.ts +2 -2
- package/dist/src/Select/Select.story.fixture.js +8 -30
- package/dist/src/Select/Select.story.js +14 -29
- package/dist/src/Select/SelectComponents.js +7 -7
- package/dist/src/Select/SelectOption.js +1 -1
- package/dist/src/Select/customReactSelectStyles.js +152 -44
- package/dist/src/Select/lib.js +1 -2
- package/dist/src/SortingTable/SortingTable.js +6 -15
- package/dist/src/StatusIndicator/StatusIndicator.d.ts +0 -1
- package/dist/src/StatusIndicator/StatusIndicator.js +16 -1
- package/dist/src/Summary/Summary.js +2 -14
- package/dist/src/Summary/SummaryDivider.js +1 -1
- package/dist/src/Summary/SummaryItem.js +2 -14
- package/dist/src/Switcher/Switch.js +23 -19
- package/dist/src/Switcher/Switcher.js +4 -16
- package/dist/src/Table/BaseTable.js +2 -14
- package/dist/src/Table/StatefulTable.d.ts +1 -1
- package/dist/src/Table/StatefulTable.js +17 -9
- package/dist/src/Table/StyledTh.d.ts +0 -1
- package/dist/src/Table/StyledTh.js +11 -2
- package/dist/src/Table/Table.js +2 -14
- package/dist/src/Table/Table.types.d.ts +0 -1
- package/dist/src/Table/TableBody.js +11 -11
- package/dist/src/Table/TableFoot.js +5 -8
- package/dist/src/Table/TableHead.js +1 -4
- package/dist/src/Table/addExpandableControl.js +5 -2
- package/dist/src/Table/addSelectableControl.js +5 -2
- package/dist/src/Table/stories/TableWithCustomSorting.story.js +4 -1
- package/dist/src/Table/stories/TableWithFiltering.story.js +8 -2
- package/dist/src/Table/stories/TableWithServerSidePagination.story.js +4 -15
- package/dist/src/Tabs/Tab.js +11 -18
- package/dist/src/Tabs/TabContainer.d.ts +0 -1
- package/dist/src/Tabs/TabScrollIndicator.js +2 -14
- package/dist/src/Tabs/Tabs.js +5 -7
- package/dist/src/Textarea/Textarea.js +3 -15
- package/dist/src/TimePicker/TimePicker.js +2 -14
- package/dist/src/TimePicker/TimePickerDropdown.d.ts +0 -1
- package/dist/src/TimePicker/TimePickerInput.d.ts +0 -1
- package/dist/src/TimePicker/TimePickerInput.js +6 -4
- package/dist/src/TimeRange/TimeRange.js +20 -20
- package/dist/src/Toast/Toast.js +4 -16
- package/dist/src/ToastContainer/ToastContainer.js +4 -16
- package/dist/src/ToastContainer/ToastContainer.story.js +1 -1
- package/dist/src/ToastContainer/ToastFunction.js +7 -19
- package/dist/src/Toggle/Toggle.js +4 -17
- package/dist/src/Toggle/ToggleButton.js +2 -14
- package/dist/src/Tooltip/Tooltip.d.ts +2 -2
- package/dist/src/Tooltip/Tooltip.story.js +7 -7
- package/dist/src/Tooltip/TooltipContainer.d.ts +0 -1
- package/dist/src/Tooltip/TooltipContainer.js +16 -1
- package/dist/src/Tooltip/components/TooltipComponents.js +9 -24
- package/dist/src/TopBar/TopBar.styled.d.ts +14 -7
- package/dist/src/TopBar/components/BackLink.js +2 -14
- package/dist/src/TopBar/components/Menu.js +2 -15
- package/dist/src/TopBar/components/MenuItemLink.js +2 -14
- package/dist/src/TopBar/components/PageTitle.js +2 -14
- package/dist/src/TopBar/stories/TopBar.backButton.story.js +3 -3
- package/dist/src/TopBar/stories/TopBar.menu.story.js +9 -20
- package/dist/src/TopBar/stories/TopBar.story.js +3 -3
- package/dist/src/TruncatedText/TruncatedText.js +8 -16
- package/dist/src/TruncatedText/components/TruncatedTextFillWidth.js +4 -16
- package/dist/src/TruncatedText/components/TruncatedTextMaxCharacters.js +5 -17
- package/dist/src/TruncatedText/types.d.ts +1 -1
- package/dist/src/Type/Headings.d.ts +4 -5
- package/dist/src/Type/Text.d.ts +0 -1
- package/dist/src/Validation/InlineValidation.js +2 -14
- package/dist/src/VerticalDivider/VerticalDivider.d.ts +0 -1
- package/dist/src/VisualTests/WithSpace.story.js +18 -18
- package/dist/src/hooks/useMediaQuery/useMediaQuery.js +1 -2
- package/dist/src/i18n.js +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/locale.story.js +1 -1
- package/dist/src/theme/mergeThemes.util.js +7 -1
- package/dist/src/theme/useNDSTheme.js +9 -3
- package/dist/src/utils/ClickInputLabel.d.ts +0 -1
- package/dist/src/utils/PopperArrow.js +5 -1
- package/dist/src/utils/story/code.d.ts +0 -1
- package/dist/src/utils/story/dashed.d.ts +2 -2
- package/dist/src/utils/story/placeholder.js +1 -1
- package/dist/src/utils/story/resizable.d.ts +2 -2
- package/dist/src/utils/story/resizable.js +1 -1
- package/dist/src/utils/story/simulatedAPIRequests.js +8 -19
- package/dist/src/utils/subPx.js +1 -1
- package/dist/src/utils/testing/useConditionalAutoClick.js +3 -3
- package/dist/src/utils/testing/useUrlProps.js +1 -1
- package/dist/src/utils/ts/FocusManager.js +1 -1
- package/dist/src/utils/useWindowDimension.story.d.ts +1 -1
- package/dist/src/utils/withMenuState.js +1 -1
- package/package.json +43 -43
- package/dist/src/TruncatedText/components/MaybeTooltip.d.ts +0 -24
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
1
2
|
import React from "react";
|
|
3
|
+
import { Page } from "..";
|
|
2
4
|
declare const _default: {
|
|
3
5
|
title: string;
|
|
6
|
+
component: ({ breadcrumbs, title, children, headerContent, fullHeight, renderHeader, ...rest }: import("./Page").PageProps) => React.JSX.Element;
|
|
4
7
|
parameters: {
|
|
5
8
|
layout: string;
|
|
6
9
|
};
|
|
7
10
|
};
|
|
8
11
|
export default _default;
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
12
|
+
type Story = StoryObj<typeof Page>;
|
|
13
|
+
export declare const _Page: Story;
|
|
14
|
+
export declare const NoPageTitle: Story;
|
|
15
|
+
export declare const NoBreadcrumbs: Story;
|
|
16
|
+
export declare const NoBackground: Story;
|
|
17
|
+
export declare const WithFullHeight: Story;
|
|
18
|
+
export declare const WithReactNodeAsTitle: Story;
|
|
@@ -2,30 +2,64 @@ import React from "react";
|
|
|
2
2
|
import { ApplicationFrame, Breadcrumbs, Link, Heading2, Text, Page, StatusIndicator, Navigation } from "..";
|
|
3
3
|
export default {
|
|
4
4
|
title: "Components/Page",
|
|
5
|
+
component: Page,
|
|
5
6
|
parameters: {
|
|
6
7
|
layout: "fullscreen",
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
|
-
export const _Page =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
React.createElement(React.Fragment, null,
|
|
13
|
-
React.createElement(Text, { fontFamily: "mono", fontSize: "small" }, "content"))));
|
|
14
|
-
export const NoPageTitle = () => (React.createElement(ApplicationFrame, { navBar: React.createElement(Navigation, null) },
|
|
15
|
-
React.createElement(Page, { breadcrumbs: React.createElement(Breadcrumbs, null,
|
|
10
|
+
export const _Page = {
|
|
11
|
+
args: {
|
|
12
|
+
breadcrumbs: (React.createElement(Breadcrumbs, null,
|
|
16
13
|
React.createElement(Link, { href: "/" }, "Home"),
|
|
17
|
-
React.createElement(Link, { href: "/" }, "Materials"))
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
React.createElement(Link, { href: "/" }, "Materials"))),
|
|
15
|
+
title: "Materials Overview",
|
|
16
|
+
headerContent: React.createElement(StatusIndicator, { type: "informative" }, "Beta"),
|
|
17
|
+
children: (React.createElement(Text, { fontFamily: "mono", fontSize: "small" }, "content")),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const NoPageTitle = {
|
|
21
|
+
render: (args) => (React.createElement(ApplicationFrame, { navBar: React.createElement(Navigation, null) },
|
|
22
|
+
React.createElement(Page, { ...args }))),
|
|
23
|
+
args: {
|
|
24
|
+
breadcrumbs: (React.createElement(Breadcrumbs, null,
|
|
25
|
+
React.createElement(Link, { href: "/" }, "Home"),
|
|
26
|
+
React.createElement(Link, { href: "/" }, "Materials"))),
|
|
27
|
+
children: (React.createElement(Text, { fontFamily: "mono", fontSize: "small" }, "content")),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const NoBreadcrumbs = {
|
|
31
|
+
render: (args) => (React.createElement(ApplicationFrame, { navBar: React.createElement(Navigation, null), height: "100vh" },
|
|
32
|
+
React.createElement(Page, { ...args }))),
|
|
33
|
+
args: {
|
|
34
|
+
title: "Materials Overview",
|
|
35
|
+
children: (React.createElement(React.Fragment, null,
|
|
22
36
|
React.createElement(Heading2, null, "Overview"),
|
|
23
|
-
React.createElement(Text, null, "I am main content.")))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
React.createElement(Text, null, "I am main content."))),
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const NoBackground = {
|
|
41
|
+
args: {
|
|
42
|
+
title: "Materials Overview",
|
|
43
|
+
breadcrumbs: (React.createElement(Breadcrumbs, null,
|
|
29
44
|
React.createElement(Link, { href: "/" }, "Home"),
|
|
30
|
-
React.createElement(Link, { href: "/" }, "Materials"))
|
|
31
|
-
|
|
45
|
+
React.createElement(Link, { href: "/" }, "Materials"))),
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export const WithFullHeight = {
|
|
49
|
+
render: (args) => (React.createElement(ApplicationFrame, { navBar: React.createElement(Navigation, null) },
|
|
50
|
+
React.createElement(Page, { ...args }))),
|
|
51
|
+
args: {
|
|
52
|
+
title: "Materials Overview",
|
|
53
|
+
fullHeight: true,
|
|
54
|
+
breadcrumbs: (React.createElement(Breadcrumbs, null,
|
|
55
|
+
React.createElement(Link, { href: "/" }, "Home"),
|
|
56
|
+
React.createElement(Link, { href: "/" }, "Materials"))),
|
|
57
|
+
children: React.createElement(Text, null, "I am main content."),
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export const WithReactNodeAsTitle = {
|
|
61
|
+
args: {
|
|
62
|
+
title: React.createElement("b", null, "I am a title"),
|
|
63
|
+
children: React.createElement(Text, null, "I am main content."),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useEffect, useState, useRef } from "react";
|
|
13
2
|
import { AnimatePresence } from "framer-motion";
|
|
14
3
|
import { useTranslation } from "react-i18next";
|
|
@@ -37,15 +26,13 @@ const focusFirstElement = () => {
|
|
|
37
26
|
}
|
|
38
27
|
};
|
|
39
28
|
const SidebarOverlay = ({ transitionDuration, top, transparent, zIndex = 799, onClick }) => (React.createElement(AnimatedBox, { position: "fixed", top: top, bottom: "0", left: "0", right: "0", zIndex: zIndex, bg: !transparent && "rgba(18, 43, 71, 0.5)", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: transitionDuration }, "data-testid": "sidebar-overlay", onMouseDown: onClick }));
|
|
40
|
-
function Sidebar(
|
|
41
|
-
var _b;
|
|
42
|
-
var { p = "x2", width = "xs", children, onClose, title, isOpen, footer, closeButtonTestId = "sidebar-close-button", closeButtonAriaLabel, offset = "0px", triggerRef, duration = 0.25, top, closeOnOutsideClick = true, overlay = "show", disableScroll = true, hideCloseButton = false, zIndex = "sidebar", helpText, renderHelpText } = _a, props = __rest(_a, ["p", "width", "children", "onClose", "title", "isOpen", "footer", "closeButtonTestId", "closeButtonAriaLabel", "offset", "triggerRef", "duration", "top", "closeOnOutsideClick", "overlay", "disableScroll", "hideCloseButton", "zIndex", "helpText", "renderHelpText"]);
|
|
29
|
+
function Sidebar({ p = "x2", width = "xs", children, onClose, title, isOpen, footer, closeButtonTestId = "sidebar-close-button", closeButtonAriaLabel, offset = "0px", triggerRef, duration = 0.25, top, closeOnOutsideClick = true, overlay = "show", disableScroll = true, hideCloseButton = false, zIndex = "sidebar", helpText, renderHelpText, ...props }) {
|
|
43
30
|
const closeButton = useRef(null);
|
|
44
31
|
const [shouldUpdateFocus, setShouldUpdateFocus] = useState(false);
|
|
45
32
|
const { t } = useTranslation();
|
|
46
33
|
const sideBarRef = useRef(null);
|
|
47
34
|
const contentRef = useRef(null);
|
|
48
|
-
const selectedWidth =
|
|
35
|
+
const selectedWidth = sidebarWidths[width] ?? width;
|
|
49
36
|
const { navigationV3 } = useFeatureFlags();
|
|
50
37
|
const theme = useTheme();
|
|
51
38
|
top || (top = navigationV3 ? theme.space[NAVIGATION_MENU_HEIGHT_STYLED_UNITS] : NAVBAR_HEIGHT);
|
|
@@ -53,7 +40,6 @@ function Sidebar(_a) {
|
|
|
53
40
|
autoLock: overlay && disableScroll && isOpen,
|
|
54
41
|
});
|
|
55
42
|
useEffect(() => {
|
|
56
|
-
var _a;
|
|
57
43
|
if (closeButton.current && isOpen) {
|
|
58
44
|
if (closeButton && closeButton.current) {
|
|
59
45
|
closeButton.current.focus();
|
|
@@ -63,7 +49,7 @@ function Sidebar(_a) {
|
|
|
63
49
|
}
|
|
64
50
|
else if (shouldUpdateFocus) {
|
|
65
51
|
if (triggerRef) {
|
|
66
|
-
|
|
52
|
+
triggerRef?.current?.focus();
|
|
67
53
|
}
|
|
68
54
|
else {
|
|
69
55
|
focusFirstElement();
|
|
@@ -105,7 +91,7 @@ function Sidebar(_a) {
|
|
|
105
91
|
};
|
|
106
92
|
return (React.createElement(React.Fragment, null,
|
|
107
93
|
closeOnOutsideClick && (React.createElement(AnimatePresence, null, isOpen && overlay !== "hide" && (React.createElement(SidebarOverlay, { top: top, transparent: overlay === "transparent" || overlay === false, transitionDuration: duration, zIndex: zIndex, onClick: closeOnOutsideClick && isOpen && onClose })))),
|
|
108
|
-
React.createElement(AnimatedBox,
|
|
94
|
+
React.createElement(AnimatedBox, { role: "dialog", paddingX: "x1", bg: "white", display: "flex", flexDirection: "column", height: `calc(100% - ${navigationV3 ? theme.space[NAVIGATION_MENU_HEIGHT_STYLED_UNITS] : NAVBAR_HEIGHT})`, borderLeftWidth: "1px", borderLeftStyle: "solid", borderLeftColor: "lightGrey", animate: isOpen ? "open" : "closed", variants: variants, initial: isOpen ? "open" : "closed", position: "fixed", top: top, right: offset, width: typeof selectedWidth === "string" ? { default: "100%", small: selectedWidth } : selectedWidth, zIndex: zIndex, ref: sideBarRef, ...props },
|
|
109
95
|
React.createElement(Flex, { flexDirection: "column", p: "x2", borderBottomWidth: "1px", borderBottomStyle: "solid", borderBottomColor: "lightGrey" },
|
|
110
96
|
React.createElement(Flex, { flexDirection: "column", gap: "x1" },
|
|
111
97
|
React.createElement(Flex, { justifyContent: "space-between", alignItems: "flex-start" },
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useState, useRef } from "react";
|
|
13
2
|
import { ApplicationFrame, Breadcrumbs, Link, Page, Sidebar, Select, PrimaryButton, Box, Textarea, Heading3, Navigation, } from "..";
|
|
14
3
|
import { useUrlProps } from "../utils/testing/useUrlProps";
|
|
@@ -19,22 +8,19 @@ export default {
|
|
|
19
8
|
chromatic: { delay: 300 }, // time for sidebar animation
|
|
20
9
|
},
|
|
21
10
|
};
|
|
22
|
-
const ExampleSidebar = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
36
|
-
React.createElement(Select, { options: [], labelText: "Last Delivery:" })));
|
|
37
|
-
};
|
|
11
|
+
const ExampleSidebar = ({ isOpen, onClose, ...props }) => (React.createElement(Sidebar, { isOpen: isOpen, title: "Filters", onClose: onClose, footer: React.createElement(PrimaryButton, null, "Apply"), ...props },
|
|
12
|
+
React.createElement(Select, { options: [{ label: "first option", value: 1 }], labelText: "Delivery:" }),
|
|
13
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
14
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
15
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
16
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
17
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
18
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
19
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
20
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
21
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
22
|
+
React.createElement(Select, { options: [], labelText: "Delivery:" }),
|
|
23
|
+
React.createElement(Select, { options: [], labelText: "Last Delivery:" })));
|
|
38
24
|
export const _Sidebar = () => {
|
|
39
25
|
const [isOpen, setIsOpen] = useState(false);
|
|
40
26
|
const triggerRef = useRef(null);
|
|
@@ -52,7 +38,7 @@ export const _Sidebar = () => {
|
|
|
52
38
|
React.createElement(Box, { minWidth: "300px" },
|
|
53
39
|
React.createElement(PrimaryButton, { onClick: toggleSidebar, ref: triggerRef, id: "openSidebarTrigger" }, "Open Sidebar"),
|
|
54
40
|
React.createElement(Box, { height: "3000px", width: "50%", bg: "lightBlue", mt: "x3", p: "x2" }, "Space for more content")),
|
|
55
|
-
React.createElement(ExampleSidebar,
|
|
41
|
+
React.createElement(ExampleSidebar, { isOpen: isOpen, onClose: closeSidebar, triggerRef: triggerRef, "aria-controls": "openSidebarTrigger", ...urlProps }))));
|
|
56
42
|
};
|
|
57
43
|
export const WithoutOverlay = () => {
|
|
58
44
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -108,7 +94,7 @@ const WithCustomOffsetComponent = (args) => {
|
|
|
108
94
|
React.createElement(Box, { minWidth: "300px" },
|
|
109
95
|
React.createElement(PrimaryButton, { onClick: toggleSidebar, ref: triggerRef, id: "openSidebarTrigger" }, "Open Sidebar"),
|
|
110
96
|
React.createElement(Box, { height: "3000px", width: "100%", bg: "lightBlue", mt: "x3", p: "x2" }, "Space for more content")),
|
|
111
|
-
React.createElement(ExampleSidebar,
|
|
97
|
+
React.createElement(ExampleSidebar, { isOpen: isOpen, onClose: closeSidebar, triggerRef: triggerRef, "aria-controls": "openSidebarTrigger", ...args }))));
|
|
112
98
|
};
|
|
113
99
|
export const WithCustomOffset = {
|
|
114
100
|
args: {
|
|
@@ -116,7 +102,7 @@ export const WithCustomOffset = {
|
|
|
116
102
|
duration: 0.5,
|
|
117
103
|
},
|
|
118
104
|
name: "With custom offset",
|
|
119
|
-
render: (args) => React.createElement(WithCustomOffsetComponent,
|
|
105
|
+
render: (args) => React.createElement(WithCustomOffsetComponent, { ...args }),
|
|
120
106
|
};
|
|
121
107
|
export const DontCloseOnOutsideClick = () => {
|
|
122
108
|
const [isOpen, setIsOpen] = useState(false);
|
package/dist/src/Link/Link.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import styled from "styled-components";
|
|
13
2
|
import { darken } from "polished";
|
|
14
3
|
import { themeGet } from "@styled-system/theme-get";
|
|
@@ -17,8 +6,7 @@ import { addStyledProps } from "../StyledProps";
|
|
|
17
6
|
import { AppTag } from "../AppTag";
|
|
18
7
|
import { InlineFlex } from "../Flex";
|
|
19
8
|
import { Icon } from "../Icon";
|
|
20
|
-
export default function Link(
|
|
21
|
-
var { children, forApp, openInNewTab } = _a, props = __rest(_a, ["children", "forApp", "openInNewTab"]);
|
|
9
|
+
export default function Link({ children, forApp, openInNewTab, ...props }) {
|
|
22
10
|
const openInNewTabProps = openInNewTab ? { target: "_blank", rel: "noopener noreferrer" } : {};
|
|
23
11
|
const renderContent = () => {
|
|
24
12
|
if (forApp || openInNewTab) {
|
|
@@ -29,7 +17,7 @@ export default function Link(_a) {
|
|
|
29
17
|
}
|
|
30
18
|
return children;
|
|
31
19
|
};
|
|
32
|
-
return (React.createElement(Anchor,
|
|
20
|
+
return (React.createElement(Anchor, { ...openInNewTabProps, ...props }, renderContent()));
|
|
33
21
|
}
|
|
34
22
|
const LinkWrapper = styled.span(({ underline = true }) => ({
|
|
35
23
|
textDecoration: underline ? "underline" : "none",
|
|
@@ -45,10 +33,14 @@ function getColor(props) {
|
|
|
45
33
|
return getColorFromProps(props) || props.theme.colors.blue;
|
|
46
34
|
}
|
|
47
35
|
const getHoverColor = (props) => (props.hover ? getColor(props) : darken("0.1", getColor(props)));
|
|
48
|
-
const Anchor = styled.a((
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
const Anchor = styled.a(({ underline = true, as, ...props }) => ({
|
|
37
|
+
...resetButtonStyles,
|
|
38
|
+
padding: as === "button" ? "0" : undefined,
|
|
39
|
+
textDecoration: underline ? "underline" : "none",
|
|
40
|
+
fontSize: props.theme.fontSizes.base,
|
|
41
|
+
color: getColor(props),
|
|
42
|
+
"&:hover": {
|
|
43
|
+
cursor: "pointer",
|
|
44
|
+
color: getHoverColor(props),
|
|
45
|
+
},
|
|
46
|
+
}), addStyledProps);
|
package/dist/src/List/List.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TooltipProps } from "../Tooltip/Tooltip";
|
|
3
|
+
export interface MaybeTooltipProps extends TooltipProps {
|
|
4
|
+
/** Whether to enable the tooltip at all */
|
|
5
|
+
showTooltip?: boolean;
|
|
6
|
+
/** Allow opening tooltip on mobile tap (not supported by new Tooltip) */
|
|
7
|
+
supportMobileTap?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Conditionally displays a tooltip.
|
|
11
|
+
*/
|
|
12
|
+
declare function MaybeTooltip({ tooltip, showTooltip, placement, defaultOpen, showDelay, maxWidth, supportMobileTap: _supportMobileTap, // Note: supportMobileTap is handled internally by the new Tooltip
|
|
13
|
+
className, children, }: MaybeTooltipProps): React.JSX.Element;
|
|
14
|
+
export default MaybeTooltip;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Tooltip } from "
|
|
2
|
+
import { Tooltip } from "../Tooltip";
|
|
3
|
+
/**
|
|
4
|
+
* Conditionally displays a tooltip.
|
|
5
|
+
*/
|
|
3
6
|
function MaybeTooltip({ tooltip, showTooltip = true, placement = "bottom", defaultOpen = false, showDelay = 100, maxWidth = "24em", supportMobileTap: _supportMobileTap = true, // Note: supportMobileTap is handled internally by the new Tooltip
|
|
4
7
|
className, children, }) {
|
|
5
8
|
if (!showTooltip) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
import MaybeTooltip from "./MaybeTooltip";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof MaybeTooltip;
|
|
7
|
+
render: (args: import("./MaybeTooltip").MaybeTooltipProps) => React.JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
type Story = StoryObj<typeof MaybeTooltip>;
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
export declare const WithNoTooltip: Story;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text } from "../Type";
|
|
3
|
+
import { Box } from "../Box";
|
|
4
|
+
import MaybeTooltip from "./MaybeTooltip";
|
|
5
|
+
export default {
|
|
6
|
+
title: "Components/MaybeTooltip",
|
|
7
|
+
component: MaybeTooltip,
|
|
8
|
+
render: (args) => (React.createElement(Box, { width: "100px" },
|
|
9
|
+
React.createElement(MaybeTooltip, { ...args }))),
|
|
10
|
+
};
|
|
11
|
+
export const Default = {
|
|
12
|
+
args: {
|
|
13
|
+
children: React.createElement(Text, null, "Hello"),
|
|
14
|
+
tooltip: "This is a tooltip",
|
|
15
|
+
showTooltip: true,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export const WithNoTooltip = {
|
|
19
|
+
args: {
|
|
20
|
+
children: React.createElement(Text, null, "Hello"),
|
|
21
|
+
showTooltip: false,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -125,7 +125,7 @@ export const WithParentSelector = {
|
|
|
125
125
|
},
|
|
126
126
|
name: "with a parent selector",
|
|
127
127
|
render: (args) => (React.createElement("div", { id: "parent-selector" },
|
|
128
|
-
React.createElement(NDSModal,
|
|
128
|
+
React.createElement(NDSModal, { ...args }, "Content"))),
|
|
129
129
|
};
|
|
130
130
|
export const ExampleControlledModal = {
|
|
131
131
|
render: () => React.createElement(ModalExample, null),
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const ModalCloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
3
2
|
ref?: import("react").Ref<HTMLButtonElement>;
|
|
4
3
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const ModalFooter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
2
|
export default ModalFooter;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const ModalHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
2
|
hasCloseButton?: boolean;
|
|
4
3
|
}>> & string;
|
|
@@ -8,5 +8,5 @@ export function useComponentVariant(selectedVariant) {
|
|
|
8
8
|
if (!context) {
|
|
9
9
|
throw new Error(`useComponentVariant must be used within the NDSProvider`);
|
|
10
10
|
}
|
|
11
|
-
return selectedVariant
|
|
11
|
+
return selectedVariant ?? context.variant;
|
|
12
12
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const GlobalStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
2
|
locale?: string;
|
|
4
3
|
}>> & string;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
import { RenderResult } from "@testing-library/react";
|
|
3
|
+
export declare const renderWithNDSProvider: (component: ReactNode, locale?: string) => RenderResult;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
3
|
import NDSProvider from "./NDSProvider";
|
|
4
|
-
export const renderWithNDSProvider = (component, locale = "en_US") =>
|
|
4
|
+
export const renderWithNDSProvider = (component, locale = "en_US") => {
|
|
5
|
+
return render(React.createElement(NDSProvider, { locale: locale }, component));
|
|
6
|
+
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import styled from "styled-components";
|
|
14
3
|
import { darken, transparentize } from "polished";
|
|
@@ -17,14 +6,13 @@ import { Flex } from "../Flex";
|
|
|
17
6
|
import { Input } from "../Input";
|
|
18
7
|
import { Icon } from "../Icon";
|
|
19
8
|
import { subPx } from "../utils";
|
|
20
|
-
const BaseNavBarSearch = (
|
|
21
|
-
var { name = "global-search", onSubmit } = _a, props = __rest(_a, ["name", "onSubmit"]);
|
|
9
|
+
const BaseNavBarSearch = ({ name = "global-search", onSubmit, ...props }) => {
|
|
22
10
|
const handleOnSubmit = (e) => {
|
|
23
11
|
e.preventDefault();
|
|
24
12
|
onSubmit(e);
|
|
25
13
|
};
|
|
26
14
|
const { t } = useTranslation();
|
|
27
|
-
return (React.createElement("form",
|
|
15
|
+
return (React.createElement("form", { ...props, onSubmit: handleOnSubmit },
|
|
28
16
|
React.createElement(Flex, { role: "search" },
|
|
29
17
|
React.createElement(Input, { id: "navbar-search", type: "search", "aria-labelledby": name, required: true, placeholder: t("search nulogy") }),
|
|
30
18
|
React.createElement("button", { id: name, "aria-label": name },
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { useTheme } from "styled-components";
|
|
14
3
|
import useMediaQuery from "../hooks/useMediaQuery";
|
|
15
4
|
import DesktopNav from "./components/DesktopNav/DesktopNav";
|
|
16
5
|
import MobileNav from "./components/MobileNav/MobileNav";
|
|
17
6
|
import { NAVIGATION_DEFAULT_BREAKPOINT_THEME_KEY } from "./components/shared/constants";
|
|
18
|
-
const Navigation = (
|
|
19
|
-
var _b;
|
|
20
|
-
var { breakpoint = NAVIGATION_DEFAULT_BREAKPOINT_THEME_KEY } = _a, props = __rest(_a, ["breakpoint"]);
|
|
7
|
+
const Navigation = ({ breakpoint = NAVIGATION_DEFAULT_BREAKPOINT_THEME_KEY, ...props }) => {
|
|
21
8
|
const theme = useTheme();
|
|
22
|
-
const query =
|
|
9
|
+
const query = theme?.breakpoints?.[breakpoint] ? breakpoint : `(min-width: ${breakpoint})`;
|
|
23
10
|
const largeScreen = useMediaQuery(query);
|
|
24
|
-
return React.createElement(React.Fragment, null, largeScreen ? React.createElement(DesktopNav,
|
|
11
|
+
return React.createElement(React.Fragment, null, largeScreen ? React.createElement(DesktopNav, { ...props }) : React.createElement(MobileNav, { ...props }));
|
|
25
12
|
};
|
|
26
13
|
export default Navigation;
|
|
@@ -49,13 +49,16 @@ export function NulogyAppSwitcher({ config }) {
|
|
|
49
49
|
return [];
|
|
50
50
|
return apps(t)
|
|
51
51
|
.filter((app) => {
|
|
52
|
-
var _a;
|
|
53
52
|
const appConfig = config.apps[app.id];
|
|
54
|
-
return Boolean(appConfig) && (
|
|
53
|
+
return Boolean(appConfig) && (appConfig.visible ?? true);
|
|
55
54
|
})
|
|
56
55
|
.map((app) => {
|
|
57
56
|
const appConfig = config.apps[app.id];
|
|
58
|
-
return
|
|
57
|
+
return {
|
|
58
|
+
...app,
|
|
59
|
+
url: appConfig.url,
|
|
60
|
+
indicator: appConfig.indicator,
|
|
61
|
+
};
|
|
59
62
|
});
|
|
60
63
|
}, [config, t]);
|
|
61
64
|
if (!config)
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { styled } from "styled-components";
|
|
14
3
|
import * as RadixNavigationMenu from "@radix-ui/react-navigation-menu";
|
|
15
4
|
const FullWidthItem = styled(RadixNavigationMenu.Item)({
|
|
16
5
|
width: "100%",
|
|
17
6
|
});
|
|
18
|
-
const Item = React.forwardRef((
|
|
19
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
20
|
-
return (React.createElement(FullWidthItem, Object.assign({}, props, { ref: forwardedRef }), children));
|
|
21
|
-
});
|
|
7
|
+
const Item = React.forwardRef(({ children, ...props }, forwardedRef) => (React.createElement(FullWidthItem, { ...props, ref: forwardedRef }, children)));
|
|
22
8
|
Item.displayName = "Item";
|
|
23
9
|
export default Item;
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import * as RadixNavigationMenu from "@radix-ui/react-navigation-menu";
|
|
14
3
|
import { styled } from "styled-components";
|
|
15
|
-
const Link = React.forwardRef((
|
|
16
|
-
|
|
17
|
-
return (React.createElement(RadixNavigationMenu.Link, { asChild: true },
|
|
18
|
-
React.createElement(A, Object.assign({}, props, { ref: forwardedRef }), children)));
|
|
19
|
-
});
|
|
4
|
+
const Link = React.forwardRef(({ children, ...props }, forwardedRef) => (React.createElement(RadixNavigationMenu.Link, { asChild: true },
|
|
5
|
+
React.createElement(A, { ...props, ref: forwardedRef }, children))));
|
|
20
6
|
Link.displayName = "Link";
|
|
21
7
|
export default Link;
|
|
22
8
|
export const A = styled("a")(({ theme }) => ({
|