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,253 @@
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); }
import * as React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import color from 'color';
import AppbarContent from './AppbarContent';
import { DEFAULT_APPBAR_HEIGHT, getAppbarBackgroundColor, modeAppbarHeight, renderAppbarContent, filterAppbarActions } from './utils';
import { useInternalTheme } from '../../core/theming';
import Surface from '../Surface';
/**
* A component to display action items in a bar. It can be placed at the top or bottom.
* The top bar usually contains the screen title, controls such as navigation buttons, menu button etc.
* The bottom bar usually provides access to a drawer and up to four actions.
*
* By default Appbar uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead.
* See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more informations
*
* ## Usage
* ### Top bar
* ```js
* import * as React from 'react';
* import { Appbar } from 'react-native-paper';
*
* const MyComponent = () => (
* <Appbar.Header>
* <Appbar.BackAction onPress={() => {}} />
* <Appbar.Content title="Title" />
* <Appbar.Action icon="calendar" onPress={() => {}} />
* <Appbar.Action icon="magnify" onPress={() => {}} />
* </Appbar.Header>
* );
*
* export default MyComponent;
* ```
*
* ### Bottom bar
* ```js
* import * as React from 'react';
* import { StyleSheet } from 'react-native';
* import { Appbar, FAB, useTheme } from 'react-native-paper';
* import { useSafeAreaInsets } from 'react-native-safe-area-context';
*
* const BOTTOM_APPBAR_HEIGHT = 80;
* const MEDIUM_FAB_HEIGHT = 56;
*
* const MyComponent = () => {
* const { bottom } = useSafeAreaInsets();
* const theme = useTheme();
*
* return (
* <Appbar
* style={[
* styles.bottom,
* {
* height: BOTTOM_APPBAR_HEIGHT + bottom,
* backgroundColor: theme.colors.elevation.level2,
* },
* ]}
* safeAreaInsets={{ bottom }}
* >
* <Appbar.Action icon="archive" onPress={() => {}} />
* <Appbar.Action icon="email" onPress={() => {}} />
* <Appbar.Action icon="label" onPress={() => {}} />
* <Appbar.Action icon="delete" onPress={() => {}} />
* <FAB
* mode="flat"
* size="medium"
* icon="plus"
* onPress={() => {}}
* style={[
* styles.fab,
* { top: (BOTTOM_APPBAR_HEIGHT - MEDIUM_FAB_HEIGHT) / 2 },
* ]}
* />
* </Appbar>
* );
* };
*
* const styles = StyleSheet.create({
* bottom: {
* backgroundColor: 'aquamarine',
* position: 'absolute',
* left: 0,
* right: 0,
* bottom: 0,
* },
* fab: {
* position: 'absolute',
* right: 16,
* },
* });
*
* export default MyComponent;
* ```
*/
const Appbar = ({
children,
dark,
style,
mode = 'small',
elevated,
safeAreaInsets,
theme: themeOverrides,
...rest
}) => {
const theme = useInternalTheme(themeOverrides);
const {
isV3
} = theme;
const flattenedStyle = StyleSheet.flatten(style);
const {
backgroundColor: customBackground,
elevation = isV3 ? elevated ? 2 : 0 : 4,
...restStyle
} = flattenedStyle || {};
const backgroundColor = getAppbarBackgroundColor(theme, elevation, customBackground, elevated);
const isMode = modeToCompare => {
return isV3 && mode === modeToCompare;
};
let isDark = false;
if (typeof dark === 'boolean') {
isDark = dark;
} else if (!isV3) {
isDark = backgroundColor === 'transparent' ? false : typeof backgroundColor === 'string' ? !color(backgroundColor).isLight() : true;
}
const isV3CenterAlignedMode = isV3 && isMode('center-aligned');
let shouldCenterContent = false;
let shouldAddLeftSpacing = false;
let shouldAddRightSpacing = false;
if (!isV3 && Platform.OS === 'ios' || isV3CenterAlignedMode) {
let hasAppbarContent = false;
let leftItemsCount = 0;
let rightItemsCount = 0;
React.Children.forEach(children, child => {
if (/*#__PURE__*/React.isValidElement(child)) {
const isLeading = child.props.isLeading === true;
if (child.type === AppbarContent) {
hasAppbarContent = true;
} else if (isLeading || !hasAppbarContent) {
leftItemsCount++;
} else {
rightItemsCount++;
}
}
});
shouldCenterContent = hasAppbarContent && leftItemsCount < 2 && rightItemsCount < (isV3 ? 3 : 2);
shouldAddLeftSpacing = shouldCenterContent && leftItemsCount === 0;
shouldAddRightSpacing = shouldCenterContent && rightItemsCount === 0;
}
const spacingStyle = isV3 ? styles.v3Spacing : styles.spacing;
const insets = {
paddingBottom: safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.bottom,
paddingTop: safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.top,
paddingLeft: safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.left,
paddingRight: safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.right
};
return /*#__PURE__*/React.createElement(Surface, _extends({
style: [{
backgroundColor
}, styles.appbar, {
height: isV3 ? modeAppbarHeight[mode] : DEFAULT_APPBAR_HEIGHT
}, insets, restStyle, !theme.isV3 && {
elevation
}],
elevation: elevation,
container: true
}, rest), shouldAddLeftSpacing ? /*#__PURE__*/React.createElement(View, {
style: spacingStyle
}) : null, (!isV3 || isMode('small') || isMode('center-aligned')) && /*#__PURE__*/React.createElement(React.Fragment, null, renderAppbarContent({
children,
isDark,
theme,
isV3,
renderOnly: ['Appbar.BackAction'],
shouldCenterContent: isV3CenterAlignedMode || shouldCenterContent
}), renderAppbarContent({
// Filter appbar actions - first leading icons, then trailing icons
children: [...filterAppbarActions(children, true), ...filterAppbarActions(children)],
isDark,
theme,
isV3,
renderExcept: ['Appbar.BackAction'],
shouldCenterContent: isV3CenterAlignedMode || shouldCenterContent
})), (isMode('medium') || isMode('large')) && /*#__PURE__*/React.createElement(View, {
style: [styles.columnContainer, isMode('center-aligned') && styles.centerAlignedContainer]
}, /*#__PURE__*/React.createElement(View, {
style: styles.controlsRow
}, renderAppbarContent({
children,
isDark,
isV3,
renderOnly: ['Appbar.BackAction'],
mode
}), renderAppbarContent({
children: filterAppbarActions(children, true),
isDark,
isV3,
renderOnly: ['Appbar.Action'],
mode
}), /*#__PURE__*/React.createElement(View, {
style: styles.rightActionControls
}, renderAppbarContent({
children: filterAppbarActions(children),
isDark,
isV3,
renderExcept: ['Appbar', 'Appbar.BackAction', 'Appbar.Content', 'Appbar.Header'],
mode
}))), renderAppbarContent({
children,
isDark,
isV3,
renderOnly: ['Appbar.Content'],
mode
})), shouldAddRightSpacing ? /*#__PURE__*/React.createElement(View, {
style: spacingStyle
}) : null);
};
const styles = StyleSheet.create({
appbar: {
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 4
},
spacing: {
width: 48
},
v3Spacing: {
width: 52
},
controlsRow: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between'
},
rightActionControls: {
flexDirection: 'row',
flex: 1,
justifyContent: 'flex-end'
},
columnContainer: {
flexDirection: 'column',
flex: 1,
paddingTop: 8
},
centerAlignedContainer: {
paddingTop: 0
}
});
export default Appbar;
// @component-docs ignore-next-line
export { Appbar };
//# sourceMappingURL=Appbar.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,61 @@
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); }
import * as React from 'react';
import color from 'color';
import { useInternalTheme } from '../../core/theming';
import { black } from '../../styles/themes/v2/colors';
import { forwardRef } from '../../utils/forwardRef';
import IconButton from '../IconButton/IconButton';
/**
* A component used to display an action item in the appbar.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Appbar } from 'react-native-paper';
* import { Platform } from 'react-native';
*
* const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical';
*
* const MyComponent = () => (
* <Appbar.Header>
* <Appbar.Content title="Title" subtitle={'Subtitle'} />
* <Appbar.Action icon="magnify" onPress={() => {}} />
* <Appbar.Action icon={MORE_ICON} onPress={() => {}} />
* </Appbar.Header>
* );
*
* export default MyComponent;
* ```
*/
const AppbarAction = forwardRef(({
size = 24,
color: iconColor,
icon,
disabled,
onPress,
accessibilityLabel,
isLeading,
theme: themeOverrides,
rippleColor,
...rest
}, ref) => {
const theme = useInternalTheme(themeOverrides);
const actionIconColor = iconColor ? iconColor : theme.isV3 ? isLeading ? theme.colors.onSurface : theme.colors.onSurfaceVariant : color(black).alpha(0.54).rgb().string();
return /*#__PURE__*/React.createElement(IconButton, _extends({
size: size,
onPress: onPress,
iconColor: actionIconColor,
icon: icon,
disabled: disabled,
accessibilityLabel: accessibilityLabel,
animated: true,
ref: ref,
rippleColor: rippleColor
}, rest));
});
AppbarAction.displayName = 'Appbar.Action';
export default AppbarAction;
// @component-docs ignore-next-line
export { AppbarAction };
//# sourceMappingURL=AppbarAction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","color","useInternalTheme","black","forwardRef","IconButton","AppbarAction","size","iconColor","icon","disabled","onPress","accessibilityLabel","isLeading","theme","themeOverrides","rippleColor","rest","ref","actionIconColor","isV3","colors","onSurface","onSurfaceVariant","alpha","rgb","string","createElement","_extends","animated","displayName"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarAction.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAS9B,OAAOC,KAAK,MAAM,OAAO;AAGzB,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,KAAK,QAAQ,+BAA+B;AACrD,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,UAAU,MAAM,0BAA0B;AA6CjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAGF,UAAU,CAC7B,CACE;EACEG,IAAI,GAAG,EAAE;EACTN,KAAK,EAAEO,SAAS;EAChBC,IAAI;EACJC,QAAQ;EACRC,OAAO;EACPC,kBAAkB;EAClBC,SAAS;EACTC,KAAK,EAAEC,cAAc;EACrBC,WAAW;EACX,GAAGC;AACE,CAAC,EACRC,GAAG,KACA;EACH,MAAMJ,KAAK,GAAGZ,gBAAgB,CAACa,cAAc,CAAC;EAE9C,MAAMI,eAAe,GAAGX,SAAS,GAC7BA,SAAS,GACTM,KAAK,CAACM,IAAI,GACVP,SAAS,GACPC,KAAK,CAACO,MAAM,CAACC,SAAS,GACtBR,KAAK,CAACO,MAAM,CAACE,gBAAgB,GAC/BtB,KAAK,CAACE,KAAK,CAAC,CAACqB,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EAE3C,oBACE1B,KAAA,CAAA2B,aAAA,CAACtB,UAAU,EAAAuB,QAAA;IACTrB,IAAI,EAAEA,IAAK;IACXI,OAAO,EAAEA,OAAQ;IACjBH,SAAS,EAAEW,eAAgB;IAC3BV,IAAI,EAAEA,IAAK;IACXC,QAAQ,EAAEA,QAAS;IACnBE,kBAAkB,EAAEA,kBAAmB;IACvCiB,QAAQ;IACRX,GAAG,EAAEA,GAAI;IACTF,WAAW,EAAEA;EAAY,GACrBC,IAAI,CACT,CAAC;AAEN,CACF,CAAC;AAEDX,YAAY,CAACwB,WAAW,GAAG,eAAe;AAE1C,eAAexB,YAAY;;AAE3B;AACA,SAASA,YAAY","ignoreList":[]}

