@aws-amplify/ui 6.15.4 → 6.15.6

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.
@@ -1,5 +1,6 @@
1
1
  import { translate, DefaultTexts } from '../../i18n/translations.mjs';
2
2
  import { defaultTexts } from '../../i18n/dictionaries/index.mjs';
3
+ import { getSentenceSpacer, terminateSentence } from '../../i18n/sentencePunctuation.mjs';
3
4
 
4
5
  /**
5
6
  * ConfirmSignIn
@@ -24,13 +25,15 @@ const getDeliveryMessageText = (codeDeliveryDetails) => {
24
25
  const isEmailMessage = DeliveryMedium === 'EMAIL';
25
26
  const isTextMessage = DeliveryMedium === 'SMS';
26
27
  const arrivalMessage = translate(DefaultTexts.CODE_ARRIVAL);
28
+ const spacer = getSentenceSpacer(arrivalMessage);
27
29
  if (!(isEmailMessage || isTextMessage)) {
28
- return `${translate(DefaultTexts.CODE_SENT)}. ${arrivalMessage}.`;
30
+ const sentMessage = translate(DefaultTexts.CODE_SENT);
31
+ return `${terminateSentence(sentMessage)}${spacer}${terminateSentence(arrivalMessage)}`;
29
32
  }
30
33
  const instructionMessage = isEmailMessage
31
34
  ? translate(DefaultTexts.CODE_EMAILED)
32
35
  : translate(DefaultTexts.CODE_TEXTED);
33
- return `${instructionMessage} ${Destination}. ${arrivalMessage}.`;
36
+ return `${terminateSentence(`${instructionMessage} ${Destination}`)}${spacer}${terminateSentence(arrivalMessage)}`;
34
37
  };
35
38
  const getDeliveryMethodText = (codeDeliveryDetails) => {
36
39
  const { DeliveryMedium } = codeDeliveryDetails ?? {};
@@ -0,0 +1,72 @@
1
+ /**
2
+ * #6966 — script-aware punctuation for the Authenticator delivery message.
3
+ *
4
+ * The delivery message is assembled from translated fragments joined by
5
+ * punctuation. Hardcoding an ASCII period is wrong for locales whose sentence
6
+ * terminator differs: Japanese/Chinese use the ideographic full stop `。` and
7
+ * Thai writes no sentence terminator at all. The terminator and the
8
+ * inter-sentence spacer are therefore derived from the script of the
9
+ * surrounding translated copy, keeping punctuation locale-correct without
10
+ * adding a translation key, interpolation, or any public API.
11
+ *
12
+ * Script detection is MAJORITY-based rather than "contains any": a sentence is
13
+ * treated as CJK or Thai only when most of its non-whitespace characters belong
14
+ * to that script. "Contains any" mis-classifies copy such as a Latin sentence
15
+ * that includes a single CJK proper noun, or a Korean (Hangul) phrase that
16
+ * happens to contain a stray CJK codepoint.
17
+ */
18
+ // Han / Kana ranges whose sentences terminate with the ideographic full stop.
19
+ const CJK_CHARACTERS = /[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f]/g;
20
+ // Thai script range. Thai does not use a written sentence terminator.
21
+ const THAI_CHARACTERS = /[\u0e00-\u0e7f]/g;
22
+ // Copy that is already sentence-terminated must not receive a second terminator
23
+ // (e.g. a customer vocabulary override). Beyond ASCII `.!?` and their
24
+ // full-width twins `。!?`, this also covers the colon `:` / `:`, the ellipsis
25
+ // `…`, and the full-width `.` and half-width `。` full stops.
26
+ const TERMINAL_PUNCTUATION = /[.!?:…。!?:.。]$/;
27
+ const countMatches = (sentence, pattern) => sentence.match(pattern)?.length ?? 0;
28
+ // Classifies `sentence` by the script forming the majority (more than half) of
29
+ // its non-whitespace characters. Anything not predominantly CJK or Thai —
30
+ // Latin, Cyrillic, Hangul, etc. — is treated as `latin`.
31
+ const getSentenceScript = (sentence) => {
32
+ const significantLength = sentence.replace(/\s/g, '').length;
33
+ if (significantLength === 0) {
34
+ return 'latin';
35
+ }
36
+ if (countMatches(sentence, CJK_CHARACTERS) * 2 > significantLength) {
37
+ return 'cjk';
38
+ }
39
+ if (countMatches(sentence, THAI_CHARACTERS) * 2 > significantLength) {
40
+ return 'thai';
41
+ }
42
+ return 'latin';
43
+ };
44
+ /**
45
+ * Appends the script-appropriate sentence terminator to `sentence` unless it is
46
+ * already terminated. CJK copy receives the ideographic full stop `。`, Thai
47
+ * copy is left untouched, and every other script receives an ASCII period.
48
+ *
49
+ * @internal Not exported from the `@aws-amplify/ui` public entry point.
50
+ */
51
+ const terminateSentence = (sentence) => {
52
+ if (TERMINAL_PUNCTUATION.test(sentence)) {
53
+ return sentence;
54
+ }
55
+ switch (getSentenceScript(sentence)) {
56
+ case 'cjk':
57
+ return `${sentence}。`;
58
+ case 'thai':
59
+ return sentence;
60
+ default:
61
+ return `${sentence}.`;
62
+ }
63
+ };
64
+ /**
65
+ * Returns the separator to place between two joined sentences. CJK scripts do
66
+ * not separate sentences with a space; every other script does.
67
+ *
68
+ * @internal Not exported from the `@aws-amplify/ui` public entry point.
69
+ */
70
+ const getSentenceSpacer = (sentence) => getSentenceScript(sentence) === 'cjk' ? '' : ' ';
71
+
72
+ export { getSentenceSpacer, terminateSentence };
@@ -73,6 +73,9 @@ function createAuthenticatorMachine(options) {
73
73
  onDone: { actions: 'setUser', target: 'setup' },
74
74
  onError: { target: 'setup' },
75
75
  },
