@transferwise/components 0.0.0-experimental-9773c7e → 0.0.0-experimental-c0ebd4f

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.
Files changed (87) hide show
  1. package/build/alert/Alert.js.map +1 -1
  2. package/build/alert/Alert.mjs.map +1 -1
  3. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  4. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  5. package/build/common/propsValues/sentiment.js +1 -0
  6. package/build/common/propsValues/sentiment.js.map +1 -1
  7. package/build/common/propsValues/sentiment.mjs +1 -0
  8. package/build/common/propsValues/sentiment.mjs.map +1 -1
  9. package/build/i18n/cs.json +9 -9
  10. package/build/i18n/cs.json.js +9 -9
  11. package/build/i18n/cs.json.mjs +9 -9
  12. package/build/index.js +0 -1
  13. package/build/index.js.map +1 -1
  14. package/build/index.mjs +1 -1
  15. package/build/main.css +60 -190
  16. package/build/statusIcon/StatusIcon.js +2 -2
  17. package/build/statusIcon/StatusIcon.js.map +1 -1
  18. package/build/statusIcon/StatusIcon.mjs +2 -2
  19. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  20. package/build/styles/inputs/Input.css +28 -2
  21. package/build/styles/inputs/TextArea.css +28 -2
  22. package/build/styles/main.css +60 -190
  23. package/build/styles/popover/Popover.css +28 -2
  24. package/build/title/Title.js.map +1 -1
  25. package/build/title/Title.mjs.map +1 -1
  26. package/build/types/alert/Alert.d.ts +2 -2
  27. package/build/types/alert/Alert.d.ts.map +1 -1
  28. package/build/types/avatarWrapper/AvatarWrapper.d.ts +2 -2
  29. package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
  30. package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
  31. package/build/types/index.d.ts +0 -2
  32. package/build/types/index.d.ts.map +1 -1
  33. package/build/types/statusIcon/StatusIcon.d.ts +3 -2
  34. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  35. package/build/types/test-utils/fake-data.d.ts +0 -1
  36. package/build/types/test-utils/fake-data.d.ts.map +1 -1
  37. package/build/types/title/Title.d.ts.map +1 -1
  38. package/package.json +4 -4
  39. package/src/alert/Alert.story.tsx +5 -3
  40. package/src/alert/Alert.tsx +11 -2
  41. package/src/avatarWrapper/AvatarWrapper.story.tsx +2 -2
  42. package/src/avatarWrapper/AvatarWrapper.tsx +3 -2
  43. package/src/common/propsValues/sentiment.ts +1 -0
  44. package/src/i18n/cs.json +9 -9
  45. package/src/index.ts +0 -2
  46. package/src/inputs/Input.css +28 -2
  47. package/src/inputs/TextArea.css +28 -2
  48. package/src/main.css +60 -190
  49. package/src/main.less +0 -1
  50. package/src/popover/Popover.css +28 -2
  51. package/src/statusIcon/StatusIcon.docs.mdx +1 -1
  52. package/src/statusIcon/StatusIcon.spec.tsx +10 -4
  53. package/src/statusIcon/StatusIcon.story.tsx +10 -5
  54. package/src/statusIcon/StatusIcon.tsx +6 -4
  55. package/src/test-utils/fake-data.ts +0 -3
  56. package/src/title/Title.test.story.tsx +19 -12
  57. package/src/title/Title.tsx +1 -0
  58. package/build/styles/item/Item.css +0 -186
  59. package/build/types/item/Item.d.ts +0 -40
  60. package/build/types/item/Item.d.ts.map +0 -1
  61. package/build/types/item/ItemAdditionalInfo.d.ts +0 -9
  62. package/build/types/item/ItemAdditionalInfo.d.ts.map +0 -1
  63. package/build/types/item/ItemCheckbox.d.ts +0 -4
  64. package/build/types/item/ItemCheckbox.d.ts.map +0 -1
  65. package/build/types/item/ItemIconButton.d.ts +0 -4
  66. package/build/types/item/ItemIconButton.d.ts.map +0 -1
  67. package/build/types/item/ItemImage.d.ts +0 -4
  68. package/build/types/item/ItemImage.d.ts.map +0 -1
  69. package/build/types/item/ItemNavigation.d.ts +0 -4
  70. package/build/types/item/ItemNavigation.d.ts.map +0 -1
  71. package/build/types/item/index.d.ts +0 -5
  72. package/build/types/item/index.d.ts.map +0 -1
  73. package/build/types/item/prompt/Prompt.d.ts +0 -12
  74. package/build/types/item/prompt/Prompt.d.ts.map +0 -1
  75. package/src/item/Item.css +0 -186
  76. package/src/item/Item.less +0 -177
  77. package/src/item/Item.story.tsx +0 -93
  78. package/src/item/Item.tsx +0 -165
  79. package/src/item/ItemAdditionalInfo.tsx +0 -31
  80. package/src/item/ItemCheckbox.tsx +0 -16
  81. package/src/item/ItemIconButton.tsx +0 -15
  82. package/src/item/ItemImage.tsx +0 -11
  83. package/src/item/ItemNavigation.tsx +0 -16
  84. package/src/item/index.ts +0 -4
  85. package/src/item/prompt/Prompt.spec.tsx +0 -77
  86. package/src/item/prompt/Prompt.story.tsx +0 -170
  87. package/src/item/prompt/Prompt.tsx +0 -44
