@aws-amplify/ui-react 6.4.0 → 6.5.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 (37) hide show
  1. package/dist/{Field-4b189104.js → Field-3db91851.js} +23 -12
  2. package/dist/{ThemeStyle-b2dce96a.js → ThemeStyle-7d5abbc4.js} +18 -12
  3. package/dist/esm/components/ThemeProvider/ComponentStyle.mjs +21 -0
  4. package/dist/esm/components/ThemeProvider/GlobalStyle.mjs +18 -0
  5. package/dist/esm/components/ThemeProvider/Style.mjs +62 -0
  6. package/dist/esm/components/ThemeProvider/ThemeStyle.mjs +7 -60
  7. package/dist/esm/server.mjs +2 -0
  8. package/dist/esm/version.mjs +1 -1
  9. package/dist/index.js +79 -80
  10. package/dist/internal.js +1 -2
  11. package/dist/server.js +61 -13
  12. package/dist/styles/breadcrumbs.css +4 -2
  13. package/dist/styles/breadcrumbs.layer.css +4 -2
  14. package/dist/styles/button.css +19 -10
  15. package/dist/styles/button.layer.css +19 -10
  16. package/dist/styles/input.css +3 -2
  17. package/dist/styles/input.layer.css +3 -2
  18. package/dist/styles/link.css +10 -5
  19. package/dist/styles/link.layer.css +10 -5
  20. package/dist/styles/reset.css +4 -1
  21. package/dist/styles/reset.layer.css +4 -1
  22. package/dist/styles/sliderField.css +3 -2
  23. package/dist/styles/sliderField.layer.css +3 -2
  24. package/dist/styles/textArea.css +3 -2
  25. package/dist/styles/textArea.layer.css +3 -2
  26. package/dist/styles.css +42 -23
  27. package/dist/styles.layer.css +42 -23
  28. package/dist/types/components/ThemeProvider/ComponentStyle.d.ts +22 -0
  29. package/dist/types/components/ThemeProvider/GlobalStyle.d.ts +20 -0
  30. package/dist/types/components/ThemeProvider/Style.d.ts +13 -0
  31. package/dist/types/components/ThemeProvider/ThemeStyle.d.ts +6 -4
  32. package/dist/types/primitives/shared/responsive/utils.d.ts +1 -1
  33. package/dist/types/server.d.ts +2 -0
  34. package/dist/types/version.d.ts +1 -1
  35. package/package.json +5 -4
  36. package/dist/primitiveWithForwardRef-7e929242.js +0 -36
  37. package/dist/types/primitives/Card/__test__/Card.test.d.ts +0 -1
