@mediamonks/react-kit 1.0.3 → 2.0.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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="gsap/types/split-text.js" />
1
2
  import SplitText from 'gsap/SplitText';
2
3
  import { type ComponentProps, type ReactElement, type RefAttributes } from 'react';
3
4
  /**
@@ -1,4 +1,5 @@
1
1
  import gsap from 'gsap';
2
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2
3
  import ScrollTrigger from 'gsap/ScrollTrigger';
3
4
  import { useEffect, useRef } from 'react';
4
5
  import { animations } from '../../animations.js';
package/dist/gsap.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from './gsap/components/SplitTextWrapper/SplitTextWrapper.js';
2
+ export * from './gsap/hooks/useAnimation/useAnimation.js';
3
+ export * from './gsap/hooks/useExposeAnimation/useExposeAnimation.js';
4
+ export * from './gsap/hooks/useExposedAnimation/useExposedAnimation.js';
5
+ export * from './gsap/hooks/useExposedAnimations/useExposedAnimations.js';
6
+ export * from './gsap/hooks/useFlip/useFlip.js';
7
+ export * from './gsap/hooks/useScrollAnimation/useScrollAnimation.js';
8
+ export * from './gsap/utils/getAnimation/getAnimation.js';
package/dist/gsap.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from './gsap/components/SplitTextWrapper/SplitTextWrapper.js';
2
+ export * from './gsap/hooks/useAnimation/useAnimation.js';
3
+ export * from './gsap/hooks/useExposeAnimation/useExposeAnimation.js';
4
+ export * from './gsap/hooks/useExposedAnimation/useExposedAnimation.js';
5
+ export * from './gsap/hooks/useExposedAnimations/useExposedAnimations.js';
6
+ export * from './gsap/hooks/useFlip/useFlip.js';
7
+ export * from './gsap/hooks/useScrollAnimation/useScrollAnimation.js';
8
+ export * from './gsap/utils/getAnimation/getAnimation.js';
package/dist/index.d.ts CHANGED
@@ -1,13 +1,5 @@
1
1
  export * from './components/AutoAdjustFontSize/AutoAdjustFontSize.js';
2
2
  export * from './components/AutoFill/AutoFill.js';
3
- export * from './gsap/components/SplitTextWrapper/SplitTextWrapper.js';
4
- export * from './gsap/hooks/useAnimation/useAnimation.js';
5
- export * from './gsap/hooks/useExposeAnimation/useExposeAnimation.js';
6
- export * from './gsap/hooks/useExposedAnimation/useExposedAnimation.js';
7
- export * from './gsap/hooks/useExposedAnimations/useExposedAnimations.js';
8
- export * from './gsap/hooks/useFlip/useFlip.js';
9
- export * from './gsap/hooks/useScrollAnimation/useScrollAnimation.js';
10
- export * from './gsap/utils/getAnimation/getAnimation.js';
11
3
  export * from './hocs/ensuredForwardRef/ensuredForwardRef.js';
12
4
  export * from './hooks/useClientSideValue/useClientSideValue.js';
13
5
  export * from './hooks/useContentRect/useContentRect.js';
@@ -31,18 +23,18 @@ export * from './hooks/useRefs/utils/validateAndUnwrapRefs/validateAndUnwrapRefs
31
23
  export * from './hooks/useResizeObserver/useResizeObserver.js';
32
24
  export * from './hooks/useStaticValue/useStaticValue.js';
33
25
  export * from './hooks/useToggle/useToggle.js';
26
+ export * from './lifecycle/components/CrossFlow/CrossFlow.js';
27
+ export * from './lifecycle/components/TransitionPresence/TransitionPresence.context.js';
28
+ export * from './lifecycle/components/TransitionPresence/TransitionPresence.js';
34
29
  export * from './lifecycle/hooks/useBeforeMount/useBeforeMount.js';
30
+ export * from './lifecycle/hooks/useBeforeUnmount/useBeforeUnmount.js';
35
31
  export * from './lifecycle/hooks/useIsMounted/useIsMounted.js';
36
32
  export * from './lifecycle/hooks/useIsMountedState/useIsMountedState.js';
37
33
  export * from './lifecycle/hooks/useMount/useMount.js';
38
34
  export * from './lifecycle/hooks/useUnmount/useUnmount.js';
39
- export * from './nextjs/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
35
+ export * from './types/PolymorphicComponentProps/PolymorphicComponentProps.js';
40
36
  export * from './utils/adjustFontSize/adjustFontSize.js';
41
37
  export * from './utils/arrayRef/arrayRef.js';
42
38
  export * from './utils/createTimeout/createTimeout.js';
43
39
  export * from './utils/isRefObject/isRefObject.js';
44
40
  export * from './utils/unref/unref.js';
45
- export { CrossFlow } from './lifecycle/components/CrossFlow/CrossFlow.js';
46
- export { TransitionPresenceContext } from './lifecycle/components/TransitionPresence/TransitionPresence.context.js';
47
- export { TransitionPresence } from './lifecycle/components/TransitionPresence/TransitionPresence.js';
48
- export { useBeforeUnmount, type BeforeUnmountCallback, } from './lifecycle/hooks/useBeforeUnmount/useBeforeUnmount.js';
package/dist/index.js CHANGED
@@ -1,14 +1,6 @@
1
1
  /* PLOP_ADD_EXPORT */