76
+ // handle a sign out occurring while `handleGetCurrentUser` is in flight,
77
+ // exiting cancels the invoke so a stale user cannot be applied
78
+ on: { SIGN_OUT: '#authenticator.signOut' },
76
79
  },
77
80
  setup: {
78
81
  initial: 'initConfig',
@@ -118,6 +121,7 @@ function createAuthenticatorMachine(options) {
118
121
  },
119
122
  onError: { target: '#authenticator.setup' },
120
123
  },
124
+ on: { SIGN_OUT: '#authenticator.signOut' },
121
125
  },
122
126
  signInActor: {
123
127
  initial: 'spawnActor',
@@ -271,6 +275,14 @@ function createAuthenticatorMachine(options) {
271
275
  },
272
276
  },
273
277
  on: {
278
+ // `SIGN_OUT` handled by `setup.initConfig` moves the machine past setup without
279
+ // the UI ever sending `INIT`, leaving it configured with defaults. Accept `INIT`
280
+ // late so a subsequently rendered UI can still apply its `config` and `services`.
281
+ INIT: {
282
+ cond: 'shouldInitialize',
283
+ actions: 'configure',
284
+ target: '#authenticator.setup.getConfig',
285
+ },
274
286
  SIGN_IN_WITH_REDIRECT: { target: '#authenticator.getCurrentUser' },
275
287
  CHANGE: { actions: 'forwardToActor' },
276
288
  BLUR: { actions: 'forwardToActor' },
@@ -362,6 +374,7 @@ function createAuthenticatorMachine(options) {
362
374
  return {
363
375
  services: { ...defaultServices, ...customServices },
364
376
  config,
377
+ hasInitialized: true,
365
378
  };
366
379
  }),
367
380
  setHasSetup: assign({ hasSetup: true }),
