@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,141 @@
1
+ import * as React from "react";
2
+ import { styled, xStyledCommonProps } from "@elliemae/ds-legacy-system";
3
+ import { DSUploaderName, DSUploaderSlots } from "./constants.js";
4
+ const StyledUploaderWrapper = styled("div", {
5
+ name: DSUploaderName,
6
+ slot: DSUploaderSlots.ROOT
7
+ })`
8
+ display: inline-flex;
9
+ flex-direction: column;
10
+ ${xStyledCommonProps}
11
+ `;
12
+ const StyledDividerVertical = styled("div", {
13
+ name: DSUploaderName,
14
+ slot: DSUploaderSlots.DIVIDER_VERTICAL
15
+ })`
16
+ border-right: 1px solid ${({ theme }) => theme.colors.neutral[100]};
17
+ border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[100]};
18
+ height: ${({ theme }) => theme.space.s};
19
+ margin: 0 ${({ theme }) => theme.space.xs};
20
+ `;
21
+ const StyledDividerVerticalActions = styled(StyledDividerVertical, {
22
+ name: DSUploaderName,
23
+ slot: DSUploaderSlots.ACTIONS_DIVIDER_VERTICAL
24
+ })`
25
+ height: initial;
26
+ margin: 2px ${({ theme }) => theme.space.xxxs};
27
+ `;
28
+ const StyledUploaderIconArea = styled("div", {
29
+ name: DSUploaderName,
30
+ slot: DSUploaderSlots.ICON_AREA
31
+ })`
32
+ position: relative;
33
+ & svg {
34
+ fill: ${({ theme }) => theme.colors.neutral["500"]};
35
+ }
36
+ `;
37
+ const StyledUploaderDragActive = styled("div", {
38
+ name: DSUploaderName,
39
+ slot: DSUploaderSlots.UPLOADER_DRAG_ACTIVE
40
+ })`
41
+ visibility: hidden;
42
+ position: absolute;
43
+ top: 0;
44
+ left: 0;
45
+ width: 100%;
46
+ height: 100%;
47
+ background-color: ${({ theme }) => theme.colors.brand[500]};
48
+ color: ${({ theme }) => theme.colors.neutral["000"]};
49
+ border: 1px ${({ theme }) => theme.colors.brand[500]};
50
+ border-radius: 4px;
51
+ font-weight: ${({ theme }) => theme.fontWeights.bold};
52
+ justify-content: center;
53
+ align-items: center;
54
+ `;
55
+ const StyledUploader = styled("div", {
56
+ name: DSUploaderName,
57
+ slot: DSUploaderSlots.UPLOADER
58
+ })`
59
+ position: relative;
60
+ display: inline-flex;
61
+ border: 1px solid
62
+ ${({ theme, isDragActive, disabledAll }) => isDragActive && !disabledAll ? "transparent" : theme.colors.neutral["200"]};
63
+ padding: 6px ${({ theme }) => theme.space.xs};
64
+ border-radius: 4px;
65
+ align-items: center;
66
+ outline: none;
67
+
68
+ &:hover,
69
+ &:focus {
70
+ background-color: ${({ theme }) => theme.colors.brand["100"]};
71
+ border: 1px dashed ${({ theme }) => theme.colors.brand["500"]};
72
+ ${StyledDividerVertical} {
73
+ border-color: ${({ theme }) => theme.colors.brand["300"]};
74
+ }
75
+ ${StyledUploaderIconArea} {
76
+ & svg {
77
+ fill: ${({ theme }) => theme.colors.brand["500"]};
78
+ }
79
+ }
80
+ }
81
+
82
+ &:focus {
83
+ // in replace of @include dsFocus();
84
+ outline: none;
85
+ box-shadow: inset 0 0 0 1px #8cc2ed;
86
+ border-radius: 2px;
87
+ }
88
+
89
+ ${StyledUploaderDragActive} {
90
+ ${({ isDragActive, disabledAll }) => {
91
+ if (isDragActive && !disabledAll) {
92
+ return `
93
+ visibility: visible;
94
+ display: flex;
95
+
96
+ `;
97
+ }
98
+ }}
99
+ }
100
+ `;
101
+ const StyledUploaderInfo = styled("div", {
102
+ name: DSUploaderName,
103
+ slot: DSUploaderSlots.UPLOADER_INFO
104
+ })``;
105
+ const StyledInfoText = styled("span", {
106
+ name: DSUploaderName,
107
+ slot: DSUploaderSlots.INFO_TEXT
108
+ })`
109
+ font-size: 1rem;
110
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
111
+ color: ${({ theme }) => theme.colors.neutral[700]};
112
+ `;
113
+ const StyledAcceptedTypes = styled("div", {
114
+ name: DSUploaderName,
115
+ slot: DSUploaderSlots.ACCEPTED_TYPES
116
+ })`
117
+ margin-top: 2px;
118
+ color: ${({ theme }) => theme.colors.neutral[500]};
119
+ text-transform: uppercase;
120
+ text-align: right;
121
+ font-size: ${({ theme }) => theme.fontSizes.label[200]};
122
+ `;
123
+ const StyledUploaderActions = styled("div", {
124
+ name: DSUploaderName,
125
+ slot: DSUploaderSlots.UPLOADER_ACTIONS
126
+ })`
127
+ display: flex;
128
+ `;
129
+ export {
130
+ StyledAcceptedTypes,
131
+ StyledDividerVertical,
132
+ StyledDividerVerticalActions,
133
+ StyledInfoText,
134
+ StyledUploader,
135
+ StyledUploaderActions,
136
+ StyledUploaderDragActive,
137
+ StyledUploaderIconArea,
138
+ StyledUploaderInfo,
139
+ StyledUploaderWrapper
140
+ };
141
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,gBAAgB,uBAAuB;AAEzC,MAAM,wBAAwB,OAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,IAGG;AAAA;AAGG,MAAM,wBAAwB,OAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,gBAAgB;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,+BAA+B,OAAO,uBAAuB;AAAA,EACxE,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA,gBAEe,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAGpC,MAAM,yBAAyB,OAAO,OAAO;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,YAGW,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,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AAO,OAAO;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AACM,MAAM,iBAAiB,OAAO,QAAQ;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA,iBAEgB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,WACvC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAG3C,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,gBAAgB;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,wBAAwB,OAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import { type ComponentType } from 'react';
2
+ import { type DSUploaderT } from './react-desc-prop-types.js';
3
+ declare const DSUploader: ComponentType<DSUploaderT.DefaultProps>;
4
+ declare const UploaderWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSUploaderT.DefaultProps>;
5
+ export { UploaderWithSchema, DSUploader };
6
+ export default DSUploader;
@@ -0,0 +1,18 @@
1
+ export declare const DSUploaderName = "DSUploader";
2
+ export declare const DSUploaderSlots: {
3
+ ROOT: string;
4
+ UPLOADER: string;
5
+ ICON_AREA: string;
6
+ DIVIDER_VERTICAL: string;
7
+ ACTIONS_DIVIDER_VERTICAL: string;
8
+ UPLOADER_INFO: string;
9
+ INFO_TEXT: string;
10
+ UPLOADER_DRAG_ACTIVE: string;
11
+ ACCEPTED_TYPES: string;
12
+ UPLOADER_ACTIONS: string;
13
+ };
14
+ export declare const defaultActions: {
15
+ readonly defaultAction: "LOCAL DRIVE";
16
+ readonly altAction: "DOCUMENTS";
17
+ };
18
+ export declare const DSUploaderDataTestIds: Record<string, string>;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import type { DropzoneOptions } from 'react-dropzone';
3
+ export interface DSUploaderPropsT extends DropzoneOptions {
4
+ containerProps?: Record<string, unknown>;
5
+ label?: string;
6
+ icon?: React.FC<{
7
+ size: string;
8
+ }>;
9
+ defaultActionLabel?: string;
10
+ dragActiveInstructionalText?: string;
11
+ dragActiveIcon?: React.FC;
12
+ altActionLabel?: string;
13
+ acceptedTypesText?: string;
14
+ disabledDefault?: boolean;
15
+ disabledAlt?: boolean;
16
+ onDefaultHandlerClick?: () => void | null;
17
+ onAltHandlerClick?: () => void | null;
18
+ actions?: Record<string, unknown>;
19
+ showAltAction?: boolean;
20
+ defaultActionTooltipText: string;
21
+ altActionTooltipText: string;
22
+ }
23
+ export interface ActionButtonPropsT {
24
+ labelText: string;
25
+ variant: undefined | 'variant-disabled';
26
+ onClick: () => void | null;
27
+ }
@@ -0,0 +1,2 @@
1
+ export { default, DSUploader, UploaderWithSchema } from './DSUploader.js';
2
+ export * from './constants.js';
@@ -0,0 +1,30 @@
1
+ import { type WeakValidationMap } from 'react';
2
+ /** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
3
+ export declare namespace DSUploaderT {
4
+ interface DefaultProps {
5
+ containerProps: Record<string, unknown>;
6
+ label: string;
7
+ icon: React.FC;
8
+ defaultActionLabel?: string;
9
+ dragActiveInstructionalText?: string;
10
+ dragActiveIcon: React.FC;
11
+ altActionLabel: string;
12
+ acceptedTypesText: string;
13
+ disabledDefault: boolean;
14
+ disabledAlt: boolean;
15
+ onDefaultHandlerClick: () => void | null;
16
+ onAltHandlerClick: () => void | null;
17
+ actions: Record<string, unknown>;
18
+ showAltAction: boolean;
19
+ defaultActionTooltipText: string;
20
+ altActionTooltipText: string;
21
+ }
22
+ type ActionsT = Record<string, unknown>;
23
+ }
24
+ export interface ActionButtonPropsT {
25
+ labelText: string;
26
+ variant: undefined | 'variant-disabled';
27
+ onClick: () => void | null;
28
+ }
29
+ export declare const propTypes: WeakValidationMap<DSUploaderT.DefaultProps>;
30
+ export declare const defaultProps: DSUploaderT.DefaultProps;
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@elliemae/ds-legacy-uploader",
3
+ "version": "1.0.0-rc.1",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Uploader",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ },
17
+ "./propTypes": {
18
+ "import": "./dist/esm/propTypes.js",
19
+ "require": "./dist/cjs/propTypes.js"
20
+ },
21
+ "./DSUploader": {
22
+ "import": "./dist/esm/DSUploader.js",
23
+ "require": "./dist/cjs/DSUploader.js"
24
+ }
25
+ },
26
+ "sideEffects": [
27
+ "*.css",
28
+ "*.scss"
29
+ ],
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://git.elliemae.io/platform-ui/dimsum-legacy.git"
33
+ },
34
+ "engines": {
35
+ "pnpm": ">=6",
36
+ "node": ">=16"
37
+ },
38
+ "author": "ICE MT",
39
+ "jestSonar": {
40
+ "sonar56x": true,
41
+ "reportPath": "reports",
42
+ "reportFile": "tests.xml",
43
+ "indent": 4
44
+ },
45
+ "dependencies": {
46
+ "react-dropzone": "~10.2.2",
47
+ "@elliemae/ds-legacy-button": "1.0.0-rc.1",
48
+ "@elliemae/ds-legacy-classnames": "1.0.0-rc.1",
49
+ "@elliemae/ds-legacy-props-helpers": "1.0.0-rc.1",
50
+ "@elliemae/ds-legacy-icons": "1.0.0-rc.1",
51
+ "@elliemae/ds-legacy-system": "1.0.0-rc.1",
52
+ "@elliemae/ds-legacy-utilities": "1.0.0-rc.1",
53
+ "@elliemae/ds-legacy-tooltip": "1.0.0-rc.1"
54
+ },
55
+ "devDependencies": {
56
+ "@elliemae/pui-cli": "~9.0.0-next.31",
57
+ "@elliemae/pui-theme": "~2.7.0",
58
+ "@elliemae/ds-legacy-monorepo-devops": "1.0.0-rc.1"
59
+ },
60
+ "peerDependencies": {
61
+ "lodash": "^4.17.21",
62
+ "react": "~17.0.2",
63
+ "react-dom": "^17.0.2"
64
+ },
65
+ "publishConfig": {
66
+ "access": "public",
67
+ "typeSafety": false
68
+ },
69
+ "scripts": {
70
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
71
+ "test": "pui-cli test --passWithNoTests",
72
+ "lint": "node ../../../scripts/lint.mjs",
73
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
74
+ "dts": "node ../../../scripts/dts.mjs",
75
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
76
+ "dev:build": "pnpm --filter {.}... build",
77
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
78
+ "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
79
+ }
80
+ }