@basic-ui/material 1.0.0-alpha.12 → 1.0.0-alpha.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basic-ui/material",
3
- "version": "1.0.0-alpha.12",
3
+ "version": "1.0.0-alpha.15",
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",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "run -T concurrently \"yarn:build:*\"",
18
18
  "build:dts": "run -T tsc -p ./tsconfig-build.json --isolatedModules false --declaration --emitDeclarationOnly",
19
- "build:cjs": "run -T rollup -c ../../rollup.config.js",
19
+ "build:cjs": "run -T cross-env NODE_ENV=production rollup -c ../../rollup.config.js",
20
20
  "build:esm": "run -T cross-env NODE_ENV=production BABEL_ENV=esm run -T babel --config-file ../../babel.config.js ./src --extensions \".ts,.tsx,.js,.jsx\" --source-maps --out-dir ./build/esm --ignore \"**/*.story.tsx,**/*.story.ts,**/*.test.tsx,**/*.test.ts\"",
21
21
  "build-storybook": "run -T build-storybook -c ./scripts/storybook -o .out",
22
22
  "lint": "run -T eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
@@ -27,8 +27,8 @@
27
27
  "test": "echo \"Error: no test specified\" && exit 1"
28
28
  },
29
29
  "dependencies": {
30
- "@basic-ui/core": "^0.0.42",
31
- "@basic-ui/dynamic-theme": "^0.0.2",
30
+ "@basic-ui/core": "^0.0.43",
31
+ "@basic-ui/dynamic-theme": "^0.0.5",
32
32
  "@styled-system/should-forward-prop": "5.1.5",
33
33
  "@types/styled-system": "^5.1.10",
34
34
  "@types/styled-system__css": "^5.0.14",
@@ -36,7 +36,7 @@
36
36
  "styled-system": "^5.1.5"
37
37
  },
38
38
  "devDependencies": {
39
- "@basic-ui/color-picker": "^0.0.9",
39
+ "@basic-ui/color-picker": "^0.0.10",
40
40
  "@emotion/react": "11.9.0",
41
41
  "@emotion/styled": "11.8.1",
42
42
  "@material/material-color-utilities": "0.1.1",
@@ -52,5 +52,5 @@
52
52
  "react": "^16.14.0 || ^17.0.0 || ^18.0.0",
53
53
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0"
54
54
  },
55
- "gitHead": "ccb278c4188123480cffa3a1df5f04eed38b911e"
55
+ "gitHead": "1bf6a5a0f35cfa0ae1cfac346b0bb10d4d00931f"
56
56
  }
@@ -3,9 +3,9 @@ import { rem } from 'polished';
3
3
  import type { ReactElement } from 'react';
4
4
  import { cloneElement, forwardRef, useRef } from 'react';
5
5
  import {
6
- DARK_THEME_CLASS,
7
- DEFAULT_THEME_CLASS,
8
- useColorMode,
6
+ DARK_SCHEME_CLASS,
7
+ LIGHT_SCHEME_CLASS,
8
+ useColorScheme,
9
9
  } from '@basic-ui/dynamic-theme';
10
10
 
11
11
  import { Box } from '../Box';
@@ -22,7 +22,7 @@ export interface SnackbarProps extends PaperProps {
22
22
 
23
23
  export const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(
24
24
  function Snackbar(props, forwardedRef) {
25
- const { colorMode } = useColorMode();
25
+ const { colorScheme } = useColorScheme();
26
26
  const ref = useRef<HTMLDivElement | null>(null);
27
27
  const {
28
28
  __css,
@@ -44,7 +44,7 @@ export const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(
44
44
  elevation={4}
45
45
  darkThemeBackgroundOverlay={4}
46
46
  className={
47
- colorMode === 'default' ? DARK_THEME_CLASS : DEFAULT_THEME_CLASS
47
+ colorScheme === 'light' ? DARK_SCHEME_CLASS : LIGHT_SCHEME_CLASS
48
48
  }
49
49
  ref={assignMultipleRefs(forwardedRef, ref)}
50
50
  __css={{
@@ -8,7 +8,7 @@ import {
8
8
  import type { Color } from '@basic-ui/color-picker';
9
9
  import { toColor } from '@basic-ui/color-picker';
10
10
  import {
11
- THEME_OVERRIDE_KEY,
11
+ THEME_OVERRIDE_STORAGE_KEY,
12
12
  injectThemeOverride,
13
13
  transformTheme,
14
14
  } from '@basic-ui/dynamic-theme';
@@ -89,7 +89,10 @@ const ThemeBuilderImpl = (props: ThemeBuilderProps) => {
89
89
  [scheme]
90
90
  );
91
91
  useEffect(() => {
92
- localStorage.setItem(THEME_OVERRIDE_KEY, JSON.stringify({ colorModes }));
92
+ localStorage.setItem(
93
+ THEME_OVERRIDE_STORAGE_KEY,
94
+ JSON.stringify({ colorModes })
95
+ );
93
96
  injectThemeOverride({ colorModes });
94
97
  }, [colorModes]);
95
98
 
package/src/color.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { SystemStyleObject } from '@styled-system/css';
2
2
  import { get } from '@styled-system/css';
3
3
  import { parseToRgb } from 'polished';
4
- import { DARK_THEME_CLASS } from '@basic-ui/dynamic-theme';
4
+ import { DARK_SCHEME_CLASS } from '@basic-ui/dynamic-theme';
5
5
 
6
6
  import type { Theme } from './theme';
7
7
 
@@ -74,7 +74,7 @@ export function getDarkThemeBackgroundOverlay(
74
74
  }
75
75
 
76
76
  return {
77
- [`.${DARK_THEME_CLASS} &, &.${DARK_THEME_CLASS}`]: {
77
+ [`.${DARK_SCHEME_CLASS} &, &.${DARK_SCHEME_CLASS}`]: {
78
78
  ...getBackgroundOverlay(theme, backgroundOverlay, overlayColor),
79
79
  },
80
80
  };