@tap-payments/os-micro-frontend-shared 0.1.491 → 0.1.492-test.2
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/{chunk-HQMP5K4E.js → chunk-7JK4Z6IQ.js} +1 -1
- package/build/{chunk-ZTFNCBDJ.js → chunk-C5QNPNNY.js} +1 -1
- package/build/chunk-DSXKDOAD.js +1 -0
- package/build/chunk-LKNVJTYP.js +1 -0
- package/build/chunk-VRUT6M23.js +1 -0
- package/build/components/ActionMenu/ActionMenuDropDown.d.ts +1 -1
- package/build/components/ActionMenu/ActionMenuItem.d.ts +1 -1
- package/build/components/ActionMenu/type.d.ts +1 -1
- package/build/components/Amount/TotalAmount/TotalAmount.d.ts +1 -1
- package/build/components/Amount/index.js +1 -1
- package/build/components/AmountConversionFilter/AmountConversionFilter.d.ts +1 -1
- package/build/components/AmountConversionFilter/index.js +1 -1
- package/build/components/AmountInput/AmountInput.d.ts +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AmountStatusChip/AmountStatusChip.d.ts +1 -1
- package/build/components/AmountStatusChip/style.d.ts +1 -1
- package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
- package/build/components/AppServices/AppServices.d.ts +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/AppServicesBar.d.ts +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/headers/AppWindowHeader/type.d.ts +1 -1
- package/build/components/AuthenticationTypeChip/AuthenticationTypeChip.d.ts +1 -1
- package/build/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/Chip/style.d.ts +0 -1
- package/build/components/CopyImage/index.js +1 -1
- package/build/components/CountBadge/style.d.ts +0 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CurrencyFilter/CurrencyFilter.d.ts +1 -1
- package/build/components/CurrencyFilter/index.js +1 -1
- package/build/components/Customer/CustomerForms/CustomerEmailForm.d.ts +1 -1
- package/build/components/Customer/CustomerForms/CustomerFullInfo.d.ts +1 -1
- package/build/components/Customer/CustomerForms/CustomerFullInfoForm.d.ts +1 -1
- package/build/components/Customer/CustomerForms/CustomerPhoneNumberForm.d.ts +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/DateFilter.d.ts +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/DeviceIcon.d.ts +1 -1
- package/build/components/DeviceIcon/style.d.ts +1 -1
- package/build/components/Dialog/style.d.ts +0 -1
- package/build/components/Discount/DiscountDropdown/DiscountDropdown.d.ts +1 -1
- package/build/components/Discount/DiscountRateDropdown/DiscountRateDropdown.d.ts +1 -1
- package/build/components/Discount/TotalDiscount/TotalDiscount.d.ts +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/Discount/utils.d.ts +1 -1
- package/build/components/DropdownButton/type.d.ts +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FileInputPreview/type.d.ts +1 -1
- package/build/components/FileInputPreview/utils.d.ts +1 -1
- package/build/components/FilePreview/type.d.ts +1 -1
- package/build/components/FileUploader/type.d.ts +1 -1
- package/build/components/FilterDropdown/components/FlatMerchantsListMenu/style.d.ts +1 -1
- package/build/components/FilterDropdown/components/MerchantsFilterItem/type.d.ts +1 -1
- package/build/components/FilterDropdown/components/MerchantsFilterItem/utils.d.ts +2 -2
- package/build/components/FilterDropdown/components/RetailersItem/RetailersItem.d.ts +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/FilterDropdown/type.d.ts +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FlagDetails/index.js +1 -1
- package/build/components/FlippingCard/style.d.ts +0 -1
- package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
- package/build/components/InputBase/AmountInputBase/AmountInputBase.d.ts +1 -1
- package/build/components/InputBase/AmountInputBase/CurrencyList/CurrencyList.d.ts +1 -1
- package/build/components/InputBase/PhoneInputBase/CountriesList/CountriesList.d.ts +1 -1
- package/build/components/InputBase/PhoneInputBase/PhoneInputBase.d.ts +1 -1
- package/build/components/InputBase/SelectBase/DefaultClearIcon.d.ts +5 -0
- package/build/components/InputBase/SelectBase/DefaultSelectIcon.d.ts +5 -0
- package/build/components/InputBase/SelectBase/SelectBase.d.ts +11 -1
- package/build/components/InputBase/SelectBase/SelectBaseMultiple.d.ts +7 -1
- package/build/components/InputBase/SelectBase/hasSelectionValue.d.ts +2 -0
- package/build/components/InputBase/index.js +1 -1
- package/build/components/Inputs/CountriesDropDown/CountriesDropdown.d.ts +1 -1
- package/build/components/Inputs/SearchInput/SearchInput.d.ts +1 -1
- package/build/components/JSONViewer/components/JSONSearchBar/styles.d.ts +0 -1
- package/build/components/JSONViewer/style.d.ts +0 -1
- package/build/components/LanguageDropdown/index.js +1 -1
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
- package/build/components/ListColumnFilter/ListColumnFilter.d.ts +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/MainContainer/MainContainer.d.ts +1 -1
- package/build/components/MaskedText/type.d.ts +1 -1
- package/build/components/MerchantCurrencyDropdown/MerchantCurrencyDropdown.d.ts +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantLogo/style.d.ts +1 -1
- package/build/components/MerchantsDropdown/BrandItem.d.ts +1 -1
- package/build/components/MerchantsDropdown/EntityItem.d.ts +1 -1
- package/build/components/MerchantsDropdown/EntityList.d.ts +1 -1
- package/build/components/MerchantsDropdown/MerchantItem.d.ts +2 -2
- package/build/components/MerchantsDropdown/MerchantsList.d.ts +1 -1
- package/build/components/MerchantsDropdown/hooks.d.ts +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/MerchantsDropdown/type.d.ts +1 -1
- package/build/components/MultiSelectDropdownButton/components/StatusButton.d.ts +1 -1
- package/build/components/MultiSelectDropdownButton/type.d.ts +1 -1
- package/build/components/MultiSelectStatusButton/style.d.ts +1 -1
- package/build/components/MultiSelectStatusButton/type.d.ts +1 -1
- package/build/components/NestedDropdown/NestedDropdown.d.ts +1 -1
- package/build/components/NestedDropdown/NestedMenuItem.d.ts +1 -1
- package/build/components/NestedDropdown/types.d.ts +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/AuthenticationMode.d.ts +1 -1
- package/build/components/PaymentSourceFilter/PaymentInitiated.d.ts +2 -2
- package/build/components/PaymentSourceFilter/PaymentMethod.d.ts +1 -1
- package/build/components/PaymentSourceFilter/PaymentMethods.d.ts +1 -1
- package/build/components/PaymentSourceFilter/PaymentSchemes.d.ts +1 -1
- package/build/components/PaymentSourceFilter/PaymentSourceFilter.d.ts +3 -3
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/PhoneFilter.d.ts +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/RFH/Inputs/AmountInput/type.d.ts +1 -1
- package/build/components/RFH/Inputs/FormInput/FormInput.d.ts +1 -1
- package/build/components/RFH/Inputs/FormSelect/FormSelect.d.ts +2 -2
- package/build/components/RFH/Inputs/FormSelect/type.d.ts +1 -1
- package/build/components/RFH/Inputs/MultiSelect/MultiSelect.d.ts +0 -4
- package/build/components/RFH/Inputs/MultiSelect/style.d.ts +3 -0
- package/build/components/RFH/Inputs/PhoneInput/PhoneInput.d.ts +1 -1
- package/build/components/RFH/index.js +1 -1
- package/build/components/RangeCalender/components/Hijri/Hijri.d.ts +1 -1
- package/build/components/RangeCalender/components/Timezone/Timezone.d.ts +1 -1
- package/build/components/RangeCalender/components/Timezone/components/EntitiesTimezone.d.ts +1 -1
- package/build/components/RangeCalender/components/Timezone/components/UserTimezone.d.ts +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RangeCalender/type.d.ts +1 -1
- package/build/components/ReceiptsViewer/ReceiptsViewer.d.ts +1 -1
- package/build/components/ReceiptsViewer/index.js +1 -1
- package/build/components/ReceiptsViewer/type.d.ts +1 -1
- package/build/components/ReferenceTypeFilter/ReferenceTypeFilter.d.ts +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
- package/build/components/SalesChannelFilter/SalesChannelFilter.d.ts +1 -1
- package/build/components/SalesChannelFilter/index.js +1 -1
- package/build/components/Sandbox/Sandbox.d.ts +1 -1
- package/build/components/SearchButton/styles.d.ts +0 -1
- package/build/components/SelectDropdown/index.js +1 -1
- package/build/components/SelectWithSearch/SelectWithSearch.d.ts +1 -1
- package/build/components/SelectWithSearch/index.js +1 -1
- package/build/components/SelectWithSearch/type.d.ts +7 -2
- package/build/components/StatusBar/StatusBar.d.ts +1 -1
- package/build/components/StatusBar/type.d.ts +2 -2
- package/build/components/StatusButton/type.d.ts +1 -1
- package/build/components/StatusChipWithCopy/StatusChipWithCopy.d.ts +2 -2
- package/build/components/StatusChipWithCopy/utils.d.ts +1 -1
- package/build/components/StatusFilter/StatusFilter.d.ts +2 -2
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusFilter/utils.d.ts +1 -1
- package/build/components/StatusGroupChips/style.d.ts +1 -1
- package/build/components/StatusGroupChips/type.d.ts +1 -1
- package/build/components/StatusIcons/AuthIcons/constants.d.ts +1 -1
- package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/AuthIcons/type.d.ts +1 -1
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/AuthorizationAutoIcons/type.d.ts +1 -1
- package/build/components/StatusIcons/AuthorizedIcon/AuthorizedIcon.d.ts +2 -2
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.d.ts +2 -2
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
- package/build/components/StatusIcons/DestinationIcon/DestinationIcon.d.ts +1 -1
- package/build/components/StatusIcons/DeviceIcon/DeviceIcon.d.ts +1 -1
- package/build/components/StatusIcons/GeographyIcon/style.d.ts +1 -1
- package/build/components/StatusIcons/IssuerIcon/style.d.ts +1 -1
- package/build/components/StatusIcons/IssuerIcon/type.d.ts +1 -1
- package/build/components/StatusIcons/PayoutIcon/PayoutIcon.d.ts +2 -2
- package/build/components/StatusIcons/RefundIcon/RefundIcon.d.ts +2 -2
- package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/SourceIcons/type.d.ts +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/CustomCells/ActionCell/components/ActionsColumn.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ActionCell/constant.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -2
- package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AmountCell/components/ConversionTypeLabel.d.ts +1 -1
- package/build/components/TableCells/CustomCells/AmountCell/components/CurrencyInfo.d.ts +1 -1
- package/build/components/TableCells/CustomCells/AmountCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/AmountCell/type.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/type.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/CustomerCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DateCell/DateCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DestinationCell/styled.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DestinationCell/type.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DestinationStatusCell/constant.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/ChargeStatusIcon.d.ts +1 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/OrdersCell/OrdersCellSheet.d.ts +1 -1
- package/build/components/TableCells/CustomCells/PaymentAgreementCell/type.d.ts +1 -1
- package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/type.d.ts +1 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/type.d.ts +1 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/utils.d.ts +1 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/AuthenticationMode.d.ts +1 -1
- package/build/components/TableCells/CustomCells/StatusCell/constant.d.ts +1 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TextWithChipCell/TextWithChipCell.d.ts +2 -2
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/type.d.ts +2 -2
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableHeader/TableHeader.d.ts +1 -1
- package/build/components/TableHeader/TableModeButton.d.ts +1 -1
- package/build/components/TableHeader/TableView/ColumnItem.d.ts +1 -1
- package/build/components/TableHeader/TableView/hooks/useColumnItem.d.ts +1 -1
- package/build/components/TableHeader/TableView/hooks/useCreateViewDialog.d.ts +1 -1
- package/build/components/TableHeader/TableView/hooks/useCustomTableViews.d.ts +1 -1
- package/build/components/TableHeader/TableView/hooks/useOriginalColumns.d.ts +1 -1
- package/build/components/TableHeader/TableView/hooks/useViewColumns.d.ts +1 -1
- package/build/components/TableHeader/TableView/hooks/useViewsManager.d.ts +1 -1
- package/build/components/TableHeader/TableView/hooks/useViewsMenu.d.ts +1 -1
- package/build/components/TableHeader/TableView/types.d.ts +1 -1
- package/build/components/TableHeader/TableView/utils/columnState.d.ts +1 -1
- package/build/components/TableHeader/TableView/utils/customTableViews.d.ts +1 -1
- package/build/components/TableHeader/TableView/utils/layoutTransform.d.ts +1 -1
- package/build/components/TableHeader/TableView/utils/templateToColumnsView.d.ts +1 -1
- package/build/components/TableHeader/TableView/utils/viewMenu.d.ts +1 -1
- package/build/components/TableHeader/index.js +1 -1
- package/build/components/TableHeader/type.d.ts +3 -3
- package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TableReports/style.d.ts +0 -1
- package/build/components/TooltipChip/TooltipChip.d.ts +2 -2
- package/build/components/TooltipChip/style.d.ts +1 -1
- package/build/components/TreeDropdown/TreeNodeItem/style.d.ts +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/TreeDropdown/type.d.ts +1 -1
- package/build/components/VAT/TotalVAT/TotalVAT.d.ts +1 -1
- package/build/components/VAT/VATDropdown/VATDropdown.d.ts +1 -1
- package/build/components/VAT/VATRateDropdown/VATRateDropdown.d.ts +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VAT/utils.d.ts +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableNoData.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableRowLoading.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/features/resize/hooks/useColumnResizeWithPinned.d.ts +13 -13
- package/build/components/VirtualTables/SheetViewVirtualTable/features/resize/types/index.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/features/resize/utils/resize.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumns.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumnsWidths.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/types.d.ts +1 -1
- package/build/components/VirtualTables/VirtualTable/VirtualTable.d.ts +1 -1
- package/build/components/VirtualTables/VirtualTableWithCard/VirtualTableWithCard.d.ts +1 -1
- package/build/components/VirtualTables/components/ColumnFilter/Inputs/Inputs.d.ts +1 -1
- package/build/components/VirtualTables/components/ColumnFilter/List/List.d.ts +1 -1
- package/build/components/VirtualTables/components/ColumnFilter/type.d.ts +1 -1
- package/build/components/VirtualTables/components/ColumnSort/ColumnSort.d.ts +1 -1
- package/build/components/VirtualTables/components/TableFooter/TableFooter.d.ts +1 -1
- package/build/components/VirtualTables/components/TableHeader/components/TableCell/TableCell.d.ts +2 -2
- package/build/components/VirtualTables/components/TableHeader/type.d.ts +1 -1
- package/build/components/VirtualTables/components/TableLoading.d.ts +1 -1
- package/build/components/VirtualTables/components/TableNoData.d.ts +1 -1
- package/build/components/VirtualTables/components/TableNoDataWithCard.d.ts +1 -1
- package/build/components/VirtualTables/components/TableRow.d.ts +1 -1
- package/build/components/VirtualTables/components/TableRowLoading.d.ts +1 -1
- package/build/components/VirtualTables/components/style.d.ts +0 -1
- package/build/components/VirtualTables/components/virtualScroll/ListItemWrapper.d.ts +1 -1
- package/build/components/VirtualTables/hooks/useColumnFilter.d.ts +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/constants/segment.d.ts +1 -1
- package/build/constants/timezones.d.ts +1 -1
- package/build/demo/TapOSIconsGallery/style.d.ts +1 -1
- package/build/docs/.storybook/story-utils.d.ts +19 -0
- package/build/docs/.storybook/story-utils.js +96 -0
- package/build/hooks/useAppsInfo.d.ts +3 -3
- package/build/hooks/useIsParameterSelected.d.ts +1 -1
- package/build/hooks/useSelectedMerchantDetails.d.ts +2 -2
- package/build/hooks/useToast.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/typography.d.ts +1 -1
- package/build/types/appEvents.d.ts +1 -1
- package/build/types/apps.d.ts +1 -1
- package/build/types/cell.d.ts +2 -2
- package/build/types/document.d.ts +1 -1
- package/build/types/invoice.d.ts +1 -1
- package/build/types/refund.d.ts +1 -1
- package/build/types/table.d.ts +2 -2
- package/build/types/toggleOptions.d.ts +1 -1
- package/build/types/views.d.ts +1 -1
- package/build/utils/billing.d.ts +1 -1
- package/build/utils/columns.d.ts +1 -1
- package/build/utils/conversion.d.ts +1 -1
- package/build/utils/currency.d.ts +1 -1
- package/build/utils/day.d.ts +1 -1
- package/build/utils/entity.d.ts +1 -1
- package/build/utils/error.d.ts +1 -1
- package/build/utils/file.d.ts +1 -1
- package/build/utils/freshdesk.d.ts +1 -1
- package/build/utils/language.d.ts +1 -1
- package/build/utils/localStorage.d.ts +1 -1
- package/build/utils/merchant.d.ts +1 -1
- package/build/utils/merchantSource.d.ts +1 -1
- package/build/utils/navigation.d.ts +3 -3
- package/build/utils/segment.d.ts +1 -1
- package/build/utils/skeletonColumns.d.ts +1 -1
- package/build/utils/table.d.ts +1 -1
- package/build/utils/views.d.ts +1 -1
- package/docs/.storybook/main.ts +23 -0
- package/docs/.storybook/preview.tsx +106 -0
- package/docs/.storybook/story-utils.tsx +196 -0
- package/docs/01-overview.md +158 -0
- package/docs/02-setup.md +326 -0
- package/docs/03-architecture.md +438 -0
- package/docs/04-component-guide.md +133 -0
- package/docs/05-component-development.md +173 -0
- package/docs/README.md +38 -0
- package/docs/stories/components/Accordion.stories.tsx +302 -0
- package/docs/stories/components/AccordionAdapter.stories.tsx +201 -0
- package/docs/stories/components/AccountDropdown.stories.tsx +113 -0
- package/docs/stories/components/AnimatedSpinnerIcon.stories.tsx +54 -0
- package/docs/stories/components/BackgroundAnimation.stories.tsx +139 -0
- package/docs/stories/components/BetaBanner.stories.tsx +170 -0
- package/docs/stories/components/Button.stories.tsx +132 -0
- package/docs/stories/components/CardEmptyState.stories.tsx +43 -0
- package/docs/stories/components/CardHeadline.stories.tsx +208 -0
- package/docs/stories/components/Chip.stories.tsx +106 -0
- package/docs/stories/components/CircularProgressWithLabel.stories.tsx +111 -0
- package/docs/stories/components/Collapse.stories.tsx +100 -0
- package/docs/stories/components/CountBadge.stories.tsx +115 -0
- package/docs/stories/components/CountryFlag.stories.tsx +91 -0
- package/docs/stories/components/CurrencySymbol.stories.tsx +108 -0
- package/docs/stories/components/DeviceIcon.stories.tsx +122 -0
- package/docs/stories/components/Dialog.stories.tsx +270 -0
- package/docs/stories/components/DisplayAmount.stories.tsx +102 -0
- package/docs/stories/components/DockButton.stories.tsx +118 -0
- package/docs/stories/components/ExpandableSideBar.stories.tsx +120 -0
- package/docs/stories/components/FlippingCard.stories.tsx +122 -0
- package/docs/stories/components/HeatMap.stories.tsx +199 -0
- package/docs/stories/components/IconWithBadge.stories.tsx +136 -0
- package/docs/stories/components/JSONViewer.stories.tsx +92 -0
- package/docs/stories/components/LeftPeekRightExpandingChip.stories.tsx +127 -0
- package/docs/stories/components/Loader.stories.tsx +116 -0
- package/docs/stories/components/NoInternet.stories.tsx +43 -0
- package/docs/stories/components/ProgressBar.stories.tsx +99 -0
- package/docs/stories/components/ProgressRing.stories.tsx +139 -0
- package/docs/stories/components/SimpleDialog.stories.tsx +170 -0
- package/docs/stories/components/Skeleton.stories.tsx +253 -0
- package/docs/stories/components/StatusButton.stories.tsx +84 -0
- package/docs/stories/components/StatusChip.stories.tsx +149 -0
- package/docs/stories/components/StatusLabel.stories.tsx +85 -0
- package/docs/stories/components/Text.stories.tsx +110 -0
- package/docs/stories/components/Toaster.stories.tsx +65 -0
- package/docs/stories/components/Tooltip.stories.tsx +218 -0
- package/docs/stories/components/TooltipChip.stories.tsx +104 -0
- package/docs/stories/components/WindowAppIcon.stories.tsx +76 -0
- package/docs/stories/components/inputs/ActionMenu.stories.tsx +125 -0
- package/docs/stories/components/inputs/AmountInput.stories.tsx +103 -0
- package/docs/stories/components/inputs/Autocomplete.stories.tsx +209 -0
- package/docs/stories/components/inputs/Calender.stories.tsx +105 -0
- package/docs/stories/components/inputs/Checkbox.stories.tsx +78 -0
- package/docs/stories/components/inputs/ColorPicker.stories.tsx +160 -0
- package/docs/stories/components/inputs/CopyImage.stories.tsx +116 -0
- package/docs/stories/components/inputs/CountryFilter.stories.tsx +100 -0
- package/docs/stories/components/inputs/CurrencyFilter.stories.tsx +140 -0
- package/docs/stories/components/inputs/DateFilter.stories.tsx +144 -0
- package/docs/stories/components/inputs/DropdownButton.stories.tsx +187 -0
- package/docs/stories/components/inputs/DropdownMenu.stories.tsx +282 -0
- package/docs/stories/components/inputs/FormSelect.stories.tsx +235 -0
- package/docs/stories/components/inputs/IOSSwitch.stories.tsx +95 -0
- package/docs/stories/components/inputs/Input.stories.tsx +121 -0
- package/docs/stories/components/inputs/InputNumber.stories.tsx +163 -0
- package/docs/stories/components/inputs/MerchantCurrencyDropdown.stories.tsx +192 -0
- package/docs/stories/components/inputs/MultiSelect.stories.tsx +369 -0
- package/docs/stories/components/inputs/MultiSelectWithSearch.stories.tsx +141 -0
- package/docs/stories/components/inputs/NestedDropdown.stories.tsx +143 -0
- package/docs/stories/components/inputs/OTPInput.stories.tsx +140 -0
- package/docs/stories/components/inputs/PartnersFilter.stories.tsx +114 -0
- package/docs/stories/components/inputs/RadioButton.stories.tsx +135 -0
- package/docs/stories/components/inputs/RadioGroup.stories.tsx +145 -0
- package/docs/stories/components/inputs/RangeCalender.stories.tsx +179 -0
- package/docs/stories/components/inputs/SearchListInput.stories.tsx +87 -0
- package/docs/stories/components/inputs/SelectDropdown.stories.tsx +153 -0
- package/docs/stories/components/inputs/SelectWithSearch.stories.tsx +290 -0
- package/docs/stories/components/inputs/Timepicker.stories.tsx +91 -0
- package/docs/stories/components/inputs/ToggleButtons.stories.tsx +242 -0
- package/package.json +4 -3
- package/build/chunk-CC4HU4H6.js +0 -1
- package/build/chunk-NET3U5QO.js +0 -1
- package/build/chunk-QLEUEVEZ.js +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import Box from '@mui/material/Box'
|
|
4
|
+
import { MerchantCurrencyDropdown } from '@components/MerchantCurrencyDropdown'
|
|
5
|
+
import type { Currency } from '@types'
|
|
6
|
+
import { StoryTable, StoryThead, StoryTbody, StoryRow, StoryHeaderCell, StoryRowLabel, StoryCell, StoryHint } from '@storybook-utils'
|
|
7
|
+
|
|
8
|
+
// The component only reads code.english and symbol — stub the rest for story purposes
|
|
9
|
+
const currencies = [
|
|
10
|
+
{ code: { english: 'KWD' }, symbol: 'KD' },
|
|
11
|
+
{ code: { english: 'SAR' }, symbol: 'SR' },
|
|
12
|
+
{ code: { english: 'USD' }, symbol: '$' },
|
|
13
|
+
{ code: { english: 'EUR' }, symbol: '€' },
|
|
14
|
+
] as unknown as Currency[]
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof MerchantCurrencyDropdown> = {
|
|
17
|
+
title: 'Components/Inputs/MerchantCurrencyDropdown',
|
|
18
|
+
component: MerchantCurrencyDropdown,
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
argTypes: {
|
|
21
|
+
isLoading: { control: 'boolean', description: 'Show loading spinner instead of currency' },
|
|
22
|
+
isDisabled: { control: 'boolean', description: 'Prevent opening the dropdown' },
|
|
23
|
+
},
|
|
24
|
+
parameters: {
|
|
25
|
+
layout: 'padded',
|
|
26
|
+
controls: { expanded: true },
|
|
27
|
+
},
|
|
28
|
+
decorators: [
|
|
29
|
+
(Story) => (
|
|
30
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
31
|
+
<Story />
|
|
32
|
+
</Box>
|
|
33
|
+
),
|
|
34
|
+
],
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default meta
|
|
38
|
+
type Story = StoryObj<typeof MerchantCurrencyDropdown>
|
|
39
|
+
|
|
40
|
+
// ──────────────────────────────────────────────
|
|
41
|
+
// Named wrapper component for stateful story
|
|
42
|
+
|
|
43
|
+
const MerchantCurrencyDropdownInteractive = ({ isLoading, isDisabled }: { isLoading?: boolean; isDisabled?: boolean }) => {
|
|
44
|
+
const [selected, setSelected] = useState<Currency>(currencies[0])
|
|
45
|
+
return (
|
|
46
|
+
<MerchantCurrencyDropdown
|
|
47
|
+
merchantCurrencies={currencies}
|
|
48
|
+
selectedCurrency={selected}
|
|
49
|
+
onChangeCurrency={setSelected}
|
|
50
|
+
isLoading={isLoading}
|
|
51
|
+
isDisabled={isDisabled}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ──────────────────────────────────────────────
|
|
57
|
+
// Focused stories
|
|
58
|
+
|
|
59
|
+
export const Base: Story = {
|
|
60
|
+
args: { isLoading: false, isDisabled: false },
|
|
61
|
+
parameters: {
|
|
62
|
+
docs: {
|
|
63
|
+
source: {
|
|
64
|
+
language: 'tsx',
|
|
65
|
+
code: `
|
|
66
|
+
const [selected, setSelected] = useState(currencies[0])
|
|
67
|
+
|
|
68
|
+
<MerchantCurrencyDropdown
|
|
69
|
+
merchantCurrencies={currencies}
|
|
70
|
+
selectedCurrency={selected}
|
|
71
|
+
onChangeCurrency={setSelected}
|
|
72
|
+
/>
|
|
73
|
+
`.trim(),
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
render: (args) => <MerchantCurrencyDropdownInteractive isLoading={args.isLoading} isDisabled={args.isDisabled} />,
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const SingleCurrency: Story = {
|
|
81
|
+
name: 'single currency (no dropdown)',
|
|
82
|
+
args: { isLoading: false, isDisabled: false },
|
|
83
|
+
parameters: {
|
|
84
|
+
docs: {
|
|
85
|
+
source: {
|
|
86
|
+
language: 'tsx',
|
|
87
|
+
code: `<MerchantCurrencyDropdown merchantCurrencies={[currency]} selectedCurrency={currency} />`,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
render: (args) => <MerchantCurrencyDropdown {...args} merchantCurrencies={[currencies[0]]} selectedCurrency={currencies[0]} />,
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const Empty: Story = {
|
|
95
|
+
name: 'empty (no currencies)',
|
|
96
|
+
args: { isLoading: false, isDisabled: false },
|
|
97
|
+
parameters: {
|
|
98
|
+
docs: {
|
|
99
|
+
source: {
|
|
100
|
+
language: 'tsx',
|
|
101
|
+
code: `<MerchantCurrencyDropdown merchantCurrencies={[]} />`,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
render: (args) => <MerchantCurrencyDropdown {...args} merchantCurrencies={[]} />,
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const Loading: Story = {
|
|
109
|
+
args: { isLoading: true, isDisabled: false },
|
|
110
|
+
parameters: {
|
|
111
|
+
docs: {
|
|
112
|
+
source: {
|
|
113
|
+
language: 'tsx',
|
|
114
|
+
code: `<MerchantCurrencyDropdown merchantCurrencies={currencies} isLoading />`,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
render: (args) => <MerchantCurrencyDropdown {...args} merchantCurrencies={currencies} selectedCurrency={currencies[0]} />,
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export const Disabled: Story = {
|
|
122
|
+
args: { isLoading: false, isDisabled: true },
|
|
123
|
+
parameters: {
|
|
124
|
+
docs: {
|
|
125
|
+
source: {
|
|
126
|
+
language: 'tsx',
|
|
127
|
+
code: `<MerchantCurrencyDropdown merchantCurrencies={currencies} selectedCurrency={currencies[0]} isDisabled />`,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
render: (args) => <MerchantCurrencyDropdown {...args} merchantCurrencies={currencies} selectedCurrency={currencies[0]} />,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ──────────────────────────────────────────────
|
|
135
|
+
// Kitchen sink
|
|
136
|
+
|
|
137
|
+
const tableColumns = ['STATE', 'PREVIEW'] as const
|
|
138
|
+
|
|
139
|
+
export const AllVariants: Story = {
|
|
140
|
+
name: 'all variants',
|
|
141
|
+
decorators: [],
|
|
142
|
+
render: () => (
|
|
143
|
+
<Box sx={{ maxWidth: 960, mx: 'auto' }}>
|
|
144
|
+
<StoryTable sx={{ width: 'auto' }}>
|
|
145
|
+
<StoryThead>
|
|
146
|
+
<StoryRow>
|
|
147
|
+
{tableColumns.map((header, index) => (
|
|
148
|
+
<StoryHeaderCell key={header} first={index === 0}>
|
|
149
|
+
{header}
|
|
150
|
+
</StoryHeaderCell>
|
|
151
|
+
))}
|
|
152
|
+
</StoryRow>
|
|
153
|
+
</StoryThead>
|
|
154
|
+
|
|
155
|
+
<StoryTbody>
|
|
156
|
+
<StoryRow>
|
|
157
|
+
<StoryRowLabel>Multi (dropdown)</StoryRowLabel>
|
|
158
|
+
<StoryCell>
|
|
159
|
+
<MerchantCurrencyDropdownInteractive />
|
|
160
|
+
</StoryCell>
|
|
161
|
+
</StoryRow>
|
|
162
|
+
<StoryRow>
|
|
163
|
+
<StoryRowLabel>Single (static)</StoryRowLabel>
|
|
164
|
+
<StoryCell>
|
|
165
|
+
<MerchantCurrencyDropdown merchantCurrencies={[currencies[0]]} selectedCurrency={currencies[0]} />
|
|
166
|
+
</StoryCell>
|
|
167
|
+
</StoryRow>
|
|
168
|
+
<StoryRow>
|
|
169
|
+
<StoryRowLabel>Loading</StoryRowLabel>
|
|
170
|
+
<StoryCell>
|
|
171
|
+
<MerchantCurrencyDropdown merchantCurrencies={currencies} isLoading />
|
|
172
|
+
</StoryCell>
|
|
173
|
+
</StoryRow>
|
|
174
|
+
<StoryRow>
|
|
175
|
+
<StoryRowLabel>Disabled</StoryRowLabel>
|
|
176
|
+
<StoryCell>
|
|
177
|
+
<MerchantCurrencyDropdown merchantCurrencies={currencies} selectedCurrency={currencies[0]} isDisabled />
|
|
178
|
+
</StoryCell>
|
|
179
|
+
</StoryRow>
|
|
180
|
+
<StoryRow>
|
|
181
|
+
<StoryRowLabel>Empty</StoryRowLabel>
|
|
182
|
+
<StoryCell>
|
|
183
|
+
<MerchantCurrencyDropdown merchantCurrencies={[]} />
|
|
184
|
+
</StoryCell>
|
|
185
|
+
</StoryRow>
|
|
186
|
+
</StoryTbody>
|
|
187
|
+
</StoryTable>
|
|
188
|
+
|
|
189
|
+
<StoryHint>Click the dropdown in the "Multi" row to select a different currency.</StoryHint>
|
|
190
|
+
</Box>
|
|
191
|
+
),
|
|
192
|
+
}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import Box from '@mui/material/Box'
|
|
3
|
+
import SvgIcon from '@mui/material/SvgIcon'
|
|
4
|
+
import Typography from '@mui/material/Typography'
|
|
5
|
+
import { FormProvider, useForm } from 'react-hook-form'
|
|
6
|
+
|
|
7
|
+
import { MultiSelect } from '@components'
|
|
8
|
+
|
|
9
|
+
type PlatformOption = {
|
|
10
|
+
id: string
|
|
11
|
+
label: string
|
|
12
|
+
sublabel?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const platformOptions: PlatformOption[] = [
|
|
16
|
+
{ id: '1', label: 'Agelient Technologies', sublabel: 'Commerce Platform' },
|
|
17
|
+
{ id: '2', label: 'Apple', sublabel: 'Commerce Platform' },
|
|
18
|
+
{ id: '3', label: 'Artech LLC', sublabel: 'Commerce Platform' },
|
|
19
|
+
{ id: '4', label: 'Artik Technologies', sublabel: 'Commerce Platform' },
|
|
20
|
+
{ id: '5', label: 'Stripe', sublabel: 'Payment Platform' },
|
|
21
|
+
{ id: '6', label: 'Adyen', sublabel: 'Payment Platform' },
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
type StoryFormValues = {
|
|
25
|
+
selection: PlatformOption[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Custom dropdown arrow for `IconComponent` demos (MUI passes `className` for rotation when open). */
|
|
29
|
+
function StoryChevronIcon({ className }: Readonly<{ className?: string }>) {
|
|
30
|
+
return (
|
|
31
|
+
<SvgIcon className={className} viewBox="0 0 24 24" fontSize="small" sx={{ color: 'text.secondary' }}>
|
|
32
|
+
<path d="M7 10l5 5 5-5H7z" />
|
|
33
|
+
</SvgIcon>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Alternate clear glyph for `ClearIconComponent` demos. */
|
|
38
|
+
function StoryResetClearIcon({ className }: Readonly<{ className?: string }>) {
|
|
39
|
+
return (
|
|
40
|
+
<SvgIcon className={className} viewBox="0 0 24 24" sx={{ fontSize: 18 }}>
|
|
41
|
+
<path d="M12 5V1L7 6l5 5V7c2.76 0 5 2.24 5 5s-2.24 5-5 5-5-2.24-5-5H6c0 3.31 2.69 6 6 6s6-2.69 6-6-2.69-6-6-6z" />
|
|
42
|
+
</SvgIcon>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function FormWrapper({
|
|
47
|
+
children,
|
|
48
|
+
initialSelection = [platformOptions[0], platformOptions[3]],
|
|
49
|
+
}: Readonly<{
|
|
50
|
+
children: React.ReactNode
|
|
51
|
+
initialSelection?: PlatformOption[]
|
|
52
|
+
}>) {
|
|
53
|
+
const methods = useForm<StoryFormValues>({
|
|
54
|
+
defaultValues: {
|
|
55
|
+
selection: initialSelection,
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<FormProvider {...methods}>
|
|
61
|
+
<Box component="form" sx={{ width: 340 }} onSubmit={(e) => e.preventDefault()}>
|
|
62
|
+
{children}
|
|
63
|
+
</Box>
|
|
64
|
+
</FormProvider>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const meta: Meta<typeof MultiSelect> = {
|
|
69
|
+
title: 'Components/Inputs/MultiSelect (RFH)',
|
|
70
|
+
component: MultiSelect,
|
|
71
|
+
tags: ['autodocs'],
|
|
72
|
+
args: {
|
|
73
|
+
label: 'Platform',
|
|
74
|
+
disabled: false,
|
|
75
|
+
required: false,
|
|
76
|
+
isLoading: false,
|
|
77
|
+
showSearchInput: false,
|
|
78
|
+
searchPlaceholder: 'Search platforms',
|
|
79
|
+
showCheckbox: true,
|
|
80
|
+
showClearIcon: false,
|
|
81
|
+
},
|
|
82
|
+
argTypes: {
|
|
83
|
+
label: { control: 'text' },
|
|
84
|
+
helperText: { control: 'text' },
|
|
85
|
+
disabled: { control: 'boolean' },
|
|
86
|
+
required: { control: 'boolean' },
|
|
87
|
+
isLoading: { control: 'boolean' },
|
|
88
|
+
showSearchInput: { control: 'boolean' },
|
|
89
|
+
searchPlaceholder: { control: 'text' },
|
|
90
|
+
showCheckbox: { control: 'boolean' },
|
|
91
|
+
showClearIcon: { control: 'boolean' },
|
|
92
|
+
IconComponent: { table: { disable: true } },
|
|
93
|
+
ClearIconComponent: { table: { disable: true } },
|
|
94
|
+
name: { table: { disable: true } },
|
|
95
|
+
options: { table: { disable: true } },
|
|
96
|
+
getOptionValue: { table: { disable: true } },
|
|
97
|
+
getOptionLabel: { table: { disable: true } },
|
|
98
|
+
renderOption: { table: { disable: true } },
|
|
99
|
+
getOptionDisabled: { table: { disable: true } },
|
|
100
|
+
isOptionEqualToValue: { table: { disable: true } },
|
|
101
|
+
MenuProps: { table: { disable: true } },
|
|
102
|
+
},
|
|
103
|
+
parameters: {
|
|
104
|
+
layout: 'padded',
|
|
105
|
+
controls: {
|
|
106
|
+
expanded: true,
|
|
107
|
+
include: [
|
|
108
|
+
'label',
|
|
109
|
+
'helperText',
|
|
110
|
+
'disabled',
|
|
111
|
+
'required',
|
|
112
|
+
'isLoading',
|
|
113
|
+
'showSearchInput',
|
|
114
|
+
'searchPlaceholder',
|
|
115
|
+
'showCheckbox',
|
|
116
|
+
'showClearIcon',
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
docs: {
|
|
120
|
+
description: {
|
|
121
|
+
component: [
|
|
122
|
+
'Multi-select bound to react-hook-form via `Controller`. Wrap with `FormProvider` and pass a field `name` that matches your form values (array of selected option objects).',
|
|
123
|
+
'',
|
|
124
|
+
'- **showSearchInput** / **searchPlaceholder**: filter options inside the menu.',
|
|
125
|
+
'- **showCheckbox**: toggle row checkboxes.',
|
|
126
|
+
'- **showClearIcon** / **ClearIconComponent**: clear all selections from the field adornment.',
|
|
127
|
+
'- **IconComponent**: replace the default MUI expand arrow.',
|
|
128
|
+
].join('\n'),
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
decorators: [
|
|
133
|
+
(Story) => (
|
|
134
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
135
|
+
<Story />
|
|
136
|
+
</Box>
|
|
137
|
+
),
|
|
138
|
+
],
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export default meta
|
|
142
|
+
|
|
143
|
+
type Story = StoryObj<typeof MultiSelect>
|
|
144
|
+
|
|
145
|
+
export const Base: Story = {
|
|
146
|
+
render: (args) => (
|
|
147
|
+
<FormWrapper>
|
|
148
|
+
<MultiSelect
|
|
149
|
+
{...args}
|
|
150
|
+
name="selection"
|
|
151
|
+
options={platformOptions}
|
|
152
|
+
getOptionValue={(opt) => opt.id}
|
|
153
|
+
getOptionLabel={(opt) => opt.label}
|
|
154
|
+
/>
|
|
155
|
+
</FormWrapper>
|
|
156
|
+
),
|
|
157
|
+
parameters: {
|
|
158
|
+
docs: {
|
|
159
|
+
source: {
|
|
160
|
+
language: 'tsx',
|
|
161
|
+
code: `
|
|
162
|
+
const methods = useForm({ defaultValues: { selection: [] } })
|
|
163
|
+
|
|
164
|
+
<FormProvider {...methods}>
|
|
165
|
+
<MultiSelect
|
|
166
|
+
name="selection"
|
|
167
|
+
label="Platform"
|
|
168
|
+
options={platformOptions}
|
|
169
|
+
getOptionValue={(opt) => opt.id}
|
|
170
|
+
getOptionLabel={(opt) => opt.label}
|
|
171
|
+
/>
|
|
172
|
+
</FormProvider>
|
|
173
|
+
`.trim(),
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export const WithSearch: Story = {
|
|
180
|
+
args: {
|
|
181
|
+
showSearchInput: true,
|
|
182
|
+
},
|
|
183
|
+
render: (args) => (
|
|
184
|
+
<FormWrapper>
|
|
185
|
+
<MultiSelect
|
|
186
|
+
{...args}
|
|
187
|
+
name="selection"
|
|
188
|
+
options={platformOptions}
|
|
189
|
+
getOptionValue={(opt) => opt.id}
|
|
190
|
+
getOptionLabel={(opt) => opt.label}
|
|
191
|
+
/>
|
|
192
|
+
</FormWrapper>
|
|
193
|
+
),
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export const WithoutCheckbox: Story = {
|
|
197
|
+
args: {
|
|
198
|
+
showCheckbox: false,
|
|
199
|
+
},
|
|
200
|
+
render: (args) => (
|
|
201
|
+
<FormWrapper>
|
|
202
|
+
<MultiSelect
|
|
203
|
+
{...args}
|
|
204
|
+
name="selection"
|
|
205
|
+
options={platformOptions}
|
|
206
|
+
getOptionValue={(opt) => opt.id}
|
|
207
|
+
getOptionLabel={(opt) => opt.label}
|
|
208
|
+
/>
|
|
209
|
+
</FormWrapper>
|
|
210
|
+
),
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export const CustomOptionContent: Story = {
|
|
214
|
+
name: 'Custom option (renderOption)',
|
|
215
|
+
args: {
|
|
216
|
+
showSearchInput: true,
|
|
217
|
+
},
|
|
218
|
+
render: (args) => (
|
|
219
|
+
<FormWrapper>
|
|
220
|
+
<MultiSelect
|
|
221
|
+
{...args}
|
|
222
|
+
name="selection"
|
|
223
|
+
options={platformOptions}
|
|
224
|
+
getOptionValue={(opt) => opt.id}
|
|
225
|
+
getOptionLabel={(opt) => opt.label}
|
|
226
|
+
renderOption={(option) => (
|
|
227
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, width: '100%' }}>
|
|
228
|
+
<Box
|
|
229
|
+
sx={{
|
|
230
|
+
width: 24,
|
|
231
|
+
height: 24,
|
|
232
|
+
borderRadius: '50%',
|
|
233
|
+
bgcolor: 'grey.300',
|
|
234
|
+
display: 'flex',
|
|
235
|
+
alignItems: 'center',
|
|
236
|
+
justifyContent: 'center',
|
|
237
|
+
fontSize: 10,
|
|
238
|
+
fontWeight: 600,
|
|
239
|
+
color: 'grey.700',
|
|
240
|
+
}}
|
|
241
|
+
>
|
|
242
|
+
{(option.label ?? '').slice(0, 2).toUpperCase()}
|
|
243
|
+
</Box>
|
|
244
|
+
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
|
|
245
|
+
<Typography variant="body2" sx={{ fontSize: 12, fontWeight: 500 }}>
|
|
246
|
+
{option.label}
|
|
247
|
+
</Typography>
|
|
248
|
+
<Typography variant="caption" color="text.secondary" sx={{ fontSize: 10 }}>
|
|
249
|
+
{option.sublabel ?? 'Platform'}
|
|
250
|
+
</Typography>
|
|
251
|
+
</Box>
|
|
252
|
+
</Box>
|
|
253
|
+
)}
|
|
254
|
+
/>
|
|
255
|
+
</FormWrapper>
|
|
256
|
+
),
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export const WithDisabledOptions: Story = {
|
|
260
|
+
args: {
|
|
261
|
+
showSearchInput: true,
|
|
262
|
+
},
|
|
263
|
+
render: (args) => (
|
|
264
|
+
<FormWrapper>
|
|
265
|
+
<MultiSelect
|
|
266
|
+
{...args}
|
|
267
|
+
name="selection"
|
|
268
|
+
options={platformOptions}
|
|
269
|
+
getOptionValue={(opt) => opt.id}
|
|
270
|
+
getOptionLabel={(opt) => opt.label}
|
|
271
|
+
getOptionDisabled={(opt) => opt.id === '2' || opt.id === '6'}
|
|
272
|
+
/>
|
|
273
|
+
</FormWrapper>
|
|
274
|
+
),
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export const WithClearIcon: Story = {
|
|
278
|
+
args: {
|
|
279
|
+
showClearIcon: true,
|
|
280
|
+
},
|
|
281
|
+
render: (args) => (
|
|
282
|
+
<FormWrapper>
|
|
283
|
+
<MultiSelect
|
|
284
|
+
{...args}
|
|
285
|
+
name="selection"
|
|
286
|
+
options={platformOptions}
|
|
287
|
+
getOptionValue={(opt) => opt.id}
|
|
288
|
+
getOptionLabel={(opt) => opt.label}
|
|
289
|
+
/>
|
|
290
|
+
</FormWrapper>
|
|
291
|
+
),
|
|
292
|
+
parameters: {
|
|
293
|
+
docs: {
|
|
294
|
+
description: {
|
|
295
|
+
story: 'Clears the field to an empty array `[]`. The clear control is hidden when there is no selection, while loading, or when disabled.',
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export const WithCustomIcons: Story = {
|
|
302
|
+
name: 'Custom IconComponent & ClearIconComponent',
|
|
303
|
+
args: {
|
|
304
|
+
showClearIcon: true,
|
|
305
|
+
showSearchInput: true,
|
|
306
|
+
},
|
|
307
|
+
render: (args) => (
|
|
308
|
+
<FormWrapper>
|
|
309
|
+
<MultiSelect
|
|
310
|
+
{...args}
|
|
311
|
+
name="selection"
|
|
312
|
+
options={platformOptions}
|
|
313
|
+
getOptionValue={(opt) => opt.id}
|
|
314
|
+
getOptionLabel={(opt) => opt.label}
|
|
315
|
+
IconComponent={StoryChevronIcon}
|
|
316
|
+
ClearIconComponent={StoryResetClearIcon}
|
|
317
|
+
/>
|
|
318
|
+
</FormWrapper>
|
|
319
|
+
),
|
|
320
|
+
parameters: {
|
|
321
|
+
docs: {
|
|
322
|
+
description: {
|
|
323
|
+
story: 'Pass any React element type MUI can render as the menu icon and as the clear button icon.',
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export const ClearIconEmptyDefault: Story = {
|
|
330
|
+
name: 'Clear icon (starts empty)',
|
|
331
|
+
args: {
|
|
332
|
+
showClearIcon: true,
|
|
333
|
+
},
|
|
334
|
+
render: (args) => (
|
|
335
|
+
<FormWrapper initialSelection={[]}>
|
|
336
|
+
<MultiSelect
|
|
337
|
+
{...args}
|
|
338
|
+
name="selection"
|
|
339
|
+
options={platformOptions}
|
|
340
|
+
getOptionValue={(opt) => opt.id}
|
|
341
|
+
getOptionLabel={(opt) => opt.label}
|
|
342
|
+
/>
|
|
343
|
+
</FormWrapper>
|
|
344
|
+
),
|
|
345
|
+
parameters: {
|
|
346
|
+
docs: {
|
|
347
|
+
description: {
|
|
348
|
+
story: 'No clear control until at least one option is selected.',
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export const Disabled: Story = {
|
|
355
|
+
args: {
|
|
356
|
+
disabled: true,
|
|
357
|
+
},
|
|
358
|
+
render: (args) => (
|
|
359
|
+
<FormWrapper>
|
|
360
|
+
<MultiSelect
|
|
361
|
+
{...args}
|
|
362
|
+
name="selection"
|
|
363
|
+
options={platformOptions}
|
|
364
|
+
getOptionValue={(opt) => opt.id}
|
|
365
|
+
getOptionLabel={(opt) => opt.label}
|
|
366
|
+
/>
|
|
367
|
+
</FormWrapper>
|
|
368
|
+
),
|
|
369
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
import Box from '@mui/material/Box'
|
|
4
|
+
import MultiSelectWithSearch from '@components/MultiSelectWithSearch'
|
|
5
|
+
import type { MultiSelectWithSearchProps, Option } from '@components/MultiSelectWithSearch/type'
|
|
6
|
+
|
|
7
|
+
const nestedOptions: MultiSelectWithSearchProps['nestedOptions'] = [
|
|
8
|
+
{
|
|
9
|
+
label: 'Payments',
|
|
10
|
+
options: [
|
|
11
|
+
{
|
|
12
|
+
label: 'Methods',
|
|
13
|
+
options: [
|
|
14
|
+
{ label: 'Card', value: 'card' },
|
|
15
|
+
{ label: 'Apple Pay', value: 'apple_pay' },
|
|
16
|
+
{ label: 'KNET', value: 'knet' },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: 'Status',
|
|
21
|
+
options: [
|
|
22
|
+
{ label: 'Captured', value: 'captured' },
|
|
23
|
+
{ label: 'Failed', value: 'failed' },
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const meta: Meta<typeof MultiSelectWithSearch> = {
|
|
31
|
+
title: 'Components/Inputs/MultiSelectWithSearch',
|
|
32
|
+
component: MultiSelectWithSearch,
|
|
33
|
+
tags: ['autodocs'],
|
|
34
|
+
argTypes: {
|
|
35
|
+
nestedOptions: { table: { disable: true } },
|
|
36
|
+
selectedOptions: { table: { disable: true } },
|
|
37
|
+
onChangeOptions: { table: { disable: true } },
|
|
38
|
+
},
|
|
39
|
+
parameters: {
|
|
40
|
+
layout: 'padded',
|
|
41
|
+
controls: { expanded: true },
|
|
42
|
+
},
|
|
43
|
+
decorators: [
|
|
44
|
+
(Story) => (
|
|
45
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
46
|
+
<Story />
|
|
47
|
+
</Box>
|
|
48
|
+
),
|
|
49
|
+
],
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default meta
|
|
53
|
+
|
|
54
|
+
type Story = StoryObj<typeof MultiSelectWithSearch>
|
|
55
|
+
|
|
56
|
+
function BaseRender(args: Partial<MultiSelectWithSearchProps>) {
|
|
57
|
+
const [selectedOptions, setSelectedOptions] = useState<Option[]>([])
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Box sx={{ width: 340 }}>
|
|
61
|
+
<MultiSelectWithSearch
|
|
62
|
+
nestedOptions={nestedOptions}
|
|
63
|
+
selectedOptions={selectedOptions}
|
|
64
|
+
onChangeOptions={setSelectedOptions}
|
|
65
|
+
placeholder={args.placeholder ?? 'Search options'}
|
|
66
|
+
isLoading={args.isLoading}
|
|
67
|
+
disabled={args.disabled}
|
|
68
|
+
/>
|
|
69
|
+
</Box>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const Base: Story = {
|
|
74
|
+
render: BaseRender,
|
|
75
|
+
parameters: {
|
|
76
|
+
docs: {
|
|
77
|
+
source: {
|
|
78
|
+
language: 'tsx',
|
|
79
|
+
code: `
|
|
80
|
+
const [selectedOptions, setSelectedOptions] = useState<Option[]>([])
|
|
81
|
+
|
|
82
|
+
<MultiSelectWithSearch
|
|
83
|
+
nestedOptions={nestedOptions}
|
|
84
|
+
selectedOptions={selectedOptions}
|
|
85
|
+
onChangeOptions={setSelectedOptions}
|
|
86
|
+
placeholder="Search options"
|
|
87
|
+
/>
|
|
88
|
+
`.trim(),
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const Loading: Story = {
|
|
95
|
+
render: BaseRender,
|
|
96
|
+
args: {
|
|
97
|
+
isLoading: true,
|
|
98
|
+
placeholder: 'Searching...',
|
|
99
|
+
},
|
|
100
|
+
parameters: {
|
|
101
|
+
docs: {
|
|
102
|
+
source: {
|
|
103
|
+
language: 'tsx',
|
|
104
|
+
code: `
|
|
105
|
+
const [selectedOptions, setSelectedOptions] = useState<Option[]>([])
|
|
106
|
+
|
|
107
|
+
<MultiSelectWithSearch
|
|
108
|
+
nestedOptions={nestedOptions}
|
|
109
|
+
selectedOptions={selectedOptions}
|
|
110
|
+
onChangeOptions={setSelectedOptions}
|
|
111
|
+
placeholder="Searching..."
|
|
112
|
+
isLoading
|
|
113
|
+
/>
|
|
114
|
+
`.trim(),
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const Disabled: Story = {
|
|
121
|
+
render: BaseRender,
|
|
122
|
+
args: {
|
|
123
|
+
disabled: true,
|
|
124
|
+
},
|
|
125
|
+
parameters: {
|
|
126
|
+
docs: {
|
|
127
|
+
source: {
|
|
128
|
+
language: 'tsx',
|
|
129
|
+
code: `
|
|
130
|
+
<MultiSelectWithSearch
|
|
131
|
+
nestedOptions={nestedOptions}
|
|
132
|
+
selectedOptions={[]}
|
|
133
|
+
onChangeOptions={() => {}}
|
|
134
|
+
placeholder="Search options"
|
|
135
|
+
disabled
|
|
136
|
+
/>
|
|
137
|
+
`.trim(),
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
}
|