@aws-amplify/ui-react 6.3.1 → 6.4.0

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.
@@ -658,6 +658,9 @@ const PrimitiveCatalog = {
658
658
  "size": {
659
659
  "type": "string"
660
660
  },
661
+ "isLoading": {
662
+ "type": "boolean"
663
+ },
661
664
  "isDisabled": {
662
665
  "type": "boolean"
663
666
  },
@@ -7,12 +7,15 @@ import '../Icon/context/IconsContext.mjs';
7
7
  import { useIcons } from '../Icon/context/useIcons.mjs';
8
8
  import { IconUser } from '../Icon/icons/IconUser.mjs';
9
9
  import { Image } from '../Image/Image.mjs';
10
+ import { Loader } from '../Loader/Loader.mjs';
10
11
 
11
- const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src, alt, ...rest }, ref) => {
12
+ const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src, alt, isLoading, ...rest }, ref) => {
12
13
  const icons = useIcons('avatar');
13
14
  const icon = icons?.user ?? React.createElement(IconUser, null);
14
15
  const componentClasses = classNames(ComponentClassName.Avatar, className, classNameModifier(ComponentClassName.Avatar, variation), classNameModifier(ComponentClassName.Avatar, size), classNameModifier(ComponentClassName.Avatar, colorTheme));
15
- return (React.createElement(View, { as: "span", className: componentClasses, ref: ref, ...rest }, src ? (React.createElement(Image, { className: ComponentClassName.AvatarImage, src: src, alt: alt })) : (children ?? (React.createElement(View, { as: "span", className: ComponentClassName.AvatarIcon, "aria-hidden": "true" }, icon)))));
16
+ return (React.createElement(View, { as: "span", className: componentClasses, ref: ref, ...rest },
17
+ src ? (React.createElement(Image, { className: ComponentClassName.AvatarImage, src: src, alt: alt })) : (children ?? (React.createElement(View, { as: "span", className: ComponentClassName.AvatarIcon, "aria-hidden": "true" }, icon))),
18
+ isLoading ? (React.createElement(Loader, { className: ComponentClassName.AvatarLoader })) : null));
16
19
  };
