@transferwise/components 0.0.0-experimental-e9426b6 → 0.0.0-experimental-0397551

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 (182) hide show
  1. package/build/dateInput/DateInput.js +3 -6
  2. package/build/dateInput/DateInput.js.map +1 -1
  3. package/build/dateInput/DateInput.mjs +2 -5
  4. package/build/dateInput/DateInput.mjs.map +1 -1
  5. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +3 -5
  6. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  7. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +1 -3
  8. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  9. package/build/index.js +3 -5
  10. package/build/index.js.map +1 -1
  11. package/build/index.mjs +1 -3
  12. package/build/index.mjs.map +1 -1
  13. package/build/inputs/SelectInput.js +821 -0
  14. package/build/inputs/SelectInput.js.map +1 -0
  15. package/build/inputs/SelectInput.messages.js.map +1 -0
  16. package/build/inputs/SelectInput.messages.mjs.map +1 -0
  17. package/build/inputs/SelectInput.mjs +813 -0
  18. package/build/inputs/SelectInput.mjs.map +1 -0
  19. package/build/main.css +47 -47
  20. package/build/moneyInput/MoneyInput.js +2 -5
  21. package/build/moneyInput/MoneyInput.js.map +1 -1
  22. package/build/moneyInput/MoneyInput.mjs +1 -4
  23. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  24. package/build/phoneNumberInput/PhoneNumberInput.js +2 -5
  25. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  26. package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -4
  27. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  28. package/build/styles/main.css +47 -47
  29. package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +7 -4
  30. package/build/types/inputs/SelectInput.d.ts.map +1 -0
  31. package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
  32. package/package.json +1 -1
  33. package/src/actionButton/ActionButton.story.tsx +3 -0
  34. package/src/checkbox/Checkbox.story.tsx +3 -0
  35. package/src/circularButton/CircularButton.story.tsx +3 -0
  36. package/src/common/bottomSheet/BottomSheet.story.tsx +12 -0
  37. package/src/common/circle/Circle.story.tsx +3 -0
  38. package/src/criticalBanner/CriticalCommsBanner.story.tsx +3 -0
  39. package/src/dateInput/DateInput.test.story.tsx +6 -0
  40. package/src/dateLookup/DateLookup.story.tsx +3 -0
  41. package/src/info/Info.story.tsx +6 -0
  42. package/src/inputs/{SelectInput/SelectInput.docs.mdx → SelectInput.docs.mdx} +1 -0
  43. package/src/inputs/SelectInput.less +219 -0
  44. package/src/inputs/{SelectInput/SelectInput.story.tsx → SelectInput.story.tsx} +7 -7
  45. package/src/inputs/SelectInput.tsx +1190 -0
  46. package/src/main.css +47 -47
  47. package/src/main.less +1 -1
  48. package/src/modal/Modal.story.tsx +15 -0
  49. package/src/snackbar/Snackbar.test.story.tsx +9 -0
  50. package/build/inputs/SelectInput/SelectInput.helpers.js +0 -115
  51. package/build/inputs/SelectInput/SelectInput.helpers.js.map +0 -1
  52. package/build/inputs/SelectInput/SelectInput.helpers.mjs +0 -109
  53. package/build/inputs/SelectInput/SelectInput.helpers.mjs.map +0 -1
  54. package/build/inputs/SelectInput/SelectInput.js +0 -216
  55. package/build/inputs/SelectInput/SelectInput.js.map +0 -1
  56. package/build/inputs/SelectInput/SelectInput.messages.js.map +0 -1
  57. package/build/inputs/SelectInput/SelectInput.messages.mjs.map +0 -1
  58. package/build/inputs/SelectInput/SelectInput.mjs +0 -210
  59. package/build/inputs/SelectInput/SelectInput.mjs.map +0 -1
  60. package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.js +0 -26
  61. package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.js.map +0 -1
  62. package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.mjs +0 -24
  63. package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.mjs.map +0 -1
  64. package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.js +0 -54
  65. package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.js.map +0 -1
  66. package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.mjs +0 -52
  67. package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.mjs.map +0 -1
  68. package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js +0 -50
  69. package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js.map +0 -1
  70. package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.mjs +0 -48
  71. package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.mjs.map +0 -1
  72. package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.js +0 -47
  73. package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.js.map +0 -1
  74. package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.mjs +0 -45
  75. package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.mjs.map +0 -1
  76. package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.js +0 -45
  77. package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.js.map +0 -1
  78. package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.mjs +0 -41
  79. package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.mjs.map +0 -1
  80. package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js +0 -41
  81. package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js.map +0 -1
  82. package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.mjs +0 -38
  83. package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.mjs.map +0 -1
  84. package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.js +0 -270
  85. package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.js.map +0 -1
  86. package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.mjs +0 -268
  87. package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.mjs.map +0 -1
  88. package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.js +0 -48
  89. package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.js.map +0 -1
  90. package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.mjs +0 -46
  91. package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.mjs.map +0 -1
  92. package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.js +0 -41
  93. package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.js.map +0 -1
  94. package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.mjs +0 -34
  95. package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.mjs.map +0 -1
  96. package/build/styles/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.css +0 -17
  97. package/build/styles/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.css +0 -16
  98. package/build/styles/inputs/SelectInput/components/SelectInputOption/SelectInputOption.css +0 -33
  99. package/build/styles/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.css +0 -37
  100. package/build/types/inputs/SelectInput/SelectInput.d.ts +0 -3
  101. package/build/types/inputs/SelectInput/SelectInput.d.ts.map +0 -1
  102. package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts +0 -28
  103. package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts.map +0 -1
  104. package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +0 -1
  105. package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +0 -1
  106. package/build/types/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.d.ts +0 -5
  107. package/build/types/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.d.ts.map +0 -1
  108. package/build/types/inputs/SelectInput/components/SelectInputClearButton/index.d.ts +0 -2
  109. package/build/types/inputs/SelectInput/components/SelectInputClearButton/index.d.ts.map +0 -1
  110. package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.d.ts +0 -9
  111. package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.d.ts.map +0 -1
  112. package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/index.d.ts +0 -2
  113. package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/index.d.ts.map +0 -1
  114. package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.d.ts +0 -9
  115. package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
  116. package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/index.d.ts +0 -2
  117. package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/index.d.ts.map +0 -1
  118. package/build/types/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.d.ts +0 -8
  119. package/build/types/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.d.ts.map +0 -1
  120. package/build/types/inputs/SelectInput/components/SelectInputItemView/index.d.ts +0 -2
  121. package/build/types/inputs/SelectInput/components/SelectInputItemView/index.d.ts.map +0 -1
  122. package/build/types/inputs/SelectInput/components/SelectInputOption/SelectInputOption.d.ts +0 -10
  123. package/build/types/inputs/SelectInput/components/SelectInputOption/SelectInputOption.d.ts.map +0 -1
  124. package/build/types/inputs/SelectInput/components/SelectInputOption/index.d.ts +0 -2
  125. package/build/types/inputs/SelectInput/components/SelectInputOption/index.d.ts.map +0 -1
  126. package/build/types/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.d.ts +0 -9
  127. package/build/types/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.d.ts.map +0 -1
  128. package/build/types/inputs/SelectInput/components/SelectInputOptionContent/index.d.ts +0 -3
  129. package/build/types/inputs/SelectInput/components/SelectInputOptionContent/index.d.ts.map +0 -1
  130. package/build/types/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.d.ts +0 -15
  131. package/build/types/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.d.ts.map +0 -1
  132. package/build/types/inputs/SelectInput/components/SelectInputOptions/index.d.ts +0 -2
  133. package/build/types/inputs/SelectInput/components/SelectInputOptions/index.d.ts.map +0 -1
  134. package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.d.ts +0 -6
  135. package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
  136. package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/index.d.ts +0 -2
  137. package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/index.d.ts.map +0 -1
  138. package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.d.ts +0 -15
  139. package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.d.ts.map +0 -1
  140. package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/index.d.ts +0 -3
  141. package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/index.d.ts.map +0 -1
  142. package/build/types/inputs/SelectInput/index.d.ts +0 -5
  143. package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
  144. package/src/inputs/SelectInput/SelectInput.helpers.ts +0 -152
  145. package/src/inputs/SelectInput/SelectInput.less +0 -42
  146. package/src/inputs/SelectInput/SelectInput.test.tsx +0 -606
  147. package/src/inputs/SelectInput/SelectInput.tsx +0 -247
  148. package/src/inputs/SelectInput/SelectInput.types.ts +0 -114
  149. package/src/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.tsx +0 -25
  150. package/src/inputs/SelectInput/components/SelectInputClearButton/index.ts +0 -1
  151. package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.css +0 -17
  152. package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.less +0 -15
  153. package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.tsx +0 -56
  154. package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/index.ts +0 -1
  155. package/src/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.tsx +0 -64
  156. package/src/inputs/SelectInput/components/SelectInputGroupItemView/index.ts +0 -1
  157. package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.css +0 -16
  158. package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.less +0 -17
  159. package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.tsx +0 -55
  160. package/src/inputs/SelectInput/components/SelectInputItemView/index.ts +0 -1
  161. package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.css +0 -33
  162. package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.less +0 -32
  163. package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.tsx +0 -51
  164. package/src/inputs/SelectInput/components/SelectInputOption/index.ts +0 -5
  165. package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.css +0 -37
  166. package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.less +0 -38
  167. package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.tsx +0 -67
  168. package/src/inputs/SelectInput/components/SelectInputOptionContent/index.ts +0 -5
  169. package/src/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.less +0 -75
  170. package/src/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.tsx +0 -369
  171. package/src/inputs/SelectInput/components/SelectInputOptions/index.ts +0 -1
  172. package/src/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.tsx +0 -56
  173. package/src/inputs/SelectInput/components/SelectInputOptionsContainer/index.ts +0 -1
  174. package/src/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.tsx +0 -39
  175. package/src/inputs/SelectInput/components/SelectInputTriggerButton/index.ts +0 -5
  176. package/src/inputs/SelectInput/index.ts +0 -13
  177. package/build/inputs/{SelectInput/SelectInput.messages.js → SelectInput.messages.js} +0 -0
  178. package/build/inputs/{SelectInput/SelectInput.messages.mjs → SelectInput.messages.mjs} +0 -0
  179. package/{src/inputs/SelectInput → build/styles/inputs}/SelectInput.css +47 -47
  180. package/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
  181. package/{build/styles/inputs/SelectInput → src/inputs}/SelectInput.css +47 -47
  182. /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