View File

@@ -0,0 +1,38 @@
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); }
import * as React from 'react';
import AppbarAction from './AppbarAction';
import AppbarBackIcon from './AppbarBackIcon';
import { forwardRef } from '../../utils/forwardRef';
/**
* A component used to display a back button in the appbar.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Appbar } from 'react-native-paper';
*
* const MyComponent = () => (
* <Appbar.Header>
* <Appbar.BackAction onPress={() => {}} />
* </Appbar.Header>
* );
*
* export default MyComponent;
* ```
*/
const AppbarBackAction = forwardRef(({
accessibilityLabel = 'Back',
...rest
}, ref) => /*#__PURE__*/React.createElement(AppbarAction, _extends({
accessibilityLabel: accessibilityLabel
}, rest, {
icon: AppbarBackIcon,
isLeading: true,
ref: ref
})));
AppbarBackAction.displayName = 'Appbar.BackAction';
export default AppbarBackAction;
// @component-docs ignore-next-line
export { AppbarBackAction };
//# sourceMappingURL=AppbarBackAction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","AppbarAction","AppbarBackIcon","forwardRef","AppbarBackAction","accessibilityLabel","rest","ref","createElement","_extends","icon","isLeading","displayName"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarBackAction.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAU9B,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,UAAU,QAAQ,wBAAwB;AA8BnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGD,UAAU,CACjC,CAAC;EAAEE,kBAAkB,GAAG,MAAM;EAAE,GAAGC;AAAY,CAAC,EAAEC,GAAG,kBACnDP,KAAA,CAAAQ,aAAA,CAACP,YAAY,EAAAQ,QAAA;EACXJ,kBAAkB,EAAEA;AAAmB,GACnCC,IAAI;EACRI,IAAI,EAAER,cAAe;EACrBS,SAAS;EACTJ,GAAG,EAAEA;AAAI,EACV,CAEL,CAAC;AAEDH,gBAAgB,CAACQ,WAAW,GAAG,mBAAmB;AAElD,eAAeR,gBAAgB;;AAE/B;AACA,SAASA,gBAAgB","ignoreList":[]}

