@ukic/canary-react 2.0.0-canary.0 → 2.0.0-canary.2

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,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
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@ukic/canary-react",
3
- "sideEffects": false,
4
- "version": "2.0.0-canary.0",
3
+ "sideEffects": [
4
+ "*.css"
5
+ ],
6
+ "version": "2.0.0-canary.2",
5
7
  "description": "React-wrapped web components compiled using StencilJS",
6
8
  "scripts": {
7
9
  "build": "npm run clean && npm run compile && npm run copy:core-css && npm run copy:normalize-css",
@@ -15,9 +17,6 @@
15
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",
16
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
19
  },
18
- "publishConfig": {
19
- "access": "public"
20
- },
21
20
  "main": "./dist/index.js",
22
21
  "module": "./dist/index.js",
23
22
  "types": "./dist/index.d.ts",
@@ -25,12 +24,13 @@
25
24
  "dist/"
26
25
  ],
27
26
  "dependencies": {
28
- "@ukic/canary-web-components": "^2.0.0-canary.0",
29
- "@ukic/fonts": "^2.2.0"
27
+ "@ukic/canary-web-components": "^2.0.0-canary.2",
28
+ "@ukic/fonts": "^2.3.0"
30
29
  },
31
30
  "devDependencies": {
32
31
  "@babel/core": "^7.16.0",
33
- "@stencil/react-output-target": "^0.4.0",
32
+ "@mdi/js": "^7.2.96",
33
+ "@stencil/react-output-target": "^0.5.3",
34
34
  "@storybook/addon-a11y": "^6.4.8",
35
35
  "@storybook/addon-actions": "^6.4.8",
36
36
  "@storybook/addon-docs": "^6.4.8",
@@ -39,12 +39,13 @@
39
39
  "@storybook/addon-postcss": "^2.0.0",
40
40
  "@storybook/builder-webpack5": "^6.5.14",
41
41
  "@storybook/manager-webpack5": "^6.5.14",
42
- "@storybook/react": "6.5.15",
42
+ "@storybook/react": "^6.5.15",
43
43
  "@types/jest": "27.0.3",
44
44
  "@types/node": "^16.11.11",
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
49
  "jest": "^27.4.1",
49
50
  "jest-dom": "^4.0.0",
50
51
  "mkdirp": "^1.0.4",
@@ -52,13 +53,12 @@
52
53
  "react": "^16.7.0",
53
54
  "react-dom": "^16.7.0",
54
55
  "react-hook-form": "^7.38.0",
56
+ "react-markdown": "^8.0.7",
55
57
  "react-router-dom": "^6.3.0",
58
+ "remark-gfm": "^3.0.1",
56
59
  "typescript": "^4.5.2",
57
60
  "webpack": "^5.76.0"
58
61
  },
59
- "overrides": {
60
- "webpack": "^5.76.0"
61
- },
62
62
  "peerDependencies": {
63
63
  "react": "^16.7.0 || ^17.0.2 || ^18.2.0",
64
64
  "react-dom": "^16.7.0 || ^17.0.2 || ^18.2.0"
@@ -71,6 +71,5 @@
71
71
  "dist"
72
72
  ]
73
73
  },
74
- "license": "MIT",
75
- "gitHead": "7c98878b286939f371e498b79cfac7c8617b4a70"
74
+ "license": "MIT"
76
75
  }