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

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

View File

@@ -0,0 +1,52 @@
"use strict";
const SKIP = Symbol('SKIP');
module.exports = function rewire(babel, options) {
const t = babel.types;
const {
name,
index,
mappings
} = require(options.mappings || '../../mappings.json');
return {
visitor: {
ImportDeclaration(path) {
if (path.node.source.value !== name || path.node[SKIP]) {
return;
}
path.node.source.value = `${name}/${index}`;
path.replaceWithMultiple(path.node.specifiers.reduce((declarations, specifier) => {
const mapping = mappings[specifier.imported.name];
if (mapping) {
const alias = `${name}/${mapping.path}`;
const identifier = t.identifier(specifier.local.name);
let s;
switch (mapping.name) {
case 'default':
s = t.importDefaultSpecifier(identifier);
break;
case '*':
s = t.importNamespaceSpecifier(identifier);
break;
default:
s = t.importSpecifier(identifier, t.identifier(mapping.name));
}
declarations.push(t.importDeclaration([s], t.stringLiteral(alias)));
} else {
const previous = declarations.find(d => d.source.value === path.node.source.value);
if (previous) {
previous.specifiers.push(specifier);
} else {
const node = t.importDeclaration([specifier], path.node.source);
node[SKIP] = true;
declarations.push(node);
}
}
return declarations;
}, []));
path.requeue();
}
}
};
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["SKIP","Symbol","module","exports","rewire","babel","options","t","types","name","index","mappings","require","visitor","ImportDeclaration","path","node","source","value","replaceWithMultiple","specifiers","reduce","declarations","specifier","mapping","imported","alias","identifier","local","s","importDefaultSpecifier","importNamespaceSpecifier","importSpecifier","push","importDeclaration","stringLiteral","previous","find","d","requeue"],"sourceRoot":"../../../src","sources":["babel/index.js"],"mappings":";;AAAA,MAAMA,IAAI,GAAGC,MAAM,CAAC,MAAM,CAAC;AAE3BC,MAAM,CAACC,OAAO,GAAG,SAASC,MAAMA,CAACC,KAAK,EAAEC,OAAO,EAAE;EAC/C,MAAMC,CAAC,GAAGF,KAAK,CAACG,KAAK;EAErB,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGC,OAAO,CAACN,OAAO,CAACK,QAAQ,IACxD,qBAAqB,CAAC;EAExB,OAAO;IACLE,OAAO,EAAE;MACPC,iBAAiBA,CAACC,IAAI,EAAE;QACtB,IAAIA,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,KAAK,KAAKT,IAAI,IAAIM,IAAI,CAACC,IAAI,CAAChB,IAAI,CAAC,EAAE;UACtD;QACF;QAEAe,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,KAAK,GAAG,GAAGT,IAAI,IAAIC,KAAK,EAAE;QAC3CK,IAAI,CAACI,mBAAmB,CACtBJ,IAAI,CAACC,IAAI,CAACI,UAAU,CAACC,MAAM,CAAC,CAACC,YAAY,EAAEC,SAAS,KAAK;UACvD,MAAMC,OAAO,GAAGb,QAAQ,CAACY,SAAS,CAACE,QAAQ,CAAChB,IAAI,CAAC;U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I,CAACwB,OAAO,CAAC,CAAC;MAChB;IACF;EACF,CAAC;AACH,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,198 @@
"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); }
const DURATION = 2400;
/**
* Activity indicator is used to present progress of some activity in the app.
* It can be used as a drop-in replacement for the ActivityIndicator shipped with React Native.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { ActivityIndicator, MD2Colors } from 'react-native-paper';
*
* const MyComponent = () => (
* <ActivityIndicator animating={true} color={MD2Colors.red800} />
* );
*
* export default MyComponent;
* ```
*/
const ActivityIndicator = ({
animating = true,
color: indicatorColor,
hidesWhenStopped = true,
size: indicatorSize = 'small',
style,
theme: themeOverrides,
...rest
}) => {
var _theme$colors;
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
current: timer
} = React.useRef(new _reactNative.Animated.Value(0));
const {
current: fade
} = React.useRef(new _reactNative.Animated.Value(!animating && hidesWhenStopped ? 0 : 1));
const rotation = React.useRef(undefined);
const {
animation: {
scale
}
} = theme;
const startRotation = React.useCallback(() => {
// Show indicator
_reactNative.Animated.timing(fade, {
duration: 200 * scale,
toValue: 1,
isInteraction: false,
useNativeDriver: true
}).start();
// Circular animation in loop
if (rotation.current) {
timer.setValue(0);
// $FlowFixMe
_reactNative.Animated.loop(rotation.current).start();
}
}, [scale, fade, timer]);
const stopRotation = () => {
if (rotation.current) {
rotation.current.stop();
}
};
React.useEffect(() => {
if (rotation.current === undefined) {
// Circular animation in loop
rotation.current = _reactNative.Animated.timing(timer, {
duration: DURATION,
easing: _reactNative.Easing.linear,
// Animated.loop does not work if useNativeDriver is true on web
useNativeDriver: _reactNative.Platform.OS !== 'web',
toValue: 1,
isInteraction: false
});
}
if (animating) {
startRotation();
} else if (hidesWhenStopped) {
// Hide indicator first and then stop rotation
_reactNative.Animated.timing(fade, {
duration: 200 * scale,
toValue: 0,
useNativeDriver: true,
isInteraction: false
}).start(stopRotation);
} else {
stopRotation();
}
}, [animating, fade, hidesWhenStopped, startRotation, scale, timer]);
const color = indicatorColor || ((_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary);
const size = typeof indicatorSize === 'string' ? indicatorSize === 'small' ? 24 : 48 : indicatorSize ? indicatorSize : 24;
const frames = 60 * DURATION / 1000;
const easing = _reactNative.Easing.bezier(0.4, 0.0, 0.7, 1.0);
const containerStyle = {
width: size,
height: size / 2,
overflow: 'hidden'
};
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
style: [styles.container, style]
}, rest, {
accessible: true,
accessibilityRole: "progressbar",
accessibilityState: {
busy: animating
}
}), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [{
width: size,
height: size,
opacity: fade
}],
collapsable: false
}, [0, 1].map(index => {
// Thanks to https://github.com/n4kz/react-native-indicators for the great work
const inputRange = Array.from(new Array(frames), (_, frameIndex) => frameIndex / (frames - 1));
const outputRange = Array.from(new Array(frames), (_, frameIndex) => {
let progress = 2 * frameIndex / (frames - 1);
const rotation = index ? +(360 - 15) : -(180 - 15);
if (progress > 1.0) {
progress = 2.0 - progress;
}
const direction = index ? -1 : +1;
return `${direction * (180 - 30) * easing(progress) + rotation}deg`;
});
const layerStyle = {
width: size,
height: size,
transform: [{
rotate: timer.interpolate({
inputRange: [0, 1],
outputRange: [`${0 + 30 + 15}deg`, `${2 * 360 + 30 + 15}deg`]
})
}]
};
const viewportStyle = {
width: size,
height: size,
transform: [{
translateY: index ? -size / 2 : 0
}, {
rotate: timer.interpolate({
inputRange,
outputRange
})
}]
};
const offsetStyle = index ? {
top: size / 2
} : null;
const lineStyle = {
width: size,
height: size,
borderColor: color,
borderWidth: size / 10,
borderRadius: size / 2
};
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
key: index,
style: [styles.layer]
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: layerStyle
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [containerStyle, offsetStyle],
collapsable: false
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: viewportStyle
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: containerStyle,
collapsable: false
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: lineStyle
}))))));
})));
};
const styles = _reactNative.StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center'
},
layer: {
..._reactNative.StyleSheet.absoluteFill,
justifyContent: 'center',
alignItems: 'center'
}
});
var _default = exports.default = ActivityIndicator;
//# sourceMappingURL=ActivityIndicator.js.map

File diff suppressed because one or more lines are too long

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,CA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,cAAc;EACrBC,WAAW;EACX,GAAGC;AACE,CAAC,EACRC,GAAG,KACA;EACH,MAAMJ,KAAK,GAAG,IAAAK,yBAAgB,EAACJ,cAAc,CAAC;EAE9C,MAAMK,eAAe,GAAGZ,SAAS,GAC7BA,SAAS,GACTM,KAAK,CAACO,IAAI,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,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AAH,MAAA,CAAAI,MAAA,GAAAJ,MAAA,CAAAI,MAAA,CAAAC,IAAA,eAAAf,CAAA,aAAAN,CAAA,MAAAA,CAAA,GAAAsB,SAAA,CAAAC,MAAA,EAAAvB,CAAA,UAAAG,CAAA,GAAAmB,SAAA,CAAAtB,CAAA,YAAAK,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"],"sourceRo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AC;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,C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EAAEC,IAAI,CAACC,GAAG,CAACR,IAAI,EAAEC,KAAK;IACzC,CAAC,EACDL,YAAY,EACZ,IAAAa,eAAM,EAAClB,SAAS,CAAC;EACjB,gBAEFvD,KAAA,CAAAmE,aAAA,CAAC9D,OAAA,CAAAqE,MAAM,EAAA7C,QAAA;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"],"sourceRo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gB,EAAE;MAC/CP,KAAK,CAACnC,IAAI,GAAGA,IAAI;MACjBmC,KAAK,CAACpB,KAAK,GAAG,CACZlB,IAAI,GACA+C,CAAC,KAAK,CAAC,IAAI,CAACP,mBAAmB,IAAIQ,MAAM,CAACC,SAAS,GACnDF,CAAC,KAAK,CAAC,IAAIC,MAAM,CAACE,SAAS,EAC/BV,mBAAmB,IAAIQ,MAAM,CAACG,oBAAoB,EAClDf,KAAK,CAACE,KAAK,CAACpB,KAAK,CAClB;MACDoB,KAAK,CAAC1B,KAAK;IACb;IACA,oBAAOoB,cAAK,CAACoB,YAAY,CAAChB,KAAK,EAAEE,KAAK,CAAC;EACzC,CAAC,CAAC;AACN,CAAC;AAAC5B,OAAA,CAAA6B,mBAAA,GAAAA,mBAAA;AAEF,MAAMS,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BH,oBAAoB,EAAE;IACpBI,UAAU,EAAE;EACd,CAAC;EACDL,SAAS,EAAE;IACTM,UAAU,EAAE;EACd,CAAC;EACDP,SAAS,EAAE;IACTO,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Icon", {
enumerable: true,
get: function () {
return _AvatarIcon.default;
}
});
Object.defineProperty(exports, "Image", {
enumerable: true,
get: function () {
return _AvatarImage.default;
}
});
Object.defineProperty(exports, "Text", {
enumerable: true,
get: function () {
return _AvatarText.default;
}
});
var _AvatarIcon = _interopRequireDefault(require("./AvatarIcon"));
var _AvatarImage = _interopRequireDefault(require("./AvatarImage"));
var _AvatarText = _interopRequireDefault(require("./AvatarText"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
//# sourceMappingURL=Avatar.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_AvatarIcon","_interopRequireDefault","require","_AvatarImage","_AvatarText","e","__esModule","default"],"sourceRoot":"../../../../src","sources":["components/Avatar/Avatar.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA+C,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}

View File

@@ -0,0 +1,65 @@
"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");
var _colors = require("../../styles/themes/v2/colors");
var _getContrastingColor = _interopRequireDefault(require("../../utils/getContrastingColor"));
var _Icon = _interopRequireDefault(require("../Icon"));
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); }
const defaultSize = 64;
/**
* Avatars can be used to represent people in a graphical way.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Avatar } from 'react-native-paper';
*
* const MyComponent = () => (
* <Avatar.Icon size={24} icon="folder" />
* );
* ```
*/
const Avatar = ({
icon,
size = defaultSize,
style,
theme: themeOverrides,
...rest
}) => {
var _theme$colors;
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
backgroundColor = (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary,
...restStyle
} = _reactNative.StyleSheet.flatten(style) || {};
const textColor = rest.color ?? (0, _getContrastingColor.default)(backgroundColor, _colors.white, 'rgba(0, 0, 0, .54)');
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
style: [{
width: size,
height: size,
borderRadius: size / 2,
backgroundColor
}, styles.container, restStyle]
}, rest), /*#__PURE__*/React.createElement(_Icon.default, {
source: icon,
color: textColor,
size: size * 0.6
}));
};
Avatar.displayName = 'Avatar.Icon';
const styles = _reactNative.StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center'
}
});
var _default = exports.default = Avatar;
//# sourceMappingURL=AvatarIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_theming","_colors","_getContrastingColor","_interopRequireDefault","_Icon","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","defaultSize","Avatar","icon","size","style","theme","themeOverrides","rest","_theme$colors","useInternalTheme","backgroundColor","colors","primary","restStyle","StyleSheet","flatten","textColor","color","getContrastingColor","white","createElement","View","width","height","borderRadius","styles","container","source","displayName","create","justifyContent","alignItems","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Avatar/AvatarIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,oBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AA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b,IAAI,EAAEA,IAAI,GAAG;EAAI,CAAE,CACrD,CAAC;AAEX,CAAC;AAEDF,MAAM,CAAC2B,WAAW,GAAG,aAAa;AAElC,MAAMH,MAAM,GAAGX,uBAAU,CAACe,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxD,OAAA,GAEYwB,MAAM","ignoreList":[]}

View File

@@ -0,0 +1,75 @@
"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); }
const defaultSize = 64;
/**
* Avatars can be used to represent people in a graphical way.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Avatar } from 'react-native-paper';
*
* const MyComponent = () => (
* <Avatar.Image size={24} source={require('../assets/avatar.png')} />
* );
* export default MyComponent
* ```
*/
const AvatarImage = ({
size = defaultSize,
source,
style,
onError,
onLayout,
onLoad,
onLoadEnd,
onLoadStart,
onProgress,
theme: themeOverrides,
testID,
...rest
}) => {
const {
colors
} = (0, _theming.useInternalTheme)(themeOverrides);
const {
backgroundColor = colors === null || colors === void 0 ? void 0 : colors.primary
} = _reactNative.StyleSheet.flatten(style) || {};
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
style: [{
width: size,
height: size,
borderRadius: size / 2,
backgroundColor
}, style]
}, rest), typeof source === 'function' && source({
size
}), typeof source !== 'function' && /*#__PURE__*/React.createElement(_reactNative.Image, {
testID: testID,
source: source,
style: {
width: size,
height: size,
borderRadius: size / 2
},
onError: onError,
onLayout: onLayout,
onLoad: onLoad,
onLoadEnd: onLoadEnd,
onLoadStart: onLoadStart,
onProgress: onProgress,
accessibilityIgnoresInvertColors: true
}));
};
AvatarImage.displayName = 'Avatar.Image';
var _default = exports.default = AvatarImage;
//# sourceMappingURL=AvatarImage.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","defaultSize","AvatarImage","size","source","style","onError","onLayout","onLoad","onLoadEnd","onLoadStart","onProgress","theme","themeOverrides","testID","rest","colors","useInternalTheme","backgroundColor","primary","StyleSheet","flatten","createElement","View","width","height","borderRadius","Image","accessibilityIgnoresInvertColors","displayName","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Avatar/AvatarImage.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,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,MAAA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X,CAAC;AAED1B,WAAW,CAAC2B,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7C,OAAA,GAE1BgB,WAAW","ignoreList":[]}

View File

@@ -0,0 +1,79 @@
"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");
var _colors = require("../../styles/themes/v2/colors");
var _getContrastingColor = _interopRequireDefault(require("../../utils/getContrastingColor"));
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); }
const defaultSize = 64;
/**
* Avatars can be used to represent people in a graphical way.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Avatar } from 'react-native-paper';
*
* const MyComponent = () => (
* <Avatar.Text size={24} label="XD" />
* );
* ```
*/
const AvatarText = ({
label,
size = defaultSize,
style,
labelStyle,
color: customColor,
theme: themeOverrides,
maxFontSizeMultiplier,
...rest
}) => {
var _theme$colors;
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
backgroundColor = (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary,
...restStyle
} = _reactNative.StyleSheet.flatten(style) || {};
const textColor = customColor ?? (0, _getContrastingColor.default)(backgroundColor, _colors.white, 'rgba(0, 0, 0, .54)');
const {
fontScale
} = (0, _reactNative.useWindowDimensions)();
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
style: [{
width: size,
height: size,
borderRadius: size / 2,
backgroundColor
}, styles.container, restStyle]
}, rest), /*#__PURE__*/React.createElement(_Text.default, {
style: [styles.text, {
color: textColor,
fontSize: size / 2,
lineHeight: size / fontScale
}, labelStyle],
numberOfLines: 1,
maxFontSizeMultiplier: maxFontSizeMultiplier
}, label));
};
AvatarText.displayName = 'Avatar.Text';
const styles = _reactNative.StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center'
},
text: {
textAlign: 'center',
textAlignVertical: 'center'
}
});
var _default = exports.default = AvatarText;
//# sourceMappingURL=AvatarText.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_theming","_colors","_getContrastingColor","_interopRequireDefault","_Text","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","defaultSize","AvatarText","label","size","style","labelStyle","color","customColor","theme","themeOverrides","maxFontSizeMultiplier","rest","_theme$colors","useInternalTheme","backgroundColor","colors","primary","restStyle","StyleSheet","flatten","textColor","getContrastingColor","white","fontScale","useWindowDimensions","createElement","View","width","height","borderRadius","styles","container","text","fontSize","lineHeight","numberOfLines","displayName","create","justifyContent","alignItems","textAlign","textAlignVertical","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Avatar/AvatarText.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,oBAAA,GAAA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AAC;MACtBW;IACF,CAAC,EACDgB,MAAM,CAACC,SAAS,EAChBd,SAAS;EACT,GACEN,IAAI,gBAER7C,KAAA,CAAA2D,aAAA,CAACnD,KAAA,CAAAG,OAAI;IACH2B,KAAK,EAAE,CACL0B,MAAM,CAACE,IAAI,EACX;MACE1B,KAAK,EAAEc,SAAS;MAChBa,QAAQ,EAAE9B,IAAI,GAAG,CAAC;MAClB+B,UAAU,EAAE/B,IAAI,GAAGoB;IACrB,CAAC,EACDlB,UAAU,CACV;IACF8B,aAAa,EAAE,CAAE;IACjBzB,qBAAqB,EAAEA;EAAsB,GAE5CR,KACG,CACF,CAAC;AAEX,CAAC;AAEDD,UAAU,CAACmC,WAAW,GAAG,aAAa;AAEtC,MAAMN,MAAM,GAAGZ,uBAAU,CAACmB,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDP,IAAI,EAAE;IACJQ,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAEYwB,UAAU","ignoreList":[]}

View File