View File

@@ -0,0 +1,45 @@
import * as React from 'react';
import { I18nManager, Image, Platform, StyleSheet, View } from 'react-native';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
const AppbarBackIcon = ({
size,
color
}) => {
const iosIconSize = size - 3;
return Platform.OS === 'ios' ? /*#__PURE__*/React.createElement(View, {
style: [styles.wrapper, {
width: size,
height: size,
transform: [{
scaleX: I18nManager.getConstants().isRTL ? -1 : 1
}]
}]
}, /*#__PURE__*/React.createElement(Image, {
source: require('../../assets/back-chevron.png'),
style: [styles.icon, {
tintColor: color,
width: iosIconSize,
height: iosIconSize
}],
accessibilityIgnoresInvertColors: true
})) : /*#__PURE__*/React.createElement(MaterialCommunityIcon, {
name: "arrow-left",
color: color,
size: size,
direction: I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
});
};
const styles = StyleSheet.create({
wrapper: {
alignItems: 'center',
justifyContent: 'center'
},
icon: {
resizeMode: 'contain'
}
});
export default AppbarBackIcon;
// @component-docs ignore-next-line
export { AppbarBackIcon };
//# sourceMappingURL=AppbarBackIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","I18nManager","Image","Platform","StyleSheet","View","MaterialCommunityIcon","AppbarBackIcon","size","color","iosIconSize","OS","createElement","style","styles","wrapper","width","height","transform","scaleX","getConstants","isRTL","source","require","icon","tintColor","accessibilityIgnoresInvertColors","name","direction","create","alignItems","justifyContent","resizeMode"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarBackIcon.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE7E,OAAOC,qBAAqB,MAAM,0BAA0B;AAE5D,MAAMC,cAAc,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAAuC,CAAC,KAAK;EAC3E,MAAMC,WAAW,GAAGF,IAAI,GAAG,CAAC;EAE5B,OAAOL,QAAQ,CAACQ,EAAE,KAAK,KAAK,gBAC1BX,KAAA,CAAAY,aAAA,CAACP,IAAI;IACHQ,KAAK,EAAE,CACLC,MAAM,CAACC,OAAO,EACd;MACEC,KAAK,EAAER,IAAI;MACXS,MAAM,EAAET,IAAI;MACZU,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAElB,WAAW,CAACmB,YAAY,CAAC,CAAC,CAACC,KAAK,GAAG,CAAC,CAAC,GAAG;MAAE,CAAC;IACnE,CAAC;EACD,gBAEFrB,KAAA,CAAAY,aAAA,CAACV,KAAK;IACJoB,MAAM,EAAEC,OAAO,CAAC,+BAA+B,CAAE;IACjDV,KAAK,EAAE,CACLC,MAAM,CAACU,IAAI,EACX;MAAEC,SAAS,EAAEhB,KAAK;MAAEO,KAAK,EAAEN,WAAW;MAAEO,MAAM,EAAEP;IAAY,CAAC,CAC7D;IACFgB,gCAAgC;EAAA,CACjC,CACG,CAAC,gBAEP1B,KAAA,CAAAY,aAAA,CAACN,qBAAqB;IACpBqB,IAAI,EAAC,YAAY;IACjBlB,KAAK,EAAEA,KAAM;IACbD,IAAI,EAAEA,IAAK;IACXoB,SAAS,EAAE3B,WAAW,CAACmB,YAAY,CAAC,CAAC,CAACC,KAAK,GAAG,KAAK,GAAG;EAAM,CAC7D,CACF;AACH,CAAC;AAED,MAAMP,MAAM,GAAGV,UAAU,CAACyB,MAAM,CAAC;EAC/Bd,OAAO,EAAE;IACPe,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDP,IAAI,EAAE;IACJQ,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAezB,cAAc;;AAE7B;AACA,SAASA,cAAc","ignoreList":[]}