package/build/main.css CHANGED
@@ -2585,8 +2585,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2585
2585
  line-height: 1.2;
2586
2586
  line-height: var(--line-height-title);
2587
2587
  letter-spacing: 0;
2588
- -webkit-hyphens: auto;
2589
- hyphens: auto;
2590
2588
  margin-bottom: 0;
2591
2589
  margin-bottom: initial;
2592
2590
  font-size: 1.375rem;
@@ -2598,6 +2596,36 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2598
2596
  height: 72px !important;
2599
2597
  height: var(--size-72) !important;
2600
2598
  }
2599
+ @supports (hyphenate-limit-chars: 1) {
2600
+ .np-form-control--size-lg {
2601
+ -webkit-hyphens: auto;
2602
+ hyphens: auto;
2603
+ hyphenate-limit-chars: 7 3;
2604
+ }
2605
+ @media (min-width: 768px) {
2606
+ .np-form-control--size-lg {
2607
+ hyphenate-limit-chars: 8 3;
2608
+ }
2609
+ }
2610
+ @media (min-width: 992px) {
2611
+ .np-form-control--size-lg {
2612
+ hyphenate-limit-chars: 10 4 3;
2613
+ }
2614
+ }
2615
+ }
2616
+ @supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
2617
+ .np-form-control--size-lg {
2618
+ -webkit-hyphens: auto;
2619
+ hyphens: auto;
2620
+ -webkit-hyphenate-limit-before: 3;
2621
+ -webkit-hyphenate-limit-after: 3;
2622
+ }
2623
+ @media (min-width: 992px) {
2624
+ .np-form-control--size-lg {
2625
+ -webkit-hyphenate-limit-before: 4;
2626
+ }
2627
+ }
2628
+ }
2601
2629
  .np-form-control--size-lg + p,
2602
2630
  .np-form-control--size-lg + ul:not(.list-unstyled),
2603
2631
  .np-form-control--size-lg + ol:not(.list-unstyled) {
@@ -2620,192 +2648,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2620
2648
  border-radius: 9999px !important;
2621
2649
  border-radius: var(--radius-full) !important;
2622
2650
  }
