@capillarytech/blaze-ui 0.1.6-alpha.36 → 0.1.6-alpha.37

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.
@@ -8,7 +8,7 @@ import uploadIcon from '../assets/upload.svg';
8
8
 
9
9
  import { InfoCircleOutlined, SearchOutlined, WarningFilled, DownOutlined } from '@ant-design/icons';
10
10
 
11
- import withStyles from '../../utils/withStyles'; // Updated import path
11
+ import withStyles from '../utils/withStyles';
12
12
  import { SelectWrapper, HeaderWrapper, selectStyles } from './styles';
13
13
 
14
14
  const CapUnifiedSelect = ({
package/index.js CHANGED
@@ -13,4 +13,4 @@ export * as styledVars from './styled/variables';
13
13
  export { default as styled } from './styled';
14
14
 
15
15
  // Export utils
16
- export * as Utils from '../utils';
16
+ export * as Utils from './utils';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/blaze-ui",
3
3
  "author": "Capillary Technologies",
4
- "version": "0.1.6-alpha.36",
4
+ "version": "0.1.6-alpha.37",
5
5
  "description": "Capillary UI component library with Ant Design v5",
6
6
  "main": "./index.js",
7
7
  "sideEffects": [
package/utils/index.js ADDED
@@ -0,0 +1 @@
1
+ export { default as withStyles } from './withStyles';
@@ -0,0 +1,24 @@
1
+ import styled from 'styled-components';
2
+
3
+ /**
4
+ * Enhances a React component with additional styles using styled-components.
5
+ * @param {React.ComponentType} WrappedComponent - The React component to enhance.
6
+ * @param {TemplateStringsArray} styles - CSS styles as a TemplateStringsArray.
7
+ * @returns {React.ComponentType} Returns the enhanced styled component.
8
+ */
9
+ const withStyledComponent = (WrappedComponent, styles) => {
10
+ /**
11
+ * A styled component generated by combining WrappedComponent with additional styles.
12
+ * @type {React.ComponentType}
13
+ */
14
+ const StyledComponent = styled(WrappedComponent)`
15
+ ${styles};
16
+ `;
17
+
18
+ // Set default props from the original component to the styled component
19
+ StyledComponent.defaultProps = WrappedComponent.defaultProps;
20
+
21
+ return StyledComponent;
22
+ };
23
+
24
+ export default withStyledComponent;