@metamask-previews/design-system-react-native 0.9.0-preview.694a8ed → 0.11.0-preview.645f8b0
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
|
@@ -7,7 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const react_native_1 = require("react-native/index.js");
|
|
8
8
|
const types_1 = require("../../types/index.cjs");
|
|
9
9
|
const Text_constants_1 = require("../Text/Text.constants.cjs");
|
|
10
|
-
exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadonly = false, twClassName, onBlur, onFocus, autoFocus = false, ...props }, ref) => {
|
|
10
|
+
exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadonly = false, value, placeholder, twClassName, onBlur, onFocus, autoFocus = false, ...props }, ref) => {
|
|
11
11
|
const [isFocused, setIsFocused] = (0, react_1.useState)(autoFocus);
|
|
12
12
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
13
13
|
const theme = (0, design_system_twrnc_preset_1.useTheme)();
|
|
@@ -17,6 +17,11 @@ exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVari
|
|
|
17
17
|
const finalFontWeight = Text_constants_1.MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];
|
|
18
18
|
const fontSuffix = Text_constants_1.TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];
|
|
19
19
|
const fontClass = `font-${types_1.FontFamily.Default}${fontSuffix}`;
|
|
20
|
+
const hasPlaceholder = placeholder !== undefined && placeholder !== null && placeholder !== '';
|
|
21
|
+
// Only apply placeholder-mode styling when a placeholder is present and
|
|
22
|
+
// the controlled value is empty. This keeps the iOS lineHeight workaround
|
|
23
|
+
// scoped to the placeholder-visible state without affecting typed text.
|
|
24
|
+
const isPlaceholderVisible = hasPlaceholder && value === '';
|
|
20
25
|
const inputStyle = (0, react_1.useMemo)(() => tw.style(`text-${textVariant}`, fontClass, 'text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
|
|
21
26
|
!isDisabled &&
|
|
22
27
|
isFocused &&
|
|
@@ -45,9 +50,14 @@ exports.Input = (0, react_1.forwardRef)(({ style, textVariant = types_1.TextVari
|
|
|
45
50
|
}, [isDisabled, onFocus]);
|
|
46
51
|
const resolvedStyle = [
|
|
47
52
|
inputStyle,
|
|
53
|
+
// iOS-only workaround: when a placeholder is visible, native iOS
|
|
54
|
+
// TextInput can render placeholder text vertically offset.
|
|
55
|
+
// Keep this iOS-only because lineHeight: 0 can collapse text on Android.
|
|
56
|
+
react_native_1.Platform.OS === 'ios' &&
|
|
57
|
+
isPlaceholderVisible && { lineHeight: 0 },
|
|
48
58
|
react_native_1.Platform.OS === 'ios' && { textAlignVertical: 'center' },
|
|
49
59
|
style,
|
|
50
60
|
].filter(Boolean);
|
|
51
|
-
return (<react_native_1.TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
61
|
+
return (<react_native_1.TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} placeholder={placeholder} value={value} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
52
62
|
});
|
|
53
63
|
//# sourceMappingURL=Input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;AAAA,8FAIuD;AACvD,oEAAyE;AACzE,iCAAmE;AACnE,wDAAmD;AAEnD,iDAAsD;AACtD,+DAGgC;AAInB,QAAA,KAAK,GAAG,IAAA,kBAAU,EAC7B,CACE,EACE,KAAK,EACL,WAAW,GAAG,mBAAW,CAAC,MAAM,EAChC,qBAAqB,EACrB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,WAAW,EACX,MAAM,EACN,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,KAAK,GAAG,IAAA,qCAAQ,GAAE,CAAC;IAEzB,MAAM,oBAAoB,GAAG,IAAA,eAAO,EAClC,GAAG,EAAE,CACH,KAAK,KAAK,kCAAK,CAAC,KAAK;QACnB,CAAC,CAAC,0BAAU,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW;QACpC,CAAC,CAAC,yBAAS,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EACvC,CAAC,K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ACN,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO,CACL,CAAC,wBAAS,CACR,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,aAAa,CAAC,CACrB,QAAQ,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,CACrC,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,EACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask-previews/design-tokens';\nimport { forwardRef, useCallback, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport { FontFamily, TextVariant } from '../../types';\nimport {\n MAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadonly = false,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n\n const inputStyle = useMemo(\n () =>\n tw.style(\n `text-${textVariant}`,\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n textVariant,\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const resolvedStyle = [\n inputStyle,\n Platform.OS === 'ios' && { textAlignVertical: 'center' as const },\n style,\n ].filter(Boolean);\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor}\n {...props}\n style={resolvedStyle}\n editable={!isDisabled && !isReadonly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;AAAA,8FAIuD;AACvD,oEAAyE;AACzE,iCAAmE;AACnE,wDAAmD;AAEnD,iDAAsD;AACtD,+DAGgC;AAInB,QAAA,KAAK,GAAG,IAAA,kBAAU,EAC7B,CACE,EACE,KAAK,EACL,WAAW,GAAG,mBAAW,CAAC,MAAM,EAChC,qBAAqB,EACrB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,WAAW,EACX,WAAW,EACX,MAAM,EACN,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,GAAG,K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ACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask-previews/design-tokens';\nimport { forwardRef, useCallback, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport { FontFamily, TextVariant } from '../../types';\nimport {\n MAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadonly = false,\n value,\n placeholder,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n const hasPlaceholder =\n placeholder !== undefined && placeholder !== null && placeholder !== '';\n // Only apply placeholder-mode styling when a placeholder is present and\n // the controlled value is empty. This keeps the iOS lineHeight workaround\n // scoped to the placeholder-visible state without affecting typed text.\n const isPlaceholderVisible = hasPlaceholder && value === '';\n\n const inputStyle = useMemo(\n () =>\n tw.style(\n `text-${textVariant}`,\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n textVariant,\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const resolvedStyle = [\n inputStyle,\n // iOS-only workaround: when a placeholder is visible, native iOS\n // TextInput can render placeholder text vertically offset.\n // Keep this iOS-only because lineHeight: 0 can collapse text on Android.\n Platform.OS === 'ios' &&\n isPlaceholderVisible && { lineHeight: 0 as const },\n Platform.OS === 'ios' && { textAlignVertical: 'center' as const },\n style,\n ].filter(Boolean);\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor}\n {...props}\n placeholder={placeholder}\n value={value}\n style={resolvedStyle}\n editable={!isDisabled && !isReadonly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TextInput } from "react-native/index.js";
|
|
2
2
|
import { TextVariant } from "../../types/index.cjs";
|
|
3
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "editable"> & {
|
|
3
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "editable" | "value" | "defaultValue"> & {
|
|
4
|
+
value: string;
|
|
4
5
|
textVariant?: TextVariant | undefined;
|
|
5
6
|
isDisabled?: boolean | undefined;
|
|
6
7
|
isReadonly?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAY,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EAAc,WAAW,EAAE,8BAAoB;AAQtD,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAY,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EAAc,WAAW,EAAE,8BAAoB;AAQtD,eAAO,MAAM,KAAK;;;;;;;6CAmHjB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TextInput } from "react-native/index.js";
|
|
2
2
|
import { TextVariant } from "../../types/index.mjs";
|
|
3
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "editable"> & {
|
|
3
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "editable" | "value" | "defaultValue"> & {
|
|
4
|
+
value: string;
|
|
4
5
|
textVariant?: TextVariant | undefined;
|
|
5
6
|
isDisabled?: boolean | undefined;
|
|
6
7
|
isReadonly?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAY,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EAAc,WAAW,EAAE,8BAAoB;AAQtD,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAY,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EAAc,WAAW,EAAE,8BAAoB;AAQtD,eAAO,MAAM,KAAK;;;;;;;6CAmHjB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { forwardRef, useCallback, useMemo, useState } from "react";
|
|
|
4
4
|
import { Platform, TextInput } from "react-native/index.js";
|
|
5
5
|
import { FontFamily, TextVariant } from "../../types/index.mjs";
|
|
6
6
|
import { MAP_TEXT_VARIANT_FONTWEIGHT, TWCLASSMAP_TEXT_FONTWEIGHT } from "../Text/Text.constants.mjs";
|
|
7
|
-
export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadonly = false, twClassName, onBlur, onFocus, autoFocus = false, ...props }, ref) => {
|
|
7
|
+
export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadonly = false, value, placeholder, twClassName, onBlur, onFocus, autoFocus = false, ...props }, ref) => {
|
|
8
8
|
const [isFocused, setIsFocused] = useState(autoFocus);
|
|
9
9
|
const tw = useTailwind();
|
|
10
10
|
const theme = useTheme();
|
|
@@ -14,6 +14,11 @@ export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isSt
|
|
|
14
14
|
const finalFontWeight = MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];
|
|
15
15
|
const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];
|
|
16
16
|
const fontClass = `font-${FontFamily.Default}${fontSuffix}`;
|
|
17
|
+
const hasPlaceholder = placeholder !== undefined && placeholder !== null && placeholder !== '';
|
|
18
|
+
// Only apply placeholder-mode styling when a placeholder is present and
|
|
19
|
+
// the controlled value is empty. This keeps the iOS lineHeight workaround
|
|
20
|
+
// scoped to the placeholder-visible state without affecting typed text.
|
|
21
|
+
const isPlaceholderVisible = hasPlaceholder && value === '';
|
|
17
22
|
const inputStyle = useMemo(() => tw.style(`text-${textVariant}`, fontClass, 'text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
|
|
18
23
|
!isDisabled &&
|
|
19
24
|
isFocused &&
|
|
@@ -42,9 +47,14 @@ export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isSt
|
|
|
42
47
|
}, [isDisabled, onFocus]);
|
|
43
48
|
const resolvedStyle = [
|
|
44
49
|
inputStyle,
|
|
50
|
+
// iOS-only workaround: when a placeholder is visible, native iOS
|
|
51
|
+
// TextInput can render placeholder text vertically offset.
|
|
52
|
+
// Keep this iOS-only because lineHeight: 0 can collapse text on Android.
|
|
53
|
+
Platform.OS === 'ios' &&
|
|
54
|
+
isPlaceholderVisible && { lineHeight: 0 },
|
|
45
55
|
Platform.OS === 'ios' && { textAlignVertical: 'center' },
|
|
46
56
|
style,
|
|
47
57
|
].filter(Boolean);
|
|
48
|
-
return (<TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
58
|
+
return (<TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} placeholder={placeholder} value={value} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
49
59
|
});
|
|
50
60
|
//# sourceMappingURL=Input.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACT,sDAAsD;AACvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,yCAAyC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc;AACnE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,8BAAoB;AACtD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC3B,mCAA+B;AAIhC,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,KAAK,EACL,WAAW,GAAG,WAAW,CAAC,MAAM,EAChC,qBAAqB,EACrB,UA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Y,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;SACb;IACH,CAAC,EACD,CAAC,UAAU,EAAE,MAAM,CAAC,CACrB,CAAC;IAEF,oEAAoE;IACpE,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,CAAoD,EAAE,EAAE;QACvD,IAAI,CAAC,UAAU,EAAE;YACf,YAAY,CAAC,IAAI,CAAC,CAAC;YACnB,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;SACd;IACH,CAAC,EACD,CAAC,UAAU,EAAE,OAAO,CAAC,CACtB,CAAC;IAEF,MAAM,aAAa,GAAG;QACpB,UAAU;QACV,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,iBAAiB,EAAE,QAAiB,EAAE;QACjE,KAAK;KACN,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO,CACL,CAAC,SAAS,CACR,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,aAAa,CAAC,CACrB,QAAQ,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,CACrC,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,EACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask-previews/design-tokens';\nimport { forwardRef, useCallback, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport { FontFamily, TextVariant } from '../../types';\nimport {\n MAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadonly = false,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n\n const inputStyle = useMemo(\n () =>\n tw.style(\n `text-${textVariant}`,\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n textVariant,\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const resolvedStyle = [\n inputStyle,\n Platform.OS === 'ios' && { textAlignVertical: 'center' as const },\n style,\n ].filter(Boolean);\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor}\n {...props}\n style={resolvedStyle}\n editable={!isDisabled && !isReadonly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACT,sDAAsD;AACvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,yCAAyC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc;AACnE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,8BAAoB;AACtD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC3B,mCAA+B;AAIhC,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,KAAK,EACL,WAAW,GAAG,WAAW,CAAC,MAAM,EAChC,qBAAqB,EACrB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,WAAW,EACX,WAAW,EACX,MAAM,EACN,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,oBAAoB,GAAG,OAAO,CAClC,GAAG,EAAE,CACH,KAAK,KAAK,KAAK,CAAC,KAAK;QACnB,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW;QACpC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EACvC,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,MAAM,eAAe,GAAG,2BAA2B,CAAC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AEF,MAAM,aAAa,GAAG;QACpB,UAAU;QACV,iEAAiE;QACjE,2DAA2D;QAC3D,yEAAyE;QACzE,QAAQ,CAAC,EAAE,KAAK,KAAK;YACnB,oBAAoB,IAAI,EAAE,UAAU,EAAE,CAAU,EAAE;QACpD,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,iBAAiB,EAAE,QAAiB,EAAE;QACjE,KAAK;KACN,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO,CACL,CAAC,SAAS,CACR,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,IAAI,KAAK,CAAC,CACV,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,KAAK,CAAC,CAAC,aAAa,CAAC,CACrB,QAAQ,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,CACrC,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,EACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask-previews/design-tokens';\nimport { forwardRef, useCallback, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport { FontFamily, TextVariant } from '../../types';\nimport {\n MAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadonly = false,\n value,\n placeholder,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = MAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n const hasPlaceholder =\n placeholder !== undefined && placeholder !== null && placeholder !== '';\n // Only apply placeholder-mode styling when a placeholder is present and\n // the controlled value is empty. This keeps the iOS lineHeight workaround\n // scoped to the placeholder-visible state without affecting typed text.\n const isPlaceholderVisible = hasPlaceholder && value === '';\n\n const inputStyle = useMemo(\n () =>\n tw.style(\n `text-${textVariant}`,\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n textVariant,\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const resolvedStyle = [\n inputStyle,\n // iOS-only workaround: when a placeholder is visible, native iOS\n // TextInput can render placeholder text vertically offset.\n // Keep this iOS-only because lineHeight: 0 can collapse text on Android.\n Platform.OS === 'ios' &&\n isPlaceholderVisible && { lineHeight: 0 as const },\n Platform.OS === 'ios' && { textAlignVertical: 'center' as const },\n style,\n ].filter(Boolean);\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor}\n {...props}\n placeholder={placeholder}\n value={value}\n style={resolvedStyle}\n editable={!isDisabled && !isReadonly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextInputProps } from 'react-native';\n\nimport type { TextVariant } from '../../types';\n\nexport type InputProps = Omit
|
|
1
|
+
{"version":3,"file":"Input.types.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextInputProps } from 'react-native';\n\nimport type { TextVariant } from '../../types';\n\nexport type InputProps = Omit<\n TextInputProps,\n 'editable' | 'value' | 'defaultValue'\n> & {\n /**\n * Controlled value for Input.\n */\n value: string;\n /**\n * Optional enum to select between Typography variants.\n *\n * @default BodyMd\n */\n textVariant?: TextVariant;\n /**\n * Optional boolean to disable Input.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional boolean to show readonly input.\n *\n * @default false\n */\n isReadonly?: boolean;\n /**\n * Optional boolean to disable state styles.\n *\n * @default false\n */\n isStateStylesDisabled?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n};\n"]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { TextInputProps } from "react-native/index.js";
|
|
2
2
|
import type { TextVariant } from "../../types/index.cjs";
|
|
3
|
-
export type InputProps = Omit<TextInputProps, 'editable'> & {
|
|
3
|
+
export type InputProps = Omit<TextInputProps, 'editable' | 'value' | 'defaultValue'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Controlled value for Input.
|
|
6
|
+
*/
|
|
7
|
+
value: string;
|
|
4
8
|
/**
|
|
5
9
|
* Optional enum to select between Typography variants.
|
|
6
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAqB;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C,MAAM,MAAM,UAAU,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"Input.types.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAqB;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,cAAc,EACd,UAAU,GAAG,OAAO,GAAG,cAAc,CACtC,GAAG;IACF;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { TextInputProps } from "react-native/index.js";
|
|
2
2
|
import type { TextVariant } from "../../types/index.mjs";
|
|
3
|
-
export type InputProps = Omit<TextInputProps, 'editable'> & {
|
|
3
|
+
export type InputProps = Omit<TextInputProps, 'editable' | 'value' | 'defaultValue'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Controlled value for Input.
|
|
6
|
+
*/
|
|
7
|
+
value: string;
|
|
4
8
|
/**
|
|
5
9
|
* Optional enum to select between Typography variants.
|
|
6
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAqB;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C,MAAM,MAAM,UAAU,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"Input.types.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAqB;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,cAAc,EACd,UAAU,GAAG,OAAO,GAAG,cAAc,CACtC,GAAG;IACF;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextInputProps } from 'react-native';\n\nimport type { TextVariant } from '../../types';\n\nexport type InputProps = Omit
|
|
1
|
+
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextInputProps } from 'react-native';\n\nimport type { TextVariant } from '../../types';\n\nexport type InputProps = Omit<\n TextInputProps,\n 'editable' | 'value' | 'defaultValue'\n> & {\n /**\n * Controlled value for Input.\n */\n value: string;\n /**\n * Optional enum to select between Typography variants.\n *\n * @default BodyMd\n */\n textVariant?: TextVariant;\n /**\n * Optional boolean to disable Input.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional boolean to show readonly input.\n *\n * @default false\n */\n isReadonly?: boolean;\n /**\n * Optional boolean to disable state styles.\n *\n * @default false\n */\n isStateStylesDisabled?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n};\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ListItem = void 0;
|
|
27
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const react_native_1 = require("react-native/index.js");
|
|
30
|
+
const Box_1 = require("../Box/index.cjs");
|
|
31
|
+
const ListItem_constants_1 = require("./ListItem.constants.cjs");
|
|
32
|
+
const ListItem_types_1 = require("./ListItem.types.cjs");
|
|
33
|
+
const VERTICAL_ALIGNMENT_MAP = {
|
|
34
|
+
[ListItem_types_1.ListItemVerticalAlignment.Top]: Box_1.BoxAlignItems.Start,
|
|
35
|
+
[ListItem_types_1.ListItemVerticalAlignment.Center]: Box_1.BoxAlignItems.Center,
|
|
36
|
+
[ListItem_types_1.ListItemVerticalAlignment.Bottom]: Box_1.BoxAlignItems.End,
|
|
37
|
+
};
|
|
38
|
+
const ListItem = ({ children, topAccessory, bottomAccessory, topAccessoryGap = ListItem_constants_1.DEFAULT_LISTITEM_TOPACCESSORYGAP, bottomAccessoryGap = ListItem_constants_1.DEFAULT_LISTITEM_BOTTOMACCESSORYGAP, gap = ListItem_constants_1.DEFAULT_LISTITEM_GAP, verticalAlignment = ListItem_constants_1.DEFAULT_LISTITEM_VERTICALALIGNMENT, twClassName, style, ...props }) => {
|
|
39
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
40
|
+
return (<Box_1.Box style={style
|
|
41
|
+
? [tw.style('p-4', twClassName), style]
|
|
42
|
+
: tw.style('p-4', twClassName)} {...props}>
|
|
43
|
+
{topAccessory && (<react_native_1.View testID={ListItem_constants_1.TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER} style={{ marginBottom: topAccessoryGap }}>
|
|
44
|
+
{topAccessory}
|
|
45
|
+
</react_native_1.View>)}
|
|
46
|
+
<Box_1.Box flexDirection={Box_1.BoxFlexDirection.Row} alignItems={VERTICAL_ALIGNMENT_MAP[verticalAlignment]}>
|
|
47
|
+
{react_1.Children.toArray(children)
|
|
48
|
+
.filter((child) => Boolean(child))
|
|
49
|
+
.map((child, index) => (<react_1.default.Fragment key={index}>
|
|
50
|
+
{index > 0 && (<react_native_1.View style={{ width: gap }} testID={ListItem_constants_1.TESTID_LISTITEM_GAP} accessible={false}/>)}
|
|
51
|
+
{child}
|
|
52
|
+
</react_1.default.Fragment>))}
|
|
53
|
+
</Box_1.Box>
|
|
54
|
+
{bottomAccessory && (<react_native_1.View testID={ListItem_constants_1.TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER} style={{ marginTop: bottomAccessoryGap }}>
|
|
55
|
+
{bottomAccessory}
|
|
56
|
+
</react_native_1.View>)}
|
|
57
|
+
</Box_1.Box>);
|
|
58
|
+
};
|
|
59
|
+
exports.ListItem = ListItem;
|
|
60
|
+
exports.ListItem.displayName = 'ListItem';
|
|
61
|
+
//# sourceMappingURL=ListItem.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.cjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAwC;AACxC,wDAAoD;AAEpD,0CAA8D;AAE9D,iEAQ8B;AAE9B,yDAA6D;AAE7D,MAAM,sBAAsB,GAC1B;IACE,CAAC,0CAAyB,CAAC,GAAG,CAAC,EAAE,mBAAa,CAAC,KAAK;IACpD,CAAC,0CAAyB,CAAC,MAAM,CAAC,EAAE,mBAAa,CAAC,MAAM;IACxD,CAAC,0CAAyB,CAAC,MAAM,CAAC,EAAE,mBAAa,CAAC,GAAG;CACtD,CAAC;AAEG,MAAM,QAAQ,GAA4B,CAAC,EAChD,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,eAAe,GAAG,qDAAgC,EAClD,kBAAkB,GAAG,wDAAmC,EACxD,GAAG,GAAG,yCAAoB,EAC1B,iBAAiB,GAAG,uDAAkC,EACtD,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wC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AC,CAAC,6DAAwC,CAAC,CACjD,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAEzC;UAAA,CAAC,eAAe,CAClB;QAAA,EAAE,mBAAI,CAAC,CACR,CACH;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA5DW,QAAA,QAAQ,YA4DnB;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { Children } from 'react';\nimport { DimensionValue, View } from 'react-native';\n\nimport { Box, BoxAlignItems, BoxFlexDirection } from '../Box';\n\nimport {\n DEFAULT_LISTITEM_BOTTOMACCESSORYGAP,\n DEFAULT_LISTITEM_GAP,\n DEFAULT_LISTITEM_TOPACCESSORYGAP,\n DEFAULT_LISTITEM_VERTICALALIGNMENT,\n TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER,\n TESTID_LISTITEM_GAP,\n TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER,\n} from './ListItem.constants';\nimport type { ListItemProps } from './ListItem.types';\nimport { ListItemVerticalAlignment } from './ListItem.types';\n\nconst VERTICAL_ALIGNMENT_MAP: Record<ListItemVerticalAlignment, BoxAlignItems> =\n {\n [ListItemVerticalAlignment.Top]: BoxAlignItems.Start,\n [ListItemVerticalAlignment.Center]: BoxAlignItems.Center,\n [ListItemVerticalAlignment.Bottom]: BoxAlignItems.End,\n };\n\nexport const ListItem: React.FC<ListItemProps> = ({\n children,\n topAccessory,\n bottomAccessory,\n topAccessoryGap = DEFAULT_LISTITEM_TOPACCESSORYGAP,\n bottomAccessoryGap = DEFAULT_LISTITEM_BOTTOMACCESSORYGAP,\n gap = DEFAULT_LISTITEM_GAP,\n verticalAlignment = DEFAULT_LISTITEM_VERTICALALIGNMENT,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <Box\n style={\n style\n ? [tw.style('p-4', twClassName), style]\n : tw.style('p-4', twClassName)\n }\n {...props}\n >\n {topAccessory && (\n <View\n testID={TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER}\n style={{ marginBottom: topAccessoryGap }}\n >\n {topAccessory}\n </View>\n )}\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={VERTICAL_ALIGNMENT_MAP[verticalAlignment]}\n >\n {Children.toArray(children)\n .filter((child) => Boolean(child))\n .map((child, index) => (\n <React.Fragment key={index}>\n {index > 0 && (\n <View\n style={{ width: gap as DimensionValue }}\n testID={TESTID_LISTITEM_GAP}\n accessible={false}\n />\n )}\n {child}\n </React.Fragment>\n ))}\n </Box>\n {bottomAccessory && (\n <View\n testID={TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER}\n style={{ marginTop: bottomAccessoryGap }}\n >\n {bottomAccessory}\n </View>\n )}\n </Box>\n );\n};\n\nListItem.displayName = 'ListItem';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_LISTITEM_BOTTOMACCESSORYGAP = exports.DEFAULT_LISTITEM_TOPACCESSORYGAP = exports.DEFAULT_LISTITEM_VERTICALALIGNMENT = exports.DEFAULT_LISTITEM_GAP = exports.TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER = exports.TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER = exports.TESTID_LISTITEM_GAP = void 0;
|
|
4
|
+
const ListItem_types_1 = require("./ListItem.types.cjs");
|
|
5
|
+
// Test IDs
|
|
6
|
+
exports.TESTID_LISTITEM_GAP = 'listitem-gap';
|
|
7
|
+
exports.TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER = 'listitem-top-accessory-wrapper';
|
|
8
|
+
exports.TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER = 'listitem-bottom-accessory-wrapper';
|
|
9
|
+
// Defaults
|
|
10
|
+
exports.DEFAULT_LISTITEM_GAP = 16;
|
|
11
|
+
exports.DEFAULT_LISTITEM_VERTICALALIGNMENT = ListItem_types_1.ListItemVerticalAlignment.Center;
|
|
12
|
+
exports.DEFAULT_LISTITEM_TOPACCESSORYGAP = 0;
|
|
13
|
+
exports.DEFAULT_LISTITEM_BOTTOMACCESSORYGAP = 0;
|
|
14
|
+
//# sourceMappingURL=ListItem.constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.constants.cjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.constants.ts"],"names":[],"mappings":";;;AAAA,yDAA6D;AAE7D,WAAW;AACE,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,qCAAqC,GAChD,gCAAgC,CAAC;AACtB,QAAA,wCAAwC,GACnD,mCAAmC,CAAC;AAEtC,WAAW;AACE,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAC1B,QAAA,kCAAkC,GAC7C,0CAAyB,CAAC,MAAM,CAAC;AACtB,QAAA,gCAAgC,GAAG,CAAC,CAAC;AACrC,QAAA,mCAAmC,GAAG,CAAC,CAAC","sourcesContent":["import { ListItemVerticalAlignment } from './ListItem.types';\n\n// Test IDs\nexport const TESTID_LISTITEM_GAP = 'listitem-gap';\nexport const TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER =\n 'listitem-top-accessory-wrapper';\nexport const TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER =\n 'listitem-bottom-accessory-wrapper';\n\n// Defaults\nexport const DEFAULT_LISTITEM_GAP = 16;\nexport const DEFAULT_LISTITEM_VERTICALALIGNMENT =\n ListItemVerticalAlignment.Center;\nexport const DEFAULT_LISTITEM_TOPACCESSORYGAP = 0;\nexport const DEFAULT_LISTITEM_BOTTOMACCESSORYGAP = 0;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TESTID_LISTITEM_GAP = "listitem-gap";
|
|
2
|
+
export declare const TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER = "listitem-top-accessory-wrapper";
|
|
3
|
+
export declare const TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER = "listitem-bottom-accessory-wrapper";
|
|
4
|
+
export declare const DEFAULT_LISTITEM_GAP = 16;
|
|
5
|
+
export declare const DEFAULT_LISTITEM_VERTICALALIGNMENT: "center";
|
|
6
|
+
export declare const DEFAULT_LISTITEM_TOPACCESSORYGAP = 0;
|
|
7
|
+
export declare const DEFAULT_LISTITEM_BOTTOMACCESSORYGAP = 0;
|
|
8
|
+
//# sourceMappingURL=ListItem.constants.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.constants.d.cts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,qCAAqC,mCAChB,CAAC;AACnC,eAAO,MAAM,wCAAwC,sCAChB,CAAC;AAGtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,kCAAkC,UACb,CAAC;AACnC,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,mCAAmC,IAAI,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TESTID_LISTITEM_GAP = "listitem-gap";
|
|
2
|
+
export declare const TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER = "listitem-top-accessory-wrapper";
|
|
3
|
+
export declare const TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER = "listitem-bottom-accessory-wrapper";
|
|
4
|
+
export declare const DEFAULT_LISTITEM_GAP = 16;
|
|
5
|
+
export declare const DEFAULT_LISTITEM_VERTICALALIGNMENT: "center";
|
|
6
|
+
export declare const DEFAULT_LISTITEM_TOPACCESSORYGAP = 0;
|
|
7
|
+
export declare const DEFAULT_LISTITEM_BOTTOMACCESSORYGAP = 0;
|
|
8
|
+
//# sourceMappingURL=ListItem.constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.constants.d.mts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,qCAAqC,mCAChB,CAAC;AACnC,eAAO,MAAM,wCAAwC,sCAChB,CAAC;AAGtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,kCAAkC,UACb,CAAC;AACnC,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,mCAAmC,IAAI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ListItemVerticalAlignment } from "./ListItem.types.mjs";
|
|
2
|
+
// Test IDs
|
|
3
|
+
export const TESTID_LISTITEM_GAP = 'listitem-gap';
|
|
4
|
+
export const TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER = 'listitem-top-accessory-wrapper';
|
|
5
|
+
export const TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER = 'listitem-bottom-accessory-wrapper';
|
|
6
|
+
// Defaults
|
|
7
|
+
export const DEFAULT_LISTITEM_GAP = 16;
|
|
8
|
+
export const DEFAULT_LISTITEM_VERTICALALIGNMENT = ListItemVerticalAlignment.Center;
|
|
9
|
+
export const DEFAULT_LISTITEM_TOPACCESSORYGAP = 0;
|
|
10
|
+
export const DEFAULT_LISTITEM_BOTTOMACCESSORYGAP = 0;
|
|
11
|
+
//# sourceMappingURL=ListItem.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.constants.mjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,6BAAyB;AAE7D,WAAW;AACX,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAClD,MAAM,CAAC,MAAM,qCAAqC,GAChD,gCAAgC,CAAC;AACnC,MAAM,CAAC,MAAM,wCAAwC,GACnD,mCAAmC,CAAC;AAEtC,WAAW;AACX,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,kCAAkC,GAC7C,yBAAyB,CAAC,MAAM,CAAC;AACnC,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC","sourcesContent":["import { ListItemVerticalAlignment } from './ListItem.types';\n\n// Test IDs\nexport const TESTID_LISTITEM_GAP = 'listitem-gap';\nexport const TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER =\n 'listitem-top-accessory-wrapper';\nexport const TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER =\n 'listitem-bottom-accessory-wrapper';\n\n// Defaults\nexport const DEFAULT_LISTITEM_GAP = 16;\nexport const DEFAULT_LISTITEM_VERTICALALIGNMENT =\n ListItemVerticalAlignment.Center;\nexport const DEFAULT_LISTITEM_TOPACCESSORYGAP = 0;\nexport const DEFAULT_LISTITEM_BOTTOMACCESSORYGAP = 0;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.d.cts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAcxC,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAUtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4D5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.d.mts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAcxC,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAUtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4D5C,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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, { Children } from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { View } from "react-native/index.js";
|
|
11
|
+
import { Box, BoxAlignItems, BoxFlexDirection } from "../Box/index.mjs";
|
|
12
|
+
import { DEFAULT_LISTITEM_BOTTOMACCESSORYGAP, DEFAULT_LISTITEM_GAP, DEFAULT_LISTITEM_TOPACCESSORYGAP, DEFAULT_LISTITEM_VERTICALALIGNMENT, TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER, TESTID_LISTITEM_GAP, TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER } from "./ListItem.constants.mjs";
|
|
13
|
+
import { ListItemVerticalAlignment } from "./ListItem.types.mjs";
|
|
14
|
+
const VERTICAL_ALIGNMENT_MAP = {
|
|
15
|
+
[ListItemVerticalAlignment.Top]: BoxAlignItems.Start,
|
|
16
|
+
[ListItemVerticalAlignment.Center]: BoxAlignItems.Center,
|
|
17
|
+
[ListItemVerticalAlignment.Bottom]: BoxAlignItems.End,
|
|
18
|
+
};
|
|
19
|
+
export const ListItem = ({ children, topAccessory, bottomAccessory, topAccessoryGap = DEFAULT_LISTITEM_TOPACCESSORYGAP, bottomAccessoryGap = DEFAULT_LISTITEM_BOTTOMACCESSORYGAP, gap = DEFAULT_LISTITEM_GAP, verticalAlignment = DEFAULT_LISTITEM_VERTICALALIGNMENT, twClassName, style, ...props }) => {
|
|
20
|
+
const tw = useTailwind();
|
|
21
|
+
return (<Box style={style
|
|
22
|
+
? [tw.style('p-4', twClassName), style]
|
|
23
|
+
: tw.style('p-4', twClassName)} {...props}>
|
|
24
|
+
{topAccessory && (<View testID={TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER} style={{ marginBottom: topAccessoryGap }}>
|
|
25
|
+
{topAccessory}
|
|
26
|
+
</View>)}
|
|
27
|
+
<Box flexDirection={BoxFlexDirection.Row} alignItems={VERTICAL_ALIGNMENT_MAP[verticalAlignment]}>
|
|
28
|
+
{Children.toArray(children)
|
|
29
|
+
.filter((child) => Boolean(child))
|
|
30
|
+
.map((child, index) => (<React.Fragment key={index}>
|
|
31
|
+
{index > 0 && (<View style={{ width: gap }} testID={TESTID_LISTITEM_GAP} accessible={false}/>)}
|
|
32
|
+
{child}
|
|
33
|
+
</React.Fragment>))}
|
|
34
|
+
</Box>
|
|
35
|
+
{bottomAccessory && (<View testID={TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER} style={{ marginTop: bottomAccessoryGap }}>
|
|
36
|
+
{bottomAccessory}
|
|
37
|
+
</View>)}
|
|
38
|
+
</Box>);
|
|
39
|
+
};
|
|
40
|
+
ListItem.displayName = 'ListItem';
|
|
41
|
+
//# sourceMappingURL=ListItem.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.mjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AACxC,OAAO,EAAkB,IAAI,EAAE,8BAAqB;AAEpD,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,EAAE,yBAAe;AAE9D,OAAO,EACL,mCAAmC,EACnC,oBAAoB,EACpB,gCAAgC,EAChC,kCAAkC,EAClC,wCAAwC,EACxC,mBAAmB,EACnB,qCAAqC,EACtC,iCAA6B;AAE9B,OAAO,EAAE,yBAAyB,EAAE,6BAAyB;AAE7D,MAAM,sBAAsB,GAC1B;IACE,CAAC,yBAAyB,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC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,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CACzB;cAAA,CAAC,KAAK,GAAG,CAAC,IAAI,CACZ,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,GAAqB,EAAE,CAAC,CACxC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAC5B,UAAU,CAAC,CAAC,KAAK,CAAC,EAClB,CACH,CACD;cAAA,CAAC,KAAK,CACR;YAAA,EAAE,KAAK,CAAC,QAAQ,CAAC,CAClB,CAAC,CACN;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,eAAe,IAAI,CAClB,CAAC,IAAI,CACH,MAAM,CAAC,CAAC,wCAAwC,CAAC,CACjD,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAEzC;UAAA,CAAC,eAAe,CAClB;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { Children } from 'react';\nimport { DimensionValue, View } from 'react-native';\n\nimport { Box, BoxAlignItems, BoxFlexDirection } from '../Box';\n\nimport {\n DEFAULT_LISTITEM_BOTTOMACCESSORYGAP,\n DEFAULT_LISTITEM_GAP,\n DEFAULT_LISTITEM_TOPACCESSORYGAP,\n DEFAULT_LISTITEM_VERTICALALIGNMENT,\n TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER,\n TESTID_LISTITEM_GAP,\n TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER,\n} from './ListItem.constants';\nimport type { ListItemProps } from './ListItem.types';\nimport { ListItemVerticalAlignment } from './ListItem.types';\n\nconst VERTICAL_ALIGNMENT_MAP: Record<ListItemVerticalAlignment, BoxAlignItems> =\n {\n [ListItemVerticalAlignment.Top]: BoxAlignItems.Start,\n [ListItemVerticalAlignment.Center]: BoxAlignItems.Center,\n [ListItemVerticalAlignment.Bottom]: BoxAlignItems.End,\n };\n\nexport const ListItem: React.FC<ListItemProps> = ({\n children,\n topAccessory,\n bottomAccessory,\n topAccessoryGap = DEFAULT_LISTITEM_TOPACCESSORYGAP,\n bottomAccessoryGap = DEFAULT_LISTITEM_BOTTOMACCESSORYGAP,\n gap = DEFAULT_LISTITEM_GAP,\n verticalAlignment = DEFAULT_LISTITEM_VERTICALALIGNMENT,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <Box\n style={\n style\n ? [tw.style('p-4', twClassName), style]\n : tw.style('p-4', twClassName)\n }\n {...props}\n >\n {topAccessory && (\n <View\n testID={TESTID_LISTITEM_TOP_ACCESSORY_WRAPPER}\n style={{ marginBottom: topAccessoryGap }}\n >\n {topAccessory}\n </View>\n )}\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={VERTICAL_ALIGNMENT_MAP[verticalAlignment]}\n >\n {Children.toArray(children)\n .filter((child) => Boolean(child))\n .map((child, index) => (\n <React.Fragment key={index}>\n {index > 0 && (\n <View\n style={{ width: gap as DimensionValue }}\n testID={TESTID_LISTITEM_GAP}\n accessible={false}\n />\n )}\n {child}\n </React.Fragment>\n ))}\n </Box>\n {bottomAccessory && (\n <View\n testID={TESTID_LISTITEM_BOTTOM_ACCESSORY_WRAPPER}\n style={{ marginTop: bottomAccessoryGap }}\n >\n {bottomAccessory}\n </View>\n )}\n </Box>\n );\n};\n\nListItem.displayName = 'ListItem';\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListItemVerticalAlignment = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Vertical alignment options for children inside the ListItem row.
|
|
6
|
+
*/
|
|
7
|
+
exports.ListItemVerticalAlignment = {
|
|
8
|
+
Top: 'top',
|
|
9
|
+
Center: 'center',
|
|
10
|
+
Bottom: 'bottom',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=ListItem.types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.types.cjs","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.types.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACU,QAAA,yBAAyB,GAAG;IACvC,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport type { ViewProps } from 'react-native';\n\n/**\n * Vertical alignment options for children inside the ListItem row.\n */\nexport const ListItemVerticalAlignment = {\n Top: 'top',\n Center: 'center',\n Bottom: 'bottom',\n} as const;\n\nexport type ListItemVerticalAlignment =\n (typeof ListItemVerticalAlignment)[keyof typeof ListItemVerticalAlignment];\n\n/**\n * ListItem component props.\n *\n * Extends `ViewProps` so the root View inherits standard React Native\n * props such as `testID` and `accessibilityLabel`.\n */\nexport type ListItemProps = {\n /**\n * Content to display inside the list item row.\n */\n children?: ReactNode;\n /**\n * Optional content displayed above the list item row.\n */\n topAccessory?: ReactNode;\n /**\n * Optional content displayed below the list item row.\n */\n bottomAccessory?: ReactNode;\n /**\n * Gap in pixels between the topAccessory and the row.\n *\n * @default 0\n */\n topAccessoryGap?: number;\n /**\n * Gap in pixels between the row and the bottomAccessory.\n *\n * @default 0\n */\n bottomAccessoryGap?: number;\n /**\n * Horizontal spacing between each child inside the row.\n *\n * @default 16\n */\n gap?: number | string;\n /**\n * Vertical alignment of children inside the row.\n *\n * @default ListItemVerticalAlignment.Center\n */\n verticalAlignment?: ListItemVerticalAlignment;\n /**\n * Optional Tailwind class names to override default styles on the root element.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ViewProps } from "react-native/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Vertical alignment options for children inside the ListItem row.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ListItemVerticalAlignment: {
|
|
7
|
+
readonly Top: "top";
|
|
8
|
+
readonly Center: "center";
|
|
9
|
+
readonly Bottom: "bottom";
|
|
10
|
+
};
|
|
11
|
+
export type ListItemVerticalAlignment = (typeof ListItemVerticalAlignment)[keyof typeof ListItemVerticalAlignment];
|
|
12
|
+
/**
|
|
13
|
+
* ListItem component props.
|
|
14
|
+
*
|
|
15
|
+
* Extends `ViewProps` so the root View inherits standard React Native
|
|
16
|
+
* props such as `testID` and `accessibilityLabel`.
|
|
17
|
+
*/
|
|
18
|
+
export type ListItemProps = {
|
|
19
|
+
/**
|
|
20
|
+
* Content to display inside the list item row.
|
|
21
|
+
*/
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Optional content displayed above the list item row.
|
|
25
|
+
*/
|
|
26
|
+
topAccessory?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Optional content displayed below the list item row.
|
|
29
|
+
*/
|
|
30
|
+
bottomAccessory?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Gap in pixels between the topAccessory and the row.
|
|
33
|
+
*
|
|
34
|
+
* @default 0
|
|
35
|
+
*/
|
|
36
|
+
topAccessoryGap?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Gap in pixels between the row and the bottomAccessory.
|
|
39
|
+
*
|
|
40
|
+
* @default 0
|
|
41
|
+
*/
|
|
42
|
+
bottomAccessoryGap?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Horizontal spacing between each child inside the row.
|
|
45
|
+
*
|
|
46
|
+
* @default 16
|
|
47
|
+
*/
|
|
48
|
+
gap?: number | string;
|
|
49
|
+
/**
|
|
50
|
+
* Vertical alignment of children inside the row.
|
|
51
|
+
*
|
|
52
|
+
* @default ListItemVerticalAlignment.Center
|
|
53
|
+
*/
|
|
54
|
+
verticalAlignment?: ListItemVerticalAlignment;
|
|
55
|
+
/**
|
|
56
|
+
* Optional Tailwind class names to override default styles on the root element.
|
|
57
|
+
*/
|
|
58
|
+
twClassName?: string;
|
|
59
|
+
} & ViewProps;
|
|
60
|
+
//# sourceMappingURL=ListItem.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.types.d.cts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ViewProps } from "react-native/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Vertical alignment options for children inside the ListItem row.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ListItemVerticalAlignment: {
|
|
7
|
+
readonly Top: "top";
|
|
8
|
+
readonly Center: "center";
|
|
9
|
+
readonly Bottom: "bottom";
|
|
10
|
+
};
|
|
11
|
+
export type ListItemVerticalAlignment = (typeof ListItemVerticalAlignment)[keyof typeof ListItemVerticalAlignment];
|
|
12
|
+
/**
|
|
13
|
+
* ListItem component props.
|
|
14
|
+
*
|
|
15
|
+
* Extends `ViewProps` so the root View inherits standard React Native
|
|
16
|
+
* props such as `testID` and `accessibilityLabel`.
|
|
17
|
+
*/
|
|
18
|
+
export type ListItemProps = {
|
|
19
|
+
/**
|
|
20
|
+
* Content to display inside the list item row.
|
|
21
|
+
*/
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Optional content displayed above the list item row.
|
|
25
|
+
*/
|
|
26
|
+
topAccessory?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Optional content displayed below the list item row.
|
|
29
|
+
*/
|
|
30
|
+
bottomAccessory?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Gap in pixels between the topAccessory and the row.
|
|
33
|
+
*
|
|
34
|
+
* @default 0
|
|
35
|
+
*/
|
|
36
|
+
topAccessoryGap?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Gap in pixels between the row and the bottomAccessory.
|
|
39
|
+
*
|
|
40
|
+
* @default 0
|
|
41
|
+
*/
|
|
42
|
+
bottomAccessoryGap?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Horizontal spacing between each child inside the row.
|
|
45
|
+
*
|
|
46
|
+
* @default 16
|
|
47
|
+
*/
|
|
48
|
+
gap?: number | string;
|
|
49
|
+
/**
|
|
50
|
+
* Vertical alignment of children inside the row.
|
|
51
|
+
*
|
|
52
|
+
* @default ListItemVerticalAlignment.Center
|
|
53
|
+
*/
|
|
54
|
+
verticalAlignment?: ListItemVerticalAlignment;
|
|
55
|
+
/**
|
|
56
|
+
* Optional Tailwind class names to override default styles on the root element.
|
|
57
|
+
*/
|
|
58
|
+
twClassName?: string;
|
|
59
|
+
} & ViewProps;
|
|
60
|
+
//# sourceMappingURL=ListItem.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.types.d.mts","sourceRoot":"","sources":["../../../src/components/ListItem/ListItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
|