@aws-amplify/ui-react 3.0.0 → 3.0.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 (134) hide show
  1. package/README.md +1 -1
  2. package/dist/IconWarning-45c2c272.js +1 -0
  3. package/dist/esm/components/Authenticator/Authenticator.js +1 -1
  4. package/dist/esm/components/Authenticator/ConfirmSignIn/ConfirmSignIn.js +1 -1
  5. package/dist/esm/components/Authenticator/ConfirmSignUp/ConfirmSignUp.js +1 -1
  6. package/dist/esm/components/Authenticator/FederatedSignIn/FederatedSignIn.js +1 -1
  7. package/dist/esm/components/Authenticator/ForceNewPassword/ForceNewPassword.js +1 -1
  8. package/dist/esm/components/Authenticator/ResetPassword/ConfirmResetPassword.js +1 -1
  9. package/dist/esm/components/Authenticator/ResetPassword/ResetPassword.js +1 -1
  10. package/dist/esm/components/Authenticator/Router/Router.js +1 -1
  11. package/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.js +1 -1
  12. package/dist/esm/components/Authenticator/SignIn/SignIn.js +1 -1
  13. package/dist/esm/components/Authenticator/SignUp/SignUp.js +1 -1
  14. package/dist/esm/components/Authenticator/VerifyUser/ConfirmVerifyUser.js +1 -1
  15. package/dist/esm/components/Authenticator/VerifyUser/VerifyUser.js +1 -1
  16. package/dist/esm/components/Authenticator/hooks/useAuthenticator/index.js +1 -1
  17. package/dist/esm/components/Authenticator/shared/ValidationErrors.js +1 -1
  18. package/dist/esm/primitives/shared/constants.js +1 -1
  19. package/dist/esm/primitives-catalog.js +9 -0
  20. package/dist/index.js +1 -1
  21. package/dist/internal.js +1 -1
  22. package/dist/primitives.json +9 -0
  23. package/dist/styles.css +140 -1
  24. package/dist/types/components/Authenticator/Authenticator.d.ts +2 -2
  25. package/dist/types/components/Authenticator/ConfirmSignUp/ConfirmSignUp.d.ts +1 -1
  26. package/dist/types/components/Authenticator/Router/Router.d.ts +3 -1
  27. package/dist/types/components/Authenticator/hooks/useAuthenticator/index.d.ts +30 -31
  28. package/dist/types/components/Authenticator/hooks/useFormHandlers/useFormHandlers.d.ts +2 -2
  29. package/dist/types/components/Authenticator/shared/ValidationErrors.d.ts +1 -1
  30. package/dist/types/components/Authenticator/withAuthenticator.d.ts +2 -2
  31. package/dist/types/components/Geo/LocationSearch/index.d.ts +1 -1
  32. package/dist/types/components/Geo/MapView/index.d.ts +1 -1
  33. package/dist/types/hooks/useAuth.d.ts +0 -1
  34. package/dist/types/primitives/Alert/Alert.d.ts +1 -1
  35. package/dist/types/primitives/Badge/Badge.d.ts +1 -1
  36. package/dist/types/primitives/Button/Button.d.ts +1 -1
  37. package/dist/types/primitives/ButtonGroup/ButtonGroup.d.ts +1 -1
  38. package/dist/types/primitives/Card/Card.d.ts +1 -1
  39. package/dist/types/primitives/Checkbox/Checkbox.d.ts +1 -1
  40. package/dist/types/primitives/CheckboxField/CheckboxField.d.ts +1 -1
  41. package/dist/types/primitives/Divider/Divider.d.ts +1 -1
  42. package/dist/types/primitives/Expander/Expander.d.ts +1 -1
  43. package/dist/types/primitives/Expander/ExpanderItem.d.ts +1 -1
  44. package/dist/types/primitives/Field/FieldClearButton.d.ts +1 -1
  45. package/dist/types/primitives/FieldGroup/FieldGroup.d.ts +1 -1
  46. package/dist/types/primitives/FieldGroupIcon/FieldGroupIcon.d.ts +1 -1
  47. package/dist/types/primitives/FieldGroupIcon/FieldGroupIconButton.d.ts +1 -1
  48. package/dist/types/primitives/Flex/Flex.d.ts +1 -1
  49. package/dist/types/primitives/Grid/Grid.d.ts +1 -1
  50. package/dist/types/primitives/Heading/Heading.d.ts +1 -1
  51. package/dist/types/primitives/Icon/Icon.d.ts +1 -1
  52. package/dist/types/primitives/Image/Image.d.ts +1 -1
  53. package/dist/types/primitives/Input/Input.d.ts +1 -1
  54. package/dist/types/primitives/Label/Label.d.ts +1 -1
  55. package/dist/types/primitives/Link/Link.d.ts +1 -1
  56. package/dist/types/primitives/Loader/Loader.d.ts +1 -1
  57. package/dist/types/primitives/Menu/Menu.d.ts +1 -1
  58. package/dist/types/primitives/Pagination/Pagination.d.ts +1 -1
  59. package/dist/types/primitives/PasswordField/PasswordField.d.ts +1 -1
  60. package/dist/types/primitives/PasswordField/ShowPasswordButton.d.ts +1 -1
  61. package/dist/types/primitives/PhoneNumberField/CountryCodeSelect.d.ts +1 -1
  62. package/dist/types/primitives/PhoneNumberField/PhoneNumberField.d.ts +1 -1
  63. package/dist/types/primitives/Placeholder/Placeholder.d.ts +1 -1
  64. package/dist/types/primitives/Radio/Radio.d.ts +1 -1
  65. package/dist/types/primitives/RadioGroupField/RadioGroupField.d.ts +1 -1
  66. package/dist/types/primitives/Rating/Rating.d.ts +1 -1
  67. package/dist/types/primitives/ScrollView/ScrollView.d.ts +1 -1
  68. package/dist/types/primitives/SearchField/SearchField.d.ts +1 -1
  69. package/dist/types/primitives/SearchField/SearchFieldButton.d.ts +1 -1
  70. package/dist/types/primitives/Select/Select.d.ts +1 -1
  71. package/dist/types/primitives/SelectField/SelectField.d.ts +1 -1
  72. package/dist/types/primitives/SliderField/SliderField.d.ts +1 -1
  73. package/dist/types/primitives/StepperField/StepperField.d.ts +1 -1
  74. package/dist/types/primitives/SwitchField/SwitchField.d.ts +1 -1
  75. package/dist/types/primitives/Table/Table.d.ts +1 -1
  76. package/dist/types/primitives/Table/TableBody.d.ts +1 -1
  77. package/dist/types/primitives/Table/TableCell.d.ts +1 -1
  78. package/dist/types/primitives/Table/TableFoot.d.ts +1 -1
  79. package/dist/types/primitives/Table/TableHead.d.ts +1 -1
  80. package/dist/types/primitives/Table/TableRow.d.ts +1 -1
  81. package/dist/types/primitives/Tabs/Tabs.d.ts +2 -2
  82. package/dist/types/primitives/Text/Text.d.ts +1 -1
  83. package/dist/types/primitives/TextArea/TextArea.d.ts +1 -1
  84. package/dist/types/primitives/TextAreaField/TextAreaField.d.ts +1 -1
  85. package/dist/types/primitives/ToggleButton/ToggleButton.d.ts +1 -1
  86. package/dist/types/primitives/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
  87. package/dist/types/primitives/View/View.d.ts +2 -2
  88. package/dist/types/primitives/VisuallyHidden/VisuallyHidden.d.ts +1 -1
  89. package/dist/types/primitives/shared/constants.d.ts +1 -1
  90. package/dist/types/primitives/types/alert.d.ts +6 -0
  91. package/dist/types/primitives/types/badge.d.ts +2 -0
  92. package/dist/types/primitives/types/base.d.ts +15 -0
  93. package/dist/types/primitives/types/button.d.ts +12 -2
  94. package/dist/types/primitives/types/card.d.ts +4 -0
  95. package/dist/types/primitives/types/checkbox.d.ts +8 -4
  96. package/dist/types/primitives/types/collection.d.ts +20 -2
  97. package/dist/types/primitives/types/divider.d.ts +7 -2
  98. package/dist/types/primitives/types/expander.d.ts +7 -0
  99. package/dist/types/primitives/types/field.d.ts +6 -1
  100. package/dist/types/primitives/types/fieldGroupIcon.d.ts +2 -0
  101. package/dist/types/primitives/types/flex.d.ts +8 -1
  102. package/dist/types/primitives/types/grid.d.ts +84 -0
  103. package/dist/types/primitives/types/heading.d.ts +4 -0
  104. package/dist/types/primitives/types/icon.d.ts +16 -9
  105. package/dist/types/primitives/types/image.d.ts +26 -9
  106. package/dist/types/primitives/types/input.d.ts +47 -22
  107. package/dist/types/primitives/types/label.d.ts +2 -0
  108. package/dist/types/primitives/types/link.d.ts +10 -0
  109. package/dist/types/primitives/types/loader.d.ts +7 -0
  110. package/dist/types/primitives/types/menu.d.ts +16 -3
  111. package/dist/types/primitives/types/pagination.d.ts +29 -6
  112. package/dist/types/primitives/types/passwordField.d.ts +22 -6
  113. package/dist/types/primitives/types/phoneNumberField.d.ts +25 -0
  114. package/dist/types/primitives/types/placeholder.d.ts +4 -1
  115. package/dist/types/primitives/types/radio.d.ts +1 -0
  116. package/dist/types/primitives/types/radioGroupField.d.ts +2 -0
  117. package/dist/types/primitives/types/rating.d.ts +7 -0
  118. package/dist/types/primitives/types/searchField.d.ts +9 -2
  119. package/dist/types/primitives/types/select.d.ts +52 -0
  120. package/dist/types/primitives/types/selectField.d.ts +1 -0
  121. package/dist/types/primitives/types/sliderField.d.ts +56 -0
  122. package/dist/types/primitives/types/stepperField.d.ts +39 -2
  123. package/dist/types/primitives/types/style.d.ts +387 -6
  124. package/dist/types/primitives/types/switchField.d.ts +13 -1
  125. package/dist/types/primitives/types/table.d.ts +12 -0
  126. package/dist/types/primitives/types/tabs.d.ts +8 -0
  127. package/dist/types/primitives/types/text.d.ts +3 -0
  128. package/dist/types/primitives/types/textArea.d.ts +34 -14
  129. package/dist/types/primitives/types/textField.d.ts +5 -0
  130. package/dist/types/primitives/types/toggleButton.d.ts +16 -0
  131. package/dist/types/primitives/types/toggleButtonGroup.d.ts +20 -0
  132. package/dist/types/primitives/types/view.d.ts +25 -0
  133. package/package.json +2 -2
  134. package/dist/IconWarning-3289842c.js +0 -1
