@dfds-ui/react-components 0.9.11-alpha.ca6fd903 → 0.9.11-alpha.d0bfdd42
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/cjs/accordion/Accordion.d.ts +97 -0
- package/cjs/accordion/AccordionContent.d.ts +13 -0
- package/cjs/accordion/AccordionSmall.d.ts +55 -0
- package/cjs/accordion/index.d.ts +3 -0
- package/cjs/app-bar/AppBar.d.ts +12 -0
- package/cjs/app-bar/AppBarContext.d.ts +10 -0
- package/cjs/app-bar/AppBarDrawer.d.ts +3 -0
- package/cjs/app-bar/AppBarIconButton.d.ts +10 -0
- package/cjs/app-bar/AppBarItem.d.ts +21 -0
- package/cjs/app-bar/AppBarListItem.d.ts +15 -0
- package/cjs/app-bar/index.d.ts +7 -0
- package/cjs/assertions/banner/Banner.d.ts +52 -0
- package/cjs/assertions/banner/BannerAction.d.ts +18 -0
- package/cjs/assertions/banner/BannerActionContext.d.ts +12 -0
- package/cjs/assertions/banner/BannerTypography.d.ts +7 -0
- package/cjs/assertions/banner/index.d.ts +4 -0
- package/cjs/assertions/index.d.ts +2 -0
- package/cjs/assertions/toast/Toast.d.ts +11 -0
- package/cjs/assertions/toast/Toaster.d.ts +18 -0
- package/cjs/assertions/toast/index.d.ts +2 -0
- package/cjs/badge/Badge.d.ts +26 -0
- package/cjs/badge/index.d.ts +2 -0
- package/cjs/button/BadgeIcon.d.ts +6 -0
- package/cjs/button/BaseButton.d.ts +14 -0
- package/cjs/button/Button.d.ts +18 -0
- package/cjs/button/IconButton.d.ts +75 -0
- package/cjs/button/LinkButton.d.ts +8 -0
- package/cjs/button/button-style.d.ts +7 -0
- package/cjs/button/index.d.ts +7 -0
- package/cjs/button-stack/ButtonStack.d.ts +11 -0
- package/cjs/button-stack/index.d.ts +1 -0
- package/cjs/card/Card.d.ts +18 -0
- package/cjs/card/CardActions.d.ts +4 -0
- package/cjs/card/CardContent.d.ts +13 -0
- package/cjs/card/CardMedia.d.ts +18 -0
- package/cjs/card/CardPriceTag.d.ts +24 -0
- package/cjs/card/CardTitle.d.ts +18 -0
- package/cjs/card/index.d.ts +6 -0
- package/cjs/chip/Chip.d.ts +19 -0
- package/cjs/chip/index.d.ts +2 -0
- package/cjs/common/LockBodyScroll.d.ts +25 -0
- package/cjs/common/arrow.d.ts +6 -0
- package/cjs/common/emotionCloneElement.d.ts +2 -0
- package/cjs/common/intent.d.ts +3 -0
- package/cjs/common/miniMoize.d.ts +1 -0
- package/cjs/common/polymorphic.d.ts +25 -0
- package/cjs/common/use-media.d.ts +1 -0
- package/cjs/common/useOnClickOutside.d.ts +3 -0
- package/cjs/common/utils.d.ts +3 -0
- package/cjs/counter/Counter.d.ts +26 -0
- package/cjs/counter/PluralCounter.d.ts +13 -0
- package/cjs/counter/index.d.ts +2 -0
- package/cjs/data-table/DataTable.d.ts +10 -0
- package/cjs/data-table/index.d.ts +1 -0
- package/cjs/date-range-picker/DatePickerDefaultStyles.d.ts +2 -0
- package/cjs/date-range-picker/DatePickerDfdsStyles.d.ts +2 -0
- package/cjs/date-range-picker/DateRangePicker.d.ts +33 -0
- package/cjs/date-range-picker/index.d.ts +1 -0
- package/cjs/divider/Divider.d.ts +22 -0
- package/cjs/divider/index.d.ts +1 -0
- package/cjs/drawer/Drawer.d.ts +31 -0
- package/cjs/drawer/index.d.ts +1 -0
- package/cjs/dropdown-menu/Dropdown.d.ts +46 -0
- package/cjs/dropdown-menu/DropdownContext.d.ts +12 -0
- package/cjs/dropdown-menu/MenuCheckbox.d.ts +34 -0
- package/cjs/dropdown-menu/MenuItem.d.ts +45 -0
- package/cjs/dropdown-menu/MenuTitle.d.ts +14 -0
- package/cjs/dropdown-menu/index.d.ts +5 -0
- package/cjs/elevation/index.d.ts +3 -0
- package/cjs/flexbox/FlexBox.d.ts +98 -0
- package/cjs/flexbox/index.d.ts +1 -0
- package/cjs/footer/Footer.d.ts +6 -0
- package/cjs/footer/index.d.ts +1 -0
- package/cjs/forms/assistive-text/AssistiveText.d.ts +7 -0
- package/cjs/forms/asterisk/Asterisk.d.ts +2 -0
- package/cjs/forms/checkbox/Checkbox.d.ts +39 -0
- package/cjs/forms/checkbox/ExampleControlComponent.d.ts +10 -0
- package/cjs/forms/checkbox/index.d.ts +1 -0
- package/cjs/forms/email-field/EmailField.d.ts +6 -0
- package/cjs/forms/error-text/ErrorText.d.ts +7 -0
- package/cjs/forms/field/Field.d.ts +10 -0
- package/cjs/forms/index.d.ts +21 -0
- package/cjs/forms/input/Input.d.ts +19 -0
- package/cjs/forms/input/InputComposition.d.ts +43 -0
- package/cjs/forms/label/Label.d.ts +10 -0
- package/cjs/forms/number-field/NumberField.d.ts +6 -0
- package/cjs/forms/password-field/PasswordField.d.ts +4 -0
- package/cjs/forms/radio/Radio.d.ts +35 -0
- package/cjs/forms/reactselect/ReactSelect.d.ts +25 -0
- package/cjs/forms/searchable-select/AsyncSearchableSelect.d.ts +6 -0
- package/cjs/forms/select/Select.d.ts +16 -0
- package/cjs/forms/select-field/SelectField.d.ts +17 -0
- package/cjs/forms/switch/Switch.d.ts +13 -0
- package/cjs/forms/tel-field/TelField.d.ts +6 -0
- package/cjs/forms/text-field/TextField.d.ts +26 -0
- package/cjs/global-styles/GlobalStyles.d.ts +2 -0
- package/cjs/global-styles/ResetStyles.d.ts +8 -0
- package/cjs/global-styles/ResetStyles.js +39 -0
- package/cjs/global-styles/sanitize.d.ts +1 -0
- package/cjs/grid/Column.d.ts +9 -0
- package/cjs/grid/Container.d.ts +14 -0
- package/cjs/grid/index.d.ts +2 -0
- package/cjs/hero/Hero.d.ts +10 -0
- package/cjs/hero/index.d.ts +1 -0
- package/cjs/hero/stripes.d.ts +6 -0
- package/cjs/ie-banner/IEBanner.d.ts +11 -0
- package/cjs/ie-banner/index.d.ts +1 -0
- package/cjs/index.d.ts +43 -0
- package/cjs/index.js +9 -0
- package/cjs/layout/LayoutLegacy.d.ts +1 -0
- package/cjs/lists/FeatureList.d.ts +24 -0
- package/cjs/lists/ListAddon.d.ts +11 -0
- package/cjs/lists/ListDivider.d.ts +4 -0
- package/cjs/lists/ListIcon.d.ts +18 -0
- package/cjs/lists/ListItem.d.ts +46 -0
- package/cjs/lists/ListText.d.ts +39 -0
- package/cjs/lists/ListTextGroup.d.ts +15 -0
- package/cjs/lists/ListTitle.d.ts +3 -0
- package/cjs/lists/index.d.ts +8 -0
- package/cjs/loader/DfdsLoader.d.ts +9 -0
- package/cjs/loader/Loader.d.ts +5 -0
- package/cjs/loader/index.d.ts +2 -0
- package/cjs/localization/LocaleFlag.d.ts +13 -0
- package/cjs/localization/index.d.ts +2 -0
- package/cjs/localization/locales.d.ts +34 -0
- package/cjs/logo/Logo.d.ts +10 -0
- package/cjs/logo/index.d.ts +1 -0
- package/cjs/media/index.d.ts +2 -0
- package/cjs/menu/Menu.d.ts +7 -0
- package/cjs/menu/index.d.ts +2 -0
- package/cjs/nav-bar/NavBar.d.ts +35 -0
- package/cjs/nav-bar/index.d.ts +2 -0
- package/cjs/nav-menu/NavMenuItem.d.ts +10 -0
- package/cjs/nav-menu/index.d.ts +1 -0
- package/cjs/pagination/Pagination.d.ts +44 -0
- package/cjs/pagination/Pagination.styles.d.ts +2 -0
- package/cjs/pagination/index.d.ts +1 -0
- package/cjs/popper/Popper.d.ts +29 -0
- package/cjs/popper/index.d.ts +1 -0
- package/cjs/progress-bar/ProgressBar.d.ts +7 -0
- package/cjs/progress-bar/index.d.ts +2 -0
- package/cjs/schedule/ScheduleItem.d.ts +21 -0
- package/cjs/schedule/ScheduleList.d.ts +11 -0
- package/cjs/schedule/index.d.ts +2 -0
- package/cjs/side-sheet/SideSheet.d.ts +57 -0
- package/cjs/side-sheet/SideSheetCloseButton.d.ts +13 -0
- package/cjs/side-sheet/SideSheetContent.d.ts +7 -0
- package/cjs/side-sheet/SideSheetFooter.d.ts +7 -0
- package/cjs/side-sheet/SideSheetHeader.d.ts +9 -0
- package/cjs/side-sheet/SideSheetHeadline.d.ts +7 -0
- package/cjs/side-sheet/index.d.ts +4 -0
- package/cjs/site-layout/SiteLayout.d.ts +36 -0
- package/cjs/site-layout/index.d.ts +2 -0
- package/cjs/skeleton/Skeleton.d.ts +6 -0
- package/cjs/skeleton/index.d.ts +1 -0
- package/cjs/social-media-link-list/SocialMediaLinkList.d.ts +26 -0
- package/cjs/social-media-link-list/index.d.ts +1 -0
- package/cjs/spinner/Spinner.d.ts +57 -0
- package/cjs/spinner/index.d.ts +1 -0
- package/cjs/stepper/Step.d.ts +9 -0
- package/cjs/stepper/Step.js +58 -56
- package/cjs/stepper/Stepper.d.ts +15 -0
- package/cjs/stepper/Stepper.js +69 -36
- package/cjs/stepper/index.d.ts +2 -0
- package/cjs/stepper/index.js +11 -1
- package/cjs/styles/index.d.ts +3 -0
- package/cjs/styles/media.d.ts +21 -0
- package/cjs/styles/rem.d.ts +1 -0
- package/cjs/styles/style-helpers.d.ts +1 -0
- package/cjs/styles/theme.d.ts +39 -0
- package/cjs/surface/Surface.d.ts +30 -0
- package/cjs/surface/index.d.ts +1 -0
- package/cjs/tab/Tab.d.ts +11 -0
- package/cjs/tab/TabPanel.d.ts +7 -0
- package/cjs/tab/Tabs.d.ts +11 -0
- package/cjs/tab/TabsContext.d.ts +14 -0
- package/cjs/tab/index.d.ts +4 -0
- package/cjs/table/Table.d.ts +22 -0
- package/cjs/table/TableBody.d.ts +9 -0
- package/cjs/table/TableDataCell.d.ts +14 -0
- package/cjs/table/TableHead.d.ts +14 -0
- package/cjs/table/TableHeaderCell.d.ts +15 -0
- package/cjs/table/TableRow.d.ts +17 -0
- package/cjs/table/index.d.ts +6 -0
- package/cjs/test/Test.d.ts +8 -0
- package/cjs/tooltip/Tooltip.d.ts +22 -0
- package/cjs/tooltip/index.d.ts +2 -0
- package/cjs/typography/Headlines.d.ts +70 -0
- package/cjs/typography/Text.d.ts +4 -0
- package/cjs/typography/index.d.ts +2 -0
- package/global-styles/ResetStyles.d.ts +8 -0
- package/global-styles/ResetStyles.js +29 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +9 -9
- package/stepper/Step.d.ts +5 -37
- package/stepper/Step.js +65 -59
- package/stepper/Stepper.d.ts +11 -23
- package/stepper/Stepper.js +86 -34
- package/stepper/index.d.ts +1 -1
- package/stepper/index.js +1 -1
- package/cjs/stepper/StepButton.js +0 -68
- package/cjs/stepper/StepLabel.js +0 -31
- package/cjs/stepper/Stepper.styles.js +0 -40
- package/stepper/StepButton.d.ts +0 -4
- package/stepper/StepButton.js +0 -54
- package/stepper/StepLabel.d.ts +0 -6
- package/stepper/StepLabel.js +0 -19
- package/stepper/Stepper.styles.d.ts +0 -3
- package/stepper/Stepper.styles.js +0 -27
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButtonSize } from '../button/IconButton';
|
|
3
|
+
export declare type SideSheetCloseButtonProps = {
|
|
4
|
+
onRequestClose?: () => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
icon?: React.ElementType;
|
|
7
|
+
size?: IconButtonSize;
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
closeLabel?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare const SideSheetCloseButton: ({ onRequestClose, className, icon, size, closeLabel, ...rest }: SideSheetCloseButtonProps) => JSX.Element;
|
|
13
|
+
export default SideSheetCloseButton;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type SideSheetFooterProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SideSheetContent: ({ children, className, ...rest }: SideSheetFooterProps) => JSX.Element;
|
|
7
|
+
export default SideSheetContent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type SideSheetFooterProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SideSheetFooter: ({ children, className, ...rest }: SideSheetFooterProps) => JSX.Element;
|
|
7
|
+
export default SideSheetFooter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type ModalHeaderProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
sticky?: boolean;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
noDivider?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const SideSheetHeader: ({ children, className, sticky, noDivider, ...rest }: ModalHeaderProps) => JSX.Element;
|
|
9
|
+
export default SideSheetHeader;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type SideSheetHeadlineProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SideSheetHeadline: ({ className, children }: SideSheetHeadlineProps) => JSX.Element;
|
|
7
|
+
export default SideSheetHeadline;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type RenderAs = {
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
};
|
|
5
|
+
declare type LayoutProps = {
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
} & RenderAs;
|
|
9
|
+
declare type LayoutChildProps = {
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
} & RenderAs;
|
|
13
|
+
export declare const LayoutGrid: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
as?: React.ElementType<any> | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
fullWidth?: boolean | undefined;
|
|
18
|
+
className?: string | undefined;
|
|
19
|
+
} & RenderAs, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
20
|
+
export declare const Layout: React.FunctionComponent<LayoutProps>;
|
|
21
|
+
export declare const LayoutHeader: React.FunctionComponent<LayoutChildProps>;
|
|
22
|
+
export declare const LayoutMain: React.FunctionComponent<LayoutChildProps>;
|
|
23
|
+
export declare const LayoutFooter: React.FunctionComponent<LayoutChildProps>;
|
|
24
|
+
declare const _default: {
|
|
25
|
+
Grid: import("@emotion/styled").StyledComponent<{
|
|
26
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
27
|
+
as?: React.ElementType<any> | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
fullWidth?: boolean | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
} & RenderAs, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
32
|
+
Header: React.FunctionComponent<LayoutChildProps>;
|
|
33
|
+
Main: React.FunctionComponent<LayoutChildProps>;
|
|
34
|
+
Footer: React.FunctionComponent<LayoutChildProps>;
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Skeleton';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
export declare type SocialMediaLinkListProps = {
|
|
3
|
+
instagramLink?: string;
|
|
4
|
+
facebookLink?: string;
|
|
5
|
+
blogLink?: string;
|
|
6
|
+
twitterLink?: string;
|
|
7
|
+
linkedinLink?: string;
|
|
8
|
+
youtubeLink?: string;
|
|
9
|
+
mailshareLink?: string;
|
|
10
|
+
iconSize?: string;
|
|
11
|
+
noPadding?: boolean;
|
|
12
|
+
colorOverwrite?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const SoMeWrapper: import("@emotion/styled").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: React.ElementType<any> | undefined;
|
|
17
|
+
} & import("../flexbox/FlexBox").FlexBoxProps & {
|
|
18
|
+
as?: React.ElementType<any> | undefined;
|
|
19
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
} & {
|
|
22
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
23
|
+
} & SocialMediaLinkListProps, {}, {}>;
|
|
24
|
+
declare type socialMediaLinkListComponent = FunctionComponent<SocialMediaLinkListProps>;
|
|
25
|
+
export declare const SocialMediaLinkList: socialMediaLinkListComponent;
|
|
26
|
+
export default SocialMediaLinkList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SocialMediaLinkList';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { PolymorphicComponentProps } from '../common/polymorphic';
|
|
2
|
+
declare type Color = 'dark' | 'secondary' | 'light';
|
|
3
|
+
export declare type SpinnerProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Indicates that Spinner will show up instantaneously (instead of fading in).
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
instant?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the size of the Spinner.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated Use css instead.
|
|
13
|
+
*/
|
|
14
|
+
size?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Class name to be assigned to component.
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Set the color variant to use.
|
|
21
|
+
*/
|
|
22
|
+
color?: Color;
|
|
23
|
+
} & PolymorphicComponentProps;
|
|
24
|
+
/**
|
|
25
|
+
* A spinner is used to give user a sense of progress, when the time required to complete the given task is not known.
|
|
26
|
+
*/
|
|
27
|
+
export declare function Spinner({ instant, size, className, color, as, ...rest }: SpinnerProps): JSX.Element;
|
|
28
|
+
export declare namespace Spinner {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Style the regular spinner to achieve the desired effect.
|
|
33
|
+
*/
|
|
34
|
+
export declare const CenteredSpinner: import("@emotion/styled").StyledComponent<{
|
|
35
|
+
/**
|
|
36
|
+
* Indicates that Spinner will show up instantaneously (instead of fading in).
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
instant?: boolean | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Specifies the size of the Spinner.
|
|
42
|
+
*
|
|
43
|
+
* @deprecated Use css instead.
|
|
44
|
+
*/
|
|
45
|
+
size?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Class name to be assigned to component.
|
|
48
|
+
*/
|
|
49
|
+
className?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Set the color variant to use.
|
|
52
|
+
*/
|
|
53
|
+
color?: Color | undefined;
|
|
54
|
+
} & PolymorphicComponentProps & {
|
|
55
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
56
|
+
}, {}, {}>;
|
|
57
|
+
export default Spinner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Spinner';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ListItemProps } from './../lists/ListItem';
|
|
3
|
+
declare type StepProps = {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
listItemProps?: ListItemProps;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: React.NamedExoticComponent<StepProps>;
|
|
9
|
+
export default _default;
|
package/cjs/stepper/Step.js
CHANGED
|
@@ -3,21 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _core = require("@material-ui/core");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _Stepper = require("./Stepper");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _ListItem = _interopRequireDefault(require("./../lists/ListItem"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _theme = require("@dfds-ui/theme");
|
|
21
|
+
|
|
22
|
+
const _excluded = ["children", "label", "listItemProps"];
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
@@ -27,63 +29,63 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
29
|
|
|
28
30
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
31
|
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
|
|
34
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
35
|
+
|
|
36
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
37
|
+
|
|
38
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
39
|
+
|
|
40
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
41
|
+
|
|
42
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
+
|
|
30
44
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
45
|
|
|
32
46
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
47
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
49
|
+
|
|
50
|
+
const listItemStyles = ({
|
|
51
|
+
isActive
|
|
52
|
+
}) => /*#__PURE__*/(0, _react2.css)("background-color:", isActive ? _theme.theme.colors.secondary.light : _theme.theme.colors.surface.secondary, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:listItemStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdGVwcGVyL1N0ZXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVdtRSIsImZpbGUiOiIuLi8uLi8uLi9zcmMvc3RlcHBlci9TdGVwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUsIEZ1bmN0aW9uQ29tcG9uZW50LCB1c2VFZmZlY3QsIHVzZVN0YXRlLCBtZW1vIH0gZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IFN0ZXAgYXMgU3RlcFdyYXBwZXIsIFN0ZXBDb250ZW50IH0gZnJvbSAnQG1hdGVyaWFsLXVpL2NvcmUnXG5pbXBvcnQgeyB1c2VTdGVwcGVyQ29udGV4dCB9IGZyb20gJy4vU3RlcHBlcidcbmltcG9ydCBMaXN0SXRlbSwgeyBMaXN0SXRlbVByb3BzIH0gZnJvbSAnLi8uLi9saXN0cy9MaXN0SXRlbSdcbmltcG9ydCB1dWlkIGZyb20gJ3V1aWQvdjQnXG5pbXBvcnQgeyB0aGVtZSB9IGZyb20gJ0BkZmRzLXVpL3RoZW1lJ1xuXG50eXBlIFN0ZXBQcm9wcyA9IHsgbGFiZWw6IFJlYWN0Tm9kZTsgY2hpbGRyZW46IFJlYWN0Tm9kZTsgbGlzdEl0ZW1Qcm9wcz86IExpc3RJdGVtUHJvcHMgfVxudHlwZSBTdGVwQ29tcG9uZW50ID0gRnVuY3Rpb25Db21wb25lbnQ8U3RlcFByb3BzPlxuXG5jb25zdCBsaXN0SXRlbVN0eWxlcyA9ICh7IGlzQWN0aXZlIH06IHsgaXNBY3RpdmU6IGJvb2xlYW4gfSkgPT4gY3NzYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiAke2lzQWN0aXZlID8gdGhlbWUuY29sb3JzLnNlY29uZGFyeS5saWdodCA6IHRoZW1lLmNvbG9ycy5zdXJmYWNlLnNlY29uZGFyeX07XG5gXG5cbmNvbnN0IHN0ZXBDb250ZW50U3R5bGVzID0gY3NzYFxuICAuTXVpU3RlcENvbnRlbnQtcm9vdCB7XG4gICAgYm9yZGVyOiBub25lO1xuICAgIG1hcmdpbjogMHB4O1xuICAgIHBhZGRpbmc6IDBweDtcbiAgfVxuYFxuXG5jb25zdCBTdGVwOiBTdGVwQ29tcG9uZW50ID0gKHsgY2hpbGRyZW4sIGxhYmVsLCBsaXN0SXRlbVByb3BzLCAuLi5wcm9wcyB9KSA9PiB7XG4gIGNvbnN0IFtzdGVwSWRdID0gdXNlU3RhdGUodXVpZCgpKVxuICBjb25zdCB7IHNldFN0ZXAsIGFjdGl2ZVN0ZXAgfSA9IHVzZVN0ZXBwZXJDb250ZXh0KClcbiAgY29uc3QgaXNBY3RpdmUgPSBzdGVwSWQgPT09IGFjdGl2ZVN0ZXBcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIHJlYWN0LWhvb2tzL2V4aGF1c3RpdmUtZGVwc1xuICB1c2VFZmZlY3QoKCkgPT4gc2V0U3RlcChzdGVwSWQpLCBbXSlcbiAgcmV0dXJuIChcbiAgICA8U3RlcFdyYXBwZXIgey4uLnByb3BzfSBjc3M9e3N0ZXBDb250ZW50U3R5bGVzfT5cbiAgICAgIDxMaXN0SXRlbSBhcz1cImRpdlwiIGNzcz17bGlzdEl0ZW1TdHlsZXMoeyBpc0FjdGl2ZSB9KX0gey4uLmxpc3RJdGVtUHJvcHN9PlxuICAgICAgICB7bGFiZWx9XG4gICAgICA8L0xpc3RJdGVtPlxuICAgICAgPFN0ZXBDb250ZW50PntjaGlsZHJlbn08L1N0ZXBDb250ZW50PlxuICAgIDwvU3RlcFdyYXBwZXI+XG4gIClcbn1cblxuZXhwb3J0IGRlZmF1bHQgbWVtbyhTdGVwKVxuIl19 */");
|
|
53
|
+
|
|
54
|
+
const stepContentStyles = process.env.NODE_ENV === "production" ? {
|
|
55
|
+
name: "1nyoacf",
|
|
56
|
+
styles: ".MuiStepContent-root{border:none;margin:0px;padding:0px;}"
|
|
57
|
+
} : {
|
|
58
|
+
name: "ndmke3-stepContentStyles",
|
|
59
|
+
styles: ".MuiStepContent-root{border:none;margin:0px;padding:0px;};label:stepContentStyles;",
|
|
60
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdGVwcGVyL1N0ZXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWU2QiIsImZpbGUiOiIuLi8uLi8uLi9zcmMvc3RlcHBlci9TdGVwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUsIEZ1bmN0aW9uQ29tcG9uZW50LCB1c2VFZmZlY3QsIHVzZVN0YXRlLCBtZW1vIH0gZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IFN0ZXAgYXMgU3RlcFdyYXBwZXIsIFN0ZXBDb250ZW50IH0gZnJvbSAnQG1hdGVyaWFsLXVpL2NvcmUnXG5pbXBvcnQgeyB1c2VTdGVwcGVyQ29udGV4dCB9IGZyb20gJy4vU3RlcHBlcidcbmltcG9ydCBMaXN0SXRlbSwgeyBMaXN0SXRlbVByb3BzIH0gZnJvbSAnLi8uLi9saXN0cy9MaXN0SXRlbSdcbmltcG9ydCB1dWlkIGZyb20gJ3V1aWQvdjQnXG5pbXBvcnQgeyB0aGVtZSB9IGZyb20gJ0BkZmRzLXVpL3RoZW1lJ1xuXG50eXBlIFN0ZXBQcm9wcyA9IHsgbGFiZWw6IFJlYWN0Tm9kZTsgY2hpbGRyZW46IFJlYWN0Tm9kZTsgbGlzdEl0ZW1Qcm9wcz86IExpc3RJdGVtUHJvcHMgfVxudHlwZSBTdGVwQ29tcG9uZW50ID0gRnVuY3Rpb25Db21wb25lbnQ8U3RlcFByb3BzPlxuXG5jb25zdCBsaXN0SXRlbVN0eWxlcyA9ICh7IGlzQWN0aXZlIH06IHsgaXNBY3RpdmU6IGJvb2xlYW4gfSkgPT4gY3NzYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiAke2lzQWN0aXZlID8gdGhlbWUuY29sb3JzLnNlY29uZGFyeS5saWdodCA6IHRoZW1lLmNvbG9ycy5zdXJmYWNlLnNlY29uZGFyeX07XG5gXG5cbmNvbnN0IHN0ZXBDb250ZW50U3R5bGVzID0gY3NzYFxuICAuTXVpU3RlcENvbnRlbnQtcm9vdCB7XG4gICAgYm9yZGVyOiBub25lO1xuICAgIG1hcmdpbjogMHB4O1xuICAgIHBhZGRpbmc6IDBweDtcbiAgfVxuYFxuXG5jb25zdCBTdGVwOiBTdGVwQ29tcG9uZW50ID0gKHsgY2hpbGRyZW4sIGxhYmVsLCBsaXN0SXRlbVByb3BzLCAuLi5wcm9wcyB9KSA9PiB7XG4gIGNvbnN0IFtzdGVwSWRdID0gdXNlU3RhdGUodXVpZCgpKVxuICBjb25zdCB7IHNldFN0ZXAsIGFjdGl2ZVN0ZXAgfSA9IHVzZVN0ZXBwZXJDb250ZXh0KClcbiAgY29uc3QgaXNBY3RpdmUgPSBzdGVwSWQgPT09IGFjdGl2ZVN0ZXBcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIHJlYWN0LWhvb2tzL2V4aGF1c3RpdmUtZGVwc1xuICB1c2VFZmZlY3QoKCkgPT4gc2V0U3RlcChzdGVwSWQpLCBbXSlcbiAgcmV0dXJuIChcbiAgICA8U3RlcFdyYXBwZXIgey4uLnByb3BzfSBjc3M9e3N0ZXBDb250ZW50U3R5bGVzfT5cbiAgICAgIDxMaXN0SXRlbSBhcz1cImRpdlwiIGNzcz17bGlzdEl0ZW1TdHlsZXMoeyBpc0FjdGl2ZSB9KX0gey4uLmxpc3RJdGVtUHJvcHN9PlxuICAgICAgICB7bGFiZWx9XG4gICAgICA8L0xpc3RJdGVtPlxuICAgICAgPFN0ZXBDb250ZW50PntjaGlsZHJlbn08L1N0ZXBDb250ZW50PlxuICAgIDwvU3RlcFdyYXBwZXI+XG4gIClcbn1cblxuZXhwb3J0IGRlZmF1bHQgbWVtbyhTdGVwKVxuIl19 */",
|
|
61
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
62
|
+
};
|
|
42
63
|
|
|
43
64
|
const Step = _ref => {
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_ref$label = _ref.label,
|
|
48
|
-
label = _ref$label === void 0 ? '' : _ref$label,
|
|
49
|
-
activeProp = _ref.active,
|
|
50
|
-
completedProp = _ref.completed,
|
|
51
|
-
disabledProp = _ref.disabled,
|
|
65
|
+
let children = _ref.children,
|
|
66
|
+
label = _ref.label,
|
|
67
|
+
listItemProps = _ref.listItemProps,
|
|
52
68
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
53
69
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const contextValue = _react.default.useMemo(() => ({
|
|
75
|
-
index,
|
|
76
|
-
active,
|
|
77
|
-
completed,
|
|
78
|
-
disabled,
|
|
79
|
-
editable
|
|
80
|
-
}), [index, active, completed, disabled, editable]);
|
|
81
|
-
|
|
82
|
-
return (0, _react2.jsx)(StepContext.Provider, {
|
|
83
|
-
value: contextValue
|
|
84
|
-
}, (0, _react2.jsx)("div", _extends({
|
|
85
|
-
css: _Stepper.stepWrapperStyles
|
|
86
|
-
}, props), (0, _react2.jsx)(_StepButton.default, null), label && (0, _react2.jsx)(_StepLabel.default, null, label)));
|
|
70
|
+
const _useState = (0, _react.useState)((0, _v.default)()),
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
72
|
+
stepId = _useState2[0];
|
|
73
|
+
|
|
74
|
+
const _useStepperContext = (0, _Stepper.useStepperContext)(),
|
|
75
|
+
setStep = _useStepperContext.setStep,
|
|
76
|
+
activeStep = _useStepperContext.activeStep;
|
|
77
|
+
|
|
78
|
+
const isActive = stepId === activeStep; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
+
|
|
80
|
+
(0, _react.useEffect)(() => setStep(stepId), []);
|
|
81
|
+
return (0, _react2.jsx)(_core.Step, _extends({}, props, {
|
|
82
|
+
css: stepContentStyles
|
|
83
|
+
}), (0, _react2.jsx)(_ListItem.default, _extends({
|
|
84
|
+
as: "div",
|
|
85
|
+
css: listItemStyles({
|
|
86
|
+
isActive
|
|
87
|
+
})
|
|
88
|
+
}, listItemProps), label), (0, _react2.jsx)(_core.StepContent, null, children));
|
|
87
89
|
};
|
|
88
90
|
|
|
89
91
|
var _default = /*#__PURE__*/(0, _react.memo)(Step);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { SetStateAction, Dispatch, ReactNode } from 'react';
|
|
2
|
+
declare type StepperProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
initialStep?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const useStepperContext: () => {
|
|
7
|
+
activeStep: string;
|
|
8
|
+
setStep: (id: string) => void;
|
|
9
|
+
setNext: () => Dispatch<SetStateAction<number>> | void;
|
|
10
|
+
setBack: () => Dispatch<SetStateAction<number>> | void;
|
|
11
|
+
setReset: () => Dispatch<SetStateAction<number>> | void;
|
|
12
|
+
setActiveIndex: Dispatch<SetStateAction<number>>;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: React.NamedExoticComponent<StepperProps>;
|
|
15
|
+
export default _default;
|
package/cjs/stepper/Stepper.js
CHANGED
|
@@ -3,57 +3,90 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.
|
|
6
|
+
exports.default = exports.useStepperContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _core = require("@material-ui/core");
|
|
11
11
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
|
|
14
|
+
const _excluded = ["children", "initialStep"];
|
|
15
|
+
|
|
14
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
17
|
|
|
16
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
19
|
|
|
18
|
-
function
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
21
|
|
|
20
|
-
function
|
|
22
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
23
|
|
|
22
|
-
function
|
|
24
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
26
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
+
|
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
29
|
+
|
|
30
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
+
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
34
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
35
|
+
|
|
36
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
37
|
+
|
|
38
|
+
const StepperContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
39
|
+
|
|
40
|
+
const useStepperContext = () => {
|
|
41
|
+
const context = (0, _react.useContext)(StepperContext);
|
|
42
|
+
|
|
43
|
+
if (context === undefined) {
|
|
44
|
+
throw new Error('useStepperContext must be used within a StepperProvider');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return context;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.useStepperContext = useStepperContext;
|
|
51
|
+
|
|
52
|
+
const StepperProvider = _ref => {
|
|
53
|
+
let children = _ref.children,
|
|
54
|
+
initialStep = _ref.initialStep,
|
|
55
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
56
|
+
|
|
57
|
+
const _useState = (0, _react.useState)([]),
|
|
58
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
+
steps = _useState2[0],
|
|
60
|
+
setSteps = _useState2[1];
|
|
61
|
+
|
|
62
|
+
const _useState3 = (0, _react.useState)(initialStep || 0),
|
|
63
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
64
|
+
activeIndex = _useState4[0],
|
|
65
|
+
setActiveIndex = _useState4[1];
|
|
51
66
|
|
|
67
|
+
const activeStep = steps[activeIndex];
|
|
68
|
+
const setStep = (0, _react.useCallback)(newStep => setSteps(prevSteps => [...prevSteps, newStep]), []);
|
|
69
|
+
const setNext = (0, _react.useCallback)(() => setActiveIndex(prevIndex => prevIndex + 1), []);
|
|
70
|
+
const setBack = (0, _react.useCallback)(() => setActiveIndex(prevIndex => prevIndex - 1), []);
|
|
71
|
+
const setReset = (0, _react.useCallback)(() => setActiveIndex(0), []);
|
|
52
72
|
return (0, _react2.jsx)(StepperContext.Provider, {
|
|
53
|
-
value:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
value: {
|
|
74
|
+
setStep,
|
|
75
|
+
activeStep,
|
|
76
|
+
setNext,
|
|
77
|
+
setBack,
|
|
78
|
+
setReset,
|
|
79
|
+
setActiveIndex
|
|
80
|
+
}
|
|
81
|
+
}, (0, _react2.jsx)(_core.Stepper, _extends({
|
|
82
|
+
style: {
|
|
83
|
+
padding: 0
|
|
84
|
+
}
|
|
85
|
+
}, props, {
|
|
86
|
+
connector: (0, _react2.jsx)(_react.default.Fragment, null),
|
|
87
|
+
orientation: "vertical",
|
|
88
|
+
activeStep: activeIndex
|
|
89
|
+
}), children));
|
|
57
90
|
};
|
|
58
91
|
|
|
59
92
|
var _default = /*#__PURE__*/(0, _react.memo)(StepperProvider);
|
package/cjs/stepper/index.js
CHANGED
|
@@ -15,9 +15,19 @@ Object.defineProperty(exports, "Stepper", {
|
|
|
15
15
|
return _Stepper.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "useStepperContext", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _Stepper.useStepperContext;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
|
|
19
25
|
var _Step = _interopRequireDefault(require("./Step"));
|
|
20
26
|
|
|
21
|
-
var _Stepper =
|
|
27
|
+
var _Stepper = _interopRequireWildcard(require("./Stepper"));
|
|
28
|
+
|
|
29
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
+
|
|
31
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
32
|
|
|
23
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const defaultBreakPoints: {
|
|
2
|
+
xl: number;
|
|
3
|
+
lg: number;
|
|
4
|
+
md: number;
|
|
5
|
+
sm: number;
|
|
6
|
+
xs: number;
|
|
7
|
+
};
|
|
8
|
+
declare type BreakPoint = keyof typeof defaultBreakPoints | number;
|
|
9
|
+
export declare function legacyGenerateMedia(breakPoints: typeof defaultBreakPoints): {
|
|
10
|
+
lt: (breakPoint: BreakPoint) => string;
|
|
11
|
+
gt: (breakPoint: BreakPoint) => string;
|
|
12
|
+
bt: (firstBreakpoint: BreakPoint, secondBreakpoint: BreakPoint) => string;
|
|
13
|
+
tablet: () => string;
|
|
14
|
+
};
|
|
15
|
+
export declare const legacyMedia: {
|
|
16
|
+
lt: (breakPoint: BreakPoint) => string;
|
|
17
|
+
gt: (breakPoint: BreakPoint) => string;
|
|
18
|
+
bt: (firstBreakpoint: BreakPoint, secondBreakpoint: BreakPoint) => string;
|
|
19
|
+
tablet: () => string;
|
|
20
|
+
};
|
|
21
|
+
export default legacyMedia;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const rem: (targetPixelValue: number, base?: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const visuallyHidden: () => import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const theme: {
|
|
2
|
+
colors: {
|
|
3
|
+
yesGreen: string;
|
|
4
|
+
cautionAmber: string;
|
|
5
|
+
noRed: string;
|
|
6
|
+
linkBlue: string;
|
|
7
|
+
linkHover: string;
|
|
8
|
+
actionBlue: string;
|
|
9
|
+
actionHover: string;
|
|
10
|
+
actionMedium: string;
|
|
11
|
+
actionLight: string;
|
|
12
|
+
primaryOrange: string;
|
|
13
|
+
primaryHover: string;
|
|
14
|
+
uiEnabled: string;
|
|
15
|
+
uiDisabled: string;
|
|
16
|
+
textGrey: string;
|
|
17
|
+
textMedium: string;
|
|
18
|
+
textLight: string;
|
|
19
|
+
groupBlue: string;
|
|
20
|
+
groupMedium: string;
|
|
21
|
+
groupLight: string;
|
|
22
|
+
backgroundGrey: string;
|
|
23
|
+
white: string;
|
|
24
|
+
whiteHover: string;
|
|
25
|
+
};
|
|
26
|
+
fontFamily: string;
|
|
27
|
+
spacing: {
|
|
28
|
+
xxs: string;
|
|
29
|
+
xs: string;
|
|
30
|
+
s: string;
|
|
31
|
+
m: string;
|
|
32
|
+
l: string;
|
|
33
|
+
xl: string;
|
|
34
|
+
xxl: string;
|
|
35
|
+
};
|
|
36
|
+
uiRoundness: string;
|
|
37
|
+
};
|
|
38
|
+
export declare type ThemeInterface = typeof theme;
|
|
39
|
+
export default theme;
|