View File

@@ -0,0 +1,134 @@
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); }
import * as React from 'react';
import { Platform, StyleSheet, Pressable, View } from 'react-native';
import color from 'color';
import { modeTextVariant } from './utils';
import { useInternalTheme } from '../../core/theming';
import { white } from '../../styles/themes/v2/colors';
import Text from '../Typography/Text';
/**
* A component used to display a title and optional subtitle in an appbar.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Appbar } from 'react-native-paper';
*
* const MyComponent = () => (
* <Appbar.Header>
* <Appbar.Content title="Title" />
* </Appbar.Header>
* );
*
* export default MyComponent;
* ```
*/
const AppbarContent = ({
color: titleColor,
subtitle,
subtitleStyle,
onPress,
disabled,
style,
titleRef,
titleStyle,
title,
titleMaxFontSizeMultiplier,
mode = 'small',
theme: themeOverrides,
testID = 'appbar-content',
...rest
}) => {
const theme = useInternalTheme(themeOverrides);
const {
isV3,
colors
} = theme;
const titleTextColor = titleColor ? titleColor : isV3 ? colors.onSurface : white;
const subtitleColor = color(titleTextColor).alpha(0.7).rgb().string();
const modeContainerStyles = {
small: styles.v3DefaultContainer,
medium: styles.v3MediumContainer,
large: styles.v3LargeContainer,
'center-aligned': styles.v3DefaultContainer
};
const variant = modeTextVariant[mode];
const contentWrapperProps = {
pointerEvents: 'box-none',
style: [styles.container, isV3 && modeContainerStyles[mode], style],
testID,
...rest
};
const content = /*#__PURE__*/React.createElement(React.Fragment, null, typeof title === 'string' ? /*#__PURE__*/React.createElement(Text, _extends({}, isV3 && {
variant
}, {
ref: titleRef,
style: [{
color: titleTextColor,
...(isV3 ? theme.fonts[variant] : Platform.OS === 'ios' ? theme.fonts.regular : theme.fonts.medium)
}, !isV3 && styles.title, titleStyle],
numberOfLines: 1,
accessible: true,
accessibilityRole: onPress ? 'none' : Platform.OS === 'web' ? 'heading' : 'header'
// @ts-expect-error We keep old a11y props for backwards compat with old RN versions
,
accessibilityTraits: "header",
testID: `${testID}-title-text`,
maxFontSizeMultiplier: titleMaxFontSizeMultiplier
}), title) : title, !isV3 && subtitle ? /*#__PURE__*/React.createElement(Text, {
style: [styles.subtitle, {
color: subtitleColor
}, subtitleStyle],
numberOfLines: 1
}, subtitle) : null);
if (onPress) {
return (
/*#__PURE__*/
// eslint-disable-next-line react-native-a11y/has-accessibility-props
React.createElement(Pressable, _extends({
accessibilityRole: touchableRole
// @ts-expect-error We keep old a11y props for backwards compat with old RN versions
,
accessibilityTraits: touchableRole,
accessibilityComponentType: "button",
accessbilityState: disabled ? 'disabled' : null,
onPress: onPress,
disabled: disabled
}, contentWrapperProps), content)
);
}
return /*#__PURE__*/React.createElement(View, contentWrapperProps, content);
};
AppbarContent.displayName = 'Appbar.Content';
const styles = StyleSheet.create({
container: {
flex: 1,
paddingHorizontal: 12
},
v3DefaultContainer: {
paddingHorizontal: 0
},
v3MediumContainer: {
paddingHorizontal: 0,
justifyContent: 'flex-end',
paddingBottom: 24
},
v3LargeContainer: {
paddingHorizontal: 0,
paddingTop: 36,
justifyContent: 'flex-end',
paddingBottom: 28
},
title: {
fontSize: Platform.OS === 'ios' ? 17 : 20
},
subtitle: {
fontSize: Platform.OS === 'ios' ? 11 : 14
}
});
const touchableRole = 'button';
export default AppbarContent;
// @component-docs ignore-next-line
export { AppbarContent };
//# sourceMappingURL=AppbarContent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","Platform","StyleSheet","Pressable","View","color","modeTextVariant","useInternalTheme","white","Text","AppbarContent","titleColor","subtitle","subtitleStyle","onPress","disabled","style","titleRef","titleStyle","title","titleMaxFontSizeMultiplier","mode","theme","themeOverrides","testID","rest","isV3","colors","titleTextColor","onSurface","subtitleColor","alpha","rgb","string","modeContainerStyles","small","styles","v3DefaultContainer","medium","v3MediumContainer","large","v3LargeContainer","variant","contentWrapperProps","pointerEvents","container","content","createElement","Fragment","_extends","ref","fonts","OS","regular","numberOfLines","accessible","accessibilityRole","accessibilityTraits","maxFontSizeMultiplier","touchableRole","accessibilityComponentType","accessbilityState","displayName","create","flex","paddingHorizontal","justifyContent","paddingBottom","paddingTop","fontSize"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarContent.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAGEC,QAAQ,EAERC,UAAU,EAEVC,SAAS,EACTC,IAAI,QAGC,cAAc;AAErB,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,KAAK,QAAQ,+BAA+B;AAErD,OAAOC,IAAI,MAAmB,oBAAoB;AAiElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAGA,CAAC;EACrBL,KAAK,EAAEM,UAAU;EACjBC,QAAQ;EACRC,aAAa;EACbC,OAAO;EACPC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,UAAU;EACVC,KAAK;EACLC,0BAA0B;EAC1BC,IAAI,GAAG,OAAO;EACdC,KAAK,EAAEC,cAAc;EACrBC,MAAM,GAAG,gBAAgB;EACzB,GAAGC;AACE,CAAC,KAAK;EACX,MAAMH,KAAK,GAAGf,gBAAgB,CAACgB,cAAc,CAAC;EAC9C,MAAM;IAAEG,IAAI;IAAEC;EAAO,CAAC,GAAGL,KAA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,iBAAiB,EAAE,CAAC;IACpBC,cAAc,EAAE,UAAU;IAC1BC,aAAa,EAAE;EACjB,CAAC;EACD1B,gBAAgB,EAAE;IAChBwB,iBAAiB,EAAE,CAAC;IACpBG,UAAU,EAAE,EAAE;IACdF,cAAc,EAAE,UAAU;IAC1BC,aAAa,EAAE;EACjB,CAAC;EACDhD,KAAK,EAAE;IACLkD,QAAQ,EAAEpE,QAAQ,CAACmD,EAAE,KAAK,KAAK,GAAG,EAAE,GAAG;EACzC,CAAC;EACDxC,QAAQ,EAAE;IACRyD,QAAQ,EAAEpE,QAAQ,CAACmD,EAAE,KAAK,KAAK,GAAG,EAAE,GAAG;EACzC;AACF,CAAC,CAAC;AAEF,MAAMO,aAAgC,GAAG,QAAQ;AAEjD,eAAejD,aAAa;;AAE5B;AACA,SAASA,aAAa","ignoreList":[]}

