@openfin/ui-library 0.12.0 → 0.13.0-alpha.1678975108
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/components/controls/Button/button.d.ts +3 -3
- package/dist/components/controls/Button/button.variants.d.ts +4 -4
- package/dist/components/controls/ExpandableButton/expandableButton.d.ts +2 -2
- package/dist/components/controls/ExpandableButton/expandablePanel.d.ts +1 -1
- package/dist/components/controls/Toggle/toggle.d.ts +2 -2
- package/dist/components/elements/Badge/badge.d.ts +1 -1
- package/dist/components/elements/Calendar/calendar.d.ts +7 -0
- package/dist/components/elements/Calendar/index.d.ts +1 -0
- package/dist/components/elements/DropdownMenu/dropdownMenu.d.ts +5 -6
- package/dist/components/elements/DropdownMenu/index.d.ts +1 -0
- package/dist/components/elements/DropdownMenu/menu.d.ts +62 -0
- package/dist/components/elements/DropdownMenu/{dropdownOptionTitle.d.ts → optionTitle.d.ts} +2 -2
- package/dist/components/elements/Icon/icon.d.ts +4 -4
- package/dist/components/elements/IconWithBadge/iconWithBadge.d.ts +1 -1
- package/dist/components/elements/Loader/loader.d.ts +1 -1
- package/dist/components/elements/Loader/openfinLoader.d.ts +1 -1
- package/dist/components/input/BaseInput/baseInput.d.ts +1 -1
- package/dist/components/input/Checkbox/checkbox.d.ts +1 -1
- package/dist/components/input/DateInput/dateInput.d.ts +12 -0
- package/dist/components/input/DateInput/index.d.ts +1 -0
- package/dist/components/input/RadioGroup/radioGroup.d.ts +2 -2
- package/dist/components/input/RadioInput/radioInput.d.ts +2 -2
- package/dist/components/input/TextInput/textInput.d.ts +1 -1
- package/dist/components/layout/Box/box.d.ts +1 -1
- package/dist/components/layout/Box/types.d.ts +7 -7
- package/dist/components/system/HOC/index.d.ts +2 -2
- package/dist/components/system/ThemeProvider/lib/config.d.ts +3 -3
- package/dist/components/system/ThemeProvider/lib/constants.d.ts +1 -0
- package/dist/components/system/ThemeProvider/lib/helpers.d.ts +1 -1
- package/dist/components/system/ThemeProvider/lib/palette.d.ts +1 -0
- package/dist/components/system/ThemeProvider/lib/types.d.ts +20 -20
- package/dist/components/system/ThemeProvider/themeProvider.d.ts +1 -1
- package/dist/components/typography/Heading/heading.d.ts +111 -105
- package/dist/components/typography/Text/text.d.ts +1 -1
- package/dist/hooks/useColorScheme.d.ts +2 -2
- package/dist/hooks/useDropdownKeyboardNavigation.d.ts +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +229 -89
- package/dist/index.js.LICENSE.txt +2 -2
- package/package.json +11 -4
- package/dist/components/elements/DropdownMenu/dropdownOptionsMenu.d.ts +0 -24
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, FC, ReactNode } from 'react';
|
|
2
2
|
import { ButtonShape, ButtonSize, ButtonKind, ButtonLayout } from './button.variants';
|
|
3
|
-
|
|
3
|
+
type ButtonPropsWithLabel = {
|
|
4
4
|
children?: never;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type ButtonPropsWithChildren = {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & (ButtonPropsWithLabel | ButtonPropsWithChildren) & {
|
|
10
10
|
label?: string;
|
|
11
11
|
href?: string;
|
|
12
12
|
size?: keyof typeof ButtonSize;
|
|
@@ -16,7 +16,7 @@ export declare const ButtonKind: {
|
|
|
16
16
|
readonly secondary: "secondary";
|
|
17
17
|
readonly textOnly: "textOnly";
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type ButtonKindType = keyof typeof ButtonKind;
|
|
20
20
|
/**
|
|
21
21
|
* Button Size
|
|
22
22
|
*/
|
|
@@ -25,7 +25,7 @@ export declare const ButtonSize: {
|
|
|
25
25
|
readonly base: "base";
|
|
26
26
|
readonly large: "large";
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type ButtonSizeType = keyof typeof ButtonSize;
|
|
29
29
|
/**
|
|
30
30
|
* Button Width
|
|
31
31
|
*/
|
|
@@ -33,7 +33,7 @@ export declare const ButtonLayout: {
|
|
|
33
33
|
readonly fit: "fit";
|
|
34
34
|
readonly full: "full";
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type ButtonLayoutType = keyof typeof ButtonLayout;
|
|
37
37
|
/**
|
|
38
38
|
* Button Shape
|
|
39
39
|
*/
|
|
@@ -41,7 +41,7 @@ export declare const ButtonShape: {
|
|
|
41
41
|
readonly square: "square";
|
|
42
42
|
readonly pill: "pill";
|
|
43
43
|
};
|
|
44
|
-
export
|
|
44
|
+
export type ButtonShapeType = keyof typeof ButtonShape;
|
|
45
45
|
export declare const variants: {
|
|
46
46
|
readonly size: {
|
|
47
47
|
readonly base: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button';
|
|
3
3
|
import { ExpandDirection } from './expandDirection';
|
|
4
|
-
export
|
|
4
|
+
export type SecondaryButtonProps = {
|
|
5
5
|
title: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
onClick: (event: React.MouseEvent, closeSecondaryButtonsPanel?: () => void) => void;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type ExpandableButtonProps = Omit<ButtonProps, 'shape'> & {
|
|
10
10
|
secondaryButtons?: SecondaryButtonProps[];
|
|
11
11
|
closePanelOnSecondaryButtonClick?: boolean;
|
|
12
12
|
expandDirection?: ExpandDirection;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SecondaryButtonProps } from './expandableButton';
|
|
2
2
|
import { ButtonSizeType } from '../Button';
|
|
3
3
|
import { ExpandDirection } from './expandDirection';
|
|
4
|
-
export
|
|
4
|
+
export type ExpandablePanelProps = {
|
|
5
5
|
secondaryButtons: SecondaryButtonProps[];
|
|
6
6
|
onCollapseRequest: () => void;
|
|
7
7
|
closePanelOnSecondaryButtonClick?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, InputHTMLAttributes } from 'react';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type LabelSideType = 'left' | 'right';
|
|
3
|
+
export type ToggleProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
4
4
|
label?: string;
|
|
5
5
|
labelSide?: LabelSideType;
|
|
6
6
|
type?: 'checkbox' | 'radio';
|
|
@@ -14,5 +14,5 @@ export interface BadgeCountProps {
|
|
|
14
14
|
*/
|
|
15
15
|
max?: number;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type BadgeProps = BadgeCountProps & React.HTMLAttributes<HTMLDivElement>;
|
|
18
18
|
export declare const Badge: React.FC<BadgeProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calendar';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { MenuOption } from './menu';
|
|
3
3
|
export interface DropdownMenuProps {
|
|
4
4
|
label?: string;
|
|
5
|
-
selected?:
|
|
6
|
-
options?:
|
|
7
|
-
onChange: (value:
|
|
5
|
+
selected?: MenuOption;
|
|
6
|
+
options?: MenuOption[][];
|
|
7
|
+
onChange: (value: MenuOption) => void;
|
|
8
8
|
onOptionHover?: (value?: unknown) => void;
|
|
9
9
|
placeholder?: string;
|
|
10
|
-
renderLabel?: (option:
|
|
10
|
+
renderLabel?: (option: MenuOption, isOpen: boolean, onClick: () => void) => ReactNode;
|
|
11
11
|
fitContent?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare const DropdownMenu: FC<DropdownMenuProps>;
|
|
14
|
-
export declare const ButtonImage: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MenuOption {
|
|
3
|
+
title: string;
|
|
4
|
+
value: unknown;
|
|
5
|
+
iconUrl?: string;
|
|
6
|
+
overrideOnClick?: (value?: MenuOption) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The properties for the Menu component.
|
|
10
|
+
*/
|
|
11
|
+
export interface MenuProps {
|
|
12
|
+
/**
|
|
13
|
+
* An array of options to be displayed in the menu. The outer array represents the rows of the menu, while the inner arrays represent the columns.
|
|
14
|
+
*/
|
|
15
|
+
options: MenuOption[][];
|
|
16
|
+
/**
|
|
17
|
+
* The currently selected option in the menu.
|
|
18
|
+
*/
|
|
19
|
+
selected?: MenuOption;
|
|
20
|
+
/**
|
|
21
|
+
* An ID to associate wrapper component with this Menu.
|
|
22
|
+
*/
|
|
23
|
+
menuId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* A function to be called to close the menu.
|
|
26
|
+
*/
|
|
27
|
+
handleExpandMenu?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* A function to be called when an option in the menu is hovered over.
|
|
30
|
+
*/
|
|
31
|
+
onOptionHover?: (value?: unknown) => void;
|
|
32
|
+
/**
|
|
33
|
+
* A function to be called when an option in the menu is selected/clicked.
|
|
34
|
+
*/
|
|
35
|
+
onChange: (value: MenuOption) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the width of the menu should fit its contents
|
|
38
|
+
*/
|
|
39
|
+
fitContent?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The width of the menu, as a CSS string, default to 100% of the parent container.
|
|
42
|
+
*/
|
|
43
|
+
width?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The height of the menu, as a CSS string.
|
|
46
|
+
*/
|
|
47
|
+
height?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The text to be displayed as the header of the menu.
|
|
50
|
+
*/
|
|
51
|
+
header?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The currently focused option in the menu.
|
|
54
|
+
*/
|
|
55
|
+
focusedOption?: MenuOption;
|
|
56
|
+
/**
|
|
57
|
+
* The menu should be positioned absolutely.
|
|
58
|
+
*/
|
|
59
|
+
absolutePosition?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare const Menu: React.FC<MenuProps>;
|
|
62
|
+
export declare const ButtonImage: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { TextProps } from '../../typography/Text';
|
|
3
|
-
interface
|
|
3
|
+
interface OptionTitleProps extends Omit<TextProps, 'children'> {
|
|
4
4
|
children?: string;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* A single line of Text that will overflow with ellipsis. When overflown mousing over the text will display a tooltip with the text content.
|
|
8
8
|
*/
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const OptionTitle: FC<OptionTitleProps>;
|
|
10
10
|
/**
|
|
11
11
|
* Checks if a element's content is overflown.
|
|
12
12
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { IconSizeType, IconType } from '../../system/ThemeProvider/lib/types';
|
|
3
|
-
export
|
|
3
|
+
export type PropsWithIcon = {
|
|
4
4
|
icon: IconType;
|
|
5
5
|
children?: never;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type PropsWithChild = {
|
|
8
8
|
icon?: never;
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type IconSizeProps = {
|
|
12
12
|
size?: IconSizeType;
|
|
13
13
|
containerSize?: IconSizeType;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type IconProps = HTMLAttributes<HTMLDivElement> & (PropsWithIcon | PropsWithChild) & IconSizeProps;
|
|
16
16
|
export declare const Icon: import("styled-components").StyledComponent<({ icon, children, size, containerSize, ...props }: IconProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconProps } from '../Icon/icon';
|
|
3
3
|
import { BadgeCountProps } from '../Badge';
|
|
4
|
-
export
|
|
4
|
+
export type IconWithBadgeProps = IconProps & BadgeCountProps;
|
|
5
5
|
export declare const IconWithBadge: React.FC<IconWithBadgeProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { IconSizeProps } from '../Icon';
|
|
3
|
-
export
|
|
3
|
+
export type LoaderProps = IconSizeProps & HTMLAttributes<HTMLDivElement>;
|
|
4
4
|
export declare const Loader: import("styled-components").StyledComponent<({ ...props }: LoaderProps) => JSX.Element, import("styled-components").DefaultTheme, IconSizeProps & HTMLAttributes<HTMLDivElement>, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { IconSizeProps } from '../Icon';
|
|
3
|
-
export
|
|
3
|
+
export type OpenfinLoaderProps = IconSizeProps & HTMLAttributes<HTMLDivElement>;
|
|
4
4
|
export declare const OpenfinLoader: import("styled-components").StyledComponent<({ ...props }: OpenfinLoaderProps) => JSX.Element, import("styled-components").DefaultTheme, IconSizeProps & HTMLAttributes<HTMLDivElement>, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { WithStatusProps } from '../../system/HOC';
|
|
3
|
-
export
|
|
3
|
+
export type BaseInputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
4
4
|
message?: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
type?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseInputProps } from '../BaseInput';
|
|
3
3
|
import { WithStatusProps } from '../../system/HOC';
|
|
4
|
-
export
|
|
4
|
+
export type CheckboxProps = BaseInputProps;
|
|
5
5
|
export declare const Checkbox: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
6
6
|
message?: string | undefined;
|
|
7
7
|
label?: string | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChangeEventHandler, MouseEventHandler } from 'react';
|
|
2
|
+
import { BaseInputProps } from '../BaseInput';
|
|
3
|
+
type DateTypeFormat = 'date' | 'time' | 'datetime-local';
|
|
4
|
+
interface DateInputProps extends Omit<BaseInputProps, 'value' | 'type'> {
|
|
5
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
6
|
+
onExpand?: MouseEventHandler<HTMLDivElement>;
|
|
7
|
+
expanded?: boolean;
|
|
8
|
+
value?: string;
|
|
9
|
+
type?: DateTypeFormat;
|
|
10
|
+
}
|
|
11
|
+
export declare const DateInput: import("react").ForwardRefExoticComponent<DateInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dateInput';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { UnitPxType } from '../../system/ThemeProvider';
|
|
3
3
|
import { RadioLabelSideType } from '../RadioInput/radioInput';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
type RadioDirectionType = 'row' | 'column';
|
|
5
|
+
export type RadioGroupProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
6
6
|
direction?: RadioDirectionType;
|
|
7
7
|
gap?: UnitPxType;
|
|
8
8
|
labelSide?: RadioLabelSideType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LabelSideType } from '../../controls/Toggle';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type RadioLabelSideType = LabelSideType | 'top' | 'bottom';
|
|
4
|
+
export type RadioProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
5
5
|
label?: string;
|
|
6
6
|
labelSide?: RadioLabelSideType;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseInputProps } from '../BaseInput';
|
|
3
|
-
export
|
|
3
|
+
export type TextInputProps = BaseInputProps;
|
|
4
4
|
export declare const TextInput: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
5
5
|
message?: string | undefined;
|
|
6
6
|
label?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { UnitPxType } from '../../system/ThemeProvider/lib/types';
|
|
3
3
|
import * as BoxTypes from './types';
|
|
4
|
-
export
|
|
4
|
+
export type BoxProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
alignItems?: BoxTypes.AlignItems;
|
|
6
6
|
display?: BoxTypes.Display;
|
|
7
7
|
flexDirection?: BoxTypes.FlexDirection;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
1
|
+
export type AlignItems = 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'first baseline' | 'last baseline' | 'start' | 'end' | 'self-start' | 'self-end';
|
|
2
|
+
export type Display = 'flex' | 'inline-flex';
|
|
3
|
+
export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
4
|
+
export type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
5
|
+
export type JustifyContent = 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'start' | 'end' | 'left' | 'right';
|
|
6
|
+
export type AlignSelf = 'auto' | 'flex-start' | ' flex-end' | 'center' | 'baseline' | 'stretch';
|
|
7
|
+
export type BackgroundLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -2,18 +2,18 @@ import { FlattenSimpleInterpolation } from 'styled-components';
|
|
|
2
2
|
/**
|
|
3
3
|
* ThemeProvider Configuration
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type ConfigurationType = CDNFontConfig | ImportFontConfig;
|
|
6
6
|
/**
|
|
7
7
|
* Custom import and handling for font loading.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type ImportFontConfig = {
|
|
10
10
|
fontLoading: 'import';
|
|
11
11
|
fontCss: FlattenSimpleInterpolation;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Use fonts from the Openfin CDN.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type CDNFontConfig = {
|
|
17
17
|
fontLoading: 'cdn';
|
|
18
18
|
};
|
|
19
19
|
export declare const Configuration: ConfigurationType;
|
|
@@ -15,6 +15,7 @@ export declare const Color: {
|
|
|
15
15
|
readonly lightGray5: "#C9CBD2";
|
|
16
16
|
readonly neutralGray: "#7D808A";
|
|
17
17
|
readonly neutralGray80: "rgba(125,128,138,0.8)";
|
|
18
|
+
readonly silverGray: "#C0C1C2";
|
|
18
19
|
readonly darkGray1: "#53565F";
|
|
19
20
|
readonly darkGray2: "#383A40";
|
|
20
21
|
readonly darkGray3: "#2F3136";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefaultTheme, StyledProps } from 'styled-components';
|
|
2
2
|
import { StatusType } from '../../HOC';
|
|
3
3
|
import { Palette } from './palette';
|
|
4
|
-
export
|
|
4
|
+
export type ComponentVariants = {
|
|
5
5
|
[key: string]: {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
@@ -30,6 +30,7 @@ export declare const Palette: {
|
|
|
30
30
|
readonly textDefault: "textDefault";
|
|
31
31
|
readonly textHelp: "textHelp";
|
|
32
32
|
readonly textInactive: "textInactive";
|
|
33
|
+
readonly borderNeutral: "borderNeutral";
|
|
33
34
|
readonly contentBackground1: "contentBackground1";
|
|
34
35
|
readonly contentBackground2: "contentBackground2";
|
|
35
36
|
readonly contentBackground3: "contentBackground3";
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { DefaultTheme } from 'styled-components';
|
|
2
2
|
import { Color, FontSize, FontStack, FontWeight, IconSet, IconSize, LineHeight, Radius, Shadow, Size, Transition, Typography, Unit, UnitPx } from './constants';
|
|
3
3
|
import { Palette } from './palette';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
4
|
+
export type ColorType = keyof typeof Color;
|
|
5
|
+
export type FontSizeType = keyof typeof FontSize;
|
|
6
|
+
export type FontStackType = keyof typeof FontStack;
|
|
7
|
+
export type FontWeightType = keyof typeof FontWeight;
|
|
8
|
+
export type IconSizeType = keyof typeof IconSize;
|
|
9
|
+
export type IconType = keyof typeof IconSet;
|
|
10
|
+
export type LineHeightType = keyof typeof LineHeight;
|
|
11
|
+
export type RadiusType = keyof typeof Radius;
|
|
12
|
+
export type ShadowType = keyof typeof Shadow;
|
|
13
|
+
export type SizeType = keyof typeof Size;
|
|
14
|
+
export type TransitionType = keyof typeof Transition;
|
|
15
|
+
export type TypographyType = keyof typeof Typography;
|
|
16
|
+
export type UnitPxType = keyof typeof UnitPx;
|
|
17
|
+
export type UnitType = keyof typeof Unit;
|
|
18
|
+
export type ThemeSet = {
|
|
19
19
|
light: DefaultTheme;
|
|
20
20
|
dark: DefaultTheme;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
22
|
+
export type PaletteKeyType = keyof typeof Palette;
|
|
23
|
+
export type PaletteType = Record<keyof typeof Palette, string>;
|
|
24
|
+
export type ThemePaletteSet = {
|
|
25
25
|
light: {
|
|
26
26
|
palette: PaletteType;
|
|
27
27
|
};
|
|
@@ -40,7 +40,7 @@ export declare type ThemePaletteSet = {
|
|
|
40
40
|
* @example ValueOf<typeof someObject>
|
|
41
41
|
* @link https://stackoverflow.com/questions/49285864/is-there-a-valueof-similar-to-keyof-in-typescript
|
|
42
42
|
*/
|
|
43
|
-
export
|
|
43
|
+
export type ValueOf<T> = T[keyof T];
|
|
44
44
|
/**
|
|
45
45
|
* Join a string tuple to a string with a separator.
|
|
46
46
|
* @example
|
|
@@ -48,4 +48,4 @@ export declare type ValueOf<T> = T[keyof T];
|
|
|
48
48
|
* type MyArrayString = StringTupleJoin<typeof array, ', '>;
|
|
49
49
|
* const str: MyArrayString = "hello, world";
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
51
|
+
export type StringTupleJoin<T extends readonly string[], Separator extends string> = T extends readonly [string, ...infer Tail] ? Tail extends [string, ...string[]] ? `${T[0]}${Separator}${StringTupleJoin<Tail, Separator>}` : `${T[0]}` : never;
|
|
@@ -2,7 +2,7 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import { ColorScheme } from '../../../hooks/useColorScheme';
|
|
3
3
|
import { ConfigurationType } from './lib/config';
|
|
4
4
|
import { ThemePaletteSet } from './lib/types';
|
|
5
|
-
export
|
|
5
|
+
export type ThemeProviderProps = {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
themes?: ThemePaletteSet;
|
|
8
8
|
scheme?: keyof typeof ColorScheme;
|