@elliemae/ds-header 3.0.0-next.2 → 3.0.0-next.6
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/Header.js +143 -0
- package/dist/cjs/Header.js.map +7 -0
- package/dist/cjs/index.js +28 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/esm/Header.js +116 -0
- package/dist/esm/Header.js.map +7 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +7 -0
- package/package.json +27 -18
- package/cjs/Header.js +0 -96
- package/cjs/index.js +0 -10
- package/esm/Header.js +0 -84
- package/esm/index.js +0 -1
- package/types/Header.d.ts +0 -167
- package/types/index.d.ts +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
|
+
var __objRest = (source, exclude) => {
|
|
23
|
+
var target = {};
|
|
24
|
+
for (var prop in source)
|
|
25
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
+
target[prop] = source[prop];
|
|
27
|
+
if (source != null && __getOwnPropSymbols)
|
|
28
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
+
target[prop] = source[prop];
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
var __export = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
37
|
+
};
|
|
38
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
39
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
40
|
+
for (let key of __getOwnPropNames(module2))
|
|
41
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
42
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
43
|
+
}
|
|
44
|
+
return target;
|
|
45
|
+
};
|
|
46
|
+
var __toESM = (module2, isNodeMode) => {
|
|
47
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
48
|
+
};
|
|
49
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
50
|
+
return (module2, temp) => {
|
|
51
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
52
|
+
};
|
|
53
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
54
|
+
var Header_exports = {};
|
|
55
|
+
__export(Header_exports, {
|
|
56
|
+
DSHeader: () => DSHeader,
|
|
57
|
+
HeaderWithSchema: () => HeaderWithSchema,
|
|
58
|
+
default: () => Header_default
|
|
59
|
+
});
|
|
60
|
+
var React = __toESM(require("react"));
|
|
61
|
+
var import_react = __toESM(require("react"));
|
|
62
|
+
var import_react_desc = require("react-desc");
|
|
63
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
64
|
+
var import_styled_components2 = require("@xstyled/styled-components");
|
|
65
|
+
const H = import_styled_components.default.h3`
|
|
66
|
+
font-weight: unset;
|
|
67
|
+
font-size: unset;
|
|
68
|
+
line-height: unset;
|
|
69
|
+
margin: 0;
|
|
70
|
+
padding: 0;
|
|
71
|
+
${import_styled_components2.space}
|
|
72
|
+
${import_styled_components2.sizing}
|
|
73
|
+
${import_styled_components2.typography}
|
|
74
|
+
`;
|
|
75
|
+
const DSHeader = (_a) => {
|
|
76
|
+
var _b = _a, {
|
|
77
|
+
color,
|
|
78
|
+
fontFamily,
|
|
79
|
+
fontSize,
|
|
80
|
+
fontWeight,
|
|
81
|
+
height,
|
|
82
|
+
level,
|
|
83
|
+
lineHeight,
|
|
84
|
+
text,
|
|
85
|
+
width
|
|
86
|
+
} = _b, rest = __objRest(_b, [
|
|
87
|
+
"color",
|
|
88
|
+
"fontFamily",
|
|
89
|
+
"fontSize",
|
|
90
|
+
"fontWeight",
|
|
91
|
+
"height",
|
|
92
|
+
"level",
|
|
93
|
+
"lineHeight",
|
|
94
|
+
"text",
|
|
95
|
+
"width"
|
|
96
|
+
]);
|
|
97
|
+
return /* @__PURE__ */ import_react.default.createElement(H, __spreadValues({
|
|
98
|
+
as: `h${level}`,
|
|
99
|
+
color,
|
|
100
|
+
fontFamily,
|
|
101
|
+
fontSize,
|
|
102
|
+
fontWeight,
|
|
103
|
+
h: height,
|
|
104
|
+
lineHeight,
|
|
105
|
+
w: width,
|
|
106
|
+
"data-testid": "em-ds-header"
|
|
107
|
+
}, rest), text);
|
|
108
|
+
};
|
|
109
|
+
DSHeader.defaultProps = {
|
|
110
|
+
level: 3,
|
|
111
|
+
lineHeight: 1.2
|
|
112
|
+
};
|
|
113
|
+
const headerProps = {
|
|
114
|
+
color: import_react_desc.PropTypes.string.description("Colors aliases from theme. I.e. `brand.400`"),
|
|
115
|
+
fontFamily: import_react_desc.PropTypes.string.description("font-family aliases from theme. I.e. `default`"),
|
|
116
|
+
fontSize: import_react_desc.PropTypes.string.description("any valid value format. I.e. `16px`"),
|
|
117
|
+
fontWeight: import_react_desc.PropTypes.string.description("any alias from theme. I.e. `semibold`"),
|
|
118
|
+
height: import_react_desc.PropTypes.string.description("any valid value format. I.e. `200px`"),
|
|
119
|
+
level: import_react_desc.PropTypes.oneOf([1, 2, 3, 4, 5, 6]).description("Depth of header tag. I.e. level `2` renders a h2 tag").defaultValue(2),
|
|
120
|
+
lineHeight: import_react_desc.PropTypes.number.description("float numbers for line-height. I.e. 1.5").defaultValue(1.2),
|
|
121
|
+
m: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin"),
|
|
122
|
+
mb: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-bottom"),
|
|
123
|
+
ml: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-left"),
|
|
124
|
+
mr: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-right"),
|
|
125
|
+
mt: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-top"),
|
|
126
|
+
mx: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin x"),
|
|
127
|
+
my: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin y"),
|
|
128
|
+
p: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding"),
|
|
129
|
+
pb: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-bottom"),
|
|
130
|
+
pl: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-left"),
|
|
131
|
+
pr: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-right"),
|
|
132
|
+
pt: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-top"),
|
|
133
|
+
px: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding x"),
|
|
134
|
+
py: import_react_desc.PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding y"),
|
|
135
|
+
text: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.element]).description("Header s text").isRequired,
|
|
136
|
+
width: import_react_desc.PropTypes.string.description("text width")
|
|
137
|
+
};
|
|
138
|
+
DSHeader.propTypes = headerProps;
|
|
139
|
+
const HeaderWithSchema = (0, import_react_desc.describe)(DSHeader);
|
|
140
|
+
HeaderWithSchema.propTypes = headerProps;
|
|
141
|
+
var Header_default = DSHeader;
|
|
142
|
+
module.exports = __toCommonJS(Header_exports);
|
|
143
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Header.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport styled from 'styled-components';\nimport { space, sizing, typography } from '@xstyled/styled-components';\n\nconst H = styled.h3`\n font-weight: unset;\n font-size: unset;\n line-height: unset;\n margin: 0;\n padding: 0;\n ${space}\n ${sizing}\n ${typography}\n`;\n\nconst DSHeader = ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n height,\n level,\n lineHeight,\n text,\n width,\n ...rest\n}) => (\n <H\n as={`h${level}`}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n h={height}\n lineHeight={lineHeight}\n w={width}\n data-testid=\"em-ds-header\"\n {...rest}\n >\n {text}\n </H>\n);\n\nDSHeader.defaultProps = {\n level: 3,\n lineHeight: 1.2,\n};\n\nconst headerProps = {\n color: PropTypes.string.description('Colors aliases from theme. I.e. `brand.400`'),\n fontFamily: PropTypes.string.description('font-family aliases from theme. I.e. `default`'),\n fontSize: PropTypes.string.description('any valid value format. I.e. `16px`'),\n fontWeight: PropTypes.string.description('any alias from theme. I.e. `semibold`'),\n height: PropTypes.string.description('any valid value format. I.e. `200px`'),\n level: PropTypes.oneOf([1, 2, 3, 4, 5, 6])\n .description('Depth of header tag. I.e. level `2` renders a h2 tag')\n .defaultValue(2),\n lineHeight: PropTypes.number.description('float numbers for line-height. I.e. 1.5').defaultValue(1.2),\n m: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin'),\n mb: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-bottom'),\n ml: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-left'),\n mr: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-right'),\n mt: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-top'),\n mx: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin x'),\n my: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin y'),\n p: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding'),\n pb: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-bottom'),\n pl: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-left'),\n pr: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-right'),\n pt: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-top'),\n px: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding x'),\n py: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding y'),\n text: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('Header s text').isRequired,\n width: PropTypes.string.description('text width'),\n};\n\nDSHeader.propTypes = headerProps;\n\nconst HeaderWithSchema = describe(DSHeader);\nHeaderWithSchema.propTypes = headerProps;\n\nexport { DSHeader, HeaderWithSchema };\nexport default DSHeader;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAoC;AACpC,+BAAmB;AACnB,gCAA0C;AAE1C,MAAM,IAAI,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMb;AAAA,IACA;AAAA,IACA;AAAA;AAGJ,MAAM,WAAW,CAAC,OAWf;AAXe,eAChB;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MATgB,IAUb,iBAVa,IAUb;AAAA,IATH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,4DAAC,GAAD;AAAA,IACE,IAAI,IAAI;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,I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AAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,QAAQ,YAAY;AAAA,EAC3E,IAAI,4BAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,QAAQ,YAAY;AAAA,EAC3E,IAAI,4BAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,QAAQ,YAAY;AAAA,EAC3E,IAAI,4BAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,QAAQ,YAAY;AAAA,EAC3E,IAAI,4BAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,QAAQ,YAAY;AAAA,EAC3E,IAAI,4BAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,QAAQ,YAAY;AAAA,EAC3E,MAAM,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,UAAU,YAAY,iBAAiB;AAAA,EAC9F,OAAO,4BAAU,OAAO,YAAY;AAAA;AAGtC,SAAS,YAAY;AAErB,MAAM,mBAAmB,gCAAS;AAClC,iBAAiB,YAAY;AAG7B,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(module2))
|
|
11
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (module2, isNodeMode) => {
|
|
17
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
+
return (module2, temp) => {
|
|
21
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
+
};
|
|
23
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
+
var src_exports = {};
|
|
25
|
+
var React = __toESM(require("react"));
|
|
26
|
+
__reExport(src_exports, require("./Header"));
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './Header';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;ADAvB,wBAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import * as React from "react";
|
|
30
|
+
import React2 from "react";
|
|
31
|
+
import { describe, PropTypes } from "react-desc";
|
|
32
|
+
import styled from "styled-components";
|
|
33
|
+
import { space, sizing, typography } from "@xstyled/styled-components";
|
|
34
|
+
const H = styled.h3`
|
|
35
|
+
font-weight: unset;
|
|
36
|
+
font-size: unset;
|
|
37
|
+
line-height: unset;
|
|
38
|
+
margin: 0;
|
|
39
|
+
padding: 0;
|
|
40
|
+
${space}
|
|
41
|
+
${sizing}
|
|
42
|
+
${typography}
|
|
43
|
+
`;
|
|
44
|
+
const DSHeader = (_a) => {
|
|
45
|
+
var _b = _a, {
|
|
46
|
+
color,
|
|
47
|
+
fontFamily,
|
|
48
|
+
fontSize,
|
|
49
|
+
fontWeight,
|
|
50
|
+
height,
|
|
51
|
+
level,
|
|
52
|
+
lineHeight,
|
|
53
|
+
text,
|
|
54
|
+
width
|
|
55
|
+
} = _b, rest = __objRest(_b, [
|
|
56
|
+
"color",
|
|
57
|
+
"fontFamily",
|
|
58
|
+
"fontSize",
|
|
59
|
+
"fontWeight",
|
|
60
|
+
"height",
|
|
61
|
+
"level",
|
|
62
|
+
"lineHeight",
|
|
63
|
+
"text",
|
|
64
|
+
"width"
|
|
65
|
+
]);
|
|
66
|
+
return /* @__PURE__ */ React2.createElement(H, __spreadValues({
|
|
67
|
+
as: `h${level}`,
|
|
68
|
+
color,
|
|
69
|
+
fontFamily,
|
|
70
|
+
fontSize,
|
|
71
|
+
fontWeight,
|
|
72
|
+
h: height,
|
|
73
|
+
lineHeight,
|
|
74
|
+
w: width,
|
|
75
|
+
"data-testid": "em-ds-header"
|
|
76
|
+
}, rest), text);
|
|
77
|
+
};
|
|
78
|
+
DSHeader.defaultProps = {
|
|
79
|
+
level: 3,
|
|
80
|
+
lineHeight: 1.2
|
|
81
|
+
};
|
|
82
|
+
const headerProps = {
|
|
83
|
+
color: PropTypes.string.description("Colors aliases from theme. I.e. `brand.400`"),
|
|
84
|
+
fontFamily: PropTypes.string.description("font-family aliases from theme. I.e. `default`"),
|
|
85
|
+
fontSize: PropTypes.string.description("any valid value format. I.e. `16px`"),
|
|
86
|
+
fontWeight: PropTypes.string.description("any alias from theme. I.e. `semibold`"),
|
|
87
|
+
height: PropTypes.string.description("any valid value format. I.e. `200px`"),
|
|
88
|
+
level: PropTypes.oneOf([1, 2, 3, 4, 5, 6]).description("Depth of header tag. I.e. level `2` renders a h2 tag").defaultValue(2),
|
|
89
|
+
lineHeight: PropTypes.number.description("float numbers for line-height. I.e. 1.5").defaultValue(1.2),
|
|
90
|
+
m: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin"),
|
|
91
|
+
mb: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-bottom"),
|
|
92
|
+
ml: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-left"),
|
|
93
|
+
mr: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-right"),
|
|
94
|
+
mt: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin-top"),
|
|
95
|
+
mx: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin x"),
|
|
96
|
+
my: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("margin y"),
|
|
97
|
+
p: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding"),
|
|
98
|
+
pb: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-bottom"),
|
|
99
|
+
pl: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-left"),
|
|
100
|
+
pr: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-right"),
|
|
101
|
+
pt: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding-top"),
|
|
102
|
+
px: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding x"),
|
|
103
|
+
py: PropTypes.oneOf(["xxs", "xs", "s", "m", "l", "xl", "xxl"]).description("padding y"),
|
|
104
|
+
text: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description("Header s text").isRequired,
|
|
105
|
+
width: PropTypes.string.description("text width")
|
|
106
|
+
};
|
|
107
|
+
DSHeader.propTypes = headerProps;
|
|
108
|
+
const HeaderWithSchema = describe(DSHeader);
|
|
109
|
+
HeaderWithSchema.propTypes = headerProps;
|
|
110
|
+
var Header_default = DSHeader;
|
|
111
|
+
export {
|
|
112
|
+
DSHeader,
|
|
113
|
+
HeaderWithSchema,
|
|
114
|
+
Header_default as default
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/Header.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport styled from 'styled-components';\nimport { space, sizing, typography } from '@xstyled/styled-components';\n\nconst H = styled.h3`\n font-weight: unset;\n font-size: unset;\n line-height: unset;\n margin: 0;\n padding: 0;\n ${space}\n ${sizing}\n ${typography}\n`;\n\nconst DSHeader = ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n height,\n level,\n lineHeight,\n text,\n width,\n ...rest\n}) => (\n <H\n as={`h${level}`}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n h={height}\n lineHeight={lineHeight}\n w={width}\n data-testid=\"em-ds-header\"\n {...rest}\n >\n {text}\n </H>\n);\n\nDSHeader.defaultProps = {\n level: 3,\n lineHeight: 1.2,\n};\n\nconst headerProps = {\n color: PropTypes.string.description('Colors aliases from theme. I.e. `brand.400`'),\n fontFamily: PropTypes.string.description('font-family aliases from theme. I.e. `default`'),\n fontSize: PropTypes.string.description('any valid value format. I.e. `16px`'),\n fontWeight: PropTypes.string.description('any alias from theme. I.e. `semibold`'),\n height: PropTypes.string.description('any valid value format. I.e. `200px`'),\n level: PropTypes.oneOf([1, 2, 3, 4, 5, 6])\n .description('Depth of header tag. I.e. level `2` renders a h2 tag')\n .defaultValue(2),\n lineHeight: PropTypes.number.description('float numbers for line-height. I.e. 1.5').defaultValue(1.2),\n m: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin'),\n mb: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-bottom'),\n ml: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-left'),\n mr: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-right'),\n mt: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-top'),\n mx: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin x'),\n my: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin y'),\n p: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding'),\n pb: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-bottom'),\n pl: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-left'),\n pr: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-right'),\n pt: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-top'),\n px: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding x'),\n py: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding y'),\n text: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('Header s text').isRequired,\n width: PropTypes.string.description('text width'),\n};\n\nDSHeader.propTypes = headerProps;\n\nconst HeaderWithSchema = describe(DSHeader);\nHeaderWithSchema.propTypes = headerProps;\n\nexport { DSHeader, HeaderWithSchema };\nexport default DSHeader;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AAEA,MAAM,IAAI,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMb;AAAA,IACA;AAAA,IACA;AAAA;AAGJ,MAAM,WAAW,CAAC,OAWf;AAXe,eAChB;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./cjs/index.js"
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
13
16
|
},
|
|
14
17
|
"./Header": {
|
|
15
|
-
"import": "./esm/Header.js",
|
|
16
|
-
"require": "./cjs/Header.js"
|
|
18
|
+
"import": "./dist/esm/Header.js",
|
|
19
|
+
"require": "./dist/cjs/Header.js"
|
|
17
20
|
}
|
|
18
21
|
},
|
|
19
22
|
"sideEffects": [
|
|
@@ -25,18 +28,18 @@
|
|
|
25
28
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
26
29
|
},
|
|
27
30
|
"engines": {
|
|
28
|
-
"
|
|
29
|
-
"node": ">=
|
|
31
|
+
"pnpm": ">=6",
|
|
32
|
+
"node": ">=16"
|
|
30
33
|
},
|
|
31
34
|
"author": "ICE MT",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
35
|
+
"jestSonar": {
|
|
36
|
+
"sonar56x": true,
|
|
37
|
+
"reportPath": "reports",
|
|
38
|
+
"reportFile": "tests.xml",
|
|
39
|
+
"indent": 4
|
|
37
40
|
},
|
|
38
41
|
"dependencies": {
|
|
39
|
-
"@xstyled/styled-components": "~3.1.
|
|
42
|
+
"@xstyled/styled-components": "~3.1.2",
|
|
40
43
|
"react-desc": "~4.1.3"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
@@ -51,7 +54,13 @@
|
|
|
51
54
|
},
|
|
52
55
|
"publishConfig": {
|
|
53
56
|
"access": "public",
|
|
54
|
-
"
|
|
55
|
-
|
|
57
|
+
"typeSafety": false
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
61
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
62
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
63
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
64
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
56
65
|
}
|
|
57
66
|
}
|
package/cjs/Header.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
12
|
-
require('react');
|
|
13
|
-
var reactDesc = require('react-desc');
|
|
14
|
-
var styled = require('styled-components');
|
|
15
|
-
var styledComponents = require('@xstyled/styled-components');
|
|
16
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
17
|
-
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
22
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
23
|
-
|
|
24
|
-
const _excluded = ["color", "fontFamily", "fontSize", "fontWeight", "height", "level", "lineHeight", "text", "width"];
|
|
25
|
-
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
const H = /*#__PURE__*/styled__default["default"].h3.withConfig({
|
|
30
|
-
componentId: "sc-hpgkwz-0"
|
|
31
|
-
})(["font-weight:unset;font-size:unset;line-height:unset;margin:0;padding:0;", " ", " ", ""], styledComponents.space, styledComponents.sizing, styledComponents.typography);
|
|
32
|
-
|
|
33
|
-
const DSHeader = _ref => {
|
|
34
|
-
let {
|
|
35
|
-
color,
|
|
36
|
-
fontFamily,
|
|
37
|
-
fontSize,
|
|
38
|
-
fontWeight,
|
|
39
|
-
height,
|
|
40
|
-
level,
|
|
41
|
-
lineHeight,
|
|
42
|
-
text,
|
|
43
|
-
width
|
|
44
|
-
} = _ref,
|
|
45
|
-
rest = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/jsxRuntime.jsx(H, _objectSpread(_objectSpread({
|
|
48
|
-
as: "h".concat(level),
|
|
49
|
-
color: color,
|
|
50
|
-
fontFamily: fontFamily,
|
|
51
|
-
fontSize: fontSize,
|
|
52
|
-
fontWeight: fontWeight,
|
|
53
|
-
h: height,
|
|
54
|
-
lineHeight: lineHeight,
|
|
55
|
-
w: width,
|
|
56
|
-
"data-testid": "em-ds-header"
|
|
57
|
-
}, rest), {}, {
|
|
58
|
-
children: text
|
|
59
|
-
}));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
DSHeader.defaultProps = {
|
|
63
|
-
level: 3,
|
|
64
|
-
lineHeight: 1.2
|
|
65
|
-
};
|
|
66
|
-
const headerProps = {
|
|
67
|
-
color: reactDesc.PropTypes.string.description('Colors aliases from theme. I.e. `brand.400`'),
|
|
68
|
-
fontFamily: reactDesc.PropTypes.string.description('font-family aliases from theme. I.e. `default`'),
|
|
69
|
-
fontSize: reactDesc.PropTypes.string.description('any valid value format. I.e. `16px`'),
|
|
70
|
-
fontWeight: reactDesc.PropTypes.string.description('any alias from theme. I.e. `semibold`'),
|
|
71
|
-
height: reactDesc.PropTypes.string.description('any valid value format. I.e. `200px`'),
|
|
72
|
-
level: reactDesc.PropTypes.oneOf([1, 2, 3, 4, 5, 6]).description('Depth of header tag. I.e. level `2` renders a h2 tag').defaultValue(2),
|
|
73
|
-
lineHeight: reactDesc.PropTypes.number.description('float numbers for line-height. I.e. 1.5').defaultValue(1.2),
|
|
74
|
-
m: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin'),
|
|
75
|
-
mb: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-bottom'),
|
|
76
|
-
ml: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-left'),
|
|
77
|
-
mr: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-right'),
|
|
78
|
-
mt: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-top'),
|
|
79
|
-
mx: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin x'),
|
|
80
|
-
my: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin y'),
|
|
81
|
-
p: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding'),
|
|
82
|
-
pb: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-bottom'),
|
|
83
|
-
pl: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-left'),
|
|
84
|
-
pr: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-right'),
|
|
85
|
-
pt: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-top'),
|
|
86
|
-
px: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding x'),
|
|
87
|
-
py: reactDesc.PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding y'),
|
|
88
|
-
text: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.element]).description('Header s text').isRequired,
|
|
89
|
-
width: reactDesc.PropTypes.string.description('text width')
|
|
90
|
-
};
|
|
91
|
-
const HeaderWithSchema = reactDesc.describe(DSHeader);
|
|
92
|
-
HeaderWithSchema.propTypes = headerProps;
|
|
93
|
-
|
|
94
|
-
exports.DSHeader = DSHeader;
|
|
95
|
-
exports.HeaderWithSchema = HeaderWithSchema;
|
|
96
|
-
exports["default"] = DSHeader;
|
package/cjs/index.js
DELETED
package/esm/Header.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
-
import 'react';
|
|
9
|
-
import { PropTypes, describe } from 'react-desc';
|
|
10
|
-
import styled from 'styled-components';
|
|
11
|
-
import { space, sizing, typography } from '@xstyled/styled-components';
|
|
12
|
-
import { jsx } from 'react/jsx-runtime';
|
|
13
|
-
|
|
14
|
-
const _excluded = ["color", "fontFamily", "fontSize", "fontWeight", "height", "level", "lineHeight", "text", "width"];
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
const H = /*#__PURE__*/styled.h3.withConfig({
|
|
20
|
-
componentId: "sc-hpgkwz-0"
|
|
21
|
-
})(["font-weight:unset;font-size:unset;line-height:unset;margin:0;padding:0;", " ", " ", ""], space, sizing, typography);
|
|
22
|
-
|
|
23
|
-
const DSHeader = _ref => {
|
|
24
|
-
let {
|
|
25
|
-
color,
|
|
26
|
-
fontFamily,
|
|
27
|
-
fontSize,
|
|
28
|
-
fontWeight,
|
|
29
|
-
height,
|
|
30
|
-
level,
|
|
31
|
-
lineHeight,
|
|
32
|
-
text,
|
|
33
|
-
width
|
|
34
|
-
} = _ref,
|
|
35
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
-
|
|
37
|
-
return /*#__PURE__*/jsx(H, _objectSpread(_objectSpread({
|
|
38
|
-
as: "h".concat(level),
|
|
39
|
-
color: color,
|
|
40
|
-
fontFamily: fontFamily,
|
|
41
|
-
fontSize: fontSize,
|
|
42
|
-
fontWeight: fontWeight,
|
|
43
|
-
h: height,
|
|
44
|
-
lineHeight: lineHeight,
|
|
45
|
-
w: width,
|
|
46
|
-
"data-testid": "em-ds-header"
|
|
47
|
-
}, rest), {}, {
|
|
48
|
-
children: text
|
|
49
|
-
}));
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
DSHeader.defaultProps = {
|
|
53
|
-
level: 3,
|
|
54
|
-
lineHeight: 1.2
|
|
55
|
-
};
|
|
56
|
-
const headerProps = {
|
|
57
|
-
color: PropTypes.string.description('Colors aliases from theme. I.e. `brand.400`'),
|
|
58
|
-
fontFamily: PropTypes.string.description('font-family aliases from theme. I.e. `default`'),
|
|
59
|
-
fontSize: PropTypes.string.description('any valid value format. I.e. `16px`'),
|
|
60
|
-
fontWeight: PropTypes.string.description('any alias from theme. I.e. `semibold`'),
|
|
61
|
-
height: PropTypes.string.description('any valid value format. I.e. `200px`'),
|
|
62
|
-
level: PropTypes.oneOf([1, 2, 3, 4, 5, 6]).description('Depth of header tag. I.e. level `2` renders a h2 tag').defaultValue(2),
|
|
63
|
-
lineHeight: PropTypes.number.description('float numbers for line-height. I.e. 1.5').defaultValue(1.2),
|
|
64
|
-
m: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin'),
|
|
65
|
-
mb: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-bottom'),
|
|
66
|
-
ml: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-left'),
|
|
67
|
-
mr: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-right'),
|
|
68
|
-
mt: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin-top'),
|
|
69
|
-
mx: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin x'),
|
|
70
|
-
my: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('margin y'),
|
|
71
|
-
p: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding'),
|
|
72
|
-
pb: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-bottom'),
|
|
73
|
-
pl: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-left'),
|
|
74
|
-
pr: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-right'),
|
|
75
|
-
pt: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding-top'),
|
|
76
|
-
px: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding x'),
|
|
77
|
-
py: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('padding y'),
|
|
78
|
-
text: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('Header s text').isRequired,
|
|
79
|
-
width: PropTypes.string.description('text width')
|
|
80
|
-
};
|
|
81
|
-
const HeaderWithSchema = describe(DSHeader);
|
|
82
|
-
HeaderWithSchema.propTypes = headerProps;
|
|
83
|
-
|
|
84
|
-
export { DSHeader, HeaderWithSchema, DSHeader as default };
|
package/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DSHeader, HeaderWithSchema } from './Header.js';
|
package/types/Header.d.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
declare const DSHeader: {
|
|
4
|
-
({ color, fontFamily, fontSize, fontWeight, height, level, lineHeight, text, width, ...rest }: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
color: any;
|
|
7
|
-
fontFamily: any;
|
|
8
|
-
fontSize: any;
|
|
9
|
-
fontWeight: any;
|
|
10
|
-
height: any;
|
|
11
|
-
level: any;
|
|
12
|
-
lineHeight: any;
|
|
13
|
-
text: any;
|
|
14
|
-
width: any;
|
|
15
|
-
}): JSX.Element;
|
|
16
|
-
defaultProps: {
|
|
17
|
-
level: number;
|
|
18
|
-
lineHeight: number;
|
|
19
|
-
};
|
|
20
|
-
propTypes: {
|
|
21
|
-
color: {
|
|
22
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
23
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
24
|
-
};
|
|
25
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
26
|
-
};
|
|
27
|
-
fontFamily: {
|
|
28
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
29
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
30
|
-
};
|
|
31
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
32
|
-
};
|
|
33
|
-
fontSize: {
|
|
34
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
35
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
36
|
-
};
|
|
37
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
38
|
-
};
|
|
39
|
-
fontWeight: {
|
|
40
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
41
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
42
|
-
};
|
|
43
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
44
|
-
};
|
|
45
|
-
height: {
|
|
46
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
47
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
48
|
-
};
|
|
49
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
50
|
-
};
|
|
51
|
-
level: {
|
|
52
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
53
|
-
};
|
|
54
|
-
lineHeight: {
|
|
55
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
56
|
-
};
|
|
57
|
-
m: {
|
|
58
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
59
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
60
|
-
};
|
|
61
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
62
|
-
};
|
|
63
|
-
mb: {
|
|
64
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
65
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
66
|
-
};
|
|
67
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
68
|
-
};
|
|
69
|
-
ml: {
|
|
70
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
71
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
72
|
-
};
|
|
73
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
74
|
-
};
|
|
75
|
-
mr: {
|
|
76
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
77
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
78
|
-
};
|
|
79
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
80
|
-
};
|
|
81
|
-
mt: {
|
|
82
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
83
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
84
|
-
};
|
|
85
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
86
|
-
};
|
|
87
|
-
mx: {
|
|
88
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
89
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
90
|
-
};
|
|
91
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
92
|
-
};
|
|
93
|
-
my: {
|
|
94
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
95
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
96
|
-
};
|
|
97
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
98
|
-
};
|
|
99
|
-
p: {
|
|
100
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
101
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
102
|
-
};
|
|
103
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
104
|
-
};
|
|
105
|
-
pb: {
|
|
106
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
107
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
108
|
-
};
|
|
109
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
110
|
-
};
|
|
111
|
-
pl: {
|
|
112
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
113
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
114
|
-
};
|
|
115
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
116
|
-
};
|
|
117
|
-
pr: {
|
|
118
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
119
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
120
|
-
};
|
|
121
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
122
|
-
};
|
|
123
|
-
pt: {
|
|
124
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
125
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
126
|
-
};
|
|
127
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
128
|
-
};
|
|
129
|
-
px: {
|
|
130
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
131
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
132
|
-
};
|
|
133
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
134
|
-
};
|
|
135
|
-
py: {
|
|
136
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
137
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
138
|
-
};
|
|
139
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
140
|
-
};
|
|
141
|
-
text: import("react-desc").PropTypesDescValue;
|
|
142
|
-
width: {
|
|
143
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
144
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
145
|
-
};
|
|
146
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
declare const HeaderWithSchema: {
|
|
151
|
-
(props?: {
|
|
152
|
-
[x: string]: any;
|
|
153
|
-
color: any;
|
|
154
|
-
fontFamily: any;
|
|
155
|
-
fontSize: any;
|
|
156
|
-
fontWeight: any;
|
|
157
|
-
height: any;
|
|
158
|
-
level: any;
|
|
159
|
-
lineHeight: any;
|
|
160
|
-
text: any;
|
|
161
|
-
width: any;
|
|
162
|
-
} | undefined): JSX.Element;
|
|
163
|
-
propTypes: unknown;
|
|
164
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
165
|
-
};
|
|
166
|
-
export { DSHeader, HeaderWithSchema };
|
|
167
|
-
export default DSHeader;
|
package/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Header';
|