@elliemae/ds-legacy-system 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/arithmetic.js +61 -0
- package/dist/cjs/arithmetic.js.map +7 -0
- package/dist/cjs/constants.js +48 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/globalStyles.js +66 -0
- package/dist/cjs/globalStyles.js.map +7 -0
- package/dist/cjs/index.js +53 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/mobileUtilities.js +71 -0
- package/dist/cjs/mobileUtilities.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/spaceUtilities.js +97 -0
- package/dist/cjs/spaceUtilities.js.map +7 -0
- package/dist/cjs/styled/checkNamingConvention.js +49 -0
- package/dist/cjs/styled/checkNamingConvention.js.map +7 -0
- package/dist/cjs/styled/coerceWithDefaultTheme.js +46 -0
- package/dist/cjs/styled/coerceWithDefaultTheme.js.map +7 -0
- package/dist/cjs/styled/expressions/genStyleOverridesExpression.js +44 -0
- package/dist/cjs/styled/expressions/genStyleOverridesExpression.js.map +7 -0
- package/dist/cjs/styled/expressions/genVariantOverridesExpression.js +63 -0
- package/dist/cjs/styled/expressions/genVariantOverridesExpression.js.map +7 -0
- package/dist/cjs/styled/expressions/index.js +38 -0
- package/dist/cjs/styled/expressions/index.js.map +7 -0
- package/dist/cjs/styled/fixStyleArg.js +48 -0
- package/dist/cjs/styled/fixStyleArg.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/generateAttributes.js +71 -0
- package/dist/cjs/styled/generated-attributes/generateAttributes.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/generateAutoCalculated.js +42 -0
- package/dist/cjs/styled/generated-attributes/generateAutoCalculated.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/generateDisplayName.js +41 -0
- package/dist/cjs/styled/generated-attributes/generateDisplayName.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/index.js +36 -0
- package/dist/cjs/styled/generated-attributes/index.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/utils/callbackMerger.js +50 -0
- package/dist/cjs/styled/generated-attributes/utils/callbackMerger.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/utils/refMerger.js +54 -0
- package/dist/cjs/styled/generated-attributes/utils/refMerger.js.map +7 -0
- package/dist/cjs/styled/helpers.js +57 -0
- package/dist/cjs/styled/helpers.js.map +7 -0
- package/dist/cjs/styled/index.js +55 -0
- package/dist/cjs/styled/index.js.map +7 -0
- package/dist/cjs/styled/styled.js +38 -0
- package/dist/cjs/styled/styled.js.map +7 -0
- package/dist/cjs/styled/styledFunction.js +78 -0
- package/dist/cjs/styled/styledFunction.js.map +7 -0
- package/dist/cjs/styled/styledObject.js +42 -0
- package/dist/cjs/styled/styledObject.js.map +7 -0
- package/dist/cjs/styled/system-types.js +28 -0
- package/dist/cjs/styled/system-types.js.map +7 -0
- package/dist/cjs/styled/system-utilities/background.js +45 -0
- package/dist/cjs/styled/system-utilities/background.js.map +7 -0
- package/dist/cjs/styled/system-utilities/border.js +188 -0
- package/dist/cjs/styled/system-utilities/border.js.map +7 -0
- package/dist/cjs/styled/system-utilities/color.js +47 -0
- package/dist/cjs/styled/system-utilities/color.js.map +7 -0
- package/dist/cjs/styled/system-utilities/index.js +50 -0
- package/dist/cjs/styled/system-utilities/index.js.map +7 -0
- package/dist/cjs/styled/system-utilities/sizing.js +67 -0
- package/dist/cjs/styled/system-utilities/sizing.js.map +7 -0
- package/dist/cjs/styled/system-utilities/space.js +37 -0
- package/dist/cjs/styled/system-utilities/space.js.map +7 -0
- package/dist/cjs/styled/system.js +40 -0
- package/dist/cjs/styled/system.js.map +7 -0
- package/dist/cjs/styled/transformers/index.js +36 -0
- package/dist/cjs/styled/transformers/index.js.map +7 -0
- package/dist/cjs/styled/transformers/magicCssTransform.js +66 -0
- package/dist/cjs/styled/transformers/magicCssTransform.js.map +7 -0
- package/dist/cjs/styled/types.js +28 -0
- package/dist/cjs/styled/types.js.map +7 -0
- package/dist/cjs/th.js +86 -0
- package/dist/cjs/th.js.map +7 -0
- package/dist/cjs/theme.js +37 -0
- package/dist/cjs/theme.js.map +7 -0
- package/dist/cjs/themeProviderHOC.js +42 -0
- package/dist/cjs/themeProviderHOC.js.map +7 -0
- package/dist/cjs/utils.js +292 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/xStyledWrapper.js +62 -0
- package/dist/cjs/xStyledWrapper.js.map +7 -0
- package/dist/esm/arithmetic.js +31 -0
- package/dist/esm/arithmetic.js.map +7 -0
- package/dist/esm/constants.js +18 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/globalStyles.js +36 -0
- package/dist/esm/globalStyles.js.map +7 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/mobileUtilities.js +41 -0
- package/dist/esm/mobileUtilities.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/spaceUtilities.js +67 -0
- package/dist/esm/spaceUtilities.js.map +7 -0
- package/dist/esm/styled/checkNamingConvention.js +19 -0
- package/dist/esm/styled/checkNamingConvention.js.map +7 -0
- package/dist/esm/styled/coerceWithDefaultTheme.js +16 -0
- package/dist/esm/styled/coerceWithDefaultTheme.js.map +7 -0
- package/dist/esm/styled/expressions/genStyleOverridesExpression.js +14 -0
- package/dist/esm/styled/expressions/genStyleOverridesExpression.js.map +7 -0
- package/dist/esm/styled/expressions/genVariantOverridesExpression.js +33 -0
- package/dist/esm/styled/expressions/genVariantOverridesExpression.js.map +7 -0
- package/dist/esm/styled/expressions/index.js +8 -0
- package/dist/esm/styled/expressions/index.js.map +7 -0
- package/dist/esm/styled/fixStyleArg.js +18 -0
- package/dist/esm/styled/fixStyleArg.js.map +7 -0
- package/dist/esm/styled/generated-attributes/generateAttributes.js +41 -0
- package/dist/esm/styled/generated-attributes/generateAttributes.js.map +7 -0
- package/dist/esm/styled/generated-attributes/generateAutoCalculated.js +12 -0
- package/dist/esm/styled/generated-attributes/generateAutoCalculated.js.map +7 -0
- package/dist/esm/styled/generated-attributes/generateDisplayName.js +11 -0
- package/dist/esm/styled/generated-attributes/generateDisplayName.js.map +7 -0
- package/dist/esm/styled/generated-attributes/index.js +6 -0
- package/dist/esm/styled/generated-attributes/index.js.map +7 -0
- package/dist/esm/styled/generated-attributes/utils/callbackMerger.js +20 -0
- package/dist/esm/styled/generated-attributes/utils/callbackMerger.js.map +7 -0
- package/dist/esm/styled/generated-attributes/utils/refMerger.js +24 -0
- package/dist/esm/styled/generated-attributes/utils/refMerger.js.map +7 -0
- package/dist/esm/styled/helpers.js +27 -0
- package/dist/esm/styled/helpers.js.map +7 -0
- package/dist/esm/styled/index.js +35 -0
- package/dist/esm/styled/index.js.map +7 -0
- package/dist/esm/styled/styled.js +8 -0
- package/dist/esm/styled/styled.js.map +7 -0
- package/dist/esm/styled/styledFunction.js +48 -0
- package/dist/esm/styled/styledFunction.js.map +7 -0
- package/dist/esm/styled/styledObject.js +12 -0
- package/dist/esm/styled/styledObject.js.map +7 -0
- package/dist/esm/styled/system-types.js +2 -0
- package/dist/esm/styled/system-types.js.map +7 -0
- package/dist/esm/styled/system-utilities/background.js +15 -0
- package/dist/esm/styled/system-utilities/background.js.map +7 -0
- package/dist/esm/styled/system-utilities/border.js +158 -0
- package/dist/esm/styled/system-utilities/border.js.map +7 -0
- package/dist/esm/styled/system-utilities/color.js +17 -0
- package/dist/esm/styled/system-utilities/color.js.map +7 -0
- package/dist/esm/styled/system-utilities/index.js +20 -0
- package/dist/esm/styled/system-utilities/index.js.map +7 -0
- package/dist/esm/styled/system-utilities/sizing.js +37 -0
- package/dist/esm/styled/system-utilities/sizing.js.map +7 -0
- package/dist/esm/styled/system-utilities/space.js +7 -0
- package/dist/esm/styled/system-utilities/space.js.map +7 -0
- package/dist/esm/styled/system.js +10 -0
- package/dist/esm/styled/system.js.map +7 -0
- package/dist/esm/styled/transformers/index.js +6 -0
- package/dist/esm/styled/transformers/index.js.map +7 -0
- package/dist/esm/styled/transformers/magicCssTransform.js +36 -0
- package/dist/esm/styled/transformers/magicCssTransform.js.map +7 -0
- package/dist/esm/styled/types.js +2 -0
- package/dist/esm/styled/types.js.map +7 -0
- package/dist/esm/th.js +56 -0
- package/dist/esm/th.js.map +7 -0
- package/dist/esm/theme.js +7 -0
- package/dist/esm/theme.js.map +7 -0
- package/dist/esm/themeProviderHOC.js +12 -0
- package/dist/esm/themeProviderHOC.js.map +7 -0
- package/dist/esm/utils.js +262 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/xStyledWrapper.js +43 -0
- package/dist/esm/xStyledWrapper.js.map +7 -0
- package/dist/types/arithmetic.d.ts +5 -0
- package/dist/types/constants.d.ts +11 -0
- package/dist/types/globalStyles.d.ts +3 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/mobileUtilities.d.ts +4 -0
- package/dist/types/spaceUtilities.d.ts +8 -0
- package/dist/types/styled/checkNamingConvention.d.ts +1 -0
- package/dist/types/styled/coerceWithDefaultTheme.d.ts +2 -0
- package/dist/types/styled/expressions/genStyleOverridesExpression.d.ts +3 -0
- package/dist/types/styled/expressions/genVariantOverridesExpression.d.ts +3 -0
- package/dist/types/styled/expressions/index.d.ts +2 -0
- package/dist/types/styled/fixStyleArg.d.ts +2 -0
- package/dist/types/styled/generated-attributes/generateAttributes.d.ts +2 -0
- package/dist/types/styled/generated-attributes/generateAutoCalculated.d.ts +2 -0
- package/dist/types/styled/generated-attributes/generateDisplayName.d.ts +2 -0
- package/dist/types/styled/generated-attributes/index.d.ts +1 -0
- package/dist/types/styled/generated-attributes/utils/callbackMerger.d.ts +3 -0
- package/dist/types/styled/generated-attributes/utils/refMerger.d.ts +7 -0
- package/dist/types/styled/helpers.d.ts +5 -0
- package/dist/types/styled/index.d.ts +6 -0
- package/dist/types/styled/styled.d.ts +7 -0
- package/dist/types/styled/styledFunction.d.ts +9 -0
- package/dist/types/styled/styledObject.d.ts +6 -0
- package/dist/types/styled/system-types.d.ts +74 -0
- package/dist/types/styled/system-utilities/background.d.ts +2 -0
- package/dist/types/styled/system-utilities/border.d.ts +1 -0
- package/dist/types/styled/system-utilities/color.d.ts +2 -0
- package/dist/types/styled/system-utilities/index.d.ts +6 -0
- package/dist/types/styled/system-utilities/sizing.d.ts +1 -0
- package/dist/types/styled/system-utilities/space.d.ts +3 -0
- package/dist/types/styled/system.d.ts +1 -0
- package/dist/types/styled/transformers/index.d.ts +1 -0
- package/dist/types/styled/transformers/magicCssTransform.d.ts +4 -0
- package/dist/types/styled/types.d.ts +42 -0
- package/dist/types/tests/arithmetic.test.d.ts +1 -0
- package/dist/types/th.d.ts +19 -0
- package/dist/types/theme.d.ts +2 -0
- package/dist/types/themeProviderHOC.d.ts +2 -0
- package/dist/types/utils.d.ts +41 -0
- package/dist/types/xStyledWrapper.d.ts +3 -0
- package/package.json +123 -0
|
@@ -0,0 +1,61 @@
|
|
|
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 arithmetic_exports = {};
|
|
30
|
+
__export(arithmetic_exports, {
|
|
31
|
+
getNumberAndUnit: () => getNumberAndUnit,
|
|
32
|
+
op: () => op
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(arithmetic_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
function getNumberAndUnit(numberStrWithUnit) {
|
|
37
|
+
const matchResult = String(numberStrWithUnit).match(/[a-z]+|[(/^\-?\d*.\d+|\d+),?]+/gi);
|
|
38
|
+
let number = "0";
|
|
39
|
+
let unit = "px";
|
|
40
|
+
if (matchResult) {
|
|
41
|
+
[number, unit] = matchResult;
|
|
42
|
+
}
|
|
43
|
+
return { number, unit };
|
|
44
|
+
}
|
|
45
|
+
function op(operator, n1, n2) {
|
|
46
|
+
const { number, unit } = getNumberAndUnit(n1);
|
|
47
|
+
const { number: number2, unit: unit2 } = getNumberAndUnit(n2);
|
|
48
|
+
switch (operator) {
|
|
49
|
+
case "*":
|
|
50
|
+
return `${Number(number) * Number(number2)}${unit || unit2}`;
|
|
51
|
+
case "+":
|
|
52
|
+
return `${Number(number) + Number(number2)}${unit || unit2}`;
|
|
53
|
+
case "-":
|
|
54
|
+
return `${Number(number) - Number(number2)}${unit || unit2}`;
|
|
55
|
+
case "/":
|
|
56
|
+
return `${Number(number) / Number(number2)}${unit || unit2}`;
|
|
57
|
+
default:
|
|
58
|
+
return `${Number(number) + Number(number2)}${unit || unit2}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=arithmetic.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/arithmetic.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export function getNumberAndUnit(numberStrWithUnit: string | number): { number: string; unit: string } {\n const matchResult = String(numberStrWithUnit).match(/[a-z]+|[(/^\\-?\\d*.\\d+|\\d+),?]+/gi);\n let number = '0';\n let unit = 'px';\n if (matchResult) {\n [number, unit] = matchResult;\n }\n\n return { number, unit };\n}\n\nexport function op(operator: string, n1: string, n2: string | number): string {\n const { number, unit } = getNumberAndUnit(n1);\n const { number: number2, unit: unit2 } = getNumberAndUnit(n2);\n switch (operator) {\n case '*':\n return `${Number(number) * Number(number2)}${unit || unit2}`;\n case '+':\n return `${Number(number) + Number(number2)}${unit || unit2}`;\n case '-':\n return `${Number(number) - Number(number2)}${unit || unit2}`;\n case '/':\n return `${Number(number) / Number(number2)}${unit || unit2}`;\n default:\n return `${Number(number) + Number(number2)}${unit || unit2}`;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,SAAS,iBAAiB,mBAAsE;AACrG,QAAM,cAAc,OAAO,iBAAiB,EAAE,MAAM,kCAAkC;AACtF,MAAI,SAAS;AACb,MAAI,OAAO;AACX,MAAI,aAAa;AACf,KAAC,QAAQ,IAAI,IAAI;AAAA,EACnB;AAEA,SAAO,EAAE,QAAQ,KAAK;AACxB;AAEO,SAAS,GAAG,UAAkB,IAAY,IAA6B;AAC5E,QAAM,EAAE,QAAQ,KAAK,IAAI,iBAAiB,EAAE;AAC5C,QAAM,EAAE,QAAQ,SAAS,MAAM,MAAM,IAAI,iBAAiB,EAAE;AAC5D,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD;AACE,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,EACzD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
desktopBaseFont: () => desktopBaseFont,
|
|
32
|
+
mobileBaseFont: () => mobileBaseFont,
|
|
33
|
+
translateUnits: () => translateUnits
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(constants_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
const desktopBaseFont = 13;
|
|
38
|
+
const mobileBaseFont = 16;
|
|
39
|
+
const translateUnits = {
|
|
40
|
+
"8px": "4px",
|
|
41
|
+
"16px": "8px",
|
|
42
|
+
"32px": "16px",
|
|
43
|
+
"48px": "24px",
|
|
44
|
+
"56px": "32px",
|
|
45
|
+
"64px": "48px",
|
|
46
|
+
"72px": "64px"
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/constants.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const desktopBaseFont = 13;\n\nexport const mobileBaseFont = 16;\n\nexport const translateUnits = {\n '8px': '4px',\n '16px': '8px',\n '32px': '16px',\n '48px': '24px',\n '56px': '32px',\n '64px': '48px',\n '72px': '64px',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,kBAAkB;AAExB,MAAM,iBAAiB;AAEvB,MAAM,iBAAiB;AAAA,EAC5B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACV;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 globalStyles_exports = {};
|
|
30
|
+
__export(globalStyles_exports, {
|
|
31
|
+
GlobalStyles: () => GlobalStyles
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(globalStyles_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_styled = require("./styled/index.js");
|
|
36
|
+
var import_th = require("./th.js");
|
|
37
|
+
const GlobalStyles = import_styled.createGlobalStyle`
|
|
38
|
+
// Here we setup the root font-sizes for mobile vs desktop
|
|
39
|
+
:root {
|
|
40
|
+
font-size: ${(props) => props.device === "desktop" ? "81.25%" : "100%"};
|
|
41
|
+
|
|
42
|
+
@media(min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
43
|
+
font-size: ${(props) => props.device === "mobile" ? "100%" : "81.25%"};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
body {
|
|
48
|
+
overscroll-behavior-y: none;
|
|
49
|
+
|
|
50
|
+
font-size: 1rem; // since we correctly have set up the root font-sizes, we can use 1rem
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* fix sanitize */
|
|
54
|
+
::placeholder {
|
|
55
|
+
font-weight: ${import_th.th.fontWeight("regular")};
|
|
56
|
+
color: ${import_th.th.color("neutral-500")};
|
|
57
|
+
}
|
|
58
|
+
::-webkit-input-placeholder {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:where(svg:not([fill])) {
|
|
63
|
+
fill: unset;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
//# sourceMappingURL=globalStyles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/globalStyles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { createGlobalStyle } from './styled/index.js';\nimport { th } from './th.js';\n\nexport const GlobalStyles = createGlobalStyle<{ device: 'desktop' | 'mobile' }>`\n // Here we setup the root font-sizes for mobile vs desktop\n :root {\n font-size: ${(props) => (props.device === 'desktop' ? '81.25%' : '100%')};\n\n @media(min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => (props.device === 'mobile' ? '100%' : '81.25%')};\n }\n }\n\n body {\n overscroll-behavior-y: none;\n\n font-size: 1rem; // since we correctly have set up the root font-sizes, we can use 1rem\n }\n\n /* fix sanitize */\n ::placeholder {\n font-weight: ${th.fontWeight('regular')};\n color: ${th.color('neutral-500')};\n }\n ::-webkit-input-placeholder {\n opacity: 1;\n }\n\n :where(svg:not([fill])) {\n fill: unset;\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAkC;AAClC,gBAAmB;AAEZ,MAAM,eAAe;AAAA;AAAA;AAAA,iBAGX,CAAC,UAAW,MAAM,WAAW,YAAY,WAAW;AAAA;AAAA,wBAE7C,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACtC,CAAC,UAAW,MAAM,WAAW,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAYjD,aAAG,WAAW,SAAS;AAAA,aAC7B,aAAG,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
ThemeContext: () => import_styled_components.ThemeContext,
|
|
33
|
+
XStyledWrapper: () => import_xStyledWrapper.XStyledWrapper,
|
|
34
|
+
position: () => import_system.position,
|
|
35
|
+
themeProviderHOC: () => import_themeProviderHOC.themeProviderHOC,
|
|
36
|
+
typography: () => import_system.typography,
|
|
37
|
+
xStyledCommonProps: () => import_xStyledWrapper.xStyledCommonProps
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(src_exports);
|
|
40
|
+
var React = __toESM(require("react"));
|
|
41
|
+
__reExport(src_exports, require("./globalStyles.js"), module.exports);
|
|
42
|
+
__reExport(src_exports, require("./spaceUtilities.js"), module.exports);
|
|
43
|
+
__reExport(src_exports, require("./mobileUtilities.js"), module.exports);
|
|
44
|
+
__reExport(src_exports, require("./utils.js"), module.exports);
|
|
45
|
+
__reExport(src_exports, require("./arithmetic.js"), module.exports);
|
|
46
|
+
__reExport(src_exports, require("./th.js"), module.exports);
|
|
47
|
+
__reExport(src_exports, require("./theme.js"), module.exports);
|
|
48
|
+
__reExport(src_exports, require("./styled/index.js"), module.exports);
|
|
49
|
+
var import_system = require("@xstyled/system");
|
|
50
|
+
var import_themeProviderHOC = require("./themeProviderHOC.js");
|
|
51
|
+
var import_styled_components = require("@xstyled/styled-components");
|
|
52
|
+
var import_xStyledWrapper = require("./xStyledWrapper.js");
|
|
53
|
+
//# 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 './globalStyles.js';\nexport * from './spaceUtilities.js';\nexport * from './mobileUtilities.js';\nexport * from './utils.js';\nexport * from './arithmetic.js';\nexport * from './th.js';\nexport * from './theme.js';\nexport * from './styled/index.js';\nexport { position, typography } from '@xstyled/system';\nexport { themeProviderHOC } from './themeProviderHOC.js';\nexport { ThemeContext } from '@xstyled/styled-components';\nexport { xStyledCommonProps, XStyledWrapper } from './xStyledWrapper.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,8BAAd;AACA,wBAAc,gCADd;AAEA,wBAAc,iCAFd;AAGA,wBAAc,uBAHd;AAIA,wBAAc,4BAJd;AAKA,wBAAc,oBALd;AAMA,wBAAc,uBANd;AAOA,wBAAc,8BAPd;AAQA,oBAAqC;AACrC,8BAAiC;AACjC,+BAA6B;AAC7B,4BAAmD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 mobileUtilities_exports = {};
|
|
30
|
+
__export(mobileUtilities_exports, {
|
|
31
|
+
__UNSAFE_SPACE_TO_DIMSUM: () => __UNSAFE_SPACE_TO_DIMSUM,
|
|
32
|
+
isMobile: () => isMobile,
|
|
33
|
+
toMobile: () => toMobile,
|
|
34
|
+
useIsMobile: () => useIsMobile
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(mobileUtilities_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
var import_theme = require("./theme.js");
|
|
40
|
+
var import_constants = require("./constants.js");
|
|
41
|
+
function __UNSAFE_SPACE_TO_DIMSUM(unit) {
|
|
42
|
+
if (unit in import_constants.translateUnits)
|
|
43
|
+
return import_constants.translateUnits[unit];
|
|
44
|
+
return `${parseFloat(unit) * (import_constants.mobileBaseFont / import_constants.desktopBaseFont) / 2}px`;
|
|
45
|
+
}
|
|
46
|
+
const isMobile = () => {
|
|
47
|
+
if (!window)
|
|
48
|
+
return false;
|
|
49
|
+
return Number(import_theme.theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
|
|
50
|
+
};
|
|
51
|
+
function toMobile(unit) {
|
|
52
|
+
if (!isMobile())
|
|
53
|
+
return unit;
|
|
54
|
+
return `${parseFloat(unit) * (import_constants.desktopBaseFont / import_constants.mobileBaseFont)}rem`;
|
|
55
|
+
}
|
|
56
|
+
const useIsMobile = () => {
|
|
57
|
+
const [mobile, setMobile] = (0, import_react.useState)(isMobile());
|
|
58
|
+
(0, import_react.useEffect)(() => {
|
|
59
|
+
function handleResize() {
|
|
60
|
+
setMobile(isMobile());
|
|
61
|
+
}
|
|
62
|
+
window?.addEventListener("resize", handleResize);
|
|
63
|
+
return () => {
|
|
64
|
+
window?.removeEventListener("resize", handleResize);
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
if (!window)
|
|
68
|
+
return false;
|
|
69
|
+
return mobile;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=mobileUtilities.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/mobileUtilities.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/naming-convention */\nimport { useState, useEffect } from 'react';\nimport { theme } from './theme.js';\nimport { desktopBaseFont, mobileBaseFont, translateUnits } from './constants.js';\n\n// eslint-disable-next-line no-underscore-dangle\nexport function __UNSAFE_SPACE_TO_DIMSUM(unit: string): string {\n if (unit in translateUnits) return translateUnits[unit as keyof typeof translateUnits];\n return `${(parseFloat(unit) * (mobileBaseFont / desktopBaseFont)) / 2}px`;\n}\n\nexport const isMobile = (): boolean => {\n if (!window) return false;\n return Number(theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;\n};\n\nexport function toMobile(unit: string): string {\n if (!isMobile()) return unit;\n return `${parseFloat(unit) * (desktopBaseFont / mobileBaseFont)}rem`;\n}\n\nexport const useIsMobile = (): boolean => {\n const [mobile, setMobile] = useState<boolean>(isMobile());\n\n useEffect(() => {\n function handleResize() {\n setMobile(isMobile());\n }\n window?.addEventListener('resize', handleResize);\n return () => {\n window?.removeEventListener('resize', handleResize);\n };\n }, []);\n\n if (!window) return false;\n return mobile;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoC;AACpC,mBAAsB;AACtB,uBAAgE;AAGzD,SAAS,yBAAyB,MAAsB;AAC7D,MAAI,QAAQ;AAAgB,WAAO,gCAAe,IAAmC;AACrF,SAAO,GAAI,WAAW,IAAI,KAAK,kCAAiB,oCAAoB;AACtE;AAEO,MAAM,WAAW,MAAe;AACrC,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,OAAO,mBAAM,YAAY,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,OAAO,cAAc;AAChF;AAEO,SAAS,SAAS,MAAsB;AAC7C,MAAI,CAAC,SAAS;AAAG,WAAO;AACxB,SAAO,GAAG,WAAW,IAAI,KAAK,mCAAkB;AAClD;AAEO,MAAM,cAAc,MAAe;AACxC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAkB,SAAS,CAAC;AAExD,8BAAU,MAAM;AACd,aAAS,eAAe;AACtB,gBAAU,SAAS,CAAC;AAAA,IACtB;AACA,YAAQ,iBAAiB,UAAU,YAAY;AAC/C,WAAO,MAAM;AACX,cAAQ,oBAAoB,UAAU,YAAY;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 spaceUtilities_exports = {};
|
|
30
|
+
__export(spaceUtilities_exports, {
|
|
31
|
+
fixSpace: () => fixSpace,
|
|
32
|
+
fixSpaceGutter: () => fixSpaceGutter,
|
|
33
|
+
mapGap: () => mapGap,
|
|
34
|
+
mapGrid: () => mapGrid,
|
|
35
|
+
mapGutter: () => mapGutter,
|
|
36
|
+
mapSpace: () => mapSpace,
|
|
37
|
+
mapTemplateGrid: () => mapTemplateGrid,
|
|
38
|
+
numbersToFr: () => numbersToFr
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(spaceUtilities_exports);
|
|
41
|
+
var React = __toESM(require("react"));
|
|
42
|
+
var import_lodash = require("lodash");
|
|
43
|
+
var import_theme = require("./theme.js");
|
|
44
|
+
function mapGap(gutter) {
|
|
45
|
+
if (!gutter)
|
|
46
|
+
return "0rem";
|
|
47
|
+
if (String(gutter).includes("rem") || String(gutter).includes("px"))
|
|
48
|
+
return gutter;
|
|
49
|
+
return `${import_theme.theme.space[gutter]}`;
|
|
50
|
+
}
|
|
51
|
+
function mapGutter(gutter) {
|
|
52
|
+
if (!gutter)
|
|
53
|
+
return "0rem";
|
|
54
|
+
return `${import_theme.theme.space[gutter]} * 2`;
|
|
55
|
+
}
|
|
56
|
+
function mapSpace(width) {
|
|
57
|
+
if (typeof width === "string")
|
|
58
|
+
return (0, import_lodash.get)(import_theme.theme, width) ? `${(0, import_lodash.get)(import_theme.theme, width)}` : width;
|
|
59
|
+
return `${width * 100}%`;
|
|
60
|
+
}
|
|
61
|
+
function fixSpaceGutter(width, gutter) {
|
|
62
|
+
if (!width)
|
|
63
|
+
return "";
|
|
64
|
+
if (width === "fit-content")
|
|
65
|
+
return width;
|
|
66
|
+
if (Array.isArray(width))
|
|
67
|
+
return width.map((w) => `calc(${mapSpace(w)} - (${mapGutter(gutter)}))`);
|
|
68
|
+
return `calc(${mapSpace(width)} - (${mapGutter(gutter)}))`;
|
|
69
|
+
}
|
|
70
|
+
function fixSpace(width) {
|
|
71
|
+
if (!width)
|
|
72
|
+
return "";
|
|
73
|
+
if (Array.isArray(width))
|
|
74
|
+
return width.map((w) => mapSpace(w));
|
|
75
|
+
return mapSpace(width);
|
|
76
|
+
}
|
|
77
|
+
function numbersToFr(grid) {
|
|
78
|
+
const den = grid.map((f) => f < 1 ? Math.floor(1 / f) : f);
|
|
79
|
+
return den.map((d) => `${d}fr`);
|
|
80
|
+
}
|
|
81
|
+
function mapGrid(width) {
|
|
82
|
+
if ((0, import_lodash.get)(import_theme.theme, width))
|
|
83
|
+
return `${(0, import_lodash.get)(import_theme.theme, width)}`;
|
|
84
|
+
if (typeof width === "string")
|
|
85
|
+
return width;
|
|
86
|
+
const den = width < 1 ? Math.floor(1 / width) : width;
|
|
87
|
+
return `${den}fr`;
|
|
88
|
+
}
|
|
89
|
+
function mapTemplateGrid(grid) {
|
|
90
|
+
if (Array.isArray(grid)) {
|
|
91
|
+
if (grid.some((w) => typeof w === "string"))
|
|
92
|
+
return grid.map((w) => mapGrid(w));
|
|
93
|
+
return numbersToFr(grid);
|
|
94
|
+
}
|
|
95
|
+
return mapGrid(grid);
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=spaceUtilities.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/spaceUtilities.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { get } from 'lodash';\nimport { theme } from './theme.js';\n\nexport function mapGap(gutter: number | string): number | string {\n if (!gutter) return '0rem';\n if (String(gutter).includes('rem') || String(gutter).includes('px')) return gutter;\n return `${theme.space[gutter as keyof typeof theme.space]}`;\n}\n\nexport function mapGutter(gutter: string | number | undefined): string {\n if (!gutter) return '0rem';\n return `${theme.space[gutter as keyof typeof theme.space]} * 2`;\n}\n\nexport function mapSpace(width: string | number): string {\n if (typeof width === 'string') return get(theme, width) ? `${get(theme, width)}` : width;\n return `${width * 100}%`;\n}\n\nexport function fixSpaceGutter(\n width: string | number | string[] | number[],\n gutter?: string | number,\n): string | string[] {\n if (!width) return '';\n if (width === 'fit-content') return width;\n if (Array.isArray(width)) return width.map((w) => `calc(${mapSpace(w)} - (${mapGutter(gutter)}))`);\n return `calc(${mapSpace(width)} - (${mapGutter(gutter)}))`;\n}\n\nexport function fixSpace(width: string | number | string[] | number[]): string | string[] {\n if (!width) return '';\n if (Array.isArray(width)) return width.map((w) => mapSpace(w));\n return mapSpace(width);\n}\n\nexport function numbersToFr(grid: number[]): string[] {\n const den = grid.map((f) => (f < 1 ? Math.floor(1 / f) : f));\n return den.map((d) => `${d}fr`);\n}\nexport function mapGrid(width: string | number): string {\n if (get(theme, width)) return `${get(theme, width)}`;\n if (typeof width === 'string') return width;\n const den = width < 1 ? Math.floor(1 / width) : width;\n return `${den}fr`;\n}\n\nexport function mapTemplateGrid(grid: number | string | (number | string)[]): string | string[] {\n if (Array.isArray(grid)) {\n if (grid.some((w) => typeof w === 'string')) return grid.map((w) => mapGrid(w));\n return numbersToFr(grid as number[]);\n }\n return mapGrid(grid);\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAoB;AACpB,mBAAsB;AAEf,SAAS,OAAO,QAA0C;AAC/D,MAAI,CAAC;AAAQ,WAAO;AACpB,MAAI,OAAO,MAAM,EAAE,SAAS,KAAK,KAAK,OAAO,MAAM,EAAE,SAAS,IAAI;AAAG,WAAO;AAC5E,SAAO,GAAG,mBAAM,MAAM,MAAkC;AAC1D;AAEO,SAAS,UAAU,QAA6C;AACrE,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,GAAG,mBAAM,MAAM,MAAkC;AAC1D;AAEO,SAAS,SAAS,OAAgC;AACvD,MAAI,OAAO,UAAU;AAAU,eAAO,mBAAI,oBAAO,KAAK,IAAI,OAAG,mBAAI,oBAAO,KAAK,MAAM;AACnF,SAAO,GAAG,QAAQ;AACpB;AAEO,SAAS,eACd,OACA,QACmB;AACnB,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,UAAU;AAAe,WAAO;AACpC,MAAI,MAAM,QAAQ,KAAK;AAAG,WAAO,MAAM,IAAI,CAAC,MAAM,QAAQ,SAAS,CAAC,QAAQ,UAAU,MAAM,KAAK;AACjG,SAAO,QAAQ,SAAS,KAAK,QAAQ,UAAU,MAAM;AACvD;AAEO,SAAS,SAAS,OAAiE;AACxF,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,MAAM,QAAQ,KAAK;AAAG,WAAO,MAAM,IAAI,CAAC,MAAM,SAAS,CAAC,CAAC;AAC7D,SAAO,SAAS,KAAK;AACvB;AAEO,SAAS,YAAY,MAA0B;AACpD,QAAM,MAAM,KAAK,IAAI,CAAC,MAAO,IAAI,IAAI,KAAK,MAAM,IAAI,CAAC,IAAI,CAAE;AAC3D,SAAO,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK;AAChC;AACO,SAAS,QAAQ,OAAgC;AACtD,UAAI,mBAAI,oBAAO,KAAK;AAAG,WAAO,OAAG,mBAAI,oBAAO,KAAK;AACjD,MAAI,OAAO,UAAU;AAAU,WAAO;AACtC,QAAM,MAAM,QAAQ,IAAI,KAAK,MAAM,IAAI,KAAK,IAAI;AAChD,SAAO,GAAG;AACZ;AAEO,SAAS,gBAAgB,MAAgE;AAC9F,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,QAAI,KAAK,KAAK,CAAC,MAAM,OAAO,MAAM,QAAQ;AAAG,aAAO,KAAK,IAAI,CAAC,MAAM,QAAQ,CAAC,CAAC;AAC9E,WAAO,YAAY,IAAgB;AAAA,EACrC;AACA,SAAO,QAAQ,IAAI;AACrB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 checkNamingConvention_exports = {};
|
|
30
|
+
__export(checkNamingConvention_exports, {
|
|
31
|
+
checkNamingConvention: () => checkNamingConvention
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(checkNamingConvention_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const checkNamingConvention = (componentName, componentSlot) => {
|
|
36
|
+
if (componentName !== null) {
|
|
37
|
+
const matches = componentName.match(/DS([A-Z]|[a-z]|[0-9])*/);
|
|
38
|
+
if (!matches || matches.length === 0 || matches[0].length !== componentName.length) {
|
|
39
|
+
console.warn(`BAD FORMAT FOR COMPONENT NAME ${componentName}, use DSWhateverComponentTitled`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (componentSlot !== null) {
|
|
43
|
+
const isValid = /([a-z]-)*/.test(componentSlot);
|
|
44
|
+
if (!isValid) {
|
|
45
|
+
console.warn(`BAD FORMAT FOR COMPONENT SLOT ${componentSlot}, use any-component-slot`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=checkNamingConvention.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/styled/checkNamingConvention.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-console */\n\nexport const checkNamingConvention = (componentName: string | null, componentSlot: string | null): void => {\n // We just check that the name is correctly written, should be removed in the future\n if (componentName !== null) {\n const matches = componentName.match(/DS([A-Z]|[a-z]|[0-9])*/);\n if (!matches || matches.length === 0 || matches[0].length !== componentName.length) {\n console.warn(`BAD FORMAT FOR COMPONENT NAME ${componentName}, use DSWhateverComponentTitled`);\n }\n }\n if (componentSlot !== null) {\n const isValid = /([a-z]-)*/.test(componentSlot);\n if (!isValid) {\n console.warn(`BAD FORMAT FOR COMPONENT SLOT ${componentSlot}, use any-component-slot`);\n }\n }\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,wBAAwB,CAAC,eAA8B,kBAAuC;AAEzG,MAAI,kBAAkB,MAAM;AAC1B,UAAM,UAAU,cAAc,MAAM,wBAAwB;AAC5D,QAAI,CAAC,WAAW,QAAQ,WAAW,KAAK,QAAQ,CAAC,EAAE,WAAW,cAAc,QAAQ;AAClF,cAAQ,KAAK,iCAAiC,8CAA8C;AAAA,IAC9F;AAAA,EACF;AACA,MAAI,kBAAkB,MAAM;AAC1B,UAAM,UAAU,YAAY,KAAK,aAAa;AAC9C,QAAI,CAAC,SAAS;AACZ,cAAQ,KAAK,iCAAiC,uCAAuC;AAAA,IACvF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var coerceWithDefaultTheme_exports = {};
|
|
30
|
+
__export(coerceWithDefaultTheme_exports, {
|
|
31
|
+
coerceWithDefaultTheme: () => coerceWithDefaultTheme
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(coerceWithDefaultTheme_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_theme = require("../theme.js");
|
|
36
|
+
const coerceSingleExpressionWithDefaultTheme = (expression) => {
|
|
37
|
+
if (typeof expression === "function") {
|
|
38
|
+
return (props) => expression({
|
|
39
|
+
...props,
|
|
40
|
+
theme: props.theme ?? import_theme.theme
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return expression;
|
|
44
|
+
};
|
|
45
|
+
const coerceWithDefaultTheme = (expressions) => expressions ? expressions.map(coerceSingleExpressionWithDefaultTheme) : [];
|
|
46
|
+
//# sourceMappingURL=coerceWithDefaultTheme.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/styled/coerceWithDefaultTheme.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { theme as defaultTheme } from '../theme.js';\nimport type { Expressions, Expression, PropsWithTheme } from './types.js';\n\nconst coerceSingleExpressionWithDefaultTheme = (expression: Expression): Expression => {\n if (typeof expression === 'function') {\n return (props: PropsWithTheme) =>\n expression({\n ...props,\n theme: props.theme ?? defaultTheme,\n });\n }\n return expression;\n};\n\nexport const coerceWithDefaultTheme = (expressions: Expressions): Expressions =>\n expressions ? expressions.map(coerceSingleExpressionWithDefaultTheme) : [];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsC;AAGtC,MAAM,yCAAyC,CAAC,eAAuC;AACrF,MAAI,OAAO,eAAe,YAAY;AACpC,WAAO,CAAC,UACN,WAAW;AAAA,MACT,GAAG;AAAA,MACH,OAAO,MAAM,SAAS,aAAAA;AAAA,IACxB,CAAC;AAAA,EACL;AACA,SAAO;AACT;AAEO,MAAM,yBAAyB,CAAC,gBACrC,cAAc,YAAY,IAAI,sCAAsC,IAAI,CAAC;",
|
|
6
|
+
"names": ["defaultTheme"]
|
|
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 genStyleOverridesExpression_exports = {};
|
|
30
|
+
__export(genStyleOverridesExpression_exports, {
|
|
31
|
+
genStyleOverridesExpression: () => genStyleOverridesExpression
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(genStyleOverridesExpression_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_theme = require("../../theme.js");
|
|
36
|
+
const getStyleOverrides = (name, theme) => theme.components?.[name]?.styleOverrides || null;
|
|
37
|
+
const genStyleOverridesExpression = (componentName, componentSlot) => (props) => {
|
|
38
|
+
const styleOverrides = getStyleOverrides(componentName, props.theme ?? import_theme.theme);
|
|
39
|
+
if (styleOverrides) {
|
|
40
|
+
return [styleOverrides[componentSlot]];
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=genStyleOverridesExpression.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/styled/expressions/genStyleOverridesExpression.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { PropsWithTheme, Theme } from '../types.js';\nimport { theme as defaultTheme } from '../../theme.js';\nimport type { CSSObject } from 'styled-components';\n\nconst getStyleOverrides = (name: string, theme: Theme): CSSObject | null =>\n theme.components?.[name]?.styleOverrides || null;\n\nexport const genStyleOverridesExpression =\n (componentName: string, componentSlot: string) => (props: PropsWithTheme) => {\n const styleOverrides = getStyleOverrides(componentName, props.theme ?? defaultTheme);\n if (styleOverrides) {\n return [styleOverrides[componentSlot]];\n }\n return null;\n };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAsC;AAGtC,MAAM,oBAAoB,CAAC,MAAc,UACvC,MAAM,aAAa,IAAI,GAAG,kBAAkB;AAEvC,MAAM,8BACX,CAAC,eAAuB,kBAA0B,CAAC,UAA0B;AAC3E,QAAM,iBAAiB,kBAAkB,eAAe,MAAM,SAAS,aAAAA,KAAY;AACnF,MAAI,gBAAgB;AAClB,WAAO,CAAC,eAAe,aAAa,CAAC;AAAA,EACvC;AACA,SAAO;AACT;",
|
|
6
|
+
"names": ["defaultTheme"]
|
|
7
|
+
}
|