@cube-dev/ui-kit 0.7.4 → 0.7.8
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/Root.d.ts +4 -0
- package/dist/cjs/components/content/Result/Result.d.ts +19 -0
- package/dist/cjs/components/forms/FieldWrapper.d.ts +7 -1
- package/dist/cjs/components/forms/Form/Field.d.ts +2 -0
- package/dist/cjs/components/forms/Form/Form.d.ts +3 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/shared/form.d.ts +4 -2
- package/dist/cjs/stories/FormFieldArgs.d.ts +6 -0
- package/dist/cjs/styles/styledScrollbar.d.ts +0 -25
- package/dist/cjs/tokens.d.ts +7 -0
- package/dist/cjs/utils/react/index.d.ts +1 -0
- package/dist/cjs/utils/react/wrapNodeIfPlain.d.ts +2 -0
- package/dist/mjs/components/Root.d.ts +4 -0
- package/dist/mjs/components/content/Result/Result.d.ts +19 -0
- package/dist/mjs/components/forms/FieldWrapper.d.ts +7 -1
- package/dist/mjs/components/forms/Form/Field.d.ts +2 -0
- package/dist/mjs/components/forms/Form/Form.d.ts +3 -0
- package/dist/mjs/index.d.ts +2 -0
- package/dist/mjs/index.js +5 -5
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/shared/form.d.ts +4 -2
- package/dist/mjs/stories/FormFieldArgs.d.ts +6 -0
- package/dist/mjs/styles/styledScrollbar.d.ts +0 -25
- package/dist/mjs/tokens.d.ts +7 -0
- package/dist/mjs/utils/react/index.d.ts +1 -0
- package/dist/mjs/utils/react/wrapNodeIfPlain.d.ts +2 -0
- package/package.json +15 -7
|
@@ -50,11 +50,13 @@ export interface FormFieldProps extends FormBaseProps {
|
|
|
50
50
|
label?: ReactNode;
|
|
51
51
|
/** Custom label props */
|
|
52
52
|
labelProps?: Props;
|
|
53
|
-
/** Message for the field. Some additional information or error notice
|
|
53
|
+
/** Message for the field. Some additional information or error notice */
|
|
54
54
|
message?: ReactNode;
|
|
55
|
+
/** Description for the field. Will be placed below the label */
|
|
56
|
+
description?: ReactNode;
|
|
55
57
|
/** A tooltip that is shown inside the label */
|
|
56
58
|
tooltip?: ReactNode;
|
|
57
|
-
/** Whether the element should receive focus on render
|
|
59
|
+
/** Whether the element should receive focus on render */
|
|
58
60
|
autoFocus?: boolean;
|
|
59
61
|
}
|
|
60
62
|
export declare type ValidationRuleBase = {
|
|
@@ -20,6 +20,12 @@ export declare const LABEL_ARG: {
|
|
|
20
20
|
description: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
export declare const DESCRIPTION_ARG: {
|
|
24
|
+
description: {
|
|
25
|
+
control: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
23
29
|
export declare const NECESSITY_INDICATOR_ARG: {
|
|
24
30
|
necessityIndicator: {
|
|
25
31
|
description: string;
|
|
@@ -9,25 +9,9 @@ export declare function styledScrollbarStyle({ styledScrollbar: val }: {
|
|
|
9
9
|
$?: undefined;
|
|
10
10
|
display?: undefined;
|
|
11
11
|
})[] | ({
|
|
12
|
-
'--local-scrollbar-thumb-color': string;
|
|
13
|
-
'--local-scrollbar-border-color': string;
|
|
14
|
-
'--local-scrollbar-bg-color': string;
|
|
15
|
-
$?: undefined;
|
|
16
|
-
width?: undefined;
|
|
17
|
-
height?: undefined;
|
|
18
|
-
'background-color'?: undefined;
|
|
19
|
-
'border-radius'?: undefined;
|
|
20
|
-
border?: undefined;
|
|
21
|
-
'background-clip'?: undefined;
|
|
22
|
-
'scrollbar-width'?: undefined;
|
|
23
|
-
'scrollbar-color'?: undefined;
|
|
24
|
-
} | {
|
|
25
12
|
$: string;
|
|
26
13
|
width: string;
|
|
27
14
|
height: string;
|
|
28
|
-
'--local-scrollbar-thumb-color'?: undefined;
|
|
29
|
-
'--local-scrollbar-border-color'?: undefined;
|
|
30
|
-
'--local-scrollbar-bg-color'?: undefined;
|
|
31
15
|
'background-color'?: undefined;
|
|
32
16
|
'border-radius'?: undefined;
|
|
33
17
|
border?: undefined;
|
|
@@ -37,9 +21,6 @@ export declare function styledScrollbarStyle({ styledScrollbar: val }: {
|
|
|
37
21
|
} | {
|
|
38
22
|
$: string;
|
|
39
23
|
'background-color': string;
|
|
40
|
-
'--local-scrollbar-thumb-color'?: undefined;
|
|
41
|
-
'--local-scrollbar-border-color'?: undefined;
|
|
42
|
-
'--local-scrollbar-bg-color'?: undefined;
|
|
43
24
|
width?: undefined;
|
|
44
25
|
height?: undefined;
|
|
45
26
|
'border-radius'?: undefined;
|
|
@@ -53,9 +34,6 @@ export declare function styledScrollbarStyle({ styledScrollbar: val }: {
|
|
|
53
34
|
'border-radius': string;
|
|
54
35
|
border: string;
|
|
55
36
|
'background-clip': string;
|
|
56
|
-
'--local-scrollbar-thumb-color'?: undefined;
|
|
57
|
-
'--local-scrollbar-border-color'?: undefined;
|
|
58
|
-
'--local-scrollbar-bg-color'?: undefined;
|
|
59
37
|
width?: undefined;
|
|
60
38
|
height?: undefined;
|
|
61
39
|
'scrollbar-width'?: undefined;
|
|
@@ -63,9 +41,6 @@ export declare function styledScrollbarStyle({ styledScrollbar: val }: {
|
|
|
63
41
|
} | {
|
|
64
42
|
'scrollbar-width': string;
|
|
65
43
|
'scrollbar-color': string;
|
|
66
|
-
'--local-scrollbar-thumb-color'?: undefined;
|
|
67
|
-
'--local-scrollbar-border-color'?: undefined;
|
|
68
|
-
'--local-scrollbar-bg-color'?: undefined;
|
|
69
44
|
$?: undefined;
|
|
70
45
|
width?: undefined;
|
|
71
46
|
height?: undefined;
|
package/dist/cjs/tokens.d.ts
CHANGED
|
@@ -148,5 +148,12 @@ declare const TOKENS: {
|
|
|
148
148
|
'default-line-height': string;
|
|
149
149
|
'default-letter-spacing': string;
|
|
150
150
|
'default-font-weight': string;
|
|
151
|
+
'scrollbar-width': string;
|
|
152
|
+
'scrollbar-outline-width': string;
|
|
153
|
+
'scrollbar-radius': string;
|
|
154
|
+
'scrollbar-thumb-color': string;
|
|
155
|
+
'scrollbar-outline-color': string;
|
|
156
|
+
'scrollbar-bg-color': string;
|
|
157
|
+
'scrollbar-corner-color': string;
|
|
151
158
|
};
|
|
152
159
|
export { TOKENS };
|
|
@@ -4,10 +4,14 @@ export interface CubeRootProps extends BaseProps {
|
|
|
4
4
|
tokens?: {
|
|
5
5
|
[key: string]: string;
|
|
6
6
|
};
|
|
7
|
+
bodyStyles?: {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
};
|
|
7
10
|
fonts?: boolean;
|
|
8
11
|
publicUrl?: string;
|
|
9
12
|
router?: any;
|
|
10
13
|
font?: string;
|
|
11
14
|
monospaceFont?: string;
|
|
15
|
+
applyLegacyTokens?: boolean;
|
|
12
16
|
}
|
|
13
17
|
export declare const Root: (allProps: CubeRootProps) => JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseProps, ContainerStyleProps } from '../../types';
|
|
3
|
+
export interface CubeResultProps extends BaseProps, ContainerStyleProps {
|
|
4
|
+
/** Additional block content. For example, a set of buttons */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Custom icon element */
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Result status from ready-made templates
|
|
10
|
+
* @default 'info'
|
|
11
|
+
*/
|
|
12
|
+
status?: CubeResultStatus;
|
|
13
|
+
/** The subTitle */
|
|
14
|
+
subTitle?: ReactNode;
|
|
15
|
+
/** The title */
|
|
16
|
+
title?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare type CubeResultStatus = 'success' | 'error' | 'info' | 'warning' | 404 | 403 | 500;
|
|
19
|
+
export declare const Result: import("react").ForwardRefExoticComponent<CubeResultProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -5,15 +5,21 @@ export declare type CubeFieldWrapperProps = {
|
|
|
5
5
|
as: string;
|
|
6
6
|
labelPosition: LabelPosition;
|
|
7
7
|
label?: string;
|
|
8
|
+
labelStyles?: Styles;
|
|
8
9
|
styles?: Styles;
|
|
10
|
+
/** Whether the input is required */
|
|
9
11
|
isRequired?: boolean;
|
|
12
|
+
/** Whether the input is disabled */
|
|
10
13
|
isDisabled?: boolean;
|
|
11
|
-
labelStyles?: Styles;
|
|
12
14
|
necessityIndicator?: NecessityIndicator;
|
|
13
15
|
labelProps?: any;
|
|
14
16
|
fieldProps?: any;
|
|
17
|
+
/** Custom message for the field. It will be placed below the label and the input */
|
|
15
18
|
message?: string | ReactNode;
|
|
19
|
+
/** Styles for the message */
|
|
16
20
|
messageStyles?: Styles;
|
|
21
|
+
/** The description for the field. It will be placed below the label */
|
|
22
|
+
description?: string;
|
|
17
23
|
Component?: JSX.Element;
|
|
18
24
|
validationState?: ValidationState;
|
|
19
25
|
requiredMark?: boolean;
|
|
@@ -19,6 +19,8 @@ export interface CubeFieldProps extends OptionalFieldBaseProps {
|
|
|
19
19
|
form?: CubeFormInstance;
|
|
20
20
|
/** The message for the field or text for the error */
|
|
21
21
|
message?: string;
|
|
22
|
+
/** The description for the field */
|
|
23
|
+
description?: ReactNode;
|
|
22
24
|
/** Tooltip for the label that explains something. */
|
|
23
25
|
tooltip?: ReactNode;
|
|
24
26
|
/** Field name. It's used as a key the form data. */
|
|
@@ -2,6 +2,7 @@ import { FormHTMLAttributes } from 'react';
|
|
|
2
2
|
import { CubeFormInstance, CubeFormData } from './useForm';
|
|
3
3
|
import { BaseProps, ContainerStyleProps } from '../../types';
|
|
4
4
|
import { FormBaseProps } from '../../../shared';
|
|
5
|
+
import { Styles } from '../../../styles/types';
|
|
5
6
|
export declare const FormContext: import("react").Context<{}>;
|
|
6
7
|
export declare function useFormProps(props: any): any;
|
|
7
8
|
export interface CubeFormProps extends FormBaseProps, BaseProps, ContainerStyleProps, Pick<FormHTMLAttributes<HTMLFormElement>, 'action' | 'autoComplete' | 'encType' | 'method' | 'target'> {
|
|
@@ -19,6 +20,8 @@ export interface CubeFormProps extends FormBaseProps, BaseProps, ContainerStyleP
|
|
|
19
20
|
onSubmitFailed?: (any?: any) => void | Promise<any>;
|
|
20
21
|
/** Set form instance created by useForm */
|
|
21
22
|
form?: CubeFormInstance;
|
|
23
|
+
/** The size of the side area with labels. Only for `labelPosition="side"` */
|
|
24
|
+
labelWidth?: Styles['width'];
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
27
|
* Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ export { Header } from './components/content/Header';
|
|
|
47
47
|
export type { CubeHeaderProps } from './components/content/Header';
|
|
48
48
|
export { Footer } from './components/content/Footer';
|
|
49
49
|
export type { CubeFooterProps } from './components/content/Footer';
|
|
50
|
+
export { Result } from './components/content/Result/Result';
|
|
51
|
+
export type { CubeResultProps, CubeResultStatus, } from './components/content/Result/Result';
|
|
50
52
|
export { FieldWrapper } from './components/forms/FieldWrapper';
|
|
51
53
|
export type { CubeFieldWrapperProps } from './components/forms/FieldWrapper';
|
|
52
54
|
export { LoadingAnimation } from './components/status/LoadingAnimation/LoadingAnimation';
|