cdslibrary 1.0.21 → 1.0.22
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/components/CDSButton.jsx +10 -9
- package/index.js +1 -4
- package/package.json +1 -1
package/components/CDSButton.jsx
CHANGED
|
@@ -3,10 +3,10 @@ import { Text, StyleSheet, TouchableOpacity } from "react-native";
|
|
|
3
3
|
import { Dimensions, Platform } from "react-native";
|
|
4
4
|
import { MaterialIcons } from "@expo/vector-icons";
|
|
5
5
|
import { useTheme } from "../context/CDSThemeContext";
|
|
6
|
-
import {getSemanticTextStyles} from "../tokens/CDSsemanticTextStyles";
|
|
6
|
+
import { getSemanticTextStyles } from "../tokens/CDSsemanticTextStyles";
|
|
7
7
|
|
|
8
8
|
const { width } = Dimensions.get("window");
|
|
9
|
-
const isMobile = width <= 768
|
|
9
|
+
const isMobile = width <= 768
|
|
10
10
|
|
|
11
11
|
export const CDSButton = ({
|
|
12
12
|
label,
|
|
@@ -23,15 +23,15 @@ export const CDSButton = ({
|
|
|
23
23
|
type === "disabled"
|
|
24
24
|
? theme.surface.action.disabled
|
|
25
25
|
: type === "secondary" || type === "ghost" || type === "link"
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
? "transparent"
|
|
27
|
+
: theme.surface.action.primary;
|
|
28
28
|
|
|
29
29
|
const textColor =
|
|
30
30
|
type === "secondary" || type === "ghost" || type === "link"
|
|
31
31
|
? theme.text.neutral.primary
|
|
32
32
|
: type === "disabled"
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
? theme.text.neutral.disabled
|
|
34
|
+
: theme.text.neutral.contrast;
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<TouchableOpacity
|
|
@@ -41,9 +41,10 @@ export const CDSButton = ({
|
|
|
41
41
|
styles.container,
|
|
42
42
|
{ backgroundColor },
|
|
43
43
|
flexend && { justifyContent: "flex-end", paddingHorizontal: 0 },
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
{
|
|
45
|
+
paddingHorizontal: type === "icon" ? 12 : 24,
|
|
46
|
+
...(isMobile && { width: "100%" })
|
|
47
|
+
},
|
|
47
48
|
type === "secondary" && {
|
|
48
49
|
borderColor: theme.outline.action.primary,
|
|
49
50
|
borderWidth: 1,
|
package/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
|
|
1
2
|
// import { registerRootComponent } from 'expo';
|
|
2
3
|
|
|
3
4
|
// import App from './App';
|
|
4
|
-
|
|
5
|
-
// // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
|
6
|
-
// // It also ensures that whether you load the app in Expo Go or in a native build,
|
|
7
|
-
// // the environment is set up appropriately
|
|
8
5
|
// registerRootComponent(App);
|
|
9
6
|
|
|
10
7
|
export {CDSBottomSheet} from './components/CDSBottomSheet';
|