@aws-amplify/ui-react 5.0.2 → 5.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.
@@ -10,7 +10,7 @@ export type AuthenticatorProps = Partial<AuthenticatorMachineOptions & Component
10
10
  user?: AmplifyUser;
11
11
  }) => JSX.Element);
12
12
  }>;
13
- export declare function AuthenticatorInternal({ children, className, components: customComponents, formFields, hideSignUp, initialState, loginMechanisms, signUpAttributes, services, socialProviders, variation, }: AuthenticatorProps): JSX.Element;
13
+ export declare function AuthenticatorInternal({ children, className, components: customComponents, formFields, hideSignUp, initialState, loginMechanisms, passwordSettings, signUpAttributes, services, socialProviders, variation, }: AuthenticatorProps): JSX.Element;
14
14
  /**
15
15
  * [📖 Docs](https://ui.docs.amplify.aws/react/connected-components/authenticator)
16
16
  */
@@ -1,6 +1,5 @@
1
- interface UseDeprecationWarning {
2
- shouldWarn: boolean;
3
- message: string;
4
- }
5
- export declare const useDeprecationWarning: ({ shouldWarn, message, }: UseDeprecationWarning) => void;
6
- export {};
1
+ import { UseDeprecationWarning } from '@aws-amplify/ui-react-core';
2
+ /**
3
+ * Logs a deprecation warning `message` to the console.
4
+ */
5
+ export declare const useDeprecationWarning: UseDeprecationWarning;
@@ -1,2 +1,2 @@
1
1
  import { BaseFieldGroupIconProps, ForwardRefPrimitive } from '../types';
2
- export declare const FieldGroupIcon: ForwardRefPrimitive<BaseFieldGroupIconProps, 'button' | 'div'>;
2
+ export declare const FieldGroupIcon: ForwardRefPrimitive<BaseFieldGroupIconProps, 'div'>;
@@ -2,4 +2,4 @@ import { BaseRadioGroupFieldProps, ForwardRefPrimitive } from '../types';
2
2
  /**
3
3
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/radiogroupfield)
4
4
  */
5
- export declare const RadioGroupField: ForwardRefPrimitive<BaseRadioGroupFieldProps, 'div'>;
5
+ export declare const RadioGroupField: ForwardRefPrimitive<BaseRadioGroupFieldProps, 'fieldset'>;
@@ -16,7 +16,7 @@ interface UseStepper extends Required<Pick<StepperFieldProps, 'step' | 'value'>>
16
16
  shouldDisableDecreaseButton: boolean;
17
17
  shouldDisableIncreaseButton: boolean;
18
18
  }
19
- export declare const useStepper: ({ defaultValue, value: controlledValue, step, max, min, isDisabled, isReadOnly, onChange, onDecrease, onIncrease, onStepChange, }: Omit<import("..").PrimitivePropsWithAs<import("../types/stepperField").BaseStepperFieldProps, "input">, "ref"> & React.RefAttributes<HTMLInputElement> & Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "as" | keyof React.RefAttributes<HTMLInputElement> | keyof import("../types/stepperField").BaseStepperFieldProps> & {
19
+ export declare const useStepper: ({ defaultValue, value: controlledValue, step, max, min, isDisabled, isReadOnly, onChange, onDecrease, onIncrease, onStepChange, }: Omit<import("..").PrimitivePropsWithAs<import("../types/stepperField").BaseStepperFieldProps, "input">, "ref"> & React.RefAttributes<HTMLInputElement> & Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "as" | keyof React.RefAttributes<React.ComponentRef<Element_1>> | keyof import("../types/stepperField").BaseStepperFieldProps> & {
20
20
  onChange?: ChangeHandler | undefined;
21
21
  }) => UseStepper;
22
22
  export {};
@@ -19,4 +19,4 @@ export interface BaseRadioGroupFieldProps extends BaseFieldProps, FlexContainerS
19
19
  */
20
20
  labelPosition?: LabelPositions;
21
21
  }
22
- export type RadioGroupFieldProps<Element extends ElementType = 'input'> = PrimitiveProps<BaseRadioGroupFieldProps, Element>;
22
+ export type RadioGroupFieldProps<Element extends ElementType = 'fieldset'> = PrimitiveProps<BaseRadioGroupFieldProps, Element>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { Property } from 'csstype';
3
3
  import { WebDesignToken } from '@aws-amplify/ui';
4
- import type { BoxShadowKeys, ColorKeys, FontFamilyKeys, FontSizeKeys, FontWeightKeys, LineHeightKeys, OpacityKeys, RadiiKeys, SpaceKeys, TransformKeys } from './theme';
4
+ import type { BoxShadowKeys, BorderWidthKeys, ColorKeys, FontFamilyKeys, FontSizeKeys, FontWeightKeys, LineHeightKeys, OpacityKeys, RadiiKeys, SpaceKeys, TransformKeys } from './theme';
5
5
  import { FlexItemStyleProps, FlexContainerStyleProps } from './flex';
6
6
  import { GridItemStyleProps, GridContainerStyleProps } from './grid';
7
7
  import { ImageStyleProps } from './image';
@@ -53,6 +53,27 @@ export interface BaseStyleProps extends FlexItemStyleProps, GridItemStyleProps {
53
53
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border)
54
54
  */
55
55
  border?: ResponsiveStyle<StyleToken<Property.Border>>;
56
+ /**
57
+ * @description
58
+ * Shorthand CSS property that sets an element's border-color.
59
+ * @see
60
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color)
61
+ */
62
+ borderColor?: ResponsiveStyle<ColorKeys<StyleToken<Property.BorderColor>>>;
63
+ /**
64
+ * @description
65
+ * Shorthand CSS property that sets an element's border-width.
66
+ * @see
67
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)
68
+ */
69
+ borderWidth?: ResponsiveStyle<BorderWidthKeys<StyleToken<Property.BorderWidth>>>;
70
+ /**
71
+ * @description
72
+ * Shorthand CSS property that sets an element's border-style.
73
+ * @see
74
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style)
75
+ */
76
+ borderStyle?: ResponsiveStyle<StyleToken<Property.BorderStyle>>;
56
77
  /**
57
78
  * @description
58
79
  * Rounds the corners of an element's outer border edge.
@@ -72,4 +72,4 @@ export interface BaseSwitchFieldProps extends BaseInputProps, BaseFieldProps, Ba
72
72
  */
73
73
  value?: string | number;
74
74
  }
