@metamask-previews/design-system-react-native 0.9.0-preview.694a8ed → 0.11.0-preview.3aca0bd
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/CHANGELOG.md +51 -1
- package/dist/components/BannerAlert/BannerAlert.cjs +23 -0
- package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.cjs +30 -0
- package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts +7 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts +7 -0
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.constants.mjs +27 -0
- package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.d.cts +4 -0
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.d.mts +4 -0
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.mjs +23 -0
- package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.cjs +3 -0
- package/dist/components/BannerAlert/BannerAlert.types.cjs.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.cts +10 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.cts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.mts +10 -0
- package/dist/components/BannerAlert/BannerAlert.types.d.mts.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.types.mjs +2 -0
- package/dist/components/BannerAlert/BannerAlert.types.mjs.map +1 -0
- package/dist/components/BannerAlert/index.cjs +8 -0
- package/dist/components/BannerAlert/index.cjs.map +1 -0
- package/dist/components/BannerAlert/index.d.cts +4 -0
- package/dist/components/BannerAlert/index.d.cts.map +1 -0
- package/dist/components/BannerAlert/index.d.mts +4 -0
- package/dist/components/BannerAlert/index.d.mts.map +1 -0
- package/dist/components/BannerAlert/index.mjs +3 -0
- package/dist/components/BannerAlert/index.mjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.cjs +1 -1
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs +1 -1
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +109 -0
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.d.cts +16 -0
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.d.mts +16 -0
- package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.mjs +87 -0
- package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.types.cjs +3 -0
- package/dist/components/BottomSheet/BottomSheet.types.cjs.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.types.d.cts +28 -0
- package/dist/components/BottomSheet/BottomSheet.types.d.cts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.types.d.mts +28 -0
- package/dist/components/BottomSheet/BottomSheet.types.d.mts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.types.mjs +2 -0
- package/dist/components/BottomSheet/BottomSheet.types.mjs.map +1 -0
- package/dist/components/BottomSheet/index.cjs +6 -0
- package/dist/components/BottomSheet/index.cjs.map +1 -0
- package/dist/components/BottomSheet/index.d.cts +3 -0
- package/dist/components/BottomSheet/index.d.cts.map +1 -0
- package/dist/components/BottomSheet/index.d.mts +3 -0
- package/dist/components/BottomSheet/index.d.mts.map +1 -0
- package/dist/components/BottomSheet/index.mjs +2 -0
- package/dist/components/BottomSheet/index.mjs.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +207 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.cjs +18 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.cjs.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.cts +14 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.cts.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.mts +14 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.mts.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.mjs +15 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.mjs.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +13 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +13 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +190 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs +3 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +56 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +56 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs +2 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -0
- package/dist/components/BottomSheetDialog/index.cjs +9 -0
- package/dist/components/BottomSheetDialog/index.cjs.map +1 -0
- package/dist/components/BottomSheetDialog/index.d.cts +3 -0
- package/dist/components/BottomSheetDialog/index.d.cts.map +1 -0
- package/dist/components/BottomSheetDialog/index.d.mts +3 -0
- package/dist/components/BottomSheetDialog/index.d.mts.map +1 -0
- package/dist/components/BottomSheetDialog/index.mjs +2 -0
- package/dist/components/BottomSheetDialog/index.mjs.map +1 -0
- package/dist/components/ButtonBase/ButtonBase.cjs +2 -9
- package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.mjs +3 -10
- package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
- package/dist/components/ButtonFilter/ButtonFilter.cjs +28 -0
- package/dist/components/ButtonFilter/ButtonFilter.cjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.cts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.cts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.mts +4 -0
- package/dist/components/ButtonFilter/ButtonFilter.d.mts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.mjs +28 -0
- package/dist/components/ButtonFilter/ButtonFilter.mjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.cjs +3 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.cjs.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.cts +9 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.cts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.mts +9 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.d.mts.map +1 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.mjs +2 -0
- package/dist/components/ButtonFilter/ButtonFilter.types.mjs.map +1 -0
- package/dist/components/ButtonFilter/index.cjs +6 -0
- package/dist/components/ButtonFilter/index.cjs.map +1 -0
- package/dist/components/ButtonFilter/index.d.cts +3 -0
- package/dist/components/ButtonFilter/index.d.cts.map +1 -0
- package/dist/components/ButtonFilter/index.d.mts +3 -0
- package/dist/components/ButtonFilter/index.d.mts.map +1 -0
- package/dist/components/ButtonFilter/index.mjs +2 -0
- package/dist/components/ButtonFilter/index.mjs.map +1 -0
- package/dist/components/ButtonIcon/ButtonIcon.cjs +10 -4
- package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.cts +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.mts +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.mjs +11 -5
- package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +4 -11
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +4 -11
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
- package/dist/components/ButtonIcon/index.cjs +2 -1
- package/dist/components/ButtonIcon/index.cjs.map +1 -1
- package/dist/components/ButtonIcon/index.d.cts +1 -1
- package/dist/components/ButtonIcon/index.d.cts.map +1 -1
- package/dist/components/ButtonIcon/index.d.mts +1 -1
- package/dist/components/ButtonIcon/index.d.mts.map +1 -1
- package/dist/components/ButtonIcon/index.mjs +1 -1
- package/dist/components/ButtonIcon/index.mjs.map +1 -1
- package/dist/components/Icon/assets/ai.svg +1 -1
- package/dist/components/Input/Input.cjs +12 -2
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.cts +2 -1
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts +2 -1
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/Input/Input.mjs +12 -2
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Input/Input.types.cjs.map +1 -1
- package/dist/components/Input/Input.types.d.cts +5 -1
- package/dist/components/Input/Input.types.d.cts.map +1 -1
- package/dist/components/Input/Input.types.d.mts +5 -1
- package/dist/components/Input/Input.types.d.mts.map +1 -1
- package/dist/components/Input/Input.types.mjs.map +1 -1
- package/dist/components/ListItem/ListItem.cjs +61 -0
- package/dist/components/ListItem/ListItem.cjs.map +1 -0
- package/dist/components/ListItem/ListItem.constants.cjs +14 -0
- package/dist/components/ListItem/ListItem.constants.cjs.map +1 -0
- package/dist/components/ListItem/ListItem.constants.d.cts +8 -0
- package/dist/components/ListItem/ListItem.constants.d.cts.map +1 -0
- package/dist/components/ListItem/ListItem.constants.d.mts +8 -0
- package/dist/components/ListItem/ListItem.constants.d.mts.map +1 -0
- package/dist/components/ListItem/ListItem.constants.mjs +11 -0
- package/dist/components/ListItem/ListItem.constants.mjs.map +1 -0
- package/dist/components/ListItem/ListItem.d.cts +4 -0
- package/dist/components/ListItem/ListItem.d.cts.map +1 -0
- package/dist/components/ListItem/ListItem.d.mts +4 -0
- package/dist/components/ListItem/ListItem.d.mts.map +1 -0
- package/dist/components/ListItem/ListItem.mjs +41 -0
- package/dist/components/ListItem/ListItem.mjs.map +1 -0
- package/dist/components/ListItem/ListItem.types.cjs +12 -0
- package/dist/components/ListItem/ListItem.types.cjs.map +1 -0
- package/dist/components/ListItem/ListItem.types.d.cts +60 -0
- package/dist/components/ListItem/ListItem.types.d.cts.map +1 -0
- package/dist/components/ListItem/ListItem.types.d.mts +60 -0
- package/dist/components/ListItem/ListItem.types.d.mts.map +1 -0
- package/dist/components/ListItem/ListItem.types.mjs +9 -0
- package/dist/components/ListItem/ListItem.types.mjs.map +1 -0
- package/dist/components/ListItem/index.cjs +8 -0
- package/dist/components/ListItem/index.cjs.map +1 -0
- package/dist/components/ListItem/index.d.cts +4 -0
- package/dist/components/ListItem/index.d.cts.map +1 -0
- package/dist/components/ListItem/index.d.mts +4 -0
- package/dist/components/ListItem/index.d.mts.map +1 -0
- package/dist/components/ListItem/index.mjs +3 -0
- package/dist/components/ListItem/index.mjs.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.cjs +28 -0
- package/dist/components/MainActionButton/MainActionButton.cjs.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.d.cts +4 -0
- package/dist/components/MainActionButton/MainActionButton.d.cts.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.d.mts +4 -0
- package/dist/components/MainActionButton/MainActionButton.d.mts.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.mjs +28 -0
- package/dist/components/MainActionButton/MainActionButton.mjs.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.types.cjs +3 -0
- package/dist/components/MainActionButton/MainActionButton.types.cjs.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.types.d.cts +41 -0
- package/dist/components/MainActionButton/MainActionButton.types.d.cts.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.types.d.mts +41 -0
- package/dist/components/MainActionButton/MainActionButton.types.d.mts.map +1 -0
- package/dist/components/MainActionButton/MainActionButton.types.mjs +2 -0
- package/dist/components/MainActionButton/MainActionButton.types.mjs.map +1 -0
- package/dist/components/MainActionButton/index.cjs +6 -0
- package/dist/components/MainActionButton/index.cjs.map +1 -0
- package/dist/components/MainActionButton/index.d.cts +3 -0
- package/dist/components/MainActionButton/index.d.cts.map +1 -0
- package/dist/components/MainActionButton/index.d.mts +3 -0
- package/dist/components/MainActionButton/index.d.mts.map +1 -0
- package/dist/components/MainActionButton/index.mjs +2 -0
- package/dist/components/MainActionButton/index.mjs.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.cjs +22 -0
- package/dist/components/TabEmptyState/TabEmptyState.cjs.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.d.cts +4 -0
- package/dist/components/TabEmptyState/TabEmptyState.d.cts.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.d.mts +4 -0
- package/dist/components/TabEmptyState/TabEmptyState.d.mts.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.mjs +22 -0
- package/dist/components/TabEmptyState/TabEmptyState.mjs.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.cjs +3 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.cjs.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.d.cts +45 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.d.cts.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.d.mts +45 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.d.mts.map +1 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.mjs +2 -0
- package/dist/components/TabEmptyState/TabEmptyState.types.mjs.map +1 -0
- package/dist/components/TabEmptyState/index.cjs +6 -0
- package/dist/components/TabEmptyState/index.cjs.map +1 -0
- package/dist/components/TabEmptyState/index.d.cts +3 -0
- package/dist/components/TabEmptyState/index.d.cts.map +1 -0
- package/dist/components/TabEmptyState/index.d.mts +3 -0
- package/dist/components/TabEmptyState/index.d.mts.map +1 -0
- package/dist/components/TabEmptyState/index.mjs +2 -0
- package/dist/components/TabEmptyState/index.mjs.map +1 -0
- package/dist/components/Toast/Toast.cjs +3 -2
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts.map +1 -1
- package/dist/components/Toast/Toast.d.mts.map +1 -1
- package/dist/components/Toast/Toast.mjs +4 -3
- package/dist/components/Toast/Toast.mjs.map +1 -1
- package/dist/components/Toast/Toast.types.cjs +5 -5
- package/dist/components/Toast/Toast.types.cjs.map +1 -1
- package/dist/components/Toast/Toast.types.d.cts +5 -4
- package/dist/components/Toast/Toast.types.d.cts.map +1 -1
- package/dist/components/Toast/Toast.types.d.mts +5 -4
- package/dist/components/Toast/Toast.types.d.mts.map +1 -1
- package/dist/components/Toast/Toast.types.mjs +4 -4
- package/dist/components/Toast/Toast.types.mjs.map +1 -1
- package/dist/components/Toast/index.cjs +2 -2
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +1 -1
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.mts +1 -1
- package/dist/components/Toast/index.d.mts.map +1 -1
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/index.cjs +31 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +24 -4
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +24 -4
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +12 -2
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +10 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +8 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +8 -0
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +9 -0
- package/dist/types/index.mjs.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AACvC,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAGpC,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACpD,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,OAAO,EAAE,6CAAmC;AACrD,OAAO,EAAE,cAAc,EAAE,6DAAyD;A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AC,EAAE,CAAC,CAClB,WAAW,CAAC,CAAC,YAAY,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvG,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,IAAI,CACd,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC,CAAC,CAC9C;gBAAA,CAAC,YAAY,CACf;cAAA,EAAE,IAAI,CAAC,CACR,CACF,CACH;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { View } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { ButtonBaseSize } from '../../types';\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\nimport { TextOrChildren } from '../temp-components/TextOrChildren/TextOrChildren';\nimport { TextVariant, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading, please wait';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center gap-x-2',\n // Visual styling\n 'rounded-xl bg-muted px-4 min-w-[80px] overflow-hidden',\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <View\n style={tw.style(\n 'absolute inset-0 flex items-center justify-center',\n )}\n testID=\"spinner-container\"\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n loadingTextProps={{\n numberOfLines: 1,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n {...spinnerProps}\n />\n </View>\n )}\n\n {/* Button content - opacity controlled individually on each child */}\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${isLoading ? 'opacity-0' : ''} ${iconClassName ? iconClassName(pressed) : ''}`}\n {...startIconProps}\n />\n ) : (\n startAccessory && (\n <View style={tw.style(isLoading && 'opacity-0')}>\n {startAccessory}\n </View>\n )\n )}\n\n {typeof children === 'string' ? (\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n twClassName: `shrink grow-0 flex-wrap text-center ${isLoading ? 'opacity-0' : ''} ${textClassName ? textClassName(pressed) : ''}`,\n ...textProps,\n }}\n >\n {children}\n </TextOrChildren>\n ) : (\n <View style={tw.style(isLoading && 'opacity-0')}>{children}</View>\n )}\n\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${isLoading ? 'opacity-0' : ''} ${iconClassName ? iconClassName(pressed) : ''}`}\n {...endIconProps}\n />\n ) : (\n endAccessory && (\n <View style={tw.style(isLoading && 'opacity-0')}>\n {endAccessory}\n </View>\n )\n )}\n </>\n )}\n </ButtonAnimated>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ButtonBase.mjs","sourceRoot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,CAAC,CAAC,EAAE,IAAI,SAAS,EAAE,WAAW,IAAI,EAAE,EAAE,CAAC,CAElK;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CACnE,CAED;;UAAA,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAClB,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,gBAAgB,CAAC,CACvB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,WAAW,CAAC,CAAC,YAAY,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvG,IAAI,YAAY,CAAC,EACjB,CACH,CAAC,CAAC,CAAC,CACF,YAAY,IAAI,CACd,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC,CAAC,CAC9C;gBAAA,CAAC,YAAY,CACf;cAAA,EAAE,IAAI,CAAC,CACR,CACF,CACH;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { View } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { ButtonBaseSize } from '../../types';\nimport { Icon, IconColor, IconSize } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\nimport { Text, TextVariant, FontWeight, TextColor } from '../Text';\n\nimport { TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading, please wait';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center gap-x-2',\n // Visual styling\n 'rounded-xl bg-muted px-4 min-w-[80px] overflow-hidden',\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <View\n style={tw.style(\n 'absolute inset-0 flex items-center justify-center',\n )}\n testID=\"spinner-container\"\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n loadingTextProps={{\n numberOfLines: 1,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n {...spinnerProps}\n />\n </View>\n )}\n\n {/* Button content - opacity controlled individually on each child */}\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${isLoading ? 'opacity-0' : ''} ${iconClassName ? iconClassName(pressed) : ''}`}\n {...startIconProps}\n />\n ) : (\n startAccessory && (\n <View style={tw.style(isLoading && 'opacity-0')}>\n {startAccessory}\n </View>\n )\n )}\n\n {typeof children === 'string' ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n color={TextColor.TextDefault}\n {...textProps}\n twClassName={`shrink grow-0 flex-wrap text-center ${isLoading ? 'opacity-0' : ''} ${textClassName ? textClassName(pressed) : ''} ${textProps?.twClassName ?? ''}`}\n >\n {children}\n </Text>\n ) : (\n <View style={tw.style(isLoading && 'opacity-0')}>{children}</View>\n )}\n\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={IconSize.Sm}\n twClassName={`shrink-0 ${isLoading ? 'opacity-0' : ''} ${iconClassName ? iconClassName(pressed) : ''}`}\n {...endIconProps}\n />\n ) : (\n endAccessory && (\n <View style={tw.style(isLoading && 'opacity-0')}>\n {endAccessory}\n </View>\n )\n )}\n </>\n )}\n </ButtonAnimated>\n );\n};\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ButtonFilter = void 0;
|
|
7
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const ButtonBase_1 = require("../ButtonBase/index.cjs");
|
|
10
|
+
const ButtonFilter = ({ isActive = false, twClassName, textProps, style, ...props }) => {
|
|
11
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
12
|
+
const mergedStyle = [
|
|
13
|
+
tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),
|
|
14
|
+
style,
|
|
15
|
+
];
|
|
16
|
+
const mergedTextProps = {
|
|
17
|
+
...textProps,
|
|
18
|
+
twClassName: [
|
|
19
|
+
isActive ? 'text-icon-inverse' : 'text-default',
|
|
20
|
+
textProps?.twClassName,
|
|
21
|
+
]
|
|
22
|
+
.filter(Boolean)
|
|
23
|
+
.join(' '),
|
|
24
|
+
};
|
|
25
|
+
return (<ButtonBase_1.ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props}/>);
|
|
26
|
+
};
|
|
27
|
+
exports.ButtonFilter = ButtonFilter;
|
|
28
|
+
//# sourceMappingURL=ButtonFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAE1B,wDAA2C;AAIpC,MAAM,YAAY,GAAgC,CAAC,EACxD,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,WAAW,GAAG;QAClB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,EAAE,WAAW,CAAC;QAC3E,KAAK;KACN,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,GAAG,SAAS;QACZ,WAAW,EAAE;YACX,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc;YAC/C,SAAS,EAAE,WAAW;SACvB;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;KACb,CAAC;IAEF,OAAO,CACL,CAAC,uBAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAC1E,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,YAAY,gBA2BvB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter: React.FC<ButtonFilterProps> = ({\n isActive = false,\n twClassName,\n textProps,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const mergedStyle = [\n tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),\n style,\n ];\n\n const mergedTextProps = {\n ...textProps,\n twClassName: [\n isActive ? 'text-icon-inverse' : 'text-default',\n textProps?.twClassName,\n ]\n .filter(Boolean)\n .join(' '),\n };\n\n return (\n <ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props} />\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2BpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2BpD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { ButtonBase } from "../ButtonBase/index.mjs";
|
|
11
|
+
export const ButtonFilter = ({ isActive = false, twClassName, textProps, style, ...props }) => {
|
|
12
|
+
const tw = useTailwind();
|
|
13
|
+
const mergedStyle = [
|
|
14
|
+
tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),
|
|
15
|
+
style,
|
|
16
|
+
];
|
|
17
|
+
const mergedTextProps = {
|
|
18
|
+
...textProps,
|
|
19
|
+
twClassName: [
|
|
20
|
+
isActive ? 'text-icon-inverse' : 'text-default',
|
|
21
|
+
textProps?.twClassName,
|
|
22
|
+
]
|
|
23
|
+
.filter(Boolean)
|
|
24
|
+
.join(' '),
|
|
25
|
+
};
|
|
26
|
+
return (<ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props}/>);
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ButtonFilter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACxD,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAG;QAClB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,EAAE,WAAW,CAAC;QAC3E,KAAK;KACN,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,GAAG,SAAS;QACZ,WAAW,EAAE;YACX,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc;YAC/C,SAAS,EAAE,WAAW;SACvB;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;KACb,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAC1E,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonFilterProps } from './ButtonFilter.types';\n\nexport const ButtonFilter: React.FC<ButtonFilterProps> = ({\n isActive = false,\n twClassName,\n textProps,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const mergedStyle = [\n tw.style(isActive ? 'bg-icon-default' : 'bg-background-muted', twClassName),\n style,\n ];\n\n const mergedTextProps = {\n ...textProps,\n twClassName: [\n isActive ? 'text-icon-inverse' : 'text-default',\n textProps?.twClassName,\n ]\n .filter(Boolean)\n .join(' '),\n };\n\n return (\n <ButtonBase textProps={mergedTextProps} style={mergedStyle} {...props} />\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonFilterPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type ButtonFilterProps = Omit<\n ButtonBaseProps,\n 'twClassName' | 'textClassName'\n> &\n ButtonFilterPropsShared & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ButtonFilterPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ButtonBaseProps } from "../ButtonBase/index.cjs";
|
|
3
|
+
export type ButtonFilterProps = Omit<ButtonBaseProps, 'twClassName' | 'textClassName'> & ButtonFilterPropsShared & {
|
|
4
|
+
/**
|
|
5
|
+
* Optional prop to add twrnc overriding classNames.
|
|
6
|
+
*/
|
|
7
|
+
twClassName?: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=ButtonFilter.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,eAAe,EACf,aAAa,GAAG,eAAe,CAChC,GACC,uBAAuB,GAAG;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ButtonFilterPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ButtonBaseProps } from "../ButtonBase/index.mjs";
|
|
3
|
+
export type ButtonFilterProps = Omit<ButtonBaseProps, 'twClassName' | 'textClassName'> & ButtonFilterPropsShared & {
|
|
4
|
+
/**
|
|
5
|
+
* Optional prop to add twrnc overriding classNames.
|
|
6
|
+
*/
|
|
7
|
+
twClassName?: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=ButtonFilter.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AAErD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,eAAe,EACf,aAAa,GAAG,eAAe,CAChC,GACC,uBAAuB,GAAG;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFilter.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/ButtonFilter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonFilterPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type ButtonFilterProps = Omit<\n ButtonBaseProps,\n 'twClassName' | 'textClassName'\n> &\n ButtonFilterPropsShared & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonFilter = void 0;
|
|
4
|
+
var ButtonFilter_1 = require("./ButtonFilter.cjs");
|
|
5
|
+
Object.defineProperty(exports, "ButtonFilter", { enumerable: true, get: function () { return ButtonFilter_1.ButtonFilter; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["export { ButtonFilter } from './ButtonFilter';\nexport type { ButtonFilterProps } from './ButtonFilter.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/ButtonFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB","sourcesContent":["export { ButtonFilter } from './ButtonFilter';\nexport type { ButtonFilterProps } from './ButtonFilter.types';\n"]}
|
|
@@ -30,17 +30,23 @@ const types_1 = require("../../types/index.cjs");
|
|
|
30
30
|
const Icon_1 = require("../Icon/index.cjs");
|
|
31
31
|
const ButtonAnimated_1 = require("../temp-components/ButtonAnimated/index.cjs");
|
|
32
32
|
const ButtonIcon_constants_1 = require("./ButtonIcon.constants.cjs");
|
|
33
|
-
const ButtonIcon = ({ size = types_1.ButtonIconSize.Md, iconName, iconProps, isDisabled = false,
|
|
33
|
+
const ButtonIcon = ({ size = types_1.ButtonIconSize.Md, iconName, iconProps, isDisabled = false, variant = types_1.ButtonIconVariant.Default, onPressIn, onPressOut, twClassName, style, ...props }) => {
|
|
34
34
|
const [isPressed, setIsPressed] = (0, react_1.useState)(false);
|
|
35
35
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
36
36
|
let backgroundColor = 'bg-transparent';
|
|
37
|
-
if (
|
|
37
|
+
if (variant === types_1.ButtonIconVariant.Floating) {
|
|
38
38
|
backgroundColor = 'bg-icon-default';
|
|
39
39
|
}
|
|
40
|
+
else if (variant === types_1.ButtonIconVariant.Filled) {
|
|
41
|
+
backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';
|
|
42
|
+
}
|
|
40
43
|
else if (isPressed) {
|
|
41
44
|
backgroundColor = 'bg-pressed';
|
|
42
45
|
}
|
|
43
|
-
const twIconColorClassNames =
|
|
46
|
+
const twIconColorClassNames = variant === types_1.ButtonIconVariant.Floating
|
|
47
|
+
? 'text-primary-inverse'
|
|
48
|
+
: 'text-icon-default';
|
|
49
|
+
const borderRadiusClass = variant === types_1.ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';
|
|
44
50
|
const onPressInHandler = (event) => {
|
|
45
51
|
setIsPressed(true);
|
|
46
52
|
onPressIn?.(event);
|
|
@@ -50,7 +56,7 @@ const ButtonIcon = ({ size = types_1.ButtonIconSize.Md, iconName, iconProps, isD
|
|
|
50
56
|
onPressOut?.(event);
|
|
51
57
|
};
|
|
52
58
|
return (<ButtonAnimated_1.ButtonAnimated disabled={isDisabled} onPressIn={onPressInHandler} onPressOut={onPressOutHandler} accessible testID="button-icon" {...props} style={[
|
|
53
|
-
tw.style('items-center justify-center', ButtonIcon_constants_1.TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],
|
|
59
|
+
tw.style('items-center justify-center', ButtonIcon_constants_1.TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size], borderRadiusClass, backgroundColor, isDisabled ? 'opacity-50' : 'opacity-100', twClassName),
|
|
54
60
|
style,
|
|
55
61
|
]}>
|
|
56
62
|
<Icon_1.Icon name={iconName} color={twIconColorClassNames} size={ButtonIcon_constants_1.MAP_BUTTONICON_SIZE_ICONSIZE[size]} {...iconProps}/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAwC;AAGxC,
|
|
1
|
+
{"version":3,"file":"ButtonIcon.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAwC;AAGxC,iDAAgE;AAEhE,4CAA+B;AAC/B,gFAAmE;AAEnE,qEAGgC;AAGzB,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,GAAG,sBAAc,CAAC,EAAE,EACxB,QAAQ,EACR,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,yBAAiB,CAAC,OAAO,EACnC,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,CAAC,S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BAA6B,EAC7B,2DAAoC,CAAC,IAAI,CAAC,EAC1C,iBAAiB,EACjB,eAAe,EACf,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACzC,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,KAAK,CAAC,CAAC,qBAAkC,CAAC,CAC1C,IAAI,CAAC,CAAC,mDAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,UAAU,cAsErB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useState } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { ButtonIconSize, ButtonIconVariant } from '../../types';\nimport type { IconColor } from '../Icon';\nimport { Icon } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\n\nimport {\n MAP_BUTTONICON_SIZE_ICONSIZE,\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION,\n} from './ButtonIcon.constants';\nimport type { ButtonIconProps } from './ButtonIcon.types';\n\nexport const ButtonIcon = ({\n size = ButtonIconSize.Md,\n iconName,\n iconProps,\n isDisabled = false,\n variant = ButtonIconVariant.Default,\n onPressIn,\n onPressOut,\n twClassName,\n style,\n ...props\n}: ButtonIconProps) => {\n const [isPressed, setIsPressed] = useState(false);\n const tw = useTailwind();\n\n let backgroundColor = 'bg-transparent';\n if (variant === ButtonIconVariant.Floating) {\n backgroundColor = 'bg-icon-default';\n } else if (variant === ButtonIconVariant.Filled) {\n backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';\n } else if (isPressed) {\n backgroundColor = 'bg-pressed';\n }\n\n const twIconColorClassNames =\n variant === ButtonIconVariant.Floating\n ? 'text-primary-inverse'\n : 'text-icon-default';\n\n const borderRadiusClass =\n variant === ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n setIsPressed(true);\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n setIsPressed(false);\n onPressOut?.(event);\n };\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n accessible\n testID=\"button-icon\"\n {...props}\n style={[\n tw.style(\n 'items-center justify-center',\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],\n borderRadiusClass,\n backgroundColor,\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n color={twIconColorClassNames as IconColor}\n size={MAP_BUTTONICON_SIZE_ICONSIZE[size]}\n {...iconProps}\n />\n </ButtonAnimated>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ButtonIconProps } from "./ButtonIcon.types.cjs";
|
|
3
|
-
export declare const ButtonIcon: ({ size, iconName, iconProps, isDisabled,
|
|
3
|
+
export declare const ButtonIcon: ({ size, iconName, iconProps, isDisabled, variant, onPressIn, onPressOut, twClassName, style, ...props }: ButtonIconProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ButtonIcon.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAYxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"ButtonIcon.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAYxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4GAWpB,eAAe,sBA2DjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ButtonIconProps } from "./ButtonIcon.types.mjs";
|
|
3
|
-
export declare const ButtonIcon: ({ size, iconName, iconProps, isDisabled,
|
|
3
|
+
export declare const ButtonIcon: ({ size, iconName, iconProps, isDisabled, variant, onPressIn, onPressOut, twClassName, style, ...props }: ButtonIconProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ButtonIcon.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAYxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"ButtonIcon.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAYxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,4GAWpB,eAAe,sBA2DjB,CAAC"}
|
|
@@ -7,21 +7,27 @@ function $importDefault(module) {
|
|
|
7
7
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
8
|
import $React, { useState } from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
|
-
import { ButtonIconSize } from "../../types/index.mjs";
|
|
10
|
+
import { ButtonIconSize, ButtonIconVariant } from "../../types/index.mjs";
|
|
11
11
|
import { Icon } from "../Icon/index.mjs";
|
|
12
12
|
import { ButtonAnimated } from "../temp-components/ButtonAnimated/index.mjs";
|
|
13
13
|
import { MAP_BUTTONICON_SIZE_ICONSIZE, TWCLASSMAP_BUTTONICON_SIZE_DIMENSION } from "./ButtonIcon.constants.mjs";
|
|
14
|
-
export const ButtonIcon = ({ size = ButtonIconSize.Md, iconName, iconProps, isDisabled = false,
|
|
14
|
+
export const ButtonIcon = ({ size = ButtonIconSize.Md, iconName, iconProps, isDisabled = false, variant = ButtonIconVariant.Default, onPressIn, onPressOut, twClassName, style, ...props }) => {
|
|
15
15
|
const [isPressed, setIsPressed] = useState(false);
|
|
16
16
|
const tw = useTailwind();
|
|
17
17
|
let backgroundColor = 'bg-transparent';
|
|
18
|
-
if (
|
|
18
|
+
if (variant === ButtonIconVariant.Floating) {
|
|
19
19
|
backgroundColor = 'bg-icon-default';
|
|
20
20
|
}
|
|
21
|
+
else if (variant === ButtonIconVariant.Filled) {
|
|
22
|
+
backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';
|
|
23
|
+
}
|
|
21
24
|
else if (isPressed) {
|
|
22
25
|
backgroundColor = 'bg-pressed';
|
|
23
26
|
}
|
|
24
|
-
const twIconColorClassNames =
|
|
27
|
+
const twIconColorClassNames = variant === ButtonIconVariant.Floating
|
|
28
|
+
? 'text-primary-inverse'
|
|
29
|
+
: 'text-icon-default';
|
|
30
|
+
const borderRadiusClass = variant === ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';
|
|
25
31
|
const onPressInHandler = (event) => {
|
|
26
32
|
setIsPressed(true);
|
|
27
33
|
onPressIn?.(event);
|
|
@@ -31,7 +37,7 @@ export const ButtonIcon = ({ size = ButtonIconSize.Md, iconName, iconProps, isDi
|
|
|
31
37
|
onPressOut?.(event);
|
|
32
38
|
};
|
|
33
39
|
return (<ButtonAnimated disabled={isDisabled} onPressIn={onPressInHandler} onPressOut={onPressOutHandler} accessible testID="button-icon" {...props} style={[
|
|
34
|
-
tw.style('items-center justify-center', TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],
|
|
40
|
+
tw.style('items-center justify-center', TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size], borderRadiusClass, backgroundColor, isDisabled ? 'opacity-50' : 'opacity-100', twClassName),
|
|
35
41
|
style,
|
|
36
42
|
]}>
|
|
37
43
|
<Icon name={iconName} color={twIconColorClassNames} size={MAP_BUTTONICON_SIZE_ICONSIZE[size]} {...iconProps}/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAGxC,OAAO,EAAE,cAAc,EAAE,8BAAoB;
|
|
1
|
+
{"version":3,"file":"ButtonIcon.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAGxC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,8BAAoB;AAEhE,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAC/B,OAAO,EAAE,cAAc,EAAE,oDAA0C;AAEnE,OAAO,EACL,4BAA4B,EAC5B,oCAAoC,EACrC,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,QAAQ,EACR,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,iBAAiB,CAAC,OAAO,EACnC,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,IAAI,eAAe,GAAG,gBAAgB,CAAC;IACvC,IAAI,OAAO,KAAK,iBAAiB,CAAC,QAAQ,EAAE;QAC1C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AAQ,CAAC,CACf,KAAK,CAAC,CAAC,qBAAkC,CAAC,CAC1C,IAAI,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CACzC,IAAI,SAAS,CAAC,EAElB;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useState } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { ButtonIconSize, ButtonIconVariant } from '../../types';\nimport type { IconColor } from '../Icon';\nimport { Icon } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\n\nimport {\n MAP_BUTTONICON_SIZE_ICONSIZE,\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION,\n} from './ButtonIcon.constants';\nimport type { ButtonIconProps } from './ButtonIcon.types';\n\nexport const ButtonIcon = ({\n size = ButtonIconSize.Md,\n iconName,\n iconProps,\n isDisabled = false,\n variant = ButtonIconVariant.Default,\n onPressIn,\n onPressOut,\n twClassName,\n style,\n ...props\n}: ButtonIconProps) => {\n const [isPressed, setIsPressed] = useState(false);\n const tw = useTailwind();\n\n let backgroundColor = 'bg-transparent';\n if (variant === ButtonIconVariant.Floating) {\n backgroundColor = 'bg-icon-default';\n } else if (variant === ButtonIconVariant.Filled) {\n backgroundColor = isPressed ? 'bg-muted-pressed' : 'bg-muted';\n } else if (isPressed) {\n backgroundColor = 'bg-pressed';\n }\n\n const twIconColorClassNames =\n variant === ButtonIconVariant.Floating\n ? 'text-primary-inverse'\n : 'text-icon-default';\n\n const borderRadiusClass =\n variant === ButtonIconVariant.Default ? 'rounded-lg' : 'rounded-full';\n\n const onPressInHandler = (event: GestureResponderEvent) => {\n setIsPressed(true);\n onPressIn?.(event);\n };\n\n const onPressOutHandler = (event: GestureResponderEvent) => {\n setIsPressed(false);\n onPressOut?.(event);\n };\n\n return (\n <ButtonAnimated\n disabled={isDisabled}\n onPressIn={onPressInHandler}\n onPressOut={onPressOutHandler}\n accessible\n testID=\"button-icon\"\n {...props}\n style={[\n tw.style(\n 'items-center justify-center',\n TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size],\n borderRadiusClass,\n backgroundColor,\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ),\n style,\n ]}\n >\n <Icon\n name={iconName}\n color={twIconColorClassNames as IconColor}\n size={MAP_BUTTONICON_SIZE_ICONSIZE[size]}\n {...iconProps}\n />\n </ButtonAnimated>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { ButtonIconSize } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { ButtonAnimatedProps } from '../temp-components/ButtonAnimated';\n\n/**\n * ButtonIcon component props.\n */\nexport type ButtonIconProps = {\n /**\n * Optional prop to control the size of the icon\n * Different sizes map to specific pixel dimensions\n *\n * @default IconSize.Md\n */\n size?: ButtonIconSize;\n /**\n * Optional prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Partial<IconProps>;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to
|
|
1
|
+
{"version":3,"file":"ButtonIcon.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { ButtonIconSize, ButtonIconVariant } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { ButtonAnimatedProps } from '../temp-components/ButtonAnimated';\n\n/**\n * ButtonIcon component props.\n */\nexport type ButtonIconProps = {\n /**\n * Optional prop to control the size of the icon\n * Different sizes map to specific pixel dimensions\n *\n * @default IconSize.Md\n */\n size?: ButtonIconSize;\n /**\n * Optional prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Partial<IconProps>;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to control the visual variant of the button.\n *\n * @default ButtonIconVariant.Default\n */\n variant?: ButtonIconVariant;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & Omit<ButtonAnimatedProps, 'children'>;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StyleProp, ViewStyle } from "react-native/index.js";
|
|
2
|
-
import type { ButtonIconSize } from "../../types/index.cjs";
|
|
2
|
+
import type { ButtonIconSize, ButtonIconVariant } from "../../types/index.cjs";
|
|
3
3
|
import type { IconProps, IconName } from "../Icon/index.cjs";
|
|
4
4
|
import type { ButtonAnimatedProps } from "../temp-components/ButtonAnimated/index.cjs";
|
|
5
5
|
/**
|
|
@@ -28,18 +28,11 @@ export type ButtonIconProps = {
|
|
|
28
28
|
*/
|
|
29
29
|
isDisabled?: boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Optional prop to
|
|
31
|
+
* Optional prop to control the visual variant of the button.
|
|
32
32
|
*
|
|
33
|
-
* @default
|
|
34
|
-
*/
|
|
35
|
-
isInverse?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Optional prop to show the floating/contained state of the button, which is reserved for floating buttons.
|
|
38
|
-
* Note: This prop provides styling only. There is no positioning logic.
|
|
39
|
-
*
|
|
40
|
-
* @default false
|
|
33
|
+
* @default ButtonIconVariant.Default
|
|
41
34
|
*/
|
|
42
|
-
|
|
35
|
+
variant?: ButtonIconVariant;
|
|
43
36
|
/**
|
|
44
37
|
* Optional prop to add twrnc overriding classNames.
|
|
45
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAoB;
|
|
1
|
+
{"version":3,"file":"ButtonIcon.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,8BAAoB;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oDAA0C;AAE7E;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StyleProp, ViewStyle } from "react-native/index.js";
|
|
2
|
-
import type { ButtonIconSize } from "../../types/index.mjs";
|
|
2
|
+
import type { ButtonIconSize, ButtonIconVariant } from "../../types/index.mjs";
|
|
3
3
|
import type { IconProps, IconName } from "../Icon/index.mjs";
|
|
4
4
|
import type { ButtonAnimatedProps } from "../temp-components/ButtonAnimated/index.mjs";
|
|
5
5
|
/**
|
|
@@ -28,18 +28,11 @@ export type ButtonIconProps = {
|
|
|
28
28
|
*/
|
|
29
29
|
isDisabled?: boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Optional prop to
|
|
31
|
+
* Optional prop to control the visual variant of the button.
|
|
32
32
|
*
|
|
33
|
-
* @default
|
|
34
|
-
*/
|
|
35
|
-
isInverse?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Optional prop to show the floating/contained state of the button, which is reserved for floating buttons.
|
|
38
|
-
* Note: This prop provides styling only. There is no positioning logic.
|
|
39
|
-
*
|
|
40
|
-
* @default false
|
|
33
|
+
* @default ButtonIconVariant.Default
|
|
41
34
|
*/
|
|
42
|
-
|
|
35
|
+
variant?: ButtonIconVariant;
|
|
43
36
|
/**
|
|
44
37
|
* Optional prop to add twrnc overriding classNames.
|
|
45
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.types.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAoB;
|
|
1
|
+
{"version":3,"file":"ButtonIcon.types.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,8BAAoB;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oDAA0C;AAE7E;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { ButtonIconSize } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { ButtonAnimatedProps } from '../temp-components/ButtonAnimated';\n\n/**\n * ButtonIcon component props.\n */\nexport type ButtonIconProps = {\n /**\n * Optional prop to control the size of the icon\n * Different sizes map to specific pixel dimensions\n *\n * @default IconSize.Md\n */\n size?: ButtonIconSize;\n /**\n * Optional prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Partial<IconProps>;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to
|
|
1
|
+
{"version":3,"file":"ButtonIcon.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { ButtonIconSize, ButtonIconVariant } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { ButtonAnimatedProps } from '../temp-components/ButtonAnimated';\n\n/**\n * ButtonIcon component props.\n */\nexport type ButtonIconProps = {\n /**\n * Optional prop to control the size of the icon\n * Different sizes map to specific pixel dimensions\n *\n * @default IconSize.Md\n */\n size?: ButtonIconSize;\n /**\n * Optional prop to specify an icon to show\n */\n iconName: IconName;\n /**\n * Optional prop to pass additional properties to the icon\n */\n iconProps?: Partial<IconProps>;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to control the visual variant of the button.\n *\n * @default ButtonIconVariant.Default\n */\n variant?: ButtonIconVariant;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & Omit<ButtonAnimatedProps, 'children'>;\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ButtonIcon = exports.ButtonIconSize = void 0;
|
|
3
|
+
exports.ButtonIcon = exports.ButtonIconVariant = exports.ButtonIconSize = void 0;
|
|
4
4
|
var types_1 = require("../../types/index.cjs");
|
|
5
5
|
Object.defineProperty(exports, "ButtonIconSize", { enumerable: true, get: function () { return types_1.ButtonIconSize; } });
|
|
6
|
+
Object.defineProperty(exports, "ButtonIconVariant", { enumerable: true, get: function () { return types_1.ButtonIconVariant; } });
|
|
6
7
|
var ButtonIcon_1 = require("./ButtonIcon.cjs");
|
|
7
8
|
Object.defineProperty(exports, "ButtonIcon", { enumerable: true, get: function () { return ButtonIcon_1.ButtonIcon; } });
|
|
8
9
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":";;;AAAA,+CAAgE;AAAvD,uGAAA,cAAc,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAC1C,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { ButtonIconSize, ButtonIconVariant } from '../../types';\nexport { ButtonIcon } from './ButtonIcon';\nexport type { ButtonIconProps } from './ButtonIcon.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ButtonIconSize } from "../../types/index.cjs";
|
|
1
|
+
export { ButtonIconSize, ButtonIconVariant } from "../../types/index.cjs";
|
|
2
2
|
export { ButtonIcon } from "./ButtonIcon.cjs";
|
|
3
3
|
export type { ButtonIconProps } from "./ButtonIcon.types.cjs";
|
|
4
4
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,8BAAoB;AAChE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ButtonIconSize } from "../../types/index.mjs";
|
|
1
|
+
export { ButtonIconSize, ButtonIconVariant } from "../../types/index.mjs";
|
|
2
2
|
export { ButtonIcon } from "./ButtonIcon.mjs";
|
|
3
3
|
export type { ButtonIconProps } from "./ButtonIcon.types.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,8BAAoB;AAChE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/ButtonIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,8BAAoB;AAChE,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { ButtonIconSize, ButtonIconVariant } from '../../types';\nexport { ButtonIcon } from './ButtonIcon';\nexport type { ButtonIconProps } from './ButtonIcon.types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m17.7143 3c.2505 2.26476 2.0307 4.05261 4.2857 4.30429-2.255.25167-4.0352 2.03952-4.2857 4.30431-.2506-2.26479-2.0307-4.05264-4.2857-4.30431 2.255-.25168 4.0351-2.03953 4.2857-4.30429zm-1.2556 11.9129c.1772 1.6014 1.4359 2.8656 3.0305 3.0436-1.5946.1779-2.8533 1.4421-3.0305 3.0435-.1772-1.6014-1.4359-2.8656-3.0305-3.0435 1.5946-.178 2.8533-1.4422 3.0305-3.0436z"/><path d="m9.14286 4.86963c-.10963.99098-.39498 1.92717-.82422 2.77663-.77739 1.53842-2.02676 2.79234-3.55917 3.57204-.84441.4296-1.77478.7153-2.75947.8251.98469.1099 1.91506.3955 2.75947.8252 1.53241.7797 2.78178 2.0336 3.55917 3.572.42924.8495.71459 1.7857.82422 2.7766.10963-.9909.39497-1.9271.82422-2.7766.77742-1.5384 2.02672-2.7923 3.55912-3.572.8445-.4297 1.7748-.7153 2.7595-.8252-.9847-.1098-1.915-.3955-2.7595-.8251-1.5324-.7797-2.7817-2.03362-3.55912-3.57204-.42925-.84946-.71459-1.78565-.82422-2.
|
|
1
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m17.7143 3c.2505 2.26476 2.0307 4.05261 4.2857 4.30429-2.255.25167-4.0352 2.03952-4.2857 4.30431-.2506-2.26479-2.0307-4.05264-4.2857-4.30431 2.255-.25168 4.0351-2.03953 4.2857-4.30429zm-1.2556 11.9129c.1772 1.6014 1.4359 2.8656 3.0305 3.0436-1.5946.1779-2.8533 1.4421-3.0305 3.0435-.1772-1.6014-1.4359-2.8656-3.0305-3.0435 1.5946-.178 2.8533-1.4422 3.0305-3.0436z"/><path d="m9.14286 4.86963c-.10963.99098-.39498 1.92717-.82422 2.77663-.77739 1.53842-2.02676 2.79234-3.55917 3.57204-.84441.4296-1.77478.7153-2.75947.8251.98469.1099 1.91506.3955 2.75947.8252 1.53241.7797 2.78178 2.0336 3.55917 3.572.42924.8495.71459 1.7857.82422 2.7766.10963-.9909.39497-1.9271.82422-2.7766.77742-1.5384 2.02672-2.7923 3.55912-3.572.8445-.4297 1.7748-.7153 2.7595-.8252-.9847-.1098-1.915-.3955-2.7595-.8251-1.5324-.7797-2.7817-2.03362-3.55912-3.57204-.42925-.84946-.71459-1.78565-.82422-2.77663z"/></g></svg>
|