@zendeskgarden/react-forms 8.49.0 → 8.49.3

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 (32) hide show
  1. package/dist/index.cjs.js +77 -88
  2. package/dist/index.esm.js +77 -89
  3. package/dist/typings/elements/Checkbox.d.ts +2 -10
  4. package/dist/typings/elements/FileUpload.d.ts +2 -9
  5. package/dist/typings/elements/Input.d.ts +2 -12
  6. package/dist/typings/elements/MediaInput.d.ts +2 -20
  7. package/dist/typings/elements/MultiThumbRange.d.ts +2 -26
  8. package/dist/typings/elements/Radio.d.ts +2 -5
  9. package/dist/typings/elements/Range.d.ts +2 -5
  10. package/dist/typings/elements/Select.d.ts +2 -12
  11. package/dist/typings/elements/Textarea.d.ts +2 -18
  12. package/dist/typings/elements/Toggle.d.ts +2 -5
  13. package/dist/typings/elements/common/Fieldset.d.ts +2 -7
  14. package/dist/typings/elements/common/Label.d.ts +2 -5
  15. package/dist/typings/elements/common/Message.d.ts +2 -6
  16. package/dist/typings/elements/faux-input/FauxInput.d.ts +1 -19
  17. package/dist/typings/elements/faux-input/components/EndIcon.d.ts +2 -12
  18. package/dist/typings/elements/faux-input/components/StartIcon.d.ts +2 -12
  19. package/dist/typings/elements/file-list/components/File.d.ts +2 -12
  20. package/dist/typings/elements/file-list/utils.d.ts +3 -18
  21. package/dist/typings/elements/input-group/InputGroup.d.ts +2 -5
  22. package/dist/typings/elements/tiles/Tiles.d.ts +2 -11
  23. package/dist/typings/elements/tiles/components/Tile.d.ts +2 -7
  24. package/dist/typings/index.d.ts +4 -20
  25. package/dist/typings/styled/common/StyledMessage.d.ts +2 -2
  26. package/dist/typings/styled/common/StyledMessageIcon.d.ts +2 -2
  27. package/dist/typings/styled/file-list/StyledFile.d.ts +2 -1
  28. package/dist/typings/styled/text/StyledTextInput.d.ts +2 -2
  29. package/dist/typings/types/index.d.ts +143 -0
  30. package/dist/typings/utils/useTilesContext.d.ts +4 -10
  31. package/package.json +5 -5
  32. package/dist/typings/utils/validation.d.ts +0 -7
@@ -4,32 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
8
- export interface IMultiThumbRangeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
9
- /** Sets the minimum permitted value */
10
- min?: number;
11
- /** Sets the maximum permitted value */
12
- max?: number;
13
- /** Sets the minimum thumb input value */
14
- minValue?: number;
15
- /** Sets the maximum thumb input value */
16
- maxValue?: number;
17
- /** Defines the stepping interval */
18
- step?: number;
19
- /** Indicates that the element is not interactive */
20
- disabled?: boolean;
21
- /**
22
- * Handles change events
23
- *
24
- * @param {Object} updatedValues The values that have changed
25
- * @param {number} [updatedValues.minValue] The optional minimum value
26
- * @param {number} [updatedValues.maxValue] The optional maximum value
27
- * */
28
- onChange?: (updatedValues: {
29
- minValue?: number;
30
- maxValue?: number;
31
- }) => void;
32
- }
7
+ import React from 'react';
8
+ import { IMultiThumbRangeProps } from '../types';
33
9
  /**
34
10
  * @extends HTMLAttributes<HTMLDivElement>
35
11
  */
@@ -4,11 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { InputHTMLAttributes } from 'react';
8
- export interface IRadioProps extends InputHTMLAttributes<HTMLInputElement> {
9
- /** Applies compact styling */
10
- isCompact?: boolean;
11
- }
7
+ import React from 'react';
8
+ import { IRadioProps } from '../types';
12
9
  /**
13
10
  * @extends InputHTMLAttributes<HTMLInputElement>
14
11
  */