75
- export type SwitchFieldProps<Element extends ElementType = 'input'> = PrimitiveProps<BaseSwitchFieldProps, Element>;
75
+ export type SwitchFieldProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseSwitchFieldProps, Element>;
@@ -1,4 +1,4 @@
1
- import type { FontSizes, FontWeights, LineHeights, Radii, Shadows, SpaceSizes } from '@aws-amplify/ui';
1
+ import type { BorderWidths, FontSizes, FontWeights, LineHeights, Radii, Shadows, SpaceSizes } from '@aws-amplify/ui';
2
2
  /**
3
3
  * Token keys for colors
4
4
  *
@@ -23,6 +23,7 @@ type FontColorKeys = 'font.primary' | 'font.secondary' | 'font.tertiary' | 'font
23
23
  type BackgroundColorKeys = 'background.primary' | 'background.secondary' | 'background.tertiary' | 'background.quaternary' | 'background.disabled' | 'background.success' | 'background.info' | 'background.warning' | 'background.error';
24
24
  type BorderColorKeys = 'border.primary' | 'border.secondary' | 'border.tertiary' | 'border.disabled' | 'border.focus' | 'border.pressed' | 'border.error';
25
25
  type ShadowColorKeys = 'shadow.primary' | 'shadow.secondary' | 'shadow.tertiary';
26
+ export type BorderWidthKeys<PropertyType> = PropertyType | keyof BorderWidths;
26
27
  export type ColorKeys<PropertyType> = PropertyType | WhiteKey | BlackKey | RedKeys | OrangeKeys | YellowKeys | GreenKeys | TealKeys | BlueKeys | PurpleKeys | PinkKeys | NeutralKeys | OverlayKeys | BrandColorKeys | FontColorKeys | BackgroundColorKeys | BorderColorKeys | ShadowColorKeys;
27
28
  export type BoxShadowKeys<PropertyType> = PropertyType | keyof Shadows;
28
29
  export type FontSizeKeys<PropertyType> = PropertyType | keyof FontSizes;
@@ -34,6 +35,6 @@ export type RadiiKeys<PropertyType> = PropertyType | keyof Radii;
34
35
  export type SpaceKeys<PropertyType> = PropertyType | keyof SpaceSizes | 'zero' | 'relative.xxxs' | 'relative.xxs' | 'relative.xs' | 'relative.small' | 'relative.medium' | 'relative.large' | 'relative.xl' | 'relative.xxl' | 'relative.xxxl' | 'relative.full';
35
36
  export type TransformKeys<PropertyType> = PropertyType | 'slideX.small' | 'slideX.medium' | 'slideX.large';
36
37
  export declare const isThemeStylePropKey: (key: string) => key is ThemeStylePropKey;
37
- export type ThemeStylePropKey = 'backgroundColor' | 'borderRadius' | 'bottom' | 'boxShadow' | 'color' | 'columnGap' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'gap' | 'height' | 'left' | 'letterSpacing' | 'lineHeight' | 'margin' | 'marginBlock' | 'marginBlockEnd' | 'marginBlockStart' | 'marginBottom' | 'marginInline' | 'marginInlineEnd' | 'marginInlineStart' | 'marginLeft' | 'marginRight' | 'marginTop' | 'maxHeight' | 'maxWidth' | 'minHeight' | 'minWidth' | 'opacity' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'paddingBottom' | 'right' | 'rowGap' | 'top' | 'transform' | 'width';
38
+ export type ThemeStylePropKey = 'backgroundColor' | 'borderColor' | 'borderRadius' | 'borderWidth' | 'bottom' | 'boxShadow' | 'color' | 'columnGap' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'gap' | 'height' | 'left' | 'letterSpacing' | 'lineHeight' | 'margin' | 'marginBlock' | 'marginBlockEnd' | 'marginBlockStart' | 'marginBottom' | 'marginInline' | 'marginInlineEnd' | 'marginInlineStart' | 'marginLeft' | 'marginRight' | 'marginTop' | 'maxHeight' | 'maxWidth' | 'minHeight' | 'minWidth' | 'opacity' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'paddingBottom' | 'right' | 'rowGap' | 'top' | 'transform' | 'width';
38
39
  export type ThemeTokenKey = 'components' | 'borderWidths' | 'colors' | 'fonts' | 'fontSizes' | 'fontWeights' | 'lineHeights' | 'opacities' | 'outlineOffsets' | 'outlineWidths' | 'radii' | 'shadows' | 'space' | 'time' | 'transforms';
39
40
  export {};
@@ -12,8 +12,15 @@ type AsProp<Element extends ElementType> = {
12
12
  as?: Element;
13
13
  };
14
14
  export type PrimitivePropsWithAs<Props extends BaseViewProps, Element extends ElementType> = Omit<Props, 'as'> & AsProp<Element>;
15
- type PrimitivePropsWithRef<Props extends BaseViewProps, Element extends ElementType> = Omit<Props, 'ref'> & (IsAny<Element> extends false ? React.RefAttributes<React.ComponentRef<Element>> : React.RefAttributes<any>);
16
- export type PrimitivePropsWithHTMLAttributes<Props extends BaseViewProps, Element extends ElementType> = MergeProps<PrimitivePropsWithRef<Props, Element>, React.ComponentPropsWithoutRef<Element>>;
15
+ type PrimitivePropsWithRef<Props extends BaseViewProps, Element extends ElementType> = Omit<Props, 'ref'> & React.RefAttributes<React.ComponentRef<Element>>;
16
+ export type PrimitivePropsWithHTMLAttributes<Props extends BaseViewProps, Element extends ElementType> =
17
+ /**
18
+ * Doing an IsAny<Element> conditional check here makes sure typescript infers the type of `Element`.
19
+ * Without this check Typescript won't do an additional inference phase for the generics `Element`,
20
+ * and simply treat it as any, which in turn affects other the inference for other types.
21
+ * e.g. In an event handler, onChange((event) => { console.log(event)}), event will be implicitly inferred as any without the check
22
+ */
23
+ IsAny<Element> extends false ? MergeProps<PrimitivePropsWithRef<Props, Element>, React.ComponentPropsWithoutRef<Element>> : any;
17
24
  export type PrimitiveProps<Props extends BaseViewProps, Element extends ElementType> = PrimitivePropsWithHTMLAttributes<PrimitivePropsWithAs<Props, Element>, Element>;