@@ -0,0 +1,98 @@
"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");
var _colors = require("../styles/themes/v2/colors");
var _getContrastingColor = _interopRequireDefault(require("../utils/getContrastingColor"));
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); }
const defaultSize = 20;
/**
* Badges are small status descriptors for UI elements.
* A badge consists of a small circle, typically containing a number or other short set of characters, that appears in proximity to another object.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Badge } from 'react-native-paper';
*
* const MyComponent = () => (
* <Badge>3</Badge>
* );
*
* export default MyComponent;
* ```
*/
const Badge = ({
children,
size = defaultSize,
style,
theme: themeOverrides,
visible = true,
...rest
}) => {
var _theme$colors;
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
current: opacity
} = React.useRef(new _reactNative.Animated.Value(visible ? 1 : 0));
const {
fontScale
} = (0, _reactNative.useWindowDimensions)();
const isFirstRendering = React.useRef(true);
const {
animation: {
scale
}
} = theme;
React.useEffect(() => {
// Do not run animation on very first rendering
if (isFirstRendering.current) {
isFirstRendering.current = false;
return;
}
_reactNative.Animated.timing(opacity, {
toValue: visible ? 1 : 0,
duration: 150 * scale,
useNativeDriver: true
}).start();
}, [visible, opacity, scale]);
const {
backgroundColor = theme.isV3 ? theme.colors.error : (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.notification,
...restStyle
} = _reactNative.StyleSheet.flatten(style) || {};
const textColor = theme.isV3 ? theme.colors.onError : (0, _getContrastingColor.default)(backgroundColor, _colors.white, _colors.black);
const borderRadius = size / 2;
const paddingHorizontal = theme.isV3 ? 3 : 4;
return /*#__PURE__*/React.createElement(_reactNative.Animated.Text, _extends({
numberOfLines: 1,
style: [{
opacity,
backgroundColor,
color: textColor,
fontSize: size * 0.5,
...(!theme.isV3 && theme.fonts.regular),
lineHeight: size / fontScale,
height: size,
minWidth: size,
borderRadius,
paddingHorizontal
}, styles.container, restStyle]
}, rest), children);
};
var _default = exports.default = Badge;
const styles = _reactNative.StyleSheet.create({
container: {
alignSelf: 'flex-end',
textAlign: 'center',
textAlignVertical: 'center',
overflow: 'hidden'
}
});
//# sourceMappingURL=Badge.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_theming","_colors","_getContrastingColor","_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","defaultSize","Badge","children","size","style","theme","themeOverrides","visible","rest","_theme$colors","useInternalTheme","current","opacity","useRef","Animated","Value","fontScale","useWindowDimensions","isFirstRendering","animation","scale","useEffect","timing","toValue","duration","useNativeDriver","start","backgroundColor","isV3","colors","error","notification","restStyle","StyleSheet","flatten","textColor","onError","getContrastingColor","white","black","borderRadius","paddingHorizontal","createElement","Text","numberOfLines","color","fontSize","fonts","regular","lineHeight","height","minWidth","styles","container","_default","exports","create","alignSelf","textAlign","textAlignVertical","overflow"],"sourceRoot":"../../../src","sources":["components/Badge.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,oBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAA+D,SAAAK,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,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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 _Button = _interopRequireDefault(require("./Button/Button"));
var _Icon = _interopRequireDefault(require("./Icon"));
var _Surface = _interopRequireDefault(require("./Surface"));
var _Text = _interopRequireDefault(require("./Typography/Text"));
var _theming = require("../core/theming");
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); }
const DEFAULT_MAX_WIDTH = 960;
/**
* Banner displays a prominent message and related actions.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Image } from 'react-native';
* import { Banner } from 'react-native-paper';
*
* const MyComponent = () => {
* const [visible, setVisible] = React.useState(true);
*
* return (
* <Banner
* visible={visible}
* actions={[
* {
* label: 'Fix it',
* onPress: () => setVisible(false),
* },
* {
* label: 'Learn more',
* onPress: () => setVisible(false),
* },
* ]}
* icon={({size}) => (
* <Image
* source={{
* uri: 'https://avatars3.githubusercontent.com/u/17571969?s=400&v=4',
* }}
* style={{
* width: size,
* height: size,
* }}
* />
* )}>
* There was a problem processing a transaction on your credit card.
* </Banner>
* );
* };
*
* export default MyComponent;
* ```
*/
const Banner = ({
visible,
icon,
children,
actions = [],
contentStyle,
elevation = 1,
style,
theme: themeOverrides,
onShowAnimationFinished = () => {},
onHideAnimationFinished = () => {},
maxFontSizeMultiplier,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
current: position
} = React.useRef(new _reactNative.Animated.Value(visible ? 1 : 0));
const [layout, setLayout] = React.useState({
height: 0,
measured: false
});
const showCallback = (0, _useLatestCallback.default)(onShowAnimationFinished);
const hideCallback = (0, _useLatestCallback.default)(onHideAnimationFinished);
const {
scale
} = theme.animation;
const opacity = position.interpolate({
inputRange: [0, 0.1, 1],
outputRange: [0, 1, 1]
});
React.useEffect(() => {
if (visible) {
// show
_reactNative.Animated.timing(position, {
duration: 250 * scale,
toValue: 1,
useNativeDriver: false
}).start(showCallback);
} else {
// hide
_reactNative.Animated.timing(position, {
duration: 200 * scale,
toValue: 0,
useNativeDriver: false
}).start(hideCallback);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible, position, scale]);
const handleLayout = ({
nativeEvent
}) => {
const {
height
} = nativeEvent.layout;
setLayout({
height,
measured: true
});
};
// The banner animation has 2 parts:
// 1. Blank spacer element which animates its height to move the content
// 2. Actual banner which animates its translateY
// In initial render, we position everything normally and measure the height of the banner
// Once we have the height, we apply the height to the spacer and switch the banner to position: absolute
// We need this because we need to move the content below as if banner's height was being animated
// However we can't animated banner's height directly as it'll also resize the content inside
const height = _reactNative.Animated.multiply(position, layout.height);
const translateY = _reactNative.Animated.multiply(_reactNative.Animated.add(position, -1), layout.height);
return /*#__PURE__*/React.createElement(_Surface.default, _extends({}, rest, {
style: [!theme.isV3 && styles.elevation, {
opacity
}, style],
theme: theme,
container: true
}, theme.isV3 && {
elevation
}), /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.wrapper, contentStyle]
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: {
height
}
}), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
onLayout: handleLayout,
style: [layout.measured || !visible ?
// If we have measured banner's height or it's invisible,
// Position it absolutely, the layout will be taken care of the spacer
[styles.absolute, {
transform: [{
translateY
}]
}] :
// Otherwise position it normally
null, !layout.measured && !visible ?
// If we haven't measured banner's height yet and it's invisible,
// hide it with opacity: 0 so user doesn't see it
styles.transparent : null]
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.content
}, icon ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.icon
}, /*#__PURE__*/React.createElement(_Icon.default, {
source: icon,
size: 40
})) : null, /*#__PURE__*/React.createElement(_Text.default, {
style: [styles.message, {
color: theme.isV3 ? theme.colors.onSurface : theme.colors.text
}],
accessibilityLiveRegion: visible ? 'polite' : 'none',
accessibilityRole: "alert",
maxFontSizeMultiplier: maxFontSizeMultiplier
}, children)), /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.actions
}, actions.map(({
label,
...others
}, i) => {
var _theme$colors;
return /*#__PURE__*/React.createElement(_Button.default, _extends({
key: /* eslint-disable-line react/no-array-index-key */i,
compact: true,
mode: "text",
style: styles.button,
textColor: (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary,
theme: theme
}, others), label);
})))));
};
const styles = _reactNative.StyleSheet.create({
wrapper: {
overflow: 'hidden',
alignSelf: 'center',
width: '100%',
maxWidth: DEFAULT_MAX_WIDTH
},
absolute: {
position: 'absolute',
top: 0,
width: '100%'
},
content: {
flexDirection: 'row',
justifyContent: 'flex-start',
marginHorizontal: 8,
marginTop: 16,
marginBottom: 0
},
icon: {
margin: 8
},
message: {
flex: 1,
margin: 8
},
actions: {
flexDirection: 'row',
justifyContent: 'flex-end',
margin: 4
},
button: {
margin: 4
},
elevation: {
elevation: 1
},
transparent: {
opacity: 0
}
});
var _default = exports.default = Banner;
//# sourceMappingURL=Banner.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,322 @@
"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 _BottomNavigationBar = _interopRequireDefault(require("./BottomNavigationBar"));
var _BottomNavigationRouteScreen = _interopRequireDefault(require("./BottomNavigationRouteScreen"));
var _theming = require("../../core/theming");
var _useAnimatedValueArray = _interopRequireDefault(require("../../utils/useAnimatedValueArray"));
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); }
const FAR_FAR_AWAY = _reactNative.Platform.OS === 'web' ? 0 : 9999;
const SceneComponent = /*#__PURE__*/React.memo(({
component,
...rest
}) => /*#__PURE__*/React.createElement(component, rest));
/**
* BottomNavigation provides quick navigation between top-level views of an app with a bottom navigation bar.
* It is primarily designed for use on mobile. If you want to use the navigation bar only see [`BottomNavigation.Bar`](BottomNavigationBar).
*
* By default BottomNavigation 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 information.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { BottomNavigation, Text } from 'react-native-paper';
*
* const MusicRoute = () => <Text>Music</Text>;
*
* const AlbumsRoute = () => <Text>Albums</Text>;
*
* const RecentsRoute = () => <Text>Recents</Text>;
*
* const NotificationsRoute = () => <Text>Notifications</Text>;
*
* const MyComponent = () => {
* const [index, setIndex] = React.useState(0);
* const [routes] = React.useState([
* { key: 'music', title: 'Favorites', focusedIcon: 'heart', unfocusedIcon: 'heart-outline'},
* { key: 'albums', title: 'Albums', focusedIcon: 'album' },
* { key: 'recents', title: 'Recents', focusedIcon: 'history' },
* { key: 'notifications', title: 'Notifications', focusedIcon: 'bell', unfocusedIcon: 'bell-outline' },
* ]);
*
* const renderScene = BottomNavigation.SceneMap({
* music: MusicRoute,
* albums: AlbumsRoute,
* recents: RecentsRoute,
* notifications: NotificationsRoute,
* });
*
* return (
* <BottomNavigation
* navigationState={{ index, routes }}
* onIndexChange={setIndex}
* renderScene={renderScene}
* />
* );
* };
*
* export default MyComponent;
* ```
*/
const BottomNavigation = ({
navigationState,
renderScene,
renderIcon,
renderLabel,
renderTouchable,
getLabelText,
getBadge,
getColor,
getAccessibilityLabel,
getTestID,
activeColor,
inactiveColor,
keyboardHidesNavigationBar = _reactNative.Platform.OS === 'android',
barStyle,
labeled = true,
style,
activeIndicatorStyle,
sceneAnimationEnabled = false,
sceneAnimationType = 'opacity',
sceneAnimationEasing,
onTabPress,
onTabLongPress,
onIndexChange,
shifting: shiftingProp,
safeAreaInsets,
labelMaxFontSizeMultiplier = 1,
compact: compactProp,
testID = 'bottom-navigation',
theme: themeOverrides,
getLazy = ({
route
}) => route.lazy
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
scale
} = theme.animation;
const compact = compactProp ?? !theme.isV3;
let shifting = shiftingProp ?? (theme.isV3 ? false : navigationState.routes.length > 3);
if (shifting && navigationState.routes.length < 2) {
shifting = false;
console.warn('BottomNavigation needs at least 2 tabs to run shifting animation');
}
const focusedKey = navigationState.routes[navigationState.index].key;
/**
* Active state of individual tab item positions:
* -1 if they're before the active tab, 0 if they're active, 1 if they're after the active tab
*/
const tabsPositionAnims = (0, _useAnimatedValueArray.default)(navigationState.routes.map((_, i) => i === navigationState.index ? 0 : i >= navigationState.index ? 1 : -1));
/**
* The top offset for each tab item to position it offscreen.
* Placing items offscreen helps to save memory usage for inactive screens with removeClippedSubviews.
* We use animated values for this to prevent unnecessary re-renders.
*/
const offsetsAnims = (0, _useAnimatedValueArray.default)(navigationState.routes.map(
// offscreen === 1, normal === 0
(_, i) => i === navigationState.index ? 0 : 1));
/**
* List of loaded tabs, tabs will be loaded when navigated to.
*/
const [loaded, setLoaded] = React.useState([focusedKey]);
if (!loaded.includes(focusedKey)) {
// Set the current tab to be loaded if it was not loaded before
setLoaded(loaded => [...loaded, focusedKey]);
}
const animateToIndex = React.useCallback(index => {
_reactNative.Animated.parallel([...navigationState.routes.map((_, i) => _reactNative.Animated.timing(tabsPositionAnims[i], {
toValue: i === index ? 0 : i >= index ? 1 : -1,
duration: theme.isV3 || shifting ? 150 * scale : 0,
useNativeDriver: true,
easing: sceneAnimationEasing
}))]).start(({
finished
}) => {
if (finished) {
// Position all inactive screens offscreen to save memory usage
// Only do it when animation has finished to avoid glitches mid-transition if switching fast
offsetsAnims.forEach((offset, i) => {
if (i === index) {
offset.setValue(0);
} else {
offset.setValue(1);
}
});
}
});
}, [shifting, navigationState.routes, offsetsAnims, scale, tabsPositionAnims, sceneAnimationEasing, theme]);
React.useEffect(() => {
// Workaround for native animated bug in react-native@^0.57
// Context: https://github.com/callstack/react-native-paper/pull/637
animateToIndex(navigationState.index);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const prevNavigationState = React.useRef(undefined);
React.useEffect(() => {
// Reset offsets of previous and current tabs before animation
offsetsAnims.forEach((offset, i) => {
var _prevNavigationState$;
if (i === navigationState.index || i === ((_prevNavigationState$ = prevNavigationState.current) === null || _prevNavigationState$ === void 0 ? void 0 : _prevNavigationState$.index)) {
offset.setValue(0);
}
});
animateToIndex(navigationState.index);
}, [navigationState.index, animateToIndex, offsetsAnims]);
const handleTabPress = (0, _useLatestCallback.default)(event => {
onTabPress === null || onTabPress === void 0 || onTabPress(event);
if (event.defaultPrevented) {
return;
}
const index = navigationState.routes.findIndex(route => event.route.key === route.key);
if (index !== navigationState.index) {
prevNavigationState.current = navigationState;
onIndexChange(index);
}
});
const jumpTo = (0, _useLatestCallback.default)(key => {
const index = navigationState.routes.findIndex(route => route.key === key);
prevNavigationState.current = navigationState;
onIndexChange(index);
});
const {
routes
} = navigationState;
const {
colors
} = theme;
return /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.container, style],
testID: testID
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.content, {
backgroundColor: colors === null || colors === void 0 ? void 0 : colors.background
}]
}, routes.map((route, index) => {
var _prevNavigationState$2;
if (getLazy({
route
}) !== false && !loaded.includes(route.key)) {
// Don't render a screen if we've never navigated to it
return null;
}
const focused = navigationState.index === index;
const previouslyFocused = ((_prevNavigationState$2 = prevNavigationState.current) === null || _prevNavigationState$2 === void 0 ? void 0 : _prevNavigationState$2.index) === index;
const countAlphaOffscreen = sceneAnimationEnabled && (focused || previouslyFocused);
const renderToHardwareTextureAndroid = sceneAnimationEnabled && focused;
const opacity = sceneAnimationEnabled ? tabsPositionAnims[index].interpolate({
inputRange: [-1, 0, 1],
outputRange: [0, 1, 0]
}) : focused ? 1 : 0;
const offsetTarget = focused ? 0 : FAR_FAR_AWAY;
const top = sceneAnimationEnabled ? offsetsAnims[index].interpolate({
inputRange: [0, 1],
outputRange: [0, offsetTarget]
}) : offsetTarget;
const left = sceneAnimationType === 'shifting' ? tabsPositionAnims[index].interpolate({
inputRange: [-1, 0, 1],
outputRange: [-50, 0, 50]
}) : 0;
const zIndex = focused ? 1 : 0;
return /*#__PURE__*/React.createElement(_BottomNavigationRouteScreen.default, {
key: route.key,
pointerEvents: focused ? 'auto' : 'none',
accessibilityElementsHidden: !focused,
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
index: index,
visibility: opacity,
style: [_reactNative.StyleSheet.absoluteFill, {
zIndex
}],
collapsable: false,
removeClippedSubviews:
// On iOS, set removeClippedSubviews to true only when not focused
// This is an workaround for a bug where the clipped view never re-appears
_reactNative.Platform.OS === 'ios' ? navigationState.index !== index : true
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({}, _reactNative.Platform.OS === 'android' && {
needsOffscreenAlphaCompositing: countAlphaOffscreen
}, {
renderToHardwareTextureAndroid: renderToHardwareTextureAndroid,
style: [styles.content, {
opacity,
transform: [{
translateX: left
}, {
translateY: top
}]
}]
}), renderScene({
route,
jumpTo
})));
})), /*#__PURE__*/React.createElement(_BottomNavigationBar.default, {
navigationState: navigationState,
renderIcon: renderIcon,
renderLabel: renderLabel,
renderTouchable: renderTouchable,
getLabelText: getLabelText,
getBadge: getBadge,
getColor: getColor,
getAccessibilityLabel: getAccessibilityLabel,
getTestID: getTestID,
activeColor: activeColor,
inactiveColor: inactiveColor,
keyboardHidesNavigationBar: keyboardHidesNavigationBar,
style: barStyle,
activeIndicatorStyle: activeIndicatorStyle,
labeled: labeled,
animationEasing: sceneAnimationEasing,
onTabPress: handleTabPress,
onTabLongPress: onTabLongPress,
shifting: shifting,
safeAreaInsets: safeAreaInsets,
labelMaxFontSizeMultiplier: labelMaxFontSizeMultiplier,
compact: compact,
testID: `${testID}-bar`,
theme: theme
}));
};
/**
* Function which takes a map of route keys to components.
* Pure components are used to minimize re-rendering of the pages.
* This drastically improves the animation performance.
*/
BottomNavigation.SceneMap = scenes => {
return ({
route,
jumpTo
}) => /*#__PURE__*/React.createElement(SceneComponent, {
key: route.key,
component: scenes[route.key ? route.key : ''],
route: route,
jumpTo: jumpTo
});
};
// @component ./BottomNavigationBar.tsx
BottomNavigation.Bar = _BottomNavigationBar.default;
var _default = exports.default = BottomNavigation;
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
overflow: 'hidden'
},
content: {
flex: 1
}
});
//# sourceMappingURL=BottomNavigation.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,633 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _overlay = _interopRequireDefault(require("../../styles/overlay"));
var _colors = require("../../styles/themes/v2/colors");
var _useAnimatedValue = _interopRequireDefault(require("../../utils/useAnimatedValue"));
var _useAnimatedValueArray = _interopRequireDefault(require("../../utils/useAnimatedValueArray"));
var _useIsKeyboardShown = _interopRequireDefault(require("../../utils/useIsKeyboardShown"));
var _useLayout = _interopRequireDefault(require("../../utils/useLayout"));
var _Badge = _interopRequireDefault(require("../Badge"));
var _Icon = _interopRequireDefault(require("../Icon"));
var _Surface = _interopRequireDefault(require("../Surface"));
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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); }
const MIN_RIPPLE_SCALE = 0.001; // Minimum scale is not 0 due to bug with animation
const MIN_TAB_WIDTH = 96;
const MAX_TAB_WIDTH = 168;
const BAR_HEIGHT = 56;
const OUTLINE_WIDTH = 64;
const Touchable = ({
route: _0,
style,
children,
borderless,
centered,
rippleColor,
...rest
}) => _TouchableRipple.default.supported ? /*#__PURE__*/React.createElement(_TouchableRipple.default, _extends({}, rest, {
disabled: rest.disabled || undefined,
borderless: borderless,
centered: centered,
rippleColor: rippleColor,
style: style
}), children) : /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
style: style
}, rest), children);
/**
* A navigation bar which can easily be integrated with [React Navigation's Bottom Tabs Navigator](https://reactnavigation.org/docs/bottom-tab-navigator/).
*
* ## Usage
* ### without React Navigation
* ```js
* import React from 'react';
* import { useState } from 'react';
* import { View } from 'react-native';
* import { BottomNavigation, Text, Provider } from 'react-native-paper';
* import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
*
* function HomeScreen() {
* return (
* <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
* <Text>Home!</Text>
* </View>
* );
* }
*
* function SettingsScreen() {
* return (
* <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
* <Text>Settings!</Text>
* </View>
* );
* }
*
* export default function MyComponent() {
* const [index, setIndex] = useState(0);
*
* const routes = [
* { key: 'home', title: 'Home', icon: 'home' },
* { key: 'settings', title: 'Settings', icon: 'cog' },
* ];
* const renderScene = ({ route }) => {
* switch (route.key) {
* case 'home':
* return <HomeScreen />;
* case 'settings':
* return <SettingsScreen />;
* default:
* return null;
* }
* };
*
* return (
* <Provider>
* {renderScene({ route: routes[index] })}
* <BottomNavigation.Bar
* navigationState={{ index, routes }}
* onTabPress={({ route }) => {
* const newIndex = routes.findIndex((r) => r.key === route.key);
* if (newIndex !== -1) {
* setIndex(newIndex);
* }
* }}
* renderIcon={({ route, color }) => (
* <Icon name={route.icon} size={24} color={color} />
* )}
* getLabelText={({ route }) => route.title}
* />
* </Provider>
* );
* }
* ```
*/
const BottomNavigationBar = ({
navigationState,
renderIcon,
renderLabel,
renderTouchable = ({
key,
...props
}) => /*#__PURE__*/React.createElement(Touchable, _extends({
key: key
}, props)),
getLabelText = ({
route
}) => route.title,
getBadge = ({
route
}) => route.badge,
getColor = ({
route
}) => route.color,
getAccessibilityLabel = ({
route
}) => route.accessibilityLabel,
getTestID = ({
route
}) => route.testID,
activeColor,
inactiveColor,
keyboardHidesNavigationBar = _reactNative.Platform.OS === 'android',
style,
activeIndicatorStyle,
labeled = true,
animationEasing,
onTabPress,
onTabLongPress,
shifting: shiftingProp,
safeAreaInsets,
labelMaxFontSizeMultiplier = 1,
compact: compactProp,
testID = 'bottom-navigation-bar',
theme: themeOverrides
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
bottom,
left,
right
} = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
const {
scale
} = theme.animation;
const compact = compactProp ?? !theme.isV3;
let shifting = shiftingProp ?? (theme.isV3 ? false : navigationState.routes.length > 3);
if (shifting && navigationState.routes.length < 2) {
shifting = false;
console.warn('BottomNavigation.Bar needs at least 2 tabs to run shifting animation');
}
/**
* Visibility of the navigation bar, visible state is 1 and invisible is 0.
*/
const visibleAnim = (0, _useAnimatedValue.default)(1);
/**
* Active state of individual tab items, active state is 1 and inactive state is 0.
*/
const tabsAnims = (0, _useAnimatedValueArray.default)(navigationState.routes.map(
// focused === 1, unfocused === 0
(_, i) => i === navigationState.index ? 1 : 0));
/**
* Index of the currently active tab. Used for setting the background color.
* We don't use the color as an animated value directly, because `setValue` seems to be buggy with colors?.
*/
const indexAnim = (0, _useAnimatedValue.default)(navigationState.index);
/**
* Animation for the background color ripple, used to determine it's scale and opacity.
*/
const rippleAnim = (0, _useAnimatedValue.default)(MIN_RIPPLE_SCALE);
/**
* Layout of the navigation bar. The width is used to determine the size and position of the ripple.
*/
const [layout, onLayout] = (0, _useLayout.default)();
/**
* Track whether the keyboard is visible to show and hide the navigation bar.
*/
const [keyboardVisible, setKeyboardVisible] = React.useState(false);
const handleKeyboardShow = React.useCallback(() => {
setKeyboardVisible(true);
_reactNative.Animated.timing(visibleAnim, {
toValue: 0,
duration: 150 * scale,
useNativeDriver: true
}).start();
}, [scale, visibleAnim]);
const handleKeyboardHide = React.useCallback(() => {
_reactNative.Animated.timing(visibleAnim, {
toValue: 1,
duration: 100 * scale,
useNativeDriver: true
}).start(() => {
setKeyboardVisible(false);
});
}, [scale, visibleAnim]);
const animateToIndex = React.useCallback(index => {
// Reset the ripple to avoid glitch if it's currently animating
rippleAnim.setValue(MIN_RIPPLE_SCALE);
_reactNative.Animated.parallel([_reactNative.Animated.timing(rippleAnim, {
toValue: 1,
duration: theme.isV3 || shifting ? 400 * scale : 0,
useNativeDriver: true
}), ...navigationState.routes.map((_, i) => _reactNative.Animated.timing(tabsAnims[i], {
toValue: i === index ? 1 : 0,
duration: theme.isV3 || shifting ? 150 * scale : 0,
useNativeDriver: true,
easing: animationEasing
}))]).start(() => {
// Workaround a bug in native animations where this is reset after first animation
tabsAnims.map((tab, i) => tab.setValue(i === index ? 1 : 0));
// Update the index to change bar's background color and then hide the ripple
indexAnim.setValue(index);
rippleAnim.setValue(MIN_RIPPLE_SCALE);
});
}, [rippleAnim, theme.isV3, shifting, scale, navigationState.routes, tabsAnims, animationEasing, indexAnim]);
React.useEffect(() => {
// Workaround for native animated bug in react-native@^0.57
// Context: https://github.com/callstack/react-native-paper/pull/637
animateToIndex(navigationState.index);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
(0, _useIsKeyboardShown.default)({
onShow: handleKeyboardShow,
onHide: handleKeyboardHide
});
React.useEffect(() => {
animateToIndex(navigationState.index);
}, [navigationState.index, animateToIndex]);
const eventForIndex = index => {
const event = {
route: navigationState.routes[index],
defaultPrevented: false,
preventDefault: () => {
event.defaultPrevented = true;
}
};
return event;
};
const {
routes
} = navigationState;
const {
colors,
dark: isDarkTheme,
mode,
isV3
} = theme;
const {
backgroundColor: customBackground,
elevation = 4
} = _reactNative.StyleSheet.flatten(style) || {};
const approxBackgroundColor = customBackground ? customBackground : isDarkTheme && mode === 'adaptive' ? (0, _overlay.default)(elevation, colors === null || colors === void 0 ? void 0 : colors.surface) : colors === null || colors === void 0 ? void 0 : colors.primary;
const v2BackgroundColorInterpolation = shifting ? indexAnim.interpolate({
inputRange: routes.map((_, i) => i),
// FIXME: does outputRange support ColorValue or just strings?
// @ts-expect-error
outputRange: routes.map(route => getColor({
route
}) || approxBackgroundColor)
}) : approxBackgroundColor;
const backgroundColor = isV3 ? customBackground || theme.colors.elevation.level2 : shifting ? v2BackgroundColorInterpolation : approxBackgroundColor;
const isDark = typeof approxBackgroundColor === 'string' ? !(0, _color.default)(approxBackgroundColor).isLight() : true;
const textColor = isDark ? _colors.white : _colors.black;
const activeTintColor = (0, _utils.getActiveTintColor)({
activeColor,
defaultColor: textColor,
theme
});
const inactiveTintColor = (0, _utils.getInactiveTintColor)({
inactiveColor,
defaultColor: textColor,
theme
});
const touchColor = (0, _color.default)(activeTintColor).alpha(0.12).rgb().string();
const maxTabWidth = routes.length > 3 ? MIN_TAB_WIDTH : MAX_TAB_WIDTH;
const maxTabBarWidth = maxTabWidth * routes.length;
const rippleSize = layout.width / 4;
const insets = {
left: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.left) ?? left,
right: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.right) ?? right,
bottom: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.bottom) ?? bottom
};
return /*#__PURE__*/React.createElement(_Surface.default, _extends({}, theme.isV3 && {
elevation: 0
}, {
testID: testID,
style: [!theme.isV3 && styles.elevation, styles.bar, keyboardHidesNavigationBar // eslint-disable-next-line react-native/no-inline-styles
? {
// When the keyboard is shown, slide down the navigation bar
transform: [{
translateY: visibleAnim.interpolate({
inputRange: [0, 1],
outputRange: [layout.height, 0]
})
}],
// Absolutely position the navigation bar so that the content is below it
// This is needed to avoid gap at bottom when the navigation bar is hidden
position: keyboardVisible ? 'absolute' : undefined
} : null, style],
pointerEvents: layout.measured ? keyboardHidesNavigationBar && keyboardVisible ? 'none' : 'auto' : 'none',
onLayout: onLayout,
container: true
}), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.barContent, {
backgroundColor
}],
testID: `${testID}-content`
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.items, {
marginBottom: insets.bottom,
marginHorizontal: Math.max(insets.left, insets.right)
}, compact && {
maxWidth: maxTabBarWidth
}],
accessibilityRole: 'tablist',
testID: `${testID}-content-wrapper`
}, shifting && !isV3 ? /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "none",
style: [styles.ripple, {
// Since we have a single ripple, we have to reposition it so that it appears to expand from active tab.
// We need to move it from the top to center of the navigation bar and from the left to the active tab.
top: (BAR_HEIGHT - rippleSize) / 2,
left: Math.min(layout.width, maxTabBarWidth) / routes.length * (navigationState.index + 0.5) - rippleSize / 2,
height: rippleSize,
width: rippleSize,
borderRadius: rippleSize / 2,
backgroundColor: getColor({
route: routes[navigationState.index]
}),
transform: [{
// Scale to twice the size to ensure it covers the whole navigation bar
scale: rippleAnim.interpolate({
inputRange: [0, 1],
outputRange: [0, 8]
})
}],
opacity: rippleAnim.interpolate({
inputRange: [0, MIN_RIPPLE_SCALE, 0.3, 1],
outputRange: [0, 0, 1, 1]
})
}],
testID: `${testID}-content-ripple`
}) : null, routes.map((route, index) => {
const focused = navigationState.index === index;
const active = tabsAnims[index];
// Scale the label up
const scale = labeled && shifting ? active.interpolate({
inputRange: [0, 1],
outputRange: [0.5, 1]
}) : 1;
// Move down the icon to account for no-label in shifting and smaller label in non-shifting.
const translateY = labeled ? shifting ? active.interpolate({
inputRange: [0, 1],
outputRange: [7, 0]
}) : 0 : 7;
// We render the active icon and label on top of inactive ones and cross-fade them on change.
// This trick gives the illusion that we are animating between active and inactive colors.
// This is to ensure that we can use native driver, as colors cannot be animated with native driver.
const activeOpacity = active;
const inactiveOpacity = active.interpolate({
inputRange: [0, 1],
outputRange: [1, 0]
});
const v3ActiveOpacity = focused ? 1 : 0;
const v3InactiveOpacity = shifting ? inactiveOpacity : focused ? 0 : 1;
// Scale horizontally the outline pill
const outlineScale = focused ? active.interpolate({
inputRange: [0, 1],
outputRange: [0.5, 1]
}) : 0;
const badge = getBadge({
route
});
const activeLabelColor = (0, _utils.getLabelColor)({
tintColor: activeTintColor,
hasColor: Boolean(activeColor),
focused,
defaultColor: textColor,
theme
});
const inactiveLabelColor = (0, _utils.getLabelColor)({
tintColor: inactiveTintColor,
hasColor: Boolean(inactiveColor),
focused,
defaultColor: textColor,
theme
});
const badgeStyle = {
top: !isV3 ? -2 : typeof badge === 'boolean' ? 4 : 2,
right: (badge != null && typeof badge !== 'boolean' ? String(badge).length * -2 : 0) - (!isV3 ? 2 : 0)
};
const isLegacyOrV3Shifting = !isV3 || isV3 && shifting && labeled;
const font = isV3 ? theme.fonts.labelMedium : {};
return renderTouchable({
key: route.key,
route,
borderless: true,
centered: true,
rippleColor: isV3 ? 'transparent' : touchColor,
onPress: () => onTabPress(eventForIndex(index)),
onLongPress: () => onTabLongPress === null || onTabLongPress === void 0 ? void 0 : onTabLongPress(eventForIndex(index)),
testID: getTestID({
route
}),
accessibilityLabel: getAccessibilityLabel({
route
}),
accessibilityRole: _reactNative.Platform.OS === 'ios' ? 'button' : 'tab',
accessibilityState: {
selected: focused
},
style: [styles.item, isV3 && styles.v3Item],
children: /*#__PURE__*/React.createElement(_reactNative.View, {
pointerEvents: "none",
style: isV3 && (labeled ? styles.v3TouchableContainer : styles.v3NoLabelContainer)
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.iconContainer, isV3 && styles.v3IconContainer, isLegacyOrV3Shifting && {
transform: [{
translateY
}]
}]
}, isV3 && focused && /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.outline, {
transform: [{
scaleX: outlineScale
}],
backgroundColor: theme.colors.secondaryContainer
}, activeIndicatorStyle]
}), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.iconWrapper, isV3 && styles.v3IconWrapper, {
opacity: isLegacyOrV3Shifting ? activeOpacity : v3ActiveOpacity
}]
}, renderIcon ? renderIcon({
route,
focused: true,
color: activeTintColor
}) : /*#__PURE__*/React.createElement(_Icon.default, {
source: route.focusedIcon,
color: activeTintColor,
size: 24
})), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.iconWrapper, isV3 && styles.v3IconWrapper, {
opacity: isLegacyOrV3Shifting ? inactiveOpacity : v3InactiveOpacity
}]
}, renderIcon ? renderIcon({
route,
focused: false,
color: inactiveTintColor
}) : /*#__PURE__*/React.createElement(_Icon.default, {
source: theme.isV3 && route.unfocusedIcon !== undefined ? route.unfocusedIcon : route.focusedIcon,
color: inactiveTintColor,
size: 24
})), /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.badgeContainer, badgeStyle]
}, typeof badge === 'boolean' ? /*#__PURE__*/React.createElement(_Badge.default, {
visible: badge,
size: isV3 ? 6 : 8
}) : /*#__PURE__*/React.createElement(_Badge.default, {
visible: badge != null,
size: 16
}, badge))), labeled ? /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.labelContainer, !isV3 && {
transform: [{
scale
}]
}]
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.labelWrapper, {
opacity: isLegacyOrV3Shifting ? activeOpacity : v3ActiveOpacity
}]
}, renderLabel ? renderLabel({
route,
focused: true,
color: activeLabelColor
}) : /*#__PURE__*/React.createElement(_Text.default, {
maxFontSizeMultiplier: labelMaxFontSizeMultiplier,
variant: "labelMedium",
style: [styles.label, {
color: activeLabelColor,
...font
}]
}, getLabelText({
route
}))), shifting ? null : /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.labelWrapper, {
opacity: isLegacyOrV3Shifting ? inactiveOpacity : v3InactiveOpacity
}]
}, renderLabel ? renderLabel({
route,
focused: false,
color: inactiveLabelColor
}) : /*#__PURE__*/React.createElement(_Text.default, {
maxFontSizeMultiplier: labelMaxFontSizeMultiplier,
variant: "labelMedium",
selectable: false,
style: [styles.label, {
color: inactiveLabelColor,
...font
}]
}, getLabelText({
route
})))) : !isV3 && /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.labelContainer
}))
});
}))));
};
BottomNavigationBar.displayName = 'BottomNavigation.Bar';
var _default = exports.default = BottomNavigationBar;
const styles = _reactNative.StyleSheet.create({
bar: {
left: 0,
right: 0,
bottom: 0
},
barContent: {
alignItems: 'center',
overflow: 'hidden'
},
items: {
flexDirection: 'row',
...(_reactNative.Platform.OS === 'web' ? {
width: '100%'
} : null)
},
item: {
flex: 1,
// Top padding is 6 and bottom padding is 10
// The extra 4dp bottom padding is offset by label's height
paddingVertical: 6
},
v3Item: {
paddingVertical: 0
},
ripple: {
position: 'absolute'
},
iconContainer: {
height: 24,
width: 24,
marginTop: 2,
marginHorizontal: 12,
alignSelf: 'center'
},
v3IconContainer: {
height: 32,
width: 32,
marginBottom: 4,
marginTop: 0,
justifyContent: 'center'
},
iconWrapper: {
..._reactNative.StyleSheet.absoluteFill,
alignItems: 'center'
},
v3IconWrapper: {
top: 4
},
labelContainer: {
height: 16,
paddingBottom: 2
},
labelWrapper: {
..._reactNative.StyleSheet.absoluteFill
},
// eslint-disable-next-line react-native/no-color-literals
label: {
fontSize: 12,
height: BAR_HEIGHT,
textAlign: 'center',
backgroundColor: 'transparent',
...(_reactNative.Platform.OS === 'web' ? {
whiteSpace: 'nowrap',
alignSelf: 'center'
} : null)
},
badgeContainer: {
position: 'absolute',
left: 0
},
v3TouchableContainer: {
paddingTop: 12,
paddingBottom: 16
},
v3NoLabelContainer: {
height: 80,
justifyContent: 'center',
alignItems: 'center'
},
outline: {
width: OUTLINE_WIDTH,
height: OUTLINE_WIDTH / 2,
borderRadius: OUTLINE_WIDTH / 4,
alignSelf: 'center'
},
elevation: {
elevation: 4
}
});
//# sourceMappingURL=BottomNavigationBar.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactNative = require("react-native");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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); }
class BottomNavigationRouteScreen extends _react.default.Component {
render() {
const {
style,
index,
children,
visibility,
...rest
} = this.props;
// On Web, the unfocused tab screens can still be clicked since they are transparent, but still there
// Hiding them with `display: none` makes sure that they won't receive clicks
// We only set it on Web since on native, react-native-pager-view's breaks due to layout changing
const display = _reactNative.Platform.OS === 'web' ? visibility === 0 ? 'none' : 'flex' : undefined;
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
testID: `RouteScreen: ${index}`,
style: [style, {
display
}]
}, rest), children);
}
}
var _default = exports.default = _reactNative.Animated.createAnimatedComponent(BottomNavigationRouteScreen);
//# sourceMappingURL=BottomNavigationRouteScreen.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","BottomNavigationRouteScreen","React","Component","render","style","index","children","visibility","rest","props","display","Platform","OS","undefined","createElement","View","testID","_default","exports","Animated","createAnimatedComponent"],"sourceRoot":"../../../../src","sources":["components/BottomNavigation/BottomNavigationRouteScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAmE,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAOnE,MAAMO,2BAA2B,SAASC,cAAK,CAACC,SAAS,CAAQ;EAC/DC,MAAMA,CAAA,EAAc;IAClB,MAAM;MAAEC,KAAK;MAAEC,KAAK;MAAEC,QAAQ;MAAEC,UAAU;MAAE,GAAGC;IAAK,CAAC,GAAG,IAAI,CAACC,KAAK;;IAElE;IACA;IACA;IACA,MAAMC,OAAO,GACXC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAIL,UAAU,KAAK,CAAC,GAAG,MAAM,GAAG,MAAM,GAAIM,SAAS;IAE1E,oBACEhC,MAAA,CAAAM,OAAA,CAAA2B,aAAA,CAAC9B,YAAA,CAAA+B,IAAI,EAAA3B,QAAA;MACH4B,MAAM,EAAE,gBAAgBX,KAAK,EAAG;MAChCD,KAAK,EAAE,CAACA,KAAK,EAAE;QAAEM;MAAQ,CAAC;IAAE,GACxBF,IAAI,GAEPF,QACG,CAAC;EAEX;AACF;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAA/B,OAAA,GAEcgC,qBAAQ,CAACC,uBAAuB,CAACpB,2BAA2B,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getLabelColor = exports.getInactiveTintColor = exports.getActiveTintColor = void 0;
var _color = _interopRequireDefault(require("color"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const getActiveTintColor = ({
activeColor,
defaultColor,
theme
}) => {
if (typeof activeColor === 'string') {
return activeColor;
}
if (theme.isV3) {
return theme.colors.onSecondaryContainer;
}
return defaultColor;
};
exports.getActiveTintColor = getActiveTintColor;
const getInactiveTintColor = ({
inactiveColor,
defaultColor,
theme
}) => {
if (typeof inactiveColor === 'string') {
return inactiveColor;
}
if (theme.isV3) {
return theme.colors.onSurfaceVariant;
}
return (0, _color.default)(defaultColor).alpha(0.5).rgb().string();
};
exports.getInactiveTintColor = getInactiveTintColor;
const getLabelColor = ({
tintColor,
hasColor,
focused,
defaultColor,
theme
}) => {
if (hasColor) {
return tintColor;
}
if (theme.isV3) {
if (focused) {
return theme.colors.onSurface;
}
return theme.colors.onSurfaceVariant;
}
return defaultColor;
};
exports.getLabelColor = getLabelColor;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_color","_interopRequireDefault","require","e","__esModule","default","getActiveTintColor","activeColor","defaultColor","theme","isV3","colors","onSecondaryContainer","exports","getInactiveTintColor","inactiveColor","onSurfaceVariant","color","alpha","rgb","string","getLabelColor","tintColor","hasColor","focused","onSurface"],"sourceRoot":"../../../../src","sources":["components/BottomNavigation/utils.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAUnB,MAAMG,kBAAkB,GAAGA,CAAC;EACjCC,WAAW;EACXC,YAAY;EACZC;AAGF,CAAC,KAAK;EACJ,IAAI,OAAOF,WAAW,KAAK,QAAQ,EAAE;IACnC,OAAOA,WAAW;EACpB;EAEA,IAAIE,KAAK,CAACC,IAAI,EAAE;IACd,OAAOD,KAAK,CAACE,MAAM,CAACC,oBAAoB;EAC1C;EAEA,OAAOJ,YAAY;AACrB,CAAC;AAACK,OAAA,CAAAP,kBAAA,GAAAA,kBAAA;AAEK,MAAMQ,oBAAoB,GAAGA,CAAC;EACnCC,aAAa;EACbP,YAAY;EACZC;AAGF,CAAC,KAAK;EACJ,IAAI,OAAOM,aAAa,KAAK,QAAQ,EAAE;IACrC,OAAOA,aAAa;EACtB;EAEA,IAAIN,KAAK,CAACC,IAAI,EAAE;IACd,OAAOD,KAAK,CAACE,MAAM,CAACK,gBAAgB;EACtC;EAEA,OAAO,IAAAC,cAAK,EAACT,YAAY,CAAC,CAACU,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;AACtD,CAAC;AAACP,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AAEK,MAAMO,aAAa,GAAGA,CAAC;EAC5BC,SAAS;EACTC,QAAQ;EACRC,OAAO;EACPhB,YAAY;EACZC;AAKF,CAAC,KAAK;EACJ,IAAIc,QAAQ,EAAE;IACZ,OAAOD,SAAS;EAClB;EAEA,IAAIb,KAAK,CAACC,IAAI,EAAE;IACd,IAAIc,OAAO,EAAE;MACX,OAAOf,KAAK,CAACE,MAAM,CAACc,SAAS;IAC/B;IACA,OAAOhB,KAAK,CAACE,MAAM,CAACK,gBAAgB;EACtC;EAEA,OAAOR,YAAY;AACrB,CAAC;AAACK,OAAA,CAAAQ,aAAA,GAAAA,aAAA","ignoreList":[]}

View File

@@ -0,0 +1,304 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = 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 _forwardRef = require("../../utils/forwardRef");
var _hasTouchHandler = _interopRequireDefault(require("../../utils/hasTouchHandler"));
var _splitStyles = require("../../utils/splitStyles");
var _ActivityIndicator = _interopRequireDefault(require("../ActivityIndicator"));
var _Icon = _interopRequireDefault(require("../Icon"));
var _Surface = _interopRequireDefault(require("../Surface"));
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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 button is component that the user can press to trigger an action.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Button } from 'react-native-paper';
*
* const MyComponent = () => (
* <Button icon="camera" mode="contained" onPress={() => console.log('Pressed')}>
* Press me
* </Button>
* );
*
* export default MyComponent;
* ```
*/
const Button = ({
disabled,
compact,
mode = 'text',
dark,
loading,
icon,
buttonColor: customButtonColor,
textColor: customTextColor,
rippleColor: customRippleColor,
children,
accessibilityLabel,
accessibilityHint,
accessibilityRole = 'button',
hitSlop,
onPress,
onPressIn,
onPressOut,
onLongPress,
delayLongPress,
style,
theme: themeOverrides,
uppercase: uppercaseProp,
contentStyle,
labelStyle,
testID = 'button',
accessible,
background,
maxFontSizeMultiplier,
touchableRef,
...rest
}, ref) => {
var _StyleSheet$flatten;
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const isMode = React.useCallback(modeToCompare => {
return mode === modeToCompare;
}, [mode]);
const {
roundness,
isV3,
animation
} = theme;
const uppercase = uppercaseProp ?? !theme.isV3;
const isWeb = _reactNative.Platform.OS === 'web';
const hasPassedTouchHandler = (0, _hasTouchHandler.default)({
onPress,
onPressIn,
onPressOut,
onLongPress
});
const isElevationEntitled = !disabled && (isV3 ? isMode('elevated') : isMode('contained'));
const initialElevation = isV3 ? 1 : 2;
const activeElevation = isV3 ? 2 : 8;
const {
current: elevation
} = React.useRef(new _reactNative.Animated.Value(isElevationEntitled ? initialElevation : 0));
React.useEffect(() => {
// Workaround not to call setValue on Animated.Value, because it breaks styles.
// https://github.com/callstack/react-native-paper/issues/4559
_reactNative.Animated.timing(elevation, {
toValue: isElevationEntitled ? initialElevation : 0,
duration: 0,
useNativeDriver: true
});
}, [isElevationEntitled, elevation, initialElevation]);
const handlePressIn = e => {
onPressIn === null || onPressIn === void 0 || onPressIn(e);
if (isV3 ? isMode('elevated') : isMode('contained')) {
const {
scale
} = animation;
_reactNative.Animated.timing(elevation, {
toValue: activeElevation,
duration: 200 * scale,
useNativeDriver: isWeb || _reactNative.Platform.constants.reactNativeVersion.minor <= 72
}).start();
}
};
const handlePressOut = e => {
onPressOut === null || onPressOut === void 0 || onPressOut(e);
if (isV3 ? isMode('elevated') : isMode('contained')) {
const {
scale
} = animation;
_reactNative.Animated.timing(elevation, {
toValue: initialElevation,
duration: 150 * scale,
useNativeDriver: isWeb || _reactNative.Platform.constants.reactNativeVersion.minor <= 72
}).start();
}
};
const flattenedStyles = _reactNative.StyleSheet.flatten(style) || {};
const [, borderRadiusStyles] = (0, _splitStyles.splitStyles)(flattenedStyles, style => style.startsWith('border') && style.endsWith('Radius'));
const borderRadius = (isV3 ? 5 : 1) * roundness;
const iconSize = isV3 ? 18 : 16;
const {
backgroundColor,
borderColor,
textColor,
borderWidth
} = (0, _utils.getButtonColors)({
customButtonColor,
customTextColor,
theme,
mode,
disabled,
dark
});
const rippleColor = customRippleColor || (0, _color.default)(textColor).alpha(0.12).rgb().string();
const touchableStyle = {
...borderRadiusStyles,
borderRadius: borderRadiusStyles.borderRadius ?? borderRadius
};
const buttonStyle = {
backgroundColor,
borderColor,
borderWidth,
...touchableStyle
};
const {
color: customLabelColor,
fontSize: customLabelSize
} = _reactNative.StyleSheet.flatten(labelStyle) || {};
const font = isV3 ? theme.fonts.labelLarge : theme.fonts.medium;
const textStyle = {
color: textColor,
...font
};
const iconStyle = ((_StyleSheet$flatten = _reactNative.StyleSheet.flatten(contentStyle)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.flexDirection) === 'row-reverse' ? [styles.iconReverse, isV3 && styles[`md3IconReverse${compact ? 'Compact' : ''}`], isV3 && isMode('text') && styles[`md3IconReverseTextMode${compact ? 'Compact' : ''}`]] : [styles.icon, isV3 && styles[`md3Icon${compact ? 'Compact' : ''}`], isV3 && isMode('text') && styles[`md3IconTextMode${compact ? 'Compact' : ''}`]];
return /*#__PURE__*/React.createElement(_Surface.default, _extends({}, rest, {
ref: ref,
testID: `${testID}-container`,
style: [styles.button, compact && styles.compact, buttonStyle, style, !isV3 && !disabled && {
elevation
}]
}, isV3 && {
elevation: elevation
}, {
container: true
}), /*#__PURE__*/React.createElement(_TouchableRipple.default, {
borderless: true,
background: background,
onPress: onPress,
onLongPress: onLongPress,
onPressIn: hasPassedTouchHandler ? handlePressIn : undefined,
onPressOut: hasPassedTouchHandler ? handlePressOut : undefined,
delayLongPress: delayLongPress,
accessibilityLabel: accessibilityLabel,
accessibilityHint: accessibilityHint,
accessibilityRole: accessibilityRole,
accessibilityState: {
disabled
},
accessible: accessible,
hitSlop: hitSlop,
disabled: disabled,
rippleColor: rippleColor,
style: (0, _utils.getButtonTouchableRippleStyle)(touchableStyle, borderWidth),
testID: testID,
theme: theme,
ref: touchableRef
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.content, contentStyle]
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: iconStyle,
testID: `${testID}-icon-container`
}, /*#__PURE__*/React.createElement(_Icon.default, {
source: icon,
size: customLabelSize ?? iconSize,
color: typeof customLabelColor === 'string' ? customLabelColor : textColor
})) : null, loading ? /*#__PURE__*/React.createElement(_ActivityIndicator.default, {
size: customLabelSize ?? iconSize,
color: typeof customLabelColor === 'string' ? customLabelColor : textColor,
style: iconStyle
}) : null, /*#__PURE__*/React.createElement(_Text.default, {
variant: "labelLarge",
selectable: false,
numberOfLines: 1,
testID: `${testID}-text`,
style: [styles.label, !isV3 && styles.md2Label, isV3 && (isMode('text') ? icon || loading ? styles.md3LabelTextAddons : styles.md3LabelText : styles.md3Label), compact && styles.compactLabel, uppercase && styles.uppercaseLabel, textStyle, labelStyle],
maxFontSizeMultiplier: maxFontSizeMultiplier
}, children))));
};
const styles = _reactNative.StyleSheet.create({
button: {
minWidth: 64,
borderStyle: 'solid'
},
compact: {
minWidth: 'auto'
},
content: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center'
},
icon: {
marginLeft: 12,
marginRight: -4
},
iconReverse: {
marginRight: 12,
marginLeft: -4
},
/* eslint-disable react-native/no-unused-styles */
md3Icon: {
marginLeft: 16,
marginRight: -16
},
md3IconCompact: {
marginLeft: 8,
marginRight: 0
},
md3IconReverse: {
marginLeft: -16,
marginRight: 16
},
md3IconReverseCompact: {
marginLeft: 0,
marginRight: 8
},
md3IconTextMode: {
marginLeft: 12,
marginRight: -8
},
md3IconTextModeCompact: {
marginLeft: 6,
marginRight: 0
},
md3IconReverseTextMode: {
marginLeft: -8,
marginRight: 12
},
md3IconReverseTextModeCompact: {
marginLeft: 0,
marginRight: 6
},
/* eslint-enable react-native/no-unused-styles */
label: {
textAlign: 'center',
marginVertical: 9,
marginHorizontal: 16
},
md2Label: {
letterSpacing: 1
},
compactLabel: {
marginHorizontal: 8
},
uppercaseLabel: {
textTransform: 'uppercase'
},
md3Label: {
marginVertical: 10,
marginHorizontal: 24
},
md3LabelText: {
marginHorizontal: 12
},
md3LabelTextAddons: {
marginHorizontal: 16
}
});
var _default = exports.default = (0, _forwardRef.forwardRef)(Button);
//# sourceMappingURL=Button.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,194 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getButtonTouchableRippleStyle = exports.getButtonColors = void 0;
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _colors = require("../../styles/themes/v2/colors");
var _splitStyles = require("../../utils/splitStyles");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const isDark = ({
dark,
backgroundColor
}) => {
if (typeof dark === 'boolean') {
return dark;
}
if (backgroundColor === 'transparent') {
return false;
}
if (backgroundColor !== 'transparent') {
return !(0, _color.default)(backgroundColor).isLight();
}
return false;
};
const getButtonBackgroundColor = ({
isMode,
theme,
disabled,
customButtonColor
}) => {
if (customButtonColor && !disabled) {
return customButtonColor;
}
if (theme.isV3) {
if (disabled) {
if (isMode('outlined') || isMode('text')) {
return 'transparent';
}
return theme.colors.surfaceDisabled;
}
if (isMode('elevated')) {
return theme.colors.elevation.level1;
}
if (isMode('contained')) {
return theme.colors.primary;
}
if (isMode('contained-tonal')) {
return theme.colors.secondaryContainer;
}
}
if (isMode('contained')) {
if (disabled) {
return (0, _color.default)(theme.dark ? _colors.white : _colors.black).alpha(0.12).rgb().string();
}
return theme.colors.primary;
}
return 'transparent';
};
const getButtonTextColor = ({
isMode,
theme,
disabled,
customTextColor,
backgroundColor,
dark
}) => {
if (customTextColor && !disabled) {
return customTextColor;
}
if (theme.isV3) {
if (disabled) {
return theme.colors.onSurfaceDisabled;
}
if (typeof dark === 'boolean') {
if (isMode('contained') || isMode('contained-tonal') || isMode('elevated')) {
return isDark({
dark,
backgroundColor
}) ? _colors.white : _colors.black;
}
}
if (isMode('outlined') || isMode('text') || isMode('elevated')) {
return theme.colors.primary;
}
if (isMode('contained')) {
return theme.colors.onPrimary;
}
if (isMode('contained-tonal')) {
return theme.colors.onSecondaryContainer;
}
}
if (disabled) {
return (0, _color.default)(theme.dark ? _colors.white : _colors.black).alpha(0.32).rgb().string();
}
if (isMode('contained')) {
return isDark({
dark,
backgroundColor
}) ? _colors.white : _colors.black;
}
return theme.colors.primary;
};
const getButtonBorderColor = ({
isMode,
disabled,
theme
}) => {
if (theme.isV3) {
if (disabled && isMode('outlined')) {
return theme.colors.surfaceDisabled;
}
if (isMode('outlined')) {
return theme.colors.outline;
}
}
if (isMode('outlined')) {
return (0, _color.default)(theme.dark ? _colors.white : _colors.black).alpha(0.29).rgb().string();
}
return 'transparent';
};
const getButtonBorderWidth = ({
isMode,
theme
}) => {
if (theme.isV3) {
if (isMode('outlined')) {
return 1;
}
}
if (isMode('outlined')) {
return _reactNative.StyleSheet.hairlineWidth;
}
return 0;
};
const getButtonColors = ({
theme,
mode,
customButtonColor,
customTextColor,
disabled,
dark
}) => {
const isMode = modeToCompare => {
return mode === modeToCompare;
};
const backgroundColor = getButtonBackgroundColor({
isMode,
theme,
disabled,
customButtonColor
});
const textColor = getButtonTextColor({
isMode,
theme,
disabled,
customTextColor,
backgroundColor,
dark
});
const borderColor = getButtonBorderColor({
isMode,
theme,
disabled
});
const borderWidth = getButtonBorderWidth({
isMode,
theme
});
return {
backgroundColor,
borderColor,
textColor,
borderWidth
};
};
exports.getButtonColors = getButtonColors;
const getButtonTouchableRippleStyle = (style, borderWidth = 0) => {
if (!style) return {};
const touchableRippleStyle = {};
const [, borderRadiusStyles] = (0, _splitStyles.splitStyles)(style, style => style.startsWith('border') && style.endsWith('Radius'));
Object.keys(borderRadiusStyles).forEach(key => {
const value = style[key];
if (typeof value === 'number') {
// Only subtract borderWidth if value is greater than 0
const radius = value > 0 ? value - borderWidth : 0;
touchableRippleStyle[key] = radius;
}
});
return touchableRippleStyle;
};
exports.getButtonTouchableRippleStyle = getButtonTouchableRippleStyle;
//# sourceMappingURL=utils.js.map

File diff suppressed because one or more lines are too long

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,QAA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BC,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,CAA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tB,QAAA,KAAKW,IAAI;IAAED,KAAK,EAAE,CAACO,MAAM,CAACM,SAAS,EAAET,YAAY,EAAEJ,KAAK;EAAE,EAAE,CAAC;AAC3E,CAAC;AAEDJ,WAAW,CAACkB,WAAW,GAAG,cAAc;AAExC,MAAMP,MAAM,GAAGQ,uBAAU,CAACC,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,iBAAiB,EAAE;EACrB,CAAC;EACDR,KAAK,EAAE;IACLS,UAAU,EAAE;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":";;;;;;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B,MAAM,CAACG,KAAK,EAAEP,UAAU,CAAE;IAClCQ,gCAAgC;EAAA,EACjC,CACG,CAAC;AAEX,CAAC;AAACC,OAAA,CAAAxB,SAAA,GAAAA,SAAA;AAEFA,SAAS,CAACyB,WAAW,GAAG,YAAY;AACpC,MAAMN,MAAM,GAAGV,uBAAU,CAACiB,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,MAAM,EAAE,GAAG;IACXC,eAAe,EAAEC,eAAO;IACxBC,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,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Module", {
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.ts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AAK,EAACC,aAAK,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EAChD;EACA,OAAO,IAAAJ,cAAK,EAACK,aAAK,CAAC,CAACH,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,MAAME,kBAAkB,GAAGA,CAAC;EAC1BzB,KAAK;EACL0B;AAIF,CAAC,KAAK;EACJ,IAAI1B,KAAK,CAACI,IAAI,EAAE;IACd,IAAIsB,MAAM,CAAC,WAAW,CAAC,EAAE;MACvB,OAAO1B,KAAK,CAACgB,MAAM,CAACW,cAAc;IACpC;IACA,IAAID,MAAM,CAAC,UAAU,CAAC,EAAE;MACtB,OAAO1B,KAAK,CAACgB,MAAM,CAACY,OAAO;IAC7B;EACF;EACA,OAAOf,SAAS;AAClB,CAAC;AAEM,MAAMgB,aAAa,GAAGA,CAAC;EAC5B7B,KAAK;EACL8B;AAIF,CAAC,KAAK;EACJ,MAAMJ,MAAM,GAAIK,aAAuB,IAAK;IAC1C,OAAOD,IAAI,KAAKC,aAAa;EAC/B,CAAC;EAED,OAAO;IACLC,eAAe,EAAEP,kBAAkB,CAAC;MAClCzB,KAAK;MACL0B;IACF,CAAC,CAAC;IACFO,WAAW,EAAElB,cAAc,CAAC;MAAEf;IAAM,CAAC;EACvC,CAAC;AACH,CAAC;AAACc,OAAA,CAAAe,aAAA,GAAAA,aAAA","ignoreList":[]}

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.Checkbox = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _CheckboxAndroid = _interopRequireDefault(require("./CheckboxAndroid"));
var _CheckboxIOS = _interopRequireDefault(require("./CheckboxIOS"));
var _theming = require("../../core/theming");
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); }
/**
* Checkboxes allow the selection of multiple options from a set.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Checkbox } from 'react-native-paper';
*
* const MyComponent = () => {
* const [checked, setChecked] = React.useState(false);
*
* return (
* <Checkbox
* status={checked ? 'checked' : 'unchecked'}
* onPress={() => {
* setChecked(!checked);
* }}
* />
* );
* };
*
* export default MyComponent;
* ```
*/
const Checkbox = ({
theme: themeOverrides,
...props
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
return _reactNative.Platform.OS === 'ios' ? /*#__PURE__*/React.createElement(_CheckboxIOS.default, _extends({}, props, {
theme: theme
})) : /*#__PURE__*/React.createElement(_CheckboxAndroid.default, _extends({}, props, {
theme: theme
}));
};
var _default = exports.default = Checkbox; // @component-docs ignore-next-line
const CheckboxWithTheme = exports.Checkbox = Checkbox;
// @component-docs ignore-next-line
//# sourceMappingURL=Checkbox.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_CheckboxAndroid","_interopRequireDefault","_CheckboxIOS","_theming","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","Checkbox","theme","themeOverrides","props","useInternalTheme","Platform","OS","createElement","_default","exports","CheckboxWithTheme"],"sourceRoot":"../../../../src","sources":["components/Checkbox/Checkbox.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAsD,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,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,CAAA,OAAAK,CAAA,IAAAD,CAAA,GAAAS,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAG,CAAA,OAAAK,CAAA,CAAAI,GAAA,IAAAJ,CA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AAiB,GAAAD,OAAA,CAAAT,QAAA,GAAGA,QAAQ;AAClC","ignoreList":[]}

View File

@@ -0,0 +1,133 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.CheckboxAndroid = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _MaterialCommunityIcon = _interopRequireDefault(require("../MaterialCommunityIcon"));
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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); }
// From https://material.io/design/motion/speed.html#duration
const ANIMATION_DURATION = 100;
/**
* Checkboxes allow the selection of multiple options from a set.
* This component follows platform guidelines for Android, but can be used
* on any platform.
*
* @extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple
*/
const CheckboxAndroid = ({
status,
theme: themeOverrides,
disabled,
onPress,
testID,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
current: scaleAnim
} = React.useRef(new _reactNative.Animated.Value(1));
const isFirstRendering = React.useRef(true);
const {
animation: {
scale
}
} = theme;
React.useEffect(() => {
// Do not run animation on very first rendering
if (isFirstRendering.current) {
isFirstRendering.current = false;
return;
}
const checked = status === 'checked';
_reactNative.Animated.sequence([_reactNative.Animated.timing(scaleAnim, {
toValue: 0.85,
duration: checked ? ANIMATION_DURATION * scale : 0,
useNativeDriver: false
}), _reactNative.Animated.timing(scaleAnim, {
toValue: 1,
duration: checked ? ANIMATION_DURATION * scale : ANIMATION_DURATION * scale * 1.75,
useNativeDriver: false
})]).start();
}, [status, scaleAnim, scale]);
const checked = status === 'checked';
const indeterminate = status === 'indeterminate';
const {
rippleColor,
selectionControlColor
} = (0, _utils.getAndroidSelectionControlColor)({
theme,
disabled,
checked,
customColor: rest.color,
customUncheckedColor: rest.uncheckedColor
});
const borderWidth = scaleAnim.interpolate({
inputRange: [0.8, 1],
outputRange: [7, 0]
});
const icon = indeterminate ? 'minus-box' : checked ? 'checkbox-marked' : 'checkbox-blank-outline';
return /*#__PURE__*/React.createElement(_TouchableRipple.default, _extends({}, rest, {
borderless: true,
rippleColor: rippleColor,
onPress: onPress,
disabled: disabled,
accessibilityRole: "checkbox",
accessibilityState: {
disabled,
checked
},
accessibilityLiveRegion: "polite",
style: styles.container,
testID: testID,
theme: theme
}), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: {
transform: [{
scale: scaleAnim
}]
}
}, /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
allowFontScaling: false,
name: icon,
size: 24,
color: selectionControlColor,
direction: "ltr"
}), /*#__PURE__*/React.createElement(_reactNative.View, {
style: [_reactNative.StyleSheet.absoluteFill, styles.fillContainer]
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.fill, {
borderColor: selectionControlColor
}, {
borderWidth
}]
}))));
};
exports.CheckboxAndroid = CheckboxAndroid;
CheckboxAndroid.displayName = 'Checkbox.Android';
const styles = _reactNative.StyleSheet.create({
container: {
borderRadius: 18,
width: 36,
height: 36,
padding: 6
},
fillContainer: {
alignItems: 'center',
justifyContent: 'center'
},
fill: {
height: 14,
width: 14
}
});
var _default = exports.default = CheckboxAndroid; // @component-docs ignore-next-line
//# sourceMappingURL=CheckboxAndroid.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,79 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.CheckboxIOS = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _MaterialCommunityIcon = _interopRequireDefault(require("../MaterialCommunityIcon"));
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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); }
/**
* Checkboxes allow the selection of multiple options from a set.
* This component follows platform guidelines for iOS, but can be used
* on any platform.
*
* @extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple
*/
const CheckboxIOS = ({
status,
disabled,
onPress,
theme: themeOverrides,
testID,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const checked = status === 'checked';
const indeterminate = status === 'indeterminate';
const {
checkedColor,
rippleColor
} = (0, _utils.getSelectionControlIOSColor)({
theme,
disabled,
customColor: rest.color
});
const icon = indeterminate ? 'minus' : 'check';
const opacity = indeterminate || checked ? 1 : 0;
return /*#__PURE__*/React.createElement(_TouchableRipple.default, _extends({}, rest, {
borderless: true,
rippleColor: rippleColor,
onPress: onPress,
disabled: disabled,
accessibilityRole: "checkbox",
accessibilityState: {
disabled,
checked
},
accessibilityLiveRegion: "polite",
style: styles.container,
testID: testID,
theme: theme
}), /*#__PURE__*/React.createElement(_reactNative.View, {
style: {
opacity
}
}, /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
allowFontScaling: false,
name: icon,
size: 24,
color: checkedColor,
direction: "ltr"
})));
};
exports.CheckboxIOS = CheckboxIOS;
CheckboxIOS.displayName = 'Checkbox.IOS';
const styles = _reactNative.StyleSheet.create({
container: {
borderRadius: 18,
padding: 6
}
});
var _default = exports.default = CheckboxIOS; // @component-docs ignore-next-line
//# sourceMappingURL=CheckboxIOS.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_utils","_theming","_MaterialCommunityIcon","_interopRequireDefault","_TouchableRipple","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","CheckboxIOS","status","disabled","onPress","theme","themeOverrides","testID","rest","useInternalTheme","checked","indeterminate","checkedColor","rippleColor","getSelectionControlIOSColor","customColor","color","icon","opacity","createElement","borderless","accessibilityRole","accessibilityState","accessibilityLiveRegion","style","styles","container","View","allowFontScaling","name","size","direction","exports","displayName","StyleSheet","create","borderRadius","padding","_default"],"sourceRoot":"../../../../src","sources":["components/Checkbox/CheckboxIOS.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,sBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,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AEA,MAAO;IACfF,KAAK,EAAEA;EAAM,iBAEbtC,KAAA,CAAAoD,aAAA,CAACjD,YAAA,CAAAyD,IAAI;IAACH,KAAK,EAAE;MAAEN;IAAQ;EAAE,gBACvBnD,KAAA,CAAAoD,aAAA,CAAC9C,sBAAA,CAAAK,OAAqB;IACpBkD,gBAAgB,EAAE,KAAM;IACxBC,IAAI,EAAEZ,IAAK;IACXa,IAAI,EAAE,EAAG;IACTd,KAAK,EAAEJ,YAAa;IACpBmB,SAAS,EAAC;EAAK,CAChB,CACG,CACS,CAAC;AAEtB,CAAC;AAACC,OAAA,CAAA/B,WAAA,GAAAA,WAAA;AAEFA,WAAW,CAACgC,WAAW,GAAG,cAAc;AAExC,MAAMR,MAAM,GAAGS,uBAAU,CAACC,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,YAAY,EAAE,EAAE;IAChBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAN,OAAA,CAAAtD,OAAA,GAEYuB,WAAW,EAE1B","ignoreList":[]}