@@ -4,11 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { InputHTMLAttributes } from 'react';
8
- export interface IRangeProps extends InputHTMLAttributes<HTMLInputElement> {
9
- /** @ignore */
10
- hasLowerTrack?: boolean;
11
- }
7
+ import React from 'react';
8
+ import { IRangeProps } from '../types';
12
9
  /**
13
10
  * @extends InputHTMLAttributes<HTMLInputElement>
14
11
  */
@@ -4,18 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { SelectHTMLAttributes } from 'react';
8
- import { VALIDATION } from '../utils/validation';
9
- export interface ISelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
10
- /** Applies compact styling */
11
- isCompact?: boolean;
12
- /** Removes borders and padding */
13
- isBare?: boolean;
14
- /** Applies inset `box-shadow` styling on focus */
15
- focusInset?: boolean;
16
- /** Applies validation state styling */
17
- validation?: VALIDATION;
18
- }
7
+ import React from 'react';
8
+ import { ISelectProps } from '../types';
19
9
  /**
20
10
  * @extends SelectHTMLAttributes<HTMLSelectElement>
21
11
  */
@@ -4,24 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { TextareaHTMLAttributes } from 'react';
8
- import { VALIDATION } from '../utils/validation';
9
- export interface ITextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
10
- /** Applies compact styling */
11
- isCompact?: boolean;
12
- /** Removes borders and padding */
13
- isBare?: boolean;
14
- /** Applies inset `box-shadow` styling on focus */
15
- focusInset?: boolean;
16
- /** Enables manual vertical resize */
17
- isResizable?: boolean;
18
- /** Defines the minimum height in rows */
19
- minRows?: number;
20
- /** Defines the maximum height in rows */
21
- maxRows?: number;
22
- /** Applies validation state styling */
23
- validation?: VALIDATION;
24
- }
7
+ import React from 'react';
8
+ import { ITextareaProps } from '../types';
25
9
  /**
26
10
  * @extends TextareaHTMLAttributes<HTMLTextAreaElement>
27
11
  */
@@ -4,11 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { InputHTMLAttributes } from 'react';
8
- export interface IToggleProps extends InputHTMLAttributes<HTMLInputElement> {
9
- /** Applies compact styling */
10
- isCompact?: boolean;
11
- }
7
+ import React from 'react';
8
+ import { IToggleProps } from '../types';
12
9
  /**
13
10
  * @extends InputHTMLAttributes<HTMLInputElement>
14
11
  */
@@ -4,14 +4,9 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { FieldsetHTMLAttributes } from 'react';
7
+ import React from 'react';
8
8
  import { Legend } from './Legend';
9
- export interface IFieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
10
- /**
11
- * Applies compact styling
12
- */
13
- isCompact?: boolean;
14
- }
9
+ import { IFieldsetProps } from '../../types';
15
10
  /**
16
11
  * @extends FieldsetHTMLAttributes<HTMLFieldSetElement>
17
12
  */
@@ -4,11 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
8
- export interface ILabelProps extends HTMLAttributes<HTMLLabelElement> {
9
- /** Applies regular (non-bold) font weight */
10
- isRegular?: boolean;
11
- }
7
+ import React from 'react';
8
+ import { ILabelProps } from '../../types';
12
9
  /**
13
10
  * @extends LabelHTMLAttributes<HTMLLabelElement>
14
11
  */
@@ -4,12 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
8
- import { VALIDATION } from '../../utils/validation';
9
- export interface IMessageProps extends HTMLAttributes<HTMLDivElement> {
10
- /** Applies validation state styling */
11
- validation?: VALIDATION;
12
- }
7
+ import React from 'react';
8
+ import { IMessageProps } from '../../types';
13
9
  /**
14
10
  * @extends HTMLAttributes<HTMLDivElement>
15
11
  */
@@ -5,7 +5,7 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import React, { HTMLAttributes } from 'react';
8
- import { VALIDATION } from '../../utils/validation';
8
+ import { IFauxInputProps } from '../../types';
9
9
  import { StartIcon } from './components/StartIcon';
