@elliemae/ds-uploader 3.21.2 → 3.22.0-next.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.
- package/dist/cjs/DSUploader.js +137 -103
- package/dist/cjs/DSUploader.js.map +3 -3
- package/dist/cjs/constants.js +57 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/{propTypes.js → react-desc-prop-types.js} +30 -6
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styled.js +171 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/DSUploader.js +153 -102
- package/dist/esm/DSUploader.js.map +2 -2
- package/dist/esm/constants.js +27 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/{propTypes.js → react-desc-prop-types.js} +28 -4
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styled.js +141 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/types/DSUploader.d.ts +4 -35
- package/dist/types/constants.d.ts +18 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +30 -0
- package/package.json +28 -15
- package/dist/cjs/propTypes.js.map +0 -7
- package/dist/esm/propTypes.js.map +0 -7
- package/dist/types/propTypes.d.ts +0 -26
|
@@ -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_system = require("@elliemae/ds-system");
|
|
45
|
+
var import_constants = require("./constants.js");
|
|
46
|
+
const StyledUploaderWrapper = (0, import_ds_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_system.xStyledCommonProps}
|
|
53
|
+
`;
|
|
54
|
+
const StyledDividerVertical = (0, import_ds_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_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_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_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_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_system.styled)("div", {
|
|
144
|
+
name: import_constants.DSUploaderName,
|
|
145
|
+
slot: import_constants.DSUploaderSlots.UPLOADER_INFO
|
|
146
|
+
})``;
|
|
147
|
+
const StyledInfoText = (0, import_ds_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_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_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-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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3C,MAAM,0BAAsB,yBAAO,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,yBAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/DSUploader.js
CHANGED
|
@@ -1,122 +1,173 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { runAll } from "@elliemae/ds-utilities";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import {
|
|
6
|
+
describe,
|
|
7
|
+
useMemoMergePropsWithDefault,
|
|
8
|
+
useValidateTypescriptPropTypes,
|
|
9
|
+
useGetGlobalAttributes,
|
|
10
|
+
useGetXstyledProps
|
|
11
|
+
} from "@elliemae/ds-props-helpers";
|
|
12
|
+
import { DSButtonV2, BUTTON_TYPES } from "@elliemae/ds-button";
|
|
8
13
|
import { useDropzone } from "react-dropzone";
|
|
9
14
|
import DSTooltip from "@elliemae/ds-tooltip";
|
|
10
|
-
import { propTypes } from "./
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const ActionButton = ({ labelText, ...otherProps }) => /* @__PURE__ */ jsx(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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);
|
|
49
65
|
const { onClick: onOpenFile, ...rootProps } = getRootProps();
|
|
50
66
|
const disabledAll = disabledDefault && disabledAlt;
|
|
51
|
-
const delfaultActionButton =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
}
|
|
59
77
|
}
|
|
60
|
-
|
|
78
|
+
),
|
|
79
|
+
[actions.defaultAction, defaultActionLabel, disabledDefault, onDefaultHandlerClick, onOpenFile]
|
|
61
80
|
);
|
|
62
|
-
const altActionButton =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
+
}
|
|
70
91
|
}
|
|
71
|
-
|
|
92
|
+
),
|
|
93
|
+
[actions.altAction, altActionLabel, disabledAlt, onAltHandlerClick]
|
|
72
94
|
);
|
|
73
|
-
const defaultAction =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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]
|
|
81
106
|
);
|
|
82
|
-
const altAction =
|
|
83
|
-
|
|
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,
|
|
84
121
|
{
|
|
85
|
-
containerProps
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
+
]
|
|
89
165
|
}
|
|
90
166
|
);
|
|
91
|
-
return /* @__PURE__ */ jsxs(UploaderWrapper, { ...containerProps, classProps: { disabled: disabledAll }, children: [
|
|
92
|
-
/* @__PURE__ */ jsxs(Uploader, { ...rootProps, classProps: { isDragActive }, children: [
|
|
93
|
-
/* @__PURE__ */ jsx(UploaderIconArea, { children: /* @__PURE__ */ jsx(UploadFileIcon, { size: "l" }) }),
|
|
94
|
-
/* @__PURE__ */ jsx(DividerVertical, {}),
|
|
95
|
-
/* @__PURE__ */ jsxs(UploaderInfo, { children: [
|
|
96
|
-
/* @__PURE__ */ jsx(InfoText, { children: label }),
|
|
97
|
-
/* @__PURE__ */ jsxs(UploaderActions, { children: [
|
|
98
|
-
actions.defaultAction && defaultAction,
|
|
99
|
-
(actions.altAction || showAltAction) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
-
actions.defaultAction && /* @__PURE__ */ jsx(DividerVertical, {}),
|
|
101
|
-
altAction
|
|
102
|
-
] })
|
|
103
|
-
] })
|
|
104
|
-
] }),
|
|
105
|
-
!disabledAll && /* @__PURE__ */ jsxs(UploaderDragActive, { children: [
|
|
106
|
-
/* @__PURE__ */ jsx(DragActiveIcon, {}),
|
|
107
|
-
dragActiveInstructionalText
|
|
108
|
-
] }),
|
|
109
|
-
!disabledAll && /* @__PURE__ */ jsx("input", { ...getInputProps() })
|
|
110
|
-
] }),
|
|
111
|
-
typeof acceptedTypesText === "string" && /* @__PURE__ */ jsx(AcceptedTypes, { children: acceptedTypesText.toUpperCase() })
|
|
112
|
-
] });
|
|
113
|
-
};
|
|
114
|
-
DSUploader.actions = {
|
|
115
|
-
defaultAction: "LOCAL DRIVE",
|
|
116
|
-
altAction: "DOCUMENTS"
|
|
117
167
|
};
|
|
168
|
+
DSUploader.actions = defaultActions;
|
|
118
169
|
DSUploader.propTypes = propTypes;
|
|
119
|
-
DSUploader.displayName =
|
|
170
|
+
DSUploader.displayName = DSUploaderName;
|
|
120
171
|
const UploaderWithSchema = describe(DSUploader);
|
|
121
172
|
UploaderWithSchema.propTypes = propTypes;
|
|
122
173
|
var DSUploader_default = DSUploader;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
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-utilities';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n useGetXstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSButtonV2, BUTTON_TYPES } from '@elliemae/ds-button';\nimport { useDropzone } from 'react-dropzone';\nimport DSTooltip from '@elliemae/ds-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,YAAY,WAAW;AC6BrB,SA6HY,UA7HZ,KA6HY,YA7HZ;AA3BF,SAAoC,aAAa,eAAe;AAChE,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAY,oBAAoB;AACzC,SAAS,mBAAmB;AAC5B,OAAO,eAAe;AACtB,SAAS,cAAyD,iBAAiB;AACnF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB,sBAAsB;AAC/C,MAAM,eAAe,CAAC,EAAE,WAAW,GAAG,WAAW,MAC/C;AAAA,EAAC;AAAA;AAAA,IACE,GAAG;AAAA,IACJ,YAAY,aAAa;AAAA,IACzB,OAAO,EAAE,SAAS,GAAG,QAAQ,WAAW,aAAa,MAAM;AAAA,IAE1D;AAAA;AACH;AAGF,MAAM,aAAsD,CAAC,UAAU;AACrE,QAAM,mBAAmB,6BAAuD,OAAO,YAAY;AACnG,iCAA+B,kBAAkB,WAAW,cAAc;AAE1E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;A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ACC,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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-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-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
|
+
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAAA,UAAS,YAAY,0BAA0B;",
|
|
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
6
|
"names": ["default"]
|
|
7
7
|
}
|