View File

@@ -0,0 +1,124 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.CheckboxItem = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
var _CheckboxAndroid = _interopRequireDefault(require("./CheckboxAndroid"));
var _CheckboxIOS = _interopRequireDefault(require("./CheckboxIOS"));
var _theming = require("../../core/theming");
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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); }
/**
* Checkbox.Item allows you to press the whole row (item) instead of only the Checkbox.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { View } from 'react-native';
* import { Checkbox } from 'react-native-paper';
*
* const MyComponent = () => (
* <View>
* <Checkbox.Item label="Item" status="checked" />
* </View>
* );
*
* export default MyComponent;
*```
*/
const CheckboxItem = ({
style,
status,
label,
onPress,
onLongPress,
labelStyle,
theme: themeOverrides,
testID,
mode,
position = 'trailing',
accessibilityLabel = label,
disabled,
labelVariant = 'bodyLarge',
labelMaxFontSizeMultiplier = 1.5,
rippleColor,
background,
hitSlop,
...props
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const checkboxProps = {
...props,
status,
theme,
disabled
};
const isLeading = position === 'leading';
let checkbox;
if (mode === 'android') {
checkbox = /*#__PURE__*/React.createElement(_CheckboxAndroid.default, checkboxProps);
} else if (mode === 'ios') {
checkbox = /*#__PURE__*/React.createElement(_CheckboxIOS.default, checkboxProps);
} else {
checkbox = /*#__PURE__*/React.createElement(_Checkbox.default, checkboxProps);
}
const textColor = theme.isV3 ? theme.colors.onSurface : theme.colors.text;
const disabledTextColor = theme.isV3 ? theme.colors.onSurfaceDisabled : theme.colors.disabled;
const textAlign = isLeading ? 'right' : 'left';
const computedStyle = {
color: disabled ? disabledTextColor : textColor,
textAlign
};
return /*#__PURE__*/React.createElement(_TouchableRipple.default, {
accessibilityLabel: accessibilityLabel,
accessibilityRole: "checkbox",
accessibilityState: {
checked: status === 'checked',
disabled
},
onPress: onPress,
onLongPress: onLongPress,
testID: testID,
disabled: disabled,
rippleColor: rippleColor,
theme: theme,
background: background,
hitSlop: hitSlop
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.container, style],
pointerEvents: "none",
importantForAccessibility: "no-hide-descendants"
}, isLeading && checkbox, /*#__PURE__*/React.createElement(_Text.default, {
variant: labelVariant,
testID: `${testID}-text`,
maxFontSizeMultiplier: labelMaxFontSizeMultiplier,
style: [styles.label, !theme.isV3 && styles.font, computedStyle, labelStyle]
}, label), !isLeading && checkbox));
};
exports.CheckboxItem = CheckboxItem;
CheckboxItem.displayName = 'Checkbox.Item';
var _default = exports.default = CheckboxItem; // @component-docs ignore-next-line
const styles = _reactNative.StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingVertical: 8,
paddingHorizontal: 16
},
label: {
flexShrink: 1,
flexGrow: 1
},
font: {
fontSize: 16
}
});
//# sourceMappingURL=CheckboxItem.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_Checkbox","_interopRequireDefault","_CheckboxAndroid","_CheckboxIOS","_theming","_TouchableRipple","_Text","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CheckboxItem","style","status","label","onPress","onLongPress","labelStyle","theme","themeOverrides","testID","mode","position","accessibilityLabel","disabled","labelVariant","labelMaxFontSizeMultiplier","rippleColor","background","hitSlop","props","useInternalTheme","checkboxProps","isLeading","checkbox","createElement","textColor","isV3","colors","onSurface","text","disabledTextColor","onSurfaceDisabled","textAlign","computedStyle","color","accessibilityRole","accessibilityState","checked","View","styles","container","pointerEvents","importantForAccessibility","variant","maxFontSizeMultiplier","font","exports","displayName","_default","StyleSheet","create","flexDirection","alignItems","justifyContent","paddingVertical","paddingHorizontal","flexShrink","flexGrow","fontSize"],"sourceRoot":"../../../../src","sources":["components/Checkbox/CheckboxItem.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAWA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAC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ACmB,SAAS,IAAIC,QACX,CACS,CAAC;AAEtB,CAAC;AAACuB,OAAA,CAAA9C,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAAC+C,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAF,OAAA,CAAA/D,OAAA,GAE5BiB,YAAY,EAE3B;AAGA,MAAMuC,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,SAAS,EAAE;IACTW,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDpD,KAAK,EAAE;IACLqD,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAE;EACZ,CAAC;EACDZ,IAAI,EAAE;IACJa,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
var _CheckboxAndroid = _interopRequireDefault(require("./CheckboxAndroid"));
var _CheckboxIOS = _interopRequireDefault(require("./CheckboxIOS"));
var _CheckboxItem = _interopRequireDefault(require("./CheckboxItem"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const Checkbox = Object.assign(
// @component ./Checkbox.tsx
_Checkbox.default, {
// @component ./CheckboxItem.tsx
Item: _CheckboxItem.default,
// @component ./CheckboxAndroid.tsx
Android: _CheckboxAndroid.default,
// @component ./CheckboxIOS.tsx
IOS: _CheckboxIOS.default
});
var _default = exports.default = Checkbox;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_Checkbox","_interopRequireDefault","require","_CheckboxAndroid","_CheckboxIOS","_CheckboxItem","e","__esModule","default","Checkbox","Object","assign","CheckboxComponent","Item","CheckboxItem","Android","CheckboxAndroid","IOS","CheckboxIOS","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Checkbox/index.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1C,MAAMG,QAAQ,GAAGC,MAAM,CAACC,MAAM;AAC5B;AACAC,iBAAiB,EACjB;EACE;EACAC,IAAI,EAAEC,qBAAY;EAClB;EACAC,OAAO,EAAEC,wBAAe;EACxB;EACAC,GAAG,EAAEC;AACP,CACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAZ,OAAA,GAEaC,QAAQ","ignoreList":[]}

View File

@@ -0,0 +1,150 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getSelectionControlIOSColor = exports.getAndroidSelectionControlColor = void 0;
var _color = _interopRequireDefault(require("color"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const getAndroidCheckedColor = ({
theme,
customColor
}) => {
if (customColor) {
return customColor;
}
if (theme.isV3) {
return theme.colors.primary;
}
return theme.colors.accent;
};
const getAndroidUncheckedColor = ({
theme,
customUncheckedColor
}) => {
if (customUncheckedColor) {
return customUncheckedColor;
}
if (theme.isV3) {
return theme.colors.onSurfaceVariant;
}
if (theme.dark) {
return (0, _color.default)(theme.colors.text).alpha(0.7).rgb().string();
}
return (0, _color.default)(theme.colors.text).alpha(0.54).rgb().string();
};
const getAndroidRippleColor = ({
theme,
checkedColor,
disabled
}) => {
if (disabled) {
if (theme.isV3) {
return (0, _color.default)(theme.colors.onSurface).alpha(0.16).rgb().string();
}
return (0, _color.default)(theme.colors.text).alpha(0.16).rgb().string();
}
return (0, _color.default)(checkedColor).fade(0.32).rgb().string();
};
const getAndroidControlColor = ({
theme,
checked,
disabled,
checkedColor,
uncheckedColor
}) => {
if (disabled) {
if (theme.isV3) {
return theme.colors.onSurfaceDisabled;
}
return theme.colors.disabled;
}
if (checked) {
return checkedColor;
}
return uncheckedColor;
};
const getAndroidSelectionControlColor = ({
theme,
disabled,
checked,
customColor,
customUncheckedColor
}) => {
const checkedColor = getAndroidCheckedColor({
theme,
customColor
});
const uncheckedColor = getAndroidUncheckedColor({
theme,
customUncheckedColor
});
return {
rippleColor: getAndroidRippleColor({
theme,
checkedColor,
disabled
}),
selectionControlColor: getAndroidControlColor({
theme,
disabled,
checked,
checkedColor,
uncheckedColor
})
};
};
exports.getAndroidSelectionControlColor = getAndroidSelectionControlColor;
const getIOSCheckedColor = ({
theme,
disabled,
customColor
}) => {
if (disabled) {
if (theme.isV3) {
return theme.colors.onSurfaceDisabled;
}
return theme.colors.disabled;
}
if (customColor) {
return customColor;
}
if (theme.isV3) {
return theme.colors.primary;
}
return theme.colors.accent;
};
const getIOSRippleColor = ({
theme,
checkedColor,
disabled
}) => {
if (disabled) {
if (theme.isV3) {
return (0, _color.default)(theme.colors.onSurface).alpha(0.16).rgb().string();
}
return (0, _color.default)(theme.colors.text).alpha(0.16).rgb().string();
}
return (0, _color.default)(checkedColor).fade(0.32).rgb().string();
};
const getSelectionControlIOSColor = ({
theme,
disabled,
customColor
}) => {
const checkedColor = getIOSCheckedColor({
theme,
disabled,
customColor
});
return {
checkedColor,
rippleColor: getIOSRippleColor({
theme,
checkedColor,
disabled
})
};
};
exports.getSelectionControlIOSColor = getSelectionControlIOSColor;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_color","_interopRequireDefault","require","e","__esModule","default","getAndroidCheckedColor","theme","customColor","isV3","colors","primary","accent","getAndroidUncheckedColor","customUncheckedColor","onSurfaceVariant","dark","color","text","alpha","rgb","string","getAndroidRippleColor","checkedColor","disabled","onSurface","fade","getAndroidControlColor","checked","uncheckedColor","onSurfaceDisabled","getAndroidSelectionControlColor","rippleColor","selectionControlColor","exports","getIOSCheckedColor","getIOSRippleColor","getSelectionControlIOSColor"],"sourceRoot":"../../../../src","sources":["components/Checkbox/utils.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI1B,MAAMG,sBAAsB,GAAGA,CAAC;EAC9BC,KAAK;EACLC;AAIF,CAAC,KAAK;EACJ,IAAIA,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,IAAID,KAAK,CAACE,IAAI,EAAE;IACd,OAAOF,KAAK,CAACG,MAAM,CAACC,OAAO;EAC7B;EAEA,OAAOJ,KAAK,CAACG,MAAM,CAACE,MAAM;AAC5B,CAAC;AAED,MAAMC,wBAAwB,GAAGA,CAAC;EAChCN,KAAK;EACLO;AAIF,CAAC,KAAK;EACJ,IAAIA,oBAAoB,EAAE;IACxB,OAAOA,oBAAoB;EAC7B;EAEA,IAAIP,KAAK,CAACE,IAAI,EAAE;IACd,OAAOF,KAAK,CAACG,MAAM,CAACK,gBAAgB;EACtC;EAEA,IAAIR,KAAK,CAACS,IAAI,EAAE;IACd,OAAO,IAAAC,cAAK,EAACV,KAAK,CAACG,MAAM,CAACQ,IAAI,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EAC3D;EAEA,OAAO,IAAAJ,cAAK,EAACV,KAAK,CAACG,MAAM,CAACQ,IAAI,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,MAAMC,qBAAqB,GAAGA,CAAC;EAC7Bf,KAAK;EACLgB,YAAY;EACZC;AAK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C;AAEM,MAAMgB,2BAA2B,GAAGA,CAAC;EAC1C9B,KAAK;EACLiB,QAAQ;EACRhB;AAKF,CAAC,KAAK;EACJ,MAAMe,YAAY,GAAGY,kBAAkB,CAAC;IAAE5B,KAAK;IAAEiB,QAAQ;IAAEhB;EAAY,CAAC,CAAC;EACzE,OAAO;IACLe,YAAY;IACZS,WAAW,EAAEI,iBAAiB,CAAC;MAC7B7B,KAAK;MACLgB,YAAY;MACZC;IACF,CAAC;EACH,CAAC;AACH,CAAC;AAACU,OAAA,CAAAG,2BAAA,GAAAA,2BAAA","ignoreList":[]}

View File

@@ -0,0 +1,316 @@
"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 _helpers = require("./helpers");
var _theming = require("../../core/theming");
var _colors = require("../../styles/themes/v2/colors");
var _hasTouchHandler = _interopRequireDefault(require("../../utils/hasTouchHandler"));
var _Icon = _interopRequireDefault(require("../Icon"));
var _MaterialCommunityIcon = _interopRequireDefault(require("../MaterialCommunityIcon"));
var _Surface = _interopRequireDefault(require("../Surface"));
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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); }
/**
* Chips are compact elements that can represent inputs, attributes, or actions.
* They can have an icon or avatar on the left, and a close button icon on the right.
* They are typically used to:
* <ul>
* <li>Present multiple options </li>
* <li>Represent attributes active or chosen </li>
* <li>Present filter options </li>
* <li>Trigger actions related to primary content </li>
* </ul>
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Chip } from 'react-native-paper';
*
* const MyComponent = () => (
* <Chip icon="information" onPress={() => console.log('Pressed')}>Example Chip</Chip>
* );
*
* export default MyComponent;
* ```
*/
const Chip = ({
mode = 'flat',
children,
icon,
avatar,
selected = false,
disabled = false,
background,
accessibilityLabel,
accessibilityRole = 'button',
closeIconAccessibilityLabel = 'Close',
onPress,
onLongPress,
onPressOut,
onPressIn,
delayLongPress,
onClose,
closeIcon,
textStyle,
style,
theme: themeOverrides,
testID = 'chip',
selectedColor,
rippleColor: customRippleColor,
showSelectedOverlay = false,
showSelectedCheck = true,
ellipsizeMode,
compact,
elevated = false,
maxFontSizeMultiplier,
hitSlop,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
isV3,
roundness
} = theme;
const isWeb = _reactNative.Platform.OS === 'web';
const {
current: elevation
} = React.useRef(new _reactNative.Animated.Value(isV3 && elevated ? 1 : 0));
const hasPassedTouchHandler = (0, _hasTouchHandler.default)({
onPress,
onLongPress,
onPressIn,
onPressOut
});
const isOutlined = mode === 'outlined';
const handlePressIn = (0, _useLatestCallback.default)(e => {
const {
scale
} = theme.animation;
onPressIn === null || onPressIn === void 0 || onPressIn(e);
_reactNative.Animated.timing(elevation, {
toValue: isV3 ? elevated ? 2 : 0 : 4,
duration: 200 * scale,
useNativeDriver: isWeb || _reactNative.Platform.constants.reactNativeVersion.minor <= 72
}).start();
});
const handlePressOut = (0, _useLatestCallback.default)(e => {
const {
scale
} = theme.animation;
onPressOut === null || onPressOut === void 0 || onPressOut(e);
_reactNative.Animated.timing(elevation, {
toValue: isV3 && elevated ? 1 : 0,
duration: 150 * scale,
useNativeDriver: isWeb || _reactNative.Platform.constants.reactNativeVersion.minor <= 72
}).start();
});
const opacity = isV3 ? 0.38 : 0.26;
const defaultBorderRadius = roundness * (isV3 ? 2 : 4);
const iconSize = isV3 ? 18 : 16;
const {
backgroundColor: customBackgroundColor,
borderRadius = defaultBorderRadius
} = _reactNative.StyleSheet.flatten(style) || {};
const {
borderColor,
textColor,
iconColor,
rippleColor,
selectedBackgroundColor,
backgroundColor
} = (0, _helpers.getChipColors)({
isOutlined,
theme,
selectedColor,
showSelectedOverlay,
customBackgroundColor,
disabled,
customRippleColor
});
const accessibilityState = {
selected,
disabled
};
const elevationStyle = isV3 || _reactNative.Platform.OS === 'android' ? elevation : 0;
const multiplier = isV3 ? compact ? 1.5 : 2 : 1;
const labelSpacings = {
marginRight: onClose ? 0 : 8 * multiplier,
marginLeft: avatar || icon || selected && showSelectedCheck ? 4 * multiplier : 8 * multiplier
};
const contentSpacings = {
paddingRight: isV3 ? onClose ? 34 : 0 : onClose ? 32 : 4
};
const labelTextStyle = {
color: textColor,
...(isV3 ? theme.fonts.labelLarge : theme.fonts.regular)
};
return /*#__PURE__*/React.createElement(_Surface.default, _extends({
style: [styles.container, isV3 && styles.md3Container, !theme.isV3 && {
elevation: elevationStyle
}, {
backgroundColor: selected ? selectedBackgroundColor : backgroundColor,
borderColor,
borderRadius
}, style]
}, theme.isV3 && {
elevation: elevationStyle
}, rest, {
testID: `${testID}-container`,
theme: theme,
container: true
}), /*#__PURE__*/React.createElement(_TouchableRipple.default, {
borderless: true,
background: background,
style: [{
borderRadius
}, styles.touchable],
onPress: onPress,
onLongPress: onLongPress,
onPressIn: hasPassedTouchHandler ? handlePressIn : undefined,
onPressOut: hasPassedTouchHandler ? handlePressOut : undefined,
delayLongPress: delayLongPress,
rippleColor: rippleColor,
disabled: disabled,
accessibilityLabel: accessibilityLabel,
accessibilityRole: accessibilityRole,
accessibilityState: accessibilityState,
testID: testID,
theme: theme,
hitSlop: hitSlop
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.content, isV3 && styles.md3Content, contentSpacings]
}, avatar && !icon ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.avatarWrapper, isV3 && styles.md3AvatarWrapper, disabled && {
opacity
}]
}, /*#__PURE__*/React.isValidElement(avatar) ? /*#__PURE__*/React.cloneElement(avatar, {
style: [styles.avatar, avatar.props.style]
}) : avatar) : null, icon || selected && showSelectedCheck ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.icon, isV3 && styles.md3Icon, avatar ? [styles.avatar, styles.avatarSelected, isV3 && selected && styles.md3SelectedIcon] : null]
}, icon ? /*#__PURE__*/React.createElement(_Icon.default, {
source: icon,
color: avatar ? _colors.white : !disabled && theme.isV3 ? theme.colors.primary : iconColor,
size: 18,
theme: theme
}) : /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: "check",
color: avatar ? _colors.white : iconColor,
size: 18,
direction: "ltr"
})) : null, /*#__PURE__*/React.createElement(_Text.default, {
variant: "labelLarge",
selectable: false,
numberOfLines: 1,
style: [isV3 ? styles.md3LabelText : styles.labelText, labelTextStyle, labelSpacings, textStyle],
ellipsizeMode: ellipsizeMode,
maxFontSizeMultiplier: maxFontSizeMultiplier
}, children))), onClose ? /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.closeButtonStyle
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
onPress: onClose,
disabled: disabled,
accessibilityRole: "button",
accessibilityLabel: closeIconAccessibilityLabel
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.icon, styles.closeIcon, isV3 && styles.md3CloseIcon]
}, closeIcon ? /*#__PURE__*/React.createElement(_Icon.default, {
source: closeIcon,
color: iconColor,
size: iconSize
}) : /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: isV3 ? 'close' : 'close-circle',
size: iconSize,
color: iconColor,
direction: "ltr"
})))) : null);
};
const styles = _reactNative.StyleSheet.create({
container: {
borderWidth: _reactNative.StyleSheet.hairlineWidth,
borderStyle: 'solid',
flexDirection: _reactNative.Platform.select({
default: 'column',
web: 'row'
})
},
md3Container: {
borderWidth: 1
},
content: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 4,
position: 'relative'
},
md3Content: {
paddingLeft: 0
},
icon: {
padding: 4,
alignSelf: 'center'
},
md3Icon: {
paddingLeft: 8,
paddingRight: 0
},
closeIcon: {
marginRight: 4
},
md3CloseIcon: {
marginRight: 8,
padding: 0
},
labelText: {
minHeight: 24,
lineHeight: 24,
textAlignVertical: 'center',
marginVertical: 4
},
md3LabelText: {
textAlignVertical: 'center',
marginVertical: 6
},
avatar: {
width: 24,
height: 24,
borderRadius: 12
},
avatarWrapper: {
marginRight: 4
},
md3AvatarWrapper: {
marginLeft: 4,
marginRight: 0
},
md3SelectedIcon: {
paddingLeft: 4
},
// eslint-disable-next-line react-native/no-color-literals
avatarSelected: {
position: 'absolute',
top: 4,
left: 4,
backgroundColor: 'rgba(0, 0, 0, .29)'
},
closeButtonStyle: {
position: 'absolute',
right: 0,
height: '100%',
justifyContent: 'center',
alignItems: 'center'
},
touchable: {
width: '100%'
}
});
var _default = exports.default = Chip;
//# sourceMappingURL=Chip.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,250 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getChipColors = 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 getBorderColor = ({
theme,
isOutlined,
disabled,
selectedColor,
backgroundColor
}) => {
const isSelectedColor = selectedColor !== undefined;
if (theme.isV3) {
if (!isOutlined) {
// If the Chip mode is "flat", set border color to transparent
return 'transparent';
}
if (disabled) {
return (0, _color.default)(theme.colors.onSurfaceVariant).alpha(0.12).rgb().string();
}
if (isSelectedColor) {
return (0, _color.default)(selectedColor).alpha(0.29).rgb().string();
}
return theme.colors.outline;
}
if (isOutlined) {
if (isSelectedColor) {
return (0, _color.default)(selectedColor).alpha(0.29).rgb().string();
}
if (theme.dark) {
return (0, _color.default)(_colors.white).alpha(0.29).rgb().string();
}
return (0, _color.default)(_colors.black).alpha(0.29).rgb().string();
}
return backgroundColor;
};
const getTextColor = ({
theme,
isOutlined,
disabled,
selectedColor
}) => {
const isSelectedColor = selectedColor !== undefined;
if (theme.isV3) {
if (disabled) {
return theme.colors.onSurfaceDisabled;
}
if (isSelectedColor) {
return selectedColor;
}
if (isOutlined) {
return theme.colors.onSurfaceVariant;
}
return theme.colors.onSecondaryContainer;
}
if (disabled) {
return theme.colors.disabled;
}
if (isSelectedColor) {
return (0, _color.default)(selectedColor).alpha(0.87).rgb().string();
}
return (0, _color.default)(theme.colors.text).alpha(0.87).rgb().string();
};
const getDefaultBackgroundColor = ({
theme,
isOutlined
}) => {
if (theme.isV3) {
if (isOutlined) {
return theme.colors.surface;
}
return theme.colors.secondaryContainer;
}
if (isOutlined) {
var _theme$colors;
return (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.surface;
}
if (theme.dark) {
return '#383838';
}
return '#ebebeb';
};
const getBackgroundColor = ({
theme,
isOutlined,
disabled,
customBackgroundColor
}) => {
if (typeof customBackgroundColor === 'string') {
return customBackgroundColor;
}
if (theme.isV3) {
if (disabled) {
if (isOutlined) {
return 'transparent';
}
return (0, _color.default)(theme.colors.onSurfaceVariant).alpha(0.12).rgb().string();
}
}
return getDefaultBackgroundColor({
theme,
isOutlined
});
};
const getSelectedBackgroundColor = ({
theme,
isOutlined,
disabled,
customBackgroundColor,
showSelectedOverlay
}) => {
const backgroundColor = getBackgroundColor({
theme,
disabled,
isOutlined,
customBackgroundColor
});
if (theme.isV3) {
if (isOutlined) {
if (showSelectedOverlay) {
return (0, _color.default)(backgroundColor).mix((0, _color.default)(theme.colors.onSurfaceVariant), 0.12).rgb().string();
}
return (0, _color.default)(backgroundColor).mix((0, _color.default)(theme.colors.onSurfaceVariant), 0).rgb().string();
}
if (showSelectedOverlay) {
return (0, _color.default)(backgroundColor).mix((0, _color.default)(theme.colors.onSecondaryContainer), 0.12).rgb().string();
}
return (0, _color.default)(backgroundColor).mix((0, _color.default)(theme.colors.onSecondaryContainer), 0).rgb().string();
}
if (theme.dark) {
if (isOutlined) {
return (0, _color.default)(backgroundColor).lighten(0.2).rgb().string();
}
return (0, _color.default)(backgroundColor).lighten(0.4).rgb().string();
}
if (isOutlined) {
return (0, _color.default)(backgroundColor).darken(0.08).rgb().string();
}
return (0, _color.default)(backgroundColor).darken(0.2).rgb().string();
};
const getIconColor = ({
theme,
isOutlined,
disabled,
selectedColor
}) => {
const isSelectedColor = selectedColor !== undefined;
if (theme.isV3) {
if (disabled) {
return theme.colors.onSurfaceDisabled;
}
if (isSelectedColor) {
return selectedColor;
}
if (isOutlined) {
return theme.colors.onSurfaceVariant;
}
return theme.colors.onSecondaryContainer;
}
if (disabled) {
return theme.colors.disabled;
}
if (isSelectedColor) {
return (0, _color.default)(selectedColor).alpha(0.54).rgb().string();
}
return (0, _color.default)(theme.colors.text).alpha(0.54).rgb().string();
};
const getRippleColor = ({
theme,
isOutlined,
disabled,
selectedColor,
selectedBackgroundColor,
customRippleColor
}) => {
if (customRippleColor) {
return customRippleColor;
}
const isSelectedColor = selectedColor !== undefined;
const textColor = getTextColor({
theme,
disabled,
selectedColor,
isOutlined
});
if (theme.isV3) {
if (isSelectedColor) {
return (0, _color.default)(selectedColor).alpha(0.12).rgb().string();
}
return (0, _color.default)(textColor).alpha(0.12).rgb().string();
}
if (isSelectedColor) {
return (0, _color.default)(selectedColor).fade(0.5).rgb().string();
}
return selectedBackgroundColor;
};
const getChipColors = ({
isOutlined,
theme,
selectedColor,
showSelectedOverlay,
customBackgroundColor,
disabled,
customRippleColor
}) => {
const baseChipColorProps = {
theme,
isOutlined,
disabled
};
const backgroundColor = getBackgroundColor({
...baseChipColorProps,
customBackgroundColor
});
const selectedBackgroundColor = getSelectedBackgroundColor({
...baseChipColorProps,
customBackgroundColor,
showSelectedOverlay
});
return {
borderColor: getBorderColor({
...baseChipColorProps,
selectedColor,
backgroundColor
}),
textColor: getTextColor({
...baseChipColorProps,
selectedColor
}),
iconColor: getIconColor({
...baseChipColorProps,
selectedColor
}),
rippleColor: getRippleColor({
...baseChipColorProps,
selectedColor,
selectedBackgroundColor,
customRippleColor
}),
backgroundColor,
selectedBackgroundColor
};
};
exports.getChipColors = getChipColors;
//# sourceMappingURL=helpers.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,102 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _Icon = _interopRequireWildcard(require("./Icon"));
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); }
const CrossFadeIcon = ({
color,
size,
source,
theme: themeOverrides,
testID = 'cross-fade-icon'
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const [currentIcon, setCurrentIcon] = React.useState(() => source);
const [previousIcon, setPreviousIcon] = React.useState(null);
const {
current: fade
} = React.useRef(new _reactNative.Animated.Value(1));
const {
scale
} = theme.animation;
if (currentIcon !== source) {
setPreviousIcon(() => currentIcon);
setCurrentIcon(() => source);
}
React.useEffect(() => {
if ((0, _Icon.isValidIcon)(previousIcon) && !(0, _Icon.isEqualIcon)(previousIcon, currentIcon)) {
fade.setValue(1);
_reactNative.Animated.timing(fade, {
duration: scale * 200,
toValue: 0,
useNativeDriver: true
}).start();
}
}, [currentIcon, previousIcon, fade, scale]);
const opacityPrev = fade;
const opacityNext = previousIcon ? fade.interpolate({
inputRange: [0, 1],
outputRange: [1, 0]
}) : 1;
const rotatePrev = fade.interpolate({
inputRange: [0, 1],
outputRange: ['-90deg', '0deg']
});
const rotateNext = previousIcon ? fade.interpolate({
inputRange: [0, 1],
outputRange: ['0deg', '-180deg']
}) : '0deg';
return /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.content, {
height: size,
width: size
}]
}, previousIcon ? /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.icon, {
opacity: opacityPrev,
transform: [{
rotate: rotatePrev
}]
}],
testID: `${testID}-previous`
}, /*#__PURE__*/React.createElement(_Icon.default, {
source: previousIcon,
size: size,
color: color,
theme: theme
})) : null, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.icon, {
opacity: opacityNext,
transform: [{
rotate: rotateNext
}]
}],
testID: `${testID}-current`
}, /*#__PURE__*/React.createElement(_Icon.default, {
source: currentIcon,
size: size,
color: color,
theme: theme
})));
};
var _default = exports.default = CrossFadeIcon;
const styles = _reactNative.StyleSheet.create({
content: {
alignItems: 'center',
justifyContent: 'center'
},
icon: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0
}
});
//# sourceMappingURL=CrossFadeIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_Icon","_theming","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CrossFadeIcon","color","size","source","theme","themeOverrides","testID","useInternalTheme","currentIcon","setCurrentIcon","useState","previousIcon","setPreviousIcon","current","fade","useRef","Animated","Value","scale","animation","useEffect","isValidIcon","isEqualIcon","setValue","timing","duration","toValue","useNativeDriver","start","opacityPrev","opacityNext","interpolate","inputRange","outputRange","rotatePrev","rotateNext","createElement","View","style","styles","content","height","width","icon","opacity","transform","rotate","_default","exports","StyleSheet","create","alignItems","justifyContent","position","top","left","right","bottom"],"sourceRoot":"../../../src","sources":["components/CrossFadeIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAmD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,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,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IA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AAA6D,aAAA,CAAC1D,YAAA,CAAAsC,QAAQ,CAACqB,IAAI;IACZC,KAAK,EAAE,CACLC,MAAM,CAACI,IAAI,EACX;MACEC,OAAO,EAAEd,WAAW;MACpBe,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAEX;MAAW,CAAC;IACpC,CAAC,CACD;IACF7B,MAAM,EAAE,GAAGA,MAAM;EAAW,gBAE5B/B,KAAA,CAAA6D,aAAA,CAACzD,KAAA,CAAAY,OAAI;IAACY,MAAM,EAAEK,WAAY;IAACN,IAAI,EAAEA,IAAK;IAACD,KAAK,EAAEA,KAAM;IAACG,KAAK,EAAEA;EAAM,CAAE,CACvD,CACX,CAAC;AAEX,CAAC;AAAC,IAAA2C,QAAA,GAAAC,OAAA,CAAAzD,OAAA,GAEaS,aAAa;AAE5B,MAAMuC,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,OAAO,EAAE;IACPW,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDT,IAAI,EAAE;IACJU,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,128 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _DataTableCell = _interopRequireDefault(require("./DataTableCell"));
var _DataTableHeader2 = _interopRequireDefault(require("./DataTableHeader"));
var _DataTablePagination2 = _interopRequireDefault(require("./DataTablePagination"));
var _DataTableRow2 = _interopRequireDefault(require("./DataTableRow"));
var _DataTableTitle2 = _interopRequireDefault(require("./DataTableTitle"));
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); } // eslint-disable-next-line @typescript-eslint/no-unused-vars
/**
* Data tables allow displaying sets of data.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { DataTable } from 'react-native-paper';
*
* const MyComponent = () => {
* const [page, setPage] = React.useState<number>(0);
* const [numberOfItemsPerPageList] = React.useState([2, 3, 4]);
* const [itemsPerPage, onItemsPerPageChange] = React.useState(
* numberOfItemsPerPageList[0]
* );
*
* const [items] = React.useState([
* {
* key: 1,
* name: 'Cupcake',
* calories: 356,
* fat: 16,
* },
* {
* key: 2,
* name: 'Eclair',
* calories: 262,
* fat: 16,
* },
* {
* key: 3,
* name: 'Frozen yogurt',
* calories: 159,
* fat: 6,
* },
* {
* key: 4,
* name: 'Gingerbread',
* calories: 305,
* fat: 3.7,
* },
* ]);
*
* const from = page * itemsPerPage;
* const to = Math.min((page + 1) * itemsPerPage, items.length);
*
* React.useEffect(() => {
* setPage(0);
* }, [itemsPerPage]);
*
* return (
* <DataTable>
* <DataTable.Header>
* <DataTable.Title>Dessert</DataTable.Title>
* <DataTable.Title numeric>Calories</DataTable.Title>
* <DataTable.Title numeric>Fat</DataTable.Title>
* </DataTable.Header>
*
* {items.slice(from, to).map((item) => (
* <DataTable.Row key={item.key}>
* <DataTable.Cell>{item.name}</DataTable.Cell>
* <DataTable.Cell numeric>{item.calories}</DataTable.Cell>
* <DataTable.Cell numeric>{item.fat}</DataTable.Cell>
* </DataTable.Row>
* ))}
*
* <DataTable.Pagination
* page={page}
* numberOfPages={Math.ceil(items.length / itemsPerPage)}
* onPageChange={(page) => setPage(page)}
* label={`${from + 1}-${to} of ${items.length}`}
* numberOfItemsPerPageList={numberOfItemsPerPageList}
* numberOfItemsPerPage={itemsPerPage}
* onItemsPerPageChange={onItemsPerPageChange}
* showFastPaginationControls
* selectPageDropdownLabel={'Rows per page'}
* />
* </DataTable>
* );
* };
*
* export default MyComponent;
* ```
*/
const DataTable = ({
children,
style,
...rest
}) => /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, rest, {
style: [styles.container, style]
}), children);
// @component ./DataTableHeader.tsx
DataTable.Header = _DataTableHeader2.default;
// @component ./DataTableTitle.tsx
DataTable.Title = _DataTableTitle2.default;
// @component ./DataTableRow.tsx
DataTable.Row = _DataTableRow2.default;
// @component ./DataTableCell.tsx
DataTable.Cell = _DataTableCell.default;
// @component ./DataTablePagination.tsx
DataTable.Pagination = _DataTablePagination2.default;
const styles = _reactNative.StyleSheet.create({
container: {
width: '100%'
}
});
var _default = exports.default = DataTable;
//# sourceMappingURL=DataTable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_DataTableCell","_interopRequireDefault","_DataTableHeader2","_DataTablePagination2","_DataTableRow2","_DataTableTitle2","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","DataTable","children","style","rest","createElement","View","styles","container","Header","DataTableHeader","Title","DataTableTitle","Row","DataTableRow","Cell","DataTableCell","Pagination","DataTablePagination","StyleSheet","create","width","_default","exports"],"sourceRoot":"../../../../src","sources":["components/DataTable/DataTable.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;A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X,SAAS,CAACY,GAAG,GAAGC,sBAAY;;AAE5B;AACAb,SAAS,CAACc,IAAI,GAAGC,sBAAa;;AAE9B;AACAf,SAAS,CAACgB,UAAU,GAAGC,6BAAmB;AAE1C,MAAMX,MAAM,GAAGY,uBAAU,CAACC,MAAM,CAAC;EAC/BZ,SAAS,EAAE;IACTa,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7C,OAAA,GAEYuB,SAAS","ignoreList":[]}

