@basic-ui/material 0.1.2 → 0.1.6
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 +18 -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/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/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/CheckBoxIcon.d.ts +1 -1
- package/build/esm/Chip/ChipBase.d.ts +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- 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/Paper/Paper.d.ts +1 -1
- package/build/esm/Select/SelectIcon.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/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/color.d.ts +3 -2
- package/build/esm/color.js +13 -5
- package/build/esm/color.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +220 -113
- package/package.json +4 -5
- package/src/BottomSheet/BottomSheetSurface.tsx +1 -1
- package/src/Dialog/DialogSurface.tsx +2 -1
- package/src/color.ts +24 -12
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basic-ui/material",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Accessible React Components used as building blocks for UI patterns",
|
|
5
5
|
"author": "Lucas Terra <lucasterra7@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"private": false,
|
|
8
7
|
"main": "./build/cjs/index.js",
|
|
9
8
|
"module": "./build/esm/index.js",
|
|
10
9
|
"jsnext:main": "./build/esm/index.js",
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
],
|
|
16
15
|
"sideEffects": false,
|
|
17
16
|
"scripts": {
|
|
18
|
-
"start": "start-storybook -p 9001 -c ./scripts/storybook",
|
|
17
|
+
"start": "yarn run -T start-storybook -p 9001 -c ./scripts/storybook",
|
|
19
18
|
"build": "concurrently \"yarn:build:*\"",
|
|
20
19
|
"build:dts": "tsc -p ./tsconfig.json --isolatedModules false --declaration --emitDeclarationOnly",
|
|
21
20
|
"build:cjs": "rollup -c ../../rollup.config.js",
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
|
-
"@basic-ui/core": "^0.0.
|
|
28
|
+
"@basic-ui/core": "^0.0.33",
|
|
30
29
|
"@styled-system/should-forward-prop": "5.1.5",
|
|
31
30
|
"@types/styled-system": "^5.1.10",
|
|
32
31
|
"@types/styled-system__css": "^5.0.14",
|
|
@@ -50,5 +49,5 @@
|
|
|
50
49
|
"react-dom": ">=16.14.0 || >=17.0.0",
|
|
51
50
|
"react-spring": "^9.0.0"
|
|
52
51
|
},
|
|
53
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "5aa740f6686e8ed8b633d4e0d173a6dd91d28bef"
|
|
54
53
|
}
|
|
@@ -22,8 +22,9 @@ export const DialogSurface = forwardRef<HTMLDivElement, DialogSurfaceProps>(
|
|
|
22
22
|
as={Paper}
|
|
23
23
|
theme={theme}
|
|
24
24
|
elevation={24}
|
|
25
|
-
backgroundColor="surface"
|
|
26
25
|
__css={{
|
|
26
|
+
position: 'relative',
|
|
27
|
+
bg: 'surface',
|
|
27
28
|
borderRadius: rem(8),
|
|
28
29
|
width: '100%',
|
|
29
30
|
maxWidth: rem(600),
|
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
|
}
|