@aws-amplify/ui-react 3.0.1 → 3.0.4

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 (113) hide show
  1. package/dist/IconWarning-227761f5.js +1 -0
  2. package/dist/esm/components/Authenticator/Authenticator.js +1 -1
  3. package/dist/esm/components/Authenticator/ConfirmSignIn/ConfirmSignIn.js +1 -1
  4. package/dist/esm/components/Authenticator/ConfirmSignUp/ConfirmSignUp.js +1 -1
  5. package/dist/esm/components/Authenticator/FederatedSignIn/FederatedSignIn.js +1 -1
  6. package/dist/esm/components/Authenticator/ForceNewPassword/ForceNewPassword.js +1 -1
  7. package/dist/esm/components/Authenticator/ResetPassword/ConfirmResetPassword.js +1 -1
  8. package/dist/esm/components/Authenticator/ResetPassword/ResetPassword.js +1 -1
  9. package/dist/esm/components/Authenticator/Router/Router.js +1 -1
  10. package/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.js +1 -1
  11. package/dist/esm/components/Authenticator/SignIn/SignIn.js +1 -1
  12. package/dist/esm/components/Authenticator/SignUp/SignUp.js +1 -1
  13. package/dist/esm/components/Authenticator/VerifyUser/ConfirmVerifyUser.js +1 -1
  14. package/dist/esm/components/Authenticator/VerifyUser/VerifyUser.js +1 -1
  15. package/dist/esm/components/Authenticator/hooks/useAuthenticator/index.js +1 -1
  16. package/dist/esm/components/Authenticator/shared/ValidationErrors.js +1 -1
  17. package/dist/esm/primitives/shared/constants.js +1 -1
  18. package/dist/esm/primitives-catalog.js +9 -0
  19. package/dist/index.js +1 -1
  20. package/dist/internal.js +1 -1
  21. package/dist/primitives.json +9 -0
  22. package/dist/styles.css +150 -8
  23. package/dist/types/components/Authenticator/Authenticator.d.ts +12 -5
  24. package/dist/types/components/Authenticator/ConfirmSignUp/ConfirmSignUp.d.ts +1 -1
  25. package/dist/types/components/Authenticator/Router/Router.d.ts +1 -2
  26. package/dist/types/components/Authenticator/Router/types.d.ts +0 -7
  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/button.d.ts +4 -2
  91. package/dist/types/primitives/types/checkbox.d.ts +4 -2
  92. package/dist/types/primitives/types/collection.d.ts +9 -2
  93. package/dist/types/primitives/types/divider.d.ts +4 -2
  94. package/dist/types/primitives/types/field.d.ts +2 -1
  95. package/dist/types/primitives/types/flex.d.ts +1 -1
  96. package/dist/types/primitives/types/grid.d.ts +84 -0
  97. package/dist/types/primitives/types/icon.d.ts +10 -8
  98. package/dist/types/primitives/types/image.d.ts +12 -9
  99. package/dist/types/primitives/types/input.d.ts +32 -22
  100. package/dist/types/primitives/types/link.d.ts +7 -0
  101. package/dist/types/primitives/types/menu.d.ts +6 -3
  102. package/dist/types/primitives/types/pagination.d.ts +12 -6
  103. package/dist/types/primitives/types/passwordField.d.ts +10 -5
  104. package/dist/types/primitives/types/placeholder.d.ts +2 -1
  105. package/dist/types/primitives/types/searchField.d.ts +4 -2
  106. package/dist/types/primitives/types/sliderField.d.ts +8 -0
  107. package/dist/types/primitives/types/stepperField.d.ts +4 -2
  108. package/dist/types/primitives/types/style.d.ts +122 -66
  109. package/dist/types/primitives/types/switchField.d.ts +0 -1
  110. package/dist/types/primitives/types/textArea.d.ts +17 -13
  111. package/dist/types/primitives/types/view.d.ts +2 -1
  112. package/package.json +2 -2
  113. package/dist/IconWarning-3289842c.js +0 -1
@@ -2,58 +2,71 @@ import * as React from 'react';
2
2
  import { Sizes } from './base';
3
3
  import { FieldVariations } from './field';
4
4
  import { ViewProps } from './view';
5
+ export declare type EnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
5
6
  export declare type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
6
7
  export declare type InputSizes = Sizes;
