@onepercentio/one-ui 0.6.7 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AdaptiveDialog/AdaptiveDialog.d.ts +2 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js +5 -4
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js.map +1 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.module.scss +5 -4
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.d.ts +1 -0
- package/dist/components/Button/Button.js +3 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/EmailInput/EmailInput.d.ts +1 -1
- package/dist/components/EmailInput/EmailInput.stories.d.ts +1 -1
- package/dist/components/HSForms/HSForms.d.ts +4 -1
- package/dist/components/HSForms/HSForms.js +37 -17
- package/dist/components/HSForms/HSForms.js.map +1 -1
- package/dist/components/InfinityScroll/InfinityScroll.js +2 -2
- package/dist/components/InfinityScroll/InfinityScroll.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +13 -0
- package/dist/components/ProgressBar/ProgressBar.js +17 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/components/ProgressBar/ProgressBar.module.scss +32 -0
- package/dist/components/ProgressBar/ProgressBar.stories.d.ts +14 -0
- package/dist/components/ProgressBar/ProgressBar.stories.js +52 -0
- package/dist/components/ProgressBar/ProgressBar.stories.js.map +1 -0
- package/dist/components/ProgressBar/index.d.ts +1 -0
- package/dist/components/ProgressBar/index.js +9 -0
- package/dist/components/ProgressBar/index.js.map +1 -0
- package/dist/components/Transition/Transition.js +70 -38
- package/dist/components/Transition/Transition.js.map +1 -1
- package/dist/components/Transition/TransitionContainer/TransitionContainer.d.ts +4 -0
- package/dist/components/Transition/TransitionContainer/TransitionContainer.js +14 -0
- package/dist/components/Transition/TransitionContainer/TransitionContainer.js.map +1 -0
- package/dist/components/Transition/TransitionContainer/index.d.ts +1 -0
- package/dist/components/Transition/TransitionContainer/index.js +9 -0
- package/dist/components/Transition/TransitionContainer/index.js.map +1 -0
- package/dist/context/AsyncProcessQueue.d.ts +37 -0
- package/dist/context/AsyncProcessQueue.js +160 -0
- package/dist/context/AsyncProcessQueue.js.map +1 -0
- package/dist/context/OneUIProvider.d.ts +5 -0
- package/dist/context/OneUIProvider.js.map +1 -1
- package/dist/context/__mocks__/OneUIProvider.d.ts +7 -0
- package/dist/hooks/useAsyncControl.d.ts +3 -4
- package/dist/hooks/useAsyncControl.js +1 -1
- package/dist/hooks/useAsyncControl.js.map +1 -1
- package/dist/hooks/usePagination.d.ts +2 -3
- package/package.json +2 -1
|
@@ -2,8 +2,9 @@ import { PropsWithChildren } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* This component implements a generic drawer that displays it as a drawer on mobile and as a modal on desktop
|
|
4
4
|
**/
|
|
5
|
-
export default function AdaptiveDialog({ onClose, open, className, children, }: PropsWithChildren<{
|
|
5
|
+
export default function AdaptiveDialog({ onClose, open, className, onClickOut, children, }: PropsWithChildren<{
|
|
6
6
|
className?: string;
|
|
7
7
|
open: boolean;
|
|
8
8
|
onClose?: () => void;
|
|
9
|
+
onClickOut?: () => void;
|
|
9
10
|
}>): JSX.Element | null;
|
|
@@ -30,10 +30,11 @@ const react_1 = __importStar(require("react"));
|
|
|
30
30
|
const AdaptiveDialog_module_scss_1 = __importDefault(require("./AdaptiveDialog.module.scss"));
|
|
31
31
|
const MutableHamburgerButton_1 = __importDefault(require("../MutableHamburgerButton"));
|
|
32
32
|
const ScrollAndFocusLock_1 = __importDefault(require("../utilitary/ScrollAndFocusLock"));
|
|
33
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
33
34
|
/**
|
|
34
35
|
* This component implements a generic drawer that displays it as a drawer on mobile and as a modal on desktop
|
|
35
36
|
**/
|
|
36
|
-
function AdaptiveDialog({ onClose, open = false, className = "", children, }) {
|
|
37
|
+
function AdaptiveDialog({ onClose, open = false, className = "", onClickOut, children, }) {
|
|
37
38
|
const rootDivRef = (0, react_1.useRef)(null);
|
|
38
39
|
const [isVisible, setIsVisible] = (0, react_1.useState)(open);
|
|
39
40
|
const [expanded, setExpanded] = (0, react_1.useState)(false);
|
|
@@ -49,12 +50,12 @@ function AdaptiveDialog({ onClose, open = false, className = "", children, }) {
|
|
|
49
50
|
rootDivRef.current.addEventListener("animationend", toggleVisbility);
|
|
50
51
|
}
|
|
51
52
|
}, [open]);
|
|
52
|
-
return isVisible || open ? (react_1.default.createElement("div", { ref: rootDivRef, className: `${AdaptiveDialog_module_scss_1.default.backdrop} ${open ? AdaptiveDialog_module_scss_1.default.open : AdaptiveDialog_module_scss_1.default.close} ${expanded ? AdaptiveDialog_module_scss_1.default.expanded : ""}
|
|
53
|
-
react_1.default.createElement("div", { className: `${AdaptiveDialog_module_scss_1.default.container} ${className}
|
|
53
|
+
return isVisible || open ? (react_1.default.createElement(react_1.default.Fragment, null, react_dom_1.default.createPortal(react_1.default.createElement("div", { ref: rootDivRef, className: `${AdaptiveDialog_module_scss_1.default.backdrop} ${open ? AdaptiveDialog_module_scss_1.default.open : AdaptiveDialog_module_scss_1.default.close} ${expanded ? AdaptiveDialog_module_scss_1.default.expanded : ""}`, onClick: onClickOut },
|
|
54
|
+
react_1.default.createElement("div", { className: `${AdaptiveDialog_module_scss_1.default.container} ${className}`, onClick: (e) => e.stopPropagation() },
|
|
54
55
|
react_1.default.createElement(ScrollAndFocusLock_1.default, { open: open },
|
|
55
56
|
onClose && (react_1.default.createElement(MutableHamburgerButton_1.default, { className: AdaptiveDialog_module_scss_1.default.closeBtn, onClick: onClose, state: "closed", size: 24 })),
|
|
56
57
|
react_1.default.createElement("div", { className: AdaptiveDialog_module_scss_1.default.indicator, onClick: () => setExpanded((p) => !p) }),
|
|
57
|
-
children)))) : null;
|
|
58
|
+
children))), document.body))) : null;
|
|
58
59
|
}
|
|
59
60
|
exports.default = AdaptiveDialog;
|
|
60
61
|
//# sourceMappingURL=AdaptiveDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdaptiveDialog.js","sourceRoot":"","sources":["../../../src/components/AdaptiveDialog/AdaptiveDialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8E;AAC9E,8FAAkD;AAClD,uFAA+D;AAC/D,yFAAiE;
|
|
1
|
+
{"version":3,"file":"AdaptiveDialog.js","sourceRoot":"","sources":["../../../src/components/AdaptiveDialog/AdaptiveDialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8E;AAC9E,8FAAkD;AAClD,uFAA+D;AAC/D,yFAAiE;AACjE,0DAAiC;AAEjC;;IAEI;AACJ,SAAwB,cAAc,CAAC,EACrC,OAAO,EACP,IAAI,GAAG,KAAK,EACZ,SAAS,GAAG,EAAE,EACd,UAAU,EACV,QAAQ,GAMR;IACA,MAAM,UAAU,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEhD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,IAAI,EAAE;YACR,YAAY,CAAC,IAAI,CAAC,CAAC;YACnB,MAAM,eAAe,GAAG,CAAC,CAAiB,EAAE,EAAE;gBAC5C,IAAI,CAAC,CAAC,aAAa,KAAK,oCAAM,CAAC,eAAe,EAAE;oBAC9C,YAAY,CAAC,KAAK,CAAC,CAAC;oBACnB,CAAC,CAAC,MAA0B,CAAC,mBAAmB,CAC/C,cAAc,EACd,eAAe,CAChB,CAAC;iBACH;YACH,CAAC,CAAC;YACF,UAAU,CAAC,OAAQ,CAAC,gBAAgB,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;SACvE;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,CACzB,8DACG,mBAAQ,CAAC,YAAY,CACpB,uCACE,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,GAAG,oCAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,oCAAM,CAAC,IAAI,CAAC,CAAC,CAAC,oCAAM,CAAC,KAAK,IAChE,QAAQ,CAAC,CAAC,CAAC,oCAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC/B,EAAE,EACF,OAAO,EAAE,UAAU;QAEnB,uCACE,SAAS,EAAE,GAAG,oCAAM,CAAC,SAAS,IAAI,SAAS,EAAE,EAC7C,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE;YAEnC,8BAAC,4BAAkB,IAAC,IAAI,EAAE,IAAI;gBAC3B,OAAO,IAAI,CACV,8BAAC,gCAAsB,IACrB,SAAS,EAAE,oCAAM,CAAC,QAAQ,EAC1B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,QAAQ,EACd,IAAI,EAAE,EAAE,GACR,CACH;gBACD,uCACE,SAAS,EAAE,oCAAM,CAAC,SAAS,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GACrC;gBACD,QAAQ,CACU,CACjB,CACF,EACN,QAAQ,CAAC,IAAI,CACd,CACA,CACJ,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAnED,iCAmEC"}
|
|
@@ -119,21 +119,22 @@
|
|
|
119
119
|
@keyframes slideUp {
|
|
120
120
|
0% {
|
|
121
121
|
min-height: 0px;
|
|
122
|
-
|
|
122
|
+
transform: translateY(100%);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
100% {
|
|
126
|
-
|
|
126
|
+
min-height: 0px;
|
|
127
|
+
transform: translateY(0%);
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
@keyframes slideDown {
|
|
131
132
|
0% {
|
|
132
|
-
|
|
133
|
+
transform: translateY(0%);
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
100% {
|
|
136
137
|
min-height: 0px;
|
|
137
|
-
|
|
138
|
+
transform: translateY(100%);
|
|
138
139
|
}
|
|
139
140
|
}
|
|
@@ -39,13 +39,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports._Button = void 0;
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
|
+
const OneUIProvider_1 = require("../../context/OneUIProvider");
|
|
42
43
|
const Button_module_scss_1 = __importDefault(require("./Button.module.scss"));
|
|
43
44
|
/**
|
|
44
45
|
* A simple button with the new design
|
|
45
46
|
**/
|
|
46
47
|
function _Button(_a) {
|
|
47
48
|
var { children, variant = "transparent", className = "" } = _a, otherProps = __rest(_a, ["children", "variant", "className"]);
|
|
48
|
-
|
|
49
|
+
const classNameType = (0, OneUIProvider_1.useOneUIConfig)("component.button.className", {});
|
|
50
|
+
return (react_1.default.createElement("button", Object.assign({ ref: arguments[1], className: `${Button_module_scss_1.default.button} ${Button_module_scss_1.default[variant]} ${className} ${classNameType[variant] || ""}` }, otherProps), children));
|
|
49
51
|
}
|
|
50
52
|
exports._Button = _Button;
|
|
51
53
|
exports.default = (0, react_1.forwardRef)(_Button);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoE;AACpE,8EAA0C;AAQ1C;;IAEI;AACJ,SAAgB,OAAO,CAAC,EAKV;QALU,EACtB,QAAQ,EACR,OAAO,GAAG,aAAa,EACvB,SAAS,GAAG,EAAE,OAEF,EADT,UAAU,cAJS,oCAKvB,CADc;IAEb,OAAO,CACL,wDACE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,EACjB,SAAS,EAAE,GAAG,4BAAM,CAAC,MAAM,IAAI,4BAAM,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoE;AACpE,+DAA6D;AAC7D,8EAA0C;AAQ1C;;IAEI;AACJ,SAAgB,OAAO,CAAC,EAKV;QALU,EACtB,QAAQ,EACR,OAAO,GAAG,aAAa,EACvB,SAAS,GAAG,EAAE,OAEF,EADT,UAAU,cAJS,oCAKvB,CADc;IAEb,MAAM,aAAa,GAAG,IAAA,8BAAc,EAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;IACvE,OAAO,CACL,wDACE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,EACjB,SAAS,EAAE,GAAG,4BAAM,CAAC,MAAM,IAAI,4BAAM,CAAC,OAAO,CAAC,IAAI,SAAS,IAAI,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IACzF,UAAU,GAEb,QAAQ,CACF,CACV,CAAC;AACJ,CAAC;AAhBD,0BAgBC;AAED,kBAAe,IAAA,kBAAU,EAAiC,OAAO,CAAC,CAAC"}
|
|
@@ -19,7 +19,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
19
19
|
messages: {
|
|
20
20
|
invalidEmail: string;
|
|
21
21
|
};
|
|
22
|
-
}, "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "default" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "
|
|
22
|
+
}, "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "default" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "border" | "error" | "Icon" | "messages" | "icon" | "hideError" | "disclaimer" | "multiline" | "decoration"> & React.RefAttributes<{
|
|
23
23
|
validateEmail: (email: string) => boolean;
|
|
24
24
|
}>>;
|
|
25
25
|
export default _default;
|
|
@@ -19,7 +19,7 @@ declare const _default: {
|
|
|
19
19
|
messages: {
|
|
20
20
|
invalidEmail: string;
|
|
21
21
|
};
|
|
22
|
-
}, "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "default" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "
|
|
22
|
+
}, "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "default" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "border" | "error" | "Icon" | "messages" | "icon" | "hideError" | "disclaimer" | "multiline" | "decoration"> & React.RefAttributes<{
|
|
23
23
|
validateEmail: (email: string) => boolean;
|
|
24
24
|
}>>;
|
|
25
25
|
title: string;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export default function HSForms({ region, partialId, formId, }: {
|
|
1
|
+
export default function HSForms({ region, partialId, formId, className, onFormReady, onFormSubmitted, }: {
|
|
2
2
|
region: "na1";
|
|
3
3
|
partialId: string;
|
|
4
4
|
formId: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
onFormReady?: (div: HTMLDivElement, form: any) => void;
|
|
7
|
+
onFormSubmitted?: () => void;
|
|
5
8
|
}): JSX.Element | null;
|
|
@@ -24,28 +24,48 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const react_1 = __importStar(require("react"));
|
|
27
|
-
function HSForms({ region, partialId, formId, }) {
|
|
27
|
+
function HSForms({ region, partialId, formId, className, onFormReady, onFormSubmitted, }) {
|
|
28
28
|
if (window.PRERENDER)
|
|
29
29
|
return null;
|
|
30
30
|
const container = (0, react_1.useRef)(null);
|
|
31
31
|
(0, react_1.useEffect)(() => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
Promise.resolve().then(() => __importStar(require("jquery"))).then((jqueryModule) => {
|
|
33
|
+
const funcId = String(Math.round(Math.random() * 999999));
|
|
34
|
+
const idx = `onLoad${funcId}`;
|
|
35
|
+
const idx2 = `onSubmit${funcId}`;
|
|
36
|
+
window[idx] = function (form) {
|
|
37
|
+
if (onFormReady)
|
|
38
|
+
onFormReady(container.current, form);
|
|
39
|
+
};
|
|
40
|
+
window[idx2] = function () {
|
|
41
|
+
if (onFormSubmitted)
|
|
42
|
+
onFormSubmitted();
|
|
43
|
+
};
|
|
44
|
+
window.jQuery = jqueryModule.default;
|
|
45
|
+
const script = document.createElement("script");
|
|
46
|
+
script.setAttribute("src", "https://js.hsforms.net/forms/v2.js");
|
|
47
|
+
script.setAttribute("type", "text/javascript");
|
|
48
|
+
script.setAttribute("charset", "utf-8");
|
|
49
|
+
script.onload = () => {
|
|
50
|
+
const createFormScript = document.createElement("script");
|
|
51
|
+
createFormScript.setAttribute("type", "text/javascript");
|
|
52
|
+
createFormScript.innerHTML = `hbspt.forms.create({
|
|
53
|
+
region: "${region}",
|
|
54
|
+
portalId: "${partialId}",
|
|
55
|
+
formId: "${formId}",
|
|
56
|
+
submitButtonClass: '#',
|
|
57
|
+
css: ' ',
|
|
58
|
+
cssClass: '#',
|
|
59
|
+
onFormReady: ${idx},
|
|
60
|
+
onFormSubmitted: ${idx2},
|
|
61
|
+
formInstanceId: ${funcId}
|
|
62
|
+
});`;
|
|
63
|
+
container.current.appendChild(createFormScript);
|
|
64
|
+
};
|
|
65
|
+
document.head.appendChild(script);
|
|
66
|
+
});
|
|
47
67
|
}, [region, partialId, formId]);
|
|
48
|
-
return react_1.default.createElement("div", { ref: container });
|
|
68
|
+
return react_1.default.createElement("div", { ref: container, className: className });
|
|
49
69
|
}
|
|
50
70
|
exports.default = HSForms;
|
|
51
71
|
//# sourceMappingURL=HSForms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HSForms.js","sourceRoot":"","sources":["../../../src/components/HSForms/HSForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AAEjD,SAAwB,OAAO,CAAC,EAC9B,MAAM,EACN,SAAS,EACT,MAAM,
|
|
1
|
+
{"version":3,"file":"HSForms.js","sourceRoot":"","sources":["../../../src/components/HSForms/HSForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AAEjD,SAAwB,OAAO,CAAC,EAC9B,MAAM,EACN,SAAS,EACT,MAAM,EACN,SAAS,EACT,WAAW,EACX,eAAe,GAQhB;IACC,IAAK,MAAc,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAE/C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,kDAAO,QAAS,IAAE,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE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CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAChC,OAAO,uCAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAQ,CAAC;AAC3D,CAAC;AAtDD,0BAsDC"}
|
|
@@ -71,8 +71,8 @@ function InfinityScroll({ items, pageSize, initialPage = 0, pageClass, className
|
|
|
71
71
|
return slicedItems.map((i, index) => typeof i === "object"
|
|
72
72
|
? Object.assign(Object.assign({}, i), { key: index }) : i);
|
|
73
73
|
}
|
|
74
|
-
(0, react_1.
|
|
75
|
-
if (isCountTheSameOrLowerThanPage)
|
|
74
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
75
|
+
if (isCountTheSameOrLowerThanPage || window.PRERENDER)
|
|
76
76
|
return;
|
|
77
77
|
const viewportWidth = parentDiv.current.clientWidth;
|
|
78
78
|
const centerScroll = parentDiv.current.scrollWidth / 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfinityScroll.js","sourceRoot":"","sources":["../../../src/components/InfinityScroll/InfinityScroll.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAQe;AACf,8FAAkD;AAElD,SAAgB,mBAAmB,CACjC,wBAAgC,EAChC,mBAA2B,EAC3B,mBAA2B,EAC3B,mBAA2B;IAE3B,IAAI,wBAAwB,KAAK,mBAAmB;QAAE,OAAO,CAAC,CAAC;SAC1D,IAAI,wBAAwB,KAAK,mBAAmB;QAAE,OAAO,CAAC,CAAC,CAAC;;QAChE,OAAO,CAAC,CAAC;AAChB,CAAC;AATD,kDASC;AAED,SAAgB,IAAI,CAAC,QAAgB;IACnC,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAC1D,GAAG,CAAC,CAAC,CAA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KAAK,CAAC,MAAM,EAAE;4BAC5B,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;4BAClC,QAAQ,GAAG,CAAC,CAAC;yBACd;wBAED,OAAO;4BACL,IAAI,EAAE,QAAQ;4BACd,MAAM;yBACP,CAAC;oBACJ,CAAC,CAAC,CAAC;iBACJ;YACH,CAAC;YACH,CAAC,CAAC,SAAS;QAGd,CAAC,6BAA6B,IAAI,CACjC,uCACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,SAAS,iBACR,eAAe,EAC3B,GAAG,EAAE,OAAO,IAEX,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CACzC,CACP;QACD,uCACE,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,SAAS,iBACR,eAAe,EAC3B,GAAG,EAAE,OAAO,IAEX,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CACrC;QACL,CAAC,6BAA6B,IAAI,CACjC,uCACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,SAAS,iBACR,eAAe,EAC3B,GAAG,EAAE,OAAO,IAEX,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CACzC,CACP,CACG,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,IAAA,kBAAU,EAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const ProgressBar_module_scss_1 = __importDefault(require("./ProgressBar.module.scss"));
|
|
8
|
+
/**
|
|
9
|
+
* Shows a progress bar
|
|
10
|
+
**/
|
|
11
|
+
function ProgressBar({ size, progress, }) {
|
|
12
|
+
return (react_1.default.createElement("div", { className: ProgressBar_module_scss_1.default.container, style: { fontSize: size } },
|
|
13
|
+
react_1.default.createElement("span", { style: { width: `${progress}%` } }),
|
|
14
|
+
react_1.default.createElement("span", { style: { left: `${progress}%` } })));
|
|
15
|
+
}
|
|
16
|
+
exports.default = ProgressBar;
|
|
17
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../src/components/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,wFAA+C;AAE/C;;IAEI;AACJ,SAAwB,WAAW,CAAC,EAClC,IAAI,EACJ,QAAQ,GAUT;IACC,OAAO,CACL,uCAAK,SAAS,EAAE,iCAAM,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzD,wCAAM,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,QAAQ,GAAG,EAAE,GAAI;QAC1C,wCAAM,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,QAAQ,GAAG,EAAE,GAAI,CACrC,CACP,CAAC;AACJ,CAAC;AAnBD,8BAmBC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
@import "../../assets/styles/index.scss";
|
|
3
|
+
|
|
4
|
+
.container {
|
|
5
|
+
margin: 0.375em;
|
|
6
|
+
height: 0.25em;
|
|
7
|
+
background-color: red;
|
|
8
|
+
position: relative;
|
|
9
|
+
border-radius: math.div(0.25em, 2);
|
|
10
|
+
background: var(--progress-bar-bg, #0000);
|
|
11
|
+
> :first-child {
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
background-color: green;
|
|
16
|
+
height: inherit;
|
|
17
|
+
border-top-left-radius: math.div(0.25em, 2);
|
|
18
|
+
border-bottom-left-radius: math.div(0.25em, 2);
|
|
19
|
+
background: var(--progress-bar-bar, var(--digital-blue));
|
|
20
|
+
transition: width var(--animation-speed-transition, $fast) ease-out;
|
|
21
|
+
}
|
|
22
|
+
> :last-child {
|
|
23
|
+
position: absolute;
|
|
24
|
+
margin-top: math.div(-0.5em, 1.25);
|
|
25
|
+
margin-left: -0.5em;
|
|
26
|
+
height: 1em;
|
|
27
|
+
width: 1em;
|
|
28
|
+
border-radius: 0.5em;
|
|
29
|
+
transition: left var(--animation-speed-transition, $fast) ease-out;
|
|
30
|
+
background: var(--progress-bar-guide, var(--digital-blue));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ProgressBar from "./ProgressBar";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
component: typeof ProgressBar;
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const InitialImplementation: {
|
|
8
|
+
(args: any): JSX.Element;
|
|
9
|
+
args: Partial<{
|
|
10
|
+
size: string | number;
|
|
11
|
+
progress: number;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
export declare const Example: (args: any) => JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Example = exports.InitialImplementation = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const ProgressBar_1 = __importDefault(require("./ProgressBar"));
|
|
32
|
+
exports.default = {
|
|
33
|
+
component: ProgressBar_1.default,
|
|
34
|
+
title: "Progress Bar",
|
|
35
|
+
};
|
|
36
|
+
const InitialImplementation = (args) => react_1.default.createElement(ProgressBar_1.default, Object.assign({}, args));
|
|
37
|
+
exports.InitialImplementation = InitialImplementation;
|
|
38
|
+
const Example = (args) => {
|
|
39
|
+
const [s, ss] = (0, react_1.useState)(0);
|
|
40
|
+
(0, react_1.useEffect)(() => {
|
|
41
|
+
const t = setInterval(() => {
|
|
42
|
+
ss(Math.random() * 100);
|
|
43
|
+
}, 500);
|
|
44
|
+
return () => {
|
|
45
|
+
clearInterval(t);
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
return react_1.default.createElement(ProgressBar_1.default, { size: 48, progress: s });
|
|
49
|
+
};
|
|
50
|
+
exports.Example = Example;
|
|
51
|
+
exports.InitialImplementation.args = { size: 48, progress: 33 };
|
|
52
|
+
//# sourceMappingURL=ProgressBar.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.stories.js","sourceRoot":"","sources":["../../../src/components/ProgressBar/ProgressBar.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAmD;AACnD,gEAAwC;AAExC,kBAAe;IACb,SAAS,EAAE,qBAAW;IACtB,KAAK,EAAE,cAAc;CACtB,CAAC;AAEK,MAAM,qBAAqB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC,8BAAC,qBAAW,oBAAK,IAAI,EAAI,CAAC;AAAjE,QAAA,qBAAqB,yBAA4C;AACvE,MAAM,OAAO,GAAG,CAAC,IAAS,EAAE,EAAE;IACnC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAC5B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,EAAE;YACzB,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;QAC1B,CAAC,EAAE,GAAG,CAAC,CAAC;QACR,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,8BAAC,qBAAW,IAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAI,CAAC;AAChD,CAAC,CAAC;AAXW,QAAA,OAAO,WAWlB;AACF,6BAAqB,CAAC,IAAI,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAEpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ProgressBar';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var ProgressBar_1 = require("./ProgressBar");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ProgressBar_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ProgressBar/index.tsx"],"names":[],"mappings":";;;;;;AAAA,6CAAwC;AAA/B,uHAAA,OAAO,OAAA"}
|
|
@@ -89,9 +89,10 @@ function TransitionClasses(type) {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function ChildrenWrapperFactory(func, key, toRemoveKeys) {
|
|
92
|
+
function ChildrenWrapperFactory(func, key, externalPropsContainer, toRemoveKeys) {
|
|
93
93
|
func.associatedKey = key;
|
|
94
94
|
func.toRemoveKeys = toRemoveKeys;
|
|
95
|
+
func.externalProps = externalPropsContainer;
|
|
95
96
|
return func;
|
|
96
97
|
}
|
|
97
98
|
/**
|
|
@@ -104,10 +105,14 @@ function Transition(_a, _containerRef) {
|
|
|
104
105
|
transformOrigin: "initial",
|
|
105
106
|
});
|
|
106
107
|
const [childrenWrappers, setChildrenWrappers] = (0, react_1.useState)(() => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
var _a;
|
|
109
|
+
const externalProps = {
|
|
110
|
+
"data-testid": "transition-container",
|
|
111
|
+
key: String(((_a = children[step]) === null || _a === void 0 ? void 0 : _a.key) || step),
|
|
112
|
+
style: contentStyle,
|
|
113
|
+
className: contentClassName,
|
|
114
|
+
};
|
|
115
|
+
const func = ChildrenWrapperFactory(({ children }) => react_1.default.createElement("div", Object.assign({}, externalProps), children), children[step].key || step, externalProps, []);
|
|
111
116
|
return [func];
|
|
112
117
|
});
|
|
113
118
|
const prevStep = (0, react_1.useRef)(step);
|
|
@@ -138,14 +143,17 @@ function Transition(_a, _containerRef) {
|
|
|
138
143
|
setChildrenWrappers((screensBeforeChangingStep) => {
|
|
139
144
|
const enteringScreenRef = (0, react_1.createRef)();
|
|
140
145
|
const [FirstNextScreen, ...restOfScreens] = screensBeforeChangingStep.filter((a) => (a === null || a === void 0 ? void 0 : a.associatedKey) !== String(key));
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
if (FirstNextScreen) {
|
|
147
|
+
Object.assign(FirstNextScreen.externalProps, {
|
|
148
|
+
"data-testid": "transition-container",
|
|
149
|
+
style: contentStyle,
|
|
150
|
+
className: `${transitionClasses.backward.elementExiting}`,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function animationEndListener(event) {
|
|
148
154
|
var _a, _b;
|
|
155
|
+
if (event.target !== event.currentTarget)
|
|
156
|
+
return;
|
|
149
157
|
const isAnimationFromExpectedState = (_a = enteringScreenRef.current) === null || _a === void 0 ? void 0 : _a.classList.contains(transitionClasses.backward.elementEntering);
|
|
150
158
|
(_b = enteringScreenRef.current) === null || _b === void 0 ? void 0 : _b.classList.remove(transitionClasses.backward.elementEntering);
|
|
151
159
|
setChildrenWrappers((screensAfterTheCurrentStepEntered) => {
|
|
@@ -162,13 +170,26 @@ function Transition(_a, _containerRef) {
|
|
|
162
170
|
return shouldKeep;
|
|
163
171
|
});
|
|
164
172
|
});
|
|
165
|
-
|
|
173
|
+
event.currentTarget.removeEventListener("animationend", animationEndListener);
|
|
166
174
|
}
|
|
175
|
+
const propsContainer = {
|
|
176
|
+
ref: enteringScreenRef,
|
|
177
|
+
"data-testid": "transition-container",
|
|
178
|
+
key,
|
|
179
|
+
className: `${transitionClasses.backward.elementEntering} ${contentClassName}`,
|
|
180
|
+
style: Object.assign({}, contentStyle),
|
|
181
|
+
onAnimationEnd: animationEndListener,
|
|
182
|
+
};
|
|
167
183
|
const newWrapper = ChildrenWrapperFactory(({ children }) => {
|
|
168
|
-
return
|
|
169
|
-
}, key, [prevKeyToRemove, ...((FirstNextScreen === null || FirstNextScreen === void 0 ? void 0 : FirstNextScreen.toRemoveKeys) || [])]);
|
|
184
|
+
return react_1.default.createElement("div", Object.assign({}, propsContainer), children);
|
|
185
|
+
}, key, propsContainer, [prevKeyToRemove, ...((FirstNextScreen === null || FirstNextScreen === void 0 ? void 0 : FirstNextScreen.toRemoveKeys) || [])]);
|
|
170
186
|
if (FirstNextScreen)
|
|
171
|
-
return [
|
|
187
|
+
return [
|
|
188
|
+
newWrapper,
|
|
189
|
+
FirstNextScreen ||
|
|
190
|
+
ChildrenWrapperFactory(() => react_1.default.createElement(react_1.default.Fragment, null), "", {}),
|
|
191
|
+
...restOfScreens,
|
|
192
|
+
];
|
|
172
193
|
else
|
|
173
194
|
return [newWrapper];
|
|
174
195
|
});
|
|
@@ -180,32 +201,43 @@ function Transition(_a, _containerRef) {
|
|
|
180
201
|
const lastIndex = screensBeforeChangingStep.length - 1;
|
|
181
202
|
const lastWrapper = screensBeforeChangingStep[lastIndex];
|
|
182
203
|
const nextScreenRef = (0, react_1.createRef)();
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
204
|
+
if (lastWrapper) {
|
|
205
|
+
Object.assign(lastWrapper.externalProps, {
|
|
206
|
+
"data-testid": "transition-container",
|
|
207
|
+
style: contentStyle,
|
|
208
|
+
className: `${contentClassName} ${transitionClasses.forward.elementExiting}`,
|
|
209
|
+
onAnimationEnd: (e) => {
|
|
210
|
+
var _a;
|
|
211
|
+
if (e.target !== e.currentTarget)
|
|
212
|
+
return;
|
|
213
|
+
if (transitionClasses.forward.elementEntering)
|
|
214
|
+
(_a = nextScreenRef.current) === null || _a === void 0 ? void 0 : _a.classList.remove(transitionClasses.forward.elementEntering);
|
|
215
|
+
if (onDiscardStep)
|
|
216
|
+
onDiscardStep(prevKeyToRemove);
|
|
217
|
+
setChildrenWrappers((screensAfterTheCurrentStepEntered) => {
|
|
218
|
+
const nextState = screensAfterTheCurrentStepEntered.filter((s) => {
|
|
219
|
+
const shouldMantain = (s === null || s === void 0 ? void 0 : s.associatedKey) !== String(prevKeyToRemove);
|
|
220
|
+
return shouldMantain;
|
|
199
221
|
});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
222
|
+
return nextState;
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
const propsContainer = {
|
|
228
|
+
ref: nextScreenRef,
|
|
229
|
+
"data-testid": "transition-container",
|
|
230
|
+
key,
|
|
231
|
+
style: Object.assign({}, contentStyle),
|
|
232
|
+
className: `${contentClassName} ${transitionClasses.forward.elementEntering}`,
|
|
233
|
+
};
|
|
203
234
|
const newWrapper = ChildrenWrapperFactory(({ children }) => {
|
|
204
|
-
return
|
|
205
|
-
}, key);
|
|
235
|
+
return react_1.default.createElement("div", Object.assign({}, propsContainer), children);
|
|
236
|
+
}, key, propsContainer);
|
|
206
237
|
return [
|
|
207
238
|
...screensBeforeChangingStep.slice(0, lastIndex),
|
|
208
|
-
|
|
239
|
+
lastWrapper ||
|
|
240
|
+
ChildrenWrapperFactory(() => react_1.default.createElement(react_1.default.Fragment, null), "fallback", {}),
|
|
209
241
|
newWrapper,
|
|
210
242
|
];
|
|
211
243
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transition.js","sourceRoot":"","sources":["../../../src/components/Transition/Transition.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAYe;AACf,sFAA8C;AA6B9C,SAAS,iBAAiB,CACxB,IAEC;IAiBD,QAAQ,IAAI,EAAE;QACZ,KAAK,wBAAwB,CAAC,SAAS;YACrC,OAAO;gBACL,QAAQ,EAAE;oBACR,cAAc,EAAE,gCAAM,CAAC,eAAe;oBACtC,eAAe,EAAE,gCAAM,CAAC,cAAc;iBACvC;gBACD,OAAO,EAAE;oBACP,cAAc,EAAE,gCAAM,CAAC,eAAe;oBACtC,eAAe,EAAE,gCAAM,CAAC,cAAc;iBACvC;aACF,CAAC;QACJ,KAAK,wBAAwB,CAAC,IAAI;YAChC,OAAO;gBACL,QAAQ,EAAE;oBACR,cAAc,EAAE,gCAAM,CAAC,eAAe;oBACtC,eAAe,EAAE,gCAAM,CAAC,aAAa;iBACtC;gBACD,OAAO,EAAE;oBACP,cAAc,EAAE,gCAAM,CAAC,eAAe;oBACtC,eAAe,EAAE,gCAAM,CAAC,aAAa;iBACtC;aACF,CAAC;QACJ,KAAK,wBAAwB,CAAC,KAAK;YACjC,OAAO;gBACL,QAAQ,EAAE;oBACR,eAAe,EAAE,gCAAM,CAAC,YAAY;oBACpC,cAAc,EAAE,EAAE;iBACnB;gBACD,OAAO,EAAE;oBACP,eAAe,EAAE,EAAE;oBACnB,cAAc,EAAE,gCAAM,CAAC,QAAQ;iBAChC;aACF,CAAC;QACJ,KAAK,wBAAwB,CAAC,qBAAqB,CAAC;QACpD,KAAK,wBAAwB,CAAC,mBAAmB;YAC/C,OAAO;gBACL,QAAQ,EAAE;oBACR,eAAe,EAAE,gCAAM,CAAC,MAAM;oBAC9B,cAAc,EAAE,gCAAM,CAAC,QAAQ;iBAChC;gBACD,OAAO,EAAE;oBACP,eAAe,EAAE,gCAAM,CAAC,OAAO;oBAC/B,cAAc,EAAE,gCAAM,CAAC,OAAO;iBAC/B;aACF,CAAC;KACL;AACH,CAAC;
|
|
1
|
+
{"version":3,"file":"Transition.js","sourceRoot":"","sources":["../../../src/components/Transition/Transition.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAOnC;AAED,kBAAe,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
/**
|
|
8
|
+
* This holds the logic for switching transition modes inside the content container
|
|
9
|
+
**/
|
|
10
|
+
function TransitionContainer() {
|
|
11
|
+
return react_1.default.createElement(react_1.default.Fragment, null, "TransitionContainer");
|
|
12
|
+
}
|
|
13
|
+
exports.default = TransitionContainer;
|
|
14
|
+
//# sourceMappingURL=TransitionContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransitionContainer.js","sourceRoot":"","sources":["../../../../src/components/Transition/TransitionContainer/TransitionContainer.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAI1B;;IAEI;AACJ,SAAwB,mBAAmB;IAEvC,OAAO,oFAAwB,CAAC;AACpC,CAAC;AAHD,sCAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TransitionContainer';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var TransitionContainer_1 = require("./TransitionContainer");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(TransitionContainer_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Transition/TransitionContainer/index.tsx"],"names":[],"mappings":";;;;;;AAAA,6DAAgD;AAAvC,+HAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { PropsWithChildren, ReactElement, RefObject } from "react";
|
|
2
|
+
declare type ReactElementWithState = ReactElement & {
|
|
3
|
+
status: "loading" | "succeded" | "failed";
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* This propagates the utilitary functions
|
|
7
|
+
*/
|
|
8
|
+
export declare function AsyncProcessQueueProvider({ children }: PropsWithChildren<{}>): JSX.Element;
|
|
9
|
+
export declare function useAsyncProcessQueueContext(): {
|
|
10
|
+
targetElRef: React.RefObject<HTMLElement>;
|
|
11
|
+
pendingTransactions: {
|
|
12
|
+
count: number;
|
|
13
|
+
setCounter: React.Dispatch<React.SetStateAction<number>>;
|
|
14
|
+
increment: () => void;
|
|
15
|
+
decrement: () => void;
|
|
16
|
+
reset: () => void;
|
|
17
|
+
};
|
|
18
|
+
UIs: ReactElementWithState[];
|
|
19
|
+
setUIs: (func: (prev: ReactElementWithState[]) => ReactElementWithState[]) => void;
|
|
20
|
+
};
|
|
21
|
+
declare type AsyncProcessStatuses = "loading" | "succeded" | "failed";
|
|
22
|
+
export interface UIStateFactory {
|
|
23
|
+
(status: AsyncProcessStatuses, error?: Error, dismiss?: () => void, retry?: () => void): ReactElement;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This function wraps other async functions and decides when the ongoing promise should be put on the queue or not
|
|
27
|
+
*/
|
|
28
|
+
export declare function useAsyncProcessQueue<T extends {
|
|
29
|
+
[k: string]: (...args: any[]) => Promise<any>;
|
|
30
|
+
}>(functionsToQueue: T, UIFactory: (functionName: keyof T) => UIStateFactory): T & {
|
|
31
|
+
elToTransitionToQueue: RefObject<HTMLElement>;
|
|
32
|
+
/**
|
|
33
|
+
* Function that wraps the current running actions and animates to the target queue element
|
|
34
|
+
*/
|
|
35
|
+
wrapQueue: () => void;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useAsyncProcessQueue = exports.useAsyncProcessQueueContext = exports.AsyncProcessQueueProvider = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const Context = (0, react_1.createContext)(null);
|
|
29
|
+
function useCounter() {
|
|
30
|
+
const [count, setCounter] = (0, react_1.useState)(0);
|
|
31
|
+
return {
|
|
32
|
+
count,
|
|
33
|
+
setCounter,
|
|
34
|
+
increment: () => setCounter((prev) => prev + 1),
|
|
35
|
+
decrement: () => setCounter((prev) => prev - 1),
|
|
36
|
+
reset: () => setCounter(0),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* This propagates the utilitary functions
|
|
41
|
+
*/
|
|
42
|
+
function AsyncProcessQueueProvider({ children }) {
|
|
43
|
+
const targetRef = (0, react_1.useRef)(null);
|
|
44
|
+
const pendingCounter = useCounter();
|
|
45
|
+
const [UIs, setUIs] = (0, react_1.useState)([]);
|
|
46
|
+
return (react_1.default.createElement(Context.Provider, { value: {
|
|
47
|
+
targetElRef: targetRef,
|
|
48
|
+
pendingTransactions: pendingCounter,
|
|
49
|
+
setUIs,
|
|
50
|
+
UIs,
|
|
51
|
+
} }, children));
|
|
52
|
+
}
|
|
53
|
+
exports.AsyncProcessQueueProvider = AsyncProcessQueueProvider;
|
|
54
|
+
function useAsyncProcessQueueContext() {
|
|
55
|
+
return (0, react_1.useContext)(Context);
|
|
56
|
+
}
|
|
57
|
+
exports.useAsyncProcessQueueContext = useAsyncProcessQueueContext;
|
|
58
|
+
function calculateCenter(el) {
|
|
59
|
+
const boundsOnViewport = el.getBoundingClientRect();
|
|
60
|
+
return {
|
|
61
|
+
x: boundsOnViewport.x + boundsOnViewport.width / 2,
|
|
62
|
+
y: boundsOnViewport.y + boundsOnViewport.height / 2,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* This function wraps other async functions and decides when the ongoing promise should be put on the queue or not
|
|
67
|
+
*/
|
|
68
|
+
function useAsyncProcessQueue(functionsToQueue, UIFactory) {
|
|
69
|
+
const loadingRef = (0, react_1.useRef)(null);
|
|
70
|
+
const wrapped = (0, react_1.useRef)(false);
|
|
71
|
+
const elToTransitionToQueue = (0, react_1.useRef)(null);
|
|
72
|
+
const { targetElRef: targetEl, setUIs } = (0, react_1.useContext)(Context);
|
|
73
|
+
const initialCenter = (0, react_1.useRef)();
|
|
74
|
+
(0, react_1.useEffect)(() => {
|
|
75
|
+
initialCenter.current = {
|
|
76
|
+
center: calculateCenter(targetEl.current),
|
|
77
|
+
dimensions: [
|
|
78
|
+
targetEl.current.clientWidth,
|
|
79
|
+
targetEl.current.clientHeight,
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
const wrapQueue = (0, react_1.useCallback)(() => {
|
|
84
|
+
if (wrapped.current || !loadingRef.current)
|
|
85
|
+
return;
|
|
86
|
+
const wrapUI = loadingRef.current;
|
|
87
|
+
wrapped.current = true;
|
|
88
|
+
const clone = elToTransitionToQueue.current.cloneNode(true);
|
|
89
|
+
const currPositionOnViewport = elToTransitionToQueue.current.getBoundingClientRect();
|
|
90
|
+
const currPosCenter = calculateCenter(elToTransitionToQueue.current);
|
|
91
|
+
const targetCenter = targetEl.current
|
|
92
|
+
? calculateCenter(targetEl.current)
|
|
93
|
+
: initialCenter.current.center;
|
|
94
|
+
clone.style.position = "fixed";
|
|
95
|
+
clone.style.top = `${currPositionOnViewport.top}px`;
|
|
96
|
+
clone.style.left = `${currPositionOnViewport.left}px`;
|
|
97
|
+
clone.style.width = `${currPositionOnViewport.width}px`;
|
|
98
|
+
clone.style.height = `${currPositionOnViewport.height}px`;
|
|
99
|
+
clone.style.transition = `transform 250ms ease-out, opacity 250ms ease-in`;
|
|
100
|
+
clone.style.opacity = "1";
|
|
101
|
+
clone.ontransitionend = ({ target, currentTarget }) => {
|
|
102
|
+
if (target === currentTarget)
|
|
103
|
+
wrapUI();
|
|
104
|
+
};
|
|
105
|
+
const targetHeight = Math.min(targetEl.current
|
|
106
|
+
? targetEl.current.clientHeight
|
|
107
|
+
: initialCenter.current.dimensions[1], elToTransitionToQueue.current.clientHeight);
|
|
108
|
+
const targetWidth = Math.min(targetHeight, targetEl.current
|
|
109
|
+
? targetEl.current.clientWidth
|
|
110
|
+
: initialCenter.current.dimensions[0], elToTransitionToQueue.current.clientWidth);
|
|
111
|
+
const targetScaleX = targetWidth / elToTransitionToQueue.current.clientWidth;
|
|
112
|
+
const targetScaleY = targetHeight / elToTransitionToQueue.current.clientHeight;
|
|
113
|
+
document.body.appendChild(clone);
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
clone.style.opacity = "0";
|
|
116
|
+
clone.style.transform = `translateX(${targetCenter.x - currPosCenter.x}px) translateY(${targetCenter.y - currPosCenter.y}px) scaleX(${targetScaleX}) scaleY(${targetScaleY})`;
|
|
117
|
+
clone.addEventListener("transitionend", ({ target, currentTarget }) => {
|
|
118
|
+
if (target === currentTarget)
|
|
119
|
+
clone.remove();
|
|
120
|
+
});
|
|
121
|
+
}, 100);
|
|
122
|
+
}, []);
|
|
123
|
+
return Object.entries(functionsToQueue).reduce((r, [k, v]) => {
|
|
124
|
+
const process = (...args) => {
|
|
125
|
+
const promise = v(...args);
|
|
126
|
+
loadingRef.current = function () {
|
|
127
|
+
// Write the loading UI
|
|
128
|
+
const LoadingUIInstance = Object.assign(Object.assign({}, UIFactory(k)("loading")), { status: "loading" });
|
|
129
|
+
setUIs((prev) => [
|
|
130
|
+
...prev.filter((a) => a.key !== LoadingUIInstance.key),
|
|
131
|
+
LoadingUIInstance,
|
|
132
|
+
]);
|
|
133
|
+
promise.then((result) => {
|
|
134
|
+
const UIInstance = UIFactory(k)("succeded");
|
|
135
|
+
// Write success UI
|
|
136
|
+
setUIs((prev) => prev.map((a) => a === LoadingUIInstance
|
|
137
|
+
? Object.assign(Object.assign({}, UIInstance), { status: "succeded" }) : a));
|
|
138
|
+
return result;
|
|
139
|
+
});
|
|
140
|
+
promise.catch((error) => {
|
|
141
|
+
const UIInstance = UIFactory(k)("failed", error, () => setUIs((prev) => prev.filter((ui) => ui !== UIInstance)), () => {
|
|
142
|
+
process(...args);
|
|
143
|
+
loadingRef.current();
|
|
144
|
+
});
|
|
145
|
+
// Write success UI
|
|
146
|
+
setUIs((prev) => prev.map((a) => a === LoadingUIInstance
|
|
147
|
+
? Object.assign(Object.assign({}, UIInstance), { status: "failed" }) : a));
|
|
148
|
+
throw error;
|
|
149
|
+
});
|
|
150
|
+
return promise;
|
|
151
|
+
};
|
|
152
|
+
promise.finally(() => {
|
|
153
|
+
loadingRef.current = null;
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
return Object.assign(Object.assign({}, r), { [k]: process });
|
|
157
|
+
}, { elToTransitionToQueue, wrapQueue });
|
|
158
|
+
}
|
|
159
|
+
exports.useAsyncProcessQueue = useAsyncProcessQueue;
|
|
160
|
+
//# sourceMappingURL=AsyncProcessQueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncProcessQueue.js","sourceRoot":"","sources":["../../src/context/AsyncProcessQueue.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAUe;AAMf,MAAM,OAAO,GAAG,IAAA,qBAAa,EAO1B,IAAW,CAAC,CAAC;AAEhB,SAAS,UAAU;IACjB,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAExC,OAAO;QACL,KAAK;QACL,UAAU;QACV,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC;QAC/C,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC;QAC/C,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;KAC3B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAyB;IAC3E,MAAM,SAAS,GAAG,IAAA,cAAM,EAAc,IAAI,CAAC,CAAC;IAC5C,MAAM,cAAc,GAAG,UAAU,EAAE,CAAC;IACpC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,IAAA,gBAAQ,EAA0B,EAAE,CAAC,C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AAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,EAC9D,GAAG,EAAE;wBACH,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;wBACjB,UAAU,CAAC,OAAQ,EAAE,CAAC;oBACxB,CAAC,CACuB,CAAC;oBAC3B,mBAAmB;oBACnB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACd,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACb,CAAC,KAAK,iBAAiB;wBACrB,CAAC,iCAAM,UAAU,KAAE,MAAM,EAAE,QAAQ,IACnC,CAAC,CAAC,CAAC,CACN,CACF,CAAC;oBAEF,MAAM,KAAK,CAAC;gBACd,CAAC,CAAC,CAAC;gBACH,OAAO,OAAO,CAAC;YACjB,CAAC,CAAC;YACF,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE;gBACnB,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;YAC5B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACF,uCACK,CAAC,KACJ,CAAC,CAAC,CAAC,EAAE,OAAO,IACZ;IACJ,CAAC,EACD,EAAE,qBAAqB,EAAE,SAAS,EAMjC,CACF,CAAC;AACJ,CAAC;AA/JD,oDA+JC"}
|
|
@@ -12,6 +12,11 @@ export declare type ContextSpecs = {
|
|
|
12
12
|
[k in React.ComponentProps<typeof import("../components/Text")["default"]>["type"]]?: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
+
button?: {
|
|
16
|
+
className?: {
|
|
17
|
+
[k in NonNullable<React.ComponentProps<typeof import("../components/Button")["default"]>["variant"]>]?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
15
20
|
input: {
|
|
16
21
|
className: string;
|
|
17
22
|
border: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneUIProvider.js","sourceRoot":"","sources":["../../src/context/OneUIProvider.tsx"],"names":[],"mappings":";;;;;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AC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,MAAM,GAAG,GAAG,IAAA,aAAG,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC/B,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAU,CAAC;QAC/C,OAAO,YAAY,CAAC,GAAG,IAAI,YAAY,CAAmB,CAAC;KAC5D;IACD,OAAO,IAAA,aAAG,EAAC,OAAO,EAAE,IAAI,CAAC,IAAI,YAAY,CAAC;AAC5C,CAAC;AAXD,wCAWC"}
|
|
@@ -16,6 +16,13 @@ export declare function useOneUIContext(): {
|
|
|
16
16
|
boldTitleBig?: string | undefined;
|
|
17
17
|
} | undefined;
|
|
18
18
|
} | undefined;
|
|
19
|
+
button?: {
|
|
20
|
+
className?: {
|
|
21
|
+
transparent?: string | undefined;
|
|
22
|
+
filled?: string | undefined;
|
|
23
|
+
outline?: string | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} | undefined;
|
|
19
26
|
input?: {
|
|
20
27
|
className?: string | undefined;
|
|
21
28
|
border?: boolean | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
export default function useAsyncControl<E extends CommonErrorCodes, F = any>(functionsToWrap?: F): {
|
|
2
|
+
export default function useAsyncControl<E = any, F = any>(functionsToWrap?: F): {
|
|
4
3
|
process: (asyncFn: () => Promise<any>) => Promise<any>;
|
|
5
4
|
loading: boolean;
|
|
6
|
-
error: E | undefined;
|
|
7
|
-
setError: import("react").Dispatch<import("react").SetStateAction<E | undefined>>;
|
|
5
|
+
error: Error | E | undefined;
|
|
6
|
+
setError: import("react").Dispatch<import("react").SetStateAction<Error | E | undefined>>;
|
|
8
7
|
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
9
8
|
} & F;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAsyncControl.js","sourceRoot":"","sources":["../../src/hooks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,IAChE;IACH,CAAC,EAAE,EAAO,CAAM,EAChB;AACJ,CAAC;AA/BD,kCA+BC"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import useAsyncControl from "./useAsyncControl";
|
|
2
|
-
import { CommonErrorCodes } from "../types";
|
|
3
2
|
declare type UpdateEvent<I extends any> = {
|
|
4
3
|
finished: boolean;
|
|
5
4
|
items: I;
|
|
6
5
|
totalItems: number;
|
|
7
6
|
};
|
|
8
7
|
export default function usePagination<I extends any, A extends any[]>(request: (page: number, currItems?: I, ...args: A) => Promise<UpdateEvent<I>>, paginationId?: (...args: A) => string): Paginable<I, A>;
|
|
9
|
-
export declare type Paginable<I extends any, A extends any[] = []> = {
|
|
8
|
+
export declare type Paginable<I extends any, A extends any[] = [], E extends any = any> = {
|
|
10
9
|
updateItems: (cb: (prevItems?: I) => UpdateEvent<I>["items"]) => void;
|
|
11
10
|
getNextPage: (...args: A) => void;
|
|
12
11
|
getPage: (page: number, ...args: A) => void;
|
|
13
12
|
totalItems: (...args: A) => number | undefined;
|
|
14
13
|
loading: boolean;
|
|
15
|
-
error:
|
|
14
|
+
error: E | Error | undefined;
|
|
16
15
|
items: I | undefined;
|
|
17
16
|
setError: ReturnType<typeof useAsyncControl>["setError"];
|
|
18
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onepercentio/one-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "A set of reusable components created through the development of Onepercent projects",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"https-browserify": "^1.0.0",
|
|
49
49
|
"inquirer": "^8.2.4",
|
|
50
50
|
"jest": "^27.3.1",
|
|
51
|
+
"jquery": "^3.6.0",
|
|
51
52
|
"node-fetch": "^2",
|
|
52
53
|
"os-browserify": "^0.3.0",
|
|
53
54
|
"react": "^18.0.0",
|