17
20
  /**
18
21
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/avatar)
@@ -1,3 +1,3 @@
1
- const VERSION = '6.3.1';
1
+ const VERSION = '6.4.0';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -669,11 +669,13 @@ const ImagePrimitive = ({ className, ...rest }, ref) => (React__namespace.create
669
669
  const Image = primitiveWithForwardRef.primitiveWithForwardRef(ImagePrimitive);
670
670
  Image.displayName = 'Image';
671
671
 
672
- const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src, alt, ...rest }, ref) => {
672
+ const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src, alt, isLoading, ...rest }, ref) => {
673
673
  const icons = Field.useIcons('avatar');
674
674
  const icon = icons?.user ?? React__namespace.createElement(Field.IconUser, null);
675
675
  const componentClasses = ui.classNames(ui.ComponentClassName.Avatar, className, ui.classNameModifier(ui.ComponentClassName.Avatar, variation), ui.classNameModifier(ui.ComponentClassName.Avatar, size), ui.classNameModifier(ui.ComponentClassName.Avatar, colorTheme));
676
- return (React__namespace.createElement(Field.View, { as: "span", className: componentClasses, ref: ref, ...rest }, src ? (React__namespace.createElement(Image, { className: ui.ComponentClassName.AvatarImage, src: src, alt: alt })) : (children ?? (React__namespace.createElement(Field.View, { as: "span", className: ui.ComponentClassName.AvatarIcon, "aria-hidden": "true" }, icon)))));
676
+ return (React__namespace.createElement(Field.View, { as: "span", className: componentClasses, ref: ref, ...rest },
677
+ src ? (React__namespace.createElement(Image, { className: ui.ComponentClassName.AvatarImage, src: src, alt: alt })) : (children ?? (React__namespace.createElement(Field.View, { as: "span", className: ui.ComponentClassName.AvatarIcon, "aria-hidden": "true" }, icon))),
678
+ isLoading ? (React__namespace.createElement(Field.Loader, { className: ui.ComponentClassName.AvatarLoader })) : null));
677
679
  };
678
680
  /**
679
681
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/avatar)
@@ -2521,7 +2523,7 @@ const defaultDeleteUserDisplayText = {
2521
2523
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2522
2524
  };
2523
2525
 
2524
- const VERSION = '6.3.1';
2526
+ const VERSION = '6.4.0';
2525
2527
 
2526
2528
  const logger$2 = ui.getLogger('AccountSettings');
2527
2529
  const getIsDisabled = (formValues, validationError) => {
package/dist/internal.js CHANGED
@@ -818,6 +818,9 @@ const PrimitiveCatalog = {
818
818
  "size": {
819
819
  "type": "string"
820
820
  },
821
+ "isLoading": {
822
+ "type": "boolean"
823
+ },
821
824
  "isDisabled": {
822
825
  "type": "boolean"
823
826
  },
@@ -6,6 +6,7 @@
6
6
  --avatar-border-color: var(--amplify-components-avatar-border-color);
7
7
  --avatar-size: var(--amplify-components-avatar-width);
8
8
  --amplify-components-icon-height: 100%;
9
+ position: relative;
9
10
  display: inline-flex;
10
11
  align-items: center;
11
12
  justify-content: center;
@@ -56,6 +57,9 @@
56
57
  --avatar-filled-color: var(
57
58
  --amplify-components-avatar-warning-background-color
58
59
  );
60
+ --amplify-components-loader-stroke-filled: var(
61
+ --amplify-components-avatar-warning-color
62
+ );
59
63
  }
60
64
  .amplify-avatar--error {
61
65
  --avatar-border-color: var(--amplify-components-avatar-error-border-color);
@@ -69,6 +73,9 @@
69
73
  --avatar-filled-color: var(
70
74
  --amplify-components-avatar-error-background-color
71
75
  );
76
+ --amplify-components-loader-stroke-filled: var(
77
+ --amplify-components-avatar-error-color
78
+ );
72
79
  }
73
80
  .amplify-avatar--info {
74
81
  --avatar-border-color: var(--amplify-components-avatar-info-border-color);
@@ -82,6 +89,9 @@
82
89
  --avatar-filled-color: var(
83
90
  --amplify-components-avatar-info-background-color
84
91
  );
92
+ --amplify-components-loader-stroke-filled: var(
93
+ --amplify-components-avatar-info-color
94
+ );
85
95
  }
86
96
  .amplify-avatar--success {
87
97
  --avatar-border-color: var(
@@ -97,6 +107,9 @@
97
107
  --avatar-filled-color: var(
98
108
  --amplify-components-avatar-success-background-color
99
109
  );
110
+ --amplify-components-loader-stroke-filled: var(
111
+ --amplify-components-avatar-success-color
112
+ );
100
113
  }
101
114
  .amplify-avatar__icon {
102
115
  display: flex;
@@ -108,4 +121,11 @@
108
121
  -o-object-fit: cover;
109
122
  object-fit: cover;
110
123
  display: block;
124
+ }
125
+ .amplify-avatar__loader {
126
+ position: absolute;
127
+ inset: 0;
128
+ width: 100%;
129
+ height: 100%;
130
+ stroke: transparent;
111
131
  }
@@ -7,6 +7,7 @@
7
7
  --avatar-border-color: var(--amplify-components-avatar-border-color);
8
8
  --avatar-size: var(--amplify-components-avatar-width);
9
9
  --amplify-components-icon-height: 100%;
10
+ position: relative;
10
11
  display: inline-flex;
11
12
  align-items: center;
12
13
  justify-content: center;
@@ -57,6 +58,9 @@
57
58
  --avatar-filled-color: var(
58
59
  --amplify-components-avatar-warning-background-color
59
60
  );
61
+ --amplify-components-loader-stroke-filled: var(
62
+ --amplify-components-avatar-warning-color
63
+ );
60
64
  }
61
65
  .amplify-avatar--error {
62
66
  --avatar-border-color: var(--amplify-components-avatar-error-border-color);
@@ -70,6 +74,9 @@
70
74
  --avatar-filled-color: var(
71
75
  --amplify-components-avatar-error-background-color
72
76
  );
77
+ --amplify-components-loader-stroke-filled: var(
78
+ --amplify-components-avatar-error-color
79
+ );
73
80
  }
74
81
  .amplify-avatar--info {
75
82
  --avatar-border-color: var(--amplify-components-avatar-info-border-color);
@@ -83,6 +90,9 @@
83
90
  --avatar-filled-color: var(
84
91
  --amplify-components-avatar-info-background-color
85
92
  );
93
+ --amplify-components-loader-stroke-filled: var(
94
+ --amplify-components-avatar-info-color
95
+ );
86
96
  }
87
97
  .amplify-avatar--success {
88
98
  --avatar-border-color: var(
@@ -98,6 +108,9 @@
98
108
  --avatar-filled-color: var(
99
109
  --amplify-components-avatar-success-background-color
100
110
  );
111
+ --amplify-components-loader-stroke-filled: var(
112
+ --amplify-components-avatar-success-color
113
+ );
101
114
  }
102
115
  .amplify-avatar__icon {
103
116
  display: flex;
@@ -110,4 +123,11 @@
110
123
  object-fit: cover;
111
124
  display: block;
112
125
  }
126
+ .amplify-avatar__loader {
127
+ position: absolute;
128
+ inset: 0;
129
+ width: 100%;
130
+ height: 100%;
131
+ stroke: transparent;
132
+ }
113
133
  }
package/dist/styles.css CHANGED
@@ -3519,6 +3519,7 @@ strong.amplify-text {
3519
3519
  --avatar-border-color: var(--amplify-components-avatar-border-color);
3520
3520
  --avatar-size: var(--amplify-components-avatar-width);
3521
3521
  --amplify-components-icon-height: 100%;
3522
+ position: relative;
3522
3523
  display: inline-flex;
3523
3524
  align-items: center;
3524
3525
  justify-content: center;
@@ -3569,6 +3570,9 @@ strong.amplify-text {
3569
3570
  --avatar-filled-color: var(
3570
3571
  --amplify-components-avatar-warning-background-color
3571
3572
  );
3573
+ --amplify-components-loader-stroke-filled: var(
3574
+ --amplify-components-avatar-warning-color
3575
+ );
3572
3576
  }
3573
3577
  .amplify-avatar--error {
3574
3578
  --avatar-border-color: var(--amplify-components-avatar-error-border-color);
@@ -3582,6 +3586,9 @@ strong.amplify-text {
3582
3586
  --avatar-filled-color: var(
3583
3587
  --amplify-components-avatar-error-background-color
3584
3588
  );
3589
+ --amplify-components-loader-stroke-filled: var(
3590
+ --amplify-components-avatar-error-color
3591
+ );
3585
3592
  }
3586
3593
  .amplify-avatar--info {
3587
3594
  --avatar-border-color: var(--amplify-components-avatar-info-border-color);
@@ -3595,6 +3602,9 @@ strong.amplify-text {
3595
3602
  --avatar-filled-color: var(
3596
3603
  --amplify-components-avatar-info-background-color
3597
3604
  );
3605
+ --amplify-components-loader-stroke-filled: var(
3606
+ --amplify-components-avatar-info-color
3607
+ );
3598
3608
  }
3599
3609
  .amplify-avatar--success {
3600
3610
  --avatar-border-color: var(
@@ -3610,6 +3620,9 @@ strong.amplify-text {
3610
3620
  --avatar-filled-color: var(
3611
3621
  --amplify-components-avatar-success-background-color
3612
3622
  );
3623
+ --amplify-components-loader-stroke-filled: var(
3624
+ --amplify-components-avatar-success-color
3625
+ );
3613
3626
  }
3614
3627
  .amplify-avatar__icon {
3615
3628
  display: flex;
@@ -3622,6 +3635,13 @@ strong.amplify-text {
3622
3635
  object-fit: cover;
3623
3636
  display: block;
3624
3637
  }
3638
+ .amplify-avatar__loader {
3639
+ position: absolute;
3640
+ inset: 0;
3641
+ width: 100%;
3642
+ height: 100%;
3643
+ stroke: transparent;
3644
+ }
3625
3645
 
3626
3646
  .amplify-breadcrumbs__list {
3627
3647
  display: flex;
@@ -3520,6 +3520,7 @@ strong.amplify-text {
3520
3520
  --avatar-border-color: var(--amplify-components-avatar-border-color);
3521
3521
  --avatar-size: var(--amplify-components-avatar-width);
3522
3522
  --amplify-components-icon-height: 100%;
3523
+ position: relative;
3523
3524
  display: inline-flex;
3524
3525
  align-items: center;
3525
3526
  justify-content: center;
@@ -3570,6 +3571,9 @@ strong.amplify-text {
3570
3571
  --avatar-filled-color: var(
3571
3572
  --amplify-components-avatar-warning-background-color
3572
3573
  );
3574
+ --amplify-components-loader-stroke-filled: var(
3575
+ --amplify-components-avatar-warning-color
3576
+ );
3573
3577
  }
3574
3578
  .amplify-avatar--error {
3575
3579
  --avatar-border-color: var(--amplify-components-avatar-error-border-color);
@@ -3583,6 +3587,9 @@ strong.amplify-text {
3583
3587
  --avatar-filled-color: var(
3584
3588
  --amplify-components-avatar-error-background-color
3585
3589
  );
3590
+ --amplify-components-loader-stroke-filled: var(
3591
+ --amplify-components-avatar-error-color
3592
+ );
3586
3593
  }
3587
3594
  .amplify-avatar--info {
3588
3595
  --avatar-border-color: var(--amplify-components-avatar-info-border-color);
@@ -3596,6 +3603,9 @@ strong.amplify-text {
3596
3603
  --avatar-filled-color: var(
3597
3604
  --amplify-components-avatar-info-background-color
3598
3605
  );
3606
+ --amplify-components-loader-stroke-filled: var(
3607
+ --amplify-components-avatar-info-color
3608
+ );
3599
3609
  }
3600
3610
  .amplify-avatar--success {
3601
3611
  --avatar-border-color: var(
@@ -3611,6 +3621,9 @@ strong.amplify-text {
3611
3621
  --avatar-filled-color: var(
3612
3622
  --amplify-components-avatar-success-background-color
3613
3623
  );
3624
+ --amplify-components-loader-stroke-filled: var(
3625
+ --amplify-components-avatar-success-color
3626
+ );
3614
3627
  }
3615
3628
  .amplify-avatar__icon {
3616
3629
  display: flex;
@@ -3623,6 +3636,13 @@ strong.amplify-text {
3623
3636
  object-fit: cover;
3624
3637
  display: block;
3625
3638
  }
3639
+ .amplify-avatar__loader {
3640
+ position: absolute;
3641
+ inset: 0;
3642
+ width: 100%;
3643
+ height: 100%;
3644
+ stroke: transparent;
3645
+ }
3626
3646
 
3627
3647
  .amplify-breadcrumbs__list {
3628
3648
  display: flex;
@@ -31,6 +31,11 @@ export interface BaseAvatarProps extends BaseViewProps {
31
31
  * The size property will affect the size of the avatar.
32
32
  */
33
33
  size?: AvatarSizes;
34
+ /**
35
+ * @description
36
+ * The isLoading property will display a loader around the avatar
37
+ */
38
+ isLoading?: boolean;
34
39
  }
35
40
  export type AvatarProps<Element extends ElementType = 'span'> = PrimitiveProps<BaseAvatarProps, Element>;
36
41
  export {};
@@ -1 +1 @@
1
- export declare const VERSION = "6.3.1";
1
+ export declare const VERSION = "6.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "6.3.1",
3
+ "version": "6.4.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -55,8 +55,8 @@
55
55
  "typecheck": "tsc --noEmit"
56
56
  },
57
57
  "dependencies": {
58
- "@aws-amplify/ui": "6.4.1",
59
- "@aws-amplify/ui-react-core": "3.0.22",
58
+ "@aws-amplify/ui": "6.5.0",
59
+ "@aws-amplify/ui-react-core": "3.0.23",
60
60
  "@radix-ui/react-direction": "1.0.0",
61
61
  "@radix-ui/react-dropdown-menu": "1.0.0",
62
62
  "@radix-ui/react-slider": "1.0.0",