@geee-be/react-utils 1.1.2 → 1.1.4

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,5 +1,17 @@
1
1
  # @geee-be/react-utils
2
2
 
3
+ ## 1.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 464eb24: Trial sub components with Card
8
+
9
+ ## 1.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - b5d137c: Add Carousel
14
+
3
15
  ## 1.1.2
4
16
 
5
17
  ### Patch Changes
@@ -1 +1,2 @@
1
1
  export * from './ripple.js';
2
+ export * from './sub-component.js';
@@ -3,7 +3,6 @@ export const createRipple = (event) => {
3
3
  const element = event.currentTarget;
4
4
  if (!element || !(element instanceof HTMLElement))
5
5
  return;
6
- element.style.position = 'relative';
7
6
  element.style.overflow = 'hidden';
8
7
  const rect = element.getBoundingClientRect();
9
8
  const radius = findFurthestPoint(event.clientX, element.offsetWidth, rect.left, event.clientY, element.offsetHeight, rect.top);
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const withSubComponents = (RootComponent, subComponents) => Object.assign(forwardRef((props, ref) => (_jsx(RootComponent, { ...props, ref: ref }))), subComponents);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geee-be/react-utils",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -1 +1,2 @@
1
1
  export * from './ripple.js';
2
+ export * from './sub-component.js';
@@ -6,7 +6,6 @@ export const createRipple: MouseEventHandler<HTMLElement> = (event) => {
6
6
  const element = event.currentTarget;
7
7
  if (!element || !(element instanceof HTMLElement)) return;
8
8
 
9
- element.style.position = 'relative';
10
9
  element.style.overflow = 'hidden';
11
10
 
12
11
  const rect = element.getBoundingClientRect();
@@ -0,0 +1,12 @@
1
+ import { type ComponentType, forwardRef } from 'react';
2
+
3
+ export const withSubComponents = <P extends {}, S>(
4
+ RootComponent: ComponentType<P>,
5
+ subComponents: S,
6
+ ) =>
7
+ Object.assign(
8
+ forwardRef<unknown, P>((props: any, ref: any) => (
9
+ <RootComponent {...props} ref={ref} />
10
+ )),
11
+ subComponents,
12
+ );