@nulogy/components 11.0.0 → 11.2.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 +6745 -3176
- package/dist/main.module.js +6802 -3235
- package/dist/src/BottomSheet/BottomSheet.d.ts +22 -0
- package/dist/src/BottomSheet/BottomSheet.parts.d.ts +44 -0
- package/dist/src/BottomSheet/BottomSheet.styled.d.ts +38 -0
- package/dist/src/BottomSheet/BottomSheetProvider.d.ts +12 -0
- package/dist/src/BottomSheet/index.d.ts +3 -0
- package/dist/src/BottomSheet/stories/BottomSheet.actions.story.d.ts +13 -0
- package/dist/src/BottomSheet/stories/BottomSheet.content.story.d.ts +13 -0
- package/dist/src/BottomSheet/stories/BottomSheet.features.story.d.ts +14 -0
- package/dist/src/BottomSheet/stories/BottomSheet.parts.story.d.ts +12 -0
- package/dist/src/BottomSheet/stories/BottomSheet.story.d.ts +12 -0
- package/dist/src/BrandedNavBar/NavBarBackground.d.ts +1 -1
- package/dist/src/Button/Button.d.ts +3 -2
- package/dist/src/Button/ControlIcon.d.ts +2 -1
- package/dist/src/Button/IconicButton.d.ts +2 -1
- package/dist/src/Checkbox/Checkbox.d.ts +1 -1
- package/dist/src/DatePicker/DatePickerStyles.d.ts +1 -1
- package/dist/src/Divider/Divider.d.ts +4 -1
- package/dist/src/Divider/Divider.story.d.ts +2 -1
- package/dist/src/DropdownMenu/DropdownButton.d.ts +1 -1
- package/dist/src/DropdownMenu/DropdownMenuContainer.d.ts +1 -1
- package/dist/src/FieldLabel/FramedIcon.d.ts +2 -1
- package/dist/src/Icon/Icon.d.ts +2 -1
- package/dist/src/Input/InputField.d.ts +3 -2
- package/dist/src/Link/Link.d.ts +9 -1
- package/dist/src/Modal/ModalContent.d.ts +1 -1
- package/dist/src/Modal/ModalHeader.d.ts +1 -1
- package/dist/src/NDSProvider/ComponentVariantContext.d.ts +1 -1
- package/dist/src/NDSProvider/FeatureFlagsContext.d.ts +11 -0
- package/dist/src/NDSProvider/GlobalStyles.d.ts +1 -1
- package/dist/src/NDSProvider/GlobalStylesComposer.d.ts +1 -1
- package/dist/src/NDSProvider/NDSProvider.d.ts +4 -2
- package/dist/src/Select/Select.story.d.ts +1 -0
- package/dist/src/Select/customReactSelectStyles.d.ts +2 -2
- package/dist/src/StyledProps/index.d.ts +5 -1
- package/dist/src/Textarea/StyledTextarea.d.ts +1 -1
- package/dist/src/Toggle/Toggle.d.ts +1 -1
- package/dist/src/Toggle/ToggleButton.d.ts +1 -1
- package/dist/src/Tooltip/Tooltip.story.d.ts +1 -0
- package/dist/src/Tooltip/TooltipContainer.d.ts +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/theme/NDSThemeProvider.d.ts +5 -0
- package/dist/src/theme/index.d.ts +2 -0
- package/dist/src/{NDSProvider → theme}/mergeThemes.util.d.ts +1 -1
- package/dist/src/theme/theme.d.ts +5 -0
- package/dist/src/{theme.type.d.ts → theme/theme.type.d.ts} +10 -2
- package/dist/src/{NDSProvider → theme}/useNDSTheme.d.ts +4 -3
- package/dist/src/utils/noop.d.ts +5 -0
- package/dist/src/utils/story/dashed.d.ts +9 -0
- package/dist/src/utils/story/placeholder.d.ts +7 -0
- package/package.json +6 -4
- package/dist/src/VisualTests/KitchenSink.story.d.ts +0 -6
- package/dist/src/theme.d.ts +0 -5
- package/dist/src/utils/DeprecatedComponent.d.ts +0 -2
- package/dist/src/utils/conditionallyRequiredProp.d.ts +0 -1
- package/dist/src/utils/dashed.d.ts +0 -9
- package/dist/src/utils/deprecatedProp.d.ts +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { WidthProps } from "styled-system";
|
|
3
|
+
export interface Props {
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
title?: string;
|
|
8
|
+
helpText?: React.ReactNode;
|
|
9
|
+
closeButtonLabel?: string;
|
|
10
|
+
hideCloseButton?: boolean;
|
|
11
|
+
secondaryAction?: (props: {
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}) => React.ReactElement;
|
|
14
|
+
primaryAction?: (props: {
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
}) => React.ReactElement;
|
|
17
|
+
disableCloseOnOverlayClick?: boolean;
|
|
18
|
+
sheetWidth?: WidthProps["width"];
|
|
19
|
+
contentWidth?: WidthProps["width"];
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export default function BottomSheet({ title, helpText, closeButtonLabel, secondaryAction, primaryAction, isOpen, onClose, sheetWidth, contentWidth, disableCloseOnOverlayClick, hideCloseButton, children, ...props }: Props): React.JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DialogContentProps, DialogOverlayProps } from "@reach/dialog";
|
|
2
|
+
import { AnimatePresenceProps } from "framer-motion";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { HeightProps, LayoutProps, MaxHeightProps, MaxWidthProps, SpaceProps, WidthProps } from "styled-system";
|
|
5
|
+
interface RootProps extends AnimatePresenceProps {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function Root({ isOpen, onClose, children, ...props }: RootProps): React.JSX.Element;
|
|
11
|
+
interface OverlayPartProps extends DialogOverlayProps {
|
|
12
|
+
closeOnClick?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function OverlayPart({ closeOnClick, children, ...props }: OverlayPartProps): React.JSX.Element;
|
|
15
|
+
interface SheetPartProps extends DialogContentProps, WidthProps, MaxWidthProps, HeightProps, MaxHeightProps, SpaceProps, LayoutProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
"aria-label": string;
|
|
18
|
+
}
|
|
19
|
+
declare function SheetPart({ children, ...props }: SheetPartProps): React.JSX.Element;
|
|
20
|
+
export declare const BottomSheetParts: {
|
|
21
|
+
Root: typeof Root;
|
|
22
|
+
Overlay: typeof OverlayPart;
|
|
23
|
+
Sheet: typeof SheetPart;
|
|
24
|
+
ContentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
25
|
+
Header: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
26
|
+
Title: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, React.HTMLAttributes<HTMLParagraphElement> & {
|
|
27
|
+
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
28
|
+
inline?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
textTransform?: "initial" | "-moz-initial" | "inherit" | "revert" | "unset" | "none" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase";
|
|
31
|
+
fontSize?: string;
|
|
32
|
+
} & import("..").StyledProps & {
|
|
33
|
+
as: string;
|
|
34
|
+
}, "as">;
|
|
35
|
+
HelpText: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, React.HTMLAttributes<HTMLParagraphElement> & {
|
|
36
|
+
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
37
|
+
inline?: boolean;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
textTransform?: "initial" | "-moz-initial" | "inherit" | "revert" | "unset" | "none" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase";
|
|
40
|
+
fontSize?: string;
|
|
41
|
+
} & import("..").StyledProps, never>;
|
|
42
|
+
Footer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DialogContentProps } from "@reach/dialog";
|
|
3
|
+
import type { AnimationProps } from "framer-motion";
|
|
4
|
+
import type { HeightProps, LayoutProps, MaxHeightProps, MaxWidthProps, SpaceProps, WidthProps } from "styled-system";
|
|
5
|
+
declare const Overlay: import("styled-components").StyledComponent<import("framer-motion").CustomDomComponent<import("@reach/utils/dist/declarations/src/polymorphic").Merge<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
+
ref?: import("react").Ref<HTMLDivElement>;
|
|
7
|
+
}, import("@reach/dialog/dist/declarations/src").DialogOverlayProps & {
|
|
8
|
+
as?: "div";
|
|
9
|
+
}>>, import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
interface SheetProps extends DialogContentProps, AnimationProps, WidthProps, MaxWidthProps, HeightProps, MaxHeightProps, SpaceProps, LayoutProps {
|
|
11
|
+
}
|
|
12
|
+
declare const Sheet: import("styled-components").StyledComponent<import("framer-motion").CustomDomComponent<import("@reach/utils/dist/declarations/src/polymorphic").Merge<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
|
+
ref?: import("react").Ref<HTMLDivElement>;
|
|
14
|
+
}, DialogContentProps & {
|
|
15
|
+
as?: "div";
|
|
16
|
+
}>>, import("styled-components").DefaultTheme, {
|
|
17
|
+
[x: string]: {};
|
|
18
|
+
} & SheetProps, never>;
|
|
19
|
+
declare const ContentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
declare const Footer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
+
declare const Header: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
22
|
+
declare const Title: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, import("react").HTMLAttributes<HTMLParagraphElement> & {
|
|
23
|
+
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
24
|
+
inline?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
textTransform?: "initial" | "inherit" | "-moz-initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
|
|
27
|
+
fontSize?: string;
|
|
28
|
+
} & import("../StyledProps").StyledProps & {
|
|
29
|
+
as: string;
|
|
30
|
+
}, "as">;
|
|
31
|
+
declare const HelpText: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, import("react").HTMLAttributes<HTMLParagraphElement> & {
|
|
32
|
+
variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
|
|
33
|
+
inline?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
textTransform?: "initial" | "inherit" | "-moz-initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
|
|
36
|
+
fontSize?: string;
|
|
37
|
+
} & import("../StyledProps").StyledProps, never>;
|
|
38
|
+
export { Overlay, Sheet, ContentContainer, Footer, Header, Title, HelpText };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface BottomSheetContextType {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare function useBottomSheet(): BottomSheetContextType;
|
|
7
|
+
declare function BottomSheetProvider({ isOpen, onClose, children, }: {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
export { BottomSheetProvider, useBottomSheet };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => React.JSX.Element)[];
|
|
5
|
+
parameters: {
|
|
6
|
+
chromatic: {
|
|
7
|
+
delay: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const WithAHiddenCloseButton: () => React.JSX.Element;
|
|
13
|
+
export declare const WithButtons: () => React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => React.JSX.Element)[];
|
|
5
|
+
parameters: {
|
|
6
|
+
chromatic: {
|
|
7
|
+
delay: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const WithHelpText: () => React.JSX.Element;
|
|
13
|
+
export declare const WithHelpContent: () => React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => React.JSX.Element)[];
|
|
5
|
+
parameters: {
|
|
6
|
+
chromatic: {
|
|
7
|
+
delay: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const WithCustomWidths: () => React.JSX.Element;
|
|
13
|
+
export declare const DisableCloseOnOverlayClick: () => React.JSX.Element;
|
|
14
|
+
export declare const AdvancedUsage: () => React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => React.JSX.Element)[];
|
|
5
|
+
parameters: {
|
|
6
|
+
chromatic: {
|
|
7
|
+
delay: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const RenderedUsingCompositionalAPI: () => React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: ((storyFn: any) => React.JSX.Element)[];
|
|
5
|
+
parameters: {
|
|
6
|
+
chromatic: {
|
|
7
|
+
delay: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const BasicUsage: () => React.JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { IconName } from "@nulogy/icons";
|
|
2
3
|
import { SpaceProps } from "styled-system";
|
|
3
|
-
import { DefaultNDSThemeType } from "../theme
|
|
4
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
4
5
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
5
6
|
export type ButtonProps = SpaceProps & React.ComponentPropsWithRef<"button"> & {
|
|
6
7
|
className?: string;
|
|
7
|
-
icon?:
|
|
8
|
+
icon?: IconName | "loading";
|
|
8
9
|
iconSide?: "left" | "right";
|
|
9
10
|
size?: "small" | "medium";
|
|
10
11
|
variant?: ComponentVariant;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { IconName } from "@nulogy/icons";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { LayoutProps, SpaceProps } from "styled-system";
|
|
3
4
|
type ControlIconProps = React.ComponentPropsWithRef<"button"> & SpaceProps & LayoutProps & {
|
|
4
5
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
5
|
-
icon:
|
|
6
|
+
icon: IconName | "loading";
|
|
6
7
|
toggled?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
size?: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
|
+
import { IconName } from "@nulogy/icons";
|
|
3
4
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
4
5
|
interface BaseProps {
|
|
5
6
|
variant?: ComponentVariant;
|
|
6
7
|
color?: string;
|
|
7
8
|
labelHidden?: boolean;
|
|
8
|
-
icon?:
|
|
9
|
+
icon?: IconName | "loading";
|
|
9
10
|
iconSize?: string;
|
|
10
11
|
hoverBackgroundColor?: string;
|
|
11
12
|
fontSize?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
|
-
import { DefaultNDSThemeType } from "../theme
|
|
3
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
4
4
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
5
5
|
type NativeInputProps = Omit<React.ComponentPropsWithRef<"input">, "size">;
|
|
6
6
|
type CheckboxProps = NativeInputProps & SpaceProps & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultNDSThemeType } from "../theme
|
|
1
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
2
2
|
export declare const DatePickerStyles: import("styled-components").GlobalStyleComponent<{
|
|
3
3
|
theme: DefaultNDSThemeType;
|
|
4
4
|
}, import("styled-components").DefaultTheme>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { StyledProps } from "../StyledProps";
|
|
2
|
-
|
|
2
|
+
export interface DividerProps extends StyledProps, React.HTMLAttributes<HTMLHRElement> {
|
|
3
|
+
secondary?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const Divider: import("styled-components").StyledComponent<"hr", import("styled-components").DefaultTheme, DividerProps, never>;
|
|
3
6
|
export default Divider;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("styled-components").StyledComponent<"
|
|
4
|
+
component: import("styled-components").StyledComponent<"hr", import("styled-components").DefaultTheme, import("./Divider").DividerProps, never>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const Default: () => React.JSX.Element;
|
|
8
|
+
export declare const Secondary: () => React.JSX.Element;
|
|
8
9
|
export declare const WithCustomColourAndSpacing: () => React.JSX.Element;
|
|
9
10
|
export declare const WithCustomProperties: () => React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DefaultNDSThemeType } from "../theme
|
|
2
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
3
3
|
import { StyledProps } from "../StyledProps";
|
|
4
4
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
5
5
|
declare const DropdownButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
|
+
import { IconName } from "@nulogy/icons";
|
|
2
3
|
interface FramedIconProps extends React.ComponentPropsWithoutRef<"svg"> {
|
|
3
4
|
iconSize: string;
|
|
4
|
-
icon:
|
|
5
|
+
icon: IconName | "loading";
|
|
5
6
|
focusable?: boolean;
|
|
6
7
|
maxWidth?: string;
|
|
7
8
|
tooltip?: string | ReactElement;
|
package/dist/src/Icon/Icon.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { IconName } from "@nulogy/icons";
|
|
2
3
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
3
4
|
type NativeInputProps = Omit<React.ComponentPropsWithRef<"input">, "size" | "height" | "width">;
|
|
4
5
|
export interface InputFieldProps extends NativeInputProps {
|
|
5
6
|
htmlSize?: number;
|
|
6
7
|
variant?: ComponentVariant;
|
|
7
|
-
iconRight?:
|
|
8
|
-
iconLeft?:
|
|
8
|
+
iconRight?: IconName | "loading";
|
|
9
|
+
iconLeft?: IconName | "loading";
|
|
9
10
|
iconRightSize?: string;
|
|
10
11
|
iconLeftSize?: string;
|
|
11
12
|
error?: boolean;
|
package/dist/src/Link/Link.d.ts
CHANGED
|
@@ -8,5 +8,13 @@ export type LinkProps = React.ComponentPropsWithRef<"a"> & Partial<StyledProps>
|
|
|
8
8
|
to?: string;
|
|
9
9
|
as?: React.ElementType | string;
|
|
10
10
|
};
|
|
11
|
-
declare const Link:
|
|
11
|
+
declare const Link: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
12
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
13
|
+
} & Partial<StyledProps> & {
|
|
14
|
+
underline?: boolean;
|
|
15
|
+
hover?: string;
|
|
16
|
+
variant?: ComponentVariant;
|
|
17
|
+
to?: string;
|
|
18
|
+
as?: React.ElementType | string;
|
|
19
|
+
}, never>;
|
|
12
20
|
export default Link;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultNDSThemeType } from "../theme
|
|
1
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
2
2
|
declare const ModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
3
|
hasCloseButton?: boolean;
|
|
4
4
|
theme?: DefaultNDSThemeType;
|
|
@@ -4,7 +4,7 @@ type ComponentVariantContextValue = {
|
|
|
4
4
|
variant: ComponentVariant;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export default function ComponentVariantContextProvider({ variant, children }: ComponentVariantContextValue): React.JSX.Element;
|
|
8
7
|
export declare const ComponentVariantContext: React.Context<ComponentVariantContextValue>;
|
|
8
|
+
export default function ComponentVariantContextProvider({ variant, children }: ComponentVariantContextValue): React.JSX.Element;
|
|
9
9
|
export declare function useComponentVariant(selectedVariant?: ComponentVariant): ComponentVariant;
|
|
10
10
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface FeatureFlags {
|
|
3
|
+
experimentalDesktopTypographyScale?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface FeatureFlagsContextValue {
|
|
6
|
+
featureFlags: FeatureFlags;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const FeatureFlagsContext: React.Context<FeatureFlagsContextValue>;
|
|
10
|
+
export default function FeatureFlagsProvider({ featureFlags, children }: FeatureFlagsContextValue): React.JSX.Element;
|
|
11
|
+
export declare function useFeatureFlags(): FeatureFlags;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ThemeType } from "../theme
|
|
2
|
+
import { ThemeType } from "../theme";
|
|
3
3
|
import { ComponentVariant } from "./ComponentVariantContext";
|
|
4
|
+
import { FeatureFlags } from "./FeatureFlagsContext";
|
|
4
5
|
type NDSProviderProps = {
|
|
5
6
|
theme?: ThemeType;
|
|
6
7
|
locale?: string;
|
|
7
8
|
disableGlobalStyles?: boolean;
|
|
8
9
|
children?: React.ReactNode;
|
|
9
10
|
variant?: ComponentVariant;
|
|
11
|
+
featureFlags?: FeatureFlags;
|
|
10
12
|
};
|
|
11
|
-
declare function NDSProvider({ theme: customTheme, children, disableGlobalStyles, locale, variant, }: NDSProviderProps): React.JSX.Element;
|
|
13
|
+
declare function NDSProvider({ theme: customTheme, children, disableGlobalStyles, locale, variant, featureFlags, }: NDSProviderProps): React.JSX.Element;
|
|
12
14
|
export default NDSProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CSSObject } from "styled-components";
|
|
2
2
|
import type { GroupBase, MenuPlacement, StylesConfig } from "react-select";
|
|
3
3
|
import type { CSSProperties } from "react";
|
|
4
|
-
import type { DefaultNDSThemeType } from "../theme
|
|
4
|
+
import type { DefaultNDSThemeType } from "../theme";
|
|
5
5
|
import type { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
6
6
|
type Placement = "top" | "bottom";
|
|
7
7
|
export declare function getControlBorderRadius({ border, isMenuOpen, menuLength, menuPlacement, theme, }: {
|
|
@@ -20,7 +20,7 @@ export declare function getMenuBorderRadius({ border, menuPlacement, theme, }: {
|
|
|
20
20
|
style: CSSProperties["borderBottomStyle"];
|
|
21
21
|
};
|
|
22
22
|
type VariantConfig = {
|
|
23
|
-
[key in ComponentVariant]
|
|
23
|
+
[key in ComponentVariant]?: CSSObject;
|
|
24
24
|
};
|
|
25
25
|
export declare function stylesForVariant(config: VariantConfig, variant?: ComponentVariant): CSSObject;
|
|
26
26
|
export declare function showIndicatorSeparator({ hasValue, isClearable, isMulti }: {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { styleFn, variant as styledSystemVariant } from "styled-system";
|
|
1
2
|
import type { SpaceProps, PaddingProps, MarginProps, WidthProps, FontSizeProps, FontFamilyProps, TextAlignProps, LineHeightProps, FontWeightProps, FontStyleProps, LetterSpacingProps, DisplayProps, MaxWidthProps, MinWidthProps, HeightProps, MaxHeightProps, MinHeightProps, SizeProps, VerticalAlignProps, AlignItemsProps, AlignContentProps, JustifyItemsProps, JustifyContentProps, FlexWrapProps, FlexBasisProps, FlexDirectionProps, FlexProps, JustifySelfProps, AlignSelfProps, OrderProps, GridGapProps, GridColumnGapProps, GridRowGapProps, GridColumnProps, GridRowProps, GridAutoFlowProps, GridAutoColumnsProps, GridAutoRowsProps, GridTemplateColumnsProps, GridTemplateRowsProps, GridTemplateAreasProps, GridAreaProps, BorderProps, BorderTopProps, BorderRightProps, BorderBottomProps, BorderLeftProps, BordersProps, BorderColorProps, BorderRadiusProps, BoxShadowProps, OpacityProps, OverflowProps, BackgroundProps, BackgroundImageProps, BackgroundPositionProps, BackgroundRepeatProps, BackgroundSizeProps, PositionProps, ZIndexProps, TopProps, RightProps, BottomProps, LeftProps, TextStyleProps, ColorStyleProps, ButtonStyleProps, FlexboxProps, GridProps, BackgroundColorProps, FlexGrowProps, TypographyProps, LayoutProps } from "styled-system";
|
|
2
3
|
import { CSSProperties } from "react";
|
|
3
|
-
export declare
|
|
4
|
+
export declare function getStyledPropNames(...styleFns: styleFn[]): string[];
|
|
5
|
+
export declare const excludeStyledProps: (...styleFns: styleFn[]) => (prop: string | number) => boolean;
|
|
6
|
+
export declare const variant: typeof styledSystemVariant;
|
|
7
|
+
export declare const addStyledProps: styleFn;
|
|
4
8
|
interface TransitionProps {
|
|
5
9
|
transition?: CSSProperties["transition"];
|
|
6
10
|
transitionDelay?: CSSProperties["transitionDelay"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
|
-
import { DefaultNDSThemeType } from "../theme
|
|
3
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
4
4
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
5
5
|
export type StyledTextareaProps = React.ComponentPropsWithRef<"textarea"> & SpaceProps & {
|
|
6
6
|
variant?: ComponentVariant;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
3
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
4
|
-
import { DefaultNDSThemeType } from "../theme
|
|
4
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
5
5
|
declare const ToggleComponent: React.ForwardRefExoticComponent<SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
|
6
6
|
onChange?: (...args: any[]) => any;
|
|
7
7
|
variant?: ComponentVariant;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PositionProps } from "styled-system";
|
|
2
|
-
import { DefaultNDSThemeType } from "../theme
|
|
2
|
+
import { DefaultNDSThemeType } from "../theme";
|
|
3
3
|
declare const TooltipContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("../Box").BoxProps & PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
4
4
|
theme?: DefaultNDSThemeType;
|
|
5
5
|
dataPlacement?: "top" | "bottom" | "left" | "right";
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { Alert, NotificationTypes } from "./Alert";
|
|
|
2
2
|
export type { NotificationType } from "./Alert";
|
|
3
3
|
export { AsyncSelect } from "./AsyncSelect";
|
|
4
4
|
export { Banner } from "./Banner";
|
|
5
|
+
export { BottomSheet, BottomSheetParts } from "./BottomSheet";
|
|
6
|
+
export type { BottomSheetProps } from "./BottomSheet";
|
|
5
7
|
export { AnimatedBox, Box } from "./Box";
|
|
6
8
|
export { BrandedNavBar, BrandLogoContainer, DesktopMenu, EnvironmentBanner, MenuTrigger, NavBarBackground, SmallNavBar, } from "./BrandedNavBar";
|
|
7
9
|
export type { BrandLogoContainerProps, DesktopMenuProps, EnvironmentBannerProps, MenuTriggerProps, NavBarBackgroundProps, RenderMenuButtonProps, SmallNavBarProps, } from "./BrandedNavBar";
|
|
@@ -43,11 +45,11 @@ export { Table } from "./Table";
|
|
|
43
45
|
export type { TableCellInfoType, TableColumnType, TableProps, TableRowType } from "./Table";
|
|
44
46
|
export { Tab, Tabs } from "./Tabs";
|
|
45
47
|
export { Textarea } from "./Textarea";
|
|
46
|
-
export type {
|
|
48
|
+
export type { DefaultNDSThemeType, ThemeType } from "./theme";
|
|
47
49
|
export { TimePicker } from "./TimePicker";
|
|
48
50
|
export { TimeRange } from "./TimeRange";
|
|
49
51
|
export { Toast } from "./Toast";
|
|
50
|
-
export {
|
|
52
|
+
export { toast, ToastContainer } from "./ToastContainer";
|
|
51
53
|
export { Toggle } from "./Toggle";
|
|
52
54
|
export { Tooltip } from "./Tooltip";
|
|
53
55
|
export { TruncatedText } from "./TruncatedText";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DefaultNDSThemeType, ThemeType } from "
|
|
1
|
+
import { DefaultNDSThemeType, ThemeType } from "./theme.type";
|
|
2
2
|
export declare const mergeThemes: (theme: DefaultNDSThemeType, customTheme: ThemeType) => DefaultNDSThemeType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DefaultNDSThemeType } from "./theme.type";
|
|
2
|
+
type ThemeKey = "legacy" | "experimental" | "tablet" | "phone";
|
|
3
|
+
export declare const themes: Record<ThemeKey, DefaultNDSThemeType>;
|
|
4
|
+
export declare const legacy: DefaultNDSThemeType, experimental: DefaultNDSThemeType, tablet: DefaultNDSThemeType, phone: DefaultNDSThemeType;
|
|
5
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RecursivePartial } from "
|
|
1
|
+
import { RecursivePartial } from "../utils/ts/recursivePartial";
|
|
2
2
|
interface Colors {
|
|
3
3
|
black: string;
|
|
4
4
|
blackBlue: string;
|
|
@@ -28,6 +28,7 @@ interface FontSizes {
|
|
|
28
28
|
smaller: string;
|
|
29
29
|
small: string;
|
|
30
30
|
medium: string;
|
|
31
|
+
base: string;
|
|
31
32
|
large: string;
|
|
32
33
|
larger: string;
|
|
33
34
|
largest: string;
|
|
@@ -35,6 +36,13 @@ interface FontSizes {
|
|
|
35
36
|
heading2: string;
|
|
36
37
|
heading3: string;
|
|
37
38
|
heading4: string;
|
|
39
|
+
xxs: string;
|
|
40
|
+
xs: string;
|
|
41
|
+
sm: string;
|
|
42
|
+
md: string;
|
|
43
|
+
lg: string;
|
|
44
|
+
xl: string;
|
|
45
|
+
xxl: string;
|
|
38
46
|
}
|
|
39
47
|
interface LineHeights {
|
|
40
48
|
base: string;
|
|
@@ -96,7 +104,7 @@ interface Radii {
|
|
|
96
104
|
medium: string;
|
|
97
105
|
large: string;
|
|
98
106
|
circle: string;
|
|
99
|
-
|
|
107
|
+
pill: string;
|
|
100
108
|
}
|
|
101
109
|
export interface Breakpoints {
|
|
102
110
|
extraSmall: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
2
|
+
import { FeatureFlags } from "../NDSProvider/FeatureFlagsContext";
|
|
3
|
+
import { Breakpoints, DefaultNDSThemeType, ThemeType } from "./theme.type";
|
|
3
4
|
export declare const buildBreakPoints: (breakpointsConfig: Readonly<Breakpoints>) => {
|
|
4
5
|
map: <T>(fn: (value: string) => T) => T[];
|
|
5
6
|
extraSmall: string;
|
|
@@ -8,5 +9,5 @@ export declare const buildBreakPoints: (breakpointsConfig: Readonly<Breakpoints>
|
|
|
8
9
|
large: string;
|
|
9
10
|
extraLarge: string;
|
|
10
11
|
};
|
|
11
|
-
export declare const getThemeByVariant: (variant: ComponentVariant, isTabletSize: boolean) => DefaultNDSThemeType;
|
|
12
|
+
export declare const getThemeByVariant: (variant: ComponentVariant, isTabletSize: boolean, featureFlags: FeatureFlags) => DefaultNDSThemeType;
|
|
12
13
|
export declare function useNDSTheme(variant?: ComponentVariant, customTheme?: ThemeType): DefaultNDSThemeType;
|