diff --git a/src/components/IconButton/IconButton.tsx b/src/components/IconButton/IconButton.tsx index 456e214a83..be7aed0fab 100644 --- a/src/components/IconButton/IconButton.tsx +++ b/src/components/IconButton/IconButton.tsx @@ -196,6 +196,7 @@ const styles = StyleSheet.create({ container: { overflow: 'hidden', margin: 6, + elevation: 0, }, touchable: { flexGrow: 1, diff --git a/src/components/ToggleButton/utils.ts b/src/components/ToggleButton/utils.ts index b15fc985d7..f7c3afdf70 100644 --- a/src/components/ToggleButton/utils.ts +++ b/src/components/ToggleButton/utils.ts @@ -1,5 +1,5 @@ import color from 'color'; -import { tokens } from '../../../src/styles/themes/v3/tokens'; +import { tokens } from '../../styles/themes/v3/tokens'; import type { Theme } from '../../types'; export const getToggleButtonColor = ({ @@ -16,7 +16,10 @@ export const getToggleButtonColor = ({ .rgb() .string(); } - return theme.dark ? 'rgba(255, 255, 255, .12)' : 'rgba(0, 0, 0, .08)'; + if (theme.dark) { + return 'rgba(255, 255, 255, .12)'; + } + return 'rgba(0, 0, 0, .08)'; } return 'transparent'; }; diff --git a/src/components/__tests__/Appbar/__snapshots__/Appbar.test.js.snap b/src/components/__tests__/Appbar/__snapshots__/Appbar.test.js.snap index 0c8f53b0a0..7123c4050b 100644 --- a/src/components/__tests__/Appbar/__snapshots__/Appbar.test.js.snap +++ b/src/components/__tests__/Appbar/__snapshots__/Appbar.test.js.snap @@ -45,16 +45,10 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -154,17 +148,11 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "opacity": 0.32, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -259,16 +247,10 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -453,16 +435,10 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } diff --git a/src/components/__tests__/__snapshots__/DataTable.test.js.snap b/src/components/__tests__/__snapshots__/DataTable.test.js.snap index 68d3a3666f..58bd2a1cff 100644 --- a/src/components/__tests__/__snapshots__/DataTable.test.js.snap +++ b/src/components/__tests__/__snapshots__/DataTable.test.js.snap @@ -236,16 +236,10 @@ exports[`renders data table pagination 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -316,16 +310,10 @@ exports[`renders data table pagination 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -450,16 +438,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -530,16 +512,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -610,16 +586,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -690,16 +660,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -824,16 +788,10 @@ exports[`renders data table pagination with label 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -904,16 +862,10 @@ exports[`renders data table pagination with label 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -1217,16 +1169,10 @@ exports[`renders data table pagination with options select 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -1297,16 +1243,10 @@ exports[`renders data table pagination with options select 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -1377,16 +1317,10 @@ exports[`renders data table pagination with options select 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -1457,16 +1391,10 @@ exports[`renders data table pagination with options select 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } diff --git a/src/components/__tests__/__snapshots__/IconButton.test.js.snap b/src/components/__tests__/__snapshots__/IconButton.test.js.snap index 88905e9d8f..f03cc6ee1b 100644 --- a/src/components/__tests__/__snapshots__/IconButton.test.js.snap +++ b/src/components/__tests__/__snapshots__/IconButton.test.js.snap @@ -8,17 +8,11 @@ exports[`renders disabled icon button 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "opacity": 0.32, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -91,16 +85,10 @@ exports[`renders icon button by default 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -173,16 +161,10 @@ exports[`renders icon button with color 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -255,16 +237,10 @@ exports[`renders icon button with size 1`] = ` "borderColor": undefined, "borderRadius": 22.5, "borderWidth": 0, + "elevation": 0, "height": 45, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 45, } } @@ -337,16 +313,10 @@ exports[`renders icon change animated 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } diff --git a/src/components/__tests__/__snapshots__/Searchbar.test.js.snap b/src/components/__tests__/__snapshots__/Searchbar.test.js.snap index acae77298d..54906483e7 100644 --- a/src/components/__tests__/__snapshots__/Searchbar.test.js.snap +++ b/src/components/__tests__/__snapshots__/Searchbar.test.js.snap @@ -26,16 +26,10 @@ exports[`renders with placeholder 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -135,17 +129,11 @@ exports[`renders with placeholder 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "opacity": 0.32, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -238,16 +226,10 @@ exports[`renders with text 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -348,16 +330,10 @@ exports[`renders with text 1`] = ` "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 6, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } diff --git a/src/components/__tests__/__snapshots__/TextInput.test.js.snap b/src/components/__tests__/__snapshots__/TextInput.test.js.snap index dc4b5ee83c..e4e21b01a4 100644 --- a/src/components/__tests__/__snapshots__/TextInput.test.js.snap +++ b/src/components/__tests__/__snapshots__/TextInput.test.js.snap @@ -1034,16 +1034,10 @@ exports[`correctly renders left-side icon adornment, and right-side affix adornm "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 0, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } @@ -1316,16 +1310,10 @@ exports[`correctly renders left-side icon adornment, and right-side affix adornm "borderColor": undefined, "borderRadius": 18, "borderWidth": 0, + "elevation": 0, "height": 36, "margin": 0, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 36, } } diff --git a/src/components/__tests__/__snapshots__/ToggleButton.test.js.snap b/src/components/__tests__/__snapshots__/ToggleButton.test.js.snap index 91079a894c..1310d19cc2 100644 --- a/src/components/__tests__/__snapshots__/ToggleButton.test.js.snap +++ b/src/components/__tests__/__snapshots__/ToggleButton.test.js.snap @@ -8,17 +8,11 @@ exports[`renders disabled toggle button 1`] = ` "borderColor": "rgba(0, 0, 0, 0.29)", "borderRadius": 4, "borderWidth": 0, + "elevation": 0, "height": 42, "margin": 0, "opacity": 0.32, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 42, } } @@ -90,16 +84,10 @@ exports[`renders toggle button 1`] = ` "borderColor": "rgba(0, 0, 0, 0.29)", "borderRadius": 4, "borderWidth": 0, + "elevation": 0, "height": 42, "margin": 0, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 42, } } @@ -171,17 +159,11 @@ exports[`renders unchecked toggle button 1`] = ` "borderColor": "rgba(0, 0, 0, 0.29)", "borderRadius": 4, "borderWidth": 0, + "elevation": 0, "height": 42, "margin": 0, "opacity": 0.32, "overflow": "hidden", - "shadowColor": "#000000", - "shadowOffset": Object { - "height": 3, - "width": 0, - }, - "shadowOpacity": 0.24, - "shadowRadius": 4, "width": 42, } }