d2coreui 23.0.35 → 23.0.36

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.
@@ -4,6 +4,7 @@ type WithCssChildren<T extends BaseReturnType> = (css: ReturnStyles<T>) => any;
4
4
  interface WithCssProperties<T extends BaseReturnType> {
5
5
  children: WithCssChildren<T>;
6
6
  useStyles: (props?: any) => ReturnStyles<T>;
7
+ props?: any;
7
8
  }
8
- export default function WithCss<T extends BaseReturnType>({ useStyles, children }: WithCssProperties<T>): any;
9
+ export default function WithCss<T extends BaseReturnType>({ useStyles, children, props }: WithCssProperties<T>): any;
9
10
  export {};
@@ -1,5 +1,9 @@
1
- export default function WithCss({ useStyles, children }) {
2
- const css = useStyles();
1
+ import { useContext } from "react";
2
+ import { SpaceCompactItemContext } from "antd/es/space/Compact";
3
+ export default function WithCss({ useStyles, children, props }) {
4
+ const contextSize = useContext(SpaceCompactItemContext);
5
+ const mergedSize = (props === null || props === void 0 ? void 0 : props.size) || (contextSize === null || contextSize === void 0 ? void 0 : contextSize.compactSize) || 'default';
6
+ const css = useStyles(Object.assign(Object.assign({}, props), { size: mergedSize }));
3
7
  return children(css);
4
8
  }
5
9
  ;
@@ -1 +1 @@
1
- {"version":3,"file":"withCss.js","sourceRoot":"","sources":["../../../../components/style/withCss.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,CAA4B,EAAC,SAAS,EAAE,QAAQ,EAAsB;IACjG,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAAA,CAAC","sourcesContent":["import {BaseReturnType} from 'antd-style';\r\nimport {ReturnStyles} from \"antd-style/lib/factories/createStyles/types\";\r\n\r\ntype WithCssChildren<T extends BaseReturnType> = (css: ReturnStyles<T>) => any;\r\n\r\ninterface WithCssProperties<T extends BaseReturnType> {\r\n children: WithCssChildren<T>;\r\n useStyles: (props?:any) => ReturnStyles<T>\r\n}\r\n\r\nexport default function WithCss<T extends BaseReturnType> ({useStyles, children}:WithCssProperties<T>) {\r\n const css = useStyles();\r\n return children(css);\r\n};"]}
1
+ {"version":3,"file":"withCss.js","sourceRoot":"","sources":["../../../../components/style/withCss.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACjC,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAU9D,MAAM,CAAC,OAAO,UAAU,OAAO,CAA4B,EAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAsB;IACxG,MAAM,WAAW,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,CAAA,IAAI,SAAS,CAAC;IACxE,MAAM,GAAG,GAAG,SAAS,iCAAK,KAAK,KAAE,IAAI,EAAE,UAAU,IAAE,CAAC;IACpD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAAA,CAAC","sourcesContent":["import {BaseReturnType} from 'antd-style';\r\nimport {ReturnStyles} from \"antd-style/lib/factories/createStyles/types\";\r\nimport {useContext} from \"react\";\r\nimport {SpaceCompactItemContext} from \"antd/es/space/Compact\";\r\n\r\ntype WithCssChildren<T extends BaseReturnType> = (css: ReturnStyles<T>) => any;\r\n\r\ninterface WithCssProperties<T extends BaseReturnType> {\r\n children: WithCssChildren<T>;\r\n useStyles: (props?:any) => ReturnStyles<T>\r\n props?: any;\r\n}\r\n\r\nexport default function WithCss<T extends BaseReturnType> ({useStyles, children, props}:WithCssProperties<T>) {\r\n const contextSize = useContext(SpaceCompactItemContext);\r\n const mergedSize = props?.size || contextSize?.compactSize || 'default';\r\n const css = useStyles({...props, size: mergedSize});\r\n return children(css);\r\n};"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d2coreui",
3
- "version": "23.0.35",
3
+ "version": "23.0.36",
4
4
  "description": "Core UI components and utilities library.",
5
5
  "author": "Ipesoft s.r.o.",
6
6
  "license": "MIT",