View File

@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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 to show a single cell inside of a table.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { DataTable } from 'react-native-paper';
*
* const MyComponent = () => (
* <DataTable.Row>
* <DataTable.Cell numeric>1</DataTable.Cell>
* <DataTable.Cell numeric>2</DataTable.Cell>
* <DataTable.Cell numeric>3</DataTable.Cell>
* <DataTable.Cell numeric>4</DataTable.Cell>
* </DataTable.Row>
* );
*
* export default MyComponent;
* ```
*
* If you want to support multiline text, please use View instead, as multiline text doesn't comply with
* MD Guidelines (https://github.com/callstack/react-native-paper/issues/2381).
*
* @extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple
*/
const DataTableCell = ({
children,
textStyle,
style,
numeric,
maxFontSizeMultiplier,
testID,
...rest
}) => {
return /*#__PURE__*/React.createElement(_TouchableRipple.default, _extends({}, rest, {
testID: testID,
style: [styles.container, numeric && styles.right, style]
}), /*#__PURE__*/React.createElement(CellContent, {
textStyle: textStyle,
testID: testID,
maxFontSizeMultiplier: maxFontSizeMultiplier
}, children));
};
const CellContent = ({
children,
textStyle,
maxFontSizeMultiplier,
testID
}) => {
if (/*#__PURE__*/React.isValidElement(children)) {
return children;
}
return /*#__PURE__*/React.createElement(_Text.default, {
style: textStyle,
numberOfLines: 1,
maxFontSizeMultiplier: maxFontSizeMultiplier,
testID: `${testID}-text-container`
}, children);
};
DataTableCell.displayName = 'DataTable.Cell';
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
alignItems: 'center'
},
right: {
justifyContent: 'flex-end'
}
});
var _default = exports.default = DataTableCell;
//# sourceMappingURL=DataTableCell.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_TouchableRipple","_interopRequireDefault","_Text","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","DataTableCell","children","textStyle","style","numeric","maxFontSizeMultiplier","testID","rest","createElement","styles","container","right","CellContent","isValidElement","numberOfLines","displayName","StyleSheet","create","flex","flexDirection","alignItems","justifyContent","_default","exports"],"sourceRoot":"../../../../src","sources":["components/DataTable/DataTableCell.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uB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AA,CAAClC,KAAA,CAAAG,OAAI;IACH0B,KAAK,EAAED,SAAU;IACjBY,aAAa,EAAE,CAAE;IACjBT,qBAAqB,EAAEA,qBAAsB;IAC7CC,MAAM,EAAE,GAAGA,MAAM;EAAkB,GAElCL,QACG,CAAC;AAEX,CAAC;AAEDD,aAAa,CAACe,WAAW,GAAG,gBAAgB;AAE5C,MAAMN,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EAEDT,KAAK,EAAE;IACLU,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAEYuB,aAAa","ignoreList":[]}

View File

@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DataTableHeader = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _theming = require("../../core/theming");
var _colors = require("../../styles/themes/v2/colors");
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 title in table header.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { DataTable } from 'react-native-paper';
*
* const MyComponent = () => (
* <DataTable>
* <DataTable.Header>
* <DataTable.Title
* sortDirection='descending'
* >
* Dessert
* </DataTable.Title>
* <DataTable.Title numeric>Calories</DataTable.Title>
* <DataTable.Title numeric>Fat (g)</DataTable.Title>
* </DataTable.Header>
* </DataTable>
* );
*
* export default MyComponent;
* ```
*/
const DataTableHeader = ({
children,
style,
theme: themeOverrides,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const borderBottomColor = theme.isV3 ? theme.colors.surfaceVariant : (0, _color.default)(theme.dark ? _colors.white : _colors.black).alpha(0.12).rgb().string();
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, rest, {
style: [styles.header, {
borderBottomColor
}, style]
}), children);
};
exports.DataTableHeader = DataTableHeader;
DataTableHeader.displayName = 'DataTable.Header';
const styles = _reactNative.StyleSheet.create({
header: {
flexDirection: 'row',
paddingHorizontal: 16,
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth * 2
}
});
var _default = exports.default = DataTableHeader; // @component-docs ignore-next-line
//# sourceMappingURL=DataTableHeader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_color","_interopRequireDefault","_theming","_colors","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","DataTableHeader","children","style","theme","themeOverrides","rest","useInternalTheme","borderBottomColor","isV3","colors","surfaceVariant","color","dark","white","black","alpha","rgb","string","createElement","View","styles","header","exports","displayName","StyleSheet","create","flexDirection","paddingHorizontal","borderBottomWidth","hairlineWidth","_default"],"sourceRoot":"../../../../src","sources":["components/DataTable/DataTableHeader.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAA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ACC,MAAM,CAAC;EAC/BJ,MAAM,EAAE;IACNK,aAAa,EAAE,KAAK;IACpBC,iBAAiB,EAAE,EAAE;IACrBC,iBAAiB,EAAEJ,uBAAU,CAACK,aAAa,GAAG;EAChD;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAR,OAAA,CAAA7C,OAAA,GAEYuB,eAAe,EAE9B","ignoreList":[]}