View File

@@ -0,0 +1,100 @@
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); }
import * as React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { Appbar } from './Appbar';
import { DEFAULT_APPBAR_HEIGHT, getAppbarBackgroundColor, modeAppbarHeight, getAppbarBorders } from './utils';
import { useInternalTheme } from '../../core/theming';
import shadow from '../../styles/shadow';
/**
* A component to use as a header at the top of the screen.
* It can contain the screen title, controls such as navigation buttons, menu button etc.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Appbar } from 'react-native-paper';
*
* const MyComponent = () => {
* const _goBack = () => console.log('Went back');
*
* const _handleSearch = () => console.log('Searching');
*
* const _handleMore = () => console.log('Shown more');
*
* return (
* <Appbar.Header>
* <Appbar.BackAction onPress={_goBack} />
* <Appbar.Content title="Title" />
* <Appbar.Action icon="magnify" onPress={_handleSearch} />
* <Appbar.Action icon="dots-vertical" onPress={_handleMore} />
* </Appbar.Header>
* );
* };
*
* export default MyComponent;
* ```
*/
const AppbarHeader = ({
// Don't use default props since we check it to know whether we should use SafeAreaView
statusBarHeight,
style,
dark,
mode = Platform.OS === 'ios' ? 'center-aligned' : 'small',
elevated = false,
theme: themeOverrides,
testID = 'appbar-header',
...rest
}) => {
const theme = useInternalTheme(themeOverrides);
const {
isV3
} = theme;
const flattenedStyle = StyleSheet.flatten(style);
const {
height = isV3 ? modeAppbarHeight[mode] : DEFAULT_APPBAR_HEIGHT,
elevation = isV3 ? elevated ? 2 : 0 : 4,
backgroundColor: customBackground,
zIndex = isV3 && elevated ? 1 : 0,
...restStyle
} = flattenedStyle || {};
const borderRadius = getAppbarBorders(restStyle);
const backgroundColor = getAppbarBackgroundColor(theme, elevation, customBackground, elevated);
const {
top,
left,
right
} = useSafeAreaInsets();
return /*#__PURE__*/React.createElement(View, {
testID: `${testID}-root-layer`,
style: [{
backgroundColor,
zIndex,
elevation,
paddingTop: statusBarHeight ?? top,
paddingHorizontal: Math.max(left, right)
}, borderRadius, shadow(elevation)]
}, /*#__PURE__*/React.createElement(Appbar, _extends({
testID: testID,
style: [{
height,
backgroundColor
}, styles.appbar, restStyle],
dark: dark
}, isV3 && {
mode
}, rest, {
theme: theme
})));
};
AppbarHeader.displayName = 'Appbar.Header';
const styles = StyleSheet.create({
appbar: {
elevation: 0
}
});
export default AppbarHeader;
// @component-docs ignore-next-line
export { AppbarHeader };
//# sourceMappingURL=AppbarHeader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","Platform","StyleSheet","View","useSafeAreaInsets","Appbar","DEFAULT_APPBAR_HEIGHT","getAppbarBackgroundColor","modeAppbarHeight","getAppbarBorders","useInternalTheme","shadow","AppbarHeader","statusBarHeight","style","dark","mode","OS","elevated","theme","themeOverrides","testID","rest","isV3","flattenedStyle","flatten","height","elevation","backgroundColor","customBackground","zIndex","restStyle","borderRadius","top","left","right","createElement","paddingTop","paddingHorizontal","Math","max","_extends","styles","appbar","displayName","create"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarHeader.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAGEC,QAAQ,EAERC,UAAU,EACVC,IAAI,QAEC,cAAc;AAErB,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,MAAM,QAAQ,UAAU;AACjC,SACEC,qBAAqB,EACrBC,wBAAwB,EACxBC,gBAAgB,EAChBC,gBAAgB,QACX,SAAS;AAChB,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,OAAOC,MAAM,MAAM,qBAAqB;AA4CxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAGA,CAAC;EACpB;EACAC,eAAe;EACfC,KAAK;EACLC,IAAI;EACJC,IAAI,GAAGf,QAAQ,CAACgB,EAAE,KAAK,KAAK,GAAG,gBAAgB,GAAG,OAAO;EACzDC,QAAQ,GAAG,KAAK;EAChBC,KAAK,EAAEC,cAAc;EACrBC,MAAM,GAAG,eAAe;EACxB,GAAGC;AACE,CAAC,KAAK;EACX,MAAMH,KAAK,GAAGT,gBAAgB,CAACU,cAAc,CAAC;EAC9C,MAAM;IAAEG;EAAK,CAAC,GAAGJ,KAAK;EAEtB,MAAMK,cAAc,GAAGtB,UAAU,CAACuB,OAAO,CAACX,KAAK,CAAC;EAChD,MAAM;IACJY,MAAM,GAAGH,IAAI,GAAGf,gBAAgB,CAACQ,IAAI,CAAC,GAAGV,qBAAqB;IAC9DqB,SAAS,GAAGJ,IAAI,GAAIL,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAI,CAAC;IACzCU,eAAe,EAAEC,gBAAgB;IACjCC,MAAM,GAAGP,IAAI,IAAIL,QAAQ,GAAG,CAAC,GAAG,CAAC;IACjC,GAAGa;EACL,CAAC,GAAIP,cAAc,IAAI,CAAC,CAKvB;EAED,MAAMQ,YAAY,GAAGvB,gBAAgB,CAACsB,SAAS,CAAC;EAEhD,MAAMH,eAAe,GAAGrB,wBAAwB,CAC9CY,KAAK,EACLQ,SAAS,EACTE,gBAAgB,EAChBX,QACF,CAAC;EAED,MAAM;IAAEe,GAAG;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAG/B,iBAAiB,CAAC,CAAC;EAEhD,oBACEJ,KAAA,CAAAoC,aAAA,CAACjC,IAAI;IACHkB,MAAM,EAAE,GAAGA,MAAM,aAAc;IAC/BP,KAAK,EAAE,CACL;MACEc,eAAe;MACfE,MAAM;MACNH,SAAS;MACTU,UAAU,EAAExB,eAAe,IAAIoB,GAAG;MAClCK,iBAAiB,EAAEC,IAAI,CAACC,GAAG,CAACN,IAAI,EAAEC,KAAK;IACzC,CAAC,EACDH,YAAY,EACZrB,MAAM,CAACgB,SAAS,CAAC;EACjB,gBAEF3B,KAAA,CAAAoC,aAAA,CAAC/B,MAAM,EAAAoC,QAAA;IACLpB,MAAM,EAAEA,MAAO;IACfP,KAAK,EAAE,CAAC;MAAEY,MAAM;MAAEE;IAAgB,CAAC,EAAEc,MAAM,CAACC,MAAM,EAAEZ,SAAS,CAAE;IAC/DhB,IAAI,EAAEA;EAAK,GACNQ,IAAI,IAAI;IACXP;EACF,CAAC,EACGM,IAAI;IACRH,KAAK,EAAEA;EAAM,EACd,CACG,CAAC;AAEX,CAAC;AAEDP,YAAY,CAACgC,WAAW,GAAG,eAAe;AAE1C,MAAMF,MAAM,GAAGxC,UAAU,CAAC2C,MAAM,CAAC;EAC/BF,MAAM,EAAE;IACNhB,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAef,YAAY;;AAE3B;AACA,SAASA,YAAY","ignoreList":[]}

