@vitus-labs/coolgrid 2.6.1 → 2.6.2

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/index.js CHANGED
@@ -42,14 +42,13 @@ var RowContext_default = createContext({});
42
42
 
43
43
  //#endregion
44
44
  //#region src/useContext.tsx
45
- const pickThemeProps = (props, keywords) => pick(props, keywords);
46
45
  const getGridContext = (props = {}, theme = {}) => ({
47
- columns: get(props, "columns") || get(theme, "grid.columns") || get(theme, "coolgrid.columns"),
48
- containerWidth: get(props, "width") || get(theme, "grid.container") || get(theme, "coolgrid.container")
46
+ columns: props.columns || get(theme, "grid.columns") || get(theme, "coolgrid.columns"),
47
+ containerWidth: props.width || get(theme, "grid.container") || get(theme, "coolgrid.container")
49
48
  });
50
49
  const useGridContext = (props) => {
51
50
  const { theme } = useContext(context);
52
- const stableCtxProps = useStableValue(pickThemeProps(props, CONTEXT_KEYS));
51
+ const stableCtxProps = useStableValue(pick(props, CONTEXT_KEYS));
53
52
  return useMemo(() => {
54
53
  return {
55
54
  ...getGridContext(stableCtxProps, theme),
@@ -42,14 +42,13 @@ var RowContext_default = createContext({});
42
42
 
43
43
  //#endregion
44
44
  //#region src/useContext.tsx
45
- const pickThemeProps = (props, keywords) => pick(props, keywords);
46
45
  const getGridContext = (props = {}, theme = {}) => ({
47
- columns: get(props, "columns") || get(theme, "grid.columns") || get(theme, "coolgrid.columns"),
48
- containerWidth: get(props, "width") || get(theme, "grid.container") || get(theme, "coolgrid.container")
46
+ columns: props.columns || get(theme, "grid.columns") || get(theme, "coolgrid.columns"),
47
+ containerWidth: props.width || get(theme, "grid.container") || get(theme, "coolgrid.container")
49
48
  });
50
49
  const useGridContext = (props) => {
51
50
  const { theme } = useContext(context);
52
- const stableCtxProps = useStableValue(pickThemeProps(props, CONTEXT_KEYS));
51
+ const stableCtxProps = useStableValue(pick(props, CONTEXT_KEYS));
53
52
  return useMemo(() => {
54
53
  return {
55
54
  ...getGridContext(stableCtxProps, theme),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/coolgrid",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -61,8 +61,8 @@
61
61
  "typecheck": "tsc --noEmit"
62
62
  },
63
63
  "peerDependencies": {
64
- "@vitus-labs/core": "^2.6.1",
65
- "@vitus-labs/unistyle": "^2.6.1",
64
+ "@vitus-labs/core": "^2.6.2",
65
+ "@vitus-labs/unistyle": "^2.6.2",
66
66
  "react": ">= 19",
67
67
  "react-native": ">= 0.76"
68
68
  },