@retray-dev/ui-kit 6.1.0 → 7.0.1
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/COMPONENTS.md +447 -13
- package/EXAMPLES.md +248 -0
- package/README.md +11 -10
- package/dist/Accordion.d.mts +28 -0
- package/dist/Accordion.d.ts +28 -0
- package/dist/Accordion.js +340 -0
- package/dist/Accordion.mjs +6 -0
- package/dist/AlertBanner.d.mts +16 -0
- package/dist/AlertBanner.d.ts +16 -0
- package/dist/AlertBanner.js +247 -0
- package/dist/AlertBanner.mjs +5 -0
- package/dist/Avatar.d.mts +20 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +234 -0
- package/dist/Avatar.mjs +3 -0
- package/dist/Badge.d.mts +26 -0
- package/dist/Badge.d.ts +26 -0
- package/dist/Badge.js +247 -0
- package/dist/Badge.mjs +4 -0
- package/dist/Button.d.mts +25 -0
- package/dist/Button.d.ts +25 -0
- package/dist/Button.js +414 -0
- package/dist/Button.mjs +8 -0
- package/dist/ButtonGroup.d.mts +26 -0
- package/dist/ButtonGroup.d.ts +26 -0
- package/dist/ButtonGroup.js +52 -0
- package/dist/ButtonGroup.mjs +2 -0
- package/dist/Card.d.mts +39 -0
- package/dist/Card.d.ts +39 -0
- package/dist/Card.js +329 -0
- package/dist/Card.mjs +7 -0
- package/dist/CategoryStrip.d.mts +26 -0
- package/dist/CategoryStrip.d.ts +26 -0
- package/dist/CategoryStrip.js +396 -0
- package/dist/CategoryStrip.mjs +9 -0
- package/dist/Checkbox.d.mts +14 -0
- package/dist/Checkbox.d.ts +14 -0
- package/dist/Checkbox.js +304 -0
- package/dist/Checkbox.mjs +7 -0
- package/dist/Chip.d.mts +31 -0
- package/dist/Chip.d.ts +31 -0
- package/dist/Chip.js +370 -0
- package/dist/Chip.mjs +8 -0
- package/dist/ConfirmDialog.d.mts +15 -0
- package/dist/ConfirmDialog.d.ts +15 -0
- package/dist/ConfirmDialog.js +530 -0
- package/dist/ConfirmDialog.mjs +9 -0
- package/dist/CurrencyDisplay.d.mts +24 -0
- package/dist/CurrencyDisplay.d.ts +24 -0
- package/dist/CurrencyDisplay.js +189 -0
- package/dist/CurrencyDisplay.mjs +3 -0
- package/dist/CurrencyInput.d.mts +26 -0
- package/dist/CurrencyInput.d.ts +26 -0
- package/dist/CurrencyInput.js +404 -0
- package/dist/CurrencyInput.mjs +7 -0
- package/dist/DetailRow.d.mts +32 -0
- package/dist/DetailRow.d.ts +32 -0
- package/dist/DetailRow.js +275 -0
- package/dist/DetailRow.mjs +4 -0
- package/dist/EmptyState.d.mts +27 -0
- package/dist/EmptyState.d.ts +27 -0
- package/dist/EmptyState.js +503 -0
- package/dist/EmptyState.mjs +9 -0
- package/dist/Form.d.mts +52 -0
- package/dist/Form.d.ts +52 -0
- package/dist/Form.js +204 -0
- package/dist/Form.mjs +3 -0
- package/dist/IconButton.d.mts +22 -0
- package/dist/IconButton.d.ts +22 -0
- package/dist/IconButton.js +383 -0
- package/dist/IconButton.mjs +7 -0
- package/dist/Input.d.mts +23 -0
- package/dist/Input.d.ts +23 -0
- package/dist/Input.js +351 -0
- package/dist/Input.mjs +6 -0
- package/dist/LabelValue.d.mts +16 -0
- package/dist/LabelValue.d.ts +16 -0
- package/dist/LabelValue.js +225 -0
- package/dist/LabelValue.mjs +4 -0
- package/dist/ListGroup.d.mts +34 -0
- package/dist/ListGroup.d.ts +34 -0
- package/dist/ListGroup.js +217 -0
- package/dist/ListGroup.mjs +4 -0
- package/dist/ListItem.d.mts +64 -0
- package/dist/ListItem.d.ts +64 -0
- package/dist/ListItem.js +430 -0
- package/dist/ListItem.mjs +8 -0
- package/dist/MediaCard.d.mts +39 -0
- package/dist/MediaCard.d.ts +39 -0
- package/dist/MediaCard.js +427 -0
- package/dist/MediaCard.mjs +8 -0
- package/dist/MenuGroup.d.mts +34 -0
- package/dist/MenuGroup.d.ts +34 -0
- package/dist/MenuGroup.js +217 -0
- package/dist/MenuGroup.mjs +4 -0
- package/dist/MenuItem.d.mts +48 -0
- package/dist/MenuItem.d.ts +48 -0
- package/dist/MenuItem.js +403 -0
- package/dist/MenuItem.mjs +8 -0
- package/dist/MonthPicker.d.mts +20 -0
- package/dist/MonthPicker.d.ts +20 -0
- package/dist/MonthPicker.js +234 -0
- package/dist/MonthPicker.mjs +4 -0
- package/dist/Pressable.d.mts +34 -0
- package/dist/Pressable.d.ts +34 -0
- package/dist/Pressable.js +132 -0
- package/dist/Pressable.mjs +4 -0
- package/dist/Progress.d.mts +14 -0
- package/dist/Progress.d.ts +14 -0
- package/dist/Progress.js +191 -0
- package/dist/Progress.mjs +4 -0
- package/dist/RadioGroup.d.mts +19 -0
- package/dist/RadioGroup.d.ts +19 -0
- package/dist/RadioGroup.js +341 -0
- package/dist/RadioGroup.mjs +7 -0
- package/dist/Select.d.mts +22 -0
- package/dist/Select.d.ts +22 -0
- package/dist/Select.js +441 -0
- package/dist/Select.mjs +6 -0
- package/dist/Separator.d.mts +10 -0
- package/dist/Separator.d.ts +10 -0
- package/dist/Separator.js +156 -0
- package/dist/Separator.mjs +2 -0
- package/dist/Sheet.d.mts +81 -0
- package/dist/Sheet.d.ts +81 -0
- package/dist/Sheet.js +340 -0
- package/dist/Sheet.mjs +4 -0
- package/dist/Skeleton.d.mts +17 -0
- package/dist/Skeleton.d.ts +17 -0
- package/dist/Skeleton.js +205 -0
- package/dist/Skeleton.mjs +4 -0
- package/dist/Slider.d.mts +20 -0
- package/dist/Slider.d.ts +20 -0
- package/dist/Slider.js +232 -0
- package/dist/Slider.mjs +4 -0
- package/dist/Spinner.d.mts +12 -0
- package/dist/Spinner.d.ts +12 -0
- package/dist/Spinner.js +172 -0
- package/dist/Spinner.mjs +3 -0
- package/dist/Switch.d.mts +13 -0
- package/dist/Switch.d.ts +13 -0
- package/dist/Switch.js +261 -0
- package/dist/Switch.mjs +5 -0
- package/dist/Tabs.d.mts +27 -0
- package/dist/Tabs.d.ts +27 -0
- package/dist/Tabs.js +389 -0
- package/dist/Tabs.mjs +6 -0
- package/dist/Text.d.mts +12 -0
- package/dist/Text.d.ts +12 -0
- package/dist/Text.js +311 -0
- package/dist/Text.mjs +4 -0
- package/dist/Textarea.d.mts +16 -0
- package/dist/Textarea.d.ts +16 -0
- package/dist/Textarea.js +333 -0
- package/dist/Textarea.mjs +6 -0
- package/dist/Toast.d.mts +47 -0
- package/dist/Toast.d.ts +47 -0
- package/dist/Toast.js +185 -0
- package/dist/Toast.mjs +3 -0
- package/dist/Toggle.d.mts +33 -0
- package/dist/Toggle.d.ts +33 -0
- package/dist/Toggle.js +397 -0
- package/dist/Toggle.mjs +8 -0
- package/dist/VirtualList.d.mts +19 -0
- package/dist/VirtualList.d.ts +19 -0
- package/dist/VirtualList.js +38 -0
- package/dist/VirtualList.mjs +1 -0
- package/dist/chunk-2CE3TQVY.mjs +11 -0
- package/dist/chunk-2UYENBLV.mjs +49 -0
- package/dist/chunk-3BBOZ3OQ.mjs +41 -0
- package/dist/chunk-5IKW3VNC.mjs +43 -0
- package/dist/chunk-63357L2X.mjs +51 -0
- package/dist/chunk-6LQYY7HC.mjs +127 -0
- package/dist/chunk-6Q64UFIA.mjs +71 -0
- package/dist/chunk-76PFOSM2.mjs +41 -0
- package/dist/chunk-7H2OR44A.mjs +14 -0
- package/dist/chunk-A4MDAP7G.mjs +42 -0
- package/dist/chunk-AU2VDY4P.mjs +190 -0
- package/dist/chunk-BRKYVJVV.mjs +60 -0
- package/dist/chunk-CRYBX2CM.mjs +146 -0
- package/dist/chunk-DITNP6PL.mjs +106 -0
- package/dist/chunk-FTLJOUOQ.mjs +97 -0
- package/dist/chunk-GCWOGZYL.mjs +104 -0
- package/dist/chunk-GNGLDL6Z.mjs +60 -0
- package/dist/chunk-GPOUINK5.mjs +148 -0
- package/dist/chunk-HSPSMN6U.mjs +115 -0
- package/dist/chunk-IRRY3CRZ.mjs +82 -0
- package/dist/chunk-JB67UOB5.mjs +92 -0
- package/dist/chunk-JBLL7U3U.mjs +64 -0
- package/dist/chunk-KWCPOM6W.mjs +136 -0
- package/dist/chunk-KZJRQOIU.mjs +64 -0
- package/dist/chunk-L7E7TVEZ.mjs +145 -0
- package/dist/chunk-LG4DO3DK.mjs +174 -0
- package/dist/chunk-LWG526VX.mjs +139 -0
- package/dist/chunk-MN7OG7IY.mjs +96 -0
- package/dist/chunk-MX6HRKMI.mjs +29 -0
- package/dist/chunk-NC5ZTR2Y.mjs +32 -0
- package/dist/chunk-NQGVLMWG.mjs +90 -0
- package/dist/chunk-QCNARS3X.mjs +46 -0
- package/dist/chunk-QXGYKWI7.mjs +134 -0
- package/dist/chunk-QY3X2UYR.mjs +191 -0
- package/dist/chunk-RKLHUDZS.mjs +92 -0
- package/dist/chunk-RMMK64W5.mjs +54 -0
- package/dist/chunk-RR2VQLKE.mjs +190 -0
- package/dist/chunk-RTC3CFXF.mjs +29 -0
- package/dist/chunk-SBZYEV4S.mjs +61 -0
- package/dist/chunk-SOA2Z4RB.mjs +82 -0
- package/dist/chunk-SOYNZDVY.mjs +151 -0
- package/dist/chunk-T7XZ7H7Y.mjs +57 -0
- package/dist/chunk-TAJ2PQ2O.mjs +163 -0
- package/dist/chunk-U4N7WF4Z.mjs +108 -0
- package/dist/chunk-URDE3EUU.mjs +132 -0
- package/dist/chunk-URLL5JBR.mjs +245 -0
- package/dist/chunk-XDMN67KV.mjs +59 -0
- package/dist/chunk-Y6MXOREN.mjs +120 -0
- package/dist/chunk-YZJAFS4P.mjs +131 -0
- package/dist/index.d.mts +94 -852
- package/dist/index.d.ts +94 -852
- package/dist/index.js +1387 -942
- package/dist/index.mjs +50 -3844
- package/package.json +23 -14
- package/src/assets/fonts/Sohne-Bold.otf +0 -0
- package/src/assets/fonts/Sohne-BoldItalic.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraBold.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraBoldItalic.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraLight.otf +0 -0
- package/src/assets/fonts/Sohne-ExtraLightItalic.otf +0 -0
- package/src/assets/fonts/Sohne-Italic.otf +0 -0
- package/src/assets/fonts/Sohne-Light.otf +0 -0
- package/src/assets/fonts/Sohne-LightItalic.otf +0 -0
- package/src/assets/fonts/Sohne-Medium.otf +0 -0
- package/src/assets/fonts/Sohne-MediumItalic.otf +0 -0
- package/src/assets/fonts/Sohne-Regular.otf +0 -0
- package/src/assets/fonts/Sohne-SemiBold.otf +0 -0
- package/src/assets/fonts/Sohne-SemiBoldItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Bold.otf +0 -0
- package/src/assets/fonts/SohneMono-BoldItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraBold.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraBoldItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraLight.otf +0 -0
- package/src/assets/fonts/SohneMono-ExtraLightItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Italic.otf +0 -0
- package/src/assets/fonts/SohneMono-Light.otf +0 -0
- package/src/assets/fonts/SohneMono-LightItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Medium.otf +0 -0
- package/src/assets/fonts/SohneMono-MediumItalic.otf +0 -0
- package/src/assets/fonts/SohneMono-Regular.otf +0 -0
- package/src/assets/fonts/SohneMono-SemiBold.otf +0 -0
- package/src/assets/fonts/SohneMono-SemiBoldItalic.otf +0 -0
- package/src/components/Accordion/Accordion.tsx +13 -15
- package/src/components/AlertBanner/AlertBanner.tsx +33 -12
- package/src/components/Avatar/Avatar.tsx +4 -2
- package/src/components/Badge/Badge.tsx +4 -2
- package/src/components/Button/Button.tsx +30 -29
- package/src/components/ButtonGroup/ButtonGroup.tsx +13 -10
- package/src/components/Card/Card.tsx +36 -65
- package/src/components/CategoryStrip/CategoryStrip.tsx +68 -58
- package/src/components/Checkbox/Checkbox.tsx +41 -55
- package/src/components/Chip/Chip.tsx +49 -84
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +2 -2
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +4 -2
- package/src/components/CurrencyInput/CurrencyInput.tsx +2 -2
- package/src/components/DetailRow/DetailRow.tsx +9 -7
- package/src/components/EmptyState/EmptyState.tsx +2 -2
- package/src/components/Form/Form.tsx +149 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/IconButton/IconButton.tsx +24 -20
- package/src/components/Input/Input.tsx +63 -50
- package/src/components/LabelValue/LabelValue.tsx +6 -4
- package/src/components/ListGroup/ListGroup.tsx +145 -0
- package/src/components/ListGroup/index.ts +1 -0
- package/src/components/ListItem/ListItem.tsx +30 -43
- package/src/components/MediaCard/MediaCard.tsx +31 -29
- package/src/components/MenuGroup/MenuGroup.tsx +145 -0
- package/src/components/MenuGroup/index.ts +1 -0
- package/src/components/MenuItem/MenuItem.tsx +29 -40
- package/src/components/MonthPicker/MonthPicker.tsx +14 -4
- package/src/components/Pressable/Pressable.tsx +27 -46
- package/src/components/Progress/Progress.tsx +21 -12
- package/src/components/RadioGroup/RadioGroup.tsx +55 -32
- package/src/components/Select/Select.tsx +23 -21
- package/src/components/Separator/Separator.tsx +1 -3
- package/src/components/Sheet/Sheet.tsx +85 -18
- package/src/components/Skeleton/Skeleton.tsx +25 -14
- package/src/components/Slider/Slider.tsx +13 -3
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/Switch/Switch.tsx +70 -52
- package/src/components/Tabs/Tabs.tsx +59 -47
- package/src/components/Text/Text.tsx +3 -1
- package/src/components/Textarea/Textarea.tsx +44 -23
- package/src/components/Toast/Toast.tsx +6 -6
- package/src/components/Toggle/Toggle.tsx +86 -68
- package/src/components/VirtualList/VirtualList.tsx +60 -0
- package/src/components/VirtualList/index.ts +1 -0
- package/src/fonts.ts +38 -20
- package/src/index.ts +5 -1
- package/src/theme/colors.ts +53 -39
- package/src/theme/types.ts +3 -0
- package/src/tokens.ts +49 -39
- package/src/utils/animations.ts +58 -0
- package/src/utils/icons.ts +47 -20
- package/src/utils/useColorTransition.ts +40 -0
- package/src/utils/usePressScale.ts +75 -0
- package/src/assets/fonts/Poppins-Black.ttf +0 -0
- package/src/assets/fonts/Poppins-BlackItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Bold.ttf +0 -0
- package/src/assets/fonts/Poppins-BoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraBoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraLightItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Italic.ttf +0 -0
- package/src/assets/fonts/Poppins-Light.ttf +0 -0
- package/src/assets/fonts/Poppins-LightItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Medium.ttf +0 -0
- package/src/assets/fonts/Poppins-MediumItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Regular.ttf +0 -0
- package/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/src/assets/fonts/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Thin.ttf +0 -0
- package/src/assets/fonts/Poppins-ThinItalic.ttf +0 -0
package/dist/ListItem.js
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React3 = require('react');
|
|
4
|
+
var reactNative = require('react-native');
|
|
5
|
+
var Animated = require('react-native-reanimated');
|
|
6
|
+
var vectorIcons = require('@expo/vector-icons');
|
|
7
|
+
var reactNativeSizeMatters = require('react-native-size-matters');
|
|
8
|
+
var AntDesign = require('@expo/vector-icons/AntDesign');
|
|
9
|
+
var Entypo = require('@expo/vector-icons/Entypo');
|
|
10
|
+
var Feather = require('@expo/vector-icons/Feather');
|
|
11
|
+
var FontAwesome5 = require('@expo/vector-icons/FontAwesome5');
|
|
12
|
+
var MaterialIcons = require('@expo/vector-icons/MaterialIcons');
|
|
13
|
+
var Ionicons = require('@expo/vector-icons/Ionicons');
|
|
14
|
+
|
|
15
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
18
|
+
var Animated__default = /*#__PURE__*/_interopDefault(Animated);
|
|
19
|
+
var AntDesign__default = /*#__PURE__*/_interopDefault(AntDesign);
|
|
20
|
+
var Entypo__default = /*#__PURE__*/_interopDefault(Entypo);
|
|
21
|
+
var Feather__default = /*#__PURE__*/_interopDefault(Feather);
|
|
22
|
+
var FontAwesome5__default = /*#__PURE__*/_interopDefault(FontAwesome5);
|
|
23
|
+
var MaterialIcons__default = /*#__PURE__*/_interopDefault(MaterialIcons);
|
|
24
|
+
var Ionicons__default = /*#__PURE__*/_interopDefault(Ionicons);
|
|
25
|
+
|
|
26
|
+
// src/components/ListItem/ListItem.tsx
|
|
27
|
+
var _haptics = null;
|
|
28
|
+
async function getHaptics() {
|
|
29
|
+
if (reactNative.Platform.OS === "web") return null;
|
|
30
|
+
if (!_haptics) {
|
|
31
|
+
_haptics = await import('expo-haptics');
|
|
32
|
+
}
|
|
33
|
+
return _haptics;
|
|
34
|
+
}
|
|
35
|
+
function selectionAsync() {
|
|
36
|
+
if (reactNative.Platform.OS === "web") return;
|
|
37
|
+
getHaptics().then((h) => h?.selectionAsync());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/theme/colorUtils.ts
|
|
41
|
+
function hexToRgb(hex) {
|
|
42
|
+
const clean = hex.replace("#", "");
|
|
43
|
+
const full = clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean;
|
|
44
|
+
if (full.length !== 6) return null;
|
|
45
|
+
return {
|
|
46
|
+
r: parseInt(full.slice(0, 2), 16),
|
|
47
|
+
g: parseInt(full.slice(2, 4), 16),
|
|
48
|
+
b: parseInt(full.slice(4, 6), 16)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function componentToHex(c) {
|
|
52
|
+
return Math.round(Math.max(0, Math.min(255, c))).toString(16).padStart(2, "0");
|
|
53
|
+
}
|
|
54
|
+
function rgbToHex(r, g, b) {
|
|
55
|
+
return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
|
|
56
|
+
}
|
|
57
|
+
function withAlphaOnWhite(hex, alpha) {
|
|
58
|
+
const rgb = hexToRgb(hex);
|
|
59
|
+
if (!rgb) return hex;
|
|
60
|
+
const r = rgb.r * alpha + 255 * (1 - alpha);
|
|
61
|
+
const g = rgb.g * alpha + 255 * (1 - alpha);
|
|
62
|
+
const b = rgb.b * alpha + 255 * (1 - alpha);
|
|
63
|
+
return rgbToHex(r, g, b);
|
|
64
|
+
}
|
|
65
|
+
function withAlphaOnDark(hex, alpha, bgHex = "#0f0f0f") {
|
|
66
|
+
const rgb = hexToRgb(hex);
|
|
67
|
+
const bg = hexToRgb(bgHex);
|
|
68
|
+
if (!rgb || !bg) return hex;
|
|
69
|
+
const r = rgb.r * alpha + bg.r * (1 - alpha);
|
|
70
|
+
const g = rgb.g * alpha + bg.g * (1 - alpha);
|
|
71
|
+
const b = rgb.b * alpha + bg.b * (1 - alpha);
|
|
72
|
+
return rgbToHex(r, g, b);
|
|
73
|
+
}
|
|
74
|
+
function mixWithBackground(fgHex, bgHex, opacity) {
|
|
75
|
+
const fg = hexToRgb(fgHex);
|
|
76
|
+
const bg = hexToRgb(bgHex);
|
|
77
|
+
if (!fg || !bg) return fgHex;
|
|
78
|
+
const r = fg.r * opacity + bg.r * (1 - opacity);
|
|
79
|
+
const g = fg.g * opacity + bg.g * (1 - opacity);
|
|
80
|
+
const b = fg.b * opacity + bg.b * (1 - opacity);
|
|
81
|
+
return rgbToHex(r, g, b);
|
|
82
|
+
}
|
|
83
|
+
function lighten(hex, amount) {
|
|
84
|
+
return withAlphaOnWhite(hex, 1 - amount);
|
|
85
|
+
}
|
|
86
|
+
function darken(hex, amount) {
|
|
87
|
+
const rgb = hexToRgb(hex);
|
|
88
|
+
if (!rgb) return hex;
|
|
89
|
+
return rgbToHex(rgb.r * (1 - amount), rgb.g * (1 - amount), rgb.b * (1 - amount));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/theme/colors.ts
|
|
93
|
+
var defaultLight = {
|
|
94
|
+
background: "#ffffff",
|
|
95
|
+
foreground: "#1a1a1a",
|
|
96
|
+
card: "#ffffff",
|
|
97
|
+
primary: "#1a1a1a",
|
|
98
|
+
primaryForeground: "#ffffff",
|
|
99
|
+
// AUDIT FIX: brand accent — was undefined; falls back to primary when omitted
|
|
100
|
+
accent: "#d4561d",
|
|
101
|
+
accentForeground: "#ffffff",
|
|
102
|
+
border: "#dddddd",
|
|
103
|
+
// AUDIT FIX: was #e53935 (4.22:1 on white — fails AA); #c72828 = 5.59:1 ✓
|
|
104
|
+
destructive: "#c72828",
|
|
105
|
+
destructiveForeground: "#ffffff",
|
|
106
|
+
success: "#1a7a45",
|
|
107
|
+
successForeground: "#ffffff",
|
|
108
|
+
// AUDIT FIX: was #e67e00 (2.86:1 — severe fail); #9a5200 = 5.86:1 ✓ AAA-near
|
|
109
|
+
warning: "#9a5200",
|
|
110
|
+
warningForeground: "#ffffff"
|
|
111
|
+
};
|
|
112
|
+
function deriveColors(t, scheme) {
|
|
113
|
+
const dark = scheme === "dark";
|
|
114
|
+
const bg = t.background;
|
|
115
|
+
const foregroundSubtle = mixWithBackground(t.foreground, bg, 0.7);
|
|
116
|
+
const foregroundMuted = mixWithBackground(t.foreground, bg, 0.62);
|
|
117
|
+
const surface = dark ? lighten(bg, -0.06) : darken(bg, 0.04);
|
|
118
|
+
const surfaceStrong = dark ? lighten(bg, -0.12) : darken(bg, 0.08);
|
|
119
|
+
const destructiveTint = dark ? withAlphaOnDark(t.destructive, 0.15, bg) : withAlphaOnWhite(t.destructive, 0.08);
|
|
120
|
+
const destructiveBorder = dark ? withAlphaOnDark(t.destructive, 0.45, bg) : withAlphaOnWhite(t.destructive, 0.3);
|
|
121
|
+
const successTint = dark ? withAlphaOnDark(t.success, 0.15, bg) : withAlphaOnWhite(t.success, 0.08);
|
|
122
|
+
const successBorder = dark ? withAlphaOnDark(t.success, 0.45, bg) : withAlphaOnWhite(t.success, 0.3);
|
|
123
|
+
const warningTint = dark ? withAlphaOnDark(t.warning, 0.15, bg) : withAlphaOnWhite(t.warning, 0.08);
|
|
124
|
+
const warningBorder = dark ? withAlphaOnDark(t.warning, 0.45, bg) : withAlphaOnWhite(t.warning, 0.3);
|
|
125
|
+
return {
|
|
126
|
+
...t,
|
|
127
|
+
foregroundSubtle,
|
|
128
|
+
foregroundMuted,
|
|
129
|
+
surface,
|
|
130
|
+
surfaceStrong,
|
|
131
|
+
destructiveTint,
|
|
132
|
+
destructiveBorder,
|
|
133
|
+
successTint,
|
|
134
|
+
successBorder,
|
|
135
|
+
warningTint,
|
|
136
|
+
warningBorder,
|
|
137
|
+
overlay: t.overlay ?? "rgba(0,0,0,0.45)",
|
|
138
|
+
accentResolved: t.accent ?? t.primary,
|
|
139
|
+
accentForegroundResolved: t.accentForeground ?? t.primaryForeground,
|
|
140
|
+
ring: t.accent ?? t.primary,
|
|
141
|
+
input: t.border,
|
|
142
|
+
separator: dark ? lighten(t.border, 0.22) : darken(t.border, 0.16)
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// src/theme/ThemeProvider.tsx
|
|
147
|
+
var ThemeContext = React3.createContext({
|
|
148
|
+
colors: deriveColors(defaultLight, "light"),
|
|
149
|
+
colorScheme: "light"
|
|
150
|
+
});
|
|
151
|
+
function useTheme() {
|
|
152
|
+
const context = React3.useContext(ThemeContext);
|
|
153
|
+
if (!context) {
|
|
154
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
155
|
+
}
|
|
156
|
+
return context;
|
|
157
|
+
}
|
|
158
|
+
var isWeb = reactNative.Platform.OS === "web";
|
|
159
|
+
var s = isWeb ? (n) => n : reactNativeSizeMatters.scale;
|
|
160
|
+
var vs = isWeb ? (n) => n : reactNativeSizeMatters.verticalScale;
|
|
161
|
+
var ms = isWeb ? (n, _factor) => n : reactNativeSizeMatters.moderateScale;
|
|
162
|
+
var mvs = isWeb ? (n, _factor) => n : reactNativeSizeMatters.moderateVerticalScale;
|
|
163
|
+
var glyphMapOf = (mod) => mod.glyphMap ?? {};
|
|
164
|
+
var ALL_FAMILIES = [
|
|
165
|
+
{ name: "Ionicons", component: Ionicons__default.default, getGlyphMap: () => glyphMapOf(Ionicons__default.default) },
|
|
166
|
+
{ name: "MaterialIcons", component: MaterialIcons__default.default, getGlyphMap: () => glyphMapOf(MaterialIcons__default.default) },
|
|
167
|
+
{ name: "FontAwesome5", component: FontAwesome5__default.default, getGlyphMap: () => glyphMapOf(FontAwesome5__default.default) },
|
|
168
|
+
{ name: "Entypo", component: Entypo__default.default, getGlyphMap: () => glyphMapOf(Entypo__default.default) },
|
|
169
|
+
{ name: "AntDesign", component: AntDesign__default.default, getGlyphMap: () => glyphMapOf(AntDesign__default.default) },
|
|
170
|
+
{ name: "Feather", component: Feather__default.default, getGlyphMap: () => glyphMapOf(Feather__default.default) }
|
|
171
|
+
];
|
|
172
|
+
var activeFamilies = ALL_FAMILIES;
|
|
173
|
+
var resolvedCache = null;
|
|
174
|
+
function buildCache() {
|
|
175
|
+
const cache = /* @__PURE__ */ new Map();
|
|
176
|
+
for (const family of activeFamilies) {
|
|
177
|
+
const glyphMap = family.getGlyphMap();
|
|
178
|
+
for (const iconName of Object.keys(glyphMap)) {
|
|
179
|
+
cache.set(iconName, family);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return cache;
|
|
183
|
+
}
|
|
184
|
+
function resolveFamily(name) {
|
|
185
|
+
if (!resolvedCache) {
|
|
186
|
+
resolvedCache = buildCache();
|
|
187
|
+
}
|
|
188
|
+
return resolvedCache.get(name) ?? null;
|
|
189
|
+
}
|
|
190
|
+
function Icon({ name, size, color, family }) {
|
|
191
|
+
let resolved = null;
|
|
192
|
+
if (family) {
|
|
193
|
+
resolved = ALL_FAMILIES.find((f) => f.name === family) ?? null;
|
|
194
|
+
} else {
|
|
195
|
+
resolved = resolveFamily(name);
|
|
196
|
+
}
|
|
197
|
+
if (!resolved) return null;
|
|
198
|
+
const Component = resolved.component;
|
|
199
|
+
return React3__default.default.createElement(Component, { name, size, color });
|
|
200
|
+
}
|
|
201
|
+
function renderIcon(name, size, color) {
|
|
202
|
+
return React3__default.default.createElement(Icon, { name, size, color });
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// src/tokens.ts
|
|
206
|
+
var RADIUS = {
|
|
207
|
+
md: 14};
|
|
208
|
+
var SPRINGS = {
|
|
209
|
+
/** Tight, premium press feel — Buttons, Toggle, Tabs triggers. */
|
|
210
|
+
pressIn: { stiffness: 600, damping: 35, mass: 0.8 },
|
|
211
|
+
pressOut: { stiffness: 280, damping: 22, mass: 0.8 },
|
|
212
|
+
/** Slightly softer for larger surfaces — Card, ListItem, MenuItem. */
|
|
213
|
+
surfacePressIn: { stiffness: 380, damping: 30, mass: 0.95 },
|
|
214
|
+
surfacePressOut: { stiffness: 220, damping: 20, mass: 0.95 }};
|
|
215
|
+
({
|
|
216
|
+
/** Material-style ease-out — natural deceleration for state changes. */
|
|
217
|
+
standard: Animated.Easing.bezier(0.2, 0, 0, 1),
|
|
218
|
+
/** Strong ease-out for expanding surfaces (Accordion open). */
|
|
219
|
+
expand: Animated.Easing.bezier(0.23, 1, 0.32, 1),
|
|
220
|
+
/** Quick ease-in for collapsing. */
|
|
221
|
+
collapse: Animated.Easing.in(Animated.Easing.ease)
|
|
222
|
+
});
|
|
223
|
+
var PRESS_SCALE = {
|
|
224
|
+
button: 0.95,
|
|
225
|
+
row: 0.97};
|
|
226
|
+
function useHover() {
|
|
227
|
+
const [hovered, setHovered] = React3.useState(false);
|
|
228
|
+
const onMouseEnter = React3.useCallback(() => setHovered(true), []);
|
|
229
|
+
const onMouseLeave = React3.useCallback(() => setHovered(false), []);
|
|
230
|
+
if (reactNative.Platform.OS !== "web") {
|
|
231
|
+
return { hovered: false, hoverHandlers: {} };
|
|
232
|
+
}
|
|
233
|
+
return { hovered, hoverHandlers: { onMouseEnter, onMouseLeave } };
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// src/utils/usePressScale.ts
|
|
237
|
+
function usePressScale({
|
|
238
|
+
pressScale = PRESS_SCALE.button,
|
|
239
|
+
hoverScale = 1.02,
|
|
240
|
+
pressInSpring = SPRINGS.pressIn,
|
|
241
|
+
pressOutSpring = SPRINGS.pressOut,
|
|
242
|
+
disabled = false
|
|
243
|
+
} = {}) {
|
|
244
|
+
const scale2 = Animated.useSharedValue(1);
|
|
245
|
+
const { hovered, hoverHandlers } = useHover();
|
|
246
|
+
const onPressIn = React3.useCallback(() => {
|
|
247
|
+
if (disabled) return;
|
|
248
|
+
scale2.value = Animated.withSpring(pressScale, pressInSpring);
|
|
249
|
+
}, [disabled, pressScale, pressInSpring, scale2]);
|
|
250
|
+
const onPressOut = React3.useCallback(() => {
|
|
251
|
+
if (disabled) return;
|
|
252
|
+
scale2.value = Animated.withSpring(1, pressOutSpring);
|
|
253
|
+
}, [disabled, pressOutSpring, scale2]);
|
|
254
|
+
const hoverActive = reactNative.Platform.OS === "web" && hovered && hoverScale !== 1 && !disabled;
|
|
255
|
+
const animatedStyle = Animated.useAnimatedStyle(() => ({
|
|
256
|
+
transform: [
|
|
257
|
+
{ scale: scale2.value * (hoverActive ? hoverScale : 1) }
|
|
258
|
+
]
|
|
259
|
+
}));
|
|
260
|
+
return {
|
|
261
|
+
animatedStyle,
|
|
262
|
+
onPressIn,
|
|
263
|
+
onPressOut,
|
|
264
|
+
hoverHandlers
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// src/components/ListItem/ListItem.tsx
|
|
269
|
+
function ListItemBase({
|
|
270
|
+
leftRender,
|
|
271
|
+
rightRender,
|
|
272
|
+
trailing,
|
|
273
|
+
icon,
|
|
274
|
+
leftIcon,
|
|
275
|
+
rightIcon,
|
|
276
|
+
leftIconColor,
|
|
277
|
+
rightIconColor,
|
|
278
|
+
title,
|
|
279
|
+
subtitle,
|
|
280
|
+
caption,
|
|
281
|
+
variant = "plain",
|
|
282
|
+
showChevron = false,
|
|
283
|
+
showSeparator = false,
|
|
284
|
+
onPress,
|
|
285
|
+
disabled,
|
|
286
|
+
style,
|
|
287
|
+
titleStyle,
|
|
288
|
+
subtitleStyle,
|
|
289
|
+
captionStyle,
|
|
290
|
+
accessibilityLabel
|
|
291
|
+
}) {
|
|
292
|
+
const { colors } = useTheme();
|
|
293
|
+
const { animatedStyle, onPressIn, onPressOut, hoverHandlers } = usePressScale({
|
|
294
|
+
pressScale: PRESS_SCALE.row,
|
|
295
|
+
pressInSpring: SPRINGS.surfacePressIn,
|
|
296
|
+
pressOutSpring: SPRINGS.surfacePressOut,
|
|
297
|
+
disabled: !onPress || disabled
|
|
298
|
+
});
|
|
299
|
+
const handlePress = () => {
|
|
300
|
+
selectionAsync();
|
|
301
|
+
onPress?.();
|
|
302
|
+
};
|
|
303
|
+
const effectiveLeft = leftIcon ? renderIcon(leftIcon, 24, leftIconColor ?? colors.foreground) : leftRender ?? icon;
|
|
304
|
+
const effectiveRight = rightIcon ? renderIcon(rightIcon, 24, rightIconColor ?? colors.foregroundMuted) : rightRender ?? trailing;
|
|
305
|
+
const cardStyle = variant === "card" ? {
|
|
306
|
+
backgroundColor: colors.card,
|
|
307
|
+
borderRadius: RADIUS.md,
|
|
308
|
+
borderWidth: 1,
|
|
309
|
+
borderColor: colors.border,
|
|
310
|
+
shadowColor: "#000",
|
|
311
|
+
shadowOffset: { width: 0, height: 2 },
|
|
312
|
+
shadowOpacity: 0.06,
|
|
313
|
+
shadowRadius: 6,
|
|
314
|
+
elevation: 2
|
|
315
|
+
} : {};
|
|
316
|
+
const a11yLabel = accessibilityLabel ?? [title, subtitle, caption].filter(Boolean).join(". ");
|
|
317
|
+
return /* @__PURE__ */ React3__default.default.createElement(Animated__default.default.View, { style: [animatedStyle, disabled && styles.disabled], ...hoverHandlers }, /* @__PURE__ */ React3__default.default.createElement(
|
|
318
|
+
reactNative.TouchableOpacity,
|
|
319
|
+
{
|
|
320
|
+
style: [styles.container, cardStyle, style],
|
|
321
|
+
onPress: onPress ? handlePress : void 0,
|
|
322
|
+
onPressIn,
|
|
323
|
+
onPressOut,
|
|
324
|
+
disabled,
|
|
325
|
+
activeOpacity: 1,
|
|
326
|
+
touchSoundDisabled: true,
|
|
327
|
+
accessibilityRole: onPress ? "button" : void 0,
|
|
328
|
+
accessibilityLabel: onPress ? a11yLabel : void 0,
|
|
329
|
+
accessibilityState: onPress ? { disabled: !!disabled } : void 0
|
|
330
|
+
},
|
|
331
|
+
effectiveLeft ? /* @__PURE__ */ React3__default.default.createElement(reactNative.View, { style: styles.leftContainer }, effectiveLeft) : null,
|
|
332
|
+
/* @__PURE__ */ React3__default.default.createElement(reactNative.View, { style: styles.content }, /* @__PURE__ */ React3__default.default.createElement(
|
|
333
|
+
reactNative.Text,
|
|
334
|
+
{
|
|
335
|
+
style: [styles.title, { color: colors.foreground }, titleStyle],
|
|
336
|
+
numberOfLines: 2,
|
|
337
|
+
allowFontScaling: true
|
|
338
|
+
},
|
|
339
|
+
title
|
|
340
|
+
), subtitle ? /* @__PURE__ */ React3__default.default.createElement(
|
|
341
|
+
reactNative.Text,
|
|
342
|
+
{
|
|
343
|
+
style: [styles.subtitle, { color: colors.foregroundMuted }, subtitleStyle],
|
|
344
|
+
numberOfLines: 2,
|
|
345
|
+
allowFontScaling: true
|
|
346
|
+
},
|
|
347
|
+
subtitle
|
|
348
|
+
) : null, caption ? /* @__PURE__ */ React3__default.default.createElement(
|
|
349
|
+
reactNative.Text,
|
|
350
|
+
{
|
|
351
|
+
style: [styles.caption, { color: colors.foregroundMuted }, captionStyle],
|
|
352
|
+
numberOfLines: 1,
|
|
353
|
+
allowFontScaling: true
|
|
354
|
+
},
|
|
355
|
+
caption
|
|
356
|
+
) : null),
|
|
357
|
+
effectiveRight !== void 0 ? /* @__PURE__ */ React3__default.default.createElement(reactNative.View, { style: styles.rightContainer }, typeof effectiveRight === "string" ? /* @__PURE__ */ React3__default.default.createElement(
|
|
358
|
+
reactNative.Text,
|
|
359
|
+
{
|
|
360
|
+
style: [styles.rightText, { color: colors.foregroundMuted }],
|
|
361
|
+
allowFontScaling: true
|
|
362
|
+
},
|
|
363
|
+
effectiveRight
|
|
364
|
+
) : effectiveRight) : showChevron ? /* @__PURE__ */ React3__default.default.createElement(vectorIcons.Entypo, { name: "chevron-with-circle-right", size: 20, color: colors.foregroundMuted }) : null
|
|
365
|
+
), showSeparator ? /* @__PURE__ */ React3__default.default.createElement(
|
|
366
|
+
reactNative.View,
|
|
367
|
+
{
|
|
368
|
+
style: [
|
|
369
|
+
styles.separator,
|
|
370
|
+
{ backgroundColor: colors.separator }
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
) : null);
|
|
374
|
+
}
|
|
375
|
+
var ListItem = React3__default.default.memo(ListItemBase);
|
|
376
|
+
var styles = reactNative.StyleSheet.create({
|
|
377
|
+
container: {
|
|
378
|
+
flexDirection: "row",
|
|
379
|
+
alignItems: "center",
|
|
380
|
+
paddingHorizontal: s(16),
|
|
381
|
+
paddingVertical: vs(10),
|
|
382
|
+
gap: s(12)
|
|
383
|
+
},
|
|
384
|
+
leftContainer: {
|
|
385
|
+
width: s(44),
|
|
386
|
+
height: s(44),
|
|
387
|
+
alignItems: "center",
|
|
388
|
+
justifyContent: "center",
|
|
389
|
+
flexShrink: 0
|
|
390
|
+
},
|
|
391
|
+
content: {
|
|
392
|
+
flex: 1,
|
|
393
|
+
gap: vs(4)
|
|
394
|
+
},
|
|
395
|
+
title: {
|
|
396
|
+
fontFamily: "Sohne-Medium",
|
|
397
|
+
fontSize: ms(15),
|
|
398
|
+
lineHeight: mvs(22)
|
|
399
|
+
},
|
|
400
|
+
subtitle: {
|
|
401
|
+
fontFamily: "Sohne-Regular",
|
|
402
|
+
fontSize: ms(13),
|
|
403
|
+
lineHeight: mvs(18)
|
|
404
|
+
},
|
|
405
|
+
caption: {
|
|
406
|
+
fontFamily: "Sohne-Regular",
|
|
407
|
+
fontSize: ms(12),
|
|
408
|
+
lineHeight: mvs(16),
|
|
409
|
+
opacity: 0.7
|
|
410
|
+
},
|
|
411
|
+
rightContainer: {
|
|
412
|
+
alignItems: "flex-end",
|
|
413
|
+
justifyContent: "center",
|
|
414
|
+
flexShrink: 0,
|
|
415
|
+
maxWidth: s(160)
|
|
416
|
+
},
|
|
417
|
+
rightText: {
|
|
418
|
+
fontFamily: "Sohne-Regular",
|
|
419
|
+
fontSize: ms(14)
|
|
420
|
+
},
|
|
421
|
+
separator: {
|
|
422
|
+
height: reactNative.StyleSheet.hairlineWidth,
|
|
423
|
+
marginRight: 0
|
|
424
|
+
},
|
|
425
|
+
disabled: {
|
|
426
|
+
opacity: 0.45
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
exports.ListItem = ListItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ListItem } from './chunk-LG4DO3DK.mjs';
|
|
2
|
+
import './chunk-T7XZ7H7Y.mjs';
|
|
3
|
+
import './chunk-QCNARS3X.mjs';
|
|
4
|
+
import './chunk-RTC3CFXF.mjs';
|
|
5
|
+
import './chunk-5IKW3VNC.mjs';
|
|
6
|
+
import './chunk-QY3X2UYR.mjs';
|
|
7
|
+
import './chunk-SOYNZDVY.mjs';
|
|
8
|
+
import './chunk-2CE3TQVY.mjs';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageSourcePropType, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
type MediaCardAspectRatio = '1:1' | '4:3' | '16:9' | '4:5' | '3:2';
|
|
5
|
+
interface MediaCardProps {
|
|
6
|
+
/** Image source — URI string or require(). */
|
|
7
|
+
imageSource?: ImageSourcePropType;
|
|
8
|
+
/** Image aspect ratio. Defaults to `'4:3'`. */
|
|
9
|
+
aspectRatio?: MediaCardAspectRatio;
|
|
10
|
+
/** Badge content rendered top-left over the image (e.g. a Badge component or Text). */
|
|
11
|
+
badge?: React.ReactNode;
|
|
12
|
+
/** Icon rendered in a circle button top-right over the image. Defaults to `'heart'`. */
|
|
13
|
+
actionIcon?: React.ReactNode;
|
|
14
|
+
/** Icon name for the action button. Overrides `actionIcon`. */
|
|
15
|
+
actionIconName?: string;
|
|
16
|
+
/** Whether the action icon is in active/filled state. */
|
|
17
|
+
actionActive?: boolean;
|
|
18
|
+
/** Called when the top-right action icon is pressed. */
|
|
19
|
+
onActionPress?: () => void;
|
|
20
|
+
/** Primary text below the image. */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** Secondary text below the title. */
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
/** Tertiary / caption text below subtitle. */
|
|
25
|
+
caption?: string;
|
|
26
|
+
/** Called when the card body is pressed. */
|
|
27
|
+
onPress?: () => void;
|
|
28
|
+
style?: ViewStyle;
|
|
29
|
+
/** Style for the image container. */
|
|
30
|
+
imageStyle?: ViewStyle;
|
|
31
|
+
/** Additional content rendered below caption. */
|
|
32
|
+
footer?: React.ReactNode;
|
|
33
|
+
/** Accessibility label override. Defaults to title (and subtitle if present). */
|
|
34
|
+
accessibilityLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
declare function MediaCardBase({ imageSource, aspectRatio, badge, actionIcon, actionIconName, actionActive, onActionPress, title, subtitle, caption, onPress, style, imageStyle, footer, accessibilityLabel, }: MediaCardProps): React.JSX.Element;
|
|
37
|
+
declare const MediaCard: React.MemoExoticComponent<typeof MediaCardBase>;
|
|
38
|
+
|
|
39
|
+
export { MediaCard, type MediaCardAspectRatio, type MediaCardProps };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageSourcePropType, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
type MediaCardAspectRatio = '1:1' | '4:3' | '16:9' | '4:5' | '3:2';
|
|
5
|
+
interface MediaCardProps {
|
|
6
|
+
/** Image source — URI string or require(). */
|
|
7
|
+
imageSource?: ImageSourcePropType;
|
|
8
|
+
/** Image aspect ratio. Defaults to `'4:3'`. */
|
|
9
|
+
aspectRatio?: MediaCardAspectRatio;
|
|
10
|
+
/** Badge content rendered top-left over the image (e.g. a Badge component or Text). */
|
|
11
|
+
badge?: React.ReactNode;
|
|
12
|
+
/** Icon rendered in a circle button top-right over the image. Defaults to `'heart'`. */
|
|
13
|
+
actionIcon?: React.ReactNode;
|
|
14
|
+
/** Icon name for the action button. Overrides `actionIcon`. */
|
|
15
|
+
actionIconName?: string;
|
|
16
|
+
/** Whether the action icon is in active/filled state. */
|
|
17
|
+
actionActive?: boolean;
|
|
18
|
+
/** Called when the top-right action icon is pressed. */
|
|
19
|
+
onActionPress?: () => void;
|
|
20
|
+
/** Primary text below the image. */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** Secondary text below the title. */
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
/** Tertiary / caption text below subtitle. */
|
|
25
|
+
caption?: string;
|
|
26
|
+
/** Called when the card body is pressed. */
|
|
27
|
+
onPress?: () => void;
|
|
28
|
+
style?: ViewStyle;
|
|
29
|
+
/** Style for the image container. */
|
|
30
|
+
imageStyle?: ViewStyle;
|
|
31
|
+
/** Additional content rendered below caption. */
|
|
32
|
+
footer?: React.ReactNode;
|
|
33
|
+
/** Accessibility label override. Defaults to title (and subtitle if present). */
|
|
34
|
+
accessibilityLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
declare function MediaCardBase({ imageSource, aspectRatio, badge, actionIcon, actionIconName, actionActive, onActionPress, title, subtitle, caption, onPress, style, imageStyle, footer, accessibilityLabel, }: MediaCardProps): React.JSX.Element;
|
|
37
|
+
declare const MediaCard: React.MemoExoticComponent<typeof MediaCardBase>;
|
|
38
|
+
|
|
39
|
+
export { MediaCard, type MediaCardAspectRatio, type MediaCardProps };
|