@juspay/blend-design-system 0.0.32 → 0.0.33
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/Accordion/index.d.ts +1 -0
- package/dist/components/Alert/alert.tokens.d.ts +2 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/Alert/types.d.ts +3 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/AvatarGroup/index.d.ts +1 -0
- package/dist/components/Breadcrumb/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/ButtonV2/ButtonGroupV2/ButtonGroupV2.d.ts +4 -0
- package/dist/components/ButtonV2/ButtonGroupV2/buttonGroupV2.types.d.ts +10 -0
- package/dist/components/ButtonV2/ButtonGroupV2/index.d.ts +3 -0
- package/dist/components/ButtonV2/ButtonGroupV2/utils.d.ts +3 -0
- package/dist/components/ButtonV2/ButtonV2.d.ts +24 -0
- package/dist/components/ButtonV2/IconButton.d.ts +7 -0
- package/dist/components/ButtonV2/LinkButton.d.ts +7 -0
- package/dist/components/ButtonV2/VisuallyHidden.d.ts +1 -0
- package/dist/components/ButtonV2/buttonV2.dark.tokens.d.ts +3 -0
- package/dist/components/ButtonV2/buttonV2.light.tokens.d.ts +3 -0
- package/dist/components/ButtonV2/buttonV2.tokens.d.ts +67 -0
- package/dist/components/ButtonV2/buttonV2.types.d.ts +64 -0
- package/dist/components/ButtonV2/index.d.ts +8 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Charts/CustomTooltip.d.ts +3 -1
- package/dist/components/Charts/index.d.ts +1 -0
- package/dist/components/Charts/utils.d.ts +12 -0
- package/dist/components/ChatInput/index.d.ts +1 -0
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts +1 -0
- package/dist/components/Directory/index.d.ts +1 -0
- package/dist/components/Inputs/AutofillStyles/AutofillStyles.d.ts +1 -0
- package/dist/components/Inputs/DropdownInput/index.d.ts +1 -0
- package/dist/components/Inputs/MultiValueInput/MultiValueInput.d.ts +1 -1
- package/dist/components/Inputs/MultiValueInput/index.d.ts +1 -0
- package/dist/components/Inputs/MultiValueInput/types.d.ts +2 -0
- package/dist/components/Inputs/NumberInput/index.d.ts +1 -0
- package/dist/components/Inputs/OTPInput/index.d.ts +1 -0
- package/dist/components/Inputs/SearchInput/index.d.ts +1 -0
- package/dist/components/Inputs/TextInput/index.d.ts +1 -0
- package/dist/components/Inputs/UnitInput/index.d.ts +1 -0
- package/dist/components/KeyValuePair/index.d.ts +1 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/types.d.ts +10 -0
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts +1 -0
- package/dist/components/MultiSelect/types.d.ts +1 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Primitives/Block/Block.d.ts +2 -0
- package/dist/components/Primitives/Group/Group.d.ts +4 -0
- package/dist/components/Primitives/Group/index.d.ts +3 -0
- package/dist/components/Primitives/Group/types.d.ts +81 -0
- package/dist/components/Primitives/Group/utils.d.ts +35 -0
- package/dist/components/Primitives/PrimitiveButton/PrimitiveButton.d.ts +4 -0
- package/dist/components/ProgressBar/index.d.ts +1 -0
- package/dist/components/Sidebar/index.d.ts +1 -0
- package/dist/components/SingleSelect/index.d.ts +1 -0
- package/dist/components/Snackbar/index.d.ts +1 -0
- package/dist/components/StatCard/StatCard.d.ts +1 -1
- package/dist/components/StatCard/index.d.ts +1 -0
- package/dist/components/StatCard/types.d.ts +3 -2
- package/dist/components/StatCard/utils.d.ts +1 -1
- package/dist/components/Stepper/index.d.ts +1 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Tabs/TabsList.d.ts +1 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/types.d.ts +2 -2
- package/dist/components/TagGroupV2/TagGroupV2.d.ts +4 -0
- package/dist/components/TagGroupV2/TagGroupV2.types.d.ts +8 -0
- package/dist/components/TagGroupV2/index.d.ts +2 -0
- package/dist/components/TagV2/TagSkeleton.d.ts +15 -0
- package/dist/components/TagV2/TagV2.d.ts +22 -0
- package/dist/components/TagV2/TagV2.types.d.ts +46 -0
- package/dist/components/TagV2/index.d.ts +2 -0
- package/dist/components/TagV2/tagV2.dark.tokens.d.ts +3 -0
- package/dist/components/TagV2/tagV2.light.tokens.d.ts +3 -0
- package/dist/components/TagV2/tagV2.tokens.d.ts +62 -0
- package/dist/components/TagV2/utils.d.ts +6 -0
- package/dist/components/Tags/index.d.ts +1 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Topbar/index.d.ts +1 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/components/Upload/types.d.ts +14 -0
- package/dist/components/Upload/utils.d.ts +1 -1
- package/dist/components/common/TruncatedTextWithTooltip.d.ts +1 -2
- package/dist/context/ThemeContext.d.ts +4 -0
- package/dist/context/useComponentToken.d.ts +3 -1
- package/dist/global-utils/GlobalUtils.d.ts +1 -0
- package/dist/main.js +38131 -33933
- package/dist/pollyfills/resizeObserverPollyfill.d.ts +1 -0
- package/dist/tokens/font.tokens.d.ts +55 -0
- package/dist/utils/accessibility/aria-helpers.d.ts +202 -0
- package/dist/utils/accessibility/focus-helpers.d.ts +115 -0
- package/dist/utils/accessibility/icon-helpers.d.ts +3 -0
- package/dist/utils/accessibility/index.d.ts +21 -0
- package/dist/utils/accessibility/keyboard-helpers.d.ts +117 -0
- package/dist/utils/prop-helpers.d.ts +1 -0
- package/package.json +1 -1
|
@@ -18,7 +18,9 @@ import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
|
18
18
|
* - Background uses an additional style dimension; border/button are variant-only
|
|
19
19
|
*/
|
|
20
20
|
export type AlertTokenType = {
|
|
21
|
+
width: CSSObject['width'];
|
|
21
22
|
maxWidth: CSSObject['maxWidth'];
|
|
23
|
+
minWidth: CSSObject['minWidth'];
|
|
22
24
|
gap: CSSObject['gap'];
|
|
23
25
|
padding: CSSObject['padding'];
|
|
24
26
|
borderRadius: CSSObject['borderRadius'];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ButtonV2Props } from '../buttonV2.types';
|
|
3
|
+
import { ButtonProps } from '../../Button/types';
|
|
4
|
+
export type ButtonGroupV2ChildProps = ButtonV2Props | ButtonProps;
|
|
5
|
+
export type ButtonGroupV2Props = {
|
|
6
|
+
stacked?: boolean;
|
|
7
|
+
gap?: string | number;
|
|
8
|
+
children: ReactElement<ButtonGroupV2ChildProps> | ReactElement<ButtonGroupV2ChildProps>[];
|
|
9
|
+
};
|
|
10
|
+
export type ButtonGroupPosition = 'left' | 'center' | 'right';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ButtonGroupPosition } from './buttonGroupV2.types';
|
|
2
|
+
export declare function getButtonGroupPosition(index: number, totalCount: number): ButtonGroupPosition | undefined;
|
|
3
|
+
export declare function getButtonGroupGap(stacked: boolean, providedGap?: string | number): string | number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ButtonV2Size, ButtonV2State, ButtonV2SubType, ButtonV2Type } from './buttonV2.types';
|
|
2
|
+
import { ButtonV2TokensType } from './buttonV2.tokens';
|
|
3
|
+
type RenderButtonContentProps = {
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isSkeleton: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
state: ButtonV2State;
|
|
8
|
+
buttonType: ButtonV2Type;
|
|
9
|
+
subType: ButtonV2SubType;
|
|
10
|
+
size: ButtonV2Size;
|
|
11
|
+
text?: string;
|
|
12
|
+
leftSlot?: {
|
|
13
|
+
slot: React.ReactNode;
|
|
14
|
+
maxHeight?: string | number;
|
|
15
|
+
};
|
|
16
|
+
rightSlot?: {
|
|
17
|
+
slot: React.ReactNode;
|
|
18
|
+
maxHeight?: string | number;
|
|
19
|
+
};
|
|
20
|
+
tokens: ButtonV2TokensType;
|
|
21
|
+
};
|
|
22
|
+
export declare function renderButtonContent({ isLoading, isSkeleton, disabled, state, buttonType, subType, size, text, leftSlot, rightSlot, tokens, }: RenderButtonContentProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare const ButtonV2: import('react').ForwardRefExoticComponent<import('./buttonV2.types').ButtonBaseProps & Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "style" | "className"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
export default ButtonV2;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as ButtonV2 } from './ButtonV2';
|
|
2
|
+
export type IconButtonProps = Omit<React.ComponentProps<typeof ButtonV2>, 'text' | 'leftSlot' | 'rightSlot' | 'subType'> & {
|
|
3
|
+
icon: React.ReactNode;
|
|
4
|
+
'aria-label': string;
|
|
5
|
+
};
|
|
6
|
+
declare const IconButton: import('react').ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export default IconButton;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const LinkButton: import('react').ForwardRefExoticComponent<import('./buttonV2.types').ButtonBaseProps & {
|
|
2
|
+
href: string;
|
|
3
|
+
target?: string;
|
|
4
|
+
rel?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
} & Omit<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, "style" | "className" | "rel" | "children" | "dangerouslySetInnerHTML" | "target" | "href"> & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
7
|
+
export default LinkButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VisuallyHidden: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { ButtonV2Size, ButtonV2State, ButtonV2SubType, ButtonV2Type, PaddingDirection } from './buttonV2.types';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
5
|
+
import { Theme } from '../../context/theme.enum';
|
|
6
|
+
export type ButtonV2TokensType = Readonly<{
|
|
7
|
+
gap: CSSObject['gap'];
|
|
8
|
+
backgroundColor: {
|
|
9
|
+
[key in ButtonV2Type]: {
|
|
10
|
+
[key in ButtonV2SubType]: {
|
|
11
|
+
[key in ButtonV2State]: CSSObject['background'];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
borderRadius: {
|
|
16
|
+
[key in ButtonV2Size]: {
|
|
17
|
+
[key in ButtonV2Type]: {
|
|
18
|
+
[key in ButtonV2SubType]: CSSObject['borderRadius'];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
padding: {
|
|
23
|
+
[key in PaddingDirection]: {
|
|
24
|
+
[key in ButtonV2Size]: {
|
|
25
|
+
[key in ButtonV2Type]: {
|
|
26
|
+
[key in ButtonV2SubType]: CSSObject['padding'];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
border: {
|
|
32
|
+
[key in ButtonV2Type]: {
|
|
33
|
+
[key in ButtonV2SubType]: {
|
|
34
|
+
[key in ButtonV2State]: CSSObject['border'];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
shadow: {
|
|
39
|
+
[key in ButtonV2Type]: {
|
|
40
|
+
[key in ButtonV2SubType]: {
|
|
41
|
+
[key in ButtonV2State]: CSSObject['boxShadow'];
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
text: {
|
|
46
|
+
color: {
|
|
47
|
+
[key in ButtonV2Type]: {
|
|
48
|
+
[key in ButtonV2SubType]: {
|
|
49
|
+
[key in ButtonV2State]: CSSObject['color'];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
fontSize: {
|
|
54
|
+
[key in ButtonV2Size]: CSSObject['fontSize'];
|
|
55
|
+
};
|
|
56
|
+
fontWeight: {
|
|
57
|
+
[key in ButtonV2Size]: CSSObject['fontWeight'];
|
|
58
|
+
};
|
|
59
|
+
lineHeight: {
|
|
60
|
+
[key in ButtonV2Size]: CSSObject['lineHeight'];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
export type ResponsiveButtonV2Tokens = {
|
|
65
|
+
[key in keyof BreakpointType]: ButtonV2TokensType;
|
|
66
|
+
};
|
|
67
|
+
export declare const getButtonV2Tokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveButtonV2Tokens;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SkeletonVariant } from '../Skeleton/skeleton.tokens';
|
|
3
|
+
export declare enum ButtonV2Type {
|
|
4
|
+
PRIMARY = "primary",
|
|
5
|
+
SECONDARY = "secondary",
|
|
6
|
+
DANGER = "danger",
|
|
7
|
+
SUCCESS = "success"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ButtonV2Size {
|
|
10
|
+
SMALL = "sm",
|
|
11
|
+
MEDIUM = "md",
|
|
12
|
+
LARGE = "lg"
|
|
13
|
+
}
|
|
14
|
+
export declare enum ButtonV2SubType {
|
|
15
|
+
DEFAULT = "default",
|
|
16
|
+
ICON_ONLY = "iconOnly",
|
|
17
|
+
INLINE = "inline"
|
|
18
|
+
}
|
|
19
|
+
export declare enum ButtonV2State {
|
|
20
|
+
DEFAULT = "default",
|
|
21
|
+
HOVER = "hover",
|
|
22
|
+
ACTIVE = "active",
|
|
23
|
+
DISABLED = "disabled"
|
|
24
|
+
}
|
|
25
|
+
export declare enum PaddingDirection {
|
|
26
|
+
TOP = "top",
|
|
27
|
+
RIGHT = "right",
|
|
28
|
+
BOTTOM = "bottom",
|
|
29
|
+
LEFT = "left"
|
|
30
|
+
}
|
|
31
|
+
export declare const ButtonType: typeof ButtonV2Type;
|
|
32
|
+
export declare const ButtonSize: typeof ButtonV2Size;
|
|
33
|
+
export declare const ButtonSubType: typeof ButtonV2SubType;
|
|
34
|
+
export declare const ButtonState: typeof ButtonV2State;
|
|
35
|
+
export type ButtonSlot = {
|
|
36
|
+
slot: React.ReactNode;
|
|
37
|
+
maxHeight?: string | number;
|
|
38
|
+
};
|
|
39
|
+
export type ButtonSkeleton = {
|
|
40
|
+
showSkeleton?: boolean;
|
|
41
|
+
skeletonVariant?: SkeletonVariant;
|
|
42
|
+
};
|
|
43
|
+
export type ButtonBaseProps = {
|
|
44
|
+
buttonType?: ButtonV2Type;
|
|
45
|
+
size?: ButtonV2Size;
|
|
46
|
+
subType?: ButtonV2SubType;
|
|
47
|
+
text?: string;
|
|
48
|
+
leftSlot?: ButtonSlot;
|
|
49
|
+
rightSlot?: ButtonSlot;
|
|
50
|
+
loading?: boolean;
|
|
51
|
+
skeleton?: ButtonSkeleton;
|
|
52
|
+
buttonGroupPosition?: 'center' | 'left' | 'right';
|
|
53
|
+
width?: string | number;
|
|
54
|
+
minWidth?: string | number;
|
|
55
|
+
maxWidth?: string | number;
|
|
56
|
+
state?: ButtonV2State;
|
|
57
|
+
};
|
|
58
|
+
export type ButtonV2Props = ButtonBaseProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style' | 'className'>;
|
|
59
|
+
export type LinkButtonProps = ButtonBaseProps & {
|
|
60
|
+
href: string;
|
|
61
|
+
target?: string;
|
|
62
|
+
rel?: string;
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'rel' | 'children' | 'className' | 'style' | 'dangerouslySetInnerHTML'>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as ButtonV2 } from './ButtonV2';
|
|
2
|
+
export { default as IconButton } from './IconButton';
|
|
3
|
+
export { default as LinkButton } from './LinkButton';
|
|
4
|
+
export { ButtonGroupV2 } from './ButtonGroupV2';
|
|
5
|
+
export type { ButtonV2Props, LinkButtonProps } from './buttonV2.types';
|
|
6
|
+
export type { IconButtonProps } from './IconButton';
|
|
7
|
+
export type { ButtonGroupV2Props, ButtonGroupPosition } from './ButtonGroupV2';
|
|
8
|
+
export * from './buttonV2.types';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { CustomTooltipProps } from './types';
|
|
1
|
+
import { CustomTooltipProps, NewNestedDataPoint } from './types';
|
|
2
|
+
export declare const findDataPointByLabel: (originalData: NewNestedDataPoint[], label: string | number) => NewNestedDataPoint | undefined;
|
|
3
|
+
export declare const getRelevantData: (originalData: NewNestedDataPoint[], label: string | number, hoveredKey: string) => import('./types').DataPoint | null;
|
|
2
4
|
export declare const CustomTooltip: ({ active, payload, label, hoveredKey, originalData, setHoveredKey, chartType, selectedKeys, xAxis, yAxis, }: CustomTooltipProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -8,5 +8,6 @@ export { default as SankeyLink } from './SankeyLink';
|
|
|
8
8
|
export { default as BlendChart } from './BlendChart';
|
|
9
9
|
export { default as BlendChartContainer } from './BlendChartContainer';
|
|
10
10
|
export { default as BlendChartHeader } from './BlendChartHeader';
|
|
11
|
+
export * from './chart.tokens';
|
|
11
12
|
export * from './types';
|
|
12
13
|
export * from './BlendChart.types';
|
|
@@ -2,3 +2,15 @@ export declare const DEFAULT_COLORS: {
|
|
|
2
2
|
key: string;
|
|
3
3
|
color: string;
|
|
4
4
|
}[];
|
|
5
|
+
/**
|
|
6
|
+
* Gets the color value for a given key from the colors array
|
|
7
|
+
* Tries to match by key first, then falls back to index-based lookup
|
|
8
|
+
* @param dataKey - The key to match against color objects
|
|
9
|
+
* @param colors - Array of color objects or strings
|
|
10
|
+
* @param index - Fallback index if key match is not found
|
|
11
|
+
* @returns The color string value
|
|
12
|
+
*/
|
|
13
|
+
export declare const getColorByKey: (dataKey: string, colors: Array<{
|
|
14
|
+
key: string;
|
|
15
|
+
color: string;
|
|
16
|
+
} | string>, index: number) => string;
|
|
@@ -5,6 +5,6 @@ export * from './TableBody/types';
|
|
|
5
5
|
export * from './TableCell/types';
|
|
6
6
|
export * from './TableFooter/types';
|
|
7
7
|
export * from './DataTableHeader/types';
|
|
8
|
-
export
|
|
8
|
+
export * from './dataTable.tokens';
|
|
9
9
|
export { validateColumnData, getColumnTypeConfig } from './columnTypes';
|
|
10
10
|
export type { ColumnFilterOption, SelectData, MultiSelectData, DateData, DateRangeData, TagData, ColumnDataTypeMap, GetColumnDataType, ColumnTypeConfig, AvatarData as DataTableAvatarData, } from './columnTypes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AutofillStyles: import('react').NamedExoticComponent<import('styled-components').ExecutionProps & object>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MultiValueInputProps } from './types';
|
|
2
|
-
declare const MultiValueInput: ({ value, label, sublabel, helpIconHintText, disabled, required, error, errorMessage, hintText, tags, onTagAdd, onTagRemove, onChange, size, onFocus, onBlur, name, id: providedId, ...rest }: MultiValueInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MultiValueInput: ({ value, label, sublabel, helpIconHintText, disabled, required, error, errorMessage, hintText, tags, onTagAdd, onTagRemove, onChange, size, onFocus, onBlur, name, id: providedId, leftSlot, rightSlot, ...rest }: MultiValueInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MultiValueInput;
|
|
@@ -27,4 +27,6 @@ export type MultiValueInputProps = {
|
|
|
27
27
|
size?: TextInputSize;
|
|
28
28
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
29
29
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
30
|
+
leftSlot?: React.ReactNode;
|
|
31
|
+
rightSlot?: React.ReactNode;
|
|
30
32
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className' | 'onChange' | 'value' | 'onFocus' | 'onBlur'>;
|
|
@@ -39,6 +39,12 @@ export type MenuProps = {
|
|
|
39
39
|
collisonBoundaryRef?: Element | null | Array<Element | null>;
|
|
40
40
|
skeleton?: MenuSkeletonProps;
|
|
41
41
|
};
|
|
42
|
+
export type SubMenuVirtualScrollProps = {
|
|
43
|
+
enableVirtualScrolling?: boolean;
|
|
44
|
+
virtualItemHeight?: number;
|
|
45
|
+
virtualOverscan?: number;
|
|
46
|
+
virtualScrollThreshold?: number;
|
|
47
|
+
};
|
|
42
48
|
export declare enum MenuItemVariant {
|
|
43
49
|
DEFAULT = "default",
|
|
44
50
|
ACTION = "action"
|
|
@@ -70,6 +76,10 @@ export type MenuItemType = {
|
|
|
70
76
|
delayDuration?: number;
|
|
71
77
|
offset?: number;
|
|
72
78
|
};
|
|
79
|
+
enableSubMenuVirtualScrolling?: boolean;
|
|
80
|
+
subMenuVirtualItemHeight?: number;
|
|
81
|
+
subMenuVirtualOverscan?: number;
|
|
82
|
+
subMenuVirtualScrollThreshold?: number;
|
|
73
83
|
};
|
|
74
84
|
export type MenuGroupType = {
|
|
75
85
|
label?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MultiSelectProps } from './types';
|
|
2
|
-
declare const MultiSelect: ({ selectedValues, onChange, items, label, sublabel, disabled, helpIconHintText, name, required, variant, selectionTagType, slot, hintText, placeholder, size, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, customTrigger, useDrawerOnMobile, minMenuWidth, maxMenuWidth, maxMenuHeight, alignment, side, sideOffset, alignOffset, inline, onBlur, onFocus, error, errorMessage, showActionButtons, primaryAction, secondaryAction, showItemDividers, showHeaderBorder, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, itemsToRender, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, showClearButton, onClearAllClick, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MultiSelect: ({ selectedValues, onChange, items, label, sublabel, disabled, helpIconHintText, name, required, variant, selectionTagType, slot, hintText, placeholder, size, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, customTrigger, useDrawerOnMobile, minMenuWidth, maxMenuWidth, maxMenuHeight, alignment, side, sideOffset, alignOffset, inline, onBlur, onFocus, error, errorMessage, showActionButtons, primaryAction, secondaryAction, showItemDividers, showHeaderBorder, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, itemsToRender, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, showClearButton, onClearAllClick, onOpenChange, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MultiSelect;
|
|
@@ -88,6 +88,7 @@ type StyledBlockProps = StateStyles & {
|
|
|
88
88
|
textAlign?: CSSObject['textAlign'];
|
|
89
89
|
textTransform?: CSSObject['textTransform'];
|
|
90
90
|
textOverflow?: CSSObject['textOverflow'];
|
|
91
|
+
userSelect?: CSSObject['userSelect'];
|
|
91
92
|
};
|
|
92
93
|
type SemanticTagType = keyof Pick<JSX.IntrinsicElements, 'div' | 'section' | 'article' | 'header' | 'footer' | 'main' | 'span' | 'nav' | 'hr'>;
|
|
93
94
|
export type BlockProps = StyledBlockProps & Omit<React.HTMLAttributes<HTMLElement>, 'as' | 'color'> & {
|
|
@@ -182,6 +183,7 @@ declare const Block: React.ForwardRefExoticComponent<StateStyles & {
|
|
|
182
183
|
textAlign?: CSSObject["textAlign"];
|
|
183
184
|
textTransform?: CSSObject["textTransform"];
|
|
184
185
|
textOverflow?: CSSObject["textOverflow"];
|
|
186
|
+
userSelect?: CSSObject["userSelect"];
|
|
185
187
|
} & Omit<React.HTMLAttributes<HTMLElement>, "color" | "as"> & {
|
|
186
188
|
children?: React.ReactNode;
|
|
187
189
|
as?: SemanticTagType;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Position of an element within a group
|
|
4
|
+
*/
|
|
5
|
+
export declare enum GroupPosition {
|
|
6
|
+
LEFT = "left",
|
|
7
|
+
CENTER = "center",
|
|
8
|
+
RIGHT = "right",
|
|
9
|
+
TOP = "top",
|
|
10
|
+
MIDDLE = "middle",
|
|
11
|
+
BOTTOM = "bottom"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Orientation of the group layout
|
|
15
|
+
*/
|
|
16
|
+
export declare enum GroupOrientation {
|
|
17
|
+
HORIZONTAL = "horizontal",
|
|
18
|
+
VERTICAL = "vertical"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Safe HTML div attributes for restProps
|
|
22
|
+
*/
|
|
23
|
+
type SafeDivAttributes = Omit<React.HTMLAttributes<HTMLDivElement>, 'display'>;
|
|
24
|
+
/**
|
|
25
|
+
* Props for the Group component
|
|
26
|
+
*/
|
|
27
|
+
export interface GroupProps extends Omit<SafeDivAttributes, 'aria-label'> {
|
|
28
|
+
/**
|
|
29
|
+
* Child elements to be grouped
|
|
30
|
+
*/
|
|
31
|
+
children: ReactElement | ReactElement[];
|
|
32
|
+
/**
|
|
33
|
+
* Whether elements should be stacked (no gap, connected borders)
|
|
34
|
+
* When true, position props are injected into children
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
stacked?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Layout orientation
|
|
40
|
+
* @default 'horizontal'
|
|
41
|
+
*/
|
|
42
|
+
orientation?: GroupOrientation;
|
|
43
|
+
/**
|
|
44
|
+
* Gap between elements when not stacked
|
|
45
|
+
* Uses foundation tokens if not provided
|
|
46
|
+
*/
|
|
47
|
+
gap?: string | number;
|
|
48
|
+
/**
|
|
49
|
+
* Alignment of items along the cross axis
|
|
50
|
+
* @default 'stretch'
|
|
51
|
+
*/
|
|
52
|
+
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
53
|
+
/**
|
|
54
|
+
* Alignment of items along the main axis
|
|
55
|
+
*/
|
|
56
|
+
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
57
|
+
/**
|
|
58
|
+
* Whether items should wrap
|
|
59
|
+
* @default 'nowrap'
|
|
60
|
+
*/
|
|
61
|
+
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
62
|
+
/**
|
|
63
|
+
* ARIA role for the group
|
|
64
|
+
* @default 'group'
|
|
65
|
+
*/
|
|
66
|
+
role?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Accessible label for the group
|
|
69
|
+
*/
|
|
70
|
+
'aria-label'?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Name of the prop to inject into children for position
|
|
73
|
+
* Different components may use different prop names:
|
|
74
|
+
* - ButtonV2: 'buttonGroupPosition'
|
|
75
|
+
* - Tag: 'splitTagPosition'
|
|
76
|
+
* - FormField: 'fieldGroupPosition'
|
|
77
|
+
* @default 'groupPosition'
|
|
78
|
+
*/
|
|
79
|
+
positionProp?: string;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { GroupPosition, GroupOrientation } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Calculate element position within a group based on index and total count
|
|
4
|
+
*
|
|
5
|
+
* @param index - Current element index (0-based)
|
|
6
|
+
* @param totalCount - Total number of elements in group
|
|
7
|
+
* @param orientation - Group orientation (horizontal or vertical)
|
|
8
|
+
* @returns Position enum value or undefined if single element
|
|
9
|
+
*/
|
|
10
|
+
export declare function getGroupPosition(index: number, totalCount: number, orientation?: GroupOrientation): GroupPosition | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Get gap value for group based on stacked mode and orientation
|
|
13
|
+
* Uses foundation tokens if gap is not provided
|
|
14
|
+
*
|
|
15
|
+
* @param stacked - Whether group is in stacked mode (no gap)
|
|
16
|
+
* @param providedGap - User-provided gap value
|
|
17
|
+
* @param orientation - Group orientation enum
|
|
18
|
+
* @returns Gap value as string or number
|
|
19
|
+
*/
|
|
20
|
+
export declare function getGroupGap(stacked: boolean, providedGap?: string | number, orientation?: GroupOrientation): string | number;
|
|
21
|
+
/**
|
|
22
|
+
* Helper to convert position prop name to match component's expected prop
|
|
23
|
+
* This allows the Group to work with different component APIs
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // For ButtonV2
|
|
27
|
+
* getPositionPropName('buttonGroupPosition') // 'buttonGroupPosition'
|
|
28
|
+
*
|
|
29
|
+
* // For Tag
|
|
30
|
+
* getPositionPropName('splitTagPosition') // 'splitTagPosition'
|
|
31
|
+
*
|
|
32
|
+
* @param propName - Name of the position prop
|
|
33
|
+
* @returns The same prop name (identity function for type safety)
|
|
34
|
+
*/
|
|
35
|
+
export declare function getPositionPropName(propName?: string): string;
|
|
@@ -15,6 +15,8 @@ type PrimitiveButtonProps = StateStyles & {
|
|
|
15
15
|
paddingY?: CSSObject['padding'];
|
|
16
16
|
paddingTop?: CSSObject['padding'];
|
|
17
17
|
paddingBottom?: CSSObject['padding'];
|
|
18
|
+
paddingLeft?: CSSObject['padding'];
|
|
19
|
+
paddingRight?: CSSObject['padding'];
|
|
18
20
|
margin?: CSSObject['margin'];
|
|
19
21
|
marginX?: CSSObject['margin'];
|
|
20
22
|
marginY?: CSSObject['margin'];
|
|
@@ -79,6 +81,8 @@ declare const PrimitiveButton: React.ForwardRefExoticComponent<StateStyles & {
|
|
|
79
81
|
paddingY?: CSSObject["padding"];
|
|
80
82
|
paddingTop?: CSSObject["padding"];
|
|
81
83
|
paddingBottom?: CSSObject["padding"];
|
|
84
|
+
paddingLeft?: CSSObject["padding"];
|
|
85
|
+
paddingRight?: CSSObject["padding"];
|
|
82
86
|
margin?: CSSObject["margin"];
|
|
83
87
|
marginX?: CSSObject["margin"];
|
|
84
88
|
marginY?: CSSObject["margin"];
|