@@ -372,6 +385,9 @@ function createAuthenticatorMachine(options) {
372
385
  isInitialStateSignUp: ({ config }) => config.initialState === 'signUp',
373
386
  isInitialStateResetPassword: ({ config }) => config.initialState === 'forgotPassword',
374
387
  shouldSetup: ({ hasSetup }) => !hasSetup,
388
+ // `hasSetup` prevents the late `INIT` from interrupting `idle`, which must
389
+ // resolve `handleGetCurrentUser` before the machine leaves it
390
+ shouldInitialize: ({ hasSetup, hasInitialized }) => hasSetup && !hasInitialized,
375
391
  hasUser: ({ user }) => {
376
392
  return !!user;
377
393
  },
package/dist/index.js CHANGED
@@ -3907,6 +3907,77 @@ const getSortedFormFields = (route, state) => {
3907
3907
  return removeOrderKeys(sortFormFields(formFields));
3908
3908
  };
3909
3909
 
3910
+ /**
3911
+ * #6966 — script-aware punctuation for the Authenticator delivery message.
3912
+ *
3913
+ * The delivery message is assembled from translated fragments joined by
3914
+ * punctuation. Hardcoding an ASCII period is wrong for locales whose sentence
3915
+ * terminator differs: Japanese/Chinese use the ideographic full stop `。` and
3916
+ * Thai writes no sentence terminator at all. The terminator and the
3917
+ * inter-sentence spacer are therefore derived from the script of the
3918
+ * surrounding translated copy, keeping punctuation locale-correct without
3919
+ * adding a translation key, interpolation, or any public API.
3920
+ *
3921
+ * Script detection is MAJORITY-based rather than "contains any": a sentence is
3922
+ * treated as CJK or Thai only when most of its non-whitespace characters belong
3923
+ * to that script. "Contains any" mis-classifies copy such as a Latin sentence
3924
+ * that includes a single CJK proper noun, or a Korean (Hangul) phrase that
3925
+ * happens to contain a stray CJK codepoint.
3926
+ */
3927
+ // Han / Kana ranges whose sentences terminate with the ideographic full stop.
3928
+ const CJK_CHARACTERS = /[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f]/g;
3929
+ // Thai script range. Thai does not use a written sentence terminator.
3930
+ const THAI_CHARACTERS = /[\u0e00-\u0e7f]/g;
3931
+ // Copy that is already sentence-terminated must not receive a second terminator
3932
+ // (e.g. a customer vocabulary override). Beyond ASCII `.!?` and their
3933
+ // full-width twins `。!?`, this also covers the colon `:` / `:`, the ellipsis
3934
+ // `…`, and the full-width `.` and half-width `。` full stops.
3935
+ const TERMINAL_PUNCTUATION = /[.!?:…。!?:.。]$/;
3936
+ const countMatches = (sentence, pattern) => sentence.match(pattern)?.length ?? 0;
3937
+ // Classifies `sentence` by the script forming the majority (more than half) of
3938
+ // its non-whitespace characters. Anything not predominantly CJK or Thai —
3939
+ // Latin, Cyrillic, Hangul, etc. — is treated as `latin`.
3940
+ const getSentenceScript = (sentence) => {
3941
+ const significantLength = sentence.replace(/\s/g, '').length;
3942
+ if (significantLength === 0) {
3943
+ return 'latin';
3944
+ }
3945
+ if (countMatches(sentence, CJK_CHARACTERS) * 2 > significantLength) {
3946
+ return 'cjk';
3947
+ }
3948
+ if (countMatches(sentence, THAI_CHARACTERS) * 2 > significantLength) {
3949
+ return 'thai';
3950
+ }
3951
+ return 'latin';
3952
+ };
3953
+ /**
3954
+ * Appends the script-appropriate sentence terminator to `sentence` unless it is
3955
+ * already terminated. CJK copy receives the ideographic full stop `。`, Thai
3956
+ * copy is left untouched, and every other script receives an ASCII period.
3957
+ *
3958
+ * @internal Not exported from the `@aws-amplify/ui` public entry point.
3959
+ */
3960
+ const terminateSentence = (sentence) => {
3961
+ if (TERMINAL_PUNCTUATION.test(sentence)) {
3962
+ return sentence;
3963
+ }
3964
+ switch (getSentenceScript(sentence)) {
3965
+ case 'cjk':
3966
+ return `${sentence}。`;
3967
+ case 'thai':
3968
+ return sentence;
3969
+ default:
3970
+ return `${sentence}.`;
3971
+ }
3972
+ };
3973
+ /**
3974
+ * Returns the separator to place between two joined sentences. CJK scripts do
3975
+ * not separate sentences with a space; every other script does.
3976
+ *
3977
+ * @internal Not exported from the `@aws-amplify/ui` public entry point.
3978
+ */
3979
+ const getSentenceSpacer = (sentence) => getSentenceScript(sentence) === 'cjk' ? '' : ' ';
3980
+
3910
3981
  /**
3911
3982
  * ConfirmSignIn
3912
3983
  */
@@ -3930,13 +4001,15 @@ const getDeliveryMessageText = (codeDeliveryDetails) => {
3930
4001
  const isEmailMessage = DeliveryMedium === 'EMAIL';
3931
4002
  const isTextMessage = DeliveryMedium === 'SMS';
3932
4003
  const arrivalMessage = translate(DefaultTexts.CODE_ARRIVAL);
4004
+ const spacer = getSentenceSpacer(arrivalMessage);
3933
4005
  if (!(isEmailMessage || isTextMessage)) {
3934
- return `${translate(DefaultTexts.CODE_SENT)}. ${arrivalMessage}.`;
4006
+ const sentMessage = translate(DefaultTexts.CODE_SENT);
4007
+ return `${terminateSentence(sentMessage)}${spacer}${terminateSentence(arrivalMessage)}`;
3935
4008
  }
3936
4009
  const instructionMessage = isEmailMessage
3937
4010
  ? translate(DefaultTexts.CODE_EMAILED)
3938
4011
  : translate(DefaultTexts.CODE_TEXTED);
3939
- return `${instructionMessage} ${Destination}. ${arrivalMessage}.`;
4012
+ return `${terminateSentence(`${instructionMessage} ${Destination}`)}${spacer}${terminateSentence(arrivalMessage)}`;
3940
4013
  };
3941
4014
  const getDeliveryMethodText = (codeDeliveryDetails) => {
3942
4015
  const { DeliveryMedium } = codeDeliveryDetails ?? {};
@@ -6081,6 +6154,9 @@ function createAuthenticatorMachine(options) {
6081
6154
  onDone: { actions: 'setUser', target: 'setup' },
6082
6155
  onError: { target: 'setup' },
6083
6156
  },
6157
+ // handle a sign out occurring while `handleGetCurrentUser` is in flight,
6158
+ // exiting cancels the invoke so a stale user cannot be applied
6159
+ on: { SIGN_OUT: '#authenticator.signOut' },
6084
6160
  },
6085
6161
  setup: {
6086
6162
  initial: 'initConfig',
@@ -6126,6 +6202,7 @@ function createAuthenticatorMachine(options) {
6126
6202
  },
6127
6203
  onError: { target: '#authenticator.setup' },
6128
6204
  },
6205
+ on: { SIGN_OUT: '#authenticator.signOut' },
6129
6206
  },
