@elliemae/ds-dropzone 3.80.0-next.75 → 3.80.0-next.76
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/DSDropzone.js +6 -1
- package/dist/cjs/DSDropzone.js.map +2 -2
- package/dist/cjs/config/useDSDropzone.js.map +2 -2
- package/dist/cjs/parts/DSActivezone/DSActivezone.js +16 -3
- package/dist/cjs/parts/DSActivezone/DSActivezone.js.map +3 -3
- package/dist/cjs/parts/DSActivezone/config/useActivezone.js +1 -8
- package/dist/cjs/parts/DSActivezone/config/useActivezone.js.map +2 -2
- package/dist/cjs/parts/DSActivezone/react-desc-prop-types.js +8 -0
- package/dist/cjs/parts/DSActivezone/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +4 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +52 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/DSDropzone.js +7 -2
- package/dist/esm/DSDropzone.js.map +2 -2
- package/dist/esm/config/useDSDropzone.js.map +2 -2
- package/dist/esm/parts/DSActivezone/DSActivezone.js +16 -3
- package/dist/esm/parts/DSActivezone/DSActivezone.js.map +3 -3
- package/dist/esm/parts/DSActivezone/config/useActivezone.js +1 -8
- package/dist/esm/parts/DSActivezone/config/useActivezone.js.map +2 -2
- package/dist/esm/parts/DSActivezone/react-desc-prop-types.js +14 -1
- package/dist/esm/parts/DSActivezone/react-desc-prop-types.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +10 -4
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +29 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/types/config/useDSDropzone.d.ts +3 -3
- package/dist/types/parts/DSActivezone/config/useActivezone.d.ts +3 -3
- package/dist/types/parts/DSActivezone/react-desc-prop-types.d.ts +13 -1
- package/dist/types/react-desc-prop-types.d.ts +11 -1
- package/package.json +9 -8
package/dist/cjs/DSDropzone.js
CHANGED
|
@@ -42,6 +42,11 @@ var import_useDSDropzone = require("./config/useDSDropzone.js");
|
|
|
42
42
|
var import_constants = require("./constants/index.js");
|
|
43
43
|
var import_styled = require("./styled.js");
|
|
44
44
|
var import_DSActivezone = require("./parts/DSActivezone/DSActivezone.js");
|
|
45
|
+
const ACTIVEZONE_SLOT_PROPS = [
|
|
46
|
+
"dsDropzoneActivezoneWrapper",
|
|
47
|
+
"dsDropzoneActivezoneIcon",
|
|
48
|
+
"dsDropzoneActivezoneLabel"
|
|
49
|
+
];
|
|
45
50
|
const DSDropzone = (props) => {
|
|
46
51
|
const {
|
|
47
52
|
propsWithDefault,
|
|
@@ -81,7 +86,7 @@ const DSDropzone = (props) => {
|
|
|
81
86
|
getOwnerPropsArguments,
|
|
82
87
|
children: [
|
|
83
88
|
propsWithDefault.children,
|
|
84
|
-
isDragInside ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSActivezone.DSActivezone, {}) : null
|
|
89
|
+
isDragInside ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSActivezone.DSActivezone, { ...(0, import_lodash_es.pick)(propsWithDefault, ACTIVEZONE_SLOT_PROPS) }) : null
|
|
85
90
|
]
|
|
86
91
|
}
|
|
87
92
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSDropzone.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, omitLockAttributes, omitLockedHandlers } from '@elliemae/ds-props-helpers';\nimport { omit } from 'lodash-es';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\n\nconst DSDropzone: React.ComponentType<DSDropzoneT.Props> = (props) => {\n const {\n propsWithDefault,\n globalProps,\n xstyledProps,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n } = useDSDropzone(props);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n // disabled and readOnly are global attributes: omitted so the holder never prints them, $disabled is read instead\n // while disabled the consumer's action handlers (click, keys, mouse, pointer, touch, clipboard, drag...) are withheld\n const safeGlobalProps = omitLockedHandlers(\n omitLockAttributes(omit(globalProps, 'onDrop', 'hasError')),\n Boolean(propsWithDefault.disabled),\n );\n return (\n <StyledDropZoneHolder\n {...safeGlobalProps}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n $disabled={Boolean(propsWithDefault.disabled)}\n >\n <StyledDropZone\n onDragEnter={onDragEnterHandler}\n onDragOver={onDragOverHandler}\n onDragLeave={onDragLeaveHandler}\n onDrop={onDropHandler}\n hasError={Boolean(propsWithDefault.hasError)}\n $disabled={Boolean(propsWithDefault.disabled)}\n isDragActive={isDragInside}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {propsWithDefault.children}\n {isDragInside ? <DSActivezone /> : null}\n </StyledDropZone>\n </StyledDropZoneHolder>\n );\n};\n\nDSDropzone.displayName = DSDropzoneName;\nconst DSDropzoneWithSchema = describe(DSDropzone);\nDSDropzoneWithSchema.propTypes = DSDropzonePropTypesSchema;\n\nexport { DSDropzone, DSDropzoneWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe, omitLockAttributes, omitLockedHandlers } from '@elliemae/ds-props-helpers';\nimport { omit, pick } from 'lodash-es';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\n\n// the slot props of the slots that live in the activezone: DSDropzone renders the activezone while a file is dragged\n// over it, so it forwards them (the other slots are read from the props of DSDropzone itself)\nconst ACTIVEZONE_SLOT_PROPS = [\n 'dsDropzoneActivezoneWrapper',\n 'dsDropzoneActivezoneIcon',\n 'dsDropzoneActivezoneLabel',\n] as const;\n\nconst DSDropzone: React.ComponentType<DSDropzoneT.Props> = (props) => {\n const {\n propsWithDefault,\n globalProps,\n xstyledProps,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n } = useDSDropzone(props);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n // disabled and readOnly are global attributes: omitted so the holder never prints them, $disabled is read instead\n // while disabled the consumer's action handlers (click, keys, mouse, pointer, touch, clipboard, drag...) are withheld\n const safeGlobalProps = omitLockedHandlers(\n omitLockAttributes(omit(globalProps, 'onDrop', 'hasError')),\n Boolean(propsWithDefault.disabled),\n );\n return (\n <StyledDropZoneHolder\n {...safeGlobalProps}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n $disabled={Boolean(propsWithDefault.disabled)}\n >\n <StyledDropZone\n onDragEnter={onDragEnterHandler}\n onDragOver={onDragOverHandler}\n onDragLeave={onDragLeaveHandler}\n onDrop={onDropHandler}\n hasError={Boolean(propsWithDefault.hasError)}\n $disabled={Boolean(propsWithDefault.disabled)}\n isDragActive={isDragInside}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {propsWithDefault.children}\n {isDragInside ? <DSActivezone {...pick(propsWithDefault, ACTIVEZONE_SLOT_PROPS)} /> : null}\n </StyledDropZone>\n </StyledDropZoneHolder>\n );\n};\n\nDSDropzone.displayName = DSDropzoneName;\nconst DSDropzoneWithSchema = describe(DSDropzone);\nDSDropzoneWithSchema.propTypes = DSDropzonePropTypesSchema;\n\nexport { DSDropzone, DSDropzoneWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4CjB;AA5CN,mBAAkB;AAClB,8BAAiE;AACjE,uBAA2B;AAC3B,mCAA4D;AAC5D,2BAA8B;AAC9B,uBAA+B;AAC/B,oBAAqD;AACrD,0BAA6B;AAI7B,MAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,aAAqD,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,oCAAc,KAAK;AACvB,QAAM,gBAAgB,aAAAA,QAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAClF,QAAM,yBAAyB,aAAAA,QAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAG/D,QAAM,sBAAkB;AAAA,QACtB,gDAAmB,uBAAK,aAAa,UAAU,UAAU,CAAC;AAAA,IAC1D,QAAQ,iBAAiB,QAAQ;AAAA,EACnC;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAW,QAAQ,iBAAiB,QAAQ;AAAA,MAE5C;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,QAAQ;AAAA,UACR,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,UAC3C,WAAW,QAAQ,iBAAiB,QAAQ;AAAA,UAC5C,cAAc;AAAA,UACd;AAAA,UACA;AAAA,UAEC;AAAA,6BAAiB;AAAA,YACjB,eAAe,4CAAC,oCAAc,OAAG,uBAAK,kBAAkB,qBAAqB,GAAG,IAAK;AAAA;AAAA;AAAA,MACxF;AAAA;AAAA,EACF;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useDSDropzone.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DropzoneCTX {\n propsWithDefault: DSDropzoneT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDSDropzone = (propsFromUser: DSDropzoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDropzoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSDropzonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSDropzoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;AAEpB,mCAAoE;AACpE,8BAAiC;AAS1B,MAAM,gBAAgB,CAAC,kBAAqC;AAIjE,QAAM,uBAAmB,sDAAwD,eAAe,yCAAY;AAC5G,gDAAiB,kBAAkB,gDAAmB;AAItD,QAAM,kBAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,mBAAe,4CAAmB,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DropzoneCTX {\n propsWithDefault: DSDropzoneT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDSDropzone = (propsFromUser: DSDropzoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDropzoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSDropzonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSDropzoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { id, disabled, onDrop } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const [isDragInside, setIsDragInside] = React.useState(false);\n\n const onBodyDragDropEvent = React.useCallback((e: Event) => {\n e.preventDefault();\n }, []);\n\n /**\n * Prevent default open file in browser\n */\n React.useEffect(() => {\n document.body.addEventListener('drop', onBodyDragDropEvent);\n return () => {\n document.body.removeEventListener('drop', onBodyDragDropEvent);\n };\n }, [onBodyDragDropEvent]);\n\n // disabled: the default of drag enter, over and drop is still cancelled (the browser opens no dropped file); the zone\n // only refuses to light up and never calls the consumer onDrop\n const onDragEnterHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n // the default is always cancelled: otherwise a file dropped on a disabled zone would be opened by the browser.\n // A disabled zone only refuses to light up.\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) setIsDragInside(true);\n },\n [disabled],\n );\n const onDragOverHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n const onDragLeaveHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n if (e.relatedTarget !== e.currentTarget && !e.currentTarget.contains(e.relatedTarget as Node)) {\n e.preventDefault();\n e.stopPropagation();\n setIsDragInside(false);\n }\n }, []);\n const onDropHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n // the state reset and the default cancel always run: the activezone can never be left visible and the browser never\n // opens a dropped file; the consumer is not called when disabled\n setIsDragInside(false);\n e.preventDefault();\n e.stopPropagation();\n if (disabled) return;\n const filesArray = Array.from(e.dataTransfer?.files ?? []);\n onDrop?.(filesArray, e);\n },\n [disabled, onDrop],\n );\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;AAEpB,mCAAoE;AACpE,8BAAiC;AAS1B,MAAM,gBAAgB,CAAC,kBAAqC;AAIjE,QAAM,uBAAmB,sDAAwD,eAAe,yCAAY;AAC5G,gDAAiB,kBAAkB,gDAAmB;AAItD,QAAM,kBAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,mBAAe,4CAAmB,gBAAgB;AAIxD,QAAM,EAAE,IAAI,UAAU,OAAO,IAAI;AACjC,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,UAAM,gBAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAI1D,QAAM,CAAC,cAAc,eAAe,IAAI,aAAAA,QAAM,SAAS,KAAK;AAE5D,QAAM,sBAAsB,aAAAA,QAAM,YAAY,CAAC,MAAa;AAC1D,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAKL,eAAAA,QAAM,UAAU,MAAM;AACpB,aAAS,KAAK,iBAAiB,QAAQ,mBAAmB;AAC1D,WAAO,MAAM;AACX,eAAS,KAAK,oBAAoB,QAAQ,mBAAmB;AAAA,IAC/D;AAAA,EACF,GAAG,CAAC,mBAAmB,CAAC;AAIxB,QAAM,qBAA6D,aAAAA,QAAM;AAAA,IACvE,CAAC,MAAM;AAGL,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,UAAI,CAAC,SAAU,iBAAgB,IAAI;AAAA,IACrC;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,oBAA4D,aAAAA,QAAM,YAAY,CAAC,MAAM;AACzF,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB,GAAG,CAAC,CAAC;AACL,QAAM,qBAA6D,aAAAA,QAAM,YAAY,CAAC,MAAM;AAC1F,QAAI,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,EAAE,cAAc,SAAS,EAAE,aAAqB,GAAG;AAC7F,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,sBAAgB,KAAK;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,CAAC;AACL,QAAM,gBAAwD,aAAAA,QAAM;AAAA,IAClE,CAAC,MAAM;AAGL,sBAAgB,KAAK;AACrB,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,UAAI,SAAU;AACd,YAAM,aAAa,MAAM,KAAK,EAAE,cAAc,SAAS,CAAC,CAAC;AACzD,eAAS,YAAY,CAAC;AAAA,IACxB;AAAA,IACA,CAAC,UAAU,MAAM;AAAA,EACnB;AAEA,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -34,6 +34,7 @@ __export(DSActivezone_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(DSActivezone_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
37
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
39
|
var import_ds_hooks_fontsize_media = require("@elliemae/ds-hooks-fontsize-media");
|
|
39
40
|
var import_ds_system = require("@elliemae/ds-system");
|
|
@@ -64,6 +65,8 @@ const DSActivezone = (props) => {
|
|
|
64
65
|
const { propsWithDefault, globalProps, xstyledProps } = (0, import_useActivezone.useActivezone)(props);
|
|
65
66
|
const { Icon, label } = propsWithDefault;
|
|
66
67
|
const mainContentCols = (0, import_ds_hooks_fontsize_media.useFontsizeMedia)(colsDef);
|
|
68
|
+
const getOwnerProps = import_react.default.useCallback(() => propsWithDefault, [propsWithDefault]);
|
|
69
|
+
const getOwnerPropsArguments = import_react.default.useCallback(() => ({}), []);
|
|
67
70
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
68
71
|
StyledWrapper,
|
|
69
72
|
{
|
|
@@ -73,12 +76,22 @@ const DSActivezone = (props) => {
|
|
|
73
76
|
bg: "brand-600",
|
|
74
77
|
gutter: "xxs",
|
|
75
78
|
cols: mainContentCols,
|
|
76
|
-
getOwnerProps
|
|
79
|
+
getOwnerProps,
|
|
80
|
+
getOwnerPropsArguments,
|
|
77
81
|
...globalProps,
|
|
78
82
|
...xstyledProps,
|
|
79
83
|
children: [
|
|
80
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledIcon, { justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: "l", color: ["neutral", "0"] }) }),
|
|
81
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledIcon, { justifyContent: "center", getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: "l", color: ["neutral", "0"] }) }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
|
+
StyledLabel,
|
|
87
|
+
{
|
|
88
|
+
variant: "b2",
|
|
89
|
+
color: "neutral-000",
|
|
90
|
+
getOwnerProps,
|
|
91
|
+
getOwnerPropsArguments,
|
|
92
|
+
children: label
|
|
93
|
+
}
|
|
94
|
+
)
|
|
82
95
|
]
|
|
83
96
|
}
|
|
84
97
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DSActivezone/DSActivezone.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { type DSActivezoneT, DSActivezonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useActivezone } from './config/useActivezone.js';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from '../../constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`\n cursor: grabbing;\n position: absolute;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n`;\nconst StyledLabel = styled(DSTypography, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;\nconst StyledIcon = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_ICON })``;\n\nconst colsDef = {\n largeFont: ['auto'],\n mediumFont: ['auto', 'auto'],\n smallFont: ['auto', 'auto'],\n};\n\nconst DSActivezone: React.ComponentType<DSActivezoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);\n const { Icon, label } = propsWithDefault;\n const mainContentCols = useFontsizeMedia(colsDef);\n return (\n <StyledWrapper\n rows={['auto']}\n justifyContent=\"center\"\n alignItems=\"center\"\n bg=\"brand-600\"\n gutter=\"xxs\"\n cols={mainContentCols}\n getOwnerProps={
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { type DSActivezoneT, DSActivezonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useActivezone } from './config/useActivezone.js';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from '../../constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`\n cursor: grabbing;\n position: absolute;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n`;\nconst StyledLabel = styled(DSTypography, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;\nconst StyledIcon = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_ICON })``;\n\nconst colsDef = {\n largeFont: ['auto'],\n mediumFont: ['auto', 'auto'],\n smallFont: ['auto', 'auto'],\n};\n\nconst DSActivezone: React.ComponentType<DSActivezoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);\n const { Icon, label } = propsWithDefault;\n const mainContentCols = useFontsizeMedia(colsDef);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n return (\n <StyledWrapper\n rows={['auto']}\n justifyContent=\"center\"\n alignItems=\"center\"\n bg=\"brand-600\"\n gutter=\"xxs\"\n cols={mainContentCols}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledIcon justifyContent=\"center\" getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <Icon size=\"l\" color={['neutral', '0']} />\n </StyledIcon>\n <StyledLabel\n variant=\"b2\"\n color=\"neutral-000\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledLabel>\n </StyledWrapper>\n );\n};\n\nDSActivezone.displayName = 'DSActivezone';\nconst DSActivezoneWithSchema = describe(DSActivezone);\nDSActivezoneWithSchema.propTypes = DSActivezonePropTypesSchema;\n\nexport { DSActivezone, DSActivezoneWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCnB;AArCJ,mBAAkB;AAClB,8BAAyB;AACzB,qCAAiC;AACjC,uBAAuB;AACvB,qBAAqB;AACrB,2BAA6B;AAC7B,mCAAgE;AAChE,2BAA8B;AAC9B,uBAAoE;AAEpE,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,gCAAe,mBAAmB,CAAC;AAAA;AAAA;AAAA,mBAGjF,qCAAoB,aAAa;AAAA,aACvC,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9C,MAAM,kBAAc,yBAAO,mCAAc,EAAE,MAAM,iCAAgB,MAAM,gCAAe,iBAAiB,CAAC;AACxG,MAAM,iBAAa,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,gCAAe,gBAAgB,CAAC;AAE9F,MAAM,UAAU;AAAA,EACd,WAAW,CAAC,MAAM;AAAA,EAClB,YAAY,CAAC,QAAQ,MAAM;AAAA,EAC3B,WAAW,CAAC,QAAQ,MAAM;AAC5B;AAEA,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,oCAAc,KAAK;AAC3E,QAAM,EAAE,MAAM,MAAM,IAAI;AACxB,QAAM,sBAAkB,iDAAiB,OAAO;AAChD,QAAM,gBAAgB,aAAAA,QAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAClF,QAAM,yBAAyB,aAAAA,QAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,CAAC,MAAM;AAAA,MACb,gBAAe;AAAA,MACf,YAAW;AAAA,MACX,IAAG;AAAA,MACH,QAAO;AAAA,MACP,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,oDAAC,cAAW,gBAAe,UAAS,eAA8B,wBAChE,sDAAC,QAAK,MAAK,KAAI,OAAO,CAAC,WAAW,GAAG,GAAG,GAC1C;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAM;AAAA,YACN;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -52,15 +52,8 @@ const useActivezone = (propsFromUser) => {
|
|
|
52
52
|
globalProps,
|
|
53
53
|
xstyledProps,
|
|
54
54
|
instanceUid
|
|
55
|
-
// ...eventHandlers,
|
|
56
55
|
}),
|
|
57
|
-
[
|
|
58
|
-
propsWithDefault,
|
|
59
|
-
globalProps,
|
|
60
|
-
xstyledProps,
|
|
61
|
-
instanceUid
|
|
62
|
-
// eventHandlers,
|
|
63
|
-
]
|
|
56
|
+
[propsWithDefault, globalProps, xstyledProps, instanceUid]
|
|
64
57
|
);
|
|
65
58
|
};
|
|
66
59
|
//# sourceMappingURL=useActivezone.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/DSActivezone/config/useActivezone.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const useActivezone = (propsFromUser: DSActivezoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSActivezoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSActivezonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSActivezoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;AAEpB,mCAAwE;AACxE,8BAAiC;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,uBAAmB,sDAA0D,eAAe,yCAAY;AAC9G,gDAAiB,kBAAkB,kDAAqB;AAIxD,QAAM,kBAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,mBAAe,4CAAmB,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const useActivezone = (propsFromUser: DSActivezoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSActivezoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSActivezonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSActivezoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n }),\n [propsWithDefault, globalProps, xstyledProps, instanceUid],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;AAEpB,mCAAwE;AACxE,8BAAiC;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,uBAAmB,sDAA0D,eAAe,yCAAY;AAC9G,gDAAiB,kBAAkB,kDAAqB;AAIxD,QAAM,kBAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,mBAAe,4CAAmB,gBAAgB;AAIxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,UAAM,gBAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAM1D,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,cAAc,WAAW;AAAA,EAC3D;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var react_desc_prop_types_exports = {};
|
|
30
30
|
__export(react_desc_prop_types_exports, {
|
|
31
|
+
ACTIVEZONE_SLOTS: () => ACTIVEZONE_SLOTS,
|
|
31
32
|
DSActivezonePropTypes: () => DSActivezonePropTypes,
|
|
32
33
|
DSActivezonePropTypesSchema: () => DSActivezonePropTypesSchema,
|
|
33
34
|
defaultProps: () => defaultProps
|
|
@@ -36,11 +37,18 @@ module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
|
36
37
|
var React = __toESM(require("react"));
|
|
37
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
39
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
40
|
+
var import_constants = require("../../constants/index.js");
|
|
41
|
+
const ACTIVEZONE_SLOTS = {
|
|
42
|
+
ACTIVEZONE_LABEL: import_constants.DROPZONE_SLOTS.ACTIVEZONE_LABEL,
|
|
43
|
+
ACTIVEZONE_ICON: import_constants.DROPZONE_SLOTS.ACTIVEZONE_ICON,
|
|
44
|
+
ACTIVEZONE_WRAPPER: import_constants.DROPZONE_SLOTS.ACTIVEZONE_WRAPPER
|
|
45
|
+
};
|
|
39
46
|
const defaultProps = {
|
|
40
47
|
Icon: import_ds_icons.UploadFile,
|
|
41
48
|
label: "DROP FILES HERE"
|
|
42
49
|
};
|
|
43
50
|
const DSActivezonePropTypes = {
|
|
51
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSDropzoneName, ACTIVEZONE_SLOTS),
|
|
44
52
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
45
53
|
...import_ds_props_helpers.xstyledPropTypes,
|
|
46
54
|
Icon: import_ds_props_helpers.PropTypes.func.description("Custom Icon").defaultValue("UploadFile"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DSActivezone/react-desc-prop-types.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport { UploadFile } from '@elliemae/ds-icons';\nimport type { WeakValidationMap } from 'react';\nimport { DSDropzoneName, DROPZONE_SLOTS } from '../../constants/index.js';\n\n// the slots that live in the activezone (they only exist while a file is dragged over the dropzone)\nexport const ACTIVEZONE_SLOTS = {\n ACTIVEZONE_LABEL: DROPZONE_SLOTS.ACTIVEZONE_LABEL,\n ACTIVEZONE_ICON: DROPZONE_SLOTS.ACTIVEZONE_ICON,\n ACTIVEZONE_WRAPPER: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER,\n} as const;\n\nexport declare namespace DSActivezoneT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n Icon: React.ComponentType<SvgIconT.Props>;\n label: string;\n }\n\n export type SlotFunctionArguments = {\n dsDropzoneActivezoneWrapper: () => object;\n dsDropzoneActivezoneIcon: () => object;\n dsDropzoneActivezoneLabel: () => object;\n };\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSDropzoneName,\n typeof ACTIVEZONE_SLOTS\n > {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSActivezoneT.DefaultProps = {\n Icon: UploadFile,\n label: 'DROP FILES HERE',\n};\n\nexport const DSActivezonePropTypes: DSPropTypesSchema<DSActivezoneT.Props> = {\n ...getPropsPerSlotPropTypes(DSDropzoneName, ACTIVEZONE_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n Icon: PropTypes.func.description('Custom Icon').defaultValue('UploadFile'),\n label: PropTypes.string.description('Active zone label').defaultValue(defaultProps.label),\n};\n\nexport const DSActivezonePropTypesSchema = DSActivezonePropTypes as unknown as WeakValidationMap<DSActivezoneT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAGP,sBAA2B;AAE3B,uBAA+C;AAGxC,MAAM,mBAAmB;AAAA,EAC9B,kBAAkB,gCAAe;AAAA,EACjC,iBAAiB,gCAAe;AAAA,EAChC,oBAAoB,gCAAe;AACrC;AAsCO,MAAM,eAA2C;AAAA,EACtD,MAAM;AAAA,EACN,OAAO;AACT;AAEO,MAAM,wBAAgE;AAAA,EAC3E,OAAG,kDAAyB,iCAAgB,gBAAgB;AAAA,EAC5D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,KAAK,YAAY,aAAa,EAAE,aAAa,YAAY;AAAA,EACzE,OAAO,kCAAU,OAAO,YAAY,mBAAmB,EAAE,aAAa,aAAa,KAAK;AAC1F;AAEO,MAAM,8BAA8B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,10 +35,11 @@ __export(react_desc_prop_types_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
36
36
|
var React = __toESM(require("react"));
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
var import_constants = require("./constants/index.js");
|
|
39
|
+
const defaultProps = {};
|
|
40
|
+
const slotPropTypes = (0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSDropzoneName, import_constants.DROPZONE_SLOTS);
|
|
41
41
|
const DSDropzonePropTypes = {
|
|
42
|
+
...slotPropTypes,
|
|
42
43
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
43
44
|
...import_ds_props_helpers.xstyledPropTypes,
|
|
44
45
|
children: import_ds_props_helpers.PropTypes.any,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,
|
|
4
|
+
"sourcesContent": ["import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { DSDropzoneName, DROPZONE_SLOTS } from './constants/index.js';\n\nexport declare namespace DSDropzoneT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n // the slots of the dropzone repeat for no instance (one wrapper, one holder, one activezone): the function form\n // receives an empty object of arguments\n export type SlotFunctionArguments = {\n dsDropzoneWrapper_holder: () => object;\n dsDropzoneWrapper: () => object;\n dsDropzoneActivezoneWrapper: () => object;\n dsDropzoneActivezoneIcon: () => object;\n dsDropzoneActivezoneLabel: () => object;\n };\n\n // the slot WRAPPER_HOLDER is published as 'wrapper_holder' (snake case, a name the theme styleOverrides and the\n // data-dimsum-slot already depend on), so the prop name at runtime is dsDropzoneWrapper_holder, while the helper type\n // would derive dsDropzoneWrapperHolder. The helper types every other slot; the holder is typed by hand.\n // Tracked in KNOWN_INTENTIONAL_DEVIATIONS.md\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSDropzoneName,\n Omit<typeof DROPZONE_SLOTS, 'WRAPPER_HOLDER'>\n > {\n dsDropzoneWrapper_holder?: object | ((args: object) => object);\n onDrop?: (files: File[], event: React.DragEvent<HTMLDivElement>) => void;\n hasError?: boolean;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export type ExampleState = '0' | '1';\n}\n\nexport const defaultProps: DSDropzoneT.DefaultProps = {};\n\n// the generator builds the right keys at runtime (dsDropzoneWrapper_holder), but its return type derives\n// dsDropzoneWrapperHolder from the snake case slot: the cast restores the keys of the props (see KNOWN_INTENTIONAL_DEVIATIONS.md)\nconst slotPropTypes = getPropsPerSlotPropTypes(DSDropzoneName, DROPZONE_SLOTS) as unknown as Pick<\n DSPropTypesSchema<DSDropzoneT.Props>,\n | 'dsDropzoneWrapper_holder'\n | 'dsDropzoneWrapper'\n | 'dsDropzoneActivezoneWrapper'\n | 'dsDropzoneActivezoneIcon'\n | 'dsDropzoneActivezoneLabel'\n>;\n\nexport const DSDropzonePropTypes: DSPropTypesSchema<DSDropzoneT.Props> = {\n ...slotPropTypes,\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.any,\n disabled: PropTypes.bool.description(\n 'Hard lock. A disabled dropzone ignores the consumer handlers for its actions and never calls onDrop; it still cancels the browser drag and drop defaults, so a dropped file is not opened.',\n ),\n hasError: PropTypes.bool.description('Show error border color'),\n onDrop: PropTypes.func\n .description(\n `\n Cb for when the drop event occurs.\n onDrop will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n @param {File[]} files\n @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n `,\n )\n .signature('(( file: File[], event: React.DragEvent ) => void )'),\n};\n\nexport const DSDropzonePropTypesSchema = DSDropzonePropTypes as unknown as WeakValidationMap<DSDropzoneT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAKO;AAGP,uBAA+C;AAiDxC,MAAM,eAAyC,CAAC;AAIvD,MAAM,oBAAgB,kDAAyB,iCAAgB,+BAAc;AAStE,MAAM,sBAA4D;AAAA,EACvE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU;AAAA,EACpB,UAAU,kCAAU,KAAK;AAAA,IACvB;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,KAAK,YAAY,yBAAyB;AAAA,EAC9D,QAAQ,kCAAU,KACf;AAAA,IACC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,EACC,UAAU,qDAAqD;AACpE;AAEO,MAAM,4BAA4B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
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 type {} from '@elliemae/ds-system';\nimport { styled, lockedStateInteractionCss } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from './constants/index.js';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAkD;AAClD,qBAAqB;AACrB,uBAAoE;
|
|
4
|
+
"sourcesContent": ["import type {} from '@elliemae/ds-system';\nimport { styled, lockedStateInteractionCss } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from './constants/index.js';\n\nconst borderImage = (color: string) =>\n `url(\"data:image/svg+xml,%3csvg aria-hidden='true' width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='${\n DROP_ZONE_CONSTANTS.BORDER_RADIUS\n }' ry='${DROP_ZONE_CONSTANTS.BORDER_RADIUS}' stroke='${encodeURIComponent(color)}' stroke-width='${\n DROP_ZONE_CONSTANTS.BORDER_WIDTH\n }' stroke-dasharray='4 6' stroke-dashoffset='0' stroke-linecap='round'/%3e%3c/svg%3e\")`;\n\ninterface DropzoneStyledProps {\n isDragActive: boolean;\n $disabled: boolean;\n hasError: boolean;\n getOwnerProps: () => object;\n getOwnerPropsArguments: () => object;\n}\nexport const StyledDropZoneHolder = styled(Grid, {\n name: DSDropzoneName,\n slot: DROPZONE_SLOTS.WRAPPER_HOLDER,\n})<{ $disabled?: boolean }>`\n position: relative;\n`;\nexport const StyledDropZone = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.WRAPPER })<DropzoneStyledProps>`\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n background-color: ${(props) => props.theme.colors.neutral['000']};\n background-image: ${(props) => {\n if (props.$disabled) {\n return borderImage(props.theme.colors.neutral[400]);\n }\n if (props.isDragActive) {\n return borderImage(props.theme.colors.brand[600]);\n }\n if (props.hasError) {\n return borderImage(props.theme.colors.danger[900]);\n }\n return borderImage(props.theme.colors.neutral[400]);\n }};\n padding: ${(props) => props.theme.space.xs} 1.8461538461538463rem;\n &:hover {\n background-image: ${(props) => {\n if (props.$disabled) {\n return borderImage(props.theme.colors.neutral[400]);\n }\n if (props.isDragActive) {\n return borderImage(props.theme.colors.brand[600]);\n }\n if (props.hasError) {\n return borderImage(props.theme.colors.danger[900]);\n }\n return borderImage(props.theme.colors.brand[600]);\n }};\n }\n cursor: ${(props) => (props.isDragActive ? 'grabbing' : 'default')};\n ${lockedStateInteractionCss}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAkD;AAClD,qBAAqB;AACrB,uBAAoE;AAEpE,MAAM,cAAc,CAAC,UACnB,gLACE,qCAAoB,aACtB,SAAS,qCAAoB,aAAa,aAAa,mBAAmB,KAAK,CAAC,mBAC9E,qCAAoB,YACtB;AASK,MAAM,2BAAuB,yBAAO,qBAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,gCAAe;AACvB,CAAC;AAAA;AAAA;AAGM,MAAM,qBAAiB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,gCAAe,QAAQ,CAAC;AAAA,mBAC9E,qCAAoB,aAAa;AAAA,sBAC9B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,sBAC5C,CAAC,UAAU;AAC7B,MAAI,MAAM,WAAW;AACnB,WAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,cAAc;AACtB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,MAAI,MAAM,UAAU;AAClB,WAAO,YAAY,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA,EACnD;AACA,SAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AACpD,CAAC;AAAA,aACU,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA;AAAA,wBAEpB,CAAC,UAAU;AAC7B,MAAI,MAAM,WAAW;AACnB,WAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,cAAc;AACtB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,MAAI,MAAM,UAAU;AAClB,WAAO,YAAY,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA,EACnD;AACA,SAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAClD,CAAC;AAAA;AAAA,YAEO,CAAC,UAAW,MAAM,eAAe,aAAa,SAAU;AAAA,IAChE,0CAAyB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
const SlotPropsAsObj = {
|
|
26
|
+
dsDropzoneWrapper_holder: { "aria-label": "just a typescript test" },
|
|
27
|
+
dsDropzoneWrapper: { "aria-label": "just a typescript test" },
|
|
28
|
+
dsDropzoneActivezoneWrapper: { "aria-label": "just a typescript test" },
|
|
29
|
+
dsDropzoneActivezoneIcon: { "aria-label": "just a typescript test" },
|
|
30
|
+
dsDropzoneActivezoneLabel: { "aria-label": "just a typescript test" }
|
|
31
|
+
};
|
|
32
|
+
const SlotPropsAsFunctions = {
|
|
33
|
+
dsDropzoneWrapper_holder: () => ({ "aria-label": "just a typescript test" }),
|
|
34
|
+
dsDropzoneWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
35
|
+
dsDropzoneActivezoneWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
36
|
+
dsDropzoneActivezoneIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
37
|
+
dsDropzoneActivezoneLabel: () => ({ "aria-label": "just a typescript test" })
|
|
38
|
+
};
|
|
39
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
40
|
+
const EnsureHolderSlotExistsInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
41
|
+
const ActivezoneSlotPropsAsObj = {
|
|
42
|
+
dsDropzoneActivezoneWrapper: { "aria-label": "just a typescript test" },
|
|
43
|
+
dsDropzoneActivezoneIcon: { "aria-label": "just a typescript test" },
|
|
44
|
+
dsDropzoneActivezoneLabel: { "aria-label": "just a typescript test" }
|
|
45
|
+
};
|
|
46
|
+
const ActivezoneSlotPropsAsFunctions = {
|
|
47
|
+
dsDropzoneActivezoneWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
48
|
+
dsDropzoneActivezoneIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
49
|
+
dsDropzoneActivezoneLabel: () => ({ "aria-label": "just a typescript test" })
|
|
50
|
+
};
|
|
51
|
+
const EnsureAllActivezoneSlotsExistInSlotFunctionArguments = ActivezoneSlotPropsAsFunctions;
|
|
52
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSDropzoneName, DROPZONE_SLOTS } from '../constants/index.js';\nimport type { DSDropzoneT } from '../react-desc-prop-types.js';\nimport type { ACTIVEZONE_SLOTS, DSActivezoneT } from '../parts/DSActivezone/react-desc-prop-types.js';\n\nconst SlotPropsAsObj: Partial<DSDropzoneT.Props> = {\n dsDropzoneWrapper_holder: { 'aria-label': 'just a typescript test' },\n dsDropzoneWrapper: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneWrapper: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneIcon: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneLabel: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSDropzoneT.SlotFunctionArguments = {\n dsDropzoneWrapper_holder: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneLabel: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments\n// The helper derives `dsDropzoneWrapperHolder` from the snake case slot 'wrapper_holder', but the prop of that slot\n// is `dsDropzoneWrapper_holder` (see KNOWN_INTENTIONAL_DEVIATIONS.md): it is checked by hand through its explicit entry\n// above, and the helper checks all the other slots.\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSDropzoneName, Omit<typeof DROPZONE_SLOTS, 'WRAPPER_HOLDER'>>\n> = SlotPropsAsFunctions;\nconst EnsureHolderSlotExistsInSlotFunctionArguments: Required<\n Pick<DSDropzoneT.SlotFunctionArguments, 'dsDropzoneWrapper_holder'>\n> = SlotPropsAsFunctions;\n\n// The activezone part (DSActivezone) owns three of the slots, and it can be composed on its own\nconst ActivezoneSlotPropsAsObj: Partial<DSActivezoneT.Props> = {\n dsDropzoneActivezoneWrapper: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneIcon: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneLabel: { 'aria-label': 'just a typescript test' },\n};\n\nconst ActivezoneSlotPropsAsFunctions: DSActivezoneT.SlotFunctionArguments = {\n dsDropzoneActivezoneWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneLabel: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\nconst EnsureAllActivezoneSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSDropzoneName, typeof ACTIVEZONE_SLOTS>\n> = ActivezoneSlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACOvB,MAAM,iBAA6C;AAAA,EACjD,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,mBAAmB,EAAE,cAAc,yBAAyB;AAAA,EAC5D,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,2BAA2B,EAAE,cAAc,yBAAyB;AACtE;AAEA,MAAM,uBAA0D;AAAA,EAC9D,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,mBAAmB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnE,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC7E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAC7E;AAMA,MAAM,6CAEF;AACJ,MAAM,gDAEF;AAGJ,MAAM,2BAAyD;AAAA,EAC7D,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,2BAA2B,EAAE,cAAc,yBAAyB;AACtE;AAEA,MAAM,iCAAsE;AAAA,EAC1E,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC7E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAC7E;AAEA,MAAM,uDAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/DSDropzone.js
CHANGED
|
@@ -2,12 +2,17 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2 from "react";
|
|
4
4
|
import { describe, omitLockAttributes, omitLockedHandlers } from "@elliemae/ds-props-helpers";
|
|
5
|
-
import { omit } from "lodash-es";
|
|
5
|
+
import { omit, pick } from "lodash-es";
|
|
6
6
|
import { DSDropzonePropTypesSchema } from "./react-desc-prop-types.js";
|
|
7
7
|
import { useDSDropzone } from "./config/useDSDropzone.js";
|
|
8
8
|
import { DSDropzoneName } from "./constants/index.js";
|
|
9
9
|
import { StyledDropZone, StyledDropZoneHolder } from "./styled.js";
|
|
10
10
|
import { DSActivezone } from "./parts/DSActivezone/DSActivezone.js";
|
|
11
|
+
const ACTIVEZONE_SLOT_PROPS = [
|
|
12
|
+
"dsDropzoneActivezoneWrapper",
|
|
13
|
+
"dsDropzoneActivezoneIcon",
|
|
14
|
+
"dsDropzoneActivezoneLabel"
|
|
15
|
+
];
|
|
11
16
|
const DSDropzone = (props) => {
|
|
12
17
|
const {
|
|
13
18
|
propsWithDefault,
|
|
@@ -47,7 +52,7 @@ const DSDropzone = (props) => {
|
|
|
47
52
|
getOwnerPropsArguments,
|
|
48
53
|
children: [
|
|
49
54
|
propsWithDefault.children,
|
|
50
|
-
isDragInside ? /* @__PURE__ */ jsx(DSActivezone, {}) : null
|
|
55
|
+
isDragInside ? /* @__PURE__ */ jsx(DSActivezone, { ...pick(propsWithDefault, ACTIVEZONE_SLOT_PROPS) }) : null
|
|
51
56
|
]
|
|
52
57
|
}
|
|
53
58
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSDropzone.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, omitLockAttributes, omitLockedHandlers } from '@elliemae/ds-props-helpers';\nimport { omit } from 'lodash-es';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\n\nconst DSDropzone: React.ComponentType<DSDropzoneT.Props> = (props) => {\n const {\n propsWithDefault,\n globalProps,\n xstyledProps,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n } = useDSDropzone(props);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n // disabled and readOnly are global attributes: omitted so the holder never prints them, $disabled is read instead\n // while disabled the consumer's action handlers (click, keys, mouse, pointer, touch, clipboard, drag...) are withheld\n const safeGlobalProps = omitLockedHandlers(\n omitLockAttributes(omit(globalProps, 'onDrop', 'hasError')),\n Boolean(propsWithDefault.disabled),\n );\n return (\n <StyledDropZoneHolder\n {...safeGlobalProps}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n $disabled={Boolean(propsWithDefault.disabled)}\n >\n <StyledDropZone\n onDragEnter={onDragEnterHandler}\n onDragOver={onDragOverHandler}\n onDragLeave={onDragLeaveHandler}\n onDrop={onDropHandler}\n hasError={Boolean(propsWithDefault.hasError)}\n $disabled={Boolean(propsWithDefault.disabled)}\n isDragActive={isDragInside}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {propsWithDefault.children}\n {isDragInside ? <DSActivezone /> : null}\n </StyledDropZone>\n </StyledDropZoneHolder>\n );\n};\n\nDSDropzone.displayName = DSDropzoneName;\nconst DSDropzoneWithSchema = describe(DSDropzone);\nDSDropzoneWithSchema.propTypes = DSDropzonePropTypesSchema;\n\nexport { DSDropzone, DSDropzoneWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, omitLockAttributes, omitLockedHandlers } from '@elliemae/ds-props-helpers';\nimport { omit, pick } from 'lodash-es';\nimport { type DSDropzoneT, DSDropzonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useDSDropzone } from './config/useDSDropzone.js';\nimport { DSDropzoneName } from './constants/index.js';\nimport { StyledDropZone, StyledDropZoneHolder } from './styled.js';\nimport { DSActivezone } from './parts/DSActivezone/DSActivezone.js';\n\n// the slot props of the slots that live in the activezone: DSDropzone renders the activezone while a file is dragged\n// over it, so it forwards them (the other slots are read from the props of DSDropzone itself)\nconst ACTIVEZONE_SLOT_PROPS = [\n 'dsDropzoneActivezoneWrapper',\n 'dsDropzoneActivezoneIcon',\n 'dsDropzoneActivezoneLabel',\n] as const;\n\nconst DSDropzone: React.ComponentType<DSDropzoneT.Props> = (props) => {\n const {\n propsWithDefault,\n globalProps,\n xstyledProps,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n } = useDSDropzone(props);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n // disabled and readOnly are global attributes: omitted so the holder never prints them, $disabled is read instead\n // while disabled the consumer's action handlers (click, keys, mouse, pointer, touch, clipboard, drag...) are withheld\n const safeGlobalProps = omitLockedHandlers(\n omitLockAttributes(omit(globalProps, 'onDrop', 'hasError')),\n Boolean(propsWithDefault.disabled),\n );\n return (\n <StyledDropZoneHolder\n {...safeGlobalProps}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n $disabled={Boolean(propsWithDefault.disabled)}\n >\n <StyledDropZone\n onDragEnter={onDragEnterHandler}\n onDragOver={onDragOverHandler}\n onDragLeave={onDragLeaveHandler}\n onDrop={onDropHandler}\n hasError={Boolean(propsWithDefault.hasError)}\n $disabled={Boolean(propsWithDefault.disabled)}\n isDragActive={isDragInside}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {propsWithDefault.children}\n {isDragInside ? <DSActivezone {...pick(propsWithDefault, ACTIVEZONE_SLOT_PROPS)} /> : null}\n </StyledDropZone>\n </StyledDropZoneHolder>\n );\n};\n\nDSDropzone.displayName = DSDropzoneName;\nconst DSDropzoneWithSchema = describe(DSDropzone);\nDSDropzoneWithSchema.propTypes = DSDropzonePropTypesSchema;\n\nexport { DSDropzone, DSDropzoneWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4CjB,SAYkB,KAZlB;AA5CN,OAAOA,YAAW;AAClB,SAAS,UAAU,oBAAoB,0BAA0B;AACjE,SAAS,MAAM,YAAY;AAC3B,SAA2B,iCAAiC;AAC5D,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,oBAAoB;AAI7B,MAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,aAAqD,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,cAAc,KAAK;AACvB,QAAM,gBAAgBA,OAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAClF,QAAM,yBAAyBA,OAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAG/D,QAAM,kBAAkB;AAAA,IACtB,mBAAmB,KAAK,aAAa,UAAU,UAAU,CAAC;AAAA,IAC1D,QAAQ,iBAAiB,QAAQ;AAAA,EACnC;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAW,QAAQ,iBAAiB,QAAQ;AAAA,MAE5C;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,QAAQ;AAAA,UACR,UAAU,QAAQ,iBAAiB,QAAQ;AAAA,UAC3C,WAAW,QAAQ,iBAAiB,QAAQ;AAAA,UAC5C,cAAc;AAAA,UACd;AAAA,UACA;AAAA,UAEC;AAAA,6BAAiB;AAAA,YACjB,eAAe,oBAAC,gBAAc,GAAG,KAAK,kBAAkB,qBAAqB,GAAG,IAAK;AAAA;AAAA;AAAA,MACxF;AAAA;AAAA,EACF;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useDSDropzone.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DropzoneCTX {\n propsWithDefault: DSDropzoneT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDSDropzone = (propsFromUser: DSDropzoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDropzoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSDropzonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSDropzoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AAEpB,SAA2B,qBAAqB,oBAAoB;AACpE,SAAS,wBAAwB;AAS1B,MAAM,gBAAgB,CAAC,kBAAqC;AAIjE,QAAM,mBAAmB,6BAAwD,eAAe,YAAY;AAC5G,mBAAiB,kBAAkB,mBAAmB;AAItD,QAAM,cAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,eAAe,mBAAmB,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSDropzoneT, DSDropzonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DropzoneCTX {\n propsWithDefault: DSDropzoneT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDSDropzone = (propsFromUser: DSDropzoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDropzoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSDropzonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSDropzoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { id, disabled, onDrop } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const [isDragInside, setIsDragInside] = React.useState(false);\n\n const onBodyDragDropEvent = React.useCallback((e: Event) => {\n e.preventDefault();\n }, []);\n\n /**\n * Prevent default open file in browser\n */\n React.useEffect(() => {\n document.body.addEventListener('drop', onBodyDragDropEvent);\n return () => {\n document.body.removeEventListener('drop', onBodyDragDropEvent);\n };\n }, [onBodyDragDropEvent]);\n\n // disabled: the default of drag enter, over and drop is still cancelled (the browser opens no dropped file); the zone\n // only refuses to light up and never calls the consumer onDrop\n const onDragEnterHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n // the default is always cancelled: otherwise a file dropped on a disabled zone would be opened by the browser.\n // A disabled zone only refuses to light up.\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) setIsDragInside(true);\n },\n [disabled],\n );\n const onDragOverHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n const onDragLeaveHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback((e) => {\n if (e.relatedTarget !== e.currentTarget && !e.currentTarget.contains(e.relatedTarget as Node)) {\n e.preventDefault();\n e.stopPropagation();\n setIsDragInside(false);\n }\n }, []);\n const onDropHandler: React.DragEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n // the state reset and the default cancel always run: the activezone can never be left visible and the browser never\n // opens a dropped file; the consumer is not called when disabled\n setIsDragInside(false);\n e.preventDefault();\n e.stopPropagation();\n if (disabled) return;\n const filesArray = Array.from(e.dataTransfer?.files ?? []);\n onDrop?.(filesArray, e);\n },\n [disabled, onDrop],\n );\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n isDragInside,\n onDragEnterHandler,\n onDragOverHandler,\n onDragLeaveHandler,\n onDropHandler,\n // eventHandlers,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AAEpB,SAA2B,qBAAqB,oBAAoB;AACpE,SAAS,wBAAwB;AAS1B,MAAM,gBAAgB,CAAC,kBAAqC;AAIjE,QAAM,mBAAmB,6BAAwD,eAAe,YAAY;AAC5G,mBAAiB,kBAAkB,mBAAmB;AAItD,QAAM,cAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,eAAe,mBAAmB,gBAAgB;AAIxD,QAAM,EAAE,IAAI,UAAU,OAAO,IAAI;AACjC,QAAM,cAAcA,OAAM,QAAQ,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAI1D,QAAM,CAAC,cAAc,eAAe,IAAIA,OAAM,SAAS,KAAK;AAE5D,QAAM,sBAAsBA,OAAM,YAAY,CAAC,MAAa;AAC1D,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAKL,EAAAA,OAAM,UAAU,MAAM;AACpB,aAAS,KAAK,iBAAiB,QAAQ,mBAAmB;AAC1D,WAAO,MAAM;AACX,eAAS,KAAK,oBAAoB,QAAQ,mBAAmB;AAAA,IAC/D;AAAA,EACF,GAAG,CAAC,mBAAmB,CAAC;AAIxB,QAAM,qBAA6DA,OAAM;AAAA,IACvE,CAAC,MAAM;AAGL,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,UAAI,CAAC,SAAU,iBAAgB,IAAI;AAAA,IACrC;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,oBAA4DA,OAAM,YAAY,CAAC,MAAM;AACzF,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB,GAAG,CAAC,CAAC;AACL,QAAM,qBAA6DA,OAAM,YAAY,CAAC,MAAM;AAC1F,QAAI,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,EAAE,cAAc,SAAS,EAAE,aAAqB,GAAG;AAC7F,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,sBAAgB,KAAK;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,CAAC;AACL,QAAM,gBAAwDA,OAAM;AAAA,IAClE,CAAC,MAAM;AAGL,sBAAgB,KAAK;AACrB,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB,UAAI,SAAU;AACd,YAAM,aAAa,MAAM,KAAK,EAAE,cAAc,SAAS,CAAC,CAAC;AACzD,eAAS,YAAY,CAAC;AAAA,IACxB;AAAA,IACA,CAAC,UAAU,MAAM;AAAA,EACnB;AAEA,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React2 from "react";
|
|
3
4
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
5
|
import { useFontsizeMedia } from "@elliemae/ds-hooks-fontsize-media";
|
|
5
6
|
import { styled } from "@elliemae/ds-system";
|
|
@@ -30,6 +31,8 @@ const DSActivezone = (props) => {
|
|
|
30
31
|
const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);
|
|
31
32
|
const { Icon, label } = propsWithDefault;
|
|
32
33
|
const mainContentCols = useFontsizeMedia(colsDef);
|
|
34
|
+
const getOwnerProps = React2.useCallback(() => propsWithDefault, [propsWithDefault]);
|
|
35
|
+
const getOwnerPropsArguments = React2.useCallback(() => ({}), []);
|
|
33
36
|
return /* @__PURE__ */ jsxs(
|
|
34
37
|
StyledWrapper,
|
|
35
38
|
{
|
|
@@ -39,12 +42,22 @@ const DSActivezone = (props) => {
|
|
|
39
42
|
bg: "brand-600",
|
|
40
43
|
gutter: "xxs",
|
|
41
44
|
cols: mainContentCols,
|
|
42
|
-
getOwnerProps
|
|
45
|
+
getOwnerProps,
|
|
46
|
+
getOwnerPropsArguments,
|
|
43
47
|
...globalProps,
|
|
44
48
|
...xstyledProps,
|
|
45
49
|
children: [
|
|
46
|
-
/* @__PURE__ */ jsx(StyledIcon, { justifyContent: "center", children: /* @__PURE__ */ jsx(Icon, { size: "l", color: ["neutral", "0"] }) }),
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
50
|
+
/* @__PURE__ */ jsx(StyledIcon, { justifyContent: "center", getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(Icon, { size: "l", color: ["neutral", "0"] }) }),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
StyledLabel,
|
|
53
|
+
{
|
|
54
|
+
variant: "b2",
|
|
55
|
+
color: "neutral-000",
|
|
56
|
+
getOwnerProps,
|
|
57
|
+
getOwnerPropsArguments,
|
|
58
|
+
children: label
|
|
59
|
+
}
|
|
60
|
+
)
|
|
48
61
|
]
|
|
49
62
|
}
|
|
50
63
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSActivezone/DSActivezone.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { type DSActivezoneT, DSActivezonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useActivezone } from './config/useActivezone.js';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from '../../constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`\n cursor: grabbing;\n position: absolute;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n`;\nconst StyledLabel = styled(DSTypography, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;\nconst StyledIcon = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_ICON })``;\n\nconst colsDef = {\n largeFont: ['auto'],\n mediumFont: ['auto', 'auto'],\n smallFont: ['auto', 'auto'],\n};\n\nconst DSActivezone: React.ComponentType<DSActivezoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);\n const { Icon, label } = propsWithDefault;\n const mainContentCols = useFontsizeMedia(colsDef);\n return (\n <StyledWrapper\n rows={['auto']}\n justifyContent=\"center\"\n alignItems=\"center\"\n bg=\"brand-600\"\n gutter=\"xxs\"\n cols={mainContentCols}\n getOwnerProps={
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useFontsizeMedia } from '@elliemae/ds-hooks-fontsize-media';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { type DSActivezoneT, DSActivezonePropTypesSchema } from './react-desc-prop-types.js';\nimport { useActivezone } from './config/useActivezone.js';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from '../../constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER })`\n cursor: grabbing;\n position: absolute;\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n padding: ${(props) => props.theme.space.xxxs} 1.8461538461538463rem;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n`;\nconst StyledLabel = styled(DSTypography, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_LABEL })``;\nconst StyledIcon = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.ACTIVEZONE_ICON })``;\n\nconst colsDef = {\n largeFont: ['auto'],\n mediumFont: ['auto', 'auto'],\n smallFont: ['auto', 'auto'],\n};\n\nconst DSActivezone: React.ComponentType<DSActivezoneT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useActivezone(props);\n const { Icon, label } = propsWithDefault;\n const mainContentCols = useFontsizeMedia(colsDef);\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n return (\n <StyledWrapper\n rows={['auto']}\n justifyContent=\"center\"\n alignItems=\"center\"\n bg=\"brand-600\"\n gutter=\"xxs\"\n cols={mainContentCols}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledIcon justifyContent=\"center\" getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <Icon size=\"l\" color={['neutral', '0']} />\n </StyledIcon>\n <StyledLabel\n variant=\"b2\"\n color=\"neutral-000\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledLabel>\n </StyledWrapper>\n );\n};\n\nDSActivezone.displayName = 'DSActivezone';\nconst DSActivezoneWithSchema = describe(DSActivezone);\nDSActivezoneWithSchema.propTypes = DSActivezonePropTypesSchema;\n\nexport { DSActivezone, DSActivezoneWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqCnB,SAaI,KAbJ;AArCJ,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAA6B,mCAAmC;AAChE,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,qBAAqB,sBAAsB;AAEpE,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,gBAAgB,MAAM,eAAe,mBAAmB,CAAC;AAAA;AAAA;AAAA,mBAGjF,oBAAoB,aAAa;AAAA,aACvC,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9C,MAAM,cAAc,OAAO,cAAc,EAAE,MAAM,gBAAgB,MAAM,eAAe,iBAAiB,CAAC;AACxG,MAAM,aAAa,OAAO,MAAM,EAAE,MAAM,gBAAgB,MAAM,eAAe,gBAAgB,CAAC;AAE9F,MAAM,UAAU;AAAA,EACd,WAAW,CAAC,MAAM;AAAA,EAClB,YAAY,CAAC,QAAQ,MAAM;AAAA,EAC3B,WAAW,CAAC,QAAQ,MAAM;AAC5B;AAEA,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,cAAc,KAAK;AAC3E,QAAM,EAAE,MAAM,MAAM,IAAI;AACxB,QAAM,kBAAkB,iBAAiB,OAAO;AAChD,QAAM,gBAAgBA,OAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAClF,QAAM,yBAAyBA,OAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,CAAC,MAAM;AAAA,MACb,gBAAe;AAAA,MACf,YAAW;AAAA,MACX,IAAG;AAAA,MACH,QAAO;AAAA,MACP,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,4BAAC,cAAW,gBAAe,UAAS,eAA8B,wBAChE,8BAAC,QAAK,MAAK,KAAI,OAAO,CAAC,WAAW,GAAG,GAAG,GAC1C;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAM;AAAA,YACN;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -19,15 +19,8 @@ const useActivezone = (propsFromUser) => {
|
|
|
19
19
|
globalProps,
|
|
20
20
|
xstyledProps,
|
|
21
21
|
instanceUid
|
|
22
|
-
// ...eventHandlers,
|
|
23
22
|
}),
|
|
24
|
-
[
|
|
25
|
-
propsWithDefault,
|
|
26
|
-
globalProps,
|
|
27
|
-
xstyledProps,
|
|
28
|
-
instanceUid
|
|
29
|
-
// eventHandlers,
|
|
30
|
-
]
|
|
23
|
+
[propsWithDefault, globalProps, xstyledProps, instanceUid]
|
|
31
24
|
);
|
|
32
25
|
};
|
|
33
26
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSActivezone/config/useActivezone.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const useActivezone = (propsFromUser: DSActivezoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSActivezoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSActivezonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSActivezoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AAEpB,SAA6B,uBAAuB,oBAAoB;AACxE,SAAS,wBAAwB;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,mBAAmB,6BAA0D,eAAe,YAAY;AAC9G,mBAAiB,kBAAkB,qBAAqB;AAIxD,QAAM,cAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,eAAe,mBAAmB,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport { type DSActivezoneT, DSActivezonePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const useActivezone = (propsFromUser: DSActivezoneT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSActivezoneT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSActivezonePropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSActivezoneT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n }),\n [propsWithDefault, globalProps, xstyledProps, instanceUid],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AAEpB,SAA6B,uBAAuB,oBAAoB;AACxE,SAAS,wBAAwB;AAE1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,mBAAmB,6BAA0D,eAAe,YAAY;AAC9G,mBAAiB,kBAAkB,qBAAqB;AAIxD,QAAM,cAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,eAAe,mBAAmB,gBAAgB;AAIxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAcA,OAAM,QAAQ,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAM1D,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,cAAc,WAAW;AAAA,EAC3D;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PropTypes,
|
|
4
|
+
getPropsPerSlotPropTypes,
|
|
5
|
+
globalAttributesPropTypes,
|
|
6
|
+
xstyledPropTypes
|
|
7
|
+
} from "@elliemae/ds-props-helpers";
|
|
3
8
|
import { UploadFile } from "@elliemae/ds-icons";
|
|
9
|
+
import { DSDropzoneName, DROPZONE_SLOTS } from "../../constants/index.js";
|
|
10
|
+
const ACTIVEZONE_SLOTS = {
|
|
11
|
+
ACTIVEZONE_LABEL: DROPZONE_SLOTS.ACTIVEZONE_LABEL,
|
|
12
|
+
ACTIVEZONE_ICON: DROPZONE_SLOTS.ACTIVEZONE_ICON,
|
|
13
|
+
ACTIVEZONE_WRAPPER: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER
|
|
14
|
+
};
|
|
4
15
|
const defaultProps = {
|
|
5
16
|
Icon: UploadFile,
|
|
6
17
|
label: "DROP FILES HERE"
|
|
7
18
|
};
|
|
8
19
|
const DSActivezonePropTypes = {
|
|
20
|
+
...getPropsPerSlotPropTypes(DSDropzoneName, ACTIVEZONE_SLOTS),
|
|
9
21
|
...globalAttributesPropTypes,
|
|
10
22
|
...xstyledPropTypes,
|
|
11
23
|
Icon: PropTypes.func.description("Custom Icon").defaultValue("UploadFile"),
|
|
@@ -13,6 +25,7 @@ const DSActivezonePropTypes = {
|
|
|
13
25
|
};
|
|
14
26
|
const DSActivezonePropTypesSchema = DSActivezonePropTypes;
|
|
15
27
|
export {
|
|
28
|
+
ACTIVEZONE_SLOTS,
|
|
16
29
|
DSActivezonePropTypes,
|
|
17
30
|
DSActivezonePropTypesSchema,
|
|
18
31
|
defaultProps
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSActivezone/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport { UploadFile } from '@elliemae/ds-icons';\nimport type { WeakValidationMap } from 'react';\nimport { DSDropzoneName, DROPZONE_SLOTS } from '../../constants/index.js';\n\n// the slots that live in the activezone (they only exist while a file is dragged over the dropzone)\nexport const ACTIVEZONE_SLOTS = {\n ACTIVEZONE_LABEL: DROPZONE_SLOTS.ACTIVEZONE_LABEL,\n ACTIVEZONE_ICON: DROPZONE_SLOTS.ACTIVEZONE_ICON,\n ACTIVEZONE_WRAPPER: DROPZONE_SLOTS.ACTIVEZONE_WRAPPER,\n} as const;\n\nexport declare namespace DSActivezoneT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n Icon: React.ComponentType<SvgIconT.Props>;\n label: string;\n }\n\n export type SlotFunctionArguments = {\n dsDropzoneActivezoneWrapper: () => object;\n dsDropzoneActivezoneIcon: () => object;\n dsDropzoneActivezoneLabel: () => object;\n };\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSDropzoneName,\n typeof ACTIVEZONE_SLOTS\n > {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSActivezoneT.DefaultProps = {\n Icon: UploadFile,\n label: 'DROP FILES HERE',\n};\n\nexport const DSActivezonePropTypes: DSPropTypesSchema<DSActivezoneT.Props> = {\n ...getPropsPerSlotPropTypes(DSDropzoneName, ACTIVEZONE_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n Icon: PropTypes.func.description('Custom Icon').defaultValue('UploadFile'),\n label: PropTypes.string.description('Active zone label').defaultValue(defaultProps.label),\n};\n\nexport const DSActivezonePropTypesSchema = DSActivezonePropTypes as unknown as WeakValidationMap<DSActivezoneT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB,sBAAsB;AAGxC,MAAM,mBAAmB;AAAA,EAC9B,kBAAkB,eAAe;AAAA,EACjC,iBAAiB,eAAe;AAAA,EAChC,oBAAoB,eAAe;AACrC;AAsCO,MAAM,eAA2C;AAAA,EACtD,MAAM;AAAA,EACN,OAAO;AACT;AAEO,MAAM,wBAAgE;AAAA,EAC3E,GAAG,yBAAyB,gBAAgB,gBAAgB;AAAA,EAC5D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,KAAK,YAAY,aAAa,EAAE,aAAa,YAAY;AAAA,EACzE,OAAO,UAAU,OAAO,YAAY,mBAAmB,EAAE,aAAa,aAAa,KAAK;AAC1F;AAEO,MAAM,8BAA8B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
PropTypes,
|
|
4
|
+
getPropsPerSlotPropTypes,
|
|
5
|
+
globalAttributesPropTypes,
|
|
6
|
+
xstyledPropTypes
|
|
7
|
+
} from "@elliemae/ds-props-helpers";
|
|
8
|
+
import { DSDropzoneName, DROPZONE_SLOTS } from "./constants/index.js";
|
|
9
|
+
const defaultProps = {};
|
|
10
|
+
const slotPropTypes = getPropsPerSlotPropTypes(DSDropzoneName, DROPZONE_SLOTS);
|
|
6
11
|
const DSDropzonePropTypes = {
|
|
12
|
+
...slotPropTypes,
|
|
7
13
|
...globalAttributesPropTypes,
|
|
8
14
|
...xstyledPropTypes,
|
|
9
15
|
children: PropTypes.any,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { DSDropzoneName, DROPZONE_SLOTS } from './constants/index.js';\n\nexport declare namespace DSDropzoneT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n // the slots of the dropzone repeat for no instance (one wrapper, one holder, one activezone): the function form\n // receives an empty object of arguments\n export type SlotFunctionArguments = {\n dsDropzoneWrapper_holder: () => object;\n dsDropzoneWrapper: () => object;\n dsDropzoneActivezoneWrapper: () => object;\n dsDropzoneActivezoneIcon: () => object;\n dsDropzoneActivezoneLabel: () => object;\n };\n\n // the slot WRAPPER_HOLDER is published as 'wrapper_holder' (snake case, a name the theme styleOverrides and the\n // data-dimsum-slot already depend on), so the prop name at runtime is dsDropzoneWrapper_holder, while the helper type\n // would derive dsDropzoneWrapperHolder. The helper types every other slot; the holder is typed by hand.\n // Tracked in KNOWN_INTENTIONAL_DEVIATIONS.md\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSDropzoneName,\n Omit<typeof DROPZONE_SLOTS, 'WRAPPER_HOLDER'>\n > {\n dsDropzoneWrapper_holder?: object | ((args: object) => object);\n onDrop?: (files: File[], event: React.DragEvent<HTMLDivElement>) => void;\n hasError?: boolean;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export type ExampleState = '0' | '1';\n}\n\nexport const defaultProps: DSDropzoneT.DefaultProps = {};\n\n// the generator builds the right keys at runtime (dsDropzoneWrapper_holder), but its return type derives\n// dsDropzoneWrapperHolder from the snake case slot: the cast restores the keys of the props (see KNOWN_INTENTIONAL_DEVIATIONS.md)\nconst slotPropTypes = getPropsPerSlotPropTypes(DSDropzoneName, DROPZONE_SLOTS) as unknown as Pick<\n DSPropTypesSchema<DSDropzoneT.Props>,\n | 'dsDropzoneWrapper_holder'\n | 'dsDropzoneWrapper'\n | 'dsDropzoneActivezoneWrapper'\n | 'dsDropzoneActivezoneIcon'\n | 'dsDropzoneActivezoneLabel'\n>;\n\nexport const DSDropzonePropTypes: DSPropTypesSchema<DSDropzoneT.Props> = {\n ...slotPropTypes,\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.any,\n disabled: PropTypes.bool.description(\n 'Hard lock. A disabled dropzone ignores the consumer handlers for its actions and never calls onDrop; it still cancels the browser drag and drop defaults, so a dropped file is not opened.',\n ),\n hasError: PropTypes.bool.description('Show error border color'),\n onDrop: PropTypes.func\n .description(\n `\n Cb for when the drop event occurs.\n onDrop will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n @param {File[]} files\n @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n `,\n )\n .signature('(( file: File[], event: React.DragEvent ) => void )'),\n};\n\nexport const DSDropzonePropTypesSchema = DSDropzonePropTypes as unknown as WeakValidationMap<DSDropzoneT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gBAAgB,sBAAsB;AAiDxC,MAAM,eAAyC,CAAC;AAIvD,MAAM,gBAAgB,yBAAyB,gBAAgB,cAAc;AAStE,MAAM,sBAA4D;AAAA,EACvE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU,KAAK;AAAA,IACvB;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,yBAAyB;AAAA,EAC9D,QAAQ,UAAU,KACf;AAAA,IACC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,EACC,UAAU,qDAAqD;AACpE;AAEO,MAAM,4BAA4B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
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 type {} from '@elliemae/ds-system';\nimport { styled, lockedStateInteractionCss } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from './constants/index.js';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,iCAAiC;AAClD,SAAS,YAAY;AACrB,SAAS,gBAAgB,qBAAqB,sBAAsB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@elliemae/ds-system';\nimport { styled, lockedStateInteractionCss } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DROPZONE_SLOTS, DROP_ZONE_CONSTANTS, DSDropzoneName } from './constants/index.js';\n\nconst borderImage = (color: string) =>\n `url(\"data:image/svg+xml,%3csvg aria-hidden='true' width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='${\n DROP_ZONE_CONSTANTS.BORDER_RADIUS\n }' ry='${DROP_ZONE_CONSTANTS.BORDER_RADIUS}' stroke='${encodeURIComponent(color)}' stroke-width='${\n DROP_ZONE_CONSTANTS.BORDER_WIDTH\n }' stroke-dasharray='4 6' stroke-dashoffset='0' stroke-linecap='round'/%3e%3c/svg%3e\")`;\n\ninterface DropzoneStyledProps {\n isDragActive: boolean;\n $disabled: boolean;\n hasError: boolean;\n getOwnerProps: () => object;\n getOwnerPropsArguments: () => object;\n}\nexport const StyledDropZoneHolder = styled(Grid, {\n name: DSDropzoneName,\n slot: DROPZONE_SLOTS.WRAPPER_HOLDER,\n})<{ $disabled?: boolean }>`\n position: relative;\n`;\nexport const StyledDropZone = styled(Grid, { name: DSDropzoneName, slot: DROPZONE_SLOTS.WRAPPER })<DropzoneStyledProps>`\n border-radius: ${DROP_ZONE_CONSTANTS.BORDER_RADIUS}px;\n background-color: ${(props) => props.theme.colors.neutral['000']};\n background-image: ${(props) => {\n if (props.$disabled) {\n return borderImage(props.theme.colors.neutral[400]);\n }\n if (props.isDragActive) {\n return borderImage(props.theme.colors.brand[600]);\n }\n if (props.hasError) {\n return borderImage(props.theme.colors.danger[900]);\n }\n return borderImage(props.theme.colors.neutral[400]);\n }};\n padding: ${(props) => props.theme.space.xs} 1.8461538461538463rem;\n &:hover {\n background-image: ${(props) => {\n if (props.$disabled) {\n return borderImage(props.theme.colors.neutral[400]);\n }\n if (props.isDragActive) {\n return borderImage(props.theme.colors.brand[600]);\n }\n if (props.hasError) {\n return borderImage(props.theme.colors.danger[900]);\n }\n return borderImage(props.theme.colors.brand[600]);\n }};\n }\n cursor: ${(props) => (props.isDragActive ? 'grabbing' : 'default')};\n ${lockedStateInteractionCss}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,iCAAiC;AAClD,SAAS,YAAY;AACrB,SAAS,gBAAgB,qBAAqB,sBAAsB;AAEpE,MAAM,cAAc,CAAC,UACnB,gLACE,oBAAoB,aACtB,SAAS,oBAAoB,aAAa,aAAa,mBAAmB,KAAK,CAAC,mBAC9E,oBAAoB,YACtB;AASK,MAAM,uBAAuB,OAAO,MAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,eAAe;AACvB,CAAC;AAAA;AAAA;AAGM,MAAM,iBAAiB,OAAO,MAAM,EAAE,MAAM,gBAAgB,MAAM,eAAe,QAAQ,CAAC;AAAA,mBAC9E,oBAAoB,aAAa;AAAA,sBAC9B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,sBAC5C,CAAC,UAAU;AAC7B,MAAI,MAAM,WAAW;AACnB,WAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,cAAc;AACtB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,MAAI,MAAM,UAAU;AAClB,WAAO,YAAY,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA,EACnD;AACA,SAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AACpD,CAAC;AAAA,aACU,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA;AAAA,wBAEpB,CAAC,UAAU;AAC7B,MAAI,MAAM,WAAW;AACnB,WAAO,YAAY,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,cAAc;AACtB,WAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,EAClD;AACA,MAAI,MAAM,UAAU;AAClB,WAAO,YAAY,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA,EACnD;AACA,SAAO,YAAY,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAClD,CAAC;AAAA;AAAA,YAEO,CAAC,UAAW,MAAM,eAAe,aAAa,SAAU;AAAA,IAChE,yBAAyB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SlotPropsAsObj = {
|
|
3
|
+
dsDropzoneWrapper_holder: { "aria-label": "just a typescript test" },
|
|
4
|
+
dsDropzoneWrapper: { "aria-label": "just a typescript test" },
|
|
5
|
+
dsDropzoneActivezoneWrapper: { "aria-label": "just a typescript test" },
|
|
6
|
+
dsDropzoneActivezoneIcon: { "aria-label": "just a typescript test" },
|
|
7
|
+
dsDropzoneActivezoneLabel: { "aria-label": "just a typescript test" }
|
|
8
|
+
};
|
|
9
|
+
const SlotPropsAsFunctions = {
|
|
10
|
+
dsDropzoneWrapper_holder: () => ({ "aria-label": "just a typescript test" }),
|
|
11
|
+
dsDropzoneWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
12
|
+
dsDropzoneActivezoneWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
13
|
+
dsDropzoneActivezoneIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
14
|
+
dsDropzoneActivezoneLabel: () => ({ "aria-label": "just a typescript test" })
|
|
15
|
+
};
|
|
16
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
17
|
+
const EnsureHolderSlotExistsInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
18
|
+
const ActivezoneSlotPropsAsObj = {
|
|
19
|
+
dsDropzoneActivezoneWrapper: { "aria-label": "just a typescript test" },
|
|
20
|
+
dsDropzoneActivezoneIcon: { "aria-label": "just a typescript test" },
|
|
21
|
+
dsDropzoneActivezoneLabel: { "aria-label": "just a typescript test" }
|
|
22
|
+
};
|
|
23
|
+
const ActivezoneSlotPropsAsFunctions = {
|
|
24
|
+
dsDropzoneActivezoneWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
25
|
+
dsDropzoneActivezoneIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
26
|
+
dsDropzoneActivezoneLabel: () => ({ "aria-label": "just a typescript test" })
|
|
27
|
+
};
|
|
28
|
+
const EnsureAllActivezoneSlotsExistInSlotFunctionArguments = ActivezoneSlotPropsAsFunctions;
|
|
29
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSDropzoneName, DROPZONE_SLOTS } from '../constants/index.js';\nimport type { DSDropzoneT } from '../react-desc-prop-types.js';\nimport type { ACTIVEZONE_SLOTS, DSActivezoneT } from '../parts/DSActivezone/react-desc-prop-types.js';\n\nconst SlotPropsAsObj: Partial<DSDropzoneT.Props> = {\n dsDropzoneWrapper_holder: { 'aria-label': 'just a typescript test' },\n dsDropzoneWrapper: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneWrapper: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneIcon: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneLabel: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSDropzoneT.SlotFunctionArguments = {\n dsDropzoneWrapper_holder: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneLabel: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments\n// The helper derives `dsDropzoneWrapperHolder` from the snake case slot 'wrapper_holder', but the prop of that slot\n// is `dsDropzoneWrapper_holder` (see KNOWN_INTENTIONAL_DEVIATIONS.md): it is checked by hand through its explicit entry\n// above, and the helper checks all the other slots.\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSDropzoneName, Omit<typeof DROPZONE_SLOTS, 'WRAPPER_HOLDER'>>\n> = SlotPropsAsFunctions;\nconst EnsureHolderSlotExistsInSlotFunctionArguments: Required<\n Pick<DSDropzoneT.SlotFunctionArguments, 'dsDropzoneWrapper_holder'>\n> = SlotPropsAsFunctions;\n\n// The activezone part (DSActivezone) owns three of the slots, and it can be composed on its own\nconst ActivezoneSlotPropsAsObj: Partial<DSActivezoneT.Props> = {\n dsDropzoneActivezoneWrapper: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneIcon: { 'aria-label': 'just a typescript test' },\n dsDropzoneActivezoneLabel: { 'aria-label': 'just a typescript test' },\n};\n\nconst ActivezoneSlotPropsAsFunctions: DSActivezoneT.SlotFunctionArguments = {\n dsDropzoneActivezoneWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsDropzoneActivezoneLabel: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\nconst EnsureAllActivezoneSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSDropzoneName, typeof ACTIVEZONE_SLOTS>\n> = ActivezoneSlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACOvB,MAAM,iBAA6C;AAAA,EACjD,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,mBAAmB,EAAE,cAAc,yBAAyB;AAAA,EAC5D,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,2BAA2B,EAAE,cAAc,yBAAyB;AACtE;AAEA,MAAM,uBAA0D;AAAA,EAC9D,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,mBAAmB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnE,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC7E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAC7E;AAMA,MAAM,6CAEF;AACJ,MAAM,gDAEF;AAGJ,MAAM,2BAAyD;AAAA,EAC7D,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,2BAA2B,EAAE,cAAc,yBAAyB;AACtE;AAEA,MAAM,iCAAsE;AAAA,EAC1E,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC7E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAC7E;AAEA,MAAM,uDAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -10,7 +10,9 @@ export interface DropzoneCTX {
|
|
|
10
10
|
}
|
|
11
11
|
export declare const useDSDropzone: (propsFromUser: DSDropzoneT.Props) => {
|
|
12
12
|
propsWithDefault: DSDropzoneT.InternalProps;
|
|
13
|
-
globalProps: Partial<Pick<DSGridT.Props, "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "
|
|
13
|
+
globalProps: Partial<Pick<DSGridT.Props, "label" | "onDrop" | "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap"> & Omit<{
|
|
14
|
+
label?: string | undefined | undefined;
|
|
15
|
+
onDrop?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
14
16
|
form?: string | undefined | undefined;
|
|
15
17
|
list?: string | undefined | undefined;
|
|
16
18
|
"aria-activedescendant"?: string | undefined | undefined;
|
|
@@ -171,7 +173,6 @@ export declare const useDSDropzone: (propsFromUser: DSDropzoneT.Props) => {
|
|
|
171
173
|
onDragOverCapture?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
172
174
|
onDragStart?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
173
175
|
onDragStartCapture?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
174
|
-
onDrop?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
175
176
|
onDropCapture?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
176
177
|
onMouseDown?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
177
178
|
onMouseDownCapture?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
@@ -322,7 +323,6 @@ export declare const useDSDropzone: (propsFromUser: DSDropzoneT.Props) => {
|
|
|
322
323
|
keyParams?: string | undefined | undefined;
|
|
323
324
|
keyType?: string | undefined | undefined;
|
|
324
325
|
kind?: string | undefined | undefined;
|
|
325
|
-
label?: string | undefined | undefined;
|
|
326
326
|
loop?: boolean | undefined | undefined;
|
|
327
327
|
low?: number | undefined | undefined;
|
|
328
328
|
manifest?: string | undefined | undefined;
|
|
@@ -3,7 +3,9 @@ import type { DSGridT } from '@elliemae/ds-grid';
|
|
|
3
3
|
import { type DSActivezoneT } from '../react-desc-prop-types.js';
|
|
4
4
|
export declare const useActivezone: (propsFromUser: DSActivezoneT.Props) => {
|
|
5
5
|
propsWithDefault: DSActivezoneT.InternalProps;
|
|
6
|
-
globalProps: Partial<Pick<DSGridT.Props, "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "
|
|
6
|
+
globalProps: Partial<Pick<DSGridT.Props, "label" | "onDrop" | "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap"> & Omit<{
|
|
7
|
+
label?: string | undefined | undefined;
|
|
8
|
+
onDrop?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
7
9
|
form?: string | undefined | undefined;
|
|
8
10
|
list?: string | undefined | undefined;
|
|
9
11
|
"aria-activedescendant"?: string | undefined | undefined;
|
|
@@ -164,7 +166,6 @@ export declare const useActivezone: (propsFromUser: DSActivezoneT.Props) => {
|
|
|
164
166
|
onDragOverCapture?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
165
167
|
onDragStart?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
166
168
|
onDragStartCapture?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
167
|
-
onDrop?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
168
169
|
onDropCapture?: React.DragEventHandler<HTMLDivElement> | undefined;
|
|
169
170
|
onMouseDown?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
170
171
|
onMouseDownCapture?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
@@ -315,7 +316,6 @@ export declare const useActivezone: (propsFromUser: DSActivezoneT.Props) => {
|
|
|
315
316
|
keyParams?: string | undefined | undefined;
|
|
316
317
|
keyType?: string | undefined | undefined;
|
|
317
318
|
kind?: string | undefined | undefined;
|
|
318
|
-
label?: string | undefined | undefined;
|
|
319
319
|
loop?: boolean | undefined | undefined;
|
|
320
320
|
low?: number | undefined | undefined;
|
|
321
321
|
manifest?: string | undefined | undefined;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
2
3
|
import type { SvgIconT } from '@elliemae/ds-icons';
|
|
3
4
|
import type { WeakValidationMap } from 'react';
|
|
5
|
+
import { DSDropzoneName } from '../../constants/index.js';
|
|
6
|
+
export declare const ACTIVEZONE_SLOTS: {
|
|
7
|
+
readonly ACTIVEZONE_LABEL: "activezone-label";
|
|
8
|
+
readonly ACTIVEZONE_ICON: "activezone-icon";
|
|
9
|
+
readonly ACTIVEZONE_WRAPPER: "activezone-wrapper";
|
|
10
|
+
};
|
|
4
11
|
export declare namespace DSActivezoneT {
|
|
5
12
|
interface RequiredProps {
|
|
6
13
|
}
|
|
@@ -8,7 +15,12 @@ export declare namespace DSActivezoneT {
|
|
|
8
15
|
Icon: React.ComponentType<SvgIconT.Props>;
|
|
9
16
|
label: string;
|
|
10
17
|
}
|
|
11
|
-
|
|
18
|
+
type SlotFunctionArguments = {
|
|
19
|
+
dsDropzoneActivezoneWrapper: () => object;
|
|
20
|
+
dsDropzoneActivezoneIcon: () => object;
|
|
21
|
+
dsDropzoneActivezoneLabel: () => object;
|
|
22
|
+
};
|
|
23
|
+
interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSDropzoneName, typeof ACTIVEZONE_SLOTS> {
|
|
12
24
|
}
|
|
13
25
|
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
14
26
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
2
3
|
import type { WeakValidationMap } from 'react';
|
|
4
|
+
import { DSDropzoneName, DROPZONE_SLOTS } from './constants/index.js';
|
|
3
5
|
export declare namespace DSDropzoneT {
|
|
4
6
|
interface RequiredProps {
|
|
5
7
|
}
|
|
6
8
|
interface DefaultProps {
|
|
7
9
|
}
|
|
8
|
-
|
|
10
|
+
type SlotFunctionArguments = {
|
|
11
|
+
dsDropzoneWrapper_holder: () => object;
|
|
12
|
+
dsDropzoneWrapper: () => object;
|
|
13
|
+
dsDropzoneActivezoneWrapper: () => object;
|
|
14
|
+
dsDropzoneActivezoneIcon: () => object;
|
|
15
|
+
dsDropzoneActivezoneLabel: () => object;
|
|
16
|
+
};
|
|
17
|
+
interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSDropzoneName, Omit<typeof DROPZONE_SLOTS, 'WRAPPER_HOLDER'>> {
|
|
18
|
+
dsDropzoneWrapper_holder?: object | ((args: object) => object);
|
|
9
19
|
onDrop?: (files: File[], event: React.DragEvent<HTMLDivElement>) => void;
|
|
10
20
|
hasError?: boolean;
|
|
11
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dropzone",
|
|
3
|
-
"version": "3.80.0-next.
|
|
3
|
+
"version": "3.80.0-next.76",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dropzone",
|
|
6
6
|
"files": [
|
|
@@ -36,16 +36,17 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-grid": "3.80.0-next.
|
|
40
|
-
"@elliemae/ds-hooks-fontsize-media": "3.80.0-next.
|
|
41
|
-
"@elliemae/ds-icons": "3.80.0-next.
|
|
42
|
-
"@elliemae/ds-props-helpers": "3.80.0-next.
|
|
43
|
-
"@elliemae/ds-system": "3.80.0-next.
|
|
44
|
-
"@elliemae/ds-typography": "3.80.0-next.
|
|
39
|
+
"@elliemae/ds-grid": "3.80.0-next.76",
|
|
40
|
+
"@elliemae/ds-hooks-fontsize-media": "3.80.0-next.76",
|
|
41
|
+
"@elliemae/ds-icons": "3.80.0-next.76",
|
|
42
|
+
"@elliemae/ds-props-helpers": "3.80.0-next.76",
|
|
43
|
+
"@elliemae/ds-system": "3.80.0-next.76",
|
|
44
|
+
"@elliemae/ds-typography": "3.80.0-next.76",
|
|
45
45
|
"uid": "^2.0.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@elliemae/ds-monorepo-devops": "3.80.0-next.
|
|
48
|
+
"@elliemae/ds-monorepo-devops": "3.80.0-next.76",
|
|
49
|
+
"@elliemae/ds-typescript-helpers": "3.80.0-next.76",
|
|
49
50
|
"lodash-es": "^4.18.1",
|
|
50
51
|
"styled-components": "~5.3.11"
|
|
51
52
|
},
|