@cube-dev/ui-kit 0.7.12 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/dist/cjs/components/content/Result/Result.d.ts +2 -1
  2. package/dist/cjs/components/forms/Checkbox/Checkbox.d.ts +6 -10
  3. package/dist/cjs/components/forms/Checkbox/CheckboxGroup.d.ts +1 -3
  4. package/dist/cjs/components/forms/FileInput/FileInput.d.ts +5 -1
  5. package/dist/cjs/components/forms/Form/Field.d.ts +2 -0
  6. package/dist/cjs/components/forms/Form/useForm.d.ts +1 -0
  7. package/dist/cjs/components/forms/NumberInput/NumberInput.d.ts +1 -3
  8. package/dist/cjs/components/forms/PasswordInput/PasswordInput.d.ts +1 -3
  9. package/dist/cjs/components/forms/RadioGroup/Radio.d.ts +9 -7
  10. package/dist/cjs/components/forms/RadioGroup/RadioGroup.d.ts +1 -3
  11. package/dist/cjs/components/forms/Switch/Switch.d.ts +1 -3
  12. package/dist/cjs/components/forms/TextArea/TextArea.d.ts +1 -3
  13. package/dist/cjs/components/forms/TextInput/TextInput.d.ts +1 -3
  14. package/dist/cjs/components/pickers/ComboBox/ComboBox.d.ts +5 -3
  15. package/dist/cjs/components/pickers/Select/Select.d.ts +2 -4
  16. package/dist/cjs/components/types.d.ts +2 -0
  17. package/dist/cjs/index.d.ts +4 -14
  18. package/dist/cjs/index.js +6 -6
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/cjs/stories/FormFieldArgs.d.ts +131 -0
  21. package/dist/cjs/styles/gap.d.ts +1 -1
  22. package/dist/cjs/utils/dotize.d.ts +21 -0
  23. package/dist/cjs/utils/react/nullableValue.d.ts +1 -0
  24. package/dist/cjs/utils/styles.d.ts +3 -3
  25. package/dist/mjs/components/content/Result/Result.d.ts +2 -1
  26. package/dist/mjs/components/forms/Checkbox/Checkbox.d.ts +6 -10
  27. package/dist/mjs/components/forms/Checkbox/CheckboxGroup.d.ts +1 -3
  28. package/dist/mjs/components/forms/FileInput/FileInput.d.ts +5 -1
  29. package/dist/mjs/components/forms/Form/Field.d.ts +2 -0
  30. package/dist/mjs/components/forms/Form/useForm.d.ts +1 -0
  31. package/dist/mjs/components/forms/NumberInput/NumberInput.d.ts +1 -3
  32. package/dist/mjs/components/forms/PasswordInput/PasswordInput.d.ts +1 -3
  33. package/dist/mjs/components/forms/RadioGroup/Radio.d.ts +9 -7
  34. package/dist/mjs/components/forms/RadioGroup/RadioGroup.d.ts +1 -3
  35. package/dist/mjs/components/forms/Switch/Switch.d.ts +1 -3
  36. package/dist/mjs/components/forms/TextArea/TextArea.d.ts +1 -3
  37. package/dist/mjs/components/forms/TextInput/TextInput.d.ts +1 -3
  38. package/dist/mjs/components/pickers/ComboBox/ComboBox.d.ts +5 -3
  39. package/dist/mjs/components/pickers/Select/Select.d.ts +2 -4
  40. package/dist/mjs/components/types.d.ts +2 -0
  41. package/dist/mjs/index.d.ts +4 -14
  42. package/dist/mjs/index.js +7 -7
  43. package/dist/mjs/index.js.map +1 -1
  44. package/dist/mjs/stories/FormFieldArgs.d.ts +131 -0
  45. package/dist/mjs/styles/gap.d.ts +1 -1
  46. package/dist/mjs/utils/dotize.d.ts +21 -0
  47. package/dist/mjs/utils/react/nullableValue.d.ts +1 -0
  48. package/dist/mjs/utils/styles.d.ts +3 -3
  49. package/package.json +5 -5
@@ -16,4 +16,5 @@ export interface CubeResultProps extends BaseProps, ContainerStyleProps {
16
16
  title?: ReactNode;
17
17
  }
18
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>>;
19
+ declare const _Result: import("react").ForwardRefExoticComponent<CubeResultProps & import("react").RefAttributes<unknown>>;
20
+ export { _Result as Result };
@@ -1,23 +1,19 @@
1
1
  /// <reference types="react" />
2
2
  import { AriaCheckboxProps } from '@react-types/checkbox';
3
+ import { CheckboxGroup } from './CheckboxGroup';
3
4
  import { BaseProps } from '../../types';