6130
6207
  signInActor: {
6131
6208
  initial: 'spawnActor',
@@ -6279,6 +6356,14 @@ function createAuthenticatorMachine(options) {
6279
6356
  },
6280
6357
  },
6281
6358
  on: {
6359
+ // `SIGN_OUT` handled by `setup.initConfig` moves the machine past setup without
6360
+ // the UI ever sending `INIT`, leaving it configured with defaults. Accept `INIT`
6361
+ // late so a subsequently rendered UI can still apply its `config` and `services`.
6362
+ INIT: {
6363
+ cond: 'shouldInitialize',
6364
+ actions: 'configure',
6365
+ target: '#authenticator.setup.getConfig',
6366
+ },
6282
6367
  SIGN_IN_WITH_REDIRECT: { target: '#authenticator.getCurrentUser' },
6283
6368
  CHANGE: { actions: 'forwardToActor' },
6284
6369
  BLUR: { actions: 'forwardToActor' },
@@ -6370,6 +6455,7 @@ function createAuthenticatorMachine(options) {
6370
6455
  return {
6371
6456
  services: { ...defaultServices, ...customServices },
6372
6457
  config,
6458
+ hasInitialized: true,
6373
6459
  };
6374
6460
  }),
6375
6461
  setHasSetup: xstate.assign({ hasSetup: true }),
