@bosonprotocol/react-kit 0.33.0-alpha.2 → 0.33.0-alpha.21
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/dist/cjs/components/buttons/BaseButton.d.ts +1 -0
- package/dist/cjs/components/buttons/BaseButton.d.ts.map +1 -1
- package/dist/cjs/components/buttons/BaseButton.js +1 -0
- package/dist/cjs/components/buttons/BaseButton.js.map +1 -1
- package/dist/cjs/components/error/SimpleError.d.ts +2 -2
- package/dist/cjs/components/error/SimpleError.d.ts.map +1 -1
- package/dist/cjs/components/error/SimpleError.js.map +1 -1
- package/dist/cjs/components/form/BaseCheckbox.d.ts +5 -0
- package/dist/cjs/components/form/BaseCheckbox.d.ts.map +1 -0
- package/dist/cjs/components/form/BaseCheckbox.js +69 -0
- package/dist/cjs/components/form/BaseCheckbox.js.map +1 -0
- package/dist/cjs/components/form/Checkbox.d.ts +13 -2
- package/dist/cjs/components/form/Checkbox.d.ts.map +1 -1
- package/dist/cjs/components/form/Checkbox.js +18 -61
- package/dist/cjs/components/form/Checkbox.js.map +1 -1
- package/dist/cjs/components/form/CountrySelect.d.ts +26 -11
- package/dist/cjs/components/form/CountrySelect.d.ts.map +1 -1
- package/dist/cjs/components/form/CountrySelect.js +64 -31
- package/dist/cjs/components/form/CountrySelect.js.map +1 -1
- package/dist/cjs/components/form/Field.styles.d.ts +36 -2
- package/dist/cjs/components/form/Field.styles.d.ts.map +1 -1
- package/dist/cjs/components/form/Field.styles.js +83 -24
- package/dist/cjs/components/form/Field.styles.js.map +1 -1
- package/dist/cjs/components/form/FormField.d.ts +2 -1
- package/dist/cjs/components/form/FormField.d.ts.map +1 -1
- package/dist/cjs/components/form/FormField.js +14 -2
- package/dist/cjs/components/form/FormField.js.map +1 -1
- package/dist/cjs/components/form/Select.d.ts +2 -1
- package/dist/cjs/components/form/Select.d.ts.map +1 -1
- package/dist/cjs/components/form/Select.js +32 -20
- package/dist/cjs/components/form/Select.js.map +1 -1
- package/dist/cjs/components/form/Upload/BaseUpload.d.ts +71 -0
- package/dist/cjs/components/form/Upload/BaseUpload.d.ts.map +1 -0
- package/dist/cjs/components/form/Upload/BaseUpload.js +264 -0
- package/dist/cjs/components/form/Upload/BaseUpload.js.map +1 -0
- package/dist/cjs/components/form/Upload/Upload.d.ts +3 -41
- package/dist/cjs/components/form/Upload/Upload.d.ts.map +1 -1
- package/dist/cjs/components/form/Upload/Upload.js +7 -258
- package/dist/cjs/components/form/Upload/Upload.js.map +1 -1
- package/dist/cjs/components/form/Upload/UploadedFile.js +2 -2
- package/dist/cjs/components/form/Upload/UploadedFile.js.map +1 -1
- package/dist/cjs/components/form/Upload/WithUploadToIpfs.d.ts.map +1 -1
- package/dist/cjs/components/form/Upload/WithUploadToIpfs.js +9 -12
- package/dist/cjs/components/form/Upload/WithUploadToIpfs.js.map +1 -1
- package/dist/cjs/components/form/index.d.ts +6 -4
- package/dist/cjs/components/form/index.d.ts.map +1 -1
- package/dist/cjs/components/form/index.js +7 -3
- package/dist/cjs/components/form/index.js.map +1 -1
- package/dist/cjs/components/form/types.d.ts +31 -3
- package/dist/cjs/components/form/types.d.ts.map +1 -1
- package/dist/cjs/components/image/Image.js +2 -2
- package/dist/cjs/components/image/Image.js.map +1 -1
- package/dist/cjs/components/image/Image.styles.d.ts +2 -1
- package/dist/cjs/components/image/Image.styles.d.ts.map +1 -1
- package/dist/cjs/components/image/Image.styles.js +2 -2
- package/dist/cjs/components/image/Image.styles.js.map +1 -1
- package/dist/cjs/components/modal/components/Commit/DetailView/InnerCommitDetailView.js +3 -3
- package/dist/cjs/components/modal/components/Commit/DetailView/InnerCommitDetailView.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js +3 -3
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js.map +1 -1
- package/dist/cjs/components/modal/components/common/OfferFullDescription/DigitalProductData.js +2 -2
- package/dist/cjs/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/DetailSlider.js +2 -2
- package/dist/cjs/components/modal/components/common/detail/DetailSlider.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/PhygitalProduct.js +2 -2
- package/dist/cjs/components/modal/components/common/detail/PhygitalProduct.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/SlickSlider.js +2 -2
- package/dist/cjs/components/modal/components/common/detail/SlickSlider.js.map +1 -1
- package/dist/cjs/components/ui/CardCTA.d.ts +21 -0
- package/dist/cjs/components/ui/CardCTA.d.ts.map +1 -0
- package/dist/cjs/components/ui/CardCTA.js +77 -0
- package/dist/cjs/components/ui/CardCTA.js.map +1 -0
- package/dist/cjs/components/ui/Grid.d.ts.map +1 -1
- package/dist/cjs/components/ui/Grid.js +22 -21
- package/dist/cjs/components/ui/Grid.js.map +1 -1
- package/dist/cjs/components/ui/IpfsImage.d.ts +5 -4
- package/dist/cjs/components/ui/IpfsImage.d.ts.map +1 -1
- package/dist/cjs/components/ui/IpfsImage.js +4 -3
- package/dist/cjs/components/ui/IpfsImage.js.map +1 -1
- package/dist/cjs/components/ui/Typography.d.ts.map +1 -1
- package/dist/cjs/components/ui/Typography.js +29 -28
- package/dist/cjs/components/ui/Typography.js.map +1 -1
- package/dist/cjs/components/ui/Video.d.ts +3 -3
- package/dist/cjs/components/ui/Video.d.ts.map +1 -1
- package/dist/cjs/components/ui/Video.js +26 -14
- package/dist/cjs/components/ui/Video.js.map +1 -1
- package/dist/cjs/components/ui/common.d.ts +2 -0
- package/dist/cjs/components/ui/common.d.ts.map +1 -0
- package/dist/cjs/components/ui/common.js +6 -0
- package/dist/cjs/components/ui/common.js.map +1 -0
- package/dist/cjs/components/wallet/ConnectButton.js +2 -2
- package/dist/cjs/components/wallet/ConnectButton.js.map +1 -1
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateContext.js +2 -2
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateContext.js.map +1 -1
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateProvider.js +2 -2
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateProvider.js.map +1 -1
- package/dist/cjs/components/widgets/finance/useOffersBacked.js +1 -1
- package/dist/cjs/components/widgets/finance/useOffersBacked.js.map +1 -1
- package/dist/cjs/hooks/core-sdk/useCoreSdk.d.ts.map +1 -1
- package/dist/cjs/hooks/core-sdk/useCoreSdk.js +2 -2
- package/dist/cjs/hooks/core-sdk/useCoreSdk.js.map +1 -1
- package/dist/cjs/hooks/form/useForm.d.ts +55 -0
- package/dist/cjs/hooks/form/useForm.d.ts.map +1 -0
- package/dist/cjs/hooks/form/useForm.js +11 -0
- package/dist/cjs/hooks/form/useForm.js.map +1 -0
- package/dist/cjs/hooks/index.d.ts +5 -0
- package/dist/cjs/hooks/index.d.ts.map +1 -1
- package/dist/cjs/hooks/index.js +5 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/ipfs/useIpfsStorage.d.ts +2 -0
- package/dist/cjs/hooks/ipfs/useIpfsStorage.d.ts.map +1 -0
- package/dist/cjs/hooks/ipfs/useIpfsStorage.js +15 -0
- package/dist/cjs/hooks/ipfs/useIpfsStorage.js.map +1 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.d.ts +12 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.d.ts.map +1 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.js +36 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.js.map +1 -0
- package/dist/cjs/{components/widgets/finance/storage/useLocalStorage.d.ts → hooks/storage/useBosonLocalStorage.d.ts} +3 -3
- package/dist/cjs/hooks/storage/useBosonLocalStorage.d.ts.map +1 -0
- package/dist/cjs/hooks/storage/useBosonLocalStorage.js +22 -0
- package/dist/cjs/hooks/storage/useBosonLocalStorage.js.map +1 -0
- package/dist/cjs/hooks/storage/useLocalStorage.d.ts +6 -0
- package/dist/cjs/hooks/storage/useLocalStorage.d.ts.map +1 -0
- package/dist/cjs/hooks/storage/useLocalStorage.js.map +1 -0
- package/dist/cjs/hooks/useIpfsMetadataStorage.d.ts +2 -2
- package/dist/cjs/hooks/useIpfsMetadataStorage.d.ts.map +1 -1
- package/dist/cjs/hooks/useIpfsMetadataStorage.js +6 -6
- package/dist/cjs/hooks/useIpfsMetadataStorage.js.map +1 -1
- package/dist/cjs/hooks/useIpfsStorage.d.ts.map +1 -1
- package/dist/cjs/hooks/useIpfsStorage.js +2 -1
- package/dist/cjs/hooks/useIpfsStorage.js.map +1 -1
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/bytes/bytesToSize.d.ts +1 -1
- package/dist/cjs/lib/bytes/bytesToSize.d.ts.map +1 -1
- package/dist/cjs/lib/bytes/bytesToSize.js +2 -1
- package/dist/cjs/lib/bytes/bytesToSize.js.map +1 -1
- package/dist/cjs/lib/const/chainInfo.d.ts.map +1 -1
- package/dist/cjs/lib/const/chainInfo.js +10 -0
- package/dist/cjs/lib/const/chainInfo.js.map +1 -1
- package/dist/cjs/lib/url/url.d.ts +1 -0
- package/dist/cjs/lib/url/url.d.ts.map +1 -1
- package/dist/cjs/lib/url/url.js +2 -1
- package/dist/cjs/lib/url/url.js.map +1 -1
- package/dist/cjs/types/helpers.d.ts +3 -0
- package/dist/cjs/types/helpers.d.ts.map +1 -1
- package/dist/cjs/types/helpers.js.map +1 -1
- package/dist/esm/components/buttons/BaseButton.d.ts +1 -0
- package/dist/esm/components/buttons/BaseButton.d.ts.map +1 -1
- package/dist/esm/components/buttons/BaseButton.js +1 -0
- package/dist/esm/components/buttons/BaseButton.js.map +1 -1
- package/dist/esm/components/error/SimpleError.d.ts +2 -2
- package/dist/esm/components/error/SimpleError.d.ts.map +1 -1
- package/dist/esm/components/error/SimpleError.js.map +1 -1
- package/dist/esm/components/form/BaseCheckbox.d.ts +5 -0
- package/dist/esm/components/form/BaseCheckbox.d.ts.map +1 -0
- package/dist/esm/components/form/BaseCheckbox.js +27 -0
- package/dist/esm/components/form/BaseCheckbox.js.map +1 -0
- package/dist/esm/components/form/Checkbox.d.ts +13 -2
- package/dist/esm/components/form/Checkbox.d.ts.map +1 -1
- package/dist/esm/components/form/Checkbox.js +16 -25
- package/dist/esm/components/form/Checkbox.js.map +1 -1
- package/dist/esm/components/form/CountrySelect.d.ts +26 -11
- package/dist/esm/components/form/CountrySelect.d.ts.map +1 -1
- package/dist/esm/components/form/CountrySelect.js +97 -67
- package/dist/esm/components/form/CountrySelect.js.map +1 -1
- package/dist/esm/components/form/Field.styles.d.ts +36 -2
- package/dist/esm/components/form/Field.styles.d.ts.map +1 -1
- package/dist/esm/components/form/Field.styles.js +58 -20
- package/dist/esm/components/form/Field.styles.js.map +1 -1
- package/dist/esm/components/form/FormField.d.ts +2 -1
- package/dist/esm/components/form/FormField.d.ts.map +1 -1
- package/dist/esm/components/form/FormField.js +2 -2
- package/dist/esm/components/form/FormField.js.map +1 -1
- package/dist/esm/components/form/Select.d.ts +2 -1
- package/dist/esm/components/form/Select.d.ts.map +1 -1
- package/dist/esm/components/form/Select.js +52 -30
- package/dist/esm/components/form/Select.js.map +1 -1
- package/dist/esm/components/form/Upload/BaseUpload.d.ts +71 -0
- package/dist/esm/components/form/Upload/BaseUpload.d.ts.map +1 -0
- package/dist/esm/components/form/Upload/BaseUpload.js +226 -0
- package/dist/esm/components/form/Upload/BaseUpload.js.map +1 -0
- package/dist/esm/components/form/Upload/Upload.d.ts +3 -41
- package/dist/esm/components/form/Upload/Upload.d.ts.map +1 -1
- package/dist/esm/components/form/Upload/Upload.js +5 -225
- package/dist/esm/components/form/Upload/Upload.js.map +1 -1
- package/dist/esm/components/form/Upload/UploadedFile.js +1 -1
- package/dist/esm/components/form/Upload/UploadedFile.js.map +1 -1
- package/dist/esm/components/form/Upload/WithUploadToIpfs.d.ts.map +1 -1
- package/dist/esm/components/form/Upload/WithUploadToIpfs.js +8 -11
- package/dist/esm/components/form/Upload/WithUploadToIpfs.js.map +1 -1
- package/dist/esm/components/form/index.d.ts +6 -4
- package/dist/esm/components/form/index.d.ts.map +1 -1
- package/dist/esm/components/form/index.js +4 -2
- package/dist/esm/components/form/index.js.map +1 -1
- package/dist/esm/components/form/types.d.ts +31 -3
- package/dist/esm/components/form/types.d.ts.map +1 -1
- package/dist/esm/components/image/Image.js +2 -2
- package/dist/esm/components/image/Image.js.map +1 -1
- package/dist/esm/components/image/Image.styles.d.ts +2 -1
- package/dist/esm/components/image/Image.styles.d.ts.map +1 -1
- package/dist/esm/components/image/Image.styles.js +2 -2
- package/dist/esm/components/image/Image.styles.js.map +1 -1
- package/dist/esm/components/modal/components/Commit/DetailView/InnerCommitDetailView.js +1 -1
- package/dist/esm/components/modal/components/Commit/DetailView/InnerCommitDetailView.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js.map +1 -1
- package/dist/esm/components/modal/components/common/OfferFullDescription/DigitalProductData.js +1 -1
- package/dist/esm/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/DetailSlider.js +1 -1
- package/dist/esm/components/modal/components/common/detail/DetailSlider.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/PhygitalProduct.js +1 -1
- package/dist/esm/components/modal/components/common/detail/PhygitalProduct.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/SlickSlider.js +1 -1
- package/dist/esm/components/modal/components/common/detail/SlickSlider.js.map +1 -1
- package/dist/esm/components/ui/CardCTA.d.ts +21 -0
- package/dist/esm/components/ui/CardCTA.d.ts.map +1 -0
- package/dist/esm/components/ui/CardCTA.js +35 -0
- package/dist/esm/components/ui/CardCTA.js.map +1 -0
- package/dist/esm/components/ui/Grid.d.ts.map +1 -1
- package/dist/esm/components/ui/Grid.js +22 -21
- package/dist/esm/components/ui/Grid.js.map +1 -1
- package/dist/esm/components/ui/IpfsImage.d.ts +5 -4
- package/dist/esm/components/ui/IpfsImage.d.ts.map +1 -1
- package/dist/esm/components/ui/IpfsImage.js +3 -4
- package/dist/esm/components/ui/IpfsImage.js.map +1 -1
- package/dist/esm/components/ui/Typography.d.ts.map +1 -1
- package/dist/esm/components/ui/Typography.js +29 -28
- package/dist/esm/components/ui/Typography.js.map +1 -1
- package/dist/esm/components/ui/Video.d.ts +3 -3
- package/dist/esm/components/ui/Video.d.ts.map +1 -1
- package/dist/esm/components/ui/Video.js +24 -14
- package/dist/esm/components/ui/Video.js.map +1 -1
- package/dist/esm/components/ui/common.d.ts +2 -0
- package/dist/esm/components/ui/common.d.ts.map +1 -0
- package/dist/esm/components/ui/common.js +2 -0
- package/dist/esm/components/ui/common.js.map +1 -0
- package/dist/esm/components/wallet/ConnectButton.js +1 -1
- package/dist/esm/components/wallet/ConnectButton.js.map +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateContext.js +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateContext.js.map +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateProvider.js +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateProvider.js.map +1 -1
- package/dist/esm/components/widgets/finance/useOffersBacked.js +1 -1
- package/dist/esm/components/widgets/finance/useOffersBacked.js.map +1 -1
- package/dist/esm/hooks/core-sdk/useCoreSdk.d.ts.map +1 -1
- package/dist/esm/hooks/core-sdk/useCoreSdk.js +3 -3
- package/dist/esm/hooks/core-sdk/useCoreSdk.js.map +1 -1
- package/dist/esm/hooks/form/useForm.d.ts +55 -0
- package/dist/esm/hooks/form/useForm.d.ts.map +1 -0
- package/dist/esm/hooks/form/useForm.js +10 -0
- package/dist/esm/hooks/form/useForm.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +5 -0
- package/dist/esm/hooks/index.d.ts.map +1 -1
- package/dist/esm/hooks/index.js +5 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/ipfs/useIpfsStorage.d.ts +2 -0
- package/dist/esm/hooks/ipfs/useIpfsStorage.d.ts.map +1 -0
- package/dist/esm/hooks/ipfs/useIpfsStorage.js +11 -0
- package/dist/esm/hooks/ipfs/useIpfsStorage.js.map +1 -0
- package/dist/esm/hooks/location/buildUseSearchParams.d.ts +12 -0
- package/dist/esm/hooks/location/buildUseSearchParams.d.ts.map +1 -0
- package/dist/esm/hooks/location/buildUseSearchParams.js +32 -0
- package/dist/esm/hooks/location/buildUseSearchParams.js.map +1 -0
- package/dist/esm/{components/widgets/finance/storage/useLocalStorage.d.ts → hooks/storage/useBosonLocalStorage.d.ts} +3 -3
- package/dist/esm/hooks/storage/useBosonLocalStorage.d.ts.map +1 -0
- package/dist/esm/hooks/storage/useBosonLocalStorage.js +15 -0
- package/dist/esm/hooks/storage/useBosonLocalStorage.js.map +1 -0
- package/dist/esm/hooks/storage/useLocalStorage.d.ts +6 -0
- package/dist/esm/hooks/storage/useLocalStorage.d.ts.map +1 -0
- package/dist/esm/hooks/storage/useLocalStorage.js.map +1 -0
- package/dist/esm/hooks/useIpfsMetadataStorage.d.ts +2 -2
- package/dist/esm/hooks/useIpfsMetadataStorage.d.ts.map +1 -1
- package/dist/esm/hooks/useIpfsMetadataStorage.js +6 -6
- package/dist/esm/hooks/useIpfsMetadataStorage.js.map +1 -1
- package/dist/esm/hooks/useIpfsStorage.d.ts.map +1 -1
- package/dist/esm/hooks/useIpfsStorage.js +2 -1
- package/dist/esm/hooks/useIpfsStorage.js.map +1 -1
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/bytes/bytesToSize.d.ts +1 -1
- package/dist/esm/lib/bytes/bytesToSize.d.ts.map +1 -1
- package/dist/esm/lib/bytes/bytesToSize.js +1 -1
- package/dist/esm/lib/bytes/bytesToSize.js.map +1 -1
- package/dist/esm/lib/const/chainInfo.d.ts.map +1 -1
- package/dist/esm/lib/const/chainInfo.js +10 -0
- package/dist/esm/lib/const/chainInfo.js.map +1 -1
- package/dist/esm/lib/url/url.d.ts +1 -0
- package/dist/esm/lib/url/url.d.ts.map +1 -1
- package/dist/esm/lib/url/url.js +1 -0
- package/dist/esm/lib/url/url.js.map +1 -1
- package/dist/esm/types/helpers.d.ts +3 -0
- package/dist/esm/types/helpers.d.ts.map +1 -1
- package/dist/esm/types/helpers.js.map +1 -1
- package/package.json +5 -5
- package/src/components/buttons/BaseButton.tsx +4 -0
- package/src/components/error/SimpleError.tsx +2 -2
- package/src/components/form/BaseCheckbox.tsx +50 -0
- package/src/components/form/Checkbox.tsx +17 -40
- package/src/components/form/CountrySelect.tsx +178 -130
- package/src/components/form/Field.styles.ts +113 -24
- package/src/components/form/FormField.tsx +4 -1
- package/src/components/form/Select.tsx +65 -34
- package/src/components/form/Upload/BaseUpload.tsx +367 -0
- package/src/components/form/Upload/Upload.tsx +8 -360
- package/src/components/form/Upload/UploadedFile.tsx +1 -1
- package/src/components/form/Upload/WithUploadToIpfs.tsx +8 -11
- package/src/components/form/index.ts +6 -4
- package/src/components/form/types.ts +31 -3
- package/src/components/image/Image.styles.ts +7 -5
- package/src/components/image/Image.tsx +2 -2
- package/src/components/modal/components/Commit/DetailView/InnerCommitDetailView.tsx +1 -1
- package/src/components/modal/components/Redeem/ExchangeView/RedeemSuccess.tsx +1 -1
- package/src/components/modal/components/common/OfferFullDescription/DigitalProductData.tsx +1 -1
- package/src/components/modal/components/common/detail/DetailSlider.tsx +1 -1
- package/src/components/modal/components/common/detail/PhygitalProduct.tsx +1 -1
- package/src/components/modal/components/common/detail/SlickSlider.tsx +1 -1
- package/src/components/ui/CardCTA.tsx +77 -0
- package/src/components/ui/Grid.tsx +33 -21
- package/src/components/ui/IpfsImage.tsx +14 -7
- package/src/components/ui/Typography.tsx +39 -29
- package/src/components/ui/Video.tsx +32 -18
- package/src/components/ui/common.ts +2 -0
- package/src/components/wallet/ConnectButton.tsx +1 -1
- package/src/components/widgets/finance/convertion-rate/ConvertionRateContext.tsx +1 -1
- package/src/components/widgets/finance/convertion-rate/ConvertionRateProvider.tsx +1 -1
- package/src/components/widgets/finance/useOffersBacked.ts +1 -1
- package/src/hooks/core-sdk/useCoreSdk.tsx +4 -3
- package/src/hooks/form/useForm.ts +12 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/ipfs/useIpfsStorage.ts +18 -0
- package/src/hooks/location/buildUseSearchParams.tsx +45 -0
- package/src/hooks/storage/useBosonLocalStorage.ts +40 -0
- package/src/{components/widgets/finance → hooks}/storage/useLocalStorage.ts +5 -17
- package/src/hooks/useIpfsMetadataStorage.tsx +11 -5
- package/src/hooks/useIpfsStorage.ts +2 -0
- package/src/index.tsx +6 -0
- package/src/lib/bytes/bytesToSize.ts +1 -1
- package/src/lib/const/chainInfo.ts +10 -1
- package/src/lib/url/url.ts +3 -0
- package/src/stories/buttons/Upload.stories.tsx +8 -0
- package/src/stories/form/BaseCheckbox.stories.tsx +113 -0
- package/src/stories/selects/CountrySelect.stories.tsx +49 -11
- package/src/stories/selects/Select.stories.tsx +117 -0
- package/src/types/helpers.ts +4 -0
- package/dist/cjs/components/widgets/finance/storage/useLocalStorage.d.ts.map +0 -1
- package/dist/cjs/components/widgets/finance/storage/useLocalStorage.js.map +0 -1
- package/dist/esm/components/widgets/finance/storage/useLocalStorage.d.ts.map +0 -1
- package/dist/esm/components/widgets/finance/storage/useLocalStorage.js.map +0 -1
- /package/dist/cjs/{components/widgets/finance → hooks}/storage/useLocalStorage.js +0 -0
- /package/dist/esm/{components/widgets/finance → hooks}/storage/useLocalStorage.js +0 -0
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
// extracted from https://usehooks.com/useLocalStorage/
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
| "isChainUnsupported"
|
|
7
|
-
| "tracing-url"
|
|
8
|
-
| "isConnectWalletFromCommit"
|
|
9
|
-
| "convertionRates"
|
|
10
|
-
| "google-jwt"
|
|
11
|
-
| "showCookies";
|
|
12
|
-
|
|
13
|
-
export function getItemFromStorage<T>(
|
|
14
|
-
key: GetItemFromStorageKey,
|
|
4
|
+
export function getItemFromStorage<K extends string, T>(
|
|
5
|
+
key: K,
|
|
15
6
|
initialValue: T
|
|
16
7
|
) {
|
|
17
8
|
if (typeof window === "undefined") {
|
|
@@ -26,7 +17,7 @@ export function getItemFromStorage<T>(
|
|
|
26
17
|
}
|
|
27
18
|
}
|
|
28
19
|
|
|
29
|
-
export function saveItemInStorage<T>(key:
|
|
20
|
+
export function saveItemInStorage<K extends string, T>(key: K, value: T) {
|
|
30
21
|
if (typeof window !== "undefined") {
|
|
31
22
|
try {
|
|
32
23
|
window.localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -36,7 +27,7 @@ export function saveItemInStorage<T>(key: string, value: T) {
|
|
|
36
27
|
}
|
|
37
28
|
}
|
|
38
29
|
|
|
39
|
-
export function removeItemInStorage(key:
|
|
30
|
+
export function removeItemInStorage<K extends string>(key: K) {
|
|
40
31
|
if (typeof window !== "undefined") {
|
|
41
32
|
try {
|
|
42
33
|
Object.keys(localStorage)
|
|
@@ -58,10 +49,7 @@ export const clearLocalStorage = () => {
|
|
|
58
49
|
}
|
|
59
50
|
};
|
|
60
51
|
|
|
61
|
-
export function useLocalStorage<T>(
|
|
62
|
-
key: GetItemFromStorageKey,
|
|
63
|
-
initialValue: T
|
|
64
|
-
) {
|
|
52
|
+
export function useLocalStorage<K extends string, T>(key: K, initialValue: T) {
|
|
65
53
|
const [storedValue, setStoredValue] = useState<T>(() =>
|
|
66
54
|
getItemFromStorage(key, initialValue)
|
|
67
55
|
);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getEnvConfigById,
|
|
4
|
+
ConfigId,
|
|
5
|
+
AnyMetadata
|
|
6
|
+
} from "@bosonprotocol/core-sdk";
|
|
3
7
|
import { IpfsMetadataStorage } from "@bosonprotocol/ipfs-storage";
|
|
4
8
|
import { EnvironmentType } from "@bosonprotocol/common/src/types";
|
|
5
9
|
|
|
@@ -14,19 +18,20 @@ import { EnvironmentType } from "@bosonprotocol/common/src/types";
|
|
|
14
18
|
export function useIpfsMetadataStorage(
|
|
15
19
|
envName: EnvironmentType,
|
|
16
20
|
configId: ConfigId,
|
|
21
|
+
validateMetadata: (metadata: AnyMetadata) => void,
|
|
17
22
|
url?: string,
|
|
18
23
|
headers?: Headers | Record<string, string>
|
|
19
24
|
) {
|
|
20
25
|
const [ipfsMetadataStorage, setIpfsMetadataStorage] =
|
|
21
26
|
useState<IpfsMetadataStorage>(
|
|
22
|
-
initIpfsMetadataStorage(envName, configId, url, headers)
|
|
27
|
+
initIpfsMetadataStorage(envName, configId, validateMetadata, url, headers)
|
|
23
28
|
);
|
|
24
29
|
|
|
25
30
|
useEffect(() => {
|
|
26
31
|
setIpfsMetadataStorage(
|
|
27
|
-
initIpfsMetadataStorage(envName, configId, url, headers)
|
|
32
|
+
initIpfsMetadataStorage(envName, configId, validateMetadata, url, headers)
|
|
28
33
|
);
|
|
29
|
-
}, [envName, configId, url, headers]);
|
|
34
|
+
}, [envName, configId, validateMetadata, url, headers]);
|
|
30
35
|
|
|
31
36
|
return ipfsMetadataStorage;
|
|
32
37
|
}
|
|
@@ -34,10 +39,11 @@ export function useIpfsMetadataStorage(
|
|
|
34
39
|
function initIpfsMetadataStorage(
|
|
35
40
|
envName: EnvironmentType,
|
|
36
41
|
configId: ConfigId,
|
|
42
|
+
validateMetadata: (metadata: AnyMetadata) => void,
|
|
37
43
|
url?: string,
|
|
38
44
|
headers?: Headers | Record<string, string>
|
|
39
45
|
) {
|
|
40
|
-
return new IpfsMetadataStorage({
|
|
46
|
+
return new IpfsMetadataStorage(validateMetadata, {
|
|
41
47
|
url: url || getEnvConfigById(envName, configId).ipfsMetadataUrl,
|
|
42
48
|
headers
|
|
43
49
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useIpfsMetadataStorage } from "./";
|
|
2
2
|
import { useEnvContext } from "../components/environment/EnvironmentContext";
|
|
3
3
|
import { useIpfsContext } from "../components/ipfs/IpfsContext";
|
|
4
|
+
import { validateMetadata } from "@bosonprotocol/core-sdk";
|
|
4
5
|
|
|
5
6
|
export function useIpfsStorage() {
|
|
6
7
|
const { envName, configId } = useEnvContext();
|
|
@@ -9,6 +10,7 @@ export function useIpfsStorage() {
|
|
|
9
10
|
const storage = useIpfsMetadataStorage(
|
|
10
11
|
envName,
|
|
11
12
|
configId,
|
|
13
|
+
validateMetadata,
|
|
12
14
|
ipfsMetadataStorageUrl,
|
|
13
15
|
ipfsMetadataStorageHeaders
|
|
14
16
|
);
|
package/src/index.tsx
CHANGED
|
@@ -32,6 +32,8 @@ export * from "./components/cta/funds/WithdrawAllFundsButton";
|
|
|
32
32
|
export * from "./components/currencyDisplay/CurrencyDisplay";
|
|
33
33
|
export * from "./components/exchangeCard/ExchangeCard";
|
|
34
34
|
export * from "./components/image/Image";
|
|
35
|
+
export * from "./components/ui/IpfsImage";
|
|
36
|
+
export { Video, VideoProps } from "./components/ui/Video";
|
|
35
37
|
export * from "./components/ui/loading/Loading";
|
|
36
38
|
export * from "./components/productCard/ProductCard";
|
|
37
39
|
export * from "./components/productCard/const";
|
|
@@ -67,8 +69,10 @@ export * from "./components/ui/Grid";
|
|
|
67
69
|
export * from "./components/ui/GridContainer";
|
|
68
70
|
export * from "./components/ui/Typography";
|
|
69
71
|
export * from "./components/ui/MuteButton";
|
|
72
|
+
export * from "./components/ui/CardCTA";
|
|
70
73
|
export * from "./components/form";
|
|
71
74
|
export * from "./lib/magicLink/logout";
|
|
75
|
+
export * from "./lib/bytes/bytesToSize";
|
|
72
76
|
export * from "./lib/magicLink/provider";
|
|
73
77
|
export * from "./lib/const/networks";
|
|
74
78
|
export * from "./lib/errors/transactions";
|
|
@@ -86,3 +90,5 @@ export * from "./components/error/SimpleError";
|
|
|
86
90
|
export * from "./components/step/MultiSteps";
|
|
87
91
|
export * from "./components/ipfs/IpfsProvider";
|
|
88
92
|
export * from "./types/helpers";
|
|
93
|
+
export * from "./lib/url/url";
|
|
94
|
+
export * from "./lib/promises/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function bytesToSize(bytes: number) {
|
|
2
2
|
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
3
3
|
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
4
4
|
return `${Math.round(bytes / Math.pow(1024, i))} ${sizes[i]}`;
|
|
@@ -5,7 +5,7 @@ import polygonMaticLogo from "../../assets/svg/polygon-matic-logo.svg";
|
|
|
5
5
|
import polygonSquareLogoUrl from "../../assets/svg/polygon_square_logo.svg";
|
|
6
6
|
import ms from "ms";
|
|
7
7
|
|
|
8
|
-
import { SupportedL1ChainId, SupportedL2ChainId } from "./chains";
|
|
8
|
+
import { LocalChainId, SupportedL1ChainId, SupportedL2ChainId } from "./chains";
|
|
9
9
|
|
|
10
10
|
export const AVERAGE_L1_BLOCK_TIME = ms(`12s`);
|
|
11
11
|
|
|
@@ -113,6 +113,15 @@ const CHAIN_INFO: ChainInfoMap = {
|
|
|
113
113
|
symbol: "aMATIC",
|
|
114
114
|
decimals: 18
|
|
115
115
|
}
|
|
116
|
+
},
|
|
117
|
+
[LocalChainId]: {
|
|
118
|
+
networkType: NetworkType.L1,
|
|
119
|
+
docs: "https://docs.uniswap.org/",
|
|
120
|
+
explorer: "https://etherscan.io/",
|
|
121
|
+
infoLink: "https://info.uniswap.org/#/",
|
|
122
|
+
label: "Local",
|
|
123
|
+
logoUrl: ethereumLogoUrl,
|
|
124
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }
|
|
116
125
|
}
|
|
117
126
|
} as const;
|
|
118
127
|
|
package/src/lib/url/url.ts
CHANGED
|
@@ -5,6 +5,9 @@ const SAFE_URL_PATTERN =
|
|
|
5
5
|
const DATA_URL_PATTERN =
|
|
6
6
|
/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;
|
|
7
7
|
|
|
8
|
+
export const websitePattern =
|
|
9
|
+
"^(http://|https://)?(www.)?([a-zA-Z0-9]+).[a-zA-Z0-9]*.[a-z]{1}.([-a-z-A-Z-0-9:_+.?/@#%&=]+)?$";
|
|
10
|
+
|
|
8
11
|
function _sanitizeUrl(url: string): string {
|
|
9
12
|
url = String(url);
|
|
10
13
|
if (url === "null" || url.length === 0 || url === "about:blank")
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseCheckbox, BaseCheckboxProps } from "../../components/form";
|
|
3
|
+
import { Formik } from "formik";
|
|
4
|
+
import type { Meta } from "@storybook/react";
|
|
5
|
+
import { theme } from "../../theme";
|
|
6
|
+
import { bosonCheckboxTheme } from "../../components/form/Checkbox";
|
|
7
|
+
const colors = theme.colors.light;
|
|
8
|
+
|
|
9
|
+
const inputName = "test";
|
|
10
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
11
|
+
export default {
|
|
12
|
+
title: "Visual Components/Inputs/BaseCheckbox",
|
|
13
|
+
component: BaseCheckbox,
|
|
14
|
+
parameters: {
|
|
15
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
16
|
+
layout: "centered"
|
|
17
|
+
},
|
|
18
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
21
|
+
argTypes: {
|
|
22
|
+
disabled: { control: "boolean" },
|
|
23
|
+
text: { control: "text" }
|
|
24
|
+
},
|
|
25
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
26
|
+
// args: { onClick: fn() },
|
|
27
|
+
decorators: [
|
|
28
|
+
(Story, { name }) => {
|
|
29
|
+
return (
|
|
30
|
+
<Formik<{ [inputName]: unknown }>
|
|
31
|
+
onSubmit={() => {
|
|
32
|
+
//
|
|
33
|
+
}}
|
|
34
|
+
initialErrors={
|
|
35
|
+
name.toLowerCase().includes("error")
|
|
36
|
+
? { [inputName]: "Checkbox error!" }
|
|
37
|
+
: {}
|
|
38
|
+
}
|
|
39
|
+
initialValues={{ [inputName]: "" }}
|
|
40
|
+
initialTouched={{ [inputName]: true }}
|
|
41
|
+
>
|
|
42
|
+
<Story />
|
|
43
|
+
</Formik>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
] satisfies Meta<typeof BaseCheckbox>["decorators"]
|
|
47
|
+
} satisfies Meta<typeof BaseCheckbox>;
|
|
48
|
+
|
|
49
|
+
const BASE_ARGS = {
|
|
50
|
+
name: inputName,
|
|
51
|
+
text: "text next to checkbox via 'text' prop",
|
|
52
|
+
theme: bosonCheckboxTheme
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Simple = {
|
|
56
|
+
args: {
|
|
57
|
+
...BASE_ARGS
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const CustomTheme = {
|
|
62
|
+
name: "With custom theme",
|
|
63
|
+
args: {
|
|
64
|
+
...BASE_ARGS,
|
|
65
|
+
theme: {
|
|
66
|
+
backgroundColor: colors.blue,
|
|
67
|
+
borderColor: colors.green,
|
|
68
|
+
color: colors.red,
|
|
69
|
+
borderRadius: "4px",
|
|
70
|
+
hover: {
|
|
71
|
+
borderColor: colors.red,
|
|
72
|
+
backgroundColor: colors.primary,
|
|
73
|
+
color: colors.darkRed
|
|
74
|
+
},
|
|
75
|
+
checked: {
|
|
76
|
+
borderColor: "#ff00d4",
|
|
77
|
+
color: "#ff00d4",
|
|
78
|
+
backgroundColor: "#ff00d444"
|
|
79
|
+
},
|
|
80
|
+
error: {
|
|
81
|
+
color: colors.orange,
|
|
82
|
+
borderColor: colors.bosonSkyBlue,
|
|
83
|
+
backgroundColor: colors.cyan
|
|
84
|
+
}
|
|
85
|
+
} satisfies BaseCheckboxProps["theme"]
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export const InputWithError = {
|
|
89
|
+
name: "With error",
|
|
90
|
+
args: {
|
|
91
|
+
...BASE_ARGS
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const CustomThemeWithError = {
|
|
96
|
+
name: "With custom theme and error",
|
|
97
|
+
args: {
|
|
98
|
+
...BASE_ARGS,
|
|
99
|
+
theme: {
|
|
100
|
+
backgroundColor: colors.blue,
|
|
101
|
+
borderColor: colors.green,
|
|
102
|
+
hover: {
|
|
103
|
+
borderColor: colors.red,
|
|
104
|
+
backgroundColor: colors.grey
|
|
105
|
+
},
|
|
106
|
+
error: {
|
|
107
|
+
color: colors.orange,
|
|
108
|
+
borderColor: colors.bosonSkyBlue,
|
|
109
|
+
backgroundColor: colors.cyan
|
|
110
|
+
}
|
|
111
|
+
} satisfies BaseCheckboxProps["theme"]
|
|
112
|
+
}
|
|
113
|
+
};
|
|
@@ -74,7 +74,14 @@ export default {
|
|
|
74
74
|
initialValues={{ [inputName]: "" }}
|
|
75
75
|
initialTouched={{ [inputName]: true }}
|
|
76
76
|
>
|
|
77
|
-
|
|
77
|
+
{({ values }) => {
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<Story args={{ ...args, name: inputName }} />
|
|
81
|
+
<div>selected value: {JSON.stringify(values)}</div>
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
}}
|
|
78
85
|
</Formik>
|
|
79
86
|
);
|
|
80
87
|
}
|
|
@@ -95,16 +102,47 @@ export const CustomTheme = {
|
|
|
95
102
|
args: {
|
|
96
103
|
...BASE_ARGS,
|
|
97
104
|
theme: {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
control: {
|
|
106
|
+
color: "yellow",
|
|
107
|
+
height: undefined,
|
|
108
|
+
background: colors.arsenic,
|
|
109
|
+
borderRadius: "16px",
|
|
110
|
+
padding: "3px",
|
|
111
|
+
boxShadow: "1px 2px 3px 4px blue",
|
|
112
|
+
borderWidth: undefined,
|
|
113
|
+
border: "1px solid green",
|
|
114
|
+
focus: {
|
|
115
|
+
border: "1px solid red"
|
|
116
|
+
},
|
|
117
|
+
hover: {
|
|
118
|
+
borderColor: "purple",
|
|
119
|
+
borderWidth: "1px"
|
|
120
|
+
},
|
|
121
|
+
error: {
|
|
122
|
+
border: "1px solid orange"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
option: {
|
|
126
|
+
opacity: "1",
|
|
127
|
+
background: "pink",
|
|
128
|
+
color: "brown",
|
|
129
|
+
selected: {
|
|
130
|
+
background: "yellow",
|
|
131
|
+
color: "cyan"
|
|
132
|
+
},
|
|
133
|
+
disabled: {
|
|
134
|
+
opacity: "0.8"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
placeholder: {
|
|
138
|
+
color: "red"
|
|
139
|
+
},
|
|
140
|
+
input: {
|
|
141
|
+
color: "cyan"
|
|
142
|
+
},
|
|
143
|
+
singleValue: {
|
|
144
|
+
color: "orange"
|
|
145
|
+
}
|
|
108
146
|
}
|
|
109
147
|
} satisfies CountrySelectProps
|
|
110
148
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { fn } from "@storybook/test";
|
|
2
|
+
import { Select, SelectProps, theme } from "../../index";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Meta } from "@storybook/react";
|
|
5
|
+
import { Formik } from "formik";
|
|
6
|
+
|
|
7
|
+
const inputWithErrors = "With error";
|
|
8
|
+
const inputName = "test";
|
|
9
|
+
|
|
10
|
+
const colors = theme.colors.light;
|
|
11
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
12
|
+
export default {
|
|
13
|
+
title: "Visual Components/Selects/Select",
|
|
14
|
+
component: Select,
|
|
15
|
+
parameters: {
|
|
16
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
17
|
+
layout: "centered"
|
|
18
|
+
},
|
|
19
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
20
|
+
tags: ["autodocs"],
|
|
21
|
+
args: { onChange: fn() },
|
|
22
|
+
argTypes: {
|
|
23
|
+
name: {
|
|
24
|
+
table: {
|
|
25
|
+
disable: true // remove name input in controls
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
theme: {
|
|
29
|
+
table: {
|
|
30
|
+
disable: true // remove name input in controls
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
disabled: { control: "boolean" },
|
|
34
|
+
placeholder: { control: "text" }
|
|
35
|
+
},
|
|
36
|
+
decorators: [
|
|
37
|
+
(Story, { args, name }) => {
|
|
38
|
+
return (
|
|
39
|
+
<Formik<{ [inputName]: unknown }>
|
|
40
|
+
onSubmit={() => {
|
|
41
|
+
//
|
|
42
|
+
}}
|
|
43
|
+
initialErrors={
|
|
44
|
+
name === inputWithErrors
|
|
45
|
+
? { [inputName]: "There has been an error!" }
|
|
46
|
+
: {}
|
|
47
|
+
}
|
|
48
|
+
initialValues={{ [inputName]: "" }}
|
|
49
|
+
initialTouched={{ [inputName]: true }}
|
|
50
|
+
>
|
|
51
|
+
<Story args={{ ...args, name: inputName }} />
|
|
52
|
+
</Formik>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
} satisfies Meta<typeof Select>;
|
|
57
|
+
|
|
58
|
+
const BASE_ARGS = {
|
|
59
|
+
name: inputName,
|
|
60
|
+
options: [
|
|
61
|
+
{ label: "first option", value: "1" },
|
|
62
|
+
{ label: "second option", value: "2" },
|
|
63
|
+
{ label: "third option", value: "3" }
|
|
64
|
+
]
|
|
65
|
+
} as SelectProps;
|
|
66
|
+
|
|
67
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
68
|
+
export const Base = {
|
|
69
|
+
args: { ...BASE_ARGS } satisfies SelectProps
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const CustomTheme = {
|
|
73
|
+
args: {
|
|
74
|
+
...BASE_ARGS,
|
|
75
|
+
theme: {
|
|
76
|
+
control: {
|
|
77
|
+
background: colors.arsenic,
|
|
78
|
+
borderRadius: "16px",
|
|
79
|
+
padding: "3px",
|
|
80
|
+
boxShadow: "1px 2px 3px 4px blue",
|
|
81
|
+
borderWidth: undefined,
|
|
82
|
+
border: "1px solid green",
|
|
83
|
+
focus: {
|
|
84
|
+
border: "1px solid red"
|
|
85
|
+
},
|
|
86
|
+
hover: {
|
|
87
|
+
borderColor: undefined,
|
|
88
|
+
borderWidth: undefined,
|
|
89
|
+
border: "1px solid purple"
|
|
90
|
+
},
|
|
91
|
+
error: {
|
|
92
|
+
border: "1px solid orange"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
option: {
|
|
96
|
+
opacity: "1",
|
|
97
|
+
background: "pink",
|
|
98
|
+
color: "brown",
|
|
99
|
+
selected: {
|
|
100
|
+
background: "yellow",
|
|
101
|
+
color: "cyan"
|
|
102
|
+
},
|
|
103
|
+
disabled: {
|
|
104
|
+
opacity: "0.8"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
} satisfies SelectProps
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const WithError = {
|
|
112
|
+
name: inputWithErrors,
|
|
113
|
+
args: {
|
|
114
|
+
...BASE_ARGS,
|
|
115
|
+
placeholder: "this is a placeholder"
|
|
116
|
+
} satisfies SelectProps
|
|
117
|
+
};
|
package/src/types/helpers.ts
CHANGED
|
@@ -5,6 +5,10 @@ export type DeepReadonly<T> = {
|
|
|
5
5
|
};
|
|
6
6
|
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
7
7
|
|
|
8
|
+
export type Prettify<T> = {
|
|
9
|
+
[K in keyof T]: T[K];
|
|
10
|
+
} & {};
|
|
11
|
+
|
|
8
12
|
type Falsy = false | 0 | "" | null | undefined;
|
|
9
13
|
|
|
10
14
|
export const isTruthy = <T>(x: T | Falsy): x is T => !!x;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.d.ts","sourceRoot":"","sources":["../../../../../../src/components/widgets/finance/storage/useLocalStorage.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,oBAAoB,GACpB,aAAa,GACb,2BAA2B,GAC3B,iBAAiB,GACjB,YAAY,GACZ,aAAa,CAAC;AAElB,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,GAAG,EAAE,qBAAqB,EAC1B,YAAY,EAAE,CAAC,OAYhB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAQzD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,QAU9C;AAED,eAAO,MAAM,iBAAiB,YAQ7B,CAAC;AAEF,wBAAgB,eAAe,CAAC,CAAC,EAC/B,GAAG,EAAE,qBAAqB,EAC1B,YAAY,EAAE,CAAC,mCAOM,CAAC,KAAK,CAAC,wBAiB7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.js","sourceRoot":"","sources":["../../../../../../src/components/widgets/finance/storage/useLocalStorage.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,iCAA8C;AAW9C,SAAgB,kBAAkB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finance/storage/useLocalStorage.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,oBAAoB,GACpB,aAAa,GACb,2BAA2B,GAC3B,iBAAiB,GACjB,YAAY,GACZ,aAAa,CAAC;AAElB,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,GAAG,EAAE,qBAAqB,EAC1B,YAAY,EAAE,CAAC,OAYhB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAQzD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,QAU9C;AAED,eAAO,MAAM,iBAAiB,YAQ7B,CAAC;AAEF,wBAAgB,eAAe,CAAC,CAAC,EAC/B,GAAG,EAAE,qBAAqB,EAC1B,YAAY,EAAE,CAAC,mCAOM,CAAC,KAAK,CAAC,wBAiB7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.js","sourceRoot":"","sources":["../../../../../../src/components/widgets/finance/storage/useLocalStorage.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAW9C,MAAM,UAAU,kBAAkB,CAChC,GAA0B,EAC1B,YAAe;IAEf,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,YAAY,CAAC;KACrB;IACD,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;KAC/C;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,YAAY,CAAC;KACrB;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAI,GAA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