@transferwise/components 0.0.0-experimental-a9ab536 → 0.0.0-experimental-74c86e4

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 (233) hide show
  1. package/build/dateInput/DateInput.js +5 -12
  2. package/build/dateInput/DateInput.js.map +1 -1
  3. package/build/dateInput/DateInput.mjs +4 -11
  4. package/build/dateInput/DateInput.mjs.map +1 -1
  5. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +8 -16
  6. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  7. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +6 -14
  8. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  9. package/build/index.js +7 -14
  10. package/build/index.js.map +1 -1
  11. package/build/index.mjs +3 -10
  12. package/build/index.mjs.map +1 -1
  13. package/build/inputs/SelectInput.js +890 -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 +881 -0
  18. package/build/inputs/SelectInput.mjs.map +1 -0
  19. package/build/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.js → _BottomSheet.js} +7 -7
  20. package/build/inputs/_BottomSheet.js.map +1 -0
  21. package/build/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.mjs → _BottomSheet.mjs} +7 -7
  22. package/build/inputs/_BottomSheet.mjs.map +1 -0
  23. package/build/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.js → _ButtonInput.js} +5 -5
  24. package/build/inputs/_ButtonInput.js.map +1 -0
  25. package/build/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.mjs → _ButtonInput.mjs} +5 -5
  26. package/build/inputs/_ButtonInput.mjs.map +1 -0
  27. package/build/inputs/{SelectInput/Popover/SelectInputPopover.js → _Popover.js} +4 -4
  28. package/build/inputs/_Popover.js.map +1 -0
  29. package/build/inputs/{SelectInput/Popover/SelectInputPopover.mjs → _Popover.mjs} +4 -4
  30. package/build/inputs/_Popover.mjs.map +1 -0
  31. package/build/main.css +90 -90
  32. package/build/moneyInput/MoneyInput.js +2 -9
  33. package/build/moneyInput/MoneyInput.js.map +1 -1
  34. package/build/moneyInput/MoneyInput.mjs +1 -8
  35. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  36. package/build/phoneNumberInput/PhoneNumberInput.js +3 -10
  37. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  38. package/build/phoneNumberInput/PhoneNumberInput.mjs +2 -9
  39. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  40. package/build/styles/main.css +90 -90
  41. package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +38 -12
  42. package/build/types/inputs/SelectInput.d.ts.map +1 -0
  43. package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
  44. package/build/types/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.d.ts → _BottomSheet.d.ts} +3 -3
  45. package/build/types/inputs/_BottomSheet.d.ts.map +1 -0
  46. package/build/types/inputs/_ButtonInput.d.ts +5 -0
  47. package/build/types/inputs/_ButtonInput.d.ts.map +1 -0
  48. package/build/types/inputs/{SelectInput/Popover/SelectInputPopover.d.ts → _Popover.d.ts} +3 -3
  49. package/build/types/inputs/_Popover.d.ts.map +1 -0
  50. package/package.json +1 -1
  51. package/src/inputs/{SelectInput/_stories/SelectInput.docs.mdx → SelectInput.docs.mdx} +1 -0
  52. package/src/inputs/SelectInput.less +219 -0
  53. package/src/inputs/{SelectInput/_stories/SelectInput.story.tsx → SelectInput.story.tsx} +8 -11
  54. package/src/inputs/{SelectInput/_stories/SelectInput.test.story.tsx → SelectInput.test.story.tsx} +10 -5
  55. package/src/inputs/{SelectInput/SelectInput.test.tsx → SelectInput.test.tsx} +11 -9
  56. package/src/inputs/SelectInput.tsx +1269 -0
  57. package/src/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.tsx → _BottomSheet.tsx} +7 -7
  58. package/src/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.tsx → _ButtonInput.tsx} +5 -5
  59. package/src/inputs/{SelectInput/Popover/SelectInputPopover.tsx → _Popover.tsx} +4 -4
  60. package/src/main.css +90 -90
  61. package/src/main.less +1 -1
  62. package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +0 -1
  63. package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +0 -1
  64. package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.js.map +0 -1
  65. package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.mjs.map +0 -1
  66. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js +0 -27
  67. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js.map +0 -1
  68. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs +0 -25
  69. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs.map +0 -1
  70. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js +0 -59
  71. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js.map +0 -1
  72. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs +0 -56
  73. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs.map +0 -1
  74. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js +0 -50
  75. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js.map +0 -1
  76. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs +0 -48
  77. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs.map +0 -1
  78. package/build/inputs/SelectInput/ItemView/SelectInputItemView.js +0 -47
  79. package/build/inputs/SelectInput/ItemView/SelectInputItemView.js.map +0 -1
  80. package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs +0 -45
  81. package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs.map +0 -1
  82. package/build/inputs/SelectInput/Option/SelectInputOption.js +0 -42
  83. package/build/inputs/SelectInput/Option/SelectInputOption.js.map +0 -1
  84. package/build/inputs/SelectInput/Option/SelectInputOption.mjs +0 -40
  85. package/build/inputs/SelectInput/Option/SelectInputOption.mjs.map +0 -1
  86. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js +0 -40
  87. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +0 -1
  88. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +0 -38
  89. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +0 -1
  90. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js +0 -48
  91. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js.map +0 -1
  92. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs +0 -46
  93. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs.map +0 -1
  94. package/build/inputs/SelectInput/Options/SelectInputOptions.js +0 -300
  95. package/build/inputs/SelectInput/Options/SelectInputOptions.js.map +0 -1
  96. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs +0 -298
  97. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs.map +0 -1
  98. package/build/inputs/SelectInput/Popover/SelectInputPopover.js.map +0 -1
  99. package/build/inputs/SelectInput/Popover/SelectInputPopover.mjs.map +0 -1
  100. package/build/inputs/SelectInput/SelectInput.contexts.js +0 -29
  101. package/build/inputs/SelectInput/SelectInput.contexts.js.map +0 -1
  102. package/build/inputs/SelectInput/SelectInput.contexts.mjs +0 -24
  103. package/build/inputs/SelectInput/SelectInput.contexts.mjs.map +0 -1
  104. package/build/inputs/SelectInput/SelectInput.js +0 -222
  105. package/build/inputs/SelectInput/SelectInput.js.map +0 -1
  106. package/build/inputs/SelectInput/SelectInput.messages.js.map +0 -1
  107. package/build/inputs/SelectInput/SelectInput.messages.mjs.map +0 -1
  108. package/build/inputs/SelectInput/SelectInput.mjs +0 -216
  109. package/build/inputs/SelectInput/SelectInput.mjs.map +0 -1
  110. package/build/inputs/SelectInput/SelectInput.utils.js +0 -164
  111. package/build/inputs/SelectInput/SelectInput.utils.js.map +0 -1
  112. package/build/inputs/SelectInput/SelectInput.utils.mjs +0 -154
  113. package/build/inputs/SelectInput/SelectInput.utils.mjs.map +0 -1
  114. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js +0 -43
  115. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +0 -1
  116. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs +0 -37
  117. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +0 -1
  118. package/build/styles/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +0 -96
  119. package/build/styles/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +0 -16
  120. package/build/styles/inputs/SelectInput/ClearButton/SelectInputClearButton.css +0 -46
  121. package/build/styles/inputs/SelectInput/ItemView/SelectInputItemView.css +0 -16
  122. package/build/styles/inputs/SelectInput/Option/SelectInputOption.css +0 -33
  123. package/build/styles/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
  124. package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +0 -81
  125. package/build/styles/inputs/SelectInput/Popover/SelectInputPopover.css +0 -46
  126. package/build/types/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.d.ts.map +0 -1
  127. package/build/types/inputs/SelectInput/BottomSheet/index.d.ts +0 -3
  128. package/build/types/inputs/SelectInput/BottomSheet/index.d.ts.map +0 -1
  129. package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts +0 -5
  130. package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts.map +0 -1
  131. package/build/types/inputs/SelectInput/ButtonInput/index.d.ts +0 -3
  132. package/build/types/inputs/SelectInput/ButtonInput/index.d.ts.map +0 -1
  133. package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts +0 -7
  134. package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts.map +0 -1
  135. package/build/types/inputs/SelectInput/ClearButton/index.d.ts +0 -3
  136. package/build/types/inputs/SelectInput/ClearButton/index.d.ts.map +0 -1
  137. package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts +0 -16
  138. package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts.map +0 -1
  139. package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts +0 -2
  140. package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts.map +0 -1
  141. package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts +0 -12
  142. package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
  143. package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts +0 -3
  144. package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts.map +0 -1
  145. package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts +0 -14
  146. package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts.map +0 -1
  147. package/build/types/inputs/SelectInput/ItemView/index.d.ts +0 -4
  148. package/build/types/inputs/SelectInput/ItemView/index.d.ts.map +0 -1
  149. package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts +0 -14
  150. package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts.map +0 -1
  151. package/build/types/inputs/SelectInput/Option/index.d.ts +0 -3
  152. package/build/types/inputs/SelectInput/Option/index.d.ts.map +0 -1
  153. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +0 -16
  154. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts.map +0 -1
  155. package/build/types/inputs/SelectInput/OptionContent/index.d.ts +0 -3
  156. package/build/types/inputs/SelectInput/OptionContent/index.d.ts.map +0 -1
  157. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts +0 -12
  158. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
  159. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts +0 -3
  160. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts.map +0 -1
  161. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts +0 -21
  162. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts.map +0 -1
  163. package/build/types/inputs/SelectInput/Options/index.d.ts +0 -4
  164. package/build/types/inputs/SelectInput/Options/index.d.ts.map +0 -1
  165. package/build/types/inputs/SelectInput/Popover/SelectInputPopover.d.ts.map +0 -1
  166. package/build/types/inputs/SelectInput/Popover/index.d.ts +0 -3
  167. package/build/types/inputs/SelectInput/Popover/index.d.ts.map +0 -1
  168. package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts +0 -33
  169. package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts.map +0 -1
  170. package/build/types/inputs/SelectInput/SelectInput.d.ts +0 -10
  171. package/build/types/inputs/SelectInput/SelectInput.d.ts.map +0 -1
  172. package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +0 -1
  173. package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +0 -1
  174. package/build/types/inputs/SelectInput/SelectInput.utils.d.ts +0 -61
  175. package/build/types/inputs/SelectInput/SelectInput.utils.d.ts.map +0 -1
  176. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts +0 -18
  177. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts.map +0 -1
  178. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts +0 -3
  179. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts.map +0 -1
  180. package/build/types/inputs/SelectInput/components.d.ts +0 -10
  181. package/build/types/inputs/SelectInput/components.d.ts.map +0 -1
  182. package/build/types/inputs/SelectInput/index.d.ts +0 -12
  183. package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
  184. package/src/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +0 -96
  185. package/src/inputs/SelectInput/BottomSheet/index.ts +0 -2
  186. package/src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +0 -16
  187. package/src/inputs/SelectInput/ButtonInput/index.ts +0 -2
  188. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.css +0 -46
  189. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.less +0 -40
  190. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.tsx +0 -29
  191. package/src/inputs/SelectInput/ClearButton/index.ts +0 -2
  192. package/src/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.tsx +0 -74
  193. package/src/inputs/SelectInput/DefaultRenderTrigger/index.ts +0 -5
  194. package/src/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.tsx +0 -64
  195. package/src/inputs/SelectInput/ItemView/GroupItemView/index.ts +0 -2
  196. package/src/inputs/SelectInput/ItemView/SelectInputItemView.css +0 -16
  197. package/src/inputs/SelectInput/ItemView/SelectInputItemView.less +0 -17
  198. package/src/inputs/SelectInput/ItemView/SelectInputItemView.tsx +0 -51
  199. package/src/inputs/SelectInput/ItemView/index.ts +0 -3
  200. package/src/inputs/SelectInput/Option/SelectInputOption.css +0 -33
  201. package/src/inputs/SelectInput/Option/SelectInputOption.less +0 -32
  202. package/src/inputs/SelectInput/Option/SelectInputOption.tsx +0 -60
  203. package/src/inputs/SelectInput/Option/index.ts +0 -2
  204. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
  205. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.less +0 -38
  206. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +0 -75
  207. package/src/inputs/SelectInput/OptionContent/index.ts +0 -2
  208. package/src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx +0 -62
  209. package/src/inputs/SelectInput/Options/OptionsContainer/index.ts +0 -2
  210. package/src/inputs/SelectInput/Options/SelectInputOptions.css +0 -81
  211. package/src/inputs/SelectInput/Options/SelectInputOptions.less +0 -77
  212. package/src/inputs/SelectInput/Options/SelectInputOptions.tsx +0 -418
  213. package/src/inputs/SelectInput/Options/index.ts +0 -3
  214. package/src/inputs/SelectInput/Popover/SelectInputPopover.css +0 -46
  215. package/src/inputs/SelectInput/Popover/index.ts +0 -2
  216. package/src/inputs/SelectInput/SelectInput.contexts.tsx +0 -40
  217. package/src/inputs/SelectInput/SelectInput.less +0 -22
  218. package/src/inputs/SelectInput/SelectInput.tsx +0 -258
  219. package/src/inputs/SelectInput/SelectInput.types.ts +0 -113
  220. package/src/inputs/SelectInput/SelectInput.utils.ts +0 -206
  221. package/src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +0 -44
  222. package/src/inputs/SelectInput/TriggerButton/index.ts +0 -5
  223. package/src/inputs/SelectInput/components.ts +0 -10
  224. package/src/inputs/SelectInput/index.ts +0 -14
  225. package/build/inputs/{SelectInput/SelectInput.messages.js → SelectInput.messages.js} +0 -0
  226. package/build/inputs/{SelectInput/SelectInput.messages.mjs → SelectInput.messages.mjs} +0 -0
  227. package/{src/inputs/SelectInput → build/styles/inputs}/SelectInput.css +90 -90
  228. package/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
  229. package/{build/styles/inputs/SelectInput → src/inputs}/SelectInput.css +90 -90
  230. /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
  231. /package/src/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.less → _BottomSheet.less} +0 -0
  232. /package/src/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.less → _ButtonInput.less} +0 -0
  233. /package/src/inputs/{SelectInput/Popover/SelectInputPopover.less → _Popover.less} +0 -0
