@metamask-previews/design-system-react 0.0.0-preview.bf69b6b → 0.0.0-preview.e1b50dd
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/components/avatar-account/AvatarAccount.cjs +27 -0
- package/dist/components/avatar-account/AvatarAccount.cjs.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.constants.cjs +12 -0
- package/dist/components/avatar-account/AvatarAccount.constants.cjs.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.constants.d.cts +3 -0
- package/dist/components/avatar-account/AvatarAccount.constants.d.cts.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.constants.d.mts +3 -0
- package/dist/components/avatar-account/AvatarAccount.constants.d.mts.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.constants.mjs +9 -0
- package/dist/components/avatar-account/AvatarAccount.constants.mjs.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.d.cts +4 -0
- package/dist/components/avatar-account/AvatarAccount.d.cts.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.d.mts +4 -0
- package/dist/components/avatar-account/AvatarAccount.d.mts.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.mjs +28 -0
- package/dist/components/avatar-account/AvatarAccount.mjs.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.types.cjs +32 -0
- package/dist/components/avatar-account/AvatarAccount.types.cjs.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.types.d.cts +58 -0
- package/dist/components/avatar-account/AvatarAccount.types.d.cts.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.types.d.mts +58 -0
- package/dist/components/avatar-account/AvatarAccount.types.d.mts.map +1 -0
- package/dist/components/avatar-account/AvatarAccount.types.mjs +29 -0
- package/dist/components/avatar-account/AvatarAccount.types.mjs.map +1 -0
- package/dist/components/avatar-account/index.cjs +9 -0
- package/dist/components/avatar-account/index.cjs.map +1 -0
- package/dist/components/avatar-account/index.d.cts +4 -0
- package/dist/components/avatar-account/index.d.cts.map +1 -0
- package/dist/components/avatar-account/index.d.mts +4 -0
- package/dist/components/avatar-account/index.d.mts.map +1 -0
- package/dist/components/avatar-account/index.mjs +3 -0
- package/dist/components/avatar-account/index.mjs.map +1 -0
- package/dist/components/avatar-base/AvatarBase.cjs +28 -0
- package/dist/components/avatar-base/AvatarBase.cjs.map +1 -0
- package/dist/components/avatar-base/AvatarBase.constants.cjs +19 -0
- package/dist/components/avatar-base/AvatarBase.constants.cjs.map +1 -0
- package/dist/components/avatar-base/AvatarBase.constants.d.cts +4 -0
- package/dist/components/avatar-base/AvatarBase.constants.d.cts.map +1 -0
- package/dist/components/avatar-base/AvatarBase.constants.d.mts +4 -0
- package/dist/components/avatar-base/AvatarBase.constants.d.mts.map +1 -0
- package/dist/components/avatar-base/AvatarBase.constants.mjs +16 -0
- package/dist/components/avatar-base/AvatarBase.constants.mjs.map +1 -0
- package/dist/components/avatar-base/AvatarBase.d.cts +4 -0
- package/dist/components/avatar-base/AvatarBase.d.cts.map +1 -0
- package/dist/components/avatar-base/AvatarBase.d.mts +4 -0
- package/dist/components/avatar-base/AvatarBase.d.mts.map +1 -0
- package/dist/components/avatar-base/AvatarBase.mjs +29 -0
- package/dist/components/avatar-base/AvatarBase.mjs.map +1 -0
- package/dist/components/avatar-base/AvatarBase.types.cjs +38 -0
- package/dist/components/avatar-base/AvatarBase.types.cjs.map +1 -0
- package/dist/components/avatar-base/AvatarBase.types.d.cts +77 -0
- package/dist/components/avatar-base/AvatarBase.types.d.cts.map +1 -0
- package/dist/components/avatar-base/AvatarBase.types.d.mts +77 -0
- package/dist/components/avatar-base/AvatarBase.types.d.mts.map +1 -0
- package/dist/components/avatar-base/AvatarBase.types.mjs +35 -0
- package/dist/components/avatar-base/AvatarBase.types.mjs.map +1 -0
- package/dist/components/avatar-base/index.cjs +9 -0
- package/dist/components/avatar-base/index.cjs.map +1 -0
- package/dist/components/avatar-base/index.d.cts +4 -0
- package/dist/components/{button-link → avatar-base}/index.d.cts.map +1 -1
- package/dist/components/avatar-base/index.d.mts +4 -0
- package/dist/components/{button-link → avatar-base}/index.d.mts.map +1 -1
- package/dist/components/avatar-base/index.mjs +3 -0
- package/dist/components/avatar-base/index.mjs.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.cjs +15 -0
- package/dist/components/avatar-favicon/AvatarFavicon.cjs.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.d.cts +4 -0
- package/dist/components/avatar-favicon/AvatarFavicon.d.cts.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.d.mts +4 -0
- package/dist/components/avatar-favicon/AvatarFavicon.d.mts.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.mjs +16 -0
- package/dist/components/avatar-favicon/AvatarFavicon.mjs.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.cjs +4 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.cjs.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.d.cts +40 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.d.cts.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.d.mts +40 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.d.mts.map +1 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.mjs +2 -0
- package/dist/components/avatar-favicon/AvatarFavicon.types.mjs.map +1 -0
- package/dist/components/avatar-favicon/index.cjs +8 -0
- package/dist/components/avatar-favicon/index.cjs.map +1 -0
- package/dist/components/avatar-favicon/index.d.cts +4 -0
- package/dist/components/avatar-favicon/index.d.cts.map +1 -0
- package/dist/components/avatar-favicon/index.d.mts +4 -0
- package/dist/components/avatar-favicon/index.d.mts.map +1 -0
- package/dist/components/avatar-favicon/index.mjs +3 -0
- package/dist/components/avatar-favicon/index.mjs.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.cjs +19 -0
- package/dist/components/avatar-icon/AvatarIcon.cjs.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.cjs +44 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.cjs.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.d.cts +11 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.d.cts.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.d.mts +11 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.d.mts.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.mjs +41 -0
- package/dist/components/avatar-icon/AvatarIcon.constants.mjs.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.d.cts +4 -0
- package/dist/components/avatar-icon/AvatarIcon.d.cts.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.d.mts +4 -0
- package/dist/components/avatar-icon/AvatarIcon.d.mts.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.mjs +20 -0
- package/dist/components/avatar-icon/AvatarIcon.mjs.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.types.cjs +36 -0
- package/dist/components/avatar-icon/AvatarIcon.types.cjs.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.types.d.cts +57 -0
- package/dist/components/avatar-icon/AvatarIcon.types.d.cts.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.types.d.mts +57 -0
- package/dist/components/avatar-icon/AvatarIcon.types.d.mts.map +1 -0
- package/dist/components/avatar-icon/AvatarIcon.types.mjs +33 -0
- package/dist/components/avatar-icon/AvatarIcon.types.mjs.map +1 -0
- package/dist/components/avatar-icon/index.cjs +9 -0
- package/dist/components/avatar-icon/index.cjs.map +1 -0
- package/dist/components/avatar-icon/index.d.cts +4 -0
- package/dist/components/avatar-icon/index.d.cts.map +1 -0
- package/dist/components/avatar-icon/index.d.mts +4 -0
- package/dist/components/avatar-icon/index.d.mts.map +1 -0
- package/dist/components/avatar-icon/index.mjs +3 -0
- package/dist/components/avatar-icon/index.mjs.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.cjs +15 -0
- package/dist/components/avatar-network/AvatarNetwork.cjs.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.d.cts +4 -0
- package/dist/components/avatar-network/AvatarNetwork.d.cts.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.d.mts +4 -0
- package/dist/components/avatar-network/AvatarNetwork.d.mts.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.mjs +16 -0
- package/dist/components/avatar-network/AvatarNetwork.mjs.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.types.cjs +4 -0
- package/dist/components/avatar-network/AvatarNetwork.types.cjs.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.types.d.cts +40 -0
- package/dist/components/avatar-network/AvatarNetwork.types.d.cts.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.types.d.mts +40 -0
- package/dist/components/avatar-network/AvatarNetwork.types.d.mts.map +1 -0
- package/dist/components/avatar-network/AvatarNetwork.types.mjs +2 -0
- package/dist/components/avatar-network/AvatarNetwork.types.mjs.map +1 -0
- package/dist/components/avatar-network/index.cjs +8 -0
- package/dist/components/avatar-network/index.cjs.map +1 -0
- package/dist/components/avatar-network/index.d.cts +4 -0
- package/dist/components/avatar-network/index.d.cts.map +1 -0
- package/dist/components/avatar-network/index.d.mts +4 -0
- package/dist/components/avatar-network/index.d.mts.map +1 -0
- package/dist/components/avatar-network/index.mjs +3 -0
- package/dist/components/avatar-network/index.mjs.map +1 -0
- package/dist/components/avatar-token/AvatarToken.cjs +15 -0
- package/dist/components/avatar-token/AvatarToken.cjs.map +1 -0
- package/dist/components/avatar-token/AvatarToken.d.cts +4 -0
- package/dist/components/avatar-token/AvatarToken.d.cts.map +1 -0
- package/dist/components/avatar-token/AvatarToken.d.mts +4 -0
- package/dist/components/avatar-token/AvatarToken.d.mts.map +1 -0
- package/dist/components/avatar-token/AvatarToken.mjs +16 -0
- package/dist/components/avatar-token/AvatarToken.mjs.map +1 -0
- package/dist/components/avatar-token/AvatarToken.types.cjs +4 -0
- package/dist/components/avatar-token/AvatarToken.types.cjs.map +1 -0
- package/dist/components/avatar-token/AvatarToken.types.d.cts +40 -0
- package/dist/components/avatar-token/AvatarToken.types.d.cts.map +1 -0
- package/dist/components/avatar-token/AvatarToken.types.d.mts +40 -0
- package/dist/components/avatar-token/AvatarToken.types.d.mts.map +1 -0
- package/dist/components/avatar-token/AvatarToken.types.mjs +2 -0
- package/dist/components/avatar-token/AvatarToken.types.mjs.map +1 -0
- package/dist/components/avatar-token/index.cjs +8 -0
- package/dist/components/avatar-token/index.cjs.map +1 -0
- package/dist/components/avatar-token/index.d.cts +4 -0
- package/dist/components/avatar-token/index.d.cts.map +1 -0
- package/dist/components/avatar-token/index.d.mts +4 -0
- package/dist/components/avatar-token/index.d.mts.map +1 -0
- package/dist/components/avatar-token/index.mjs +3 -0
- package/dist/components/avatar-token/index.mjs.map +1 -0
- package/dist/components/blockies/Blockies.cjs +40 -0
- package/dist/components/blockies/Blockies.cjs.map +1 -0
- package/dist/components/blockies/Blockies.d.cts +7 -0
- package/dist/components/blockies/Blockies.d.cts.map +1 -0
- package/dist/components/blockies/Blockies.d.mts +7 -0
- package/dist/components/blockies/Blockies.d.mts.map +1 -0
- package/dist/components/blockies/Blockies.mjs +21 -0
- package/dist/components/blockies/Blockies.mjs.map +1 -0
- package/dist/components/{button-link/ButtonLink.types.cjs → blockies/Blockies.types.cjs} +1 -1
- package/dist/components/blockies/Blockies.types.cjs.map +1 -0
- package/dist/components/blockies/Blockies.types.d.cts +16 -0
- package/dist/components/blockies/Blockies.types.d.cts.map +1 -0
- package/dist/components/blockies/Blockies.types.d.mts +16 -0
- package/dist/components/blockies/Blockies.types.d.mts.map +1 -0
- package/dist/components/blockies/Blockies.types.mjs +2 -0
- package/dist/components/blockies/Blockies.types.mjs.map +1 -0
- package/dist/components/blockies/index.cjs +6 -0
- package/dist/components/blockies/index.cjs.map +1 -0
- package/dist/components/blockies/index.d.cts +3 -0
- package/dist/components/blockies/index.d.cts.map +1 -0
- package/dist/components/blockies/index.d.mts +3 -0
- package/dist/components/blockies/index.d.mts.map +1 -0
- package/dist/components/blockies/index.mjs +2 -0
- package/dist/components/blockies/index.mjs.map +1 -0
- package/dist/components/button/Button.cjs +25 -0
- package/dist/components/button/Button.cjs.map +1 -0
- package/dist/components/button/Button.d.cts +4 -0
- package/dist/components/button/Button.d.cts.map +1 -0
- package/dist/components/button/Button.d.mts +4 -0
- package/dist/components/button/Button.d.mts.map +1 -0
- package/dist/components/button/Button.mjs +26 -0
- package/dist/components/button/Button.mjs.map +1 -0
- package/dist/components/button/Button.types.cjs +19 -0
- package/dist/components/button/Button.types.cjs.map +1 -0
- package/dist/components/button/Button.types.d.cts +31 -0
- package/dist/components/button/Button.types.d.cts.map +1 -0
- package/dist/components/button/Button.types.d.mts +31 -0
- package/dist/components/button/Button.types.d.mts.map +1 -0
- package/dist/components/button/Button.types.mjs +16 -0
- package/dist/components/button/Button.types.mjs.map +1 -0
- package/dist/components/button/index.cjs +10 -0
- package/dist/components/button/index.cjs.map +1 -0
- package/dist/components/button/index.d.cts +5 -0
- package/dist/components/button/index.d.cts.map +1 -0
- package/dist/components/button/index.d.mts +5 -0
- package/dist/components/button/index.d.mts.map +1 -0
- package/dist/components/button/index.mjs +4 -0
- package/dist/components/button/index.mjs.map +1 -0
- package/dist/components/button-base/ButtonBase.cjs +24 -10
- package/dist/components/button-base/ButtonBase.cjs.map +1 -1
- package/dist/components/button-base/ButtonBase.d.cts.map +1 -1
- package/dist/components/button-base/ButtonBase.d.mts.map +1 -1
- package/dist/components/button-base/ButtonBase.mjs +22 -8
- package/dist/components/button-base/ButtonBase.mjs.map +1 -1
- package/dist/components/button-base/ButtonBase.types.cjs.map +1 -1
- package/dist/components/button-base/ButtonBase.types.d.cts +1 -1
- package/dist/components/button-base/ButtonBase.types.d.mts +1 -1
- package/dist/components/button-base/ButtonBase.types.mjs.map +1 -1
- package/dist/components/button-icon/ButtonIcon.cjs +38 -0
- package/dist/components/button-icon/ButtonIcon.cjs.map +1 -0
- package/dist/components/button-icon/ButtonIcon.constants.cjs +16 -0
- package/dist/components/button-icon/ButtonIcon.constants.cjs.map +1 -0
- package/dist/components/button-icon/ButtonIcon.constants.d.cts +12 -0
- package/dist/components/button-icon/ButtonIcon.constants.d.cts.map +1 -0
- package/dist/components/button-icon/ButtonIcon.constants.d.mts +12 -0
- package/dist/components/button-icon/ButtonIcon.constants.d.mts.map +1 -0
- package/dist/components/button-icon/ButtonIcon.constants.mjs +13 -0
- package/dist/components/button-icon/ButtonIcon.constants.mjs.map +1 -0
- package/dist/components/button-icon/ButtonIcon.d.cts +4 -0
- package/dist/components/button-icon/ButtonIcon.d.cts.map +1 -0
- package/dist/components/button-icon/ButtonIcon.d.mts +4 -0
- package/dist/components/button-icon/ButtonIcon.d.mts.map +1 -0
- package/dist/components/button-icon/ButtonIcon.mjs +39 -0
- package/dist/components/button-icon/ButtonIcon.mjs.map +1 -0
- package/dist/components/button-icon/ButtonIcon.types.cjs +19 -0
- package/dist/components/button-icon/ButtonIcon.types.cjs.map +1 -0
- package/dist/components/button-icon/ButtonIcon.types.d.cts +61 -0
- package/dist/components/button-icon/ButtonIcon.types.d.cts.map +1 -0
- package/dist/components/button-icon/ButtonIcon.types.d.mts +61 -0
- package/dist/components/button-icon/ButtonIcon.types.d.mts.map +1 -0
- package/dist/components/button-icon/ButtonIcon.types.mjs +16 -0
- package/dist/components/button-icon/ButtonIcon.types.mjs.map +1 -0
- package/dist/components/button-icon/index.cjs +8 -0
- package/dist/components/button-icon/index.cjs.map +1 -0
- package/dist/components/button-icon/index.d.cts +4 -0
- package/dist/components/button-icon/index.d.cts.map +1 -0
- package/dist/components/button-icon/index.d.mts +4 -0
- package/dist/components/button-icon/index.d.mts.map +1 -0
- package/dist/components/button-icon/index.mjs +3 -0
- package/dist/components/button-icon/index.mjs.map +1 -0
- package/dist/components/button-primary/ButtonPrimary.cjs +45 -23
- package/dist/components/button-primary/ButtonPrimary.cjs.map +1 -1
- package/dist/components/button-primary/ButtonPrimary.d.cts.map +1 -1
- package/dist/components/button-primary/ButtonPrimary.d.mts.map +1 -1
- package/dist/components/button-primary/ButtonPrimary.mjs +45 -23
- package/dist/components/button-primary/ButtonPrimary.mjs.map +1 -1
- package/dist/components/button-secondary/ButtonSecondary.cjs +26 -25
- package/dist/components/button-secondary/ButtonSecondary.cjs.map +1 -1
- package/dist/components/button-secondary/ButtonSecondary.d.cts.map +1 -1
- package/dist/components/button-secondary/ButtonSecondary.d.mts.map +1 -1
- package/dist/components/button-secondary/ButtonSecondary.mjs +26 -25
- package/dist/components/button-secondary/ButtonSecondary.mjs.map +1 -1
- package/dist/components/button-tertiary/ButtonTertiary.cjs +60 -0
- package/dist/components/button-tertiary/ButtonTertiary.cjs.map +1 -0
- package/dist/components/button-tertiary/ButtonTertiary.d.cts +4 -0
- package/dist/components/button-tertiary/ButtonTertiary.d.cts.map +1 -0
- package/dist/components/button-tertiary/ButtonTertiary.d.mts +4 -0
- package/dist/components/button-tertiary/ButtonTertiary.d.mts.map +1 -0
- package/dist/components/button-tertiary/ButtonTertiary.mjs +61 -0
- package/dist/components/button-tertiary/ButtonTertiary.mjs.map +1 -0
- package/dist/components/button-tertiary/ButtonTertiary.types.cjs +3 -0
- package/dist/components/button-tertiary/ButtonTertiary.types.cjs.map +1 -0
- package/dist/components/{button-link/ButtonLink.types.d.cts → button-tertiary/ButtonTertiary.types.d.cts} +8 -3
- package/dist/components/button-tertiary/ButtonTertiary.types.d.cts.map +1 -0
- package/dist/components/{button-link/ButtonLink.types.d.mts → button-tertiary/ButtonTertiary.types.d.mts} +8 -3
- package/dist/components/button-tertiary/ButtonTertiary.types.d.mts.map +1 -0
- package/dist/components/button-tertiary/ButtonTertiary.types.mjs +2 -0
- package/dist/components/button-tertiary/ButtonTertiary.types.mjs.map +1 -0
- package/dist/components/button-tertiary/index.cjs +8 -0
- package/dist/components/button-tertiary/index.cjs.map +1 -0
- package/dist/components/button-tertiary/index.d.cts +4 -0
- package/dist/components/button-tertiary/index.d.cts.map +1 -0
- package/dist/components/button-tertiary/index.d.mts +4 -0
- package/dist/components/button-tertiary/index.d.mts.map +1 -0
- package/dist/components/button-tertiary/index.mjs +3 -0
- package/dist/components/button-tertiary/index.mjs.map +1 -0
- package/dist/components/index.cjs +40 -9
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +26 -7
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +26 -7
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +14 -6
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/jazzicon/Jazzicon.cjs +98 -0
- package/dist/components/jazzicon/Jazzicon.cjs.map +1 -0
- package/dist/components/jazzicon/Jazzicon.d.cts +7 -0
- package/dist/components/jazzicon/Jazzicon.d.cts.map +1 -0
- package/dist/components/jazzicon/Jazzicon.d.mts +7 -0
- package/dist/components/jazzicon/Jazzicon.d.mts.map +1 -0
- package/dist/components/jazzicon/Jazzicon.mjs +77 -0
- package/dist/components/jazzicon/Jazzicon.mjs.map +1 -0
- package/dist/components/jazzicon/Jazzicon.types.cjs +3 -0
- package/dist/components/jazzicon/Jazzicon.types.cjs.map +1 -0
- package/dist/components/jazzicon/Jazzicon.types.d.cts +16 -0
- package/dist/components/jazzicon/Jazzicon.types.d.cts.map +1 -0
- package/dist/components/jazzicon/Jazzicon.types.d.mts +16 -0
- package/dist/components/jazzicon/Jazzicon.types.d.mts.map +1 -0
- package/dist/components/jazzicon/Jazzicon.types.mjs +2 -0
- package/dist/components/jazzicon/Jazzicon.types.mjs.map +1 -0
- package/dist/components/jazzicon/Jazzicon.utilities.cjs +58 -0
- package/dist/components/jazzicon/Jazzicon.utilities.cjs.map +1 -0
- package/dist/components/jazzicon/Jazzicon.utilities.d.cts +15 -0
- package/dist/components/jazzicon/Jazzicon.utilities.d.cts.map +1 -0
- package/dist/components/jazzicon/Jazzicon.utilities.d.mts +15 -0
- package/dist/components/jazzicon/Jazzicon.utilities.d.mts.map +1 -0
- package/dist/components/jazzicon/Jazzicon.utilities.mjs +52 -0
- package/dist/components/jazzicon/Jazzicon.utilities.mjs.map +1 -0
- package/dist/components/jazzicon/index.cjs +6 -0
- package/dist/components/jazzicon/index.cjs.map +1 -0
- package/dist/components/jazzicon/index.d.cts +3 -0
- package/dist/components/jazzicon/index.d.cts.map +1 -0
- package/dist/components/jazzicon/index.d.mts +3 -0
- package/dist/components/jazzicon/index.d.mts.map +1 -0
- package/dist/components/jazzicon/index.mjs +2 -0
- package/dist/components/jazzicon/index.mjs.map +1 -0
- package/dist/components/text/Text.cjs +2 -2
- package/dist/components/text/Text.cjs.map +1 -1
- package/dist/components/text/Text.d.cts.map +1 -1
- package/dist/components/text/Text.d.mts.map +1 -1
- package/dist/components/text/Text.mjs +2 -2
- package/dist/components/text/Text.mjs.map +1 -1
- package/dist/components/text/Text.types.cjs.map +1 -1
- package/dist/components/text/Text.types.d.cts +4 -0
- package/dist/components/text/Text.types.d.cts.map +1 -1
- package/dist/components/text/Text.types.d.mts +4 -0
- package/dist/components/text/Text.types.d.mts.map +1 -1
- package/dist/components/text/Text.types.mjs.map +1 -1
- package/dist/components/text-button/TextButton.cjs +49 -0
- package/dist/components/text-button/TextButton.cjs.map +1 -0
- package/dist/components/text-button/TextButton.d.cts +4 -0
- package/dist/components/text-button/TextButton.d.cts.map +1 -0
- package/dist/components/text-button/TextButton.d.mts +4 -0
- package/dist/components/text-button/TextButton.d.mts.map +1 -0
- package/dist/components/text-button/TextButton.mjs +50 -0
- package/dist/components/text-button/TextButton.mjs.map +1 -0
- package/dist/components/text-button/TextButton.types.cjs +3 -0
- package/dist/components/text-button/TextButton.types.cjs.map +1 -0
- package/dist/components/text-button/TextButton.types.d.cts +35 -0
- package/dist/components/text-button/TextButton.types.d.cts.map +1 -0
- package/dist/components/text-button/TextButton.types.d.mts +35 -0
- package/dist/components/text-button/TextButton.types.d.mts.map +1 -0
- package/dist/components/text-button/TextButton.types.mjs +2 -0
- package/dist/components/text-button/TextButton.types.mjs.map +1 -0
- package/dist/components/text-button/index.cjs +6 -0
- package/dist/components/text-button/index.cjs.map +1 -0
- package/dist/components/text-button/index.d.cts +3 -0
- package/dist/components/text-button/index.d.cts.map +1 -0
- package/dist/components/text-button/index.d.mts +3 -0
- package/dist/components/text-button/index.d.mts.map +1 -0
- package/dist/components/text-button/index.mjs +2 -0
- package/dist/components/text-button/index.mjs.map +1 -0
- package/package.json +11 -6
- package/dist/components/button-link/ButtonLink.cjs +0 -32
- package/dist/components/button-link/ButtonLink.cjs.map +0 -1
- package/dist/components/button-link/ButtonLink.d.cts +0 -4
- package/dist/components/button-link/ButtonLink.d.cts.map +0 -1
- package/dist/components/button-link/ButtonLink.d.mts +0 -4
- package/dist/components/button-link/ButtonLink.d.mts.map +0 -1
- package/dist/components/button-link/ButtonLink.mjs +0 -33
- package/dist/components/button-link/ButtonLink.mjs.map +0 -1
- package/dist/components/button-link/ButtonLink.types.cjs.map +0 -1
- package/dist/components/button-link/ButtonLink.types.d.cts.map +0 -1
- package/dist/components/button-link/ButtonLink.types.d.mts.map +0 -1
- package/dist/components/button-link/ButtonLink.types.mjs +0 -2
- package/dist/components/button-link/ButtonLink.types.mjs.map +0 -1
- package/dist/components/button-link/index.cjs +0 -8
- package/dist/components/button-link/index.cjs.map +0 -1
- package/dist/components/button-link/index.d.cts +0 -4
- package/dist/components/button-link/index.d.mts +0 -4
- package/dist/components/button-link/index.mjs +0 -3
- package/dist/components/button-link/index.mjs.map +0 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Jazzicon = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const jazzicon_1 = __importDefault(require("@metamask/jazzicon"));
|
|
32
|
+
const utils_1 = require("@metamask/utils");
|
|
33
|
+
const Jazzicon_types_1 = require("./Jazzicon.types.cjs");
|
|
34
|
+
const Jazzicon_utilities_1 = require("./Jazzicon.utilities.cjs");
|
|
35
|
+
/**
|
|
36
|
+
* Cache for storing generated SVG elements by `address:diameter` so
|
|
37
|
+
* we don't regenerate them repeatedly.
|
|
38
|
+
*/
|
|
39
|
+
const iconCache = {};
|
|
40
|
+
const Jazzicon = ({ address, size = 32, ...props }) => {
|
|
41
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
let isCancelled = false;
|
|
44
|
+
(async () => {
|
|
45
|
+
if (!containerRef.current) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// Clear any existing content
|
|
49
|
+
while (containerRef.current.firstChild) {
|
|
50
|
+
containerRef.current.removeChild(containerRef.current.firstChild);
|
|
51
|
+
}
|
|
52
|
+
// Check the cache
|
|
53
|
+
const cacheKey = `${address.toLowerCase()}:${size}`;
|
|
54
|
+
if (iconCache[cacheKey]) {
|
|
55
|
+
// If cached, just append a clone
|
|
56
|
+
if (!isCancelled) {
|
|
57
|
+
const clone = iconCache[cacheKey].cloneNode(true);
|
|
58
|
+
containerRef.current.appendChild(clone);
|
|
59
|
+
}
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Determine the CAIP namespace
|
|
63
|
+
const namespace = await (0, Jazzicon_utilities_1.getCaipNamespaceFromAddress)(address);
|
|
64
|
+
if (isCancelled) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Pick seeding strategy based on namespace
|
|
68
|
+
let seed;
|
|
69
|
+
if (namespace === utils_1.KnownCaipNamespace.Eip155) {
|
|
70
|
+
seed = (0, Jazzicon_utilities_1.generateSeedEthereum)(address);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
seed = (0, Jazzicon_utilities_1.generateSeedNonEthereum)(address);
|
|
74
|
+
}
|
|
75
|
+
// Create Jazzicon
|
|
76
|
+
const newIcon = (0, jazzicon_1.default)(size, seed);
|
|
77
|
+
// Cache it
|
|
78
|
+
iconCache[cacheKey] = newIcon;
|
|
79
|
+
// Append a fresh clone
|
|
80
|
+
if (!isCancelled && containerRef.current) {
|
|
81
|
+
containerRef.current.appendChild(newIcon.cloneNode(true));
|
|
82
|
+
}
|
|
83
|
+
})();
|
|
84
|
+
// Cleanup
|
|
85
|
+
return () => {
|
|
86
|
+
isCancelled = true;
|
|
87
|
+
if (containerRef.current) {
|
|
88
|
+
while (containerRef.current.firstChild) {
|
|
89
|
+
containerRef.current.removeChild(containerRef.current.firstChild);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}, [address, size]);
|
|
94
|
+
return react_1.default.createElement("div", { ref: containerRef, ...props });
|
|
95
|
+
};
|
|
96
|
+
exports.Jazzicon = Jazzicon;
|
|
97
|
+
exports.Jazzicon.displayName = 'Jazzicon';
|
|
98
|
+
//# sourceMappingURL=Jazzicon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.cjs","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AACjD,kEAA0C;AAC1C,2CAAqD;AAErD,yDAAiD;AACjD,iEAI8B;AAE9B;;;GAGG;AACH,MAAM,SAAS,GAAmC,EAAE,CAAC;AAE9C,MAAM,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,KAAK,EAAiB,EAAE,EAAE;IAC1E,MAAM,YAAY,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAElD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,CAAC,KAAK,IAAI,EAAE;YACV,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;gBACzB,OAAO;aACR;YACD,6BAA6B;YAC7B,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;gBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;aACnE;YAED,kBAAkB;YAClB,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC;YACpD,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE;gBACvB,iCAAiC;gBACjC,IAAI,CAAC,WAAW,EAAE;oBAChB,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,IAAI,CAAmB,CAAC;oBACpE,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;iBACzC;gBACD,OAAO;aACR;YAED,+BAA+B;YAC/B,MAAM,SAAS,GAAG,MAAM,IAAA,gDAA2B,EAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,WAAW,EAAE;gBACf,OAAO;aACR;YAED,2CAA2C;YAC3C,IAAI,IAAuB,CAAC;YAC5B,IAAI,SAAS,KAAK,0BAAkB,CAAC,MAAM,EAAE;gBAC3C,IAAI,GAAG,IAAA,yCAAoB,EAAC,OAAO,CAAC,CAAC;aACtC;iBAAM;gBACL,IAAI,GAAG,IAAA,4CAAuB,EAAC,OAAO,CAAC,CAAC;aACzC;YAED,kBAAkB;YAClB,MAAM,OAAO,GAAG,IAAA,kBAAQ,EAAC,IAAI,EAAE,IAAI,CAAmB,CAAC;YAEvD,WAAW;YACX,SAAS,CAAC,QAAQ,CAAC,GAAG,OAAyB,CAAC;YAEhD,uBAAuB;YACvB,IAAI,CAAC,WAAW,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;aAC3D;QACH,CAAC,CAAC,EAAE,CAAC;QAEL,UAAU;QACV,OAAO,GAAG,EAAE;YACV,WAAW,GAAG,IAAI,CAAC;YACnB,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxB,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;oBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;iBACnE;aACF;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,uCAAK,GAAG,EAAE,YAAY,KAAM,KAAK,GAAI,CAAC;AAC/C,CAAC,CAAC;AAhEW,QAAA,QAAQ,YAgEnB;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport jazzicon from '@metamask/jazzicon';\nimport { KnownCaipNamespace } from '@metamask/utils';\n\nimport { JazziconProps } from './Jazzicon.types';\nimport {\n generateSeedEthereum,\n generateSeedNonEthereum,\n getCaipNamespaceFromAddress,\n} from './Jazzicon.utilities';\n\n/**\n * Cache for storing generated SVG elements by `address:diameter` so\n * we don't regenerate them repeatedly.\n */\nconst iconCache: Record<string, HTMLDivElement> = {};\n\nexport const Jazzicon = ({ address, size = 32, ...props }: JazziconProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n (async () => {\n if (!containerRef.current) {\n return;\n }\n // Clear any existing content\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n\n // Check the cache\n const cacheKey = `${address.toLowerCase()}:${size}`;\n if (iconCache[cacheKey]) {\n // If cached, just append a clone\n if (!isCancelled) {\n const clone = iconCache[cacheKey].cloneNode(true) as HTMLDivElement;\n containerRef.current.appendChild(clone);\n }\n return;\n }\n\n // Determine the CAIP namespace\n const namespace = await getCaipNamespaceFromAddress(address);\n if (isCancelled) {\n return;\n }\n\n // Pick seeding strategy based on namespace\n let seed: number | number[];\n if (namespace === KnownCaipNamespace.Eip155) {\n seed = generateSeedEthereum(address);\n } else {\n seed = generateSeedNonEthereum(address);\n }\n\n // Create Jazzicon\n const newIcon = jazzicon(size, seed) as HTMLDivElement;\n\n // Cache it\n iconCache[cacheKey] = newIcon as HTMLDivElement;\n\n // Append a fresh clone\n if (!isCancelled && containerRef.current) {\n containerRef.current.appendChild(newIcon.cloneNode(true));\n }\n })();\n\n // Cleanup\n return () => {\n isCancelled = true;\n if (containerRef.current) {\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n }\n };\n }, [address, size]);\n\n return <div ref={containerRef} {...props} />;\n};\n\nJazzicon.displayName = 'Jazzicon';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.d.cts","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,cAAc;AAIjD,OAAO,EAAE,aAAa,EAAE,6BAAyB;AAajD,eAAO,MAAM,QAAQ;kCAAsC,aAAa;;CAgEvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.d.mts","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,cAAc;AAIjD,OAAO,EAAE,aAAa,EAAE,6BAAyB;AAajD,eAAO,MAAM,QAAQ;kCAAsC,aAAa;;CAgEvE,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React from "react";
|
|
8
|
+
const { useEffect, useRef } = $React;
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import $jazzicon from "@metamask/jazzicon";
|
|
11
|
+
const jazzicon = $importDefault($jazzicon);
|
|
12
|
+
import { KnownCaipNamespace } from "@metamask/utils";
|
|
13
|
+
import { JazziconProps } from "./Jazzicon.types.mjs";
|
|
14
|
+
import { generateSeedEthereum, generateSeedNonEthereum, getCaipNamespaceFromAddress } from "./Jazzicon.utilities.mjs";
|
|
15
|
+
/**
|
|
16
|
+
* Cache for storing generated SVG elements by `address:diameter` so
|
|
17
|
+
* we don't regenerate them repeatedly.
|
|
18
|
+
*/
|
|
19
|
+
const iconCache = {};
|
|
20
|
+
export const Jazzicon = ({ address, size = 32, ...props }) => {
|
|
21
|
+
const containerRef = useRef(null);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
let isCancelled = false;
|
|
24
|
+
(async () => {
|
|
25
|
+
if (!containerRef.current) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Clear any existing content
|
|
29
|
+
while (containerRef.current.firstChild) {
|
|
30
|
+
containerRef.current.removeChild(containerRef.current.firstChild);
|
|
31
|
+
}
|
|
32
|
+
// Check the cache
|
|
33
|
+
const cacheKey = `${address.toLowerCase()}:${size}`;
|
|
34
|
+
if (iconCache[cacheKey]) {
|
|
35
|
+
// If cached, just append a clone
|
|
36
|
+
if (!isCancelled) {
|
|
37
|
+
const clone = iconCache[cacheKey].cloneNode(true);
|
|
38
|
+
containerRef.current.appendChild(clone);
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// Determine the CAIP namespace
|
|
43
|
+
const namespace = await getCaipNamespaceFromAddress(address);
|
|
44
|
+
if (isCancelled) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Pick seeding strategy based on namespace
|
|
48
|
+
let seed;
|
|
49
|
+
if (namespace === KnownCaipNamespace.Eip155) {
|
|
50
|
+
seed = generateSeedEthereum(address);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
seed = generateSeedNonEthereum(address);
|
|
54
|
+
}
|
|
55
|
+
// Create Jazzicon
|
|
56
|
+
const newIcon = jazzicon(size, seed);
|
|
57
|
+
// Cache it
|
|
58
|
+
iconCache[cacheKey] = newIcon;
|
|
59
|
+
// Append a fresh clone
|
|
60
|
+
if (!isCancelled && containerRef.current) {
|
|
61
|
+
containerRef.current.appendChild(newIcon.cloneNode(true));
|
|
62
|
+
}
|
|
63
|
+
})();
|
|
64
|
+
// Cleanup
|
|
65
|
+
return () => {
|
|
66
|
+
isCancelled = true;
|
|
67
|
+
if (containerRef.current) {
|
|
68
|
+
while (containerRef.current.firstChild) {
|
|
69
|
+
containerRef.current.removeChild(containerRef.current.firstChild);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}, [address, size]);
|
|
74
|
+
return React.createElement("div", { ref: containerRef, ...props });
|
|
75
|
+
};
|
|
76
|
+
Jazzicon.displayName = 'Jazzicon';
|
|
77
|
+
//# sourceMappingURL=Jazzicon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.mjs","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.tsx"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,SAAQ,2BAA2B;;AAC1C,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AAErD,OAAO,EAAE,aAAa,EAAE,6BAAyB;AACjD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC5B,iCAA6B;AAE9B;;;GAGG;AACH,MAAM,SAAS,GAAmC,EAAE,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,KAAK,EAAiB,EAAE,EAAE;IAC1E,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,CAAC,KAAK,IAAI,EAAE;YACV,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;gBACzB,OAAO;aACR;YACD,6BAA6B;YAC7B,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;gBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;aACnE;YAED,kBAAkB;YAClB,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC;YACpD,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE;gBACvB,iCAAiC;gBACjC,IAAI,CAAC,WAAW,EAAE;oBAChB,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,IAAI,CAAmB,CAAC;oBACpE,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;iBACzC;gBACD,OAAO;aACR;YAED,+BAA+B;YAC/B,MAAM,SAAS,GAAG,MAAM,2BAA2B,CAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,WAAW,EAAE;gBACf,OAAO;aACR;YAED,2CAA2C;YAC3C,IAAI,IAAuB,CAAC;YAC5B,IAAI,SAAS,KAAK,kBAAkB,CAAC,MAAM,EAAE;gBAC3C,IAAI,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;aACtC;iBAAM;gBACL,IAAI,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;aACzC;YAED,kBAAkB;YAClB,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAmB,CAAC;YAEvD,WAAW;YACX,SAAS,CAAC,QAAQ,CAAC,GAAG,OAAyB,CAAC;YAEhD,uBAAuB;YACvB,IAAI,CAAC,WAAW,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;aAC3D;QACH,CAAC,CAAC,EAAE,CAAC;QAEL,UAAU;QACV,OAAO,GAAG,EAAE;YACV,WAAW,GAAG,IAAI,CAAC;YACnB,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxB,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;oBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;iBACnE;aACF;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,6BAAK,GAAG,EAAE,YAAY,KAAM,KAAK,GAAI,CAAC;AAC/C,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport jazzicon from '@metamask/jazzicon';\nimport { KnownCaipNamespace } from '@metamask/utils';\n\nimport { JazziconProps } from './Jazzicon.types';\nimport {\n generateSeedEthereum,\n generateSeedNonEthereum,\n getCaipNamespaceFromAddress,\n} from './Jazzicon.utilities';\n\n/**\n * Cache for storing generated SVG elements by `address:diameter` so\n * we don't regenerate them repeatedly.\n */\nconst iconCache: Record<string, HTMLDivElement> = {};\n\nexport const Jazzicon = ({ address, size = 32, ...props }: JazziconProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n (async () => {\n if (!containerRef.current) {\n return;\n }\n // Clear any existing content\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n\n // Check the cache\n const cacheKey = `${address.toLowerCase()}:${size}`;\n if (iconCache[cacheKey]) {\n // If cached, just append a clone\n if (!isCancelled) {\n const clone = iconCache[cacheKey].cloneNode(true) as HTMLDivElement;\n containerRef.current.appendChild(clone);\n }\n return;\n }\n\n // Determine the CAIP namespace\n const namespace = await getCaipNamespaceFromAddress(address);\n if (isCancelled) {\n return;\n }\n\n // Pick seeding strategy based on namespace\n let seed: number | number[];\n if (namespace === KnownCaipNamespace.Eip155) {\n seed = generateSeedEthereum(address);\n } else {\n seed = generateSeedNonEthereum(address);\n }\n\n // Create Jazzicon\n const newIcon = jazzicon(size, seed) as HTMLDivElement;\n\n // Cache it\n iconCache[cacheKey] = newIcon as HTMLDivElement;\n\n // Append a fresh clone\n if (!isCancelled && containerRef.current) {\n containerRef.current.appendChild(newIcon.cloneNode(true));\n }\n })();\n\n // Cleanup\n return () => {\n isCancelled = true;\n if (containerRef.current) {\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n }\n };\n }, [address, size]);\n\n return <div ref={containerRef} {...props} />;\n};\n\nJazzicon.displayName = 'Jazzicon';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.types.cjs","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nexport type JazziconProps = ComponentProps<'div'> & {\n /**\n * Required address used as a unique identifier to generate the Jazzicon.\n */\n address: string;\n /**\n * Optional prop to control the size of the Jazzicon.\n */\n size?: number;\n /**\n * Optional prop to add a test id to the icon\n */\n 'data-testid'?: string;\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export type JazziconProps = ComponentProps<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Required address used as a unique identifier to generate the Jazzicon.
|
|
5
|
+
*/
|
|
6
|
+
address: string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional prop to control the size of the Jazzicon.
|
|
9
|
+
*/
|
|
10
|
+
size?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Optional prop to add a test id to the icon
|
|
13
|
+
*/
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Jazzicon.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.types.d.cts","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAClD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export type JazziconProps = ComponentProps<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Required address used as a unique identifier to generate the Jazzicon.
|
|
5
|
+
*/
|
|
6
|
+
address: string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional prop to control the size of the Jazzicon.
|
|
9
|
+
*/
|
|
10
|
+
size?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Optional prop to add a test id to the icon
|
|
13
|
+
*/
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Jazzicon.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.types.d.mts","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAClD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.types.mjs","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nexport type JazziconProps = ComponentProps<'div'> & {\n /**\n * Required address used as a unique identifier to generate the Jazzicon.\n */\n address: string;\n /**\n * Optional prop to control the size of the Jazzicon.\n */\n size?: number;\n /**\n * Optional prop to add a test id to the icon\n */\n 'data-testid'?: string;\n};\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCaipNamespaceFromAddress = exports.generateSeedNonEthereum = exports.generateSeedEthereum = void 0;
|
|
4
|
+
const utils_1 = require("@metamask/utils");
|
|
5
|
+
const addresses_1 = require("@solana/addresses");
|
|
6
|
+
/**
|
|
7
|
+
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
8
|
+
*/
|
|
9
|
+
function generateSeedEthereum(address) {
|
|
10
|
+
// Example: parse the first 8 chars of the address after '0x'
|
|
11
|
+
const addr = address.slice(2, 10);
|
|
12
|
+
return parseInt(addr, 16);
|
|
13
|
+
}
|
|
14
|
+
exports.generateSeedEthereum = generateSeedEthereum;
|
|
15
|
+
/**
|
|
16
|
+
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
17
|
+
*/
|
|
18
|
+
function generateSeedNonEthereum(address) {
|
|
19
|
+
return Array.from((0, utils_1.stringToBytes)(address.normalize('NFKC').toLowerCase()));
|
|
20
|
+
}
|
|
21
|
+
exports.generateSeedNonEthereum = generateSeedNonEthereum;
|
|
22
|
+
/**
|
|
23
|
+
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
24
|
+
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
25
|
+
*/
|
|
26
|
+
async function getCaipNamespaceFromAddress(address) {
|
|
27
|
+
// Check for CAIP-10 formatted addresses
|
|
28
|
+
if (address.includes(':')) {
|
|
29
|
+
const [namespace] = address.split(':');
|
|
30
|
+
if (namespace.toLowerCase() === 'bip122') {
|
|
31
|
+
return utils_1.KnownCaipNamespace.Bip122;
|
|
32
|
+
}
|
|
33
|
+
if (namespace.toLowerCase() === 'solana') {
|
|
34
|
+
return utils_1.KnownCaipNamespace.Solana;
|
|
35
|
+
}
|
|
36
|
+
if (namespace.toLowerCase() === 'eip155') {
|
|
37
|
+
return utils_1.KnownCaipNamespace.Eip155;
|
|
38
|
+
}
|
|
39
|
+
// Add other namespaces as needed.
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const { validate, Network } = await import("bitcoin-address-validation");
|
|
43
|
+
if (validate(address, Network.mainnet) ||
|
|
44
|
+
validate(address, Network.testnet)) {
|
|
45
|
+
return utils_1.KnownCaipNamespace.Bip122;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// If the import fails or 'validate' is not available, fall through
|
|
50
|
+
}
|
|
51
|
+
if ((0, addresses_1.isAddress)(address)) {
|
|
52
|
+
return utils_1.KnownCaipNamespace.Solana;
|
|
53
|
+
}
|
|
54
|
+
// Default to Ethereum
|
|
55
|
+
return utils_1.KnownCaipNamespace.Eip155;
|
|
56
|
+
}
|
|
57
|
+
exports.getCaipNamespaceFromAddress = getCaipNamespaceFromAddress;
|
|
58
|
+
//# sourceMappingURL=Jazzicon.utilities.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.cjs","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":";;;AAAA,2CAAoE;AACpE,iDAAiE;AAEjE;;GAEG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,6DAA6D;IAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAJD,oDAIC;AAED;;GAEG;AACH,SAAgB,uBAAuB,CAAC,OAAe;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAA,qBAAa,EAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAFD,0DAEC;AAED;;;GAGG;AACI,KAAK,UAAU,2BAA2B,CAC/C,OAAe;IAEf,wCAAwC;IACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACzB,MAAM,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;QACD,kCAAkC;KACnC;IAED,IAAI;QACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,8BAA8B,CAAC;QACzE,IACE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;YAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAClC;YACA,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;KACF;IAAC,MAAM;QACN,mEAAmE;KACpE;IAED,IAAI,IAAA,qBAAe,EAAC,OAAO,CAAC,EAAE;QAC5B,OAAO,0BAAkB,CAAC,MAAM,CAAC;KAClC;IAED,sBAAsB;IACtB,OAAO,0BAAkB,CAAC,MAAM,CAAC;AACnC,CAAC;AApCD,kEAoCC","sourcesContent":["import { stringToBytes, KnownCaipNamespace } from '@metamask/utils';\nimport { isAddress as isSolanaAddress } from '@solana/addresses';\n\n/**\n * Generates a numeric seed for Ethereum (eip155) addresses.\n */\nexport function generateSeedEthereum(address: string): number {\n // Example: parse the first 8 chars of the address after '0x'\n const addr = address.slice(2, 10);\n return parseInt(addr, 16);\n}\n\n/**\n * Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).\n */\nexport function generateSeedNonEthereum(address: string): number[] {\n return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));\n}\n\n/**\n * Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.\n * Returns a Promise that resolves to one of the known CAIP-2 namespaces.\n */\nexport async function getCaipNamespaceFromAddress(\n address: string,\n): Promise<KnownCaipNamespace> {\n // Check for CAIP-10 formatted addresses\n if (address.includes(':')) {\n const [namespace] = address.split(':');\n if (namespace.toLowerCase() === 'bip122') {\n return KnownCaipNamespace.Bip122;\n }\n if (namespace.toLowerCase() === 'solana') {\n return KnownCaipNamespace.Solana;\n }\n if (namespace.toLowerCase() === 'eip155') {\n return KnownCaipNamespace.Eip155;\n }\n // Add other namespaces as needed.\n }\n\n try {\n const { validate, Network } = await import('bitcoin-address-validation');\n if (\n validate(address, Network.mainnet) ||\n validate(address, Network.testnet)\n ) {\n return KnownCaipNamespace.Bip122;\n }\n } catch {\n // If the import fails or 'validate' is not available, fall through\n }\n\n if (isSolanaAddress(address)) {\n return KnownCaipNamespace.Solana;\n }\n\n // Default to Ethereum\n return KnownCaipNamespace.Eip155;\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { KnownCaipNamespace } from "@metamask/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateSeedEthereum(address: string): number;
|
|
6
|
+
/**
|
|
7
|
+
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateSeedNonEthereum(address: string): number[];
|
|
10
|
+
/**
|
|
11
|
+
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
12
|
+
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCaipNamespaceFromAddress(address: string): Promise<KnownCaipNamespace>;
|
|
15
|
+
//# sourceMappingURL=Jazzicon.utilities.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.d.cts","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,wBAAwB;AAGpE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAEjE;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAkC7B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { KnownCaipNamespace } from "@metamask/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateSeedEthereum(address: string): number;
|
|
6
|
+
/**
|
|
7
|
+
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateSeedNonEthereum(address: string): number[];
|
|
10
|
+
/**
|
|
11
|
+
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
12
|
+
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCaipNamespaceFromAddress(address: string): Promise<KnownCaipNamespace>;
|
|
15
|
+
//# sourceMappingURL=Jazzicon.utilities.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.d.mts","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,wBAAwB;AAGpE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAEjE;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAkC7B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { stringToBytes, KnownCaipNamespace } from "@metamask/utils";
|
|
2
|
+
import { isAddress as isSolanaAddress } from "@solana/addresses";
|
|
3
|
+
/**
|
|
4
|
+
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
5
|
+
*/
|
|
6
|
+
export function generateSeedEthereum(address) {
|
|
7
|
+
// Example: parse the first 8 chars of the address after '0x'
|
|
8
|
+
const addr = address.slice(2, 10);
|
|
9
|
+
return parseInt(addr, 16);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
13
|
+
*/
|
|
14
|
+
export function generateSeedNonEthereum(address) {
|
|
15
|
+
return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
19
|
+
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
20
|
+
*/
|
|
21
|
+
export async function getCaipNamespaceFromAddress(address) {
|
|
22
|
+
// Check for CAIP-10 formatted addresses
|
|
23
|
+
if (address.includes(':')) {
|
|
24
|
+
const [namespace] = address.split(':');
|
|
25
|
+
if (namespace.toLowerCase() === 'bip122') {
|
|
26
|
+
return KnownCaipNamespace.Bip122;
|
|
27
|
+
}
|
|
28
|
+
if (namespace.toLowerCase() === 'solana') {
|
|
29
|
+
return KnownCaipNamespace.Solana;
|
|
30
|
+
}
|
|
31
|
+
if (namespace.toLowerCase() === 'eip155') {
|
|
32
|
+
return KnownCaipNamespace.Eip155;
|
|
33
|
+
}
|
|
34
|
+
// Add other namespaces as needed.
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const { validate, Network } = await import("bitcoin-address-validation");
|
|
38
|
+
if (validate(address, Network.mainnet) ||
|
|
39
|
+
validate(address, Network.testnet)) {
|
|
40
|
+
return KnownCaipNamespace.Bip122;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// If the import fails or 'validate' is not available, fall through
|
|
45
|
+
}
|
|
46
|
+
if (isSolanaAddress(address)) {
|
|
47
|
+
return KnownCaipNamespace.Solana;
|
|
48
|
+
}
|
|
49
|
+
// Default to Ethereum
|
|
50
|
+
return KnownCaipNamespace.Eip155;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=Jazzicon.utilities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.mjs","sourceRoot":"","sources":["../../../src/components/jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,wBAAwB;AACpE,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,0BAA0B;AAEjE;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,6DAA6D;IAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,OAAe;IAEf,wCAAwC;IACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACzB,MAAM,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,kBAAkB,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,kBAAkB,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,kBAAkB,CAAC,MAAM,CAAC;SAClC;QACD,kCAAkC;KACnC;IAED,IAAI;QACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,8BAA8B,CAAC;QACzE,IACE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;YAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAClC;YACA,OAAO,kBAAkB,CAAC,MAAM,CAAC;SAClC;KACF;IAAC,MAAM;QACN,mEAAmE;KACpE;IAED,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE;QAC5B,OAAO,kBAAkB,CAAC,MAAM,CAAC;KAClC;IAED,sBAAsB;IACtB,OAAO,kBAAkB,CAAC,MAAM,CAAC;AACnC,CAAC","sourcesContent":["import { stringToBytes, KnownCaipNamespace } from '@metamask/utils';\nimport { isAddress as isSolanaAddress } from '@solana/addresses';\n\n/**\n * Generates a numeric seed for Ethereum (eip155) addresses.\n */\nexport function generateSeedEthereum(address: string): number {\n // Example: parse the first 8 chars of the address after '0x'\n const addr = address.slice(2, 10);\n return parseInt(addr, 16);\n}\n\n/**\n * Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).\n */\nexport function generateSeedNonEthereum(address: string): number[] {\n return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));\n}\n\n/**\n * Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.\n * Returns a Promise that resolves to one of the known CAIP-2 namespaces.\n */\nexport async function getCaipNamespaceFromAddress(\n address: string,\n): Promise<KnownCaipNamespace> {\n // Check for CAIP-10 formatted addresses\n if (address.includes(':')) {\n const [namespace] = address.split(':');\n if (namespace.toLowerCase() === 'bip122') {\n return KnownCaipNamespace.Bip122;\n }\n if (namespace.toLowerCase() === 'solana') {\n return KnownCaipNamespace.Solana;\n }\n if (namespace.toLowerCase() === 'eip155') {\n return KnownCaipNamespace.Eip155;\n }\n // Add other namespaces as needed.\n }\n\n try {\n const { validate, Network } = await import('bitcoin-address-validation');\n if (\n validate(address, Network.mainnet) ||\n validate(address, Network.testnet)\n ) {\n return KnownCaipNamespace.Bip122;\n }\n } catch {\n // If the import fails or 'validate' is not available, fall through\n }\n\n if (isSolanaAddress(address)) {\n return KnownCaipNamespace.Solana;\n }\n\n // Default to Ethereum\n return KnownCaipNamespace.Eip155;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Jazzicon = void 0;
|
|
4
|
+
var Jazzicon_1 = require("./Jazzicon.cjs");
|
|
5
|
+
Object.defineProperty(exports, "Jazzicon", { enumerable: true, get: function () { return Jazzicon_1.Jazzicon; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/jazzicon/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAA7B,oGAAA,QAAQ,OAAA","sourcesContent":["export { Jazzicon } from './Jazzicon';\nexport type { JazziconProps } from './Jazzicon.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/jazzicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/jazzicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/jazzicon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,uBAAmB","sourcesContent":["export { Jazzicon } from './Jazzicon';\nexport type { JazziconProps } from './Jazzicon.types';\n"]}
|
|
@@ -9,12 +9,12 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
10
10
|
const Text_constants_1 = require("./Text.constants.cjs");
|
|
11
11
|
const Text_types_1 = require("./Text.types.cjs");
|
|
12
|
-
const Text = ({ variant = Text_types_1.TextVariant.BodyMd, children, className, fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = Text_types_1.TextColor.TextDefault, style, }) => {
|
|
12
|
+
const Text = ({ variant = Text_types_1.TextVariant.BodyMd, children, className, fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = Text_types_1.TextColor.TextDefault, style, ...props }) => {
|
|
13
13
|
// When asChild is true, use Radix Slot to merge props onto the child component.
|
|
14
14
|
// Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
|
|
15
15
|
const Component = asChild ? react_slot_1.Slot : Text_constants_1.TEXT_DEFAULT_TAG_MAP[variant];
|
|
16
16
|
const mergedClassName = (0, tw_merge_1.twMerge)(color, Text_constants_1.TEXT_CLASS_MAP[variant], fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className);
|
|
17
|
-
return (react_1.default.createElement(Component, { className: mergedClassName, style: style }, children));
|
|
17
|
+
return (react_1.default.createElement(Component, { className: mergedClassName, style: style, ...props }, children));
|
|
18
18
|
};
|
|
19
19
|
exports.Text = Text;
|
|
20
20
|
//# sourceMappingURL=Text.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAC5C,kDAA0B;AAE1B,uDAA+C;AAC/C,yDAAwE;AAExE,iDAAsD;AAE/C,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,wBAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,sBAAS,CAAC,WAAW,EAC7B,KAAK,
|
|
1
|
+
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAC5C,kDAA0B;AAE1B,uDAA+C;AAC/C,yDAAwE;AAExE,iDAAsD;AAE/C,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,wBAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,sBAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,qCAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,IAAA,kBAAO,EAC7B,KAAK,EACL,+BAAc,CAAC,OAAO,CAAC,EACvB,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AApCW,QAAA,IAAI,QAoCf","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from './Text.constants';\nimport type { TextProps } from './Text.types';\nimport { TextVariant, TextColor } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component = asChild ? Slot : TEXT_DEFAULT_TAG_MAP[variant];\n\n const mergedClassName = twMerge(\n color,\n TEXT_CLASS_MAP[variant],\n fontWeight,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n );\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAoCpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAoCpC,CAAC"}
|
|
@@ -10,11 +10,11 @@ const React = $importDefault($React);
|
|
|
10
10
|
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
11
11
|
import { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from "./Text.constants.mjs";
|
|
12
12
|
import { TextVariant, TextColor } from "./Text.types.mjs";
|
|
13
|
-
export const Text = ({ variant = TextVariant.BodyMd, children, className, fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = TextColor.TextDefault, style, }) => {
|
|
13
|
+
export const Text = ({ variant = TextVariant.BodyMd, children, className, fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = TextColor.TextDefault, style, ...props }) => {
|
|
14
14
|
// When asChild is true, use Radix Slot to merge props onto the child component.
|
|
15
15
|
// Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
|
|
16
16
|
const Component = asChild ? Slot : TEXT_DEFAULT_TAG_MAP[variant];
|
|
17
17
|
const mergedClassName = twMerge(color, TEXT_CLASS_MAP[variant], fontWeight, fontStyle, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className);
|
|
18
|
-
return (React.createElement(Component, { className: mergedClassName, style: style }, children));
|
|
18
|
+
return (React.createElement(Component, { className: mergedClassName, style: style, ...props }, children));
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=Text.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,6BAAyB;AAExE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,yBAAqB;AAEtD,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,
|
|
1
|
+
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,6BAAyB;AAExE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,yBAAqB;AAEtD,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,OAAO,CAC7B,KAAK,EACL,cAAc,CAAC,OAAO,CAAC,EACvB,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { TEXT_CLASS_MAP, TEXT_DEFAULT_TAG_MAP } from './Text.constants';\nimport type { TextProps } from './Text.types';\nimport { TextVariant, TextColor } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component = asChild ? Slot : TEXT_DEFAULT_TAG_MAP[variant];\n\n const mergedClassName = twMerge(\n color,\n TEXT_CLASS_MAP[variant],\n fontWeight,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n );\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/text/Text.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/text/Text.types.ts"],"names":[],"mappings":";;;AAoEA,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,gBAAgB;IAChB,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IAExB,gBAAgB;IAChB,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IAExB,aAAa;IACb,iCAAkB,CAAA;IAClB,iCAAkB,CAAA;IAClB,iCAAkB,CAAA;IAClB,iCAAkB,CAAA;AACpB,CAAC,EAfW,WAAW,2BAAX,WAAW,QAetB;AAED,IAAY,SAmCX;AAnCD,WAAY,SAAS;IACnB,gCAAgC;IAChC,yCAA4B,CAAA;IAC5B,uCAAuC;IACvC,iDAAoC,CAAA;IACpC,6DAA6D;IAC7D,qCAAwB,CAAA;IACxB,qFAAqF;IACrF,oDAAuC,CAAA;IACvC,iGAAiG;IACjG,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,0FAA0F;IAC1F,gDAAmC,CAAA;IACnC,yDAAyD;IACzD,wDAA2C,CAAA;IAC3C,+EAA+E;IAC/E,gDAAmC,CAAA;IACnC,oFAAoF;IACpF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,yFAAyF;IACzF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,sFAAsF;IACtF,8CAAiC,CAAA;IACjC,8EAA8E;IAC9E,8CAAiC,CAAA;IACjC,8CAA8C;IAC9C,qCAAwB,CAAA;IACxB,sCAAsC;IACtC,6CAAgC,CAAA;AAClC,CAAC,EAnCW,SAAS,yBAAT,SAAS,QAmCpB;AAED,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,+BAAkB,CAAA;IAClB,mCAAsB,CAAA;IACtB,iCAAoB,CAAA;IACpB,qCAAwB,CAAA;AAC1B,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AAED,IAAY,UAaX;AAbD,WAAY,UAAU;IACpB;;OAEG;IACH,gCAAkB,CAAA;IAClB;;OAEG;IACH,oCAAsB,CAAA;IACtB;;OAEG;IACH,oCAAsB,CAAA;AACxB,CAAC,EAbW,UAAU,0BAAV,UAAU,QAarB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,sCAAsB,CAAA;IACtB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,0CAAyB,CAAA;IACzB,uCAAsB,CAAA;AACxB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB","sourcesContent":["export type TextProps = {\n /**\n * Optional prop for inline styles\n */\n style?: React.CSSProperties;\n /**\n * Optional prop to change the font size of the component. The Text component uses responsive font sizes.\n * Different variants map to specific HTML elements by default.\n * @default TextVariant.BodyMd\n */\n variant?: TextVariant;\n /**\n * The text content or elements to be rendered within the component.\n */\n children: React.ReactNode;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to control the font weight of the text.\n * - Normal: 400\n * - Medium: 500\n * - Bold: 700\n */\n fontWeight?: FontWeight;\n /**\n * Optional prop to control the font style of the text.\n * Options: Normal, Italic\n */\n fontStyle?: FontStyle;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional prop that when true, adds an ellipsis (...) when text overflows its container.\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop that sets the color of the text using predefined theme colors.\n * @default TextColor.TextDefault\n */\n color?: TextColor;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n\nexport enum TextVariant {\n // Display Sizes\n DisplayLg = 'display-lg',\n DisplayMd = 'display-md',\n\n // Heading Sizes\n HeadingLg = 'heading-lg',\n HeadingMd = 'heading-md',\n HeadingSm = 'heading-sm',\n\n // Font Sizes\n BodyLg = 'body-lg',\n BodyMd = 'body-md',\n BodySm = 'body-sm',\n BodyXs = 'body-xs',\n}\n\nexport enum TextColor {\n /** For default neutral text. */\n TextDefault = 'text-default',\n /** For softer contrast neutral text */\n TextAlternative = 'text-alternative',\n /** For the softest contrast neutral text (not accessible) */\n TextMuted = 'text-muted',\n /** For elements used on top of overlay/alternative. Used for text, icon or border */\n OverlayInverse = 'text-overlay-inverse',\n /** For interactive, active, and selected semantics. Used for text, background, icon or border */\n PrimaryDefault = 'text-primary-default',\n /** For elements used on top of primary/default. Used for text, icon or border */\n PrimaryInverse = 'text-primary-inverse',\n /** For the critical alert semantic elements. Used for text, background, icon or border */\n ErrorDefault = 'text-error-default',\n /** For the stronger contrast error semantic elements. */\n ErrorAlternative = 'text-error-alternative',\n /** For elements used on top of error/default. Used for text, icon or border */\n ErrorInverse = 'text-error-inverse',\n /** For the positive semantic elements. Used for text, background, icon or border */\n SuccessDefault = 'text-success-default',\n /** For elements used on top of success/default. Used for text, icon or border */\n SuccessInverse = 'text-success-inverse',\n /** For the caution alert semantic elements. Used for text, background, icon or border */\n WarningDefault = 'text-warning-default',\n /** For elements used on top of warning/default. Used for text, icon or border */\n WarningInverse = 'text-warning-inverse',\n /** For informational read-only elements. Used for text, background, icon or border */\n InfoDefault = 'text-info-default',\n /** For elements used on top of info/default. Used for text, icon or border */\n InfoInverse = 'text-info-inverse',\n /** Inherit the color of the parent element */\n Inherit = 'text-inherit',\n /** Make the text color transparent */\n Transparent = 'text-transparent',\n}\n\nexport enum TextAlign {\n Left = 'text-left',\n Center = 'text-center',\n Right = 'text-right',\n Justify = 'text-justify',\n}\n\nexport enum FontWeight {\n /**\n * Weight - 700\n */\n Bold = 'font-bold',\n /**\n * Weight - 500\n */\n Medium = 'font-medium',\n /**\n * Weight - 400\n */\n Normal = 'font-normal',\n}\n\nexport enum OverflowWrap {\n BreakWord = 'break-words',\n Anywhere = 'break-all',\n Normal = 'break-normal',\n}\n\nexport enum FontStyle {\n Italic = 'italic',\n Normal = 'not-italic',\n}\n\nexport enum TextTransform {\n Uppercase = 'uppercase',\n Lowercase = 'lowercase',\n Capitalize = 'capitalize',\n Normal = 'normal-case',\n}\n"]}
|