@ukic/canary-react 2.0.0-canary.2 → 2.0.0-canary.20
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 +8 -63
- package/dist/components.js +13 -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 +107 -74
- package/dist/react-component-lib/createOverlayComponent.d.ts +21 -21
- package/dist/react-component-lib/createOverlayComponent.js +190 -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 +108 -107
- package/dist/react-component-lib/utils/case.d.ts +2 -2
- package/dist/react-component-lib/utils/case.js +8 -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 +46 -31
- package/package.json +39 -17
- package/dist/react-component-lib/slottedSVG.d.ts +0 -2
- package/dist/react-component-lib/slottedSVG.js +0 -24
@@ -1,16 +1,16 @@
|
|
1
|
-
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
2
|
-
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
3
|
-
/**
|
4
|
-
* Transforms a React event name to a browser event name.
|
5
|
-
*/
|
6
|
-
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
7
|
-
/**
|
8
|
-
* Checks if an event is supported in the current execution environment.
|
9
|
-
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
10
|
-
*/
|
11
|
-
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
12
|
-
export declare const syncEvent: (node: Element & {
|
13
|
-
__events?: {
|
14
|
-
[key: string]: (e: Event) => any;
|
15
|
-
};
|
16
|
-
}, eventName: string, newEventHandler?: (e: Event) => any) => void;
|
1
|
+
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
2
|
+
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
3
|
+
/**
|
4
|
+
* Transforms a React event name to a browser event name.
|
5
|
+
*/
|
6
|
+
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
7
|
+
/**
|
8
|
+
* Checks if an event is supported in the current execution environment.
|
9
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
10
|
+
*/
|
11
|
+
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
12
|
+
export declare const syncEvent: (node: Element & {
|
13
|
+
__events?: {
|
14
|
+
[key: string]: (e: Event) => any;
|
15
|
+
};
|
16
|
+
}, eventName: string, newEventHandler?: (e: Event) => any) => void;
|
@@ -1,107 +1,108 @@
|
|
1
|
-
import { camelToDashCase } from './case';
|
2
|
-
export
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
name === '
|
14
|
-
name === '
|
15
|
-
name === '
|
16
|
-
name === '
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
//
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
return finalClassNames.
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
element.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
};
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
return map;
|
107
|
-
|
1
|
+
import { camelToDashCase } from './case';
|
2
|
+
export var attachProps = function (node, newProps, oldProps) {
|
3
|
+
if (oldProps === void 0) { oldProps = {}; }
|
4
|
+
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
5
|
+
if (node instanceof Element) {
|
6
|
+
// add any classes in className to the class list
|
7
|
+
var className = getClassName(node.classList, newProps, oldProps);
|
8
|
+
if (className !== '') {
|
9
|
+
node.className = className;
|
10
|
+
}
|
11
|
+
Object.keys(newProps).forEach(function (name) {
|
12
|
+
if (name === 'children' ||
|
13
|
+
name === 'style' ||
|
14
|
+
name === 'ref' ||
|
15
|
+
name === 'class' ||
|
16
|
+
name === 'className' ||
|
17
|
+
name === 'forwardedRef') {
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
21
|
+
var eventName = name.substring(2);
|
22
|
+
var eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
23
|
+
if (!isCoveredByReact(eventNameLc)) {
|
24
|
+
syncEvent(node, eventNameLc, newProps[name]);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
node[name] = newProps[name];
|
29
|
+
var propType = typeof newProps[name];
|
30
|
+
if (propType === 'string') {
|
31
|
+
node.setAttribute(camelToDashCase(name), newProps[name]);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
36
|
+
};
|
37
|
+
export var getClassName = function (classList, newProps, oldProps) {
|
38
|
+
var newClassProp = newProps.className || newProps.class;
|
39
|
+
var oldClassProp = oldProps.className || oldProps.class;
|
40
|
+
// map the classes to Maps for performance
|
41
|
+
var currentClasses = arrayToMap(classList);
|
42
|
+
var incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
43
|
+
var oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
44
|
+
var finalClassNames = [];
|
45
|
+
// loop through each of the current classes on the component
|
46
|
+
// to see if it should be a part of the classNames added
|
47
|
+
currentClasses.forEach(function (currentClass) {
|
48
|
+
if (incomingPropClasses.has(currentClass)) {
|
49
|
+
// add it as its already included in classnames coming in from newProps
|
50
|
+
finalClassNames.push(currentClass);
|
51
|
+
incomingPropClasses.delete(currentClass);
|
52
|
+
}
|
53
|
+
else if (!oldPropClasses.has(currentClass)) {
|
54
|
+
// add it as it has NOT been removed by user
|
55
|
+
finalClassNames.push(currentClass);
|
56
|
+
}
|
57
|
+
});
|
58
|
+
incomingPropClasses.forEach(function (s) { return finalClassNames.push(s); });
|
59
|
+
return finalClassNames.join(' ');
|
60
|
+
};
|
61
|
+
/**
|
62
|
+
* Transforms a React event name to a browser event name.
|
63
|
+
*/
|
64
|
+
export var transformReactEventName = function (eventNameSuffix) {
|
65
|
+
switch (eventNameSuffix) {
|
66
|
+
case 'doubleclick':
|
67
|
+
return 'dblclick';
|
68
|
+
}
|
69
|
+
return eventNameSuffix;
|
70
|
+
};
|
71
|
+
/**
|
72
|
+
* Checks if an event is supported in the current execution environment.
|
73
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
74
|
+
*/
|
75
|
+
export var isCoveredByReact = function (eventNameSuffix) {
|
76
|
+
if (typeof document === 'undefined') {
|
77
|
+
return true;
|
78
|
+
}
|
79
|
+
else {
|
80
|
+
var eventName = 'on' + transformReactEventName(eventNameSuffix);
|
81
|
+
var isSupported = eventName in document;
|
82
|
+
if (!isSupported) {
|
83
|
+
var element = document.createElement('div');
|
84
|
+
element.setAttribute(eventName, 'return;');
|
85
|
+
isSupported = typeof element[eventName] === 'function';
|
86
|
+
}
|
87
|
+
return isSupported;
|
88
|
+
}
|
89
|
+
};
|
90
|
+
export var syncEvent = function (node, eventName, newEventHandler) {
|
91
|
+
var eventStore = node.__events || (node.__events = {});
|
92
|
+
var oldEventHandler = eventStore[eventName];
|
93
|
+
// Remove old listener so they don't double up.
|
94
|
+
if (oldEventHandler) {
|
95
|
+
node.removeEventListener(eventName, oldEventHandler);
|
96
|
+
}
|
97
|
+
// Bind new listener.
|
98
|
+
node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
|
99
|
+
if (newEventHandler) {
|
100
|
+
newEventHandler.call(this, e);
|
101
|
+
}
|
102
|
+
}));
|
103
|
+
};
|
104
|
+
var arrayToMap = function (arr) {
|
105
|
+
var map = new Map();
|
106
|
+
arr.forEach(function (s) { return map.set(s, s); });
|
107
|
+
return map;
|
108
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const dashToPascalCase: (str: string) => string;
|
2
|
-
export declare const camelToDashCase: (str: string) => string;
|
1
|
+
export declare const dashToPascalCase: (str: string) => string;
|
2
|
+
export declare const camelToDashCase: (str: string) => string;
|
@@ -1,6 +1,8 @@
|
|
1
|
-
export
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
export var dashToPascalCase = function (str) {
|
2
|
+
return str
|
3
|
+
.toLowerCase()
|
4
|
+
.split('-')
|
5
|
+
.map(function (segment) { return segment.charAt(0).toUpperCase() + segment.slice(1); })
|
6
|
+
.join('');
|
7
|
+
};
|
8
|
+
export var camelToDashCase = function (str) { return str.replace(/([A-Z])/g, function (m) { return "-".concat(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
|
2
|
-
return process && process.env && process.env.NODE_ENV === 'development';
|
3
|
-
};
|
4
|
-
|
5
|
-
export
|
6
|
-
if (isDevMode()) {
|
7
|
-
if (!warnings[key]) {
|
8
|
-
console.warn(message);
|
9
|
-
warnings[key] = true;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
};
|
1
|
+
export var isDevMode = function () {
|
2
|
+
return process && process.env && process.env.NODE_ENV === 'development';
|
3
|
+
};
|
4
|
+
var warnings = {};
|
5
|
+
export var deprecationWarning = function (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,46 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
import React from 'react';
|
13
|
+
export var setRef = function (ref, value) {
|
14
|
+
if (typeof ref === 'function') {
|
15
|
+
ref(value);
|
16
|
+
}
|
17
|
+
else if (ref != null) {
|
18
|
+
// Cast as a MutableRef so we can assign current
|
19
|
+
ref.current = value;
|
20
|
+
}
|
21
|
+
};
|
22
|
+
export var mergeRefs = function () {
|
23
|
+
var refs = [];
|
24
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
25
|
+
refs[_i] = arguments[_i];
|
26
|
+
}
|
27
|
+
return function (value) {
|
28
|
+
refs.forEach(function (ref) {
|
29
|
+
setRef(ref, value);
|
30
|
+
});
|
31
|
+
};
|
32
|
+
};
|
33
|
+
export var createForwardRef = function (ReactComponent, displayName) {
|
34
|
+
var forwardRef = function (props, ref) {
|
35
|
+
return React.createElement(ReactComponent, __assign({}, props, { forwardedRef: ref }));
|
36
|
+
};
|
37
|
+
forwardRef.displayName = displayName;
|
38
|
+
return React.forwardRef(forwardRef);
|
39
|
+
};
|
40
|
+
export var defineCustomElement = function (tagName, customElement) {
|
41
|
+
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
42
|
+
customElements.define(tagName, customElement);
|
43
|
+
}
|
44
|
+
};
|
45
|
+
export * from './attachProps';
|
46
|
+
export * from './case';
|
package/package.json
CHANGED
@@ -3,19 +3,25 @@
|
|
3
3
|
"sideEffects": [
|
4
4
|
"*.css"
|
5
5
|
],
|
6
|
-
"version": "2.0.0-canary.
|
6
|
+
"version": "2.0.0-canary.20",
|
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",
|
10
|
+
"cypress": "cypress run --component --headed",
|
11
|
+
"cypress:open": "cypress open",
|
12
|
+
"cypress:component": "cypress run --component --headless",
|
13
|
+
"cypress:ci": "cross-env CYPRESS_CI=true npm run cypress:component",
|
10
14
|
"clean": "rimraf dist",
|
11
15
|
"compile": "npm run tsc",
|
12
16
|
"tsc": "tsc -p .",
|
13
17
|
"rollup": "rollup -c",
|
14
|
-
"storybook": "
|
15
|
-
"build-storybook": "rimraf ./storybook-static &&
|
18
|
+
"storybook": "storybook dev -p 6009",
|
19
|
+
"build-storybook": "rimraf ./storybook-static && storybook build",
|
16
20
|
"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"
|
21
|
+
"copy:core-css": "echo 'Copy core.css from: @ukic/canary-web-components' && mkdirp -p ./dist/core && ncp ../canary-web-components/dist/core/core.css ./dist/core/core.css",
|
22
|
+
"copy:normalize-css": "echo 'Copy normalize.css from: @ukic/canary-web-components' && ncp ../canary-web-components/dist/core/normalize.css ./dist/core/normalize.css",
|
23
|
+
"prettier": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore src --check",
|
24
|
+
"prettier:fix": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore src --write"
|
19
25
|
},
|
20
26
|
"main": "./dist/index.js",
|
21
27
|
"module": "./dist/index.js",
|
@@ -24,28 +30,39 @@
|
|
24
30
|
"dist/"
|
25
31
|
],
|
26
32
|
"dependencies": {
|
27
|
-
"@ukic/canary-web-components": "^2.0.0-canary.
|
28
|
-
"@ukic/
|
33
|
+
"@ukic/canary-web-components": "^2.0.0-canary.20",
|
34
|
+
"@ukic/react": "^2.25.0",
|
35
|
+
"@ukic/web-components": "^2.25.0"
|
29
36
|
},
|
30
37
|
"devDependencies": {
|
31
38
|
"@babel/core": "^7.16.0",
|
39
|
+
"@babel/preset-env": "^7.23.9",
|
40
|
+
"@babel/preset-react": "^7.23.3",
|
41
|
+
"@babel/preset-typescript": "^7.23.3",
|
42
|
+
"@cypress/react": "^8.0.0",
|
43
|
+
"@cypress/webpack-preprocessor": "^6.0.0",
|
32
44
|
"@mdi/js": "^7.2.96",
|
33
45
|
"@stencil/react-output-target": "^0.5.3",
|
34
|
-
"@storybook/addon-a11y": "^6.
|
35
|
-
"@storybook/addon-actions": "^6.
|
36
|
-
"@storybook/addon-docs": "^6.
|
37
|
-
"@storybook/addon-essentials": "^6.
|
38
|
-
"@storybook/addon-links": "^6.
|
46
|
+
"@storybook/addon-a11y": "^7.6.10",
|
47
|
+
"@storybook/addon-actions": "^7.6.10",
|
48
|
+
"@storybook/addon-docs": "^7.6.10",
|
49
|
+
"@storybook/addon-essentials": "^7.6.10",
|
50
|
+
"@storybook/addon-links": "^7.6.10",
|
51
|
+
"@storybook/addon-mdx-gfm": "^7.6.10",
|
39
52
|
"@storybook/addon-postcss": "^2.0.0",
|
40
|
-
"@storybook/
|
41
|
-
"@storybook/
|
42
|
-
"@storybook/react": "^6.5.15",
|
53
|
+
"@storybook/react": "^7.6.10",
|
54
|
+
"@storybook/react-webpack5": "^7.6.10",
|
43
55
|
"@types/jest": "27.0.3",
|
44
56
|
"@types/node": "^16.11.11",
|
45
57
|
"@types/react": "^17.0.37",
|
46
58
|
"@types/react-dom": "^17.0.11",
|
47
59
|
"babel-loader": "^8.2.3",
|
48
|
-
"
|
60
|
+
"cross-env": "^7.0.3",
|
61
|
+
"cypress": "^13.3.1",
|
62
|
+
"cypress-axe": "^1.5.0",
|
63
|
+
"cypress-image-diff-js": "^1.32.0",
|
64
|
+
"eslint-plugin-cypress": "^2.15.1",
|
65
|
+
"github-markdown-css": "^5.5.0",
|
49
66
|
"jest": "^27.4.1",
|
50
67
|
"jest-dom": "^4.0.0",
|
51
68
|
"mkdirp": "^1.0.4",
|
@@ -56,10 +73,14 @@
|
|
56
73
|
"react-markdown": "^8.0.7",
|
57
74
|
"react-router-dom": "^6.3.0",
|
58
75
|
"remark-gfm": "^3.0.1",
|
76
|
+
"storybook": "^7.6.10",
|
77
|
+
"ts-loader": "^9.5.0",
|
59
78
|
"typescript": "^4.5.2",
|
79
|
+
"url-loader": "^4.1.1",
|
60
80
|
"webpack": "^5.76.0"
|
61
81
|
},
|
62
82
|
"peerDependencies": {
|
83
|
+
"@ukic/fonts": "^2.6.0",
|
63
84
|
"react": "^16.7.0 || ^17.0.2 || ^18.2.0",
|
64
85
|
"react-dom": "^16.7.0 || ^17.0.2 || ^18.2.0"
|
65
86
|
},
|
@@ -71,5 +92,6 @@
|
|
71
92
|
"dist"
|
72
93
|
]
|
73
94
|
},
|
74
|
-
"license": "MIT"
|
95
|
+
"license": "MIT",
|
96
|
+
"gitHead": "eb7aab0b104807bab72ff8030dbd57f847480fd7"
|
75
97
|
}
|
@@ -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
|
-
};
|