@aws-amplify/ui-react 3.0.0 → 3.0.1

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 (45) hide show
  1. package/README.md +1 -1
  2. package/dist/styles.css +1 -1
  3. package/dist/types/primitives/types/alert.d.ts +6 -0
  4. package/dist/types/primitives/types/badge.d.ts +2 -0
  5. package/dist/types/primitives/types/base.d.ts +15 -0
  6. package/dist/types/primitives/types/button.d.ts +8 -0
  7. package/dist/types/primitives/types/card.d.ts +4 -0
  8. package/dist/types/primitives/types/checkbox.d.ts +5 -3
  9. package/dist/types/primitives/types/collection.d.ts +11 -0
  10. package/dist/types/primitives/types/divider.d.ts +3 -0
  11. package/dist/types/primitives/types/expander.d.ts +7 -0
  12. package/dist/types/primitives/types/field.d.ts +4 -0
  13. package/dist/types/primitives/types/fieldGroupIcon.d.ts +2 -0
  14. package/dist/types/primitives/types/flex.d.ts +7 -0
  15. package/dist/types/primitives/types/heading.d.ts +4 -0
  16. package/dist/types/primitives/types/icon.d.ts +9 -4
  17. package/dist/types/primitives/types/image.d.ts +17 -3
  18. package/dist/types/primitives/types/input.d.ts +18 -3
  19. package/dist/types/primitives/types/label.d.ts +2 -0
  20. package/dist/types/primitives/types/link.d.ts +3 -0
  21. package/dist/types/primitives/types/loader.d.ts +7 -0
  22. package/dist/types/primitives/types/menu.d.ts +10 -0
  23. package/dist/types/primitives/types/pagination.d.ts +17 -0
  24. package/dist/types/primitives/types/passwordField.d.ts +12 -1
  25. package/dist/types/primitives/types/phoneNumberField.d.ts +25 -0
  26. package/dist/types/primitives/types/placeholder.d.ts +2 -0
  27. package/dist/types/primitives/types/radio.d.ts +1 -0
  28. package/dist/types/primitives/types/radioGroupField.d.ts +2 -0
  29. package/dist/types/primitives/types/rating.d.ts +7 -0
  30. package/dist/types/primitives/types/searchField.d.ts +5 -0
  31. package/dist/types/primitives/types/select.d.ts +52 -0
  32. package/dist/types/primitives/types/selectField.d.ts +1 -0
  33. package/dist/types/primitives/types/sliderField.d.ts +48 -0
  34. package/dist/types/primitives/types/stepperField.d.ts +35 -0
  35. package/dist/types/primitives/types/style.d.ts +331 -6
  36. package/dist/types/primitives/types/switchField.d.ts +13 -0
  37. package/dist/types/primitives/types/table.d.ts +12 -0
  38. package/dist/types/primitives/types/tabs.d.ts +8 -0
  39. package/dist/types/primitives/types/text.d.ts +3 -0
  40. package/dist/types/primitives/types/textArea.d.ts +19 -3
  41. package/dist/types/primitives/types/textField.d.ts +5 -0
  42. package/dist/types/primitives/types/toggleButton.d.ts +16 -0
  43. package/dist/types/primitives/types/toggleButtonGroup.d.ts +20 -0
  44. package/dist/types/primitives/types/view.d.ts +24 -0
  45. package/package.json +2 -2
@@ -4,46 +4,58 @@ import { Sizes } from './base';
4
4
  import { FieldVariations } from './field';
5
5
  import { ViewProps } from './view';
6
6
  export interface TextAreaStyleProps {
7
+ /**
8
+ * @description
9
+ * Defines if (and how) an element is resizable by the user
10
+ */
7
11
  resize?: Property.Resize;
8
12
  }