View File

@@ -0,0 +1,277 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DataTablePagination = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _theming = require("../../core/theming");
var _Button = _interopRequireDefault(require("../Button/Button"));
var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
var _MaterialCommunityIcon = _interopRequireDefault(require("../MaterialCommunityIcon"));
var _Menu = _interopRequireDefault(require("../Menu/Menu"));
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); }
const PaginationControls = ({
page,
numberOfPages,
onPageChange,
showFastPaginationControls,
theme: themeOverrides,
paginationControlRippleColor
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const textColor = theme.isV3 ? theme.colors.onSurface : theme.colors.text;
return /*#__PURE__*/React.createElement(React.Fragment, null, showFastPaginationControls ? /*#__PURE__*/React.createElement(_IconButton.default, {
icon: ({
size,
color
}) => /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: "page-first",
color: color,
size: size,
direction: _reactNative.I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
}),
iconColor: textColor,
rippleColor: paginationControlRippleColor,
disabled: page === 0,
onPress: () => onPageChange(0),
accessibilityLabel: "page-first",
theme: theme
}) : null, /*#__PURE__*/React.createElement(_IconButton.default, {
icon: ({
size,
color
}) => /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: "chevron-left",
color: color,
size: size,
direction: _reactNative.I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
}),
iconColor: textColor,
rippleColor: paginationControlRippleColor,
disabled: page === 0,
onPress: () => onPageChange(page - 1),
accessibilityLabel: "chevron-left",
theme: theme
}), /*#__PURE__*/React.createElement(_IconButton.default, {
icon: ({
size,
color
}) => /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: "chevron-right",
color: color,
size: size,
direction: _reactNative.I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
}),
iconColor: textColor,
rippleColor: paginationControlRippleColor,
disabled: numberOfPages === 0 || page === numberOfPages - 1,
onPress: () => onPageChange(page + 1),
accessibilityLabel: "chevron-right",
theme: theme
}), showFastPaginationControls ? /*#__PURE__*/React.createElement(_IconButton.default, {
icon: ({
size,
color
}) => /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: "page-last",
color: color,
size: size,
direction: _reactNative.I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
}),
iconColor: textColor,
rippleColor: paginationControlRippleColor,
disabled: numberOfPages === 0 || page === numberOfPages - 1,
onPress: () => onPageChange(numberOfPages - 1),
accessibilityLabel: "page-last",
theme: theme
}) : null);
};
const PaginationDropdown = ({
numberOfItemsPerPageList,
numberOfItemsPerPage,
onItemsPerPageChange,
theme: themeOverrides,
selectPageDropdownRippleColor,
dropdownItemRippleColor
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
colors
} = theme;
const [showSelect, toggleSelect] = React.useState(false);
return /*#__PURE__*/React.createElement(_Menu.default, {
visible: showSelect,
onDismiss: () => toggleSelect(!showSelect),
theme: theme,
anchor: /*#__PURE__*/React.createElement(_Button.default, {
mode: "outlined",
onPress: () => toggleSelect(true),
style: styles.button,
icon: "menu-down",
contentStyle: styles.contentStyle,
theme: theme,
rippleColor: selectPageDropdownRippleColor
}, `${numberOfItemsPerPage}`)
}, numberOfItemsPerPageList === null || numberOfItemsPerPageList === void 0 ? void 0 : numberOfItemsPerPageList.map(option => /*#__PURE__*/React.createElement(_Menu.default.Item, {
key: option,
titleStyle: option === numberOfItemsPerPage && {
color: colors === null || colors === void 0 ? void 0 : colors.primary
},
onPress: () => {
onItemsPerPageChange === null || onItemsPerPageChange === void 0 || onItemsPerPageChange(option);
toggleSelect(false);
},
rippleColor: dropdownItemRippleColor,
title: option,
theme: theme
})));
};
/**
* A component to show pagination for data table.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { DataTable } from 'react-native-paper';
*
* const numberOfItemsPerPageList = [2, 3, 4];
*
* const items = [
* {
* key: 1,
* name: 'Page 1',
* },
* {
* key: 2,
* name: 'Page 2',
* },
* {
* key: 3,
* name: 'Page 3',
* },
* ];
*
* const MyComponent = () => {
* const [page, setPage] = React.useState(0);
* const [numberOfItemsPerPage, onItemsPerPageChange] = React.useState(numberOfItemsPerPageList[0]);
* const from = page * numberOfItemsPerPage;
* const to = Math.min((page + 1) * numberOfItemsPerPage, items.length);
*
* React.useEffect(() => {
* setPage(0);
* }, [numberOfItemsPerPage]);
*
* return (
* <DataTable>
* <DataTable.Pagination
* page={page}
* numberOfPages={Math.ceil(items.length / numberOfItemsPerPage)}
* onPageChange={page => setPage(page)}
* label={`${from + 1}-${to} of ${items.length}`}
* showFastPaginationControls
* numberOfItemsPerPageList={numberOfItemsPerPageList}
* numberOfItemsPerPage={numberOfItemsPerPage}
* onItemsPerPageChange={onItemsPerPageChange}
* selectPageDropdownLabel={'Rows per page'}
* />
* </DataTable>
* );
* };
*
* export default MyComponent;
* ```
*/
const DataTablePagination = ({
label,
accessibilityLabel,
page,
numberOfPages,
onPageChange,
style,
showFastPaginationControls = false,
numberOfItemsPerPageList,
numberOfItemsPerPage,
onItemsPerPageChange,
selectPageDropdownLabel,
selectPageDropdownAccessibilityLabel,
selectPageDropdownRippleColor,
dropdownItemRippleColor,
theme: themeOverrides,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const labelColor = (0, _color.default)(theme.isV3 ? theme.colors.onSurface : theme === null || theme === void 0 ? void 0 : theme.colors.text).alpha(0.6).rgb().string();
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, rest, {
style: [styles.container, style],
accessibilityLabel: "pagination-container"
}), numberOfItemsPerPageList && numberOfItemsPerPage && onItemsPerPageChange && /*#__PURE__*/React.createElement(_reactNative.View, {
accessibilityLabel: "Options Select",
style: styles.optionsContainer
}, /*#__PURE__*/React.createElement(_Text.default, {
style: [styles.label, {
color: labelColor
}],
numberOfLines: 3,
accessibilityLabel: selectPageDropdownAccessibilityLabel || 'selectPageDropdownLabel'
}, selectPageDropdownLabel), /*#__PURE__*/React.createElement(PaginationDropdown, {
numberOfItemsPerPageList: numberOfItemsPerPageList,
numberOfItemsPerPage: numberOfItemsPerPage,
onItemsPerPageChange: onItemsPerPageChange,
selectPageDropdownRippleColor: selectPageDropdownRippleColor,
dropdownItemRippleColor: dropdownItemRippleColor,
theme: theme
})), /*#__PURE__*/React.createElement(_Text.default, {
style: [styles.label, {
color: labelColor
}],
numberOfLines: 3,
accessibilityLabel: accessibilityLabel || 'label'
}, label), /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.iconsContainer
}, /*#__PURE__*/React.createElement(PaginationControls, {
showFastPaginationControls: showFastPaginationControls,
onPageChange: onPageChange,
page: page,
numberOfPages: numberOfPages,
theme: theme
})));
};
exports.DataTablePagination = DataTablePagination;
DataTablePagination.displayName = 'DataTable.Pagination';
const styles = _reactNative.StyleSheet.create({
container: {
justifyContent: 'flex-end',
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 16,
flexWrap: 'wrap'
},
optionsContainer: {
flexDirection: 'row',
alignItems: 'center',
marginVertical: 6
},
label: {
fontSize: 12,
marginRight: 16
},
button: {
textAlign: 'center',
marginRight: 16
},
iconsContainer: {
flexDirection: 'row'
},
contentStyle: {
flexDirection: 'row-reverse'
}
});
var _default = exports.default = DataTablePagination; // @component-docs ignore-next-line
//# sourceMappingURL=DataTablePagination.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DataTableRow = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _theming = require("../../core/theming");
var _colors = require("../../styles/themes/v2/colors");
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
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 show a single row inside of a table.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { DataTable } from 'react-native-paper';
*
* const MyComponent = () => (
* <DataTable.Row>
* <DataTable.Cell numeric>1</DataTable.Cell>
* <DataTable.Cell numeric>2</DataTable.Cell>
* <DataTable.Cell numeric>3</DataTable.Cell>
* <DataTable.Cell numeric>4</DataTable.Cell>
* </DataTable.Row>
* );
*
* export default MyComponent;
* ```
*
* @extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple
*/
const DataTableRow = ({
onPress,
style,
children,
pointerEvents,
theme: themeOverrides,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const borderBottomColor = theme.isV3 ? theme.colors.surfaceVariant : (0, _color.default)(theme.dark ? _colors.white : _colors.black).alpha(0.12).rgb().string();
return /*#__PURE__*/React.createElement(_TouchableRipple.default, _extends({}, rest, {
onPress: onPress,
style: [styles.container, {
borderBottomColor
}, style]
}), /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.content,
pointerEvents: pointerEvents
}, children));
};
exports.DataTableRow = DataTableRow;
DataTableRow.displayName = 'DataTable.Row';
const styles = _reactNative.StyleSheet.create({
container: {
borderStyle: 'solid',
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth,
minHeight: 48,
paddingHorizontal: 16
},
content: {
flex: 1,
flexDirection: 'row'
}
});
var _default = exports.default = DataTableRow; // @component-docs ignore-next-line
//# sourceMappingURL=DataTableRow.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_color","_interopRequireDefault","_theming","_colors","_TouchableRipple","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","DataTableRow","onPress","style","children","pointerEvents","theme","themeOverrides","rest","useInternalTheme","borderBottomColor","isV3","colors","surfaceVariant","color","dark","white","black","alpha","rgb","string","createElement","styles","container","View","content","exports","displayName","StyleSheet","create","borderStyle","borderBottomWidth","hairlineWidth","minHeight","paddingHorizontal","flex","flexDirection","_default"],"sourceRoot":"../../../../src","sources":["components/DataTable/DataTableRow.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,gBAAA,GAAAH,sBAAA,CAAAH,OAAA;AAAiE,SAAAG,uBAAAI,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,CAAA,OAAAK,CAAA,IAAAD,CAAA,GAAAS,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,C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G,OAAe,EAAAiB,QAAA,KACVa,IAAI;IACRN,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAE,CAACmB,MAAM,CAACC,SAAS,EAAE;MAAEb;IAAkB,CAAC,EAAEP,KAAK;EAAE,iBAExDpC,KAAA,CAAAsD,aAAA,CAACnD,YAAA,CAAAsD,IAAI;IAACrB,KAAK,EAAEmB,MAAM,CAACG,OAAQ;IAACpB,aAAa,EAAEA;EAAc,GACvDD,QACG,CACS,CAAC;AAEtB,CAAC;AAACsB,OAAA,CAAAzB,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAAC0B,WAAW,GAAG,eAAe;AAE1C,MAAML,MAAM,GAAGM,uBAAU,CAACC,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,WAAW,EAAE,OAAO;IACpBC,iBAAiB,EAAEH,uBAAU,CAACI,aAAa;IAC3CC,SAAS,EAAE,EAAE;IACbC,iBAAiB,EAAE;EACrB,CAAC;EACDT,OAAO,EAAE;IACPU,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAX,OAAA,CAAAhD,OAAA,GAEYuB,YAAY,EAE3B","ignoreList":[]}

View File

@@ -0,0 +1,139 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DataTableTitle = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _theming = require("../../core/theming");
var _MaterialCommunityIcon = _interopRequireDefault(require("../MaterialCommunityIcon"));
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 to display title in table header.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { DataTable } from 'react-native-paper';
*
* const MyComponent = () => (
* <DataTable>
* <DataTable.Header>
* <DataTable.Title
* sortDirection='descending'
* >
* Dessert
* </DataTable.Title>
* <DataTable.Title numeric>Calories</DataTable.Title>
* <DataTable.Title numeric>Fat (g)</DataTable.Title>
* </DataTable.Header>
* </DataTable>
* );
*
* export default MyComponent;
* ```
*/
const DataTableTitle = ({
numeric,
children,
onPress,
sortDirection,
textStyle,
style,
theme: themeOverrides,
numberOfLines = 1,
maxFontSizeMultiplier,
...rest
}) => {
var _theme$colors;
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
current: spinAnim
} = React.useRef(new _reactNative.Animated.Value(sortDirection === 'ascending' ? 0 : 1));
React.useEffect(() => {
_reactNative.Animated.timing(spinAnim, {
toValue: sortDirection === 'ascending' ? 0 : 1,
duration: 150,
useNativeDriver: true
}).start();
}, [sortDirection, spinAnim]);
const textColor = theme.isV3 ? theme.colors.onSurface : theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.text;
const alphaTextColor = (0, _color.default)(textColor).alpha(0.6).rgb().string();
const spin = spinAnim.interpolate({
inputRange: [0, 1],
outputRange: ['0deg', '180deg']
});
const icon = sortDirection ? /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
style: [styles.icon, {
transform: [{
rotate: spin
}]
}]
}, /*#__PURE__*/React.createElement(_MaterialCommunityIcon.default, {
name: "arrow-up",
size: 16,
color: textColor,
direction: _reactNative.I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
})) : null;
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
disabled: !onPress,
onPress: onPress
}, rest, {
style: [styles.container, numeric && styles.right, style]
}), icon, /*#__PURE__*/React.createElement(_Text.default, {
style: [styles.cell,
// height must scale with numberOfLines
{
maxHeight: 24 * _reactNative.PixelRatio.getFontScale() * numberOfLines
},
// if numberOfLines causes wrap, center is lost. Align directly, sensitive to numeric and RTL
numberOfLines > 1 ? numeric ? _reactNative.I18nManager.getConstants().isRTL ? styles.leftText : styles.rightText : styles.centerText : {}, sortDirection ? styles.sorted : {
color: alphaTextColor
}, textStyle],
numberOfLines: numberOfLines,
maxFontSizeMultiplier: maxFontSizeMultiplier
}, children));
};
exports.DataTableTitle = DataTableTitle;
DataTableTitle.displayName = 'DataTable.Title';
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
alignContent: 'center',
paddingVertical: 12
},
rightText: {
textAlign: 'right'
},
leftText: {
textAlign: 'left'
},
centerText: {
textAlign: 'center'
},
right: {
justifyContent: 'flex-end'
},
cell: {
lineHeight: 24,
fontSize: 12,
fontWeight: '500',
alignItems: 'center'
},
sorted: {
marginLeft: 8
},
icon: {
height: 24,
justifyContent: 'center'
}
});
var _default = exports.default = DataTableTitle; // @component-docs ignore-next-line
//# sourceMappingURL=DataTableTitle.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,146 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _DialogActions = _interopRequireDefault(require("./DialogActions"));
var _DialogContent = _interopRequireDefault(require("./DialogContent"));
var _DialogIcon = _interopRequireDefault(require("./DialogIcon"));
var _DialogScrollArea = _interopRequireDefault(require("./DialogScrollArea"));
var _DialogTitle = _interopRequireDefault(require("./DialogTitle"));
var _theming = require("../../core/theming");
var _overlay = _interopRequireDefault(require("../../styles/overlay"));
var _Modal = _interopRequireDefault(require("../Modal"));
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 DIALOG_ELEVATION = 24;
/**
* Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks.
* To render the `Dialog` above other components, you'll need to wrap it with the [`Portal`](../../Portal) component.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { View } from 'react-native';
* import { Button, Dialog, Portal, PaperProvider, Text } from 'react-native-paper';
*
* const MyComponent = () => {
* const [visible, setVisible] = React.useState(false);
*
* const showDialog = () => setVisible(true);
*
* const hideDialog = () => setVisible(false);
*
* return (
* <PaperProvider>
* <View>
* <Button onPress={showDialog}>Show Dialog</Button>
* <Portal>
* <Dialog visible={visible} onDismiss={hideDialog}>
* <Dialog.Title>Alert</Dialog.Title>
* <Dialog.Content>
* <Text variant="bodyMedium">This is simple dialog</Text>
* </Dialog.Content>
* <Dialog.Actions>
* <Button onPress={hideDialog}>Done</Button>
* </Dialog.Actions>
* </Dialog>
* </Portal>
* </View>
* </PaperProvider>
* );
* };
*
* export default MyComponent;
* ```
*/
const Dialog = ({
children,
dismissable = true,
dismissableBackButton = dismissable,
onDismiss,
visible = false,
style,
theme: themeOverrides,
testID
}) => {
const {
right,
left
} = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
isV3,
dark,
mode,
colors,
roundness
} = theme;
const borderRadius = (isV3 ? 7 : 1) * roundness;
const backgroundColorV2 = dark && mode === 'adaptive' ? (0, _overlay.default)(DIALOG_ELEVATION, colors === null || colors === void 0 ? void 0 : colors.surface) : colors === null || colors === void 0 ? void 0 : colors.surface;
const backgroundColor = isV3 ? theme.colors.elevation.level3 : backgroundColorV2;
return /*#__PURE__*/React.createElement(_Modal.default, {
dismissable: dismissable,
dismissableBackButton: dismissableBackButton,
onDismiss: onDismiss,
visible: visible,
contentContainerStyle: [{
borderRadius,
backgroundColor,
marginHorizontal: Math.max(left, right, 26)
}, styles.container, style],
theme: theme,
testID: testID
}, React.Children.toArray(children).filter(child => child != null && typeof child !== 'boolean').map((child, i) => {
if (isV3) {
if (i === 0 && /*#__PURE__*/React.isValidElement(child)) {
return /*#__PURE__*/React.cloneElement(child, {
style: [{
marginTop: 24
}, child.props.style]
});
}
}
if (i === 0 && /*#__PURE__*/React.isValidElement(child) && child.type === _DialogContent.default) {
// Dialog content is the first item, so we add a top padding
return /*#__PURE__*/React.cloneElement(child, {
style: [{
paddingTop: 24
}, child.props.style]
});
}
return child;
}));
};
// @component ./DialogContent.tsx
Dialog.Content = _DialogContent.default;
// @component ./DialogActions.tsx
Dialog.Actions = _DialogActions.default;
// @component ./DialogTitle.tsx
Dialog.Title = _DialogTitle.default;
// @component ./DialogScrollArea.tsx
Dialog.ScrollArea = _DialogScrollArea.default;
// @component ./DialogIcon.tsx
Dialog.Icon = _DialogIcon.default;
const styles = _reactNative.StyleSheet.create({
container: {
/**
* This prevents the shadow from being clipped on Android since Android
* doesn't support `overflow: visible`.
* One downside for this fix is that it will disable clicks on the area
* of the shadow around the dialog, consequently, if you click around the
* dialog (44 pixel from the top and bottom) it won't be dismissed.
*/
marginVertical: _reactNative.Platform.OS === 'android' ? 44 : 0,
elevation: DIALOG_ELEVATION,
justifyContent: 'flex-start'
}
});
var _default = exports.default = Dialog;
//# sourceMappingURL=Dialog.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,73 @@
"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 in a Dialog.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Button, Dialog, Portal } from 'react-native-paper';
*
* const MyComponent = () => {
* const [visible, setVisible] = React.useState(false);
*
* const hideDialog = () => setVisible(false);
*
* return (
* <Portal>
* <Dialog visible={visible} onDismiss={hideDialog}>
* <Dialog.Actions>
* <Button onPress={() => console.log('Cancel')}>Cancel</Button>
* <Button onPress={() => console.log('Ok')}>Ok</Button>
* </Dialog.Actions>
* </Dialog>
* </Portal>
* );
* };
*
* export default MyComponent;
* ```
*/
const DialogActions = props => {
const {
isV3
} = (0, _theming.useInternalTheme)(props.theme);
const actionsLength = React.Children.toArray(props.children).length;
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, props, {
style: [isV3 ? styles.v3Container : styles.container, props.style]
}), React.Children.map(props.children, (child, i) => /*#__PURE__*/React.isValidElement(child) ? /*#__PURE__*/React.cloneElement(child, {
compact: true,
uppercase: !isV3,
style: [isV3 && {
marginRight: i + 1 === actionsLength ? 0 : 8
}, child.props.style]
}) : child));
};
DialogActions.displayName = 'Dialog.Actions';
const styles = _reactNative.StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-end',
padding: 8
},
v3Container: {
flexDirection: 'row',
flexGrow: 1,
alignItems: 'center',
justifyContent: 'flex-end',
paddingBottom: 24,
paddingHorizontal: 24
}
});
var _default = exports.default = DialogActions;
//# sourceMappingURL=DialogActions.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","DialogActions","props","isV3","useInternalTheme","theme","actionsLength","Children","toArray","children","createElement","View","style","styles","v3Container","container","map","child","isValidElement","cloneElement","compact","uppercase","marginRight","displayName","StyleSheet","create","flexDirection","alignItems","justifyContent","padding","flexGrow","paddingBottom","paddingHorizontal","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Dialog/DialogActions.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,CAA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AAA,GAAAC,OAAA,CAAAhD,OAAA,GAEYe,aAAa","ignoreList":[]}

View File

@@ -0,0 +1,49 @@
"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 in a Dialog.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Dialog, Portal, Text } from 'react-native-paper';
*
* const MyComponent = () => {
* const [visible, setVisible] = React.useState(false);
*
* const hideDialog = () => setVisible(false);
*
* return (
* <Portal>
* <Dialog visible={visible} onDismiss={hideDialog}>
* <Dialog.Content>
* <Text variant="bodyMedium">This is simple dialog</Text>
* </Dialog.Content>
* </Dialog>
* </Portal>
* );
* };
*
* export default MyComponent;
* ```
*/
const DialogContent = props => /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, props, {
style: [styles.container, props.style]
}), props.children);
DialogContent.displayName = 'Dialog.Content';
const styles = _reactNative.StyleSheet.create({
container: {
paddingBottom: 24,
paddingHorizontal: 24
}
});
var _default = exports.default = DialogContent;
//# sourceMappingURL=DialogContent.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","DialogContent","props","createElement","View","style","styles","container","children","displayName","StyleSheet","create","paddingBottom","paddingHorizontal","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Dialog/DialogContent.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,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAkB,SAAA,WAAAA,QAAA,GAAAH,MAAA,CAAAI,MAAA,GAAAJ,MAAA,CAAAI,MAAA,CAAAC,IAAA,eAAAjB,CAAA,aAAAJ,CAAA,MAAAA,CAAA,GAAAsB,SAAA,CAAAC,MAAA,EAAAvB,CAAA,UAAAC,CAAA,GAAAqB,SAAA,CAAAtB,CAAA,YAAAG,CAAA,IAAAF,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAd,CAAA,EAAAE,CAAA,MAAAC,CAAA,CAAAD,CAAA,IAAAF,CAAA,CAAAE,CAAA,aAAAC,CAAA,KAAAe,QAAA,CAAAK,KAAA,OAAAF,SAAA;AAUtE;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,MAAMG,aAAa,GAAIC,KAAY,iBACjC9B,KAAA,CAAA+B,aAAA,CAAC5B,YAAA,CAAA6B,IAAI,EAAAT,QAAA,KAAKO,KAAK;EAAEG,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAEL,KAAK,CAACG,KAAK;AAAE,IACrDH,KAAK,CAACM,QACH,CACP;AAEDP,aAAa,CAACQ,WAAW,GAAG,gBAAgB;AAE5C,MAAMH,MAAM,GAAGI,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,aAAa,EAAE,EAAE;IACjBC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7B,OAAA,GAEYe,aAAa","ignoreList":[]}

