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,259 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.Appbar = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _AppbarContent = _interopRequireDefault(require("./AppbarContent"));
var _utils = require("./utils");
var _theming = require("../../core/theming");
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 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 = (0, _theming.useInternalTheme)(themeOverrides);
const {
isV3
} = theme;
const flattenedStyle = _reactNative.StyleSheet.flatten(style);
const {
backgroundColor: customBackground,
elevation = isV3 ? elevated ? 2 : 0 : 4,
...restStyle
} = flattenedStyle || {};
const backgroundColor = (0, _utils.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' ? !(0, _color.default)(backgroundColor).isLight() : true;
}
const isV3CenterAlignedMode = isV3 && isMode('center-aligned');
let shouldCenterContent = false;
let shouldAddLeftSpacing = false;
let shouldAddRightSpacing = false;
if (!isV3 && _reactNative.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.default) {
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.default, _extends({
style: [{
backgroundColor
}, styles.appbar, {
height: isV3 ? _utils.modeAppbarHeight[mode] : _utils.DEFAULT_APPBAR_HEIGHT
}, insets, restStyle, !theme.isV3 && {
elevation
}],
elevation: elevation,
container: true
}, rest), shouldAddLeftSpacing ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: spacingStyle
}) : null, (!isV3 || isMode('small') || isMode('center-aligned')) && /*#__PURE__*/React.createElement(React.Fragment, null, (0, _utils.renderAppbarContent)({
children,
isDark,
theme,
isV3,
renderOnly: ['Appbar.BackAction'],
shouldCenterContent: isV3CenterAlignedMode || shouldCenterContent
}), (0, _utils.renderAppbarContent)({
// Filter appbar actions - first leading icons, then trailing icons
children: [...(0, _utils.filterAppbarActions)(children, true), ...(0, _utils.filterAppbarActions)(children)],
isDark,
theme,
isV3,
renderExcept: ['Appbar.BackAction'],
shouldCenterContent: isV3CenterAlignedMode || shouldCenterContent
})), (isMode('medium') || isMode('large')) && /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.columnContainer, isMode('center-aligned') && styles.centerAlignedContainer]
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.controlsRow
}, (0, _utils.renderAppbarContent)({
children,
isDark,
isV3,
renderOnly: ['Appbar.BackAction'],
mode
}), (0, _utils.renderAppbarContent)({
children: (0, _utils.filterAppbarActions)(children, true),
isDark,
isV3,
renderOnly: ['Appbar.Action'],
mode
}), /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.rightActionControls
}, (0, _utils.renderAppbarContent)({
children: (0, _utils.filterAppbarActions)(children),
isDark,
isV3,
renderExcept: ['Appbar', 'Appbar.BackAction', 'Appbar.Content', 'Appbar.Header'],
mode
}))), (0, _utils.renderAppbarContent)({
children,
isDark,
isV3,
renderOnly: ['Appbar.Content'],
mode
})), shouldAddRightSpacing ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: spacingStyle
}) : null);
};
exports.Appbar = Appbar;
const styles = _reactNative.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
}
});
var _default = exports.default = Appbar; // @component-docs ignore-next-line
//# sourceMappingURL=Appbar.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.AppbarAction = void 0;
var React = _interopRequireWildcard(require("react"));
var _color = _interopRequireDefault(require("color"));
var _theming = require("../../core/theming");
var _colors = require("../../styles/themes/v2/colors");
var _forwardRef = require("../../utils/forwardRef");
var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
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 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 = exports.AppbarAction = (0, _forwardRef.forwardRef)(({
size = 24,
color: iconColor,
icon,
disabled,
onPress,
accessibilityLabel,
isLeading,
theme: themeOverrides,
rippleColor,
...rest
}, ref) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const actionIconColor = iconColor ? iconColor : theme.isV3 ? isLeading ? theme.colors.onSurface : theme.colors.onSurfaceVariant : (0, _color.default)(_colors.black).alpha(0.54).rgb().string();
return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
size: size,
onPress: onPress,
iconColor: actionIconColor,
icon: icon,
disabled: disabled,
accessibilityLabel: accessibilityLabel,
animated: true,
ref: ref,
rippleColor: rippleColor
}, rest));
});
AppbarAction.displayName = 'Appbar.Action';
var _default = exports.default = AppbarAction; // @component-docs ignore-next-line
//# sourceMappingURL=AppbarAction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_color","_interopRequireDefault","_theming","_colors","_forwardRef","_IconButton","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","AppbarAction","exports","forwardRef","size","color","iconColor","icon","disabled","onPress","accessibilityLabel","isLeading","theme","themeOverrides","rippleColor","rest","ref","useInternalTheme","actionIconColor","isV3","colors","onSurface","onSurfaceVariant","black","alpha","rgb","string","createElement","animated","displayName","_default"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarAction.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAEA,IAAAM,WAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAAkD,SAAAE,uBAAAK,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,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAAAH,CAAA,gBAAAG,CAAA,OAAAW,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAG,CAA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AI,GACVR,SAAS,GACPC,KAAK,CAACQ,MAAM,CAACC,SAAS,GACtBT,KAAK,CAACQ,MAAM,CAACE,gBAAgB,GAC/B,IAAAjB,cAAK,EAACkB,aAAK,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EAE3C,oBACE3D,KAAA,CAAA4D,aAAA,CAACpD,WAAA,CAAAG,OAAU,EAAAiB,QAAA;IACTS,IAAI,EAAEA,IAAK;IACXK,OAAO,EAAEA,OAAQ;IACjBH,SAAS,EAAEY,eAAgB;IAC3BX,IAAI,EAAEA,IAAK;IACXC,QAAQ,EAAEA,QAAS;IACnBE,kBAAkB,EAAEA,kBAAmB;IACvCkB,QAAQ;IACRZ,GAAG,EAAEA,GAAI;IACTF,WAAW,EAAEA;EAAY,GACrBC,IAAI,CACT,CAAC;AAEN,CACF,CAAC;AAEDd,YAAY,CAAC4B,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAA5B,OAAA,CAAAxB,OAAA,GAE5BuB,YAAY,EAE3B","ignoreList":[]}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.AppbarBackAction = void 0;
var React = _interopRequireWildcard(require("react"));
var _AppbarAction = _interopRequireDefault(require("./AppbarAction"));
var _AppbarBackIcon = _interopRequireDefault(require("./AppbarBackIcon"));
var _forwardRef = require("../../utils/forwardRef");
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 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 = exports.AppbarBackAction = (0, _forwardRef.forwardRef)(({
accessibilityLabel = 'Back',
...rest
}, ref) => /*#__PURE__*/React.createElement(_AppbarAction.default, _extends({
accessibilityLabel: accessibilityLabel
}, rest, {
icon: _AppbarBackIcon.default,
isLeading: true,
ref: ref
})));
AppbarBackAction.displayName = 'Appbar.BackAction';
var _default = exports.default = AppbarBackAction; // @component-docs ignore-next-line
//# sourceMappingURL=AppbarBackAction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_AppbarAction","_interopRequireDefault","_AppbarBackIcon","_forwardRef","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","AppbarBackAction","exports","forwardRef","accessibilityLabel","rest","ref","createElement","icon","AppbarBackIcon","isLeading","displayName","_default"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarBackAction.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAUA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAAoD,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CA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AAAK,CAAA,IAAAF,CAAA,OAAAW,cAAA,CAAAC,IAAA,CAAAZ,CAAA,EAAAE,CAAA,MAAAC,CAAA,CAAAD,CAAA,IAAAF,CAAA,CAAAE,CAAA,aAAAC,CAAA,KAAAa,QAAA,CAAAK,KAAA,OAAAF,SAAA;AA8BpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,sBAAU,EACjC,CAAC;EAAEC,kBAAkB,GAAG,MAAM;EAAE,GAAGC;AAAY,CAAC,EAAEC,GAAG,kBACnDrC,KAAA,CAAAsC,aAAA,CAACnC,aAAA,CAAAM,OAAY,EAAAiB,QAAA;EACXS,kBAAkB,EAAEA;AAAmB,GACnCC,IAAI;EACRG,IAAI,EAAEC,uBAAe;EACrBC,SAAS;EACTJ,GAAG,EAAEA;AAAI,EACV,CAEL,CAAC;AAEDL,gBAAgB,CAACU,WAAW,GAAG,mBAAmB;AAAC,IAAAC,QAAA,GAAAV,OAAA,CAAAxB,OAAA,GAEpCuB,gBAAgB,EAE/B","ignoreList":[]}

