@swisspost/design-system-components-react 9.0.0-next.8 → 10.0.0-next.37
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.
- package/dist/components/stencil-generated/index.js +36 -34
- package/dist/components/stencil-generated/index.js.map +1 -1
- package/dist/components/stencil-generated/react-component-lib/createComponent.js +20 -26
- package/dist/components/stencil-generated/react-component-lib/createComponent.js.map +1 -1
- package/dist/components/stencil-generated/react-component-lib/createOverlayComponent.js +42 -54
- package/dist/components/stencil-generated/react-component-lib/createOverlayComponent.js.map +1 -1
- package/dist/components/stencil-generated/react-component-lib/utils/attachProps.js +0 -16
- package/dist/components/stencil-generated/react-component-lib/utils/attachProps.js.map +1 -1
- package/dist/components/stencil-generated/react-component-lib/utils/index.js +1 -2
- package/dist/components/stencil-generated/react-component-lib/utils/index.js.map +1 -1
- package/dist/{components → types/components}/stencil-generated/index.d.ts +5 -0
- package/dist/{components → types/components}/stencil-generated/react-component-lib/utils/attachProps.d.ts +0 -7
- package/package.json +20 -22
- /package/dist/{components → types/components}/index.d.ts +0 -0
- /package/dist/{components → types/components}/stencil-generated/react-component-lib/createComponent.d.ts +0 -0
- /package/dist/{components → types/components}/stencil-generated/react-component-lib/createOverlayComponent.d.ts +0 -0
- /package/dist/{components → types/components}/stencil-generated/react-component-lib/index.d.ts +0 -0
- /package/dist/{components → types/components}/stencil-generated/react-component-lib/interfaces.d.ts +0 -0
- /package/dist/{components → types/components}/stencil-generated/react-component-lib/utils/case.d.ts +0 -0
- /package/dist/{components → types/components}/stencil-generated/react-component-lib/utils/dev.d.ts +0 -0
- /package/dist/{components → types/components}/stencil-generated/react-component-lib/utils/index.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* auto-generated react proxies */
|
|
4
1
|
import { createReactComponent } from './react-component-lib';
|
|
5
2
|
import { defineCustomElements } from '@swisspost/design-system-components/loader';
|
|
6
3
|
defineCustomElements();
|
|
7
|
-
export const PostAccordion =
|
|
8
|
-
export const PostAccordionItem =
|
|
9
|
-
export const PostAvatar =
|
|
10
|
-
export const PostBackToTop =
|
|
11
|
-
export const PostBanner =
|
|
12
|
-
export const PostBreadcrumbItem =
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
4
|
+
export const PostAccordion = createReactComponent('post-accordion');
|
|
5
|
+
export const PostAccordionItem = createReactComponent('post-accordion-item');
|
|
6
|
+
export const PostAvatar = createReactComponent('post-avatar');
|
|
7
|
+
export const PostBackToTop = createReactComponent('post-back-to-top');
|
|
8
|
+
export const PostBanner = createReactComponent('post-banner');
|
|
9
|
+
export const PostBreadcrumbItem = createReactComponent('post-breadcrumb-item');
|
|
10
|
+
export const PostBreadcrumbs = createReactComponent('post-breadcrumbs');
|
|
11
|
+
export const PostCardControl = createReactComponent('post-card-control');
|
|
12
|
+
export const PostClosebutton = createReactComponent('post-closebutton');
|
|
13
|
+
export const PostCollapsible = createReactComponent('post-collapsible');
|
|
14
|
+
export const PostCollapsibleTrigger = createReactComponent('post-collapsible-trigger');
|
|
15
|
+
export const PostFooter = createReactComponent('post-footer');
|
|
16
|
+
export const PostHeader = createReactComponent('post-header');
|
|
17
|
+
export const PostIcon = createReactComponent('post-icon');
|
|
18
|
+
export const PostLanguageOption = createReactComponent('post-language-option');
|
|
19
|
+
export const PostLanguageSwitch = createReactComponent('post-language-switch');
|
|
20
|
+
export const PostLinkarea = createReactComponent('post-linkarea');
|
|
21
|
+
export const PostList = createReactComponent('post-list');
|
|
22
|
+
export const PostListItem = createReactComponent('post-list-item');
|
|
23
|
+
export const PostLogo = createReactComponent('post-logo');
|
|
24
|
+
export const PostMainnavigation = createReactComponent('post-mainnavigation');
|
|
25
|
+
export const PostMegadropdown = createReactComponent('post-megadropdown');
|
|
26
|
+
export const PostMegadropdownTrigger = createReactComponent('post-megadropdown-trigger');
|
|
27
|
+
export const PostMenu = createReactComponent('post-menu');
|
|
28
|
+
export const PostMenuItem = createReactComponent('post-menu-item');
|
|
29
|
+
export const PostMenuTrigger = createReactComponent('post-menu-trigger');
|
|
30
|
+
export const PostPopover = createReactComponent('post-popover');
|
|
31
|
+
export const PostPopovercontainer = createReactComponent('post-popovercontainer');
|
|
32
|
+
export const PostRating = createReactComponent('post-rating');
|
|
33
|
+
export const PostTabHeader = createReactComponent('post-tab-header');
|
|
34
|
+
export const PostTabPanel = createReactComponent('post-tab-panel');
|
|
35
|
+
export const PostTabs = createReactComponent('post-tabs');
|
|
36
|
+
export const PostTag = createReactComponent('post-tag');
|
|
37
|
+
export const PostTogglebutton = createReactComponent('post-togglebutton');
|
|
38
|
+
export const PostTooltip = createReactComponent('post-tooltip');
|
|
39
|
+
export const PostTooltipTrigger = createReactComponent('post-tooltip-trigger');
|
|
38
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/stencil-generated/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/stencil-generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAElF,oBAAo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M,CAAC,MAAM,gBAAgB,GAAgB,oBAAoB,CAAoD,mBAAmB,CAAC,CAAC;AAC1I,MAAM,CAAC,MAAM,WAAW,GAAgB,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,MAAM,CAAC,MAAM,kBAAkB,GAAgB,oBAAoB,CAAwD,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
import React, { createElement } from 'react';
|
|
13
2
|
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
|
|
14
3
|
export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
|
|
@@ -19,9 +8,20 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
19
8
|
const ReactComponent = class extends React.Component {
|
|
20
9
|
constructor(props) {
|
|
21
10
|
super(props);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
Object.defineProperty(this, "componentEl", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "setComponentElRef", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: (element) => {
|
|
22
|
+
this.componentEl = element;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
25
|
}
|
|
26
26
|
componentDidMount() {
|
|
27
27
|
this.componentDidUpdate(this.props);
|
|
@@ -30,7 +30,7 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
30
30
|
attachProps(this.componentEl, this.props, prevProps);
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
const
|
|
33
|
+
const { children, forwardedRef, style, className, ref, ...cProps } = this.props;
|
|
34
34
|
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
35
35
|
const value = cProps[name];
|
|
36
36
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
@@ -40,8 +40,6 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
// we should only render strings, booleans, and numbers as attrs in html.
|
|
44
|
-
// objects, functions, arrays etc get synced via properties on mount.
|
|
45
43
|
const type = typeof value;
|
|
46
44
|
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
47
45
|
acc[camelToDashCase(name)] = value;
|
|
@@ -52,21 +50,17 @@ export const createReactComponent = (tagName, ReactComponentContext, manipulateP
|
|
|
52
50
|
if (manipulatePropsFunction) {
|
|
53
51
|
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
54
52
|
}
|
|
55
|
-
const newProps =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
* React.createElement causes all elements to be rendered
|
|
61
|
-
* as <tagname> instead of the actual Web Component.
|
|
62
|
-
*/
|
|
53
|
+
const newProps = {
|
|
54
|
+
...propsToPass,
|
|
55
|
+
ref: mergeRefs(forwardedRef, this.setComponentElRef),
|
|
56
|
+
style,
|
|
57
|
+
};
|
|
63
58
|
return createElement(tagName, newProps, children);
|
|
64
59
|
}
|
|
65
60
|
static get displayName() {
|
|
66
61
|
return displayName;
|
|
67
62
|
}
|
|
68
63
|
};
|
|
69
|
-
// If context was passed to createReactComponent then conditionally add it to the Component Class
|
|
70
64
|
if (ReactComponentContext) {
|
|
71
65
|
ReactComponent.contextType = ReactComponentContext;
|
|
72
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../../../src/components/stencil-generated/react-component-lib/createComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../../../src/components/stencil-generated/react-component-lib/createComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWxH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAMlC,OAAe,EACf,qBAAuD,EACvD,uBAGuB,EACvB,mBAAgC,EAChC,EAAE;IACF,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,mBAAmB,EAAE,CAAC;IACxB,CAAC;IAED,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,KAAM,SAAQ,KAAK,CAAC,SAAiD;QAO1F,YAAY,KAA6C;YACvD,KAAK,CAAC,KAAK,CAAC,CAAC;YAPf;;;;;eAA0B;YAE1B;;;;uBAAoB,CAAC,OAAoB,EAAE,EAAE;oBAC3C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;gBAC7B,CAAC;eAAC;QAIF,CAAC;QAED,iBAAiB;YACf,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;QAED,kBAAkB,CAAC,SAAiD;YAClE,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,EAAE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AS,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC;gBACpD,KAAK;aACN,CAAC;YASF,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,KAAK,WAAW;YACpB,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAGF,IAAI,qBAAqB,EAAE,CAAC;QAC1B,cAAc,CAAC,WAAW,GAAG,qBAAqB,CAAC;IACrD,CAAC;IAED,OAAO,gBAAgB,CAAwB,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9E,CAAC,CAAC"}
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
1
|
import React from 'react';
|
|
22
2
|
import ReactDOM from 'react-dom';
|
|
23
3
|
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
|
|
@@ -32,6 +12,18 @@ export const createOverlayComponent = (tagName, controller, customElement) => {
|
|
|
32
12
|
class Overlay extends React.Component {
|
|
33
13
|
constructor(props) {
|
|
34
14
|
super(props);
|
|
15
|
+
Object.defineProperty(this, "overlay", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(this, "el", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
35
27
|
if (typeof document !== 'undefined') {
|
|
36
28
|
this.el = document.createElement('div');
|
|
37
29
|
}
|
|
@@ -57,53 +49,49 @@ export const createOverlayComponent = (tagName, controller, customElement) => {
|
|
|
57
49
|
setRef(this.props.forwardedRef, null);
|
|
58
50
|
}
|
|
59
51
|
shouldComponentUpdate(nextProps) {
|
|
60
|
-
// Check if the overlay component is about to dismiss
|
|
61
52
|
if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
|
|
62
53
|
isDismissing = true;
|
|
63
54
|
}
|
|
64
55
|
return true;
|
|
65
56
|
}
|
|
66
|
-
componentDidUpdate(prevProps) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* Now that the overlay is dismissed
|
|
79
|
-
* we need to render again so that any
|
|
80
|
-
* inner components will be unmounted
|
|
81
|
-
*/
|
|
82
|
-
this.forceUpdate();
|
|
83
|
-
}
|
|
84
|
-
});
|
|
57
|
+
async componentDidUpdate(prevProps) {
|
|
58
|
+
if (this.overlay) {
|
|
59
|
+
attachProps(this.overlay, this.props, prevProps);
|
|
60
|
+
}
|
|
61
|
+
if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
|
|
62
|
+
this.present(prevProps);
|
|
63
|
+
}
|
|
64
|
+
if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
|
|
65
|
+
await this.overlay.dismiss();
|
|
66
|
+
isDismissing = false;
|
|
67
|
+
this.forceUpdate();
|
|
68
|
+
}
|
|
85
69
|
}
|
|
86
|
-
present(prevProps) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
70
|
+
async present(prevProps) {
|
|
71
|
+
const { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, ...cProps } = this.props;
|
|
72
|
+
const elementProps = {
|
|
73
|
+
...cProps,
|
|
74
|
+
ref: this.props.forwardedRef,
|
|
75
|
+
[didDismissEventName]: this.handleDismiss,
|
|
76
|
+
[didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e),
|
|
77
|
+
[willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e),
|
|
78
|
+
[willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e),
|
|
79
|
+
};
|
|
80
|
+
this.overlay = await controller.create({
|
|
81
|
+
...elementProps,
|
|
82
|
+
component: this.el,
|
|
83
|
+
componentProps: {},
|
|
94
84
|
});
|
|
85
|
+
setRef(this.props.forwardedRef, this.overlay);
|
|
86
|
+
attachProps(this.overlay, elementProps, prevProps);
|
|
87
|
+
await this.overlay.present();
|
|
95
88
|
}
|
|
96
89
|
render() {
|
|
97
|
-
/**
|
|
98
|
-
* Continue to render the component even when
|
|
99
|
-
* overlay is dismissing otherwise component
|
|
100
|
-
* will be hidden before animation is done.
|
|
101
|
-
*/
|
|
102
90
|
return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
|
|
103
91
|
}
|
|
104
92
|
}
|
|
105
93
|
return React.forwardRef((props, ref) => {
|
|
106
|
-
return React.createElement(Overlay,
|
|
94
|
+
return React.createElement(Overlay, { ...props, forwardedRef: ref });
|
|
107
95
|
});
|
|
108
96
|
};
|
|
109
97
|
//# sourceMappingURL=createOverlayComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../../../src/components/stencil-generated/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../../../src/components/stencil-generated/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC,OAAO,EAA4B,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAgB/G,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAe,EACf,UAA8D,EAC9D,aAAmB,EACnB,EAAE;IACF,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAE5C,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,mBAAmB,GAAG,KAAK,WAAW,YAAY,CAAC;IACzD,MAAM,mBAAmB,GAAG,KAAK,WAAW,YAAY,CAAC;IACzD,MAAM,oBAAoB,GAAG,KAAK,WAAW,aAAa,CAAC;IAC3D,MAAM,oBAAoB,GAAG,KAAK,WAAW,aAAa,CAAC;IAO3D,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,MAAM,OAAQ,SAAQ,KAAK,CAAC,SAAgB;QAI1C,YAAY,KAAY;YACtB,KAAK,CAAC,KAAK,CAAC,CAAC;YAJf;;;;;eAAsB;YACtB;;;;;eAAoB;YAIlB,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;gBACpC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M,CAAC;gBACrC,GAAG,YAAY;gBACf,SAAS,EAAE,IAAI,CAAC,EAAE;gBAClB,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;YAEH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9C,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;YAEnD,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC/B,CAAC;QAED,MAAM;YAMJ,OAAO,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACxG,CAAC;KACF;IAED,OAAO,KAAK,CAAC,UAAU,CAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACzD,OAAO,oBAAC,OAAO,OAAK,KAAK,EAAE,YAAY,EAAE,GAAG,GAAI,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { camelToDashCase } from './case';
|
|
2
2
|
export const attachProps = (node, newProps, oldProps = {}) => {
|
|
3
|
-
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
4
3
|
if (node instanceof Element) {
|
|
5
|
-
// add any classes in className to the class list
|
|
6
4
|
const className = getClassName(node.classList, newProps, oldProps);
|
|
7
5
|
if (className !== '') {
|
|
8
6
|
node.className = className;
|
|
@@ -36,30 +34,22 @@ export const attachProps = (node, newProps, oldProps = {}) => {
|
|
|
36
34
|
export const getClassName = (classList, newProps, oldProps) => {
|
|
37
35
|
const newClassProp = newProps.className || newProps.class;
|
|
38
36
|
const oldClassProp = oldProps.className || oldProps.class;
|
|
39
|
-
// map the classes to Maps for performance
|
|
40
37
|
const currentClasses = arrayToMap(classList);
|
|
41
38
|
const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
42
39
|
const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
43
40
|
const finalClassNames = [];
|
|
44
|
-
// loop through each of the current classes on the component
|
|
45
|
-
// to see if it should be a part of the classNames added
|
|
46
41
|
currentClasses.forEach((currentClass) => {
|
|
47
42
|
if (incomingPropClasses.has(currentClass)) {
|
|
48
|
-
// add it as its already included in classnames coming in from newProps
|
|
49
43
|
finalClassNames.push(currentClass);
|
|
50
44
|
incomingPropClasses.delete(currentClass);
|
|
51
45
|
}
|
|
52
46
|
else if (!oldPropClasses.has(currentClass)) {
|
|
53
|
-
// add it as it has NOT been removed by user
|
|
54
47
|
finalClassNames.push(currentClass);
|
|
55
48
|
}
|
|
56
49
|
});
|
|
57
50
|
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
58
51
|
return finalClassNames.join(' ');
|
|
59
52
|
};
|
|
60
|
-
/**
|
|
61
|
-
* Transforms a React event name to a browser event name.
|
|
62
|
-
*/
|
|
63
53
|
export const transformReactEventName = (eventNameSuffix) => {
|
|
64
54
|
switch (eventNameSuffix) {
|
|
65
55
|
case 'doubleclick':
|
|
@@ -67,10 +57,6 @@ export const transformReactEventName = (eventNameSuffix) => {
|
|
|
67
57
|
}
|
|
68
58
|
return eventNameSuffix;
|
|
69
59
|
};
|
|
70
|
-
/**
|
|
71
|
-
* Checks if an event is supported in the current execution environment.
|
|
72
|
-
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
73
|
-
*/
|
|
74
60
|
export const isCoveredByReact = (eventNameSuffix) => {
|
|
75
61
|
if (typeof document === 'undefined') {
|
|
76
62
|
return true;
|
|
@@ -89,11 +75,9 @@ export const isCoveredByReact = (eventNameSuffix) => {
|
|
|
89
75
|
export const syncEvent = (node, eventName, newEventHandler) => {
|
|
90
76
|
const eventStore = node.__events || (node.__events = {});
|
|
91
77
|
const oldEventHandler = eventStore[eventName];
|
|
92
|
-
// Remove old listener so they don't double up.
|
|
93
78
|
if (oldEventHandler) {
|
|
94
79
|
node.removeEventListener(eventName, oldEventHandler);
|
|
95
80
|
}
|
|
96
|
-
// Bind new listener.
|
|
97
81
|
node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
|
|
98
82
|
if (newEventHandler) {
|
|
99
83
|
newEventHandler.call(this, e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../../../src/components/stencil-generated/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiB,EAAE,QAAa,EAAE,WAAgB,EAAE,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../../../src/components/stencil-generated/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiB,EAAE,QAAa,EAAE,WAAgB,EAAE,EAAE,EAAE;IAElF,IAAI,IAAI,YAAY,OAAO,EAAE,CAAC;QAE5B,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrC,IACE,IAAI,KAAK,UAAU;gBACnB,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,KAAK;gBACd,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,WAA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AAC,CAAC"}
|
|
@@ -4,7 +4,6 @@ export const setRef = (ref, value) => {
|
|
|
4
4
|
ref(value);
|
|
5
5
|
}
|
|
6
6
|
else if (ref != null) {
|
|
7
|
-
// Cast as a MutableRef so we can assign current
|
|
8
7
|
ref.current = value;
|
|
9
8
|
}
|
|
10
9
|
};
|
|
@@ -17,7 +16,7 @@ export const mergeRefs = (...refs) => {
|
|
|
17
16
|
};
|
|
18
17
|
export const createForwardRef = (ReactComponent, displayName) => {
|
|
19
18
|
const forwardRef = (props, ref) => {
|
|
20
|
-
return React.createElement(ReactComponent,
|
|
19
|
+
return React.createElement(ReactComponent, { ...props, forwardedRef: ref });
|
|
21
20
|
};
|
|
22
21
|
forwardRef.displayName = displayName;
|
|
23
22
|
return React.forwardRef(forwardRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/stencil-generated/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAA+D,EAAE,KAAU,EAAE,EAAE;IACpG,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,CAAC;IACb,CAAC;SAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/stencil-generated/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAA+D,EAAE,KAAU,EAAE,EAAE;IACpG,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,CAAC;IACb,CAAC;SAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAEtB,GAAmC,CAAC,OAAO,GAAG,KAAK,CAAC;IACvD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,GAAG,IAAoE,EAC/C,EAAE;IAC1B,OAAO,CAAC,KAAU,EAAE,EAAE;QACpB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAwB,cAAmB,EAAE,WAAmB,EAAE,EAAE;IAClG,MAAM,UAAU,GAAG,CACjB,KAAuD,EACvD,GAA0C,EAC1C,EAAE;QACF,OAAO,oBAAC,cAAc,OAAK,KAAK,EAAE,YAAY,EAAE,GAAG,GAAI,CAAC;IAC1D,CAAC,CAAC;IACF,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC;IAErC,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,aAAkB,EAAE,EAAE;IACzE,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACzG,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"}
|
|
@@ -5,13 +5,17 @@ export declare const PostAvatar: import("react").ForwardRefExoticComponent<JSX.P
|
|
|
5
5
|
export declare const PostBackToTop: import("react").ForwardRefExoticComponent<JSX.PostBackToTop & Omit<import("react").HTMLAttributes<HTMLPostBackToTopElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostBackToTopElement>>;
|
|
6
6
|
export declare const PostBanner: import("react").ForwardRefExoticComponent<JSX.PostBanner & Omit<import("react").HTMLAttributes<HTMLPostBannerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostBannerElement>>;
|
|
7
7
|
export declare const PostBreadcrumbItem: import("react").ForwardRefExoticComponent<JSX.PostBreadcrumbItem & Omit<import("react").HTMLAttributes<HTMLPostBreadcrumbItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostBreadcrumbItemElement>>;
|
|
8
|
+
export declare const PostBreadcrumbs: import("react").ForwardRefExoticComponent<JSX.PostBreadcrumbs & Omit<import("react").HTMLAttributes<HTMLPostBreadcrumbsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostBreadcrumbsElement>>;
|
|
8
9
|
export declare const PostCardControl: import("react").ForwardRefExoticComponent<JSX.PostCardControl & Omit<import("react").HTMLAttributes<HTMLPostCardControlElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostCardControlElement>>;
|
|
9
10
|
export declare const PostClosebutton: import("react").ForwardRefExoticComponent<JSX.PostClosebutton & Omit<import("react").HTMLAttributes<HTMLPostClosebuttonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostClosebuttonElement>>;
|
|
10
11
|
export declare const PostCollapsible: import("react").ForwardRefExoticComponent<JSX.PostCollapsible & Omit<import("react").HTMLAttributes<HTMLPostCollapsibleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostCollapsibleElement>>;
|
|
11
12
|
export declare const PostCollapsibleTrigger: import("react").ForwardRefExoticComponent<JSX.PostCollapsibleTrigger & Omit<import("react").HTMLAttributes<HTMLPostCollapsibleTriggerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostCollapsibleTriggerElement>>;
|
|
13
|
+
export declare const PostFooter: import("react").ForwardRefExoticComponent<JSX.PostFooter & Omit<import("react").HTMLAttributes<HTMLPostFooterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostFooterElement>>;
|
|
12
14
|
export declare const PostHeader: import("react").ForwardRefExoticComponent<JSX.PostHeader & Omit<import("react").HTMLAttributes<HTMLPostHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostHeaderElement>>;
|
|
13
15
|
export declare const PostIcon: import("react").ForwardRefExoticComponent<JSX.PostIcon & Omit<import("react").HTMLAttributes<HTMLPostIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostIconElement>>;
|
|
14
16
|
export declare const PostLanguageOption: import("react").ForwardRefExoticComponent<JSX.PostLanguageOption & Omit<import("react").HTMLAttributes<HTMLPostLanguageOptionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostLanguageOptionElement>>;
|
|
17
|
+
export declare const PostLanguageSwitch: import("react").ForwardRefExoticComponent<JSX.PostLanguageSwitch & Omit<import("react").HTMLAttributes<HTMLPostLanguageSwitchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostLanguageSwitchElement>>;
|
|
18
|
+
export declare const PostLinkarea: import("react").ForwardRefExoticComponent<JSX.PostLinkarea & Omit<import("react").HTMLAttributes<HTMLPostLinkareaElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostLinkareaElement>>;
|
|
15
19
|
export declare const PostList: import("react").ForwardRefExoticComponent<JSX.PostList & Omit<import("react").HTMLAttributes<HTMLPostListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostListElement>>;
|
|
16
20
|
export declare const PostListItem: import("react").ForwardRefExoticComponent<JSX.PostListItem & Omit<import("react").HTMLAttributes<HTMLPostListItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostListItemElement>>;
|
|
17
21
|
export declare const PostLogo: import("react").ForwardRefExoticComponent<JSX.PostLogo & Omit<import("react").HTMLAttributes<HTMLPostLogoElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostLogoElement>>;
|
|
@@ -30,3 +34,4 @@ export declare const PostTabs: import("react").ForwardRefExoticComponent<JSX.Pos
|
|
|
30
34
|
export declare const PostTag: import("react").ForwardRefExoticComponent<JSX.PostTag & Omit<import("react").HTMLAttributes<HTMLPostTagElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostTagElement>>;
|
|
31
35
|
export declare const PostTogglebutton: import("react").ForwardRefExoticComponent<JSX.PostTogglebutton & Omit<import("react").HTMLAttributes<HTMLPostTogglebuttonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostTogglebuttonElement>>;
|
|
32
36
|
export declare const PostTooltip: import("react").ForwardRefExoticComponent<JSX.PostTooltip & Omit<import("react").HTMLAttributes<HTMLPostTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostTooltipElement>>;
|
|
37
|
+
export declare const PostTooltipTrigger: import("react").ForwardRefExoticComponent<JSX.PostTooltipTrigger & Omit<import("react").HTMLAttributes<HTMLPostTooltipTriggerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLPostTooltipTriggerElement>>;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
|
2
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
3
|
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
4
|
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
|
12
5
|
export declare const syncEvent: (node: Element & {
|
|
13
6
|
__events?: {
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-next.37",
|
|
4
4
|
"description": "Design System React Components for easy integration with the React ecosystem",
|
|
5
5
|
"author": "Swiss Post <design-system@post.ch>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
+
"private": false,
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "https://github.com/swisspost/design-system.git"
|
|
@@ -12,34 +13,32 @@
|
|
|
12
13
|
"bugs": {
|
|
13
14
|
"url": "https://github.com/swisspost/design-system/issues"
|
|
14
15
|
},
|
|
15
|
-
"main": "dist/index.js",
|
|
16
|
-
"types": "dist/index.d.ts",
|
|
17
|
-
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
],
|
|
20
16
|
"publishConfig": {
|
|
21
17
|
"access": "public",
|
|
22
18
|
"linkDirectory": true
|
|
23
19
|
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"main": "dist/index.js",
|
|
24
|
+
"types": "dist/types/index.d.ts",
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@swisspost/design-system-components": "
|
|
26
|
+
"@swisspost/design-system-components": "10.0.0-next.37"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
+
"@eslint/js": "9.18.0",
|
|
30
|
+
"@stencil/react-output-target": "0.5.3",
|
|
31
|
+
"@types/node": "22.10.5",
|
|
29
32
|
"@types/react": "18.3.3",
|
|
30
|
-
"@types/react-dom": "18.3.
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"eslint-config-love": "43.1.0",
|
|
35
|
-
"eslint-plugin-import": "2.29.1",
|
|
36
|
-
"eslint-plugin-n": "16.6.2",
|
|
37
|
-
"eslint-plugin-promise": "6.6.0",
|
|
38
|
-
"eslint-plugin-react": "7.35.0",
|
|
33
|
+
"@types/react-dom": "18.3.5",
|
|
34
|
+
"eslint": "9.18.0",
|
|
35
|
+
"eslint-plugin-react": "7.37.4",
|
|
36
|
+
"globals": "16.0.0",
|
|
39
37
|
"react": "18.3.1",
|
|
40
38
|
"react-dom": "18.3.1",
|
|
41
39
|
"rimraf": "6.0.1",
|
|
42
|
-
"typescript": "
|
|
40
|
+
"typescript": "5.8.3",
|
|
41
|
+
"typescript-eslint": "8.20.0"
|
|
43
42
|
},
|
|
44
43
|
"peerDependencies": {
|
|
45
44
|
"react": "18.3.1",
|
|
@@ -53,10 +52,9 @@
|
|
|
53
52
|
"frontend"
|
|
54
53
|
],
|
|
55
54
|
"scripts": {
|
|
56
|
-
"build": "pnpm run clean &&
|
|
55
|
+
"build": "pnpm run clean && tsc -p .",
|
|
57
56
|
"clean": "rimraf dist",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"lint": "eslint src/**/*.ts"
|
|
57
|
+
"lint": "eslint",
|
|
58
|
+
"lint:fix": "eslint --fix"
|
|
61
59
|
}
|
|
62
60
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components → types/components}/stencil-generated/react-component-lib/index.d.ts
RENAMED
|
File without changes
|
/package/dist/{components → types/components}/stencil-generated/react-component-lib/interfaces.d.ts
RENAMED
|
File without changes
|
/package/dist/{components → types/components}/stencil-generated/react-component-lib/utils/case.d.ts
RENAMED
|
File without changes
|
/package/dist/{components → types/components}/stencil-generated/react-component-lib/utils/dev.d.ts
RENAMED
|
File without changes
|
/package/dist/{components → types/components}/stencil-generated/react-component-lib/utils/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|