@elliemae/ds-svg 3.16.0-next.17
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/DSSvg.js +69 -0
- package/dist/cjs/DSSvg.js.map +7 -0
- package/dist/cjs/config/useSvg.js +53 -0
- package/dist/cjs/config/useSvg.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 +44 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +51 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styled.js +153 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/DSSvg.js +39 -0
- package/dist/esm/DSSvg.js.map +7 -0
- package/dist/esm/config/useSvg.js +23 -0
- package/dist/esm/config/useSvg.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 +14 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +21 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styled.js +123 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/types/DSSvg.d.ts +5 -0
- package/dist/types/config/useSvg.d.ts +13 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/react-desc-prop-types.d.ts +19 -0
- package/dist/types/styled.d.ts +6 -0
- package/dist/types/tests/DSSvg.test.d.ts +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,69 @@
|
|
|
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 DSSvg_exports = {};
|
|
30
|
+
__export(DSSvg_exports, {
|
|
31
|
+
DSSvg: () => DSSvg,
|
|
32
|
+
DSSvgWithSchema: () => DSSvgWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSSvg_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
39
|
+
var import_useSvg = require("./config/useSvg.js");
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
41
|
+
var import_styled = require("./styled.js");
|
|
42
|
+
const DSSvg = (props) => {
|
|
43
|
+
const {
|
|
44
|
+
globalProps,
|
|
45
|
+
xstyledProps,
|
|
46
|
+
propsWithDefault: { viewBox, size, children, focusable }
|
|
47
|
+
} = (0, import_useSvg.useSvg)(props);
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
import_styled.StyledWrapper,
|
|
50
|
+
{
|
|
51
|
+
viewBox,
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
focusable,
|
|
55
|
+
...globalProps,
|
|
56
|
+
...xstyledProps,
|
|
57
|
+
size,
|
|
58
|
+
display: xstyledProps.display,
|
|
59
|
+
overflow: xstyledProps.overflow,
|
|
60
|
+
visibility: xstyledProps.visibility,
|
|
61
|
+
children
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
DSSvg.propTypes = import_react_desc_prop_types.DSSvgPropTypes;
|
|
66
|
+
DSSvg.displayName = import_constants.DSSvgName;
|
|
67
|
+
const DSSvgWithSchema = (0, import_ds_props_helpers.describe)(DSSvg);
|
|
68
|
+
DSSvgWithSchema.propTypes = import_react_desc_prop_types.DSSvgPropTypes;
|
|
69
|
+
//# sourceMappingURL=DSSvg.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSSvg.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT, DSSvgPropTypes } from './react-desc-prop-types.js';\nimport { useSvg } from './config/useSvg.js';\nimport { DSSvgName } from './constants/index.js';\nimport { StyledWrapper } from './styled.js';\n\nconst DSSvg: React.ComponentType<DSSvgT.Props> = (props) => {\n const {\n globalProps,\n xstyledProps,\n propsWithDefault: { viewBox, size, children, focusable },\n } = useSvg(props);\n\n return (\n <StyledWrapper\n viewBox={viewBox}\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable={focusable}\n {...globalProps}\n {...xstyledProps}\n size={size}\n display={xstyledProps.display as string | undefined}\n overflow={xstyledProps.overflow as string | undefined}\n visibility={xstyledProps.visibility as string | undefined}\n >\n {children}\n </StyledWrapper>\n );\n};\n\nDSSvg.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\nDSSvg.displayName = DSSvgName;\nconst DSSvgWithSchema = describe(DSSvg);\nDSSvgWithSchema.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\n\nexport { DSSvg, DSSvgWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADenB;AAdJ,8BAAyB;AACzB,mCAA4C;AAC5C,oBAAuB;AACvB,uBAA0B;AAC1B,oBAA8B;AAE9B,MAAM,QAA2C,CAAC,UAAU;AAC1D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,kBAAkB,EAAE,SAAS,MAAM,UAAU,UAAU;AAAA,EACzD,QAAI,sBAAO,KAAK;AAEhB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAM;AAAA,MACN,eAAY;AAAA,MACZ;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,SAAS,aAAa;AAAA,MACtB,UAAU,aAAa;AAAA,MACvB,YAAY,aAAa;AAAA,MAExB;AAAA;AAAA,EACH;AAEJ;AAEA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,sBAAkB,kCAAS,KAAK;AACtC,gBAAgB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 useSvg_exports = {};
|
|
30
|
+
__export(useSvg_exports, {
|
|
31
|
+
useSvg: () => useSvg
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useSvg_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
38
|
+
var import_useValidateProps = require("./useValidateProps.js");
|
|
39
|
+
const useSvg = (propsFromUser) => {
|
|
40
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
|
|
41
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSSvgPropTypes);
|
|
42
|
+
const globalProps = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
|
|
43
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
44
|
+
return import_react.default.useMemo(
|
|
45
|
+
() => ({
|
|
46
|
+
propsWithDefault,
|
|
47
|
+
globalProps,
|
|
48
|
+
xstyledProps
|
|
49
|
+
}),
|
|
50
|
+
[propsWithDefault, globalProps, xstyledProps]
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=useSvg.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useSvg.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT, DSSvgPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface SvgCTX {\n propsWithDefault: DSSvgT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useSvg = (propsFromUser: DSSvgT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSvgT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSSvgPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSSvgT.InternalProps>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\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,mCAA0D;AAC1D,8BAAiC;AAS1B,MAAM,SAAS,CAAC,kBAAgC;AAIrD,QAAM,uBAAmB,sDAAmD,eAAe,yCAAY;AACvG,gDAAiB,kBAAkB,2CAAc;AAIjD,QAAM,kBAAc,gDAA6C,gBAAgB;AACjF,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;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_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
|
+
const useValidateProps = (props, propTypes) => {
|
|
38
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSSvgName);
|
|
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 type { DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT } from '../react-desc-prop-types.js';\nimport { DSSvgName } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSSvgT.InternalProps, propTypes: DSPropTypesSchema<DSSvgT.Props>): void => {\n useValidateTypescriptPropTypes(props, propTypes, DSSvgName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA+C;AAE/C,uBAA0B;AAEnB,MAAM,mBAAmB,CAAC,OAA6B,cAAqD;AACjH,8DAA+B,OAAO,WAAW,0BAAS;AAC5D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
DSSvgName: () => DSSvgName,
|
|
32
|
+
SVG_DATA_TESTID: () => SVG_DATA_TESTID,
|
|
33
|
+
SVG_SLOTS: () => SVG_SLOTS
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(constants_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
const DSSvgName = "DSSvg";
|
|
38
|
+
const SVG_SLOTS = {
|
|
39
|
+
ROOT: "root"
|
|
40
|
+
};
|
|
41
|
+
const SVG_DATA_TESTID = {
|
|
42
|
+
ROOT: `ds-svg-${SVG_SLOTS.ROOT}`
|
|
43
|
+
};
|
|
44
|
+
//# 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": ["export const DSSvgName = 'DSSvg';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_SLOTS = {\n ROOT: 'root',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_DATA_TESTID = {\n ROOT: `ds-svg-${SVG_SLOTS.ROOT}`,\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,YAAY;AAGlB,MAAM,YAAY;AAAA,EACvB,MAAM;AACR;AAGO,MAAM,kBAAkB;AAAA,EAC7B,MAAM,UAAU,UAAU;AAC5B;",
|
|
6
|
+
"names": []
|
|
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 src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
DSSvg: () => import_DSSvg.DSSvg,
|
|
32
|
+
DSSvgWithSchema: () => import_DSSvg.DSSvgWithSchema,
|
|
33
|
+
SVG_DATA_TESTID: () => import_constants.SVG_DATA_TESTID
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_DSSvg = require("./DSSvg.js");
|
|
38
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
39
|
+
var import_constants = require("./constants/index.js");
|
|
40
|
+
//# 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 { DSSvg, DSSvgWithSchema } from './DSSvg.js';\nexport { type DSSvgT } from './react-desc-prop-types.js';\nexport { SVG_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAuC;AACvC,mCAA4B;AAC5B,uBAAgC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
DSSvgPropTypes: () => DSSvgPropTypes,
|
|
32
|
+
defaultProps: () => defaultProps
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
const defaultProps = {
|
|
38
|
+
focusable: false
|
|
39
|
+
};
|
|
40
|
+
const DSSvgPropTypes = {
|
|
41
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
42
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
43
|
+
viewBox: import_ds_props_helpers.PropTypes.string.isRequired.description(
|
|
44
|
+
"The viewBox attribute defines the coordinate system for the SVG content."
|
|
45
|
+
),
|
|
46
|
+
size: import_ds_props_helpers.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description(
|
|
47
|
+
"The size of the SVG. This will be used to set the width and height of the SVG."
|
|
48
|
+
),
|
|
49
|
+
focusable: import_ds_props_helpers.PropTypes.bool.description("The focusable attribute is used to determine whether an element can be focused.").defaultValue(false)
|
|
50
|
+
};
|
|
51
|
+
//# 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 { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSvgT {\n export type SizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n export interface RequiredProps {\n viewBox: string;\n }\n\n export interface DefaultProps {\n focusable: boolean;\n }\n\n export interface OptionalProps {\n size?: SizeType;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<SVGElement>,\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<SVGElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSSvgT.DefaultProps = {\n focusable: false,\n};\n\nexport const DSSvgPropTypes: DSPropTypesSchema<DSSvgT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n viewBox: PropTypes.string.isRequired.description(\n 'The viewBox attribute defines the coordinate system for the SVG content.',\n ),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description(\n 'The size of the SVG. This will be used to set the width and height of the SVG.',\n ),\n focusable: PropTypes.bool\n .description('The focusable attribute is used to determine whether an element can be focused.')\n .defaultValue(false),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAsChE,MAAM,eAAoC;AAAA,EAC/C,WAAW;AACb;AAEO,MAAM,iBAAkD;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,kCAAU,OAAO,WAAW;AAAA,IACnC;AAAA,EACF;AAAA,EACA,MAAM,kCAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,WAAW,kCAAU,KAClB,YAAY,iFAAiF,EAC7F,aAAa,KAAK;AACvB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var styled_exports = {};
|
|
30
|
+
__export(styled_exports, {
|
|
31
|
+
StyledWrapper: () => StyledWrapper
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(styled_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
+
var import_constants = require("./constants/index.js");
|
|
37
|
+
const xxlSizes = import_ds_system.css`
|
|
38
|
+
width: 4rem;
|
|
39
|
+
height: 4rem;
|
|
40
|
+
@media (min-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
41
|
+
width: 4.923rem;
|
|
42
|
+
height: 4.923rem;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
const xlSizes = import_ds_system.css`
|
|
46
|
+
width: 3rem;
|
|
47
|
+
height: 3rem;
|
|
48
|
+
@media (min-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
49
|
+
width: 3.692rem;
|
|
50
|
+
height: 3.692rem;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
const lSizes = import_ds_system.css`
|
|
54
|
+
width: 2rem;
|
|
55
|
+
height: 2rem;
|
|
56
|
+
@media (min-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
57
|
+
width: 2.462rem;
|
|
58
|
+
height: 2.462rem;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
const mSizes = import_ds_system.css`
|
|
62
|
+
width: 1.5rem;
|
|
63
|
+
height: 1.5rem;
|
|
64
|
+
@media (min-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
65
|
+
width: 1.846rem;
|
|
66
|
+
height: 1.846rem;
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
const sSizes = import_ds_system.css`
|
|
70
|
+
width: 1rem;
|
|
71
|
+
height: 1rem;
|
|
72
|
+
@media (min-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
73
|
+
width: 1.231rem;
|
|
74
|
+
height: 1.231rem;
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
const xsSizes = import_ds_system.css`
|
|
78
|
+
width: 0.5rem;
|
|
79
|
+
height: 0.5rem;
|
|
80
|
+
@media (min-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
81
|
+
width: 0.615rem;
|
|
82
|
+
height: 0.615rem;
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
const xxsSizes = import_ds_system.css`
|
|
86
|
+
width: 0.25rem;
|
|
87
|
+
height: 0.25rem;
|
|
88
|
+
@media (min-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
89
|
+
width: 0.308rem;
|
|
90
|
+
height: 0.308rem;
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
const standarSizes = import_ds_system.css`
|
|
94
|
+
${sSizes}
|
|
95
|
+
`;
|
|
96
|
+
const getSize = (size) => {
|
|
97
|
+
if (size === "xxl")
|
|
98
|
+
return xxlSizes;
|
|
99
|
+
if (size === "xl")
|
|
100
|
+
return xlSizes;
|
|
101
|
+
if (size === "l")
|
|
102
|
+
return lSizes;
|
|
103
|
+
if (size === "m")
|
|
104
|
+
return mSizes;
|
|
105
|
+
if (size === "s")
|
|
106
|
+
return sSizes;
|
|
107
|
+
if (size === "xs")
|
|
108
|
+
return xsSizes;
|
|
109
|
+
if (size === "xxs")
|
|
110
|
+
return xxsSizes;
|
|
111
|
+
return standarSizes;
|
|
112
|
+
};
|
|
113
|
+
const StyledWrapper = (0, import_ds_system.styled)("svg", { name: import_constants.DSSvgName, slot: import_constants.SVG_SLOTS.ROOT })`
|
|
114
|
+
${import_ds_system.layout}
|
|
115
|
+
${import_ds_system.space}
|
|
116
|
+
${import_ds_system.sizing}
|
|
117
|
+
|
|
118
|
+
${({ size }) => {
|
|
119
|
+
if (size)
|
|
120
|
+
return getSize(size);
|
|
121
|
+
}};
|
|
122
|
+
|
|
123
|
+
${({ width, theme }) => {
|
|
124
|
+
if (typeof width === "string") {
|
|
125
|
+
return `
|
|
126
|
+
width: ${width};
|
|
127
|
+
`;
|
|
128
|
+
} else if (typeof width === "number") {
|
|
129
|
+
return `
|
|
130
|
+
width: ${width / 16}rem;
|
|
131
|
+
@media (min-width: ${theme.breakpoints?.small}) {
|
|
132
|
+
width: ${width / 13}rem;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
}
|
|
136
|
+
}}
|
|
137
|
+
|
|
138
|
+
${({ height, theme }) => {
|
|
139
|
+
if (typeof height === "string") {
|
|
140
|
+
return `
|
|
141
|
+
height: ${height};
|
|
142
|
+
`;
|
|
143
|
+
} else if (typeof height === "number") {
|
|
144
|
+
return `
|
|
145
|
+
height: ${height / 16}rem;
|
|
146
|
+
@media (min-width: ${theme.breakpoints?.small}) {
|
|
147
|
+
height: ${height / 13}rem;
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
}}
|
|
152
|
+
`;
|
|
153
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { FlattenInterpolation, Theme } from '@elliemae/ds-system';\nimport { layout, sizing, space, css, styled, th } from '@elliemae/ds-system';\nimport type { DSSvgT } from './react-desc-prop-types.js';\nimport { DSSvgName, SVG_SLOTS } from './constants/index.js';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\n\nconst xxlSizes = css`\n width: 4rem;\n height: 4rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 4.923rem;\n height: 4.923rem;\n }\n`;\n\nconst xlSizes = css`\n width: 3rem;\n height: 3rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 3.692rem;\n height: 3.692rem;\n }\n`;\n\nconst lSizes = css`\n width: 2rem;\n height: 2rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 2.462rem;\n height: 2.462rem;\n }\n`;\n\nconst mSizes = css`\n width: 1.5rem;\n height: 1.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.846rem;\n height: 1.846rem;\n }\n`;\n\nconst sSizes = css`\n width: 1rem;\n height: 1rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.231rem;\n height: 1.231rem;\n }\n`;\n\nconst xsSizes = css`\n width: 0.5rem;\n height: 0.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.615rem;\n height: 0.615rem;\n }\n`;\n\nconst xxsSizes = css`\n width: 0.25rem;\n height: 0.25rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.308rem;\n height: 0.308rem;\n }\n`;\n\nconst standarSizes = css`\n ${sSizes}\n`;\n\nconst getSize = (\n size: DSSvgT.SizeType | undefined,\n): FlattenInterpolation<{\n theme: Theme;\n}> => {\n if (size === 'xxl') return xxlSizes;\n if (size === 'xl') return xlSizes;\n if (size === 'l') return lSizes;\n if (size === 'm') return mSizes;\n if (size === 's') return sSizes;\n if (size === 'xs') return xsSizes;\n if (size === 'xxs') return xxsSizes;\n return standarSizes;\n};\n\nexport const StyledWrapper = styled('svg', { name: DSSvgName, slot: SVG_SLOTS.ROOT })<\n { size?: DSSvgT.SizeType } & XstyledProps\n>`\n ${layout}\n ${space}\n ${sizing}\n\n ${({ size }) => {\n if (size) return getSize(size);\n }};\n\n ${({ width, theme }) => {\n if (typeof width === 'string') {\n return `\n width: ${width};\n `;\n } else if (typeof width === 'number') {\n return `\n width: ${width / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n width: ${width / 13}rem;\n }\n `;\n }\n }}\n\n ${({ height, theme }) => {\n if (typeof height === 'string') {\n return `\n height: ${height};\n `;\n } else if (typeof height === 'number') {\n return `\n height: ${height / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n height: ${height / 13}rem;\n }\n `;\n }\n }}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuD;AAEvD,uBAAqC;AAGrC,MAAM,WAAW;AAAA;AAAA;AAAA,uBAGM,oBAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,UAAU;AAAA;AAAA;AAAA,uBAGO,oBAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,SAAS;AAAA;AAAA;AAAA,uBAGQ,oBAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,SAAS;AAAA;AAAA;AAAA,uBAGQ,oBAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,SAAS;AAAA;AAAA;AAAA,uBAGQ,oBAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,UAAU;AAAA;AAAA;AAAA,uBAGO,oBAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,WAAW;AAAA;AAAA;AAAA,uBAGM,oBAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,eAAe;AAAA,IACjB;AAAA;AAGJ,MAAM,UAAU,CACd,SAGI;AACJ,MAAI,SAAS;AAAO,WAAO;AAC3B,MAAI,SAAS;AAAM,WAAO;AAC1B,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAM,WAAO;AAC1B,MAAI,SAAS;AAAO,WAAO;AAC3B,SAAO;AACT;AAEO,MAAM,oBAAgB,yBAAO,OAAO,EAAE,MAAM,4BAAW,MAAM,2BAAU,KAAK,CAAC;AAAA,IAGhF;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA,CAAC,EAAE,KAAK,MAAM;AACd,MAAI;AAAM,WAAO,QAAQ,IAAI;AAC/B;AAAA;AAAA,IAEE,CAAC,EAAE,OAAO,MAAM,MAAM;AACtB,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,iBACI;AAAA;AAAA,EAEb,WAAW,OAAO,UAAU,UAAU;AACpC,WAAO;AAAA,iBACI,QAAQ;AAAA,6BACI,MAAM,aAAa;AAAA,mBAC7B,QAAQ;AAAA;AAAA;AAAA,EAGvB;AACF;AAAA;AAAA,IAEE,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,kBACK;AAAA;AAAA,EAEd,WAAW,OAAO,WAAW,UAAU;AACrC,WAAO;AAAA,kBACK,SAAS;AAAA,6BACE,MAAM,aAAa;AAAA,oBAC5B,SAAS;AAAA;AAAA;AAAA,EAGzB;AACF;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { DSSvgPropTypes } from "./react-desc-prop-types.js";
|
|
5
|
+
import { useSvg } from "./config/useSvg.js";
|
|
6
|
+
import { DSSvgName } from "./constants/index.js";
|
|
7
|
+
import { StyledWrapper } from "./styled.js";
|
|
8
|
+
const DSSvg = (props) => {
|
|
9
|
+
const {
|
|
10
|
+
globalProps,
|
|
11
|
+
xstyledProps,
|
|
12
|
+
propsWithDefault: { viewBox, size, children, focusable }
|
|
13
|
+
} = useSvg(props);
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
StyledWrapper,
|
|
16
|
+
{
|
|
17
|
+
viewBox,
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
focusable,
|
|
21
|
+
...globalProps,
|
|
22
|
+
...xstyledProps,
|
|
23
|
+
size,
|
|
24
|
+
display: xstyledProps.display,
|
|
25
|
+
overflow: xstyledProps.overflow,
|
|
26
|
+
visibility: xstyledProps.visibility,
|
|
27
|
+
children
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
DSSvg.propTypes = DSSvgPropTypes;
|
|
32
|
+
DSSvg.displayName = DSSvgName;
|
|
33
|
+
const DSSvgWithSchema = describe(DSSvg);
|
|
34
|
+
DSSvgWithSchema.propTypes = DSSvgPropTypes;
|
|
35
|
+
export {
|
|
36
|
+
DSSvg,
|
|
37
|
+
DSSvgWithSchema
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=DSSvg.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSSvg.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT, DSSvgPropTypes } from './react-desc-prop-types.js';\nimport { useSvg } from './config/useSvg.js';\nimport { DSSvgName } from './constants/index.js';\nimport { StyledWrapper } from './styled.js';\n\nconst DSSvg: React.ComponentType<DSSvgT.Props> = (props) => {\n const {\n globalProps,\n xstyledProps,\n propsWithDefault: { viewBox, size, children, focusable },\n } = useSvg(props);\n\n return (\n <StyledWrapper\n viewBox={viewBox}\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable={focusable}\n {...globalProps}\n {...xstyledProps}\n size={size}\n display={xstyledProps.display as string | undefined}\n overflow={xstyledProps.overflow as string | undefined}\n visibility={xstyledProps.visibility as string | undefined}\n >\n {children}\n </StyledWrapper>\n );\n};\n\nDSSvg.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\nDSSvg.displayName = DSSvgName;\nconst DSSvgWithSchema = describe(DSSvg);\nDSSvgWithSchema.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\n\nexport { DSSvg, DSSvgWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACenB;AAdJ,SAAS,gBAAgB;AACzB,SAAsB,sBAAsB;AAC5C,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAE9B,MAAM,QAA2C,CAAC,UAAU;AAC1D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,kBAAkB,EAAE,SAAS,MAAM,UAAU,UAAU;AAAA,EACzD,IAAI,OAAO,KAAK;AAEhB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAM;AAAA,MACN,eAAY;AAAA,MACZ;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,SAAS,aAAa;AAAA,MACtB,UAAU,aAAa;AAAA,MACvB,YAAY,aAAa;AAAA,MAExB;AAAA;AAAA,EACH;AAEJ;AAEA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,kBAAkB,SAAS,KAAK;AACtC,gBAAgB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { DSSvgPropTypes, defaultProps } from "../react-desc-prop-types.js";
|
|
5
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
6
|
+
const useSvg = (propsFromUser) => {
|
|
7
|
+
const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
|
|
8
|
+
useValidateProps(propsWithDefault, DSSvgPropTypes);
|
|
9
|
+
const globalProps = useGetGlobalAttributes(propsWithDefault);
|
|
10
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
11
|
+
return React2.useMemo(
|
|
12
|
+
() => ({
|
|
13
|
+
propsWithDefault,
|
|
14
|
+
globalProps,
|
|
15
|
+
xstyledProps
|
|
16
|
+
}),
|
|
17
|
+
[propsWithDefault, globalProps, xstyledProps]
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
useSvg
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useSvg.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useSvg.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 { type DSSvgT, DSSvgPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface SvgCTX {\n propsWithDefault: DSSvgT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useSvg = (propsFromUser: DSSvgT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSvgT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSSvgPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSSvgT.InternalProps>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAsB,gBAAgB,oBAAoB;AAC1D,SAAS,wBAAwB;AAS1B,MAAM,SAAS,CAAC,kBAAgC;AAIrD,QAAM,mBAAmB,6BAAmD,eAAe,YAAY;AACvG,mBAAiB,kBAAkB,cAAc;AAIjD,QAAM,cAAc,uBAA6C,gBAAgB;AACjF,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSSvgName } from "../constants/index.js";
|
|
4
|
+
const useValidateProps = (props, propTypes) => {
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSSvgName);
|
|
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 type { DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT } from '../react-desc-prop-types.js';\nimport { DSSvgName } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSSvgT.InternalProps, propTypes: DSPropTypesSchema<DSSvgT.Props>): void => {\n useValidateTypescriptPropTypes(props, propTypes, DSSvgName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,sCAAsC;AAE/C,SAAS,iBAAiB;AAEnB,MAAM,mBAAmB,CAAC,OAA6B,cAAqD;AACjH,iCAA+B,OAAO,WAAW,SAAS;AAC5D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const DSSvgName = "DSSvg";
|
|
3
|
+
const SVG_SLOTS = {
|
|
4
|
+
ROOT: "root"
|
|
5
|
+
};
|
|
6
|
+
const SVG_DATA_TESTID = {
|
|
7
|
+
ROOT: `ds-svg-${SVG_SLOTS.ROOT}`
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
DSSvgName,
|
|
11
|
+
SVG_DATA_TESTID,
|
|
12
|
+
SVG_SLOTS
|
|
13
|
+
};
|
|
14
|
+
//# 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", "export const DSSvgName = 'DSSvg';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_SLOTS = {\n ROOT: 'root',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_DATA_TESTID = {\n ROOT: `ds-svg-${SVG_SLOTS.ROOT}`,\n} as const;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,YAAY;AAGlB,MAAM,YAAY;AAAA,EACvB,MAAM;AACR;AAGO,MAAM,kBAAkB;AAAA,EAC7B,MAAM,UAAU,UAAU;AAC5B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSSvg, DSSvgWithSchema } from "./DSSvg.js";
|
|
3
|
+
import {} from "./react-desc-prop-types.js";
|
|
4
|
+
import { SVG_DATA_TESTID } from "./constants/index.js";
|
|
5
|
+
export {
|
|
6
|
+
DSSvg,
|
|
7
|
+
DSSvgWithSchema,
|
|
8
|
+
SVG_DATA_TESTID
|
|
9
|
+
};
|
|
10
|
+
//# 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 { DSSvg, DSSvgWithSchema } from './DSSvg.js';\nexport { type DSSvgT } from './react-desc-prop-types.js';\nexport { SVG_DATA_TESTID } from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,OAAO,uBAAuB;AACvC,eAA4B;AAC5B,SAAS,uBAAuB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
focusable: false
|
|
5
|
+
};
|
|
6
|
+
const DSSvgPropTypes = {
|
|
7
|
+
...globalAttributesPropTypes,
|
|
8
|
+
...xstyledPropTypes,
|
|
9
|
+
viewBox: PropTypes.string.isRequired.description(
|
|
10
|
+
"The viewBox attribute defines the coordinate system for the SVG content."
|
|
11
|
+
),
|
|
12
|
+
size: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description(
|
|
13
|
+
"The size of the SVG. This will be used to set the width and height of the SVG."
|
|
14
|
+
),
|
|
15
|
+
focusable: PropTypes.bool.description("The focusable attribute is used to determine whether an element can be focused.").defaultValue(false)
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
DSSvgPropTypes,
|
|
19
|
+
defaultProps
|
|
20
|
+
};
|
|
21
|
+
//# 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 { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSvgT {\n export type SizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n export interface RequiredProps {\n viewBox: string;\n }\n\n export interface DefaultProps {\n focusable: boolean;\n }\n\n export interface OptionalProps {\n size?: SizeType;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<SVGElement>,\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<SVGElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSSvgT.DefaultProps = {\n focusable: false,\n};\n\nexport const DSSvgPropTypes: DSPropTypesSchema<DSSvgT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n viewBox: PropTypes.string.isRequired.description(\n 'The viewBox attribute defines the coordinate system for the SVG content.',\n ),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description(\n 'The size of the SVG. This will be used to set the width and height of the SVG.',\n ),\n focusable: PropTypes.bool\n .description('The focusable attribute is used to determine whether an element can be focused.')\n .defaultValue(false),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;AAsChE,MAAM,eAAoC;AAAA,EAC/C,WAAW;AACb;AAEO,MAAM,iBAAkD;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,UAAU,OAAO,WAAW;AAAA,IACnC;AAAA,EACF;AAAA,EACA,MAAM,UAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,WAAW,UAAU,KAClB,YAAY,iFAAiF,EAC7F,aAAa,KAAK;AACvB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { layout, sizing, space, css, styled, th } from "@elliemae/ds-system";
|
|
3
|
+
import { DSSvgName, SVG_SLOTS } from "./constants/index.js";
|
|
4
|
+
const xxlSizes = css`
|
|
5
|
+
width: 4rem;
|
|
6
|
+
height: 4rem;
|
|
7
|
+
@media (min-width: ${th.breakpoint("small")}) {
|
|
8
|
+
width: 4.923rem;
|
|
9
|
+
height: 4.923rem;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
const xlSizes = css`
|
|
13
|
+
width: 3rem;
|
|
14
|
+
height: 3rem;
|
|
15
|
+
@media (min-width: ${th.breakpoint("small")}) {
|
|
16
|
+
width: 3.692rem;
|
|
17
|
+
height: 3.692rem;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
const lSizes = css`
|
|
21
|
+
width: 2rem;
|
|
22
|
+
height: 2rem;
|
|
23
|
+
@media (min-width: ${th.breakpoint("small")}) {
|
|
24
|
+
width: 2.462rem;
|
|
25
|
+
height: 2.462rem;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
const mSizes = css`
|
|
29
|
+
width: 1.5rem;
|
|
30
|
+
height: 1.5rem;
|
|
31
|
+
@media (min-width: ${th.breakpoint("small")}) {
|
|
32
|
+
width: 1.846rem;
|
|
33
|
+
height: 1.846rem;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
const sSizes = css`
|
|
37
|
+
width: 1rem;
|
|
38
|
+
height: 1rem;
|
|
39
|
+
@media (min-width: ${th.breakpoint("small")}) {
|
|
40
|
+
width: 1.231rem;
|
|
41
|
+
height: 1.231rem;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
const xsSizes = css`
|
|
45
|
+
width: 0.5rem;
|
|
46
|
+
height: 0.5rem;
|
|
47
|
+
@media (min-width: ${th.breakpoint("small")}) {
|
|
48
|
+
width: 0.615rem;
|
|
49
|
+
height: 0.615rem;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
const xxsSizes = css`
|
|
53
|
+
width: 0.25rem;
|
|
54
|
+
height: 0.25rem;
|
|
55
|
+
@media (min-width: ${th.breakpoint("small")}) {
|
|
56
|
+
width: 0.308rem;
|
|
57
|
+
height: 0.308rem;
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
const standarSizes = css`
|
|
61
|
+
${sSizes}
|
|
62
|
+
`;
|
|
63
|
+
const getSize = (size) => {
|
|
64
|
+
if (size === "xxl")
|
|
65
|
+
return xxlSizes;
|
|
66
|
+
if (size === "xl")
|
|
67
|
+
return xlSizes;
|
|
68
|
+
if (size === "l")
|
|
69
|
+
return lSizes;
|
|
70
|
+
if (size === "m")
|
|
71
|
+
return mSizes;
|
|
72
|
+
if (size === "s")
|
|
73
|
+
return sSizes;
|
|
74
|
+
if (size === "xs")
|
|
75
|
+
return xsSizes;
|
|
76
|
+
if (size === "xxs")
|
|
77
|
+
return xxsSizes;
|
|
78
|
+
return standarSizes;
|
|
79
|
+
};
|
|
80
|
+
const StyledWrapper = styled("svg", { name: DSSvgName, slot: SVG_SLOTS.ROOT })`
|
|
81
|
+
${layout}
|
|
82
|
+
${space}
|
|
83
|
+
${sizing}
|
|
84
|
+
|
|
85
|
+
${({ size }) => {
|
|
86
|
+
if (size)
|
|
87
|
+
return getSize(size);
|
|
88
|
+
}};
|
|
89
|
+
|
|
90
|
+
${({ width, theme }) => {
|
|
91
|
+
if (typeof width === "string") {
|
|
92
|
+
return `
|
|
93
|
+
width: ${width};
|
|
94
|
+
`;
|
|
95
|
+
} else if (typeof width === "number") {
|
|
96
|
+
return `
|
|
97
|
+
width: ${width / 16}rem;
|
|
98
|
+
@media (min-width: ${theme.breakpoints?.small}) {
|
|
99
|
+
width: ${width / 13}rem;
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
}}
|
|
104
|
+
|
|
105
|
+
${({ height, theme }) => {
|
|
106
|
+
if (typeof height === "string") {
|
|
107
|
+
return `
|
|
108
|
+
height: ${height};
|
|
109
|
+
`;
|
|
110
|
+
} else if (typeof height === "number") {
|
|
111
|
+
return `
|
|
112
|
+
height: ${height / 16}rem;
|
|
113
|
+
@media (min-width: ${theme.breakpoints?.small}) {
|
|
114
|
+
height: ${height / 13}rem;
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
}}
|
|
119
|
+
`;
|
|
120
|
+
export {
|
|
121
|
+
StyledWrapper
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FlattenInterpolation, Theme } from '@elliemae/ds-system';\nimport { layout, sizing, space, css, styled, th } from '@elliemae/ds-system';\nimport type { DSSvgT } from './react-desc-prop-types.js';\nimport { DSSvgName, SVG_SLOTS } from './constants/index.js';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\n\nconst xxlSizes = css`\n width: 4rem;\n height: 4rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 4.923rem;\n height: 4.923rem;\n }\n`;\n\nconst xlSizes = css`\n width: 3rem;\n height: 3rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 3.692rem;\n height: 3.692rem;\n }\n`;\n\nconst lSizes = css`\n width: 2rem;\n height: 2rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 2.462rem;\n height: 2.462rem;\n }\n`;\n\nconst mSizes = css`\n width: 1.5rem;\n height: 1.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.846rem;\n height: 1.846rem;\n }\n`;\n\nconst sSizes = css`\n width: 1rem;\n height: 1rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.231rem;\n height: 1.231rem;\n }\n`;\n\nconst xsSizes = css`\n width: 0.5rem;\n height: 0.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.615rem;\n height: 0.615rem;\n }\n`;\n\nconst xxsSizes = css`\n width: 0.25rem;\n height: 0.25rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.308rem;\n height: 0.308rem;\n }\n`;\n\nconst standarSizes = css`\n ${sSizes}\n`;\n\nconst getSize = (\n size: DSSvgT.SizeType | undefined,\n): FlattenInterpolation<{\n theme: Theme;\n}> => {\n if (size === 'xxl') return xxlSizes;\n if (size === 'xl') return xlSizes;\n if (size === 'l') return lSizes;\n if (size === 'm') return mSizes;\n if (size === 's') return sSizes;\n if (size === 'xs') return xsSizes;\n if (size === 'xxs') return xxsSizes;\n return standarSizes;\n};\n\nexport const StyledWrapper = styled('svg', { name: DSSvgName, slot: SVG_SLOTS.ROOT })<\n { size?: DSSvgT.SizeType } & XstyledProps\n>`\n ${layout}\n ${space}\n ${sizing}\n\n ${({ size }) => {\n if (size) return getSize(size);\n }};\n\n ${({ width, theme }) => {\n if (typeof width === 'string') {\n return `\n width: ${width};\n `;\n } else if (typeof width === 'number') {\n return `\n width: ${width / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n width: ${width / 13}rem;\n }\n `;\n }\n }}\n\n ${({ height, theme }) => {\n if (typeof height === 'string') {\n return `\n height: ${height};\n `;\n } else if (typeof height === 'number') {\n return `\n height: ${height / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n height: ${height / 13}rem;\n }\n `;\n }\n }}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,QAAQ,OAAO,KAAK,QAAQ,UAAU;AAEvD,SAAS,WAAW,iBAAiB;AAGrC,MAAM,WAAW;AAAA;AAAA;AAAA,uBAGM,GAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,UAAU;AAAA;AAAA;AAAA,uBAGO,GAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,SAAS;AAAA;AAAA;AAAA,uBAGQ,GAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,SAAS;AAAA;AAAA;AAAA,uBAGQ,GAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,SAAS;AAAA;AAAA;AAAA,uBAGQ,GAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,UAAU;AAAA;AAAA;AAAA,uBAGO,GAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,WAAW;AAAA;AAAA;AAAA,uBAGM,GAAG,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAM5C,MAAM,eAAe;AAAA,IACjB;AAAA;AAGJ,MAAM,UAAU,CACd,SAGI;AACJ,MAAI,SAAS;AAAO,WAAO;AAC3B,MAAI,SAAS;AAAM,WAAO;AAC1B,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAM,WAAO;AAC1B,MAAI,SAAS;AAAO,WAAO;AAC3B,SAAO;AACT;AAEO,MAAM,gBAAgB,OAAO,OAAO,EAAE,MAAM,WAAW,MAAM,UAAU,KAAK,CAAC;AAAA,IAGhF;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA,CAAC,EAAE,KAAK,MAAM;AACd,MAAI;AAAM,WAAO,QAAQ,IAAI;AAC/B;AAAA;AAAA,IAEE,CAAC,EAAE,OAAO,MAAM,MAAM;AACtB,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,iBACI;AAAA;AAAA,EAEb,WAAW,OAAO,UAAU,UAAU;AACpC,WAAO;AAAA,iBACI,QAAQ;AAAA,6BACI,MAAM,aAAa;AAAA,mBAC7B,QAAQ;AAAA;AAAA;AAAA,EAGvB;AACF;AAAA;AAAA,IAEE,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,kBACK;AAAA;AAAA,EAEd,WAAW,OAAO,WAAW,UAAU;AACrC,WAAO;AAAA,kBACK,SAAS;AAAA,6BACE,MAAM,aAAa;AAAA,oBAC5B,SAAS;AAAA;AAAA;AAAA,EAGzB;AACF;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DSSvgT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const DSSvg: React.ComponentType<DSSvgT.Props>;
|
|
4
|
+
declare const DSSvgWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSSvgT.Props>;
|
|
5
|
+
export { DSSvg, DSSvgWithSchema };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import { type DSSvgT } from '../react-desc-prop-types.js';
|
|
3
|
+
export interface SvgCTX {
|
|
4
|
+
propsWithDefault: DSSvgT.InternalProps;
|
|
5
|
+
globalProps: ReturnType<typeof useGetGlobalAttributes>;
|
|
6
|
+
xstyledProps: ReturnType<typeof useGetXstyledProps>;
|
|
7
|
+
instanceUid: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const useSvg: (propsFromUser: DSSvgT.Props) => {
|
|
10
|
+
propsWithDefault: DSSvgT.InternalProps;
|
|
11
|
+
globalProps: import("@elliemae/ds-props-helpers").GlobalAttributesT<Element>;
|
|
12
|
+
xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
2
|
+
export declare namespace DSSvgT {
|
|
3
|
+
type SizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
|
4
|
+
interface RequiredProps {
|
|
5
|
+
viewBox: string;
|
|
6
|
+
}
|
|
7
|
+
interface DefaultProps {
|
|
8
|
+
focusable: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface OptionalProps {
|
|
11
|
+
size?: SizeType;
|
|
12
|
+
}
|
|
13
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<SVGElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
14
|
+
}
|
|
15
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<SVGElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultProps: DSSvgT.DefaultProps;
|
|
19
|
+
export declare const DSSvgPropTypes: DSPropTypesSchema<DSSvgT.Props>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Theme } from '@elliemae/ds-system';
|
|
2
|
+
import type { DSSvgT } from './react-desc-prop-types.js';
|
|
3
|
+
import type { XstyledProps } from '@elliemae/ds-props-helpers';
|
|
4
|
+
export declare const StyledWrapper: import("styled-components").StyledComponent<"svg", Theme, {
|
|
5
|
+
size?: DSSvgT.SizeType | undefined;
|
|
6
|
+
} & XstyledProps, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-svg",
|
|
3
|
+
"version": "3.16.0-next.17",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Svg",
|
|
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-system": "3.16.0-next.17",
|
|
39
|
+
"@elliemae/ds-props-helpers": "3.16.0-next.17",
|
|
40
|
+
"@xstyled/system": "~3.6.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@testing-library/jest-dom": "~5.16.5",
|
|
44
|
+
"@testing-library/react": "~12.1.3",
|
|
45
|
+
"jest-axe": "^7.0.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": "^17.0.2",
|
|
49
|
+
"react-dom": "^17.0.2",
|
|
50
|
+
"styled-components": "~5.3.6"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public",
|
|
54
|
+
"typeSafety": false
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
58
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
59
|
+
"lint": "node ../../scripts/lint.mjs --fix",
|
|
60
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
|
|
61
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
62
|
+
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
63
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
64
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
65
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
66
|
+
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
67
|
+
}
|
|
68
|
+
}
|