@elliemae/ds-legacy-uploader 1.0.1 → 1.0.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/cjs/DSUploader.js +7 -7
- package/dist/cjs/DSUploader.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +4 -4
- package/dist/cjs/styled.js.map +2 -2
- package/dist/esm/DSUploader.js +7 -7
- package/dist/esm/DSUploader.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +4 -4
- package/dist/esm/styled.js.map +2 -2
- package/dist/types/react-desc-prop-types.d.ts +6 -4
- package/dist/types/styled.d.ts +14 -0
- package/package.json +9 -9
package/dist/cjs/DSUploader.js
CHANGED
|
@@ -75,18 +75,18 @@ const DSUploader = (props) => {
|
|
|
75
75
|
altActionTooltipText,
|
|
76
76
|
...rest
|
|
77
77
|
} = propsWithDefault;
|
|
78
|
-
const globalAttributes = (0, import_ds_legacy_props_helpers.useGetGlobalAttributes)(rest);
|
|
78
|
+
const { disabled, ...globalAttributes } = (0, import_ds_legacy_props_helpers.useGetGlobalAttributes)(rest);
|
|
79
79
|
const xstyledProps = (0, import_ds_legacy_props_helpers.useGetXstyledProps)(rest);
|
|
80
80
|
const getOwnerProps = (0, import_react.useCallback)(() => propsWithDefault, [propsWithDefault]);
|
|
81
81
|
const getOwnerPropsArguments = (0, import_react.useCallback)(() => ({}), []);
|
|
82
82
|
const { getRootProps, getInputProps, isDragActive } = (0, import_react_dropzone.useDropzone)(rest);
|
|
83
83
|
const { onClick: onOpenFile, ...rootProps } = getRootProps();
|
|
84
|
-
const disabledAll = disabledDefault && disabledAlt;
|
|
84
|
+
const disabledAll = disabledDefault && disabledAlt || disabled;
|
|
85
85
|
const delfaultActionButton = (0, import_react.useMemo)(
|
|
86
86
|
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
87
|
ActionButton,
|
|
88
88
|
{
|
|
89
|
-
disabled: disabledDefault,
|
|
89
|
+
disabled: disabledDefault || disabledAll,
|
|
90
90
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
91
91
|
onClick: (...args) => {
|
|
92
92
|
if (!disabledDefault)
|
|
@@ -100,7 +100,7 @@ const DSUploader = (props) => {
|
|
|
100
100
|
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
101
|
ActionButton,
|
|
102
102
|
{
|
|
103
|
-
disabled: disabledAlt,
|
|
103
|
+
disabled: disabledAlt || disabledAll,
|
|
104
104
|
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
105
105
|
onClick: (...args) => {
|
|
106
106
|
if (!disabledAlt)
|
|
@@ -148,16 +148,16 @@ const DSUploader = (props) => {
|
|
|
148
148
|
{
|
|
149
149
|
...rootProps,
|
|
150
150
|
isDragActive,
|
|
151
|
-
disabledAll,
|
|
152
151
|
getOwnerProps,
|
|
153
152
|
getOwnerPropsArguments,
|
|
153
|
+
disabled: disabledAll,
|
|
154
154
|
children: [
|
|
155
155
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledUploaderIconArea, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadFileIcon, { size: "l" }) }),
|
|
156
156
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledDividerVertical, { getOwnerProps, getOwnerPropsArguments }),
|
|
157
157
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledUploaderInfo, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
158
158
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledInfoText, { getOwnerProps, getOwnerPropsArguments, children: label }),
|
|
159
159
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledUploaderActions, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
160
|
-
actions.defaultAction
|
|
160
|
+
actions.defaultAction ? defaultAction : null,
|
|
161
161
|
(actions.altAction || showAltAction) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
162
162
|
actions.defaultAction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
163
|
import_styled.StyledDividerVerticalActions,
|
|
@@ -171,7 +171,7 @@ const DSUploader = (props) => {
|
|
|
171
171
|
] })
|
|
172
172
|
] }),
|
|
173
173
|
!disabledAll && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledUploaderDragActive, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
174
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DragActiveIcon, { color: ["neutral", "
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DragActiveIcon, { color: ["neutral", "0"], mr: "xxs" }),
|
|
175
175
|
dragActiveInstructionalText
|
|
176
176
|
] }),
|
|
177
177
|
!disabledAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ...getInputProps(), "aria-label": "file" })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSUploader.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* 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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BrB;AA3BF,mBAAgE;AAChE,iCAAuB;AACvB,qCAMO;AACP,8BAAyC;AACzC,4BAA4B;AAC5B,+BAAsB;AACtB,mCAAmF;AACnF,oBAWO;AACP,uBAA+C;AAC/C,MAAM,eAAe,CAAC,EAAE,WAAW,GAAG,WAAW,MAC/C;AAAA,EAAC;AAAA;AAAA,IACE,GAAG;AAAA,IACJ,YAAY,qCAAa;AAAA,IACzB,OAAO,EAAE,SAAS,GAAG,QAAQ,WAAW,aAAa,MAAM;AAAA,IAE1D;AAAA;AACH;AAGF,MAAM,aAAsD,CAAC,UAAU;AACrE,QAAM,uBAAmB,6DAAuD,OAAO,yCAAY;AACnG,qEAA+B,kBAAkB,wCAAW,+BAAc;AAE1E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,
|
|
4
|
+
"sourcesContent": ["/* 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 { disabled, ...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) || disabled;\n\n const delfaultActionButton = useMemo(\n () => (\n <ActionButton\n disabled={disabledDefault || disabledAll}\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 || disabledAll}\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 getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n disabled={disabledAll}\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 : null}\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', '0']} 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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BrB;AA3BF,mBAAgE;AAChE,iCAAuB;AACvB,qCAMO;AACP,8BAAyC;AACzC,4BAA4B;AAC5B,+BAAsB;AACtB,mCAAmF;AACnF,oBAWO;AACP,uBAA+C;AAC/C,MAAM,eAAe,CAAC,EAAE,WAAW,GAAG,WAAW,MAC/C;AAAA,EAAC;AAAA;AAAA,IACE,GAAG;AAAA,IACJ,YAAY,qCAAa;AAAA,IACzB,OAAO,EAAE,SAAS,GAAG,QAAQ,WAAW,aAAa,MAAM;AAAA,IAE1D;AAAA;AACH;AAGF,MAAM,aAAsD,CAAC,UAAU;AACrE,QAAM,uBAAmB,6DAAuD,OAAO,yCAAY;AACnG,qEAA+B,kBAAkB,wCAAW,+BAAc;AAE1E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,UAAU,GAAG,iBAAiB,QAAI,uDAAuB,IAAI;AACrE,QAAM,mBAAe,mDAAmB,IAAI;AAE5C,QAAM,oBAAgB,0BAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAC5E,QAAM,6BAAyB,0BAAY,OAAO,CAAC,IAAI,CAAC,CAAC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@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qCAAuE;AACvE,
|
|
4
|
+
"sourcesContent": ["import { type WeakValidationMap } from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport { UploadFile, type SvgIconT } 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<SvgIconT.Props>;\n defaultActionLabel?: string;\n dragActiveInstructionalText?: string;\n dragActiveIcon: React.FC<SvgIconT.Props>;\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 disabled?: boolean;\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qCAAuE;AACvE,6BAA0C;AAC1C,uBAA+B;AAiCxB,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,gBAAgB,yCAAU,OAAO,YAAY,mDAAmD;AAAA,EAChG,UAAU,yCAAU,OAAO,YAAY,2BAA2B;AAAA,EAClE,SAAS,yCAAU,OAAO,YAAY,sCAAsC;AAAA,EAC5E,SAAS,yCAAU,OAAO,YAAY,sCAAsC;AAAA,EAC5E,gBAAgB,yCAAU,KAAK;AAAA,IAC7B;AAAA,EACF;AAAA,EACA,UAAU,yCAAU,KAAK,YAAY,0BAA0B;AAAA,EAC/D,UAAU,yCAAU,KAAK,YAAY,2DAA2D;AAAA,EAChG,QAAQ,yCAAU,OAAO,YAAY,6DAA6D;AAAA,EAElG,OAAO,yCAAU,OAAO,YAAY,iBAAiB,EAAE,aAAa,QAAQ;AAAA,EAC5E,MAAM,yCAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,iCAAU;AAAA,EAC/E,SAAS,yCAAU,MAAM;AAAA,IACvB,eAAe,yCAAU;AAAA,IACzB,WAAW,yCAAU;AAAA,EACvB,CAAC,EACE,YAAY,mBAAmB,EAC/B,aAAa,EAAE,eAAe,cAAc,CAAC;AAAA,EAChD,oBAAoB,yCAAU,OAAO,YAAY,4BAA4B;AAAA,EAC7E,eAAe,yCAAU,KAAK,YAAY,iDAAiD,EAAE,aAAa,IAAI;AAAA,EAC9G,gBAAgB,yCAAU,OAAO,YAAY,6BAA6B,EAAE,aAAa,aAAa;AAAA,EACtG,6BAA6B,yCAAU,OACpC,YAAY,iEAAiE,EAC7E,aAAa,iBAAiB;AAAA,EACjC,gBAAgB,yCAAU,KAAK,YAAY,qDAAqD;AAAA,EAChG,mBAAmB,yCAAU,OAC1B,YAAY,oDAAoD,EAChE,aAAa,qBAAqB;AAAA,EACrC,iBAAiB,yCAAU,KAAK,YAAY,kDAAkD,EAAE,aAAa,KAAK;AAAA,EAClH,aAAa,yCAAU,KAAK,YAAY,sDAAsD,EAAE,aAAa,KAAK;AAAA,EAClH,uBAAuB,yCAAU,KAAK,YAAY,oCAAoC;AAAA,EACtF,mBAAmB,yCAAU,KAAK,YAAY,qCAAqC;AAAA,EACnF,0BAA0B,yCAAU,OAAO,YAAY,yCAAyC;AAAA,EAChG,sBAAsB,yCAAU,OAAO,YAAY,2CAA2C;AAChG;AAEO,MAAM,eAAyC;AAAA,EACpD,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAC9B,mBAAmB,MAAM;AAAA,EAAC;AAAA,EAC1B,SAAS;AAAA,EACT,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,sBAAsB;AACxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -101,13 +101,13 @@ const StyledUploader = (0, import_ds_legacy_system.styled)("div", {
|
|
|
101
101
|
position: relative;
|
|
102
102
|
display: inline-flex;
|
|
103
103
|
border: 1px solid
|
|
104
|
-
${({ theme, isDragActive,
|
|
104
|
+
${({ theme, isDragActive, disabled }) => isDragActive && !disabled ? "transparent" : theme.colors.neutral["200"]};
|
|
105
105
|
padding: 6px ${({ theme }) => theme.space.xs};
|
|
106
106
|
border-radius: 4px;
|
|
107
107
|
align-items: center;
|
|
108
108
|
outline: none;
|
|
109
109
|
|
|
110
|
-
&:hover,
|
|
110
|
+
&:hover:not([disabled]),
|
|
111
111
|
&:focus {
|
|
112
112
|
background-color: ${({ theme }) => theme.colors.brand["100"]};
|
|
113
113
|
border: 1px dashed ${({ theme }) => theme.colors.brand["500"]};
|
|
@@ -129,8 +129,8 @@ const StyledUploader = (0, import_ds_legacy_system.styled)("div", {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
${StyledUploaderDragActive} {
|
|
132
|
-
${({ isDragActive,
|
|
133
|
-
if (isDragActive && !
|
|
132
|
+
${({ isDragActive, disabled }) => {
|
|
133
|
+
if (isDragActive && !disabled) {
|
|
134
134
|
return `
|
|
135
135
|
visibility: visible;
|
|
136
136
|
display: flex;
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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})
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA2C;AAC3C,uBAAgD;
|
|
4
|
+
"sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-legacy-system';\nimport { DSUploaderName, DSUploaderSlots } from './constants.js';\nimport type { XstyledProps } from '@elliemae/ds-legacy-props-helpers';\n\nexport const StyledUploaderWrapper = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.ROOT,\n})<XstyledProps>`\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; disabled?: boolean }>`\n position: relative;\n display: inline-flex;\n border: 1px solid\n ${({ theme, isDragActive, disabled }) => (isDragActive && !disabled ? '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:not([disabled]),\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, disabled }) => {\n if (isDragActive && !disabled) {\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;AAGzC,M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,UAAU,MAAM,GAAG;AAAA;AAGhD,MAAM,4BAAwB,gCAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSUploader.js
CHANGED
|
@@ -57,18 +57,18 @@ const DSUploader = (props) => {
|
|
|
57
57
|
altActionTooltipText,
|
|
58
58
|
...rest
|
|
59
59
|
} = propsWithDefault;
|
|
60
|
-
const globalAttributes = useGetGlobalAttributes(rest);
|
|
60
|
+
const { disabled, ...globalAttributes } = useGetGlobalAttributes(rest);
|
|
61
61
|
const xstyledProps = useGetXstyledProps(rest);
|
|
62
62
|
const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);
|
|
63
63
|
const getOwnerPropsArguments = useCallback(() => ({}), []);
|
|
64
64
|
const { getRootProps, getInputProps, isDragActive } = useDropzone(rest);
|
|
65
65
|
const { onClick: onOpenFile, ...rootProps } = getRootProps();
|
|
66
|
-
const disabledAll = disabledDefault && disabledAlt;
|
|
66
|
+
const disabledAll = disabledDefault && disabledAlt || disabled;
|
|
67
67
|
const delfaultActionButton = useMemo(
|
|
68
68
|
() => /* @__PURE__ */ jsx(
|
|
69
69
|
ActionButton,
|
|
70
70
|
{
|
|
71
|
-
disabled: disabledDefault,
|
|
71
|
+
disabled: disabledDefault || disabledAll,
|
|
72
72
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
73
73
|
onClick: (...args) => {
|
|
74
74
|
if (!disabledDefault)
|
|
@@ -82,7 +82,7 @@ const DSUploader = (props) => {
|
|
|
82
82
|
() => /* @__PURE__ */ jsx(
|
|
83
83
|
ActionButton,
|
|
84
84
|
{
|
|
85
|
-
disabled: disabledAlt,
|
|
85
|
+
disabled: disabledAlt || disabledAll,
|
|
86
86
|
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
87
87
|
onClick: (...args) => {
|
|
88
88
|
if (!disabledAlt)
|
|
@@ -130,16 +130,16 @@ const DSUploader = (props) => {
|
|
|
130
130
|
{
|
|
131
131
|
...rootProps,
|
|
132
132
|
isDragActive,
|
|
133
|
-
disabledAll,
|
|
134
133
|
getOwnerProps,
|
|
135
134
|
getOwnerPropsArguments,
|
|
135
|
+
disabled: disabledAll,
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ jsx(StyledUploaderIconArea, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(UploadFileIcon, { size: "l" }) }),
|
|
138
138
|
/* @__PURE__ */ jsx(StyledDividerVertical, { getOwnerProps, getOwnerPropsArguments }),
|
|
139
139
|
/* @__PURE__ */ jsxs(StyledUploaderInfo, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
140
140
|
/* @__PURE__ */ jsx(StyledInfoText, { getOwnerProps, getOwnerPropsArguments, children: label }),
|
|
141
141
|
/* @__PURE__ */ jsxs(StyledUploaderActions, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
142
|
-
actions.defaultAction
|
|
142
|
+
actions.defaultAction ? defaultAction : null,
|
|
143
143
|
(actions.altAction || showAltAction) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
144
144
|
actions.defaultAction && /* @__PURE__ */ jsx(
|
|
145
145
|
StyledDividerVerticalActions,
|
|
@@ -153,7 +153,7 @@ const DSUploader = (props) => {
|
|
|
153
153
|
] })
|
|
154
154
|
] }),
|
|
155
155
|
!disabledAll && /* @__PURE__ */ jsxs(StyledUploaderDragActive, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
156
|
-
/* @__PURE__ */ jsx(DragActiveIcon, { color: ["neutral", "
|
|
156
|
+
/* @__PURE__ */ jsx(DragActiveIcon, { color: ["neutral", "0"], mr: "xxs" }),
|
|
157
157
|
dragActiveInstructionalText
|
|
158
158
|
] }),
|
|
159
159
|
!disabledAll && /* @__PURE__ */ jsx("input", { ...getInputProps(), "aria-label": "file" })
|
|
@@ -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, { 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
|
|
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;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,
|
|
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 { disabled, ...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) || disabled;\n\n const delfaultActionButton = useMemo(\n () => (\n <ActionButton\n disabled={disabledDefault || disabledAll}\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 || disabledAll}\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 getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n disabled={disabledAll}\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 : null}\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', '0']} 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,i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AAC,yBAAsB,eAA8B,wBAAgD;AAAA,cACrG,qBAAC,sBAAmB,eAA8B,wBAChD;AAAA,oCAAC,kBAAe,eAA8B,wBAC3C,iBACH;AAAA,gBACA,qBAAC,yBAAsB,eAA8B,wBAClD;AAAA,0BAAQ,gBAAgB,gBAAgB;AAAA,mBACvC,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,GAAG,GAAG,IAAG,OAAM;AAAA,gBACjD;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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,
|
|
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, type SvgIconT } 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<SvgIconT.Props>;\n defaultActionLabel?: string;\n dragActiveInstructionalText?: string;\n dragActiveIcon: React.FC<SvgIconT.Props>;\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 disabled?: boolean;\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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,aAAa,UAAU,KAAK,YAAY,sDAAsD,EAAE,aAAa,KAAK;AAAA,EAClH,uBAAuB,UAAU,KAAK,YAAY,oCAAoC;AAAA,EACtF,mBAAmB,UAAU,KAAK,YAAY,qCAAqC;AAAA,EACnF,0BAA0B,UAAU,OAAO,YAAY,yCAAyC;AAAA,EAChG,sBAAsB,UAAU,OAAO,YAAY,2CAA2C;AAChG;AAEO,MAAM,eAAyC;AAAA,EACpD,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAC9B,mBAAmB,MAAM;AAAA,EAAC;AAAA,EAC1B,SAAS;AAAA,EACT,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,sBAAsB;AACxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styled.js
CHANGED
|
@@ -59,13 +59,13 @@ const StyledUploader = styled("div", {
|
|
|
59
59
|
position: relative;
|
|
60
60
|
display: inline-flex;
|
|
61
61
|
border: 1px solid
|
|
62
|
-
${({ theme, isDragActive,
|
|
62
|
+
${({ theme, isDragActive, disabled }) => isDragActive && !disabled ? "transparent" : theme.colors.neutral["200"]};
|
|
63
63
|
padding: 6px ${({ theme }) => theme.space.xs};
|
|
64
64
|
border-radius: 4px;
|
|
65
65
|
align-items: center;
|
|
66
66
|
outline: none;
|
|
67
67
|
|
|
68
|
-
&:hover,
|
|
68
|
+
&:hover:not([disabled]),
|
|
69
69
|
&:focus {
|
|
70
70
|
background-color: ${({ theme }) => theme.colors.brand["100"]};
|
|
71
71
|
border: 1px dashed ${({ theme }) => theme.colors.brand["500"]};
|
|
@@ -87,8 +87,8 @@ const StyledUploader = styled("div", {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
${StyledUploaderDragActive} {
|
|
90
|
-
${({ isDragActive,
|
|
91
|
-
if (isDragActive && !
|
|
90
|
+
${({ isDragActive, disabled }) => {
|
|
91
|
+
if (isDragActive && !disabled) {
|
|
92
92
|
return `
|
|
93
93
|
visibility: visible;
|
|
94
94
|
display: flex;
|
package/dist/esm/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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})
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,gBAAgB,uBAAuB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-legacy-system';\nimport { DSUploaderName, DSUploaderSlots } from './constants.js';\nimport type { XstyledProps } from '@elliemae/ds-legacy-props-helpers';\n\nexport const StyledUploaderWrapper = styled('div', {\n name: DSUploaderName,\n slot: DSUploaderSlots.ROOT,\n})<XstyledProps>`\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; disabled?: boolean }>`\n position: relative;\n display: inline-flex;\n border: 1px solid\n ${({ theme, isDragActive, disabled }) => (isDragActive && !disabled ? '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:not([disabled]),\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, disabled }) => {\n if (isDragActive && !disabled) {\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;AAGzC,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,EA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BAAgB,CAAC,UAAU;AAC7B,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKT;AACF;AAAA;AAAA;AAIG,MAAM,qBAAqB,OAAO,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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type WeakValidationMap } from 'react';
|
|
2
|
+
import { type SvgIconT } from '@elliemae/ds-legacy-icons';
|
|
2
3
|
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
3
4
|
export declare namespace DSUploaderT {
|
|
4
5
|
interface DefaultProps {
|
|
5
6
|
containerProps: Record<string, unknown>;
|
|
6
7
|
label: string;
|
|
7
|
-
icon: React.FC
|
|
8
|
+
icon: React.FC<SvgIconT.Props>;
|
|
8
9
|
defaultActionLabel?: string;
|
|
9
10
|
dragActiveInstructionalText?: string;
|
|
10
|
-
dragActiveIcon: React.FC
|
|
11
|
+
dragActiveIcon: React.FC<SvgIconT.Props>;
|
|
11
12
|
altActionLabel: string;
|
|
12
13
|
acceptedTypesText: string;
|
|
13
14
|
disabledDefault: boolean;
|
|
@@ -22,9 +23,10 @@ export declare namespace DSUploaderT {
|
|
|
22
23
|
type ActionsT = Record<string, unknown>;
|
|
23
24
|
}
|
|
24
25
|
export interface ActionButtonPropsT {
|
|
25
|
-
labelText
|
|
26
|
-
variant
|
|
26
|
+
labelText?: string;
|
|
27
|
+
variant?: undefined | 'variant-disabled';
|
|
27
28
|
onClick: () => void | null;
|
|
29
|
+
disabled?: boolean;
|
|
28
30
|
}
|
|
29
31
|
export declare const propTypes: WeakValidationMap<DSUploaderT.DefaultProps>;
|
|
30
32
|
export declare const defaultProps: DSUploaderT.DefaultProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { XstyledProps } from '@elliemae/ds-legacy-props-helpers';
|
|
2
|
+
export declare const StyledUploaderWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, XstyledProps & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
3
|
+
export declare const StyledDividerVertical: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
4
|
+
export declare const StyledDividerVerticalActions: import("styled-components").StyledComponent<import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>, import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
5
|
+
export declare const StyledUploaderIconArea: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
6
|
+
export declare const StyledUploaderDragActive: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
7
|
+
export declare const StyledUploader: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, {
|
|
8
|
+
isDragActive: boolean;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
} & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
11
|
+
export declare const StyledUploaderInfo: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
12
|
+
export declare const StyledInfoText: import("styled-components").StyledComponent<"span", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
13
|
+
export declare const StyledAcceptedTypes: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
14
|
+
export declare const StyledUploaderActions: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-legacy-uploader",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Uploader",
|
|
6
6
|
"files": [
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"react-dropzone": "~10.2.2",
|
|
47
|
-
"@elliemae/ds-legacy-button": "1.0.
|
|
48
|
-
"@elliemae/ds-legacy-classnames": "1.0.
|
|
49
|
-
"@elliemae/ds-legacy-
|
|
50
|
-
"@elliemae/ds-legacy-props-helpers": "1.0.
|
|
51
|
-
"@elliemae/ds-legacy-
|
|
52
|
-
"@elliemae/ds-legacy-
|
|
53
|
-
"@elliemae/ds-legacy-
|
|
47
|
+
"@elliemae/ds-legacy-button": "1.0.2",
|
|
48
|
+
"@elliemae/ds-legacy-classnames": "1.0.2",
|
|
49
|
+
"@elliemae/ds-legacy-system": "1.0.2",
|
|
50
|
+
"@elliemae/ds-legacy-props-helpers": "1.0.2",
|
|
51
|
+
"@elliemae/ds-legacy-utilities": "1.0.2",
|
|
52
|
+
"@elliemae/ds-legacy-icons": "1.0.2",
|
|
53
|
+
"@elliemae/ds-legacy-tooltip": "1.0.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
57
57
|
"@elliemae/pui-theme": "~2.7.0",
|
|
58
|
-
"@elliemae/ds-legacy-monorepo-devops": "1.0.
|
|
58
|
+
"@elliemae/ds-legacy-monorepo-devops": "1.0.2"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"lodash": "^4.17.21",
|