@transferwise/components 0.0.0-experimental-a9ab536 → 0.0.0-experimental-3df0347
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.
- package/build/dateInput/DateInput.js +5 -12
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +4 -11
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +8 -16
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +6 -14
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/index.js +7 -14
- package/build/index.js.map +1 -1
- package/build/index.mjs +3 -10
- package/build/index.mjs.map +1 -1
- package/build/inputs/SelectInput.js +890 -0
- package/build/inputs/SelectInput.js.map +1 -0
- package/build/inputs/SelectInput.messages.js.map +1 -0
- package/build/inputs/SelectInput.messages.mjs.map +1 -0
- package/build/inputs/SelectInput.mjs +881 -0
- package/build/inputs/SelectInput.mjs.map +1 -0
- package/build/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.js → _BottomSheet.js} +7 -7
- package/build/inputs/_BottomSheet.js.map +1 -0
- package/build/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.mjs → _BottomSheet.mjs} +7 -7
- package/build/inputs/_BottomSheet.mjs.map +1 -0
- package/build/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.js → _ButtonInput.js} +5 -5
- package/build/inputs/_ButtonInput.js.map +1 -0
- package/build/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.mjs → _ButtonInput.mjs} +5 -5
- package/build/inputs/_ButtonInput.mjs.map +1 -0
- package/build/inputs/{SelectInput/Popover/SelectInputPopover.js → _Popover.js} +4 -4
- package/build/inputs/_Popover.js.map +1 -0
- package/build/inputs/{SelectInput/Popover/SelectInputPopover.mjs → _Popover.mjs} +4 -4
- package/build/inputs/_Popover.mjs.map +1 -0
- package/build/main.css +91 -91
- package/build/moneyInput/MoneyInput.js +2 -9
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -8
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +3 -10
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +2 -9
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/styles/main.css +91 -91
- package/build/styles/sentimentSurface/SentimentSurface.css +1 -1
- package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +38 -12
- package/build/types/inputs/SelectInput.d.ts.map +1 -0
- package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
- package/build/types/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.d.ts → _BottomSheet.d.ts} +3 -3
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -0
- package/build/types/inputs/_ButtonInput.d.ts +5 -0
- package/build/types/inputs/_ButtonInput.d.ts.map +1 -0
- package/build/types/inputs/{SelectInput/Popover/SelectInputPopover.d.ts → _Popover.d.ts} +3 -3
- package/build/types/inputs/_Popover.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/inputs/{SelectInput/_stories/SelectInput.docs.mdx → SelectInput.docs.mdx} +1 -0
- package/src/inputs/SelectInput.less +219 -0
- package/src/inputs/{SelectInput/_stories/SelectInput.story.tsx → SelectInput.story.tsx} +8 -11
- package/src/inputs/{SelectInput/_stories/SelectInput.test.story.tsx → SelectInput.test.story.tsx} +10 -5
- package/src/inputs/{SelectInput/SelectInput.test.tsx → SelectInput.test.tsx} +11 -9
- package/src/inputs/SelectInput.tsx +1269 -0
- package/src/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.tsx → _BottomSheet.tsx} +7 -7
- package/src/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.tsx → _ButtonInput.tsx} +5 -5
- package/src/inputs/{SelectInput/Popover/SelectInputPopover.tsx → _Popover.tsx} +4 -4
- package/src/main.css +91 -91
- package/src/main.less +1 -1
- package/src/sentimentSurface/SentimentSurface.css +1 -1
- package/src/sentimentSurface/SentimentSurface.less +1 -1
- package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +0 -1
- package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +0 -1
- package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.js.map +0 -1
- package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.mjs.map +0 -1
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js +0 -27
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js.map +0 -1
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs +0 -25
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs.map +0 -1
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js +0 -59
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js.map +0 -1
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs +0 -56
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs.map +0 -1
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js +0 -50
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js.map +0 -1
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs +0 -48
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.js +0 -47
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.js.map +0 -1
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs +0 -45
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/Option/SelectInputOption.js +0 -42
- package/build/inputs/SelectInput/Option/SelectInputOption.js.map +0 -1
- package/build/inputs/SelectInput/Option/SelectInputOption.mjs +0 -40
- package/build/inputs/SelectInput/Option/SelectInputOption.mjs.map +0 -1
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js +0 -40
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +0 -1
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +0 -38
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +0 -1
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js +0 -48
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js.map +0 -1
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs +0 -46
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs.map +0 -1
- package/build/inputs/SelectInput/Options/SelectInputOptions.js +0 -300
- package/build/inputs/SelectInput/Options/SelectInputOptions.js.map +0 -1
- package/build/inputs/SelectInput/Options/SelectInputOptions.mjs +0 -298
- package/build/inputs/SelectInput/Options/SelectInputOptions.mjs.map +0 -1
- package/build/inputs/SelectInput/Popover/SelectInputPopover.js.map +0 -1
- package/build/inputs/SelectInput/Popover/SelectInputPopover.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.contexts.js +0 -29
- package/build/inputs/SelectInput/SelectInput.contexts.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.contexts.mjs +0 -24
- package/build/inputs/SelectInput/SelectInput.contexts.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.js +0 -222
- package/build/inputs/SelectInput/SelectInput.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.messages.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.messages.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.mjs +0 -216
- package/build/inputs/SelectInput/SelectInput.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.utils.js +0 -164
- package/build/inputs/SelectInput/SelectInput.utils.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.utils.mjs +0 -154
- package/build/inputs/SelectInput/SelectInput.utils.mjs.map +0 -1
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js +0 -43
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +0 -1
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs +0 -37
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +0 -1
- package/build/styles/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +0 -96
- package/build/styles/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +0 -16
- package/build/styles/inputs/SelectInput/ClearButton/SelectInputClearButton.css +0 -46
- package/build/styles/inputs/SelectInput/ItemView/SelectInputItemView.css +0 -16
- package/build/styles/inputs/SelectInput/Option/SelectInputOption.css +0 -33
- package/build/styles/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
- package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +0 -81
- package/build/styles/inputs/SelectInput/Popover/SelectInputPopover.css +0 -46
- package/build/types/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/BottomSheet/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/BottomSheet/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts +0 -5
- package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ButtonInput/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/ButtonInput/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts +0 -7
- package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ClearButton/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/ClearButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts +0 -16
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts +0 -12
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts +0 -14
- package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/index.d.ts +0 -4
- package/build/types/inputs/SelectInput/ItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts +0 -14
- package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Option/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/Option/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +0 -16
- package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/OptionContent/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/OptionContent/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts +0 -12
- package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts +0 -21
- package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/index.d.ts +0 -4
- package/build/types/inputs/SelectInput/Options/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Popover/SelectInputPopover.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Popover/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/Popover/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts +0 -33
- package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.d.ts +0 -10
- package/build/types/inputs/SelectInput/SelectInput.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.utils.d.ts +0 -61
- package/build/types/inputs/SelectInput/SelectInput.utils.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts +0 -18
- package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/TriggerButton/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/TriggerButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components.d.ts +0 -10
- package/build/types/inputs/SelectInput/components.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/index.d.ts +0 -12
- package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
- package/src/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +0 -96
- package/src/inputs/SelectInput/BottomSheet/index.ts +0 -2
- package/src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +0 -16
- package/src/inputs/SelectInput/ButtonInput/index.ts +0 -2
- package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.css +0 -46
- package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.less +0 -40
- package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.tsx +0 -29
- package/src/inputs/SelectInput/ClearButton/index.ts +0 -2
- package/src/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.tsx +0 -74
- package/src/inputs/SelectInput/DefaultRenderTrigger/index.ts +0 -5
- package/src/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.tsx +0 -64
- package/src/inputs/SelectInput/ItemView/GroupItemView/index.ts +0 -2
- package/src/inputs/SelectInput/ItemView/SelectInputItemView.css +0 -16
- package/src/inputs/SelectInput/ItemView/SelectInputItemView.less +0 -17
- package/src/inputs/SelectInput/ItemView/SelectInputItemView.tsx +0 -51
- package/src/inputs/SelectInput/ItemView/index.ts +0 -3
- package/src/inputs/SelectInput/Option/SelectInputOption.css +0 -33
- package/src/inputs/SelectInput/Option/SelectInputOption.less +0 -32
- package/src/inputs/SelectInput/Option/SelectInputOption.tsx +0 -60
- package/src/inputs/SelectInput/Option/index.ts +0 -2
- package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
- package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.less +0 -38
- package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +0 -75
- package/src/inputs/SelectInput/OptionContent/index.ts +0 -2
- package/src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx +0 -62
- package/src/inputs/SelectInput/Options/OptionsContainer/index.ts +0 -2
- package/src/inputs/SelectInput/Options/SelectInputOptions.css +0 -81
- package/src/inputs/SelectInput/Options/SelectInputOptions.less +0 -77
- package/src/inputs/SelectInput/Options/SelectInputOptions.tsx +0 -418
- package/src/inputs/SelectInput/Options/index.ts +0 -3
- package/src/inputs/SelectInput/Popover/SelectInputPopover.css +0 -46
- package/src/inputs/SelectInput/Popover/index.ts +0 -2
- package/src/inputs/SelectInput/SelectInput.contexts.tsx +0 -40
- package/src/inputs/SelectInput/SelectInput.less +0 -22
- package/src/inputs/SelectInput/SelectInput.tsx +0 -258
- package/src/inputs/SelectInput/SelectInput.types.ts +0 -113
- package/src/inputs/SelectInput/SelectInput.utils.ts +0 -206
- package/src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +0 -44
- package/src/inputs/SelectInput/TriggerButton/index.ts +0 -5
- package/src/inputs/SelectInput/components.ts +0 -10
- package/src/inputs/SelectInput/index.ts +0 -14
- package/build/inputs/{SelectInput/SelectInput.messages.js → SelectInput.messages.js} +0 -0
- package/build/inputs/{SelectInput/SelectInput.messages.mjs → SelectInput.messages.mjs} +0 -0
- package/{src/inputs/SelectInput → build/styles/inputs}/SelectInput.css +90 -90
- package/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
- package/{build/styles/inputs/SelectInput → src/inputs}/SelectInput.css +90 -90
- /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
- /package/src/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.less → _BottomSheet.less} +0 -0
- /package/src/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.less → _ButtonInput.less} +0 -0
- /package/src/inputs/{SelectInput/Popover/SelectInputPopover.less → _Popover.less} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Props for the SelectInputOptionContent component.
|
|
3
|
-
*/
|
|
4
|
-
export interface SelectInputOptionContentProps {
|
|
5
|
-
title: React.ReactNode;
|
|
6
|
-
note?: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
icon?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Component for rendering structured content within a SelectInput option.
|
|
12
|
-
* Supports title, optional note, description, and icon with different styling
|
|
13
|
-
* based on whether it's rendered within the trigger button or the dropdown.
|
|
14
|
-
*/
|
|
15
|
-
export declare function SelectInputOptionContent({ title, note, description, icon, }: SelectInputOptionContentProps): import("react").JSX.Element;
|
|
16
|
-
//# sourceMappingURL=SelectInputOptionContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionContent.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE,6BAA6B,+BAkD/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/OptionContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC"}
|
package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Props for the SelectInputOptionsContainer component.
|
|
3
|
-
*/
|
|
4
|
-
export interface SelectInputOptionsContainerProps extends React.ComponentPropsWithRef<'div'> {
|
|
5
|
-
onAriaActiveDescendantChange: (value: React.AriaAttributes['aria-activedescendant']) => void;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Container component for SelectInput options.
|
|
9
|
-
* Handles keyboard navigation and accessibility features.
|
|
10
|
-
*/
|
|
11
|
-
export declare const SelectInputOptionsContainer: import("react").ForwardRefExoticComponent<Omit<SelectInputOptionsContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
12
|
-
//# sourceMappingURL=SelectInputOptionsContainer.d.ts.map
|
package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionsContainer.d.ts","sourceRoot":"","sources":["../../../../../../src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,gCAAiC,SAAQ,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC;IAC1F,4BAA4B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAC;CAC9F;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,iJA+CtC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/inputs/SelectInput/Options/OptionsContainer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,YAAY,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SelectInputProps } from '../SelectInput.types';
|
|
2
|
-
/**
|
|
3
|
-
* Props for the SelectInputOptions component.
|
|
4
|
-
*/
|
|
5
|
-
export interface SelectInputOptionsProps<T = string> extends Pick<SelectInputProps<T>, 'items' | 'renderValue' | 'renderFooter' | 'filterable' | 'filterPlaceholder' | 'id' | 'parentId' | 'compareValues' | 'sortFilteredOptions'> {
|
|
6
|
-
searchInputRef: React.MutableRefObject<HTMLInputElement | null>;
|
|
7
|
-
listboxRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
8
|
-
filterQuery: string;
|
|
9
|
-
onFilterChange: (query: string) => void;
|
|
10
|
-
listBoxLabel?: string;
|
|
11
|
-
listBoxLabelledBy?: string;
|
|
12
|
-
autocomplete?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
onAutocompleteSelect?: (value: T) => void;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* The main options container component for SelectInput.
|
|
18
|
-
* Manages filtering, virtualization, and rendering of options.
|
|
19
|
-
*/
|
|
20
|
-
export declare function SelectInputOptions<T = string>({ id, parentId, items, compareValues: compareValuesProp, renderValue, renderFooter, filterable, filterPlaceholder, sortFilteredOptions, searchInputRef, listboxRef, filterQuery, onFilterChange, listBoxLabel, listBoxLabelledBy, autocomplete, name, onAutocompleteSelect, }: SelectInputOptionsProps<T>): import("react").JSX.Element;
|
|
21
|
-
//# sourceMappingURL=SelectInputOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptions.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/Options/SelectInputOptions.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAyB,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AAMhG;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,IAAI,CAC/D,gBAAgB,CAAC,CAAC,CAAC,EACjB,OAAO,GACP,aAAa,GACb,cAAc,GACd,YAAY,GACZ,mBAAmB,GACnB,IAAI,GACJ,UAAU,GACV,eAAe,GACf,qBAAqB,CACxB;IACC,cAAc,EAAE,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAChE,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,MAAM,EAAE,EAC7C,EAAE,EACF,QAAQ,EACR,KAAK,EACL,aAAa,EAAE,iBAAiB,EAChC,WAAoB,EACpB,YAAY,EACZ,UAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,IAAI,EACJ,oBAAoB,GACrB,EAAE,uBAAuB,CAAC,CAAC,CAAC,+BAsV5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/Options/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputPopover.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/Popover/SelectInputPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAOf,MAAM,oBAAoB,CAAC;AAS5B,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChC,mBAAmB,EAAE,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK;YACvE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAID,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,aAAa,EACb,KAAK,EACL,IAAW,EACX,OAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,uBAAuB,+BAmFzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/Popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Context for passing props to the SelectInputTriggerButton component.
|
|
4
|
-
*/
|
|
5
|
-
export interface SelectInputTriggerButtonPropsContextValue {
|
|
6
|
-
ref?: React.ForwardedRef<HTMLButtonElement | null>;
|
|
7
|
-
id?: string;
|
|
8
|
-
onClick?: (event: React.MouseEvent) => void;
|
|
9
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
10
|
-
size?: 'sm' | 'md' | 'lg';
|
|
11
|
-
[key: string]: unknown;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Context for passing props to the SelectInputTriggerButton component.
|
|
15
|
-
*/
|
|
16
|
-
export declare const SelectInputTriggerButtonPropsContext: React.Context<SelectInputTriggerButtonPropsContextValue>;
|
|
17
|
-
/**
|
|
18
|
-
* Context for providing the total count of items in a SelectInput.
|
|
19
|
-
* Used for ARIA accessibility to inform screen readers about the total number of options.
|
|
20
|
-
*/
|
|
21
|
-
export declare const SelectInputItemsCountContext: React.Context<number | undefined>;
|
|
22
|
-
/**
|
|
23
|
-
* Context for providing the current item position in a SelectInput.
|
|
24
|
-
* Used for ARIA accessibility to inform screen readers about the position of the option.
|
|
25
|
-
*/
|
|
26
|
-
export declare const SelectInputItemPositionContext: React.Context<number | undefined>;
|
|
27
|
-
/**
|
|
28
|
-
* Context indicating whether an option's content is rendered within the trigger button.
|
|
29
|
-
* When true, certain styling adjustments are applied to make the content fit better in the trigger.
|
|
30
|
-
*/
|
|
31
|
-
export declare const SelectInputOptionContentWithinTriggerContext: React.Context<boolean>;
|
|
32
|
-
export type { WithInputAttributesProps } from '../contexts';
|
|
33
|
-
//# sourceMappingURL=SelectInput.contexts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.contexts.d.ts","sourceRoot":"","sources":["../../../../src/inputs/SelectInput/SelectInput.contexts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,yCAAyC;IACxD,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACnD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IACjD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,oCAAoC,0DACa,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,4BAA4B,mCAA+C,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,mCAA+C,CAAC;AAE3F;;;GAGG;AACH,eAAO,MAAM,4CAA4C,wBAAuB,CAAC;AAGjF,YAAY,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SelectInputProps } from './SelectInput.types';
|
|
2
|
-
/**
|
|
3
|
-
* SelectInput component allows users to select an option from a dropdown list.
|
|
4
|
-
* Supports filtering, multiple selection, and customization.
|
|
5
|
-
*/
|
|
6
|
-
export declare function SelectInput<T = string, M extends boolean = false>({ id: idProp, parentId, name, multiple, placeholder, autocomplete, items, defaultValue, value: controlledValue, compareValues, renderValue, renderFooter, renderTrigger, filterable, filterPlaceholder, sortFilteredOptions, disabled, size, className, UNSAFE_triggerButtonProps, triggerRef: externalTriggerRef, onFilterChange, onChange, onOpen, onClose, onClear, }: SelectInputProps<T, M>): import("react").JSX.Element;
|
|
7
|
-
export declare namespace SelectInput {
|
|
8
|
-
var sortByRelevance: typeof import("./SelectInput.utils").sortByRelevance;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=SelectInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../../src/inputs/SelectInput/SelectInput.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,SAAS,OAAO,GAAG,KAAK,EAAE,EACjE,EAAE,EAAE,MAAM,EACV,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,KAAK,EAAE,eAAe,EACtB,aAAa,EACb,WAAoB,EACpB,YAAY,EACZ,aAAoC,EACpC,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,IAAW,EACX,SAAS,EACT,yBAAyB,EACzB,UAAU,EAAE,kBAAkB,EAC9B,cAAqB,EACrB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,GACR,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,+BAwMxB;yBAnOe,WAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.messages.d.ts","sourceRoot":"","sources":["../../../../src/inputs/SelectInput/SelectInput.messages.ts"],"names":[],"mappings":";;;;;;;AAEA,wBAMG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.types.d.ts","sourceRoot":"","sources":["../../../../src/inputs/SelectInput/SelectInput.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { SelectInputItem, SelectInputOptionItem } from './SelectInput.types';
|
|
2
|
-
declare const MAX_ITEMS_WITHOUT_VIRTUALIZATION = 50;
|
|
3
|
-
export { MAX_ITEMS_WITHOUT_VIRTUALIZATION };
|
|
4
|
-
/**
|
|
5
|
-
* Converts a string to a normalized, searchable format by:
|
|
6
|
-
* - Trimming whitespace
|
|
7
|
-
* - Normalizing whitespace (convert multiple spaces to single space)
|
|
8
|
-
* - Converting to NFD normalization form to handle diacritics
|
|
9
|
-
* - Removing combining diacritical marks
|
|
10
|
-
* - Converting to lowercase
|
|
11
|
-
*/
|
|
12
|
-
export declare function searchableString(value: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Extracts searchable strings from a value.
|
|
15
|
-
* - If the value is a string, returns a normalized version.
|
|
16
|
-
* - If the value is an object, extracts all string values and normalizes them.
|
|
17
|
-
* - Otherwise returns an empty array.
|
|
18
|
-
*/
|
|
19
|
-
export declare function inferSearchableStrings(value: unknown): string[];
|
|
20
|
-
/**
|
|
21
|
-
* Sets the value of a duplicate option item to undefined, effectively hiding it when rendered.
|
|
22
|
-
*/
|
|
23
|
-
export declare function dedupeSelectInputOptionItem<T>(item: SelectInputOptionItem<T>, existingValues: Set<T>, compareValues?: (a: T, b: T) => boolean): SelectInputOptionItem<T | undefined>;
|
|
24
|
-
/**
|
|
25
|
-
* Sets the `value` of duplicate option items to `undefined`, hiding them when
|
|
26
|
-
* rendered. Indexes are kept intact within groups to preserve the active item
|
|
27
|
-
* between filter changes when possible.
|
|
28
|
-
*/
|
|
29
|
-
export declare function dedupeSelectInputItems<T>(items: readonly SelectInputItem<T>[], compareValues?: (a: T, b: T) => boolean): SelectInputItem<T | undefined>[];
|
|
30
|
-
/**
|
|
31
|
-
* Checks if a SelectInputOptionItem matches the search needle.
|
|
32
|
-
*/
|
|
33
|
-
export declare function selectInputOptionItemIncludesNeedle<T>(item: SelectInputOptionItem<T>, needle: string): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Filters SelectInputItems based on the provided predicate function.
|
|
36
|
-
* For group items, it checks if any of their options match the predicate.
|
|
37
|
-
*/
|
|
38
|
-
export declare function filterSelectInputItems<T>(items: readonly SelectInputItem<T>[], predicate: (item: SelectInputOptionItem<T>) => boolean): SelectInputItem<T>[];
|
|
39
|
-
/**
|
|
40
|
-
* Flattens and sorts filtered options using the provided comparator.
|
|
41
|
-
* Extracts all options from groups, filters out undefined values (deduplicated items),
|
|
42
|
-
* sorts them, and returns as a flat list of option items.
|
|
43
|
-
*/
|
|
44
|
-
export declare function sortSelectInputItems<T>(items: readonly SelectInputItem<T | undefined>[], compareFn: (a: SelectInputOptionItem<NonNullable<T>>, b: SelectInputOptionItem<NonNullable<T>>, searchQuery: string) => number, searchQuery: string): SelectInputItem<NonNullable<T>>[];
|
|
45
|
-
/**
|
|
46
|
-
* A prebuilt sort function for `sortFilteredOptions` that sorts options by relevance to the search query.
|
|
47
|
-
* Prioritizes: exact matches > starts with > contains > alphabetical.
|
|
48
|
-
*
|
|
49
|
-
* @param getLabel - Function to extract the label string from the option value. Defaults to using `title` property.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```tsx
|
|
53
|
-
* <SelectInput
|
|
54
|
-
* filterable
|
|
55
|
-
* sortFilteredOptions={sortByRelevance((value) => value.name)}
|
|
56
|
-
* // ...
|
|
57
|
-
* />
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare function sortByRelevance<T>(getLabel?: (value: T) => string): (a: SelectInputOptionItem<T>, b: SelectInputOptionItem<T>, searchQuery: string) => number;
|
|
61
|
-
//# sourceMappingURL=SelectInput.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.utils.d.ts","sourceRoot":"","sources":["../../../../src/inputs/SelectInput/SelectInput.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,QAAA,MAAM,gCAAgC,KAAK,CAAC;AAC5C,OAAO,EAAE,gCAAgC,EAAE,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,UAW7C;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,YAYpD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,EAC3C,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAC9B,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,EACtB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,GACtC,qBAAqB,CAAC,CAAC,GAAG,SAAS,CAAC,CAUtC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,KAAK,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,EACpC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,GACtC,eAAe,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAoBlC;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,CAAC,EACnD,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAC9B,MAAM,EAAE,MAAM,WAKf;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,KAAK,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,EACpC,SAAS,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,OAAO,wBAcvD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,KAAK,EAAE,SAAS,eAAe,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,EAChD,SAAS,EAAE,CACT,CAAC,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EACxC,CAAC,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EACxC,WAAW,EAAE,MAAM,KAChB,MAAM,EACX,WAAW,EAAE,MAAM,GAClB,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAiBnC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,QAAQ,GAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAsD,GAC7E,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,KAAK,MAAM,CA2B3F"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Merge } from '../../../utils';
|
|
2
|
-
/**
|
|
3
|
-
* Type for the trigger button element.
|
|
4
|
-
*/
|
|
5
|
-
export type SelectInputTriggerButtonElementType = 'button' | React.ComponentType;
|
|
6
|
-
/**
|
|
7
|
-
* Props for the SelectInputTriggerButton component.
|
|
8
|
-
*/
|
|
9
|
-
export type SelectInputTriggerButtonProps<T extends SelectInputTriggerButtonElementType = 'button'> = Merge<React.ComponentPropsWithoutRef<T>, {
|
|
10
|
-
as?: T;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* The trigger button component for SelectInput.
|
|
14
|
-
* Uses Headless UI's ListboxButton with polymorphic support to allow
|
|
15
|
-
* rendering as different element types.
|
|
16
|
-
*/
|
|
17
|
-
export declare function SelectInputTriggerButton<T extends SelectInputTriggerButtonElementType = 'button'>({ as, ...restProps }: SelectInputTriggerButtonProps<T>): import("react").JSX.Element;
|
|
18
|
-
//# sourceMappingURL=SelectInputTriggerButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputTriggerButton.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC;AAEjF;;GAEG;AACH,MAAM,MAAM,6BAA6B,CACvC,CAAC,SAAS,mCAAmC,GAAG,QAAQ,IACtD,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE;IAAE,EAAE,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,mCAAmC,GAAG,QAAQ,EAAE,EACjG,EAAkB,EAClB,GAAG,SAAS,EACb,EAAE,6BAA6B,CAAC,CAAC,CAAC,+BAclC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/inputs/SelectInput/TriggerButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EACV,mCAAmC,EACnC,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './ClearButton';
|
|
2
|
-
export * from './Option';
|
|
3
|
-
export * from './OptionContent';
|
|
4
|
-
export * from './TriggerButton';
|
|
5
|
-
export * from './ItemView';
|
|
6
|
-
export * from './Options';
|
|
7
|
-
export * from './BottomSheet';
|
|
8
|
-
export * from './Popover';
|
|
9
|
-
export * from './ButtonInput';
|
|
10
|
-
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/inputs/SelectInput/components.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './SelectInput';
|
|
2
|
-
export * from './SelectInput.types';
|
|
3
|
-
export * from './SelectInput.utils';
|
|
4
|
-
export * from './SelectInput.contexts';
|
|
5
|
-
export * from './ClearButton';
|
|
6
|
-
export * from './Option';
|
|
7
|
-
export * from './OptionContent';
|
|
8
|
-
export * from './TriggerButton';
|
|
9
|
-
export * from './DefaultRenderTrigger';
|
|
10
|
-
export * from './ItemView';
|
|
11
|
-
export * from './Options';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/inputs/SelectInput/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
.np-bottom-sheet-v2-container {
|
|
2
|
-
position: relative;
|
|
3
|
-
z-index: 1060;
|
|
4
|
-
}
|
|
5
|
-
.np-bottom-sheet-v2-backdrop {
|
|
6
|
-
position: fixed;
|
|
7
|
-
inset: 0px;
|
|
8
|
-
background-color: #37517e;
|
|
9
|
-
background-color: var(--color-content-primary);
|
|
10
|
-
opacity: 0.4;
|
|
11
|
-
transition-property: opacity;
|
|
12
|
-
transition-timing-function: ease-out;
|
|
13
|
-
transition-duration: 300ms;
|
|
14
|
-
}
|
|
15
|
-
.np-bottom-sheet-v2-backdrop--closed {
|
|
16
|
-
opacity: 0;
|
|
17
|
-
}
|
|
18
|
-
.np-bottom-sheet-v2 {
|
|
19
|
-
position: fixed;
|
|
20
|
-
inset: 0px;
|
|
21
|
-
bottom: env(keyboard-inset-height, 0px);
|
|
22
|
-
margin-left: 8px;
|
|
23
|
-
margin-left: var(--size-8);
|
|
24
|
-
margin-right: 8px;
|
|
25
|
-
margin-right: var(--size-8);
|
|
26
|
-
margin-top: 64px;
|
|
27
|
-
margin-top: var(--size-64);
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
justify-content: flex-end;
|
|
31
|
-
}
|
|
32
|
-
.np-bottom-sheet-v2-content {
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
overflow: auto;
|
|
36
|
-
border-top-left-radius: 32px;
|
|
37
|
-
/* TODO: Tokenize */
|
|
38
|
-
border-top-right-radius: 32px;
|
|
39
|
-
/* TODO: Tokenize */
|
|
40
|
-
background-color: #ffffff;
|
|
41
|
-
background-color: var(--color-background-elevated);
|
|
42
|
-
box-shadow: 0 0 40px rgba(69, 71, 69, 0.2);
|
|
43
|
-
}
|
|
44
|
-
.np-bottom-sheet-v2-content:focus {
|
|
45
|
-
outline: none;
|
|
46
|
-
}
|
|
47
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
48
|
-
.np-bottom-sheet-v2-content {
|
|
49
|
-
transition-property: transform;
|
|
50
|
-
transition-timing-function: ease-out;
|
|
51
|
-
transition-duration: 300ms;
|
|
52
|
-
}
|
|
53
|
-
.np-bottom-sheet-v2-content--closed {
|
|
54
|
-
transform: translateY(100%);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
@media (prefers-reduced-motion: reduce) {
|
|
58
|
-
.np-bottom-sheet-v2-content {
|
|
59
|
-
transition-property: opacity;
|
|
60
|
-
transition-timing-function: ease-out;
|
|
61
|
-
transition-duration: 300ms;
|
|
62
|
-
}
|
|
63
|
-
.np-bottom-sheet-v2-content--closed {
|
|
64
|
-
opacity: 0;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
.np-bottom-sheet-v2-header {
|
|
68
|
-
align-self: flex-end;
|
|
69
|
-
padding: 16px;
|
|
70
|
-
padding: var(--size-16);
|
|
71
|
-
}
|
|
72
|
-
.np-bottom-sheet-v2-content-inner {
|
|
73
|
-
display: grid;
|
|
74
|
-
grid-template-rows: minmax(0, 1fr);
|
|
75
|
-
grid-row-gap: 8px;
|
|
76
|
-
grid-row-gap: var(--size-8);
|
|
77
|
-
row-gap: 8px;
|
|
78
|
-
row-gap: var(--size-8);
|
|
79
|
-
overflow: auto;
|
|
80
|
-
}
|
|
81
|
-
.np-bottom-sheet-v2-content-inner--has-title {
|
|
82
|
-
grid-template-rows: auto minmax(0, 1fr);
|
|
83
|
-
}
|
|
84
|
-
.np-bottom-sheet-v2-content-inner--padding-md {
|
|
85
|
-
padding: 16px;
|
|
86
|
-
padding: var(--size-16);
|
|
87
|
-
padding-top: 0px;
|
|
88
|
-
}
|
|
89
|
-
.np-bottom-sheet-v2-title {
|
|
90
|
-
color: #37517e;
|
|
91
|
-
color: var(--color-content-primary);
|
|
92
|
-
}
|
|
93
|
-
.np-bottom-sheet-v2-body {
|
|
94
|
-
color: #5d7079;
|
|
95
|
-
color: var(--color-content-secondary);
|
|
96
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
.np-button-input {
|
|
2
|
-
display: inline-grid;
|
|
3
|
-
grid-auto-columns: minmax(0, 1fr);
|
|
4
|
-
align-content: center;
|
|
5
|
-
border-radius: 10px;
|
|
6
|
-
border-radius: var(--size-10);
|
|
7
|
-
text-align: start;
|
|
8
|
-
}
|
|
9
|
-
.np-button-input:has(.np-select-input-option-description-in-trigger) {
|
|
10
|
-
height: auto !important;
|
|
11
|
-
align-content: start;
|
|
12
|
-
padding-top: 12px !important;
|
|
13
|
-
padding-top: var(--size-12) !important;
|
|
14
|
-
padding-bottom: 12px !important;
|
|
15
|
-
padding-bottom: var(--size-12) !important;
|
|
16
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
.np-select-input-addon-container {
|
|
2
|
-
pointer-events: none;
|
|
3
|
-
margin-inline-start: 4px;
|
|
4
|
-
margin-inline-start: var(--size-4);
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
}
|
|
8
|
-
.np-select-input-addon-container > :not([hidden]) ~ :not([hidden]) {
|
|
9
|
-
margin-inline-start: 4px;
|
|
10
|
-
margin-inline-start: var(--size-4);
|
|
11
|
-
}
|
|
12
|
-
.np-select-input-addon {
|
|
13
|
-
border-width: 0;
|
|
14
|
-
background: none;
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
height: 24px;
|
|
17
|
-
height: var(--size-24);
|
|
18
|
-
width: 24px;
|
|
19
|
-
width: var(--size-24);
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
border-radius: 0.125rem /* 2px */;
|
|
23
|
-
/* TODO: Tokenize */
|
|
24
|
-
}
|
|
25
|
-
.np-select-input-addon--interactive {
|
|
26
|
-
pointer-events: auto;
|
|
27
|
-
color: #c9cbce;
|
|
28
|
-
color: var(--color-interactive-secondary);
|
|
29
|
-
}
|
|
30
|
-
.np-select-input-addon--interactive:hover {
|
|
31
|
-
color: #b5b7ba;
|
|
32
|
-
color: var(--color-interactive-secondary-hover);
|
|
33
|
-
}
|
|
34
|
-
.np-select-input-addon--interactive:focus {
|
|
35
|
-
outline: none;
|
|
36
|
-
}
|
|
37
|
-
.np-select-input-addon--interactive:focus-visible {
|
|
38
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
39
|
-
outline-offset: var(--ring-outline-offset);
|
|
40
|
-
}
|
|
41
|
-
.np-select-input-addon-separator {
|
|
42
|
-
height: 24px;
|
|
43
|
-
height: var(--size-24);
|
|
44
|
-
border-inline-start: 1px solid rgba(0,0,0,0.10196);
|
|
45
|
-
border-inline-start: 1px solid var(--color-border-neutral);
|
|
46
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
@import (reference) "../../../../node_modules/@transferwise/neptune-css/src/less/ring.less";
|
|
2
|
-
|
|
3
|
-
.np-select-input-addon-container {
|
|
4
|
-
pointer-events: none;
|
|
5
|
-
margin-inline-start: var(--size-4);
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
|
|
9
|
-
& > :not([hidden]) ~ :not([hidden]) {
|
|
10
|
-
margin-inline-start: var(--size-4);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.np-select-input-addon {
|
|
15
|
-
border-width: 0;
|
|
16
|
-
background: none;
|
|
17
|
-
|
|
18
|
-
display: inline-flex;
|
|
19
|
-
height: var(--size-24);
|
|
20
|
-
width: var(--size-24);
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
border-radius: 0.125rem /* 2px */; /* TODO: Tokenize */
|
|
24
|
-
|
|
25
|
-
&--interactive {
|
|
26
|
-
pointer-events: auto;
|
|
27
|
-
color: var(--color-interactive-secondary);
|
|
28
|
-
|
|
29
|
-
&:hover {
|
|
30
|
-
color: var(--color-interactive-secondary-hover);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.focus-ring();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.np-select-input-addon-separator {
|
|
38
|
-
height: var(--size-24);
|
|
39
|
-
border-inline-start: 1px solid var(--color-border-neutral);
|
|
40
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Cross } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { useIntl } from 'react-intl';
|
|
4
|
-
import dateTriggerMessages from '../../../dateLookup/dateTrigger/DateTrigger.messages';
|
|
5
|
-
|
|
6
|
-
export interface SelectInputClearButtonProps extends Pick<
|
|
7
|
-
React.ComponentPropsWithoutRef<'button'>,
|
|
8
|
-
'className' | 'onClick'
|
|
9
|
-
> {}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A button component used to clear the selected value in a SelectInput.
|
|
13
|
-
*/
|
|
14
|
-
export function SelectInputClearButton({ className, onClick }: SelectInputClearButtonProps) {
|
|
15
|
-
const intl = useIntl();
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<button
|
|
19
|
-
type="button"
|
|
20
|
-
aria-label={intl.formatMessage(dateTriggerMessages.ariaLabel)}
|
|
21
|
-
className={clsx(className, 'np-select-input-addon np-select-input-addon--interactive')}
|
|
22
|
-
onClick={onClick}
|
|
23
|
-
>
|
|
24
|
-
<Cross size={16} />
|
|
25
|
-
</button>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Type is already exported above
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { ChevronDown } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import { InputGroup } from '../../../inputs/InputGroup';
|
|
6
|
-
import { SelectInputClearButton } from '../ClearButton';
|
|
7
|
-
import { SelectInputTriggerButton } from '../TriggerButton';
|
|
8
|
-
import { SelectInputProps } from '../SelectInput.types';
|
|
9
|
-
import { SelectInputButtonInput } from '../ButtonInput';
|
|
10
|
-
|
|
11
|
-
export interface SelectInputDefaultRenderTriggerProps {
|
|
12
|
-
content: React.ReactNode;
|
|
13
|
-
placeholderShown: boolean;
|
|
14
|
-
clear: (() => void) | undefined;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
size: 'sm' | 'md' | 'lg';
|
|
17
|
-
className: string | undefined;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Default render function for the SelectInput trigger.
|
|
22
|
-
* Displays the selected value or placeholder with clear button and dropdown indicator.
|
|
23
|
-
*/
|
|
24
|
-
export function SelectInputDefaultRenderTrigger({
|
|
25
|
-
content,
|
|
26
|
-
placeholderShown,
|
|
27
|
-
clear,
|
|
28
|
-
disabled,
|
|
29
|
-
size,
|
|
30
|
-
className,
|
|
31
|
-
}: SelectInputDefaultRenderTriggerProps) {
|
|
32
|
-
return (
|
|
33
|
-
<InputGroup
|
|
34
|
-
addonEnd={{
|
|
35
|
-
content: (
|
|
36
|
-
<span className={clsx('np-select-input-addon-container', disabled && 'disabled')}>
|
|
37
|
-
{clear != null && !placeholderShown ? (
|
|
38
|
-
<>
|
|
39
|
-
<SelectInputClearButton
|
|
40
|
-
onClick={(event) => {
|
|
41
|
-
event.preventDefault();
|
|
42
|
-
clear();
|
|
43
|
-
}}
|
|
44
|
-
/>
|
|
45
|
-
<span className="np-select-input-addon-separator" />
|
|
46
|
-
</>
|
|
47
|
-
) : null}
|
|
48
|
-
<span className="np-select-input-addon">
|
|
49
|
-
<ChevronDown size={16} />
|
|
50
|
-
</span>
|
|
51
|
-
</span>
|
|
52
|
-
),
|
|
53
|
-
initialContentWidth: 24 + 4,
|
|
54
|
-
padding: 'sm',
|
|
55
|
-
}}
|
|
56
|
-
disabled={disabled}
|
|
57
|
-
className={className}
|
|
58
|
-
>
|
|
59
|
-
<SelectInputTriggerButton as={SelectInputButtonInput} size={size}>
|
|
60
|
-
<span
|
|
61
|
-
className={clsx(
|
|
62
|
-
'np-select-input-content',
|
|
63
|
-
placeholderShown && 'np-select-input-placeholder',
|
|
64
|
-
)}
|
|
65
|
-
>
|
|
66
|
-
{content}
|
|
67
|
-
</span>
|
|
68
|
-
</SelectInputTriggerButton>
|
|
69
|
-
</InputGroup>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const DefaultRenderTrigger =
|
|
74
|
-
SelectInputDefaultRenderTrigger satisfies SelectInputProps['renderTrigger'];
|