@basic-ui/material 0.1.1 → 0.1.5
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/build/cjs/index.js +19 -9
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +1 -1
- package/build/esm/AppBar/AppBar.d.ts +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.js +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
- package/build/esm/Button/BaseButton.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/Button/FilledButton.d.ts +1 -1
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/TransparentButton.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Chip/ChipBase.d.ts +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.js +2 -1
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +1 -1
- package/build/esm/Link/Link.d.ts +1 -1
- package/build/esm/List/List.d.ts +1 -1
- package/build/esm/ListItem/ListItem.d.ts +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Paper/Paper.d.ts +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Tab/Tab.d.ts +1 -1
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/Table/Table.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Text/Text.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/HelperText.d.ts +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/TextField/index.d.ts +1 -0
- package/build/esm/TextField/index.js +1 -0
- package/build/esm/TextField/index.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/esm/color.d.ts +3 -2
- package/build/esm/color.js +13 -5
- package/build/esm/color.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +109 -108
- package/package.json +3 -3
- package/src/BottomSheet/BottomSheetSurface.tsx +1 -1
- package/src/Dialog/DialogSurface.tsx +2 -1
- package/src/TextField/index.ts +1 -0
- package/src/color.ts +24 -12
package/src/color.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { get } from '@styled-system/css';
|
|
1
|
+
import { get, SystemStyleObject } from '@styled-system/css';
|
|
3
2
|
import { parseToRgb } from 'polished';
|
|
4
3
|
import { DARK_THEME_CLASS } from './ColorMode';
|
|
5
4
|
import { Theme } from './theme';
|
|
@@ -17,25 +16,38 @@ export const alpha = (colorString: string, alphaValue: number) => (
|
|
|
17
16
|
return `rgba(${rgb.red},${rgb.green},${rgb.blue},${alphaValue})`;
|
|
18
17
|
};
|
|
19
18
|
|
|
19
|
+
export function getBackgroundOverlay(
|
|
20
|
+
theme: Theme,
|
|
21
|
+
backgroundOverlay: number | string
|
|
22
|
+
): SystemStyleObject {
|
|
23
|
+
if (Number(backgroundOverlay) <= 0) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
background: `linear-gradient(${get(theme, 'colors.surface')}, ${get(
|
|
29
|
+
theme,
|
|
30
|
+
'colors.surface'
|
|
31
|
+
)}), ${alpha(
|
|
32
|
+
'on.surface',
|
|
33
|
+
get(theme, `paper.overlays.${backgroundOverlay}`) || 0
|
|
34
|
+
)(theme)}`,
|
|
35
|
+
backgroundBlendMode: 'overlay',
|
|
36
|
+
backgroundRepeat: 'no-repeat',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
20
40
|
export function getDarkThemeBackgroundOverlay(
|
|
21
41
|
theme: Theme,
|
|
22
42
|
backgroundOverlay: number | string
|
|
23
|
-
):
|
|
43
|
+
): SystemStyleObject {
|
|
24
44
|
if (Number(backgroundOverlay) <= 0) {
|
|
25
45
|
return {};
|
|
26
46
|
}
|
|
27
47
|
|
|
28
48
|
return {
|
|
29
49
|
[`.${DARK_THEME_CLASS} &, &.${DARK_THEME_CLASS}`]: {
|
|
30
|
-
|
|
31
|
-
theme,
|
|
32
|
-
'colors.surface'
|
|
33
|
-
)}), ${alpha(
|
|
34
|
-
'on.surface',
|
|
35
|
-
get(theme, `paper.overlays.${backgroundOverlay}`) || 0
|
|
36
|
-
)(theme)}`,
|
|
37
|
-
backgroundBlendMode: 'overlay',
|
|
38
|
-
backgroundRepeat: 'no-repeat',
|
|
50
|
+
...getBackgroundOverlay(theme, backgroundOverlay),
|
|
39
51
|
},
|
|
40
52
|
};
|
|
41
53
|
}
|