@aws-amplify/ui-react 2.15.2 → 2.15.5

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.
@@ -7483,6 +7483,10 @@
7483
7483
  "variation": {
7484
7484
  "type": "string"
7485
7485
  },
7486
+ "level": {
7487
+ "type": "number",
7488
+ "priority": true
7489
+ },
7486
7490
  "isTruncated": {
7487
7491
  "type": "boolean"
7488
7492
  }
package/dist/styles.css CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * Do not edit directly
7
- * Generated on Mon, 11 Apr 2022 18:40:17 GMT
7
+ * Generated on Thu, 21 Apr 2022 22:58:20 GMT
8
8
  */
9
9
 
10
10
  :root, [data-amplify-theme] {
@@ -249,7 +249,6 @@
249
249
  --amplify-components-menu-item-min-height: 2.5rem;
250
250
  --amplify-components-menu-min-width: 14rem;
251
251
  --amplify-components-menu-max-width: 30rem;
252
- --amplify-components-menu-gap: 0;
253
252
  --amplify-components-menu-flex-direction: column;
254
253
  --amplify-components-menu-border-style: solid;
255
254
  --amplify-components-loader-linear-animation-duration: 1s;
@@ -271,7 +270,6 @@
271
270
  --amplify-components-fieldmessages-description-font-style: italic;
272
271
  --amplify-components-fieldgroup-outer-align-items: center;
273
272
  --amplify-components-fieldgroup-vertical-align-items: center;
274
- --amplify-components-fieldgroup-gap: 0;
275
273
  --amplify-components-fieldcontrol-disabled-cursor: not-allowed;
276
274
  --amplify-components-fieldcontrol-quiet-border-radius: 0;
277
275
  --amplify-components-fieldcontrol-quiet-border-block-start: none;
@@ -290,7 +288,6 @@
290
288
  --amplify-components-expander-width: 100%;
291
289
  --amplify-components-expander-display: block;
292
290
  --amplify-components-divider-border-style: solid;
293
- --amplify-components-countrycodeselect-height: 100%;
294
291
  --amplify-components-checkboxfield-justify-content: center;
295
292
  --amplify-components-checkboxfield-flex-direction: column;
296
293
  --amplify-components-checkboxfield-align-content: center;
@@ -327,12 +324,10 @@
327
324
  --amplify-components-button-link-active-border-color: transparent;
328
325
  --amplify-components-button-link-focus-border-color: transparent;
329
326
  --amplify-components-button-link-hover-border-color: transparent;
330
- --amplify-components-button-link-background-color: transparent;
331
327
  --amplify-components-button-link-border-color: transparent;
332
- --amplify-components-button-link-border-width: 0;
328
+ --amplify-components-button-link-background-color: transparent;
333
329
  --amplify-components-button-menu-justify-content: start;
334
330
  --amplify-components-button-menu-background-color: transparent;
335
- --amplify-components-button-menu-border-width: 0;
336
331
  --amplify-components-button-primary-active-border-color: transparent;
337
332
  --amplify-components-button-primary-focus-border-color: transparent;
338
333
  --amplify-components-button-primary-hover-border-color: transparent;
@@ -492,6 +487,7 @@
492
487
  --amplify-components-menu-large-width: var(--amplify-font-sizes-xxxl);
493
488
  --amplify-components-menu-small-height: var(--amplify-font-sizes-medium);
494
489
  --amplify-components-menu-small-width: var(--amplify-font-sizes-medium);
490
+ --amplify-components-menu-gap: var(--amplify-space-zero);
495
491
  --amplify-components-menu-border-width: var(--amplify-border-widths-small);
496
492
  --amplify-components-menu-border-radius: var(--amplify-radii-medium);
497
493
  --amplify-components-menu-background-color: var(--amplify-colors-white);
@@ -530,6 +526,7 @@
530
526
  --amplify-components-flex-gap: var(--amplify-space-medium);
531
527
  --amplify-components-fieldmessages-description-font-size: var(--amplify-font-sizes-small);
532
528
  --amplify-components-fieldmessages-error-font-size: var(--amplify-font-sizes-small);
529
+ --amplify-components-fieldgroup-gap: var(--amplify-space-zero);
533
530
  --amplify-components-fieldcontrol-disabled-border-color: var(--amplify-colors-transparent);
534
531
  --amplify-components-fieldcontrol-quiet-border-block-end: var(--amplify-border-widths-small) solid var(--amplify-colors-border-primary);
535
532
  --amplify-components-fieldcontrol-large-padding-inline-end: var(--amplify-space-medium);
@@ -584,6 +581,7 @@
584
581
  --amplify-components-divider-label-font-size: var(--amplify-font-sizes-small);
585
582
  --amplify-components-divider-label-padding-inline: var(--amplify-space-medium);
586
583
  --amplify-components-divider-border-width: var(--amplify-border-widths-medium);
584
+ --amplify-components-countrycodeselect-height: var(--amplify-space-relative-full);
587
585
  --amplify-components-copy-tool-tip-font-size: var(--amplify-font-sizes-xxs);
588
586
  --amplify-components-copy-tool-tip-color: var(--amplify-colors-teal-100);
589
587
  --amplify-components-copy-tool-tip-bottom: var(--amplify-space-large);
@@ -606,6 +604,8 @@
606
604
  --amplify-components-card-padding: var(--amplify-space-medium);
607
605
  --amplify-components-card-border-radius: var(--amplify-radii-xs);
608
606
  --amplify-components-button-loader-wrapper-gap: var(--amplify-space-xs);
607
+ --amplify-components-button-link-border-width: var(--amplify-space-zero);
608
+ --amplify-components-button-menu-border-width: var(--amplify-space-zero);
609
609
  --amplify-components-button-primary-border-width: var(--amplify-border-widths-small);
610
610
  --amplify-components-button-border-style: var(--amplify-components-fieldcontrol-border-style);
611
611
  --amplify-components-button-font-weight: 700;
@@ -673,7 +673,6 @@
673
673
  --amplify-components-switchfield-track-background-color: var(--amplify-colors-background-tertiary);
674
674
  --amplify-components-switchfield-thumb-border-color: var(--amplify-colors-border-tertiary);
675
675
  --amplify-components-switchfield-thumb-background-color: var(--amplify-colors-background-primary);
676
- --amplify-components-switchfield-focused-shadow: var(--amplify-shadows-small);
677
676
  --amplify-components-sliderfield-thumb-hover-background-color: var(--amplify-colors-background-primary);
678
677
  --amplify-components-sliderfield-thumb-border-color: var(--amplify-colors-border-primary);
679
678
  --amplify-components-sliderfield-thumb-box-shadow: var(--amplify-shadows-small);
@@ -701,7 +700,7 @@
701
700
  --amplify-components-fieldmessages-error-color: var(--amplify-colors-font-error);
702
701
  --amplify-components-fieldcontrol-error-focus-box-shadow: 0px 0px 0px 1px var(--amplify-colors-border-error);
703
702
  --amplify-components-fieldcontrol-error-border-color: var(--amplify-colors-border-error);
704
- --amplify-components-fieldcontrol-quiet-error-focus-box-shadow: 0px 1px var(--amplify-colors-border-error);
703
+ --amplify-components-fieldcontrol-quiet-error-focus-box-shadow: 0px 1px 0px var(--amplify-colors-border-error);
705
704
  --amplify-components-fieldcontrol-quiet-error-border-block-end-color: var(--amplify-colors-border-error);
706
705
  --amplify-components-fieldcontrol-large-font-size: var(--amplify-components-field-large-font-size);
707
706
  --amplify-components-fieldcontrol-small-font-size: var(--amplify-components-field-small-font-size);
@@ -801,6 +800,7 @@
801
800
  --amplify-components-tabs-item-active-color: var(--amplify-colors-font-interactive);
802
801
  --amplify-components-tabs-item-focus-color: var(--amplify-colors-font-focus);
803
802
  --amplify-components-tabs-item-hover-color: var(--amplify-colors-font-hover);
803
+ --amplify-components-switchfield-focused-shadow: 0px 0px 0px 2px var(--amplify-colors-border-focus);
804
804
  --amplify-components-sliderfield-thumb-focus-box-shadow: 0 0 0 3px var(--amplify-colors-border-focus);
805
805
  --amplify-components-sliderfield-thumb-hover-border-color: var(--amplify-colors-border-focus);
806
806
  --amplify-components-sliderfield-thumb-disabled-background-color: var(--amplify-colors-background-disabled);
@@ -820,7 +820,7 @@
820
820
  --amplify-components-fieldcontrol-disabled-color: var(--amplify-colors-font-disabled);
821
821
  --amplify-components-fieldcontrol-focus-box-shadow: 0px 0px 0px 1px var(--amplify-colors-border-focus);
822
822
  --amplify-components-fieldcontrol-focus-border-color: var(--amplify-colors-border-focus);
823
- --amplify-components-fieldcontrol-quiet-focus-box-shadow: 0px 1px var(--amplify-colors-border-focus);
823
+ --amplify-components-fieldcontrol-quiet-focus-box-shadow: 0px 1px 0px var(--amplify-colors-border-focus);
824
824
  --amplify-components-fieldcontrol-quiet-focus-border-block-end-color: var(--amplify-colors-border-focus);
825
825
  --amplify-components-expander-item-focus-box-shadow: 0 0 0 2px var(--amplify-colors-border-focus);
826
826
  --amplify-components-checkbox-label-disabled-color: var(--amplify-colors-font-disabled);
@@ -1624,6 +1624,7 @@ h6.amplify-heading {
1624
1624
  /* Center by default */
1625
1625
 
1626
1626
  [data-amplify-authenticator][data-variation=modal] {
1627
+ overflow-y: auto;
1627
1628
  display: grid;
1628
1629
  width: var(--amplify-components-authenticator-modal-width);
1629
1630
  height: var(--amplify-components-authenticator-modal-height);
@@ -1,13 +1,15 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { CognitoUserAmplify } from '@aws-amplify/ui';
3
3
  import { useAuthenticator } from '../hooks/useAuthenticator';
4
+ declare type AuthenticatorChildren = React.ReactNode | (({ signOut, user, }: {
5
+ signOut?: ReturnType<typeof useAuthenticator>['signOut'];
6
+ user?: CognitoUserAmplify;
7
+ }) => React.ReactNode);
4
8
  export declare type RouterProps = {
5
9
  className?: string;
6
- children?: ({ signOut, user, }: {
7
- signOut: ReturnType<typeof useAuthenticator>['signOut'];
8
- user: CognitoUserAmplify;
9
- }) => JSX.Element;
10
+ children?: AuthenticatorChildren;
10
11
  variation?: 'default' | 'modal';
11
12
  hideSignUp?: boolean;
12
13
  };
13
14
  export declare function Router({ children, className, variation, hideSignUp, }: RouterProps): JSX.Element;
15
+ export {};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare function SignIn(): JSX.Element;
3
3
  export declare namespace SignIn {
4
- var Header: () => JSX.Element;
5
4
  var Footer: () => JSX.Element;
5
+ var Header: () => JSX.Element;
6
6
  }
@@ -1,45 +1,20 @@
1
1
  /// <reference types="react" />
2
- export declare const defaultComponents: {
3
- Header: () => JSX.Element;
4
- SignIn: {
5
- Header: () => JSX.Element;
6
- Footer: () => JSX.Element;
7
- };
8
- SignUp: {
9
- Header: () => JSX.Element;
10
- FormFields: () => JSX.Element;
11
- Footer: () => JSX.Element;
12
- };
13
- ConfirmSignUp: {
14
- Header: () => JSX.Element;
15
- Footer: () => JSX.Element;
16
- };
17
- SetupTOTP: {
18
- Header: () => JSX.Element;
19
- Footer: () => JSX.Element;
20
- };
21
- ConfirmResetPassword: {
22
- Header: () => JSX.Element;
23
- Footer: () => JSX.Element;
24
- };
25
- ConfirmSignIn: {
26
- Header: () => JSX.Element;
27
- Footer: () => JSX.Element;
28
- };
29
- VerifyUser: {
30
- Header: () => JSX.Element;
31
- Footer: () => JSX.Element;
32
- };
33
- ConfirmVerifyUser: {
34
- Header: () => JSX.Element;
35
- Footer: () => JSX.Element;
36
- };
37
- ForceNewPassword: {
38
- FormFields: () => JSX.Element;
39
- };
40
- ResetPassword: {
41
- Header: () => JSX.Element;
42
- Footer: () => JSX.Element;
43
- };
44
- Footer: () => JSX.Element;
45
- };
2
+ interface Components {
3
+ Footer?: () => JSX.Element;
4
+ FormFields?: () => JSX.Element;
5
+ Header?: () => JSX.Element;
6
+ }
7
+ export interface DefaultComponents extends Omit<Components, 'FormFields'> {
8
+ ConfirmSignIn?: Omit<Components, 'FormFields'>;
9
+ ConfirmSignUp?: Omit<Components, 'FormFields'>;
10
+ ConfirmResetPassword?: Omit<Components, 'FormFields'>;
11
+ ConfirmVerifyUser?: Omit<Components, 'FormFields'>;
12
+ ForceNewPassword?: Pick<Components, 'FormFields'>;
13
+ ResetPassword?: Omit<Components, 'FormFields'>;
14
+ SetupTOTP?: Omit<Components, 'FormFields'>;
15
+ SignIn?: Omit<Components, 'FormFields'>;
16
+ SignUp?: Components;
17
+ VerifyUser?: Omit<Components, 'FormFields'>;
18
+ }
19
+ export declare const defaultComponents: DefaultComponents;
20
+ export {};
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
- import { PartialDeep } from 'src/types';
3
- import { defaultComponents } from './defaultComponents';
2
+ import { DefaultComponents } from './defaultComponents';
4
3
  export interface ComponentsProviderProps {
5
- components?: PartialDeep<typeof defaultComponents>;
4
+ components?: DefaultComponents;
6
5
  }
7
6
  export declare const CustomComponentsContext: React.Context<ComponentsProviderProps>;
8
7
  export declare const useCustomComponents: () => ComponentsProviderProps;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AuthenticatorProps } from './Authenticator';
3
3
  export declare type WithAuthenticatorOptions = Omit<AuthenticatorProps, 'children'>;
4
- export declare function withAuthenticator(Component: any, options?: WithAuthenticatorOptions): (props: any) => JSX.Element;
4
+ export declare function withAuthenticator<Props>(Component: (props?: Props) => JSX.Element, options?: WithAuthenticatorOptions): (props: Props) => JSX.Element;
@@ -18,7 +18,7 @@
18
18
  * return <Geocoder />;
19
19
  * }
20
20
  */
21
- export declare const Geocoder: ({ position, ...props }: GeocoderProps) => JSX.Element;
21
+ export declare const Geocoder: (props: GeocoderProps) => JSX.Element;
22
22
  export declare type GeocoderProps = {
23
23
  /**
24
24
  * A bounding box given as an array in the format `[minX, minY, maxX, maxY]`.
@@ -3,8 +3,8 @@ export interface UseComposeRefsCallbackProps<RefType> {
3
3
  externalRef: React.ForwardedRef<RefType>;
4
4
  internalRef: React.MutableRefObject<RefType>;
5
5
  }
6
- export declare type UseComposeRefsCallbackReturn<RefType> = (node: RefType) => void;
6
+ export declare type UseComposeRefsCallback<RefType> = (node: RefType) => void;
7
7
  /**
8
8
  * Creates ref callback to compose together external and internal refs
9
9
  */
10
- export declare const useComposeRefsCallback: <RefType>({ externalRef, internalRef, }: UseComposeRefsCallbackProps<RefType>) => UseComposeRefsCallbackReturn<RefType>;
10
+ export declare function useComposeRefsCallback<RefType>({ externalRef, internalRef, }: UseComposeRefsCallbackProps<RefType>): UseComposeRefsCallback<RefType>;
@@ -5,5 +5,5 @@ export declare const useSearchField: ({ onSubmit, onClear, externalRef, }: UseSe
5
5
  onKeyDown: (event: any) => void;
6
6
  onInput: (event: any) => void;
7
7
  onClick: () => void;
8
- composedRefs: import("../../hooks/useComposeRefsCallback").UseComposeRefsCallbackReturn<HTMLInputElement>;
8
+ composedRefs: import("../../hooks/useComposeRefsCallback").UseComposeRefsCallback<HTMLInputElement>;
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "2.15.2",
3
+ "version": "2.15.5",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "exports": {
@@ -44,21 +44,20 @@
44
44
  "build": "yarn run build:ts && yarn run build:catalog",
45
45
  "build:ts": "rollup --config",
46
46
  "build:catalog": "ts-node scripts/generatePrimitivesCatalog.ts",
47
- "dev": "rollup --config --watch",
48
- "eslint:primitives": "eslint ./src/primitives --ext .js,.ts,.tsx",
47
+ "dev": "tsup --watch",
48
+ "dev:build": "tsup",
49
49
  "update:icons": "node scripts/updateIcons.js",
50
50
  "build:icons": "yarn run clean:icons && node scripts/generateIcons.js",
51
51
  "clean": "rimraf dist node_modules",
52
52
  "clean:icons": "rimraf ./src/primitives/Icon/icons",
53
- "primitives:new": "hygen primitives new",
54
- "lint": "tsc --noEmit && yarn eslint:primitives",
53
+ "lint": "tsc --noEmit && yarn eslint ./src --ext .js,.ts,.tsx",
55
54
  "test": "yarn test:unit",
56
55
  "test:watch": "yarn test:unit:watch",
57
56
  "test:unit": "jest",
58
57
  "test:unit:watch": "jest --watch"
59
58
  },
60
59
  "dependencies": {
61
- "@aws-amplify/ui": "3.6.2",
60
+ "@aws-amplify/ui": "3.6.5",
62
61
  "@aws-amplify/ui-react-v1": "npm:@aws-amplify/ui-react@1.2.9",
63
62
  "@radix-ui/react-accordion": "0.1.6",
64
63
  "@radix-ui/react-dropdown-menu": "0.1.6",
@@ -69,8 +68,8 @@
69
68
  "deepmerge": "4.2.2",
70
69
  "lodash": "4.17.21",
71
70
  "mapbox-gl": "npm:empty-npm-package@1.0.0",
72
- "maplibre-gl-js-amplify": "1.2.3",
73
- "maplibre-gl": "1.15.2",
71
+ "maplibre-gl": "1.15.3",
72
+ "maplibre-gl-js-amplify": "1.5.0",
74
73
  "qrcode": "1.5.0",
75
74
  "react-generate-context": "1.0.1",
76
75
  "react-map-gl": "7.0.10"
@@ -100,7 +99,6 @@
100
99
  "degit": "^2.8.4",
101
100
  "eslint": "^8.4.1",
102
101
  "eslint-plugin-react-hooks": "^4.3.0",
103
- "hygen": "^6.1.0",
104
102
  "jest": "^27.0.4",
105
103
  "jest-matchmedia-mock": "^1.1.0",
106
104
  "react-router-dom": "^6.2.1",
@@ -110,8 +108,7 @@
110
108
  "rollup-plugin-terser": "^7.0.2",
111
109
  "ts-jest": "^27.0.3",
112
110
  "ts-morph": "^12.0.0",
113
- "ts-node": "^10.2.1",
114
- "typescript": "^4.3.2"
111
+ "ts-node": "^10.2.1"
115
112
  },
116
113
  "sideEffects": [
117
114
  "dist/**/*.css"
@@ -1,59 +0,0 @@
1
- import { Primitive } from './Primitive';
2
- /**
3
- Create a type from another type with all keys and nested keys set to optional.
4
-
5
- Use-cases:
6
- - Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
7
- - Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
8
-
9
- @example
10
- ```
11
- import {PartialDeep} from 'type-fest';
12
-
13
- const settings: Settings = {
14
- textEditor: {
15
- fontSize: 14;
16
- fontColor: '#000000';
17
- fontWeight: 400;
18
- }
19
- autocomplete: false;
20
- autosave: true;
21
- };
22
-
23
- const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
24
- return {...settings, ...savedSettings};
25
- }
26
-
27
- settings = applySavedSettings({textEditor: {fontWeight: 500}});
28
- ```
29
-
30
- @category Utilities
31
- */
32
- export declare type PartialDeep<T> = T extends Primitive ? Partial<T> : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends Array<infer ItemType> ? ItemType[] extends T ? Array<PartialDeep<ItemType | undefined>> : PartialObjectDeep<T> : PartialObjectDeep<T> : unknown;
33
- /**
34
- Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
35
- */
36
- interface PartialMapDeep<KeyType, ValueType> extends Map<PartialDeep<KeyType>, PartialDeep<ValueType>> {
37
- }
38
- /**
39
- Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
40
- */
41
- interface PartialSetDeep<T> extends Set<PartialDeep<T>> {
42
- }
43
- /**
44
- Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
45
- */
46
- interface PartialReadonlyMapDeep<KeyType, ValueType> extends ReadonlyMap<PartialDeep<KeyType>, PartialDeep<ValueType>> {
47
- }
48
- /**
49
- Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
50
- */
51
- interface PartialReadonlySetDeep<T> extends ReadonlySet<PartialDeep<T>> {
52
- }
53
- /**
54
- Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
55
- */
56
- declare type PartialObjectDeep<ObjectType extends object> = {
57
- [KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType]>;
58
- };
59
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
3
- @category Basic
4
- */
5
- export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
@@ -1 +0,0 @@
1
- export * from './PartialDeep';