7
8
  export interface InputProps extends ViewProps {
8
9
  /**
9
10
  * @description
10
- * Specifies permissions for browser UA to autocomplete field
11
- * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
11
+ * Specifies permissions for browser UA to autocomplete field.
12
+ * @see
13
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
12
14
  */
13
15
  autoComplete?: string;
14
16
  /**
15
17
  * @description
16
- * If checked is provided, this will be a controlled checkbox or radio
18
+ * If checked is provided, this will be a controlled checkbox or radio.
17
19
  */
18
20
  checked?: boolean;
19
21
  /**
20
22
  * @description
21
- * Use this to initialize an uncontrolled checkbox or radio
23
+ * Use this to initialize an uncontrolled checkbox or radio.
22
24
  */
23
25
  defaultChecked?: boolean;
24
26
  /**
25
27
  * @description
26
- * Use this to provide a default value for an uncontrolled field
28
+ * Use this to provide a default value for an uncontrolled field.
27
29
  */
28
30
  defaultValue?: React.AllHTMLAttributes<'input'>['defaultValue'];
29
31
  /**
30
32
  * @description
31
- * Indicates that Field is in error state
33
+ * Indicates that Field is in error state.
32
34
  */
33
35
  hasError?: boolean;
34
36
  /**
35
37
  * @description
36
- * Provides hint for virtual keyboard shown
37
- * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
38
- * @default: "text"
38
+ * Defines what action label (or icon) to present for the enter key on virtual keyboards.
39
+ * @see
40
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
41
+ */
42
+ enterKeyHint?: EnterKeyHint;
43
+ /**
44
+ * @description
45
+ * Provides hint for virtual keyboard shown
46
+ * @see
47
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
48
+ * @default "text"
39
49
  */
40
50
  inputMode?: InputMode;
41
51
  /**
42
52
  * @description
43
- * Determines whether field should be disabled
44
- * @default false
53
+ * Determines whether field should be disabled.
54
+ * @default
55
+ * false
45
56
  */
46
57
  isDisabled?: boolean;
47
58
  /**
48
59
  * @description
49
- * Determines whether field should be immutable
50
- * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly)
51
- * @default false
60
+ * Determines whether field should be immutable.
61
+ * @see
62
+ *[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly)
63
+ * @default
64
+ * false
52
65
  */
53
66
  isReadOnly?: boolean;
54
67
  /**
55
68
  * @description
56
- * Whether field should be marked required
69
+ * Whether field should be marked required.
57
70
  */
58
71
  isRequired?: boolean;
59
72
  /**
@@ -63,10 +76,7 @@ export interface InputProps extends ViewProps {
63
76
  name?: string;
64
77
  /**
65
78
  * @description
66
- * Placeholder text shown when field is empty
67
- * Accessibility tip: avoid putting important instructions for
68
- * filling out the TextField in the placeholder. Use descriptiveText
69
- * for important instructions
79
+ * Placeholder text shown when field is empty Accessibility tip: avoid putting important instructions for filling out the TextField in the placeholder. Use descriptiveText for important instructions.
70
80
  */
71
81
  placeholder?: string;
72
82
  /**
@@ -76,17 +86,17 @@ export interface InputProps extends ViewProps {
76
86
  size?: InputSizes;
77
87
  /**
78
88
  * @description
79
- * Input field type
89
+ * Input field type.
80
90
  */
81
91
  type?: React.HTMLInputTypeAttribute;
82
92
  /**
83
93
  * @description
84
- * If value is provided, this will be a controlled field
94
+ * If value is provided, this will be a controlled field.
85
95
  */
86
96
  value?: React.AllHTMLAttributes<'input'>['value'];
87
97
  /**
88
98
  * @description
89
- * Variants
99
+ * Variants.
90
100
  */
91
101
  variation?: FieldVariations;
92
102
  }
@@ -17,6 +17,13 @@ export interface LinkOptions {
17
17
  * A string representation of the URL path
18
18
  */
19
19
  to?: string;
20
+ /**
21
+ * @description
22
+ * a stringifier that returns a string containing the whole URL, and allows the href to be updated.
23
+ * @see
24
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/href)
25
+ */
26
+ href?: string;
20
27
  }
21
28
  export interface LinkProps extends ViewProps, LinkOptions {
22
29
  }
