@public-ui/react 1.1.7-rc.10

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 (101) hide show
  1. package/LICENSE +287 -0
  2. package/README.md +7 -0
  3. package/cjs/index.d.ts +46 -0
  4. package/cjs/index.js +49 -0
  5. package/cjs/index.js.map +1 -0
  6. package/cjs/react-component-lib/createComponent.d.ts +10 -0
  7. package/cjs/react-component-lib/createComponent.js +92 -0
  8. package/cjs/react-component-lib/createComponent.js.map +1 -0
  9. package/cjs/react-component-lib/createOverlayComponent.d.ts +21 -0
  10. package/cjs/react-component-lib/createOverlayComponent.js +105 -0
  11. package/cjs/react-component-lib/createOverlayComponent.js.map +1 -0
  12. package/cjs/react-component-lib/index.d.ts +2 -0
  13. package/cjs/react-component-lib/index.js +8 -0
  14. package/cjs/react-component-lib/index.js.map +1 -0
  15. package/cjs/react-component-lib/interfaces.d.ts +29 -0
  16. package/cjs/react-component-lib/interfaces.js +3 -0
  17. package/cjs/react-component-lib/interfaces.js.map +1 -0
  18. package/cjs/react-component-lib/utils/attachProps.d.ts +8 -0
  19. package/cjs/react-component-lib/utils/attachProps.js +92 -0
  20. package/cjs/react-component-lib/utils/attachProps.js.map +1 -0
  21. package/cjs/react-component-lib/utils/case.d.ts +2 -0
  22. package/cjs/react-component-lib/utils/case.js +12 -0
  23. package/cjs/react-component-lib/utils/case.js.map +1 -0
  24. package/cjs/react-component-lib/utils/dev.d.ts +2 -0
  25. package/cjs/react-component-lib/utils/dev.js +18 -0
  26. package/cjs/react-component-lib/utils/dev.js.map +1 -0
  27. package/cjs/react-component-lib/utils/index.d.ts +10 -0
  28. package/cjs/react-component-lib/utils/index.js +57 -0
  29. package/cjs/react-component-lib/utils/index.js.map +1 -0
  30. package/esm/index.d.ts +46 -0
  31. package/esm/index.js +46 -0
  32. package/esm/index.js.map +1 -0
  33. package/esm/react-component-lib/createComponent.d.ts +10 -0
  34. package/esm/react-component-lib/createComponent.js +65 -0
  35. package/esm/react-component-lib/createComponent.js.map +1 -0
  36. package/esm/react-component-lib/createOverlayComponent.d.ts +21 -0
  37. package/esm/react-component-lib/createOverlayComponent.js +98 -0
  38. package/esm/react-component-lib/createOverlayComponent.js.map +1 -0
  39. package/esm/react-component-lib/index.d.ts +2 -0
  40. package/esm/react-component-lib/index.js +3 -0
  41. package/esm/react-component-lib/index.js.map +1 -0
  42. package/esm/react-component-lib/interfaces.d.ts +29 -0
  43. package/esm/react-component-lib/interfaces.js +2 -0
  44. package/esm/react-component-lib/interfaces.js.map +1 -0
  45. package/esm/react-component-lib/utils/attachProps.d.ts +8 -0
  46. package/esm/react-component-lib/utils/attachProps.js +85 -0
  47. package/esm/react-component-lib/utils/attachProps.js.map +1 -0
  48. package/esm/react-component-lib/utils/case.d.ts +2 -0
  49. package/esm/react-component-lib/utils/case.js +7 -0
  50. package/esm/react-component-lib/utils/case.js.map +1 -0
  51. package/esm/react-component-lib/utils/dev.d.ts +2 -0
  52. package/esm/react-component-lib/utils/dev.js +13 -0
  53. package/esm/react-component-lib/utils/dev.js.map +1 -0
  54. package/esm/react-component-lib/utils/index.d.ts +10 -0
  55. package/esm/react-component-lib/utils/index.js +33 -0
  56. package/esm/react-component-lib/utils/index.js.map +1 -0
  57. package/package.json +73 -0
  58. package/types/index.d.ts +46 -0
  59. package/types/react-component-lib/createComponent.d.ts +10 -0
  60. package/types/react-component-lib/createOverlayComponent.d.ts +21 -0
  61. package/types/react-component-lib/index.d.ts +2 -0
  62. package/types/react-component-lib/interfaces.d.ts +29 -0
  63. package/types/react-component-lib/utils/attachProps.d.ts +8 -0
  64. package/types/react-component-lib/utils/attachProps.js +85 -0
  65. package/types/react-component-lib/utils/attachProps.js.map +1 -0
  66. package/types/react-component-lib/utils/case.d.ts +2 -0
  67. package/types/react-component-lib/utils/case.js +7 -0
  68. package/types/react-component-lib/utils/case.js.map +1 -0
  69. package/types/react-component-lib/utils/dev.d.ts +2 -0
  70. package/types/react-component-lib/utils/dev.js +13 -0
  71. package/types/react-component-lib/utils/dev.js.map +1 -0
  72. package/types/react-component-lib/utils/index.d.ts +10 -0
  73. package/types/react-component-lib/utils/index.js +33 -0
  74. package/types/react-component-lib/utils/index.js.map +1 -0
  75. package/umd/index.d.ts +46 -0
  76. package/umd/index.js +59 -0
  77. package/umd/index.js.map +1 -0
  78. package/umd/react-component-lib/createComponent.d.ts +10 -0
  79. package/umd/react-component-lib/createComponent.js +102 -0
  80. package/umd/react-component-lib/createComponent.js.map +1 -0
  81. package/umd/react-component-lib/createOverlayComponent.d.ts +21 -0
  82. package/umd/react-component-lib/createOverlayComponent.js +115 -0
  83. package/umd/react-component-lib/createOverlayComponent.js.map +1 -0
  84. package/umd/react-component-lib/index.d.ts +2 -0
  85. package/umd/react-component-lib/index.js +18 -0
  86. package/umd/react-component-lib/index.js.map +1 -0
  87. package/umd/react-component-lib/interfaces.d.ts +29 -0
  88. package/umd/react-component-lib/interfaces.js +13 -0
  89. package/umd/react-component-lib/interfaces.js.map +1 -0
  90. package/umd/react-component-lib/utils/attachProps.d.ts +8 -0
  91. package/umd/react-component-lib/utils/attachProps.js +102 -0
  92. package/umd/react-component-lib/utils/attachProps.js.map +1 -0
  93. package/umd/react-component-lib/utils/case.d.ts +2 -0
  94. package/umd/react-component-lib/utils/case.js +22 -0
  95. package/umd/react-component-lib/utils/case.js.map +1 -0
  96. package/umd/react-component-lib/utils/dev.d.ts +2 -0
  97. package/umd/react-component-lib/utils/dev.js +28 -0
  98. package/umd/react-component-lib/utils/dev.js.map +1 -0
  99. package/umd/react-component-lib/utils/index.d.ts +10 -0
  100. package/umd/react-component-lib/utils/index.js +67 -0
  101. package/umd/react-component-lib/utils/index.js.map +1 -0