@@ -1731,8 +1731,9 @@ strong.amplify-text {
1731
1731
  padding-inline-start: var(--amplify-components-button-padding-inline-start);
1732
1732
  padding-inline-end: var(--amplify-components-button-padding-inline-end);
1733
1733
  transition: all var(--amplify-components-button-transition-duration);
1734
- -moz-user-select: none;
1735
- user-select: none;
1734
+ -webkit-user-select: none;
1735
+ -moz-user-select: none;
1736
+ user-select: none;
1736
1737
  --amplify-internal-button-disabled-color: var(
1737
1738
  --amplify-components-button-disabled-color
1738
1739
  );
@@ -2753,50 +2754,58 @@ strong.amplify-text {
2753
2754
  background-color: var(--amplify-internal-button-disabled-background-color);
2754
2755
  border-color: var(--amplify-internal-button-disabled-border-color);
2755
2756
  color: var(--amplify-internal-button-disabled-color);
2756
- text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2757
+ -webkit-text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2758
+ text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2757
2759
  cursor: not-allowed;
2758
2760
  }
2759
2761
  .amplify-button--disabled:hover {
2760
2762
  background-color: var(--amplify-internal-button-disabled-background-color);
2761
2763
  border-color: var(--amplify-internal-button-disabled-border-color);
2762
2764
  color: var(--amplify-internal-button-disabled-color);
2763
- text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2765
+ -webkit-text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2766
+ text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2764
2767
  }
2765
2768
  .amplify-button--disabled :focus {
2766
2769
  background-color: var(--amplify-internal-button-disabled-background-color);
2767
2770
  border-color: var(--amplify-internal-button-disabled-border-color);
2768
2771
  color: var(--amplify-internal-button-disabled-color);
2769
- text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2772
+ -webkit-text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2773
+ text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2770
2774
  }
2771
2775
  .amplify-button--disabled:active {
2772
2776
  background-color: var(--amplify-internal-button-disabled-background-color);
2773
2777
  border-color: var(--amplify-internal-button-disabled-border-color);
2774
2778
  color: var(--amplify-internal-button-disabled-color);
2775
- text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2779
+ -webkit-text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2780
+ text-decoration: var(--amplify-internal-button-disabled-text-decoration);
2776
2781
  }
2777
2782
  .amplify-button--loading {
2778
2783
  background-color: var(--amplify-internal-button-loading-background-color);
2779
2784
  border-color: var(--amplify-internal-button-loading-border-color);
2780
2785
  color: var(--amplify-components-button-loading-color);
2781
- text-decoration: var(--amplify-internal-button-loading-text-decoration);
2786
+ -webkit-text-decoration: var(--amplify-internal-button-loading-text-decoration);
2787
+ text-decoration: var(--amplify-internal-button-loading-text-decoration);
2782
2788
  }
2783
2789
  .amplify-button--loading:hover {
2784
2790
  background-color: var(--amplify-internal-button-loading-background-color);
2785
2791
  border-color: var(--amplify-internal-button-loading-border-color);
2786
2792
  color: var(--amplify-components-button-loading-color);
2787
- text-decoration: var(--amplify-internal-button-loading-text-decoration);
2793
+ -webkit-text-decoration: var(--amplify-internal-button-loading-text-decoration);
2794
+ text-decoration: var(--amplify-internal-button-loading-text-decoration);
2788
2795
  }
2789
2796
  .amplify-button--loading:focus {
2790
2797
  background-color: var(--amplify-internal-button-loading-background-color);
2791
2798
  border-color: var(--amplify-internal-button-loading-border-color);
2792
2799
  color: var(--amplify-components-button-loading-color);
2793
- text-decoration: var(--amplify-internal-button-loading-text-decoration);
2800
+ -webkit-text-decoration: var(--amplify-internal-button-loading-text-decoration);
2801
+ text-decoration: var(--amplify-internal-button-loading-text-decoration);
2794
2802
  }
2795
2803
  .amplify-button--loading:active {
2796
2804
  background-color: var(--amplify-internal-button-loading-background-color);
2797
2805
  border-color: var(--amplify-internal-button-loading-border-color);
2798
2806
  color: var(--amplify-components-button-loading-color);
2799
- text-decoration: var(--amplify-internal-button-loading-text-decoration);
2807
+ -webkit-text-decoration: var(--amplify-internal-button-loading-text-decoration);
2808
+ text-decoration: var(--amplify-internal-button-loading-text-decoration);
2800
2809
  }
2801
2810
  .amplify-button__loader-wrapper {
2802
2811
  align-items: var(--amplify-components-button-loader-wrapper-align-items);
@@ -2944,8 +2953,9 @@ strong.amplify-text {
2944
2953
  outline-style: var(--amplify-components-fieldcontrol-outline-style);
2945
2954
  outline-width: var(--amplify-components-fieldcontrol-outline-width);
2946
2955
  outline-offset: var(--amplify-components-fieldcontrol-outline-offset);
2947
- -moz-user-select: text;
2948
- user-select: text;
2956
+ -webkit-user-select: text;
2957
+ -moz-user-select: text;
2958
+ user-select: text;
2949
2959
  display: inline-block;
2950
2960
  --amplify-components-fieldcontrol-color: var(
2951
2961
  --amplify-components-input-color
@@ -3028,8 +3038,9 @@ strong.amplify-text {
3028
3038
  outline-style: var(--amplify-components-fieldcontrol-outline-style);
3029
3039
  outline-width: var(--amplify-components-fieldcontrol-outline-width);
3030
3040
  outline-offset: var(--amplify-components-fieldcontrol-outline-offset);
3031
- -moz-user-select: text;
3032
- user-select: text;
3041
+ -webkit-user-select: text;
3042
+ -moz-user-select: text;
3043
+ user-select: text;
3033
3044
  white-space: pre-wrap;
3034
3045
  }
3035
3046
  .amplify-textarea:focus {
@@ -3093,24 +3104,29 @@ strong.amplify-text {
3093
3104
 
3094
3105
  .amplify-link {
3095
3106
  color: var(--amplify-components-link-color);
3096
- text-decoration: var(--amplify-components-link-text-decoration);
3107
+ -webkit-text-decoration: var(--amplify-components-link-text-decoration);
3108
+ text-decoration: var(--amplify-components-link-text-decoration);
3097
3109
  cursor: pointer;
3098
3110
  }
3099
3111
  .amplify-link:visited {
3100
3112
  color: var(--amplify-components-link-visited-color);
3101
- text-decoration: var(--amplify-components-link-visited-text-decoration);
3113
+ -webkit-text-decoration: var(--amplify-components-link-visited-text-decoration);
3114
+ text-decoration: var(--amplify-components-link-visited-text-decoration);
3102
3115
  }
3103
3116
  .amplify-link:active {
3104
3117
  color: var(--amplify-components-link-active-color);
3105
- text-decoration: var(--amplify-components-link-active-text-decoration);
3118
+ -webkit-text-decoration: var(--amplify-components-link-active-text-decoration);
3119
+ text-decoration: var(--amplify-components-link-active-text-decoration);
3106
3120
  }
3107
3121
  .amplify-link:focus {
3108
3122
  color: var(--amplify-components-link-focus-color);
3109
- text-decoration: var(--amplify-components-link-focus-text-decoration);
3123
+ -webkit-text-decoration: var(--amplify-components-link-focus-text-decoration);
3124
+ text-decoration: var(--amplify-components-link-focus-text-decoration);
3110
3125
  }
3111
3126
  .amplify-link:hover {
3112
3127
  color: var(--amplify-components-link-hover-color);
3113
- text-decoration: var(--amplify-components-link-hover-text-decoration);
3128
+ -webkit-text-decoration: var(--amplify-components-link-hover-text-decoration);
3129
+ text-decoration: var(--amplify-components-link-hover-text-decoration);
3114
3130
  }
3115
3131
 
3116
3132
  .amplify-loader {
@@ -3673,14 +3689,16 @@ strong.amplify-text {
3673
3689
  font-weight: var(--amplify-components-breadcrumbs-link-font-weight);
3674
3690
  padding-inline: var(--amplify-components-breadcrumbs-link-padding-inline);
3675
3691
  padding-block: var(--amplify-components-breadcrumbs-link-padding-block);
3676
- text-decoration: var(--amplify-components-breadcrumbs-link-text-decoration);
3692
+ -webkit-text-decoration: var(--amplify-components-breadcrumbs-link-text-decoration);
3693
+ text-decoration: var(--amplify-components-breadcrumbs-link-text-decoration);
3677
3694
  }
3678
3695
 
3679
3696
  .amplify-breadcrumbs__link--current {
3680
3697
  color: var(--amplify-components-breadcrumbs-link-current-color);
3681
3698
  font-size: var(--amplify-components-breadcrumbs-link-current-font-size);
3682
3699
  font-weight: var(--amplify-components-breadcrumbs-link-current-font-weight);
3683
- text-decoration: var(--amplify-components-breadcrumbs-link-current-text-decoration);
3700
+ -webkit-text-decoration: var(--amplify-components-breadcrumbs-link-current-text-decoration);
3701
+ text-decoration: var(--amplify-components-breadcrumbs-link-current-text-decoration);
3684
3702
  }
3685
3703
 
3686
3704
  .amplify-card {
@@ -5230,8 +5248,9 @@ html[dir=rtl] .amplify-field-group__inner-start {
5230
5248
  padding-block: var(--amplify-components-sliderfield-padding-block);
5231
5249
  position: relative;
5232
5250
  touch-action: none;
5233
- -moz-user-select: none;
5234
- user-select: none;
5251
+ -webkit-user-select: none;
5252
+ -moz-user-select: none;
5253
+ user-select: none;
5235
5254
  --amplify-internal-sliderfield-root-height: var(
5236
5255
  --amplify-components-sliderfield-thumb-height
5237
5256
  );
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { WebTheme } from '@aws-amplify/ui';
3
+ import { BaseComponentTheme } from '@aws-amplify/ui';
4
+ interface ComponentStyleProps extends React.ComponentProps<'style'> {
5
+ /**
6
+ * Provide a server generated nonce which matches your CSP `style-src` rule.
7
+ * This will be attached to the generated <style> tag.
8
+ * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src
9
+ */
10
+ nonce?: string;
11
+ theme: Pick<WebTheme, 'name' | 'breakpoints' | 'tokens'>;
12
+ componentThemes: BaseComponentTheme[];
13
+ }
14
+ /**
15
+ * @experimental
16
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
17
+ */
18
+ export declare const ComponentStyle: {
19
+ ({ theme, componentThemes, ...rest }: ComponentStyleProps): JSX.Element | null;
20
+ displayName: string;
21
+ };
22
+ export {};
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { createGlobalCSS } from '@aws-amplify/ui';
3
+ interface GlobalStyleProps extends React.ComponentProps<'style'> {
4
+ /**
5
+ * Provide a server generated nonce which matches your CSP `style-src` rule.
6
+ * This will be attached to the generated <style> tag.
7
+ * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src
8
+ */
9
+ nonce?: string;
10
+ styles: Parameters<typeof createGlobalCSS>[0];
11
+ }
12
+ /**
13
+ * @experimental
14
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
15
+ */
16
+ export declare const GlobalStyle: {
17
+ ({ styles, ...rest }: GlobalStyleProps): JSX.Element | null;
18
+ displayName: string;
19
+ };
20
+ export {};
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ interface StyleProps extends React.ComponentProps<'style'> {
3
+ cssText?: string;
4
+ }
5
+ /**
6
+ * @experimental
7
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
8
+ */
9
+ export declare const Style: {
10
+ ({ cssText, ...rest }: StyleProps): JSX.Element | null;
11
+ displayName: string;
12
+ };
13
+ export {};
@@ -1,6 +1,6 @@
1
+ import * as React from 'react';
1
2
  import { WebTheme } from '@aws-amplify/ui';
2
- import { BaseComponentProps, ElementType, ForwardRefPrimitive, PrimitiveProps } from '../../primitives/types';
3
- interface BaseStyleThemeProps extends BaseComponentProps {
3
+ interface ThemeStyleProps extends React.ComponentProps<'style'> {
4
4
  /**
5
5
  * Provide a server generated nonce which matches your CSP `style-src` rule.
6
6
  * This will be attached to the generated <style> tag.
@@ -9,10 +9,12 @@ interface BaseStyleThemeProps extends BaseComponentProps {
9
9
  nonce?: string;
10
10
  theme?: WebTheme;
11
11
  }
12
- export type ThemeStyleProps<Element extends ElementType = 'style'> = PrimitiveProps<BaseStyleThemeProps, Element>;
13
12
  /**
14
13
  * @experimental
15
14
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
16
15
  */
17
- export declare const ThemeStyle: ForwardRefPrimitive<BaseStyleThemeProps, 'style'>;
16
+ export declare const ThemeStyle: {
17
+ ({ theme, ...rest }: ThemeStyleProps): JSX.Element | null;
18
+ displayName: string;
19
+ };
18
20
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Breakpoint, Breakpoints, ValueBreakpoints } from '../../types/responsive';
2
2
  export declare const getValueAtCurrentBreakpoint: <Value = string | number>({ breakpoint, breakpoints, values, }: {
3
- values: Partial<Record<"small" | "large" | "medium" | "xl" | "xxl" | "base", Value>> | Value[];
3
+ values: Partial<Record<"base" | "small" | "large" | "medium" | "xl" | "xxl", Value>> | Value[];
4
4
  breakpoint: Breakpoint;
5
5
  breakpoints: Breakpoints;
6
6
  }) => string | number | Value | null;
@@ -1,2 +1,4 @@
1
1
  export { ThemeStyle } from './components/ThemeProvider/ThemeStyle';
2
+ export { ComponentStyle } from './components/ThemeProvider/ComponentStyle';
3
+ export { GlobalStyle } from './components/ThemeProvider/GlobalStyle';
2
4
  export { createTheme, defineComponentTheme, createComponentClasses, defaultTheme, defaultDarkModeOverride, } from '@aws-amplify/ui';
@@ -1 +1 @@
1
- export declare const VERSION = "6.4.0";
1
+ export declare const VERSION = "6.5.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "6.4.0",
3
+ "version": "6.5.1",
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.5.0",
59
- "@aws-amplify/ui-react-core": "3.0.23",
58
+ "@aws-amplify/ui": "6.6.1",
59
+ "@aws-amplify/ui-react-core": "3.0.25",
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",
@@ -66,7 +66,8 @@
66
66
  "tslib": "^2.5.2"
67
67
  },
68
68
  "peerDependencies": {
69
- "aws-amplify": "^6.3.2",
69
+ "@aws-amplify/core": "^6.4.0",
70
+ "aws-amplify": "^6.6.0",
70
71
  "react": "^16.14.0 || ^17.0 || ^18.0",
71
72
  "react-dom": "^16.14.0 || ^17.0 || ^18.0"
72
73
  },
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function _interopNamespace(e) {
6
- if (e && e.__esModule) return e;
7
- var n = Object.create(null);
8
- if (e) {
9
- Object.keys(e).forEach(function (k) {
10
- if (k !== 'default') {
11
- var d = Object.getOwnPropertyDescriptor(e, k);
12
- Object.defineProperty(n, k, d.get ? d : {
13
- enumerable: true,
14
- get: function () { return e[k]; }
15
- });
16
- }
17
- });
18
- }
19
- n["default"] = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
24
-
25
- /**
26
- * Updates the return type for primitives wrapped in `React.forwardRef` to
27
- * `React.ReactElement`. In React 18 the return type of `React.ExoticComponent`
28
- * was changed from `React.ReactElement` to `React.ReactNode`, which breaks
29
- * clients using React 16 and 17.
30
- *
31
- * @param primitive UI Primitive to be wrapped with `React.forwardRef`
32
- * @returns ForwaredRef wrapped UI Primitive
33
- */
34
- const primitiveWithForwardRef = (primitive) => React__namespace.forwardRef(primitive);
35
-
36
- exports.primitiveWithForwardRef = primitiveWithForwardRef;
@@ -1 +0,0 @@
1
- export {};