@quartzds/core-react 1.0.0-beta.1

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.
Files changed (42) hide show
  1. package/README.md +74 -0
  2. package/lib/generated/proxies.d.ts +13 -0
  3. package/lib/generated/proxies.d.ts.map +1 -0
  4. package/lib/generated/proxies.js +27 -0
  5. package/lib/generated/proxies.js.map +1 -0
  6. package/lib/generated/react-component-lib/createComponent.d.ts +11 -0
  7. package/lib/generated/react-component-lib/createComponent.d.ts.map +1 -0
  8. package/lib/generated/react-component-lib/createComponent.js +68 -0
  9. package/lib/generated/react-component-lib/createComponent.js.map +1 -0
  10. package/lib/generated/react-component-lib/createOverlayComponent.d.ts +22 -0
  11. package/lib/generated/react-component-lib/createOverlayComponent.d.ts.map +1 -0
  12. package/lib/generated/react-component-lib/createOverlayComponent.js +96 -0
  13. package/lib/generated/react-component-lib/createOverlayComponent.js.map +1 -0
  14. package/lib/generated/react-component-lib/index.d.ts +3 -0
  15. package/lib/generated/react-component-lib/index.d.ts.map +1 -0
  16. package/lib/generated/react-component-lib/index.js +3 -0
  17. package/lib/generated/react-component-lib/index.js.map +1 -0
  18. package/lib/generated/react-component-lib/interfaces.d.ts +30 -0
  19. package/lib/generated/react-component-lib/interfaces.d.ts.map +1 -0
  20. package/lib/generated/react-component-lib/interfaces.js +2 -0
  21. package/lib/generated/react-component-lib/interfaces.js.map +1 -0
  22. package/lib/generated/react-component-lib/utils/attachProps.d.ts +13 -0
  23. package/lib/generated/react-component-lib/utils/attachProps.d.ts.map +1 -0
  24. package/lib/generated/react-component-lib/utils/attachProps.js +98 -0
  25. package/lib/generated/react-component-lib/utils/attachProps.js.map +1 -0
  26. package/lib/generated/react-component-lib/utils/case.d.ts +3 -0
  27. package/lib/generated/react-component-lib/utils/case.d.ts.map +1 -0
  28. package/lib/generated/react-component-lib/utils/case.js +7 -0
  29. package/lib/generated/react-component-lib/utils/case.js.map +1 -0
  30. package/lib/generated/react-component-lib/utils/dev.d.ts +3 -0
  31. package/lib/generated/react-component-lib/utils/dev.d.ts.map +1 -0
  32. package/lib/generated/react-component-lib/utils/dev.js +13 -0
  33. package/lib/generated/react-component-lib/utils/dev.js.map +1 -0
  34. package/lib/generated/react-component-lib/utils/index.d.ts +11 -0
  35. package/lib/generated/react-component-lib/utils/index.d.ts.map +1 -0
  36. package/lib/generated/react-component-lib/utils/index.js +32 -0
  37. package/lib/generated/react-component-lib/utils/index.js.map +1 -0
  38. package/lib/index.d.ts +3 -0
  39. package/lib/index.d.ts.map +1 -0
  40. package/lib/index.js +6 -0
  41. package/lib/index.js.map +1 -0
  42. package/package.json +54 -0
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: © 2023 Schneider Electric
3
+
4
+ SPDX-License-Identifier: LGPL-2.1-only
5
+ -->
6
+
7
+ # `@quartzds/core-react`
8
+
9
+ [![NPM Package][npm-badge]][npm-link]
10
+ [![License][license-badge]][license]
11
+
12
+ React wrapper for [Quartz design system][] web components.
13
+
14
+ ## 💿 Installation
15
+
16
+ ```bash
17
+ npm install @quartzds/core-react react react-dom
18
+ ```
19
+
20
+ ## 📖 Usage
21
+
22
+ ### Importing Components
23
+
24
+ Every Quartz core component is available to import as a React component. Note
25
+ that we're importing the `<QdsButton>` _React component_ instead of the
26
+ `<qds-button>` _custom element_ in the example below:
27
+
28
+ ```jsx
29
+ import { QdsButton } from '@quartzds/core-react'
30
+
31
+ const MyComponent = () => (
32
+ <QdsButton importance="emphasized" text="Click me"></QdsButton>
33
+ )
34
+
35
+ export default MyComponent
36
+ ```
37
+
38
+ ### Event Handling
39
+
40
+ Many Quartz core components emit [custom events][]. For example, the
41
+ [input component][] emits the `qdsInput` event when it receives input. In React,
42
+ you can listen to the event using `onQdsInput`.
43
+
44
+ Here's how you can bind the input's value to a state variable:
45
+
46
+ ```jsx
47
+ import { useState } from 'react'
48
+ import { QdsInput } from '@quartzds/core-react'
49
+
50
+ function MyComponent() {
51
+ const [value, setValue] = useState('')
52
+
53
+ return (
54
+ <QdsInput
55
+ value={value}
56
+ onQdsInput={(event) => setValue(event.target.value)}
57
+ />
58
+ )
59
+ }
60
+
61
+ export default MyComponent
62
+ ```
63
+
64
+ ## ⚖️ License
65
+
66
+ See the [LICENSE][] file for license rights and limitations.
67
+
68
+ [npm-badge]: https://img.shields.io/npm/v/@quartzds/core-react?logo=npm
69
+ [npm-link]: https://www.npmjs.com/package/@quartzds/core-react
70
+ [license-badge]: https://img.shields.io/npm/l/@quartzds/core-react?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PHBhdGggZD0ibTIzLjkgOS43LTMuNTQtNy44OS0uMDA1LS4wMWEuNTQyLjU0MiAwIDAgMC0uMDQxLS4wNzZsLS4wMTQtLjAxOGEuNTMzLjUzMyAwIDAgMC0uMTIyLS4xMjJsLS4wMTUtLjAxMWEuNTI4LjUyOCAwIDAgMC0uMDgtLjA0NGwtLjAyNC0uMDA5YS41MjcuNTI3IDAgMCAwLS4wNjctLjAybC0uMDI4LS4wMDdhLjUyNC41MjQgMCAwIDAtLjA5Ni0uMDFoLTYuODVjLTEuMDItMS41Mi0xLjAyLTEuNTQtMiAwaC02Ljg2YS41NDMuNTQzIDAgMCAwLS4wOTYuMDFsLS4wMjguMDA3YS41MTYuNTE2IDAgMCAwLS4wNjcuMDJsLS4wMjQuMDFhLjUzNy41MzcgMCAwIDAtLjA4LjA0M2wtLjAxNS4wMTFhLjUxLjUxIDAgMCAwLS4wNTcuMDQ3bC0uMDIuMDJhLjU0My41NDMgMCAwIDAtLjA0NS4wNTVsLS4wMTQuMDE4YS41MjIuNTIyIDAgMCAwLS4wNDEuMDc1bC0uMDA1LjAxdi4wMDFMLjExNiA5LjcyYS41MzEuNTMxIDAgMCAwLS4wOTYuMzA0YzAgMi4yOCAxLjg2IDQuMTQgNC4xNCA0LjE0czQuMTQtMS44NiA0LjE0LTQuMTRhLjUzLjUzIDAgMCAwLS4wOTYtLjMwNGwtMy4yNS02LjM3IDYuMDctLjAyM3YxOC4yYy0yLjU1LjI5NC03LjAxLjM4MS03IDIuNWgxNmMwLTIuMDMtNC40OC0yLjI3LTctMi41di0xOC4xbDUuNjktLjAyLTIuOTIgNi40OWMwIC4wMDIgMCAuMDAzLS4wMDIuMDA1bC0uMDA2LjAxOGEuNTQ1LjU0NSAwIDAgMC0uMDIzLjA3NWwtLjAwNS4wMmEuNTI0LjUyNCAwIDAgMC0uMDEuMDkydi4wMDhjMCAyLjI4IDEuODYgNC4xNCA0LjE0IDQuMTQgMi4yOCAwIDQuMTQtMS44NiA0LjE0LTQuMTRhLjUyOC41MjggMCAwIDAtLjEyLS4zMzJ6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+
71
+ [license]: /LICENSE
72
+ [quartz design system]: https://github.com/quartzds
73
+ [custom events]: https://developer.mozilla.org/docs/Web/API/CustomEvent
74
+ [input component]: /core/src/components/input/
@@ -0,0 +1,13 @@
1
+ import type { JSX } from '@quartzds/core/components';
2
+ export declare const QdsButton: import("react").ForwardRefExoticComponent<JSX.QdsButton & Omit<import("react").HTMLAttributes<HTMLQdsButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsButtonElement>>;
3
+ export declare const QdsCheckbox: import("react").ForwardRefExoticComponent<JSX.QdsCheckbox & Omit<import("react").HTMLAttributes<HTMLQdsCheckboxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsCheckboxElement>>;
4
+ export declare const QdsDropdown: import("react").ForwardRefExoticComponent<JSX.QdsDropdown & Omit<import("react").HTMLAttributes<HTMLQdsDropdownElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsDropdownElement>>;
5
+ export declare const QdsIcon: import("react").ForwardRefExoticComponent<JSX.QdsIcon & Omit<import("react").HTMLAttributes<HTMLQdsIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsIconElement>>;
6
+ export declare const QdsInlineLink: import("react").ForwardRefExoticComponent<JSX.QdsInlineLink & Omit<import("react").HTMLAttributes<HTMLQdsInlineLinkElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsInlineLinkElement>>;
7
+ export declare const QdsInput: import("react").ForwardRefExoticComponent<JSX.QdsInput & Omit<import("react").HTMLAttributes<HTMLQdsInputElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsInputElement>>;
8
+ export declare const QdsLabel: import("react").ForwardRefExoticComponent<JSX.QdsLabel & Omit<import("react").HTMLAttributes<HTMLQdsLabelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsLabelElement>>;
9
+ export declare const QdsRadio: import("react").ForwardRefExoticComponent<JSX.QdsRadio & Omit<import("react").HTMLAttributes<HTMLQdsRadioElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsRadioElement>>;
10
+ export declare const QdsSwitch: import("react").ForwardRefExoticComponent<JSX.QdsSwitch & Omit<import("react").HTMLAttributes<HTMLQdsSwitchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsSwitchElement>>;
11
+ export declare const QdsTitle: import("react").ForwardRefExoticComponent<JSX.QdsTitle & Omit<import("react").HTMLAttributes<HTMLQdsTitleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsTitleElement>>;
12
+ export declare const QdsTooltip: import("react").ForwardRefExoticComponent<JSX.QdsTooltip & Omit<import("react").HTMLAttributes<HTMLQdsTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLQdsTooltipElement>>;
13
+ //# sourceMappingURL=proxies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxies.d.ts","sourceRoot":"","sources":["../../src/generated/proxies.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAcrD,eAAO,MAAM,SAAS,mPAA8H,CAAC;AACrJ,eAAO,MAAM,WAAW,yPAAsI,CAAC;AAC/J,eAAO,MAAM,WAAW,yPAAsI,CAAC;AAC/J,eAAO,MAAM,OAAO,6OAAsH,CAAC;AAC3I,eAAO,MAAM,aAAa,+PAA+I,CAAC;AAC1K,eAAO,MAAM,QAAQ,gPAA0H,CAAC;AAChJ,eAAO,MAAM,QAAQ,gPAA0H,CAAC;AAChJ,eAAO,MAAM,QAAQ,gPAA0H,CAAC;AAChJ,eAAO,MAAM,SAAS,mPAA8H,CAAC;AACrJ,eAAO,MAAM,QAAQ,gPAA0H,CAAC;AAChJ,eAAO,MAAM,UAAU,sPAAkI,CAAC"}
@@ -0,0 +1,27 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /* auto-generated react proxies */
4
+ import { createReactComponent } from './react-component-lib';
5
+ import { defineCustomElement as defineQdsButton } from '@quartzds/core/components/qds-button.js';
6
+ import { defineCustomElement as defineQdsCheckbox } from '@quartzds/core/components/qds-checkbox.js';
7
+ import { defineCustomElement as defineQdsDropdown } from '@quartzds/core/components/qds-dropdown.js';
8
+ import { defineCustomElement as defineQdsIcon } from '@quartzds/core/components/qds-icon.js';
9
+ import { defineCustomElement as defineQdsInlineLink } from '@quartzds/core/components/qds-inline-link.js';
10
+ import { defineCustomElement as defineQdsInput } from '@quartzds/core/components/qds-input.js';
11
+ import { defineCustomElement as defineQdsLabel } from '@quartzds/core/components/qds-label.js';
12
+ import { defineCustomElement as defineQdsRadio } from '@quartzds/core/components/qds-radio.js';
13
+ import { defineCustomElement as defineQdsSwitch } from '@quartzds/core/components/qds-switch.js';
14
+ import { defineCustomElement as defineQdsTitle } from '@quartzds/core/components/qds-title.js';
15
+ import { defineCustomElement as defineQdsTooltip } from '@quartzds/core/components/qds-tooltip.js';
16
+ export const QdsButton = /*@__PURE__*/ createReactComponent('qds-button', undefined, undefined, defineQdsButton);
17
+ export const QdsCheckbox = /*@__PURE__*/ createReactComponent('qds-checkbox', undefined, undefined, defineQdsCheckbox);
18
+ export const QdsDropdown = /*@__PURE__*/ createReactComponent('qds-dropdown', undefined, undefined, defineQdsDropdown);
19
+ export const QdsIcon = /*@__PURE__*/ createReactComponent('qds-icon', undefined, undefined, defineQdsIcon);
20
+ export const QdsInlineLink = /*@__PURE__*/ createReactComponent('qds-inline-link', undefined, undefined, defineQdsInlineLink);
21
+ export const QdsInput = /*@__PURE__*/ createReactComponent('qds-input', undefined, undefined, defineQdsInput);
22
+ export const QdsLabel = /*@__PURE__*/ createReactComponent('qds-label', undefined, undefined, defineQdsLabel);
23
+ export const QdsRadio = /*@__PURE__*/ createReactComponent('qds-radio', undefined, undefined, defineQdsRadio);
24
+ export const QdsSwitch = /*@__PURE__*/ createReactComponent('qds-switch', undefined, undefined, defineQdsSwitch);
25
+ export const QdsTitle = /*@__PURE__*/ createReactComponent('qds-title', undefined, undefined, defineQdsTitle);
26
+ export const QdsTooltip = /*@__PURE__*/ createReactComponent('qds-tooltip', undefined, undefined, defineQdsTooltip);
27
+ //# sourceMappingURL=proxies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxies.js","sourceRoot":"","sources":["../../src/generated/proxies.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,kCAAkC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,mBAAmB,IAAI,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACrG,OAAO,EAAE,mBAAmB,IAAI,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACrG,OAAO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c,CAAC,CAAC;AAChJ,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAA,oBAAoB,CAAoC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AAChJ,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAA,oBAAoB,CAAoC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AAChJ,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAA,oBAAoB,CAAsC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AACrJ,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAA,oBAAoB,CAAoC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AAChJ,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAA,oBAAoB,CAAwC,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface HTMLStencilElement extends HTMLElement {
3
+ componentOnReady(): Promise<this>;
4
+ }
5
+ interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
6
+ forwardedRef: React.RefObject<ElementType>;
7
+ ref?: React.Ref<any>;
8
+ }
9
+ export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
10
+ export {};
11
+ //# sourceMappingURL=createComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../../../src/generated/react-component-lib/createComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAI7C,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,UAAU,yBAAyB,CAAC,WAAW,CAAE,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACxF,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACtB;AAED,eAAO,MAAM,oBAAoB,8GAMtB,MAAM,0JAIA,GAAG,+CAEI,MAAM,IAAI,kKAgFjC,CAAC"}
@@ -0,0 +1,68 @@
1
+ import React, { createElement } from 'react';
2
+ import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
3
+ export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
4
+ if (defineCustomElement !== undefined) {
5
+ defineCustomElement();
6
+ }
7
+ const displayName = dashToPascalCase(tagName);
8
+ const ReactComponent = class extends React.Component {
9
+ constructor(props) {
10
+ super(props);
11
+ this.setComponentElRef = (element) => {
12
+ this.componentEl = element;
13
+ };
14
+ }
15
+ componentDidMount() {
16
+ this.componentDidUpdate(this.props);
17
+ }
18
+ componentDidUpdate(prevProps) {
19
+ attachProps(this.componentEl, this.props, prevProps);
20
+ }
21
+ render() {
22
+ const { children, forwardedRef, style, className, ref, ...cProps } = this.props;
23
+ let propsToPass = Object.keys(cProps).reduce((acc, name) => {
24
+ const value = cProps[name];
25
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
26
+ const eventName = name.substring(2).toLowerCase();
27
+ if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
28
+ acc[name] = value;
29
+ }
30
+ }
31
+ else {
32
+ // we should only render strings, booleans, and numbers as attrs in html.
33
+ // objects, functions, arrays etc get synced via properties on mount.
34
+ const type = typeof value;
35
+ if (type === 'string' || type === 'boolean' || type === 'number') {
36
+ acc[camelToDashCase(name)] = value;
37
+ }
38
+ }
39
+ return acc;
40
+ }, {});
41
+ if (manipulatePropsFunction) {
42
+ propsToPass = manipulatePropsFunction(this.props, propsToPass);
43
+ }
44
+ const newProps = {
45
+ ...propsToPass,
46
+ ref: mergeRefs(forwardedRef, this.setComponentElRef),
47
+ style,
48
+ };
49
+ /**
50
+ * We use createElement here instead of
51
+ * React.createElement to work around a
52
+ * bug in Vite (https://github.com/vitejs/vite/issues/6104).
53
+ * React.createElement causes all elements to be rendered
54
+ * as <tagname> instead of the actual Web Component.
55
+ */
56
+ return createElement(tagName, newProps, children);
57
+ }
58
+ static get displayName() {
59
+ return displayName;
60
+ }
61
+ };
62
+ // If context was passed to createReactComponent then conditionally add it to the Component Class
63
+ if (ReactComponentContext) {
64
+ ReactComponent.contextType = ReactComponentContext;
65
+ }
66
+ return createForwardRef(ReactComponent, displayName);
67
+ };
68
+ //# sourceMappingURL=createComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../../src/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;QACrC,mBAAmB,EAAE,CAAC;KACvB;IAED,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,KAAM,SAAQ,KAAK,CAAC,SAAiD;QAO1F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;wBAChE,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;qBACpC;iBACF;gBACD,OAAO,GAAG,CAAC;YACb,CAAC,EAAE,EAAwB,CAAC,CAAC;YAE7B,IAAI,uBAAuB,EAAE;gBAC3B,WAAW,GAAG,uBAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;aAChE;YAED,MAAM,QAAQ,GAAiE;gBAC7E,GAAG,WAAW;gBACd,GAAG,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC;gBACpD,KAAK;aACN,CAAC;YAEF;;;;;;eAMG;YACH,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,KAAK,WAAW;YACpB,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,iGAAiG;IACjG,IAAI,qBAAqB,EAAE;QACzB,cAAc,CAAC,WAAW,GAAG,qBAAqB,CAAC;KACpD;IAED,OAAO,gBAAgB,CAAwB,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9E,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { OverlayEventDetail } from './interfaces';
3
+ import { StencilReactForwardedRef } from './utils';
4
+ interface OverlayElement extends HTMLElement {
5
+ present: () => Promise<void>;
6
+ dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
7
+ }
8
+ export interface ReactOverlayProps {
9
+ children?: React.ReactNode;
10
+ isOpen: boolean;
11
+ onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
12
+ onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
13
+ onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
14
+ onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
15
+ }
16
+ export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
17
+ create: (options: any) => Promise<OverlayType>;
18
+ }, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
19
+ forwardedRef?: StencilReactForwardedRef<OverlayType>;
20
+ }> & React.RefAttributes<OverlayType>>;
21
+ export {};
22
+ //# sourceMappingURL=createOverlayComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOverlayComponent.d.ts","sourceRoot":"","sources":["../../../src/generated/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAA8D,MAAM,SAAS,CAAC;AAE/G,UAAU,cAAe,SAAQ,WAAW;IAC1C,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACtE;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAChE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAChE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;CAClE;AAED,eAAO,MAAM,sBAAsB,iFACxB,MAAM;sBACiB,GAAG;mBACnB,GAAG;;sCAsHpB,CAAC"}
@@ -0,0 +1,96 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
4
+ export const createOverlayComponent = (tagName, controller, customElement) => {
5
+ defineCustomElement(tagName, customElement);
6
+ const displayName = dashToPascalCase(tagName);
7
+ const didDismissEventName = `on${displayName}DidDismiss`;
8
+ const didPresentEventName = `on${displayName}DidPresent`;
9
+ const willDismissEventName = `on${displayName}WillDismiss`;
10
+ const willPresentEventName = `on${displayName}WillPresent`;
11
+ let isDismissing = false;
12
+ class Overlay extends React.Component {
13
+ constructor(props) {
14
+ super(props);
15
+ if (typeof document !== 'undefined') {
16
+ this.el = document.createElement('div');
17
+ }
18
+ this.handleDismiss = this.handleDismiss.bind(this);
19
+ }
20
+ static get displayName() {
21
+ return displayName;
22
+ }
23
+ componentDidMount() {
24
+ if (this.props.isOpen) {
25
+ this.present();
26
+ }
27
+ }
28
+ componentWillUnmount() {
29
+ if (this.overlay) {
30
+ this.overlay.dismiss();
31
+ }
32
+ }
33
+ handleDismiss(event) {
34
+ if (this.props.onDidDismiss) {
35
+ this.props.onDidDismiss(event);
36
+ }
37
+ setRef(this.props.forwardedRef, null);
38
+ }
39
+ shouldComponentUpdate(nextProps) {
40
+ // Check if the overlay component is about to dismiss
41
+ if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
42
+ isDismissing = true;
43
+ }
44
+ return true;
45
+ }
46
+ async componentDidUpdate(prevProps) {
47
+ if (this.overlay) {
48
+ attachProps(this.overlay, this.props, prevProps);
49
+ }
50
+ if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
51
+ this.present(prevProps);
52
+ }
53
+ if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
54
+ await this.overlay.dismiss();
55
+ isDismissing = false;
56
+ /**
57
+ * Now that the overlay is dismissed
58
+ * we need to render again so that any
59
+ * inner components will be unmounted
60
+ */
61
+ this.forceUpdate();
62
+ }
63
+ }
64
+ async present(prevProps) {
65
+ const { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, ...cProps } = this.props;
66
+ const elementProps = {
67
+ ...cProps,
68
+ ref: this.props.forwardedRef,
69
+ [didDismissEventName]: this.handleDismiss,
70
+ [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e),
71
+ [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e),
72
+ [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e),
73
+ };
74
+ this.overlay = await controller.create({
75
+ ...elementProps,
76
+ component: this.el,
77
+ componentProps: {},
78
+ });
79
+ setRef(this.props.forwardedRef, this.overlay);
80
+ attachProps(this.overlay, elementProps, prevProps);
81
+ await this.overlay.present();
82
+ }
83
+ render() {
84
+ /**
85
+ * Continue to render the component even when
86
+ * overlay is dismissing otherwise component
87
+ * will be hidden before animation is done.
88
+ */
89
+ return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
90
+ }
91
+ }
92
+ return React.forwardRef((props, ref) => {
93
+ return React.createElement(Overlay, { ...props, forwardedRef: ref });
94
+ });
95
+ };
96
+ //# sourceMappingURL=createOverlayComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../../src/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,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,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;gBACnG,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;aACpG,CAAC;YAEF,IAAI,CAAC,OAAO,GAAG,MAAM,UAAU,CAAC,MAAM,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;YACJ;;;;eAIG;YACH,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"}
@@ -0,0 +1,3 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,30 @@
1
+ export interface EventEmitter<T = any> {
2
+ emit: (data?: T) => CustomEvent<T>;
3
+ }
4
+ export interface StyleReactProps {
5
+ class?: string;
6
+ className?: string;
7
+ style?: {
8
+ [key: string]: any;
9
+ };
10
+ }
11
+ export interface OverlayEventDetail<T = any> {
12
+ data?: T;
13
+ role?: string;
14
+ }
15
+ export interface OverlayInterface {
16
+ el: HTMLElement;
17
+ animated: boolean;
18
+ keyboardClose: boolean;
19
+ overlayIndex: number;
20
+ presented: boolean;
21
+ enterAnimation?: any;
22
+ leaveAnimation?: any;
23
+ didPresent: EventEmitter<void>;
24
+ willPresent: EventEmitter<void>;
25
+ willDismiss: EventEmitter<OverlayEventDetail>;
26
+ didDismiss: EventEmitter<OverlayEventDetail>;
27
+ present(): Promise<void>;
28
+ dismiss(data?: any, role?: string): Promise<boolean>;
29
+ }
30
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/generated/react-component-lib/interfaces.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACnC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG;IACzC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,WAAW,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IAEnB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,cAAc,CAAC,EAAE,GAAG,CAAC;IAErB,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/B,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,WAAW,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC9C,UAAU,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE7C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/generated/react-component-lib/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
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
+ * Checks if an event is supported in the current execution environment.
5
+ * @license Modernizr 3.0.0pre (Custom Build) | MIT
6
+ */
7
+ export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
8
+ export declare const syncEvent: (node: Element & {
9
+ __events?: {
10
+ [key: string]: (e: Event) => any;
11
+ };
12
+ }, eventName: string, newEventHandler?: (e: Event) => any) => void;
13
+ //# sourceMappingURL=attachProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachProps.d.ts","sourceRoot":"","sources":["../../../../src/generated/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,SAAU,WAAW,YAAY,GAAG,aAAY,GAAG,SAoC1E,CAAC;AAEF,eAAO,MAAM,YAAY,cAAe,YAAY,YAAY,GAAG,YAAY,GAAG,WAsBjF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,oBAAqB,MAAM,YAevD,CAAC;AAEF,eAAO,MAAM,SAAS;;2BAC+B,KAAK,KAAK,GAAG;;cACrD,MAAM,wBACK,KAAK,KAAK,GAAG,SAmBpC,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { camelToDashCase } from './case';
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
+ if (node instanceof Element) {
5
+ // add any classes in className to the class list
6
+ const className = getClassName(node.classList, newProps, oldProps);
7
+ if (className !== '') {
8
+ node.className = className;
9
+ }
10
+ Object.keys(newProps).forEach((name) => {
11
+ if (name === 'children' ||
12
+ name === 'style' ||
13
+ name === 'ref' ||
14
+ name === 'class' ||
15
+ name === 'className' ||
16
+ name === 'forwardedRef') {
17
+ return;
18
+ }
19
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
20
+ const eventName = name.substring(2);
21
+ const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
22
+ if (!isCoveredByReact(eventNameLc)) {
23
+ syncEvent(node, eventNameLc, newProps[name]);
24
+ }
25
+ }
26
+ else {
27
+ node[name] = newProps[name];
28
+ const propType = typeof newProps[name];
29
+ if (propType === 'string') {
30
+ node.setAttribute(camelToDashCase(name), newProps[name]);
31
+ }
32
+ }
33
+ });
34
+ }
35
+ };
36
+ export const getClassName = (classList, newProps, oldProps) => {
37
+ const newClassProp = newProps.className || newProps.class;
38
+ const oldClassProp = oldProps.className || oldProps.class;
39
+ // map the classes to Maps for performance
40
+ const currentClasses = arrayToMap(classList);
41
+ const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
42
+ const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
43
+ 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
+ currentClasses.forEach((currentClass) => {
47
+ if (incomingPropClasses.has(currentClass)) {
48
+ // add it as its already included in classnames coming in from newProps
49
+ finalClassNames.push(currentClass);
50
+ incomingPropClasses.delete(currentClass);
51
+ }
52
+ else if (!oldPropClasses.has(currentClass)) {
53
+ // add it as it has NOT been removed by user
54
+ finalClassNames.push(currentClass);
55
+ }
56
+ });
57
+ incomingPropClasses.forEach((s) => finalClassNames.push(s));
58
+ return finalClassNames.join(' ');
59
+ };
60
+ /**
61
+ * Checks if an event is supported in the current execution environment.
62
+ * @license Modernizr 3.0.0pre (Custom Build) | MIT
63
+ */
64
+ export const isCoveredByReact = (eventNameSuffix) => {
65
+ if (typeof document === 'undefined') {
66
+ return true;
67
+ }
68
+ else {
69
+ const eventName = 'on' + eventNameSuffix;
70
+ let isSupported = eventName in document;
71
+ if (!isSupported) {
72
+ const element = document.createElement('div');
73
+ element.setAttribute(eventName, 'return;');
74
+ isSupported = typeof element[eventName] === 'function';
75
+ }
76
+ return isSupported;
77
+ }
78
+ };
79
+ export const syncEvent = (node, eventName, newEventHandler) => {
80
+ const eventStore = node.__events || (node.__events = {});
81
+ const oldEventHandler = eventStore[eventName];
82
+ // Remove old listener so they don't double up.
83
+ if (oldEventHandler) {
84
+ node.removeEventListener(eventName, oldEventHandler);
85
+ }
86
+ // Bind new listener.
87
+ node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
88
+ if (newEventHandler) {
89
+ newEventHandler.call(this, e);
90
+ }
91
+ }));
92
+ };
93
+ const arrayToMap = (arr) => {
94
+ const map = new Map();
95
+ arr.forEach((s) => map.set(s, s));
96
+ return map;
97
+ };
98
+ //# sourceMappingURL=attachProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../../src/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;IAClF,6GAA6G;IAC7G,IAAI,IAAI,YAAY,OAAO,EAAE;QAC3B,iDAAiD;QACjD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,EAAE,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;SAC5B;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,WAAW;gBACpB,IAAI,KAAK,cAAc,EACvB;gBACA,OAAO;aACR;YACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE;gBACjE,MAAM,SAAS,GAA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EAAE;IACF,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IAE9C,+CAA+C;IAC/C,IAAI,eAAe,EAAE;QACnB,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;KACtD;IAED,qBAAqB;IACrB,IAAI,CAAC,gBAAgB,CACnB,SAAS,EACT,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS,OAAO,CAAC,CAAQ;QAChD,IAAI,eAAe,EAAE;YACnB,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SAC/B;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,GAA4B,EAAE,EAAE;IAClD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;IACrC,GAAgB,CAAC,OAAO,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const dashToPascalCase: (str: string) => string;
2
+ export declare const camelToDashCase: (str: string) => string;
3
+ //# sourceMappingURL=case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../../src/generated/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,QAAS,MAAM,WAK/B,CAAC;AACd,eAAO,MAAM,eAAe,QAAS,MAAM,WAAqE,CAAC"}
@@ -0,0 +1,7 @@
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()}`);
7
+ //# sourceMappingURL=case.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case.js","sourceRoot":"","sources":["../../../../src/generated/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE,CAC9C,GAAG;KACA,WAAW,EAAE;KACb,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const isDevMode: () => boolean;
2
+ export declare const deprecationWarning: (key: string, message: string) => void;
3
+ //# sourceMappingURL=dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../../src/generated/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAErB,CAAC;AAIF,eAAO,MAAM,kBAAkB,QAAS,MAAM,WAAW,MAAM,SAO9D,CAAC"}
@@ -0,0 +1,13 @@
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
+ };
13
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../../src/generated/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,QAAQ,GAA+B,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,EAAE;IACjE,IAAI,SAAS,EAAE,EAAE;QACf,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAClB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;SACtB;KACF;AACH,CAAC,CAAC"}
@@ -0,0 +1,11 @@
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<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
8
+ export declare const defineCustomElement: (tagName: string, customElement: any) => void;
9
+ export * from './attachProps';
10
+ export * from './case';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,MAAM,yBAAyB,CAAC,QAAQ,EAAE,WAAW,IAAI,QAAQ,GACrE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAChD,eAAe,CAAC;AAGlB,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AAEnH,eAAO,MAAM,MAAM,QAAS,yBAAyB,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,SAAS,GAAG,SAOjG,CAAC;AAEF,eAAO,MAAM,SAAS,YACX,CAAC,yBAAyB,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,KACtE,MAAM,WAAW,CAAC,GAAG,CAMvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,0CAA2C,GAAG,eAAe,MAAM,gJAU/F,CAAC;AAEF,eAAO,MAAM,mBAAmB,YAAa,MAAM,iBAAiB,GAAG,SAItE,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,32 @@
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, { ...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';
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/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;QAC7B,GAAG,CAAC,KAAK,CAAC,CAAC;KACZ;SAAM,IAAI,GAAG,IAAI,IAAI,EAAE;QACtB,gDAAgD;QAC/C,GAAmC,CAAC,OAAO,GAAG,KAAK,CAAC;KACtD;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;QACxG,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KAC/C;AACH,CAAC,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './generated/proxies';
2
+ export { getPlatform, getTheme, type IconLibrary, type IconLibraryResolver, registerIconLibrary, setAssetPath, setNonce, setPlatform, setTheme, unregisterIconLibrary, } from '@quartzds/core';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,qBAAqB,GACtB,MAAM,gBAAgB,CAAA"}
package/lib/index.js ADDED
@@ -0,0 +1,6 @@
1
+ // SPDX-FileCopyrightText: © 2023 Schneider Electric
2
+ //
3
+ // SPDX-License-Identifier: LGPL-2.1-only
4
+ export * from './generated/proxies';
5
+ export { getPlatform, getTheme, registerIconLibrary, setAssetPath, setNonce, setPlatform, setTheme, unregisterIconLibrary, } from '@quartzds/core';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,yCAAyC;AAEzC,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACL,WAAW,EACX,QAAQ,EAGR,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,qBAAqB,GACtB,MAAM,gBAAgB,CAAA"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@quartzds/core-react",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "React wrapper for @quartzds/core",
5
+ "homepage": "https://github.com/quartzds/core-foundations/tree/main/packages/react",
6
+ "bugs": {
7
+ "url": "https://github.com/quartzds/core-foundations/issues"
8
+ },
9
+ "repository": "https://github.com/quartzds/core-foundations",
10
+ "license": "LGPL-2.1-only",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./lib/index.d.ts",
14
+ "import": "./lib/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "main": "./lib/index.js",
19
+ "types": "./lib/index.d.ts",
20
+ "files": [
21
+ "lib/**"
22
+ ],
23
+ "scripts": {
24
+ "clean": "rimraf lib/"
25
+ },
26
+ "dependencies": {
27
+ "@quartzds/core": "1.0.0-beta.1"
28
+ },
29
+ "devDependencies": {
30
+ "@types/react": "18.2.6",
31
+ "@types/react-dom": "18.2.4",
32
+ "rimraf": "5.0.1"
33
+ },
34
+ "peerDependencies": {
35
+ "@types/react": ">=17.0.0",
36
+ "@types/react-dom": ">=17.0.0",
37
+ "react": ">=17.0.0",
38
+ "react-dom": ">=17.0.0"
39
+ },
40
+ "peerDependenciesMeta": {
41
+ "@types/react": {
42
+ "optional": true
43
+ },
44
+ "@types/react-dom": {
45
+ "optional": true
46
+ }
47
+ },
48
+ "engines": {
49
+ "node": "^14.20.0 || ^16.13.0 || >=18.10.0"
50
+ },
51
+ "publishConfig": {
52
+ "access": "public"
53
+ }
54
+ }