@elliemae/ds-card-v2-action-addon 3.21.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSCardV2ActionAddon.js +55 -0
- package/dist/cjs/DSCardV2ActionAddon.js.map +7 -0
- package/dist/cjs/config/useCardV2ActionAddon.js +72 -0
- package/dist/cjs/config/useCardV2ActionAddon.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +40 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +46 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +57 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styles.js +48 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/esm/DSCardV2ActionAddon.js +25 -0
- package/dist/esm/DSCardV2ActionAddon.js.map +7 -0
- package/dist/esm/config/useCardV2ActionAddon.js +42 -0
- package/dist/esm/config/useCardV2ActionAddon.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +10 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +16 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +27 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styles.js +18 -0
- package/dist/esm/styles.js.map +7 -0
- package/dist/types/config/useCardV2ActionAddon.d.ts +15 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +5 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/react-desc-prop-types.d.ts +21 -0
- package/dist/types/styles.d.ts +6 -0
- package/dist/types/tests/DSCardV2ActionAddon.axe.test.d.ts +1 -0
- package/dist/types/tests/DSCardV2Addon.test.d.ts +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSCardV2ActionAddon_exports = {};
|
|
30
|
+
__export(DSCardV2ActionAddon_exports, {
|
|
31
|
+
DSCardV2ActionAddon: () => DSCardV2ActionAddon,
|
|
32
|
+
DSCardV2ActionAddonWithSchema: () => DSCardV2ActionAddonWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSCardV2ActionAddon_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
38
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
39
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
|
+
var import_useCardV2ActionAddon = require("./config/useCardV2ActionAddon.js");
|
|
41
|
+
var import_styles = require("./styles.js");
|
|
42
|
+
var import_constants = require("./constants/index.js");
|
|
43
|
+
const DSCardV2ActionAddon = (props) => {
|
|
44
|
+
const { propsWithDefault, globalProps, xstyledProps } = (0, import_useCardV2ActionAddon.useCardV2ActionAddon)(props);
|
|
45
|
+
const { innerRef, onClick, label, icon } = propsWithDefault;
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Addon, { innerRef, buttonType: "icon", ...globalProps, ...xstyledProps, onClick, children: [
|
|
47
|
+
label,
|
|
48
|
+
icon || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ChevronSmallDown, { color: ["brand-primary", "700"] })
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
DSCardV2ActionAddon.propTypes = import_react_desc_prop_types.DSCardV2ActionAddonPropTypesSchema;
|
|
52
|
+
DSCardV2ActionAddon.displayName = import_constants.DSCardV2ActionAddonName;
|
|
53
|
+
const DSCardV2ActionAddonWithSchema = (0, import_ds_utilities.describe)(DSCardV2ActionAddon);
|
|
54
|
+
DSCardV2ActionAddonWithSchema.propTypes = import_react_desc_prop_types.DSCardV2ActionAddonPropTypesSchema;
|
|
55
|
+
//# sourceMappingURL=DSCardV2ActionAddon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSCardV2ActionAddon.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2ActionAddon } from './config/useCardV2ActionAddon.js';\nimport { Addon } from './styles.js';\nimport { DSCardV2ActionAddonName } from './constants/index.js';\n\nconst DSCardV2ActionAddon: React.ComponentType<DSCardV2ActionAddonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2ActionAddon(props);\n const { innerRef, onClick, label, icon } = propsWithDefault;\n return (\n <Addon innerRef={innerRef} buttonType=\"icon\" {...globalProps} {...xstyledProps} onClick={onClick}>\n {label}\n {icon || <ChevronSmallDown color={['brand-primary', '700']} />}\n </Addon>\n );\n};\n\nDSCardV2ActionAddon.propTypes = DSCardV2ActionAddonPropTypesSchema;\nDSCardV2ActionAddon.displayName = DSCardV2ActionAddonName;\nconst DSCardV2ActionAddonWithSchema = describe(DSCardV2ActionAddon);\nDSCardV2ActionAddonWithSchema.propTypes = DSCardV2ActionAddonPropTypesSchema;\n\nexport { DSCardV2ActionAddon, DSCardV2ActionAddonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADYnB;AAXJ,0BAAyB;AACzB,sBAAiC;AACjC,mCAA8E;AAC9E,kCAAqC;AACrC,oBAAsB;AACtB,uBAAwC;AAExC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,kDAAqB,KAAK;AAClF,QAAM,EAAE,UAAU,SAAS,OAAO,KAAK,IAAI;AAC3C,SACE,6CAAC,uBAAM,UAAoB,YAAW,QAAQ,GAAG,aAAc,GAAG,cAAc,SAC7E;AAAA;AAAA,IACA,QAAQ,4CAAC,oCAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA,KAC9D;AAEJ;AAEA,oBAAoB,YAAY;AAChC,oBAAoB,cAAc;AAClC,MAAM,oCAAgC,8BAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useCardV2ActionAddon_exports = {};
|
|
30
|
+
__export(useCardV2ActionAddon_exports, {
|
|
31
|
+
useCardV2ActionAddon: () => useCardV2ActionAddon
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useCardV2ActionAddon_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
38
|
+
var import_uid = require("uid");
|
|
39
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
40
|
+
var import_useValidateProps = require("./useValidateProps.js");
|
|
41
|
+
const useCardV2ActionAddon = (propsFromUser) => {
|
|
42
|
+
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(
|
|
43
|
+
propsFromUser,
|
|
44
|
+
import_react_desc_prop_types.defaultProps
|
|
45
|
+
);
|
|
46
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSCardV2ActionAddonPropTypes);
|
|
47
|
+
const globalProps = (0, import_lodash.omit)((0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault), [
|
|
48
|
+
"cols",
|
|
49
|
+
"rows",
|
|
50
|
+
"wrap"
|
|
51
|
+
]);
|
|
52
|
+
const xstyledProps = (0, import_ds_utilities.useGetXstyledProps)(propsWithDefault);
|
|
53
|
+
const { id } = propsWithDefault;
|
|
54
|
+
const instanceUid = import_react.default.useMemo(() => id || (0, import_uid.uid)(5), [id]);
|
|
55
|
+
return import_react.default.useMemo(
|
|
56
|
+
() => ({
|
|
57
|
+
propsWithDefault,
|
|
58
|
+
globalProps,
|
|
59
|
+
xstyledProps,
|
|
60
|
+
instanceUid
|
|
61
|
+
// ...eventHandlers,
|
|
62
|
+
}),
|
|
63
|
+
[
|
|
64
|
+
propsWithDefault,
|
|
65
|
+
globalProps,
|
|
66
|
+
xstyledProps,
|
|
67
|
+
instanceUid
|
|
68
|
+
// eventHandlers,
|
|
69
|
+
]
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=useCardV2ActionAddon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useCardV2ActionAddon.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardV2ActionAddonCTX {\n propsWithDefault: DSCardV2ActionAddonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useCardV2ActionAddon = (propsFromUser: DSCardV2ActionAddonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardV2ActionAddonT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSCardV2ActionAddonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSCardV2ActionAddonT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\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,oBAAqB;AACrB,0BAAyF;AACzF,iBAAoB;AACpB,mCAAsF;AACtF,8BAAiC;AAS1B,MAAM,uBAAuB,CAAC,kBAA8C;AAIjF,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,yDAA4B;AAI/D,QAAM,kBAAc,wBAAK,4CAA2D,gBAAgB,GAAG;AAAA,IACrG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,wCAAmB,gBAAgB;AAKxD,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;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useValidateProps_exports = {};
|
|
30
|
+
__export(useValidateProps_exports, {
|
|
31
|
+
useValidateProps: () => useValidateProps
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
|
+
const useValidateProps = (props, propTypes) => {
|
|
38
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSCardV2ActionAddonName);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { WeakValidationMap } from 'react';\nimport { type DSCardV2ActionAddonT } from '../react-desc-prop-types.js';\nimport { DSCardV2ActionAddonName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSCardV2ActionAddonT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSCardV2ActionAddonName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA+C;AAG/C,uBAAwC;AAEjC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,0DAA+B,OAAO,WAAW,wCAAuB;AAC1E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
CARD_V2_ACTION_ADDON_DATA_TESTID: () => CARD_V2_ACTION_ADDON_DATA_TESTID,
|
|
32
|
+
CARD_V2_ACTION_ADDON_SLOTS: () => CARD_V2_ACTION_ADDON_SLOTS,
|
|
33
|
+
DSCardV2ActionAddonName: () => DSCardV2ActionAddonName
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(constants_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
38
|
+
const DSCardV2ActionAddonName = "DSCardV2ActionAddon";
|
|
39
|
+
const CARD_V2_ACTION_ADDON_SLOTS = {
|
|
40
|
+
ADDON: "action-addon"
|
|
41
|
+
};
|
|
42
|
+
const CARD_V2_ACTION_ADDON_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(
|
|
43
|
+
DSCardV2ActionAddonName,
|
|
44
|
+
CARD_V2_ACTION_ADDON_SLOTS
|
|
45
|
+
);
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2ActionAddonName = 'DSCardV2ActionAddon';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_SLOTS = {\n ADDON: 'action-addon',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_DATA_TESTID = slotObjectToDataTestIds(\n DSCardV2ActionAddonName,\n CARD_V2_ACTION_ADDON_SLOTS,\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,0BAA0B;AAGhC,MAAM,6BAA6B;AAAA,EACxC,OAAO;AACT;AAGO,MAAM,uCAAmC;AAAA,EAC9C;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
CARD_V2_ACTION_ADDON_DATA_TESTID: () => import_constants.CARD_V2_ACTION_ADDON_DATA_TESTID,
|
|
32
|
+
DSCardActionAddonWithSchema: () => import_DSCardV2ActionAddon.DSCardV2ActionAddonWithSchema,
|
|
33
|
+
DSCardV2ActionAddon: () => import_DSCardV2ActionAddon.DSCardV2ActionAddon,
|
|
34
|
+
DSCardV2ActionAddonWithSchema: () => import_DSCardV2ActionAddon.DSCardV2ActionAddonWithSchema
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_DSCardV2ActionAddon = require("./DSCardV2ActionAddon.js");
|
|
39
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2ActionAddon,\n DSCardV2ActionAddonWithSchema,\n DSCardV2ActionAddonWithSchema as DSCardActionAddonWithSchema,\n} from './DSCardV2ActionAddon.js';\nexport { type DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nexport { CARD_V2_ACTION_ADDON_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,iCAIO;AACP,mCAA0C;AAC1C,uBAAiD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSCardV2ActionAddonPropTypes: () => DSCardV2ActionAddonPropTypes,
|
|
32
|
+
DSCardV2ActionAddonPropTypesSchema: () => DSCardV2ActionAddonPropTypesSchema,
|
|
33
|
+
defaultProps: () => defaultProps
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
38
|
+
const defaultProps = {};
|
|
39
|
+
const DSCardV2ActionAddonPropTypes = {
|
|
40
|
+
...import_ds_utilities.globalAttributesPropTypes,
|
|
41
|
+
...import_ds_utilities.xstyledPropTypes,
|
|
42
|
+
/**
|
|
43
|
+
* Addon label
|
|
44
|
+
*/
|
|
45
|
+
label: import_ds_utilities.PropTypes.string.description("Addon label"),
|
|
46
|
+
/**
|
|
47
|
+
* On click callback
|
|
48
|
+
*/
|
|
49
|
+
onClick: import_ds_utilities.PropTypes.func.description("On click callback"),
|
|
50
|
+
/**
|
|
51
|
+
* Icon to display after the label
|
|
52
|
+
*/
|
|
53
|
+
icon: import_ds_utilities.PropTypes.element.description("Icon to display after the label"),
|
|
54
|
+
innerRef: import_ds_utilities.PropTypes.func.description("Ref to the action button")
|
|
55
|
+
};
|
|
56
|
+
const DSCardV2ActionAddonPropTypesSchema = DSCardV2ActionAddonPropTypes;
|
|
57
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSCardV2ActionAddonT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n label?: string;\n onClick?: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n icon?: JSX.Element;\n innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2ActionAddonT.DefaultProps = {};\n\nexport const DSCardV2ActionAddonPropTypes: DSPropTypesSchema<DSCardV2ActionAddonT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Addon label\n */\n label: PropTypes.string.description('Addon label'),\n /**\n * On click callback\n */\n onClick: PropTypes.func.description('On click callback'),\n /**\n * Icon to display after the label\n */\n icon: PropTypes.element.description('Icon to display after the label'),\n innerRef: PropTypes.func.description('Ref to the action button'),\n};\n\nexport const DSCardV2ActionAddonPropTypesSchema =\n DSCardV2ActionAddonPropTypes as unknown as WeakValidationMap<DSCardV2ActionAddonT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,0BAAuE;AAmChE,MAAM,eAAkD,CAAC;AAEzD,MAAM,+BAA8E;AAAA,EACzF,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,8BAAU,OAAO,YAAY,aAAa;AAAA;AAAA;AAAA;AAAA,EAIjD,SAAS,8BAAU,KAAK,YAAY,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAIvD,MAAM,8BAAU,QAAQ,YAAY,iCAAiC;AAAA,EACrE,UAAU,8BAAU,KAAK,YAAY,0BAA0B;AACjE;AAEO,MAAM,qCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var styles_exports = {};
|
|
30
|
+
__export(styles_exports, {
|
|
31
|
+
Addon: () => Addon
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(styles_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
+
var import_ds_button = require("@elliemae/ds-button");
|
|
37
|
+
var import_constants = require("./constants/index.js");
|
|
38
|
+
const Addon = (0, import_ds_system.styled)(import_ds_button.DSButtonV2, { name: import_constants.DSCardV2ActionAddonName, slot: import_constants.CARD_V2_ACTION_ADDON_SLOTS.ADDON })`
|
|
39
|
+
background-color: transparent;
|
|
40
|
+
padding: 4px;
|
|
41
|
+
height: 100%;
|
|
42
|
+
border: none;
|
|
43
|
+
font-size: 13px;
|
|
44
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
45
|
+
color: ${(props) => props.theme.colors.brand["700"]};
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
`;
|
|
48
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport type { DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { DSCardV2ActionAddonName, CARD_V2_ACTION_ADDON_SLOTS } from './constants/index.js';\n\nconst Addon = styled(DSButtonV2, { name: DSCardV2ActionAddonName, slot: CARD_V2_ACTION_ADDON_SLOTS.ADDON })<{\n onClick: DSCardV2ActionAddonT.Props['onClick'];\n}>`\n background-color: transparent;\n padding: 4px;\n height: 100%;\n border: none;\n font-size: 13px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.brand['700']};\n cursor: pointer;\n`;\n\nexport { Addon };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAEvB,uBAA2B;AAC3B,uBAAoE;AAEpE,MAAM,YAAQ,yBAAO,6BAAY,EAAE,MAAM,0CAAyB,MAAM,4CAA2B,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQzF,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,KAAK;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { describe } from "@elliemae/ds-utilities";
|
|
4
|
+
import { ChevronSmallDown } from "@elliemae/ds-icons";
|
|
5
|
+
import { DSCardV2ActionAddonPropTypesSchema } from "./react-desc-prop-types.js";
|
|
6
|
+
import { useCardV2ActionAddon } from "./config/useCardV2ActionAddon.js";
|
|
7
|
+
import { Addon } from "./styles.js";
|
|
8
|
+
import { DSCardV2ActionAddonName } from "./constants/index.js";
|
|
9
|
+
const DSCardV2ActionAddon = (props) => {
|
|
10
|
+
const { propsWithDefault, globalProps, xstyledProps } = useCardV2ActionAddon(props);
|
|
11
|
+
const { innerRef, onClick, label, icon } = propsWithDefault;
|
|
12
|
+
return /* @__PURE__ */ jsxs(Addon, { innerRef, buttonType: "icon", ...globalProps, ...xstyledProps, onClick, children: [
|
|
13
|
+
label,
|
|
14
|
+
icon || /* @__PURE__ */ jsx(ChevronSmallDown, { color: ["brand-primary", "700"] })
|
|
15
|
+
] });
|
|
16
|
+
};
|
|
17
|
+
DSCardV2ActionAddon.propTypes = DSCardV2ActionAddonPropTypesSchema;
|
|
18
|
+
DSCardV2ActionAddon.displayName = DSCardV2ActionAddonName;
|
|
19
|
+
const DSCardV2ActionAddonWithSchema = describe(DSCardV2ActionAddon);
|
|
20
|
+
DSCardV2ActionAddonWithSchema.propTypes = DSCardV2ActionAddonPropTypesSchema;
|
|
21
|
+
export {
|
|
22
|
+
DSCardV2ActionAddon,
|
|
23
|
+
DSCardV2ActionAddonWithSchema
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=DSCardV2ActionAddon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSCardV2ActionAddon.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2ActionAddon } from './config/useCardV2ActionAddon.js';\nimport { Addon } from './styles.js';\nimport { DSCardV2ActionAddonName } from './constants/index.js';\n\nconst DSCardV2ActionAddon: React.ComponentType<DSCardV2ActionAddonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2ActionAddon(props);\n const { innerRef, onClick, label, icon } = propsWithDefault;\n return (\n <Addon innerRef={innerRef} buttonType=\"icon\" {...globalProps} {...xstyledProps} onClick={onClick}>\n {label}\n {icon || <ChevronSmallDown color={['brand-primary', '700']} />}\n </Addon>\n );\n};\n\nDSCardV2ActionAddon.propTypes = DSCardV2ActionAddonPropTypesSchema;\nDSCardV2ActionAddon.displayName = DSCardV2ActionAddonName;\nconst DSCardV2ActionAddonWithSchema = describe(DSCardV2ActionAddon);\nDSCardV2ActionAddonWithSchema.propTypes = DSCardV2ActionAddonPropTypesSchema;\n\nexport { DSCardV2ActionAddon, DSCardV2ActionAddonWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACYnB,SAEW,KAFX;AAXJ,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAoC,0CAA0C;AAC9E,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,+BAA+B;AAExC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,qBAAqB,KAAK;AAClF,QAAM,EAAE,UAAU,SAAS,OAAO,KAAK,IAAI;AAC3C,SACE,qBAAC,SAAM,UAAoB,YAAW,QAAQ,GAAG,aAAc,GAAG,cAAc,SAC7E;AAAA;AAAA,IACA,QAAQ,oBAAC,oBAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA,KAC9D;AAEJ;AAEA,oBAAoB,YAAY;AAChC,oBAAoB,cAAc;AAClC,MAAM,gCAAgC,SAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { omit } from "lodash";
|
|
4
|
+
import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-utilities";
|
|
5
|
+
import { uid } from "uid";
|
|
6
|
+
import { DSCardV2ActionAddonPropTypes, defaultProps } from "../react-desc-prop-types.js";
|
|
7
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
8
|
+
const useCardV2ActionAddon = (propsFromUser) => {
|
|
9
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
10
|
+
propsFromUser,
|
|
11
|
+
defaultProps
|
|
12
|
+
);
|
|
13
|
+
useValidateProps(propsWithDefault, DSCardV2ActionAddonPropTypes);
|
|
14
|
+
const globalProps = omit(useGetGlobalAttributes(propsWithDefault), [
|
|
15
|
+
"cols",
|
|
16
|
+
"rows",
|
|
17
|
+
"wrap"
|
|
18
|
+
]);
|
|
19
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
20
|
+
const { id } = propsWithDefault;
|
|
21
|
+
const instanceUid = React2.useMemo(() => id || uid(5), [id]);
|
|
22
|
+
return React2.useMemo(
|
|
23
|
+
() => ({
|
|
24
|
+
propsWithDefault,
|
|
25
|
+
globalProps,
|
|
26
|
+
xstyledProps,
|
|
27
|
+
instanceUid
|
|
28
|
+
// ...eventHandlers,
|
|
29
|
+
}),
|
|
30
|
+
[
|
|
31
|
+
propsWithDefault,
|
|
32
|
+
globalProps,
|
|
33
|
+
xstyledProps,
|
|
34
|
+
instanceUid
|
|
35
|
+
// eventHandlers,
|
|
36
|
+
]
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
useCardV2ActionAddon
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=useCardV2ActionAddon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useCardV2ActionAddon.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardV2ActionAddonCTX {\n propsWithDefault: DSCardV2ActionAddonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useCardV2ActionAddon = (propsFromUser: DSCardV2ActionAddonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardV2ActionAddonT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSCardV2ActionAddonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSCardV2ActionAddonT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AACpB,SAAoC,8BAA8B,oBAAoB;AACtF,SAAS,wBAAwB;AAS1B,MAAM,uBAAuB,CAAC,kBAA8C;AAIjF,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,4BAA4B;AAI/D,QAAM,cAAc,KAAK,uBAA2D,gBAAgB,GAAG;AAAA,IACrG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,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;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-utilities";
|
|
3
|
+
import { DSCardV2ActionAddonName } from "../constants/index.js";
|
|
4
|
+
const useValidateProps = (props, propTypes) => {
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSCardV2ActionAddonName);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
useValidateProps
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { WeakValidationMap } from 'react';\nimport { type DSCardV2ActionAddonT } from '../react-desc-prop-types.js';\nimport { DSCardV2ActionAddonName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSCardV2ActionAddonT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSCardV2ActionAddonName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,+BAA+B;AAEjC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,uBAAuB;AAC1E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
const DSCardV2ActionAddonName = "DSCardV2ActionAddon";
|
|
4
|
+
const CARD_V2_ACTION_ADDON_SLOTS = {
|
|
5
|
+
ADDON: "action-addon"
|
|
6
|
+
};
|
|
7
|
+
const CARD_V2_ACTION_ADDON_DATA_TESTID = slotObjectToDataTestIds(
|
|
8
|
+
DSCardV2ActionAddonName,
|
|
9
|
+
CARD_V2_ACTION_ADDON_SLOTS
|
|
10
|
+
);
|
|
11
|
+
export {
|
|
12
|
+
CARD_V2_ACTION_ADDON_DATA_TESTID,
|
|
13
|
+
CARD_V2_ACTION_ADDON_SLOTS,
|
|
14
|
+
DSCardV2ActionAddonName
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2ActionAddonName = 'DSCardV2ActionAddon';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_SLOTS = {\n ADDON: 'action-addon',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_DATA_TESTID = slotObjectToDataTestIds(\n DSCardV2ActionAddonName,\n CARD_V2_ACTION_ADDON_SLOTS,\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,0BAA0B;AAGhC,MAAM,6BAA6B;AAAA,EACxC,OAAO;AACT;AAGO,MAAM,mCAAmC;AAAA,EAC9C;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
DSCardV2ActionAddon,
|
|
4
|
+
DSCardV2ActionAddonWithSchema,
|
|
5
|
+
DSCardV2ActionAddonWithSchema as DSCardV2ActionAddonWithSchema2
|
|
6
|
+
} from "./DSCardV2ActionAddon.js";
|
|
7
|
+
import {} from "./react-desc-prop-types.js";
|
|
8
|
+
import { CARD_V2_ACTION_ADDON_DATA_TESTID } from "./constants/index.js";
|
|
9
|
+
export {
|
|
10
|
+
CARD_V2_ACTION_ADDON_DATA_TESTID,
|
|
11
|
+
DSCardV2ActionAddonWithSchema2 as DSCardActionAddonWithSchema,
|
|
12
|
+
DSCardV2ActionAddon,
|
|
13
|
+
DSCardV2ActionAddonWithSchema
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2ActionAddon,\n DSCardV2ActionAddonWithSchema,\n DSCardV2ActionAddonWithSchema as DSCardActionAddonWithSchema,\n} from './DSCardV2ActionAddon.js';\nexport { type DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nexport { CARD_V2_ACTION_ADDON_DATA_TESTID } from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACiC,iCAAjCA;AAAA,OACK;AACP,eAA0C;AAC1C,SAAS,wCAAwC;",
|
|
6
|
+
"names": ["DSCardV2ActionAddonWithSchema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-utilities";
|
|
3
|
+
const defaultProps = {};
|
|
4
|
+
const DSCardV2ActionAddonPropTypes = {
|
|
5
|
+
...globalAttributesPropTypes,
|
|
6
|
+
...xstyledPropTypes,
|
|
7
|
+
/**
|
|
8
|
+
* Addon label
|
|
9
|
+
*/
|
|
10
|
+
label: PropTypes.string.description("Addon label"),
|
|
11
|
+
/**
|
|
12
|
+
* On click callback
|
|
13
|
+
*/
|
|
14
|
+
onClick: PropTypes.func.description("On click callback"),
|
|
15
|
+
/**
|
|
16
|
+
* Icon to display after the label
|
|
17
|
+
*/
|
|
18
|
+
icon: PropTypes.element.description("Icon to display after the label"),
|
|
19
|
+
innerRef: PropTypes.func.description("Ref to the action button")
|
|
20
|
+
};
|
|
21
|
+
const DSCardV2ActionAddonPropTypesSchema = DSCardV2ActionAddonPropTypes;
|
|
22
|
+
export {
|
|
23
|
+
DSCardV2ActionAddonPropTypes,
|
|
24
|
+
DSCardV2ActionAddonPropTypesSchema,
|
|
25
|
+
defaultProps
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSCardV2ActionAddonT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n label?: string;\n onClick?: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n icon?: JSX.Element;\n innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2ActionAddonT.DefaultProps = {};\n\nexport const DSCardV2ActionAddonPropTypes: DSPropTypesSchema<DSCardV2ActionAddonT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Addon label\n */\n label: PropTypes.string.description('Addon label'),\n /**\n * On click callback\n */\n onClick: PropTypes.func.description('On click callback'),\n /**\n * Icon to display after the label\n */\n icon: PropTypes.element.description('Icon to display after the label'),\n innerRef: PropTypes.func.description('Ref to the action button'),\n};\n\nexport const DSCardV2ActionAddonPropTypesSchema =\n DSCardV2ActionAddonPropTypes as unknown as WeakValidationMap<DSCardV2ActionAddonT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAmChE,MAAM,eAAkD,CAAC;AAEzD,MAAM,+BAA8E;AAAA,EACzF,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,UAAU,OAAO,YAAY,aAAa;AAAA;AAAA;AAAA;AAAA,EAIjD,SAAS,UAAU,KAAK,YAAY,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAIvD,MAAM,UAAU,QAAQ,YAAY,iCAAiC;AAAA,EACrE,UAAU,UAAU,KAAK,YAAY,0BAA0B;AACjE;AAEO,MAAM,qCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styled } from "@elliemae/ds-system";
|
|
3
|
+
import { DSButtonV2 } from "@elliemae/ds-button";
|
|
4
|
+
import { DSCardV2ActionAddonName, CARD_V2_ACTION_ADDON_SLOTS } from "./constants/index.js";
|
|
5
|
+
const Addon = styled(DSButtonV2, { name: DSCardV2ActionAddonName, slot: CARD_V2_ACTION_ADDON_SLOTS.ADDON })`
|
|
6
|
+
background-color: transparent;
|
|
7
|
+
padding: 4px;
|
|
8
|
+
height: 100%;
|
|
9
|
+
border: none;
|
|
10
|
+
font-size: 13px;
|
|
11
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
12
|
+
color: ${(props) => props.theme.colors.brand["700"]};
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
`;
|
|
15
|
+
export {
|
|
16
|
+
Addon
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport type { DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { DSCardV2ActionAddonName, CARD_V2_ACTION_ADDON_SLOTS } from './constants/index.js';\n\nconst Addon = styled(DSButtonV2, { name: DSCardV2ActionAddonName, slot: CARD_V2_ACTION_ADDON_SLOTS.ADDON })<{\n onClick: DSCardV2ActionAddonT.Props['onClick'];\n}>`\n background-color: transparent;\n padding: 4px;\n height: 100%;\n border: none;\n font-size: 13px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.brand['700']};\n cursor: pointer;\n`;\n\nexport { Addon };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB,kCAAkC;AAEpE,MAAM,QAAQ,OAAO,YAAY,EAAE,MAAM,yBAAyB,MAAM,2BAA2B,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQzF,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,KAAK;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-utilities';
|
|
3
|
+
import { type DSCardV2ActionAddonT } from '../react-desc-prop-types.js';
|
|
4
|
+
export interface CardV2ActionAddonCTX {
|
|
5
|
+
propsWithDefault: DSCardV2ActionAddonT.InternalProps;
|
|
6
|
+
globalProps: ReturnType<typeof useGetGlobalAttributes>;
|
|
7
|
+
xstyledProps: ReturnType<typeof useGetXstyledProps>;
|
|
8
|
+
instanceUid: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const useCardV2ActionAddon: (propsFromUser: DSCardV2ActionAddonT.Props) => {
|
|
11
|
+
propsWithDefault: DSCardV2ActionAddonT.InternalProps;
|
|
12
|
+
globalProps: import("lodash").Omit<import("@elliemae/ds-utilities").GlobalAttributesT<Element>, "cols" | "rows" | "wrap">;
|
|
13
|
+
xstyledProps: import("@elliemae/ds-utilities").XstyledProps;
|
|
14
|
+
instanceUid: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { DSCardV2ActionAddon, DSCardV2ActionAddonWithSchema, DSCardV2ActionAddonWithSchema as DSCardActionAddonWithSchema, } from './DSCardV2ActionAddon.js';
|
|
2
|
+
export { type DSCardV2ActionAddonT } from './react-desc-prop-types.js';
|
|
3
|
+
export { CARD_V2_ACTION_ADDON_DATA_TESTID } from './constants/index.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WeakValidationMap } from 'react';
|
|
2
|
+
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';
|
|
3
|
+
export declare namespace DSCardV2ActionAddonT {
|
|
4
|
+
interface RequiredProps {
|
|
5
|
+
}
|
|
6
|
+
interface DefaultProps {
|
|
7
|
+
}
|
|
8
|
+
interface OptionalProps {
|
|
9
|
+
label?: string;
|
|
10
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
11
|
+
icon?: JSX.Element;
|
|
12
|
+
innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);
|
|
13
|
+
}
|
|
14
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
15
|
+
}
|
|
16
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export declare const defaultProps: DSCardV2ActionAddonT.DefaultProps;
|
|
20
|
+
export declare const DSCardV2ActionAddonPropTypes: DSPropTypesSchema<DSCardV2ActionAddonT.Props>;
|
|
21
|
+
export declare const DSCardV2ActionAddonPropTypesSchema: WeakValidationMap<DSCardV2ActionAddonT.Props>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DSCardV2ActionAddonT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const Addon: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-button").DSButtonT.Props>, import("@elliemae/ds-system").Theme, {
|
|
4
|
+
onClick: DSCardV2ActionAddonT.Props['onClick'];
|
|
5
|
+
} & import("@elliemae/ds-system").OwnerInterface, never>;
|
|
6
|
+
export { Addon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-card-v2-action-addon",
|
|
3
|
+
"version": "3.21.0-next.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Card V2 Action Addon",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"*.css",
|
|
20
|
+
"*.scss"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"pnpm": ">=6",
|
|
28
|
+
"node": ">=16"
|
|
29
|
+
},
|
|
30
|
+
"author": "ICE MT",
|
|
31
|
+
"jestSonar": {
|
|
32
|
+
"sonar56x": true,
|
|
33
|
+
"reportPath": "reports",
|
|
34
|
+
"reportFile": "tests.xml",
|
|
35
|
+
"indent": 4
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@elliemae/ds-button": "3.21.0-next.1",
|
|
39
|
+
"@elliemae/ds-icons": "3.21.0-next.1",
|
|
40
|
+
"@elliemae/ds-system": "3.21.0-next.1",
|
|
41
|
+
"@xstyled/system": "~3.7.3",
|
|
42
|
+
"uid": "~2.0.1",
|
|
43
|
+
"@elliemae/ds-utilities": "3.21.0-next.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"styled-components": "~5.3.9",
|
|
47
|
+
"jest-axe": "^7.0.1",
|
|
48
|
+
"lodash": "^4.17.21"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@testing-library/jest-dom": "~5.16.4",
|
|
52
|
+
"@testing-library/react": "~12.1.3",
|
|
53
|
+
"@testing-library/user-event": "~13.5.0",
|
|
54
|
+
"react": "^17.0.2",
|
|
55
|
+
"react-dom": "^17.0.2",
|
|
56
|
+
"styled-components": "~5.3.9"
|
|
57
|
+
},
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"access": "public",
|
|
60
|
+
"typeSafety": false
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
64
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
65
|
+
"lint": "node ../../scripts/lint.mjs --fix",
|
|
66
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
|
|
67
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
68
|
+
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
69
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
70
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
71
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
72
|
+
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
73
|
+
}
|
|
74
|
+
}
|