feat(smart-app): implement complete mobile app MVP

- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

View File

@@ -0,0 +1,228 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _useLatestCallback = _interopRequireDefault(require("use-latest-callback"));
var _CardActions = _interopRequireDefault(require("./CardActions"));
var _CardContent = _interopRequireDefault(require("./CardContent"));
var _CardCover = _interopRequireDefault(require("./CardCover"));
var _CardTitle = _interopRequireDefault(require("./CardTitle"));
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _forwardRef = require("../../utils/forwardRef");
var _hasTouchHandler = _interopRequireDefault(require("../../utils/hasTouchHandler"));
var _splitStyles = require("../../utils/splitStyles");
var _Surface = _interopRequireDefault(require("../Surface"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
/**
* A card is a sheet of material that serves as an entry point to more detailed information.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Avatar, Button, Card, Text } from 'react-native-paper';
*
* const LeftContent = props => <Avatar.Icon {...props} icon="folder" />
*
* const MyComponent = () => (
* <Card>
* <Card.Title title="Card Title" subtitle="Card Subtitle" left={LeftContent} />
* <Card.Content>
* <Text variant="titleLarge">Card title</Text>
* <Text variant="bodyMedium">Card content</Text>
* </Card.Content>
* <Card.Cover source={{ uri: 'https://picsum.photos/700' }} />
* <Card.Actions>
* <Button>Cancel</Button>
* <Button>Ok</Button>
* </Card.Actions>
* </Card>
* );
*
* export default MyComponent;
* ```
*/
const Card = ({
elevation: cardElevation = 1,
delayLongPress,
onPress,
onLongPress,
onPressOut,
onPressIn,
mode: cardMode = 'elevated',
children,
style,
contentStyle,
theme: themeOverrides,
testID = 'card',
accessible,
disabled,
...rest
}, ref) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const isMode = React.useCallback(modeToCompare => {
return cardMode === modeToCompare;
}, [cardMode]);
const hasPassedTouchHandler = (0, _hasTouchHandler.default)({
onPress,
onLongPress,
onPressIn,
onPressOut
});
// Default animated value
const {
current: elevation
} = React.useRef(new _reactNative.Animated.Value(cardElevation));
// Dark adaptive animated value, used in case of toggling the theme,
// it prevents animating the background with native drivers inside Surface
const {
current: elevationDarkAdaptive
} = React.useRef(new _reactNative.Animated.Value(cardElevation));
const {
animation,
dark,
mode,
roundness,
isV3
} = theme;
const prevDarkRef = React.useRef(dark);
React.useEffect(() => {
prevDarkRef.current = dark;
});
const prevDark = prevDarkRef.current;
const isAdaptiveMode = mode === 'adaptive';
const animationDuration = 150 * animation.scale;
React.useEffect(() => {
/**
* Resets animations values if updating to dark adaptive mode,
* otherwise, any card that is in the middle of animation while
* toggling the theme will stay at that animated value until
* the next press-in
*/
if (dark && isAdaptiveMode && !prevDark) {
elevation.setValue(cardElevation);
elevationDarkAdaptive.setValue(cardElevation);
}
}, [prevDark, dark, isAdaptiveMode, cardElevation, elevation, elevationDarkAdaptive]);
const runElevationAnimation = pressType => {
if (isV3 && isMode('contained')) {
return;
}
const isPressTypeIn = pressType === 'in';
if (dark && isAdaptiveMode) {
_reactNative.Animated.timing(elevationDarkAdaptive, {
toValue: isPressTypeIn ? isV3 ? 2 : 8 : cardElevation,
duration: animationDuration,
useNativeDriver: false
}).start();
} else {
_reactNative.Animated.timing(elevation, {
toValue: isPressTypeIn ? isV3 ? 2 : 8 : cardElevation,
duration: animationDuration,
useNativeDriver: false
}).start();
}
};
const handlePressIn = (0, _useLatestCallback.default)(e => {
onPressIn === null || onPressIn === void 0 || onPressIn(e);
runElevationAnimation('in');
});
const handlePressOut = (0, _useLatestCallback.default)(e => {
onPressOut === null || onPressOut === void 0 || onPressOut(e);
runElevationAnimation('out');
});
const total = React.Children.count(children);
const siblings = React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.type ? child.type.displayName : null);
const computedElevation = dark && isAdaptiveMode ? elevationDarkAdaptive : elevation;
const {
backgroundColor,
borderColor: themedBorderColor
} = (0, _utils.getCardColors)({
theme,
mode: cardMode
});
const flattenedStyles = _reactNative.StyleSheet.flatten(style) || {};
const {
borderColor = themedBorderColor
} = flattenedStyles;
const [, borderRadiusStyles] = (0, _splitStyles.splitStyles)(flattenedStyles, style => style.startsWith('border') && style.endsWith('Radius'));
const borderRadiusCombinedStyles = {
borderRadius: (isV3 ? 3 : 1) * roundness,
...borderRadiusStyles
};
const content = /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.innerContainer, contentStyle],
testID: testID
}, React.Children.map(children, (child, index) => /*#__PURE__*/React.isValidElement(child) ? /*#__PURE__*/React.cloneElement(child, {
index,
total,
siblings,
borderRadiusStyles
}) : child));
return /*#__PURE__*/React.createElement(_Surface.default, _extends({
ref: ref,
style: [isV3 && !isMode('elevated') && {
backgroundColor
}, !isV3 && (isMode('outlined') ? styles.resetElevation : {
elevation: computedElevation
}), borderRadiusCombinedStyles, style],
theme: theme
}, isV3 && {
elevation: isMode('elevated') ? computedElevation : 0
}, {
testID: `${testID}-container`,
container: true
}, rest), isMode('outlined') && /*#__PURE__*/React.createElement(_reactNative.View, {
pointerEvents: "none",
testID: `${testID}-outline`,
style: [{
borderColor
}, styles.outline, borderRadiusCombinedStyles]
}), hasPassedTouchHandler ? /*#__PURE__*/React.createElement(_reactNative.Pressable, {
accessible: accessible,
unstable_pressDelay: 0,
disabled: disabled,
delayLongPress: delayLongPress,
onLongPress: onLongPress,
onPress: onPress,
onPressIn: handlePressIn,
onPressOut: handlePressOut
}, content) : content);
};
Card.displayName = 'Card';
const Component = (0, _forwardRef.forwardRef)(Card);
const CardComponent = Component;
// @component ./CardContent.tsx
CardComponent.Content = _CardContent.default;
// @component ./CardActions.tsx
CardComponent.Actions = _CardActions.default;
// @component ./CardCover.tsx
CardComponent.Cover = _CardCover.default;
// @component ./CardTitle.tsx
CardComponent.Title = _CardTitle.default;
const styles = _reactNative.StyleSheet.create({
innerContainer: {
flexShrink: 1
},
outline: {
borderWidth: 1,
position: 'absolute',
width: '100%',
height: '100%',
zIndex: 2
},
resetElevation: {
elevation: 0
}
});
var _default = exports.default = CardComponent;
//# sourceMappingURL=Card.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,74 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _theming = require("../../core/theming");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
/**
* A component to show a list of actions inside a Card.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Card, Button } from 'react-native-paper';
*
* const MyComponent = () => (
* <Card>
* <Card.Actions>
* <Button>Cancel</Button>
* <Button>Ok</Button>
* </Card.Actions>
* </Card>
* );
*
* export default MyComponent;
* ```
*/
const CardActions = ({
theme,
style,
children,
...rest
}) => {
const {
isV3
} = (0, _theming.useInternalTheme)(theme);
const justifyContent = isV3 ? 'flex-end' : 'flex-start';
const containerStyle = [styles.container, {
justifyContent
}, style];
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, rest, {
style: containerStyle
}), React.Children.map(children, (child, index) => {
if (! /*#__PURE__*/React.isValidElement(child)) {
return child;
}
const compact = !isV3 && child.props.compact !== false;
const mode = child.props.mode ?? (isV3 ? index === 0 ? 'outlined' : 'contained' : undefined);
const childStyle = [isV3 && styles.button, child.props.style];
return /*#__PURE__*/React.cloneElement(child, {
...child.props,
compact,
mode,
style: childStyle
});
}));
};
CardActions.displayName = 'Card.Actions';
const styles = _reactNative.StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
padding: 8
},
button: {
marginLeft: 8
}
});
var _default = exports.default = CardActions;
//# sourceMappingURL=CardActions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_theming","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","CardActions","theme","style","children","rest","isV3","useInternalTheme","justifyContent","containerStyle","styles","container","createElement","View","Children","map","child","index","isValidElement","compact","props","mode","undefined","childStyle","button","cloneElement","displayName","StyleSheet","create","flexDirection","alignItems","padding","marginLeft","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Card/CardActions.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAAsD,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBA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yC,aAAA,CAACtC,YAAA,CAAAuC,IAAI,EAAAlB,QAAA,KAAKU,IAAI;IAAEF,KAAK,EAAEM;EAAe,IACnCtC,KAAK,CAAC2C,QAAQ,CAACC,GAAG,CAACX,QAAQ,EAAE,CAACY,KAAK,EAAEC,KAAK,KAAK;IAC9C,IAAI,eAAC9C,KAAK,CAAC+C,cAAc,CAAuBF,KAAK,CAAC,EAAE;MACtD,OAAOA,KAAK;IACd;IAEA,MAAMG,OAAO,GAAG,CAACb,IAAI,IAAIU,KAAK,CAACI,KAAK,CAACD,OAAO,KAAK,KAAK;IACtD,MAAME,IAAI,GACRL,KAAK,CAACI,KAAK,CAACC,IAAI,KACff,IAAI,GAAIW,KAAK,KAAK,CAAC,GAAG,UAAU,GAAG,WAAW,GAAIK,SAAS,CAAC;IAC/D,MAAMC,UAAU,GAAG,CAACjB,IAAI,IAAII,MAAM,CAACc,MAAM,EAAER,KAAK,CAACI,KAAK,CAACjB,KAAK,CAAC;IAE7D,oBAAOhC,KAAK,CAACsD,YAAY,CAACT,KAAK,EAAE;MAC/B,GAAGA,KAAK,CAACI,KAAK;MACdD,OAAO;MACPE,IAAI;MACJlB,KAAK,EAAEoB;IACT,CAAC,CAAC;EACJ,CAAC,CACG,CAAC;AAEX,CAAC;AAEDtB,WAAW,CAACyB,WAAW,GAAG,cAAc;AAExC,MAAMhB,MAAM,GAAGiB,uBAAU,CAACC,MAAM,CAAC;EAC/BjB,SAAS,EAAE;IACTkB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE;EACX,CAAC;EACDP,MAAM,EAAE;IACNQ,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhD,OAAA,GAEYe,WAAW","ignoreList":[]}

