@elliemae/ds-legacy-uploader 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var styled_exports = {};
30
+ __export(styled_exports, {
31
+ StyledAcceptedTypes: () => StyledAcceptedTypes,
32
+ StyledDividerVertical: () => StyledDividerVertical,
33
+ StyledDividerVerticalActions: () => StyledDividerVerticalActions,
34
+ StyledInfoText: () => StyledInfoText,
35
+ StyledUploader: () => StyledUploader,
36
+ StyledUploaderActions: () => StyledUploaderActions,
37
+ StyledUploaderDragActive: () => StyledUploaderDragActive,
38
+ StyledUploaderIconArea: () => StyledUploaderIconArea,
39
+ StyledUploaderInfo: () => StyledUploaderInfo,
40
+ StyledUploaderWrapper: () => StyledUploaderWrapper
41
+ });
42
+ module.exports = __toCommonJS(styled_exports);
43
+ var React = __toESM(require("react"));
44
+ var import_ds_legacy_system = require("@elliemae/ds-legacy-system");
45
+ var import_constants = require("./constants.js");
46
+ const StyledUploaderWrapper = (0, import_ds_legacy_system.styled)("div", {
47
+ name: import_constants.DSUploaderName,
48
+ slot: import_constants.DSUploaderSlots.ROOT
49
+ })`
50
+ display: inline-flex;
51
+ flex-direction: column;
52
+ ${import_ds_legacy_system.xStyledCommonProps}
53
+ `;
54
+ const StyledDividerVertical = (0, import_ds_legacy_system.styled)("div", {
55
+ name: import_constants.DSUploaderName,
56
+ slot: import_constants.DSUploaderSlots.DIVIDER_VERTICAL
57
+ })`
58
+ border-right: 1px solid ${({ theme }) => theme.colors.neutral[100]};
59
+ border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[100]};
60
+ height: ${({ theme }) => theme.space.s};
61
+ margin: 0 ${({ theme }) => theme.space.xs};
62
+ `;
63
+ const StyledDividerVerticalActions = (0, import_ds_legacy_system.styled)(StyledDividerVertical, {
64
+ name: import_constants.DSUploaderName,
65
+ slot: import_constants.DSUploaderSlots.ACTIONS_DIVIDER_VERTICAL
66
+ })`
67
+ height: initial;
68
+ margin: 2px ${({ theme }) => theme.space.xxxs};
69
+ `;
70
+ const StyledUploaderIconArea = (0, import_ds_legacy_system.styled)("div", {
71
+ name: import_constants.DSUploaderName,
72
+ slot: import_constants.DSUploaderSlots.ICON_AREA
73
+ })`
74
+ position: relative;
75
+ & svg {
76
+ fill: ${({ theme }) => theme.colors.neutral["500"]};
77
+ }
78
+ `;
79
+ const StyledUploaderDragActive = (0, import_ds_legacy_system.styled)("div", {
80
+ name: import_constants.DSUploaderName,
81
+ slot: import_constants.DSUploaderSlots.UPLOADER_DRAG_ACTIVE
82
+ })`
83
+ visibility: hidden;
84
+ position: absolute;
85
+ top: 0;
86
+ left: 0;
87
+ width: 100%;
88
+ height: 100%;
89
+ background-color: ${({ theme }) => theme.colors.brand[500]};
90
+ color: ${({ theme }) => theme.colors.neutral["000"]};
91
+ border: 1px ${({ theme }) => theme.colors.brand[500]};
92
+ border-radius: 4px;
93
+ font-weight: ${({ theme }) => theme.fontWeights.bold};
94
+ justify-content: center;
95
+ align-items: center;
96
+ `;
97
+ const StyledUploader = (0, import_ds_legacy_system.styled)("div", {
98
+ name: import_constants.DSUploaderName,
99
+ slot: import_constants.DSUploaderSlots.UPLOADER
100
+ })`
101
+ position: relative;
102
+ display: inline-flex;
103
+ border: 1px solid
104
+ ${({ theme, isDragActive, disabledAll }) => isDragActive && !disabledAll ? "transparent" : theme.colors.neutral["200"]};
105
+ padding: 6px ${({ theme }) => theme.space.xs};
106
+ border-radius: 4px;
107
+ align-items: center;
108
+ outline: none;
109
+
110
+ &:hover,
111
+ &:focus {
112
+ background-color: ${({ theme }) => theme.colors.brand["100"]};
113
+ border: 1px dashed ${({ theme }) => theme.colors.brand["500"]};
114
+ ${StyledDividerVertical} {
115
+ border-color: ${({ theme }) => theme.colors.brand["300"]};
116
+ }
117
+ ${StyledUploaderIconArea} {
118
+ & svg {
119
+ fill: ${({ theme }) => theme.colors.brand["500"]};
120
+ }
121
+ }
122
+ }
123
+
124
+ &:focus {
125
+ // in replace of @include dsFocus();
126
+ outline: none;
127
+ box-shadow: inset 0 0 0 1px #8cc2ed;
128
+ border-radius: 2px;
129
+ }
130
+
131
+ ${StyledUploaderDragActive} {
132
+ ${({ isDragActive, disabledAll }) => {
133
+ if (isDragActive && !disabledAll) {
134
+ return `
135
+ visibility: visible;
136
+ display: flex;
137
+
138
+ `;
139
+ }
140
+ }}
141
+ }
142
+ `;
143
+ const StyledUploaderInfo = (0, import_ds_legacy_system.styled)("div", {
144
+ name: import_constants.DSUploaderName,
145
+ slot: import_constants.DSUploaderSlots.UPLOADER_INFO
146
+ })``;
147
+ const StyledInfoText = (0, import_ds_legacy_system.styled)("span", {
148
+ name: import_constants.DSUploaderName,
149
+ slot: import_constants.DSUploaderSlots.INFO_TEXT
150
+ })`
151
+ font-size: 1rem;
152
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
153
+ color: ${({ theme }) => theme.colors.neutral[700]};
154
+ `;
155
+ const StyledAcceptedTypes = (0, import_ds_legacy_system.styled)("div", {
156
+ name: import_constants.DSUploaderName,
157
+ slot: import_constants.DSUploaderSlots.ACCEPTED_TYPES
158
+ })`
159
+ margin-top: 2px;
160
+ color: ${({ theme }) => theme.colors.neutral[500]};
161
+ text-transform: uppercase;
162
+ text-align: right;
163
+ font-size: ${({ theme }) => theme.fontSizes.label[200]};
164
+ `;
165
+ const StyledUploaderActions = (0, import_ds_legacy_system.styled)("div", {
166
+ name: import_constants.DSUploaderName,
167
+ slot: import_constants.DSUploaderSlots.UPLOADER_ACTIONS
168
+ })`
169
+ display: flex;
170
+ `;
171
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-legacy-system';\nimport { DSUploaderName, DSUploaderSlots } from './constants.js';\n\nexport const StyledUploaderWrapper = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.ROOT,\n})`\n display: inline-flex;\n flex-direction: column;\n ${xStyledCommonProps}\n`;\n\nexport const StyledDividerVertical = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.DIVIDER_VERTICAL,\n})`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral[100]};\n border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[100]};\n height: ${({ theme }) => theme.space.s};\n margin: 0 ${({ theme }) => theme.space.xs};\n`;\n\nexport const StyledDividerVerticalActions = styled(StyledDividerVertical, {\n name: DSUploaderName,\n slot: DSUploaderSlots.ACTIONS_DIVIDER_VERTICAL,\n})`\n height: initial;\n margin: 2px ${({ theme }) => theme.space.xxxs};\n`;\n\nexport const StyledUploaderIconArea = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.ICON_AREA,\n})`\n position: relative;\n & svg {\n fill: ${({ theme }) => theme.colors.neutral['500']};\n }\n`;\n\nexport const StyledUploaderDragActive = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.UPLOADER_DRAG_ACTIVE,\n})`\n visibility: hidden;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: ${({ theme }) => theme.colors.brand[500]};\n color: ${({ theme }) => theme.colors.neutral['000']};\n border: 1px ${({ theme }) => theme.colors.brand[500]};\n border-radius: 4px;\n font-weight: ${({ theme }) => theme.fontWeights.bold};\n justify-content: center;\n align-items: center;\n`;\n\nexport const StyledUploader = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.UPLOADER,\n})<{ isDragActive: boolean; disabledAll: boolean }>`\n position: relative;\n display: inline-flex;\n border: 1px solid\n ${({ theme, isDragActive, disabledAll }) =>\n isDragActive && !disabledAll ? 'transparent' : theme.colors.neutral['200']};\n padding: 6px ${({ theme }) => theme.space.xs};\n border-radius: 4px;\n align-items: center;\n outline: none;\n\n &:hover,\n &:focus {\n background-color: ${({ theme }) => theme.colors.brand['100']};\n border: 1px dashed ${({ theme }) => theme.colors.brand['500']};\n ${StyledDividerVertical} {\n border-color: ${({ theme }) => theme.colors.brand['300']};\n }\n ${StyledUploaderIconArea} {\n & svg {\n fill: ${({ theme }) => theme.colors.brand['500']};\n }\n }\n }\n\n &:focus {\n // in replace of @include dsFocus();\n outline: none;\n box-shadow: inset 0 0 0 1px #8cc2ed;\n border-radius: 2px;\n }\n\n ${StyledUploaderDragActive} {\n ${({ isDragActive, disabledAll }) => {\n if (isDragActive && !disabledAll) {\n return `\n visibility: visible;\n display: flex;\n\n `;\n }\n }}\n }\n`;\n\nexport const StyledUploaderInfo = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.UPLOADER_INFO,\n})``;\nexport const StyledInfoText = styled('span', {\n name: DSUploaderName,\n slot: DSUploaderSlots.INFO_TEXT,\n})`\n font-size: 1rem;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n color: ${({ theme }) => theme.colors.neutral[700]};\n`;\n\nexport const StyledAcceptedTypes = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.ACCEPTED_TYPES,\n})`\n margin-top: 2px;\n color: ${({ theme }) => theme.colors.neutral[500]};\n text-transform: uppercase;\n text-align: right;\n font-size: ${({ theme }) => theme.fontSizes.label[200]};\n`;\n\nexport const StyledUploaderActions = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.UPLOADER_ACTIONS,\n})`\n display: flex;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA2C;AAC3C,uBAAgD;AAEzC,MAAM,4BAAwB,gCAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,IAGG;AAAA;AAGG,MAAM,4BAAwB,gCAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA,4BAC2B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,6BACtC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,YACxD,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,cACzB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAGlC,MAAM,mCAA+B,gCAAO,uBAAuB;AAAA,EACxE,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA,gB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A;AAAA;AAAA;AAAA;AAAA;AAAA,IAYnD;AAAA,MACE,CAAC,EAAE,cAAc,YAAY,MAAM;AACnC,MAAI,gBAAgB,CAAC,aAAa;AAChC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKT;AACF;AAAA;AAAA;AAIG,MAAM,yBAAqB,gCAAO,OAAO;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AACM,MAAM,qBAAiB,gCAAO,QAAQ;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA,iBAEgB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,WACvC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAG3C,MAAM,0BAAsB,gCAAO,OAAO;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA,WAEU,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA,eAGnC,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA;AAGhD,MAAM,4BAAwB,gCAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,179 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useMemo } from "react";
4
+ import { runAll } from "@elliemae/ds-legacy-utilities";
5
+ import {
6
+ describe,
7
+ useMemoMergePropsWithDefault,
8
+ useValidateTypescriptPropTypes,
9
+ useGetGlobalAttributes,
10
+ useGetXstyledProps
11
+ } from "@elliemae/ds-legacy-props-helpers";
12
+ import { DSButtonV2, BUTTON_TYPES } from "@elliemae/ds-legacy-button";
13
+ import { useDropzone } from "react-dropzone";
14
+ import DSTooltip from "@elliemae/ds-legacy-tooltip";
15
+ import { defaultProps, propTypes } from "./react-desc-prop-types.js";
16
+ import {
17
+ StyledAcceptedTypes,
18
+ StyledDividerVertical,
19
+ StyledInfoText,
20
+ StyledUploader,
21
+ StyledUploaderDragActive,
22
+ StyledUploaderIconArea,
23
+ StyledUploaderInfo,
24
+ StyledUploaderWrapper,
25
+ StyledUploaderActions,
26
+ StyledDividerVerticalActions
27
+ } from "./styled.js";
28
+ import { DSUploaderName, defaultActions } from "./constants.js";
29
+ const ActionButton = ({ labelText, ...otherProps }) => /* @__PURE__ */ jsx(
30
+ DSButtonV2,
31
+ {
32
+ ...otherProps,
33
+ buttonType: BUTTON_TYPES.TEXT,
34
+ style: { padding: 0, height: "initial", borderWidth: "0px" },
35
+ children: labelText
36
+ }
37
+ );
38
+ const DSUploader = (props) => {
39
+ const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
40
+ useValidateTypescriptPropTypes(propsWithDefault, propTypes, DSUploaderName);
41
+ const {
42
+ containerProps,
43
+ label,
44
+ icon: UploadFileIcon,
45
+ defaultActionLabel,
46
+ dragActiveInstructionalText,
47
+ dragActiveIcon: DragActiveIcon,
48
+ altActionLabel,
49
+ acceptedTypesText,
50
+ disabledDefault,
51
+ disabledAlt,
52
+ onDefaultHandlerClick,
53
+ onAltHandlerClick,
54
+ actions,
55
+ showAltAction,
56
+ defaultActionTooltipText,
57
+ altActionTooltipText,
58
+ ...rest
59
+ } = propsWithDefault;
60
+ const globalAttributes = useGetGlobalAttributes(rest);
61
+ const xstyledProps = useGetXstyledProps(rest);
62
+ const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);
63
+ const getOwnerPropsArguments = useCallback(() => ({}), []);
64
+ const { getRootProps, getInputProps, isDragActive } = useDropzone(rest);
65
+ const { onClick: onOpenFile, ...rootProps } = getRootProps();
66
+ const disabledAll = disabledDefault && disabledAlt;
67
+ const delfaultActionButton = useMemo(
68
+ () => /* @__PURE__ */ jsx(
69
+ ActionButton,
70
+ {
71
+ disabled: disabledDefault,
72
+ labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
73
+ onClick: (...args) => {
74
+ if (!disabledDefault)
75
+ runAll(onDefaultHandlerClick, onOpenFile)(...args);
76
+ }
77
+ }
78
+ ),
79
+ [actions.defaultAction, defaultActionLabel, disabledDefault, onDefaultHandlerClick, onOpenFile]
80
+ );
81
+ const altActionButton = useMemo(
82
+ () => /* @__PURE__ */ jsx(
83
+ ActionButton,
84
+ {
85
+ disabled: disabledAlt,
86
+ labelText: actions.altAction ? actions.altAction : altActionLabel,
87
+ onClick: (...args) => {
88
+ if (!disabledAlt)
89
+ onAltHandlerClick(...args);
90
+ }
91
+ }
92
+ ),
93
+ [actions.altAction, altActionLabel, disabledAlt, onAltHandlerClick]
94
+ );
95
+ const defaultAction = useMemo(
96
+ () => !defaultActionTooltipText ? delfaultActionButton : /* @__PURE__ */ jsx(
97
+ DSTooltip,
98
+ {
99
+ containerProps: { id: "default-action-tooltip" },
100
+ interactionType: "hover",
101
+ title: defaultActionTooltipText,
102
+ triggerComponent: delfaultActionButton
103
+ }
104
+ ),
105
+ [defaultActionTooltipText, delfaultActionButton]
106
+ );
107
+ const altAction = useMemo(
108
+ () => !altActionTooltipText ? altActionButton : /* @__PURE__ */ jsx(
109
+ DSTooltip,
110
+ {
111
+ containerProps: { id: "alt-action-tooltip" },
112
+ interactionType: "hover",
113
+ title: altActionTooltipText,
114
+ triggerComponent: altActionButton
115
+ }
116
+ ),
117
+ [altActionTooltipText, altActionButton]
118
+ );
119
+ return /* @__PURE__ */ jsxs(
120
+ StyledUploaderWrapper,
121
+ {
122
+ ...containerProps,
123
+ ...globalAttributes,
124
+ ...xstyledProps,
125
+ getOwnerProps,
126
+ getOwnerPropsArguments,
127
+ children: [
128
+ /* @__PURE__ */ jsxs(
129
+ StyledUploader,
130
+ {
131
+ ...rootProps,
132
+ isDragActive,
133
+ disabledAll,
134
+ getOwnerProps,
135
+ getOwnerPropsArguments,
136
+ children: [
137
+ /* @__PURE__ */ jsx(StyledUploaderIconArea, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(UploadFileIcon, { size: "l" }) }),
138
+ /* @__PURE__ */ jsx(StyledDividerVertical, { getOwnerProps, getOwnerPropsArguments }),
139
+ /* @__PURE__ */ jsxs(StyledUploaderInfo, { getOwnerProps, getOwnerPropsArguments, children: [
140
+ /* @__PURE__ */ jsx(StyledInfoText, { getOwnerProps, getOwnerPropsArguments, children: label }),
141
+ /* @__PURE__ */ jsxs(StyledUploaderActions, { getOwnerProps, getOwnerPropsArguments, children: [
142
+ actions.defaultAction && defaultAction,
143
+ (actions.altAction || showAltAction) && /* @__PURE__ */ jsxs(Fragment, { children: [
144
+ actions.defaultAction && /* @__PURE__ */ jsx(
145
+ StyledDividerVerticalActions,
146
+ {
147
+ getOwnerProps,
148
+ getOwnerPropsArguments
149
+ }
150
+ ),
151
+ altAction
152
+ ] })
153
+ ] })
154
+ ] }),
155
+ !disabledAll && /* @__PURE__ */ jsxs(StyledUploaderDragActive, { getOwnerProps, getOwnerPropsArguments, children: [
156
+ /* @__PURE__ */ jsx(DragActiveIcon, { color: ["neutral", "000"], mr: "xxs" }),
157
+ dragActiveInstructionalText
158
+ ] }),
159
+ !disabledAll && /* @__PURE__ */ jsx("input", { ...getInputProps(), "aria-label": "file" })
160
+ ]
161
+ }
162
+ ),
163
+ typeof acceptedTypesText === "string" && /* @__PURE__ */ jsx(StyledAcceptedTypes, { getOwnerProps, getOwnerPropsArguments, children: acceptedTypesText.toUpperCase() })
164
+ ]
165
+ }
166
+ );
167
+ };
168
+ DSUploader.actions = defaultActions;
169
+ DSUploader.propTypes = propTypes;
170
+ DSUploader.displayName = DSUploaderName;
171
+ const UploaderWithSchema = describe(DSUploader);
172
+ UploaderWithSchema.propTypes = propTypes;
173
+ var DSUploader_default = DSUploader;
174
+ export {
175
+ DSUploader,
176
+ UploaderWithSchema,
177
+ DSUploader_default as default
178
+ };
179
+ //# sourceMappingURL=DSUploader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSUploader.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { type ComponentType, useCallback, useMemo } from 'react';\nimport { runAll } from '@elliemae/ds-legacy-utilities';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n useGetXstyledProps,\n} from '@elliemae/ds-legacy-props-helpers';\nimport { DSButtonV2, BUTTON_TYPES } from '@elliemae/ds-legacy-button';\nimport { useDropzone } from 'react-dropzone';\nimport DSTooltip from '@elliemae/ds-legacy-tooltip';\nimport { defaultProps, type DSUploaderT, type ActionButtonPropsT, propTypes } from './react-desc-prop-types.js';\nimport {\n StyledAcceptedTypes,\n StyledDividerVertical,\n StyledInfoText,\n StyledUploader,\n StyledUploaderDragActive,\n StyledUploaderIconArea,\n StyledUploaderInfo,\n StyledUploaderWrapper,\n StyledUploaderActions,\n StyledDividerVerticalActions,\n} from './styled.js';\nimport { DSUploaderName, defaultActions } from './constants.js';\nconst ActionButton = ({ labelText, ...otherProps }: ActionButtonPropsT): React.ReactElement => (\n <DSButtonV2\n {...otherProps}\n buttonType={BUTTON_TYPES.TEXT}\n style={{ padding: 0, height: 'initial', borderWidth: '0px' }}\n >\n {labelText}\n </DSButtonV2>\n);\n\nconst DSUploader: ComponentType<DSUploaderT.DefaultProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSUploaderT.DefaultProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, propTypes, DSUploaderName);\n\n const {\n containerProps,\n label,\n icon: UploadFileIcon,\n defaultActionLabel,\n dragActiveInstructionalText,\n dragActiveIcon: DragActiveIcon,\n altActionLabel,\n acceptedTypesText,\n disabledDefault,\n disabledAlt,\n onDefaultHandlerClick,\n onAltHandlerClick,\n actions,\n showAltAction,\n defaultActionTooltipText,\n altActionTooltipText,\n ...rest\n } = propsWithDefault;\n\n const globalAttributes = useGetGlobalAttributes(rest);\n const xstyledProps = useGetXstyledProps(rest);\n\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() => ({}), []);\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone(rest);\n const { onClick: onOpenFile, ...rootProps } = getRootProps();\n const disabledAll = disabledDefault && disabledAlt;\n\n const delfaultActionButton = useMemo(\n () => (\n <ActionButton\n disabled={disabledDefault}\n labelText={actions.defaultAction ? (actions.defaultAction as string) : defaultActionLabel}\n onClick={(...args) => {\n if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...args);\n }}\n />\n ),\n [actions.defaultAction, defaultActionLabel, disabledDefault, onDefaultHandlerClick, onOpenFile],\n );\n\n const altActionButton = useMemo(\n () => (\n <ActionButton\n disabled={disabledAlt}\n labelText={actions.altAction ? (actions.altAction as string) : altActionLabel}\n onClick={(...args) => {\n if (!disabledAlt) onAltHandlerClick(...args);\n }}\n />\n ),\n [actions.altAction, altActionLabel, disabledAlt, onAltHandlerClick],\n );\n\n const defaultAction = useMemo(\n () =>\n !defaultActionTooltipText ? (\n delfaultActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'default-action-tooltip' }}\n interactionType=\"hover\"\n title={defaultActionTooltipText}\n triggerComponent={delfaultActionButton}\n />\n ),\n [defaultActionTooltipText, delfaultActionButton],\n );\n\n const altAction = useMemo(\n () =>\n !altActionTooltipText ? (\n altActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'alt-action-tooltip' }}\n interactionType=\"hover\"\n title={altActionTooltipText}\n triggerComponent={altActionButton}\n />\n ),\n [altActionTooltipText, altActionButton],\n );\n\n return (\n <StyledUploaderWrapper\n {...containerProps}\n {...globalAttributes}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledUploader\n {...rootProps}\n isDragActive={isDragActive}\n disabledAll={disabledAll}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledUploaderIconArea getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <UploadFileIcon size=\"l\" />\n </StyledUploaderIconArea>\n <StyledDividerVertical getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} />\n <StyledUploaderInfo getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledInfoText getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {label}\n </StyledInfoText>\n <StyledUploaderActions getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {actions.defaultAction && defaultAction}\n {(actions.altAction || showAltAction) && (\n <>\n {actions.defaultAction && (\n <StyledDividerVerticalActions\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n {altAction}\n </>\n )}\n </StyledUploaderActions>\n </StyledUploaderInfo>\n {!disabledAll && (\n <StyledUploaderDragActive getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <DragActiveIcon color={['neutral', '000']} mr=\"xxs\" />\n {dragActiveInstructionalText}\n </StyledUploaderDragActive>\n )}\n {!disabledAll && <input {...getInputProps()} aria-label=\"file\" />}\n </StyledUploader>\n {typeof acceptedTypesText === 'string' && (\n <StyledAcceptedTypes getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {acceptedTypesText.toUpperCase()}\n </StyledAcceptedTypes>\n )}\n </StyledUploaderWrapper>\n );\n};\n\nDSUploader.actions = defaultActions;\nDSUploader.propTypes = propTypes;\nDSUploader.displayName = DSUploaderName;\nconst UploaderWithSchema = describe(DSUploader);\nUploaderWithSchema.propTypes = propTypes;\n\nexport { UploaderWithSchema, DSUploader };\nexport default DSUploader;\n"],
5
+ "mappings": "AAAA,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,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEA;AAAA,kCAAC,0BAAuB,eAA8B,wBACpD,8BAAC,kBAAe,MAAK,KAAI,GAC3B;AAAA,cACA,oBAAC,yBAAsB,eAA8B,wBAAgD;AAAA,cACrG,qBAAC,sBAAmB,eAA8B,wBAChD;AAAA,oCAAC,kBAAe,eAA8B,wBAC3C,iBACH;AAAA,gBACA,qBAAC,yBAAsB,eAA8B,wBAClD;AAAA,0BAAQ,iBAAiB;AAAA,mBACxB,QAAQ,aAAa,kBACrB,iCACG;AAAA,4BAAQ,iBACP;AAAA,sBAAC;AAAA;AAAA,wBACC;AAAA,wBACA;AAAA;AAAA,oBACF;AAAA,oBAED;AAAA,qBACH;AAAA,mBAEJ;AAAA,iBACF;AAAA,cACC,CAAC,eACA,qBAAC,4BAAyB,eAA8B,wBACtD;AAAA,oCAAC,kBAAe,OAAO,CAAC,WAAW,KAAK,GAAG,IAAG,OAAM;AAAA,gBACnD;AAAA,iBACH;AAAA,cAED,CAAC,eAAe,oBAAC,WAAO,GAAG,cAAc,GAAG,cAAW,QAAO;AAAA;AAAA;AAAA,QACjE;AAAA,QACC,OAAO,sBAAsB,YAC5B,oBAAC,uBAAoB,eAA8B,wBAChD,4BAAkB,YAAY,GACjC;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,WAAW,UAAU;AACrB,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,qBAAqB,SAAS,UAAU;AAC9C,mBAAmB,YAAY;AAG/B,IAAO,qBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { slotObjectToDataTestIds } from "@elliemae/ds-legacy-system";
3
+ const DSUploaderName = "DSUploader";
4
+ const DSUploaderSlots = {
5
+ ROOT: "root",
6
+ UPLOADER: "uploader",
7
+ ICON_AREA: "icon-area",
8
+ DIVIDER_VERTICAL: "divider-vertical",
9
+ ACTIONS_DIVIDER_VERTICAL: "actions-divider-vertical",
10
+ UPLOADER_INFO: "uploader-info",
11
+ INFO_TEXT: "info-text",
12
+ UPLOADER_DRAG_ACTIVE: "uploader-drag-active",
13
+ ACCEPTED_TYPES: "accepted-types",
14
+ UPLOADER_ACTIONS: "uploader-actions"
15
+ };
16
+ const defaultActions = {
17
+ defaultAction: "LOCAL DRIVE",
18
+ altAction: "DOCUMENTS"
19
+ };
20
+ const DSUploaderDataTestIds = slotObjectToDataTestIds(DSUploaderName, DSUploaderSlots);
21
+ export {
22
+ DSUploaderDataTestIds,
23
+ DSUploaderName,
24
+ DSUploaderSlots,
25
+ defaultActions
26
+ };
27
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/constants.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-legacy-system';\n\nexport const DSUploaderName = 'DSUploader';\n\nexport const DSUploaderSlots = {\n ROOT: 'root',\n UPLOADER: 'uploader',\n ICON_AREA: 'icon-area',\n DIVIDER_VERTICAL: 'divider-vertical',\n ACTIONS_DIVIDER_VERTICAL: 'actions-divider-vertical',\n UPLOADER_INFO: 'uploader-info',\n INFO_TEXT: 'info-text',\n UPLOADER_DRAG_ACTIVE: 'uploader-drag-active',\n ACCEPTED_TYPES: 'accepted-types',\n UPLOADER_ACTIONS: 'uploader-actions',\n};\n\nexport const defaultActions = {\n defaultAction: 'LOCAL DRIVE',\n altAction: 'DOCUMENTS',\n} as const;\n\nexport const DSUploaderDataTestIds = slotObjectToDataTestIds(DSUploaderName, DSUploaderSlots);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,iBAAiB;AAEvB,MAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,0BAA0B;AAAA,EAC1B,eAAe;AAAA,EACf,WAAW;AAAA,EACX,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,kBAAkB;AACpB;AAEO,MAAM,iBAAiB;AAAA,EAC5B,eAAe;AAAA,EACf,WAAW;AACb;AAEO,MAAM,wBAAwB,wBAAwB,gBAAgB,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { default as default2, DSUploader, UploaderWithSchema } from "./DSUploader.js";
3
+ export * from "./constants.js";
4
+ export {
5
+ DSUploader,
6
+ UploaderWithSchema,
7
+ default2 as default
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default, DSUploader, UploaderWithSchema } from './DSUploader.js';\nexport * from './constants.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAAA,UAAS,YAAY,0BAA0B;AACxD,cAAc;",
6
+ "names": ["default"]
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-legacy-props-helpers";
3
+ import { UploadFile } from "@elliemae/ds-legacy-icons";
4
+ import { defaultActions } from "./constants.js";
5
+ const propTypes = {
6
+ ...globalAttributesPropTypes,
7
+ ...xstyledPropTypes,
8
+ containerProps: PropTypes.object.description("Set of Properties attached to the main container."),
9
+ maxFiles: PropTypes.number.description("Number of files accepted."),
10
+ minSize: PropTypes.number.description("Minimun file size accepted in bytes."),
11
+ maxSize: PropTypes.number.description("Maximum file size accepted in bytes."),
12
+ onDropRejected: PropTypes.func.description(
13
+ "Cb called when files are rejected using maxFiles, minSize or maxSize properties."
14
+ ),
15
+ disabled: PropTypes.bool.description("Disables the DSUploader."),
16
+ multiple: PropTypes.bool.description("Set to false to restrict multiple files selection/upload."),
17
+ accept: PropTypes.string.description("String containing the accepted MIME type for the DSUploader"),
18
+ label: PropTypes.string.description("Uploader label.").defaultValue("Browse"),
19
+ icon: PropTypes.func.description("Uploader left icon.").defaultValue(UploadFile),
20
+ actions: PropTypes.shape({
21
+ defaultAction: PropTypes.string,
22
+ altAction: PropTypes.string
23
+ }).description("Uploader actions.").defaultValue({ defaultAction: "LOCAL DRIVE" }),
24
+ defaultActionLabel: PropTypes.string.description("First action button label."),
25
+ showAltAction: PropTypes.bool.description("whether to show alternate action button or not.").defaultValue(true),
26
+ altActionLabel: PropTypes.string.description("Second action button label.").defaultValue("LOCAL DRIVE"),
27
+ dragActiveInstructionalText: PropTypes.string.description("informative text when user drags a file over the uploader zone.").defaultValue("DROP FILES HERE"),
28
+ dragActiveIcon: PropTypes.func.description("Icon when user drags a file over the uploader zone."),
29
+ acceptedTypesText: PropTypes.string.description("Information text to show what types are supported.").defaultValue("JPG, JPEG, PNG, PDF"),
30
+ disabledDefault: PropTypes.bool.description("Whether the default uploader is disabled or not.").defaultValue(false),
31
+ disabledAlt: PropTypes.bool.description("Whether the alternative uploader is disabled or not.").defaultValue(false),
32
+ onDefaultHandlerClick: PropTypes.func.description("First action button click handler."),
33
+ onAltHandlerClick: PropTypes.func.description("Second action button click handler."),
34
+ defaultActionTooltipText: PropTypes.string.description("shows tooltip in default action button."),
35
+ altActionTooltipText: PropTypes.string.description("Shows tooltip in alternate action button.")
36
+ };
37
+ const defaultProps = {
38
+ containerProps: {},
39
+ label: "Browse",
40
+ icon: UploadFile,
41
+ defaultActionLabel: "LOCAL DRIVE",
42
+ dragActiveInstructionalText: "DROP FILES HERE",
43
+ dragActiveIcon: UploadFile,
44
+ altActionLabel: "DOCUMENTS",
45
+ acceptedTypesText: "JPG, JPEG, PNG, PDF",
46
+ disabledDefault: false,
47
+ disabledAlt: false,
48
+ onDefaultHandlerClick: () => {
49
+ },
50
+ onAltHandlerClick: () => {
51
+ },
52
+ actions: defaultActions,
53
+ showAltAction: false,
54
+ defaultActionTooltipText: "",
55
+ altActionTooltipText: ""
56
+ };
57
+ export {
58
+ defaultProps,
59
+ propTypes
60
+ };
61
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { type WeakValidationMap } from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport { UploadFile } from '@elliemae/ds-legacy-icons';\nimport { defaultActions } from './constants.js';\n/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */\n\nexport namespace DSUploaderT {\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n label: string;\n icon: React.FC;\n defaultActionLabel?: string;\n dragActiveInstructionalText?: string;\n dragActiveIcon: React.FC;\n altActionLabel: string;\n acceptedTypesText: string;\n disabledDefault: boolean;\n disabledAlt: boolean;\n onDefaultHandlerClick: () => void | null;\n onAltHandlerClick: () => void | null;\n actions: Record<string, unknown>;\n showAltAction: boolean;\n defaultActionTooltipText: string;\n altActionTooltipText: string;\n }\n\n export type ActionsT = Record<string, unknown>;\n}\n\nexport interface ActionButtonPropsT {\n labelText: string;\n variant: undefined | 'variant-disabled';\n onClick: () => void | null;\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n containerProps: PropTypes.object.description('Set of Properties attached to the main container.'),\n maxFiles: PropTypes.number.description('Number of files accepted.'),\n minSize: PropTypes.number.description('Minimun file size accepted in bytes.'),\n maxSize: PropTypes.number.description('Maximum file size accepted in bytes.'),\n onDropRejected: PropTypes.func.description(\n 'Cb called when files are rejected using maxFiles, minSize or maxSize properties.',\n ),\n disabled: PropTypes.bool.description('Disables the DSUploader.'),\n multiple: PropTypes.bool.description('Set to false to restrict multiple files selection/upload.'),\n accept: PropTypes.string.description('String containing the accepted MIME type for the DSUploader'),\n\n label: PropTypes.string.description('Uploader label.').defaultValue('Browse'),\n icon: PropTypes.func.description('Uploader left icon.').defaultValue(UploadFile),\n actions: PropTypes.shape({\n defaultAction: PropTypes.string,\n altAction: PropTypes.string,\n })\n .description('Uploader actions.')\n .defaultValue({ defaultAction: 'LOCAL DRIVE' }),\n defaultActionLabel: PropTypes.string.description('First action button label.'),\n showAltAction: PropTypes.bool.description('whether to show alternate action button or not.').defaultValue(true),\n altActionLabel: PropTypes.string.description('Second action button label.').defaultValue('LOCAL DRIVE'),\n dragActiveInstructionalText: PropTypes.string\n .description('informative text when user drags a file over the uploader zone.')\n .defaultValue('DROP FILES HERE'),\n dragActiveIcon: PropTypes.func.description('Icon when user drags a file over the uploader zone.'),\n acceptedTypesText: PropTypes.string\n .description('Information text to show what types are supported.')\n .defaultValue('JPG, JPEG, PNG, PDF'),\n disabledDefault: PropTypes.bool.description('Whether the default uploader is disabled or not.').defaultValue(false),\n disabledAlt: PropTypes.bool.description('Whether the alternative uploader is disabled or not.').defaultValue(false),\n onDefaultHandlerClick: PropTypes.func.description('First action button click handler.'),\n onAltHandlerClick: PropTypes.func.description('Second action button click handler.'),\n defaultActionTooltipText: PropTypes.string.description('shows tooltip in default action button.'),\n altActionTooltipText: PropTypes.string.description('Shows tooltip in alternate action button.'),\n} as unknown as WeakValidationMap<DSUploaderT.DefaultProps>;\n\nexport const defaultProps: DSUploaderT.DefaultProps = {\n containerProps: {},\n label: 'Browse',\n icon: UploadFile,\n defaultActionLabel: 'LOCAL DRIVE',\n dragActiveInstructionalText: 'DROP FILES HERE',\n dragActiveIcon: UploadFile,\n altActionLabel: 'DOCUMENTS',\n acceptedTypesText: 'JPG, JPEG, PNG, PDF',\n disabledDefault: false,\n disabledAlt: false,\n onDefaultHandlerClick: () => {},\n onAltHandlerClick: () => {},\n actions: defaultActions,\n showAltAction: false,\n defaultActionTooltipText: '',\n altActionTooltipText: '',\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAgCxB,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,gBAAgB,UAAU,OAAO,YAAY,mDAAmD;AAAA,EAChG,UAAU,UAAU,OAAO,YAAY,2BAA2B;AAAA,EAClE,SAAS,UAAU,OAAO,YAAY,sCAAsC;AAAA,EAC5E,SAAS,UAAU,OAAO,YAAY,sCAAsC;AAAA,EAC5E,gBAAgB,UAAU,KAAK;AAAA,IAC7B;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,0BAA0B;AAAA,EAC/D,UAAU,UAAU,KAAK,YAAY,2DAA2D;AAAA,EAChG,QAAQ,UAAU,OAAO,YAAY,6DAA6D;AAAA,EAElG,OAAO,UAAU,OAAO,YAAY,iBAAiB,EAAE,aAAa,QAAQ;AAAA,EAC5E,MAAM,UAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,UAAU;AAAA,EAC/E,SAAS,UAAU,MAAM;AAAA,IACvB,eAAe,UAAU;AAAA,IACzB,WAAW,UAAU;AAAA,EACvB,CAAC,EACE,YAAY,mBAAmB,EAC/B,aAAa,EAAE,eAAe,cAAc,CAAC;AAAA,EAChD,oBAAoB,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