View File

@@ -0,0 +1,81 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DialogIcon = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _theming = require("../../core/theming");
var _Icon = _interopRequireDefault(require("../Icon"));
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); }
/**
* @supported Available in v5.x with theme version 3
* A component to show an icon in a Dialog.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { StyleSheet } from 'react-native';
* import { Dialog, Portal, Text } from 'react-native-paper';
*
* const MyComponent = () => {
* const [visible, setVisible] = React.useState(false);
*
* const hideDialog = () => setVisible(false);
*
* return (
* <Portal>
* <Dialog visible={visible} onDismiss={hideDialog}>
* <Dialog.Icon icon="alert" />
* <Dialog.Title style={styles.title}>This is a title</Dialog.Title>
* <Dialog.Content>
* <Text variant="bodyMedium">This is simple dialog</Text>
* </Dialog.Content>
* </Dialog>
* </Portal>
* );
* };
*
* const styles = StyleSheet.create({
* title: {
* textAlign: 'center',
* },
* })
*
* export default MyComponent;
* ```
*/
const DialogIcon = ({
size = 24,
color,
icon,
theme: themeOverrides
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
if (!theme.isV3) {
return null;
}
//@ts-ignore
const iconColor = color || theme.colors.secondary;
return /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.wrapper
}, /*#__PURE__*/React.createElement(_Icon.default, {
source: icon,
color: iconColor,
size: size
}));
};
exports.DialogIcon = DialogIcon;
DialogIcon.displayName = 'Dialog.Icon';
const styles = _reactNative.StyleSheet.create({
wrapper: {
alignItems: 'center',
justifyContent: 'center',
paddingTop: 24
}
});
var _default = exports.default = DialogIcon; // @component-docs ignore-next-line
//# sourceMappingURL=DialogIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_theming","_Icon","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DialogIcon","size","color","icon","theme","themeOverrides","useInternalTheme","isV3","iconColor","colors","secondary","createElement","View","style","styles","wrapper","source","exports","displayName","StyleSheet","create","alignItems","justifyContent","paddingTop","_default"],"sourceRoot":"../../../../src","sources":["components/Dialog/DialogIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA2C,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAM,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,CAA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AAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,OAAO,EAAE;IACPM,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAP,OAAA,CAAAlC,OAAA,GAEYiB,UAAU,EAEzB","ignoreList":[]}