9
13
  export interface TextAreaProps extends TextAreaStyleProps, ViewProps {
10
14
  /**
15
+ * @description
11
16
  * Specifies permissions for browser UA to autocomplete field
12
- * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
17
+ * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
13
18
  */
14
19
  autoComplete?: string;
15
20
  /**
21
+ * @description
16
22
  * Use this to provide a default value for an uncontrolled field
17
23
  */
18
24
  defaultValue?: React.AllHTMLAttributes<'textarea'>['defaultValue'];
19
25
  /**
26
+ * @description
20
27
  * Indicates that Field is in error state
21
28
  */
22
29
  hasError?: boolean;
23
30
  /**
31
+ * @description
24
32
  * Determines whether field should be disabled
25
33
  * @default false
26
34
  */
27
35
  isDisabled?: boolean;
28
36
  /**
29
- * Determines whether field should be immutable
30
- * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly
37
+ * @description
38
+ * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly)
31
39
  * @default false
32
40
  */
33
41
  isReadOnly?: boolean;
34
42
  /**
43
+ * @description
35
44
  * Whether field should be marked required
36
45
  */
37
46
  isRequired?: boolean;
38
47
  /**
48
+ * @description
39
49
  * Text contents maximum length
40
50
  */
41
51
  maxLength?: number;
42
52
  /**
53
+ * @description
43
54
  * Name of the field. Submitted with the form as part of a name/value pair.
44
55
  */
45
56
  name?: string;
46
57
  /**
58
+ * @description
47
59
  * Placeholder text shown when field is empty
48
60
  * Accessibility tip: avoid putting important instructions for
49
61
  * filling out the TextField in the placeholder. Use descriptiveText
@@ -51,18 +63,22 @@ export interface TextAreaProps extends TextAreaStyleProps, ViewProps {
51
63
  */
52
64
  placeholder?: string;
53
65
  /**
66
+ * @description
54
67
  * Controls height based on number of rows of text to display
55
68
  */
56
69
  rows?: number;
57
70
  /**
71
+ * @description
58
72
  * Changes the font-size, padding, and height of the field.
59
73
  */
60
74
  size?: Sizes;
61
75
  /**
76
+ * @description
62
77
  * If value is provided, this will be a controlled field
63
78
  */
64
79
  value?: React.AllHTMLAttributes<'textarea'>['value'];
65
80
  /**
81
+ * @description
66
82
  * Variants
67
83
  */
68
84
  variation?: FieldVariations;
@@ -5,22 +5,27 @@ import { FieldProps } from './field';
5
5
  import { TextAreaProps } from './textArea';
6
6
  export interface TextFieldOptions extends FieldProps, FlexContainerStyleProps {
7
7
  /**
8
+ * @description
8
9
  * Component(s) to show after input
9
10
  */
10
11
  outerEndComponent?: React.ReactNode;
11
12
  /**
13
+ * @description
12
14
  * Component(s) to show before input
13
15
  */
14
16
  outerStartComponent?: React.ReactNode;
15
17
  /**
18
+ * @description
16
19
  * FieldGroupIconButton component to show inside of input at start
17
20
  */
18
21
  innerStartComponent?: React.ReactNode;
19
22
  /**
23
+ * @description
20
24
  * FieldGroupIconButton component to show inside of input at end
21
25
  */
22
26
  innerEndComponent?: React.ReactNode;
23
27
  /**
28
+ * @description
24
29
  * Input field type (only applies when isMultiline = false)
25
30
  */
26
31
  type?: InputProps['type'];
@@ -1,7 +1,23 @@
1
1
  import { ButtonProps } from './button';
2
2
  export interface ToggleButtonProps extends ButtonProps {
3
+ /**
4
+ * @description
5
+ * Controls the selected state of the ToggleButton
6
+ */
3
7
  value?: string;
8
+ /**
9
+ * @description
10
+ * Controls the `isPressed` state of the ToggleButton when using it as a controlled component
11
+ */
4
12
  isPressed?: boolean;
13
+ /**
14
+ * @description
15
+ * When `true`, sets the `isPressed` state of the ToggleButton to `true` on initial render
16
+ */
5
17
  defaultPressed?: boolean;
18
+ /**
19
+ * @description
20
+ * Handles changes to the current value when using the ToggleButton as a controlled component
21
+ */
6
22
  onChange?: (value: string) => void;
7
23
  }
@@ -2,9 +2,29 @@ import * as React from 'react';
2
2
  import { FlexProps } from './flex';
3
3
  import { ToggleButtonProps } from './toggleButton';
4
4
  export interface ToggleButtonGroupProps extends FlexProps, Pick<ToggleButtonProps, 'size' | 'variation'> {
5
+ /**
6
+ * @description
7
+ * Accepts any number of ToggleButton components
8
+ */
5
9
  children: React.ReactNode;
10
+ /**
11
+ * @description
12
+ * When `true`, only allows one ToggleButton to be pressed at a time within a ToggleButtonGroup
13
+ */
6
14
  isExclusive?: boolean;
15
+ /**
16
+ * @description
17
+ * Used when at least one ToggleButton needs to be currently pressed
18
+ */
7
19
  isSelectionRequired?: boolean;
20
+ /**
21
+ * @description
22
+ * Controls which of its ToggleButton children are currently selected
23
+ */
8
24
  value: string | string[];
25
+ /**
26
+ * @description
27
+ * Handles changes to the current value when using the ToggleButtonGroup as a controlled component
28
+ */
9
29
  onChange: (value: string | string[]) => void;
10
30
  }
@@ -4,26 +4,50 @@ import { BaseStyleProps } from './style';
4
4
  declare type MergeProps<A, B> = A & Omit<B, keyof A>;
5
5
  export declare type ElementType = React.FC<any> | keyof JSX.IntrinsicElements;
6
6
  /**
7
+ * @description
7
8
  * Convert string element type to DOMElement Type
8
9
  * e.g. 'button' => HTMLButtonElement
9
10
  */
10
11
  export declare type HTMLElementType<Element extends ElementType> = Element extends keyof JSX.IntrinsicElements ? React.ElementRef<Element> : HTMLElementTypeFromExoticComponentRef<Element>;
11
12
  /**
13
+ * @description
12
14
  * Allows us to extract ElementType from `typeof Root` used in SliderField
13
15
  * e.g. React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLSpanElement>> => HTMLSpanElement
14
16
  */
15
17
  declare type HTMLElementTypeFromExoticComponentRef<Element extends ElementType> = Element extends React.ForwardRefExoticComponent<React.RefAttributes<infer DOMHTMLElement>> ? DOMHTMLElement : HTMLElement;
16
18
  export declare type ElementProps<Element extends ElementType> = Element extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[Element] : Element extends React.FC<infer ComponentProps> ? ComponentProps : never;
17
19
  export declare type PrimitiveProps<Props extends ViewProps, Element extends ElementType> = MergeProps<Omit<Props, 'as'> & {
20
+ /**
21
+ * @description
22
+ * Changes the type of HTML element rendered
23
+ */
18
24
  as?: Element | Props['as'];
19
25
  }, Omit<ElementProps<Element>, 'ref'>>;
20
26
  export declare type PrimitivePropsWithRef<Props extends ViewProps, Element extends ElementType> = PrimitiveProps<Props, Element> & {
27
+ /**
28
+ * @description
29
+ * References a DOM element from within a parent component
30
+ */
21
31
  ref?: React.Ref<HTMLElementType<Element>>;
22
32
  };
23
33
  export declare type Primitive<Props extends ViewProps, Element extends ElementType> = React.ForwardRefRenderFunction<HTMLElementType<Element>, PrimitivePropsWithRef<Props, Element>>;
24
34
  export interface ViewProps extends BaseComponentProps, BaseStyleProps, AriaProps {
35
+ /**
36
+ * @description
37
+ * Changes the type of HTML element rendered
38
+ */
25
39
  as?: ElementType;
40
+ /**
41
+ * @description
42
+ * Sets the Boolean `disabled` HTML attribute, which, when present, makes the element not mutable, focusable, or even submitted with the form
43
+ */
26
44
  isDisabled?: boolean;
45
+ /**
46
+ * @description
47
+ * Accepts a JavaScript object with camelCased properties rather than a CSS string.
48
+ * This is consistent with the DOM style JavaScript property, is more efficient, and prevents XSS security holes.
49
+ * [React docs]{@link https://reactjs.org/docs/dom-elements.html#style}
50
+ */
27
51
  style?: React.CSSProperties;
28
52
  }
29
53
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "exports": {
@@ -59,7 +59,7 @@
59
59
  "size": "yarn run size-limit"
60
60
  },
61
61
  "dependencies": {
62
- "@aws-amplify/ui": "3.11.0",
62
+ "@aws-amplify/ui": "3.11.1",
63
63
  "@aws-amplify/ui-react-v1": "npm:@aws-amplify/ui-react@1.2.9",
64
64
  "@radix-ui/react-accordion": "0.1.6",
65
65
  "@radix-ui/react-dropdown-menu": "0.1.6",