@ukic/canary-react 2.0.0-canary.2 → 2.0.0-canary.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,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.2",
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 6007 --no-manager-cache",
15
- "build-storybook": "rimraf ./storybook-static && build-storybook -s public",
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/canary-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/canary-web-components' && ncp ../web-components/dist/core/normalize.css ./dist/core/normalize.css"
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.2",
28
- "@ukic/fonts": "^2.3.0"
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.2.0",
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,2 +0,0 @@
1
- import { FC } from "react";
2
- export declare const SlottedSVG: FC<any>;
@@ -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
- };