package/src/main.css CHANGED
@@ -3976,6 +3976,28 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3976
3976
  color: #5d7079;
3977
3977
  color: var(--color-content-secondary);
3978
3978
  }
3979
+ .np-select-input-content {
3980
+ overflow: hidden;
3981
+ text-overflow: ellipsis;
3982
+ white-space: nowrap;
3983
+ }
3984
+ .np-select-input-placeholder {
3985
+ color: #768e9c;
3986
+ color: var(--color-content-tertiary);
3987
+ }
3988
+ .np-select-input-options-container {
3989
+ display: flex;
3990
+ height: 100%;
3991
+ flex-direction: column;
3992
+ }
3993
+ .np-select-input-options-container:focus {
3994
+ outline: none;
3995
+ }
3996
+ @media (min-width: 576px) {
3997
+ .np-select-input-options-container {
3998
+ max-height: 28rem /* 448px */;
3999
+ }
4000
+ }
3979
4001
  .np-select-input-options-status {
3980
4002
  display: flex;
3981
4003
  align-items: center;
@@ -4040,22 +4062,21 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
4040
4062
  contain: strict;
4041
4063
  height: 100%;
4042
4064
  }
4043
- .np-select-input-options-container {
4044
- display: flex;
4045
- height: 100%;
4046
- flex-direction: column;
4047
- }
4048
- .np-select-input-options-container:focus {
4049
- outline: none;
4065
+ .np-select-input-separator-item {
4066
+ margin: 8px;
4067
+ margin: var(--size-8);
4068
+ border-top-width: 1px;
4050
4069
  }
4051
- @media (min-width: 576px) {
4052
- .np-select-input-options-container {
4053
- max-height: 28rem /* 448px */;
4054
- }
4070
+ .np-select-input-group-item--without-needle:first-child {
4071
+ margin-top: calc(-1 * 8px);
4072
+ margin-top: calc(-1 * var(--size-8));
4055
4073
  }
4056
- .np-select-input-footer {
4057
- padding: 4px 24px 16px;
4058
- padding: var(--size-4) var(--size-24) var(--size-16);
4074
+ .np-select-input-group-item-header {
4075
+ position: sticky;
4076
+ top: 0px;
4077
+ z-index: 10;
4078
+ background-color: #ffffff;
4079
+ background-color: var(--color-background-elevated);
4059
4080
  }
4060
4081
  .np-select-input-option-container {
4061
4082
  display: flex;
@@ -4084,27 +4105,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
4084
4105
  .np-select-input-option-container--disabled {
4085
4106
  opacity: 0.45;
4086
4107
  }
4087
- .np-select-input-option {
4088
- flex: 1;
4089
- }
4090
4108
  .np-select-input-option-check--not-selected {
4091
4109
  visibility: hidden;
4092
4110
  }
4093
- .np-select-input-separator-item {
4094
- margin: 8px;
4095
- margin: var(--size-8);
4096
- border-top-width: 1px;
4097
- }
4098
- .np-select-input-group-item--without-needle:first-child {
4099
- margin-top: calc(-1 * 8px);
4100
- margin-top: calc(-1 * var(--size-8));
4101
- }
4102
- .np-select-input-group-item-header {
4103
- position: sticky;
4104
- top: 0px;
4105
- z-index: 10;
4106
- background-color: #ffffff;
4107
- background-color: var(--color-background-elevated);
4111
+ .np-select-input-option {
4112
+ flex: 1;
4108
4113
  }
4109
4114
  .np-select-input-option-content-container {
4110
4115
  display: flex;
@@ -4143,6 +4148,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
4143
4148
  margin-left: 8px;
4144
4149
  margin-left: var(--size-8);
4145
4150
  }
4151
+ .np-select-input-footer {
4152
+ padding: 4px 24px 16px;
4153
+ padding: var(--size-4) var(--size-24) var(--size-16);
4154
+ }
4146
4155
  .np-select-input-addon-container {
4147
4156
  pointer-events: none;
4148
4157
  margin-inline-start: 4px;
@@ -4154,21 +4163,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
4154
4163
  margin-inline-start: 4px;
4155
4164
  margin-inline-start: var(--size-4);
4156
4165
  }
4157
- .np-select-input-addon-separator {
4158
- height: 24px;
4159
- height: var(--size-24);
4160
- border-inline-start: 1px solid rgba(0,0,0,0.10196);
4161
- border-inline-start: 1px solid var(--color-border-neutral);
4162
- }
4163
- .np-select-input-content {
4164
- overflow: hidden;
4165
- text-overflow: ellipsis;
4166
- white-space: nowrap;
4167
- }
4168
- .np-select-input-placeholder {
4169
- color: #768e9c;
4170
- color: var(--color-content-tertiary);
4171
- }
4172
4166
  .np-select-input-addon {
4173
4167
  border-width: 0;
4174
4168
  background: none;
@@ -4198,6 +4192,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
4198
4192
  outline: var(--ring-outline-color) solid var(--ring-outline-width);
4199
4193
  outline-offset: var(--ring-outline-offset);
4200
4194
  }
4195
+ .np-select-input-addon-separator {
4196
+ height: 24px;
4197
+ height: var(--size-24);
4198
+ border-inline-start: 1px solid rgba(0,0,0,0.10196);
4199
+ border-inline-start: 1px solid var(--color-border-neutral);
4200
+ }
4201
4201
  .np-text-area {
4202
4202
  min-height: 72px;
4203
4203
  min-height: var(--size-72);
package/src/main.less CHANGED
@@ -44,7 +44,7 @@
44
44
  @import "./listItem/ListItem.less";
45
45
  @import "./field/Field.less";
46
46
  @import "./inputs/InputGroup.less";
47
- @import "./inputs/SelectInput/SelectInput.less";
47
+ @import "./inputs/SelectInput.less";
48
48
  @import "./inputs/TextArea.less";
49
49
  @import "./instructionsList/InstructionsList.less";
50
50
  @import "./link/Link.less";
@@ -84,6 +84,9 @@ export const BasicMobile: Story = {
84
84
  mobile: allModes.largeMobile,
85
85
  },
86
86
  },
87
+ globals: {
88
+ viewport: 'largeMobile',
89
+ },
87
90
  };
88
91
 
89
92
  export const ContentScroll: Story = {
@@ -103,6 +106,9 @@ export const ContentScrollMobile: Story = {
103
106
  mobile: allModes.largeMobile,
104
107
  },
105
108
  },
109
+ globals: {
110
+ viewport: 'largeMobile',
111
+ },
106
112
  };
107
113
 
108
114
  export const ViewportScroll: Story = {
@@ -122,6 +128,9 @@ export const ViewportScrollMobile: Story = {
122
128
  mobile: allModes.largeMobile,
123
129
  },
124
130
  },
131
+ globals: {
132
+ viewport: 'largeMobile',
133
+ },
125
134
  };
126
135
 
127
136
  export const WithoutTitle: Story = {
@@ -140,6 +149,9 @@ export const WithoutTitleMobile: Story = {
140
149
  mobile: allModes.largeMobile,
141
150
  },
142
151
  },
152
+ globals: {
153
+ viewport: 'largeMobile',
154
+ },
143
155
  };
144
156
 
145
157
  export const WithThemeProviderInContent: Story = {
@@ -167,4 +179,7 @@ export const WithThemeProviderInContentMobile: Story = {
167
179
  mobile: allModes.largeMobile,
168
180
  },
169
181
  },
182
+ globals: {
183
+ viewport: 'largeMobile',
184
+ },
170
185
  };