@@ -2,13 +2,38 @@ import * as React from 'react';
2
2
  import { SelectFieldProps } from './selectField';
3
3
  import { TextInputFieldProps } from './textField';
4
4
  export interface PhoneNumberFieldProps extends TextInputFieldProps {
5
+ /**
6
+ * @description
7
+ * Sets a hidden and accessible label for the dial code selector
8
+ */
5
9
  countryCodeLabel?: string;
10
+ /**
11
+ * @description
12
+ * Sets the name used when handling form submission for the dial code selector
13
+ */
6
14
  countryCodeName?: string;
15
+ /**
16
+ * @description
17
+ * Sets the default dial code that will be selected on initial render
18
+ */
7
19
  defaultCountryCode: string;
20
+ /**
21
+ * @description
22
+ * Accepts an array of dial codes (strings) used as options in the dial code selector
23
+ */
8
24
  dialCodeList?: Array<string>;
25
+ /**
26
+ * @description
27
+ * Handles change events for the dial code selector
28
+ */
9
29
  onCountryCodeChange?: React.ChangeEventHandler<HTMLSelectElement>;
30
+ /**
31
+ * @description
32
+ * <input> elements of type 'tel' are used to let the user enter and edit a telephone number
33
+ */
10
34
  type?: 'tel';
11
35
  /**
36
+ * @description
12
37
  * Forwarded ref for access to Country Code select DOM element
13
38
  */
14
39
  countryCodeRef?: React.Ref<HTMLSelectElement>;
@@ -3,11 +3,14 @@ import { ViewProps } from './view';
3
3
  export declare type PlaceholderSizes = Sizes;
4
4
  export interface PlaceholderProps extends ViewProps {
5
5
  /**
6
+ * @description
6
7
  * If true, the placeholder won't show, if false the placeholder will show.
7
- * @default false
8
+ * @default
9
+ * false
8
10
  */
9
11
  isLoaded?: boolean;
10
12
  /**
13
+ * @description
11
14
  * Controls the display size of placeholder
12
15
  */
13
16
  size?: PlaceholderSizes;
@@ -3,6 +3,7 @@ import { LabelPositions } from './field';
3
3
  export interface RadioProps extends InputProps {
4
4
  value: string;
5
5
  /**
6
+ * @description
6
7
  * Position of label in relation to the radio,
7
8
  * default is 'start'
8
9
  */
@@ -7,10 +7,12 @@ export interface RadioGroupFieldProps extends FieldProps, FlexContainerStyleProp
7
7
  value?: string;
8
8
  defaultValue?: string;
9
9
  /**
10
+ * @description
10
11
  * Handle onChange event
11
12
  */
12
13
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
13
14
  /**
15
+ * @description
14
16
  * Position of label in relation to the radio,
15
17
  * default is 'start'
16
18
  */
@@ -5,22 +5,26 @@ import { StyleToken } from './style';
5
5
  export declare type RatingSizes = Sizes;
6
6
  export interface RatingOptions {
7
7
  /**
8
+ * @description
8
9
  * The CSS color to use on the empty rating icon
9
10
  * Default css value is #A2A2A2
10
11
  */
11
12
  emptyColor?: StyleToken<Property.Color>;
12
13
  /**
14
+ * @description
13
15
  * This will override which icon to use as the empty icon. This will only
14
16
  * override the empty icon an will create a rating component that uses
15
17
  * different icons for filled and empty icons.
16
18
  */
17
19
  emptyIcon?: JSX.Element;
18
20
  /**
21
+ * @description
19
22
  * The CSS color to use on the filled rating icon
20
23
  * Default css value is #ffb400
21
24
  */
22
25
  fillColor?: StyleToken<Property.Color>;
23
26
  /**
27
+ * @description
24
28
  * This will override which icon to use. This will override both
25
29
  * the filled and empty icon values unless an empty icon is specified
26
30
  * with the emptyIcon prop
@@ -28,17 +32,20 @@ export interface RatingOptions {
28
32
  */
29
33
  icon?: JSX.Element;
30
34
  /**
35
+ * @description
31
36
  * The max rating integer value
32
37
  * Default is 5
33
38
  */
34
39
  maxValue?: number;
35
40
  /**
41
+ * @description
36
42
  *
37
43
  * This will set the icon size of the stars
38
44
  * Default css value is medium
39
45
  */
40
46
  size?: RatingSizes;
41
47
  /**
48
+ * @description
42
49
  * The value of the rating
43
50
  * Default is 0
44
51
  */
@@ -3,24 +3,31 @@ import { FieldGroupIconButtonProps } from './fieldGroupIcon';
3
3
  import { TextInputFieldProps } from './textField';
4
4
  export interface SearchFieldProps extends TextInputFieldProps {
5
5
  /**
6
+ * @description
6
7
  * Handle submission of search field input
7
8
  */
8
9
  onSubmit?: (value: string) => void;
9
10
  /**
11
+ * @description
10
12
  * Triggered when search field is cleared
11
13
  */
12
14
  onClear?: () => void;
13
15
  /**
16
+ * @description
14
17
  * Visually hide label
15
- * @default true
18
+ * @default
19
+ * true
16
20
  */
17
21
  labelHidden?: boolean;
18
22
  /**
23
+ * @description
19
24
  * Set the `aria-label` for clear button
20
- * @default "Clear search"
25
+ * @default
26
+ * "Clear search"
21
27
  */
22
28
  clearButtonLabel?: string;
23
29
  /**
30
+ * @description
24
31
  * Provides ref access to search button DOM element
25
32
  */
26
33
  searchButtonRef?: React.Ref<HTMLButtonElement>;
@@ -3,17 +3,69 @@ import { ViewProps } from './view';
3
3
  import { Sizes } from './base';
4
4
  export declare type SelectVariation = 'quiet';
5
5
  export interface SelectProps extends ViewProps {
6
+ /**
7
+ * @description
8
+ * A string providing a hint for a user agent's autocomplete feature
9
+ */
6
10
  autoComplete?: string;
11
+ /**
12
+ * @description
13
+ * Specifies the name of the control used when submitting form data
14
+ */
7
15
  name?: string;
16
+ /**
17
+ * @description
18
+ * Sets the SelectField’s initial value on render
19
+ */
8
20
  defaultValue?: string;
21
+ /**
22
+ * @description
23
+ * Controls the current value when using the SelectField as a controlled component
24
+ */
9
25
  value?: string;
26
+ /**
27
+ * @description
28
+ * Changes the height and font size of the SelectField. Available options are ‘small’, none (default), and ‘large’
29
+ */
10
30
  size?: Sizes;
31
+ /**
32
+ * @description
33
+ * Changes the displayed style of the SelectField. Options include ‘quiet’ and none (default)
34
+ */
11
35
  variation?: SelectVariation;
36
+ /**
37
+ * @description
38
+ * Changes the icon used to expand and collapse the SelectField
39
+ */
12
40
  icon?: React.ReactElement;
41
+ /**
42
+ * @description
43
+ * Controls the color of the icon used to expand and collapse the SelectField
44
+ */
13
45
  iconColor?: string;
46
+ /**
47
+ * @description
48
+ * Sets the text that appears in the form control when it has no value set
49
+ */
14
50
  placeholder?: string;
51
+ /**
52
+ * @description
53
+ * Marks the SelectField as having a validation error
54
+ */
15
55
  hasError?: boolean;
56
+ /**
57
+ * @description
58
+ * A Boolean attribute indicating that the user cannot interact with the control
59
+ */
16
60
  isDisabled?: boolean;
61
+ /**
62
+ * @description
63
+ * A Boolean attribute indicating that an option with a non-empty string value must be selected
64
+ */
17
65
  isRequired?: boolean;
66
+ /**
67
+ * @description
68
+ * Handles changes to the current value when using the SelectField as a controlled component
69
+ */
18
70
  onChange?: React.ChangeEventHandler<HTMLSelectElement>;
19
71
  }
@@ -3,6 +3,7 @@ import { SelectProps } from './select';
3
3
  import { FieldProps } from './field';
4
4
  export interface SelectFieldProps extends FieldProps, FlexContainerStyleProps, SelectProps {
5
5
  /**
6
+ * @description
6
7
  * List of option values for select dropdown
7
8
  */
8
9
  options?: string[];
@@ -3,18 +3,74 @@ import { StyleToken } from './style';
3
3
  import { TextInputFieldProps } from './textField';
4
4
  import { ViewProps } from './view';
5
5
  declare type SliderOrientation = 'horizontal' | 'vertical';
6
+ declare type Direction = 'ltr' | 'rtl';
6
7
  export interface SliderFieldProps extends TextInputFieldProps, ViewProps {
8
+ /**
9
+ * @description
10
+ * Sets the minimum value for the SliderField range
11
+ */
7
12
  min?: number;
13
+ /**
14
+ * @description
15
+ * Sets the maximum value for the SliderField range
16
+ */
8
17
  max?: number;
18
+ /**
19
+ * @description
20
+ * Controls the interval between selectable values
21
+ */
9
22
  step?: number;
23
+ /**
24
+ * @description
25
+ * Changes the orientation of the SliderField to either 'vertical' or 'horizontal' (default)
26
+ */
10
27
  orientation?: SliderOrientation;
28
+ /**
29
+ * @description
30
+ * When `true`, hides the numerical value to the right of the label
31
+ */
11
32
  isValueHidden?: boolean;
33
+ /**
34
+ * @description
35
+ * Controls the width of the track and size of the thumb. Options include 'small', none (default), and 'large'
36
+ */
12
37
  trackSize?: string;
38
+ /**
39
+ * @description
40
+ * Applies to the empty part of the SliderField track
41
+ */
13
42
  emptyTrackColor?: StyleToken<Property.Color>;
43
+ /**
44
+ * @description
45
+ * Applies to the filled-in part of the SliderField track
46
+ */
14
47
  filledTrackColor?: StyleToken<Property.Color>;
48
+ /**
49
+ * @description
50
+ * Applies to the thumb component that users can slide
51
+ */
15
52
  thumbColor?: StyleToken<Property.Color>;
53
+ /**
54
+ * @description
55
+ * Controls the current value when using the SliderField as a controlled component
56
+ */
16
57
  value?: number;
58
+ /**
59
+ * @description
60
+ * Sets the SliderField’s initial value on render
61
+ */
17
62
  defaultValue?: number;
63
+ /**
64
+ * @description
65
+ * Handles changes to the current value when using the SliderField as a controlled component
66
+ */
18
67
  onChange?: (value: number) => void;
68
+ /**
69
+ * @description
70
+ * sets the direction of the slider.
71
+ * @see
72
+ * [Radix docs](https://www.radix-ui.com/docs/primitives/components/slider)
73
+ */
74
+ dir?: Direction;
19
75
  }
20
76
  export {};
@@ -1,29 +1,66 @@
1
1
  import { TextInputFieldProps } from '../types/textField';
2
2
  export interface StepperFieldProps extends TextInputFieldProps {
3
+ /**
4
+ * @description
5
+ * <input> elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries.
6
+ */
3
7
  type?: 'number';
8
+ /**
9
+ * @description
10
+ * Sets the minimum possible value
11
+ */
4
12
  min?: number;
13
+ /**
14
+ * @description
15
+ * Sets the maximum possible value
16
+ */
5
17
  max?: number;
18
+ /**
19
+ * @description
20
+ * Controls the interval between selectable values
21
+ */
6
22
  step?: number;
23
+ /**
24
+ * @description
25
+ * Controls the current value when using the StepperField as a controlled component
26
+ */
7
27
  value?: number;
28
+ /**
29
+ * @description
30
+ * Sets the StepperField’s initial value on render
31
+ */
8
32
  defaultValue?: number;
9
33
  /**
34
+ * @description
10
35
  * Set the label text for increase button.
11
36
  * This will be used to construct its the `aria-label`. e.g., "Increase to 2" if the current step is 1.
12
- * @default "Increase to"
37
+ * @default
38
+ * "Increase to"
13
39
  */
14
40
  increaseButtonLabel?: string;
15
41
  /**
42
+ * @description
16
43
  * Set the label text for decrease button.
17
44
  * This will be used to construct its the `aria-label`. e.g., "Decrease to 0" if the current step is 1.
18
- * @default "Decrease to"
45
+ * @default
46
+ * "Decrease to"
19
47
  */
20
48
  decreaseButtonLabel?: string;
21
49
  /**
50
+ * @description
22
51
  * TODO:
23
52
  * Extends StepperField props from Omit<TextFieldProps, 'onChange'>, after removing [key: string]: any from the base type
24
53
  * and rename onStepChange to onChange
25
54
  */
26
55
  onStepChange?: (value: number) => void;
56
+ /**
57
+ * @description
58
+ * Handles the event when a user clicks on the increment button
59
+ */
27
60
  onIncrease?: () => void;
61
+ /**
62
+ * @description
63
+ * Handles the event when a user clicks on the decrement button
64
+ */
28
65
  onDecrease?: () => void;
29
66
  }