@vitus-labs/coolgrid 2.6.2 → 2.7.0

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
@@ -1,6 +1,6 @@
1
- import { ALIGN_CONTENT_MAP_X, Provider, context, extendCss, makeItResponsive, value } from "@vitus-labs/unistyle";
1
+ import { ALIGN_CONTENT_MAP_X, Provider, extendCss, makeItResponsive, value } from "@vitus-labs/unistyle";
2
2
  import { createContext, useContext, useMemo } from "react";
3
- import { config, get, omit, pick, useStableValue } from "@vitus-labs/core";
3
+ import { config, context, get, omit, pick, useStableValue } from "@vitus-labs/core";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/constants.ts
@@ -59,6 +59,7 @@ const useGridContext = (props) => {
59
59
 
60
60
  //#endregion
61
61
  //#region src/utils.ts
62
+ const CONTEXT_KEYS_SET = new Set(CONTEXT_KEYS);
62
63
  /** Checks whether a value is a finite number. */
63
64
  const isNumber = (value) => Number.isFinite(value);
64
65
  /** Checks whether a value is a finite number greater than zero. */
@@ -68,7 +69,7 @@ const hasValue = (value) => isNumber(value) && value > 0;
68
69
  * size is undefined (auto) or a non-zero number. Size 0 hides the column.
69
70
  */
70
71
  const isVisible = (value) => isNumber(value) && value !== 0 || value === void 0;
71
- const omitCtxKeys = (props) => omit(props, CONTEXT_KEYS);
72
+ const omitCtxKeys = (props) => omit(props, CONTEXT_KEYS_SET);
72
73
 
73
74
  //#endregion
74
75
  //#region src/Col/styled.ts
@@ -102,11 +103,6 @@ const spacingStyles$1 = (type, param, rootSize) => {
102
103
  ${`${type}: ${value(param / 2, rootSize)}`};
103
104
  `;
104
105
  };
105
- /**
106
- * Main responsive style block for Col. When the column is visible, applies
107
- * width, padding, margin, and extra CSS. When hidden (size === 0), moves
108
- * the element off-screen with fixed positioning.
109
- */
110
106
  const styles$2 = ({ theme, css, rootSize }) => {
111
107
  const { size, columns, gap, padding, extraStyles, RNparentWidth } = theme;
112
108
  if (isVisible(size)) return css`
@@ -1,6 +1,6 @@
1
- import { ALIGN_CONTENT_MAP_X, Provider, context, extendCss, makeItResponsive, value } from "@vitus-labs/unistyle";
1
+ import { ALIGN_CONTENT_MAP_X, Provider, extendCss, makeItResponsive, value } from "@vitus-labs/unistyle";
2
2
  import { createContext, useCallback, useContext, useMemo, useState } from "react";
3
- import { config, get, omit, pick, useStableValue } from "@vitus-labs/core";
3
+ import { config, context, get, omit, pick, useStableValue } from "@vitus-labs/core";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/constants.ts
@@ -59,6 +59,7 @@ const useGridContext = (props) => {
59
59
 
60
60
  //#endregion
61
61
  //#region src/utils.ts
62
+ const CONTEXT_KEYS_SET = new Set(CONTEXT_KEYS);
62
63
  /** Checks whether a value is a finite number. */
63
64
  const isNumber = (value) => Number.isFinite(value);
64
65
  /** Checks whether a value is a finite number greater than zero. */
@@ -68,7 +69,7 @@ const hasValue = (value) => isNumber(value) && value > 0;
68
69
  * size is undefined (auto) or a non-zero number. Size 0 hides the column.
69
70
  */
70
71
  const isVisible = (value) => isNumber(value) && value !== 0 || value === void 0;
71
- const omitCtxKeys = (props) => omit(props, CONTEXT_KEYS);
72
+ const omitCtxKeys = (props) => omit(props, CONTEXT_KEYS_SET);
72
73
 
73
74
  //#endregion
74
75
  //#region src/Col/styled.ts
@@ -102,11 +103,6 @@ const spacingStyles$1 = (type, param, rootSize) => {
102
103
  ${`${type}: ${value(param / 2, rootSize)}`};
103
104
  `;
104
105
  };
105
- /**
106
- * Main responsive style block for Col. When the column is visible, applies
107
- * width, padding, margin, and extra CSS. When hidden (size === 0), moves
108
- * the element off-screen with fixed positioning.
109
- */
110
106
  const styles$2 = ({ theme, css, rootSize }) => {
111
107
  const { size, columns, gap, padding, extraStyles, RNparentWidth } = theme;
112
108
  if (isVisible(size)) return css`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/coolgrid",
3
- "version": "2.6.2",
3
+ "version": "2.7.0",
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.2",
65
- "@vitus-labs/unistyle": "^2.6.2",
64
+ "@vitus-labs/core": "^2.7.0",
65
+ "@vitus-labs/unistyle": "^2.7.0",
66
66
  "react": ">= 19",
67
67
  "react-native": ">= 0.76"
68
68
  },
@@ -73,9 +73,9 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@vitus-labs/core": "workspace:*",
76
- "@vitus-labs/tools-rolldown": "2.3.1",
77
- "@vitus-labs/tools-storybook": "2.3.1",
78
- "@vitus-labs/tools-typescript": "2.3.1",
76
+ "@vitus-labs/tools-rolldown": "2.5.0",
77
+ "@vitus-labs/tools-storybook": "2.5.0",
78
+ "@vitus-labs/tools-typescript": "2.5.0",
79
79
  "@vitus-labs/unistyle": "workspace:*",
80
80
  "react-native": ">=0.84.1"
81
81
  }