View File

@@ -0,0 +1,19 @@
import AppbarComponent from './Appbar';
import AppbarAction from './AppbarAction';
import AppbarBackAction from './AppbarBackAction';
import AppbarContent from './AppbarContent';
import AppbarHeader from './AppbarHeader';
const Appbar = Object.assign(
// @component ./Appbar.tsx
AppbarComponent, {
// @component ./AppbarContent.tsx
Content: AppbarContent,
// @component ./AppbarAction.tsx
Action: AppbarAction,
// @component ./AppbarBackAction.tsx
BackAction: AppbarBackAction,
// @component ./AppbarHeader.tsx
Header: AppbarHeader
});
export default Appbar;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["AppbarComponent","AppbarAction","AppbarBackAction","AppbarContent","AppbarHeader","Appbar","Object","assign","Content","Action","BackAction","Header"],"sourceRoot":"../../../../src","sources":["components/Appbar/index.ts"],"mappings":"AAAA,OAAOA,eAAe,MAAM,UAAU;AACtC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,MAAMC,MAAM,GAAGC,MAAM,CAACC,MAAM;AAC1B;AACAP,eAAe,EACf;EACE;EACAQ,OAAO,EAAEL,aAAa;EACtB;EACAM,MAAM,EAAER,YAAY;EACpB;EACAS,UAAU,EAAER,gBAAgB;EAC5B;EACAS,MAAM,EAAEP;AACV,CACF,CAAC;AAED,eAAeC,MAAM","ignoreList":[]}