@@ -0,0 +1,21 @@
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> | undefined;
20
+ }> & React.RefAttributes<OverlayType>>;
21
+ export {};
@@ -0,0 +1,98 @@
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
+ import React from 'react';
22
+ import ReactDOM from 'react-dom';
23
+ import { attachProps, dashToPascalCase, defineCustomElement, setRef, } from './utils';
24
+ export const createOverlayComponent = (tagName, controller, customElement) => {
25
+ defineCustomElement(tagName, customElement);
26
+ const displayName = dashToPascalCase(tagName);
27
+ const didDismissEventName = `on${displayName}DidDismiss`;
28
+ const didPresentEventName = `on${displayName}DidPresent`;
29
+ const willDismissEventName = `on${displayName}WillDismiss`;
30
+ const willPresentEventName = `on${displayName}WillPresent`;
31
+ let isDismissing = false;
32
+ class Overlay extends React.Component {
33
+ constructor(props) {
34
+ super(props);
35
+ if (typeof document !== 'undefined') {
36
+ this.el = document.createElement('div');
37
+ }
38
+ this.handleDismiss = this.handleDismiss.bind(this);
39
+ }
40
+ static get displayName() {
41
+ return displayName;
42
+ }
43
+ componentDidMount() {
44
+ if (this.props.isOpen) {
45
+ this.present();
46
+ }
47
+ }
48
+ componentWillUnmount() {
49
+ if (this.overlay) {
50
+ this.overlay.dismiss();
51
+ }
52
+ }
53
+ handleDismiss(event) {
54
+ if (this.props.onDidDismiss) {
55
+ this.props.onDidDismiss(event);
56
+ }
57
+ setRef(this.props.forwardedRef, null);
58
+ }
59
+ shouldComponentUpdate(nextProps) {
60
+ if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
61
+ isDismissing = true;
62
+ }
63
+ return true;
64
+ }
65
+ componentDidUpdate(prevProps) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ if (this.overlay) {
68
+ attachProps(this.overlay, this.props, prevProps);
69
+ }
70
+ if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
71
+ this.present(prevProps);
72
+ }
73
+ if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
74
+ yield this.overlay.dismiss();
75
+ isDismissing = false;
76
+ this.forceUpdate();
77
+ }
78
+ });
79
+ }
80
+ present(prevProps) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const _a = this.props, { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent } = _a, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
83
+ const elementProps = Object.assign(Object.assign({}, cProps), { ref: this.props.forwardedRef, [didDismissEventName]: this.handleDismiss, [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e), [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e), [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e) });
84
+ this.overlay = yield controller.create(Object.assign(Object.assign({}, elementProps), { component: this.el, componentProps: {} }));
85
+ setRef(this.props.forwardedRef, this.overlay);
86
+ attachProps(this.overlay, elementProps, prevProps);
87
+ yield this.overlay.present();
88
+ });
89
+ }
90
+ render() {
91
+ return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
92
+ }
93
+ }
94
+ return React.forwardRef((props, ref) => {
95
+ return React.createElement(Overlay, Object.assign({}, props, { forwardedRef: ref }));
96
+ });
97
+ };
98
+ //# sourceMappingURL=createOverlayComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC,OAAO,EAEL,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,GACP,MAAM,SAAS,CAAC;AAgBjB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAIpC,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,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AoB,CAAC,EAAE,CAAC,CAAc,EAAE,EAAE,CACzC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAC1D,CAAC;gBAEF,IAAI,CAAC,OAAO,GAAG,MAAM,UAAU,CAAC,MAAM,iCACjC,YAAY,KACf,SAAS,EAAE,IAAI,CAAC,EAAE,EAClB,cAAc,EAAE,EAAE,IAClB,CAAC;gBAEH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC9C,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;gBAEnD,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAC/B,CAAC;SAAA;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,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
@@ -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/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,29 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/react-component-lib/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
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
+ export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
4
+ export declare const syncEvent: (node: Element & {
5
+ __events?: {
6
+ [key: string]: ((e: Event) => any) | undefined;
7
+ } | undefined;
8
+ }, eventName: string, newEventHandler?: ((e: Event) => any) | undefined) => void;
@@ -0,0 +1,85 @@
1
+ import { camelToDashCase } from './case';
2
+ export const attachProps = (node, newProps, oldProps = {}) => {
3
+ if (node instanceof Element) {
4
+ const className = getClassName(node.classList, newProps, oldProps);
5
+ if (className !== '') {
6
+ node.className = className;
7
+ }
8
+ Object.keys(newProps).forEach((name) => {
9
+ if (name === 'children' ||
10
+ name === 'style' ||
11
+ name === 'ref' ||
12
+ name === 'class' ||
13
+ name === 'className' ||
14
+ name === 'forwardedRef') {
15
+ return;
16
+ }
17
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
18
+ const eventName = name.substring(2);
19
+ const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
20
+ if (!isCoveredByReact(eventNameLc)) {
21
+ syncEvent(node, eventNameLc, newProps[name]);
22
+ }
23
+ }
24
+ else {
25
+ node[name] = newProps[name];
26
+ const propType = typeof newProps[name];
27
+ if (propType === 'string') {
28
+ node.setAttribute(camelToDashCase(name), newProps[name]);
29
+ }
30
+ }
31
+ });
32
+ }
33
+ };
34
+ export const getClassName = (classList, newProps, oldProps) => {
35
+ const newClassProp = newProps.className || newProps.class;
36
+ const oldClassProp = oldProps.className || oldProps.class;
37
+ const currentClasses = arrayToMap(classList);
38
+ const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
39
+ const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
40
+ const finalClassNames = [];
41
+ currentClasses.forEach((currentClass) => {
42
+ if (incomingPropClasses.has(currentClass)) {
43
+ finalClassNames.push(currentClass);
44
+ incomingPropClasses.delete(currentClass);
45
+ }
46
+ else if (!oldPropClasses.has(currentClass)) {
47
+ finalClassNames.push(currentClass);
48
+ }
49
+ });
50
+ incomingPropClasses.forEach((s) => finalClassNames.push(s));
51
+ return finalClassNames.join(' ');
52
+ };
53
+ export const isCoveredByReact = (eventNameSuffix) => {
54
+ if (typeof document === 'undefined') {
55
+ return true;
56
+ }
57
+ else {
58
+ const eventName = 'on' + eventNameSuffix;
59
+ let isSupported = eventName in document;
60
+ if (!isSupported) {
61
+ const element = document.createElement('div');
62
+ element.setAttribute(eventName, 'return;');
63
+ isSupported = typeof element[eventName] === 'function';
64
+ }
65
+ return isSupported;
66
+ }
67
+ };
68
+ export const syncEvent = (node, eventName, newEventHandler) => {
69
+ const eventStore = node.__events || (node.__events = {});
70
+ const oldEventHandler = eventStore[eventName];
71
+ if (oldEventHandler) {
72
+ node.removeEventListener(eventName, oldEventHandler);
73
+ }
74
+ node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
75
+ if (newEventHandler) {
76
+ newEventHandler.call(this, e);
77
+ }
78
+ }));
79
+ };
80
+ const arrayToMap = (arr) => {
81
+ const map = new Map();
82
+ arr.forEach((s) => map.set(s, s));
83
+ return map;
84
+ };
85
+ //# sourceMappingURL=attachProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../src/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;QAE3B,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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AAE,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IAG9C,IAAI,eAAe,EAAE;QACnB,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;KACtD;IAGD,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,2 @@
1
+ export declare const dashToPascalCase: (str: string) => string;
2
+ export declare const camelToDashCase: (str: string) => string;
@@ -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/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,CAC7C,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,2 @@
1
+ export declare const isDevMode: () => boolean;
2
+ export declare const deprecationWarning: (key: string, message: string) => void;
@@ -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/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,10 @@
1
+ import React from 'react';
2
+ import type { StyleReactProps } from '../interfaces';
3
+ export declare type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
4
+ export declare 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';
@@ -0,0 +1,33 @@
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
+ ref.current = value;
8
+ }
9
+ };
10
+ export const mergeRefs = (...refs) => {
11
+ return (value) => {
12
+ refs.forEach(ref => {
13
+ setRef(ref, value);
14
+ });
15
+ };
16
+ };
17
+ export const createForwardRef = (ReactComponent, displayName) => {
18
+ const forwardRef = (props, ref) => {
19
+ return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
20
+ };
21
+ forwardRef.displayName = displayName;
22
+ return React.forwardRef(forwardRef);
23
+ };
24
+ export const defineCustomElement = (tagName, customElement) => {
25
+ if (customElement !== undefined &&
26
+ typeof customElements !== 'undefined' &&
27
+ !customElements.get(tagName)) {
28
+ customElements.define(tagName, customElement);
29
+ }
30
+ };
31
+ export * from './attachProps';
32
+ export * from './case';
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/index.tsx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AAQ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@public-ui/react",
3
+ "version": "1.1.7-rc.10",
4
+ "license": "EUPL-1.2",
5
+ "homepage": "https://public-ui.github.io",
6
+ "repository": "https://github.com/public-ui/kolibri",
7
+ "bugs": {
8
+ "url": "https://github.com/public-ui/kolibri/issues",
9
+ "email": "kolibri@itzbund.de"
10
+ },
11
+ "author": {
12
+ "name": "Informationstechnikzentrum Bund",
13
+ "email": "kolibri@itzbund.de"
14
+ },
15
+ "contributors": [
16
+ {
17
+ "name": "Martin Oppitz",
18
+ "email": "martin.oppitz@itzbund.de"
19
+ }
20
+ ],
21
+ "browser": true,
22
+ "description": "Das React-Modul ist der Framework-Adapter für die Komponenten-Bibliothek.",
23
+ "sideEffects": false,
24
+ "scripts": {
25
+ "clean": "lerna exec --stream -- git clean -f -d -X && git clean -f -d -X",
26
+ "build:cjs": "tsc -m commonjs --outDir cjs",
27
+ "build:clean": "rimraf cjs esm types umd",
28
+ "build:esm": "tsc -m esnext --outDir esm",
29
+ "build:tsc": "tsc -p .",
30
+ "build:types": "tsc -d --outDir types && rimraf types/*.js types/*.map types/**/*.js types/**/*.map",
31
+ "build:umd": "tsc -m umd --outDir umd",
32
+ "build": "npm run build:clean && npm run build:cjs && npm run build:esm && npm run build:types && npm run build:umd",
33
+ "prepack": "npm run build",
34
+ ":install": "pnpm i && pnpm update",
35
+ ":publish": "npm run :install && npm publish --registry=http://localhost:4873 || true",
36
+ ":republish": "npm run :unpublish && npm run :publish",
37
+ ":unpublish": "npm unpublish -f --registry=http://localhost:4873"
38
+ },
39
+ "main": "cjs/index.js",
40
+ "module": "esm/index.js",
41
+ "types": "types/index.d.ts",
42
+ "exports": {
43
+ "require": "./cjs/index.js",
44
+ "import": "./esm/index.js"
45
+ },
46
+ "devDependencies": {
47
+ "@public-ui/core": "1.1.7-rc.10",
48
+ "@public-ui/components": "1.1.7-rc.10",
49
+ "@leanup/form": "1.3.35",
50
+ "@leanup/lib": "1.3.35",
51
+ "@types/minimatch": "5.1.2",
52
+ "@types/minimist": "1.2.2",
53
+ "@types/node": "18.8.1",
54
+ "@types/normalize-package-data": "2.4.1",
55
+ "@types/react": "18.0.21",
56
+ "@types/react-dom": "18.0.6",
57
+ "rimraf": "3.0.2",
58
+ "react": "18.2.0",
59
+ "react-dom": "18.2.0",
60
+ "typescript": "4.8.4"
61
+ },
62
+ "peerDependencies": {
63
+ "@public-ui/components": "1.1.7-rc.10",
64
+ "react": ">=16.14.0",
65
+ "react-dom": ">=16.14.0"
66
+ },
67
+ "files": [
68
+ "cjs",
69
+ "esm",
70
+ "types",
71
+ "umd"
72
+ ]
73
+ }
@@ -0,0 +1,46 @@
1
+ /// <reference types="react" />
2
+ import type { JSX } from '@public-ui/components';
3
+ export declare const KolAbbr: import("react").ForwardRefExoticComponent<JSX.KolAbbr & Omit<import("react").HTMLAttributes<HTMLKolAbbrElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolAbbrElement>>;
4
+ export declare const KolAccordion: import("react").ForwardRefExoticComponent<JSX.KolAccordion & Omit<import("react").HTMLAttributes<HTMLKolAccordionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolAccordionElement>>;
5
+ export declare const KolAlert: import("react").ForwardRefExoticComponent<JSX.KolAlert & Omit<import("react").HTMLAttributes<HTMLKolAlertElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolAlertElement>>;
6
+ export declare const KolBadge: import("react").ForwardRefExoticComponent<JSX.KolBadge & Omit<import("react").HTMLAttributes<HTMLKolBadgeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolBadgeElement>>;
7
+ export declare const KolBreadcrumb: import("react").ForwardRefExoticComponent<JSX.KolBreadcrumb & Omit<import("react").HTMLAttributes<HTMLKolBreadcrumbElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolBreadcrumbElement>>;
8
+ export declare const KolButton: import("react").ForwardRefExoticComponent<JSX.KolButton & Omit<import("react").HTMLAttributes<HTMLKolButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolButtonElement>>;
9
+ export declare const KolButtonGroup: import("react").ForwardRefExoticComponent<JSX.KolButtonGroup & Omit<import("react").HTMLAttributes<HTMLKolButtonGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolButtonGroupElement>>;
10
+ export declare const KolCard: import("react").ForwardRefExoticComponent<JSX.KolCard & Omit<import("react").HTMLAttributes<HTMLKolCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolCardElement>>;
11
+ export declare const KolDetails: import("react").ForwardRefExoticComponent<JSX.KolDetails & Omit<import("react").HTMLAttributes<HTMLKolDetailsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolDetailsElement>>;
12
+ export declare const KolForm: import("react").ForwardRefExoticComponent<JSX.KolForm & Omit<import("react").HTMLAttributes<HTMLKolFormElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolFormElement>>;
13
+ export declare const KolHeading: import("react").ForwardRefExoticComponent<JSX.KolHeading & Omit<import("react").HTMLAttributes<HTMLKolHeadingElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolHeadingElement>>;
14
+ export declare const KolHeadingWc: import("react").ForwardRefExoticComponent<JSX.KolHeadingWc & Omit<import("react").HTMLAttributes<HTMLKolHeadingWcElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolHeadingWcElement>>;
15
+ export declare const KolIcon: import("react").ForwardRefExoticComponent<JSX.KolIcon & Omit<import("react").HTMLAttributes<HTMLKolIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolIconElement>>;
16
+ export declare const KolIconFontAwesome: import("react").ForwardRefExoticComponent<JSX.KolIconFontAwesome & Omit<import("react").HTMLAttributes<HTMLKolIconFontAwesomeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolIconFontAwesomeElement>>;
17
+ export declare const KolIconIcofont: import("react").ForwardRefExoticComponent<JSX.KolIconIcofont & Omit<import("react").HTMLAttributes<HTMLKolIconIcofontElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolIconIcofontElement>>;
18
+ export declare const KolIndentedText: import("react").ForwardRefExoticComponent<JSX.KolIndentedText & Omit<import("react").HTMLAttributes<HTMLKolIndentedTextElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolIndentedTextElement>>;
19
+ export declare const KolInputAdapterLeanup: import("react").ForwardRefExoticComponent<JSX.KolInputAdapterLeanup & Omit<import("react").HTMLAttributes<HTMLKolInputAdapterLeanupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputAdapterLeanupElement>>;
20
+ export declare const KolInputCheckbox: import("react").ForwardRefExoticComponent<JSX.KolInputCheckbox & Omit<import("react").HTMLAttributes<HTMLKolInputCheckboxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputCheckboxElement>>;
21
+ export declare const KolInputColor: import("react").ForwardRefExoticComponent<JSX.KolInputColor & Omit<import("react").HTMLAttributes<HTMLKolInputColorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputColorElement>>;
22
+ export declare const KolInputEmail: import("react").ForwardRefExoticComponent<JSX.KolInputEmail & Omit<import("react").HTMLAttributes<HTMLKolInputEmailElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputEmailElement>>;
23
+ export declare const KolInputFile: import("react").ForwardRefExoticComponent<JSX.KolInputFile & Omit<import("react").HTMLAttributes<HTMLKolInputFileElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputFileElement>>;
24
+ export declare const KolInputNumber: import("react").ForwardRefExoticComponent<JSX.KolInputNumber & Omit<import("react").HTMLAttributes<HTMLKolInputNumberElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputNumberElement>>;
25
+ export declare const KolInputPassword: import("react").ForwardRefExoticComponent<JSX.KolInputPassword & Omit<import("react").HTMLAttributes<HTMLKolInputPasswordElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputPasswordElement>>;
26
+ export declare const KolInputRadio: import("react").ForwardRefExoticComponent<JSX.KolInputRadio & Omit<import("react").HTMLAttributes<HTMLKolInputRadioElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputRadioElement>>;
27
+ export declare const KolInputRange: import("react").ForwardRefExoticComponent<JSX.KolInputRange & Omit<import("react").HTMLAttributes<HTMLKolInputRangeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputRangeElement>>;
28
+ export declare const KolInputText: import("react").ForwardRefExoticComponent<JSX.KolInputText & Omit<import("react").HTMLAttributes<HTMLKolInputTextElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolInputTextElement>>;
29
+ export declare const KolKolibri: import("react").ForwardRefExoticComponent<JSX.KolKolibri & Omit<import("react").HTMLAttributes<HTMLKolKolibriElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolKolibriElement>>;
30
+ export declare const KolLink: import("react").ForwardRefExoticComponent<JSX.KolLink & Omit<import("react").HTMLAttributes<HTMLKolLinkElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolLinkElement>>;
31
+ export declare const KolLinkGroup: import("react").ForwardRefExoticComponent<JSX.KolLinkGroup & Omit<import("react").HTMLAttributes<HTMLKolLinkGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolLinkGroupElement>>;
32
+ export declare const KolLogo: import("react").ForwardRefExoticComponent<JSX.KolLogo & Omit<import("react").HTMLAttributes<HTMLKolLogoElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolLogoElement>>;
33
+ export declare const KolModal: import("react").ForwardRefExoticComponent<JSX.KolModal & Omit<import("react").HTMLAttributes<HTMLKolModalElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolModalElement>>;
34
+ export declare const KolNav: import("react").ForwardRefExoticComponent<JSX.KolNav & Omit<import("react").HTMLAttributes<HTMLKolNavElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolNavElement>>;
35
+ export declare const KolPagination: import("react").ForwardRefExoticComponent<JSX.KolPagination & Omit<import("react").HTMLAttributes<HTMLKolPaginationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolPaginationElement>>;
36
+ export declare const KolProgress: import("react").ForwardRefExoticComponent<JSX.KolProgress & Omit<import("react").HTMLAttributes<HTMLKolProgressElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolProgressElement>>;
37
+ export declare const KolSelect: import("react").ForwardRefExoticComponent<JSX.KolSelect & Omit<import("react").HTMLAttributes<HTMLKolSelectElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolSelectElement>>;
38
+ export declare const KolSkipNav: import("react").ForwardRefExoticComponent<JSX.KolSkipNav & Omit<import("react").HTMLAttributes<HTMLKolSkipNavElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolSkipNavElement>>;
39
+ export declare const KolSpin: import("react").ForwardRefExoticComponent<JSX.KolSpin & Omit<import("react").HTMLAttributes<HTMLKolSpinElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolSpinElement>>;
40
+ export declare const KolSymbol: import("react").ForwardRefExoticComponent<JSX.KolSymbol & Omit<import("react").HTMLAttributes<HTMLKolSymbolElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolSymbolElement>>;
41
+ export declare const KolTable: import("react").ForwardRefExoticComponent<JSX.KolTable & Omit<import("react").HTMLAttributes<HTMLKolTableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolTableElement>>;
42
+ export declare const KolTabs: import("react").ForwardRefExoticComponent<JSX.KolTabs & Omit<import("react").HTMLAttributes<HTMLKolTabsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolTabsElement>>;
43
+ export declare const KolTextarea: import("react").ForwardRefExoticComponent<JSX.KolTextarea & Omit<import("react").HTMLAttributes<HTMLKolTextareaElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolTextareaElement>>;
44
+ export declare const KolToast: import("react").ForwardRefExoticComponent<JSX.KolToast & Omit<import("react").HTMLAttributes<HTMLKolToastElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolToastElement>>;
45
+ export declare const KolTooltip: import("react").ForwardRefExoticComponent<JSX.KolTooltip & Omit<import("react").HTMLAttributes<HTMLKolTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolTooltipElement>>;
46
+ export declare const KolVersion: import("react").ForwardRefExoticComponent<JSX.KolVersion & Omit<import("react").HTMLAttributes<HTMLKolVersionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLKolVersionElement>>;
@@ -0,0 +1,10 @@
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> | undefined, manipulatePropsFunction?: ((originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes) | undefined, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
10
+ export {};
@@ -0,0 +1,21 @@
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> | undefined;
20
+ }> & React.RefAttributes<OverlayType>>;
21
+ export {};
@@ -0,0 +1,2 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
@@ -0,0 +1,29 @@
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
+ }
@@ -0,0 +1,8 @@
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
+ export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
4
+ export declare const syncEvent: (node: Element & {
5
+ __events?: {
6
+ [key: string]: ((e: Event) => any) | undefined;
7
+ } | undefined;
8
+ }, eventName: string, newEventHandler?: ((e: Event) => any) | undefined) => void;