@cube-dev/ui-kit 0.6.51 → 0.6.55

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.
Files changed (35) hide show
  1. package/dist/cjs/components/actions/Button/Button.d.ts +2 -1
  2. package/dist/cjs/components/content/Text.d.ts +1 -0
  3. package/dist/cjs/components/content/Title.d.ts +2 -2
  4. package/dist/cjs/components/forms/FieldWrapper.d.ts +1 -1
  5. package/dist/cjs/components/forms/Form/Field.d.ts +9 -4
  6. package/dist/cjs/components/forms/Form/useForm.d.ts +10 -6
  7. package/dist/cjs/components/forms/TextInput/TextInputBase.d.ts +2 -2
  8. package/dist/cjs/components/overlays/AlertDialog/AlertDialog.d.ts +1 -0
  9. package/dist/cjs/components/overlays/Dialog/DialogForm.d.ts +19 -0
  10. package/dist/cjs/components/overlays/Dialog/api.d.ts +1 -1
  11. package/dist/cjs/components/overlays/Dialog/index.d.ts +4 -2
  12. package/dist/cjs/css-properties.d.ts +12 -0
  13. package/dist/cjs/index.d.ts +3 -2
  14. package/dist/cjs/index.js +6 -6
  15. package/dist/cjs/index.js.map +1 -1
  16. package/dist/cjs/shared/form.d.ts +6 -3
  17. package/dist/cjs/styles/list.d.ts +6 -6
  18. package/dist/mjs/components/actions/Button/Button.d.ts +2 -1
  19. package/dist/mjs/components/content/Text.d.ts +1 -0
  20. package/dist/mjs/components/content/Title.d.ts +2 -2
  21. package/dist/mjs/components/forms/FieldWrapper.d.ts +1 -1
  22. package/dist/mjs/components/forms/Form/Field.d.ts +9 -4
  23. package/dist/mjs/components/forms/Form/useForm.d.ts +10 -6
  24. package/dist/mjs/components/forms/TextInput/TextInputBase.d.ts +2 -2
  25. package/dist/mjs/components/overlays/AlertDialog/AlertDialog.d.ts +1 -0
  26. package/dist/mjs/components/overlays/Dialog/DialogForm.d.ts +19 -0
  27. package/dist/mjs/components/overlays/Dialog/api.d.ts +1 -1
  28. package/dist/mjs/components/overlays/Dialog/index.d.ts +4 -2
  29. package/dist/mjs/css-properties.d.ts +12 -0
  30. package/dist/mjs/index.d.ts +3 -2
  31. package/dist/mjs/index.js +7 -7
  32. package/dist/mjs/index.js.map +1 -1
  33. package/dist/mjs/shared/form.d.ts +6 -3
  34. package/dist/mjs/styles/list.d.ts +6 -6
  35. package/package.json +2 -1
@@ -7,12 +7,13 @@ export interface CubeButtonProps extends CubeActionProps {
7
7
  type?: 'primary' | 'default' | 'danger' | 'link' | 'clear' | 'outline' | 'neutral' | string;
8
8
  size?: 'small' | 'default' | 'large' | string;
9
9
  }
10
- export declare function provideStyles({ size, type, theme, isLoading, icon, children, }: {
10
+ export declare function provideStyles({ size, type, theme, isLoading, icon, children, label, }: {
11
11
  size: any;
12
12
  type: any;
13
13
  theme: any;
14
14
  isLoading: any;
15
15
  icon: any;
16
16
  children: any;
17
+ label: any;
17
18
  }): any;
18
19
  export declare const Button: import("react").ForwardRefExoticComponent<CubeButtonProps & import("react").RefAttributes<import("@react-types/shared").FocusableRefValue<HTMLElement, HTMLElement>>>;
@@ -33,6 +33,7 @@ declare const Text: import("react").ForwardRefExoticComponent<CubeTextProps & im
33
33
  Danger: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
34
34
  Success: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
35
35
  Strong: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
36
+ Emphasis: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
36
37
  Selection: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
37
38
  };
38
39
  export { Text };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CubeTextProps } from './Text';
