@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
package/dist/src/Alert/Alert.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 React, { useState } from "react";
|
|
13
2
|
import styled from "styled-components";
|
|
14
3
|
import { useComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
@@ -46,8 +35,7 @@ const alertColours = {
|
|
|
46
35
|
backgroundColor: "lightYellow",
|
|
47
36
|
},
|
|
48
37
|
};
|
|
49
|
-
const Alert = (
|
|
50
|
-
var { children, isCloseable = false, title, type = "informative", closeAriaLabel, onClose, controlled = false } = _a, props = __rest(_a, ["children", "isCloseable", "title", "type", "closeAriaLabel", "onClose", "controlled"]);
|
|
38
|
+
const Alert = ({ children, isCloseable = false, title, type = "informative", closeAriaLabel, onClose, controlled = false, ...props }) => {
|
|
51
39
|
const [isVisible, setIsVisible] = useState(true);
|
|
52
40
|
const componentVariant = useComponentVariant();
|
|
53
41
|
const hideAlert = () => {
|
|
@@ -59,7 +47,7 @@ const Alert = (_a) => {
|
|
|
59
47
|
};
|
|
60
48
|
if (!isVisible)
|
|
61
49
|
return null;
|
|
62
|
-
return (React.createElement(Flex,
|
|
50
|
+
return (React.createElement(Flex, { bg: alertColours[type].backgroundColor, p: "x2", borderRadius: "medium", borderLeftWidth: "4px", borderLeftColor: alertColours[type].borderColor, borderLeftStyle: "solid", role: "alert", alignItems: children ? "flex-start" : undefined, ...props },
|
|
63
51
|
type === "danger" && React.createElement(Icon, { size: "x3", icon: "error", mr: "x1", color: alertColours[type].borderColor }),
|
|
64
52
|
type === "success" && React.createElement(Icon, { size: "x3", icon: "check", mr: "x1", color: alertColours[type].borderColor }),
|
|
65
53
|
React.createElement(Flex, { flexDirection: "column", gap: componentVariant === "touch" ? "half" : "none", mr: "auto" },
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { AppTagType } from "../types";
|
|
3
2
|
export declare const LogoWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
4
3
|
$type?: AppTagType;
|
|
@@ -1,17 +1,5 @@
|
|
|
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
|
-
export default function NulogyLogo(
|
|
14
|
-
|
|
15
|
-
return (React.createElement("svg", Object.assign({ width: width, height: height, viewBox: "0 0 8 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
2
|
+
export default function NulogyLogo({ width = 8, height = 8, ...props }) {
|
|
3
|
+
return (React.createElement("svg", { width: width, height: height, viewBox: "0 0 8 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
|
|
16
4
|
React.createElement("path", { d: "M6.75004 0.290783L8 0.872348V6.10892C8 7.23335 6.80591 7.43084 5.99989 7.56333C6.4609 7.43084 6.7526 7.28197 6.75004 6.10892V1.45441L5.50008 0.872348L6.75004 0.290783ZM1.49987 7.27255V4.07344C1.49987 3.7514 1.70755 3.38717 1.95959 3.26163L3.25007 2.61655V4.65104L4.50003 5.52785C4.75207 5.67671 5.25017 5.68019 5.25017 5.23657V4.36373L4.74951 4.07245V0L0.938216 1.63404C0.420065 1.85585 0 2.55502 0 3.2001V8L1.49987 7.27255Z", fill: "white" })));
|
|
17
5
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { gql, useLazyQuery } from "@apollo/client";
|
|
11
2
|
import { MockedProvider } from "@apollo/client/testing";
|
|
12
3
|
import React, { useCallback } from "react";
|
|
@@ -43,9 +34,9 @@ const mocks = [
|
|
|
43
34
|
];
|
|
44
35
|
const AsyncSelectWithApollo = () => {
|
|
45
36
|
const [getCountries, { data }] = useLazyQuery(GET_COUNTRIES);
|
|
46
|
-
const loadOptions = useCallback((inputValue) =>
|
|
47
|
-
|
|
48
|
-
if (data
|
|
37
|
+
const loadOptions = useCallback(async (inputValue) => {
|
|
38
|
+
await getCountries();
|
|
39
|
+
if (data?.countries) {
|
|
49
40
|
return data.countries
|
|
50
41
|
.filter((country) => country.name.toLowerCase().includes(inputValue.toLowerCase()))
|
|
51
42
|
.map((country) => ({
|
|
@@ -54,7 +45,7 @@ const AsyncSelectWithApollo = () => {
|
|
|
54
45
|
}));
|
|
55
46
|
}
|
|
56
47
|
return [];
|
|
57
|
-
}
|
|
48
|
+
}, [data, getCountries]);
|
|
58
49
|
return React.createElement(AsyncSelect, { placeholder: "Search for a country", loadOptions: loadOptions, labelText: "Country" });
|
|
59
50
|
};
|
|
60
51
|
export const WithApolloClientExample = () => (React.createElement(MockedProvider, { mocks: mocks, addTypename: false },
|
|
@@ -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, { forwardRef } from "react";
|
|
13
2
|
import AsyncReactSelect from "react-select/async";
|
|
14
3
|
import { useTranslation } from "react-i18next";
|
|
@@ -21,8 +10,7 @@ import customStyles from "../Select/customReactSelectStyles";
|
|
|
21
10
|
import { getSubset } from "../utils/subset";
|
|
22
11
|
import { useComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
23
12
|
import { SelectControl, SelectMultiValue, SelectClearIndicator, SelectContainer, SelectInput, SelectDropdownIndicator, SelectMenu, SelectOption, } from "./AsyncSelectComponents";
|
|
24
|
-
const AsyncSelect = forwardRef((
|
|
25
|
-
var { autocomplete, labelText, required, requirementText, helpText, noOptionsMessage, disabled, errorMessage, errorList, id, initialIsOpen, maxHeight, menuPosition, multiselect, name, onChange, placeholder, value, defaultValue, className, classNamePrefix, onBlur, menuIsOpen, onMenuOpen, onMenuClose, onInputChange, components, "aria-label": ariaLabel, cacheOptions = false, defaultOptions, loadOptions, isClearable } = _a, props = __rest(_a, ["autocomplete", "labelText", "required", "requirementText", "helpText", "noOptionsMessage", "disabled", "errorMessage", "errorList", "id", "initialIsOpen", "maxHeight", "menuPosition", "multiselect", "name", "onChange", "placeholder", "value", "defaultValue", "className", "classNamePrefix", "onBlur", "menuIsOpen", "onMenuOpen", "onMenuClose", "onInputChange", "components", "aria-label", "cacheOptions", "defaultOptions", "loadOptions", "isClearable"]);
|
|
13
|
+
const AsyncSelect = forwardRef(({ autocomplete, labelText, required, requirementText, helpText, noOptionsMessage, disabled, errorMessage, errorList, id, initialIsOpen, maxHeight, menuPosition, multiselect, name, onChange, placeholder, value, defaultValue, className, classNamePrefix, onBlur, menuIsOpen, onMenuOpen, onMenuClose, onInputChange, components, "aria-label": ariaLabel, cacheOptions = false, defaultOptions, loadOptions, isClearable, ...props }, ref) => {
|
|
26
14
|
const { t } = useTranslation();
|
|
27
15
|
const variant = useComponentVariant();
|
|
28
16
|
const theme = useTheme();
|
|
@@ -30,9 +18,9 @@ const AsyncSelect = forwardRef((_a, ref) => {
|
|
|
30
18
|
const error = !!(errorMessage || errorList);
|
|
31
19
|
const componentVariant = useComponentVariant(variant);
|
|
32
20
|
noOptionsMessage || (noOptionsMessage = () => t("no options"));
|
|
33
|
-
return (React.createElement(Field,
|
|
21
|
+
return (React.createElement(Field, { ...spaceProps },
|
|
34
22
|
React.createElement(MaybeFieldLabel, { labelText: labelText, requirementText: requirementText, helpText: helpText },
|
|
35
|
-
React.createElement(AsyncReactSelect,
|
|
23
|
+
React.createElement(AsyncReactSelect, { className: className, classNamePrefix: classNamePrefix, noOptionsMessage: noOptionsMessage || t("no options"), value: value, ref: ref, defaultInputValue: defaultValue, placeholder: placeholder || t("start typing"), styles: customStyles({
|
|
36
24
|
hasIcon: Boolean(props.iconLeft),
|
|
37
25
|
theme,
|
|
38
26
|
error,
|
|
@@ -40,7 +28,17 @@ const AsyncSelect = forwardRef((_a, ref) => {
|
|
|
40
28
|
maxHeight,
|
|
41
29
|
windowed: false,
|
|
42
30
|
hasDefaultOptions: Boolean(defaultOptions),
|
|
43
|
-
}), isDisabled: disabled, isSearchable: autocomplete, "aria-required": required, required: required, "aria-invalid": error, defaultMenuIsOpen: initialIsOpen, inputId: id, onBlur: onBlur, onChange: onChange, name: name, isMulti: multiselect, menuIsOpen: menuIsOpen, onMenuOpen: onMenuOpen, onMenuClose: onMenuClose, menuPosition: menuPosition, onInputChange: onInputChange, components:
|
|
31
|
+
}), isDisabled: disabled, isSearchable: autocomplete, "aria-required": required, required: required, "aria-invalid": error, defaultMenuIsOpen: initialIsOpen, inputId: id, onBlur: onBlur, onChange: onChange, name: name, isMulti: multiselect, menuIsOpen: menuIsOpen, onMenuOpen: onMenuOpen, onMenuClose: onMenuClose, menuPosition: menuPosition, onInputChange: onInputChange, components: {
|
|
32
|
+
Option: (props) => (React.createElement(SelectOption, { variant: componentVariant, ...props }, props.children)),
|
|
33
|
+
Control: SelectControl,
|
|
34
|
+
MultiValue: SelectMultiValue,
|
|
35
|
+
ClearIndicator: SelectClearIndicator,
|
|
36
|
+
DropdownIndicator: SelectDropdownIndicator,
|
|
37
|
+
SelectContainer: SelectContainer,
|
|
38
|
+
Menu: SelectMenu,
|
|
39
|
+
Input: SelectInput,
|
|
40
|
+
...components,
|
|
41
|
+
}, "aria-label": ariaLabel, cacheOptions: cacheOptions, defaultOptions: defaultOptions, loadOptions: loadOptions, isClearable: isClearable, ...props }),
|
|
44
42
|
React.createElement(InlineValidation, { mt: "x1", errorMessage: errorMessage, errorList: errorList }))));
|
|
45
43
|
});
|
|
46
44
|
export default AsyncSelect;
|
|
@@ -1,54 +1,42 @@
|
|
|
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 { components as selectComponents, } from "react-select";
|
|
14
3
|
import { components } from "react-select";
|
|
15
4
|
import { StyledOption } from "../Select/SelectOption";
|
|
16
5
|
import { InputIcon } from "../Icon/Icon";
|
|
17
|
-
export const SelectControl = (
|
|
18
|
-
var { isFocused, children } = _a, props = __rest(_a, ["isFocused", "children"]);
|
|
6
|
+
export const SelectControl = ({ isFocused, children, ...props }) => {
|
|
19
7
|
return (React.createElement("div", { "data-testid": "select-control" },
|
|
20
|
-
React.createElement(selectComponents.Control,
|
|
8
|
+
React.createElement(selectComponents.Control, { className: isFocused ? "nds-select--is-focused" : null, isFocused: isFocused, ...props },
|
|
21
9
|
props.selectProps.iconLeft && React.createElement(InputIcon, { left: "x1", icon: props.selectProps.iconLeft, size: "x3" }),
|
|
22
10
|
children)));
|
|
23
11
|
};
|
|
24
12
|
export const SelectMultiValue = (props) => {
|
|
25
13
|
return (React.createElement("div", { "data-testid": "select-multivalue" },
|
|
26
|
-
React.createElement(selectComponents.MultiValue,
|
|
14
|
+
React.createElement(selectComponents.MultiValue, { ...props }, props.children)));
|
|
27
15
|
};
|
|
28
16
|
export const SelectClearIndicator = (props) => {
|
|
29
17
|
return (React.createElement("div", { "data-testid": "select-clear" },
|
|
30
|
-
React.createElement(selectComponents.ClearIndicator,
|
|
18
|
+
React.createElement(selectComponents.ClearIndicator, { ...props }, props.children)));
|
|
31
19
|
};
|
|
32
20
|
export const SelectDropdownIndicator = (props) => {
|
|
33
21
|
return (React.createElement("div", { "data-testid": "select-arrow" },
|
|
34
|
-
React.createElement(selectComponents.DropdownIndicator,
|
|
22
|
+
React.createElement(selectComponents.DropdownIndicator, { ...props }, props.children)));
|
|
35
23
|
};
|
|
36
24
|
export const SelectContainer = (props) => {
|
|
37
25
|
return (React.createElement("div", { "data-testid": "select-container" },
|
|
38
|
-
React.createElement(selectComponents.SelectContainer,
|
|
26
|
+
React.createElement(selectComponents.SelectContainer, { ...props }, props.children)));
|
|
39
27
|
};
|
|
40
28
|
export const SelectInput = (props) => {
|
|
41
29
|
return (React.createElement("div", { "data-testid": "select-input" },
|
|
42
|
-
React.createElement(selectComponents.Input,
|
|
30
|
+
React.createElement(selectComponents.Input, { ...props }, props.children)));
|
|
43
31
|
};
|
|
44
32
|
export const SelectMenu = (props) => {
|
|
45
33
|
if (!props.selectProps.inputValue && props.options.length === 0) {
|
|
46
34
|
return null;
|
|
47
35
|
}
|
|
48
36
|
return (React.createElement("div", { "data-testid": "select-dropdown" },
|
|
49
|
-
React.createElement(components.Menu,
|
|
37
|
+
React.createElement(components.Menu, { ...props }, props.children)));
|
|
50
38
|
};
|
|
51
39
|
export function SelectOption(props) {
|
|
52
40
|
return (React.createElement(StyledOption, { isSelected: props.isSelected, isFocused: props.isFocused, "data-testid": "select-option" },
|
|
53
|
-
React.createElement(components.Option,
|
|
41
|
+
React.createElement(components.Option, { ...props }, props.children)));
|
|
54
42
|
}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { filterOptions } from "../utils/story/simulatedAPIRequests";
|
|
11
|
-
export const loadMatchingProvinces = (inputValue) =>
|
|
12
|
-
const data =
|
|
13
|
-
return
|
|
14
|
-
}
|
|
2
|
+
export const loadMatchingProvinces = async (inputValue) => {
|
|
3
|
+
const data = await filterOptions(inputValue, provinces);
|
|
4
|
+
return await data.json();
|
|
5
|
+
};
|
|
15
6
|
export const provinces = [
|
|
16
7
|
{
|
|
17
8
|
label: "Alberta",
|
|
@@ -1,18 +1,4 @@
|
|
|
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 { Alert } from "../Alert";
|
|
14
|
-
const Banner = (
|
|
15
|
-
var props = __rest(_a, []);
|
|
16
|
-
return (React.createElement(Alert, Object.assign({ borderStyle: "none", borderRadius: "0", px: "x3" }, props)));
|
|
17
|
-
};
|
|
3
|
+
const Banner = ({ ...props }) => (React.createElement(Alert, { borderStyle: "none", borderRadius: "0", px: "x3", ...props }));
|
|
18
4
|
export default Banner;
|
|
@@ -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 { useTranslation } from "react-i18next";
|
|
14
3
|
import { useTheme } from "styled-components";
|
|
@@ -17,9 +6,7 @@ import { QuietButton } from "../Button";
|
|
|
17
6
|
import { Flex } from "../Flex";
|
|
18
7
|
import { noop } from "../utils/noop";
|
|
19
8
|
import { BottomSheetParts } from "./BottomSheet.parts";
|
|
20
|
-
export default function BottomSheet(
|
|
21
|
-
var _b;
|
|
22
|
-
var { title, helpText, closeButtonLabel, secondaryAction, primaryAction, isOpen = false, onClose = noop, sheetWidth = "100%", contentWidth = { small: "100%", medium: 704 }, disableCloseOnOverlayClick = false, hideCloseButton = false, children } = _a, props = __rest(_a, ["title", "helpText", "closeButtonLabel", "secondaryAction", "primaryAction", "isOpen", "onClose", "sheetWidth", "contentWidth", "disableCloseOnOverlayClick", "hideCloseButton", "children"]);
|
|
9
|
+
export default function BottomSheet({ title, helpText, closeButtonLabel, secondaryAction, primaryAction, isOpen = false, onClose = noop, sheetWidth = "100%", contentWidth = { small: "100%", medium: 704 }, disableCloseOnOverlayClick = false, hideCloseButton = false, children, ...props }) {
|
|
23
10
|
const { t } = useTranslation();
|
|
24
11
|
const theme = useTheme();
|
|
25
12
|
closeButtonLabel || (closeButtonLabel = t("close"));
|
|
@@ -32,7 +19,7 @@ export default function BottomSheet(_a) {
|
|
|
32
19
|
const footerHeight = `calc(${theme.space.x5} + (${theme.space.x2} * 2) + ${theme.space.x4})`;
|
|
33
20
|
return (React.createElement(BottomSheetParts.Root, { isOpen: isOpen, onClose: onClose },
|
|
34
21
|
React.createElement(BottomSheetParts.Overlay, { closeOnClick: closeOnClick },
|
|
35
|
-
React.createElement(BottomSheetParts.Sheet, { width: sheetWidth, maxWidth: { small: `calc(100% - ${theme.space.x8})` }, maxHeight: { small: `calc(100dvh - ${theme.space.x7})`, medium: "85.4dvh" }, "aria-label":
|
|
22
|
+
React.createElement(BottomSheetParts.Sheet, { width: sheetWidth, maxWidth: { small: `calc(100% - ${theme.space.x8})` }, maxHeight: { small: `calc(100dvh - ${theme.space.x7})`, medium: "85.4dvh" }, "aria-label": props["aria-label"] ?? title },
|
|
36
23
|
React.createElement(BottomSheetParts.ContentContainer, null,
|
|
37
24
|
React.createElement(Box, { width: contentWidth, margin: "0 auto" },
|
|
38
25
|
React.createElement(BottomSheetParts.Header, null,
|
|
@@ -28,7 +28,7 @@ export declare const BottomSheetParts: {
|
|
|
28
28
|
inline?: boolean;
|
|
29
29
|
compact?: boolean;
|
|
30
30
|
disabled?: boolean;
|
|
31
|
-
textTransform?: "
|
|
31
|
+
textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
|
|
32
32
|
fontSize?: string;
|
|
33
33
|
} & import("..").StyledProps, "ref"> & {
|
|
34
34
|
ref?: React.Ref<HTMLParagraphElement>;
|
|
@@ -40,7 +40,7 @@ export declare const BottomSheetParts: {
|
|
|
40
40
|
inline?: boolean;
|
|
41
41
|
compact?: boolean;
|
|
42
42
|
disabled?: boolean;
|
|
43
|
-
textTransform?: "
|
|
43
|
+
textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
|
|
44
44
|
fontSize?: string;
|
|
45
45
|
} & import("..").StyledProps, "ref"> & {
|
|
46
46
|
ref?: React.Ref<HTMLParagraphElement>;
|
|
@@ -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 { AnimatePresence } from "framer-motion";
|
|
13
2
|
import React from "react";
|
|
14
3
|
import { Overlay, Sheet, ContentContainer, Footer, Header, Title, HelpText } from "./BottomSheet.styled";
|
|
@@ -25,32 +14,29 @@ const transition = {
|
|
|
25
14
|
duration: 0.5,
|
|
26
15
|
ease: [0.32, 0.72, 0, 1],
|
|
27
16
|
};
|
|
28
|
-
function Root(
|
|
29
|
-
|
|
30
|
-
return (React.createElement(AnimatePresence, Object.assign({}, props), isOpen && (React.createElement(BottomSheetProvider, { isOpen: isOpen, onClose: onClose }, children))));
|
|
17
|
+
function Root({ isOpen, onClose, children, ...props }) {
|
|
18
|
+
return (React.createElement(AnimatePresence, { ...props }, isOpen && (React.createElement(BottomSheetProvider, { isOpen: isOpen, onClose: onClose }, children))));
|
|
31
19
|
}
|
|
32
|
-
function OverlayPart(
|
|
33
|
-
var { closeOnClick, children } = _a, props = __rest(_a, ["closeOnClick", "children"]);
|
|
20
|
+
function OverlayPart({ closeOnClick, children, ...props }) {
|
|
34
21
|
const { onClose, isOpen } = useBottomSheet();
|
|
35
22
|
const [isAnimationComplete, setAnimationComplete] = React.useState(false);
|
|
36
|
-
return (React.createElement(Overlay,
|
|
23
|
+
return (React.createElement(Overlay, { "data-testid": "bottom-sheet-overlay", "data-visible": isAnimationComplete ? true : undefined, variants: overlayVariants, initial: "hidden", animate: "visible", exit: "hidden", transition: transition, onAnimationComplete: () => {
|
|
37
24
|
if (isOpen) {
|
|
38
25
|
setAnimationComplete(true);
|
|
39
26
|
}
|
|
40
|
-
}, onClick: closeOnClick ? onClose : undefined, isOpen: isOpen
|
|
27
|
+
}, onClick: closeOnClick ? onClose : undefined, isOpen: isOpen, ...props }, children));
|
|
41
28
|
}
|
|
42
|
-
function SheetPart(
|
|
43
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
29
|
+
function SheetPart({ children, ...props }) {
|
|
44
30
|
const { isOpen } = useBottomSheet();
|
|
45
31
|
const [isAnimationComplete, setAnimationComplete] = React.useState(false);
|
|
46
32
|
function handleSheetClick(e) {
|
|
47
33
|
e.stopPropagation();
|
|
48
34
|
}
|
|
49
|
-
return (React.createElement(Sheet,
|
|
35
|
+
return (React.createElement(Sheet, { "data-testid": "bottom-sheet-body", "aria-label": props["aria-label"], "data-visible": isAnimationComplete ? true : undefined, variants: sheetVariants, initial: "hidden", animate: "visible", exit: "hidden", transition: transition, onAnimationComplete: () => {
|
|
50
36
|
if (isOpen) {
|
|
51
37
|
setAnimationComplete(true);
|
|
52
38
|
}
|
|
53
|
-
}, onClick: handleSheetClick
|
|
39
|
+
}, onClick: handleSheetClick, ...props }, children));
|
|
54
40
|
}
|
|
55
41
|
export const BottomSheetParts = {
|
|
56
42
|
Root,
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DialogContentProps } from "@reach/dialog";
|
|
3
2
|
import type { AnimationProps } from "framer-motion";
|
|
4
3
|
import type { HeightProps, LayoutProps, MaxHeightProps, MaxWidthProps, SpaceProps, WidthProps } from "styled-system";
|
|
5
4
|
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"> & {
|
|
6
5
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
7
|
-
}, "as" | keyof import("@reach/dialog
|
|
6
|
+
}, "as" | keyof import("@reach/dialog").DialogOverlayProps> & import("@reach/dialog").DialogOverlayProps & {
|
|
8
7
|
as?: "div";
|
|
9
8
|
} & import("framer-motion").MotionProps, "ref"> & import("react").RefAttributes<HTMLElement | SVGElement>, never>> & string & Omit<import("framer-motion").CustomDomComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
9
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
11
|
-
}, "as" | keyof import("@reach/dialog
|
|
10
|
+
}, "as" | keyof import("@reach/dialog").DialogOverlayProps> & import("@reach/dialog").DialogOverlayProps & {
|
|
12
11
|
as?: "div";
|
|
13
12
|
}>, keyof import("react").Component<any, {}, any>>;
|
|
14
13
|
interface SheetProps extends DialogContentProps, AnimationProps, WidthProps, MaxWidthProps, HeightProps, MaxHeightProps, SpaceProps, LayoutProps {
|
|
@@ -30,7 +29,7 @@ declare const Title: import("styled-components/dist/types").IStyledComponentBase
|
|
|
30
29
|
inline?: boolean;
|
|
31
30
|
compact?: boolean;
|
|
32
31
|
disabled?: boolean;
|
|
33
|
-
textTransform?: "
|
|
32
|
+
textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
|
|
34
33
|
fontSize?: string;
|
|
35
34
|
} & import("../StyledProps").StyledProps, "ref"> & {
|
|
36
35
|
ref?: import("react").Ref<HTMLParagraphElement>;
|
|
@@ -42,7 +41,7 @@ declare const HelpText: import("styled-components/dist/types").IStyledComponentB
|
|
|
42
41
|
inline?: boolean;
|
|
43
42
|
compact?: boolean;
|
|
44
43
|
disabled?: boolean;
|
|
45
|
-
textTransform?: "
|
|
44
|
+
textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
|
|
46
45
|
fontSize?: string;
|
|
47
46
|
} & import("../StyledProps").StyledProps, "ref"> & {
|
|
48
47
|
ref?: import("react").Ref<HTMLParagraphElement>;
|
package/dist/src/Box/Box.d.ts
CHANGED
|
@@ -21,12 +21,14 @@ export declare const AnimatedBox: import("styled-components/dist/types").IStyled
|
|
|
21
21
|
suppressContentEditableWarning?: boolean;
|
|
22
22
|
suppressHydrationWarning?: boolean;
|
|
23
23
|
accessKey?: string;
|
|
24
|
+
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters";
|
|
24
25
|
autoFocus?: boolean;
|
|
25
26
|
className?: string;
|
|
26
27
|
contentEditable?: "inherit" | (boolean | "true" | "false");
|
|
27
28
|
contextMenu?: string;
|
|
28
29
|
dir?: string;
|
|
29
30
|
draggable?: boolean | "true" | "false";
|
|
31
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send";
|
|
30
32
|
id?: string;
|
|
31
33
|
lang?: string;
|
|
32
34
|
nonce?: string;
|
|
@@ -44,7 +46,6 @@ export declare const AnimatedBox: import("styled-components/dist/types").IStyled
|
|
|
44
46
|
rev?: string;
|
|
45
47
|
typeof?: string;
|
|
46
48
|
vocab?: string;
|
|
47
|
-
autoCapitalize?: string;
|
|
48
49
|
autoCorrect?: string;
|
|
49
50
|
autoSave?: string;
|
|
50
51
|
itemProp?: string;
|
|
@@ -54,20 +55,26 @@ export declare const AnimatedBox: import("styled-components/dist/types").IStyled
|
|
|
54
55
|
itemRef?: string;
|
|
55
56
|
results?: number;
|
|
56
57
|
security?: string;
|
|
57
|
-
unselectable?: "
|
|
58
|
+
unselectable?: "off" | "on";
|
|
58
59
|
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
59
60
|
is?: string;
|
|
61
|
+
exportparts?: string;
|
|
62
|
+
part?: string;
|
|
60
63
|
"aria-activedescendant"?: string;
|
|
61
64
|
"aria-atomic"?: boolean | "true" | "false";
|
|
62
65
|
"aria-autocomplete"?: "none" | "list" | "inline" | "both";
|
|
66
|
+
"aria-braillelabel"?: string;
|
|
67
|
+
"aria-brailleroledescription"?: string;
|
|
63
68
|
"aria-busy"?: boolean | "true" | "false";
|
|
64
69
|
"aria-checked"?: boolean | "true" | "false" | "mixed";
|
|
65
70
|
"aria-colcount"?: number;
|
|
66
71
|
"aria-colindex"?: number;
|
|
72
|
+
"aria-colindextext"?: string;
|
|
67
73
|
"aria-colspan"?: number;
|
|
68
74
|
"aria-controls"?: string;
|
|
69
|
-
"aria-current"?: boolean | "time" | "
|
|
75
|
+
"aria-current"?: boolean | "time" | "page" | "true" | "false" | "step" | "location" | "date";
|
|
70
76
|
"aria-describedby"?: string;
|
|
77
|
+
"aria-description"?: string;
|
|
71
78
|
"aria-details"?: string;
|
|
72
79
|
"aria-disabled"?: boolean | "true" | "false";
|
|
73
80
|
"aria-dropeffect"?: "link" | "none" | "copy" | "move" | "execute" | "popup";
|
|
@@ -97,6 +104,7 @@ export declare const AnimatedBox: import("styled-components/dist/types").IStyled
|
|
|
97
104
|
"aria-roledescription"?: string;
|
|
98
105
|
"aria-rowcount"?: number;
|
|
99
106
|
"aria-rowindex"?: number;
|
|
107
|
+
"aria-rowindextext"?: string;
|
|
100
108
|
"aria-rowspan"?: number;
|
|
101
109
|
"aria-selected"?: boolean | "true" | "false";
|
|
102
110
|
"aria-setsize"?: number;
|
|
@@ -126,7 +134,7 @@ export declare const AnimatedBox: import("styled-components/dist/types").IStyled
|
|
|
126
134
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement>;
|
|
127
135
|
onChange?: import("react").FormEventHandler<HTMLDivElement>;
|
|
128
136
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
129
|
-
onBeforeInput?: import("react").
|
|
137
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement>;
|
|
130
138
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
131
139
|
onInput?: import("react").FormEventHandler<HTMLDivElement>;
|
|
132
140
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
@@ -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 { Icon } from "../Icon";
|
|
@@ -29,47 +18,47 @@ const getSharedStyles = (color, theme) => {
|
|
|
29
18
|
borderRadius: theme.radii.medium,
|
|
30
19
|
};
|
|
31
20
|
};
|
|
32
|
-
const MenuLink = styled.a(({ color, hoverColor, hoverBackground, theme }) => (
|
|
21
|
+
const MenuLink = styled.a(({ color, hoverColor, hoverBackground, theme }) => ({
|
|
22
|
+
...getSharedStyles(color, theme),
|
|
23
|
+
fontWeight: theme.fontWeights.medium,
|
|
24
|
+
transition: ".2s",
|
|
25
|
+
"&:hover, &:focus": {
|
|
33
26
|
outline: "none",
|
|
34
27
|
color: theme.colors[hoverColor] || hoverColor,
|
|
35
28
|
backgroundColor: theme.colors[hoverBackground] || hoverBackground,
|
|
36
29
|
cursor: "pointer",
|
|
37
|
-
},
|
|
30
|
+
},
|
|
31
|
+
"&:disabled": {
|
|
38
32
|
opacity: ".5",
|
|
39
|
-
},
|
|
33
|
+
},
|
|
34
|
+
"&:focus": {
|
|
40
35
|
boxShadow: theme.shadows.focus,
|
|
41
|
-
}
|
|
42
|
-
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
const MenuText = styled.div(({ textColor, theme }) => ({
|
|
39
|
+
...getSharedStyles(textColor, theme),
|
|
40
|
+
fontWeight: theme.fontWeights.medium,
|
|
41
|
+
}));
|
|
43
42
|
const Nav = styled.nav({
|
|
44
43
|
display: "flex",
|
|
45
44
|
alignItems: "center",
|
|
46
45
|
});
|
|
47
|
-
const renderMenuTrigger = (menuItem, themeColorObject, layer, menuType) => {
|
|
48
|
-
|
|
49
|
-
return (React.createElement("div", { key: (_a = menuItem.key) !== null && _a !== void 0 ? _a : menuItem.name },
|
|
50
|
-
React.createElement(MenuTrigger, Object.assign({ menuType: menuType, name: menuItem.name, "aria-label": menuItem.ariaLabel, menuData: menuItem.items, trigger: menuItem.trigger, layer: layer }, themeColorObject))));
|
|
51
|
-
};
|
|
46
|
+
const renderMenuTrigger = (menuItem, themeColorObject, layer, menuType) => (React.createElement("div", { key: menuItem.key ?? menuItem.name },
|
|
47
|
+
React.createElement(MenuTrigger, { menuType: menuType, name: menuItem.name, "aria-label": menuItem.ariaLabel, menuData: menuItem.items, trigger: menuItem.trigger, layer: layer, ...themeColorObject })));
|
|
52
48
|
const renderMenuLink = (menuItem, themeColorObject) => {
|
|
53
|
-
var _a;
|
|
54
49
|
const linkProps = {
|
|
55
50
|
href: menuItem.href,
|
|
56
51
|
to: menuItem.to,
|
|
57
52
|
as: menuItem.as,
|
|
58
53
|
target: menuItem.openInNew ? "_blank" : undefined,
|
|
59
54
|
};
|
|
60
|
-
return (React.createElement("div", { key:
|
|
61
|
-
React.createElement(MenuLink,
|
|
55
|
+
return (React.createElement("div", { key: menuItem.key ?? menuItem.name },
|
|
56
|
+
React.createElement(MenuLink, { ...linkProps, ...themeColorObject },
|
|
62
57
|
menuItem.name,
|
|
63
58
|
menuItem.openInNew && React.createElement(Icon, { size: "x2", icon: "openInNew" }))));
|
|
64
59
|
};
|
|
65
|
-
const renderCustom = (menuItem, _themeColorObject, layer) => {
|
|
66
|
-
|
|
67
|
-
return (React.createElement("div", { key: (_a = menuItem.key) !== null && _a !== void 0 ? _a : menuItem.name }, menuItem.render({ size: "medium", layer })));
|
|
68
|
-
};
|
|
69
|
-
const renderText = (menuItem, themeColorObject) => {
|
|
70
|
-
var _a;
|
|
71
|
-
return (React.createElement(MenuText, Object.assign({ key: (_a = menuItem.key) !== null && _a !== void 0 ? _a : menuItem.name }, themeColorObject), menuItem.name));
|
|
72
|
-
};
|
|
60
|
+
const renderCustom = (menuItem, _themeColorObject, layer) => (React.createElement("div", { key: menuItem.key ?? menuItem.name }, menuItem.render({ size: "medium", layer })));
|
|
61
|
+
const renderText = (menuItem, themeColorObject) => (React.createElement(MenuText, { key: menuItem.key ?? menuItem.name, ...themeColorObject }, menuItem.name));
|
|
73
62
|
const getRenderFunction = (menuItem) => {
|
|
74
63
|
if (menuItem.items) {
|
|
75
64
|
return renderMenuTrigger;
|
|
@@ -83,10 +72,7 @@ const getRenderFunction = (menuItem) => {
|
|
|
83
72
|
return renderText;
|
|
84
73
|
};
|
|
85
74
|
const renderMenuItem = (menuItem, themeColorObject, layer, menuType) => getRenderFunction(menuItem)(menuItem, themeColorObject, layer, menuType);
|
|
86
|
-
const BaseDesktopMenu = React.forwardRef((
|
|
87
|
-
var { menuData, menuType, themeColorObject } = _a, props = __rest(_a, ["menuData", "menuType", "themeColorObject"]);
|
|
88
|
-
return (React.createElement(Nav, Object.assign({}, props, { ref: ref }), menuData.map((menuItem) => renderMenuItem(menuItem, themeColorObject, 0, menuType))));
|
|
89
|
-
});
|
|
75
|
+
const BaseDesktopMenu = React.forwardRef(({ menuData, menuType, themeColorObject, ...props }, ref) => (React.createElement(Nav, { ...props, ref: ref }, menuData.map((menuItem) => renderMenuItem(menuItem, themeColorObject, 0, menuType)))));
|
|
90
76
|
/** @deprecated The BrandedNavBar component is deprecated. Use the Navigation component instead. */
|
|
91
77
|
const DesktopMenu = styled(BaseDesktopMenu)({
|
|
92
78
|
"& > div": {
|
|
@@ -1,21 +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 NavBarDropdownMenu from "./NavBarDropdownMenu";
|
|
14
3
|
import SubMenuTrigger from "./SubMenuTrigger";
|
|
15
4
|
import renderSubMenuItems from "./renderSubMenuItems";
|
|
16
5
|
import MenuTriggerButton from "./MenuTriggerButton";
|
|
17
|
-
const MenuTrigger = (
|
|
18
|
-
var { menuData, name, color, hoverColor, hoverBackground, "aria-label": ariaLabel, trigger, layer, menuType } = _a, props = __rest(_a, ["menuData", "name", "color", "hoverColor", "hoverBackground", "aria-label", "trigger", "layer", "menuType"]);
|
|
6
|
+
const MenuTrigger = ({ menuData, name, color, hoverColor, hoverBackground, "aria-label": ariaLabel, trigger, layer, menuType, ...props }) => {
|
|
19
7
|
let dropdownMinWidth = "auto";
|
|
20
8
|
const setDropdownMinWidth = (popperData) => {
|
|
21
9
|
// Popper.js throws an error if popperData is not returned from this fn
|
|
@@ -31,7 +19,7 @@ const MenuTrigger = (_a) => {
|
|
|
31
19
|
};
|
|
32
20
|
return (
|
|
33
21
|
// @ts-ignore
|
|
34
|
-
React.createElement(NavBarDropdownMenu,
|
|
22
|
+
React.createElement(NavBarDropdownMenu, { ...props, placement: "bottom-start", modifiers: {
|
|
35
23
|
flip: { behavior: ["bottom"] },
|
|
36
24
|
setPopperWidth: {
|
|
37
25
|
enabled: true,
|
|
@@ -43,9 +31,9 @@ const MenuTrigger = (_a) => {
|
|
|
43
31
|
boundariesElement: "viewport",
|
|
44
32
|
},
|
|
45
33
|
}, trigger: () => {
|
|
46
|
-
const defaultRender = () => React.createElement(MenuTriggerButton,
|
|
34
|
+
const defaultRender = () => React.createElement(MenuTriggerButton, { ...triggerProps });
|
|
47
35
|
return trigger ? trigger({ size: "medium", defaultRender, layer }) : defaultRender();
|
|
48
|
-
} }
|
|
36
|
+
} }, ({ closeMenu }) => (React.createElement("ul", { style: {
|
|
49
37
|
listStyle: "none",
|
|
50
38
|
margin: "0",
|
|
51
39
|
padding: "0",
|