18
25
  export type Primitive<Props extends BaseViewProps, Element extends ElementType> = React.ForwardRefRenderFunction<React.ComponentRef<Element>, Props>;
19
26
  export interface ForwardRefPrimitive<Props extends BaseViewProps, DefaultElement extends ElementType> extends React.ForwardRefExoticComponent<Props> {
@@ -1 +1 @@
1
- export declare const VERSION = "5.0.2";
1
+ export declare const VERSION = "5.0.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -47,8 +47,8 @@
47
47
  "typecheck": "tsc --noEmit"
48
48
  },
49
49
  "dependencies": {
50
- "@aws-amplify/ui": "5.6.5",
51
- "@aws-amplify/ui-react-core": "2.1.24",
50
+ "@aws-amplify/ui": "5.6.6",
51
+ "@aws-amplify/ui-react-core": "2.1.25",
52
52
  "@radix-ui/react-accordion": "1.0.0",
53
53
  "@radix-ui/react-direction": "1.0.0",
54
54
  "@radix-ui/react-dropdown-menu": "1.0.0",
@@ -86,7 +86,7 @@
86
86
  "@types/react": "^17.0.2",
87
87
  "@types/testing-library__jest-dom": "^5.14.1",
88
88
  "esbuild-register": "^3.3.3",
89
- "eslint": "^8.13.0",
89
+ "eslint": "^8.44.0",
90
90
  "jest": "^27.0.4",
91
91
  "jest-matchmedia-mock": "^1.1.0",
92
92
  "react": "^17.0.2",