4
5
  import { FormFieldProps } from '../../../shared';
5
6
  export interface CubeCheckboxProps extends BaseProps, AriaCheckboxProps, FormFieldProps {
6
7
  }
7
- /**
8
- * Checkboxes allow users to select multiple items from a list of individual items,
9
- * or to mark one individual item as selected.
10
- */
11
- declare let _Checkbox: import("react").ForwardRefExoticComponent<Omit<CubeCheckboxProps, "isSelected" | "defaultSelected"> & {
8
+ declare let __Checkbox: import("react").ForwardRefExoticComponent<Omit<CubeCheckboxProps, "isSelected" | "defaultSelected"> & {
12
9
  isSelected?: any;
13
10
  defaultSelected?: any;
14
11
  } & import("react").RefAttributes<import("@react-types/shared").FocusableRefValue<HTMLElement, HTMLElement>>> & {
15
- cubeInputType: string;
12
+ Group: typeof CheckboxGroup;
13
+ } & {
16
14
  Group: import("react").ForwardRefExoticComponent<Omit<import("./CheckboxGroup").CubeCheckboxGroupProps, "value" | "defaultValue"> & {
17
15
  value?: any;
18
16
  defaultValue?: any;
19
- } & import("react").RefAttributes<unknown>> & {
20
- cubeInputType: string;
21
- };
17
+ } & import("react").RefAttributes<unknown>>;
22
18
  };
23
- export { _Checkbox as Checkbox };
19
+ export { __Checkbox as Checkbox };
@@ -12,7 +12,5 @@ export interface CubeCheckboxGroupProps extends BaseProps, AriaCheckboxGroupProp
12
12
  declare const _CheckboxGroup: import("react").ForwardRefExoticComponent<Omit<CubeCheckboxGroupProps, "value" | "defaultValue"> & {
13
13
  value?: any;
14
14
  defaultValue?: any;
15
- } & import("react").RefAttributes<unknown>> & {
16
- cubeInputType: string;
17
- };
15
+ } & import("react").RefAttributes<unknown>>;
18
16
  export { _CheckboxGroup as CheckboxGroup };
@@ -4,6 +4,10 @@ import { BaseProps, BlockStyleProps, PositionStyleProps } from '../../types';
4
4
  import { AriaTextFieldProps } from '@react-types/textfield';
5
5
  import { FormFieldProps } from '../../../shared';
6
6
  export interface CubeFileInputProps extends BaseProps, PositionStyleProps, BlockStyleProps, AriaTextFieldProps, FormFieldProps {
7
+ /**
8
+ * The size of the input
9
+ * @default default
10
+ */
7
11
  size?: 'small' | 'default' | 'large' | string;
8
12
  /** The input ref */
9
13
  inputRef?: RefObject<HTMLInputElement>;
@@ -11,7 +15,7 @@ export interface CubeFileInputProps extends BaseProps, PositionStyleProps, Block
11
15
  inputStyles?: Styles;
12
16
  /**
13
17
  * The type of the input
14
- * @default 'file'
18
+ * @default file
15
19
  */
16
20
  type?: 'file' | 'text';
17
21
  }
@@ -25,5 +25,7 @@ export interface CubeFieldProps extends OptionalFieldBaseProps {
25
25
  tooltip?: ReactNode;
26
26
  /** Field name. It's used as a key the form data. */
27
27
  name?: string[] | string;
28
+ /** Whether the field is hidden. */
29
+ isHidden?: boolean;
28
30
  }
29
31
  export declare function Field(allProps: CubeFieldProps): JSX.Element | null;
@@ -41,6 +41,7 @@ export declare class CubeFormInstance {
41
41
  isFieldTouched(name: string): boolean;
42
42
  getFieldError(name: string): string[];
43
43
  createField(name: string, skipRender?: boolean): void;
44
+ removeField(name: string, skipRender?: boolean): void;
44
45
  setFields(newFields: CubeFieldData[]): void;
45
46
  setSubmitting(isSubmitting: boolean): void;
46
47
  _createField(name: any, data?: Partial<CubeFieldData>): CubeFieldData;
@@ -11,7 +11,5 @@ export interface CubeNumberInputProps extends Omit<CubeTextInputBaseProps, 'defa
11
11
  declare const _NumberInput: import("react").ForwardRefExoticComponent<Omit<CubeNumberInputProps, "value" | "defaultValue"> & {
12
12
  value?: any;
13
13
  defaultValue?: any;
14
- } & import("react").RefAttributes<unknown>> & {
15
- cubeInputType: string;
16
- };
14
+ } & import("react").RefAttributes<unknown>>;
17
15
  export { _NumberInput as NumberInput };
