@ukic/canary-react 2.0.0-canary.1 → 2.0.0-canary.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -30
- package/dist/components.d.ts +63 -63
- package/dist/components.js +67 -67
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/react-component-lib/createComponent.d.ts +10 -10
- package/dist/react-component-lib/createComponent.js +74 -74
- package/dist/react-component-lib/createOverlayComponent.d.ts +21 -21
- package/dist/react-component-lib/createOverlayComponent.js +108 -108
- package/dist/react-component-lib/index.d.ts +2 -2
- package/dist/react-component-lib/index.js +2 -2
- package/dist/react-component-lib/interfaces.d.ts +29 -29
- package/dist/react-component-lib/interfaces.js +1 -1
- package/dist/react-component-lib/slottedSVG.d.ts +2 -2
- package/dist/react-component-lib/slottedSVG.js +24 -24
- package/dist/react-component-lib/utils/attachProps.d.ts +16 -16
- package/dist/react-component-lib/utils/attachProps.js +107 -107
- package/dist/react-component-lib/utils/case.d.ts +2 -2
- package/dist/react-component-lib/utils/case.js +6 -6
- package/dist/react-component-lib/utils/dev.d.ts +2 -2
- package/dist/react-component-lib/utils/dev.js +12 -12
- package/dist/react-component-lib/utils/index.d.ts +10 -10
- package/dist/react-component-lib/utils/index.js +31 -31
- package/package.json +3 -4
@@ -1,6 +1,6 @@
|
|
1
|
-
export const dashToPascalCase = (str) => str
|
2
|
-
.toLowerCase()
|
3
|
-
.split('-')
|
4
|
-
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
5
|
-
.join('');
|
6
|
-
export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
|
1
|
+
export const dashToPascalCase = (str) => str
|
2
|
+
.toLowerCase()
|
3
|
+
.split('-')
|
4
|
+
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
5
|
+
.join('');
|
6
|
+
export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const isDevMode: () => boolean;
|
2
|
-
export declare const deprecationWarning: (key: string, message: string) => void;
|
1
|
+
export declare const isDevMode: () => boolean;
|
2
|
+
export declare const deprecationWarning: (key: string, message: string) => void;
|
@@ -1,12 +1,12 @@
|
|
1
|
-
export const isDevMode = () => {
|
2
|
-
return process && process.env && process.env.NODE_ENV === 'development';
|
3
|
-
};
|
4
|
-
const warnings = {};
|
5
|
-
export const deprecationWarning = (key, message) => {
|
6
|
-
if (isDevMode()) {
|
7
|
-
if (!warnings[key]) {
|
8
|
-
console.warn(message);
|
9
|
-
warnings[key] = true;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
};
|
1
|
+
export const isDevMode = () => {
|
2
|
+
return process && process.env && process.env.NODE_ENV === 'development';
|
3
|
+
};
|
4
|
+
const warnings = {};
|
5
|
+
export const deprecationWarning = (key, message) => {
|
6
|
+
if (isDevMode()) {
|
7
|
+
if (!warnings[key]) {
|
8
|
+
console.warn(message);
|
9
|
+
warnings[key] = true;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
};
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import type { StyleReactProps } from '../interfaces';
|
3
|
-
export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
|
4
|
-
export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
|
5
|
-
export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
|
6
|
-
export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
|
7
|
-
export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & StyleReactProps> & React.RefAttributes<ElementType>>;
|
8
|
-
export declare const defineCustomElement: (tagName: string, customElement: any) => void;
|
9
|
-
export * from './attachProps';
|
10
|
-
export * from './case';
|
1
|
+
import React from 'react';
|
2
|
+
import type { StyleReactProps } from '../interfaces';
|
3
|
+
export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
|
4
|
+
export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
|
5
|
+
export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
|
6
|
+
export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
|
7
|
+
export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & StyleReactProps> & React.RefAttributes<ElementType>>;
|
8
|
+
export declare const defineCustomElement: (tagName: string, customElement: any) => void;
|
9
|
+
export * from './attachProps';
|
10
|
+
export * from './case';
|
@@ -1,31 +1,31 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
export const setRef = (ref, value) => {
|
3
|
-
if (typeof ref === 'function') {
|
4
|
-
ref(value);
|
5
|
-
}
|
6
|
-
else if (ref != null) {
|
7
|
-
// Cast as a MutableRef so we can assign current
|
8
|
-
ref.current = value;
|
9
|
-
}
|
10
|
-
};
|
11
|
-
export const mergeRefs = (...refs) => {
|
12
|
-
return (value) => {
|
13
|
-
refs.forEach((ref) => {
|
14
|
-
setRef(ref, value);
|
15
|
-
});
|
16
|
-
};
|
17
|
-
};
|
18
|
-
export const createForwardRef = (ReactComponent, displayName) => {
|
19
|
-
const forwardRef = (props, ref) => {
|
20
|
-
return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
21
|
-
};
|
22
|
-
forwardRef.displayName = displayName;
|
23
|
-
return React.forwardRef(forwardRef);
|
24
|
-
};
|
25
|
-
export const defineCustomElement = (tagName, customElement) => {
|
26
|
-
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
27
|
-
customElements.define(tagName, customElement);
|
28
|
-
}
|
29
|
-
};
|
30
|
-
export * from './attachProps';
|
31
|
-
export * from './case';
|
1
|
+
import React from 'react';
|
2
|
+
export const setRef = (ref, value) => {
|
3
|
+
if (typeof ref === 'function') {
|
4
|
+
ref(value);
|
5
|
+
}
|
6
|
+
else if (ref != null) {
|
7
|
+
// Cast as a MutableRef so we can assign current
|
8
|
+
ref.current = value;
|
9
|
+
}
|
10
|
+
};
|
11
|
+
export const mergeRefs = (...refs) => {
|
12
|
+
return (value) => {
|
13
|
+
refs.forEach((ref) => {
|
14
|
+
setRef(ref, value);
|
15
|
+
});
|
16
|
+
};
|
17
|
+
};
|
18
|
+
export const createForwardRef = (ReactComponent, displayName) => {
|
19
|
+
const forwardRef = (props, ref) => {
|
20
|
+
return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
21
|
+
};
|
22
|
+
forwardRef.displayName = displayName;
|
23
|
+
return React.forwardRef(forwardRef);
|
24
|
+
};
|
25
|
+
export const defineCustomElement = (tagName, customElement) => {
|
26
|
+
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
27
|
+
customElements.define(tagName, customElement);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
export * from './attachProps';
|
31
|
+
export * from './case';
|
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"sideEffects": [
|
4
4
|
"*.css"
|
5
5
|
],
|
6
|
-
"version": "2.0.0-canary.
|
6
|
+
"version": "2.0.0-canary.2",
|
7
7
|
"description": "React-wrapped web components compiled using StencilJS",
|
8
8
|
"scripts": {
|
9
9
|
"build": "npm run clean && npm run compile && npm run copy:core-css && npm run copy:normalize-css",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"dist/"
|
25
25
|
],
|
26
26
|
"dependencies": {
|
27
|
-
"@ukic/canary-web-components": "^2.0.0-canary.
|
27
|
+
"@ukic/canary-web-components": "^2.0.0-canary.2",
|
28
28
|
"@ukic/fonts": "^2.3.0"
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
@@ -71,6 +71,5 @@
|
|
71
71
|
"dist"
|
72
72
|
]
|
73
73
|
},
|
74
|
-
"license": "MIT"
|
75
|
-
"gitHead": "f8c6ba22e6f4c75e192812ca44ffa3495c003dee"
|
74
|
+
"license": "MIT"
|
76
75
|
}
|