3
- import { BaseProps, BlockStyleProps, PositionStyleProps, TagNameProps } from '../types';
4
- export interface CubeTitleProps extends BaseProps, CubeTextProps, TagNameProps, BlockStyleProps, PositionStyleProps {
3
+ import { BaseProps, ContainerStyleProps, PositionStyleProps, TagNameProps } from '../types';
4
+ export interface CubeTitleProps extends BaseProps, CubeTextProps, TagNameProps, ContainerStyleProps, PositionStyleProps {
5
5
  /** The level of the heading **/
6
6
  level?: 1 | 2 | 3 | 4 | 5 | 6;
7
7
  }
@@ -5,7 +5,6 @@ export declare type CubeFieldWrapperProps = {
5
5
  as: string;
6
6
  labelPosition: LabelPosition;
7
7
  label?: string;
8
- insideForm?: boolean;
9
8
  styles?: Styles;
10
9
  isRequired?: boolean;
11
10
  isDisabled?: boolean;
@@ -18,6 +17,7 @@ export declare type CubeFieldWrapperProps = {
18
17
  Component?: JSX.Element;
19
18
  validationState?: ValidationState;
20
19
  requiredMark?: boolean;
20
+ tooltip?: ReactNode;
21
21
  };
22
22
  /**
23
23
  * A wrapper for form fields to provide additional decoration for inputs.
@@ -1,7 +1,9 @@
1
- import { ReactElement } from 'react';
2
- import { FieldBaseProps, ValidationRule } from '../../../shared';
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { OptionalFieldBaseProps, ValidationRule } from '../../../shared';
3
3
  import { FormStore } from './useForm';
4
- export interface CubeFieldProps extends FieldBaseProps {
4
+ export interface CubeFieldProps extends OptionalFieldBaseProps {
5
+ /** The initial value of the input. */
6
+ defaultValue?: any;
5
7
  /** The type of the input. `Input`, `Checkbox`, RadioGroup`, `Select`, `ComboBox` etc... */
6
8
  type?: string;
7
9
  /** The unique ID of the field */
@@ -9,11 +11,14 @@ export interface CubeFieldProps extends FieldBaseProps {
9
11
  /** The id prefix for the field to avoid collisions between forms */
10
12
  idPrefix?: string;
11
13
  children?: ReactElement | ((FormStore: any) => ReactElement);
14
+ shouldUpdate?: boolean | ((prevValues: any, nextValues: any) => boolean);
12
15
  /** Validation rules */
13
16
  rules?: ValidationRule[];
14
17
  /** The form instance */
15
18
  form?: FormStore;
16
19
  /** The message for the field or text for the error */
17
20
  message?: string;
21
+ tooltip?: ReactNode;
22
+ name?: string[] | string;
18
23
  }
19
- export declare function Field(allProps: CubeFieldProps): ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
24
+ export declare function Field(allProps: CubeFieldProps): JSX.Element | null;
@@ -19,24 +19,28 @@ export declare class FormStore {
19
19
  onSubmit: (CubeFormData: any) => void | Promise<any>;
20
20
  constructor(forceReRender?: () => void);
21
21
  submit(): Promise<any>;
22
- setFieldValues(newData: {
22
+ setFieldsValue(newData: {
23
23
  [key: string]: any;
24
- }, touched?: boolean): void;
24
+ }, touched?: boolean, reRender?: boolean, createFields?: boolean): void;
25
25
  getFieldValue(name: any): any;
26
26
  getFieldsValue(): CubeFormData;
27
- setFieldValue(name: string, value: any, touched?: boolean): void;
27
+ /**
28
+ * Similar to getFieldsValue() but respects '.' notation and creates nested objects.
29
+ */
30
+ getFormData(): CubeFormData;
31
+ setFieldValue(name: string, value: any, touched?: boolean, reRender?: boolean): void;
28
32
  getFieldInstance(name: string): CubeField;
29
- setInitialFieldValues(values: {
33
+ setInitialFieldsValue(values: {
30
34
  [key: string]: any;
31
35
  }): void;
32
- resetFields(): void;
36
+ resetFields(reRender?: boolean): void;
33
37
  validateField(name: string): Promise<any>;
34
38
  validateFields(list?: string[]): Promise<any>;
35
39
  isFieldValid(name: string): boolean;
36
40
  isFieldInvalid(name: string): boolean;
37
41
  isFieldTouched(name: string): boolean;
38
42
  getFieldError(name: string): string[];
39
- createField(name: string): void;
43
+ createField(name: string, reRender?: boolean): void;
40
44
  setFields(newFields: CubeField[]): void;
41
45
  setSubmitting(isSubmitting: boolean): void;
42
46
  _createField(name: any, data?: Partial<CubeField>): CubeField;
@@ -1,10 +1,10 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
2
  import { Styles } from '../../../styles/types';
3
- import { BaseProps, BlockStyleProps, PositionStyleProps, Props } from '../../types';
3
+ import { BaseProps, BlockStyleProps, DimensionStyleProps, PositionStyleProps, Props } from '../../types';
4
4
  import { FormFieldProps } from '../../../shared';
5
5
  import { AriaTextFieldProps } from '@react-types/textfield';
6
6
  export declare const DEFAULT_INPUT_STYLES: Styles;
7
- export interface CubeTextInputBaseProps extends BaseProps, PositionStyleProps, BlockStyleProps, AriaTextFieldProps, FormFieldProps {
7
+ export interface CubeTextInputBaseProps extends BaseProps, PositionStyleProps, DimensionStyleProps, BlockStyleProps, AriaTextFieldProps, FormFieldProps {
8
8
  /** Input decoration before the main input */
9
9
  prefix?: ReactNode;
10
10
  /** Input decoration after the main input */
@@ -8,6 +8,7 @@ export interface CubeAlertDialogProps extends CubeDialogProps {
8
8
  secondaryProps?: CubeButtonProps;
9
9
  cancelProps?: CubeButtonProps;
10
10
  title?: string;
11
+ noActions?: boolean;
11
12
  }
12
13
  /**
13
14
  * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { CubeDialogProps } from './Dialog';
3
+ import { CubeFormProps } from '../../forms/Form/Form';
4
+ import { CubeButtonProps } from '../../actions/Button/Button';
5
+ export interface CubeDialogFormProps extends CubeDialogProps, Omit<CubeFormProps, 'role'> {
6
+ danger?: boolean;
7
+ submitProps?: CubeButtonProps;
8
+ cancelProps?: CubeButtonProps;
9
+ preserve?: boolean;
10
+ }
11
+ export interface CubeDialogFormRef {
12
+ open: () => void;
13
+ close: () => void;
14
+ }
15
+ /**
16
+ * DialogForms are a specific type of Dialog. They contain forms to fill.
17
+ */
18
+ declare let _DialogForm: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<CubeDialogFormRef>>;
19
+ export { _DialogForm as DialogForm };
@@ -8,7 +8,7 @@ export interface DialogData extends Omit<CubeDialogContainerProps, 'onDismiss'>,
8
8
  reject: (any: any) => void;
9
9
  content: ReactNode;
10
10
  isVisible?: boolean;
11
- dialogType?: 'info' | 'confirm';
11
+ dialogType?: 'info' | 'confirm' | 'form';
12
12
  }
13
13
  export interface DialogService {
14
14
  root: Element | null;
@@ -2,9 +2,11 @@
2
2
  import { CubeDialogProps } from './Dialog';
3
3
  import { CubeDialogTriggerProps, DialogTrigger } from './DialogTrigger';
4
4
  import { CubeDialogContainerProps, DialogContainer } from './DialogContainer';
5
+ import { CubeDialogFormRef, CubeDialogFormProps, DialogForm } from './DialogForm';
5
6
  declare const _Dialog: import("react").ForwardRefExoticComponent<CubeDialogProps & import("react").RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>> & {
6
7
  confirm: (options: any) => void;
7
8
  info: (options: any) => void;
9
+ form: (options: any) => void;
8
10
  };
9
- export { _Dialog as Dialog, DialogContainer, DialogTrigger };
10
- export type { CubeDialogProps, CubeDialogTriggerProps, CubeDialogContainerProps, };
11
+ export { _Dialog as Dialog, DialogContainer, DialogTrigger, DialogForm };
12
+ export type { CubeDialogProps, CubeDialogTriggerProps, CubeDialogContainerProps, CubeDialogFormRef, CubeDialogFormProps, };
@@ -121,6 +121,18 @@ declare const PROPS: {
121
121
  'tag-line-height': string;
122
122
  'tag-letter-spacing': string;
123
123
  'tag-font-weight': string;
124
+ 'strong-font-size': string;
125
+ 'strong-line-height': string;
126
+ 'strong-letter-spacing': string;
127
+ 'strong-font-family': string;
128
+ 'strong-font-style': string;
129
+ 'strong-font-weight': number;
130
+ 'em-font-size': string;
131
+ 'em-line-height': string;
132
+ 'em-letter-spacing': string;
133
+ 'em-font-family': string;
134
+ 'em-font-style': string;
135
+ 'em-font-weight': string;
124
136
  'default-font-size': string;
125
137
  'default-line-height': string;
126
138
  'default-letter-spacing': string;
@@ -98,8 +98,8 @@ export { NumberInput } from './components/forms/NumberInput/NumberInput';
98
98
  export type { CubeNumberInputProps } from './components/forms/NumberInput/NumberInput';
99
99
  export { Avatar } from './components/content/Avatar/Avatar';
100
100
  export type { CubeAvatarProps } from './components/content/Avatar/Avatar';
101
- export { Dialog, DialogTrigger, DialogContainer, } from './components/overlays/Dialog';
102
- export type { CubeDialogTriggerProps, CubeDialogContainerProps, CubeDialogProps, } from './components/overlays/Dialog';
101
+ export { Dialog, DialogTrigger, DialogContainer, DialogForm, } from './components/overlays/Dialog';
102
+ export type { CubeDialogTriggerProps, CubeDialogContainerProps, CubeDialogProps, CubeDialogFormRef, CubeDialogFormProps, } from './components/overlays/Dialog';
103
103
  export { Tooltip } from './components/overlays/Tooltip/Tooltip';
104
104
  export type { CubeTooltipProps } from './components/overlays/Tooltip/Tooltip';
105
105
  export { TooltipTrigger } from './components/overlays/Tooltip/TooltipTrigger';
@@ -135,6 +135,7 @@ export declare const Typography: {
135
135
  Danger: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
136
136
  Success: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
137
137
  Strong: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
138
+ Emphasis: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
138
139
  Selection: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>>;
139
140
  };
140
141
  Title: import("react").ForwardRefExoticComponent<CubeTitleProps & import("react").RefAttributes<unknown>> & {