@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.
- package/dist/esm/components/Authenticator/Router/index.js +1 -1
- package/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.js +1 -1
- package/dist/esm/components/Authenticator/SignIn/SignIn.js +1 -1
- package/dist/esm/components/Authenticator/hooks/useAuthenticator/index.js +1 -1
- package/dist/esm/components/Geo/Geocoder/index.js +1 -1
- package/dist/esm/components/Geo/MapView/index.js +1 -1
- package/dist/esm/hooks/useComposeRefsCallback.js +1 -1
- package/dist/esm/primitives-catalog.js +4 -0
- package/dist/index.js +1 -1
- package/dist/primitives.json +4 -0
- package/dist/styles.css +11 -10
- package/dist/types/components/Authenticator/Router/index.d.ts +7 -5
- package/dist/types/components/Authenticator/SignIn/SignIn.d.ts +1 -1
- package/dist/types/components/Authenticator/hooks/useCustomComponents/defaultComponents.d.ts +19 -44
- package/dist/types/components/Authenticator/hooks/useCustomComponents/index.d.ts +2 -3
- package/dist/types/components/Authenticator/withAuthenticator.d.ts +1 -1
- package/dist/types/components/Geo/Geocoder/index.d.ts +1 -1
- package/dist/types/hooks/useComposeRefsCallback.d.ts +2 -2
- package/dist/types/primitives/SearchField/useSearchField.d.ts +1 -1
- package/package.json +8 -11
- package/dist/types/types/PartialDeep.d.ts +0 -59
- package/dist/types/types/Primitive.d.ts +0 -5
- package/dist/types/types/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,Fragment as e,jsxs as i}from"react/jsx-runtime";import{useAuthenticator as s}from"../hooks/useAuthenticator/index.js";import{View as t}from"../../../primitives/View/View.js";import{ConfirmSignUp as n}from"../ConfirmSignUp/ConfirmSignUp.js";import{ForceNewPassword as o}from"../ForceNewPassword/ForceNewPassword.js";import{useCustomComponents as a}from"../hooks/useCustomComponents/index.js";import{SetupTOTP as m}from"../SetupTOTP/SetupTOTP.js";import"@aws-amplify/ui";import"../../../primitives/TextField/TextField.js";import"../../../primitives/Button/Button.js";import"../../../primitives/Flex/Flex.js";import"../../../primitives/Alert/Alert.js";import{SignInSignUpTabs as u}from"../shared/SignInSignUpTabs.js";import{ConfirmVerifyUser as p}from"../VerifyUser/ConfirmVerifyUser.js";import{VerifyUser as c}from"../VerifyUser/VerifyUser.js";import{ConfirmSignIn as f}from"../ConfirmSignIn/ConfirmSignIn.js";import{ConfirmResetPassword as d}from"../ResetPassword/ConfirmResetPassword.js";import{ResetPassword as l}from"../ResetPassword/ResetPassword.js";const g=r=>"signIn"===r||"signUp";function j({children:j,className:
|
|
1
|
+
import{jsx as r,Fragment as e,jsxs as i}from"react/jsx-runtime";import{useAuthenticator as s}from"../hooks/useAuthenticator/index.js";import{View as t}from"../../../primitives/View/View.js";import{ConfirmSignUp as n}from"../ConfirmSignUp/ConfirmSignUp.js";import{ForceNewPassword as o}from"../ForceNewPassword/ForceNewPassword.js";import{useCustomComponents as a}from"../hooks/useCustomComponents/index.js";import{SetupTOTP as m}from"../SetupTOTP/SetupTOTP.js";import"@aws-amplify/ui";import"../../../primitives/TextField/TextField.js";import"../../../primitives/Button/Button.js";import"../../../primitives/Flex/Flex.js";import"../../../primitives/Alert/Alert.js";import{SignInSignUpTabs as u}from"../shared/SignInSignUpTabs.js";import{ConfirmVerifyUser as p}from"../VerifyUser/ConfirmVerifyUser.js";import{VerifyUser as c}from"../VerifyUser/VerifyUser.js";import{ConfirmSignIn as f}from"../ConfirmSignIn/ConfirmSignIn.js";import{ConfirmResetPassword as d}from"../ResetPassword/ConfirmResetPassword.js";import{ResetPassword as l}from"../ResetPassword/ResetPassword.js";const g=r=>"signIn"===r||"signUp";function j({children:j,className:h,variation:w="default",hideSignUp:U}){const{route:y,signOut:P,user:S}=s((r=>[r.route,r.signOut,r.user])),{components:{Header:O,Footer:v}}=a();return["authenticated","signOut"].includes(y)?j?r(e,{children:"function"==typeof j?j({signOut:P,user:S}):j}):null:r(e,{children:r(t,Object.assign({className:h,"data-amplify-authenticator":"","data-variation":w},{children:i(t,Object.assign({"data-amplify-container":""},{children:[r(O,{}),r(t,Object.assign({"data-amplify-router":"","data-amplify-router-content":g(y)?void 0:""},{children:(()=>{switch(y){case"idle":case"setup":return null;case"confirmSignUp":return r(n,{});case"confirmSignIn":return r(f,{});case"setupTOTP":return r(m,{});case"signIn":case"signUp":return r(u,{hideSignUp:U});case"forceNewPassword":return r(o,{});case"resetPassword":return r(l,{});case"confirmResetPassword":return r(d,{});case"verifyUser":return r(c,{});case"confirmVerifyUser":return r(p,{});default:return console.warn("Unhandled Authenicator route – please open an issue: ",y),null}})()})),r(v,{})]}))}))})}export{j as Router};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as t,jsxs as o}from"react/jsx-runtime";import i from"qrcode";import*as r from"react";import{Logger as s,Auth as a}from"aws-amplify";import{getActorState as n,translate as
|
|
1
|
+
import{__awaiter as e}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as t,jsxs as o}from"react/jsx-runtime";import i from"qrcode";import*as r from"react";import{Logger as s,Auth as a}from"aws-amplify";import{getActorState as n,translate as m}from"@aws-amplify/ui";import{Flex as d}from"../../../primitives/Flex/Flex.js";import{Heading as l}from"../../../primitives/Heading/Heading.js";import{useAuthenticator as p}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as c}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as u}from"../hooks/useFormHandlers/useFormHandlers.js";import{ConfirmSignInFooter as f}from"../shared/ConfirmSignInFooter.js";import{RemoteErrorMessage as h}from"../shared/RemoteErrorMessage.js";import{FormFields as g}from"../shared/FormFields.js";const j=new s("SetupTOTP-logger"),y=()=>{var s;const{_state:l,isPending:v}=p((e=>[e.isPending])),{handleChange:O,handleSubmit:b}=u(),{components:{SetupTOTP:{Header:H=y.Header,Footer:C=y.Footer}}}=c(),[x,T]=r.useState(!0),[w,F]=r.useState(),[S,P]=r.useState("COPY"),[V,k]=r.useState(""),L=n(l),{formFields:M,user:$}=L.context,{totpIssuer:q="AWSCognito",totpUsername:D=$.username}=null===(s=null==M?void 0:M.setupTOTP)||void 0===s?void 0:s.QR,E=r.useCallback((t=>e(void 0,void 0,void 0,(function*(){try{const e=yield a.setupTOTP(t);k(e);const o=`otpauth://totp/${q}:${D}?secret=${e}&issuer=${q}`,r=yield i.toDataURL(o);F(r)}catch(e){j.error(e)}finally{T(!1)}}))),[q,D]);r.useEffect((()=>{$&&E($)}),[E,$]);return t("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-setup-totp":"",method:"post",onChange:O,onSubmit:b},{children:o("fieldset",Object.assign({style:{display:"flex",flexDirection:"column"},className:"amplify-flex",disabled:v},{children:[t(H,{}),o(d,Object.assign({direction:"column"},{children:[x?o("p",{children:[m("Loading"),"…"]}):t("img",{"data-amplify-qrcode":!0,src:w,alt:"qr code",width:"228",height:"228"}),o(d,Object.assign({"data-amplify-copy":!0},{children:[t("div",{children:V}),o(d,Object.assign({"data-amplify-copy-svg":!0,onClick:()=>{navigator.clipboard.writeText(V),P(m("COPIED"))}},{children:[t("div",Object.assign({"data-amplify-copy-tooltip":!0},{children:S})),t("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},{children:t("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})}))]}))]})),t(g,{route:"setupTOTP"}),t(h,{})]})),t(f,{}),t(C,{})]}))}))};y.Header=()=>t(l,Object.assign({level:3},{children:m("Setup TOTP")})),y.Footer=()=>null;export{y as SetupTOTP};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{translate as o,hasTranslation as r}from"@aws-amplify/ui";import{Button as s}from"../../../primitives/Button/Button.js";import{Flex as n}from"../../../primitives/Flex/Flex.js";import{View as t}from"../../../primitives/View/View.js";import{VisuallyHidden as a}from"../../../primitives/VisuallyHidden/VisuallyHidden.js";import{FederatedSignIn as m}from"../FederatedSignIn/FederatedSignIn.js";import{useAuthenticator as d}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as l}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as p}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as c}from"../shared/RemoteErrorMessage.js";import{FormFields as g}from"../shared/FormFields.js";function u(){const{isPending:r}=d((i=>[i.isPending])),{handleChange:f,handleSubmit:h}=p(),{components:{SignIn:{Header:j=u.Header,Footer:F=u.Footer}}}=l();return i(t,{children:[e(j,{}),i("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:h,onChange:f},{children:[e(m,{}),i(n,Object.assign({direction:"column"},{children:[i("fieldset",Object.assign({style:{display:"flex",flexDirection:"column"},className:"amplify-flex",disabled:r},{children:[e(a,{children:e("legend",{children:o("Sign in")})}),e(g,{route:"signIn"})]})),e(c,{}),e(s,Object.assign({isDisabled:r,isFullWidth:!0,type:"submit",variation:"primary",isLoading:r,loadingText:o("Signing in")},{children:o("Sign in")}))]}))]})),e(F,{})]})}u.
|
|
1
|
+
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{translate as o,hasTranslation as r}from"@aws-amplify/ui";import{Button as s}from"../../../primitives/Button/Button.js";import{Flex as n}from"../../../primitives/Flex/Flex.js";import{View as t}from"../../../primitives/View/View.js";import{VisuallyHidden as a}from"../../../primitives/VisuallyHidden/VisuallyHidden.js";import{FederatedSignIn as m}from"../FederatedSignIn/FederatedSignIn.js";import{useAuthenticator as d}from"../hooks/useAuthenticator/index.js";import{useCustomComponents as l}from"../hooks/useCustomComponents/index.js";import{useFormHandlers as p}from"../hooks/useFormHandlers/useFormHandlers.js";import{RemoteErrorMessage as c}from"../shared/RemoteErrorMessage.js";import{FormFields as g}from"../shared/FormFields.js";function u(){const{isPending:r}=d((i=>[i.isPending])),{handleChange:f,handleSubmit:h}=p(),{components:{SignIn:{Header:j=u.Header,Footer:F=u.Footer}}}=l();return i(t,{children:[e(j,{}),i("form",Object.assign({"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:h,onChange:f},{children:[e(m,{}),i(n,Object.assign({direction:"column"},{children:[i("fieldset",Object.assign({style:{display:"flex",flexDirection:"column"},className:"amplify-flex",disabled:r},{children:[e(a,{children:e("legend",{children:o("Sign in")})}),e(g,{route:"signIn"})]})),e(c,{}),e(s,Object.assign({isDisabled:r,isFullWidth:!0,type:"submit",variation:"primary",isLoading:r,loadingText:o("Signing in")},{children:o("Sign in")}))]}))]})),e(F,{})]})}u.Footer=()=>{const{toResetPassword:i}=d((i=>[i.toResetPassword])),n=r("Forgot your password? ")?o("Forgot your password? "):o("Forgot your password?");return e(t,Object.assign({"data-amplify-footer":""},{children:e(s,Object.assign({fontWeight:"normal",onClick:i,size:"small",variation:"link"},{children:n}))}))},u.Header=()=>null;export{u as SignIn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{getSendEventAliases as r,getServiceContextFacade as s,createAuthenticatorMachine as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{getSendEventAliases as r,getServiceContextFacade as s,createAuthenticatorMachine as n,listenToAuthHub as o}from"@aws-amplify/ui";import{useSelector as i,useInterpret as c}from"@xstate/react";import u from"lodash/isEmpty";import{areArrayValuesEqual as a}from"../../../../helpers/utils.js";const m=t.createContext({}),f=({children:r})=>{const s=t.useContext(m),i={service:c(n)},a=u(s)?i:s,{service:{send:f}}=a,p=t.useRef(!1);return t.useEffect((()=>{if(!p.current)return p.current=!0,o(f)}),[f]),e(m.Provider,Object.assign({value:a},{children:r}))},p=e=>{const n=(()=>{const{service:e}=t.useContext(m);if(!e)throw new Error("Please ensure you wrap your App with `Authenticator.Provider`.\nSee the `useAuthenticator` section on https://ui.docs.amplify.aws/components/authenticator.");return e})(),{send:o}=n,c=t.useMemo((()=>r(o)),[o]),u=e=>Object.assign(Object.assign({},c),s(e)),f=t.useRef(),p=i(n,(e=>e),((t,r)=>{if(!e)return!1;const s=f.current,n=u(r);if(f.current=n,!s)return!1;const o=e(s),i=e(n);return a(o,i)}));return Object.assign(Object.assign({},u(p)),{_state:p,_send:o})};export{m as AuthenticatorContext,f as Provider,p as useAuthenticator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as r}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{__rest as r}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as o}from"react/jsx-runtime";import t from"maplibre-gl";import{createAmplifyGeocoder as e}from"maplibre-gl-js-amplify";import{useRef as i,useEffect as n}from"react";import{useMap as s,useControl as m}from"react-map-gl";const p={maplibregl:t,marker:{color:"#3FB1CE"},popup:!0,showResultMarkers:{color:"#3FB1CE"},showResultsWhileTyping:!0},l=r=>{const{current:t}=s();return o(t?c:a,Object.assign({},p,r))},c=o=>{var{position:t="top-right"}=o,i=r(o,["position"]);return m((()=>e(i)),{position:t}),null},a=r=>{const t=i(!1);return n((()=>{t.current||(e(r).addTo("#geocoder-container"),t.current=!0)}),[r]),o("div",{id:"geocoder-container"})};export{l as Geocoder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o,__awaiter as
|
|
1
|
+
import{__rest as o,__awaiter as i}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as e}from"react/jsx-runtime";import{Amplify as t,Auth as r}from"aws-amplify";import l from"maplibre-gl";import{AmplifyMapLibreRequest as a}from"maplibre-gl-js-amplify";import{useState as m,useMemo as n,useEffect as s}from"react";import p from"react-map-gl";const c=c=>{var v,d,{mapLib:f,mapStyle:u,style:g}=c,b=o(c,["mapLib","mapStyle","style"]);const y=t.configure(),[_,j]=m(),h=n((()=>Object.assign({height:"100vh",position:"relative",width:"100vw"},g)),[g]);return s((()=>{i(void 0,void 0,void 0,(function*(){var o;const i=yield r.currentUserCredentials();if(i){const e=null===(o=y.geo)||void 0===o?void 0:o.amazon_location_service.region,{transformRequest:t}=new a(i,e);j((()=>t))}}))}),[null===(v=y.geo)||void 0===v?void 0:v.amazon_location_service.region]),_?e(p,Object.assign({},b,{mapLib:null!=f?f:l,mapStyle:null!=u?u:null===(d=y.geo)||void 0===d?void 0:d.amazon_location_service.maps.default,style:h,transformRequest:_})):null};export{c as MapView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";
|
|
1
|
+
import*as e from"react";function r({externalRef:r,internalRef:n}){return e.useCallback((e=>{"function"==typeof r?r(e):null!==r&&(r.current=e),n.current=e}),[r,n])}export{r as useComposeRefsCallback};
|