@open-pioneer/react-utils 4.5.0-dev-css-prop.20260210115456 → 4.5.0-dev-css-prop.20260210120105

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @open-pioneer/react-utils
2
2
 
3
- ## 4.5.0-dev-css-prop.20260210115456
3
+ ## 4.5.0-dev-css-prop.20260210120105
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -24,8 +24,8 @@
24
24
  ### Patch Changes
25
25
 
26
26
  - Updated dependencies [4e76893]
27
- - @open-pioneer/core@4.5.0-dev-css-prop.20260210115456
28
- - @open-pioneer/reactivity@4.5.0-dev-css-prop.20260210115456
27
+ - @open-pioneer/core@4.5.0-dev-css-prop.20260210120105
28
+ - @open-pioneer/reactivity@4.5.0-dev-css-prop.20260210120105
29
29
 
30
30
  ## 4.4.0
31
31
 
@@ -7,7 +7,7 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
7
7
  * If multiple `css` objects are defined, their values are combined into an array.
8
8
  * This way, multiple css rules may match and will not override each other.
9
9
  */
10
- export declare function mergeChakraProps<T extends Record<string, unknown>>(...args: T[]): Omit<UnionToIntersection<T>, "css"> & {
10
+ export declare function mergeChakraProps<T extends {}>(...args: T[]): Omit<UnionToIntersection<T>, "css"> & {
11
11
  css?: SystemStyleObject | SystemStyleObject[];
12
12
  };
13
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"mergeChakraProps.js","sources":["mergeChakraProps.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { mergeProps, SystemStyleObject } from \"@chakra-ui/react\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void\n ? I\n : never;\n\n/**\n * Merges multiple `props` objects from left to right.\n *\n * This function works like Chakra's {@link mergeProps}, but has additional support for Chakra's `css` property.\n * If multiple `css` objects are defined, their values are combined into an array.\n * This way, multiple css rules may match and will not override each other.\n */\nexport function mergeChakraProps<T extends Record<string, unknown>>(\n ...args: T[]\n): Omit<UnionToIntersection<T>, \"css\"> & { css?: SystemStyleObject | SystemStyleObject[] } {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const mergedProps = mergeProps(...args) as Record<string, any>;\n\n // mergeProps handles plain html attributes only; merge chakra css on our own.\n let mergedCss: SystemStyleObject | SystemStyleObject[] | undefined;\n for (const props of args) {\n const localCss = props.css as SystemStyleObject | SystemStyleObject[] | undefined;\n if (!localCss || typeof localCss !== \"object\") {\n continue;\n }\n\n if (!mergedCss) {\n if (Array.isArray(localCss)) {\n mergedCss = [...localCss];\n } else {\n mergedCss = localCss;\n }\n } else if (!Array.isArray(mergedCss)) {\n mergedCss = [mergedCss, ...wrap(localCss)];\n } else {\n mergedCss.push(...wrap(localCss));\n }\n }\n if (mergedCss) {\n mergedProps.css = mergedCss;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return mergedProps as any;\n}\n\nfunction wrap<T>(v: T | T[]): T[] {\n if (Array.isArray(v)) {\n return v;\n }\n return [v];\n}\n"],"names":[],"mappings":";;AAgBO,SAAS,oBACT,IAAA,EACoF;AAEvF,EAAA,MAAM,WAAA,GAAc,UAAA,CAAW,GAAG,IAAI,CAAA;AAGtC,EAAA,IAAI,SAAA;AACJ,EAAA,KAAA,MAAW,SAAS,IAAA,EAAM;AACtB,IAAA,MAAM,WAAW,KAAA,CAAM,GAAA;AACvB,IAAA,IAAI,CAAC,QAAA,IAAY,OAAO,QAAA,KAAa,QAAA,EAAU;AAC3C,MAAA;AAAA,IACJ;AAEA,IAAA,IAAI,CAAC,SAAA,EAAW;AACZ,MAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACzB,QAAA,SAAA,GAAY,CAAC,GAAG,QAAQ,CAAA;AAAA,MAC5B,CAAA,MAAO;AACH,QAAA,SAAA,GAAY,QAAA;AAAA,MAChB;AAAA,IACJ,CAAA,MAAA,IAAW,CAAC,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA,EAAG;AAClC,MAAA,SAAA,GAAY,CAAC,SAAA,EAAW,GAAG,IAAA,CAAK,QAAQ,CAAC,CAAA;AAAA,IAC7C,CAAA,MAAO;AACH,MAAA,SAAA,CAAU,IAAA,CAAK,GAAG,IAAA,CAAK,QAAQ,CAAC,CAAA;AAAA,IACpC;AAAA,EACJ;AACA,EAAA,IAAI,SAAA,EAAW;AACX,IAAA,WAAA,CAAY,GAAA,GAAM,SAAA;AAAA,EACtB;AAEA,EAAA,OAAO,WAAA;AACX;AAEA,SAAS,KAAQ,CAAA,EAAiB;AAC9B,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA,EAAG;AAClB,IAAA,OAAO,CAAA;AAAA,EACX;AACA,EAAA,OAAO,CAAC,CAAC,CAAA;AACb;;;;"}
1
+ {"version":3,"file":"mergeChakraProps.js","sources":["mergeChakraProps.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { mergeProps, SystemStyleObject } from \"@chakra-ui/react\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void\n ? I\n : never;\n\n/**\n * Merges multiple `props` objects from left to right.\n *\n * This function works like Chakra's {@link mergeProps}, but has additional support for Chakra's `css` property.\n * If multiple `css` objects are defined, their values are combined into an array.\n * This way, multiple css rules may match and will not override each other.\n */\nexport function mergeChakraProps<T extends {}>(\n ...args: T[]\n): Omit<UnionToIntersection<T>, \"css\"> & { css?: SystemStyleObject | SystemStyleObject[] } {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const mergedProps = mergeProps(...args) as Record<string, any>;\n\n // mergeProps handles plain html attributes only; merge chakra css on our own.\n let mergedCss: SystemStyleObject | SystemStyleObject[] | undefined;\n for (const props of args) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const localCss = (props as any).css as SystemStyleObject | SystemStyleObject[] | undefined;\n if (!localCss || typeof localCss !== \"object\") {\n continue;\n }\n\n if (!mergedCss) {\n if (Array.isArray(localCss)) {\n mergedCss = [...localCss];\n } else {\n mergedCss = localCss;\n }\n } else if (!Array.isArray(mergedCss)) {\n mergedCss = [mergedCss, ...wrap(localCss)];\n } else {\n mergedCss.push(...wrap(localCss));\n }\n }\n if (mergedCss) {\n mergedProps.css = mergedCss;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return mergedProps as any;\n}\n\nfunction wrap<T>(v: T | T[]): T[] {\n if (Array.isArray(v)) {\n return v;\n }\n return [v];\n}\n"],"names":[],"mappings":";;AAgBO,SAAS,oBACT,IAAA,EACoF;AAEvF,EAAA,MAAM,WAAA,GAAc,UAAA,CAAW,GAAG,IAAI,CAAA;AAGtC,EAAA,IAAI,SAAA;AACJ,EAAA,KAAA,MAAW,SAAS,IAAA,EAAM;AAEtB,IAAA,MAAM,WAAY,KAAA,CAAc,GAAA;AAChC,IAAA,IAAI,CAAC,QAAA,IAAY,OAAO,QAAA,KAAa,QAAA,EAAU;AAC3C,MAAA;AAAA,IACJ;AAEA,IAAA,IAAI,CAAC,SAAA,EAAW;AACZ,MAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACzB,QAAA,SAAA,GAAY,CAAC,GAAG,QAAQ,CAAA;AAAA,MAC5B,CAAA,MAAO;AACH,QAAA,SAAA,GAAY,QAAA;AAAA,MAChB;AAAA,IACJ,CAAA,MAAA,IAAW,CAAC,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA,EAAG;AAClC,MAAA,SAAA,GAAY,CAAC,SAAA,EAAW,GAAG,IAAA,CAAK,QAAQ,CAAC,CAAA;AAAA,IAC7C,CAAA,MAAO;AACH,MAAA,SAAA,CAAU,IAAA,CAAK,GAAG,IAAA,CAAK,QAAQ,CAAC,CAAA;AAAA,IACpC;AAAA,EACJ;AACA,EAAA,IAAI,SAAA,EAAW;AACX,IAAA,WAAA,CAAY,GAAA,GAAM,SAAA;AAAA,EACtB;AAEA,EAAA,OAAO,WAAA;AACX;AAEA,SAAS,KAAQ,CAAA,EAAiB;AAC9B,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA,EAAG;AAClB,IAAA,OAAO,CAAA;AAAA,EACX;AACA,EAAA,OAAO,CAAC,CAAC,CAAA;AACb;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/react-utils",
4
- "version": "4.5.0-dev-css-prop.20260210115456",
4
+ "version": "4.5.0-dev-css-prop.20260210120105",
5
5
  "description": "Contains common react utilities used by the open pioneer trails project",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -18,8 +18,8 @@
18
18
  "@conterra/reactivity-core": "^0.8.1",
19
19
  "classnames": "^2.5.1",
20
20
  "react": "^19.2.4",
21
- "@open-pioneer/core": "4.5.0-dev-css-prop.20260210115456",
22
- "@open-pioneer/reactivity": "4.5.0-dev-css-prop.20260210115456"
21
+ "@open-pioneer/core": "4.5.0-dev-css-prop.20260210120105",
22
+ "@open-pioneer/reactivity": "4.5.0-dev-css-prop.20260210120105"
23
23
  },
24
24
  "exports": {
25
25
  "./package.json": "./package.json",