@elliemae/ds-hooks-fontsize-media 3.22.0-next.15
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/DSHooksFontsizeMedia.js +47 -0
- package/dist/cjs/DSHooksFontsizeMedia.js.map +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +28 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/esm/DSHooksFontsizeMedia.js +17 -0
- package/dist/esm/DSHooksFontsizeMedia.js.map +7 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +2 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/types/DSHooksFontsizeMedia.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +12 -0
- package/package.json +70 -0
|
@@ -0,0 +1,47 @@
|
|
|
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 DSHooksFontsizeMedia_exports = {};
|
|
30
|
+
__export(DSHooksFontsizeMedia_exports, {
|
|
31
|
+
useFontsizeMedia: () => useFontsizeMedia
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(DSHooksFontsizeMedia_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_hooks_fontsize_detector = require("@elliemae/ds-hooks-fontsize-detector");
|
|
36
|
+
const useFontsizeMedia = (props) => {
|
|
37
|
+
const metaInfo = (0, import_ds_hooks_fontsize_detector.useFontSizeDetector)();
|
|
38
|
+
const { smallFont, mediumFont, largeFont } = props;
|
|
39
|
+
if (metaInfo.isLarge) {
|
|
40
|
+
return largeFont || mediumFont || smallFont;
|
|
41
|
+
} else if (metaInfo.isMedium) {
|
|
42
|
+
return mediumFont || smallFont;
|
|
43
|
+
} else {
|
|
44
|
+
return smallFont || [1];
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=DSHooksFontsizeMedia.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSHooksFontsizeMedia.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useFontSizeDetector } from '@elliemae/ds-hooks-fontsize-detector';\nimport { type DSHooksFontsizeMediaT } from './react-desc-prop-types.js';\n\nconst useFontsizeMedia = (props: DSHooksFontsizeMediaT.Props) => {\n const metaInfo = useFontSizeDetector();\n const { smallFont, mediumFont, largeFont } = props;\n\n if (metaInfo.isLarge) {\n return largeFont || mediumFont || smallFont;\n } else if (metaInfo.isMedium) {\n return mediumFont || smallFont;\n } else {\n return smallFont || [1];\n }\n};\n\nexport { useFontsizeMedia };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wCAAoC;AAGpC,MAAM,mBAAmB,CAAC,UAAuC;AAC/D,QAAM,eAAW,uDAAoB;AACrC,QAAM,EAAE,WAAW,YAAY,UAAU,IAAI;AAE7C,MAAI,SAAS,SAAS;AACpB,WAAO,aAAa,cAAc;AAAA,EACpC,WAAW,SAAS,UAAU;AAC5B,WAAO,cAAc;AAAA,EACvB,OAAO;AACL,WAAO,aAAa,CAAC,CAAC;AAAA,EACxB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
useFontsizeMedia: () => import_DSHooksFontsizeMedia.useFontsizeMedia
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_DSHooksFontsizeMedia = require("./DSHooksFontsizeMedia.js");
|
|
36
|
+
//# 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 { useFontsizeMedia } from './DSHooksFontsizeMedia.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,kCAAiC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var react_desc_prop_types_exports = {};
|
|
26
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
27
|
+
var React = __toESM(require("react"));
|
|
28
|
+
//# 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 */\n\nexport declare namespace DSHooksFontsizeMediaT {\n interface RowColBreakpoints {\n small?: string | number | (string | number)[];\n medium?: string | number | (string | number)[];\n large?: string | number | (string | number)[];\n }\n interface Props {\n smallFont?: string[] | string | number[] | RowColBreakpoints | Record<string, unknown>;\n mediumFont?: string[] | string | number[] | RowColBreakpoints | Record<string, unknown>;\n largeFont?: string[] | string | number[] | RowColBreakpoints | Record<string, unknown>;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useFontSizeDetector } from "@elliemae/ds-hooks-fontsize-detector";
|
|
3
|
+
const useFontsizeMedia = (props) => {
|
|
4
|
+
const metaInfo = useFontSizeDetector();
|
|
5
|
+
const { smallFont, mediumFont, largeFont } = props;
|
|
6
|
+
if (metaInfo.isLarge) {
|
|
7
|
+
return largeFont || mediumFont || smallFont;
|
|
8
|
+
} else if (metaInfo.isMedium) {
|
|
9
|
+
return mediumFont || smallFont;
|
|
10
|
+
} else {
|
|
11
|
+
return smallFont || [1];
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
useFontsizeMedia
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=DSHooksFontsizeMedia.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSHooksFontsizeMedia.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useFontSizeDetector } from '@elliemae/ds-hooks-fontsize-detector';\nimport { type DSHooksFontsizeMediaT } from './react-desc-prop-types.js';\n\nconst useFontsizeMedia = (props: DSHooksFontsizeMediaT.Props) => {\n const metaInfo = useFontSizeDetector();\n const { smallFont, mediumFont, largeFont } = props;\n\n if (metaInfo.isLarge) {\n return largeFont || mediumFont || smallFont;\n } else if (metaInfo.isMedium) {\n return mediumFont || smallFont;\n } else {\n return smallFont || [1];\n }\n};\n\nexport { useFontsizeMedia };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B;AAGpC,MAAM,mBAAmB,CAAC,UAAuC;AAC/D,QAAM,WAAW,oBAAoB;AACrC,QAAM,EAAE,WAAW,YAAY,UAAU,IAAI;AAE7C,MAAI,SAAS,SAAS;AACpB,WAAO,aAAa,cAAc;AAAA,EACpC,WAAW,SAAS,UAAU;AAC5B,WAAO,cAAc;AAAA,EACvB,OAAO;AACL,WAAO,aAAa,CAAC,CAAC;AAAA,EACxB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -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 { useFontsizeMedia } from './DSHooksFontsizeMedia.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,wBAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type DSHooksFontsizeMediaT } from './react-desc-prop-types.js';
|
|
2
|
+
declare const useFontsizeMedia: (props: DSHooksFontsizeMediaT.Props) => string | DSHooksFontsizeMediaT.RowColBreakpoints | Record<string, unknown> | string[] | number[] | undefined;
|
|
3
|
+
export { useFontsizeMedia };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFontsizeMedia } from './DSHooksFontsizeMedia.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare namespace DSHooksFontsizeMediaT {
|
|
2
|
+
interface RowColBreakpoints {
|
|
3
|
+
small?: string | number | (string | number)[];
|
|
4
|
+
medium?: string | number | (string | number)[];
|
|
5
|
+
large?: string | number | (string | number)[];
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
smallFont?: string[] | string | number[] | RowColBreakpoints | Record<string, unknown>;
|
|
9
|
+
mediumFont?: string[] | string | number[] | RowColBreakpoints | Record<string, unknown>;
|
|
10
|
+
largeFont?: string[] | string | number[] | RowColBreakpoints | Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-hooks-fontsize-media",
|
|
3
|
+
"version": "3.22.0-next.15",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Hooks Font Size Media",
|
|
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-hooks-fontsize-detector": "3.22.0-next.15"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@testing-library/react": "~12.1.3",
|
|
42
|
+
"@testing-library/user-event": "~13.5.0",
|
|
43
|
+
"styled-components": "~5.3.9",
|
|
44
|
+
"styled-system": "~5.1.5"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"lodash": "^4.17.21",
|
|
48
|
+
"react": "~17.0.2",
|
|
49
|
+
"react-dom": "^17.0.2",
|
|
50
|
+
"styled-components": "~5.3.9",
|
|
51
|
+
"styled-system": "^5.1.5"
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public",
|
|
55
|
+
"typeSafety": false
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
59
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
60
|
+
"lint": "node ../../scripts/lint.mjs --fix",
|
|
61
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
|
|
62
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
63
|
+
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
64
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
65
|
+
"versionx": "node ../../scripts/setup/switch-to-workspace-version.js",
|
|
66
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
67
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
68
|
+
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
69
|
+
}
|
|
70
|
+
}
|