View File

@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.AppbarBackIcon = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _MaterialCommunityIcon = _interopRequireDefault(require("../MaterialCommunityIcon"));
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 AppbarBackIcon = ({
size,
color
}) => {
const iosIconSize = size - 3;
return _reactNative.Platform.OS === 'ios' ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.wrapper, {
width: size,
height: size,
transform: [{
scaleX: _reactNative.I18nManager.getConstants().isRTL ? -1 : 1
}]
}]
}, /*#__PURE__*/React.createElement(_reactNative.Image, {
source: require('../../assets/back-chevron.png'),
style: [styles.icon, {
tintColor: color,
width: iosIconSize,
height: iosIconSize
}],
accessibilityIgnoresInvertColors: true
})) : /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: "arrow-left",
color: color,
size: size,
direction: _reactNative.I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
});
};
exports.AppbarBackIcon = AppbarBackIcon;
const styles = _reactNative.StyleSheet.create({
wrapper: {
alignItems: 'center',
justifyContent: 'center'
},
icon: {
resizeMode: 'contain'
}
});
var _default = exports.default = AppbarBackIcon; // @component-docs ignore-next-line
//# sourceMappingURL=AppbarBackIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_MaterialCommunityIcon","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AppbarBackIcon","size","color","iosIconSize","Platform","OS","createElement","View","style","styles","wrapper","width","height","transform","scaleX","I18nManager","getConstants","isRTL","Image","source","icon","tintColor","accessibilityIgnoresInvertColors","name","direction","exports","StyleSheet","create","alignItems","justifyContent","resizeMode","_default"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarBackIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6D,S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,CAAA+B,aAAA,CAAC5B,YAAA,CAAA6B,IAAI;IACHC,KAAK,EAAE,CACLC,MAAM,CAACC,OAAO,EACd;MACEC,KAAK,EAAEV,IAAI;MACXW,MAAM,EAAEX,IAAI;MACZY,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAEC,wBAAW,CAACC,YAAY,CAAC,CAAC,CAACC,KAAK,GAAG,CAAC,CAAC,GAAG;MAAE,CAAC;IACnE,CAAC;EACD,gBAEF1C,KAAA,CAAA+B,aAAA,CAAC5B,YAAA,CAAAwC,KAAK;IACJC,MAAM,EAAE1C,OAAO,CAAC,+BAA+B,CAAE;IACjD+B,KAAK,EAAE,CACLC,MAAM,CAACW,IAAI,EACX;MAAEC,SAAS,EAAEnB,KAAK;MAAES,KAAK,EAAER,WAAW;MAAES,MAAM,EAAET;IAAY,CAAC,CAC7D;IACFmB,gCAAgC;EAAA,CACjC,CACG,CAAC,gBAEP/C,KAAA,CAAA+B,aAAA,CAAC3B,sBAAA,CAAAI,OAAqB;IACpBwC,IAAI,EAAC,YAAY;IACjBrB,KAAK,EAAEA,KAAM;IACbD,IAAI,EAAEA,IAAK;IACXuB,SAAS,EAAET,wBAAW,CAACC,YAAY,CAAC,CAAC,CAACC,KAAK,GAAG,KAAK,GAAG;EAAM,CAC7D,CACF;AACH,CAAC;AAACQ,OAAA,CAAAzB,cAAA,GAAAA,cAAA;AAEF,MAAMS,MAAM,GAAGiB,uBAAU,CAACC,MAAM,CAAC;EAC/BjB,OAAO,EAAE;IACPkB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDT,IAAI,EAAE;IACJU,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAN,OAAA,CAAA1C,OAAA,GAEYiB,cAAc,EAE7B","ignoreList":[]}

