@tecsinapse/react-native-kit 1.22.10 → 1.22.11-beta.2
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/dist/cjs/components/atoms/BottomNavigator/BottomNavigator.js +2 -1
- package/dist/cjs/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
- package/dist/cjs/components/atoms/BottomNavigator/Item.d.ts +1 -1
- package/dist/cjs/components/atoms/BottomNavigator/Item.js.map +1 -1
- package/dist/esm/components/atoms/BottomNavigator/BottomNavigator.js +2 -1
- package/dist/esm/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
- package/dist/esm/components/atoms/BottomNavigator/Item.d.ts +1 -1
- package/dist/esm/components/atoms/BottomNavigator/Item.js.map +1 -1
- package/package.json +3 -3
|
@@ -38,7 +38,8 @@ function BottomNavigator({
|
|
|
38
38
|
const isSelected = value == selected;
|
|
39
39
|
return /* @__PURE__ */ React__namespace.createElement(styled.TabContainer, {
|
|
40
40
|
selected: isSelected,
|
|
41
|
-
onPress: () => onSelect(value)
|
|
41
|
+
onPress: () => onSelect(value),
|
|
42
|
+
style: { backgroundColor: "blue" }
|
|
42
43
|
}, React__namespace.cloneElement(child, {
|
|
43
44
|
_selected: isSelected
|
|
44
45
|
}), label && !labelElement && /* @__PURE__ */ React__namespace.createElement(Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomNavigator.js","sources":["../../../../../src/components/atoms/BottomNavigator/BottomNavigator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ViewProps } from 'react-native';\nimport { StyledView, TabContainer } from './styled';\nimport Item, { BottomNavigatorItemProps } from './Item';\nimport { Text } from '../Text';\n\nexport interface BottomNavigatorProps<T extends string | number | symbol>\n extends ViewProps {\n selected: T;\n onSelect: (value: T) => void | never;\n children:\n | React.ReactElement<BottomNavigatorItemProps<T>>\n | React.ReactElement<BottomNavigatorItemProps<T>>[];\n}\n\nfunction BottomNavigator<T extends string | number | symbol>({\n selected,\n onSelect,\n children,\n ...rest\n}: BottomNavigatorProps<T>): JSX.Element {\n return (\n <StyledView {...rest}>\n {React.Children.map(children, child => {\n const { value, label, labelProps, labelElement } = (\n child as React.ReactElement<BottomNavigatorItemProps<T>>\n ).props;\n const isSelected = value == selected;\n\n return (\n <TabContainer
|
|
1
|
+
{"version":3,"file":"BottomNavigator.js","sources":["../../../../../src/components/atoms/BottomNavigator/BottomNavigator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ViewProps } from 'react-native';\nimport { StyledView, TabContainer } from './styled';\nimport Item, { BottomNavigatorItemProps } from './Item';\nimport { Text } from '../Text';\n\nexport interface BottomNavigatorProps<T extends string | number | symbol>\n extends ViewProps {\n selected: T;\n onSelect: (value: T) => void | never;\n children:\n | React.ReactElement<BottomNavigatorItemProps<T>>\n | React.ReactElement<BottomNavigatorItemProps<T>>[];\n}\n\nfunction BottomNavigator<T extends string | number | symbol>({\n selected,\n onSelect,\n children,\n ...rest\n}: BottomNavigatorProps<T>): JSX.Element {\n return (\n <StyledView {...rest}>\n {React.Children.map(children, child => {\n const { value, label, labelProps, labelElement } = (\n child as React.ReactElement<BottomNavigatorItemProps<T>>\n ).props;\n const isSelected = value == selected;\n\n return (\n <TabContainer\n selected={isSelected}\n onPress={() => onSelect(value)}\n style={{ backgroundColor: 'blue' }}\n >\n {React.cloneElement(child as React.ReactElement, {\n _selected: isSelected,\n })}\n {label && !labelElement && (\n <Text\n colorVariant={\n labelProps?.colorVariant || isSelected\n ? 'primary'\n : 'secondary'\n }\n typography={labelProps?.typography || 'sub'}\n {...labelProps}\n >\n {label}\n </Text>\n )}\n {labelElement && labelElement}\n </TabContainer>\n );\n })}\n </StyledView>\n );\n}\n\nBottomNavigator.Item = Item;\n\nexport default BottomNavigator;\n"],"names":["React","StyledView","TabContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,eAAoD,CAAA;AAAA,EAC3D,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACG,GAAA,IAAA;AACL,CAAyC,EAAA;AACvC,EAAA,uBACGA,gBAAA,CAAA,aAAA,CAAAC,iBAAA,EAAA;AAAA,IAAY,GAAG,IAAA;AAAA,GAAA,EACbD,gBAAM,CAAA,QAAA,CAAS,GAAI,CAAA,QAAA,EAAU,CAAS,KAAA,KAAA;AACrC,IAAA,MAAM,EAAE,KAAO,EAAA,KAAA,EAAO,UAAY,EAAA,YAAA,KAChC,KACA,CAAA,KAAA,CAAA;AACF,IAAA,MAAM,aAAa,KAAS,IAAA,QAAA,CAAA;AAE5B,IAAA,uBACGA,gBAAA,CAAA,aAAA,CAAAE,mBAAA,EAAA;AAAA,MACC,QAAU,EAAA,UAAA;AAAA,MACV,OAAA,EAAS,MAAM,QAAA,CAAS,KAAK,CAAA;AAAA,MAC7B,KAAA,EAAO,EAAE,eAAA,EAAiB,MAAO,EAAA;AAAA,KAEhC,EAAAF,gBAAA,CAAM,aAAa,KAA6B,EAAA;AAAA,MAC/C,SAAW,EAAA,UAAA;AAAA,KACZ,CAAA,EACA,KAAS,IAAA,CAAC,gCACRA,gBAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,MACC,YACE,EAAA,UAAA,EAAY,YAAgB,IAAA,UAAA,GACxB,SACA,GAAA,WAAA;AAAA,MAEN,UAAA,EAAY,YAAY,UAAc,IAAA,KAAA;AAAA,MACrC,GAAG,UAAA;AAAA,KAEH,EAAA,KACH,CAED,EAAA,YAAA,IAAgB,YACnB,CAAA,CAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ,CAAA;AAEA,eAAA,CAAgB,IAAO,GAAA,IAAA;;;;"}
|
|
@@ -6,7 +6,7 @@ declare type ValueType = string | number | symbol;
|
|
|
6
6
|
export interface BottomNavigatorItemProps<T extends ValueType> extends Omit<ViewProps, 'children'> {
|
|
7
7
|
_selected?: boolean;
|
|
8
8
|
value: T;
|
|
9
|
-
icon
|
|
9
|
+
icon?: IconProps;
|
|
10
10
|
label?: string;
|
|
11
11
|
labelProps?: TextNativeProps;
|
|
12
12
|
labelElement?: React.ReactNode | React.ReactNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sources":["../../../../../src/components/atoms/BottomNavigator/Item.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Icon, IconProps } from '@tecsinapse/react-core';\nimport { TabContent, CustomTabContent } from './styled';\nimport { ViewProps } from 'react-native';\nimport { TextNativeProps } from '../Text';\n\ntype ValueType = string | number | symbol;\n\nexport interface BottomNavigatorItemProps<T extends ValueType>\n extends Omit<ViewProps, 'children'> {\n _selected?: boolean;\n value: T;\n icon
|
|
1
|
+
{"version":3,"file":"Item.js","sources":["../../../../../src/components/atoms/BottomNavigator/Item.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Icon, IconProps } from '@tecsinapse/react-core';\nimport { TabContent, CustomTabContent } from './styled';\nimport { ViewProps } from 'react-native';\nimport { TextNativeProps } from '../Text';\n\ntype ValueType = string | number | symbol;\n\nexport interface BottomNavigatorItemProps<T extends ValueType>\n extends Omit<ViewProps, 'children'> {\n _selected?: boolean;\n value: T;\n icon?: IconProps;\n label?: string;\n labelProps?: TextNativeProps;\n labelElement?: React.ReactNode | React.ReactNode[];\n children: React.ReactNode | React.ReactNode[];\n}\n\ntype ItemPropsWithIcon<T extends ValueType> = Omit<\n BottomNavigatorItemProps<T>,\n 'children'\n>;\n\ntype ItemPropsWithChildren<T extends ValueType> = Omit<\n BottomNavigatorItemProps<T>,\n 'icon' | 'label' | 'labelElement' | 'labelProps'\n>;\n\nfunction Item<T extends ValueType>(props: ItemPropsWithChildren<T>);\nfunction Item<T extends ValueType>(props: ItemPropsWithIcon<T>);\nfunction Item<T extends ValueType>({\n _selected,\n icon,\n children,\n ...rest\n}: Partial<BottomNavigatorItemProps<T>>): JSX.Element {\n const styledButtonStyle = _selected\n ? undefined\n : { backgroundColor: 'transparent' };\n\n const iconColorVariant = _selected ? 'primary' : 'secondary';\n\n if (icon) {\n return (\n <TabContent style={styledButtonStyle} {...rest}>\n <Icon colorVariant={iconColorVariant} size={'centi'} {...icon} />\n </TabContent>\n );\n } else {\n return <CustomTabContent>{children}</CustomTabContent>;\n }\n}\n\nexport default Item;\n"],"names":["React","TabContent","Icon","CustomTabContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,IAA0B,CAAA;AAAA,EACjC,SAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACG,GAAA,IAAA;AACL,CAAsD,EAAA;AACpD,EAAA,MAAM,iBAAoB,GAAA,SAAA,GACtB,KACA,CAAA,GAAA,EAAE,iBAAiB,aAAc,EAAA,CAAA;AAErC,EAAM,MAAA,gBAAA,GAAmB,YAAY,SAAY,GAAA,WAAA,CAAA;AAEjD,EAAA,IAAI,IAAM,EAAA;AACR,IAAA,uBACGA,gBAAA,CAAA,aAAA,CAAAC,iBAAA,EAAA;AAAA,MAAW,KAAO,EAAA,iBAAA;AAAA,MAAoB,GAAG,IAAA;AAAA,KAAA,kBACvCD,gBAAA,CAAA,aAAA,CAAAE,cAAA,EAAA;AAAA,MAAK,YAAc,EAAA,gBAAA;AAAA,MAAkB,IAAM,EAAA,OAAA;AAAA,MAAU,GAAG,IAAA;AAAA,KAAM,CACjE,CAAA,CAAA;AAAA,GAEG,MAAA;AACL,IAAO,uBAAAF,gBAAA,CAAA,aAAA,CAACG,+BAAkB,QAAS,CAAA,CAAA;AAAA,GACrC;AACF;;;;"}
|
|
@@ -16,7 +16,8 @@ function BottomNavigator({
|
|
|
16
16
|
const isSelected = value == selected;
|
|
17
17
|
return /* @__PURE__ */ React.createElement(TabContainer, {
|
|
18
18
|
selected: isSelected,
|
|
19
|
-
onPress: () => onSelect(value)
|
|
19
|
+
onPress: () => onSelect(value),
|
|
20
|
+
style: { backgroundColor: "blue" }
|
|
20
21
|
}, React.cloneElement(child, {
|
|
21
22
|
_selected: isSelected
|
|
22
23
|
}), label && !labelElement && /* @__PURE__ */ React.createElement(Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomNavigator.js","sources":["../../../../../src/components/atoms/BottomNavigator/BottomNavigator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ViewProps } from 'react-native';\nimport { StyledView, TabContainer } from './styled';\nimport Item, { BottomNavigatorItemProps } from './Item';\nimport { Text } from '../Text';\n\nexport interface BottomNavigatorProps<T extends string | number | symbol>\n extends ViewProps {\n selected: T;\n onSelect: (value: T) => void | never;\n children:\n | React.ReactElement<BottomNavigatorItemProps<T>>\n | React.ReactElement<BottomNavigatorItemProps<T>>[];\n}\n\nfunction BottomNavigator<T extends string | number | symbol>({\n selected,\n onSelect,\n children,\n ...rest\n}: BottomNavigatorProps<T>): JSX.Element {\n return (\n <StyledView {...rest}>\n {React.Children.map(children, child => {\n const { value, label, labelProps, labelElement } = (\n child as React.ReactElement<BottomNavigatorItemProps<T>>\n ).props;\n const isSelected = value == selected;\n\n return (\n <TabContainer
|
|
1
|
+
{"version":3,"file":"BottomNavigator.js","sources":["../../../../../src/components/atoms/BottomNavigator/BottomNavigator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ViewProps } from 'react-native';\nimport { StyledView, TabContainer } from './styled';\nimport Item, { BottomNavigatorItemProps } from './Item';\nimport { Text } from '../Text';\n\nexport interface BottomNavigatorProps<T extends string | number | symbol>\n extends ViewProps {\n selected: T;\n onSelect: (value: T) => void | never;\n children:\n | React.ReactElement<BottomNavigatorItemProps<T>>\n | React.ReactElement<BottomNavigatorItemProps<T>>[];\n}\n\nfunction BottomNavigator<T extends string | number | symbol>({\n selected,\n onSelect,\n children,\n ...rest\n}: BottomNavigatorProps<T>): JSX.Element {\n return (\n <StyledView {...rest}>\n {React.Children.map(children, child => {\n const { value, label, labelProps, labelElement } = (\n child as React.ReactElement<BottomNavigatorItemProps<T>>\n ).props;\n const isSelected = value == selected;\n\n return (\n <TabContainer\n selected={isSelected}\n onPress={() => onSelect(value)}\n style={{ backgroundColor: 'blue' }}\n >\n {React.cloneElement(child as React.ReactElement, {\n _selected: isSelected,\n })}\n {label && !labelElement && (\n <Text\n colorVariant={\n labelProps?.colorVariant || isSelected\n ? 'primary'\n : 'secondary'\n }\n typography={labelProps?.typography || 'sub'}\n {...labelProps}\n >\n {label}\n </Text>\n )}\n {labelElement && labelElement}\n </TabContainer>\n );\n })}\n </StyledView>\n );\n}\n\nBottomNavigator.Item = Item;\n\nexport default BottomNavigator;\n"],"names":[],"mappings":";;;;;AAeA,SAAS,eAAoD,CAAA;AAAA,EAC3D,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACG,GAAA,IAAA;AACL,CAAyC,EAAA;AACvC,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA;AAAA,IAAY,GAAG,IAAA;AAAA,GAAA,EACb,KAAM,CAAA,QAAA,CAAS,GAAI,CAAA,QAAA,EAAU,CAAS,KAAA,KAAA;AACrC,IAAA,MAAM,EAAE,KAAO,EAAA,KAAA,EAAO,UAAY,EAAA,YAAA,KAChC,KACA,CAAA,KAAA,CAAA;AACF,IAAA,MAAM,aAAa,KAAS,IAAA,QAAA,CAAA;AAE5B,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA;AAAA,MACC,QAAU,EAAA,UAAA;AAAA,MACV,OAAA,EAAS,MAAM,QAAA,CAAS,KAAK,CAAA;AAAA,MAC7B,KAAA,EAAO,EAAE,eAAA,EAAiB,MAAO,EAAA;AAAA,KAEhC,EAAA,KAAA,CAAM,aAAa,KAA6B,EAAA;AAAA,MAC/C,SAAW,EAAA,UAAA;AAAA,KACZ,CAAA,EACA,KAAS,IAAA,CAAC,gCACR,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,MACC,YACE,EAAA,UAAA,EAAY,YAAgB,IAAA,UAAA,GACxB,SACA,GAAA,WAAA;AAAA,MAEN,UAAA,EAAY,YAAY,UAAc,IAAA,KAAA;AAAA,MACrC,GAAG,UAAA;AAAA,KAEH,EAAA,KACH,CAED,EAAA,YAAA,IAAgB,YACnB,CAAA,CAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ,CAAA;AAEA,eAAA,CAAgB,IAAO,GAAA,IAAA;;;;"}
|
|
@@ -6,7 +6,7 @@ declare type ValueType = string | number | symbol;
|
|
|
6
6
|
export interface BottomNavigatorItemProps<T extends ValueType> extends Omit<ViewProps, 'children'> {
|
|
7
7
|
_selected?: boolean;
|
|
8
8
|
value: T;
|
|
9
|
-
icon
|
|
9
|
+
icon?: IconProps;
|
|
10
10
|
label?: string;
|
|
11
11
|
labelProps?: TextNativeProps;
|
|
12
12
|
labelElement?: React.ReactNode | React.ReactNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sources":["../../../../../src/components/atoms/BottomNavigator/Item.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Icon, IconProps } from '@tecsinapse/react-core';\nimport { TabContent, CustomTabContent } from './styled';\nimport { ViewProps } from 'react-native';\nimport { TextNativeProps } from '../Text';\n\ntype ValueType = string | number | symbol;\n\nexport interface BottomNavigatorItemProps<T extends ValueType>\n extends Omit<ViewProps, 'children'> {\n _selected?: boolean;\n value: T;\n icon
|
|
1
|
+
{"version":3,"file":"Item.js","sources":["../../../../../src/components/atoms/BottomNavigator/Item.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Icon, IconProps } from '@tecsinapse/react-core';\nimport { TabContent, CustomTabContent } from './styled';\nimport { ViewProps } from 'react-native';\nimport { TextNativeProps } from '../Text';\n\ntype ValueType = string | number | symbol;\n\nexport interface BottomNavigatorItemProps<T extends ValueType>\n extends Omit<ViewProps, 'children'> {\n _selected?: boolean;\n value: T;\n icon?: IconProps;\n label?: string;\n labelProps?: TextNativeProps;\n labelElement?: React.ReactNode | React.ReactNode[];\n children: React.ReactNode | React.ReactNode[];\n}\n\ntype ItemPropsWithIcon<T extends ValueType> = Omit<\n BottomNavigatorItemProps<T>,\n 'children'\n>;\n\ntype ItemPropsWithChildren<T extends ValueType> = Omit<\n BottomNavigatorItemProps<T>,\n 'icon' | 'label' | 'labelElement' | 'labelProps'\n>;\n\nfunction Item<T extends ValueType>(props: ItemPropsWithChildren<T>);\nfunction Item<T extends ValueType>(props: ItemPropsWithIcon<T>);\nfunction Item<T extends ValueType>({\n _selected,\n icon,\n children,\n ...rest\n}: Partial<BottomNavigatorItemProps<T>>): JSX.Element {\n const styledButtonStyle = _selected\n ? undefined\n : { backgroundColor: 'transparent' };\n\n const iconColorVariant = _selected ? 'primary' : 'secondary';\n\n if (icon) {\n return (\n <TabContent style={styledButtonStyle} {...rest}>\n <Icon colorVariant={iconColorVariant} size={'centi'} {...icon} />\n </TabContent>\n );\n } else {\n return <CustomTabContent>{children}</CustomTabContent>;\n }\n}\n\nexport default Item;\n"],"names":[],"mappings":";;;;AA+BA,SAAS,IAA0B,CAAA;AAAA,EACjC,SAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACG,GAAA,IAAA;AACL,CAAsD,EAAA;AACpD,EAAA,MAAM,iBAAoB,GAAA,SAAA,GACtB,KACA,CAAA,GAAA,EAAE,iBAAiB,aAAc,EAAA,CAAA;AAErC,EAAM,MAAA,gBAAA,GAAmB,YAAY,SAAY,GAAA,WAAA,CAAA;AAEjD,EAAA,IAAI,IAAM,EAAA;AACR,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA;AAAA,MAAW,KAAO,EAAA,iBAAA;AAAA,MAAoB,GAAG,IAAA;AAAA,KAAA,kBACvC,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,MAAK,YAAc,EAAA,gBAAA;AAAA,MAAkB,IAAM,EAAA,OAAA;AAAA,MAAU,GAAG,IAAA;AAAA,KAAM,CACjE,CAAA,CAAA;AAAA,GAEG,MAAA;AACL,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,wBAAkB,QAAS,CAAA,CAAA;AAAA,GACrC;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/react-native-kit",
|
|
3
3
|
"description": "TecSinapse React Native components",
|
|
4
|
-
"version": "1.22.
|
|
4
|
+
"version": "1.22.11-beta.2+67b3a86",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@emotion/native": "~11.10.0",
|
|
24
24
|
"@emotion/react": "~11.10.0",
|
|
25
|
-
"@tecsinapse/react-core": "1.21.8",
|
|
25
|
+
"@tecsinapse/react-core": "^1.21.9-beta.8+67b3a86",
|
|
26
26
|
"react-native-linear-gradient": "~2.5.6"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/uuid": "^8.3.3"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "67b3a8691628f980bce2ada1bac0d0d9b7318997"
|
|
49
49
|
}
|