View File

@@ -0,0 +1,66 @@
"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 scrollable content in a Dialog. The component only provides appropriate styling.
* For the scrollable content you can use `ScrollView`, `FlatList` etc. depending on your requirement.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { ScrollView } from 'react-native';
* import { Dialog, Portal, Text } from 'react-native-paper';
*
* const MyComponent = () => {
* const [visible, setVisible] = React.useState(false);
*
* const hideDialog = () => setVisible(false);
*
* return (
* <Portal>
* <Dialog visible={visible} onDismiss={hideDialog}>
* <Dialog.ScrollArea>
* <ScrollView contentContainerStyle={{paddingHorizontal: 24}}>
* <Text>This is a scrollable area</Text>
* </ScrollView>
* </Dialog.ScrollArea>
* </Dialog>
* </Portal>
* );
* };
*
* export default MyComponent;
* ```
*/
const DialogScrollArea = props => {
const theme = (0, _theming.useInternalTheme)(props.theme);
const borderStyles = {
borderColor: theme.isV3 ? theme.colors.surfaceVariant : 'rgba(0, 0, 0, .12)',
borderTopWidth: theme.isV3 ? 1 : _reactNative.StyleSheet.hairlineWidth,
borderBottomWidth: theme.isV3 ? 1 : _reactNative.StyleSheet.hairlineWidth
};
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, props, {
style: [styles.container, borderStyles, theme.isV3 && styles.v3Container, props.style]
}), props.children);
};
DialogScrollArea.displayName = 'Dialog.ScrollArea';
const styles = _reactNative.StyleSheet.create({
container: {
paddingHorizontal: 24,
flexGrow: 1,
flexShrink: 1
},
v3Container: {
marginBottom: 24
}
});
var _default = exports.default = DialogScrollArea;
//# sourceMappingURL=DialogScrollArea.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","DialogScrollArea","props","theme","useInternalTheme","borderStyles","borderColor","isV3","colors","surfaceVariant","borderTopWidth","StyleSheet","hairlineWidth","borderBottomWidth","createElement","View","style","styles","container","v3Container","children","displayName","create","paddingHorizontal","flexGrow","flexShrink","marginBottom","_default","exports"],"sourceRoot":"../../../../src","sources":["components/Dialog/DialogScrollArea.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,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,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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAIC,KAAY,IAAK;EACzC,MAAMC,KAAK,GAAG,IAAAC,yBAAgB,EAACF,KAAK,CAACC,KAAK,CAAC;EAC3C,MAAME,YAAY,GAAG;IACnBC,WAAW,EAAEH,KAAK,CAACI,IAAI,GACnBJ,KAAK,CAACK,MAAM,CAACC,cAAc,GAC3B,oBAAoB;IACxBC,cAAc,EAAEP,KAAK,CAACI,IAAI,GAAG,CAAC,GAAGI,uBAAU,CAACC,aAAa;IACzDC,iBAAiB,EAAEV,KAAK,CAACI,IAAI,GAAG,CAAC,GAAGI,uBAAU,CAACC;EACjD,CAAC;EACD,oBACEzC,KAAA,CAAA2C,aAAA,CAACxC,YAAA,CAAAyC,IAAI,EAAApB,QAAA,KACCO,KAAK;IACTc,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChBb,YAAY,EACZF,KAAK,CAACI,IAAI,IAAIU,MAAM,CAACE,WAAW,EAChCjB,KAAK,CAACc,KAAK;EACX,IAEDd,KAAK,CAACkB,QACH,CAAC;AAEX,CAAC;AAEDnB,gBAAgB,CAACoB,WAAW,GAAG,mBAAmB;AAElD,MAAMJ,MAAM,GAAGN,uBAAU,CAACW,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,iBAAiB,EAAE,EAAE;IACrBC,QAAQ,EAAE,CAAC;IACXC,UAAU,EAAE;EACd,CAAC;EACDN,WAAW,EAAE;IACXO,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEYe,gBAAgB","ignoreList":[]}

View File

@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DialogTitle = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _theming = require("../../core/theming");
var _Text = _interopRequireDefault(require("../Typography/Text"));
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); }
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 title in a Dialog.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Dialog, Portal, Text } from 'react-native-paper';
*
* const MyComponent = () => {
* const [visible, setVisible] = React.useState(false);
*
* const hideDialog = () => setVisible(false);
*
* return (
* <Portal>
* <Dialog visible={visible} onDismiss={hideDialog}>
* <Dialog.Title>This is a title</Dialog.Title>
* <Dialog.Content>
* <Text variant="bodyMedium">This is simple dialog</Text>
* </Dialog.Content>
* </Dialog>
* </Portal>
* );
* };
*
* export default MyComponent;
* ```
*/
const DialogTitle = ({
children,
theme: themeOverrides,
style,
...rest
}) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
isV3,
colors,
fonts
} = theme;
const TextComponent = isV3 ? _Text.default : _Title.default;
const headerTextStyle = {
color: isV3 ? colors.onSurface : colors === null || colors === void 0 ? void 0 : colors.text,
...(isV3 ? fonts.headlineSmall : {})
};
return /*#__PURE__*/React.createElement(TextComponent, _extends({
variant: "headlineSmall",
accessibilityRole: "header",
style: [styles.text, isV3 && styles.v3Text, headerTextStyle, style]
}, rest), children);
};
exports.DialogTitle = DialogTitle;
DialogTitle.displayName = 'Dialog.Title';
const styles = _reactNative.StyleSheet.create({
text: {
marginTop: 22,
marginBottom: 18,
marginHorizontal: 24
},
v3Text: {
marginTop: 16,
marginBottom: 16
}
});
var _default = exports.default = DialogTitle; // @component-docs ignore-next-line
//# sourceMappingURL=DialogTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_theming","_Text","_interopRequireDefault","_Title","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","DialogTitle","children","theme","themeOverrides","style","rest","useInternalTheme","isV3","colors","fonts","TextComponent","Text","Title","headerTextStyle","color","onSurface","text","headlineSmall","createElement","variant","accessibilityRole","styles","v3Text","exports","displayName","StyleSheet","create","marginTop","marginBottom","marginHorizontal","_default"],"sourceRoot":"../../../../src","sources":["components/Dialog/DialogTitle.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAA2C,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAA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 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=utils.js.map

Some files were not shown because too many files have changed in this diff Show More