@tap-payments/os-micro-frontend-shared 0.3.45 → 0.3.47
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/_chunks/chunk-BTDALREB.js +1 -0
- package/build/_chunks/{chunk-Q6V365AB.js → chunk-QHQNNF4J.js} +1 -1
- package/build/components/Accordion/index.js +1 -1
- package/build/components/AccountDropdown/index.js +1 -1
- package/build/components/ActionMenu/index.js +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/ActivityAreaChart/index.js +1 -1
- package/build/components/Amount/index.js +1 -1
- package/build/components/AmountConversionFilter/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AmountSlider/index.js +1 -1
- package/build/components/AmountStatusChip/index.js +1 -1
- package/build/components/AnimatedSpinnerIcon/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/AuthenticationTypeChip/index.js +1 -1
- package/build/components/Autocomplete/index.js +1 -1
- package/build/components/BetaBanner/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/Button/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/CardEmptyState/index.js +1 -1
- package/build/components/Checkbox/index.js +1 -1
- package/build/components/Chip/index.js +1 -1
- package/build/components/ChipStack/index.js +1 -1
- package/build/components/CircularProgressWithLabel/index.js +1 -1
- package/build/components/Collapse/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CopyImage/index.js +1 -1
- package/build/components/CountBadge/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CountryFlag/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyFilter/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/CustomBackdrop/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/Dialog/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/DisplayAmount/index.js +1 -1
- package/build/components/Dropdown2/index.js +1 -1
- package/build/components/DropdownButton/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/Error/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FieldFeedback/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUpload/index.js +1 -1
- package/build/components/FileUploader/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FlagDetails/index.js +1 -1
- package/build/components/FlippingCard/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IOSSwitch/index.js +1 -1
- package/build/components/Icon/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- package/build/components/Input/index.js +1 -1
- package/build/components/InputBase/index.js +1 -1
- package/build/components/InputNumber/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/LanguageDropdown/index.js +1 -1
- package/build/components/LazyImage/index.js +1 -1
- package/build/components/LeftPeekRightExpandingChip/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/ListLayout/index.js +1 -1
- package/build/components/Loader/index.js +1 -1
- package/build/components/MFWidgetLoader/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/Menu/index.js +1 -1
- package/build/components/MenuItem/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/MultiSelectDropdownButton/index.js +1 -1
- package/build/components/MultiSelectWithSearch/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/NoInternet/index.js +1 -1
- package/build/components/OpenFileInNewTab/index.js +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/ProgressBar/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RFH/index.js +1 -1
- package/build/components/RadioButton/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/ReceiptsViewer/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/ResizableHeightInput/index.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/index.js +1 -1
- package/build/components/SalesChannelFilter/index.js +1 -1
- package/build/components/ScrollLoader/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchListInput/index.js +1 -1
- package/build/components/SelectDropdown/index.js +1 -1
- package/build/components/SelectWithSearch/index.js +1 -1
- package/build/components/SimpleDialog/index.js +1 -1
- package/build/components/Skeleton/index.js +1 -1
- package/build/components/Slider/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusChip/index.js +1 -1
- package/build/components/StatusChipWithCopy/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusGroupChips/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/Toaster/index.js +1 -1
- package/build/components/ToggleButtons/index.js +1 -1
- package/build/components/ToggleView/index.js +1 -1
- package/build/components/Toolbar/index.js +1 -1
- package/build/components/ToolbarIcon/index.js +1 -1
- package/build/components/TooltipChip/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/Window/index.js +1 -1
- package/build/components/WindowAppIcon/index.js +1 -1
- package/build/components/WindowBackdrop/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/_v2/composites/Autocomplete/Autocomplete.d.ts +4 -0
- package/build/components/_v2/composites/Autocomplete/icons/LoadingIcon.d.ts +4 -0
- package/build/components/_v2/composites/Autocomplete/icons/SearchIcon.d.ts +3 -0
- package/build/components/_v2/composites/Autocomplete/icons/index.d.ts +2 -0
- package/build/components/_v2/composites/Autocomplete/index.d.ts +2 -0
- package/build/components/_v2/composites/Autocomplete/style.d.ts +83 -0
- package/build/components/_v2/composites/Autocomplete/type.d.ts +81 -0
- package/build/components/_v2/composites/GroupedSelect/type.d.ts +7 -7
- package/build/components/_v2/composites/NestedMultiSelect/type.d.ts +4 -4
- package/build/components/_v2/composites/index.d.ts +2 -0
- package/build/components/_v2/forms/RHFAutocomplete/RHFAutocomplete.d.ts +23 -0
- package/build/components/_v2/forms/RHFAutocomplete/index.d.ts +2 -0
- package/build/components/_v2/forms/RHFMultiSelect/RHFMultiSelect.d.ts +1 -1
- package/build/components/_v2/forms/index.d.ts +2 -0
- package/build/components/_v2/index.js +9 -2
- package/build/components/_v2/primitives/MultiSelectBase/type.d.ts +7 -7
- package/build/components/_v2/primitives/SelectBase/SelectOptions.d.ts +4 -4
- package/build/components/_v2/primitives/SelectBase/type.d.ts +7 -7
- package/build/components/_v2/primitives/Typography/Typography.d.ts +4 -0
- package/build/components/_v2/primitives/Typography/index.d.ts +2 -0
- package/build/components/_v2/primitives/Typography/type.d.ts +30 -0
- package/build/components/index.js +1 -1
- package/build/constants/index.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/types/brand.d.ts +115 -38
- package/build/types/entity.d.ts +138 -72
- package/build/types/index.js +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-C24XFE7G.js +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import type { InputFeedbackProps } from '../../primitives/InputFeedback/type';
|
|
4
|
+
export interface AutocompleteOption {
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string | number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Props for Autocomplete — a single-select field with autocomplete/typing support.
|
|
12
|
+
* Similar to FormSelect's searchable prop but styled to match Select composite.
|
|
13
|
+
* Users can type to search and filter options from a dropdown menu.
|
|
14
|
+
*
|
|
15
|
+
* **Value handling:** `value` and `onChange` work with primitive identifiers (strings),
|
|
16
|
+
* not full option objects. This provides better integration with form libraries.
|
|
17
|
+
*/
|
|
18
|
+
export interface AutocompleteProps<T = AutocompleteOption> {
|
|
19
|
+
/** Visible label rendered above the input */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Plain helper text shown below when no feedback is supplied */
|
|
22
|
+
helperText?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Rich feedback panel rendered flush below the input.
|
|
25
|
+
* Adjusts the input border colour and radius to connect visually.
|
|
26
|
+
* Takes priority over `helperText` when both are supplied.
|
|
27
|
+
*/
|
|
28
|
+
feedback?: InputFeedbackProps | null;
|
|
29
|
+
/** Marks the input border as error state */
|
|
30
|
+
error?: boolean;
|
|
31
|
+
/** Styling for the field root wrapper */
|
|
32
|
+
sx?: SxProps<Theme>;
|
|
33
|
+
/** List of options to populate the dropdown */
|
|
34
|
+
options?: T[];
|
|
35
|
+
/** Currently selected value — a primitive identifier string (not the full option object) */
|
|
36
|
+
value?: string | null;
|
|
37
|
+
/** Called with the selected value as a primitive identifier string (or `null` when cleared) */
|
|
38
|
+
onChange?: (value: string | null) => void;
|
|
39
|
+
/** Returns the display string for an option row */
|
|
40
|
+
getOptionLabel?: (option: T) => string;
|
|
41
|
+
/** Extracts the primitive identifier (value) from an option. Defaults to `option.value` then `option.id` */
|
|
42
|
+
getOptionValue?: (option: T) => string;
|
|
43
|
+
/** Custom renderer for each option row in the dropdown */
|
|
44
|
+
renderOption?: (option: T) => ReactNode;
|
|
45
|
+
/** Custom equality check: compares option's value with current selected value */
|
|
46
|
+
isOptionEqualToValue?: (option: T, value: string) => boolean;
|
|
47
|
+
/** When it returns `true` the option is rendered but not selectable */
|
|
48
|
+
getOptionDisabled?: (option: T) => boolean;
|
|
49
|
+
/** Placeholder text shown when no option is selected */
|
|
50
|
+
placeholder?: string | null;
|
|
51
|
+
/** When true, shows a ✕ to clear the selection */
|
|
52
|
+
clearable?: boolean;
|
|
53
|
+
/** Called when the ✕ is clicked */
|
|
54
|
+
onClear?: () => void;
|
|
55
|
+
/** When true, shows a skeleton loader inside the dropdown */
|
|
56
|
+
loading?: boolean;
|
|
57
|
+
/** Whether the field is disabled */
|
|
58
|
+
disabled?: boolean;
|
|
59
|
+
/** Stretches the input to 100% of its container */
|
|
60
|
+
fullWidth?: boolean;
|
|
61
|
+
/** Callback when the search input value changes */
|
|
62
|
+
onSearchInputChange?: (value: string) => void;
|
|
63
|
+
/** Text shown when no options match the search */
|
|
64
|
+
noOptionsText?: string;
|
|
65
|
+
/** Text shown while options are loading */
|
|
66
|
+
loadingText?: string;
|
|
67
|
+
/** Delay (ms) before triggering search - useful for API calls */
|
|
68
|
+
searchDebounceMs?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Custom search icon component. Renders in the end adornment (right side of input) when user types and loading is false.
|
|
71
|
+
* Always visible, not clickable, purely decorative.
|
|
72
|
+
* @default SearchIcon
|
|
73
|
+
*/
|
|
74
|
+
searchIcon?: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Custom loading icon component. Renders in the end adornment (right side of input) when loading is true.
|
|
77
|
+
* Always visible, not clickable, purely decorative.
|
|
78
|
+
* @default LoadingIcon (animated spinner)
|
|
79
|
+
*/
|
|
80
|
+
loadingIcon?: ReactNode;
|
|
81
|
+
}
|
|
@@ -17,10 +17,10 @@ export interface OptionGroup {
|
|
|
17
17
|
}
|
|
18
18
|
/** Props for the bare GroupedSelect trigger control (internal use only). */
|
|
19
19
|
export interface GroupedSelectTriggerProps {
|
|
20
|
-
/** Currently selected option
|
|
21
|
-
value?:
|
|
22
|
-
/** Called when the user picks an option
|
|
23
|
-
onChange?: (
|
|
20
|
+
/** Currently selected value — a primitive identifier string (not the full option object), or null when empty */
|
|
21
|
+
value?: string | null;
|
|
22
|
+
/** Called when the user picks an option, passing the selected value as a primitive identifier string */
|
|
23
|
+
onChange?: (value: string) => void;
|
|
24
24
|
/** Grouped option data rendered as accordion sections. */
|
|
25
25
|
groups: OptionGroup[];
|
|
26
26
|
/** Placeholder text shown when no option is selected. */
|
|
@@ -44,10 +44,10 @@ export interface GroupedSelectTriggerProps {
|
|
|
44
44
|
*/
|
|
45
45
|
renderOption?: (option: GroupedOption, isSelected: boolean) => ReactNode;
|
|
46
46
|
/**
|
|
47
|
-
* Custom equality check
|
|
48
|
-
* Defaults to `option.value === value
|
|
47
|
+
* Custom equality check: compares option's value with the current selected value string.
|
|
48
|
+
* Defaults to `option.value === value`.
|
|
49
49
|
*/
|
|
50
|
-
isOptionEqualToValue?: (option: GroupedOption, value:
|
|
50
|
+
isOptionEqualToValue?: (option: GroupedOption, value: string) => boolean;
|
|
51
51
|
/** Index of the accordion group that starts expanded. Defaults to 0. */
|
|
52
52
|
defaultExpandedGroup?: number | null;
|
|
53
53
|
sx?: SxProps<Theme>;
|
|
@@ -41,10 +41,10 @@ export interface NestedMultiSelectProps<T extends NestedOption = NestedOption> {
|
|
|
41
41
|
* Branch nodes (with `children`) open fly-out menus; leaf nodes (with `value`) are selectable.
|
|
42
42
|
*/
|
|
43
43
|
nodes?: TreeNode<T>[];
|
|
44
|
-
/** Currently selected
|
|
45
|
-
value?:
|
|
46
|
-
/** Called with the updated selection whenever an option is toggled. */
|
|
47
|
-
onChange?: (selected:
|
|
44
|
+
/** Currently selected option values (controlled) — array of primitive identifiers (strings), not full option objects. */
|
|
45
|
+
value?: string[];
|
|
46
|
+
/** Called with the updated selection of primitive identifiers whenever an option is toggled. */
|
|
47
|
+
onChange?: (selected: string[]) => void;
|
|
48
48
|
/** Returns the display string for an option. Defaults to `option.label`. */
|
|
49
49
|
getOptionLabel?: (option: T) => string;
|
|
50
50
|
/** Returns the unique key for an option. Defaults to `option.value`. */
|
|
@@ -8,6 +8,8 @@ export { default as PhoneInput } from './PhoneInput';
|
|
|
8
8
|
export type { PhoneInputProps } from './PhoneInput';
|
|
9
9
|
export { default as Select } from './Select';
|
|
10
10
|
export type { SelectProps } from './Select';
|
|
11
|
+
export { default as Autocomplete } from './Autocomplete';
|
|
12
|
+
export type { AutocompleteProps, AutocompleteOption } from './Autocomplete';
|
|
11
13
|
export { default as MultiSelect } from './MultiSelect';
|
|
12
14
|
export type { MultiSelectProps } from './MultiSelect';
|
|
13
15
|
export { default as GroupedSelect } from './GroupedSelect';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import type { AutocompleteProps, AutocompleteOption } from '../../composites/Autocomplete';
|
|
4
|
+
export interface RHFAutocompleteProps<T = AutocompleteOption> extends Omit<AutocompleteProps<T>, 'name'> {
|
|
5
|
+
/** RHF field name — must match the key in your form schema */
|
|
6
|
+
name: string;
|
|
7
|
+
/** RHF validation rules forwarded to `Controller` */
|
|
8
|
+
rules?: RegisterOptions;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* React Hook Form adapter for `Autocomplete`.
|
|
12
|
+
*
|
|
13
|
+
* - Reads `control` from the nearest `<FormProvider>`.
|
|
14
|
+
* - Maps `fieldState.error.message` to the `helperText` prop.
|
|
15
|
+
* - Generic over option type `T` — inferred automatically from `options` prop.
|
|
16
|
+
* - Stores the selected value as a primitive identifier string (not the full option object).
|
|
17
|
+
*/
|
|
18
|
+
declare function RHFAutocomplete<T = AutocompleteOption>({ name, rules, ...props }: Readonly<RHFAutocompleteProps<T>>): import("react").JSX.Element;
|
|
19
|
+
declare namespace RHFAutocomplete {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: typeof RHFAutocomplete;
|
|
23
|
+
export default _default;
|
|
@@ -12,7 +12,7 @@ export interface RHFMultiSelectProps<T = SelectOption> extends Omit<MultiSelectP
|
|
|
12
12
|
* React Hook Form adapter for `MultiSelect`.
|
|
13
13
|
*
|
|
14
14
|
* - Reads `control` from the nearest `<FormProvider>`.
|
|
15
|
-
* - Stores an array of
|
|
15
|
+
* - Stores an array of primitive value identifiers (strings).
|
|
16
16
|
* - Maps `fieldState.error.message` to the `feedback` prop.
|
|
17
17
|
* - A caller-supplied `feedback` prop takes priority over the field error.
|
|
18
18
|
* - Generic over option type `T` — inferred automatically from `options` prop.
|
|
@@ -4,6 +4,8 @@ export { RHFNumberInput } from './RHFNumberInput';
|
|
|
4
4
|
export type { RHFNumberInputProps } from './RHFNumberInput';
|
|
5
5
|
export { RHFSelect } from './RHFSelect';
|
|
6
6
|
export type { RHFSelectProps } from './RHFSelect';
|
|
7
|
+
export { RHFAutocomplete } from './RHFAutocomplete';
|
|
8
|
+
export type { RHFAutocompleteProps } from './RHFAutocomplete';
|
|
7
9
|
export { RHFMultiSelect } from './RHFMultiSelect';
|
|
8
10
|
export type { RHFMultiSelectProps } from './RHFMultiSelect';
|
|
9
11
|
export { RHFPhoneInput } from './RHFPhoneInput';
|