@@ -12,12 +12,12 @@ import { ThemeProvider, useTheme } from '@wise/components-theming';
12
12
  import { clsx } from 'clsx';
13
13
  import { Fragment, useState } from 'react';
14
14
 
15
- import { CloseButton } from '../../../common/closeButton';
16
- import { useVirtualKeyboard } from '../../../common/hooks/useVirtualKeyboard';
17
- import { PreventScroll } from '../../../common/preventScroll/PreventScroll';
18
- import { Size } from '../../../common/propsValues/size';
15
+ import { CloseButton } from '../common/closeButton';
16
+ import { useVirtualKeyboard } from '../common/hooks/useVirtualKeyboard';
17
+ import { PreventScroll } from '../common/preventScroll/PreventScroll';
18
+ import { Size } from '../common/propsValues/size';
19
19
 
20
- export interface SelectInputBottomSheetProps {
20
+ export interface BottomSheetProps {
21
21
  open: boolean;
22
22
  renderTrigger?: (args: {
23
23
  ref: React.RefCallback<Element>;
@@ -33,7 +33,7 @@ export interface SelectInputBottomSheetProps {
33
33
  onCloseEnd?: () => void;
34
34
  }
35
35
 
36
- export function SelectInputBottomSheet({
36
+ export function BottomSheet({
37
37
  open,
38
38
  renderTrigger,
39
39
  title,
@@ -42,7 +42,7 @@ export function SelectInputBottomSheet({
42
42
  children,
43
43
  onClose,
44
44
  onCloseEnd,
45
- }: SelectInputBottomSheetProps) {
45
+ }: BottomSheetProps) {
46
46
  useVirtualKeyboard(open);
47
47
 
48
48
  const { refs, context } = useFloating<Element>({
@@ -1,15 +1,15 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { forwardRef } from 'react';
3
3
 
4
- import { useInputPaddings } from '../../InputGroup';
5
- import { inputClassNameBase } from '../../_common';
4
+ import { useInputPaddings } from './InputGroup';
5
+ import { inputClassNameBase } from './_common';
6
6
 
7
- export interface SelectInputButtonInputProps extends React.ComponentPropsWithRef<'button'> {
7
+ export interface ButtonInputProps extends React.ComponentPropsWithRef<'button'> {
8
8
  size?: 'sm' | 'md' | 'lg';
9
9
  }
10
10
 
11
- export const SelectInputButtonInput = forwardRef(function ButtonInput(
12
- { size = 'md', className, style, ...restProps }: SelectInputButtonInputProps,
11
+ export const ButtonInput = forwardRef(function ButtonInput(
12
+ { size = 'md', className, style, ...restProps }: ButtonInputProps,
13
13
  ref: React.ForwardedRef<HTMLButtonElement | null>,
14
14
  ) {
15
15
  const inputPaddings = useInputPaddings();
@@ -18,9 +18,9 @@ import { ThemeProvider, useTheme } from '@wise/components-theming';
18
18
  import { clsx } from 'clsx';
19
19
  import { useState } from 'react';
20
20
 
21
- import { PreventScroll } from '../../../common/preventScroll/PreventScroll';
21
+ import { PreventScroll } from '../common/preventScroll/PreventScroll';
22
22
 
23
- export interface SelectInputPopoverProps {
23
+ export interface PopoverProps {
24
24
  placement?: Placement;
25
25
  open: boolean;
26
26
  renderTrigger: (args: {
@@ -39,7 +39,7 @@ export interface SelectInputPopoverProps {
39
39
 
40
40
  const floatingPadding = 16;
41
41
 
42
- export function SelectInputPopover({
42
+ export function Popover({
43
43
  placement,
44
44
  open,
45
45
  renderTrigger,
@@ -49,7 +49,7 @@ export function SelectInputPopover({
49
49
  children,
50
50
  onClose,
51
51
  onCloseEnd,
52
- }: SelectInputPopoverProps) {
52
+ }: PopoverProps) {
53
53
  const { refs, floatingStyles, context } = useFloating<Element>({
54
54
  strategy: 'fixed',
55
55
  placement,
package/src/main.css CHANGED
@@ -3984,91 +3984,14 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3984
3984
  color: #5d7079;
3985
3985
  color: var(--color-content-secondary);
3986
3986
  }
3987
- .np-select-input-option-container {
3988
- display: flex;
3989
- cursor: default;
3990
- -webkit-user-select: none;
3991
- -moz-user-select: none;
3992
- user-select: none;
3993
- align-items: center;
3994
- -moz-column-gap: 8px;
3995
- column-gap: 8px;
3996
- -moz-column-gap: var(--size-8);
3997
- column-gap: var(--size-8);
3998
- border-radius: 10px;
3999
- border-radius: var(--radius-small);
4000
- padding: 12px 16px;
4001
- padding: var(--size-12) var(--size-16);
4002
- color: var(--color-interactive-primary);
4003
- }
4004
- .np-select-input-option-container:focus {
4005
- outline: none;
4006
- }
4007
- .np-select-input-option-container--active {
4008
- box-shadow: inset 0 0 0 1px #c9cbce;
4009
- box-shadow: inset 0 0 0 1px var(--color-interactive-secondary);
4010
- }
4011
- .np-select-input-option-container--disabled {
4012
- opacity: 0.45;
4013
- }
4014
- .np-select-input-option-check--not-selected {
4015
- visibility: hidden;
4016
- }
4017
- .np-select-input-option {
4018
- flex: 1;
4019
- }
4020
- .np-select-input-option-content-container {
4021
- display: flex;
4022
- align-items: center;
4023
- -moz-column-gap: 8px;
4024
- column-gap: 8px;
4025
- -moz-column-gap: var(--size-8);
4026
- column-gap: var(--size-8);
4027
- color: #37517e;
4028
- color: var(--color-content-primary);
4029
- }
4030
- .np-select-input-option-content-icon {
4031
- display: flex;
4032
- }
4033
- .np-select-input-option-content-icon--not-within-trigger {
4034
- align-self: flex-start;
4035
- }
4036
- .np-select-input-option-content-text {
4037
- display: flex;
4038
- flex: 1;
4039
- flex-direction: column;
4040
- overflow: hidden;
4041
- }
4042
- .np-select-input-option-content-text-secondary {
4043
- color: #5d7079;
4044
- color: var(--color-content-secondary);
4045
- }
4046
- .np-select-input-option-content-text-within-trigger {
3987
+ .np-select-input-content {
4047
3988
  overflow: hidden;
4048
3989
  text-overflow: ellipsis;
4049
3990
  white-space: nowrap;
4050
3991
  }
4051
- .np-select-input-option-content-text-line-1 > :not([hidden]) ~ :not([hidden]) {
4052
- margin-right: 8px;
4053
- margin-right: var(--size-8);
4054
- margin-left: 8px;
4055
- margin-left: var(--size-8);
4056
- }
4057
- .np-select-input-group-item--without-needle:first-child {
4058
- margin-top: calc(-1 * 8px);
4059
- margin-top: calc(-1 * var(--size-8));
4060
- }
4061
- .np-select-input-group-item-header {
4062
- position: sticky;
4063
- top: 0px;
4064
- z-index: 10;
4065
- background-color: #ffffff;
4066
- background-color: var(--color-background-elevated);
4067
- }
4068
- .np-select-input-separator-item {
4069
- margin: 8px;
4070
- margin: var(--size-8);
4071
- border-top-width: 1px;
3992
+ .np-select-input-placeholder {
3993
+ color: #768e9c;
3994
+ color: var(--color-content-tertiary);
4072
3995
  }
4073
3996
  .np-select-input-options-container {
4074
3997
  display: flex;
@@ -4147,6 +4070,92 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
4147
4070
  contain: strict;
4148
4071
  height: 100%;
4149
4072
  }
4073
+ .np-select-input-separator-item {
4074
+ margin: 8px;
4075
+ margin: var(--size-8);
4076
+ border-top-width: 1px;
4077
+ }
4078
+ .np-select-input-group-item--without-needle:first-child {
4079
+ margin-top: calc(-1 * 8px);
4080
+ margin-top: calc(-1 * var(--size-8));
4081
+ }
4082
+ .np-select-input-group-item-header {
4083
+ position: sticky;
4084
+ top: 0px;
4085
+ z-index: 10;
4086
+ background-color: #ffffff;
4087
+ background-color: var(--color-background-elevated);
4088
+ }
4089
+ .np-select-input-option-container {
4090
+ display: flex;
4091
+ cursor: default;
4092
+ -webkit-user-select: none;
4093
+ -moz-user-select: none;
4094
+ user-select: none;
4095
+ align-items: center;
4096
+ -moz-column-gap: 8px;
4097
+ column-gap: 8px;
4098
+ -moz-column-gap: var(--size-8);
4099
+ column-gap: var(--size-8);
4100
+ border-radius: 10px;
4101
+ border-radius: var(--radius-small);
4102
+ padding: 12px 16px;
4103
+ padding: var(--size-12) var(--size-16);
4104
+ color: var(--color-interactive-primary);
4105
+ }
4106
+ .np-select-input-option-container:focus {
4107
+ outline: none;
4108
+ }
4109
+ .np-select-input-option-container--active {
4110
+ box-shadow: inset 0 0 0 1px #c9cbce;
4111
+ box-shadow: inset 0 0 0 1px var(--color-interactive-secondary);
4112
+ }
4113
+ .np-select-input-option-container--disabled {
4114
+ opacity: 0.45;
4115
+ }
4116
+ .np-select-input-option-check--not-selected {
4117
+ visibility: hidden;
4118
+ }
4119
+ .np-select-input-option {
4120
+ flex: 1;
4121
+ }
4122
+ .np-select-input-option-content-container {
4123
+ display: flex;
4124
+ align-items: center;
4125
+ -moz-column-gap: 8px;
4126
+ column-gap: 8px;
4127
+ -moz-column-gap: var(--size-8);
4128
+ column-gap: var(--size-8);
4129
+ color: #37517e;
4130
+ color: var(--color-content-primary);
4131
+ }
4132
+ .np-select-input-option-content-icon {
4133
+ display: flex;
4134
+ }
4135
+ .np-select-input-option-content-icon--not-within-trigger {
4136
+ align-self: flex-start;
4137
+ }
4138
+ .np-select-input-option-content-text {
4139
+ display: flex;
4140
+ flex: 1;
4141
+ flex-direction: column;
4142
+ overflow: hidden;
4143
+ }
4144
+ .np-select-input-option-content-text-secondary {
4145
+ color: #5d7079;
4146
+ color: var(--color-content-secondary);
4147
+ }
4148
+ .np-select-input-option-content-text-within-trigger {
4149
+ overflow: hidden;
4150
+ text-overflow: ellipsis;
4151
+ white-space: nowrap;
4152
+ }
4153
+ .np-select-input-option-content-text-line-1 > :not([hidden]) ~ :not([hidden]) {
4154
+ margin-right: 8px;
4155
+ margin-right: var(--size-8);
4156
+ margin-left: 8px;
4157
+ margin-left: var(--size-8);
4158
+ }
4150
4159
  .np-select-input-footer {
4151
4160
  padding: 4px 24px 16px;
4152
4161
  padding: var(--size-4) var(--size-24) var(--size-16);
@@ -4197,15 +4206,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
4197
4206
  border-inline-start: 1px solid rgba(0,0,0,0.10196);
4198
4207
  border-inline-start: 1px solid var(--color-border-neutral);
4199
4208
  }
4200
- .np-select-input-content {
4201
- overflow: hidden;
4202
- text-overflow: ellipsis;
4203
- white-space: nowrap;
4204
- }
4205
- .np-select-input-placeholder {
4206
- color: #768e9c;
4207
- color: var(--color-content-tertiary);
4208
- }
4209
4209
  .np-text-area {
4210
4210
  min-height: 72px;
4211
4211
  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";
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputBottomSheet.js","sources":["../../../../src/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n FloatingPortal,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition, TransitionChild } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { Fragment, useState } from 'react';\n\nimport { CloseButton } from '../../../common/closeButton';\nimport { useVirtualKeyboard } from '../../../common/hooks/useVirtualKeyboard';\nimport { PreventScroll } from '../../../common/preventScroll/PreventScroll';\nimport { Size } from '../../../common/propsValues/size';\n\nexport interface SelectInputBottomSheetProps {\n open: boolean;\n renderTrigger?: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n initialFocusRef?: React.MutableRefObject<HTMLElement | null>;\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nexport function SelectInputBottomSheet({\n open,\n renderTrigger,\n title,\n initialFocusRef,\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputBottomSheetProps) {\n useVirtualKeyboard(open);\n\n const { refs, context } = useFloating<Element>({\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss, role]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {renderTrigger?.({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n className=\"np-bottom-sheet-v2-container\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <TransitionChild\n as=\"div\"\n className=\"np-bottom-sheet-v2-backdrop\"\n enterFrom=\"np-bottom-sheet-v2-backdrop--closed\"\n leaveTo=\"np-bottom-sheet-v2-backdrop--closed\"\n />\n\n <div className=\"np-bottom-sheet-v2\">\n <FocusScope>\n <FloatingFocusManager context={context} initialFocus={initialFocusRef}>\n <Fragment\n key={floatingKey} // Force inner state invalidation on open\n >\n <TransitionChild\n ref={refs.setFloating}\n as=\"div\"\n className=\"np-bottom-sheet-v2-content\"\n enterFrom=\"np-bottom-sheet-v2-content--closed\"\n leaveTo=\"np-bottom-sheet-v2-content--closed\"\n {...getFloatingProps()}\n >\n <div className=\"np-bottom-sheet-v2-header\">\n <CloseButton\n size={Size.SMALL}\n onClick={() => {\n onClose?.();\n }}\n />\n </div>\n <div\n className={clsx(\n 'np-bottom-sheet-v2-content-inner',\n title && 'np-bottom-sheet-v2-content-inner--has-title',\n padding === 'md' && 'np-bottom-sheet-v2-content-inner--padding-md',\n )}\n >\n {title ? (\n <h2 className=\"np-bottom-sheet-v2-title np-text-title-body\">{title}</h2>\n ) : null}\n <div className=\"np-bottom-sheet-v2-body np-text-body-default\">\n {children}\n </div>\n </div>\n </TransitionChild>\n </Fragment>\n </FloatingFocusManager>\n </FocusScope>\n </div>\n </Transition>\n </ThemeProvider>\n </FloatingPortal>\n </>\n );\n}\n"],"names":["SelectInputBottomSheet","open","renderTrigger","title","initialFocusRef","padding","children","onClose","onCloseEnd","useVirtualKeyboard","refs","context","useFloating","onOpenChange","value","dismiss","useDismiss","role","useRole","getReferenceProps","getFloatingProps","useInteractions","floatingKey","setFloatingKey","useState","theme","screenMode","useTheme","_jsxs","_Fragment","_jsx","PreventScroll","ref","setReference","getInteractionProps","FloatingPortal","ThemeProvider","Transition","as","show","className","beforeEnter","prev","afterLeave","TransitionChild","enterFrom","leaveTo","FocusScope","FloatingFocusManager","initialFocus","Fragment","setFloating","CloseButton","size","Size","SMALL","onClick","clsx"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputBottomSheet.mjs","sources":["../../../../src/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n FloatingPortal,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition, TransitionChild } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { Fragment, useState } from 'react';\n\nimport { CloseButton } from '../../../common/closeButton';\nimport { useVirtualKeyboard } from '../../../common/hooks/useVirtualKeyboard';\nimport { PreventScroll } from '../../../common/preventScroll/PreventScroll';\nimport { Size } from '../../../common/propsValues/size';\n\nexport interface SelectInputBottomSheetProps {\n open: boolean;\n renderTrigger?: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n initialFocusRef?: React.MutableRefObject<HTMLElement | null>;\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nexport function SelectInputBottomSheet({\n open,\n renderTrigger,\n title,\n initialFocusRef,\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputBottomSheetProps) {\n useVirtualKeyboard(open);\n\n const { refs, context } = useFloating<Element>({\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss, role]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {renderTrigger?.({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n className=\"np-bottom-sheet-v2-container\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <TransitionChild\n as=\"div\"\n className=\"np-bottom-sheet-v2-backdrop\"\n enterFrom=\"np-bottom-sheet-v2-backdrop--closed\"\n leaveTo=\"np-bottom-sheet-v2-backdrop--closed\"\n />\n\n <div className=\"np-bottom-sheet-v2\">\n <FocusScope>\n <FloatingFocusManager context={context} initialFocus={initialFocusRef}>\n <Fragment\n key={floatingKey} // Force inner state invalidation on open\n >\n <TransitionChild\n ref={refs.setFloating}\n as=\"div\"\n className=\"np-bottom-sheet-v2-content\"\n enterFrom=\"np-bottom-sheet-v2-content--closed\"\n leaveTo=\"np-bottom-sheet-v2-content--closed\"\n {...getFloatingProps()}\n >\n <div className=\"np-bottom-sheet-v2-header\">\n <CloseButton\n size={Size.SMALL}\n onClick={() => {\n onClose?.();\n }}\n />\n </div>\n <div\n className={clsx(\n 'np-bottom-sheet-v2-content-inner',\n title && 'np-bottom-sheet-v2-content-inner--has-title',\n padding === 'md' && 'np-bottom-sheet-v2-content-inner--padding-md',\n )}\n >\n {title ? (\n <h2 className=\"np-bottom-sheet-v2-title np-text-title-body\">{title}</h2>\n ) : null}\n <div className=\"np-bottom-sheet-v2-body np-text-body-default\">\n {children}\n </div>\n </div>\n </TransitionChild>\n </Fragment>\n </FloatingFocusManager>\n </FocusScope>\n </div>\n </Transition>\n </ThemeProvider>\n </FloatingPortal>\n </>\n );\n}\n"],"names":["SelectInputBottomSheet","open","renderTrigger","title","initialFocusRef","padding","children","onClose","onCloseEnd","useVirtualKeyboard","refs","context","useFloating","onOpenChange","value","dismiss","useDismiss","role","useRole","getReferenceProps","getFloatingProps","useInteractions","floatingKey","setFloatingKey","useState","theme","screenMode","useTheme","_jsxs","_Fragment","_jsx","PreventScroll","ref","setReference","getInteractionProps","FloatingPortal","ThemeProvider","Transition","as","show","className","beforeEnter","prev","afterLeave","TransitionChild","enterFrom","leaveTo","FocusScope","FloatingFocusManager","initialFocus","Fragment","setFloating","CloseButton","size","Size","SMALL","onClick","clsx"],"mappings":";;;;;;;;;;;;AAmCM,SAAUA,sBAAsBA,CAAC;EACrCC,IAAI;EACJC,aAAa;EACbC,KAAK;EACLC,eAAe;AACfC,EAAAA,OAAO,GAAG,IAAI;EACdC,QAAQ;EACRC,OAAO;AACPC,EAAAA;AAAU,CACkB,EAAA;EAC5BC,kBAAkB,CAACR,IAAI,CAAC;EAExB,MAAM;IAAES,IAAI;AAAEC,IAAAA;GAAS,GAAGC,WAAW,CAAU;IAC7CX,IAAI;IACJY,YAAY,EAAGC,KAAK,IAAI;MACtB,IAAI,CAACA,KAAK,EAAE;AACVP,QAAAA,OAAO,IAAI;AACb,MAAA;AACF,IAAA;AACD,GAAA,CAAC;AAEF,EAAA,MAAMQ,OAAO,GAAGC,UAAU,CAACL,OAAO,CAAC;AACnC,EAAA,MAAMM,IAAI,GAAGC,OAAO,CAACP,OAAO,CAAC;EAC7B,MAAM;IAAEQ,iBAAiB;AAAEC,IAAAA;GAAkB,GAAGC,eAAe,CAAC,CAACN,OAAO,EAAEE,IAAI,CAAC,CAAC;EAEhF,MAAM,CAACK,WAAW,EAAEC,cAAc,CAAC,GAAGC,QAAQ,CAAC,CAAC,CAAC;EAEjD,MAAM;IAAEC,KAAK;AAAEC,IAAAA;GAAY,GAAGC,QAAQ,EAAE;EAExC,oBACEC,IAAA,CAAAC,QAAA,EAAA;AAAAvB,IAAAA,QAAA,EAAA,CACGL,IAAI,gBAAG6B,GAAA,CAACC,aAAa,EAAA,EAAA,CAAG,GAAG,IAAI,EAC/B7B,aAAa,GAAG;MACf8B,GAAG,EAAEtB,IAAI,CAACuB,YAAY;AACtBC,MAAAA,mBAAmB,EAAEf;AACtB,KAAA,CAAC,eAEFW,GAAA,CAACK,cAAc,EAAA;MAAA7B,QAAA,eACbwB,GAAA,CAACM,aAAa,EAAA;AAACX,QAAAA,KAAK,EAAC,UAAU;AAACC,QAAAA,UAAU,EAAED,KAAK,KAAK,UAAU,GAAGC,UAAU,GAAG,OAAQ;QAAApB,QAAA,eACtFsB,IAAA,CAACS,UAAU,EAAA;AACTC,UAAAA,EAAE,EAAC,KAAK;AACRC,UAAAA,IAAI,EAAEtC,IAAK;AACXuC,UAAAA,SAAS,EAAC,8BAA8B;UACxCC,WAAW,EAAEA,MAAK;AAChBlB,YAAAA,cAAc,CAAEmB,IAAI,IAAKA,IAAI,GAAG,CAAC,CAAC;UACpC,CAAE;AACFC,UAAAA,UAAU,EAAEnC,UAAW;UAAAF,QAAA,EAAA,cAEvBwB,GAAA,CAACc,eAAe,EAAA;AACdN,YAAAA,EAAE,EAAC,KAAK;AACRE,YAAAA,SAAS,EAAC,6BAA6B;AACvCK,YAAAA,SAAS,EAAC,qCAAqC;AAC/CC,YAAAA,OAAO,EAAC;WAAqC,CAG/C,eAAAhB,GAAA,CAAA,KAAA,EAAA;AAAKU,YAAAA,SAAS,EAAC,oBAAoB;YAAAlC,QAAA,eACjCwB,GAAA,CAACiB,UAAU,EAAA;cAAAzC,QAAA,eACTwB,GAAA,CAACkB,oBAAoB,EAAA;AAACrC,gBAAAA,OAAO,EAAEA,OAAQ;AAACsC,gBAAAA,YAAY,EAAE7C,eAAgB;gBAAAE,QAAA,eACpEwB,GAAA,CAACoB,UAAQ,EAAA;kBAAA5C,QAAA,eAGPsB,IAAA,CAACgB,eAAe,EAAA;oBACdZ,GAAG,EAAEtB,IAAI,CAACyC,WAAY;AACtBb,oBAAAA,EAAE,EAAC,KAAK;AACRE,oBAAAA,SAAS,EAAC,4BAA4B;AACtCK,oBAAAA,SAAS,EAAC,oCAAoC;AAC9CC,oBAAAA,OAAO,EAAC,oCAAoC;oBAAA,GACxC1B,gBAAgB,EAAE;AAAAd,oBAAAA,QAAA,gBAEtBwB,GAAA,CAAA,KAAA,EAAA;AAAKU,sBAAAA,SAAS,EAAC,2BAA2B;sBAAAlC,QAAA,eACxCwB,GAAA,CAACsB,WAAW,EAAA;wBACVC,IAAI,EAAEC,IAAI,CAACC,KAAM;wBACjBC,OAAO,EAAEA,MAAK;AACZjD,0BAAAA,OAAO,IAAI;AACb,wBAAA;uBAAE;qBAED,CACL,eAAAqB,IAAA,CAAA,KAAA,EAAA;AACEY,sBAAAA,SAAS,EAAEiB,IAAI,CACb,kCAAkC,EAClCtD,KAAK,IAAI,6CAA6C,EACtDE,OAAO,KAAK,IAAI,IAAI,8CAA8C,CAClE;sBAAAC,QAAA,EAAA,CAEDH,KAAK,gBACJ2B,GAAA,CAAA,IAAA,EAAA;AAAIU,wBAAAA,SAAS,EAAC,6CAA6C;AAAAlC,wBAAAA,QAAA,EAAEH;AAAK,uBAAK,CAAC,GACtE,IAAI,eACR2B,GAAA,CAAA,KAAA,EAAA;AAAKU,wBAAAA,SAAS,EAAC,8CAA8C;AAAAlC,wBAAAA,QAAA,EAC1DA;AAAQ,uBACN,CACP;AAAA,qBAAK,CACP;mBAAiB;AACnB,iBAAA,EAjCOgB,WAiCG;eACU;aACZ;AACd,WAAK,CACP;SAAY;OACC;AACjB,KAAgB,CAClB;AAAA,GAAA,CAAG;AAEP;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputButtonInput.js","sources":["../../../../src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport { useInputPaddings } from '../../InputGroup';\nimport { inputClassNameBase } from '../../_common';\n\nexport interface SelectInputButtonInputProps extends React.ComponentPropsWithRef<'button'> {\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport const SelectInputButtonInput = forwardRef(function ButtonInput(\n { size = 'md', className, style, ...restProps }: SelectInputButtonInputProps,\n ref: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const inputPaddings = useInputPaddings();\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={clsx(inputClassNameBase({ size }), 'np-button-input', className)}\n style={{ ...inputPaddings, ...style }}\n {...restProps}\n />\n );\n});\n"],"names":["SelectInputButtonInput","forwardRef","ButtonInput","size","className","style","restProps","ref","inputPaddings","useInputPaddings","_jsx","type","clsx","inputClassNameBase"],"mappings":";;;;;;;;MAUaA,sBAAsB,gBAAGC,gBAAU,CAAC,SAASC,WAAWA,CACnE;AAAEC,EAAAA,IAAI,GAAG,IAAI;EAAEC,SAAS;EAAEC,KAAK;EAAE,GAAGC;AAAS,CAA+B,EAC5EC,GAAiD,EAAA;AAEjD,EAAA,MAAMC,aAAa,GAAGC,2BAAgB,EAAE;AAExC,EAAA,oBACEC,cAAA,CAAA,QAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTI,IAAAA,IAAI,EAAC,QAAQ;AACbP,IAAAA,SAAS,EAAEQ,SAAI,CAACC,0BAAkB,CAAC;AAAEV,MAAAA;AAAI,KAAE,CAAC,EAAE,iBAAiB,EAAEC,SAAS,CAAE;AAC5EC,IAAAA,KAAK,EAAE;AAAE,MAAA,GAAGG,aAAa;MAAE,GAAGH;KAAQ;IAAA,GAClCC;AAAS,GAAC,CACd;AAEN,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputButtonInput.mjs","sources":["../../../../src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport { useInputPaddings } from '../../InputGroup';\nimport { inputClassNameBase } from '../../_common';\n\nexport interface SelectInputButtonInputProps extends React.ComponentPropsWithRef<'button'> {\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport const SelectInputButtonInput = forwardRef(function ButtonInput(\n { size = 'md', className, style, ...restProps }: SelectInputButtonInputProps,\n ref: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const inputPaddings = useInputPaddings();\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={clsx(inputClassNameBase({ size }), 'np-button-input', className)}\n style={{ ...inputPaddings, ...style }}\n {...restProps}\n />\n );\n});\n"],"names":["SelectInputButtonInput","forwardRef","ButtonInput","size","className","style","restProps","ref","inputPaddings","useInputPaddings","_jsx","type","clsx","inputClassNameBase"],"mappings":";;;;;;MAUaA,sBAAsB,gBAAGC,UAAU,CAAC,SAASC,WAAWA,CACnE;AAAEC,EAAAA,IAAI,GAAG,IAAI;EAAEC,SAAS;EAAEC,KAAK;EAAE,GAAGC;AAAS,CAA+B,EAC5EC,GAAiD,EAAA;AAEjD,EAAA,MAAMC,aAAa,GAAGC,gBAAgB,EAAE;AAExC,EAAA,oBACEC,GAAA,CAAA,QAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTI,IAAAA,IAAI,EAAC,QAAQ;AACbP,IAAAA,SAAS,EAAEQ,IAAI,CAACC,kBAAkB,CAAC;AAAEV,MAAAA;AAAI,KAAE,CAAC,EAAE,iBAAiB,EAAEC,SAAS,CAAE;AAC5EC,IAAAA,KAAK,EAAE;AAAE,MAAA,GAAGG,aAAa;MAAE,GAAGH;KAAQ;IAAA,GAClCC;AAAS,GAAC,CACd;AAEN,CAAC;;;;"}
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- var icons = require('@transferwise/icons');
4
- var clsx = require('clsx');
5
- var reactIntl = require('react-intl');
6
- var DateTrigger_messages = require('../../../dateLookup/dateTrigger/DateTrigger.messages.js');
7
- var jsxRuntime = require('react/jsx-runtime');
8
-
9
- function SelectInputClearButton({
10
- className,
11
- onClick
12
- }) {
13
- const intl = reactIntl.useIntl();
14
- return /*#__PURE__*/jsxRuntime.jsx("button", {
15
- type: "button",
16
- "aria-label": intl.formatMessage(DateTrigger_messages.default.ariaLabel),
17
- className: clsx.clsx(className, 'np-select-input-addon np-select-input-addon--interactive'),
18
- onClick: onClick,
19
- children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {
20
- size: 16
21
- })
22
- });
23
- }
24
- // Type is already exported above
25
-
26
- exports.SelectInputClearButton = SelectInputClearButton;
27
- //# sourceMappingURL=SelectInputClearButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputClearButton.js","sources":["../../../../src/inputs/SelectInput/ClearButton/SelectInputClearButton.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport dateTriggerMessages from '../../../dateLookup/dateTrigger/DateTrigger.messages';\n\nexport interface SelectInputClearButtonProps extends Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'className' | 'onClick'\n> {}\n\n/**\n * A button component used to clear the selected value in a SelectInput.\n */\nexport function SelectInputClearButton({ className, onClick }: SelectInputClearButtonProps) {\n const intl = useIntl();\n\n return (\n <button\n type=\"button\"\n aria-label={intl.formatMessage(dateTriggerMessages.ariaLabel)}\n className={clsx(className, 'np-select-input-addon np-select-input-addon--interactive')}\n onClick={onClick}\n >\n <Cross size={16} />\n </button>\n );\n}\n\n// Type is already exported above\n"],"names":["SelectInputClearButton","className","onClick","intl","useIntl","_jsx","type","formatMessage","dateTriggerMessages","ariaLabel","clsx","children","Cross","size"],"mappings":";;;;;;;;SAagBA,sBAAsBA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAO,CAA+B,EAAA;AACxF,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;AAEtB,EAAA,oBACEC,cAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,YAAA,EAAYH,IAAI,CAACI,aAAa,CAACC,4BAAmB,CAACC,SAAS,CAAE;AAC9DR,IAAAA,SAAS,EAAES,SAAI,CAACT,SAAS,EAAE,0DAA0D,CAAE;AACvFC,IAAAA,OAAO,EAAEA,OAAQ;IAAAS,QAAA,eAEjBN,cAAA,CAACO,WAAK,EAAA;AAACC,MAAAA,IAAI,EAAE;KAAG;AAClB,GAAQ,CAAC;AAEb;AAEA;;;;"}
@@ -1,25 +0,0 @@
1
- import { Cross } from '@transferwise/icons';
2
- import { clsx } from 'clsx';
3
- import { useIntl } from 'react-intl';
4
- import messages from '../../../dateLookup/dateTrigger/DateTrigger.messages.mjs';
5
- import { jsx } from 'react/jsx-runtime';
6
-
7
- function SelectInputClearButton({
8
- className,
9
- onClick
10
- }) {
11
- const intl = useIntl();
12
- return /*#__PURE__*/jsx("button", {
13
- type: "button",
14
- "aria-label": intl.formatMessage(messages.ariaLabel),
15
- className: clsx(className, 'np-select-input-addon np-select-input-addon--interactive'),
16
- onClick: onClick,
17
- children: /*#__PURE__*/jsx(Cross, {
18
- size: 16
19
- })
20
- });
21
- }
22
- // Type is already exported above
23
-
24
- export { SelectInputClearButton };
25
- //# sourceMappingURL=SelectInputClearButton.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputClearButton.mjs","sources":["../../../../src/inputs/SelectInput/ClearButton/SelectInputClearButton.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport dateTriggerMessages from '../../../dateLookup/dateTrigger/DateTrigger.messages';\n\nexport interface SelectInputClearButtonProps extends Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'className' | 'onClick'\n> {}\n\n/**\n * A button component used to clear the selected value in a SelectInput.\n */\nexport function SelectInputClearButton({ className, onClick }: SelectInputClearButtonProps) {\n const intl = useIntl();\n\n return (\n <button\n type=\"button\"\n aria-label={intl.formatMessage(dateTriggerMessages.ariaLabel)}\n className={clsx(className, 'np-select-input-addon np-select-input-addon--interactive')}\n onClick={onClick}\n >\n <Cross size={16} />\n </button>\n );\n}\n\n// Type is already exported above\n"],"names":["SelectInputClearButton","className","onClick","intl","useIntl","_jsx","type","formatMessage","dateTriggerMessages","ariaLabel","clsx","children","Cross","size"],"mappings":";;;;;;SAagBA,sBAAsBA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAO,CAA+B,EAAA;AACxF,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtB,EAAA,oBACEC,GAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,YAAA,EAAYH,IAAI,CAACI,aAAa,CAACC,QAAmB,CAACC,SAAS,CAAE;AAC9DR,IAAAA,SAAS,EAAES,IAAI,CAACT,SAAS,EAAE,0DAA0D,CAAE;AACvFC,IAAAA,OAAO,EAAEA,OAAQ;IAAAS,QAAA,eAEjBN,GAAA,CAACO,KAAK,EAAA;AAACC,MAAAA,IAAI,EAAE;KAAG;AAClB,GAAQ,CAAC;AAEb;AAEA;;;;"}
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- var icons = require('@transferwise/icons');
4
- var clsx = require('clsx');
5
- require('react');
6
- var InputGroup = require('../../InputGroup.js');
7
- var SelectInputClearButton = require('../ClearButton/SelectInputClearButton.js');
8
- var SelectInputTriggerButton = require('../TriggerButton/SelectInputTriggerButton.js');
9
- var SelectInputButtonInput = require('../ButtonInput/SelectInputButtonInput.js');
10
- var jsxRuntime = require('react/jsx-runtime');
11
-
12
- function SelectInputDefaultRenderTrigger({
13
- content,
14
- placeholderShown,
15
- clear,
16
- disabled,
17
- size,
18
- className
19
- }) {
20
- return /*#__PURE__*/jsxRuntime.jsx(InputGroup.InputGroup, {
21
- addonEnd: {
22
- content: /*#__PURE__*/jsxRuntime.jsxs("span", {
23
- className: clsx.clsx('np-select-input-addon-container', disabled && 'disabled'),
24
- children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
25
- children: [/*#__PURE__*/jsxRuntime.jsx(SelectInputClearButton.SelectInputClearButton, {
26
- onClick: event => {
27
- event.preventDefault();
28
- clear();
29
- }
30
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
31
- className: "np-select-input-addon-separator"
32
- })]
33
- }) : null, /*#__PURE__*/jsxRuntime.jsx("span", {
34
- className: "np-select-input-addon",
35
- children: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronDown, {
36
- size: 16
37
- })
38
- })]
39
- }),
40
- initialContentWidth: 24 + 4,
41
- padding: 'sm'
42
- },
43
- disabled: disabled,
44
- className: className,
45
- children: /*#__PURE__*/jsxRuntime.jsx(SelectInputTriggerButton.SelectInputTriggerButton, {
46
- as: SelectInputButtonInput.SelectInputButtonInput,
47
- size: size,
48
- children: /*#__PURE__*/jsxRuntime.jsx("span", {
49
- className: clsx.clsx('np-select-input-content', placeholderShown && 'np-select-input-placeholder'),
50
- children: content
51
- })
52
- })
53
- });
54
- }
55
- const DefaultRenderTrigger = SelectInputDefaultRenderTrigger;
56
-
57
- exports.DefaultRenderTrigger = DefaultRenderTrigger;
58
- exports.SelectInputDefaultRenderTrigger = SelectInputDefaultRenderTrigger;
59
- //# sourceMappingURL=SelectInputDefaultRenderTrigger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputDefaultRenderTrigger.js","sources":["../../../../src/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport React from 'react';\n\nimport { InputGroup } from '../../../inputs/InputGroup';\nimport { SelectInputClearButton } from '../ClearButton';\nimport { SelectInputTriggerButton } from '../TriggerButton';\nimport { SelectInputProps } from '../SelectInput.types';\nimport { SelectInputButtonInput } from '../ButtonInput';\n\nexport interface SelectInputDefaultRenderTriggerProps {\n content: React.ReactNode;\n placeholderShown: boolean;\n clear: (() => void) | undefined;\n disabled: boolean;\n size: 'sm' | 'md' | 'lg';\n className: string | undefined;\n}\n\n/**\n * Default render function for the SelectInput trigger.\n * Displays the selected value or placeholder with clear button and dropdown indicator.\n */\nexport function SelectInputDefaultRenderTrigger({\n content,\n placeholderShown,\n clear,\n disabled,\n size,\n className,\n}: SelectInputDefaultRenderTriggerProps) {\n return (\n <InputGroup\n addonEnd={{\n content: (\n <span className={clsx('np-select-input-addon-container', disabled && 'disabled')}>\n {clear != null && !placeholderShown ? (\n <>\n <SelectInputClearButton\n onClick={(event) => {\n event.preventDefault();\n clear();\n }}\n />\n <span className=\"np-select-input-addon-separator\" />\n </>\n ) : null}\n <span className=\"np-select-input-addon\">\n <ChevronDown size={16} />\n </span>\n </span>\n ),\n initialContentWidth: 24 + 4,\n padding: 'sm',\n }}\n disabled={disabled}\n className={className}\n >\n <SelectInputTriggerButton as={SelectInputButtonInput} size={size}>\n <span\n className={clsx(\n 'np-select-input-content',\n placeholderShown && 'np-select-input-placeholder',\n )}\n >\n {content}\n </span>\n </SelectInputTriggerButton>\n </InputGroup>\n );\n}\n\nexport const DefaultRenderTrigger =\n SelectInputDefaultRenderTrigger satisfies SelectInputProps['renderTrigger'];\n"],"names":["SelectInputDefaultRenderTrigger","content","placeholderShown","clear","disabled","size","className","_jsx","InputGroup","addonEnd","_jsxs","clsx","children","_Fragment","SelectInputClearButton","onClick","event","preventDefault","ChevronDown","initialContentWidth","padding","SelectInputTriggerButton","as","SelectInputButtonInput","DefaultRenderTrigger"],"mappings":";;;;;;;;;;;AAuBM,SAAUA,+BAA+BA,CAAC;EAC9CC,OAAO;EACPC,gBAAgB;EAChBC,KAAK;EACLC,QAAQ;EACRC,IAAI;AACJC,EAAAA;AAAS,CAC4B,EAAA;EACrC,oBACEC,cAAA,CAACC,qBAAU,EAAA;AACTC,IAAAA,QAAQ,EAAE;AACRR,MAAAA,OAAO,eACLS,eAAA,CAAA,MAAA,EAAA;QAAMJ,SAAS,EAAEK,SAAI,CAAC,iCAAiC,EAAEP,QAAQ,IAAI,UAAU,CAAE;QAAAQ,QAAA,EAAA,CAC9ET,KAAK,IAAI,IAAI,IAAI,CAACD,gBAAgB,gBACjCQ,eAAA,CAAAG,mBAAA,EAAA;UAAAD,QAAA,EAAA,cACEL,cAAA,CAACO,6CAAsB,EAAA;YACrBC,OAAO,EAAGC,KAAK,IAAI;cACjBA,KAAK,CAACC,cAAc,EAAE;AACtBd,cAAAA,KAAK,EAAE;AACT,YAAA;WAAE,CAEJ,eAAAI,cAAA,CAAA,MAAA,EAAA;AAAMD,YAAAA,SAAS,EAAC;AAAiC,WAAA,CACnD;AAAA,SAAA,CAAG,GACD,IAAI,eACRC,cAAA,CAAA,MAAA,EAAA;AAAMD,UAAAA,SAAS,EAAC,uBAAuB;UAAAM,QAAA,eACrCL,cAAA,CAACW,iBAAW,EAAA;AAACb,YAAAA,IAAI,EAAE;WAAG;AACxB,SAAM,CACR;AAAA,OAAM,CACP;MACDc,mBAAmB,EAAE,EAAE,GAAG,CAAC;AAC3BC,MAAAA,OAAO,EAAE;KACT;AACFhB,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,SAAS,EAAEA,SAAU;IAAAM,QAAA,eAErBL,cAAA,CAACc,iDAAwB,EAAA;AAACC,MAAAA,EAAE,EAAEC,6CAAuB;AAAClB,MAAAA,IAAI,EAAEA,IAAK;AAAAO,MAAAA,QAAA,eAC/DL,cAAA,CAAA,MAAA,EAAA;QACED,SAAS,EAAEK,SAAI,CACb,yBAAyB,EACzBT,gBAAgB,IAAI,6BAA6B,CACjD;AAAAU,QAAAA,QAAA,EAEDX;OACG;KACkB;AAC5B,GAAY,CAAC;AAEjB;AAEO,MAAMuB,oBAAoB,GAC/BxB;;;;;"}
@@ -1,56 +0,0 @@
1
- import { ChevronDown } from '@transferwise/icons';
2
- import { clsx } from 'clsx';
3
- import 'react';
4
- import { InputGroup } from '../../InputGroup.mjs';
5
- import { SelectInputClearButton } from '../ClearButton/SelectInputClearButton.mjs';
6
- import { SelectInputTriggerButton } from '../TriggerButton/SelectInputTriggerButton.mjs';
7
- import { SelectInputButtonInput } from '../ButtonInput/SelectInputButtonInput.mjs';
8
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
-
10
- function SelectInputDefaultRenderTrigger({
11
- content,
12
- placeholderShown,
13
- clear,
14
- disabled,
15
- size,
16
- className
17
- }) {
18
- return /*#__PURE__*/jsx(InputGroup, {
19
- addonEnd: {
20
- content: /*#__PURE__*/jsxs("span", {
21
- className: clsx('np-select-input-addon-container', disabled && 'disabled'),
22
- children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxs(Fragment, {
23
- children: [/*#__PURE__*/jsx(SelectInputClearButton, {
24
- onClick: event => {
25
- event.preventDefault();
26
- clear();
27
- }
28
- }), /*#__PURE__*/jsx("span", {
29
- className: "np-select-input-addon-separator"
30
- })]
31
- }) : null, /*#__PURE__*/jsx("span", {
32
- className: "np-select-input-addon",
33
- children: /*#__PURE__*/jsx(ChevronDown, {
34
- size: 16
35
- })
36
- })]
37
- }),
38
- initialContentWidth: 24 + 4,
39
- padding: 'sm'
40
- },
41
- disabled: disabled,
42
- className: className,
43
- children: /*#__PURE__*/jsx(SelectInputTriggerButton, {
44
- as: SelectInputButtonInput,
45
- size: size,
46
- children: /*#__PURE__*/jsx("span", {
47
- className: clsx('np-select-input-content', placeholderShown && 'np-select-input-placeholder'),
48
- children: content
49
- })
50
- })
51
- });
52
- }
53
- const DefaultRenderTrigger = SelectInputDefaultRenderTrigger;
54
-
55
- export { DefaultRenderTrigger, SelectInputDefaultRenderTrigger };
56
- //# sourceMappingURL=SelectInputDefaultRenderTrigger.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputDefaultRenderTrigger.mjs","sources":["../../../../src/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport React from 'react';\n\nimport { InputGroup } from '../../../inputs/InputGroup';\nimport { SelectInputClearButton } from '../ClearButton';\nimport { SelectInputTriggerButton } from '../TriggerButton';\nimport { SelectInputProps } from '../SelectInput.types';\nimport { SelectInputButtonInput } from '../ButtonInput';\n\nexport interface SelectInputDefaultRenderTriggerProps {\n content: React.ReactNode;\n placeholderShown: boolean;\n clear: (() => void) | undefined;\n disabled: boolean;\n size: 'sm' | 'md' | 'lg';\n className: string | undefined;\n}\n\n/**\n * Default render function for the SelectInput trigger.\n * Displays the selected value or placeholder with clear button and dropdown indicator.\n */\nexport function SelectInputDefaultRenderTrigger({\n content,\n placeholderShown,\n clear,\n disabled,\n size,\n className,\n}: SelectInputDefaultRenderTriggerProps) {\n return (\n <InputGroup\n addonEnd={{\n content: (\n <span className={clsx('np-select-input-addon-container', disabled && 'disabled')}>\n {clear != null && !placeholderShown ? (\n <>\n <SelectInputClearButton\n onClick={(event) => {\n event.preventDefault();\n clear();\n }}\n />\n <span className=\"np-select-input-addon-separator\" />\n </>\n ) : null}\n <span className=\"np-select-input-addon\">\n <ChevronDown size={16} />\n </span>\n </span>\n ),\n initialContentWidth: 24 + 4,\n padding: 'sm',\n }}\n disabled={disabled}\n className={className}\n >\n <SelectInputTriggerButton as={SelectInputButtonInput} size={size}>\n <span\n className={clsx(\n 'np-select-input-content',\n placeholderShown && 'np-select-input-placeholder',\n )}\n >\n {content}\n </span>\n </SelectInputTriggerButton>\n </InputGroup>\n );\n}\n\nexport const DefaultRenderTrigger =\n SelectInputDefaultRenderTrigger satisfies SelectInputProps['renderTrigger'];\n"],"names":["SelectInputDefaultRenderTrigger","content","placeholderShown","clear","disabled","size","className","_jsx","InputGroup","addonEnd","_jsxs","clsx","children","_Fragment","SelectInputClearButton","onClick","event","preventDefault","ChevronDown","initialContentWidth","padding","SelectInputTriggerButton","as","SelectInputButtonInput","DefaultRenderTrigger"],"mappings":";;;;;;;;;AAuBM,SAAUA,+BAA+BA,CAAC;EAC9CC,OAAO;EACPC,gBAAgB;EAChBC,KAAK;EACLC,QAAQ;EACRC,IAAI;AACJC,EAAAA;AAAS,CAC4B,EAAA;EACrC,oBACEC,GAAA,CAACC,UAAU,EAAA;AACTC,IAAAA,QAAQ,EAAE;AACRR,MAAAA,OAAO,eACLS,IAAA,CAAA,MAAA,EAAA;QAAMJ,SAAS,EAAEK,IAAI,CAAC,iCAAiC,EAAEP,QAAQ,IAAI,UAAU,CAAE;QAAAQ,QAAA,EAAA,CAC9ET,KAAK,IAAI,IAAI,IAAI,CAACD,gBAAgB,gBACjCQ,IAAA,CAAAG,QAAA,EAAA;UAAAD,QAAA,EAAA,cACEL,GAAA,CAACO,sBAAsB,EAAA;YACrBC,OAAO,EAAGC,KAAK,IAAI;cACjBA,KAAK,CAACC,cAAc,EAAE;AACtBd,cAAAA,KAAK,EAAE;AACT,YAAA;WAAE,CAEJ,eAAAI,GAAA,CAAA,MAAA,EAAA;AAAMD,YAAAA,SAAS,EAAC;AAAiC,WAAA,CACnD;AAAA,SAAA,CAAG,GACD,IAAI,eACRC,GAAA,CAAA,MAAA,EAAA;AAAMD,UAAAA,SAAS,EAAC,uBAAuB;UAAAM,QAAA,eACrCL,GAAA,CAACW,WAAW,EAAA;AAACb,YAAAA,IAAI,EAAE;WAAG;AACxB,SAAM,CACR;AAAA,OAAM,CACP;MACDc,mBAAmB,EAAE,EAAE,GAAG,CAAC;AAC3BC,MAAAA,OAAO,EAAE;KACT;AACFhB,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,SAAS,EAAEA,SAAU;IAAAM,QAAA,eAErBL,GAAA,CAACc,wBAAwB,EAAA;AAACC,MAAAA,EAAE,EAAEC,sBAAuB;AAAClB,MAAAA,IAAI,EAAEA,IAAK;AAAAO,MAAAA,QAAA,eAC/DL,GAAA,CAAA,MAAA,EAAA;QACED,SAAS,EAAEK,IAAI,CACb,yBAAyB,EACzBT,gBAAgB,IAAI,6BAA6B,CACjD;AAAAU,QAAAA,QAAA,EAEDX;OACG;KACkB;AAC5B,GAAY,CAAC;AAEjB;AAEO,MAAMuB,oBAAoB,GAC/BxB;;;;"}
@@ -1,50 +0,0 @@
1
- 'use strict';
2
-
3
- var clsx = require('clsx');
4
- var React = require('react');
5
- var Header = require('../../../../header/Header.js');
6
- var Section = require('../../../../section/Section.js');
7
- var SelectInputItemView = require('../SelectInputItemView.js');
8
- var jsxRuntime = require('react/jsx-runtime');
9
-
10
- function SelectInputGroupItemView({
11
- item,
12
- renderValue,
13
- needle
14
- }) {
15
- const headerId = React.useId();
16
- const header = /*#__PURE__*/jsxRuntime.jsx(Header.default, {
17
- as: "header",
18
- role: "none",
19
- id: headerId,
20
- title: item.label
21
- // @ts-expect-error when we migrate ActionButton to new Button this should be sorted
22
- ,
23
- action: item.action && {
24
- text: item.action.label,
25
- onClick: item.action.onClick
26
- },
27
- className: "np-select-input-group-item-header p-x-1"
28
- });
29
- return (
30
- /*#__PURE__*/
31
- // An empty container may be rendered when no options match `needle`
32
- // However, pre-filtering would result in worse performance overall
33
- jsxRuntime.jsxs(Section.default, {
34
- as: "section",
35
- role: "group",
36
- "aria-labelledby": headerId,
37
- className: clsx.clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle'),
38
- children: [needle == null ? header : null, item.options.map((option, index) => /*#__PURE__*/jsxRuntime.jsx(SelectInputItemView.SelectInputItemView
39
- // eslint-disable-next-line react/no-array-index-key
40
- , {
41
- item: option,
42
- renderValue: renderValue,
43
- needle: needle
44
- }, index))]
45
- })
46
- );
47
- }
48
-
49
- exports.SelectInputGroupItemView = SelectInputGroupItemView;
50
- //# sourceMappingURL=SelectInputGroupItemView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputGroupItemView.js","sources":["../../../../../src/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\nimport Header from '../../../../header';\nimport Section from '../../../../section';\nimport { SelectInputGroupItem } from '../../SelectInput.types';\nimport { SelectInputItemView, SelectInputItemViewProps } from '..';\n\n/**\n * Props for the SelectInputGroupItemView component.\n */\nexport interface SelectInputGroupItemViewProps<T = string> extends SelectInputItemViewProps<\n T,\n SelectInputGroupItem<T | undefined>\n> {}\n\n/**\n * Component that renders a group of SelectInput options with a header.\n */\nexport function SelectInputGroupItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputGroupItemViewProps<T>) {\n const headerId = useId();\n\n const header = (\n <Header\n as=\"header\"\n role=\"none\"\n id={headerId}\n title={item.label}\n // @ts-expect-error when we migrate ActionButton to new Button this should be sorted\n action={\n item.action && {\n text: item.action.label,\n onClick: item.action.onClick,\n }\n }\n className=\"np-select-input-group-item-header p-x-1\"\n />\n );\n\n return (\n // An empty container may be rendered when no options match `needle`\n // However, pre-filtering would result in worse performance overall\n <Section\n as=\"section\"\n role=\"group\"\n aria-labelledby={headerId}\n className={clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle')}\n >\n {needle == null ? header : null}\n {item.options.map((option, index) => (\n <SelectInputItemView\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n item={option}\n renderValue={renderValue}\n needle={needle}\n />\n ))}\n </Section>\n );\n}\n"],"names":["SelectInputGroupItemView","item","renderValue","needle","headerId","useId","header","_jsx","Header","as","role","id","title","label","action","text","onClick","className","_jsxs","Section","clsx","children","options","map","option","index","SelectInputItemView"],"mappings":";;;;;;;;;AAkBM,SAAUA,wBAAwBA,CAAa;EACnDC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CAC2B,EAAA;AACjC,EAAA,MAAMC,QAAQ,GAAGC,WAAK,EAAE;AAExB,EAAA,MAAMC,MAAM,gBACVC,cAAA,CAACC,cAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,QAAQ;AACXC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,EAAE,EAAEP,QAAS;IACbQ,KAAK,EAAEX,IAAI,CAACY;AACZ;AAAA;AACAC,IAAAA,MAAM,EACJb,IAAI,CAACa,MAAM,IAAI;AACbC,MAAAA,IAAI,EAAEd,IAAI,CAACa,MAAM,CAACD,KAAK;AACvBG,MAAAA,OAAO,EAAEf,IAAI,CAACa,MAAM,CAACE;KAExB;AACDC,IAAAA,SAAS,EAAC;AAAyC,GAAA,CAEtD;AAED,EAAA;AAAA;AACE;AACA;AACAC,IAAAA,eAAA,CAACC,eAAO,EAAA;AACNV,MAAAA,EAAE,EAAC,SAAS;AACZC,MAAAA,IAAI,EAAC,OAAO;AACZ,MAAA,iBAAA,EAAiBN,QAAS;MAC1Ba,SAAS,EAAEG,SAAI,CAAC,OAAO,EAAEjB,MAAM,KAAK,IAAI,IAAI,4CAA4C,CAAE;MAAAkB,QAAA,EAAA,CAEzFlB,MAAM,IAAI,IAAI,GAAGG,MAAM,GAAG,IAAI,EAC9BL,IAAI,CAACqB,OAAO,CAACC,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,kBAC9BlB,cAAA,CAACmB;AACC;AAAA,QAAA;AAEAzB,QAAAA,IAAI,EAAEuB,MAAO;AACbtB,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,MAAM,EAAEA;OAAO,EAHVsB,KAGU,CAElB,CAAC;KACK;AAAC;AAEd;;;;"}