10
10
  import { EndIcon } from './components/EndIcon';
11
11
  /**
@@ -18,24 +18,6 @@ export interface IIconProps extends HTMLAttributes<HTMLElement> {
18
18
  isRotated: boolean;
19
19
  children: any;
20
20
  }
21
- export interface IFauxInputProps extends HTMLAttributes<HTMLDivElement> {
22
- /** Applies compact styling */
23
- isCompact?: boolean;
24
- /** Removes borders and padding */
25
- isBare?: boolean;
26
- /** Applies inset `box-shadow` styling on focus */
27
- focusInset?: boolean;
28
- /** Indicates that the element is not interactive */
29
- disabled?: boolean;
30
- /** Applies read-only styling */
31
- readOnly?: boolean;
32
- /** Applies validation state styling */
33
- validation?: VALIDATION;
34
- /** Applies focus stying */
35
- isFocused?: boolean;
36
- /** Applies hover stying */
37
- isHovered?: boolean;
38
- }
39
21
  /**
40
22
  * @extends HTMLAttributes<HTMLDivElement>
41
23
  */
@@ -4,21 +4,11 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { SVGAttributes } from 'react';
8
- export interface IFauxInputEndIconProps extends SVGAttributes<SVGElement> {
9
- /** Applies hover styling */
10
- isHovered?: boolean;
11
- /** Applies focus styling */
12
- isFocused?: boolean;
13
- /** Applies disabled styling */
14
- isDisabled?: boolean;
15
- /** Rotates icon 180 degrees */
16
- isRotated?: boolean;
17
- }
7
+ import { IFauxInputIconProps } from '../../../types';
18
8
  /**
19
9
  * @extends SVGAttributes<SVGElement>
20
10
  */
21
11
  export declare const EndIcon: {
22
- (props: IFauxInputEndIconProps): JSX.Element;
12
+ (props: IFauxInputIconProps): JSX.Element;
23
13
  displayName: string;
24
14
  };
@@ -4,21 +4,11 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { SVGAttributes } from 'react';
8
- export interface IFauxInputStartIconProps extends SVGAttributes<SVGElement> {
9
- /** Applies hover styling */
10
- isHovered?: boolean;
11
- /** Applies focus styling */
12
- isFocused?: boolean;
13
- /** Applies disabled styling */
14
- isDisabled?: boolean;
15
- /** Rotates icon 180 degrees */
16
- isRotated?: boolean;
17
- }
7
+ import { IFauxInputIconProps } from '../../../types';
18
8
  /**
19
9
  * @extends SVGAttributes<SVGElement>
20
10
  */
21
11
  export declare const StartIcon: {
22
- (props: IFauxInputStartIconProps): JSX.Element;
12
+ (props: IFauxInputIconProps): JSX.Element;
23
13
  displayName: string;
24
14
  };
@@ -4,20 +4,10 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
7
+ import React from 'react';
8
+ import { IFileProps } from '../../../types';
8
9
  import { Close } from './Close';
9
10
  import { Delete } from './Delete';
10
- import { FILE_TYPE, VALIDATION_TYPE } from '../utils';
11
- export interface IFileProps extends HTMLAttributes<HTMLDivElement> {
12
- /** Applies compact styling */
13
- isCompact?: boolean;
14
- /** Determines the icon to display */
15
- type?: FILE_TYPE;
16
- /** Applies inset `box-shadow` styling on focus */
17
- focusInset?: boolean;
18
- /** Applies validation state styling */
19
- validation?: VALIDATION_TYPE;
20
- }
21
11
  /**
22
12
  * @extends HTMLAttributes<HTMLDivElement>
23
13
  */
