@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,235 @@
|
|
|
1
|
+
import { useEffect, type ReactNode } from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
import { Box } from '@mui/material'
|
|
4
|
+
import { FormProvider, useForm } from 'react-hook-form'
|
|
5
|
+
|
|
6
|
+
import { FormSelect } from '@components'
|
|
7
|
+
|
|
8
|
+
type Option = {
|
|
9
|
+
id: string
|
|
10
|
+
label: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const options: Option[] = [
|
|
14
|
+
{ id: '1', label: 'Card' },
|
|
15
|
+
{ id: '2', label: 'Apple Pay' },
|
|
16
|
+
{ id: '3', label: 'KNET' },
|
|
17
|
+
{ id: '4', label: 'Benefit' },
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
/** Typical “pick one” row; with `showClearIcon`, SelectBase omits empty-value options from the menu. */
|
|
21
|
+
const optionsWithPlaceholder: Option[] = [{ id: '', label: 'Select payment…' }, ...options]
|
|
22
|
+
|
|
23
|
+
type StoryFormValues = {
|
|
24
|
+
paymentMethod: Option | undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function FormWrapper({
|
|
28
|
+
children,
|
|
29
|
+
defaultPaymentMethod = options[1],
|
|
30
|
+
}: Readonly<{
|
|
31
|
+
children: ReactNode
|
|
32
|
+
defaultPaymentMethod?: Option | undefined
|
|
33
|
+
}>) {
|
|
34
|
+
const methods = useForm<StoryFormValues>({
|
|
35
|
+
defaultValues: {
|
|
36
|
+
paymentMethod: defaultPaymentMethod,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<FormProvider {...methods}>
|
|
42
|
+
<Box component="form" sx={{ width: 340 }} onSubmit={(e) => e.preventDefault()}>
|
|
43
|
+
{children}
|
|
44
|
+
</Box>
|
|
45
|
+
</FormProvider>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const meta: Meta<typeof FormSelect> = {
|
|
50
|
+
title: 'Components/Inputs/FormSelect (RFH)',
|
|
51
|
+
component: FormSelect,
|
|
52
|
+
tags: ['autodocs'],
|
|
53
|
+
args: {
|
|
54
|
+
label: 'Payment method',
|
|
55
|
+
disabled: false,
|
|
56
|
+
required: false,
|
|
57
|
+
isLoading: false,
|
|
58
|
+
showClearIcon: false,
|
|
59
|
+
showSearchInput: false,
|
|
60
|
+
searchPlaceholder: 'Search',
|
|
61
|
+
},
|
|
62
|
+
argTypes: {
|
|
63
|
+
label: { control: 'text' },
|
|
64
|
+
helperText: { control: 'text' },
|
|
65
|
+
disabled: { control: 'boolean' },
|
|
66
|
+
required: { control: 'boolean' },
|
|
67
|
+
isLoading: { control: 'boolean' },
|
|
68
|
+
showClearIcon: { control: 'boolean' },
|
|
69
|
+
showSearchInput: { control: 'boolean' },
|
|
70
|
+
searchPlaceholder: { control: 'text' },
|
|
71
|
+
name: { table: { disable: true } },
|
|
72
|
+
options: { table: { disable: true } },
|
|
73
|
+
getOptionValue: { table: { disable: true } },
|
|
74
|
+
getOptionLabel: { table: { disable: true } },
|
|
75
|
+
renderOption: { table: { disable: true } },
|
|
76
|
+
isOptionEqualToValue: { table: { disable: true } },
|
|
77
|
+
MenuProps: { table: { disable: true } },
|
|
78
|
+
startComponent: { table: { disable: true } },
|
|
79
|
+
IconComponent: { table: { disable: true } },
|
|
80
|
+
ClearIconComponent: { table: { disable: true } },
|
|
81
|
+
endAdornment: { table: { disable: true } },
|
|
82
|
+
},
|
|
83
|
+
parameters: {
|
|
84
|
+
layout: 'padded',
|
|
85
|
+
controls: {
|
|
86
|
+
expanded: true,
|
|
87
|
+
include: [
|
|
88
|
+
'label',
|
|
89
|
+
'helperText',
|
|
90
|
+
'disabled',
|
|
91
|
+
'required',
|
|
92
|
+
'isLoading',
|
|
93
|
+
'showClearIcon',
|
|
94
|
+
'showSearchInput',
|
|
95
|
+
'searchPlaceholder',
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
docs: {
|
|
99
|
+
description: {
|
|
100
|
+
component:
|
|
101
|
+
'Single-value select bound to react-hook-form via `Controller`. Wrap with `FormProvider` and use a `name` that matches a field holding one option object (or `undefined` when cleared). With **showClearIcon**, options whose `getOptionValue` / `id` is empty are not listed (use the clear control instead of a “None” row). With **showSearchInput** / **searchPlaceholder**, the menu includes a filter on option labels.',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
decorators: [
|
|
106
|
+
(Story) => (
|
|
107
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
108
|
+
<Story />
|
|
109
|
+
</Box>
|
|
110
|
+
),
|
|
111
|
+
],
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default meta
|
|
115
|
+
|
|
116
|
+
type Story = StoryObj<typeof FormSelect>
|
|
117
|
+
|
|
118
|
+
export const Base: Story = {
|
|
119
|
+
render: (args) => (
|
|
120
|
+
<FormWrapper>
|
|
121
|
+
<FormSelect {...args} name="paymentMethod" options={options} getOptionValue={(opt) => opt.id} getOptionLabel={(opt) => opt.label} />
|
|
122
|
+
</FormWrapper>
|
|
123
|
+
),
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const searchDemoOptions: Option[] = [
|
|
127
|
+
...options,
|
|
128
|
+
{ id: '5', label: 'Visa Debit' },
|
|
129
|
+
{ id: '6', label: 'Mastercard' },
|
|
130
|
+
{ id: '7', label: 'Google Pay' },
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
export const WithSearch: Story = {
|
|
134
|
+
args: {
|
|
135
|
+
showSearchInput: true,
|
|
136
|
+
searchPlaceholder: 'Search methods',
|
|
137
|
+
},
|
|
138
|
+
render: (args) => (
|
|
139
|
+
<FormWrapper defaultPaymentMethod={searchDemoOptions[0]}>
|
|
140
|
+
<FormSelect
|
|
141
|
+
{...args}
|
|
142
|
+
name="paymentMethod"
|
|
143
|
+
options={searchDemoOptions}
|
|
144
|
+
getOptionValue={(opt) => opt.id}
|
|
145
|
+
getOptionLabel={(opt) => opt.label}
|
|
146
|
+
/>
|
|
147
|
+
</FormWrapper>
|
|
148
|
+
),
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export const Required: Story = {
|
|
152
|
+
args: {
|
|
153
|
+
required: true,
|
|
154
|
+
label: 'Payment method (required)',
|
|
155
|
+
},
|
|
156
|
+
render: (args) => (
|
|
157
|
+
<FormWrapper defaultPaymentMethod={undefined}>
|
|
158
|
+
<FormSelect {...args} name="paymentMethod" options={options} getOptionValue={(opt) => opt.id} getOptionLabel={(opt) => opt.label} />
|
|
159
|
+
</FormWrapper>
|
|
160
|
+
),
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export const WithClearIcon: Story = {
|
|
164
|
+
args: {
|
|
165
|
+
showClearIcon: true,
|
|
166
|
+
},
|
|
167
|
+
render: (args) => (
|
|
168
|
+
<FormWrapper>
|
|
169
|
+
<FormSelect
|
|
170
|
+
{...args}
|
|
171
|
+
name="paymentMethod"
|
|
172
|
+
options={optionsWithPlaceholder}
|
|
173
|
+
getOptionValue={(opt) => opt.id}
|
|
174
|
+
getOptionLabel={(opt) => opt.label}
|
|
175
|
+
/>
|
|
176
|
+
</FormWrapper>
|
|
177
|
+
),
|
|
178
|
+
parameters: {
|
|
179
|
+
docs: {
|
|
180
|
+
description: {
|
|
181
|
+
story:
|
|
182
|
+
'Includes a placeholder option (`id: ""`). With **showClearIcon**, that row is hidden from the menu; clear the field with the icon instead.',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export const Loading: Story = {
|
|
189
|
+
args: {
|
|
190
|
+
isLoading: true,
|
|
191
|
+
},
|
|
192
|
+
render: (args) => (
|
|
193
|
+
<FormWrapper>
|
|
194
|
+
<FormSelect {...args} name="paymentMethod" options={options} getOptionValue={(opt) => opt.id} getOptionLabel={(opt) => opt.label} />
|
|
195
|
+
</FormWrapper>
|
|
196
|
+
),
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const Disabled: Story = {
|
|
200
|
+
args: {
|
|
201
|
+
disabled: true,
|
|
202
|
+
},
|
|
203
|
+
render: (args) => (
|
|
204
|
+
<FormWrapper>
|
|
205
|
+
<FormSelect {...args} name="paymentMethod" options={options} getOptionValue={(opt) => opt.id} getOptionLabel={(opt) => opt.label} />
|
|
206
|
+
</FormWrapper>
|
|
207
|
+
),
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function FormWrapperWithError({ children }: Readonly<{ children: ReactNode }>) {
|
|
211
|
+
const methods = useForm<StoryFormValues>({
|
|
212
|
+
defaultValues: { paymentMethod: options[0] },
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
methods.setError('paymentMethod', { type: 'manual', message: 'This payment method is not available for your region.' })
|
|
217
|
+
}, [methods])
|
|
218
|
+
|
|
219
|
+
return (
|
|
220
|
+
<FormProvider {...methods}>
|
|
221
|
+
<Box component="form" sx={{ width: 340 }} onSubmit={(e) => e.preventDefault()}>
|
|
222
|
+
{children}
|
|
223
|
+
</Box>
|
|
224
|
+
</FormProvider>
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export const WithFieldError: Story = {
|
|
229
|
+
name: 'With field error',
|
|
230
|
+
render: (args) => (
|
|
231
|
+
<FormWrapperWithError>
|
|
232
|
+
<FormSelect {...args} name="paymentMethod" options={options} getOptionValue={(opt) => opt.id} getOptionLabel={(opt) => opt.label} />
|
|
233
|
+
</FormWrapperWithError>
|
|
234
|
+
),
|
|
235
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
import Box from '@mui/material/Box'
|
|
4
|
+
import Typography from '@mui/material/Typography'
|
|
5
|
+
import FormControlLabel from '@mui/material/FormControlLabel'
|
|
6
|
+
import IOSSwitch from '@components/IOSSwitch'
|
|
7
|
+
import { StoryTable, StoryThead, StoryTbody, StoryRow, StoryHeaderCell, StoryRowLabel, StoryCell, StoryHint } from '@storybook-utils'
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof IOSSwitch> = {
|
|
10
|
+
title: 'Components/Inputs/IOSSwitch',
|
|
11
|
+
component: IOSSwitch,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
argTypes: {
|
|
14
|
+
checked: { control: 'boolean', description: 'Controlled checked state' },
|
|
15
|
+
disabled: { control: 'boolean' },
|
|
16
|
+
defaultChecked: { control: 'boolean', description: 'Initial checked state (uncontrolled)' },
|
|
17
|
+
size: {
|
|
18
|
+
control: 'radio',
|
|
19
|
+
options: ['small', 'medium'],
|
|
20
|
+
},
|
|
21
|
+
onChange: { table: { disable: true } },
|
|
22
|
+
},
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: 'padded',
|
|
25
|
+
controls: { expanded: true },
|
|
26
|
+
},
|
|
27
|
+
decorators: [
|
|
28
|
+
(Story) => (
|
|
29
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
30
|
+
<Story />
|
|
31
|
+
</Box>
|
|
32
|
+
),
|
|
33
|
+
],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default meta
|
|
37
|
+
type Story = StoryObj<typeof IOSSwitch>
|
|
38
|
+
|
|
39
|
+
// ──────────────────────────────────────────────
|
|
40
|
+
// Focused stories
|
|
41
|
+
|
|
42
|
+
export const Base: Story = {
|
|
43
|
+
args: { checked: false },
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const Checked: Story = {
|
|
47
|
+
args: { checked: true },
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ──────────────────────────────────────────────
|
|
51
|
+
// Kitchen sink
|
|
52
|
+
|
|
53
|
+
const tableColumns = ['STATE', 'OFF', 'ON'] as const
|
|
54
|
+
|
|
55
|
+
const stateRows: Array<{ label: string; extraProps: object }> = [
|
|
56
|
+
{ label: 'Default', extraProps: {} },
|
|
57
|
+
{ label: 'Disabled', extraProps: { disabled: true } },
|
|
58
|
+
{ label: 'Small', extraProps: { size: 'small' as const } },
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
export const AllVariants: Story = {
|
|
62
|
+
name: 'all variants',
|
|
63
|
+
decorators: [],
|
|
64
|
+
render: () => (
|
|
65
|
+
<Box sx={{ maxWidth: 960, mx: 'auto' }}>
|
|
66
|
+
<StoryTable>
|
|
67
|
+
<StoryThead>
|
|
68
|
+
<StoryRow>
|
|
69
|
+
{tableColumns.map((header, index) => (
|
|
70
|
+
<StoryHeaderCell key={header} first={index === 0}>
|
|
71
|
+
{header}
|
|
72
|
+
</StoryHeaderCell>
|
|
73
|
+
))}
|
|
74
|
+
</StoryRow>
|
|
75
|
+
</StoryThead>
|
|
76
|
+
|
|
77
|
+
<StoryTbody>
|
|
78
|
+
{stateRows.map(({ label, extraProps }) => (
|
|
79
|
+
<StoryRow key={label}>
|
|
80
|
+
<StoryRowLabel>{label}</StoryRowLabel>
|
|
81
|
+
<StoryCell>
|
|
82
|
+
<IOSSwitch defaultChecked={false} {...extraProps} />
|
|
83
|
+
</StoryCell>
|
|
84
|
+
<StoryCell>
|
|
85
|
+
<IOSSwitch defaultChecked {...extraProps} />
|
|
86
|
+
</StoryCell>
|
|
87
|
+
</StoryRow>
|
|
88
|
+
))}
|
|
89
|
+
</StoryTbody>
|
|
90
|
+
</StoryTable>
|
|
91
|
+
|
|
92
|
+
<StoryHint>Click any switch to toggle its state.</StoryHint>
|
|
93
|
+
</Box>
|
|
94
|
+
),
|
|
95
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import Box from '@mui/material/Box'
|
|
3
|
+
import Input from '@components/Input'
|
|
4
|
+
import { StoryTable, StoryThead, StoryTbody, StoryRow, StoryHeaderCell, StoryRowLabel, StoryCell, StoryHint } from '@storybook-utils'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Input> = {
|
|
7
|
+
title: 'Components/Inputs/Input',
|
|
8
|
+
component: Input,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
isError: { control: 'boolean', description: 'Shows error border styling' },
|
|
12
|
+
disabled: { control: 'boolean' },
|
|
13
|
+
placeholder: { control: 'text' },
|
|
14
|
+
readOnly: { control: 'boolean' },
|
|
15
|
+
value: { table: { disable: true } },
|
|
16
|
+
inputRef: { table: { disable: true } },
|
|
17
|
+
inputComponent: { table: { disable: true } },
|
|
18
|
+
inputProps: { table: { disable: true } },
|
|
19
|
+
endAdornment: { table: { disable: true } },
|
|
20
|
+
startAdornment: { table: { disable: true } },
|
|
21
|
+
},
|
|
22
|
+
parameters: {
|
|
23
|
+
layout: 'padded',
|
|
24
|
+
controls: { expanded: true },
|
|
25
|
+
},
|
|
26
|
+
decorators: [
|
|
27
|
+
(Story) => (
|
|
28
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
29
|
+
<Box sx={{ width: 320 }}>
|
|
30
|
+
<Story />
|
|
31
|
+
</Box>
|
|
32
|
+
</Box>
|
|
33
|
+
),
|
|
34
|
+
],
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default meta
|
|
38
|
+
type Story = StoryObj<typeof Input>
|
|
39
|
+
|
|
40
|
+
// ──────────────────────────────────────────────
|
|
41
|
+
// Focused stories
|
|
42
|
+
|
|
43
|
+
export const Base: Story = {
|
|
44
|
+
args: { placeholder: 'Enter value…' },
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Disabled: Story = {
|
|
48
|
+
args: { placeholder: 'Disabled input', disabled: true },
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const WithError: Story = {
|
|
52
|
+
args: { placeholder: 'Invalid value', isError: true },
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const ReadOnly: Story = {
|
|
56
|
+
args: { value: 'Read-only value', readOnly: true },
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ──────────────────────────────────────────────
|
|
60
|
+
// Kitchen sink
|
|
61
|
+
|
|
62
|
+
type InputOverride = Partial<Parameters<typeof Input>[0]>
|
|
63
|
+
|
|
64
|
+
const tableColumns = ['STATE', 'DEFAULT', 'WITH PLACEHOLDER', 'WITH VALUE'] as const
|
|
65
|
+
|
|
66
|
+
const stateRows: Array<{ label: string; cells: InputOverride[] }> = [
|
|
67
|
+
{
|
|
68
|
+
label: 'Default',
|
|
69
|
+
cells: [{}, { placeholder: 'Enter value…' }, { value: 'Some text' }],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Error',
|
|
73
|
+
cells: [{ isError: true }, { isError: true, placeholder: 'Enter value…' }, { isError: true, value: 'Bad input' }],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'Disabled',
|
|
77
|
+
cells: [{ disabled: true }, { disabled: true, placeholder: 'Disabled…' }, { disabled: true, value: 'Locked value' }],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Read-only',
|
|
81
|
+
cells: [{ readOnly: true }, { readOnly: true, placeholder: 'Read-only…' }, { readOnly: true, value: 'Static value' }],
|
|
82
|
+
},
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
export const AllVariants: Story = {
|
|
86
|
+
name: 'all variants',
|
|
87
|
+
decorators: [],
|
|
88
|
+
render: (args) => {
|
|
89
|
+
const renderInput = (override: InputOverride = {}) => <Input {...args} {...override} />
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Box sx={{ maxWidth: 960, mx: 'auto' }}>
|
|
93
|
+
<StoryTable>
|
|
94
|
+
<StoryThead>
|
|
95
|
+
<StoryRow>
|
|
96
|
+
{tableColumns.map((header, index) => (
|
|
97
|
+
<StoryHeaderCell key={header} first={index === 0}>
|
|
98
|
+
{header}
|
|
99
|
+
</StoryHeaderCell>
|
|
100
|
+
))}
|
|
101
|
+
</StoryRow>
|
|
102
|
+
</StoryThead>
|
|
103
|
+
|
|
104
|
+
<StoryTbody>
|
|
105
|
+
{stateRows.map(({ label, cells }) => (
|
|
106
|
+
<StoryRow key={label}>
|
|
107
|
+
<StoryRowLabel>{label}</StoryRowLabel>
|
|
108
|
+
{cells.map((override, index) => (
|
|
109
|
+
<StoryCell key={`${label}-${index}`}>{renderInput(override)}</StoryCell>
|
|
110
|
+
))}
|
|
111
|
+
</StoryRow>
|
|
112
|
+
))}
|
|
113
|
+
</StoryTbody>
|
|
114
|
+
</StoryTable>
|
|
115
|
+
|
|
116
|
+
<StoryHint>Use the Controls panel to toggle isError, disabled, and readOnly.</StoryHint>
|
|
117
|
+
</Box>
|
|
118
|
+
)
|
|
119
|
+
},
|
|
120
|
+
args: {},
|
|
121
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
import Box from '@mui/material/Box'
|
|
4
|
+
import InputNumber from '@components/InputNumber'
|
|
5
|
+
import { StoryTable, StoryThead, StoryTbody, StoryRow, StoryHeaderCell, StoryRowLabel, StoryCell, StoryHint } from '@storybook-utils'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof InputNumber> = {
|
|
8
|
+
title: 'Components/Inputs/InputNumber',
|
|
9
|
+
component: InputNumber,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {
|
|
12
|
+
isError: { control: 'boolean', description: 'Shows error border styling' },
|
|
13
|
+
disabled: { control: 'boolean' },
|
|
14
|
+
hideArrows: { control: 'boolean', description: 'Hides browser numeric spinner controls' },
|
|
15
|
+
placeholder: { control: 'text' },
|
|
16
|
+
readOnly: { control: 'boolean' },
|
|
17
|
+
value: { table: { disable: true } },
|
|
18
|
+
defaultValue: { control: 'number' },
|
|
19
|
+
onChange: { table: { disable: true } },
|
|
20
|
+
onKeyDown: { table: { disable: true } },
|
|
21
|
+
inputComponent: { table: { disable: true } },
|
|
22
|
+
inputRef: { table: { disable: true } },
|
|
23
|
+
inputProps: { table: { disable: true } },
|
|
24
|
+
},
|
|
25
|
+
parameters: {
|
|
26
|
+
layout: 'padded',
|
|
27
|
+
controls: { expanded: true },
|
|
28
|
+
},
|
|
29
|
+
decorators: [
|
|
30
|
+
(Story) => (
|
|
31
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
|
32
|
+
<Box sx={{ width: 320 }}>
|
|
33
|
+
<Story />
|
|
34
|
+
</Box>
|
|
35
|
+
</Box>
|
|
36
|
+
),
|
|
37
|
+
],
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default meta
|
|
41
|
+
|
|
42
|
+
type Story = StoryObj<typeof InputNumber>
|
|
43
|
+
|
|
44
|
+
export const Base: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
placeholder: 'Enter amount',
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Disabled: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
placeholder: 'Disabled amount',
|
|
53
|
+
disabled: true,
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const WithError: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
placeholder: 'Invalid amount',
|
|
60
|
+
isError: true,
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function InteractiveRender() {
|
|
65
|
+
const [value, setValue] = useState<number | ''>('')
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Box>
|
|
69
|
+
<InputNumber
|
|
70
|
+
placeholder="Type a number"
|
|
71
|
+
value={value}
|
|
72
|
+
onChange={(e) => {
|
|
73
|
+
const raw = e.target.value
|
|
74
|
+
setValue(raw === '' ? '' : Number(raw))
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
<StoryHint>Current value: {value === '' ? 'empty' : value}</StoryHint>
|
|
78
|
+
</Box>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const Interactive: Story = {
|
|
83
|
+
name: 'interactive',
|
|
84
|
+
render: InteractiveRender,
|
|
85
|
+
parameters: {
|
|
86
|
+
docs: {
|
|
87
|
+
source: {
|
|
88
|
+
language: 'tsx',
|
|
89
|
+
code: `
|
|
90
|
+
const [value, setValue] = useState<number | ''>('')
|
|
91
|
+
|
|
92
|
+
<InputNumber
|
|
93
|
+
placeholder="Type a number"
|
|
94
|
+
value={value}
|
|
95
|
+
onChange={(e) => {
|
|
96
|
+
const raw = e.target.value
|
|
97
|
+
setValue(raw === '' ? '' : Number(raw))
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
`.trim(),
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
type InputNumberOverride = Partial<Parameters<typeof InputNumber>[0]>
|
|
107
|
+
|
|
108
|
+
const tableColumns = ['STATE', 'EMPTY', 'PLACEHOLDER', 'PREFILLED'] as const
|
|
109
|
+
|
|
110
|
+
const stateRows: Array<{ label: string; cells: InputNumberOverride[] }> = [
|
|
111
|
+
{
|
|
112
|
+
label: 'Default',
|
|
113
|
+
cells: [{}, { placeholder: 'Enter amount' }, { value: 1250, readOnly: true }],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'Error',
|
|
117
|
+
cells: [{ isError: true }, { isError: true, placeholder: 'Invalid amount' }, { isError: true, value: 99999, readOnly: true }],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: 'Disabled',
|
|
121
|
+
cells: [{ disabled: true }, { disabled: true, placeholder: 'Disabled' }, { disabled: true, value: 840, readOnly: true }],
|
|
122
|
+
},
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
export const AllVariants: Story = {
|
|
126
|
+
name: 'all variants',
|
|
127
|
+
decorators: [],
|
|
128
|
+
render: (args) => {
|
|
129
|
+
const renderInput = (override: InputNumberOverride = {}) => <InputNumber {...args} {...override} />
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<Box sx={{ maxWidth: 960, mx: 'auto' }}>
|
|
133
|
+
<StoryTable>
|
|
134
|
+
<StoryThead>
|
|
135
|
+
<StoryRow>
|
|
136
|
+
{tableColumns.map((header, index) => (
|
|
137
|
+
<StoryHeaderCell key={header} first={index === 0}>
|
|
138
|
+
{header}
|
|
139
|
+
</StoryHeaderCell>
|
|
140
|
+
))}
|
|
141
|
+
</StoryRow>
|
|
142
|
+
</StoryThead>
|
|
143
|
+
|
|
144
|
+
<StoryTbody>
|
|
145
|
+
{stateRows.map(({ label, cells }) => (
|
|
146
|
+
<StoryRow key={label}>
|
|
147
|
+
<StoryRowLabel>{label}</StoryRowLabel>
|
|
148
|
+
{cells.map((override, index) => (
|
|
149
|
+
<StoryCell key={`${label}-${index}`}>{renderInput(override)}</StoryCell>
|
|
150
|
+
))}
|
|
151
|
+
</StoryRow>
|
|
152
|
+
))}
|
|
153
|
+
</StoryTbody>
|
|
154
|
+
</StoryTable>
|
|
155
|
+
|
|
156
|
+
<StoryHint>Use Controls to toggle error, disabled, and arrow visibility.</StoryHint>
|
|
157
|
+
</Box>
|
|
158
|
+
)
|
|
159
|
+
},
|
|
160
|
+
args: {
|
|
161
|
+
hideArrows: true,
|
|
162
|
+
},
|
|
163
|
+
}
|