@@ -6380,6 +6466,9 @@ function createAuthenticatorMachine(options) {
6380
6466
  isInitialStateSignUp: ({ config }) => config.initialState === 'signUp',
6381
6467
  isInitialStateResetPassword: ({ config }) => config.initialState === 'forgotPassword',
6382
6468
  shouldSetup: ({ hasSetup }) => !hasSetup,
6469
+ // `hasSetup` prevents the late `INIT` from interrupting `idle`, which must
6470
+ // resolve `handleGetCurrentUser` before the machine leaves it
6471
+ shouldInitialize: ({ hasSetup, hasInitialized }) => hasSetup && !hasInitialized,
6383
6472
  hasUser: ({ user }) => {
6384
6473
  return !!user;
6385
6474
  },
@@ -1512,11 +1512,11 @@
1512
1512
  --amplify-colors-black: hsl(0, 0%, 0%);
1513
1513
  --amplify-colors-white: hsl(0, 0%, 100%);
1514
1514
  --amplify-colors-transparent: transparent;
1515
- --amplify-fonts-default-variable: "InterVariable", "Inter var", "Inter", -apple-system, BlinkMacSystemFont,
1516
- "Helvetica Neue", "Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans",
1515
+ --amplify-fonts-default-variable: 'InterVariable', 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont,
1516
+ 'Helvetica Neue', 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans',
1517
1517
  sans-serif;
1518
- --amplify-fonts-default-static: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
1519
- "Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
1518
+ --amplify-fonts-default-static: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
1519
+ 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
1520
1520
  --amplify-font-sizes-xxxs: 0.375rem;
1521
1521
  --amplify-font-sizes-xxs: 0.5rem;
1522
1522
  --amplify-font-sizes-xs: 0.75rem;
@@ -1513,11 +1513,11 @@
1513
1513
  --amplify-colors-black: hsl(0, 0%, 0%);
1514
1514
  --amplify-colors-white: hsl(0, 0%, 100%);
1515
1515
  --amplify-colors-transparent: transparent;
1516
- --amplify-fonts-default-variable: "InterVariable", "Inter var", "Inter", -apple-system, BlinkMacSystemFont,
1517
- "Helvetica Neue", "Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans",
1516
+ --amplify-fonts-default-variable: 'InterVariable', 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont,
1517
+ 'Helvetica Neue', 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans',
1518
1518
  sans-serif;
1519
- --amplify-fonts-default-static: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
1520
- "Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
1519
+ --amplify-fonts-default-static: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
1520
+ 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
1521
1521
  --amplify-font-sizes-xxxs: 0.375rem;
1522
1522
  --amplify-font-sizes-xxs: 0.5rem;
1523
1523
  --amplify-font-sizes-xs: 0.75rem;
@@ -334,9 +334,6 @@
334
334
  border-width: var(--amplify-components-button-menu-border-width);
335
335
  background-color: var(--amplify-components-button-menu-background-color);
336
336
  justify-content: var(--amplify-components-button-menu-justify-content);
337
- --amplify-internal-button-disabled-color: var(
338
- --amplify-components-button-menu-disabled-color
339
- );
340
337
  }
341
338
  .amplify-button--menu:hover {
342
339
  color: var(--amplify-components-button-menu-hover-color);
@@ -351,6 +348,11 @@
351
348
  color: var(--amplify-components-button-menu-active-color);
352
349
  background-color: var(--amplify-components-button-menu-active-background-color);
353
350
  }