@@ -5,21 +5,6 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import React from 'react';
8
- export declare enum FileType {
9
- pdf = "pdf",
10
- zip = "zip",
11
- image = "image",
12
- document = "document",
13
- spreadsheet = "spreadsheet",
14
- presentation = "presentation",
15
- generic = "generic"
16
- }
17
- export declare enum ValidationType {
18
- success = "success",
19
- error = "error"
20
- }
21
- export declare type FILE_TYPE = keyof typeof FileType;
22
- export declare type VALIDATION_TYPE = keyof typeof ValidationType;
23
- export declare const ARRAY_FILE_TYPE: FILE_TYPE[];
24
- export declare const fileIconsDefault: Record<FILE_TYPE | VALIDATION_TYPE, React.ReactNode>;
25
- export declare const fileIconsCompact: Record<FILE_TYPE | VALIDATION_TYPE, React.ReactNode>;
8
+ import { FileType, FileValidation } from '../../types';
9
+ export declare const fileIconsDefault: Record<FileType | FileValidation, React.ReactNode>;
10
+ export declare const fileIconsCompact: Record<FileType | FileValidation, React.ReactNode>;
@@ -4,11 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
8
- export interface IInputGroupProps extends HTMLAttributes<HTMLDivElement> {
9
- /** Applies compact styling */
10
- isCompact?: boolean;
11
- }
7
+ import React from 'react';
8
+ import { IInputGroupProps } from '../../types';
12
9
  /**
13
10
  * @extends HTMLAttributes<HTMLDivElement>
14
11
  */
@@ -4,21 +4,12 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes, ChangeEventHandler } from 'react';
7
+ import React from 'react';
8
+ import { ITilesProps } from '../../types';
8
9
  import { Tile } from './components/Tile';
9
10
  import { Description } from './components/Description';
10
11
  import { Icon } from './components/Icon';
11
12
  import { Label } from './components/Label';
12
- export interface ITilesProps extends HTMLAttributes<HTMLDivElement> {
13
- /** Sets the value of the selected radio button */
14
- value?: string;
15
- /** Handles radio selection */
16
- onChange?: ChangeEventHandler<HTMLInputElement>;
17
- /** Sets the name used to reference the value of the control */
18
- name: string;
19
- /** Centers tile content */
20
- isCentered?: boolean;
21
- }
22
13
  /**
23
14
  * @extends HTMLAttributes<HTMLDivElement>
24
15
  */
@@ -4,13 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
8
- export interface ITilesTileProps extends HTMLAttributes<HTMLLabelElement> {
9
- /** Sets the value of the input */
10
- value?: string;
11
- /** Indicates that the element is not interactive */
12
- disabled?: boolean;
13
- }
7
+ import React from 'react';
8
+ import { ITilesTileProps } from '../../../types';
14
9
  /**
15
10
  * @extends HTMLAttributes<HTMLLabelElement>
16
11
  */
@@ -8,47 +8,31 @@
8
8
  export { Field } from './elements/common/Field';
9
9
  export type { IFieldProps } from './elements/common/Field';
10
10
  export { Fieldset } from './elements/common/Fieldset';
11
- export type { IFieldsetProps } from './elements/common/Fieldset';
12
11
  export { Hint } from './elements/common/Hint';
13
12
  export { Label } from './elements/common/Label';
14
- export type { ILabelProps } from './elements/common/Label';
15
13
  export { Message } from './elements/common/Message';
16
- export type { IMessageProps } from './elements/common/Message';
17
14
  /** Fields */
18
15
  export { Checkbox } from './elements/Checkbox';
19
- export type { ICheckboxProps } from './elements/Checkbox';
20
16
  export { Input } from './elements/Input';
21
- export type { IInputProps } from './elements/Input';
22
17
  export { Radio } from './elements/Radio';
23
- export type { IRadioProps } from './elements/Radio';
24
18
  export { Range } from './elements/Range';
25
- export type { IRangeProps } from './elements/Range';
26
19
  export { Textarea } from './elements/Textarea';
27
- export type { ITextareaProps } from './elements/Textarea';
28
20
  export { Toggle } from './elements/Toggle';
29
- export type { IToggleProps } from './elements/Toggle';
30
21
  export { Select } from './elements/Select';