View File

@@ -0,0 +1,84 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
/**
* A component to show content inside a Card.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Card, Text } from 'react-native-paper';
*
* const MyComponent = () => (
* <Card>
* <Card.Content>
* <Text variant="titleLarge">Card title</Text>
* <Text variant="bodyMedium">Card content</Text>
* </Card.Content>
* </Card>
* );
*
* export default MyComponent;
* ```
*/
const CardContent = ({
index,
total,
siblings,
style,
...rest
}) => {
const cover = 'withInternalTheme(CardCover)';
const title = 'withInternalTheme(CardTitle)';
let contentStyle, prev, next;
if (typeof index === 'number' && siblings) {
prev = siblings[index - 1];
next = siblings[index + 1];
}
if (prev === cover && next === cover || prev === title && next === title || total === 1) {
contentStyle = styles.only;
} else if (index === 0) {
if (next === cover || next === title) {
contentStyle = styles.only;
} else {
contentStyle = styles.first;
}
} else if (typeof total === 'number' && index === total - 1) {
if (prev === cover || prev === title) {
contentStyle = styles.only;
} else {
contentStyle = styles.last;
}
} else if (prev === cover || prev === title) {
contentStyle = styles.first;
} else if (next === cover || next === title) {
contentStyle = styles.last;
}
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, rest, {
style: [styles.container, contentStyle, style]
}));
};
CardContent.displayName = 'Card.Content';
const styles = _reactNative.StyleSheet.create({
container: {
paddingHorizontal: 16
},
first: {
paddingTop: 16
},
last: {
paddingBottom: 16
},
only: {
paddingVertical: 16
}
});
var _default = exports.default = CardContent;
//# sourceMappingURL=CardContent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","CardContent","index","total","siblings","style","rest","cover","title","contentStyle","prev","next","styles","only","first","last","createElement","View","container","displayName","StyleSheet","create","paddingHorizontal","paddingTop","paddingBottom","paddingVertical","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Card/CardContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAsE,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,C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AAE;EACd,CAAC;EACDR,IAAI,EAAE;IACJS,aAAa,EAAE;EACjB,CAAC;EACDX,IAAI,EAAE;IACJY,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAzC,OAAA,GAEYe,WAAW","ignoreList":[]}

