@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,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { theme } from '@dfds-ui/theme';
|
|
3
|
+
export declare type SurfaceType = keyof typeof theme.colors.surface;
|
|
4
|
+
export declare type SurfaceContextType = {
|
|
5
|
+
surface: SurfaceType;
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
textColors: {
|
|
8
|
+
primary: string;
|
|
9
|
+
secondary: string;
|
|
10
|
+
disabled: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare function getTextColors(surface: SurfaceType): {
|
|
14
|
+
primary: string;
|
|
15
|
+
secondary: string;
|
|
16
|
+
disabled: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function getBackgroundColor(surface: SurfaceType): string;
|
|
19
|
+
export declare const SurfaceContext: React.Context<SurfaceContextType | undefined>;
|
|
20
|
+
export declare const SurfaceProvider: React.FC<{
|
|
21
|
+
surface: SurfaceType;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function MaybeSurfaceProvider({ surface, ...rest }: React.PropsWithChildren<{
|
|
24
|
+
surface?: SurfaceType;
|
|
25
|
+
}>): JSX.Element;
|
|
26
|
+
export declare const useSurfaceContext: (surface?: "main" | "dark" | "primary" | "secondary" | "inverted" | "tertiary" | undefined) => SurfaceContextType;
|
|
27
|
+
export declare const Surface: React.FC<{
|
|
28
|
+
surface: SurfaceType;
|
|
29
|
+
className?: string;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Surface';
|
package/cjs/tab/Tab.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type Index = number | string;
|
|
3
|
+
export declare type TabProps = {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
transparent?: boolean;
|
|
7
|
+
index: Index;
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
};
|
|
10
|
+
declare const Tab: React.FC<TabProps>;
|
|
11
|
+
export default Tab;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Index } from './Tab';
|
|
3
|
+
export declare type TabsContextProps = {
|
|
4
|
+
transparent?: boolean;
|
|
5
|
+
onChange?: (index: any) => void;
|
|
6
|
+
size?: 's' | 'm';
|
|
7
|
+
activeTab?: Index | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare const TabsContext: React.Context<TabsContextProps>;
|
|
10
|
+
export declare const TabsContextProvider: React.FC<{
|
|
11
|
+
value: TabsContextProps;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const useTabsContext: () => TabsContextProps;
|
|
14
|
+
export default useTabsContext;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export declare type TableProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Table content
|
|
5
|
+
*/
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Enables interaction effect on table rows
|
|
9
|
+
*/
|
|
10
|
+
isInteractive?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Makes table header sticky when scrolling (no IE 11 support)
|
|
13
|
+
*/
|
|
14
|
+
isHeaderSticky?: boolean;
|
|
15
|
+
} & ComponentPropsWithRef<'table'>;
|
|
16
|
+
export declare type TableContextProps = {
|
|
17
|
+
isInteractive: boolean;
|
|
18
|
+
isHeaderSticky: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const useTable: () => TableContextProps;
|
|
21
|
+
export declare const Table: React.ForwardRefExoticComponent<Pick<TableProps, "key" | "css" | keyof React.TableHTMLAttributes<HTMLTableElement> | "isHeaderSticky" | "isInteractive"> & React.RefAttributes<HTMLTableElement>>;
|
|
22
|
+
export default Table;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export declare type TableBodyProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Table body content
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
} & ComponentPropsWithRef<'tbody'>;
|
|
8
|
+
export declare const TableBody: React.ForwardRefExoticComponent<Pick<TableBodyProps, "key" | "css" | keyof React.HTMLAttributes<HTMLTableSectionElement>> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
9
|
+
export default TableBody;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import { Alignment } from './TableHeaderCell';
|
|
3
|
+
export declare type TableDataCellProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Sets alignment for the content in the tag
|
|
6
|
+
*/
|
|
7
|
+
align?: Alignment;
|
|
8
|
+
/**
|
|
9
|
+
* Table cell content
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
} & ComponentPropsWithRef<'td'>;
|
|
13
|
+
export declare const TableDataCell: React.ForwardRefExoticComponent<Pick<TableDataCellProps, "key" | "css" | keyof React.TdHTMLAttributes<HTMLTableDataCellElement>> & React.RefAttributes<HTMLTableCellElement>>;
|
|
14
|
+
export default TableDataCell;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export declare type TableHeadProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Table header content
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Classes applied on the thead tag
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
} & ComponentPropsWithRef<'thead'>;
|
|
12
|
+
export declare const tableHeadStyle: import("@emotion/react").SerializedStyles;
|
|
13
|
+
export declare const TableHead: React.ForwardRefExoticComponent<Pick<TableHeadProps, "key" | "css" | keyof React.HTMLAttributes<HTMLTableSectionElement>> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
14
|
+
export default TableHead;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export declare type Alignment = 'left' | 'center' | 'right' | 'justify' | 'char';
|
|
3
|
+
export declare type TableHeaderCellProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Sets alignment for the content in the tag
|
|
6
|
+
*/
|
|
7
|
+
align?: Alignment;
|
|
8
|
+
/**
|
|
9
|
+
* Table cell content
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
} & ComponentPropsWithRef<'th'>;
|
|
13
|
+
export declare const getTableCellStyle: (align?: Alignment) => import("@emotion/react").SerializedStyles;
|
|
14
|
+
export declare const TableHeaderCell: React.ForwardRefExoticComponent<Pick<TableHeaderCellProps, "key" | "css" | keyof React.ThHTMLAttributes<HTMLTableHeaderCellElement>> & React.RefAttributes<HTMLTableCellElement>>;
|
|
15
|
+
export default TableHeaderCell;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export declare type TableRowProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Table row content
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Classes applied on the tr tag
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Applies Selected state styling to the row
|
|
13
|
+
*/
|
|
14
|
+
isSelected?: boolean;
|
|
15
|
+
} & ComponentPropsWithRef<'tr'>;
|
|
16
|
+
export declare const TableRow: React.ForwardRefExoticComponent<Pick<TableRowProps, "key" | "css" | keyof React.HTMLAttributes<HTMLTableRowElement> | "isSelected"> & React.RefAttributes<HTMLTableRowElement>>;
|
|
17
|
+
export default TableRow;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TippyProps } from '@tippy.js/react';
|
|
3
|
+
declare type Placement = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
declare type TooltipProps = {
|
|
5
|
+
content: string;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
offset?: number;
|
|
8
|
+
delay?: [number, number] | false;
|
|
9
|
+
containerProps?: any;
|
|
10
|
+
tabIndex?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const Tooltip: React.FC<TooltipProps>;
|
|
13
|
+
/**
|
|
14
|
+
* The `UnstableWithTooltip` component can be used to wrap an element with a tooltip but unlike the `Tooltip` component
|
|
15
|
+
* no extra html markup will wrapped around the targeted element.
|
|
16
|
+
*
|
|
17
|
+
* NOTE: It is important that the component being wrapped forwards a ref to the DOM node.
|
|
18
|
+
*/
|
|
19
|
+
export declare const UnstableWithTooltip: ({ delay, ...rest }: {
|
|
20
|
+
className?: string;
|
|
21
|
+
} & TippyProps) => JSX.Element;
|
|
22
|
+
export default Tooltip;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const headlineStyles: {
|
|
3
|
+
h1: import("@emotion/react").SerializedStyles;
|
|
4
|
+
h2: import("@emotion/react").SerializedStyles;
|
|
5
|
+
h3: import("@emotion/react").SerializedStyles;
|
|
6
|
+
h4: import("@emotion/react").SerializedStyles;
|
|
7
|
+
};
|
|
8
|
+
export declare const H1: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
as?: React.ElementType<any> | undefined;
|
|
11
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
12
|
+
as?: React.ElementType<any> | undefined;
|
|
13
|
+
noMargin?: boolean | undefined;
|
|
14
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
15
|
+
export declare const H2: import("@emotion/styled").StyledComponent<{
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
as?: React.ElementType<any> | undefined;
|
|
18
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
19
|
+
as?: React.ElementType<any> | undefined;
|
|
20
|
+
noMargin?: boolean | undefined;
|
|
21
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
22
|
+
export declare const H3: import("@emotion/styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: React.ElementType<any> | undefined;
|
|
25
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
26
|
+
as?: React.ElementType<any> | undefined;
|
|
27
|
+
noMargin?: boolean | undefined;
|
|
28
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
29
|
+
export declare const H4: import("@emotion/styled").StyledComponent<{
|
|
30
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
31
|
+
as?: React.ElementType<any> | undefined;
|
|
32
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
33
|
+
as?: React.ElementType<any> | undefined;
|
|
34
|
+
noMargin?: boolean | undefined;
|
|
35
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
36
|
+
export declare const Headline: React.FunctionComponent<{
|
|
37
|
+
as?: React.ElementType;
|
|
38
|
+
styledAs?: keyof typeof headlineStyles;
|
|
39
|
+
className?: string;
|
|
40
|
+
noMargin?: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const HeroHeadline: import("@emotion/styled").StyledComponent<{
|
|
43
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
44
|
+
as?: React.ElementType<any> | undefined;
|
|
45
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
46
|
+
as?: React.ElementType<any> | undefined;
|
|
47
|
+
noMargin?: boolean | undefined;
|
|
48
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
49
|
+
export declare const SectionHeadline: import("@emotion/styled").StyledComponent<{
|
|
50
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
51
|
+
as?: React.ElementType<any> | undefined;
|
|
52
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
53
|
+
as?: React.ElementType<any> | undefined;
|
|
54
|
+
noMargin?: boolean | undefined;
|
|
55
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
56
|
+
export declare const SubHeadline: import("@emotion/styled").StyledComponent<{
|
|
57
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
58
|
+
as?: React.ElementType<any> | undefined;
|
|
59
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
60
|
+
as?: React.ElementType<any> | undefined;
|
|
61
|
+
noMargin?: boolean | undefined;
|
|
62
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
63
|
+
export declare const SmallHeadline: import("@emotion/styled").StyledComponent<{
|
|
64
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
65
|
+
as?: React.ElementType<any> | undefined;
|
|
66
|
+
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | "css" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
|
|
67
|
+
as?: React.ElementType<any> | undefined;
|
|
68
|
+
noMargin?: boolean | undefined;
|
|
69
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const Text: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
3
|
+
as?: import("react").ElementType<any> | undefined;
|
|
4
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
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)."; }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Global, css } from '@emotion/react';
|
|
5
|
+
/**
|
|
6
|
+
* Minimal/modern CSS reset.
|
|
7
|
+
*
|
|
8
|
+
* Taken from: https://www.joshwcomeau.com/css/custom-css-reset/
|
|
9
|
+
*
|
|
10
|
+
* TODO: Include this in the GlobalStyles component when adapted and tested in solutions.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
+
|
|
15
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
16
|
+
name: "6jhwm5",
|
|
17
|
+
styles: "*,*::before,*::after{box-sizing:border-box;}*{margin:0;}html,body{height:100%;}body{-webkit-font-smoothing:antialiased;}img,picture,video,canvas,svg{display:block;max-width:100%;}input,button,textarea,select{font:inherit;}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;}"
|
|
18
|
+
} : {
|
|
19
|
+
name: "1dzedxz-ResetStyles",
|
|
20
|
+
styles: "*,*::before,*::after{box-sizing:border-box;}*{margin:0;}html,body{height:100%;}body{-webkit-font-smoothing:antialiased;}img,picture,video,canvas,svg{display:block;max-width:100%;}input,button,textarea,select{font:inherit;}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;};label:ResetStyles;",
|
|
21
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nbG9iYWwtc3R5bGVzL1Jlc2V0U3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjaUIiLCJmaWxlIjoiLi4vLi4vc3JjL2dsb2JhbC1zdHlsZXMvUmVzZXRTdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0J1xuXG5pbXBvcnQgeyBHbG9iYWwsIGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuXG4vKipcbiAqIE1pbmltYWwvbW9kZXJuIENTUyByZXNldC5cbiAqXG4gKiBUYWtlbiBmcm9tOiBodHRwczovL3d3dy5qb3Nod2NvbWVhdS5jb20vY3NzL2N1c3RvbS1jc3MtcmVzZXQvXG4gKlxuICogVE9ETzogSW5jbHVkZSB0aGlzIGluIHRoZSBHbG9iYWxTdHlsZXMgY29tcG9uZW50IHdoZW4gYWRhcHRlZCBhbmQgdGVzdGVkIGluIHNvbHV0aW9ucy5cbiAqL1xuZXhwb3J0IGNvbnN0IFJlc2V0U3R5bGVzID0gKCkgPT4ge1xuICByZXR1cm4gKFxuICAgIDxHbG9iYWxcbiAgICAgIHN0eWxlcz17Y3NzYFxuICAgICAgICAvKlxuICAgICAgICAgIDEuIFVzZSBhIG1vcmUtaW50dWl0aXZlIGJveC1zaXppbmcgbW9kZWwuXG4gICAgICAgICovXG4gICAgICAgICosXG4gICAgICAgICo6OmJlZm9yZSxcbiAgICAgICAgKjo6YWZ0ZXIge1xuICAgICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgIH1cbiAgICAgICAgLypcbiAgICAgICAgICAyLiBSZW1vdmUgZGVmYXVsdCBtYXJnaW5cbiAgICAgICAgKi9cbiAgICAgICAgKiB7XG4gICAgICAgICAgbWFyZ2luOiAwO1xuICAgICAgICB9XG4gICAgICAgIC8qXG4gICAgICAgICAgMy4gQWxsb3cgcGVyY2VudGFnZS1iYXNlZCBoZWlnaHRzIGluIHRoZSBhcHBsaWNhdGlvblxuICAgICAgICAqL1xuICAgICAgICBodG1sLFxuICAgICAgICBib2R5IHtcbiAgICAgICAgICBoZWlnaHQ6IDEwMCU7XG4gICAgICAgIH1cbiAgICAgICAgLypcbiAgICAgICAgICBUeXBvZ3JhcGhpYyB0d2Vha3MhXG4gICAgICAgICAgNC4gQWRkIGFjY2Vzc2libGUgbGluZS1oZWlnaHRcbiAgICAgICAgICA1LiBJbXByb3ZlIHRleHQgcmVuZGVyaW5nXG4gICAgICAgICovXG4gICAgICAgIGJvZHkge1xuICAgICAgICAgIC8qIFRPRE86IEV2YWx1YXRlIGltcGxpY2F0aW9ucyBvZiBlbmFibGluZyB0aGlzIGxpbmUtaGVpZ2h0IGNoYW5nZSAqL1xuICAgICAgICAgIC8qIGxpbmUtaGVpZ2h0OiAxLjU7ICovXG4gICAgICAgICAgLXdlYmtpdC1mb250LXNtb290aGluZzogYW50aWFsaWFzZWQ7XG4gICAgICAgIH1cbiAgICAgICAgLypcbiAgICAgICAgICA2LiBJbXByb3ZlIG1lZGlhIGRlZmF1bHRzXG4gICAgICAgICovXG4gICAgICAgIGltZyxcbiAgICAgICAgcGljdHVyZSxcbiAgICAgICAgdmlkZW8sXG4gICAgICAgIGNhbnZhcyxcbiAgICAgICAgc3ZnIHtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgICBtYXgtd2lkdGg6IDEwMCU7XG4gICAgICAgIH1cbiAgICAgICAgLypcbiAgICAgICAgICA3LiBSZW1vdmUgYnVpbHQtaW4gZm9ybSB0eXBvZ3JhcGh5IHN0eWxlc1xuICAgICAgICAqL1xuICAgICAgICBpbnB1dCxcbiAgICAgICAgYnV0dG9uLFxuICAgICAgICB0ZXh0YXJlYSxcbiAgICAgICAgc2VsZWN0IHtcbiAgICAgICAgICBmb250OiBpbmhlcml0O1xuICAgICAgICB9XG4gICAgICAgIC8qXG4gICAgICAgICAgOC4gQXZvaWQgdGV4dCBvdmVyZmxvd3NcbiAgICAgICAgKi9cbiAgICAgICAgcCxcbiAgICAgICAgaDEsXG4gICAgICAgIGgyLFxuICAgICAgICBoMyxcbiAgICAgICAgaDQsXG4gICAgICAgIGg1LFxuICAgICAgICBoNiB7XG4gICAgICAgICAgb3ZlcmZsb3ctd3JhcDogYnJlYWstd29yZDtcbiAgICAgICAgfVxuICAgICAgYH1cbiAgICAvPlxuICApXG59XG4iXX0= */",
|
|
22
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export var ResetStyles = function ResetStyles() {
|
|
26
|
+
return ___EmotionJSX(Global, {
|
|
27
|
+
styles: _ref
|
|
28
|
+
});
|
|
29
|
+
};
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as elevation } from './elevation';
|
|
2
2
|
export { default as media } from './media';
|
|
3
|
+
export { ResetStyles } from './global-styles/ResetStyles';
|
|
3
4
|
export { GlobalStyles, DfdsFontFace } from './global-styles/GlobalStyles';
|
|
4
5
|
export * from './accordion';
|
|
5
6
|
export * from './app-bar';
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as elevation } from './elevation';
|
|
2
2
|
export { default as media } from './media';
|
|
3
|
+
export { ResetStyles } from './global-styles/ResetStyles';
|
|
3
4
|
export { GlobalStyles, DfdsFontFace } from './global-styles/GlobalStyles';
|
|
4
5
|
export * from './accordion';
|
|
5
6
|
export * from './app-bar';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Shared react components within DFDS",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "0.9.11-alpha.
|
|
6
|
+
"version": "0.9.11-alpha.d0bfdd42",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"main": "./cjs/index.js",
|
|
9
9
|
"module": "./index.js",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"react-select": "^4.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dfds-ui/colors": "0.9.11-alpha.
|
|
22
|
-
"@dfds-ui/fonts": "0.9.11-alpha.
|
|
23
|
-
"@dfds-ui/hooks": "0.9.11-alpha.
|
|
24
|
-
"@dfds-ui/icons": "0.9.11-alpha.
|
|
25
|
-
"@dfds-ui/spacing": "0.9.11-alpha.
|
|
26
|
-
"@dfds-ui/theme": "0.9.11-alpha.
|
|
27
|
-
"@dfds-ui/typography": "0.9.11-alpha.
|
|
21
|
+
"@dfds-ui/colors": "0.9.11-alpha.d0bfdd42",
|
|
22
|
+
"@dfds-ui/fonts": "0.9.11-alpha.d0bfdd42",
|
|
23
|
+
"@dfds-ui/hooks": "0.9.11-alpha.d0bfdd42",
|
|
24
|
+
"@dfds-ui/icons": "0.9.11-alpha.d0bfdd42",
|
|
25
|
+
"@dfds-ui/spacing": "0.9.11-alpha.d0bfdd42",
|
|
26
|
+
"@dfds-ui/theme": "0.9.11-alpha.d0bfdd42",
|
|
27
|
+
"@dfds-ui/typography": "0.9.11-alpha.d0bfdd42",
|
|
28
28
|
"@kunukn/react-collapse": "^2.2.9",
|
|
29
29
|
"@material-ui/core": "^4.12.3",
|
|
30
30
|
"@material-ui/lab": "4.0.0-alpha.60",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react-hook-intersection-observer": "^0.1.0",
|
|
35
35
|
"uuid": "^3.3.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "d0bfdd42d757f2f255a6c71cfee953dbfa3a8f3e",
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
}
|
package/stepper/Step.d.ts
CHANGED
|
@@ -1,41 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
index: number;
|
|
4
|
-
active?: boolean;
|
|
5
|
-
completed?: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
editable?: boolean;
|
|
8
|
-
};
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ListItemProps } from './../lists/ListItem';
|
|
9
3
|
declare type StepProps = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
index: number;
|
|
14
|
-
/**
|
|
15
|
-
* Step label
|
|
16
|
-
*/
|
|
17
|
-
label?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Active step
|
|
20
|
-
*/
|
|
21
|
-
active?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Optional step
|
|
24
|
-
*/
|
|
25
|
-
optional?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Completed step
|
|
28
|
-
*/
|
|
29
|
-
completed?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Disabled step
|
|
32
|
-
*/
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* editable step
|
|
36
|
-
*/
|
|
37
|
-
editable?: boolean;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
listItemProps?: ListItemProps;
|
|
38
7
|
};
|
|
39
|
-
export declare const StepContext: React.Context<StepContextType>;
|
|
40
8
|
declare const _default: React.NamedExoticComponent<StepProps>;
|
|
41
9
|
export default _default;
|
package/stepper/Step.js
CHANGED
|
@@ -1,70 +1,76 @@
|
|
|
1
|
-
var _excluded = ["
|
|
1
|
+
var _excluded = ["children", "label", "listItemProps"];
|
|
2
2
|
|
|
3
3
|
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); }
|
|
4
4
|
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
|
|
7
|
+
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."); }
|
|
8
|
+
|
|
9
|
+
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); }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
|
|
5
17
|
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; }
|
|
6
18
|
|
|
7
19
|
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; }
|
|
8
20
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
21
|
+
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)."; }
|
|
22
|
+
|
|
23
|
+
import React, { useEffect, useState, memo } from 'react';
|
|
24
|
+
import { css } from '@emotion/react';
|
|
25
|
+
import { Step as StepWrapper, StepContent } from '@material-ui/core';
|
|
26
|
+
import { useStepperContext } from './Stepper';
|
|
27
|
+
import ListItem from './../lists/ListItem';
|
|
28
|
+
import uuid from 'uuid/v4';
|
|
29
|
+
import { theme } from '@dfds-ui/theme';
|
|
14
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
completed: completed,
|
|
59
|
-
disabled: disabled,
|
|
60
|
-
editable: editable
|
|
61
|
-
};
|
|
62
|
-
}, [index, active, completed, disabled, editable]);
|
|
63
|
-
return ___EmotionJSX(StepContext.Provider, {
|
|
64
|
-
value: contextValue
|
|
65
|
-
}, ___EmotionJSX("div", _extends({
|
|
66
|
-
css: stepWrapperStyles
|
|
67
|
-
}, props), ___EmotionJSX(StepButton, null), label && ___EmotionJSX(StepLabel, null, label)));
|
|
31
|
+
|
|
32
|
+
var listItemStyles = function listItemStyles(_ref) {
|
|
33
|
+
var isActive = _ref.isActive;
|
|
34
|
+
return /*#__PURE__*/css("background-color:", isActive ? theme.colors.secondary.light : theme.colors.surface.secondary, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:listItemStyles;"), process.env.NOD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Il19 */");
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var stepContentStyles = process.env.NODE_ENV === "production" ? {
|
|
38
|
+
name: "1nyoacf",
|
|
39
|
+
styles: ".MuiStepContent-root{border:none;margin:0px;padding:0px;}"
|
|
40
|
+
} : {
|
|
41
|
+
name: "ndmke3-stepContentStyles",
|
|
42
|
+
styles: ".MuiStepContent-root{border:none;margin:0px;padding:0px;};label:stepContentStyles;",
|
|
43
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdGVwcGVyL1N0ZXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWU2QiIsImZpbGUiOiIuLi8uLi9zcmMvc3RlcHBlci9TdGVwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUsIEZ1bmN0aW9uQ29tcG9uZW50LCB1c2VFZmZlY3QsIHVzZVN0YXRlLCBtZW1vIH0gZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IFN0ZXAgYXMgU3RlcFdyYXBwZXIsIFN0ZXBDb250ZW50IH0gZnJvbSAnQG1hdGVyaWFsLXVpL2NvcmUnXG5pbXBvcnQgeyB1c2VTdGVwcGVyQ29udGV4dCB9IGZyb20gJy4vU3RlcHBlcidcbmltcG9ydCBMaXN0SXRlbSwgeyBMaXN0SXRlbVByb3BzIH0gZnJvbSAnLi8uLi9saXN0cy9MaXN0SXRlbSdcbmltcG9ydCB1dWlkIGZyb20gJ3V1aWQvdjQnXG5pbXBvcnQgeyB0aGVtZSB9IGZyb20gJ0BkZmRzLXVpL3RoZW1lJ1xuXG50eXBlIFN0ZXBQcm9wcyA9IHsgbGFiZWw6IFJlYWN0Tm9kZTsgY2hpbGRyZW46IFJlYWN0Tm9kZTsgbGlzd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dHlsZXMoeyBpc0FjdGl2ZSB9KX0gey4uLmxpc3RJdGVtUHJvcHN9PlxuICAgICAgICB7bGFiZWx9XG4gICAgICA8L0xpc3RJdGVtPlxuICAgICAgPFN0ZXBDb250ZW50PntjaGlsZHJlbn08L1N0ZXBDb250ZW50PlxuICAgIDwvU3RlcFdyYXBwZXI+XG4gIClcbn1cblxuZXhwb3J0IGRlZmF1bHQgbWVtbyhTdGVwKVxuIl19 */",
|
|
44
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var Step = function Step(_ref2) {
|
|
48
|
+
var children = _ref2.children,
|
|
49
|
+
label = _ref2.label,
|
|
50
|
+
listItemProps = _ref2.listItemProps,
|
|
51
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
52
|
+
|
|
53
|
+
var _useState = useState(uuid()),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
55
|
+
stepId = _useState2[0];
|
|
56
|
+
|
|
57
|
+
var _useStepperContext = useStepperContext(),
|
|
58
|
+
setStep = _useStepperContext.setStep,
|
|
59
|
+
activeStep = _useStepperContext.activeStep;
|
|
60
|
+
|
|
61
|
+
var isActive = stepId === activeStep; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
+
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
return setStep(stepId);
|
|
65
|
+
}, []);
|
|
66
|
+
return ___EmotionJSX(StepWrapper, _extends({}, props, {
|
|
67
|
+
css: stepContentStyles
|
|
68
|
+
}), ___EmotionJSX(ListItem, _extends({
|
|
69
|
+
as: "div",
|
|
70
|
+
css: listItemStyles({
|
|
71
|
+
isActive: isActive
|
|
72
|
+
})
|
|
73
|
+
}, listItemProps), label), ___EmotionJSX(StepContent, null, children));
|
|
68
74
|
};
|
|
69
75
|
|
|
70
76
|
export default /*#__PURE__*/memo(Step);
|