@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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
2
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
|
+
import { ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
7
|
+
import { FontAwesome5, MaterialIcons, Entypo } from '@expo/vector-icons';
|
|
8
|
+
|
|
9
|
+
function AlertBanner({ title, description, variant = "default", icon, iconName, iconColor, style }) {
|
|
10
|
+
const { colors, colorScheme } = useTheme();
|
|
11
|
+
const isDark = colorScheme === "dark";
|
|
12
|
+
const accentColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : variant === "warning" ? colors.warning : colors.foreground;
|
|
13
|
+
const bgColor = variant === "destructive" ? isDark ? "rgba(239, 83, 80, 0.15)" : "rgba(199, 40, 40, 0.10)" : variant === "success" ? isDark ? "rgba(46, 125, 82, 0.15)" : "rgba(26, 122, 69, 0.10)" : variant === "warning" ? isDark ? "rgba(245, 166, 35, 0.15)" : "rgba(154, 82, 0, 0.10)" : colors.surface;
|
|
14
|
+
const borderColor = variant === "destructive" ? isDark ? "rgba(239, 83, 80, 0.30)" : "rgba(199, 40, 40, 0.25)" : variant === "success" ? isDark ? "rgba(46, 125, 82, 0.30)" : "rgba(26, 122, 69, 0.25)" : variant === "warning" ? isDark ? "rgba(245, 166, 35, 0.30)" : "rgba(154, 82, 0, 0.25)" : colors.border;
|
|
15
|
+
const defaultIcon = variant === "success" ? /* @__PURE__ */ React.createElement(FontAwesome5, { name: "check-circle", size: ms(16), color: accentColor }) : variant === "destructive" ? /* @__PURE__ */ React.createElement(MaterialIcons, { name: "error-outline", size: ms(17), color: accentColor }) : variant === "warning" ? /* @__PURE__ */ React.createElement(MaterialIcons, { name: "warning-amber", size: ms(17), color: accentColor }) : (
|
|
16
|
+
// AUDIT FIX: default variant previously used colors.primary (near-black)
|
|
17
|
+
// as the info icon tint — ambiguous and heavy. accentResolved gives it
|
|
18
|
+
// a meaningful chromatic signal when an accent is defined.
|
|
19
|
+
/* @__PURE__ */ React.createElement(Entypo, { name: "info-with-circle", size: ms(16), color: accentColor })
|
|
20
|
+
);
|
|
21
|
+
const effectiveIcon = iconName ? renderIcon(iconName, ms(16), iconColor ?? accentColor) : icon ?? defaultIcon;
|
|
22
|
+
return /* @__PURE__ */ React.createElement(
|
|
23
|
+
View,
|
|
24
|
+
{
|
|
25
|
+
style: [
|
|
26
|
+
styles.container,
|
|
27
|
+
{ backgroundColor: bgColor, borderWidth: 1, borderColor },
|
|
28
|
+
style
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.iconSlot }, effectiveIcon),
|
|
32
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.content }, /* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: colors.foreground }], allowFontScaling: true }, title), description ? /* @__PURE__ */ React.createElement(Text, { style: [styles.description, { color: colors.foreground, opacity: 0.85 }], allowFontScaling: true }, description) : null)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
var styles = StyleSheet.create({
|
|
36
|
+
container: {
|
|
37
|
+
flexDirection: "row",
|
|
38
|
+
alignItems: "flex-start",
|
|
39
|
+
borderRadius: RADIUS.lg,
|
|
40
|
+
gap: s(8),
|
|
41
|
+
paddingVertical: vs(10),
|
|
42
|
+
paddingHorizontal: s(12)
|
|
43
|
+
},
|
|
44
|
+
iconSlot: {
|
|
45
|
+
marginTop: vs(1)
|
|
46
|
+
},
|
|
47
|
+
content: {
|
|
48
|
+
flex: 1,
|
|
49
|
+
gap: vs(2)
|
|
50
|
+
},
|
|
51
|
+
title: {
|
|
52
|
+
fontFamily: "Sohne-Medium",
|
|
53
|
+
fontSize: ms(13)
|
|
54
|
+
},
|
|
55
|
+
description: {
|
|
56
|
+
fontFamily: "Sohne-Regular",
|
|
57
|
+
fontSize: ms(12)
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export { AlertBanner };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
2
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
3
|
+
import { vs, s } from './chunk-2CE3TQVY.mjs';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
6
|
+
|
|
7
|
+
function ListGroup({ children, variant = "plain", style }) {
|
|
8
|
+
const { colors } = useTheme();
|
|
9
|
+
const processedChildren = React.Children.map(children, (child, index) => {
|
|
10
|
+
if (!React.isValidElement(child)) return child;
|
|
11
|
+
if (child.type === ListGroupHeader || child.type === ListGroupFooter) {
|
|
12
|
+
return child;
|
|
13
|
+
}
|
|
14
|
+
const childProps = child.props;
|
|
15
|
+
const isListItem = "title" in childProps;
|
|
16
|
+
if (!isListItem) return child;
|
|
17
|
+
const isLast = index === React.Children.count(children) - 1;
|
|
18
|
+
if (childProps["showSeparator"] === void 0 && !isLast) {
|
|
19
|
+
return React.cloneElement(child, {
|
|
20
|
+
showSeparator: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return child;
|
|
24
|
+
});
|
|
25
|
+
const cardStyle = variant === "card" ? {
|
|
26
|
+
backgroundColor: colors.card,
|
|
27
|
+
borderRadius: RADIUS.md,
|
|
28
|
+
borderWidth: 1,
|
|
29
|
+
borderColor: colors.border,
|
|
30
|
+
shadowColor: "#000",
|
|
31
|
+
shadowOffset: { width: 0, height: 2 },
|
|
32
|
+
shadowOpacity: 0.06,
|
|
33
|
+
shadowRadius: 6,
|
|
34
|
+
elevation: 2,
|
|
35
|
+
paddingVertical: vs(4)
|
|
36
|
+
} : {};
|
|
37
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.container, cardStyle, style] }, processedChildren);
|
|
38
|
+
}
|
|
39
|
+
function ListGroupHeader({ children, style }) {
|
|
40
|
+
const { colors } = useTheme();
|
|
41
|
+
if (typeof children === "string") {
|
|
42
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.header, { borderBottomColor: colors.separator }, style] }, /* @__PURE__ */ React.createElement(Text, { style: [styles.headerText, { color: colors.foregroundMuted }], allowFontScaling: true }, children));
|
|
43
|
+
}
|
|
44
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.header, { borderBottomColor: colors.separator }, style] }, children);
|
|
45
|
+
}
|
|
46
|
+
function ListGroupFooter({ children, style }) {
|
|
47
|
+
const { colors } = useTheme();
|
|
48
|
+
if (typeof children === "string") {
|
|
49
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.footer, style] }, /* @__PURE__ */ React.createElement(Text, { style: [styles.footerText, { color: colors.foregroundMuted }], allowFontScaling: true }, children));
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.footer, style] }, children);
|
|
52
|
+
}
|
|
53
|
+
ListGroup.Header = ListGroupHeader;
|
|
54
|
+
ListGroup.Footer = ListGroupFooter;
|
|
55
|
+
var styles = StyleSheet.create({
|
|
56
|
+
container: {
|
|
57
|
+
overflow: "hidden"
|
|
58
|
+
},
|
|
59
|
+
header: {
|
|
60
|
+
paddingHorizontal: s(16),
|
|
61
|
+
paddingTop: vs(12),
|
|
62
|
+
paddingBottom: vs(8),
|
|
63
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
64
|
+
},
|
|
65
|
+
headerText: {
|
|
66
|
+
fontFamily: "Sohne-SemiBold",
|
|
67
|
+
fontSize: 13,
|
|
68
|
+
letterSpacing: 0.32,
|
|
69
|
+
textTransform: "uppercase"
|
|
70
|
+
},
|
|
71
|
+
footer: {
|
|
72
|
+
paddingHorizontal: s(16),
|
|
73
|
+
paddingTop: vs(8),
|
|
74
|
+
paddingBottom: vs(12)
|
|
75
|
+
},
|
|
76
|
+
footerText: {
|
|
77
|
+
fontFamily: "Sohne-Regular",
|
|
78
|
+
fontSize: 12
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export { ListGroup, ListGroupFooter, ListGroupHeader };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React, { createContext, useMemo, useContext } from 'react';
|
|
2
|
+
import { useColorScheme } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// src/theme/colorUtils.ts
|
|
5
|
+
function hexToRgb(hex) {
|
|
6
|
+
const clean = hex.replace("#", "");
|
|
7
|
+
const full = clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean;
|
|
8
|
+
if (full.length !== 6) return null;
|
|
9
|
+
return {
|
|
10
|
+
r: parseInt(full.slice(0, 2), 16),
|
|
11
|
+
g: parseInt(full.slice(2, 4), 16),
|
|
12
|
+
b: parseInt(full.slice(4, 6), 16)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function componentToHex(c) {
|
|
16
|
+
return Math.round(Math.max(0, Math.min(255, c))).toString(16).padStart(2, "0");
|
|
17
|
+
}
|
|
18
|
+
function rgbToHex(r, g, b) {
|
|
19
|
+
return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
|
|
20
|
+
}
|
|
21
|
+
function withAlphaOnWhite(hex, alpha) {
|
|
22
|
+
const rgb = hexToRgb(hex);
|
|
23
|
+
if (!rgb) return hex;
|
|
24
|
+
const r = rgb.r * alpha + 255 * (1 - alpha);
|
|
25
|
+
const g = rgb.g * alpha + 255 * (1 - alpha);
|
|
26
|
+
const b = rgb.b * alpha + 255 * (1 - alpha);
|
|
27
|
+
return rgbToHex(r, g, b);
|
|
28
|
+
}
|
|
29
|
+
function withAlphaOnDark(hex, alpha, bgHex = "#0f0f0f") {
|
|
30
|
+
const rgb = hexToRgb(hex);
|
|
31
|
+
const bg = hexToRgb(bgHex);
|
|
32
|
+
if (!rgb || !bg) return hex;
|
|
33
|
+
const r = rgb.r * alpha + bg.r * (1 - alpha);
|
|
34
|
+
const g = rgb.g * alpha + bg.g * (1 - alpha);
|
|
35
|
+
const b = rgb.b * alpha + bg.b * (1 - alpha);
|
|
36
|
+
return rgbToHex(r, g, b);
|
|
37
|
+
}
|
|
38
|
+
function mixWithBackground(fgHex, bgHex, opacity) {
|
|
39
|
+
const fg = hexToRgb(fgHex);
|
|
40
|
+
const bg = hexToRgb(bgHex);
|
|
41
|
+
if (!fg || !bg) return fgHex;
|
|
42
|
+
const r = fg.r * opacity + bg.r * (1 - opacity);
|
|
43
|
+
const g = fg.g * opacity + bg.g * (1 - opacity);
|
|
44
|
+
const b = fg.b * opacity + bg.b * (1 - opacity);
|
|
45
|
+
return rgbToHex(r, g, b);
|
|
46
|
+
}
|
|
47
|
+
function lighten(hex, amount) {
|
|
48
|
+
return withAlphaOnWhite(hex, 1 - amount);
|
|
49
|
+
}
|
|
50
|
+
function darken(hex, amount) {
|
|
51
|
+
const rgb = hexToRgb(hex);
|
|
52
|
+
if (!rgb) return hex;
|
|
53
|
+
return rgbToHex(rgb.r * (1 - amount), rgb.g * (1 - amount), rgb.b * (1 - amount));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/theme/colors.ts
|
|
57
|
+
var defaultLight = {
|
|
58
|
+
background: "#ffffff",
|
|
59
|
+
foreground: "#1a1a1a",
|
|
60
|
+
card: "#ffffff",
|
|
61
|
+
primary: "#1a1a1a",
|
|
62
|
+
primaryForeground: "#ffffff",
|
|
63
|
+
// AUDIT FIX: brand accent — was undefined; falls back to primary when omitted
|
|
64
|
+
accent: "#d4561d",
|
|
65
|
+
accentForeground: "#ffffff",
|
|
66
|
+
border: "#dddddd",
|
|
67
|
+
// AUDIT FIX: was #e53935 (4.22:1 on white — fails AA); #c72828 = 5.59:1 ✓
|
|
68
|
+
destructive: "#c72828",
|
|
69
|
+
destructiveForeground: "#ffffff",
|
|
70
|
+
success: "#1a7a45",
|
|
71
|
+
successForeground: "#ffffff",
|
|
72
|
+
// AUDIT FIX: was #e67e00 (2.86:1 — severe fail); #9a5200 = 5.86:1 ✓ AAA-near
|
|
73
|
+
warning: "#9a5200",
|
|
74
|
+
warningForeground: "#ffffff"
|
|
75
|
+
};
|
|
76
|
+
var defaultDark = {
|
|
77
|
+
background: "#0f0f0f",
|
|
78
|
+
foreground: "#fafafa",
|
|
79
|
+
card: "#1c1c1c",
|
|
80
|
+
primary: "#fafafa",
|
|
81
|
+
primaryForeground: "#0f0f0f",
|
|
82
|
+
// AUDIT FIX: lighter accent for dark surfaces (warm amber-orange)
|
|
83
|
+
accent: "#e87645",
|
|
84
|
+
accentForeground: "#ffffff",
|
|
85
|
+
border: "#303030",
|
|
86
|
+
destructive: "#ef5350",
|
|
87
|
+
destructiveForeground: "#ffffff",
|
|
88
|
+
success: "#2e7d52",
|
|
89
|
+
successForeground: "#ffffff",
|
|
90
|
+
// AUDIT FIX: brighter amber for dark-bg visibility; dark text for contrast
|
|
91
|
+
// #f5a623 on #0f0f0f = 8.6:1 ✓ as indicator; #0f0f0f text on #f5a623 = 8.6:1 ✓
|
|
92
|
+
warning: "#f5a623",
|
|
93
|
+
warningForeground: "#0f0f0f"
|
|
94
|
+
};
|
|
95
|
+
function deriveColors(t, scheme) {
|
|
96
|
+
const dark = scheme === "dark";
|
|
97
|
+
const bg = t.background;
|
|
98
|
+
const foregroundSubtle = mixWithBackground(t.foreground, bg, 0.7);
|
|
99
|
+
const foregroundMuted = mixWithBackground(t.foreground, bg, 0.62);
|
|
100
|
+
const surface = dark ? lighten(bg, -0.06) : darken(bg, 0.04);
|
|
101
|
+
const surfaceStrong = dark ? lighten(bg, -0.12) : darken(bg, 0.08);
|
|
102
|
+
const destructiveTint = dark ? withAlphaOnDark(t.destructive, 0.15, bg) : withAlphaOnWhite(t.destructive, 0.08);
|
|
103
|
+
const destructiveBorder = dark ? withAlphaOnDark(t.destructive, 0.45, bg) : withAlphaOnWhite(t.destructive, 0.3);
|
|
104
|
+
const successTint = dark ? withAlphaOnDark(t.success, 0.15, bg) : withAlphaOnWhite(t.success, 0.08);
|
|
105
|
+
const successBorder = dark ? withAlphaOnDark(t.success, 0.45, bg) : withAlphaOnWhite(t.success, 0.3);
|
|
106
|
+
const warningTint = dark ? withAlphaOnDark(t.warning, 0.15, bg) : withAlphaOnWhite(t.warning, 0.08);
|
|
107
|
+
const warningBorder = dark ? withAlphaOnDark(t.warning, 0.45, bg) : withAlphaOnWhite(t.warning, 0.3);
|
|
108
|
+
return {
|
|
109
|
+
...t,
|
|
110
|
+
foregroundSubtle,
|
|
111
|
+
foregroundMuted,
|
|
112
|
+
surface,
|
|
113
|
+
surfaceStrong,
|
|
114
|
+
destructiveTint,
|
|
115
|
+
destructiveBorder,
|
|
116
|
+
successTint,
|
|
117
|
+
successBorder,
|
|
118
|
+
warningTint,
|
|
119
|
+
warningBorder,
|
|
120
|
+
overlay: t.overlay ?? "rgba(0,0,0,0.45)",
|
|
121
|
+
accentResolved: t.accent ?? t.primary,
|
|
122
|
+
accentForegroundResolved: t.accentForeground ?? t.primaryForeground,
|
|
123
|
+
ring: t.accent ?? t.primary,
|
|
124
|
+
input: t.border,
|
|
125
|
+
separator: dark ? lighten(t.border, 0.22) : darken(t.border, 0.16)
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
var ThemeContext = createContext({
|
|
129
|
+
colors: deriveColors(defaultLight, "light"),
|
|
130
|
+
colorScheme: "light"
|
|
131
|
+
});
|
|
132
|
+
function ThemeProvider({ children, theme, colorScheme = "system" }) {
|
|
133
|
+
const systemScheme = useColorScheme() ?? "light";
|
|
134
|
+
const resolvedScheme = colorScheme === "system" ? systemScheme : colorScheme;
|
|
135
|
+
const colors = useMemo(() => {
|
|
136
|
+
const base = resolvedScheme === "dark" ? defaultDark : defaultLight;
|
|
137
|
+
const override = resolvedScheme === "dark" ? theme?.dark : theme?.light;
|
|
138
|
+
const merged = override ? { ...base, ...override } : base;
|
|
139
|
+
return deriveColors(merged, resolvedScheme);
|
|
140
|
+
}, [resolvedScheme, theme]);
|
|
141
|
+
return /* @__PURE__ */ React.createElement(ThemeContext.Provider, { value: { colors, colorScheme: resolvedScheme } }, children);
|
|
142
|
+
}
|
|
143
|
+
function useTheme() {
|
|
144
|
+
const context = useContext(ThemeContext);
|
|
145
|
+
if (!context) {
|
|
146
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
147
|
+
}
|
|
148
|
+
return context;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { ThemeProvider, defaultDark, defaultLight, deriveColors, useTheme };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import AntDesign from '@expo/vector-icons/AntDesign';
|
|
3
|
+
import Entypo from '@expo/vector-icons/Entypo';
|
|
4
|
+
import Feather from '@expo/vector-icons/Feather';
|
|
5
|
+
import FontAwesome5 from '@expo/vector-icons/FontAwesome5';
|
|
6
|
+
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
|
7
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
8
|
+
|
|
9
|
+
// src/utils/icons.ts
|
|
10
|
+
var glyphMapOf = (mod) => mod.glyphMap ?? {};
|
|
11
|
+
var ALL_FAMILIES = [
|
|
12
|
+
{ name: "Ionicons", component: Ionicons, getGlyphMap: () => glyphMapOf(Ionicons) },
|
|
13
|
+
{ name: "MaterialIcons", component: MaterialIcons, getGlyphMap: () => glyphMapOf(MaterialIcons) },
|
|
14
|
+
{ name: "FontAwesome5", component: FontAwesome5, getGlyphMap: () => glyphMapOf(FontAwesome5) },
|
|
15
|
+
{ name: "Entypo", component: Entypo, getGlyphMap: () => glyphMapOf(Entypo) },
|
|
16
|
+
{ name: "AntDesign", component: AntDesign, getGlyphMap: () => glyphMapOf(AntDesign) },
|
|
17
|
+
{ name: "Feather", component: Feather, getGlyphMap: () => glyphMapOf(Feather) }
|
|
18
|
+
];
|
|
19
|
+
var activeFamilies = ALL_FAMILIES;
|
|
20
|
+
var resolvedCache = null;
|
|
21
|
+
function configureIconFamilies(families) {
|
|
22
|
+
const order = families.map((n) => ALL_FAMILIES.find((f) => f.name === n)).filter((f) => f !== void 0);
|
|
23
|
+
activeFamilies = order.length > 0 ? order : ALL_FAMILIES;
|
|
24
|
+
resolvedCache = null;
|
|
25
|
+
}
|
|
26
|
+
function buildCache() {
|
|
27
|
+
const cache = /* @__PURE__ */ new Map();
|
|
28
|
+
for (const family of activeFamilies) {
|
|
29
|
+
const glyphMap = family.getGlyphMap();
|
|
30
|
+
for (const iconName of Object.keys(glyphMap)) {
|
|
31
|
+
cache.set(iconName, family);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return cache;
|
|
35
|
+
}
|
|
36
|
+
function resolveFamily(name) {
|
|
37
|
+
if (!resolvedCache) {
|
|
38
|
+
resolvedCache = buildCache();
|
|
39
|
+
}
|
|
40
|
+
return resolvedCache.get(name) ?? null;
|
|
41
|
+
}
|
|
42
|
+
function Icon({ name, size, color, family }) {
|
|
43
|
+
let resolved = null;
|
|
44
|
+
if (family) {
|
|
45
|
+
resolved = ALL_FAMILIES.find((f) => f.name === family) ?? null;
|
|
46
|
+
} else {
|
|
47
|
+
resolved = resolveFamily(name);
|
|
48
|
+
}
|
|
49
|
+
if (!resolved) return null;
|
|
50
|
+
const Component = resolved.component;
|
|
51
|
+
return React.createElement(Component, { name, size, color });
|
|
52
|
+
}
|
|
53
|
+
function renderIcon(name, size, color) {
|
|
54
|
+
return React.createElement(Icon, { name, size, color });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { Icon, configureIconFamilies, renderIcon };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
2
|
+
import { useHover, usePressScale } from './chunk-QCNARS3X.mjs';
|
|
3
|
+
import { impactLight } from './chunk-RTC3CFXF.mjs';
|
|
4
|
+
import { SPRINGS, PRESS_SCALE } from './chunk-5IKW3VNC.mjs';
|
|
5
|
+
import { RADIUS, SHADOWS } from './chunk-QY3X2UYR.mjs';
|
|
6
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
7
|
+
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { StyleSheet, View, Platform, Image, TouchableOpacity, Text } from 'react-native';
|
|
10
|
+
import Animated from 'react-native-reanimated';
|
|
11
|
+
|
|
12
|
+
var aspectRatioMap = {
|
|
13
|
+
"1:1": 1,
|
|
14
|
+
"4:3": 3 / 4,
|
|
15
|
+
"16:9": 9 / 16,
|
|
16
|
+
"4:5": 5 / 4,
|
|
17
|
+
"3:2": 2 / 3
|
|
18
|
+
};
|
|
19
|
+
function MediaCardBase({
|
|
20
|
+
imageSource,
|
|
21
|
+
aspectRatio = "4:3",
|
|
22
|
+
badge,
|
|
23
|
+
actionIcon,
|
|
24
|
+
actionIconName,
|
|
25
|
+
actionActive = false,
|
|
26
|
+
onActionPress,
|
|
27
|
+
title,
|
|
28
|
+
subtitle,
|
|
29
|
+
caption,
|
|
30
|
+
onPress,
|
|
31
|
+
style,
|
|
32
|
+
imageStyle,
|
|
33
|
+
footer,
|
|
34
|
+
accessibilityLabel
|
|
35
|
+
}) {
|
|
36
|
+
const { colors } = useTheme();
|
|
37
|
+
const { hovered, hoverHandlers } = useHover();
|
|
38
|
+
const { animatedStyle, onPressIn, onPressOut } = usePressScale({
|
|
39
|
+
pressScale: PRESS_SCALE.card,
|
|
40
|
+
pressInSpring: SPRINGS.surfacePressIn,
|
|
41
|
+
pressOutSpring: SPRINGS.surfacePressOut,
|
|
42
|
+
disabled: !onPress
|
|
43
|
+
});
|
|
44
|
+
const handlePress = () => {
|
|
45
|
+
if (!onPress) return;
|
|
46
|
+
impactLight();
|
|
47
|
+
onPress();
|
|
48
|
+
};
|
|
49
|
+
const ratio = aspectRatioMap[aspectRatio];
|
|
50
|
+
const resolvedActionIcon = actionIconName ? renderIcon(actionIconName, 18, actionActive ? colors.primary : colors.background) : actionIcon ?? renderIcon("heart", 18, actionActive ? colors.primary : colors.background);
|
|
51
|
+
const a11yLabel = accessibilityLabel ?? [title, subtitle].filter(Boolean).join(". ");
|
|
52
|
+
const cardContent = /* @__PURE__ */ React.createElement(
|
|
53
|
+
View,
|
|
54
|
+
{
|
|
55
|
+
style: [
|
|
56
|
+
styles.card,
|
|
57
|
+
hovered && styles.cardHovered,
|
|
58
|
+
style
|
|
59
|
+
],
|
|
60
|
+
...Platform.OS === "web" ? hoverHandlers : {}
|
|
61
|
+
},
|
|
62
|
+
/* @__PURE__ */ React.createElement(View, { style: [styles.imageContainer, imageStyle] }, /* @__PURE__ */ React.createElement(View, { style: { paddingTop: `${ratio * 100}%` } }, /* @__PURE__ */ React.createElement(View, { style: StyleSheet.absoluteFill }, imageSource ? /* @__PURE__ */ React.createElement(
|
|
63
|
+
Image,
|
|
64
|
+
{
|
|
65
|
+
source: imageSource,
|
|
66
|
+
style: styles.image,
|
|
67
|
+
resizeMode: "cover"
|
|
68
|
+
}
|
|
69
|
+
) : /* @__PURE__ */ React.createElement(View, { style: [styles.imagePlaceholder, { backgroundColor: colors.surface }] }))), badge && /* @__PURE__ */ React.createElement(View, { style: styles.badgeContainer }, badge), (onActionPress || actionIcon || actionIconName) && /* @__PURE__ */ React.createElement(
|
|
70
|
+
TouchableOpacity,
|
|
71
|
+
{
|
|
72
|
+
style: [styles.actionButton, { backgroundColor: "rgba(0,0,0,0.24)" }],
|
|
73
|
+
onPress: () => {
|
|
74
|
+
impactLight();
|
|
75
|
+
onActionPress?.();
|
|
76
|
+
},
|
|
77
|
+
activeOpacity: 0.8,
|
|
78
|
+
touchSoundDisabled: true,
|
|
79
|
+
accessibilityRole: "button",
|
|
80
|
+
accessibilityLabel: actionIconName ?? "action",
|
|
81
|
+
accessibilityState: { selected: actionActive }
|
|
82
|
+
},
|
|
83
|
+
resolvedActionIcon
|
|
84
|
+
)),
|
|
85
|
+
(title || subtitle || caption || footer) && /* @__PURE__ */ React.createElement(View, { style: styles.meta }, title ? /* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: colors.foreground }], numberOfLines: 2, allowFontScaling: true }, title) : null, subtitle ? /* @__PURE__ */ React.createElement(Text, { style: [styles.subtitle, { color: colors.foregroundSubtle }], numberOfLines: 1, allowFontScaling: true }, subtitle) : null, caption ? /* @__PURE__ */ React.createElement(Text, { style: [styles.caption, { color: colors.foregroundMuted }], numberOfLines: 1, allowFontScaling: true }, caption) : null, footer)
|
|
86
|
+
);
|
|
87
|
+
if (onPress) {
|
|
88
|
+
return /* @__PURE__ */ React.createElement(Animated.View, { style: animatedStyle }, /* @__PURE__ */ React.createElement(
|
|
89
|
+
TouchableOpacity,
|
|
90
|
+
{
|
|
91
|
+
onPress: handlePress,
|
|
92
|
+
onPressIn,
|
|
93
|
+
onPressOut,
|
|
94
|
+
activeOpacity: 1,
|
|
95
|
+
touchSoundDisabled: true,
|
|
96
|
+
accessibilityRole: "button",
|
|
97
|
+
accessibilityLabel: a11yLabel
|
|
98
|
+
},
|
|
99
|
+
cardContent
|
|
100
|
+
));
|
|
101
|
+
}
|
|
102
|
+
return cardContent;
|
|
103
|
+
}
|
|
104
|
+
var MediaCard = React.memo(MediaCardBase);
|
|
105
|
+
var styles = StyleSheet.create({
|
|
106
|
+
card: {
|
|
107
|
+
borderRadius: RADIUS.md,
|
|
108
|
+
overflow: "hidden",
|
|
109
|
+
backgroundColor: "transparent"
|
|
110
|
+
},
|
|
111
|
+
cardHovered: {
|
|
112
|
+
...SHADOWS.md
|
|
113
|
+
},
|
|
114
|
+
imageContainer: {
|
|
115
|
+
borderRadius: RADIUS.md,
|
|
116
|
+
overflow: "hidden"
|
|
117
|
+
},
|
|
118
|
+
image: {
|
|
119
|
+
width: "100%",
|
|
120
|
+
height: "100%"
|
|
121
|
+
},
|
|
122
|
+
imagePlaceholder: {
|
|
123
|
+
width: "100%",
|
|
124
|
+
height: "100%"
|
|
125
|
+
},
|
|
126
|
+
badgeContainer: {
|
|
127
|
+
position: "absolute",
|
|
128
|
+
top: s(8),
|
|
129
|
+
left: s(8)
|
|
130
|
+
},
|
|
131
|
+
actionButton: {
|
|
132
|
+
position: "absolute",
|
|
133
|
+
top: s(8),
|
|
134
|
+
right: s(8),
|
|
135
|
+
width: s(32),
|
|
136
|
+
height: s(32),
|
|
137
|
+
borderRadius: 9999,
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
justifyContent: "center"
|
|
140
|
+
},
|
|
141
|
+
meta: {
|
|
142
|
+
paddingTop: vs(8),
|
|
143
|
+
paddingBottom: vs(4),
|
|
144
|
+
gap: vs(2)
|
|
145
|
+
},
|
|
146
|
+
title: {
|
|
147
|
+
fontFamily: "Sohne-SemiBold",
|
|
148
|
+
fontSize: ms(14),
|
|
149
|
+
lineHeight: mvs(20)
|
|
150
|
+
},
|
|
151
|
+
subtitle: {
|
|
152
|
+
fontFamily: "Sohne-Regular",
|
|
153
|
+
fontSize: ms(13),
|
|
154
|
+
lineHeight: mvs(18)
|
|
155
|
+
},
|
|
156
|
+
caption: {
|
|
157
|
+
fontFamily: "Sohne-Regular",
|
|
158
|
+
fontSize: ms(12),
|
|
159
|
+
lineHeight: mvs(16)
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export { MediaCard };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useColorTransition } from './chunk-7H2OR44A.mjs';
|
|
2
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
|
+
import { usePressScale } from './chunk-QCNARS3X.mjs';
|
|
4
|
+
import { selectionAsync } from './chunk-RTC3CFXF.mjs';
|
|
5
|
+
import { PRESS_SCALE } from './chunk-5IKW3VNC.mjs';
|
|
6
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
7
|
+
import { s, mvs, ms, vs } from './chunk-2CE3TQVY.mjs';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
10
|
+
import Animated, { useAnimatedStyle, interpolateColor } from 'react-native-reanimated';
|
|
11
|
+
|
|
12
|
+
function ChipBase({ label, selected = false, onPress, icon, iconName, style, accessibilityLabel }) {
|
|
13
|
+
const { colors } = useTheme();
|
|
14
|
+
const { animatedStyle: scaleStyle, onPressIn, onPressOut, hoverHandlers } = usePressScale({
|
|
15
|
+
pressScale: PRESS_SCALE.chip
|
|
16
|
+
});
|
|
17
|
+
const colorProgress = useColorTransition(selected);
|
|
18
|
+
const surfaceStyle = useAnimatedStyle(() => ({
|
|
19
|
+
backgroundColor: interpolateColor(colorProgress.value, [0, 1], [colors.surface, colors.primary]),
|
|
20
|
+
borderColor: interpolateColor(colorProgress.value, [0, 1], [colors.border, colors.primary])
|
|
21
|
+
}));
|
|
22
|
+
const textStyle = useAnimatedStyle(() => ({
|
|
23
|
+
color: interpolateColor(colorProgress.value, [0, 1], [colors.foreground, colors.primaryForeground])
|
|
24
|
+
}));
|
|
25
|
+
const handlePress = () => {
|
|
26
|
+
selectionAsync();
|
|
27
|
+
onPress?.();
|
|
28
|
+
};
|
|
29
|
+
const resolvedIcon = iconName ? renderIcon(iconName, ms(13), selected ? colors.primaryForeground : colors.foreground) : icon;
|
|
30
|
+
return /* @__PURE__ */ React.createElement(Animated.View, { style: [styles.wrapper, scaleStyle, style], ...hoverHandlers }, /* @__PURE__ */ React.createElement(
|
|
31
|
+
TouchableOpacity,
|
|
32
|
+
{
|
|
33
|
+
onPress: handlePress,
|
|
34
|
+
onPressIn,
|
|
35
|
+
onPressOut,
|
|
36
|
+
activeOpacity: 1,
|
|
37
|
+
touchSoundDisabled: true,
|
|
38
|
+
accessibilityRole: "button",
|
|
39
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
40
|
+
accessibilityState: { selected }
|
|
41
|
+
},
|
|
42
|
+
/* @__PURE__ */ React.createElement(Animated.View, { style: [styles.chip, surfaceStyle] }, resolvedIcon ? /* @__PURE__ */ React.createElement(View, { style: styles.chipIcon }, resolvedIcon) : null, /* @__PURE__ */ React.createElement(Animated.Text, { style: [styles.label, textStyle], allowFontScaling: true }, label))
|
|
43
|
+
));
|
|
44
|
+
}
|
|
45
|
+
var Chip = React.memo(ChipBase);
|
|
46
|
+
function ChipGroup({ options, value, onValueChange, multiSelect = false, style }) {
|
|
47
|
+
const handlePress = (optionValue) => {
|
|
48
|
+
if (!multiSelect) {
|
|
49
|
+
onValueChange?.(optionValue);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const currentArray = Array.isArray(value) ? value : value ? [value] : [];
|
|
53
|
+
const isSelected2 = currentArray.includes(optionValue);
|
|
54
|
+
const newArray = isSelected2 ? currentArray.filter((v) => v !== optionValue) : [...currentArray, optionValue];
|
|
55
|
+
onValueChange?.(newArray);
|
|
56
|
+
};
|
|
57
|
+
const isSelected = (optionValue) => {
|
|
58
|
+
if (Array.isArray(value)) return value.includes(optionValue);
|
|
59
|
+
return optionValue === value;
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.group, style] }, options.map((opt) => /* @__PURE__ */ React.createElement(
|
|
62
|
+
Chip,
|
|
63
|
+
{
|
|
64
|
+
key: opt.value,
|
|
65
|
+
label: opt.label,
|
|
66
|
+
selected: isSelected(opt.value),
|
|
67
|
+
onPress: opt.disabled ? void 0 : () => handlePress(opt.value),
|
|
68
|
+
iconName: opt.iconName,
|
|
69
|
+
style: opt.disabled ? styles.chipDisabled : void 0,
|
|
70
|
+
accessibilityLabel: opt.disabled ? `${opt.label}, unavailable` : opt.label
|
|
71
|
+
}
|
|
72
|
+
)));
|
|
73
|
+
}
|
|
74
|
+
var styles = StyleSheet.create({
|
|
75
|
+
wrapper: {},
|
|
76
|
+
chip: {
|
|
77
|
+
borderRadius: 999,
|
|
78
|
+
paddingHorizontal: s(14),
|
|
79
|
+
// AUDIT FIX: was vs(5) → ~28px total height — below WCAG 44px tap target.
|
|
80
|
+
// vs(10) → ~44px total height meets WCAG 2.5.5 (AAA) minimum.
|
|
81
|
+
paddingVertical: vs(10),
|
|
82
|
+
minHeight: 44,
|
|
83
|
+
borderWidth: 1,
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
justifyContent: "center",
|
|
86
|
+
flexDirection: "row",
|
|
87
|
+
gap: s(5)
|
|
88
|
+
},
|
|
89
|
+
chipDisabled: {
|
|
90
|
+
opacity: 0.4
|
|
91
|
+
},
|
|
92
|
+
chipIcon: {
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
justifyContent: "center"
|
|
95
|
+
},
|
|
96
|
+
label: {
|
|
97
|
+
fontFamily: "Sohne-Medium",
|
|
98
|
+
fontSize: ms(13),
|
|
99
|
+
lineHeight: mvs(18)
|
|
100
|
+
},
|
|
101
|
+
group: {
|
|
102
|
+
flexDirection: "row",
|
|
103
|
+
flexWrap: "wrap",
|
|
104
|
+
gap: s(8)
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export { Chip, ChipGroup };
|