@estuary-solutions/rn-core-ui 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +743 -0
- package/dist/Accordion/Accordion.d.ts +5 -0
- package/dist/Accordion/Accordion.d.ts.map +1 -0
- package/dist/Accordion/Accordion.js +19 -0
- package/dist/Accordion/AccordionContext.d.ts +7 -0
- package/dist/Accordion/AccordionContext.d.ts.map +1 -0
- package/dist/Accordion/AccordionContext.js +3 -0
- package/dist/Accordion/AccordionGroup.d.ts +7 -0
- package/dist/Accordion/AccordionGroup.d.ts.map +1 -0
- package/dist/Accordion/AccordionGroup.js +32 -0
- package/dist/Accordion/AccordionItem.d.ts +5 -0
- package/dist/Accordion/AccordionItem.d.ts.map +1 -0
- package/dist/Accordion/AccordionItem.js +12 -0
- package/dist/Accordion/AccordionTree.d.ts +6 -0
- package/dist/Accordion/AccordionTree.d.ts.map +1 -0
- package/dist/Accordion/AccordionTree.js +4 -0
- package/dist/Accordion/AccordionTreeInternal.d.ts +5 -0
- package/dist/Accordion/AccordionTreeInternal.d.ts.map +1 -0
- package/dist/Accordion/AccordionTreeInternal.js +36 -0
- package/dist/Accordion/AccordionTreeWithGroup.d.ts +8 -0
- package/dist/Accordion/AccordionTreeWithGroup.d.ts.map +1 -0
- package/dist/Accordion/AccordionTreeWithGroup.js +11 -0
- package/dist/Accordion/index.d.ts +5 -0
- package/dist/Accordion/index.d.ts.map +1 -0
- package/dist/Accordion/index.js +4 -0
- package/dist/Accordion/types/AccordionTypes.d.ts +65 -0
- package/dist/Accordion/types/AccordionTypes.d.ts.map +1 -0
- package/dist/Accordion/types/AccordionTypes.js +1 -0
- package/dist/Avatars/Avatar.d.ts +20 -0
- package/dist/Avatars/Avatar.d.ts.map +1 -0
- package/dist/Avatars/Avatar.js +63 -0
- package/dist/Badges/Badge.d.ts +25 -0
- package/dist/Badges/Badge.d.ts.map +1 -0
- package/dist/Badges/Badge.js +75 -0
- package/dist/Breadcrumbs/Breadcrumb.d.ts +13 -0
- package/dist/Breadcrumbs/Breadcrumb.d.ts.map +1 -0
- package/dist/Breadcrumbs/Breadcrumb.js +63 -0
- package/dist/Button/Button.d.ts +7 -0
- package/dist/Button/Button.d.ts.map +1 -0
- package/dist/Button/Button.js +62 -0
- package/dist/Button/ButtonGradient.d.ts +5 -0
- package/dist/Button/ButtonGradient.d.ts.map +1 -0
- package/dist/Button/ButtonGradient.js +61 -0
- package/dist/Button/index.d.ts +4 -0
- package/dist/Button/index.d.ts.map +1 -0
- package/dist/Button/index.js +3 -0
- package/dist/Button/types/ButtonGradientTypes.d.ts +80 -0
- package/dist/Button/types/ButtonGradientTypes.d.ts.map +1 -0
- package/dist/Button/types/ButtonGradientTypes.js +1 -0
- package/dist/Button/types/ButtonTypes.d.ts +65 -0
- package/dist/Button/types/ButtonTypes.d.ts.map +1 -0
- package/dist/Button/types/ButtonTypes.js +1 -0
- package/dist/Buttons/Button.d.ts +23 -0
- package/dist/Buttons/Button.d.ts.map +1 -0
- package/dist/Buttons/Button.js +66 -0
- package/dist/Cards/Card.d.ts +22 -0
- package/dist/Cards/Card.d.ts.map +1 -0
- package/dist/Cards/Card.js +26 -0
- package/dist/Cards/CardActionArea.d.ts +13 -0
- package/dist/Cards/CardActionArea.d.ts.map +1 -0
- package/dist/Cards/CardActionArea.js +30 -0
- package/dist/Cards/CardActions.d.ts +14 -0
- package/dist/Cards/CardActions.d.ts.map +1 -0
- package/dist/Cards/CardActions.js +41 -0
- package/dist/Cards/CardContent.d.ts +13 -0
- package/dist/Cards/CardContent.d.ts.map +1 -0
- package/dist/Cards/CardContent.js +19 -0
- package/dist/Cards/CardHeader.d.ts +16 -0
- package/dist/Cards/CardHeader.d.ts.map +1 -0
- package/dist/Cards/CardHeader.js +61 -0
- package/dist/Cards/CardMedia.d.ts +23 -0
- package/dist/Cards/CardMedia.d.ts.map +1 -0
- package/dist/Cards/CardMedia.js +16 -0
- package/dist/Cards/Paper.d.ts +13 -0
- package/dist/Cards/Paper.d.ts.map +1 -0
- package/dist/Cards/Paper.js +42 -0
- package/dist/DraggableFlatList/CellDecorators.d.ts +21 -0
- package/dist/DraggableFlatList/CellDecorators.d.ts.map +1 -0
- package/dist/DraggableFlatList/CellDecorators.js +66 -0
- package/dist/DraggableFlatList/CellRendererComponent.d.ts +20 -0
- package/dist/DraggableFlatList/CellRendererComponent.d.ts.map +1 -0
- package/dist/DraggableFlatList/CellRendererComponent.js +146 -0
- package/dist/DraggableFlatList/DraggableFlatList.d.ts +9 -0
- package/dist/DraggableFlatList/DraggableFlatList.d.ts.map +1 -0
- package/dist/DraggableFlatList/DraggableFlatList.js +282 -0
- package/dist/DraggableFlatList/DraggableFlatList.web.d.ts +4 -0
- package/dist/DraggableFlatList/DraggableFlatList.web.d.ts.map +1 -0
- package/dist/DraggableFlatList/DraggableFlatList.web.js +248 -0
- package/dist/DraggableFlatList/NestableDraggableFlatList.d.ts +9 -0
- package/dist/DraggableFlatList/NestableDraggableFlatList.d.ts.map +1 -0
- package/dist/DraggableFlatList/NestableDraggableFlatList.js +66 -0
- package/dist/DraggableFlatList/NestableScrollContainer.d.ts +5 -0
- package/dist/DraggableFlatList/NestableScrollContainer.d.ts.map +1 -0
- package/dist/DraggableFlatList/NestableScrollContainer.js +28 -0
- package/dist/DraggableFlatList/PlaceholderItem.d.ts +8 -0
- package/dist/DraggableFlatList/PlaceholderItem.d.ts.map +1 -0
- package/dist/DraggableFlatList/PlaceholderItem.js +44 -0
- package/dist/DraggableFlatList/RowItem.d.ts +13 -0
- package/dist/DraggableFlatList/RowItem.d.ts.map +1 -0
- package/dist/DraggableFlatList/RowItem.js +45 -0
- package/dist/DraggableFlatList/ScrollOffsetListener.d.ts +8 -0
- package/dist/DraggableFlatList/ScrollOffsetListener.d.ts.map +1 -0
- package/dist/DraggableFlatList/ScrollOffsetListener.js +13 -0
- package/dist/Flex/Flex.d.ts +12 -0
- package/dist/Flex/Flex.d.ts.map +1 -0
- package/dist/Flex/Flex.js +28 -0
- package/dist/Flex/Flex.types.d.ts +10 -0
- package/dist/Flex/Flex.types.d.ts.map +1 -0
- package/dist/Flex/Flex.types.js +1 -0
- package/dist/Flex/index.d.ts +4 -0
- package/dist/Flex/index.d.ts.map +1 -0
- package/dist/Flex/index.js +3 -0
- package/dist/LICENSE +20 -0
- package/dist/README.md +743 -0
- package/dist/SvgIcon/SvgIcon.d.ts +9 -0
- package/dist/SvgIcon/SvgIcon.d.ts.map +1 -0
- package/dist/SvgIcon/SvgIcon.js +39 -0
- package/dist/SvgIcon/components/IconAlertCircle.d.ts +4 -0
- package/dist/SvgIcon/components/IconAlertCircle.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconAlertCircle.js +6 -0
- package/dist/SvgIcon/components/IconAngleLeft.d.ts +4 -0
- package/dist/SvgIcon/components/IconAngleLeft.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconAngleLeft.js +6 -0
- package/dist/SvgIcon/components/IconAngleRight.d.ts +4 -0
- package/dist/SvgIcon/components/IconAngleRight.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconAngleRight.js +6 -0
- package/dist/SvgIcon/components/IconCheckBox.d.ts +4 -0
- package/dist/SvgIcon/components/IconCheckBox.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconCheckBox.js +6 -0
- package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.d.ts +4 -0
- package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.js +6 -0
- package/dist/SvgIcon/components/IconCheckBoxWithBg.d.ts +4 -0
- package/dist/SvgIcon/components/IconCheckBoxWithBg.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconCheckBoxWithBg.js +6 -0
- package/dist/SvgIcon/components/IconChevronDown.d.ts +4 -0
- package/dist/SvgIcon/components/IconChevronDown.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconChevronDown.js +6 -0
- package/dist/SvgIcon/components/IconChevronUp.d.ts +4 -0
- package/dist/SvgIcon/components/IconChevronUp.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconChevronUp.js +6 -0
- package/dist/SvgIcon/components/IconHome.d.ts +4 -0
- package/dist/SvgIcon/components/IconHome.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconHome.js +6 -0
- package/dist/SvgIcon/components/IconPerson.d.ts +4 -0
- package/dist/SvgIcon/components/IconPerson.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconPerson.js +6 -0
- package/dist/SvgIcon/components/IconPlayCircle.d.ts +4 -0
- package/dist/SvgIcon/components/IconPlayCircle.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconPlayCircle.js +9 -0
- package/dist/SvgIcon/components/IconPlus.d.ts +4 -0
- package/dist/SvgIcon/components/IconPlus.d.ts.map +1 -0
- package/dist/SvgIcon/components/IconPlus.js +6 -0
- package/dist/SvgIcon/components/index.d.ts +13 -0
- package/dist/SvgIcon/components/index.d.ts.map +1 -0
- package/dist/SvgIcon/components/index.js +12 -0
- package/dist/SvgIcon/types/SvgIconTypes.d.ts +46 -0
- package/dist/SvgIcon/types/SvgIconTypes.d.ts.map +1 -0
- package/dist/SvgIcon/types/SvgIconTypes.js +1 -0
- package/dist/TextFields/TextField.d.ts +34 -0
- package/dist/TextFields/TextField.d.ts.map +1 -0
- package/dist/TextFields/TextField.js +400 -0
- package/dist/TextFields/index.d.ts +2 -0
- package/dist/TextFields/index.d.ts.map +1 -0
- package/dist/TextFields/index.js +1 -0
- package/dist/Texts/Text.d.ts +21 -0
- package/dist/Texts/Text.d.ts.map +1 -0
- package/dist/Texts/Text.js +49 -0
- package/dist/constants/DraggableFlatList/constants.d.ts +28 -0
- package/dist/constants/DraggableFlatList/constants.d.ts.map +1 -0
- package/dist/constants/DraggableFlatList/constants.js +25 -0
- package/dist/constants/DraggableFlatList/types.d.ts +65 -0
- package/dist/constants/DraggableFlatList/types.d.ts.map +1 -0
- package/dist/constants/DraggableFlatList/types.js +1 -0
- package/dist/constants/DraggableFlatList/types.web.d.ts +7 -0
- package/dist/constants/DraggableFlatList/types.web.d.ts.map +1 -0
- package/dist/constants/DraggableFlatList/types.web.js +1 -0
- package/dist/constants/consts.d.ts +16 -0
- package/dist/constants/consts.d.ts.map +1 -0
- package/dist/constants/consts.js +15 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/types.d.ts +22 -0
- package/dist/constants/types.d.ts.map +1 -0
- package/dist/constants/types.js +21 -0
- package/dist/context/DraggableFlatList/animatedValueContext.d.ts +29 -0
- package/dist/context/DraggableFlatList/animatedValueContext.d.ts.map +1 -0
- package/dist/context/DraggableFlatList/animatedValueContext.js +154 -0
- package/dist/context/DraggableFlatList/cellContext.d.ts +10 -0
- package/dist/context/DraggableFlatList/cellContext.d.ts.map +1 -0
- package/dist/context/DraggableFlatList/cellContext.js +18 -0
- package/dist/context/DraggableFlatList/draggableFlatListContext.d.ts +13 -0
- package/dist/context/DraggableFlatList/draggableFlatListContext.d.ts.map +1 -0
- package/dist/context/DraggableFlatList/draggableFlatListContext.js +19 -0
- package/dist/context/DraggableFlatList/nestableScrollContainerContext.d.ts +23 -0
- package/dist/context/DraggableFlatList/nestableScrollContainerContext.d.ts.map +1 -0
- package/dist/context/DraggableFlatList/nestableScrollContainerContext.js +36 -0
- package/dist/context/DraggableFlatList/propsContext.d.ts +9 -0
- package/dist/context/DraggableFlatList/propsContext.d.ts.map +1 -0
- package/dist/context/DraggableFlatList/propsContext.js +25 -0
- package/dist/context/DraggableFlatList/refContext.d.ts +20 -0
- package/dist/context/DraggableFlatList/refContext.d.ts.map +1 -0
- package/dist/context/DraggableFlatList/refContext.js +55 -0
- package/dist/hooks/DraggableFlatList/useAutoScroll.d.ts +2 -0
- package/dist/hooks/DraggableFlatList/useAutoScroll.d.ts.map +1 -0
- package/dist/hooks/DraggableFlatList/useAutoScroll.js +77 -0
- package/dist/hooks/DraggableFlatList/useCellTranslate.d.ts +9 -0
- package/dist/hooks/DraggableFlatList/useCellTranslate.d.ts.map +1 -0
- package/dist/hooks/DraggableFlatList/useCellTranslate.js +72 -0
- package/dist/hooks/DraggableFlatList/useNestedAutoScroll.d.ts +12 -0
- package/dist/hooks/DraggableFlatList/useNestedAutoScroll.d.ts.map +1 -0
- package/dist/hooks/DraggableFlatList/useNestedAutoScroll.js +77 -0
- package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.d.ts +15 -0
- package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.d.ts.map +1 -0
- package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.js +29 -0
- package/dist/hooks/DraggableFlatList/useStableCallback.d.ts +2 -0
- package/dist/hooks/DraggableFlatList/useStableCallback.d.ts.map +1 -0
- package/dist/hooks/DraggableFlatList/useStableCallback.js +11 -0
- package/dist/hooks/useTheme.d.ts +17 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +12 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/themes/colors.d.ts +9 -0
- package/dist/themes/colors.d.ts.map +1 -0
- package/dist/themes/colors.js +201 -0
- package/dist/themes/elevationOverlay.d.ts +2 -0
- package/dist/themes/elevationOverlay.d.ts.map +1 -0
- package/dist/themes/elevationOverlay.js +12 -0
- package/dist/themes/fontSize.d.ts +23 -0
- package/dist/themes/fontSize.d.ts.map +1 -0
- package/dist/themes/fontSize.js +22 -0
- package/dist/themes/index.d.ts +5 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +4 -0
- package/dist/themes/types/colorTypes.d.ts +665 -0
- package/dist/themes/types/colorTypes.d.ts.map +1 -0
- package/dist/themes/types/colorTypes.js +1 -0
- package/dist/utils/DraggableFlatList/typedMemo.d.ts +2 -0
- package/dist/utils/DraggableFlatList/typedMemo.d.ts.map +1 -0
- package/dist/utils/DraggableFlatList/typedMemo.js +2 -0
- package/dist/utils/cleanTagHTML.d.ts +22 -0
- package/dist/utils/cleanTagHTML.d.ts.map +1 -0
- package/dist/utils/cleanTagHTML.js +36 -0
- package/dist/utils/colors/color.d.ts +2 -0
- package/dist/utils/colors/color.d.ts.map +1 -0
- package/dist/utils/colors/color.js +6 -0
- package/dist/utils/colors/elevation.d.ts +7 -0
- package/dist/utils/colors/elevation.d.ts.map +1 -0
- package/dist/utils/colors/elevation.js +29 -0
- package/dist/utils/colors/index.d.ts +9 -0
- package/dist/utils/colors/index.d.ts.map +1 -0
- package/dist/utils/colors/index.js +7 -0
- package/dist/utils/converter.d.ts +47 -0
- package/dist/utils/converter.d.ts.map +1 -0
- package/dist/utils/converter.js +54 -0
- package/dist/utils/debounce.d.ts +36 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/debounce.js +54 -0
- package/dist/utils/filters.d.ts +3 -0
- package/dist/utils/filters.d.ts.map +1 -0
- package/dist/utils/filters.js +10 -0
- package/dist/utils/fixedDistance.d.ts +16 -0
- package/dist/utils/fixedDistance.d.ts.map +1 -0
- package/dist/utils/fixedDistance.js +17 -0
- package/dist/utils/formatMoney.d.ts +30 -0
- package/dist/utils/formatMoney.d.ts.map +1 -0
- package/dist/utils/formatMoney.js +33 -0
- package/dist/utils/getOS.d.ts +6 -0
- package/dist/utils/getOS.d.ts.map +1 -0
- package/dist/utils/getOS.js +6 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/limitedString.d.ts +15 -0
- package/dist/utils/limitedString.d.ts.map +1 -0
- package/dist/utils/limitedString.js +19 -0
- package/dist/utils/resolutions.d.ts +65 -0
- package/dist/utils/resolutions.d.ts.map +1 -0
- package/dist/utils/resolutions.js +79 -0
- package/dist/utils/scale.d.ts +141 -0
- package/dist/utils/scale.d.ts.map +1 -0
- package/dist/utils/scale.js +141 -0
- package/documents/build.js +102 -0
- package/documents/buildFromRoot.js +49 -0
- package/documents/buildFromSample.js +40 -0
- package/documents/buildV2.js +98 -0
- package/documents/copyPackageToExample.js +31 -0
- package/example/RNCoreUISample/.eslintrc.js +10 -0
- package/example/RNCoreUISample/.prettierrc.js +7 -0
- package/example/RNCoreUISample/App.js +26 -0
- package/example/RNCoreUISample/README.md +104 -0
- package/example/RNCoreUISample/android/app/debug.keystore +0 -0
- package/example/RNCoreUISample/babel.config.js +29 -0
- package/example/RNCoreUISample/documents/storybook/manager.js +5 -0
- package/example/RNCoreUISample/fix_node_modules.js +12 -0
- package/example/RNCoreUISample/index.js +20 -0
- package/example/RNCoreUISample/jest.config.js +3 -0
- package/example/RNCoreUISample/metro.config.js +30 -0
- package/package.json +101 -0
- package/src/constants/DraggableFlatList/draggable.d.ts +12 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { colors } from "../themes";
|
|
14
|
+
import { scale } from "../utils";
|
|
15
|
+
import { ActivityIndicator, StyleSheet, TouchableOpacity, View, } from "react-native";
|
|
16
|
+
import Text from "../Texts/Text";
|
|
17
|
+
const Button = (_a) => {
|
|
18
|
+
var { title, startIcon, endIcon, style, titleStyle, activeBgColor = colors.blue_00A7E1, inactiveBgColor = colors.blue_B2E5F6, disabled, isSubmit, colorsLoading, variant = "filled", borderColor = colors.blue } = _a,
|
|
19
|
+
// titleProps,
|
|
20
|
+
rest = __rest(_a, ["title", "startIcon", "endIcon", "style", "titleStyle", "activeBgColor", "inactiveBgColor", "disabled", "isSubmit", "colorsLoading", "variant", "borderColor"]);
|
|
21
|
+
const backgroundColor = disabled ? inactiveBgColor : activeBgColor;
|
|
22
|
+
return (_jsxs(TouchableOpacity, Object.assign({}, rest, { disabled: disabled || isSubmit, style: [
|
|
23
|
+
styles.btnContainer,
|
|
24
|
+
variant === "outline" && styles.btnContainerOutline,
|
|
25
|
+
{ backgroundColor },
|
|
26
|
+
variant === "outline" && { borderColor },
|
|
27
|
+
style,
|
|
28
|
+
], children: [startIcon ? _jsx(View, { style: styles.viewIconStart, children: startIcon }) : null, isSubmit ? (_jsx(ActivityIndicator, { size: "small", color: colorsLoading || colors.blue })) : (_jsx(Text, { style: [
|
|
29
|
+
styles.textTitle,
|
|
30
|
+
variant === "outline" ? styles.textTitleOutline : {},
|
|
31
|
+
// titleStyle,
|
|
32
|
+
], numberOfLines: 1, children: title })), endIcon ? _jsx(View, { style: styles.viewIconEnd, children: endIcon }) : null] })));
|
|
33
|
+
};
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
btnContainer: {
|
|
36
|
+
flexDirection: "row",
|
|
37
|
+
paddingHorizontal: scale(24),
|
|
38
|
+
paddingVertical: scale(10),
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
},
|
|
42
|
+
btnContainerOutline: {
|
|
43
|
+
paddingHorizontal: scale(23),
|
|
44
|
+
paddingVertical: scale(9),
|
|
45
|
+
borderWidth: scale(1),
|
|
46
|
+
backgroundColor: colors.white,
|
|
47
|
+
borderColor: colors.blue,
|
|
48
|
+
},
|
|
49
|
+
viewIconStart: {
|
|
50
|
+
marginRight: scale(16),
|
|
51
|
+
},
|
|
52
|
+
viewIconEnd: {
|
|
53
|
+
marginLeft: scale(16),
|
|
54
|
+
},
|
|
55
|
+
textTitle: {
|
|
56
|
+
color: colors.white,
|
|
57
|
+
},
|
|
58
|
+
textTitleOutline: {
|
|
59
|
+
color: colors.blue,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGradient.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonGradient.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6CjD,CAAC;AA4CF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { scale } from "../utils";
|
|
14
|
+
import { Platform, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
15
|
+
import LinearGradient from "react-native-linear-gradient";
|
|
16
|
+
import Text from "../Texts/Text";
|
|
17
|
+
const ButtonGradient = (_a) => {
|
|
18
|
+
var { title, startIcon, endIcon, styleButton, styleGradient, titleStyle, disabled, isSubmit, colorsLoading, variant = "filled", borderColor = "#00B4F0", colors = ["#8a3380", "#8a3380"] } = _a, rest = __rest(_a, ["title", "startIcon", "endIcon", "styleButton", "styleGradient", "titleStyle", "disabled", "isSubmit", "colorsLoading", "variant", "borderColor", "colors"]);
|
|
19
|
+
return (_jsx(TouchableOpacity, Object.assign({}, rest, { disabled: disabled || isSubmit, style: [styleButton], children: _jsxs(LinearGradient, { colors, start: { x: 0, y: 1 }, end: { x: 1, y: 0 }, style: [styles.gradient, styleGradient], children: [startIcon ? (_jsx(View, { style: styles.viewIconStart, children: startIcon })) : null, _jsx(Text, { style: [
|
|
20
|
+
styles.textTitle,
|
|
21
|
+
variant === "outline" ? styles.textTitleOutline : {},
|
|
22
|
+
// titleStyle,
|
|
23
|
+
], numberOfLines: 1, children: title }), endIcon ? _jsx(View, { style: styles.viewIconEnd, children: endIcon }) : null] }) })));
|
|
24
|
+
};
|
|
25
|
+
const styles = StyleSheet.create({
|
|
26
|
+
btnContainer: {
|
|
27
|
+
flexDirection: "row",
|
|
28
|
+
paddingHorizontal: scale(24),
|
|
29
|
+
paddingVertical: scale(10),
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
},
|
|
33
|
+
btnContainerOutline: {
|
|
34
|
+
paddingHorizontal: scale(23),
|
|
35
|
+
paddingVertical: scale(9),
|
|
36
|
+
borderWidth: scale(1),
|
|
37
|
+
backgroundColor: "white",
|
|
38
|
+
borderColor: "#00B4F0",
|
|
39
|
+
},
|
|
40
|
+
viewIconStart: {
|
|
41
|
+
marginRight: scale(16),
|
|
42
|
+
},
|
|
43
|
+
viewIconEnd: {
|
|
44
|
+
marginLeft: scale(16),
|
|
45
|
+
},
|
|
46
|
+
textTitle: {
|
|
47
|
+
color: "white",
|
|
48
|
+
},
|
|
49
|
+
textTitleOutline: {
|
|
50
|
+
color: "#00B4F0",
|
|
51
|
+
},
|
|
52
|
+
gradient: Object.assign({ borderBottomLeftRadius: 8, paddingLeft: scale(20), paddingRight: scale(25) }, Platform.select({
|
|
53
|
+
ios: {
|
|
54
|
+
paddingTop: scale(5),
|
|
55
|
+
},
|
|
56
|
+
android: {
|
|
57
|
+
paddingVertical: scale(5),
|
|
58
|
+
},
|
|
59
|
+
})),
|
|
60
|
+
});
|
|
61
|
+
export default ButtonGradient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ColorValue, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
/**
|
|
3
|
+
* ButtonGradientTypes
|
|
4
|
+
*
|
|
5
|
+
* Props used to configure the GradientButton component.
|
|
6
|
+
* Supports gradient backgrounds, icons, loading states, variants,
|
|
7
|
+
* and style customization.
|
|
8
|
+
*/
|
|
9
|
+
export interface ButtonGradientTypes {
|
|
10
|
+
/**
|
|
11
|
+
* The text displayed inside the button.
|
|
12
|
+
* Example: "Submit", "Save", "Cancel".
|
|
13
|
+
*/
|
|
14
|
+
title: string;
|
|
15
|
+
/**
|
|
16
|
+
* Icon displayed at the start (left side) of the button.
|
|
17
|
+
* Accepts any React element or SVG component.
|
|
18
|
+
*/
|
|
19
|
+
startIcon?: React.ReactNode | React.JSX.Element | React.ReactSVGElement;
|
|
20
|
+
/**
|
|
21
|
+
* Icon displayed at the end (right side) of the button.
|
|
22
|
+
* Typically used for arrows or action icons.
|
|
23
|
+
*/
|
|
24
|
+
endIcon?: React.ReactNode | React.JSX.Element | React.ReactSVGElement;
|
|
25
|
+
/**
|
|
26
|
+
* Custom style for the button container.
|
|
27
|
+
* Accepts a single ViewStyle or an array of styles.
|
|
28
|
+
*/
|
|
29
|
+
styleButton?: ViewStyle | Array<ViewStyle | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Custom style for the button container.
|
|
32
|
+
* Accepts a single ViewStyle or an array of styles.
|
|
33
|
+
*/
|
|
34
|
+
styleGradient?: ViewStyle | Array<ViewStyle | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Custom style for the button title text.
|
|
37
|
+
* Useful for adjusting color, fontSize, or fontWeight.
|
|
38
|
+
*/
|
|
39
|
+
titleStyle?: TextStyle;
|
|
40
|
+
/**
|
|
41
|
+
* Background color when the button is active.
|
|
42
|
+
* Used when gradient is disabled or overridden.
|
|
43
|
+
*/
|
|
44
|
+
activeBgColor?: ColorValue;
|
|
45
|
+
/**
|
|
46
|
+
* Background color when the button is inactive or disabled.
|
|
47
|
+
*/
|
|
48
|
+
inactiveBgColor?: ColorValue;
|
|
49
|
+
/**
|
|
50
|
+
* Enables the loading/submitting state when set to true.
|
|
51
|
+
* Commonly used in forms during API calls.
|
|
52
|
+
*/
|
|
53
|
+
isSubmit?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Color for the loading indicator or loading gradient.
|
|
56
|
+
* Example: "#FF7F50"
|
|
57
|
+
*/
|
|
58
|
+
colorsLoading?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Border color when using the "outline" variant.
|
|
61
|
+
*/
|
|
62
|
+
borderColor?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Visual style of the button.
|
|
65
|
+
* - "filled": Uses full background or gradient (default)
|
|
66
|
+
* - "outline": Transparent background with a border
|
|
67
|
+
*/
|
|
68
|
+
variant?: "outline" | "filled";
|
|
69
|
+
/**
|
|
70
|
+
* Gradient colors. Accepts an array such as:
|
|
71
|
+
* ["#FF7F50", "#FF1493"]
|
|
72
|
+
* or an object if using advanced gradient configs.
|
|
73
|
+
*/
|
|
74
|
+
colors?: any;
|
|
75
|
+
/**
|
|
76
|
+
* Disables button interaction and lowers opacity when true.
|
|
77
|
+
*/
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=ButtonGradientTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGradientTypes.d.ts","sourceRoot":"","sources":["../../../src/Button/types/ButtonGradientTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC;IAExE;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC;IAEtE;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IACvD;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAEzD;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAE3B;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ColorValue, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
/**
|
|
3
|
+
* ButtonType
|
|
4
|
+
*
|
|
5
|
+
* Props used to configure a standard button component.
|
|
6
|
+
* Supports icons, outline/filled variants, loading state,
|
|
7
|
+
* and customizable styling.
|
|
8
|
+
*/
|
|
9
|
+
export interface ButtonType {
|
|
10
|
+
/**
|
|
11
|
+
* Text displayed inside the button.
|
|
12
|
+
* Example: "Submit", "Save", "Cancel".
|
|
13
|
+
*/
|
|
14
|
+
title: string;
|
|
15
|
+
/**
|
|
16
|
+
* Icon displayed on the start (left) side of the button.
|
|
17
|
+
* Accepts any React element such as SVG or vector icon.
|
|
18
|
+
*/
|
|
19
|
+
startIcon?: React.ReactNode | React.JSX.Element | React.ReactSVGElement;
|
|
20
|
+
/**
|
|
21
|
+
* Icon displayed on the end (right) side of the button.
|
|
22
|
+
* Commonly used for arrows or confirmation icons.
|
|
23
|
+
*/
|
|
24
|
+
endIcon?: React.ReactNode | React.JSX.Element | React.ReactSVGElement;
|
|
25
|
+
/**
|
|
26
|
+
* Custom style applied to the outer button container.
|
|
27
|
+
* Supports both a single ViewStyle or an array of styles.
|
|
28
|
+
*/
|
|
29
|
+
style?: ViewStyle | Array<ViewStyle | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Custom style applied to the title text.
|
|
32
|
+
* Useful for customizing color, fontSize, or fontWeight.
|
|
33
|
+
*/
|
|
34
|
+
titleStyle?: TextStyle;
|
|
35
|
+
/**
|
|
36
|
+
* Background color when the button is active.
|
|
37
|
+
* Used when the variant is "filled".
|
|
38
|
+
*/
|
|
39
|
+
activeBgColor?: ColorValue;
|
|
40
|
+
/**
|
|
41
|
+
* Background color when the button is inactive or disabled.
|
|
42
|
+
*/
|
|
43
|
+
inactiveBgColor?: ColorValue;
|
|
44
|
+
/**
|
|
45
|
+
* Enables the loading/submitting indicator when true.
|
|
46
|
+
* Useful for forms and API calls.
|
|
47
|
+
*/
|
|
48
|
+
isSubmit?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Color used for the loading indicator.
|
|
51
|
+
* Example: "#FF7F50"
|
|
52
|
+
*/
|
|
53
|
+
colorsLoading?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Border color used when the variant is "outline".
|
|
56
|
+
*/
|
|
57
|
+
borderColor?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Determines the visual style of the button:
|
|
60
|
+
* - "filled": Default solid background
|
|
61
|
+
* - "outline": Transparent background with a border
|
|
62
|
+
*/
|
|
63
|
+
variant?: "outline" | "filled";
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=ButtonTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonTypes.d.ts","sourceRoot":"","sources":["../../../src/Button/types/ButtonTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC;IAExE;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC;IAEtE;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAEjD;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAE3B;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableOpacityProps, StyleProp, ViewStyle, TextStyle, TextProps, GestureResponderEvent } from 'react-native';
|
|
3
|
+
export interface ButtonProps extends TouchableOpacityProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
startIcon?: React.ReactNode;
|
|
6
|
+
startIconStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
endIcon?: React.ReactNode;
|
|
8
|
+
endIconStyle?: StyleProp<ViewStyle>;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
11
|
+
activeBgColor?: string;
|
|
12
|
+
inactiveBgColor?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
isSubmit?: boolean;
|
|
15
|
+
indicatorSize?: number | "small" | "large" | undefined;
|
|
16
|
+
onPress?: ((event: GestureResponderEvent) => void) | undefined;
|
|
17
|
+
variant?: 'filled' | 'outline';
|
|
18
|
+
borderColor?: string;
|
|
19
|
+
titleProps?: TextProps;
|
|
20
|
+
}
|
|
21
|
+
declare const Button: React.FC<ButtonProps>;
|
|
22
|
+
export default Button;
|
|
23
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAMtB,MAAM,WAAW,WAAY,SAAQ,qBAAqB;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC/D,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8DjC,CAAC;AAiCF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { ActivityIndicator, StyleSheet, TouchableOpacity, View, } from 'react-native';
|
|
14
|
+
import { colors } from '../themes';
|
|
15
|
+
import { scale } from '../utils';
|
|
16
|
+
import Text from '../Texts/Text';
|
|
17
|
+
const Button = (_a) => {
|
|
18
|
+
var { title, startIcon, startIconStyle, endIcon, endIconStyle, style, titleStyle, activeBgColor = colors.primary, inactiveBgColor = colors.gray_B3B3B3, disabled, isSubmit, indicatorSize, onPress, variant = 'filled', borderColor = colors.primary, titleProps } = _a, rest = __rest(_a, ["title", "startIcon", "startIconStyle", "endIcon", "endIconStyle", "style", "titleStyle", "activeBgColor", "inactiveBgColor", "disabled", "isSubmit", "indicatorSize", "onPress", "variant", "borderColor", "titleProps"]);
|
|
19
|
+
const backgroundColor = disabled
|
|
20
|
+
? inactiveBgColor
|
|
21
|
+
: variant === 'outline'
|
|
22
|
+
? colors.white
|
|
23
|
+
: activeBgColor;
|
|
24
|
+
return (_jsxs(TouchableOpacity, Object.assign({}, rest, { disabled: disabled || isSubmit, onPress: onPress, style: [
|
|
25
|
+
styles.btnContainer,
|
|
26
|
+
variant === 'outline' && styles.btnContainerOutline,
|
|
27
|
+
{ backgroundColor },
|
|
28
|
+
variant === 'outline' && { borderColor },
|
|
29
|
+
style,
|
|
30
|
+
], children: [startIcon ? _jsx(View, { style: [styles.viewIconStart, startIconStyle], children: startIcon }) : null, isSubmit ? (_jsx(ActivityIndicator, { size: indicatorSize || 'small', color: variant === 'outline' ? colors.primary : colors.white })) : (_jsx(Text, Object.assign({ style: [
|
|
31
|
+
styles.textTitle,
|
|
32
|
+
variant === 'outline' ? styles.textTitleOutline : {},
|
|
33
|
+
titleStyle,
|
|
34
|
+
], numberOfLines: 1 }, titleProps, { children: title }))), endIcon ? _jsx(View, { style: [styles.viewIconEnd, endIconStyle], children: endIcon }) : null] })));
|
|
35
|
+
};
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
btnContainer: {
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
paddingHorizontal: scale(24),
|
|
40
|
+
paddingVertical: scale(10),
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
borderRadius: scale(5),
|
|
44
|
+
},
|
|
45
|
+
btnContainerOutline: {
|
|
46
|
+
paddingHorizontal: scale(23),
|
|
47
|
+
paddingVertical: scale(9),
|
|
48
|
+
borderWidth: scale(1),
|
|
49
|
+
backgroundColor: colors.white,
|
|
50
|
+
borderColor: colors.primary,
|
|
51
|
+
},
|
|
52
|
+
viewIconStart: {
|
|
53
|
+
marginRight: scale(16),
|
|
54
|
+
},
|
|
55
|
+
viewIconEnd: {
|
|
56
|
+
marginLeft: scale(16),
|
|
57
|
+
},
|
|
58
|
+
textTitle: {
|
|
59
|
+
color: colors.white,
|
|
60
|
+
lineHeight: scale(20),
|
|
61
|
+
},
|
|
62
|
+
textTitleOutline: {
|
|
63
|
+
color: colors.primary,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
export default Button;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
import { PaperProps } from './Paper';
|
|
4
|
+
export interface CardProps extends ViewProps, PaperProps {
|
|
5
|
+
/**
|
|
6
|
+
* If true, the card will use raised styling.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
raised?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The variant to use.
|
|
12
|
+
* @default 'elevation'
|
|
13
|
+
*/
|
|
14
|
+
variant?: PaperProps['variant'];
|
|
15
|
+
/**
|
|
16
|
+
* Custom style
|
|
17
|
+
*/
|
|
18
|
+
style?: ViewStyle | ViewStyle[];
|
|
19
|
+
}
|
|
20
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<View>>;
|
|
21
|
+
export default Card;
|
|
22
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Cards/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,UAAU;IACtD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAEhC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACjC;AAED,QAAA,MAAM,IAAI,wEA2BR,CAAC;AAIH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import Paper from './Paper';
|
|
15
|
+
const Card = React.forwardRef(function Card(_a, ref) {
|
|
16
|
+
var { raised = false, variant = 'elevation', style } = _a, rest = __rest(_a, ["raised", "variant", "style"]);
|
|
17
|
+
const resolvedElevation = raised && variant !== 'outlined' ? 8 : undefined;
|
|
18
|
+
return (_jsx(Paper, Object.assign({ ref: ref, elevation: resolvedElevation, variant: variant, style: [
|
|
19
|
+
{
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
},
|
|
22
|
+
style,
|
|
23
|
+
] }, rest)));
|
|
24
|
+
});
|
|
25
|
+
Card.displayName = 'Card';
|
|
26
|
+
export default Card;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleProp, ViewStyle, AccessibilityRole } from 'react-native';
|
|
3
|
+
export interface CardActionAreaProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
onPress?: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
9
|
+
accessibilityRole?: AccessibilityRole;
|
|
10
|
+
}
|
|
11
|
+
declare const CardActionArea: React.ForwardRefExoticComponent<CardActionAreaProps & React.RefAttributes<View>>;
|
|
12
|
+
export default CardActionArea;
|
|
13
|
+
//# sourceMappingURL=CardActionArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardActionArea.d.ts","sourceRoot":"","sources":["../../src/Cards/CardActionArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,IAAI,EAEJ,SAAS,EACT,SAAS,EACT,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,QAAA,MAAM,cAAc,kFAiCnB,CAAC;AA8BF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Pressable, View, StyleSheet, } from 'react-native';
|
|
4
|
+
const CardActionArea = React.forwardRef(({ children, onPress, disabled = false, style, contentStyle, accessibilityRole = 'button', }, ref) => {
|
|
5
|
+
return (_jsxs(Pressable, { ref: ref, disabled: disabled, onPress: onPress, accessibilityRole: accessibilityRole, style: ({ pressed }) => [
|
|
6
|
+
styles.root,
|
|
7
|
+
style,
|
|
8
|
+
pressed && styles.pressed,
|
|
9
|
+
disabled && styles.disabled,
|
|
10
|
+
], children: [_jsx(View, { style: [styles.content, contentStyle], children: children }), _jsx(View, { pointerEvents: "none", style: styles.focusHighlight })] }));
|
|
11
|
+
});
|
|
12
|
+
CardActionArea.displayName = 'CardActionArea';
|
|
13
|
+
const styles = StyleSheet.create({
|
|
14
|
+
root: {
|
|
15
|
+
width: '100%',
|
|
16
|
+
borderRadius: 12,
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
width: '100%',
|
|
21
|
+
},
|
|
22
|
+
pressed: {
|
|
23
|
+
opacity: 0.92,
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
opacity: 0.5,
|
|
27
|
+
},
|
|
28
|
+
focusHighlight: Object.assign(Object.assign({}, StyleSheet.absoluteFillObject), { backgroundColor: 'rgba(0,0,0,0.08)', opacity: 0 }),
|
|
29
|
+
});
|
|
30
|
+
export default CardActionArea;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface CardActionsProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* If `true`, the actions do not have additional margin.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
disableSpacing?: boolean;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
declare const CardActions: React.ForwardRefExoticComponent<CardActionsProps & React.RefAttributes<View>>;
|
|
13
|
+
export default CardActions;
|
|
14
|
+
//# sourceMappingURL=CardActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardActions.d.ts","sourceRoot":"","sources":["../../src/Cards/CardActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,WAAW,+EAqChB,CAAC;AAeF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { View, StyleSheet, } from 'react-native';
|
|
15
|
+
const CardActions = React.forwardRef(function CardActions(props, ref) {
|
|
16
|
+
const { children, disableSpacing = false, style } = props, other = __rest(props, ["children", "disableSpacing", "style"]);
|
|
17
|
+
const childrenArray = React.Children.toArray(children);
|
|
18
|
+
return (_jsx(View, Object.assign({ ref: ref, style: [
|
|
19
|
+
styles.root,
|
|
20
|
+
style,
|
|
21
|
+
] }, other, { children: childrenArray.map((child, index) => {
|
|
22
|
+
if (!React.isValidElement(child))
|
|
23
|
+
return child;
|
|
24
|
+
const spacingStyle = !disableSpacing && index > 0
|
|
25
|
+
? styles.spacing
|
|
26
|
+
: null;
|
|
27
|
+
return (_jsx(View, { style: spacingStyle, children: child }, index));
|
|
28
|
+
}) })));
|
|
29
|
+
});
|
|
30
|
+
CardActions.displayName = 'CardActions';
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
root: {
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
padding: 8,
|
|
36
|
+
},
|
|
37
|
+
spacing: {
|
|
38
|
+
marginLeft: 8,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
export default CardActions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface CardContentProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
/**
|
|
7
|
+
* Set to `true` if you want to have spacing at bottom longer (usually use for the last CardContent)
|
|
8
|
+
*/
|
|
9
|
+
isLast?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const CardContent: React.FC<CardContentProps>;
|
|
12
|
+
export default CardContent;
|
|
13
|
+
//# sourceMappingURL=CardContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../src/Cards/CardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAgB3C,CAAC;AAaF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View, StyleSheet, } from 'react-native';
|
|
3
|
+
const CardContent = ({ children, style, isLast = true, }) => {
|
|
4
|
+
return (_jsx(View, { style: [
|
|
5
|
+
styles.root,
|
|
6
|
+
isLast && styles.last,
|
|
7
|
+
style,
|
|
8
|
+
], children: children }));
|
|
9
|
+
};
|
|
10
|
+
CardContent.displayName = 'CardContent';
|
|
11
|
+
const styles = StyleSheet.create({
|
|
12
|
+
root: {
|
|
13
|
+
padding: 16,
|
|
14
|
+
},
|
|
15
|
+
last: {
|
|
16
|
+
paddingBottom: 24,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export default CardContent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
export interface CardHeaderProps {
|
|
4
|
+
avatar?: React.ReactNode;
|
|
5
|
+
action?: React.ReactNode;
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
subheader?: React.ReactNode;
|
|
8
|
+
disableTypography?: boolean;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
11
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
12
|
+
subheaderStyle?: StyleProp<TextStyle>;
|
|
13
|
+
}
|
|
14
|
+
declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<View>>;
|
|
15
|
+
export default CardHeader;
|
|
16
|
+
//# sourceMappingURL=CardHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../src/Cards/CardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EAGJ,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEpC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACvC;AAED,QAAA,MAAM,UAAU,8EA4Df,CAAC;AA8CF,eAAe,UAAU,CAAC"}
|