2
2
  export * from './components/AutoAdjustFontSize/AutoAdjustFontSize.js';
3
3
  export * from './components/AutoFill/AutoFill.js';
4
- export * from './gsap/components/SplitTextWrapper/SplitTextWrapper.js';
5
- export * from './gsap/hooks/useAnimation/useAnimation.js';
6
- export * from './gsap/hooks/useExposeAnimation/useExposeAnimation.js';
7
- export * from './gsap/hooks/useExposedAnimation/useExposedAnimation.js';
8
- export * from './gsap/hooks/useExposedAnimations/useExposedAnimations.js';
9
- export * from './gsap/hooks/useFlip/useFlip.js';
10
- export * from './gsap/hooks/useScrollAnimation/useScrollAnimation.js';
11
- export * from './gsap/utils/getAnimation/getAnimation.js';
12
4
  export * from './hocs/ensuredForwardRef/ensuredForwardRef.js';
13
5
  export * from './hooks/useClientSideValue/useClientSideValue.js';
14
6
  export * from './hooks/useContentRect/useContentRect.js';
@@ -32,19 +24,18 @@ export * from './hooks/useRefs/utils/validateAndUnwrapRefs/validateAndUnwrapRefs
32
24
  export * from './hooks/useResizeObserver/useResizeObserver.js';
33
25
  export * from './hooks/useStaticValue/useStaticValue.js';
34
26
  export * from './hooks/useToggle/useToggle.js';
27
+ export * from './lifecycle/components/CrossFlow/CrossFlow.js';
28
+ export * from './lifecycle/components/TransitionPresence/TransitionPresence.context.js';
29
+ export * from './lifecycle/components/TransitionPresence/TransitionPresence.js';
35
30
  export * from './lifecycle/hooks/useBeforeMount/useBeforeMount.js';
31
+ export * from './lifecycle/hooks/useBeforeUnmount/useBeforeUnmount.js';
36
32
  export * from './lifecycle/hooks/useIsMounted/useIsMounted.js';
37
33
  export * from './lifecycle/hooks/useIsMountedState/useIsMountedState.js';
38
34
  export * from './lifecycle/hooks/useMount/useMount.js';
39
35
  export * from './lifecycle/hooks/useUnmount/useUnmount.js';
40
- export * from './nextjs/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
36
+ export * from './types/PolymorphicComponentProps/PolymorphicComponentProps.js';
41
37
  export * from './utils/adjustFontSize/adjustFontSize.js';
42
38
  export * from './utils/arrayRef/arrayRef.js';
43
39
  export * from './utils/createTimeout/createTimeout.js';
44
40
  export * from './utils/isRefObject/isRefObject.js';
45
41
  export * from './utils/unref/unref.js';