31
- export type { ISelectProps } from './elements/Select';
32
22
  export { MultiThumbRange } from './elements/MultiThumbRange';
33
- export type { IMultiThumbRangeProps } from './elements/MultiThumbRange';
34
23
  /** Tiles */
35
24
  export { Tiles } from './elements/tiles/Tiles';
36
- export type { ITilesProps } from './elements/tiles/Tiles';
37
- export type { ITilesTileProps } from './elements/tiles/components/Tile';
38
25
  /** Input Group */
39
26
  export { InputGroup } from './elements/input-group/InputGroup';
40
- export type { IInputGroupProps } from './elements/input-group/InputGroup';
41
27
  /** File Upload */
42
28
  export { FileUpload } from './elements/FileUpload';
43
- export type { IFileUploadProps } from './elements/FileUpload';
44
29
  /** File List */
45
30
  export { FileList } from './elements/file-list/FileList';
46
31
  export { File } from './elements/file-list/components/File';
47
- export type { IFileProps } from './elements/file-list/components/File';
48
32
  /** Other */
49
33
  export { FauxInput } from './elements/faux-input/FauxInput';
50
- export type { IFauxInputProps, IIconProps } from './elements/faux-input/FauxInput';
51
- export type { IFauxInputStartIconProps } from './elements/faux-input/components/StartIcon';
52
- export type { IFauxInputEndIconProps } from './elements/faux-input/components/EndIcon';
34
+ export type { IIconProps } from './elements/faux-input/FauxInput';
53
35
  export { MediaInput } from './elements/MediaInput';
54
- export type { IMediaInputProps } from './elements/MediaInput';
36
+ /** types */
37
+ export { VALIDATION } from './types';
38
+ export type { IFieldsetProps, ILabelProps, IMessageProps, ICheckboxProps, IRadioProps, IToggleProps, IInputProps, ITextareaProps, ISelectProps, IFileUploadProps, IFileProps, IRangeProps, IMultiThumbRangeProps, IInputGroupProps, ITilesProps, ITilesTileProps, IFauxInputProps, IFauxInputIconProps as IFauxInputStartIconProps, IFauxInputIconProps as IFauxInputEndIconProps, IMediaInputProps } from './types';
@@ -5,9 +5,9 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
- import { VALIDATION } from '../../utils/validation';
8
+ import { Validation } from '../../types';
9
9
  export interface IStyledMessageProps {
10
- validation?: VALIDATION;
10
+ validation?: Validation;
11
11
  }
