@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 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAwCvC,CAAC;AAIF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Pressable, View } from 'react-native';
|
|
4
|
+
import Animated, { FadeIn, FadeOut, LinearTransition, } from 'react-native-reanimated';
|
|
5
|
+
const Accordion = ({ header, children, expanded, defaultExpanded = false, onChange, style, disabled, }) => {
|
|
6
|
+
const isControlled = expanded !== undefined;
|
|
7
|
+
const [internalExpanded, setInternalExpanded] = React.useState(defaultExpanded);
|
|
8
|
+
const isExpanded = isControlled ? expanded : internalExpanded;
|
|
9
|
+
const toggle = React.useCallback(() => {
|
|
10
|
+
const next = !isExpanded;
|
|
11
|
+
if (!isControlled) {
|
|
12
|
+
setInternalExpanded(next);
|
|
13
|
+
}
|
|
14
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(next);
|
|
15
|
+
}, [isExpanded, isControlled, onChange]);
|
|
16
|
+
return (_jsxs(View, { style: style, children: [_jsx(Pressable, { disabled: disabled, onPress: toggle, children: header }), isExpanded && (_jsx(Animated.View, { entering: FadeIn, exiting: FadeOut, layout: LinearTransition.springify(), children: children }))] }));
|
|
17
|
+
};
|
|
18
|
+
Accordion.displayName = 'Accordion';
|
|
19
|
+
export default Accordion;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AccordionLayoutContextValue {
|
|
3
|
+
requestRelayout: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const AccordionLayoutContext: React.Context<AccordionLayoutContextValue | null>;
|
|
6
|
+
export declare const useAccordionLayout: () => AccordionLayoutContextValue | null;
|
|
7
|
+
//# sourceMappingURL=AccordionContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionContext.d.ts","sourceRoot":"","sources":["../../src/Accordion/AccordionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,sBAAsB,mDAC4B,CAAC;AAEhE,eAAO,MAAM,kBAAkB,0CACW,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccordionGroupContextValue, AccordionGroupProps } from './types/AccordionTypes';
|
|
3
|
+
declare const AccordionGroup: React.FC<AccordionGroupProps>;
|
|
4
|
+
export declare const useAccordionGroup: () => AccordionGroupContextValue;
|
|
5
|
+
export declare const useOptionalAccordionGroup: () => AccordionGroupContextValue | null;
|
|
6
|
+
export default AccordionGroup;
|
|
7
|
+
//# sourceMappingURL=AccordionGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionGroup.d.ts","sourceRoot":"","sources":["../../src/Accordion/AccordionGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAe,MAAM,wBAAwB,CAAC;AAKtG,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgCjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,kCAM7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,yCAErC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const AccordionGroupContext = React.createContext(null);
|
|
4
|
+
const AccordionGroup = ({ children, type = 'single', defaultOpenIds = [], }) => {
|
|
5
|
+
const [openIds, setOpenIds] = React.useState(() => new Set(defaultOpenIds));
|
|
6
|
+
const toggle = React.useCallback((id) => {
|
|
7
|
+
setOpenIds(prev => {
|
|
8
|
+
const next = new Set(prev);
|
|
9
|
+
if (type === 'single') {
|
|
10
|
+
next.clear();
|
|
11
|
+
if (!prev.has(id))
|
|
12
|
+
next.add(id);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
16
|
+
}
|
|
17
|
+
return next;
|
|
18
|
+
});
|
|
19
|
+
}, [type]);
|
|
20
|
+
return (_jsx(AccordionGroupContext.Provider, { value: { openIds, toggle }, children: children }));
|
|
21
|
+
};
|
|
22
|
+
export const useAccordionGroup = () => {
|
|
23
|
+
const ctx = React.useContext(AccordionGroupContext);
|
|
24
|
+
if (!ctx) {
|
|
25
|
+
throw new Error('Accordion must be used inside AccordionGroup');
|
|
26
|
+
}
|
|
27
|
+
return ctx;
|
|
28
|
+
};
|
|
29
|
+
export const useOptionalAccordionGroup = () => {
|
|
30
|
+
return React.useContext(AccordionGroupContext);
|
|
31
|
+
};
|
|
32
|
+
export default AccordionGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../src/Accordion/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0B/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Accordion from './Accordion';
|
|
3
|
+
import { useAccordionGroup } from './AccordionGroup';
|
|
4
|
+
const AccordionItem = ({ id, header, children, style, disabled, onChange, }) => {
|
|
5
|
+
const { openIds, toggle } = useAccordionGroup();
|
|
6
|
+
const expanded = openIds.has(id);
|
|
7
|
+
return (_jsx(Accordion, { header: header, expanded: expanded, onChange: (ex) => {
|
|
8
|
+
toggle(id);
|
|
9
|
+
onChange && onChange(ex);
|
|
10
|
+
}, style: style, disabled: disabled, children: children }));
|
|
11
|
+
};
|
|
12
|
+
export default AccordionItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const AccordionTree: import("react").FC<import("./types/AccordionTypes").AccordionTreeProps & {
|
|
2
|
+
renderItem?: (params: import("./types/AccordionTypes").AccordionTreeItemProps) => React.ReactNode;
|
|
3
|
+
renderRootItem?: (params: import("./types/AccordionTypes").AccordionTreeItemProps) => React.ReactNode;
|
|
4
|
+
}>;
|
|
5
|
+
export default AccordionTree;
|
|
6
|
+
//# sourceMappingURL=AccordionTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTree.d.ts","sourceRoot":"","sources":["../../src/Accordion/AccordionTree.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,aAAa;;;EAAyB,CAAC;AAI7C,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccordionTreeProps, AccordionTreeInternalProps } from './types/AccordionTypes';
|
|
3
|
+
declare const AccordionTreeInternal: React.FC<AccordionTreeInternalProps & Pick<AccordionTreeProps, 'type' | 'style' | 'itemStyle' | 'itemTextStyle' | 'renderItem' | 'renderRootItem' | 'onItemChange'>>;
|
|
4
|
+
export default AccordionTreeInternal;
|
|
5
|
+
//# sourceMappingURL=AccordionTreeInternal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTreeInternal.d.ts","sourceRoot":"","sources":["../../src/Accordion/AccordionTreeInternal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAGL,kBAAkB,EAClB,0BAA0B,EAE3B,MAAM,wBAAwB,CAAC;AAMhC,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CACnC,0BAA0B,GAC1B,IAAI,CACF,kBAAkB,EAChB,MAAM,GACN,OAAO,GACP,WAAW,GACX,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,cAAc,CACjB,CA+EF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import AccordionItem from './AccordionItem';
|
|
4
|
+
import Text from '../Texts/Text';
|
|
5
|
+
import AccordionGroup, { useOptionalAccordionGroup } from './AccordionGroup';
|
|
6
|
+
const makeTreeId = (path) => `accordion-node-${path}`;
|
|
7
|
+
const AccordionTreeInternal = ({ data, path, level, type, style, itemStyle, itemTextStyle, renderItem, renderRootItem, onItemChange, }) => {
|
|
8
|
+
const group = useOptionalAccordionGroup();
|
|
9
|
+
const renderContent = (item, nodeId, isExpanded, level) => {
|
|
10
|
+
const props = { item, nodeId, isExpanded, level };
|
|
11
|
+
if (item === null || item === void 0 ? void 0 : item.label) {
|
|
12
|
+
return item === null || item === void 0 ? void 0 : item.label;
|
|
13
|
+
}
|
|
14
|
+
if (renderRootItem) {
|
|
15
|
+
return renderRootItem(props);
|
|
16
|
+
}
|
|
17
|
+
if (renderItem) {
|
|
18
|
+
return renderItem(props);
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(View, { style: itemStyle, children: _jsx(Text, { style: itemTextStyle, children: item.title }) }));
|
|
21
|
+
};
|
|
22
|
+
return (_jsx(View, { style: style, children: data.map((item, index) => {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
const currentPath = `${path}-${index}`;
|
|
25
|
+
const nodeId = (_a = item === null || item === void 0 ? void 0 : item.id) !== null && _a !== void 0 ? _a : makeTreeId(currentPath);
|
|
26
|
+
const isExpanded = (_b = group === null || group === void 0 ? void 0 : group.openIds.has(nodeId)) !== null && _b !== void 0 ? _b : false;
|
|
27
|
+
return (_jsx(AccordionItem, { id: nodeId, header: renderContent(item, nodeId, isExpanded, level), disabled: item.disabled, onChange: (expanded) => {
|
|
28
|
+
onItemChange === null || onItemChange === void 0 ? void 0 : onItemChange(item, {
|
|
29
|
+
id: nodeId,
|
|
30
|
+
path: currentPath,
|
|
31
|
+
expanded,
|
|
32
|
+
});
|
|
33
|
+
}, children: ((_c = item.children) === null || _c === void 0 ? void 0 : _c.length) ? (_jsx(AccordionGroup, { type: type, children: _jsx(AccordionTreeInternal, { data: item.children, path: currentPath, level: level + 1, type: type, itemStyle: itemStyle, itemTextStyle: itemTextStyle, renderItem: renderItem, onItemChange: onItemChange }) })) : null }, nodeId));
|
|
34
|
+
}) }));
|
|
35
|
+
};
|
|
36
|
+
export default AccordionTreeInternal;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccordionTreeItemProps, AccordionTreeProps } from './types/AccordionTypes';
|
|
3
|
+
declare const AccordionTreeWithGroup: React.FC<AccordionTreeProps & {
|
|
4
|
+
renderItem?: (params: AccordionTreeItemProps) => React.ReactNode;
|
|
5
|
+
renderRootItem?: (params: AccordionTreeItemProps) => React.ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export default AccordionTreeWithGroup;
|
|
8
|
+
//# sourceMappingURL=AccordionTreeWithGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTreeWithGroup.d.ts","sourceRoot":"","sources":["../../src/Accordion/AccordionTreeWithGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAIhC,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CACpC,kBAAkB,GAAG;IACnB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,KAAK,CAAC,SAAS,CAAC;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,KAAK,CAAC,SAAS,CAAC;CACtE,CAaF,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import AccordionGroup, { useOptionalAccordionGroup } from './AccordionGroup';
|
|
3
|
+
import AccordionTreeInternal from './AccordionTreeInternal';
|
|
4
|
+
const AccordionTreeWithGroup = (props) => {
|
|
5
|
+
const group = useOptionalAccordionGroup();
|
|
6
|
+
if (group) {
|
|
7
|
+
return _jsx(AccordionTreeInternal, Object.assign({}, props, { level: 0, path: "0" }));
|
|
8
|
+
}
|
|
9
|
+
return (_jsx(AccordionGroup, { type: props.type, children: _jsx(AccordionTreeInternal, Object.assign({}, props, { level: 0, path: "0" })) }));
|
|
10
|
+
};
|
|
11
|
+
export default AccordionTreeWithGroup;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Accordion } from './Accordion';
|
|
2
|
+
export { default as AccordionItem } from './AccordionItem';
|
|
3
|
+
export { default as AccordionGroup } from './AccordionGroup';
|
|
4
|
+
export { default as AccordionTree } from './AccordionTree';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Accordion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
export type AccordionId = string | number;
|
|
4
|
+
export type AccordionGroupType = 'single' | 'multiple';
|
|
5
|
+
export interface AccordionProps {
|
|
6
|
+
header: React.ReactNode;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
expanded?: boolean;
|
|
9
|
+
defaultExpanded?: boolean;
|
|
10
|
+
onChange?: (expanded: boolean) => void;
|
|
11
|
+
style?: ViewStyle;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface AccordionNode {
|
|
15
|
+
id?: AccordionId;
|
|
16
|
+
title?: string;
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
children?: AccordionNode[];
|
|
20
|
+
}
|
|
21
|
+
export interface AccordionTreeProps extends AccordionTreeRenderProps {
|
|
22
|
+
type?: AccordionGroupType;
|
|
23
|
+
data: AccordionNode[];
|
|
24
|
+
style?: ViewStyle;
|
|
25
|
+
itemStyle?: ViewStyle;
|
|
26
|
+
itemTextStyle?: TextStyle;
|
|
27
|
+
onItemChange?: (item: AccordionNode, info: {
|
|
28
|
+
id: AccordionId;
|
|
29
|
+
path: string;
|
|
30
|
+
expanded: boolean;
|
|
31
|
+
}) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface AccordionGroupContextValue {
|
|
34
|
+
openIds: Set<AccordionId>;
|
|
35
|
+
toggle: (id: AccordionId) => void;
|
|
36
|
+
}
|
|
37
|
+
export interface AccordionGroupProps {
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
type?: AccordionGroupType;
|
|
40
|
+
defaultOpenIds?: AccordionId[];
|
|
41
|
+
}
|
|
42
|
+
export interface AccordionItemProps {
|
|
43
|
+
id: AccordionId;
|
|
44
|
+
header: React.ReactNode;
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
onChange?: (expanded: boolean) => void;
|
|
47
|
+
style?: ViewStyle;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface AccordionTreeItemProps {
|
|
51
|
+
item: AccordionNode;
|
|
52
|
+
nodeId: AccordionId;
|
|
53
|
+
isExpanded: boolean;
|
|
54
|
+
level: number;
|
|
55
|
+
}
|
|
56
|
+
export interface AccordionTreeInternalProps {
|
|
57
|
+
data: AccordionNode[];
|
|
58
|
+
path: string;
|
|
59
|
+
level: number;
|
|
60
|
+
}
|
|
61
|
+
export interface AccordionTreeRenderProps {
|
|
62
|
+
renderItem?: (params: AccordionTreeItemProps) => React.ReactNode;
|
|
63
|
+
renderRootItem?: (params: AccordionTreeItemProps) => React.ReactNode;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=AccordionTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTypes.d.ts","sourceRoot":"","sources":["../../../src/Accordion/types/AccordionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEvD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAmB,SAAQ,wBAAwB;IAClE,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,CACb,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE;QACJ,EAAE,EAAE,WAAW,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;KACnB,KACE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IAC1B,MAAM,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,cAAc,CAAC,EAAE,WAAW,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,WAAW,CAAC;IAChB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,KAAK,CAAC,SAAS,CAAC;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,KAAK,CAAC,SAAS,CAAC;CACtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { Source, ImageStyle } from 'react-native-fast-image';
|
|
4
|
+
export type AvatarVariant = 'circular' | 'rounded' | 'square';
|
|
5
|
+
export interface AvatarProps {
|
|
6
|
+
source?: number | Source | undefined;
|
|
7
|
+
size?: number;
|
|
8
|
+
variant?: AvatarVariant;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
alt?: string;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
imageStyle?: ImageStyle;
|
|
13
|
+
textStyle?: StyleProp<TextStyle>;
|
|
14
|
+
backgroundColor?: string;
|
|
15
|
+
iconColor?: string;
|
|
16
|
+
isFirstAlt?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const Avatar: React.FC<AvatarProps>;
|
|
19
|
+
export default Avatar;
|
|
20
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatars/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAkB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAgBD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6DjC,CAAC;AA2BF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View, Text, StyleSheet, } from 'react-native';
|
|
4
|
+
import { colors } from '../themes';
|
|
5
|
+
import SvgIcon from '../SvgIcon/SvgIcon';
|
|
6
|
+
import FastImage from 'react-native-fast-image';
|
|
7
|
+
const getAltLetter = (alt, isFirstAlt = true) => {
|
|
8
|
+
if (!alt)
|
|
9
|
+
return undefined;
|
|
10
|
+
const parts = alt
|
|
11
|
+
.trim()
|
|
12
|
+
.split(/\s+/)
|
|
13
|
+
.filter(Boolean);
|
|
14
|
+
if (!parts.length)
|
|
15
|
+
return undefined;
|
|
16
|
+
const word = isFirstAlt ? parts[0] : parts[parts.length - 1];
|
|
17
|
+
return word.charAt(0).toUpperCase();
|
|
18
|
+
};
|
|
19
|
+
const Avatar = ({ source, size = 40, variant = 'circular', children, alt, style, imageStyle, textStyle, backgroundColor = colors.primary, iconColor = colors.white, isFirstAlt = true, }) => {
|
|
20
|
+
const [error, setError] = React.useState(false);
|
|
21
|
+
const altLetter = getAltLetter(alt, isFirstAlt);
|
|
22
|
+
const borderRadius = variant === 'square'
|
|
23
|
+
? 0
|
|
24
|
+
: variant === 'rounded'
|
|
25
|
+
? 8
|
|
26
|
+
: size / 2;
|
|
27
|
+
const showImage = source && !error;
|
|
28
|
+
return (_jsx(View, { style: [
|
|
29
|
+
styles.root,
|
|
30
|
+
{
|
|
31
|
+
width: size,
|
|
32
|
+
height: size,
|
|
33
|
+
borderRadius,
|
|
34
|
+
backgroundColor: showImage ? undefined : backgroundColor,
|
|
35
|
+
},
|
|
36
|
+
style,
|
|
37
|
+
], children: showImage ? (_jsx(FastImage, { source: source, style: [
|
|
38
|
+
StyleSheet.absoluteFill,
|
|
39
|
+
{ borderRadius },
|
|
40
|
+
imageStyle,
|
|
41
|
+
], resizeMode: "cover", onError: () => setError(true) })) : children ? (children) : altLetter ? (_jsx(Text, { style: [styles.text, textStyle], children: altLetter })) : (_jsx(SvgIcon, { name: 'person', color: iconColor, size: size / 2 })) }));
|
|
42
|
+
};
|
|
43
|
+
Avatar.displayName = 'Avatar';
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
root: {
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
},
|
|
50
|
+
text: {
|
|
51
|
+
color: colors.white,
|
|
52
|
+
fontSize: 18,
|
|
53
|
+
fontWeight: '600',
|
|
54
|
+
},
|
|
55
|
+
fallback: {
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
justifyContent: 'center',
|
|
58
|
+
},
|
|
59
|
+
fallbackText: {
|
|
60
|
+
fontSize: 20,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
export default Avatar;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StyleProp, TextStyle, View, ViewStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type BadgeAnchorOrigin = {
|
|
4
|
+
vertical?: 'top' | 'bottom';
|
|
5
|
+
horizontal?: 'left' | 'right';
|
|
6
|
+
};
|
|
7
|
+
export type BadgeVariant = 'standard' | 'dot';
|
|
8
|
+
export type BadgeOverlap = 'rectangular' | 'circular';
|
|
9
|
+
export interface BadgeProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
badgeContent?: number | string;
|
|
12
|
+
max?: number;
|
|
13
|
+
showZero?: boolean;
|
|
14
|
+
invisible?: boolean;
|
|
15
|
+
color?: string;
|
|
16
|
+
variant?: BadgeVariant;
|
|
17
|
+
overlap?: BadgeOverlap;
|
|
18
|
+
anchorOrigin?: BadgeAnchorOrigin;
|
|
19
|
+
contentStyle?: StyleProp<TextStyle>;
|
|
20
|
+
style?: StyleProp<ViewStyle>;
|
|
21
|
+
badgeStyle?: StyleProp<ViewStyle>;
|
|
22
|
+
}
|
|
23
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<View>>;
|
|
24
|
+
export default Badge;
|
|
25
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/Badges/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAChF,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC;AAC9C,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,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;CACnC;AAkCD,QAAA,MAAM,KAAK,yEAuDT,CAAC;AA+BH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { colors, fontSize } from '../themes';
|
|
5
|
+
import Text from '../Texts/Text';
|
|
6
|
+
function getDisplayValue(content, max) {
|
|
7
|
+
if (typeof content === 'number') {
|
|
8
|
+
return content > max ? `${max}+` : content;
|
|
9
|
+
}
|
|
10
|
+
return content;
|
|
11
|
+
}
|
|
12
|
+
function getBadgePosition(anchorOrigin, overlap) {
|
|
13
|
+
const offset = overlap === 'circular' ? '14%' : 0;
|
|
14
|
+
return {
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
top: anchorOrigin.vertical === 'top' ? offset : undefined,
|
|
17
|
+
bottom: anchorOrigin.vertical === 'bottom' ? offset : undefined,
|
|
18
|
+
left: anchorOrigin.horizontal === 'left' ? offset : undefined,
|
|
19
|
+
right: anchorOrigin.horizontal === 'right' ? offset : undefined,
|
|
20
|
+
transform: [
|
|
21
|
+
{ translateX: anchorOrigin.horizontal === 'right' ? 8 : -8 },
|
|
22
|
+
{ translateY: anchorOrigin.vertical === 'bottom' ? 8 : -8 },
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const RADIUS_STANDARD = 10;
|
|
27
|
+
const RADIUS_DOT = 8;
|
|
28
|
+
const Badge = React.forwardRef(function Badge({ children, badgeContent, max = 99, showZero = false, invisible = false, color = colors.primary, variant = 'standard', overlap = 'rectangular', anchorOrigin = { vertical: 'top', horizontal: 'right' }, contentStyle, style, badgeStyle, }, ref) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const isZero = badgeContent === 0;
|
|
31
|
+
const isHidden = invisible ||
|
|
32
|
+
badgeContent == null ||
|
|
33
|
+
(!showZero && isZero && variant !== 'dot');
|
|
34
|
+
const displayValue = variant === 'dot' ? undefined : getDisplayValue(badgeContent, max);
|
|
35
|
+
return (_jsxs(View, { ref: ref, style: [styles.root, style], children: [children, !isHidden && (_jsx(View, { style: [
|
|
36
|
+
styles.badge,
|
|
37
|
+
variant === 'dot' && styles.dot,
|
|
38
|
+
getBadgePosition({
|
|
39
|
+
vertical: (_a = anchorOrigin.vertical) !== null && _a !== void 0 ? _a : 'top',
|
|
40
|
+
horizontal: (_b = anchorOrigin.horizontal) !== null && _b !== void 0 ? _b : 'right',
|
|
41
|
+
}, overlap),
|
|
42
|
+
{
|
|
43
|
+
backgroundColor: color
|
|
44
|
+
},
|
|
45
|
+
badgeStyle,
|
|
46
|
+
], children: variant !== 'dot' && (_jsx(Text, { color: colors.white, style: [styles.defaultContentStyle, contentStyle], children: displayValue })) }))] }));
|
|
47
|
+
});
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
root: {
|
|
50
|
+
position: 'relative',
|
|
51
|
+
alignSelf: 'flex-start',
|
|
52
|
+
},
|
|
53
|
+
badge: {
|
|
54
|
+
minWidth: RADIUS_STANDARD * 2,
|
|
55
|
+
height: RADIUS_STANDARD * 2,
|
|
56
|
+
borderRadius: RADIUS_STANDARD,
|
|
57
|
+
backgroundColor: colors.primary,
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
paddingHorizontal: 6,
|
|
61
|
+
zIndex: 1,
|
|
62
|
+
},
|
|
63
|
+
dot: {
|
|
64
|
+
width: RADIUS_DOT * 2,
|
|
65
|
+
height: RADIUS_DOT * 2,
|
|
66
|
+
minWidth: RADIUS_DOT * 2,
|
|
67
|
+
borderRadius: RADIUS_DOT,
|
|
68
|
+
paddingHorizontal: 0,
|
|
69
|
+
},
|
|
70
|
+
defaultContentStyle: {
|
|
71
|
+
fontSize: fontSize._12
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
Badge.displayName = 'Badge';
|
|
75
|
+
export default Badge;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BreadcrumbItem {
|
|
3
|
+
item?: string | React.ReactNode;
|
|
4
|
+
onPress?: () => void;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface BreadcrumbProps {
|
|
8
|
+
items: BreadcrumbItem[];
|
|
9
|
+
separator?: string | React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
12
|
+
export default Breadcrumb;
|
|
13
|
+
//# sourceMappingURL=Breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACtC;AAID,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmDzC,CAAC;AAmCF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View, Pressable, StyleSheet, } from 'react-native';
|
|
3
|
+
import colors from '../themes/colors';
|
|
4
|
+
import fontSize from '../themes/fontSize';
|
|
5
|
+
import Text from '../Texts/Text';
|
|
6
|
+
const DEFAULT_SEPARATOR = '›';
|
|
7
|
+
const Breadcrumb = ({ items, separator = DEFAULT_SEPARATOR, }) => {
|
|
8
|
+
const renderItem = (i, isLast) => {
|
|
9
|
+
if (typeof i.item === 'string') {
|
|
10
|
+
return (_jsx(Text, { style: [
|
|
11
|
+
styles.itemText,
|
|
12
|
+
isLast && styles.lastItem,
|
|
13
|
+
i.onPress && styles.link,
|
|
14
|
+
], children: i.item }));
|
|
15
|
+
}
|
|
16
|
+
return i.item;
|
|
17
|
+
};
|
|
18
|
+
const renderSeparator = () => {
|
|
19
|
+
if (typeof separator === 'string') {
|
|
20
|
+
return _jsx(Text, { style: styles.separator, children: separator });
|
|
21
|
+
}
|
|
22
|
+
return separator;
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(View, { style: styles.container, children: items.map((item, index) => {
|
|
25
|
+
const isLast = index === items.length - 1;
|
|
26
|
+
const content = renderItem(item, isLast);
|
|
27
|
+
return (_jsxs(View, { style: styles.itemWrapper, children: [_jsx(Pressable, { disabled: ((item === null || item === void 0 ? void 0 : item.disabled) !== undefined) ? item === null || item === void 0 ? void 0 : item.disabled : isLast, onPress: item === null || item === void 0 ? void 0 : item.onPress, style: ({ pressed }) => [
|
|
28
|
+
pressed && styles.pressed,
|
|
29
|
+
], children: content }), !isLast && renderSeparator()] }, index));
|
|
30
|
+
}) }));
|
|
31
|
+
};
|
|
32
|
+
const styles = StyleSheet.create({
|
|
33
|
+
container: {
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
flexWrap: 'wrap',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
},
|
|
38
|
+
itemWrapper: {
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
},
|
|
42
|
+
pressed: {
|
|
43
|
+
opacity: 0.6,
|
|
44
|
+
},
|
|
45
|
+
itemText: {
|
|
46
|
+
fontSize: fontSize._14,
|
|
47
|
+
color: colors.black,
|
|
48
|
+
},
|
|
49
|
+
link: {
|
|
50
|
+
fontWeight: '500',
|
|
51
|
+
},
|
|
52
|
+
lastItem: {
|
|
53
|
+
color: colors.primary,
|
|
54
|
+
fontWeight: '500',
|
|
55
|
+
},
|
|
56
|
+
separator: {
|
|
57
|
+
marginHorizontal: 8,
|
|
58
|
+
color: colors.gray,
|
|
59
|
+
fontSize: fontSize._14,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
|
63
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TouchableOpacityProps, ViewProps } from "react-native";
|
|
3
|
+
import { ButtonType } from "./types/ButtonTypes";
|
|
4
|
+
export type ButtonTypes = ViewProps & TouchableOpacityProps & ButtonType;
|
|
5
|
+
declare const Button: React.FC<ButtonTypes>;
|
|
6
|
+
export default Button;
|
|
7
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,qBAAqB,EAErB,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,qBAAqB,GAAG,UAAU,CAAC;AAEzE,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAoDjC,CAAC;AA+BF,eAAe,MAAM,CAAC"}
|