@ukic/canary-react 2.0.0-canary.2 → 2.0.0-canary.4
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +67 -67
- package/dist/components.d.ts +4 -63
- package/dist/components.js +8 -67
- package/dist/core/core.css +8 -5
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -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/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 +11 -9
- package/dist/react-component-lib/slottedSVG.d.ts +0 -2
- package/dist/react-component-lib/slottedSVG.js +0 -24
@@ -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.4",
|
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",
|
@@ -11,11 +11,11 @@
|
|
11
11
|
"compile": "npm run tsc",
|
12
12
|
"tsc": "tsc -p .",
|
13
13
|
"rollup": "rollup -c",
|
14
|
-
"storybook": "start-storybook -p
|
15
|
-
"build-storybook": "rimraf ./storybook-static && build-storybook
|
14
|
+
"storybook": "start-storybook -p 6009 --no-manager-cache",
|
15
|
+
"build-storybook": "rimraf ./storybook-static && build-storybook",
|
16
16
|
"audit": "echo 'Audit for: @ukic/canary-react' && audit-ci -m --config ../../audit-ci.json",
|
17
|
-
"copy:core-css": "echo 'Copy core.css from: @ukic/
|
18
|
-
"copy:normalize-css": "echo 'Copy normalize.css from: @ukic/
|
17
|
+
"copy:core-css": "echo 'Copy core.css from: @ukic/web-components' && mkdirp -p ./dist/core && ncp ../web-components/dist/core/core.css ./dist/core/core.css",
|
18
|
+
"copy:normalize-css": "echo 'Copy normalize.css from: @ukic/web-components' && ncp ../web-components/dist/core/normalize.css ./dist/core/normalize.css"
|
19
19
|
},
|
20
20
|
"main": "./dist/index.js",
|
21
21
|
"module": "./dist/index.js",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
"dist/"
|
25
25
|
],
|
26
26
|
"dependencies": {
|
27
|
-
"@ukic/canary-web-components": "^2.0.0-canary.
|
28
|
-
"@ukic/
|
27
|
+
"@ukic/canary-web-components": "^2.0.0-canary.4",
|
28
|
+
"@ukic/react": "^2.10.0"
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
31
|
"@babel/core": "^7.16.0",
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"@types/react": "^17.0.37",
|
46
46
|
"@types/react-dom": "^17.0.11",
|
47
47
|
"babel-loader": "^8.2.3",
|
48
|
-
"github-markdown-css": "^5.
|
48
|
+
"github-markdown-css": "^5.5.0",
|
49
49
|
"jest": "^27.4.1",
|
50
50
|
"jest-dom": "^4.0.0",
|
51
51
|
"mkdirp": "^1.0.4",
|
@@ -60,6 +60,7 @@
|
|
60
60
|
"webpack": "^5.76.0"
|
61
61
|
},
|
62
62
|
"peerDependencies": {
|
63
|
+
"@ukic/fonts": "^2.3.0",
|
63
64
|
"react": "^16.7.0 || ^17.0.2 || ^18.2.0",
|
64
65
|
"react-dom": "^16.7.0 || ^17.0.2 || ^18.2.0"
|
65
66
|
},
|
@@ -71,5 +72,6 @@
|
|
71
72
|
"dist"
|
72
73
|
]
|
73
74
|
},
|
74
|
-
"license": "MIT"
|
75
|
+
"license": "MIT",
|
76
|
+
"gitHead": "d5a95835136923d7ccf2990b32bd5972535aef7d"
|
75
77
|
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
|
-
import React from "react";
|
13
|
-
const defaultProps = {
|
14
|
-
xmlns: "http://www.w3.org/2000/svg",
|
15
|
-
};
|
16
|
-
function slot(name = "") {
|
17
|
-
return { ref: (e) => (e ? e.setAttribute("slot", name) : null) };
|
18
|
-
}
|
19
|
-
export const SlottedSVG = (_a) => {
|
20
|
-
var { path, slot: slotName, children } = _a, props = __rest(_a, ["path", "slot", "children"]);
|
21
|
-
return (React.createElement("svg", Object.assign({}, slot(slotName), props, defaultProps),
|
22
|
-
!!path && React.createElement("path", { d: path }),
|
23
|
-
children));
|
24
|
-
};
|