View File

@@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.CardCover = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _colors = require("../../styles/themes/v2/colors");
var _splitStyles = require("../../utils/splitStyles");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
/**
* A component to show a cover image inside a Card.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Card } from 'react-native-paper';
*
* const MyComponent = () => (
* <Card>
* <Card.Cover source={{ uri: 'https://picsum.photos/700' }} />
* </Card>
* );
*
* export default MyComponent;
* ```
*
* @extends Image props https://reactnative.dev/docs/image#props
*/
const CardCover = ({
index,
total,
style,
theme: themeOverrides,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const flattenedStyles = _reactNative.StyleSheet.flatten(style) || {};
const [, borderRadiusStyles] = (0, _splitStyles.splitStyles)(flattenedStyles, style => style.startsWith('border') && style.endsWith('Radius'));
const coverStyle = (0, _utils.getCardCoverStyle)({
theme,
index,
total,
borderRadiusStyles
});
return /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.container, coverStyle, style]
}, /*#__PURE__*/React.createElement(_reactNative.Image, _extends({}, rest, {
style: [styles.image, coverStyle],
accessibilityIgnoresInvertColors: true
})));
};
exports.CardCover = CardCover;
CardCover.displayName = 'Card.Cover';
const styles = _reactNative.StyleSheet.create({
container: {
height: 195,
backgroundColor: _colors.grey200,
overflow: 'hidden'
},
image: {
flex: 1,
height: undefined,
width: undefined,
justifyContent: 'flex-end'
}
});
var _default = exports.default = CardCover; // @component-docs ignore-next-line
//# sourceMappingURL=CardCover.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_utils","_theming","_colors","_splitStyles","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","CardCover","index","total","style","theme","themeOverrides","rest","useInternalTheme","flattenedStyles","StyleSheet","flatten","borderRadiusStyles","splitStyles","startsWith","endsWith","coverStyle","getCardCoverStyle","createElement","View","styles","container","Image","image","accessibilityIgnoresInvertColors","exports","displayName","create","height","backgroundColor","grey200","overflow","flex","undefined","width","justifyContent","_default"],"sourceRoot":"../../../../src","sources":["components/Card/CardCover.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAAsD,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CA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QAAQ,EAAE;EACZ,CAAC;EACDR,KAAK,EAAE;IACLS,IAAI,EAAE,CAAC;IACPJ,MAAM,EAAEK,SAAS;IACjBC,KAAK,EAAED,SAAS;IAChBE,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAX,OAAA,CAAAvC,OAAA,GAEYe,SAAS,EAExB","ignoreList":[]}