@@ -8,7 +8,5 @@ import { CubeTextInputBaseProps } from '../TextInput/TextInputBase';
8
8
  declare const _PasswordInput: import("react").ForwardRefExoticComponent<Omit<CubeTextInputBaseProps, "value" | "defaultValue"> & {
9
9
  value?: any;
10
10
  defaultValue?: any;
11
- } & import("react").RefAttributes<unknown>> & {
12
- cubeInputType: string;
13
- };
11
+ } & import("react").RefAttributes<unknown>>;
14
12
  export { _PasswordInput as PasswordInput };
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { RadioGroup } from './RadioGroup';
2
3
  import { Styles } from '../../../styles/types';
3
4
  import { BaseProps } from '../../types';
4
5
  import { AriaRadioProps } from '@react-types/radio';
@@ -7,19 +8,20 @@ export interface CubeRadioProps extends BaseProps, AriaRadioProps, FormFieldProp
7
8
  inputStyles?: Styles;
8
9
  type?: 'button' | 'radio';
9
10
  }
10
- declare function RadioButton(props: CubeRadioProps, ref: any): JSX.Element;
11
11
  /**
12
12
  * Radio buttons allow users to select a single option from a list of mutually exclusive options.
13
13
  * All possible options are exposed up front for users to compare.
14
14
  */
15
- declare const _Radio: import("react").ForwardRefExoticComponent<CubeRadioProps & import("react").RefAttributes<unknown>> & {
15
+ declare const _RadioButton: import("react").ForwardRefExoticComponent<CubeRadioProps & import("react").RefAttributes<unknown>>;
16
+ declare const __Radio: import("react").ForwardRefExoticComponent<CubeRadioProps & import("react").RefAttributes<unknown>> & {
17
+ Group: typeof RadioGroup;
18
+ Button: typeof _RadioButton;
19
+ } & {
16
20
  Group: import("react").ForwardRefExoticComponent<Omit<import("./RadioGroup").CubeRadioGroupProps, "value" | "defaultValue"> & {
17
21
  value?: any;
18
22
  defaultValue?: any;
19
- } & import("react").RefAttributes<unknown>> & {
20
- cubeInputType: string;
21
- };
23
+ } & import("react").RefAttributes<unknown>>;
22
24
  Button: import("react").ForwardRefExoticComponent<CubeRadioProps & import("react").RefAttributes<unknown>>;
23
25
  };
24
- export { _Radio as Radio };
25
- export { RadioButton };
26
+ export { __Radio as Radio };
27
+ export { _RadioButton as RadioButton };
@@ -13,7 +13,5 @@ export interface CubeRadioGroupProps extends BaseProps, AriaRadioGroupProps, For
13
13
  declare const _RadioGroup: import("react").ForwardRefExoticComponent<Omit<CubeRadioGroupProps, "value" | "defaultValue"> & {
14
14
  value?: any;
15
15
  defaultValue?: any;
16
- } & import("react").RefAttributes<unknown>> & {
17
- cubeInputType: string;
18
- };
16
+ } & import("react").RefAttributes<unknown>>;
19
17
  export { _RadioGroup as RadioGroup };
@@ -15,7 +15,5 @@ export interface CubeSwitchProps extends BaseProps, OuterStyleProps, BlockStyleP
15
15
  declare let _Switch: import("react").ForwardRefExoticComponent<Omit<CubeSwitchProps, "isSelected" | "defaultSelected"> & {
16
16
  isSelected?: any;
17
17
  defaultSelected?: any;
18
- } & import("react").RefAttributes<unknown>> & {
19
- cubeInputType: string;
20
- };
18
+ } & import("react").RefAttributes<unknown>>;
21
19
  export { _Switch as Switch };
@@ -15,7 +15,5 @@ export interface CubeTextAreaProps extends CubeTextInputBaseProps {
15
15
  declare const _TextArea: import("react").ForwardRefExoticComponent<Omit<CubeTextAreaProps, "value" | "defaultValue"> & {
16
16
  value?: any;
17
17
  defaultValue?: any;
18
- } & import("react").RefAttributes<unknown>> & {
19
- cubeInputType: string;
20
- };
18
+ } & import("react").RefAttributes<unknown>>;
21
19
  export { _TextArea as TextArea };
@@ -8,7 +8,5 @@ import { CubeTextInputBaseProps } from './TextInputBase';
8
8
  declare const _TextInput: import("react").ForwardRefExoticComponent<Omit<CubeTextInputBaseProps, "value" | "defaultValue"> & {
9
9
  value?: any;
10
10
  defaultValue?: any;
11
- } & import("react").RefAttributes<unknown>> & {
12
- cubeInputType: string;
13
- };
11
+ } & import("react").RefAttributes<unknown>>;
14
12
  export { _TextInput as TextInput };