View File

@@ -0,0 +1,123 @@
import React from 'react';
import { StyleSheet } from 'react-native';
import overlay from '../../styles/overlay';
import { black, white } from '../../styles/themes/v2/colors';
const borderStyleProperties = ['borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'];
export const getAppbarBackgroundColor = (theme, elevation, customBackground, elevated) => {
const {
isV3,
dark: isDarkTheme,
mode,
colors
} = theme;
const isAdaptiveMode = mode === 'adaptive';
if (customBackground) {
return customBackground;
}
if (!isV3) {
if (isDarkTheme && isAdaptiveMode) {
return overlay(elevation, colors === null || colors === void 0 ? void 0 : colors.surface);
}
return colors.primary;
}
if (elevated) {
return theme.colors.elevation.level2;
}
return colors.surface;
};
export const getAppbarColor = ({
color,
isDark,
isV3
}) => {
if (typeof color !== 'undefined') {
return color;
}
if (isDark) {
return white;
}
if (isV3) {
return undefined;
}
return black;
};
export const getAppbarBorders = style => {
const borders = {};
for (const property of borderStyleProperties) {
const value = style[property];
if (value) {
borders[property] = value;
}
}
return borders;
};
export const DEFAULT_APPBAR_HEIGHT = 56;
const MD3_DEFAULT_APPBAR_HEIGHT = 64;
export const modeAppbarHeight = {
small: MD3_DEFAULT_APPBAR_HEIGHT,
medium: 112,
large: 152,
'center-aligned': MD3_DEFAULT_APPBAR_HEIGHT
};
export const modeTextVariant = {
small: 'titleLarge',
medium: 'headlineSmall',
large: 'headlineMedium',
'center-aligned': 'titleLarge'
};
export const filterAppbarActions = (children, isLeading = false) => {
return React.Children.toArray(children).filter(child => {
if (! /*#__PURE__*/React.isValidElement(child)) return false;
return isLeading ? child.props.isLeading : !child.props.isLeading;
});
};
export const renderAppbarContent = ({
children,
isDark,
shouldCenterContent = false,
isV3,
renderOnly,
renderExcept,
mode = 'small',
theme
}) => {
return React.Children.toArray(children).filter(child => child != null && typeof child !== 'boolean').filter(child =>
// @ts-expect-error: TypeScript complains about the type of type but it doesn't matter
renderExcept ? !renderExcept.includes(child.type.displayName) : child).filter(child =>
// @ts-expect-error: TypeScript complains about the type of type but it doesn't matter
renderOnly ? renderOnly.includes(child.type.displayName) : child).map((child, i) => {
if (! /*#__PURE__*/React.isValidElement(child) || !['Appbar.Content', 'Appbar.Action', 'Appbar.BackAction', 'Tooltip'].includes(
// @ts-expect-error: TypeScript complains about the type of type but it doesn't matter
child.type.displayName)) {
return child;
}
const props = {
theme,
color: getAppbarColor({
color: child.props.color,
isDark,
isV3
})
};
// @ts-expect-error: TypeScript complains about the type of type but it doesn't matter
if (child.type.displayName === 'Appbar.Content') {
props.mode = mode;
props.style = [isV3 ? i === 0 && !shouldCenterContent && styles.v3Spacing : i !== 0 && styles.v2Spacing, shouldCenterContent && styles.centerAlignedContent, child.props.style];
props.color;
}
return /*#__PURE__*/React.cloneElement(child, props);
});
};
const styles = StyleSheet.create({
centerAlignedContent: {
alignItems: 'center'
},
v2Spacing: {
marginLeft: 8
},
v3Spacing: {
marginLeft: 12
}
});
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","StyleSheet","overlay","black","white","borderStyleProperties","getAppbarBackgroundColor","theme","elevation","customBackground","elevated","isV3","dark","isDarkTheme","mode","colors","isAdaptiveMode","surface","primary","level2","getAppbarColor","color","isDark","undefined","getAppbarBorders","style","borders","property","value","DEFAULT_APPBAR_HEIGHT","MD3_DEFAULT_APPBAR_HEIGHT","modeAppbarHeight","small","medium","large","modeTextVariant","filterAppbarActions","children","isLeading","Children","toArray","filter","child","isValidElement","props","renderAppbarContent","shouldCenterContent","renderOnly","renderExcept","includes","type","displayName","map","i","styles","v3Spacing","v2Spacing","centerAlignedContent","cloneElement","create","alignItems","marginLeft"],"sourceRoot":"../../../../src","sources":["components/Appbar/utils.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAkB,cAAc;AAEnD,OAAOC,OAAO,MAAM,sBAAsB;AAC1C,SAASC,KAAK,EAAEC,KAAK,QAAQ,+BAA+B;AAW5D,MAAMC,qBAAqB,GAAG,CAC5B,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,CACzB;AAED,OAAO,MAAMC,wBAAwB,GAAGA,CACtCC,KAAoB,EACpBC,SAAiB,EACjBC,gBAA6B,EAC7BC,QAAkB,KACf;EACH,MAAM;IAAEC,IAAI;IAAEC,IAAI,EAAEC,WAAW;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAGR,KAAK;EACvD,MAAMS,cAAc,GAAGF,IAAI,KAAK,UAAU;EAC1C,IAAIL,gBAAgB,EAAE;IACpB,OAAOA,gBAAgB;EACzB;EAEA,IAAI,CAACE,IAAI,EAAE;IACT,IAAIE,WAAW,IAA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