View File

@@ -0,0 +1,119 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.CardTitle = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _theming = require("../../core/theming");
var _Text = _interopRequireDefault(require("../Typography/Text"));
var _Caption = _interopRequireDefault(require("../Typography/v2/Caption"));
var _Title = _interopRequireDefault(require("../Typography/v2/Title"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
const LEFT_SIZE = 40;
/**
* A component to show a title, subtitle and an avatar inside a Card.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Avatar, Card, IconButton } from 'react-native-paper';
*
* const MyComponent = () => (
* <Card.Title
* title="Card Title"
* subtitle="Card Subtitle"
* left={(props) => <Avatar.Icon {...props} icon="folder" />}
* right={(props) => <IconButton {...props} icon="dots-vertical" onPress={() => {}} />}
* />
* );
*
* export default MyComponent;
* ```
*/
const CardTitle = ({
title,
titleStyle,
titleNumberOfLines = 1,
titleVariant = 'bodyLarge',
titleMaxFontSizeMultiplier,
subtitle,
subtitleStyle,
subtitleNumberOfLines = 1,
subtitleVariant = 'bodyMedium',
subtitleMaxFontSizeMultiplier,
left,
leftStyle,
right,
rightStyle,
style,
theme: themeOverrides
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const TitleComponent = theme.isV3 ? _Text.default : _Title.default;
const SubtitleComponent = theme.isV3 ? _Text.default : _Caption.default;
const minHeight = subtitle || left || right ? 72 : 50;
const marginBottom = subtitle ? 0 : 2;
return /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.container, {
minHeight
}, style]
}, left ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.left, leftStyle]
}, left({
size: LEFT_SIZE
})) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.titles]
}, title && /*#__PURE__*/React.createElement(TitleComponent, {
style: [styles.title, {
marginBottom
}, titleStyle],
numberOfLines: titleNumberOfLines,
variant: titleVariant,
maxFontSizeMultiplier: titleMaxFontSizeMultiplier
}, title), subtitle && /*#__PURE__*/React.createElement(SubtitleComponent, {
style: [styles.subtitle, subtitleStyle],
numberOfLines: subtitleNumberOfLines,
variant: subtitleVariant,
maxFontSizeMultiplier: subtitleMaxFontSizeMultiplier
}, subtitle)), /*#__PURE__*/React.createElement(_reactNative.View, {
style: rightStyle
}, right ? right({
size: 24
}) : null));
};
exports.CardTitle = CardTitle;
CardTitle.displayName = 'Card.Title';
const styles = _reactNative.StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingLeft: 16
},
left: {
justifyContent: 'center',
marginRight: 16,
height: LEFT_SIZE,
width: LEFT_SIZE
},
titles: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center'
},
title: {
minHeight: 30,
paddingRight: 16
},
subtitle: {
minHeight: 20,
marginVertical: 0,
paddingRight: 16
}
});
var _default = exports.default = CardTitle; // @component-docs ignore-next-line
//# sourceMappingURL=CardTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_theming","_Text","_interopRequireDefault","_Caption","_Title","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","LEFT_SIZE","CardTitle","title","titleStyle","titleNumberOfLines","titleVariant","titleMaxFontSizeMultiplier","subtitle","subtitleStyle","subtitleNumberOfLines","subtitleVariant","subtitleMaxFontSizeMultiplier","left","leftStyle","right","rightStyle","style","theme","themeOverrides","useInternalTheme","TitleComponent","isV3","Text","Title","SubtitleComponent","Caption","minHeight","marginBottom","createElement","View","styles","container","size","titles","numberOfLines","variant","maxFontSizeMultiplier","exports","displayName","StyleSheet","create","flexDirection","alignItems","justifyContent","paddingLeft","marginRight","height","width","flex","paddingRight","marginVertical","_default"],"sourceRoot":"../../../../src","sources":["components/Card/CardTitle.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAF,sBAAA,CAAAJ,OAAA;AAA2C,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAQ,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uB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AK,EAAED;EAAW,GAAED,KAAK,GAAGA,KAAK,CAAC;IAAEkB,IAAI,EAAE;EAAG,CAAC,CAAC,GAAG,IAAW,CAC/D,CAAC;AAEX,CAAC;AAACK,OAAA,CAAApC,SAAA,GAAAA,SAAA;AAEFA,SAAS,CAACqC,WAAW,GAAG,YAAY;AAEpC,MAAMR,MAAM,GAAGS,uBAAU,CAACC,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BC,WAAW,EAAE;EACf,CAAC;EAEDhC,IAAI,EAAE;IACJ+B,cAAc,EAAE,QAAQ;IACxBE,WAAW,EAAE,EAAE;IACfC,MAAM,EAAE9C,SAAS;IACjB+C,KAAK,EAAE/C;EACT,CAAC;EAEDiC,MAAM,EAAE;IACNe,IAAI,EAAE,CAAC;IACPP,aAAa,EAAE,QAAQ;IACvBE,cAAc,EAAE;EAClB,CAAC;EAEDzC,KAAK,EAAE;IACLwB,SAAS,EAAE,EAAE;IACbuB,YAAY,EAAE;EAChB,CAAC;EAED1C,QAAQ,EAAE;IACRmB,SAAS,EAAE,EAAE;IACbwB,cAAc,EAAE,CAAC;IACjBD,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,IAAAE,QAAA,GAAAd,OAAA,CAAAtD,OAAA,GAEYkB,SAAS,EAExB","ignoreList":[]}