12
12
  export declare const StyledMessage: import("styled-components").StyledComponent<"div", DefaultTheme, {
13
13
  'data-garden-id': string;
@@ -5,9 +5,9 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import React from 'react';
8
- import { VALIDATION } from '../../utils/validation';
8
+ import { Validation } from '../../types';
9
9
  interface IStyledMessageIconProps {
10
- validation?: VALIDATION;
10
+ validation?: Validation;
11
11
  }
12
12
  export declare const StyledMessageIcon: import("styled-components").StyledComponent<React.FC<IStyledMessageIconProps>, import("styled-components").DefaultTheme, {
13
13
  'data-garden-id': string;
@@ -5,10 +5,11 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
+ import { FileValidation } from '../../types';
8
9
  interface IStyledFileProps {
9
10
  isCompact?: boolean;
10
11
  focusInset?: boolean;
11
- validation?: 'success' | 'error';
12
+ validation?: FileValidation;
12
13
  }
13
14
  export declare const StyledFile: import("styled-components").StyledComponent<"div", DefaultTheme, {
14
15
  'data-garden-id': string;
@@ -5,13 +5,13 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
- import { VALIDATION } from '../../utils/validation';
8
+ import { Validation } from '../../types';
9
9
  export interface IStyledTextInputProps {
10
10
  isCompact?: boolean;
11
11
  isBare?: boolean;
12
12
  isHovered?: boolean;
13
13
  isFocused?: boolean;
14
14
  focusInset?: boolean;
15
- validation?: VALIDATION;
15
+ validation?: Validation;
16
16
  }
17
17
  export declare const StyledTextInput: import("styled-components").StyledComponent<"input", DefaultTheme, IStyledTextInputProps, never>;
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { FieldsetHTMLAttributes, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, SelectHTMLAttributes, SVGAttributes, TextareaHTMLAttributes } from 'react';
8
+ export declare const VALIDATION: readonly ["success", "warning", "error"];
9
+ export declare const FILE_VALIDATION: readonly ["success", "error"];
10
+ export declare const FILE_TYPE: readonly ["pdf", "zip", "image", "document", "spreadsheet", "presentation", "generic"];
11
+ export declare type Validation = typeof VALIDATION[number];
12
+ export declare type FileValidation = typeof FILE_VALIDATION[number];
13
+ export declare type FileType = typeof FILE_TYPE[number];
14
+ export interface IFieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
15
+ /** Applies compact styling */
16
+ isCompact?: boolean;
17
+ }
18
+ export interface IInputGroupProps extends Pick<IFieldsetProps, 'isCompact'>, HTMLAttributes<HTMLDivElement> {
19
+ }
20
+ export interface ILabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
21
+ /** Applies regular (non-bold) font weight */
22
+ isRegular?: boolean;
23
+ /** Hides the label visually without hiding it from screen readers */
24
+ hidden?: LabelHTMLAttributes<HTMLLabelElement>['hidden'];
25
+ }
26
+ export interface IMessageProps extends HTMLAttributes<HTMLDivElement> {
27
+ /** Applies validation state styling */
28
+ validation?: Validation;
29
+ }
30
+ export interface IRadioProps extends InputHTMLAttributes<HTMLInputElement> {
31
+ /** Applies compact styling */
32
+ isCompact?: IFieldsetProps['isCompact'];
33
+ }
34
+ export interface IToggleProps extends IRadioProps {
35
+ }
36
+ export interface ICheckboxProps extends IRadioProps {
37
+ /**
38
+ * Sets the checkbox state to
39
+ * [indeterminate](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes)
40
+ */
41
+ indeterminate?: boolean;
42
+ }
43
+ export interface IInputProps extends IRadioProps {
44
+ /** Removes borders and padding */
45
+ isBare?: boolean;
46
+ /** Applies inset `box-shadow` styling on focus */
47
+ focusInset?: boolean;
48
+ /** Applies validation state styling */
49
+ validation?: Validation;
50
+ }
51
+ export interface IMediaInputProps extends IInputProps {
52
+ /** Accepts a "start" icon to display */
53
+ start?: any;
54
+ /** Accepts an "end" icon to display */
55
+ end?: any;
56
+ /** Applies props to the wrapping [FauxInput](#fauxinput) element */
57
+ wrapperProps?: any;
58
+ /** Applies a ref to the wrapping [FauxInput](#fauxinput) element */
59
+ wrapperRef?: any;
60
+ }
61
+ export interface IFauxInputProps extends Pick<IInputProps, 'isCompact' | 'isBare' | 'focusInset' | 'validation'>, HTMLAttributes<HTMLDivElement> {
62
+ /** Indicates that the element is not interactive */
63
+ disabled?: IInputProps['disabled'];
64
+ /** Applies read-only styling */
65
+ readOnly?: IInputProps['readOnly'];
66
+ /** Applies focus stying */
67
+ isFocused?: boolean;
68
+ /** Applies hover stying */
69
+ isHovered?: boolean;
70
+ }
71
+ export interface IFauxInputIconProps extends Pick<IFauxInputProps, 'isHovered' | 'isFocused'>, SVGAttributes<SVGElement> {
72
+ /** Applies disabled styling */
73
+ isDisabled?: IFauxInputProps['disabled'];
74
+ /** Rotates icon 180 degrees */
75
+ isRotated?: boolean;
76
+ }
77
+ export interface ITextareaProps extends Pick<IInputProps, 'isCompact' | 'isBare' | 'focusInset' | 'validation'>, TextareaHTMLAttributes<HTMLTextAreaElement> {
78
+ /** Enables manual vertical resize */
79
+ isResizable?: boolean;
80
+ /** Defines the minimum height in rows */
81
+ minRows?: number;
82
+ /** Defines the maximum height in rows */
83
+ maxRows?: number;
84
+ }
85
+ export interface ISelectProps extends Pick<IInputProps, 'isCompact' | 'isBare' | 'focusInset' | 'validation'>, SelectHTMLAttributes<HTMLSelectElement> {
86
+ }
87
+ export interface IFileUploadProps extends Pick<IInputProps, 'disabled' | 'isCompact'>, HTMLAttributes<HTMLDivElement> {
88
+ /** Indicates that the element is not interactive */
89
+ disabled?: IInputProps['disabled'];
90
+ /** Applies drag styling */
91
+ isDragging?: boolean;
92
+ }
93
+ export interface IFileProps extends Pick<IInputProps, 'isCompact' | 'focusInset'>, HTMLAttributes<HTMLDivElement> {
94
+ /** Determines the icon to display */
95
+ type?: FileType;
96
+ /** Applies validation state styling */
97
+ validation?: FileValidation;
98
+ }
99
+ export interface IRangeProps extends InputHTMLAttributes<HTMLInputElement> {
100
+ /** @ignore */
101
+ hasLowerTrack?: boolean;
102
+ }
103
+ export interface IMultiThumbRangeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
104
+ /** Sets the minimum permitted value */
105
+ min?: number;
106
+ /** Sets the maximum permitted value */
107
+ max?: number;
108
+ /** Sets the minimum thumb input value */
109
+ minValue?: number;
110
+ /** Sets the maximum thumb input value */
111
+ maxValue?: number;
112
+ /** Defines the stepping interval */
113
+ step?: number;
114
+ /** Indicates that the element is not interactive */
115
+ disabled?: IRangeProps['disabled'];
116
+ /**
117
+ * Handles change events
118
+ *
119
+ * @param {Object} updatedValues The values that have changed
120
+ * @param {number} [updatedValues.minValue] The optional minimum value
121
+ * @param {number} [updatedValues.maxValue] The optional maximum value
122
+ * */
123
+ onChange?: (updatedValues: {
124
+ minValue?: number;
125
+ maxValue?: number;
126
+ }) => void;
127
+ }
128
+ export interface ITilesProps extends HTMLAttributes<HTMLDivElement> {
129
+ /** Sets the value of the selected radio button */
130
+ value?: IRadioProps['value'];
131
+ /** Handles radio selection */
132
+ onChange?: IRadioProps['onChange'];
133
+ /** Sets the name used to reference the value of the control */
134
+ name: NonNullable<IRadioProps['name']>;
135
+ /** Centers tile content */
136
+ isCentered?: boolean;
137
+ }
138
+ export interface ITilesTileProps extends HTMLAttributes<HTMLLabelElement> {
139
+ /** Sets the value of the input */
140
+ value?: IRadioProps['value'];
141
+ /** Indicates that the element is not interactive */
142
+ disabled?: IRadioProps['disabled'];
143
+ }
@@ -4,13 +4,7 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { ChangeEventHandler } from 'react';
8
- interface ITilesContext {
9
- value?: string;
10
- onChange?: ChangeEventHandler<HTMLInputElement>;
11
- name: string;
12
- isCentered?: boolean;
13
- }
14
- export declare const TilesContext: import("react").Context<ITilesContext | undefined>;
15
- export declare const useTilesContext: () => ITilesContext | undefined;
16
- export {};
7
+ /// <reference types="react" />
8
+ import { ITilesProps } from '../types';
9
+ export declare const TilesContext: import("react").Context<Pick<ITilesProps, "value" | "onChange" | "name" | "isCentered"> | undefined>;
10
+ export declare const useTilesContext: () => Pick<ITilesProps, "value" | "onChange" | "name" | "isCentered"> | undefined;