View File

@@ -0,0 +1,140 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.AppbarContent = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _colors = require("../../styles/themes/v2/colors");
var _Text = _interopRequireDefault(require("../Typography/Text"));
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 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 = (0, _theming.useInternalTheme)(themeOverrides);
const {
isV3,
colors
} = theme;
const titleTextColor = titleColor ? titleColor : isV3 ? colors.onSurface : _colors.white;
const subtitleColor = (0, _color.default)(titleTextColor).alpha(0.7).rgb().string();
const modeContainerStyles = {
small: styles.v3DefaultContainer,
medium: styles.v3MediumContainer,
large: styles.v3LargeContainer,
'center-aligned': styles.v3DefaultContainer
};
const variant = _utils.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.default, _extends({}, isV3 && {
variant
}, {
ref: titleRef,
style: [{
color: titleTextColor,
...(isV3 ? theme.fonts[variant] : _reactNative.Platform.OS === 'ios' ? theme.fonts.regular : theme.fonts.medium)
}, !isV3 && styles.title, titleStyle],
numberOfLines: 1,
accessible: true,
accessibilityRole: onPress ? 'none' : _reactNative.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.default, {
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(_reactNative.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(_reactNative.View, contentWrapperProps, content);
};
exports.AppbarContent = AppbarContent;
AppbarContent.displayName = 'Appbar.Content';
const styles = _reactNative.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: _reactNative.Platform.OS === 'ios' ? 17 : 20
},
subtitle: {
fontSize: _reactNative.Platform.OS === 'ios' ? 11 : 14
}
});
const touchableRole = 'button';
var _default = exports.default = AppbarContent; // @component-docs ignore-next-line
//# sourceMappingURL=AppbarContent.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.AppbarHeader = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _Appbar = require("./Appbar");
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _shadow = _interopRequireDefault(require("../../styles/shadow"));
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 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 = _reactNative.Platform.OS === 'ios' ? 'center-aligned' : 'small',
elevated = false,
theme: themeOverrides,
testID = 'appbar-header',
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
isV3
} = theme;
const flattenedStyle = _reactNative.StyleSheet.flatten(style);
const {
height = isV3 ? _utils.modeAppbarHeight[mode] : _utils.DEFAULT_APPBAR_HEIGHT,
elevation = isV3 ? elevated ? 2 : 0 : 4,
backgroundColor: customBackground,
zIndex = isV3 && elevated ? 1 : 0,
...restStyle
} = flattenedStyle || {};
const borderRadius = (0, _utils.getAppbarBorders)(restStyle);
const backgroundColor = (0, _utils.getAppbarBackgroundColor)(theme, elevation, customBackground, elevated);
const {
top,
left,
right
} = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
return /*#__PURE__*/React.createElement(_reactNative.View, {
testID: `${testID}-root-layer`,
style: [{
backgroundColor,
zIndex,
elevation,
paddingTop: statusBarHeight ?? top,
paddingHorizontal: Math.max(left, right)
}, borderRadius, (0, _shadow.default)(elevation)]
}, /*#__PURE__*/React.createElement(_Appbar.Appbar, _extends({
testID: testID,
style: [{
height,
backgroundColor
}, styles.appbar, restStyle],
dark: dark
}, isV3 && {
mode
}, rest, {
theme: theme
})));
};
exports.AppbarHeader = AppbarHeader;
AppbarHeader.displayName = 'Appbar.Header';
const styles = _reactNative.StyleSheet.create({
appbar: {
elevation: 0
}
});
var _default = exports.default = AppbarHeader; // @component-docs ignore-next-line
//# sourceMappingURL=AppbarHeader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_Appbar","_utils","_theming","_shadow","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","AppbarHeader","statusBarHeight","style","dark","mode","Platform","OS","elevated","theme","themeOverrides","testID","rest","useInternalTheme","isV3","flattenedStyle","StyleSheet","flatten","height","modeAppbarHeight","DEFAULT_APPBAR_HEIGHT","elevation","backgroundColor","customBackground","zIndex","restStyle","borderRadius","getAppbarBorders","getAppbarBackgroundColor","top","left","right","useSafeAreaInsets","createElement","View","paddingTop","paddingHorizontal","Math","max","shadow","Appbar","styles","appbar","exports","displayName","create","_default"],"sourceRoot":"../../../../src","sources":["components/Appbar/AppbarHeader.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAMA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAC,sBAAA,CAAAP,OAAA;AAAyC,SAAAO,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,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,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,C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A;IACLgB,MAAM,EAAEA,MAAO;IACfR,KAAK,EAAE,CAAC;MAAEe,MAAM;MAAEI;IAAgB,CAAC,EAAEmB,MAAM,CAACC,MAAM,EAAEjB,SAAS,CAAE;IAC/DrB,IAAI,EAAEA;EAAK,GACNU,IAAI,IAAI;IACXT;EACF,CAAC,EACGO,IAAI;IACRH,KAAK,EAAEA;EAAM,EACd,CACG,CAAC;AAEX,CAAC;AAACkC,OAAA,CAAA1C,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAAC2C,WAAW,GAAG,eAAe;AAE1C,MAAMH,MAAM,GAAGzB,uBAAU,CAAC6B,MAAM,CAAC;EAC/BH,MAAM,EAAE;IACNrB,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAAC,IAAAyB,QAAA,GAAAH,OAAA,CAAAjE,OAAA,GAEYuB,YAAY,EAE3B","ignoreList":[]}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _Appbar = _interopRequireDefault(require("./Appbar"));
var _AppbarAction = _interopRequireDefault(require("./AppbarAction"));
var _AppbarBackAction = _interopRequireDefault(require("./AppbarBackAction"));
var _AppbarContent = _interopRequireDefault(require("./AppbarContent"));
var _AppbarHeader = _interopRequireDefault(require("./AppbarHeader"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const Appbar = Object.assign(
// @component ./Appbar.tsx
_Appbar.default, {
// @component ./AppbarContent.tsx
Content: _AppbarContent.default,
// @component ./AppbarAction.tsx
Action: _AppbarAction.default,
// @component ./AppbarBackAction.tsx
BackAction: _AppbarBackAction.default,
// @component ./AppbarHeader.tsx
Header: _AppbarHeader.default
});
var _default = exports.default = Appbar;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_Appbar","_interopRequireDefault","require","_AppbarAction","_AppbarBackAction","_AppbarContent","_AppbarHeader","e","__esModule","default","Appbar","Object","assign","AppbarComponent","Content","AppbarContent","Action","AppbarAction","BackAction","AppbarBackAction","Header","AppbarHeader","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Appbar/index.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,cAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1C,MAAMG,MAAM,GAAGC,MAAM,CAACC,MAAM;AAC1B;AACAC,eAAe,EACf;EACE;EACAC,OAAO,EAAEC,sBAAa;EACtB;EACAC,MAAM,EAAEC,qBAAY;EACpB;EACAC,UAAU,EAAEC,yBAAgB;EAC5B;EACAC,MAAM,EAAEC;AACV,CACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEaC,MAAM","ignoreList":[]}

View File

@@ -0,0 +1,135 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.renderAppbarContent = exports.modeTextVariant = exports.modeAppbarHeight = exports.getAppbarColor = exports.getAppbarBorders = exports.getAppbarBackgroundColor = exports.filterAppbarActions = exports.DEFAULT_APPBAR_HEIGHT = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactNative = require("react-native");
var _overlay = _interopRequireDefault(require("../../styles/overlay"));
var _colors = require("../../styles/themes/v2/colors");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const borderStyleProperties = ['borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'];
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 (0, _overlay.default)(elevation, colors === null || colors === void 0 ? void 0 : colors.surface);
}
return colors.primary;
}
if (elevated) {
return theme.colors.elevation.level2;
}
return colors.surface;
};
exports.getAppbarBackgroundColor = getAppbarBackgroundColor;
const getAppbarColor = ({
color,
isDark,
isV3
}) => {
if (typeof color !== 'undefined') {
return color;
}
if (isDark) {
return _colors.white;
}
if (isV3) {
return undefined;
}
return _colors.black;
};
exports.getAppbarColor = getAppbarColor;
const getAppbarBorders = style => {
const borders = {};
for (const property of borderStyleProperties) {
const value = style[property];
if (value) {
borders[property] = value;
}
}
return borders;
};
exports.getAppbarBorders = getAppbarBorders;
const DEFAULT_APPBAR_HEIGHT = exports.DEFAULT_APPBAR_HEIGHT = 56;
const MD3_DEFAULT_APPBAR_HEIGHT = 64;
const modeAppbarHeight = exports.modeAppbarHeight = {
small: MD3_DEFAULT_APPBAR_HEIGHT,
medium: 112,
large: 152,
'center-aligned': MD3_DEFAULT_APPBAR_HEIGHT
};
const modeTextVariant = exports.modeTextVariant = {
small: 'titleLarge',
medium: 'headlineSmall',
large: 'headlineMedium',
'center-aligned': 'titleLarge'
};
const filterAppbarActions = (children, isLeading = false) => {
return _react.default.Children.toArray(children).filter(child => {
if (! /*#__PURE__*/_react.default.isValidElement(child)) return false;
return isLeading ? child.props.isLeading : !child.props.isLeading;
});
};
exports.filterAppbarActions = filterAppbarActions;
const renderAppbarContent = ({
children,
isDark,
shouldCenterContent = false,
isV3,
renderOnly,
renderExcept,
mode = 'small',
theme
}) => {
return _react.default.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.default.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.default.cloneElement(child, props);
});
};
exports.renderAppbarContent = renderAppbarContent;
const styles = _reactNative.StyleSheet.create({
centerAlignedContent: {
alignItems: 'center'
},
v2Spacing: {
marginLeft: 8
},
v3Spacing: {
marginLeft: 12
}
});
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_overlay","_colors","e","__esModule","default","borderStyleProperties","getAppbarBackgroundColor","theme","elevation","customBackground","elevated","isV3","dark","isDarkTheme","mode","colors","isAdaptiveMode","overlay","surface","primary","level2","exports","getAppbarColor","color","isDark","white","undefined","black","getAppbarBorders","style","borders","property","value","DEFAULT_APPBAR_HEIGHT","MD3_DEFAULT_APPBAR_HEIGHT","modeAppbarHeight","small","medium","large","modeTextVariant","filterAppbarActions","children","isLeading","React","Children","toArray","filter","child","isValidElement","props","renderAppbarContent","shouldCenterContent","renderOnly","renderExcept","includes","type","displayName","map","i","styles","v3Spacing","v2Spacing","centerAlignedContent","cloneElement","StyleSheet","create","alignItems","marginLeft"],"sourceRoot":"../../../../src","sources":["components/Appbar/utils.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,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