View File

@@ -0,0 +1,93 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getCardCoverStyle = exports.getCardColors = void 0;
var _color = _interopRequireDefault(require("color"));
var _colors = require("../../styles/themes/v2/colors");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const getCardCoverStyle = ({
theme,
index,
total,
borderRadiusStyles
}) => {
const {
isV3,
roundness
} = theme;
if (Object.keys(borderRadiusStyles).length > 0) {
return {
borderRadius: 3 * roundness,
...borderRadiusStyles
};
}
if (isV3) {
return {
borderRadius: 3 * roundness
};
}
if (index === 0) {
if (total === 1) {
return {
borderRadius: roundness
};
}
return {
borderTopLeftRadius: roundness,
borderTopRightRadius: roundness
};
}
if (typeof total === 'number' && index === total - 1) {
return {
borderBottomLeftRadius: roundness
};
}
return undefined;
};
exports.getCardCoverStyle = getCardCoverStyle;
const getBorderColor = ({
theme
}) => {
if (theme.isV3) {
return theme.colors.outline;
}
if (theme.dark) {
return (0, _color.default)(_colors.white).alpha(0.12).rgb().string();
}
return (0, _color.default)(_colors.black).alpha(0.12).rgb().string();
};
const getBackgroundColor = ({
theme,
isMode
}) => {
if (theme.isV3) {
if (isMode('contained')) {
return theme.colors.surfaceVariant;
}
if (isMode('outlined')) {
return theme.colors.surface;
}
}
return undefined;
};
const getCardColors = ({
theme,
mode
}) => {
const isMode = modeToCompare => {
return mode === modeToCompare;
};
return {
backgroundColor: getBackgroundColor({
theme,
isMode
}),
borderColor: getBorderColor({
theme
})
};
};
exports.getCardColors = getCardColors;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_color","_interopRequireDefault","require","_colors","e","__esModule","default","getCardCoverStyle","theme","index","total","borderRadiusStyles","isV3","roundness","Object","keys","length","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","undefined","exports","getBorderColor","colors","outline","dark","color","white","alpha","rgb","string","black","getBackgroundColor","isMode","surfaceVariant","surface","getCardColors","mode","modeToCompare","backgroundColor","borderColor"],"sourceRoot":"../../../../src","sources":["components/Card/utils.tsx"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAA6D,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAgBtD,MAAMG,iBAAiB,GAAGA,CAAC;EAChCC,KAAK;EACLC,KAAK;EACLC,KAAK;EACLC;AAMF,CAAC,KA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