46
- // Custom exports for external use only
47
- export { CrossFlow } from './lifecycle/components/CrossFlow/CrossFlow.js';
48
- export { TransitionPresenceContext } from './lifecycle/components/TransitionPresence/TransitionPresence.context.js';
49
- export { TransitionPresence } from './lifecycle/components/TransitionPresence/TransitionPresence.js';
50
- export { useBeforeUnmount, } from './lifecycle/hooks/useBeforeUnmount/useBeforeUnmount.js';
@@ -0,0 +1 @@
1
+ export * from './nextjs/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
package/dist/nextjs.js ADDED
@@ -0,0 +1 @@
1
+ export * from './nextjs/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react';
2
+ /**
3
+ * PropsFromAs is a type based on the supplied as prop.
4
+ */
5
+ type PropsFromAs<Type extends ElementType> = {
6
+ as?: Type;
7
+ };
8
+ /**
9
+ * MergeAndOverride is a type that omits type keys from BaseTypes that are also present in OverrideProps.
10
+ */
11
+ type MergeAndOverride<BaseType, OverrideProps> = Omit<BaseType, keyof OverrideProps> & OverrideProps;
12
+ export type PolymorphicRef<Type extends ElementType> = ComponentPropsWithRef<Type>['ref'];
13
+ export type PolymorphicComponentProps<BaseType extends ElementType, OwnProps = Record<string, never>> = PropsWithChildren<MergeAndOverride<ComponentPropsWithoutRef<BaseType>, PropsFromAs<BaseType> & OwnProps>>;
14
+ export type PolymorphicComponentPropsWithRef<BaseType extends ElementType, OwnProps = Record<string, never>> = PolymorphicComponentProps<BaseType, OwnProps> & {
15
+ ref?: PolymorphicRef<BaseType>;
16
+ };
17
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediamonks/react-kit",
3
- "version": "1.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A collection of React hooks, components, utilities that we use at Media.Monks",
5
5
  "keywords": [
6
6
  "react",
@@ -17,7 +17,9 @@
17
17
  "types": "./dist/index.d.ts",
18
18
  "module": "./dist/index.js",
19
19
  "exports": {
20
- ".": "./dist/index.js"
20
+ ".": "./dist/index.js",
21
+ "./gsap": "./dist/gsap.js",
22
+ "./nextjs": "./dist/nextjs.js"
21
23
  },
22
24
  "type": "module",
23
25
  "files": [
@@ -25,8 +27,7 @@
25
27
  "README.md"
26
28
  ],
27
29
  "publishConfig": {
28
- "access": "public",
29
- "provenance": false
30
+ "access": "public"
30
31
  },
31
32
  "scripts": {
32
33
  "build": "npm-run-all -s clean build:*",
@@ -50,56 +51,25 @@
50
51
  "prepare": "husky install"
51
52
  },
52
53
  "prettier": "@mediamonks/prettier-config",
53
- "eslintConfig": {
54
- "overrides": [
55
- {
56
- "files": [
57
- "*.ts",
58
- "*.tsx"
59
- ],
60
- "extends": [
61
- "@mediamonks/eslint-config",
62
- "@mediamonks/eslint-config-react",
63
- "@mediamonks/eslint-config-typescript",
64
- "@mediamonks/eslint-config-typescript-react"
65
- ],
66
- "parserOptions": {
67
- "project": "./tsconfig.json"
68
- }
69
- },
70
- {
71
- "files": [
72
- "*.cjs",
73
- "*.js",
74
- "*.jsx",
75
- "*.mjs"
76
- ],
77
- "extends": [
78
- "@mediamonks/eslint-config"
79
- ],
80
- "parserOptions": {
81
- "ecmaVersion": "latest"
82
- }
83
- }
84
- ]
85
- },
86
54
  "devDependencies": {
87
- "@mediamonks/eslint-config": "^2.0.6",
88
- "@mediamonks/eslint-config-react": "^2.1.11",
89
- "@mediamonks/eslint-config-typescript": "^1.0.8",
90
- "@mediamonks/eslint-config-typescript-react": "^1.0.10",
55
+ "@mediamonks/eslint-config": "^2.5.0",
56
+ "@mediamonks/eslint-config-react": "^2.6.0",
57
+ "@mediamonks/eslint-config-typescript": "^1.5.1",
58
+ "@mediamonks/eslint-config-typescript-react": "^1.4.1",
91
59
  "@mediamonks/prettier-config": "^1.0.1",
92
- "@storybook/addon-essentials": "^7.5.2",
93
- "@storybook/addon-interactions": "^7.5.2",
94
- "@storybook/addon-links": "^7.5.2",
95
- "@storybook/blocks": "^7.5.2",
96
- "@storybook/cli": "^7.5.2",
60
+ "@storybook/addon-essentials": "^7.6.17",
61
+ "@storybook/addon-interactions": "^7.6.17",
62
+ "@storybook/addon-links": "^7.6.17",
63
+ "@storybook/blocks": "^7.6.17",
64
+ "@storybook/cli": "^7.6.17",
97
65
  "@storybook/jest": "^0.2.3",
98
- "@storybook/react": "^7.5.2",
99
- "@storybook/react-vite": "^7.5.2",
100
- "@storybook/test-runner": "^0.13.0",
66
+ "@storybook/manager-api": "^7.6.17",
67
+ "@storybook/react": "^7.6.17",
68
+ "@storybook/react-vite": "^7.6.17",
69
+ "@storybook/test-runner": "^0.16.0",
101
70
  "@storybook/testing-library": "^0.2.2",
102
- "@storybook/types": "^7.5.2",
71
+ "@storybook/theming": "^7.6.17",
72
+ "@storybook/types": "^7.6.17",
103
73
  "@testing-library/react": "^14.0.0",
104
74
  "@types/lodash-es": "^4.17.11",
105
75
  "@types/react": "^18.0.25",
@@ -112,7 +82,7 @@
112
82
  "lint-staged": "^13.1.0",
113
83
  "npm-run-all": "^4.1.5",
114
84
  "plop": "^4.0.0",
115
- "prettier": "^2.8.0",
85
+ "prettier": "^3.2.5",
116
86
  "react": "^18.2.0",
117
87
  "react-dom": "^18.2.0",
118
88
  "shx": "^0.3.4",