@@ -6,7 +6,8 @@ export interface MenuProps extends FlexProps {
6
6
  /**
7
7
  * @description
8
8
  * Alignment of menu against trigger
9
- * @default "start"
9
+ * @default
10
+ * "start"
10
11
  */
11
12
  menuAlign?: 'start' | 'center' | 'end';
12
13
  /**
@@ -27,8 +28,10 @@ export interface MenuProps extends FlexProps {
27
28
  /**
28
29
  * @description
29
30
  * Trigger node
30
- * @default MenuButton with IconMenu
31
- * @note Must forward refs to DOM element
31
+ * @default
32
+ * MenuButton with IconMenu
33
+ * @note
34
+ * Must forward refs to DOM element
32
35
  */
33
36
  trigger?: React.ReactNode;
34
37
  /**
@@ -23,32 +23,37 @@ interface BasePaginationProps {
23
23
  /**
24
24
  * @description
25
25
  * Optionally indicates whether there are more pages after `totalPages`. Can be combined with `totalPages` to enable the next button when reaching the last page.
26
- * @default false
26
+ * @default
27
+ * false
27
28
  */
28
29
  hasMorePages?: boolean;
29
30
  /**
30
31
  * @description
31
32
  * Set the invisible label for current page.
32
- * @default "Current Page:"
33
+ * @default
34
+ * "Current Page:"
33
35
  */
34
36
  currentPageLabel?: string;
35
37
  /**
36
38
  * @description
37
39
  * Set the label text for each page button other than the current page.
38
40
  * It will be used to construct the `aria-label` for each page button. e.g, "Go to page 1" for page 1 button
39
- * @default "Go to page"
41
+ * @default
42
+ * "Go to page"
40
43
  */
41
44
  pageLabel?: string;
42
45
  /**
43
46
  * @description
44
47
  * Set the `aria-label` for the left arrow button.
45
- * @default "Go to previous page"
48
+ * @default
49
+ * "Go to previous page"
46
50
  */
47
51
  previousLabel?: string;
48
52
  /**
49
53
  * @description
50
54
  * Set the `aria-label` for the right arrow button.
51
- * @default "Go to next page"
55
+ * @default
56
+ * "Go to next page"
52
57
  */
53
58
  nextLabel?: string;
54
59
  /**
@@ -87,6 +92,8 @@ export interface PaginationItemProps extends BaseComponentProps, BaseStyleProps,
87
92
  /**
88
93
  * @description
89
94
  * The index of current page.
95
+ * @default
96
+ * "Current Page:"
90
97
  */
91
98
  currentPage?: number;
92
99
  /**
@@ -97,7 +104,6 @@ export interface PaginationItemProps extends BaseComponentProps, BaseStyleProps,
97
104
  /**
98
105
  * @description
99
106
  * Set the invisible label for current page.
100
- * @default "Current Page:"
101
107
  */
102
108
  currentPageLabel?: string;
103
109
  /**
@@ -10,20 +10,23 @@ export interface PasswordFieldProps extends TextInputFieldProps {
10
10
  /**
11
11
  * @description
12
12
  * Set the `aria-label` for hide password button
13
- * @default "Hide password"
13
+ * @default
14
+ * "Hide password"
14
15
  */
15
16
  hidePasswordButtonLabel?: string;
16
17
  /**
17
18
  * @description
18
19
  * Set the `aria-label` for show password button
19
- * @default "Show password"
20
+ * @default
21
+ * "Show password"
20
22
  */
21
23
  showPasswordButtonLabel?: string;
22
24
  /**
23
25
  * @description
24
26
  * Password autocomplete type
25
27
  * @See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values)
26
- * @default "current-password"
28
+ * @default
29
+ * "current-password"
27
30
  */
28
31
  autoComplete?: 'new-password' | 'current-password' | string;
29
32
  /**
@@ -42,13 +45,15 @@ export interface ShowPasswordButtonProps extends ButtonProps {
42
45
  /**
43
46
  * @description
44
47
  * Set the `aria-label` for hide password button
45
- * @default "Hide password"
48
+ * @default
49
+ * "Hide password"
46
50
  */
47
51
  hidePasswordButtonLabel?: string;
48
52
  /**
49
53
  * @description
50
54
  * Set the `aria-label` for show password button
51
- * @default "Show password"
55
+ * @default
56
+ * "Show password"
52
57
  */
53
58
  showPasswordButtonLabel?: string;
54
59
  }
@@ -5,7 +5,8 @@ export interface PlaceholderProps extends ViewProps {
5
5
  /**
6
6
  * @description
7
7
  * If true, the placeholder won't show, if false the placeholder will show.
8
- * @default false
8
+ * @default
9
+ * false
9
10
  */
10
11
  isLoaded?: boolean;
11
12
  /**
@@ -15,13 +15,15 @@ export interface SearchFieldProps extends TextInputFieldProps {
15
15
  /**
16
16
  * @description
17
17
  * Visually hide label
18
- * @default true
18
+ * @default
19
+ * true
19
20
  */
20
21
  labelHidden?: boolean;
21
22
  /**
22
23
  * @description
23
24
  * Set the `aria-label` for clear button
24
- * @default "Clear search"
25
+ * @default
26
+ * "Clear search"
25
27
  */
26
28
  clearButtonLabel?: string;
27
29
  /**
@@ -3,6 +3,7 @@ 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 {
7
8
  /**
8
9
  * @description
@@ -64,5 +65,12 @@ export interface SliderFieldProps extends TextInputFieldProps, ViewProps {
64
65
  * Handles changes to the current value when using the SliderField as a controlled component
65
66
  */
66
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;
67
75
  }
68
76
  export {};
@@ -34,14 +34,16 @@ export interface StepperFieldProps extends TextInputFieldProps {
34
34
  * @description
35
35
  * Set the label text for increase button.
36
36
  * This will be used to construct its the `aria-label`. e.g., "Increase to 2" if the current step is 1.
37
- * @default "Increase to"
37
+ * @default
38
+ * "Increase to"
38
39
  */
39
40
  increaseButtonLabel?: string;
40
41
  /**
41
42
  * @description
42
43
  * Set the label text for decrease button.
43
44
  * This will be used to construct its the `aria-label`. e.g., "Decrease to 0" if the current step is 1.
44
- * @default "Decrease to"
45
+ * @default
46
+ * "Decrease to"
45
47
  */
46
48
  decreaseButtonLabel?: string;
47
49
  /**