351
+ .amplify-button--menu {
352
+ --amplify-internal-button-disabled-color: var(
353
+ --amplify-components-button-menu-disabled-color
354
+ );
355
+ }
354
356
  .amplify-button--primary {
355
357
  --amplify-internal-button-border-width: var(
356
358
  --amplify-components-button-primary-border-width
@@ -364,24 +366,6 @@
364
366
  --amplify-internal-button-color: var(
365
367
  --amplify-components-button-primary-color
366
368
  );
367
- --amplify-internal-button-disabled-border-color: var(
368
- --amplify-components-button-primary-disabled-border-color
369
- );
370
- --amplify-internal-button-disabled-background-color: var(
371
- --amplify-components-button-primary-disabled-background-color
372
- );
373
- --amplify-internal-button-disabled-color: var(
374
- --amplify-components-button-primary-disabled-color
375
- );
376
- --amplify-internal-button-loading-background-color: var(
377
- --amplify-components-button-primary-loading-background-color
378
- );
379
- --amplify-internal-button-loading-border-color: var(
380
- --amplify-components-button-primary-loading-border-color
381
- );
382
- --amplify-internal-button-loading-color: var(
383
- --amplify-components-button-primary-loading-color
384
- );
385
369
  }
386
370
  .amplify-button--primary:hover {
387
371
  --amplify-internal-button-background-color: var(
@@ -654,6 +638,26 @@
654
638
  --amplify-components-button-primary-overlay-active-color
655
639
  );
656
640
  }
641
+ .amplify-button--primary {
642
+ --amplify-internal-button-disabled-border-color: var(
643
+ --amplify-components-button-primary-disabled-border-color
644
+ );
645
+ --amplify-internal-button-disabled-background-color: var(
646
+ --amplify-components-button-primary-disabled-background-color
647
+ );
648
+ --amplify-internal-button-disabled-color: var(
649
+ --amplify-components-button-primary-disabled-color
650
+ );
651
+ --amplify-internal-button-loading-background-color: var(
652
+ --amplify-components-button-primary-loading-background-color
653
+ );
654
+ --amplify-internal-button-loading-border-color: var(
655
+ --amplify-components-button-primary-loading-border-color
656
+ );
657
+ --amplify-internal-button-loading-color: var(
658
+ --amplify-components-button-primary-loading-color
659
+ );
660
+ }
657
661
  .amplify-button--link {
658
662
  --amplify-internal-button-border-width: var(
659
663
  --amplify-components-button-link-border-width
@@ -667,24 +671,6 @@
667
671
  --amplify-internal-button-color: var(
668
672
  --amplify-components-button-link-color
669
673
  );
670
- --amplify-internal-button-disabled-border-color: var(
671
- --amplify-components-button-link-disabled-border-color
672
- );
673
- --amplify-internal-button-disabled-background-color: var(
674
- --amplify-components-button-link-disabled-background-color
675
- );
676
- --amplify-internal-button-disabled-color: var(
677
- --amplify-components-button-link-disabled-color
678
- );
679
- --amplify-internal-button-loading-background-color: var(
680
- --amplify-components-button-link-loading-background-color
681
- );
682
- --amplify-internal-button-loading-border-color: var(
683
- --amplify-components-button-link-loading-border-color
684
- );
685
- --amplify-internal-button-loading-color: var(
686
- --amplify-components-button-link-loading-color
687
- );
688
674
  }
689
675
  .amplify-button--link:hover {
690
676
  --amplify-internal-button-background-color: var(
@@ -957,30 +943,32 @@
957
943
  --amplify-components-button-link-overlay-active-color
958
944
  );
959
945
  }
960
- .amplify-button--destructive {
961
- border-width: var(--amplify-components-button-destructive-border-width);
962
- background-color: var(--amplify-components-button-destructive-background-color);
963
- border-color: var(--amplify-components-button-destructive-border-color);
964
- color: var(--amplify-components-button-destructive-color);
946
+ .amplify-button--link {
965
947
  --amplify-internal-button-disabled-border-color: var(
966
- --amplify-components-button-destructive-disabled-border-color
948
+ --amplify-components-button-link-disabled-border-color
967
949
  );
968
950
  --amplify-internal-button-disabled-background-color: var(
969
- --amplify-components-button-destructive-disabled-background-color
951
+ --amplify-components-button-link-disabled-background-color
970
952
  );
971
953
  --amplify-internal-button-disabled-color: var(
972
- --amplify-components-button-destructive-disabled-color
954
+ --amplify-components-button-link-disabled-color
973
955
  );
974
956
  --amplify-internal-button-loading-background-color: var(
975
- --amplify-components-button-destructive-loading-background-color
957
+ --amplify-components-button-link-loading-background-color
976
958
  );
977
959
  --amplify-internal-button-loading-border-color: var(
978
- --amplify-components-button-destructive-loading-border-color
960
+ --amplify-components-button-link-loading-border-color
979
961
  );
980
962
  --amplify-internal-button-loading-color: var(
981
- --amplify-components-button-destructive-loading-color
963
+ --amplify-components-button-link-loading-color
982
964
  );
983
965
  }
966
+ .amplify-button--destructive {
967
+ border-width: var(--amplify-components-button-destructive-border-width);
968
+ background-color: var(--amplify-components-button-destructive-background-color);
969
+ border-color: var(--amplify-components-button-destructive-border-color);
970
+ color: var(--amplify-components-button-destructive-color);
971
+ }
984
972
  .amplify-button--destructive:hover {
985
973
  background-color: var(--amplify-components-button-destructive-hover-background-color);
986
974
  border-color: var(--amplify-components-button-destructive-hover-border-color);
@@ -997,6 +985,26 @@
997
985
  border-color: var(--amplify-components-button-destructive-active-border-color);
998
986
  color: var(--amplify-components-button-destructive-active-color);
999
987
  }
988
+ .amplify-button--destructive {
989
+ --amplify-internal-button-disabled-border-color: var(
990
+ --amplify-components-button-destructive-disabled-border-color
991
+ );
992
+ --amplify-internal-button-disabled-background-color: var(
993
+ --amplify-components-button-destructive-disabled-background-color
994
+ );
995
+ --amplify-internal-button-disabled-color: var(
996
+ --amplify-components-button-destructive-disabled-color
997
+ );
998
+ --amplify-internal-button-loading-background-color: var(
999
+ --amplify-components-button-destructive-loading-background-color
1000
+ );
1001
+ --amplify-internal-button-loading-border-color: var(
1002
+ --amplify-components-button-destructive-loading-border-color
1003
+ );
1004
+ --amplify-internal-button-loading-color: var(
1005
+ --amplify-components-button-destructive-loading-color
1006
+ );
1007
+ }
1000
1008
  .amplify-button--warning {
1001
1009
  background-color: var(--amplify-components-button-warning-background-color);
1002
1010
  border-color: var(--amplify-components-button-warning-border-color);
@@ -335,9 +335,6 @@
335
335
  border-width: var(--amplify-components-button-menu-border-width);
336
336
  background-color: var(--amplify-components-button-menu-background-color);
337
337
  justify-content: var(--amplify-components-button-menu-justify-content);
338
- --amplify-internal-button-disabled-color: var(
339
- --amplify-components-button-menu-disabled-color
340
- );
341
338
  }
342
339
  .amplify-button--menu:hover {
343
340
  color: var(--amplify-components-button-menu-hover-color);
@@ -352,6 +349,11 @@
352
349
  color: var(--amplify-components-button-menu-active-color);
353
350
  background-color: var(--amplify-components-button-menu-active-background-color);
354
351
  }
352
+ .amplify-button--menu {
353
+ --amplify-internal-button-disabled-color: var(
354
+ --amplify-components-button-menu-disabled-color
355
+ );
356
+ }
355
357
  .amplify-button--primary {
356
358
  --amplify-internal-button-border-width: var(
357
359
  --amplify-components-button-primary-border-width
@@ -365,24 +367,6 @@
365
367
  --amplify-internal-button-color: var(
366
368
  --amplify-components-button-primary-color
367
369
  );
368
- --amplify-internal-button-disabled-border-color: var(
369
- --amplify-components-button-primary-disabled-border-color
370
- );
371
- --amplify-internal-button-disabled-background-color: var(
372
- --amplify-components-button-primary-disabled-background-color
373
- );
374
- --amplify-internal-button-disabled-color: var(
375
- --amplify-components-button-primary-disabled-color
376
- );
377
- --amplify-internal-button-loading-background-color: var(
378
- --amplify-components-button-primary-loading-background-color
379
- );
380
- --amplify-internal-button-loading-border-color: var(
381
- --amplify-components-button-primary-loading-border-color
382
- );
383
- --amplify-internal-button-loading-color: var(
384
- --amplify-components-button-primary-loading-color
385
- );
386
370
  }
387
371
  .amplify-button--primary:hover {
388
372
  --amplify-internal-button-background-color: var(
@@ -655,6 +639,26 @@
655
639
  --amplify-components-button-primary-overlay-active-color
656
640
  );
657
641
  }
642
+ .amplify-button--primary {
643
+ --amplify-internal-button-disabled-border-color: var(
644
+ --amplify-components-button-primary-disabled-border-color
645
+ );
646
+ --amplify-internal-button-disabled-background-color: var(
647
+ --amplify-components-button-primary-disabled-background-color
648
+ );
649
+ --amplify-internal-button-disabled-color: var(
650
+ --amplify-components-button-primary-disabled-color
651
+ );
652
+ --amplify-internal-button-loading-background-color: var(
653
+ --amplify-components-button-primary-loading-background-color
654
+ );
655
+ --amplify-internal-button-loading-border-color: var(
656
+ --amplify-components-button-primary-loading-border-color
657
+ );
658
+ --amplify-internal-button-loading-color: var(
659
+ --amplify-components-button-primary-loading-color
660
+ );
661
+ }
658
662
  .amplify-button--link {
659
663
  --amplify-internal-button-border-width: var(
660
664
  --amplify-components-button-link-border-width
@@ -668,24 +672,6 @@
668
672
  --amplify-internal-button-color: var(
669
673
  --amplify-components-button-link-color
670
674
  );
671
- --amplify-internal-button-disabled-border-color: var(
672
- --amplify-components-button-link-disabled-border-color
673
- );
674
- --amplify-internal-button-disabled-background-color: var(
675
- --amplify-components-button-link-disabled-background-color
676
- );
677
- --amplify-internal-button-disabled-color: var(
678
- --amplify-components-button-link-disabled-color
679
- );
680
- --amplify-internal-button-loading-background-color: var(
681
- --amplify-components-button-link-loading-background-color
682
- );
683
- --amplify-internal-button-loading-border-color: var(
684
- --amplify-components-button-link-loading-border-color
685
- );
686
- --amplify-internal-button-loading-color: var(
687
- --amplify-components-button-link-loading-color
688
- );
689
675
  }
690
676
  .amplify-button--link:hover {
691
677
  --amplify-internal-button-background-color: var(
@@ -958,30 +944,32 @@
958
944
  --amplify-components-button-link-overlay-active-color
959
945
  );
960
946
  }
961
- .amplify-button--destructive {
962
- border-width: var(--amplify-components-button-destructive-border-width);
963
- background-color: var(--amplify-components-button-destructive-background-color);
964
- border-color: var(--amplify-components-button-destructive-border-color);
965
- color: var(--amplify-components-button-destructive-color);
947
+ .amplify-button--link {
966
948
  --amplify-internal-button-disabled-border-color: var(
967
- --amplify-components-button-destructive-disabled-border-color
949
+ --amplify-components-button-link-disabled-border-color
968
950
  );
969
951
  --amplify-internal-button-disabled-background-color: var(
970
- --amplify-components-button-destructive-disabled-background-color
952
+ --amplify-components-button-link-disabled-background-color
971
953
  );
972
954
  --amplify-internal-button-disabled-color: var(
973
- --amplify-components-button-destructive-disabled-color
955
+ --amplify-components-button-link-disabled-color
974
956
  );
975
957
  --amplify-internal-button-loading-background-color: var(
976
- --amplify-components-button-destructive-loading-background-color
958
+ --amplify-components-button-link-loading-background-color
977
959
  );
978
960
  --amplify-internal-button-loading-border-color: var(
979
- --amplify-components-button-destructive-loading-border-color
961
+ --amplify-components-button-link-loading-border-color
980
962
  );
981
963
  --amplify-internal-button-loading-color: var(
982
- --amplify-components-button-destructive-loading-color
964
+ --amplify-components-button-link-loading-color
983
965
  );
984
966
  }
967
+ .amplify-button--destructive {
968
+ border-width: var(--amplify-components-button-destructive-border-width);
969
+ background-color: var(--amplify-components-button-destructive-background-color);
970
+ border-color: var(--amplify-components-button-destructive-border-color);
971
+ color: var(--amplify-components-button-destructive-color);
972
+ }
985
973
  .amplify-button--destructive:hover {
986
974
  background-color: var(--amplify-components-button-destructive-hover-background-color);
987
975
  border-color: var(--amplify-components-button-destructive-hover-border-color);
@@ -998,6 +986,26 @@
998
986
  border-color: var(--amplify-components-button-destructive-active-border-color);
999
987
  color: var(--amplify-components-button-destructive-active-color);
1000
988
  }
989
+ .amplify-button--destructive {
990
+ --amplify-internal-button-disabled-border-color: var(
991
+ --amplify-components-button-destructive-disabled-border-color
992
+ );
993
+ --amplify-internal-button-disabled-background-color: var(
994
+ --amplify-components-button-destructive-disabled-background-color
995
+ );
996
+ --amplify-internal-button-disabled-color: var(
997
+ --amplify-components-button-destructive-disabled-color
998
+ );
999
+ --amplify-internal-button-loading-background-color: var(
1000
+ --amplify-components-button-destructive-loading-background-color
1001
+ );
1002
+ --amplify-internal-button-loading-border-color: var(
1003
+ --amplify-components-button-destructive-loading-border-color
1004
+ );
1005
+ --amplify-internal-button-loading-color: var(
1006
+ --amplify-components-button-destructive-loading-color
1007
+ );
1008
+ }
1001
1009
  .amplify-button--warning {
1002
1010
  background-color: var(--amplify-components-button-warning-background-color);
1003
1011
  border-color: var(--amplify-components-button-warning-border-color);