@@ -121,6 +121,9 @@ export const Mobile = {
121
121
  mobile: allModes.largeMobile,
122
122
  },
123
123
  },
124
+ globals: {
125
+ viewport: 'largeMobile',
126
+ },
124
127
  };
125
128
 
126
129
  const switchToDarkMode = async (context: { canvasElement: HTMLElement }) => {
@@ -230,6 +233,9 @@ export const RTLMobile = {
230
233
  mobile: allModes.largeMobile,
231
234
  },
232
235
  },
236
+ globals: {
237
+ viewport: 'largeMobile',
238
+ },
233
239
  };
234
240
 
235
241
  export const Zoom400 = {
@@ -260,6 +266,9 @@ export const Zoom400 = {
260
266
  zoom400: allModes.zoom400,
261
267
  },
262
268
  },
269
+ globals: {
270
+ viewport: 'zoom400',
271
+ },
263
272
  };
264
273
 
265
274
  export const MultipleClicks = {
@@ -1,115 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Normalises a string for searching by trimming, normalising whitespace,
5
- * removing diacritics, and converting to lowercase.
6
- */
7
- function searchableString(value) {
8
- return value.trim().replace(/\s+/gu, ' ')
9
- // NFD converts an Å to A + ̊ (and other special characters)
10
- .normalize('NFD')
11
- // and then this replaces the ̊ with nothing (and other special characters)
12
- .replace(/[\u0300-\u036f]/g, '').toLowerCase();
13
- }
14
- /**
15
- * Infers searchable strings from a value.
16
- * Extracts string values from objects or returns the string itself.
17
- */
18
- function inferSearchableStrings(value) {
19
- if (typeof value === 'string') {
20
- return [searchableString(value)];
21
- }
22
- if (typeof value === 'object' && value != null) {
23
- return Object.values(value).filter(innerValue => typeof innerValue === 'string').map(innerValue => searchableString(innerValue));
24
- }
25
- return [];
26
- }
27
- /**
28
- * Checks if a select input option item matches the search needle.
29
- */
30
- function selectInputOptionItemIncludesNeedle(item, needle) {
31
- return inferSearchableStrings(item.filterMatchers ?? item.value).some(haystack => haystack.includes(needle));
32
- }
33
- /**
34
- * Deduplicates a single option item by checking against existing values.
35
- * Returns the item with value set to undefined if it's a duplicate.
36
- */
37
- function dedupeSelectInputOptionItem(item, existingValues, compareValues) {
38
- const isDuplicate = compareValues ? Array.from(existingValues).some(existingValue => compareValues(item.value, existingValue)) : existingValues.has(item.value);
39
- if (!isDuplicate) {
40
- existingValues.add(item.value);
41
- return item;
42
- }
43
- return {
44
- ...item,
45
- value: undefined
46
- };
47
- }
48
- /**
49
- * Sets the `value` of duplicate option items to `undefined`, hiding them when
50
- * rendered. Indexes are kept intact within groups to preserve the active item
51
- * between filter changes when possible.
52
- */
53
- function dedupeSelectInputItems(items, compareValues) {
54
- const existingValues = new Set();
55
- return items.map(item => {
56
- switch (item.type) {
57
- case 'option':
58
- {
59
- return dedupeSelectInputOptionItem(item, existingValues, compareValues);
60
- }
61
- case 'group':
62
- {
63
- return {
64
- ...item,
65
- options: item.options.map(option => dedupeSelectInputOptionItem(option, existingValues, compareValues))
66
- };
67
- }
68
- }
69
- return item;
70
- });
71
- }
72
- /**
73
- * Filters select input items based on a predicate function.
74
- * Groups are included if at least one option matches the predicate.
75
- */
76
- function filterSelectInputItems(items, predicate) {
77
- return items.filter(item => {
78
- switch (item.type) {
79
- case 'option':
80
- {
81
- return predicate(item);
82
- }
83
- case 'group':
84
- {
85
- return item.options.some(option => predicate(option));
86
- }
87
- }
88
- return false;
89
- });
90
- }
91
- /**
92
- * Flattens and sorts filtered options using the provided comparator.
93
- * Extracts all options from groups, filters out undefined values (deduplicated items),
94
- * sorts them, and returns as a flat list of option items.
95
- */
96
- function sortSelectInputItems(items, compareFn, searchQuery) {
97
- const flattenedOption = items.flatMap(item => {
98
- if (item.type === 'option') {
99
- return item.value !== undefined ? [item] : [];
100
- }
101
- if (item.type === 'group') {
102
- return item.options.filter(option => option.value !== undefined);
103
- }
104
- return [];
105
- });
106
- // eslint-disable-next-line functional/immutable-data
107
- return flattenedOption.sort((a, b) => compareFn(a, b, searchQuery));
108
- }
109
-
110
- exports.dedupeSelectInputItems = dedupeSelectInputItems;
111
- exports.filterSelectInputItems = filterSelectInputItems;
112
- exports.searchableString = searchableString;
113
- exports.selectInputOptionItemIncludesNeedle = selectInputOptionItemIncludesNeedle;
114
- exports.sortSelectInputItems = sortSelectInputItems;
115
- //# sourceMappingURL=SelectInput.helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInput.helpers.js","sources":["../../../src/inputs/SelectInput/SelectInput.helpers.ts"],"sourcesContent":["import type { SelectInputOptionItem, SelectInputItem } from './SelectInput.types';\n\n/**\n * Normalises a string for searching by trimming, normalising whitespace,\n * removing diacritics, and converting to lowercase.\n */\nexport function searchableString(value: string) {\n return (\n value\n .trim()\n .replace(/\\s+/gu, ' ')\n // NFD converts an Å to A + ̊ (and other special characters)\n .normalize('NFD')\n // and then this replaces the ̊ with nothing (and other special characters)\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n );\n}\n\n/**\n * Infers searchable strings from a value.\n * Extracts string values from objects or returns the string itself.\n */\nfunction inferSearchableStrings(value: unknown) {\n if (typeof value === 'string') {\n return [searchableString(value)];\n }\n\n if (typeof value === 'object' && value != null) {\n return Object.values(value)\n .filter((innerValue) => typeof innerValue === 'string')\n .map((innerValue) => searchableString(innerValue));\n }\n\n return [];\n}\n\n/**\n * Checks if a select input option item matches the search needle.\n */\nexport function selectInputOptionItemIncludesNeedle<T>(\n item: SelectInputOptionItem<T>,\n needle: string,\n) {\n return inferSearchableStrings(item.filterMatchers ?? item.value).some((haystack) =>\n haystack.includes(needle),\n );\n}\n\n/**\n * Deduplicates a single option item by checking against existing values.\n * Returns the item with value set to undefined if it's a duplicate.\n */\nfunction dedupeSelectInputOptionItem<T>(\n item: SelectInputOptionItem<T>,\n existingValues: Set<T>,\n compareValues?: (a: T, b: T) => boolean,\n): SelectInputOptionItem<T | undefined> {\n const isDuplicate = compareValues\n ? Array.from(existingValues).some((existingValue) => compareValues(item.value, existingValue))\n : existingValues.has(item.value);\n\n if (!isDuplicate) {\n existingValues.add(item.value);\n return item;\n }\n return { ...item, value: undefined };\n}\n\n/**\n * Sets the `value` of duplicate option items to `undefined`, hiding them when\n * rendered. Indexes are kept intact within groups to preserve the active item\n * between filter changes when possible.\n */\nexport function dedupeSelectInputItems<T>(\n items: readonly SelectInputItem<T>[],\n compareValues?: (a: T, b: T) => boolean,\n): SelectInputItem<T | undefined>[] {\n const existingValues = new Set<T>();\n\n return items.map((item) => {\n switch (item.type) {\n case 'option': {\n return dedupeSelectInputOptionItem(item, existingValues, compareValues);\n }\n case 'group': {\n return {\n ...item,\n options: item.options.map((option) =>\n dedupeSelectInputOptionItem(option, existingValues, compareValues),\n ),\n };\n }\n default:\n }\n return item;\n });\n}\n\n/**\n * Filters select input items based on a predicate function.\n * Groups are included if at least one option matches the predicate.\n */\nexport function filterSelectInputItems<T>(\n items: readonly SelectInputItem<T>[],\n predicate: (item: SelectInputOptionItem<T>) => boolean,\n) {\n return items.filter((item) => {\n switch (item.type) {\n case 'option': {\n return predicate(item);\n }\n case 'group': {\n return item.options.some((option) => predicate(option));\n }\n default:\n }\n return false;\n });\n}\n\n/**\n * Flattens and sorts filtered options using the provided comparator.\n * Extracts all options from groups, filters out undefined values (deduplicated items),\n * sorts them, and returns as a flat list of option items.\n */\nexport function sortSelectInputItems<T>(\n items: readonly SelectInputItem<T | undefined>[],\n compareFn: (\n a: SelectInputOptionItem<NonNullable<T>>,\n b: SelectInputOptionItem<NonNullable<T>>,\n searchQuery: string,\n ) => number,\n searchQuery: string,\n): SelectInputItem<NonNullable<T>>[] {\n const flattenedOption = items.flatMap((item) => {\n if (item.type === 'option') {\n return item.value !== undefined ? [item as SelectInputOptionItem<NonNullable<T>>] : [];\n }\n\n if (item.type === 'group') {\n return item.options.filter(\n (option): option is SelectInputOptionItem<NonNullable<T>> => option.value !== undefined,\n );\n }\n\n return [];\n });\n\n // eslint-disable-next-line functional/immutable-data\n return flattenedOption.sort((a, b) => compareFn(a, b, searchQuery));\n}\n"],"names":["searchableString","value","trim","replace","normalize","toLowerCase","inferSearchableStrings","Object","values","filter","innerValue","map","selectInputOptionItemIncludesNeedle","item","needle","filterMatchers","some","haystack","includes","dedupeSelectInputOptionItem","existingValues","compareValues","isDuplicate","Array","from","existingValue","has","add","undefined","dedupeSelectInputItems","items","Set","type","options","option","filterSelectInputItems","predicate","sortSelectInputItems","compareFn","searchQuery","flattenedOption","flatMap","sort","a","b"],"mappings":";;AAEA;;;AAGG;AACG,SAAUA,gBAAgBA,CAACC,KAAa,EAAA;EAC5C,OACEA,KAAK,CACFC,IAAI,EAAE,CACNC,OAAO,CAAC,OAAO,EAAE,GAAG;AACrB;GACCC,SAAS,CAAC,KAAK;AAChB;GACCD,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAC/BE,WAAW,EAAE;AAEpB;AAEA;;;AAG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AIA,IAAI,CAACmB,IAAI,KAAK,QAAQ,EAAE;MAC1B,OAAOnB,IAAI,CAACZ,KAAK,KAAK2B,SAAS,GAAG,CAACf,IAA6C,CAAC,GAAG,EAAE;AACxF,IAAA;AAEA,IAAA,IAAIA,IAAI,CAACmB,IAAI,KAAK,OAAO,EAAE;AACzB,MAAA,OAAOnB,IAAI,CAACoB,OAAO,CAACxB,MAAM,CACvByB,MAAM,IAAsDA,MAAM,CAACjC,KAAK,KAAK2B,SAAS,CACxF;AACH,IAAA;AAEA,IAAA,OAAO,EAAE;AACX,EAAA,CAAC,CAAC;AAEF;AACA,EAAA,OAAOY,eAAe,CAACE,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKN,SAAS,CAACK,CAAC,EAAEC,CAAC,EAAEL,WAAW,CAAC,CAAC;AACrE;;;;;;;;"}
@@ -1,109 +0,0 @@
1
- /**
2
- * Normalises a string for searching by trimming, normalising whitespace,
3
- * removing diacritics, and converting to lowercase.
4
- */
5
- function searchableString(value) {
6
- return value.trim().replace(/\s+/gu, ' ')
7
- // NFD converts an Å to A + ̊ (and other special characters)
8
- .normalize('NFD')
9
- // and then this replaces the ̊ with nothing (and other special characters)
10
- .replace(/[\u0300-\u036f]/g, '').toLowerCase();
11
- }
12
- /**
13
- * Infers searchable strings from a value.
14
- * Extracts string values from objects or returns the string itself.
15
- */
16
- function inferSearchableStrings(value) {
17
- if (typeof value === 'string') {
18
- return [searchableString(value)];
19
- }
20
- if (typeof value === 'object' && value != null) {
21
- return Object.values(value).filter(innerValue => typeof innerValue === 'string').map(innerValue => searchableString(innerValue));
22
- }
23
- return [];
24
- }
25
- /**
26
- * Checks if a select input option item matches the search needle.
27
- */
28
- function selectInputOptionItemIncludesNeedle(item, needle) {
29
- return inferSearchableStrings(item.filterMatchers ?? item.value).some(haystack => haystack.includes(needle));
30
- }
31
- /**
32
- * Deduplicates a single option item by checking against existing values.
33
- * Returns the item with value set to undefined if it's a duplicate.
34
- */
35
- function dedupeSelectInputOptionItem(item, existingValues, compareValues) {
36
- const isDuplicate = compareValues ? Array.from(existingValues).some(existingValue => compareValues(item.value, existingValue)) : existingValues.has(item.value);
37
- if (!isDuplicate) {
38
- existingValues.add(item.value);
39
- return item;
40
- }
41
- return {
42
- ...item,
43
- value: undefined
44
- };
45
- }
46
- /**
47
- * Sets the `value` of duplicate option items to `undefined`, hiding them when
48
- * rendered. Indexes are kept intact within groups to preserve the active item
49
- * between filter changes when possible.
50
- */
51
- function dedupeSelectInputItems(items, compareValues) {
52
- const existingValues = new Set();
53
- return items.map(item => {
54
- switch (item.type) {
55
- case 'option':
56
- {
57
- return dedupeSelectInputOptionItem(item, existingValues, compareValues);
58
- }
59
- case 'group':
60
- {
61
- return {
62
- ...item,
63
- options: item.options.map(option => dedupeSelectInputOptionItem(option, existingValues, compareValues))
64
- };
65
- }
66
- }
67
- return item;
68
- });
69
- }
70
- /**
71
- * Filters select input items based on a predicate function.
72
- * Groups are included if at least one option matches the predicate.
73
- */
74
- function filterSelectInputItems(items, predicate) {
75
- return items.filter(item => {
76
- switch (item.type) {
77
- case 'option':
78
- {
79
- return predicate(item);
80
- }
81
- case 'group':
82
- {
83
- return item.options.some(option => predicate(option));
84
- }
85
- }
86
- return false;
87
- });
88
- }
89
- /**
90
- * Flattens and sorts filtered options using the provided comparator.
91
- * Extracts all options from groups, filters out undefined values (deduplicated items),
92
- * sorts them, and returns as a flat list of option items.
93
- */
94
- function sortSelectInputItems(items, compareFn, searchQuery) {
95
- const flattenedOption = items.flatMap(item => {
96
- if (item.type === 'option') {
97
- return item.value !== undefined ? [item] : [];
98
- }
99
- if (item.type === 'group') {
100
- return item.options.filter(option => option.value !== undefined);
101
- }
102
- return [];
103
- });
104
- // eslint-disable-next-line functional/immutable-data
105
- return flattenedOption.sort((a, b) => compareFn(a, b, searchQuery));
106
- }
107
-
108
- export { dedupeSelectInputItems, filterSelectInputItems, searchableString, selectInputOptionItemIncludesNeedle, sortSelectInputItems };
109
- //# sourceMappingURL=SelectInput.helpers.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInput.helpers.mjs","sources":["../../../src/inputs/SelectInput/SelectInput.helpers.ts"],"sourcesContent":["import type { SelectInputOptionItem, SelectInputItem } from './SelectInput.types';\n\n/**\n * Normalises a string for searching by trimming, normalising whitespace,\n * removing diacritics, and converting to lowercase.\n */\nexport function searchableString(value: string) {\n return (\n value\n .trim()\n .replace(/\\s+/gu, ' ')\n // NFD converts an Å to A + ̊ (and other special characters)\n .normalize('NFD')\n // and then this replaces the ̊ with nothing (and other special characters)\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n );\n}\n\n/**\n * Infers searchable strings from a value.\n * Extracts string values from objects or returns the string itself.\n */\nfunction inferSearchableStrings(value: unknown) {\n if (typeof value === 'string') {\n return [searchableString(value)];\n }\n\n if (typeof value === 'object' && value != null) {\n return Object.values(value)\n .filter((innerValue) => typeof innerValue === 'string')\n .map((innerValue) => searchableString(innerValue));\n }\n\n return [];\n}\n\n/**\n * Checks if a select input option item matches the search needle.\n */\nexport function selectInputOptionItemIncludesNeedle<T>(\n item: SelectInputOptionItem<T>,\n needle: string,\n) {\n return inferSearchableStrings(item.filterMatchers ?? item.value).some((haystack) =>\n haystack.includes(needle),\n );\n}\n\n/**\n * Deduplicates a single option item by checking against existing values.\n * Returns the item with value set to undefined if it's a duplicate.\n */\nfunction dedupeSelectInputOptionItem<T>(\n item: SelectInputOptionItem<T>,\n existingValues: Set<T>,\n compareValues?: (a: T, b: T) => boolean,\n): SelectInputOptionItem<T | undefined> {\n const isDuplicate = compareValues\n ? Array.from(existingValues).some((existingValue) => compareValues(item.value, existingValue))\n : existingValues.has(item.value);\n\n if (!isDuplicate) {\n existingValues.add(item.value);\n return item;\n }\n return { ...item, value: undefined };\n}\n\n/**\n * Sets the `value` of duplicate option items to `undefined`, hiding them when\n * rendered. Indexes are kept intact within groups to preserve the active item\n * between filter changes when possible.\n */\nexport function dedupeSelectInputItems<T>(\n items: readonly SelectInputItem<T>[],\n compareValues?: (a: T, b: T) => boolean,\n): SelectInputItem<T | undefined>[] {\n const existingValues = new Set<T>();\n\n return items.map((item) => {\n switch (item.type) {\n case 'option': {\n return dedupeSelectInputOptionItem(item, existingValues, compareValues);\n }\n case 'group': {\n return {\n ...item,\n options: item.options.map((option) =>\n dedupeSelectInputOptionItem(option, existingValues, compareValues),\n ),\n };\n }\n default:\n }\n return item;\n });\n}\n\n/**\n * Filters select input items based on a predicate function.\n * Groups are included if at least one option matches the predicate.\n */\nexport function filterSelectInputItems<T>(\n items: readonly SelectInputItem<T>[],\n predicate: (item: SelectInputOptionItem<T>) => boolean,\n) {\n return items.filter((item) => {\n switch (item.type) {\n case 'option': {\n return predicate(item);\n }\n case 'group': {\n return item.options.some((option) => predicate(option));\n }\n default:\n }\n return false;\n });\n}\n\n/**\n * Flattens and sorts filtered options using the provided comparator.\n * Extracts all options from groups, filters out undefined values (deduplicated items),\n * sorts them, and returns as a flat list of option items.\n */\nexport function sortSelectInputItems<T>(\n items: readonly SelectInputItem<T | undefined>[],\n compareFn: (\n a: SelectInputOptionItem<NonNullable<T>>,\n b: SelectInputOptionItem<NonNullable<T>>,\n searchQuery: string,\n ) => number,\n searchQuery: string,\n): SelectInputItem<NonNullable<T>>[] {\n const flattenedOption = items.flatMap((item) => {\n if (item.type === 'option') {\n return item.value !== undefined ? [item as SelectInputOptionItem<NonNullable<T>>] : [];\n }\n\n if (item.type === 'group') {\n return item.options.filter(\n (option): option is SelectInputOptionItem<NonNullable<T>> => option.value !== undefined,\n );\n }\n\n return [];\n });\n\n // eslint-disable-next-line functional/immutable-data\n return flattenedOption.sort((a, b) => compareFn(a, b, searchQuery));\n}\n"],"names":["searchableString","value","trim","replace","normalize","toLowerCase","inferSearchableStrings","Object","values","filter","innerValue","map","selectInputOptionItemIncludesNeedle","item","needle","filterMatchers","some","haystack","includes","dedupeSelectInputOptionItem","existingValues","compareValues","isDuplicate","Array","from","existingValue","has","add","undefined","dedupeSelectInputItems","items","Set","type","options","option","filterSelectInputItems","predicate","sortSelectInputItems","compareFn","searchQuery","flattenedOption","flatMap","sort","a","b"],"mappings":"AAEA;;;AAGG;AACG,SAAUA,gBAAgBA,CAACC,KAAa,EAAA;EAC5C,OACEA,KAAK,CACFC,IAAI,EAAE,CACNC,OAAO,CAAC,OAAO,EAAE,GAAG;AACrB;GACCC,SAAS,CAAC,KAAK;AAChB;GACCD,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAC/BE,WAAW,EAAE;AAEpB;AAEA;;;AAGG;AACH,SAASC,sBAAsBA,CAACL,KAAc,EAAA;AAC5C,EAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;AAC7B,IAAA,OAAO,CAACD,gBAAgB,CAACC,KAAK,CAAC,CAAC;AAClC,EAAA;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,IAAI,IAAI,EAAE;IAC9C,OAAOM,MAAM,CAACC,MAAM,CAACP,KAAK,CAAC,CACxBQ,MAAM,CAAEC,UAAU,IAAK,OAAOA,UAAU,KAAK,QAAQ,CAAC,CACtDC,GAAG,CAAED,UAAU,IAAKV,gBAAgB,CAACU,UAAU,CAAC,CAAC;AACtD,EAAA;AAEA,EAAA,OAAO,EAAE;AACX;AAEA;;AAEG;AACG,SAAUE,mCAAmCA,CACjDC,IAA8B,EAC9BC,MAAc,EAAA;EAEd,OAAOR,sBAAsB,CAACO,IAAI,CAACE,cAAc,IAAIF,IAAI,CAACZ,KAAK,CAAC,CAACe,IAAI,CAAEC,QAAQ,IAC7EA,QAAQ,CAACC,QAAQ,CAACJ,MAAM,CAAC,CAC1B;AACH;AAEA;;;AAGG;AACH,SAASK,2BAA2BA,CAClCN,IAA8B,EAC9BO,cAAsB,EACtBC,aAAuC,EAAA;AAEvC,EAAA,MAAMC,WAAW,GAAGD,aAAa,GAC7BE,KAAK,CAACC,IAAI,CAACJ,cAAc,CAAC,CAACJ,IAAI,CAAES,aAAa,IAA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