@cube-dev/ui-kit 0.6.61 → 0.7.2
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/cjs/components/content/PrismCode/PrismCode.d.ts +2 -2
- package/dist/cjs/components/content/Text.d.ts +0 -2
- package/dist/cjs/components/forms/TextInput/TextInputBase.d.ts +1 -1
- package/dist/cjs/components/layout/Flex.d.ts +2 -2
- package/dist/cjs/components/layout/Grid.d.ts +2 -2
- package/dist/cjs/components/layout/Space.d.ts +2 -2
- package/dist/cjs/components/pickers/ComboBox/ComboBox.d.ts +1 -1
- package/dist/cjs/components/pickers/Select/Select.d.ts +1 -2
- package/dist/cjs/components/types.d.ts +19 -6
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +14 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/providers/BreakpointsProvider.d.ts +7 -5
- package/dist/cjs/providers/StylesProvider.d.ts +8 -6
- package/dist/cjs/shared/form.d.ts +7 -0
- package/dist/cjs/stories/components/StyledButton.d.ts +4 -0
- package/dist/cjs/styled.d.ts +7 -26
- package/dist/cjs/styles/align.d.ts +9 -0
- package/dist/cjs/styles/justify.d.ts +9 -0
- package/dist/cjs/styles/list.d.ts +2 -2
- package/dist/cjs/styles/margin.d.ts +7 -1
- package/dist/cjs/styles/marginBlock.d.ts +8 -0
- package/dist/cjs/styles/marginInline.d.ts +8 -0
- package/dist/cjs/styles/types.d.ts +13 -4
- package/dist/cjs/{css-properties.d.ts → tokens.d.ts} +13 -2
- package/dist/cjs/utils/mergeStyles.d.ts +2 -0
- package/dist/cjs/utils/renderStyles.d.ts +1 -0
- package/dist/cjs/utils/responsive.d.ts +1 -1
- package/dist/cjs/utils/styles.d.ts +3 -3
- package/dist/mjs/components/content/PrismCode/PrismCode.d.ts +2 -2
- package/dist/mjs/components/content/Text.d.ts +0 -2
- package/dist/mjs/components/forms/TextInput/TextInputBase.d.ts +1 -1
- package/dist/mjs/components/layout/Flex.d.ts +2 -2
- package/dist/mjs/components/layout/Grid.d.ts +2 -2
- package/dist/mjs/components/layout/Space.d.ts +2 -2
- package/dist/mjs/components/pickers/ComboBox/ComboBox.d.ts +1 -1
- package/dist/mjs/components/pickers/Select/Select.d.ts +1 -2
- package/dist/mjs/components/types.d.ts +19 -6
- package/dist/mjs/index.d.ts +1 -1
- package/dist/mjs/index.js +15 -12
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/providers/BreakpointsProvider.d.ts +7 -5
- package/dist/mjs/providers/StylesProvider.d.ts +8 -6
- package/dist/mjs/shared/form.d.ts +7 -0
- package/dist/mjs/stories/components/StyledButton.d.ts +4 -0
- package/dist/mjs/styled.d.ts +7 -26
- package/dist/mjs/styles/align.d.ts +9 -0
- package/dist/mjs/styles/justify.d.ts +9 -0
- package/dist/mjs/styles/list.d.ts +2 -2
- package/dist/mjs/styles/margin.d.ts +7 -1
- package/dist/mjs/styles/marginBlock.d.ts +8 -0
- package/dist/mjs/styles/marginInline.d.ts +8 -0
- package/dist/mjs/styles/types.d.ts +13 -4
- package/dist/mjs/{css-properties.d.ts → tokens.d.ts} +13 -2
- package/dist/mjs/utils/mergeStyles.d.ts +2 -0
- package/dist/mjs/utils/renderStyles.d.ts +1 -0
- package/dist/mjs/utils/responsive.d.ts +1 -1
- package/dist/mjs/utils/styles.d.ts +3 -3
- package/package.json +82 -81
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export declare const BreakpointsContext: import("react").Context<number[]>;
|
|
3
|
-
|
|
4
|
-
value:
|
|
5
|
-
children:
|
|
6
|
-
}
|
|
3
|
+
interface BreakpointsProviderProps {
|
|
4
|
+
value: number[];
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function BreakpointsProvider({ value, children, }: BreakpointsProviderProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { Styles } from '../styles/types';
|
|
3
3
|
export declare const StyleContext: import("react").Context<any>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export declare function
|
|
4
|
+
interface StyleProviderProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export declare function StyleProvider({ children, ...props }: StyleProviderProps): JSX.Element;
|
|
9
|
+
export declare function useContextStyles(name: string, props?: Record<string, any>): Styles | null;
|
|
10
|
+
export {};
|
|
@@ -44,11 +44,18 @@ export interface FormBaseProps {
|
|
|
44
44
|
validateTrigger?: ValidateTrigger;
|
|
45
45
|
}
|
|
46
46
|
export interface FormFieldProps extends FormBaseProps {
|
|
47
|
+
/** Whether the field is inside the form. Private field. */
|
|
47
48
|
insideForm?: boolean;
|
|
49
|
+
/** A text label of the field */
|
|
48
50
|
label?: ReactNode;
|
|
51
|
+
/** Custom label props */
|
|
49
52
|
labelProps?: Props;
|
|
53
|
+
/** Message for the field. Some additional information or error notice. */
|
|
50
54
|
message?: ReactNode;
|
|
55
|
+
/** A tooltip that is shown inside the label */
|
|
51
56
|
tooltip?: ReactNode;
|
|
57
|
+
/** Whether the element should receive focus on render. */
|
|
58
|
+
autoFocus?: boolean;
|
|
52
59
|
}
|
|
53
60
|
export declare type ValidationRuleBase = {
|
|
54
61
|
[key: string]: any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledButton: import("react").ComponentType<import("../../components/actions/Button/Button").CubeButtonProps & import("react").RefAttributes<import("@react-types/shared").FocusableRefValue<HTMLElement, HTMLElement>>>;
|
|
3
|
+
export declare const GlobalStyledHeading: any;
|
|
4
|
+
export declare function Block(): JSX.Element;
|
package/dist/cjs/styled.d.ts
CHANGED
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { AllBaseProps, BaseStyleProps,
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { AllBaseProps, BaseStyleProps, StyledProps } from './components/types';
|
|
3
3
|
import { Styles, StylesInterface } from './styles/types';
|
|
4
4
|
import { ResponsiveStyleValue } from './utils/styles';
|
|
5
|
-
export
|
|
6
|
-
/** The name of the element. It can be used to override styles in context. */
|
|
7
|
-
name?: string;
|
|
8
|
-
/** The tag name of the element. */
|
|
9
|
-
tag?: string;
|
|
10
|
-
/** Default styles of the element. */
|
|
11
|
-
styles?: Styles;
|
|
12
|
-
/** Default css of the element. */
|
|
13
|
-
css?: string | ((props: Props) => string);
|
|
14
|
-
/** Default attributes */
|
|
15
|
-
attrs?: Record<string, any>;
|
|
16
|
-
/** The list of styles that can be provided by props */
|
|
17
|
-
styleProps?: K;
|
|
18
|
-
/** The list of available modifiers. Providing it will show a warning each time you set an incorrect modifier on the element */
|
|
19
|
-
availableMods?: T[];
|
|
20
|
-
}
|
|
21
|
-
export declare type PossibleStyleNames = readonly (keyof StylesInterface)[];
|
|
22
|
-
export declare type AllPossibleStyleNames = readonly (keyof StylesInterface)[];
|
|
23
|
-
export declare type AllBasePropsWithMods<T extends string, K extends PossibleStyleNames> = Omit<AllBaseProps, 'mods'> & {
|
|
24
|
-
mods?: Record<T, boolean | null | undefined>;
|
|
25
|
-
} & {
|
|
5
|
+
export declare type AllBasePropsWithMods<K extends (keyof StylesInterface)[]> = AllBaseProps & {
|
|
26
6
|
[key in K[number]]?: ResponsiveStyleValue<StylesInterface[key]>;
|
|
27
7
|
} & BaseStyleProps;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
8
|
+
declare function styled<K extends (keyof StylesInterface)[]>(options: StyledProps<K>, secondArg?: never): any;
|
|
9
|
+
declare function styled(selector: string, styles?: Styles): any;
|
|
10
|
+
declare function styled<K extends (keyof StylesInterface)[], C = {}>(Component: ComponentType<C>, options?: Pick<StyledProps<K>, 'styles' | 'props' | 'name' | 'tag'>): ComponentType<C>;
|
|
11
|
+
export { styled };
|
|
@@ -4,6 +4,6 @@ export declare const BLOCK_STYLES: readonly ["reset", "padding", "paddingInline"
|
|
|
4
4
|
export declare const COLOR_STYLES: readonly ["color", "fill"];
|
|
5
5
|
export declare const TEXT_STYLES: readonly ["textTransform", "fontWeight", "fontStyle"];
|
|
6
6
|
export declare const DIMENSION_STYLES: readonly ["width", "height", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
7
|
-
export declare const FLOW_STYLES: readonly ["flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
8
|
-
export declare const CONTAINER_STYLES: readonly ["display", "font", "preset", "hide", "opacity", "whiteSpace", "color", "fill", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "reset", "padding", "paddingInline", "paddingBlock", "shadow", "border", "radius", "opacity", "overflow", "styledScrollbar", "hide", "outline", "textAlign", "flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
7
|
+
export declare const FLOW_STYLES: readonly ["flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
8
|
+
export declare const CONTAINER_STYLES: readonly ["display", "font", "preset", "hide", "opacity", "whiteSpace", "color", "fill", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "reset", "padding", "paddingInline", "paddingBlock", "shadow", "border", "radius", "opacity", "overflow", "styledScrollbar", "hide", "outline", "textAlign", "flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
9
9
|
export declare const OUTER_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
export declare function marginStyle({ margin }: {
|
|
1
|
+
export declare function marginStyle({ margin, marginBlock, marginInline, marginTop, marginRight, marginBottom, marginLeft, }: {
|
|
2
2
|
margin: any;
|
|
3
|
+
marginBlock: any;
|
|
4
|
+
marginInline: any;
|
|
5
|
+
marginTop: any;
|
|
6
|
+
marginRight: any;
|
|
7
|
+
marginBottom: any;
|
|
8
|
+
marginLeft: any;
|
|
3
9
|
}): any;
|
|
4
10
|
export declare namespace marginStyle {
|
|
5
11
|
var __lookupStyles: string[];
|
|
@@ -4,7 +4,7 @@ declare type NamedColor = 'purple' | 'purple-text' | 'purple-01' | 'purple-02' |
|
|
|
4
4
|
declare type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
5
5
|
declare type OpaquePercentage = '' | `.${Digit}` | `.${Digit}${Digit}` | '.100';
|
|
6
6
|
export declare type NoType = false | null | undefined;
|
|
7
|
-
export interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline'> {
|
|
7
|
+
export interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type'> {
|
|
8
8
|
/** Set the background color of the element.
|
|
9
9
|
* ```
|
|
10
10
|
* fill="#{name_of_the_color}"
|
|
@@ -48,7 +48,7 @@ export interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' |
|
|
|
48
48
|
* Syntax: `[[<value> | [ <verticalValue> <horizontalValue>] ]? [ [ leaf | backleaf ] | [ 'top' | 'right' | 'bottom' | 'top' ]{1,2} ] ] | [ 'round' | 'ellipse' ] | true`
|
|
49
49
|
* Examples: `"1x"`, `"2x 4x"`, `"top"`, `"round"`, `"3x leaf"`, `"ellipse"`.
|
|
50
50
|
*/
|
|
51
|
-
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | string;
|
|
51
|
+
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | string | true;
|
|
52
52
|
/**
|
|
53
53
|
* The group radius style rounds the corners of a container's outer border edge by applying radius style to to its children.
|
|
54
54
|
* Syntax: `<value> [ 'round' | 'ellipse' ]? | true`
|
|
@@ -90,9 +90,18 @@ export interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' |
|
|
|
90
90
|
* The preset style sets the base text settings according to the names preset. Affected styles: `font-size`, `line-height`, `letter-spacing`, `font-weight` and `text-transform`.
|
|
91
91
|
*/
|
|
92
92
|
preset?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h5s' | 'h5m' | 'h6' | 't1' | 't2' | 't3' | 't4' | 't4m' | 'p1' | 'p2' | 'p3' | 'p4' | 'tag' | 'default' | string;
|
|
93
|
+
/**
|
|
94
|
+
* Shorthand for align-items and align-content.
|
|
95
|
+
*/
|
|
96
|
+
align?: CSSProperties['alignItems'] | CSSProperties['alignContent'];
|
|
97
|
+
/**
|
|
98
|
+
* Shorthand for justify-items and justify-content.
|
|
99
|
+
*/
|
|
100
|
+
justify?: CSSProperties['justifyItems'] | CSSProperties['justifyContent'];
|
|
93
101
|
}
|
|
94
|
-
export declare type
|
|
95
|
-
export declare type
|
|
102
|
+
export declare type SuffixForSelector = '&' | '.' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
|
103
|
+
export declare type Selector = `${SuffixForSelector}${string}`;
|
|
104
|
+
export declare type NotSelector = Exclude<string, Selector | keyof StylesInterface>;
|
|
96
105
|
export declare type StylesWithoutSelectors = {
|
|
97
106
|
[key in keyof StylesInterface]?: ResponsiveStyleValue<StylesInterface[key]>;
|
|
98
107
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const TOKENS: {
|
|
2
2
|
'font-size': string;
|
|
3
3
|
'line-height': string;
|
|
4
4
|
'input-font-size': string;
|
|
@@ -9,6 +9,7 @@ declare const PROPS: {
|
|
|
9
9
|
'outline-width': string;
|
|
10
10
|
'border-width': string;
|
|
11
11
|
radius: string;
|
|
12
|
+
'leaf-sharp-radius': string;
|
|
12
13
|
transition: string;
|
|
13
14
|
'clear-color': string;
|
|
14
15
|
'border-color': string;
|
|
@@ -117,6 +118,16 @@ declare const PROPS: {
|
|
|
117
118
|
'p4-line-height': string;
|
|
118
119
|
'p4-letter-spacing': string;
|
|
119
120
|
'p4-font-weight': string;
|
|
121
|
+
'c1-font-size': string;
|
|
122
|
+
'c1-line-height': string;
|
|
123
|
+
'c1-letter-spacing': string;
|
|
124
|
+
'c1-font-weight': string;
|
|
125
|
+
'c1-text-transform': string;
|
|
126
|
+
'c2-font-size': string;
|
|
127
|
+
'c2-line-height': string;
|
|
128
|
+
'c2-letter-spacing': string;
|
|
129
|
+
'c2-font-weight': string;
|
|
130
|
+
'c2-text-transform': string;
|
|
120
131
|
'tag-font-size': string;
|
|
121
132
|
'tag-line-height': string;
|
|
122
133
|
'tag-letter-spacing': string;
|
|
@@ -138,4 +149,4 @@ declare const PROPS: {
|
|
|
138
149
|
'default-letter-spacing': string;
|
|
139
150
|
'default-font-weight': string;
|
|
140
151
|
};
|
|
141
|
-
export
|
|
152
|
+
export { TOKENS };
|
|
@@ -6,4 +6,4 @@ export interface ResponsiveZone {
|
|
|
6
6
|
mediaQuery?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare function pointsToZones(points: number[]): any;
|
|
9
|
-
export declare function normalizeStyleZones(value: ResponsiveStyleValue, zoneNumber: number): any[] | null
|
|
9
|
+
export declare function normalizeStyleZones(value: ResponsiveStyleValue, zoneNumber: number): any[] | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Styles } from '../styles/types';
|
|
2
|
-
export declare type StyleValue<T = string> =
|
|
2
|
+
export declare type StyleValue<T = string> = T | boolean | number | null;
|
|
3
3
|
export declare type StyleValueStateMap<T = string> = {
|
|
4
4
|
[key: string]: StyleValue<T>;
|
|
5
5
|
};
|
|
@@ -57,7 +57,7 @@ export declare const CUSTOM_UNITS: {
|
|
|
57
57
|
lh: string;
|
|
58
58
|
rp: string;
|
|
59
59
|
gp: string;
|
|
60
|
-
wh: string;
|
|
60
|
+
wh: (num: any) => string;
|
|
61
61
|
sp: (num: any) => string;
|
|
62
62
|
};
|
|
63
63
|
export declare const DIRECTIONS: string[];
|
|
@@ -176,7 +176,7 @@ export declare function styleStateMapToStyleStateDataList(styleStateMap: StyleSt
|
|
|
176
176
|
states: {
|
|
177
177
|
model: null;
|
|
178
178
|
mods: never[];
|
|
179
|
-
value: string | number | boolean | null
|
|
179
|
+
value: string | number | boolean | null;
|
|
180
180
|
}[];
|
|
181
181
|
mods: never[];
|
|
182
182
|
} | {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseProps } from '../../types';
|
|
2
|
+
import { BaseProps, ContainerStyleProps } from '../../types';
|
|
3
3
|
import { Styles } from '../../../styles/types';
|
|
4
|
-
export interface CubePrismCodeProps {
|
|
4
|
+
export interface CubePrismCodeProps extends ContainerStyleProps {
|
|
5
5
|
/** The CSS style map */
|
|
6
6
|
style?: BaseProps['style'];
|
|
7
7
|
styles?: Styles;
|
|
@@ -2,7 +2,6 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
import { ResponsiveStyleValue } from '../../utils/styles';
|
|
3
3
|
import { BaseProps, BaseStyleProps, ColorStyleProps, TagNameProps, TextStyleProps } from '../types';
|
|
4
4
|
export declare const TEXT_PROP_MAP: {
|
|
5
|
-
readonly align: "textAlign";
|
|
6
5
|
readonly transform: "textTransform";
|
|
7
6
|
readonly weight: "fontWeight";
|
|
8
7
|
readonly italic: "fontStyle";
|
|
@@ -25,7 +24,6 @@ export interface CubeTextProps extends BaseProps, TagNameProps, TextStyleProps,
|
|
|
25
24
|
*/
|
|
26
25
|
italic?: ResponsiveStyleValue<CSSProperties['fontStyle']>;
|
|
27
26
|
weight?: string | number;
|
|
28
|
-
align?: ResponsiveStyleValue<CSSProperties['textAlign']>;
|
|
29
27
|
transform?: ResponsiveStyleValue<CSSProperties['textTransform']>;
|
|
30
28
|
}
|
|
31
29
|
declare const Text: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>> & {
|
|
@@ -20,7 +20,7 @@ export interface CubeTextInputBaseProps extends BaseProps, PositionStyleProps, D
|
|
|
20
20
|
/** Direct input wrapper props */
|
|
21
21
|
wrapperProps?: Props;
|
|
22
22
|
/** The input ref */
|
|
23
|
-
inputRef?: RefObject<HTMLInputElement>;
|
|
23
|
+
inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>;
|
|
24
24
|
/** The wrapper ref */
|
|
25
25
|
wrapperRef?: RefObject<HTMLDivElement>;
|
|
26
26
|
/** Whether the input has the loading status */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseProps, ContainerStyleProps
|
|
3
|
-
export interface CubeFlexProps extends BaseProps, ContainerStyleProps
|
|
2
|
+
import { BaseProps, ContainerStyleProps } from '../types';
|
|
3
|
+
export interface CubeFlexProps extends BaseProps, ContainerStyleProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const Flex: import("react").ForwardRefExoticComponent<CubeFlexProps & import("react").RefAttributes<unknown>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseProps, ContainerStyleProps, ShortGridStyles
|
|
3
|
-
export interface CubeGridProps extends BaseProps, ContainerStyleProps,
|
|
2
|
+
import { BaseProps, ContainerStyleProps, ShortGridStyles } from '../types';
|
|
3
|
+
export interface CubeGridProps extends BaseProps, ContainerStyleProps, ShortGridStyles {
|
|
4
4
|
}
|
|
5
5
|
export declare const Grid: import("react").ForwardRefExoticComponent<CubeGridProps & import("react").RefAttributes<unknown>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseProps, ContainerStyleProps
|
|
3
|
-
export interface CubeSpaceProps extends BaseProps, ContainerStyleProps
|
|
2
|
+
import { BaseProps, ContainerStyleProps } from '../types';
|
|
3
|
+
export interface CubeSpaceProps extends BaseProps, ContainerStyleProps {
|
|
4
4
|
direction?: 'vertical' | 'horizontal';
|
|
5
5
|
}
|
|
6
6
|
export declare const Space: import("react").ForwardRefExoticComponent<CubeSpaceProps & import("react").RefAttributes<unknown>>;
|
|
@@ -5,7 +5,7 @@ import { ComboBoxProps } from '@react-types/combobox';
|
|
|
5
5
|
export interface CubeComboBoxProps<T> extends Omit<CubeSelectBaseProps<T>, 'onOpenChange'>, ComboBoxProps<T>, CollectionBase<T> {
|
|
6
6
|
multiLine?: boolean;
|
|
7
7
|
autoComplete?: string;
|
|
8
|
-
inputRef?: RefObject<HTMLInputElement
|
|
8
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
9
9
|
/** The ref for the list box popover. */
|
|
10
10
|
popoverRef?: RefObject<HTMLDivElement>;
|
|
11
11
|
/** The ref for the list box. */
|
|
@@ -26,7 +26,7 @@ export interface CubeSelectProps<T> extends CubeSelectBaseProps<T> {
|
|
|
26
26
|
listBoxRef?: RefObject<HTMLElement>;
|
|
27
27
|
size?: 'small' | 'default' | 'large' | string;
|
|
28
28
|
}
|
|
29
|
-
export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps,
|
|
29
|
+
export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps, shouldUseVirtualFocus, placement, minWidth, ...otherProps }: {
|
|
30
30
|
[x: string]: any;
|
|
31
31
|
state: any;
|
|
32
32
|
popoverRef: any;
|
|
@@ -35,7 +35,6 @@ export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxSty
|
|
|
35
35
|
overlayStyles: any;
|
|
36
36
|
optionStyles: any;
|
|
37
37
|
overlayProps: any;
|
|
38
|
-
disallowEmptySelection: any;
|
|
39
38
|
shouldUseVirtualFocus?: boolean | undefined;
|
|
40
39
|
placement: any;
|
|
41
40
|
minWidth: any;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { AllHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
import { Styles } from '../styles/types';
|
|
2
|
+
import { Styles, StylesInterface } from '../styles/types';
|
|
3
3
|
import { BASE_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES } from '../styles/list';
|
|
4
|
+
export interface GlobalStyledProps {
|
|
5
|
+
breakpoints?: number[];
|
|
6
|
+
}
|
|
7
|
+
export interface StyledProps<K extends (keyof StylesInterface)[]> {
|
|
8
|
+
/** The name of the element. It can be used to override styles in context. */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** The tag name of the element. */
|
|
11
|
+
tag?: string;
|
|
12
|
+
/** Default styles of the element. */
|
|
13
|
+
styles?: Styles;
|
|
14
|
+
/** Default css of the element. */
|
|
15
|
+
css?: string | ((props: Props) => string);
|
|
16
|
+
/** Default properties/attributes */
|
|
17
|
+
props?: Record<string, any>;
|
|
18
|
+
/** The list of styles that can be provided by props */
|
|
19
|
+
styleProps?: K;
|
|
20
|
+
}
|
|
4
21
|
export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLElement>, 'className' | 'role' | 'id'> {
|
|
5
22
|
/** QA ID for e2e testing. An alias for `data-qa` attribute. */
|
|
6
23
|
qa?: string;
|
|
@@ -35,7 +52,7 @@ export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLEle
|
|
|
35
52
|
}
|
|
36
53
|
export interface BaseProps extends BasePropsWithoutChildren, Pick<AllHTMLAttributes<HTMLElementTagNameMap['div']>, 'children'> {
|
|
37
54
|
}
|
|
38
|
-
export interface AllBaseProps<K extends keyof HTMLElementTagNameMap = 'div'> extends BaseProps, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style' | 'size' | 'disabled' | 'hidden' | 'css'> {
|
|
55
|
+
export interface AllBaseProps<K extends keyof HTMLElementTagNameMap = 'div'> extends BaseProps, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style' | 'size' | 'disabled' | 'hidden' | 'css' | 'color' | 'height' | 'width'> {
|
|
39
56
|
as?: string;
|
|
40
57
|
}
|
|
41
58
|
export declare type BaseStyleProps = Pick<Styles, typeof BASE_STYLES[number]>;
|
|
@@ -47,10 +64,6 @@ export declare type DimensionStyleProps = Pick<Styles, typeof DIMENSION_STYLES[n
|
|
|
47
64
|
export declare type FlowStyleProps = Pick<Styles, typeof FLOW_STYLES[number]>;
|
|
48
65
|
export declare type ContainerStyleProps = Pick<Styles, typeof CONTAINER_STYLES[number]>;
|
|
49
66
|
export declare type OuterStyleProps = Pick<Styles, typeof OUTER_STYLES[number]>;
|
|
50
|
-
export declare type ShortItemsStyles = {
|
|
51
|
-
align?: Styles['alignItems'];
|
|
52
|
-
justify?: Styles['justifyItems'];
|
|
53
|
-
};
|
|
54
67
|
export declare type ShortGridStyles = {
|
|
55
68
|
template?: Styles['gridTemplate'];
|
|
56
69
|
columns?: Styles['gridColumns'];
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ declare const Input: import("react").ForwardRefExoticComponent<import("./compone
|
|
|
166
166
|
File: import("react").ForwardRefExoticComponent<import("./components/forms/FileInput/FileInput").CubeFileInputProps & import("react").RefAttributes<unknown>>;
|
|
167
167
|
};
|
|
168
168
|
export { Input };
|
|
169
|
-
export type { TagName, TagNameProps, AllBaseProps, BaseProps, BaseStyleProps, DimensionStyleProps, ColorStyleProps, OuterStyleProps, PositionStyleProps, TextStyleProps, BlockStyleProps, ContainerStyleProps, BasePropsWithoutChildren, Props, FlowStyleProps,
|
|
169
|
+
export type { TagName, TagNameProps, AllBaseProps, BaseProps, BaseStyleProps, DimensionStyleProps, ColorStyleProps, OuterStyleProps, PositionStyleProps, TextStyleProps, BlockStyleProps, ContainerStyleProps, BasePropsWithoutChildren, Props, FlowStyleProps, ShortGridStyles, } from './components/types';
|
|
170
170
|
export * from './styles/types';
|
|
171
171
|
export * from './styles/list';
|
|
172
172
|
export * from './styles/index';
|