@aws-amplify/ui 6.15.3 → 6.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.
@@ -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 };
@@ -265,6 +265,11 @@ function signUpActor({ services }) {
265
265
  actions: ['setNextSignUpStep', 'clearFormValues'],
266
266
  target: '#signUpActor.autoSignIn',
267
267
  },
268
+ {
269
+ cond: 'shouldManualSignIn',
270
+ actions: ['clearFormValues', 'setSignInStep'],
271
+ target: '#signUpActor.resolved',
272
+ },
268
273
  {
269
274
  actions: 'setNextSignUpStep',
270
275
  target: '#signUpActor.init',
@@ -9,6 +9,8 @@ const shouldConfirmSignInWithNewPassword = (_, { data }) => data?.nextStep.signI
9
9
  const shouldResetPasswordFromSignIn = (_, { data }) => data?.nextStep?.signInStep === 'RESET_PASSWORD';
10
10
  const shouldConfirmSignUpFromSignIn = (_, { data }) => data?.nextStep.signInStep === 'CONFIRM_SIGN_UP';
11
11
  const shouldAutoSignIn = (_, { data }) => data?.nextStep.signUpStep === 'COMPLETE_AUTO_SIGN_IN';
12
+ const shouldManualSignIn = (context, { data }) => data?.nextStep.signUpStep === 'DONE' &&
13
+ context.step === 'CONFIRM_SIGN_UP';
12
14
  const hasCompletedSignIn = (_, { data }) => data?.nextStep.signInStep === 'DONE';
13
15
  const hasCompletedSignUp = (_, { data }) => data?.nextStep.signUpStep === 'DONE';
14
16
  const hasCompletedResetPassword = (_, { data }) => data?.nextStep.resetPasswordStep === 'DONE';
@@ -110,6 +112,7 @@ const GUARDS = {
110
112
  isShouldConfirmUserAttributeStep,
111
113
  isUserAlreadyConfirmed,
112
114
  shouldAutoSignIn,
115
+ shouldManualSignIn,
113
116
  shouldConfirmResetPassword,
114
117
  shouldConfirmSignIn,
115
118
  shouldConfirmSignInWithNewPassword,
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 ?? {};
@@ -4608,6 +4681,8 @@ const shouldConfirmSignInWithNewPassword = (_, { data }) => data?.nextStep.signI
4608
4681
  const shouldResetPasswordFromSignIn = (_, { data }) => data?.nextStep?.signInStep === 'RESET_PASSWORD';
4609
4682
  const shouldConfirmSignUpFromSignIn = (_, { data }) => data?.nextStep.signInStep === 'CONFIRM_SIGN_UP';
4610
4683
  const shouldAutoSignIn = (_, { data }) => data?.nextStep.signUpStep === 'COMPLETE_AUTO_SIGN_IN';
4684
+ const shouldManualSignIn = (context, { data }) => data?.nextStep.signUpStep === 'DONE' &&
4685
+ context.step === 'CONFIRM_SIGN_UP';
4611
4686
  const hasCompletedSignIn = (_, { data }) => data?.nextStep.signInStep === 'DONE';
4612
4687
  const hasCompletedSignUp = (_, { data }) => data?.nextStep.signUpStep === 'DONE';
4613
4688
  const hasCompletedResetPassword = (_, { data }) => data?.nextStep.resetPasswordStep === 'DONE';
@@ -4709,6 +4784,7 @@ const GUARDS = {
4709
4784
  isShouldConfirmUserAttributeStep,
4710
4785
  isUserAlreadyConfirmed,
4711
4786
  shouldAutoSignIn,
4787
+ shouldManualSignIn,
4712
4788
  shouldConfirmResetPassword,
4713
4789
  shouldConfirmSignIn,
4714
4790
  shouldConfirmSignInWithNewPassword,
@@ -5802,6 +5878,11 @@ function signUpActor({ services }) {
5802
5878
  actions: ['setNextSignUpStep', 'clearFormValues'],
5803
5879
  target: '#signUpActor.autoSignIn',
5804
5880
  },
5881
+ {
5882
+ cond: 'shouldManualSignIn',
5883
+ actions: ['clearFormValues', 'setSignInStep'],
5884
+ target: '#signUpActor.resolved',
5885
+ },
5805
5886
  {
5806
5887
  actions: 'setNextSignUpStep',
5807
5888
  target: '#signUpActor.init',
@@ -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);
@@ -42,6 +42,9 @@
42
42
  border-color: var(--amplify-internal-checkbox_button-focused-before-border-color);
43
43
  box-shadow: var(--amplify-internal-checkbox_button-focused-before-box-shadow);
44
44
  }
45
+ .amplify-checkbox__button--error::before {
46
+ border-color: var(--amplify-components-checkbox-button-error-border-color);
47
+ }
45
48
  .amplify-checkbox__button--error {
46
49
  --amplify-internal-checkbox_button-focused-before-border-color: var(
47
50
  --amplify-components-checkbox-button-error-focus-border-color
@@ -50,9 +53,6 @@
50
53
  --amplify-components-checkbox-button-error-focus-box-shadow
51
54
  );
52
55
  }
53
- .amplify-checkbox__button--error::before {
54
- border-color: var(--amplify-components-checkbox-button-error-border-color);
55
- }
56
56
  .amplify-checkbox__button--disabled::before {
57
57
  border-color: var(--amplify-components-checkbox-button-disabled-border-color);
58
58
  }
@@ -43,6 +43,9 @@
43
43
  border-color: var(--amplify-internal-checkbox_button-focused-before-border-color);
44
44
  box-shadow: var(--amplify-internal-checkbox_button-focused-before-box-shadow);
45
45
  }
46
+ .amplify-checkbox__button--error::before {
47
+ border-color: var(--amplify-components-checkbox-button-error-border-color);
48
+ }
46
49
  .amplify-checkbox__button--error {
47
50
  --amplify-internal-checkbox_button-focused-before-border-color: var(
48
51
  --amplify-components-checkbox-button-error-focus-border-color
@@ -51,9 +54,6 @@
51
54
  --amplify-components-checkbox-button-error-focus-box-shadow
52
55
  );
53
56
  }
54
- .amplify-checkbox__button--error::before {
55
- border-color: var(--amplify-components-checkbox-button-error-border-color);
56
- }
57
57
  .amplify-checkbox__button--disabled::before {
58
58
  border-color: var(--amplify-components-checkbox-button-disabled-border-color);
59
59
  }