@@ -1,5 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
  import { CubeSelectBaseProps } from '../Select/Select';
3
+ import { Item } from '@react-stately/collections';
3
4
  import { CollectionBase, KeyboardDelegate, LoadingState } from '@react-types/shared';
4
5
  import { ComboBoxProps } from '@react-types/combobox';
5
6
  export interface CubeComboBoxProps<T> extends Omit<CubeSelectBaseProps<T>, 'onOpenChange'>, ComboBoxProps<T>, CollectionBase<T> {
@@ -16,8 +17,9 @@ export interface CubeComboBoxProps<T> extends Omit<CubeSelectBaseProps<T>, 'onOp
16
17
  filter?: (val: any, str: string) => boolean;
17
18
  size?: 'small' | 'default' | 'large' | string;
18
19
  }
19
- declare const _ComboBox: import("react").ForwardRefExoticComponent<CubeComboBoxProps<object> & import("react").RefAttributes<unknown>> & {
20
- cubeInputType: string;
20
+ declare const __ComboBox: import("react").ForwardRefExoticComponent<CubeComboBoxProps<object> & import("react").RefAttributes<unknown>> & {
21
+ Item: typeof Item;
22
+ } & {
21
23
  Item: <T>(props: import("@react-types/shared").ItemProps<T>) => JSX.Element;
22
24
  };
23
- export { _ComboBox as ComboBox };
25
+ export { __ComboBox as ComboBox };
@@ -39,7 +39,5 @@ export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxSty
39
39
  placement: any;
40
40
  minWidth: any;
41
41
  }): JSX.Element;
42
- declare const _Select: import("react").ForwardRefExoticComponent<CubeSelectProps<object> & import("react").RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>> & {
43
- Item: <T>(props: import("@react-types/shared").ItemProps<T>) => JSX.Element;
44
- };
45
- export { _Select as Select };
42
+ declare const __Select: any;
43
+ export { __Select as Select };
@@ -23,6 +23,8 @@ export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLEle
23
23
  qa?: string;
24
24
  /** QA value for e2e testing. An alias for `data-qaval` attribute. */
25
25
  qaVal?: string | number;
26
+ /** Inner element name */
27
+ element?: string;
26
28
  /** The style map */
27
29
  styles?: Styles;
28
30
  /** The list of responsive points in pixels */
@@ -154,32 +154,22 @@ declare const Input: import("react").ForwardRefExoticComponent<Omit<import("./co
154
154
  value?: any;
155
155
  defaultValue?: any;
156
156
  } & import("react").RefAttributes<unknown>> & {
157
- cubeInputType: string;
158
- } & {
159
157
  Text: import("react").ForwardRefExoticComponent<Omit<import("./components/forms/TextInput/TextInputBase").CubeTextInputBaseProps, "value" | "defaultValue"> & {
160
158
  value?: any;
161
159
  defaultValue?: any;
162
- } & import("react").RefAttributes<unknown>> & {
163
- cubeInputType: string;
164
- };
160
+ } & import("react").RefAttributes<unknown>>;
165
161
  Password: import("react").ForwardRefExoticComponent<Omit<import("./components/forms/TextInput/TextInputBase").CubeTextInputBaseProps, "value" | "defaultValue"> & {
166
162
  value?: any;
167
163
  defaultValue?: any;
168
- } & import("react").RefAttributes<unknown>> & {
169
- cubeInputType: string;
170
- };
164
+ } & import("react").RefAttributes<unknown>>;
171
165
  Number: import("react").ForwardRefExoticComponent<Omit<import("./components/forms/NumberInput/NumberInput").CubeNumberInputProps, "value" | "defaultValue"> & {
172
166
  value?: any;
173
167
  defaultValue?: any;
174
- } & import("react").RefAttributes<unknown>> & {
175
- cubeInputType: string;
176
- };
168
+ } & import("react").RefAttributes<unknown>>;
177
169
  TextArea: import("react").ForwardRefExoticComponent<Omit<import("./components/forms/TextArea/TextArea").CubeTextAreaProps, "value" | "defaultValue"> & {
178
170
  value?: any;
179
171
  defaultValue?: any;
180
- } & import("react").RefAttributes<unknown>> & {
181
- cubeInputType: string;
182
- };
172
+ } & import("react").RefAttributes<unknown>>;
183
173
  File: import("react").ForwardRefExoticComponent<import("./components/forms/FileInput/FileInput").CubeFileInputProps & import("react").RefAttributes<unknown>>;
184
174
  };
185
175
  export { Input };