@draftbit/core 43.4.15-d80519.0 → 43.4.16-ae1318.0
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/lib/commonjs/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/commonjs/components/Accordion/AccordionItem.js +21 -5
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/Accordion/index.js.map +1 -1
- package/lib/commonjs/components/CardContainer.js +16 -5
- package/lib/commonjs/components/CardContainer.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -5
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +2 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js +20 -4
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +3 -14
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js +19 -5
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/IconButton.js +20 -5
- package/lib/commonjs/components/IconButton.js.map +1 -1
- package/lib/commonjs/components/Picker/Picker.js +14 -3
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -6
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/ProgressCircle.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +10 -6
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/index.js.map +1 -1
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/ScreenContainer.js +22 -5
- package/lib/commonjs/components/ScreenContainer.js.map +1 -1
- package/lib/commonjs/components/Surface.js +30 -6
- package/lib/commonjs/components/Surface.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/AccordionItem.js.map +1 -1
- package/lib/commonjs/mappings/Card.js.map +1 -1
- package/lib/commonjs/mappings/CardContainerRating.js.map +1 -1
- package/lib/commonjs/mappings/DatePicker.js.map +1 -1
- package/lib/commonjs/mappings/KeyboardAvoidingView.js.map +1 -1
- package/lib/commonjs/mappings/ProgressCircle.js.map +1 -1
- package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/mappings/Slider.js.map +1 -1
- package/lib/commonjs/mappings/Switch.js.map +1 -1
- package/lib/commonjs/mappings/ToggleButton.js.map +1 -1
- package/lib/commonjs/mappings/WebView.js.map +1 -1
- package/lib/commonjs/styles/overlay.js.map +1 -1
- package/lib/module/components/Accordion/AccordionGroup.js +1 -26
- package/lib/module/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +2 -1
- package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +10 -6
- package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/module/components/Surface.js +14 -2
- package/lib/module/components/Surface.js.map +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/AccordionGroup.tsx +0 -27
- package/src/components/DatePicker/DatePicker.js +1 -1
- package/src/components/DatePicker/DatePicker.tsx +1 -1
- package/src/components/RadioButton/RadioButtonGroup.js +10 -6
- package/src/components/RadioButton/RadioButtonGroup.tsx +12 -8
- package/src/components/Surface.js +16 -5
- package/src/components/Surface.tsx +16 -5
|
@@ -5,17 +5,28 @@ import shadow from "../styles/shadow";
|
|
|
5
5
|
import overlay from "../styles/overlay";
|
|
6
6
|
import { withTheme } from "../theming";
|
|
7
7
|
const Surface = ({ elevation: propElevation, style, theme, children, ...rest }) => {
|
|
8
|
-
const { elevation: styleElevation = 3, borderRadius, overflow, height, width, } = (StyleSheet.flatten(style) || {});
|
|
8
|
+
const { elevation: styleElevation = 3, backgroundColor, borderRadius, overflow, height, width, } = (StyleSheet.flatten(style) || {});
|
|
9
9
|
const { dark: isDarkTheme, mode, colors } = theme;
|
|
10
10
|
const elevation = propElevation || styleElevation;
|
|
11
11
|
const evalationStyles = elevation ? shadow(elevation) : {};
|
|
12
|
+
const getBackgroundColor = () => {
|
|
13
|
+
if (backgroundColor) {
|
|
14
|
+
return backgroundColor;
|
|
15
|
+
}
|
|
16
|
+
else if (isDarkTheme && mode === "adaptive") {
|
|
17
|
+
return overlay(elevation, colors.surface);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return colors.surface;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
12
23
|
return (React.createElement(Animated.View, { ...rest, style: [
|
|
13
24
|
style,
|
|
14
25
|
{
|
|
15
|
-
backgroundColor:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
backgroundColor: getBackgroundColor(),
|
|
27
|
+
overflow: Platform.OS === "web" && overflow === "hidden"
|
|
28
|
+
? "hidden"
|
|
29
|
+
: "visible",
|
|
19
30
|
elevation,
|
|
20
31
|
...evalationStyles,
|
|
21
32
|
},
|
|
@@ -29,6 +29,7 @@ const Surface: React.FC<Props> = ({
|
|
|
29
29
|
}) => {
|
|
30
30
|
const {
|
|
31
31
|
elevation: styleElevation = 3,
|
|
32
|
+
backgroundColor,
|
|
32
33
|
borderRadius,
|
|
33
34
|
overflow,
|
|
34
35
|
height,
|
|
@@ -41,17 +42,27 @@ const Surface: React.FC<Props> = ({
|
|
|
41
42
|
|
|
42
43
|
const evalationStyles = elevation ? shadow(elevation) : {};
|
|
43
44
|
|
|
45
|
+
const getBackgroundColor = () => {
|
|
46
|
+
if (backgroundColor) {
|
|
47
|
+
return backgroundColor;
|
|
48
|
+
} else if (isDarkTheme && mode === "adaptive") {
|
|
49
|
+
return overlay(elevation, colors.surface);
|
|
50
|
+
} else {
|
|
51
|
+
return colors.surface;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
44
55
|
return (
|
|
45
56
|
<Animated.View
|
|
46
57
|
{...rest}
|
|
47
58
|
style={[
|
|
48
59
|
style,
|
|
49
60
|
{
|
|
50
|
-
backgroundColor:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
backgroundColor: getBackgroundColor(),
|
|
62
|
+
overflow:
|
|
63
|
+
Platform.OS === "web" && overflow === "hidden"
|
|
64
|
+
? "hidden"
|
|
65
|
+
: "visible",
|
|
55
66
|
elevation,
|
|
56
67
|
...evalationStyles,
|
|
57
68
|
},
|