@juspay/blend-design-system 0.0.1 → 0.0.5-beta.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/components/Inputs/DropdownInput/DropdownInput.d.ts +1 -1
- package/dist/components/Inputs/DropdownInput/dropdownInput.tokens.d.ts +5 -1
- package/dist/components/Inputs/DropdownInput/types.d.ts +3 -1
- package/dist/components/Inputs/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/Inputs/NumberInput/numberInput.tokens.d.ts +5 -1
- package/dist/components/Inputs/NumberInput/types.d.ts +4 -2
- package/dist/components/Inputs/TextArea/textarea.token.d.ts +5 -1
- package/dist/components/Inputs/TextArea/types.d.ts +1 -1
- package/dist/components/Inputs/TextInput/TextInput.d.ts +1 -1
- package/dist/components/Inputs/TextInput/textInput.tokens.d.ts +5 -1
- package/dist/components/Inputs/TextInput/types.d.ts +3 -1
- package/dist/components/Inputs/UnitInput/UnitInput.d.ts +1 -1
- package/dist/components/Inputs/UnitInput/types.d.ts +3 -1
- package/dist/components/Inputs/UnitInput/unitInput.tokens.d.ts +5 -1
- package/dist/components/Inputs/utils/FloatingLabels/FloatingLabels.d.ts +7 -0
- package/dist/components/MultiSelect/MultiSelectTrigger.d.ts +22 -0
- package/dist/components/MultiSelect/index.d.ts +1 -0
- package/dist/components/MultiSelect/multiSelect.tokens.d.ts +10 -2
- package/dist/components/MultiSelect/types.d.ts +1 -0
- package/dist/components/Primitives/PrimitiveButton/PrimitiveButton.d.ts +4 -0
- package/dist/components/Primitives/PrimitiveInput/PrimitiveInput.d.ts +2 -0
- package/dist/components/Primitives/PrimitiveText/PrimitiveText.d.ts +5 -0
- package/dist/components/Primitives/PrimitiveTextArea.d.ts +2 -0
- package/dist/components/SingleSelect/SingleSelectTrigger.d.ts +21 -0
- package/dist/components/SingleSelect/singleSelect.tokens.d.ts +76 -0
- package/dist/components/SingleSelect/types.d.ts +54 -1
- package/dist/components/Tabs/tabs.token.d.ts +14 -5
- package/dist/components/Tabs/types.d.ts +2 -1
- package/dist/context/ThemeContext.d.ts +16 -14
- package/dist/context/useComponentToken.d.ts +9 -8
- package/dist/global-utils/GlobalUtils.d.ts +1 -0
- package/dist/main.js +13552 -12175
- package/package.json +24 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DropdownInputProps } from './types';
|
|
2
|
-
declare const DropdownInput: ({ label, sublabel, disabled, helpIconHintText, name, required, error, errorMessage, hintText, value, onChange, slot, size, placeholder, dropDownValue, onDropDownChange, dropDownItems, dropdownName, onDropdownOpen, onDropdownClose, ...rest }: DropdownInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const DropdownInput: ({ label, sublabel, disabled, helpIconHintText, name, required, error, errorMessage, hintText, value, onChange, slot, size, placeholder, dropDownValue, onDropDownChange, dropDownItems, dropdownName, onDropdownOpen, onDropdownClose, onBlur, onFocus, ...rest }: DropdownInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DropdownInput;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
3
|
import { DropdownInputSize, DropdownInputState } from './types';
|
|
4
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
4
5
|
export type DropdownInputTokensType = {
|
|
5
6
|
input: {
|
|
6
7
|
gap: CSSObject['gap'];
|
|
@@ -28,6 +29,9 @@ export type DropdownInputTokensType = {
|
|
|
28
29
|
};
|
|
29
30
|
};
|
|
30
31
|
};
|
|
32
|
+
export type ResponsiveDropdownInputTokens = {
|
|
33
|
+
[key in keyof BreakpointType]: DropdownInputTokensType;
|
|
34
|
+
};
|
|
31
35
|
declare const dropdownInputTokens: Readonly<DropdownInputTokensType>;
|
|
32
|
-
export declare const getDropdownInputTokens: (foundationTheme: FoundationTokenType) =>
|
|
36
|
+
export declare const getDropdownInputTokens: (foundationTheme: FoundationTokenType) => ResponsiveDropdownInputTokens;
|
|
33
37
|
export default dropdownInputTokens;
|
|
@@ -28,4 +28,6 @@ export type DropdownInputProps = {
|
|
|
28
28
|
dropdownName?: string;
|
|
29
29
|
onDropdownOpen?: () => void;
|
|
30
30
|
onDropdownClose?: () => void;
|
|
31
|
-
|
|
31
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
32
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
33
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className' | 'onBlur' | 'onFocus'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NumberInputProps } from './types';
|
|
2
|
-
declare const NumberInput: ({ value, onChange, min, max, step, error, errorMessage, required, disabled, size, placeholder, sublabel, helpIconHintText, label, hintText, name, ...rest }: NumberInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const NumberInput: ({ value, onChange, min, max, step, error, errorMessage, required, disabled, size, placeholder, sublabel, helpIconHintText, label, hintText, name, onBlur, onFocus, ...rest }: NumberInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default NumberInput;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
3
4
|
declare enum TextInputSize {
|
|
4
5
|
MD = "md",
|
|
5
6
|
LG = "lg"
|
|
@@ -39,6 +40,9 @@ export type NumberInputTokensType = {
|
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
};
|
|
43
|
+
export type ResponsiveNumberInputTokens = {
|
|
44
|
+
[key in keyof BreakpointType]: NumberInputTokensType;
|
|
45
|
+
};
|
|
42
46
|
declare const numberInputTokens: Readonly<NumberInputTokensType>;
|
|
43
|
-
export declare const getNumberInputTokens: (foundationTheme: FoundationTokenType) =>
|
|
47
|
+
export declare const getNumberInputTokens: (foundationTheme: FoundationTokenType) => ResponsiveNumberInputTokens;
|
|
44
48
|
export default numberInputTokens;
|
|
@@ -3,7 +3,7 @@ export declare enum NumberInputSize {
|
|
|
3
3
|
LARGE = "lg"
|
|
4
4
|
}
|
|
5
5
|
export type NumberInputProps = {
|
|
6
|
-
value: number;
|
|
6
|
+
value: number | undefined;
|
|
7
7
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
step?: number;
|
|
9
9
|
error?: boolean;
|
|
@@ -13,4 +13,6 @@ export type NumberInputProps = {
|
|
|
13
13
|
sublabel?: string;
|
|
14
14
|
helpIconHintText?: string;
|
|
15
15
|
hintText?: string;
|
|
16
|
-
|
|
16
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
17
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
18
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className' | 'value' | 'onBlur' | 'onFocus'>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
3
4
|
type TextAreaState = 'default' | 'hover' | 'focus' | 'error' | 'disabled';
|
|
4
5
|
export type TextAreaTokensType = {
|
|
5
6
|
fontFamily: CSSObject['fontFamily'];
|
|
@@ -22,6 +23,9 @@ export type TextAreaTokensType = {
|
|
|
22
23
|
[key in TextAreaState]: CSSObject['backgroundColor'];
|
|
23
24
|
};
|
|
24
25
|
};
|
|
26
|
+
export type ResponsiveTextAreaTokens = {
|
|
27
|
+
[key in keyof BreakpointType]: TextAreaTokensType;
|
|
28
|
+
};
|
|
25
29
|
export declare const textAreaTokens: TextAreaTokensType;
|
|
26
|
-
export declare const getTextAreaTokens: (foundationTokens: FoundationTokenType) =>
|
|
30
|
+
export declare const getTextAreaTokens: (foundationTokens: FoundationTokenType) => ResponsiveTextAreaTokens;
|
|
27
31
|
export default textAreaTokens;
|
|
@@ -19,4 +19,4 @@ export type TextAreaProps = {
|
|
|
19
19
|
errorMessage?: string;
|
|
20
20
|
resize?: 'none' | 'both' | 'horizontal' | 'vertical' | 'block' | 'inline';
|
|
21
21
|
wrap?: CSSObject['whiteSpace'];
|
|
22
|
-
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size' | 'style' | 'className'>;
|
|
22
|
+
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size' | 'style' | 'className' | 'onFocus' | 'onBlur'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TextInputProps } from './types';
|
|
2
|
-
declare const TextInput: ({ size, leftSlot, rightSlot, error, errorMessage, hintText, helpIconHintText, disabled, label, placeholder, sublabel, value, onChange, name, required, ...rest }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const TextInput: ({ size, leftSlot, rightSlot, error, errorMessage, hintText, helpIconHintText, disabled, label, placeholder, sublabel, value, onChange, name, required, onBlur, onFocus, ...rest }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TextInput;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
3
|
import { TextInputSize, TextInputState } from './types';
|
|
4
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
4
5
|
export type TextInputTokensType = {
|
|
5
6
|
input: {
|
|
6
7
|
gap: CSSObject['gap'];
|
|
@@ -29,5 +30,8 @@ export type TextInputTokensType = {
|
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
declare const textInputTokens: Readonly<TextInputTokensType>;
|
|
32
|
-
export
|
|
33
|
+
export type ResponsiveTextInputTokens = {
|
|
34
|
+
[key in keyof BreakpointType]: TextInputTokensType;
|
|
35
|
+
};
|
|
36
|
+
export declare const getTextInputTokens: (foundationTheme: FoundationTokenType) => ResponsiveTextInputTokens;
|
|
33
37
|
export default textInputTokens;
|
|
@@ -21,4 +21,6 @@ export type TextInputProps = {
|
|
|
21
21
|
rightSlot?: React.ReactNode;
|
|
22
22
|
value: string;
|
|
23
23
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
24
|
-
|
|
24
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
25
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
26
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className' | 'onBlur' | 'onFocus'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UnitInputProps } from './types';
|
|
2
|
-
declare const UnitInput: ({ value, onChange, min, max, step, error, errorMessage, required, disabled, size, placeholder, sublabel, helpIconHintText, label, hintText, leftSlot, rightSlot, unit, unitPosition, name, ...rest }: UnitInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const UnitInput: ({ value, onChange, min, max, step, error, errorMessage, required, disabled, size, placeholder, sublabel, helpIconHintText, label, hintText, leftSlot, rightSlot, unit, unitPosition, name, onFocus, onBlur, ...rest }: UnitInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default UnitInput;
|
|
@@ -7,7 +7,7 @@ export declare enum UnitPosition {
|
|
|
7
7
|
RIGHT = "right"
|
|
8
8
|
}
|
|
9
9
|
export type UnitInputProps = {
|
|
10
|
-
value: number;
|
|
10
|
+
value: number | undefined;
|
|
11
11
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
12
|
step?: number;
|
|
13
13
|
error?: boolean;
|
|
@@ -22,4 +22,6 @@ export type UnitInputProps = {
|
|
|
22
22
|
rightSlot?: React.ReactNode;
|
|
23
23
|
unit: string;
|
|
24
24
|
unitPosition?: UnitPosition;
|
|
25
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
26
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
25
27
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className'>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { UnitInputSize } from './types';
|
|
3
3
|
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
4
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
4
5
|
declare enum UnitInputState {
|
|
5
6
|
DEFAULT = "default",
|
|
6
7
|
HOVER = "hover",
|
|
@@ -36,5 +37,8 @@ export type UnitInputTokensType = {
|
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
declare const unitInputTokens: UnitInputTokensType;
|
|
39
|
-
export
|
|
40
|
+
export type ResponsiveUnitInputTokens = {
|
|
41
|
+
[key in keyof BreakpointType]: UnitInputTokensType;
|
|
42
|
+
};
|
|
43
|
+
export declare const getUnitInputTokens: (foundationTheme: FoundationTokenType) => ResponsiveUnitInputTokens;
|
|
40
44
|
export default unitInputTokens;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MultiSelectTokensType } from './multiSelect.tokens';
|
|
3
|
+
import { MultiSelectMenuSize, MultiSelectSelectionTagType, MultiSelectVariant } from './types';
|
|
4
|
+
export type MultiSelectTriggerProps = {
|
|
5
|
+
selectedValues: string[];
|
|
6
|
+
slot: React.ReactNode;
|
|
7
|
+
variant: MultiSelectVariant;
|
|
8
|
+
size: MultiSelectMenuSize;
|
|
9
|
+
isSmallScreen: boolean;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
name: string;
|
|
12
|
+
label: string;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
required: boolean;
|
|
15
|
+
selectionTagType: MultiSelectSelectionTagType;
|
|
16
|
+
valueLabelMap: Record<string, string>;
|
|
17
|
+
open: boolean;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
multiSelectTokens: MultiSelectTokensType;
|
|
20
|
+
};
|
|
21
|
+
declare const MultiSelectTrigger: ({ selectedValues, slot, variant, size, isSmallScreen, onChange, name, label, placeholder, required, selectionTagType, valueLabelMap, open, onClick, multiSelectTokens, }: MultiSelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default MultiSelectTrigger;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { MultiSelectMenuSize, MultiSelectSelectionTagType, MultiSelectVariant } from './types';
|
|
3
3
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
5
|
type TriggerStates = 'open' | 'closed' | 'hover' | 'focus';
|
|
5
6
|
export type SingleSelectItemStates = 'default' | 'hover' | 'active' | 'focus' | 'focusVisible' | 'disabled' | 'selected';
|
|
6
7
|
export type MultiSelectTokensType = {
|
|
7
8
|
trigger: {
|
|
8
|
-
|
|
9
|
+
height: CSSObject['height'];
|
|
10
|
+
paddingX: {
|
|
11
|
+
[key in MultiSelectMenuSize]: CSSObject['padding'];
|
|
12
|
+
};
|
|
13
|
+
paddingY: {
|
|
9
14
|
[key in MultiSelectMenuSize]: CSSObject['padding'];
|
|
10
15
|
};
|
|
11
16
|
borderRadius: {
|
|
@@ -72,6 +77,9 @@ export type MultiSelectTokensType = {
|
|
|
72
77
|
};
|
|
73
78
|
};
|
|
74
79
|
};
|
|
80
|
+
export type ResponsiveMultiSelectTokens = {
|
|
81
|
+
[key in keyof BreakpointType]: MultiSelectTokensType;
|
|
82
|
+
};
|
|
75
83
|
export declare const multiSelectTokens: MultiSelectTokensType;
|
|
76
|
-
export declare const getMultiSelectTokens: (foundationToken: FoundationTokenType) =>
|
|
84
|
+
export declare const getMultiSelectTokens: (foundationToken: FoundationTokenType) => ResponsiveMultiSelectTokens;
|
|
77
85
|
export {};
|
|
@@ -13,6 +13,8 @@ type PrimitiveButtonProps = StateStyles & {
|
|
|
13
13
|
padding?: CSSObject['padding'];
|
|
14
14
|
paddingX?: CSSObject['padding'];
|
|
15
15
|
paddingY?: CSSObject['padding'];
|
|
16
|
+
paddingTop?: CSSObject['padding'];
|
|
17
|
+
paddingBottom?: CSSObject['padding'];
|
|
16
18
|
margin?: CSSObject['margin'];
|
|
17
19
|
marginX?: CSSObject['margin'];
|
|
18
20
|
marginY?: CSSObject['margin'];
|
|
@@ -73,6 +75,8 @@ declare const PrimitiveButton: React.ForwardRefExoticComponent<StateStyles & {
|
|
|
73
75
|
padding?: CSSObject["padding"];
|
|
74
76
|
paddingX?: CSSObject["padding"];
|
|
75
77
|
paddingY?: CSSObject["padding"];
|
|
78
|
+
paddingTop?: CSSObject["padding"];
|
|
79
|
+
paddingBottom?: CSSObject["padding"];
|
|
76
80
|
margin?: CSSObject["margin"];
|
|
77
81
|
marginX?: CSSObject["margin"];
|
|
78
82
|
marginY?: CSSObject["margin"];
|
|
@@ -12,6 +12,8 @@ type StateStyles = {
|
|
|
12
12
|
};
|
|
13
13
|
type PrimitiveInputProps = StateStyles & {
|
|
14
14
|
color?: CSSObject['color'];
|
|
15
|
+
fontSize?: CSSObject['fontSize'];
|
|
16
|
+
fontWeight?: CSSObject['fontWeight'];
|
|
15
17
|
position?: CSSObject['position'];
|
|
16
18
|
inset?: CSSObject['inset'];
|
|
17
19
|
top?: CSSObject['top'];
|
|
@@ -21,6 +21,11 @@ export type PrimitiveTextProps = {
|
|
|
21
21
|
name?: CSSObject['name'];
|
|
22
22
|
htmlFor?: CSSObject['htmlFor'];
|
|
23
23
|
textTransform?: CSSObject['textTransform'];
|
|
24
|
+
position?: CSSObject['position'];
|
|
25
|
+
top?: CSSObject['top'];
|
|
26
|
+
left?: CSSObject['left'];
|
|
27
|
+
bottom?: CSSObject['bottom'];
|
|
28
|
+
right?: CSSObject['right'];
|
|
24
29
|
};
|
|
25
30
|
export type TextProps = PrimitiveTextProps & Omit<React.HTMLAttributes<HTMLElement>, 'color'> & {
|
|
26
31
|
children: React.ReactNode;
|
|
@@ -82,6 +82,8 @@ type PrimitiveTextareaProps = StateStyles & {
|
|
|
82
82
|
placeholderStyles?: CSSObject;
|
|
83
83
|
resize?: CSSObject['resize'];
|
|
84
84
|
fontFamily?: CSSObject['fontFamily'];
|
|
85
|
+
fontSize?: CSSObject['fontSize'];
|
|
86
|
+
fontWeight?: CSSObject['fontWeight'];
|
|
85
87
|
};
|
|
86
88
|
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & PrimitiveTextareaProps;
|
|
87
89
|
declare const PrimitiveTextarea: React.FC<TextareaProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectMenuSize, SelectMenuVariant } from './types';
|
|
3
|
+
import { SingleSelectTokensType } from './singleSelect.tokens';
|
|
4
|
+
export type SingleSelectTriggerProps = {
|
|
5
|
+
size: SelectMenuSize;
|
|
6
|
+
selected: string;
|
|
7
|
+
label: string;
|
|
8
|
+
name: string;
|
|
9
|
+
placeholder: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
valueLabelMap: Record<string, string>;
|
|
12
|
+
open: boolean;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
slot: React.ReactNode;
|
|
15
|
+
variant: SelectMenuVariant;
|
|
16
|
+
isSmallScreenWithLargeSize: boolean;
|
|
17
|
+
isItemSelected: boolean;
|
|
18
|
+
singleSelectTokens: SingleSelectTokensType;
|
|
19
|
+
};
|
|
20
|
+
declare const SingleSelectTrigger: ({ size, selected, label, name, placeholder, required, valueLabelMap, open, onClick, slot, variant, isSmallScreenWithLargeSize, isItemSelected, singleSelectTokens, }: SingleSelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default SingleSelectTrigger;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { SelectMenuSize, SelectMenuVariant } from './types';
|
|
3
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
+
type TriggerStates = 'open' | 'closed' | 'hover' | 'focus';
|
|
6
|
+
export type SingleSelectItemStates = 'default' | 'hover' | 'active' | 'focus' | 'focusVisible' | 'disabled' | 'selected';
|
|
7
|
+
export type SingleSelectTokensType = {
|
|
8
|
+
trigger: {
|
|
9
|
+
height: CSSObject['height'];
|
|
10
|
+
paddingX: {
|
|
11
|
+
[key in SelectMenuSize]: CSSObject['padding'];
|
|
12
|
+
};
|
|
13
|
+
paddingY: {
|
|
14
|
+
[key in SelectMenuSize]: CSSObject['padding'];
|
|
15
|
+
};
|
|
16
|
+
borderRadius: {
|
|
17
|
+
[key in SelectMenuSize]: CSSObject['borderRadius'];
|
|
18
|
+
};
|
|
19
|
+
boxShadow: {
|
|
20
|
+
[key in SelectMenuVariant]: CSSObject['boxShadow'];
|
|
21
|
+
};
|
|
22
|
+
backgroundColor: {
|
|
23
|
+
container: {
|
|
24
|
+
[key in TriggerStates]: CSSObject['backgroundColor'];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
outline: {
|
|
28
|
+
[key in SelectMenuVariant]: {
|
|
29
|
+
[key in TriggerStates]: CSSObject['outline'];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
dropdown: {
|
|
34
|
+
shadow: CSSObject['boxShadow'];
|
|
35
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
36
|
+
paddingTop: CSSObject['paddingTop'];
|
|
37
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
38
|
+
border: CSSObject['border'];
|
|
39
|
+
outline: CSSObject['outline'];
|
|
40
|
+
borderRadius: CSSObject['borderRadius'];
|
|
41
|
+
item: {
|
|
42
|
+
padding: CSSObject['padding'];
|
|
43
|
+
margin: CSSObject['margin'];
|
|
44
|
+
borderRadius: CSSObject['borderRadius'];
|
|
45
|
+
gap: CSSObject['gap'];
|
|
46
|
+
backgroundColor: {
|
|
47
|
+
[key in SingleSelectItemStates]: CSSObject['backgroundColor'];
|
|
48
|
+
};
|
|
49
|
+
label: {
|
|
50
|
+
fontSize: CSSObject['fontSize'];
|
|
51
|
+
fontWeight: CSSObject['fontWeight'];
|
|
52
|
+
color: {
|
|
53
|
+
[key in SingleSelectItemStates]: CSSObject['color'];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
subLabel: {
|
|
57
|
+
fontSize: CSSObject['fontSize'];
|
|
58
|
+
fontWeight: CSSObject['fontWeight'];
|
|
59
|
+
color: {
|
|
60
|
+
[key in SingleSelectItemStates]: CSSObject['color'];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
seperator: {
|
|
65
|
+
color: CSSObject['color'];
|
|
66
|
+
height: CSSObject['height'];
|
|
67
|
+
margin: CSSObject['margin'];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type ResponsiveSingleSelectTokens = {
|
|
72
|
+
[key in keyof BreakpointType]: SingleSelectTokensType;
|
|
73
|
+
};
|
|
74
|
+
export declare const singleSelectTokens: SingleSelectTokensType;
|
|
75
|
+
export declare const getSingleSelectTokens: (foundationToken: FoundationTokenType) => ResponsiveSingleSelectTokens;
|
|
76
|
+
export {};
|
|
@@ -1,4 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
export declare enum SelectMenuAlignment {
|
|
2
|
+
START = "start",
|
|
3
|
+
CENTER = "center",
|
|
4
|
+
END = "end"
|
|
5
|
+
}
|
|
6
|
+
export declare enum SelectMenuVariant {
|
|
7
|
+
CONTAINER = "container",
|
|
8
|
+
NO_CONTAINER = "no-container"
|
|
9
|
+
}
|
|
10
|
+
export declare enum SelectMenuSize {
|
|
11
|
+
SMALL = "sm",
|
|
12
|
+
MEDIUM = "md",
|
|
13
|
+
LARGE = "lg"
|
|
14
|
+
}
|
|
15
|
+
export declare enum SelectMenuSide {
|
|
16
|
+
TOP = "top",
|
|
17
|
+
LEFT = "left",
|
|
18
|
+
RIGHT = "right",
|
|
19
|
+
BOTTOM = "bottom"
|
|
20
|
+
}
|
|
21
|
+
export type SelectMenuGroupType = {
|
|
22
|
+
groupLabel?: string;
|
|
23
|
+
items: SelectMenuItemType[];
|
|
24
|
+
showSeparator?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type SelectMenuProps = {
|
|
27
|
+
trigger?: React.ReactNode;
|
|
28
|
+
items: SelectMenuGroupType[];
|
|
29
|
+
asModal?: boolean;
|
|
30
|
+
alignment?: SelectMenuAlignment;
|
|
31
|
+
side?: SelectMenuSide;
|
|
32
|
+
sideOffset?: number;
|
|
33
|
+
alignOffset?: number;
|
|
34
|
+
collisonBoundaryRef?: Element | null | Array<Element | null>;
|
|
35
|
+
maxHeight?: number;
|
|
36
|
+
selected?: string | string[];
|
|
37
|
+
onSelect?: (value: string | string[]) => void;
|
|
38
|
+
allowMultiSelect?: boolean;
|
|
39
|
+
enableSearch?: boolean;
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
};
|
|
42
|
+
export type SelectMenuItemType = {
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
checked?: boolean;
|
|
46
|
+
subLabel?: string;
|
|
47
|
+
slot1?: React.ReactNode;
|
|
48
|
+
slot2?: React.ReactNode;
|
|
49
|
+
slot3?: React.ReactNode;
|
|
50
|
+
slot4?: React.ReactNode;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
onClick?: () => void;
|
|
53
|
+
subMenu?: SelectMenuItemType[];
|
|
54
|
+
};
|
|
2
55
|
export type SingleSelectProps = {
|
|
3
56
|
label: string;
|
|
4
57
|
subLabel?: string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { ThemeType } from '../../tokens';
|
|
3
3
|
import { TabsVariant, TabsSize } from './types';
|
|
4
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
5
|
export type TabsState = 'default' | 'hover' | 'active' | 'disabled';
|
|
5
6
|
export type TabsTokensType = {
|
|
6
7
|
gap: {
|
|
7
|
-
[key in
|
|
8
|
+
[key in TabsSize]: {
|
|
9
|
+
[key in TabsVariant]: CSSObject['gap'];
|
|
10
|
+
};
|
|
8
11
|
};
|
|
9
12
|
list: {
|
|
10
13
|
padding: {
|
|
@@ -25,7 +28,9 @@ export type TabsTokensType = {
|
|
|
25
28
|
[key in TabsSize]: CSSObject['height'];
|
|
26
29
|
};
|
|
27
30
|
padding: {
|
|
28
|
-
[key in
|
|
31
|
+
[key in TabsVariant]: {
|
|
32
|
+
[key in TabsSize]: CSSObject['padding'];
|
|
33
|
+
};
|
|
29
34
|
};
|
|
30
35
|
fontSize: {
|
|
31
36
|
[key in TabsSize]: CSSObject['fontSize'];
|
|
@@ -49,12 +54,16 @@ export type TabsTokensType = {
|
|
|
49
54
|
borderRadius: {
|
|
50
55
|
[key in TabsVariant]: CSSObject['borderRadius'];
|
|
51
56
|
};
|
|
57
|
+
border: {
|
|
58
|
+
[key in TabsVariant]: CSSObject['border'];
|
|
59
|
+
};
|
|
52
60
|
};
|
|
53
61
|
underline: {
|
|
54
62
|
height: CSSObject['height'];
|
|
55
63
|
color: CSSObject['color'];
|
|
56
64
|
};
|
|
57
65
|
};
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
export type ResponsiveTabsTokens = {
|
|
67
|
+
[key in keyof BreakpointType]: TabsTokensType;
|
|
68
|
+
};
|
|
69
|
+
export declare const getTabsTokens: (foundationToken: ThemeType) => ResponsiveTabsTokens;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { ThemeType } from '../tokens';
|
|
2
2
|
import { ResponsiveTagTokens } from '../components/Tags/tag.tokens';
|
|
3
3
|
import { SearchInputTokensType } from '../components/Inputs/SearchInput/searchInput.tokens';
|
|
4
|
-
import {
|
|
4
|
+
import { ResponsiveTextAreaTokens } from '../components/Inputs/TextArea/textarea.token';
|
|
5
5
|
import { ResponsiveRadioTokens } from '../components/Radio/radio.token';
|
|
6
6
|
import { ResponsiveSwitchTokens } from '../components/Switch/switch.token';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { ResponsiveTextInputTokens } from '../components/Inputs/TextInput/textInput.tokens';
|
|
8
|
+
import { ResponsiveNumberInputTokens } from '../components/Inputs/NumberInput/numberInput.tokens';
|
|
9
9
|
import { ResponsiveAlertTokens } from '../components/Alert/alert.tokens';
|
|
10
10
|
import { OTPInputTokensType } from '../components/Inputs/OTPInput/otpInput.tokens';
|
|
11
11
|
import { TooltipTokensType } from '../components/Tooltip/tooltip.tokens';
|
|
12
|
-
import {
|
|
12
|
+
import { ResponsiveUnitInputTokens } from '../components/Inputs/UnitInput/unitInput.tokens';
|
|
13
13
|
import { MultiValueInputTokensType } from '../components/Inputs/MultiValueInput/multiValueInput.tokens';
|
|
14
|
-
import {
|
|
14
|
+
import { ResponsiveDropdownInputTokens } from '../components/Inputs/DropdownInput/dropdownInput.tokens';
|
|
15
15
|
import { ResponsiveCheckboxTokens } from '../components/Checkbox/checkbox.token';
|
|
16
|
-
import {
|
|
16
|
+
import { ResponsiveTabsTokens } from '../components/Tabs/tabs.token';
|
|
17
17
|
import { ResponsiveButtonTokens } from '../components/Button/button.tokens';
|
|
18
18
|
import { ModalTokensType } from '../components/Modal/modal.tokens';
|
|
19
19
|
import { ResponsiveBreadcrumbTokens } from '../components/Breadcrumb/breadcrumb.tokens';
|
|
20
20
|
import { PopoverTokenType } from '../components/Popover/popover.tokens';
|
|
21
21
|
import { ResponsiveMenuTokensType } from '../components/Menu/menu.tokens';
|
|
22
|
-
import {
|
|
22
|
+
import { ResponsiveMultiSelectTokens } from '../components/MultiSelect/multiSelect.tokens';
|
|
23
23
|
import { TableTokenType } from '../components/DataTable/dataTable.tokens';
|
|
24
24
|
import { CalendarTokenType } from '../components/DateRangePicker/dateRangePicker.tokens';
|
|
25
25
|
import { AccordionTokenType } from '../components/Accordion/accordion.tokens';
|
|
@@ -27,28 +27,30 @@ import { StatCardTokenType } from '../components/StatCard/statcard.tokens';
|
|
|
27
27
|
import { ProgressBarTokenType } from '../components/ProgressBar/progressbar.tokens';
|
|
28
28
|
import { DrawerTokensType } from '../components/Drawer/drawer.tokens';
|
|
29
29
|
import { BreakpointType } from '../breakpoints/breakPoints';
|
|
30
|
+
import { ResponsiveSingleSelectTokens } from '../components/SingleSelect/singleSelect.tokens';
|
|
30
31
|
export type ComponentTokenType = {
|
|
31
32
|
TAGS?: ResponsiveTagTokens;
|
|
32
33
|
SEARCH_INPUT?: SearchInputTokensType;
|
|
33
|
-
TEXT_AREA?:
|
|
34
|
+
TEXT_AREA?: ResponsiveTextAreaTokens;
|
|
34
35
|
RADIO?: ResponsiveRadioTokens;
|
|
35
36
|
SWITCH?: ResponsiveSwitchTokens;
|
|
36
|
-
TEXT_INPUT?:
|
|
37
|
-
NUMBER_INPUT?:
|
|
37
|
+
TEXT_INPUT?: ResponsiveTextInputTokens;
|
|
38
|
+
NUMBER_INPUT?: ResponsiveNumberInputTokens;
|
|
38
39
|
ALERT?: ResponsiveAlertTokens;
|
|
39
40
|
OTP_INPUT?: OTPInputTokensType;
|
|
40
41
|
TOOLTIP?: TooltipTokensType;
|
|
41
|
-
UNIT_INPUT?:
|
|
42
|
+
UNIT_INPUT?: ResponsiveUnitInputTokens;
|
|
42
43
|
MULTI_VALUE_INPUT?: MultiValueInputTokensType;
|
|
43
|
-
DROPDOWN_INPUT?:
|
|
44
|
+
DROPDOWN_INPUT?: ResponsiveDropdownInputTokens;
|
|
44
45
|
CHECKBOX?: ResponsiveCheckboxTokens;
|
|
45
|
-
TABS?:
|
|
46
|
+
TABS?: ResponsiveTabsTokens;
|
|
46
47
|
BUTTON?: ResponsiveButtonTokens;
|
|
47
48
|
MODAL?: ModalTokensType;
|
|
48
49
|
BREADCRUMB?: ResponsiveBreadcrumbTokens;
|
|
49
50
|
POPOVER?: PopoverTokenType;
|
|
50
51
|
MENU?: ResponsiveMenuTokensType;
|
|
51
|
-
MULTI_SELECT?:
|
|
52
|
+
MULTI_SELECT?: ResponsiveMultiSelectTokens;
|
|
53
|
+
SINGLE_SELECT?: ResponsiveSingleSelectTokens;
|
|
52
54
|
TABLE?: TableTokenType;
|
|
53
55
|
CALENDAR?: CalendarTokenType;
|
|
54
56
|
ACCORDION?: AccordionTokenType;
|