2623
- .np-item {
2624
- padding: 16px;
2625
- padding: var(--size-16);
2626
- border-radius: 24px;
2627
- border-radius: var(--radius-large);
2628
- background-color: #ffffff;
2629
- background-color: var(--color-background-screen);
2630
- display: flex;
2631
- gap: 16px;
2632
- gap: var(--size-16);
2633
- align-items: center;
2634
- flex-direction: row;
2635
- cursor: pointer;
2636
- }
2637
- .np-item:hover {
2638
- background-color: var(--color-background-screen-hover);
2639
- }
2640
- .np-item:active {
2641
- background-color: var(--color-background-screen-active);
2642
- }
2643
- .np-item-media {
2644
- flex: 0 0 auto;
2645
- align-items: flex-start;
2646
- }
2647
- .np-item-title {
2648
- color: #37517e;
2649
- color: var(--color-content-primary);
2650
- }
2651
- .np-item-additional-info {
2652
- color: #768e9c;
2653
- color: var(--color-content-tertiary);
2654
- }
2655
- .np-item-value {
2656
- flex: 0 0 auto;
2657
- }
2658
- .np-item-control {
2659
- flex: 0 0 auto;
2660
- }
2661
- .np-item-spotlight-active {
2662
- background-color: rgba(134,167,189,0.10196);
2663
- background-color: var(--color-background-neutral);
2664
- }
2665
- .np-item-spotlight-active:hover {
2666
- background-color: var(--color-background-neutral-hover);
2667
- }
2668
- .np-item-spotlight-active:active {
2669
- background-color: var(--color-background-neutral-active);
2670
- }
2671
- .np-item-spotlight-inactive {
2672
- background-color: rgba(134, 167, 189, 0.025);
2673
- border: 1px dashed rgba(0,0,0,0.10196);
2674
- border: 1px dashed var(--color-border-neutral);
2675
- }
2676
- @supports (color: color-mix(in lch, red, blue)) {
2677
- .np-item-spotlight-inactive {
2678
- background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
2679
- }
2680
- }
2681
- .np-item-spotlight-inactive:hover {
2682
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
2683
- }
2684
- .np-item-spotlight-inactive:active {
2685
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
2686
- }
2687
- .np-item-prompt {
2688
- display: inline-flex;
2689
- padding-top: calc(8px / 2);
2690
- padding-top: calc(var(--padding-x-small) / 2);
2691
- padding-bottom: calc(8px / 2);
2692
- padding-bottom: calc(var(--padding-x-small) / 2);
2693
- padding-left: calc(8px - 1px);
2694
- padding-left: calc(var(--padding-x-small) - 1px);
2695
- padding-right: 8px;
2696
- padding-right: var(--padding-x-small);
2697
- border-radius: 10px;
2698
- border-radius: var(--radius-small);
2699
- word-break: break-word;
2700
- word-wrap: break-word;
2701
- }
2702
- .np-item-prompt .np-prompt-icon {
2703
- padding-right: calc(12px / 2);
2704
- padding-right: calc(var(--size-12) / 2);
2705
- padding-top: calc(4px - 1);
2706
- padding-top: calc(var(--size-4) - 1);
2707
- padding-bottom: calc(4px - 1);
2708
- padding-bottom: calc(var(--size-4) - 1);
2709
- }
2710
- .np-item-prompt .np-prompt-icon .tw-icon-tags,
2711
- .np-item-prompt .np-prompt-icon .tw-icon-confetti {
2712
- color: var(--color-sentiment-positive-primary);
2713
- }
2714
- .np-item-prompt a {
2715
- text-underline-offset: calc(4px / 2);
2716
- text-underline-offset: calc(var(--size-4) / 2);
2717
- }
2718
- .np-item-prompt.np-prompt-interactive {
2719
- -webkit-text-decoration: none;
2720
- text-decoration: none;
2721
- cursor: pointer;
2722
- border: none;
2723
- }
2724
- .np-item-prompt.negative {
2725
- background-color: var(--color-sentiment-negative-secondary);
2726
- color: var(--color-sentiment-negative-primary);
2727
- }
2728
- .np-item-prompt.negative a {
2729
- color: var(--color-sentiment-negative-primary);
2730
- }
2731
- .np-item-prompt.negative a:hover {
2732
- color: var(--color-sentiment-negative-primary-hover);
2733
- }
2734
- .np-item-prompt.negative a:active {
2735
- color: var(--color-sentiment-negative-primary-active);
2736
- }
2737
- .np-prompt-interactive.np-item-prompt.negative:hover {
2738
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 95%, var(--color-sentiment-negative-primary));
2739
- }
2740
- .np-prompt-interactive.np-item-prompt.negative:active {
2741
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 90%, var(--color-sentiment-negative-primary));
2742
- }
2743
- .np-item-prompt.positive,
2744
- .np-item-prompt.discount,
2745
- .np-item-prompt.savings {
2746
- background-color: var(--color-sentiment-positive-secondary);
2747
- color: var(--color-sentiment-positive-primary);
2748
- }
2749
- .np-item-prompt.positive a,
2750
- .np-item-prompt.discount a,
2751
- .np-item-prompt.savings a {
2752
- color: var(--color-sentiment-positive-primary);
2753
- }
2754
- .np-item-prompt.positive a:hover,
2755
- .np-item-prompt.discount a:hover,
2756
- .np-item-prompt.savings a:hover {
2757
- color: var(--color-sentiment-positive-primary-hover);
2758
- }
2759
- .np-item-prompt.positive a:active,
2760
- .np-item-prompt.discount a:active,
2761
- .np-item-prompt.savings a:active {
2762
- color: var(--color-sentiment-positive-primary-active);
2763
- }
2764
- .np-prompt-interactive.np-item-prompt.positive:hover,
2765
- .np-prompt-interactive.np-item-prompt.discount:hover,
2766
- .np-prompt-interactive.np-item-prompt.savings:hover {
2767
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 95%, var(--color-sentiment-positive-primary));
2768
- }
2769
- .np-prompt-interactive.np-item-prompt.positive:active,
2770
- .np-prompt-interactive.np-item-prompt.discount:active,
2771
- .np-prompt-interactive.np-item-prompt.savings:active {
2772
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 90%, var(--color-sentiment-positive-primary));
2773
- }
2774
- .np-item-prompt.neutral {
2775
- background-color: rgba(134,167,189,0.10196);
2776
- background-color: var(--color-background-neutral);
2777
- color: #37517e;
2778
- color: var(--color-content-primary);
2779
- }
2780
- .np-item-prompt.neutral a {
2781
- color: #37517e;
2782
- color: var(--color-content-primary);
2783
- }
2784
- .np-prompt-interactive.np-item-prompt.neutral:hover {
2785
- background-color: var(--color-background-neutral-hover);
2786
- }
2787
- .np-prompt-interactive.np-item-prompt.neutral:active {
2788
- background-color: var(--color-background-neutral-active);
2789
- }
2790
- .np-item-prompt.warning {
2791
- background-color: var(--color-sentiment-warning-secondary);
2792
- color: var(--color-sentiment-warning-content);
2793
- }
2794
- .np-item-prompt.warning a {
2795
- color: var(--color-sentiment-warning-content);
2796
- }
2797
- .np-item-prompt.warning a:hover {
2798
- color: var(--color-sentiment-warning-content-hover);
2799
- }
2800
- .np-item-prompt.warning a:active {
2801
- color: var(--color-sentiment-warning-content-active);
2802
- }
2803
- .np-prompt-interactive.np-item-prompt.warning:hover {
2804
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 90%, var(--color-sentiment-warning-primary));
2805
- }
2806
- .np-prompt-interactive.np-item-prompt.warning:active {
2807
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 80%, var(--color-sentiment-warning-primary));
2808
- }
2809
2651
  .np-field-control {
2810
2652
  margin-top: 4px;
2811
2653
  margin-top: var(--size-4);
@@ -4209,8 +4051,6 @@ html:not([dir="rtl"]) .np-navigation-option {
4209
4051
  line-height: 1.2;
4210
4052
  line-height: var(--line-height-title);
4211
4053
  letter-spacing: 0;
4212
- -webkit-hyphens: auto;
4213
- hyphens: auto;
4214
4054
  margin-bottom: 0;
4215
4055
  margin-bottom: initial;
4216
4056
  font-weight: 600;
@@ -4220,6 +4060,36 @@ html:not([dir="rtl"]) .np-navigation-option {
4220
4060
  letter-spacing: -0.02em;
4221
4061
  line-height: 122%;
4222
4062
  }
4063
+ @supports (hyphenate-limit-chars: 1) {
4064
+ .np-popover__container.np-bottom-sheet .np-popover__title {
4065
+ -webkit-hyphens: auto;
4066
+ hyphens: auto;
4067
+ hyphenate-limit-chars: 7 3;
4068
+ }
4069
+ @media (min-width: 768px) {
4070
+ .np-popover__container.np-bottom-sheet .np-popover__title {
4071
+ hyphenate-limit-chars: 8 3;
4072
+ }
4073
+ }
4074
+ @media (min-width: 992px) {
4075
+ .np-popover__container.np-bottom-sheet .np-popover__title {
4076
+ hyphenate-limit-chars: 10 4 3;
4077
+ }
4078
+ }
4079
+ }
4080
+ @supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
4081
+ .np-popover__container.np-bottom-sheet .np-popover__title {
4082
+ -webkit-hyphens: auto;
4083
+ hyphens: auto;
4084
+ -webkit-hyphenate-limit-before: 3;
4085
+ -webkit-hyphenate-limit-after: 3;
4086
+ }
4087
+ @media (min-width: 992px) {
4088
+ .np-popover__container.np-bottom-sheet .np-popover__title {
4089
+ -webkit-hyphenate-limit-before: 4;
4090
+ }
4091
+ }
4092
+ }
4223
4093
  .np-popover__container.np-bottom-sheet .np-popover__title + p,
4224
4094
  .np-popover__container.np-bottom-sheet .np-popover__title + ul:not(.list-unstyled),
4225
4095
  .np-popover__container.np-bottom-sheet .np-popover__title + ol:not(.list-unstyled) {
@@ -17,7 +17,7 @@ require('../common/propsValues/dateMode.js');
17
17
  require('../common/propsValues/monthFormat.js');
18
18
  require('../common/propsValues/position.js');
19
19
  require('../common/propsValues/layouts.js');
20
- require('../common/propsValues/status.js');
20
+ var status = require('../common/propsValues/status.js');
21
21
  var sentiment = require('../common/propsValues/sentiment.js');
22
22
  require('../common/propsValues/profileType.js');
23
23
  require('../common/propsValues/variant.js');
@@ -55,7 +55,7 @@ const StatusIcon = ({
55
55
  Icon: icons.Alert,
56
56
  defaultIconLabel: intl.formatMessage(StatusIcon_messages.default.warningLabel)
57
57
  },
58
- [sentiment.Sentiment.PENDING]: {
58
+ [status.Status.PENDING]: {
59
59
  Icon: icons.ClockBorderless,
60
60
  defaultIconLabel: intl.formatMessage(StatusIcon_messages.default.pendingLabel)
61
61
  },
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,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
1
+ {"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint, Status } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconSentiment = Sentiment | Status.PENDING;\n\nexport type StatusIconProps = {\n sentiment?: `${StatusIconSentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}` | Status.PENDING,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Status.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","Status","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB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ues/dateMode.mjs';
13
13
  import '../common/propsValues/monthFormat.mjs';
14
14
  import '../common/propsValues/position.mjs';
15
15
  import '../common/propsValues/layouts.mjs';
16
- import '../common/propsValues/status.mjs';
16
+ import { Status } from '../common/propsValues/status.mjs';
17
17
  import { Sentiment } from '../common/propsValues/sentiment.mjs';
18
18
  import '../common/propsValues/profileType.mjs';
19
19
  import '../common/propsValues/variant.mjs';
@@ -51,7 +51,7 @@ const StatusIcon = ({
51
51
  Icon: Alert,
52
52
  defaultIconLabel: intl.formatMessage(messages.warningLabel)
53
53
  },
54
- [Sentiment.PENDING]: {
54
+ [Status.PENDING]: {
55
55
  Icon: ClockBorderless,
56
56
  defaultIconLabel: intl.formatMessage(messages.pendingLabel)
57
57
  },
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA,SAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,SAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,KAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACC,UAAU,CAAA;KACzD;IACD,CAACP,SAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,KAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACI,YAAY,CAAA;KAC3D;IACD,CAACV,SAAS,CAACW,OAAO,GAAG;AACnBT,MAAAA,IAAI,EAAEU,KAAK;AACXR,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACO,YAAY,CAAA;KAC3D;IACD,CAACb,SAAS,CAACc,OAAO,GAAG;AACnBZ,MAAAA,IAAI,EAAEa,eAAe;AACrBX,MAAAA,gBAAgB,EAAEP,IAAI,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,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBqC,IAAAA,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAEvC,SAAS,CAAE;IAAAwC,QAAA,eAE5CL,GAAA,CAAC1B,IAAI,EAAA;AACH6B,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEtC,SAAS,KAAK,IAAI,GAAGuC,SAAS,GAAGvC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
1
+ {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint, Status } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconSentiment = Sentiment | Status.PENDING;\n\nexport type StatusIconProps = {\n sentiment?: `${StatusIconSentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}` | Status.PENDING,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Status.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","Status","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA,SAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,SAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,KAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACC,UAAU,CAAA;KACzD;IACD,CAACP,SAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,KAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACI,YAAY,CAAA;KAC3D;IACD,CAACV,SAAS,CAACW,OAAO,GAAG;AACnBT,MAAAA,IAAI,EAAEU,KAAK;AACXR,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACO,YAAY,CAAA;KAC3D;IACD,CAACC,MAAM,CAACC,OAAO,GAAG;AAChBb,MAAAA,IAAI,EAAEc,eAAe;AACrBZ,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACW,YAAY,CAAA;KAC3D;IACD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IAAAA,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAExC,SAAS,CAAE;IAAAyC,QAAA,eAE5CL,GAAA,CAAC3B,IAAI,EAAA;AACH8B,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEvC,SAAS,KAAK,IAAI,GAAGwC,SAAS,GAAGxC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
@@ -71,8 +71,6 @@
71
71
  line-height: 1.2;
72
72
  line-height: var(--line-height-title);
73
73
  letter-spacing: 0;
74
- -webkit-hyphens: auto;
75
- hyphens: auto;
76
74
  margin-bottom: 0;
77
75
  margin-bottom: initial;
78
76
  font-size: 1.375rem;
@@ -83,6 +81,34 @@
83
81
  line-height: 125%;
84
82
  height: 72px !important;
85
83
  height: var(--size-72) !important;
84
+ }@supports (hyphenate-limit-chars: 1) {
85
+ .np-form-control--size-lg {
86
+ -webkit-hyphens: auto;
87
+ hyphens: auto;
88
+ hyphenate-limit-chars: 7 3;
89
+ }
90
+ @media (min-width: 768px) {
91
+ .np-form-control--size-lg {
92
+ hyphenate-limit-chars: 8 3;
93
+ }
94
+ }
95
+ @media (min-width: 992px) {
96
+ .np-form-control--size-lg {
97
+ hyphenate-limit-chars: 10 4 3;
98
+ }
99
+ }
100
+ }@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
101
+ .np-form-control--size-lg {
102
+ -webkit-hyphens: auto;
103
+ hyphens: auto;
104
+ -webkit-hyphenate-limit-before: 3;
105
+ -webkit-hyphenate-limit-after: 3;
106
+ }
107
+ @media (min-width: 992px) {
108
+ .np-form-control--size-lg {
109
+ -webkit-hyphenate-limit-before: 4;
110
+ }
111
+ }
86
112
  }.np-form-control--size-lg + p,
87
113
  .np-form-control--size-lg + ul:not(.list-unstyled),
88
114
  .np-form-control--size-lg + ol:not(.list-unstyled) {
@@ -71,8 +71,6 @@
71
71
  line-height: 1.2;
72
72
  line-height: var(--line-height-title);
73
73
  letter-spacing: 0;
74
- -webkit-hyphens: auto;
75
- hyphens: auto;
76
74
  margin-bottom: 0;
77
75
  margin-bottom: initial;
78
76
  font-size: 1.375rem;
@@ -83,6 +81,34 @@
83
81
  line-height: 125%;
84
82
  height: 72px !important;
85
83
  height: var(--size-72) !important;
84
+ }@supports (hyphenate-limit-chars: 1) {
85
+ .np-form-control--size-lg {
86
+ -webkit-hyphens: auto;
87
+ hyphens: auto;
88
+ hyphenate-limit-chars: 7 3;
89
+ }
90
+ @media (min-width: 768px) {
91
+ .np-form-control--size-lg {
92
+ hyphenate-limit-chars: 8 3;
93
+ }
94
+ }
95
+ @media (min-width: 992px) {
96
+ .np-form-control--size-lg {
97
+ hyphenate-limit-chars: 10 4 3;
98
+ }
99
+ }
100
+ }@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
101
+ .np-form-control--size-lg {
102
+ -webkit-hyphens: auto;
103
+ hyphens: auto;
104
+ -webkit-hyphenate-limit-before: 3;
105
+ -webkit-hyphenate-limit-after: 3;
106
+ }
107
+ @media (min-width: 992px) {
108
+ .np-form-control--size-lg {
109
+ -webkit-hyphenate-limit-before: 4;
110
+ }
111
+ }
86
112
  }.np-form-control--size-lg + p,
87
113
  .np-form-control--size-lg + ul:not(.list-unstyled),
88
114
  .np-form-control--size-lg + ol:not(.list-unstyled) {