@cube-dev/ui-kit 0.7.3 → 0.7.7
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 +3 -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 +3 -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
|
@@ -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/cjs/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';
|