@aws-amplify/ui 6.0.3 → 6.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.
@@ -34,6 +34,7 @@ const LEGACY_WAIT_CONFIG = {
34
34
  actions: ['configure'],
35
35
  target: 'getConfig',
36
36
  },
37
+ SIGN_OUT: '#authenticator.signOut',
37
38
  },
38
39
  };
39
40
  // setup step proceeds directly to configure
@@ -59,7 +60,7 @@ function createAuthenticatorMachine(options) {
59
60
  idle: {
60
61
  invoke: {
61
62
  src: 'handleGetCurrentUser',
62
- onDone: { actions: 'setUser', target: 'authenticated' },
63
+ onDone: { actions: 'setUser', target: 'setup' },
63
64
  onError: { target: 'setup' },
64
65
  },
65
66
  },
@@ -70,10 +71,17 @@ function createAuthenticatorMachine(options) {
70
71
  getConfig: {
71
72
  invoke: {
72
73
  src: 'getAmplifyConfig',
73
- onDone: {
74
- actions: ['applyAmplifyConfig', 'setHasSetup'],
75
- target: 'goToInitialState',
76
- },
74
+ onDone: [
75
+ {
76
+ actions: ['applyAmplifyConfig', 'setHasSetup'],
77
+ cond: 'hasUser',
78
+ target: '#authenticator.authenticated',
79
+ },
80
+ {
81
+ actions: ['applyAmplifyConfig', 'setHasSetup'],
82
+ target: 'goToInitialState',
83
+ },
84
+ ],
77
85
  },
78
86
  },
79
87
  goToInitialState: {
@@ -332,7 +340,7 @@ function createAuthenticatorMachine(options) {
332
340
  configure: assign((_, event) => {
333
341
  const { services: customServices, ...config } = !isEmptyObject(overrideConfigServices)
334
342
  ? overrideConfigServices
335
- : event.data;
343
+ : event.data ?? {};
336
344
  return {
337
345
  services: { ...defaultServices, ...customServices },
338
346
  config,
@@ -346,6 +354,9 @@ function createAuthenticatorMachine(options) {
346
354
  isInitialStateSignUp: ({ config }) => config.initialState === 'signUp',
347
355
  isInitialStateResetPassword: ({ config }) => config.initialState === 'forgotPassword',
348
356
  shouldSetup: ({ hasSetup }) => !hasSetup,
357
+ hasUser: ({ user }) => {
358
+ return !!user;
359
+ },
349
360
  },
350
361
  services: {
351
362
  getAmplifyConfig: ({ services }) => services.getAmplifyConfig(),
package/dist/index.js CHANGED
@@ -4630,6 +4630,7 @@ const LEGACY_WAIT_CONFIG = {
4630
4630
  actions: ['configure'],
4631
4631
  target: 'getConfig',
4632
4632
  },
4633
+ SIGN_OUT: '#authenticator.signOut',
4633
4634
  },
4634
4635
  };
4635
4636
  // setup step proceeds directly to configure
@@ -4655,7 +4656,7 @@ function createAuthenticatorMachine(options) {
4655
4656
  idle: {
4656
4657
  invoke: {
4657
4658
  src: 'handleGetCurrentUser',
4658
- onDone: { actions: 'setUser', target: 'authenticated' },
4659
+ onDone: { actions: 'setUser', target: 'setup' },
4659
4660
  onError: { target: 'setup' },
4660
4661
  },
4661
4662
  },
@@ -4666,10 +4667,17 @@ function createAuthenticatorMachine(options) {
4666
4667
  getConfig: {
4667
4668
  invoke: {
4668
4669
  src: 'getAmplifyConfig',
4669
- onDone: {
4670
- actions: ['applyAmplifyConfig', 'setHasSetup'],
4671
- target: 'goToInitialState',
4672
- },
4670
+ onDone: [
4671
+ {
4672
+ actions: ['applyAmplifyConfig', 'setHasSetup'],
4673
+ cond: 'hasUser',
4674
+ target: '#authenticator.authenticated',
4675
+ },
4676
+ {
4677
+ actions: ['applyAmplifyConfig', 'setHasSetup'],
4678
+ target: 'goToInitialState',
4679
+ },
4680
+ ],
4673
4681
  },
4674
4682
  },
4675
4683
  goToInitialState: {
@@ -4928,7 +4936,7 @@ function createAuthenticatorMachine(options) {
4928
4936
  configure: xstate.assign((_, event) => {
4929
4937
  const { services: customServices, ...config } = !isEmptyObject(overrideConfigServices)
4930
4938
  ? overrideConfigServices
4931
- : event.data;
4939
+ : event.data ?? {};
4932
4940
  return {
4933
4941
  services: { ...defaultServices, ...customServices },
4934
4942
  config,
@@ -4942,6 +4950,9 @@ function createAuthenticatorMachine(options) {
4942
4950
  isInitialStateSignUp: ({ config }) => config.initialState === 'signUp',
4943
4951
  isInitialStateResetPassword: ({ config }) => config.initialState === 'forgotPassword',
4944
4952
  shouldSetup: ({ hasSetup }) => !hasSetup,
4953
+ hasUser: ({ user }) => {
4954
+ return !!user;
4955
+ },
4945
4956
  },
4946
4957
  services: {
4947
4958
  getAmplifyConfig: ({ services }) => services.getAmplifyConfig(),
@@ -206,7 +206,7 @@
206
206
  content: "";
207
207
  width: 100%;
208
208
  height: 100%;
209
- background: var(--amplify-colors-primary-40);
209
+ background: var(--amplify-colors-primary-80);
210
210
  left: -100%;
211
211
  transform: translate(var(--percentage), 0);
212
212
  transition: var(--amplify-liveness-match-indicator-transition);
@@ -207,7 +207,7 @@
207
207
  content: "";
208
208
  width: 100%;
209
209
  height: 100%;
210
- background: var(--amplify-colors-primary-40);
210
+ background: var(--amplify-colors-primary-80);
211
211
  left: -100%;
212
212
  transform: translate(var(--percentage), 0);
213
213
  transition: var(--amplify-liveness-match-indicator-transition);
package/dist/styles.css CHANGED
@@ -4112,7 +4112,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
4112
4112
  content: "";
4113
4113
  width: 100%;
4114
4114
  height: 100%;
4115
- background: var(--amplify-colors-primary-40);
4115
+ background: var(--amplify-colors-primary-80);
4116
4116
  left: -100%;
4117
4117
  transform: translate(var(--percentage), 0);
4118
4118
  transition: var(--amplify-liveness-match-indicator-transition);
@@ -4113,7 +4113,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
4113
4113
  content: "";
4114
4114
  width: 100%;
4115
4115
  height: 100%;
4116
- background: var(--amplify-colors-primary-40);
4116
+ background: var(--amplify-colors-primary-80);
4117
4117
  left: -100%;
4118
4118
  transform: translate(var(--percentage), 0);
4119
4119
  transition: var(--amplify-liveness-match-indicator-transition);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui",
3
- "version": "6.0.3",
3
+ "version": "6.0.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "csstype": "^3.1.1",
48
48
  "lodash": "4.17.21",
49
- "style-dictionary": "3.7.1",
49
+ "style-dictionary": "3.9.1",
50
50
  "tslib": "^2.5.2"
51
51
  },
52
52
  "peerDependencies": {
@@ -62,6 +62,7 @@
62
62
  "@types/lodash": "^4.14.170",
63
63
  "@types/webpack-env": "^1.16.2",
64
64
  "autoprefixer": "^10.3.1",
65
+ "glob": "^10.3.10",
65
66
  "postcss": "^8.4.31",
66
67
  "sass": "^1.35.2"
67
68
  },