@elliemae/ds-system 3.0.0-next.7 → 3.0.0-next.72
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 +20 -22
- package/dist/cjs/arithmetic.js.map +2 -2
- package/dist/cjs/constants.js +9 -16
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/ds-styled/index.js +37 -0
- package/dist/cjs/ds-styled/index.js.map +7 -0
- package/dist/cjs/ds-styled/styled.js +103 -0
- package/dist/cjs/ds-styled/styled.js.map +7 -0
- package/dist/cjs/ds-styled/types.js +20 -0
- package/dist/cjs/ds-styled/types.js.map +7 -0
- package/dist/cjs/ds-styled/utilities/background.js +41 -0
- package/dist/cjs/ds-styled/utilities/background.js.map +7 -0
- package/dist/cjs/ds-styled/utilities/border.js +174 -0
- package/dist/cjs/ds-styled/utilities/border.js.map +7 -0
- package/dist/cjs/ds-styled/utilities/helpers.js +66 -0
- package/dist/cjs/ds-styled/utilities/helpers.js.map +7 -0
- package/dist/cjs/ds-styled/utilities/index.js +27 -0
- package/dist/cjs/ds-styled/utilities/index.js.map +7 -0
- package/dist/cjs/ds-styled/utilities/magicCssTransform.js +58 -0
- package/dist/cjs/ds-styled/utilities/magicCssTransform.js.map +7 -0
- package/dist/cjs/ds-styled/utilities/resolvers.js +49 -0
- package/dist/cjs/ds-styled/utilities/resolvers.js.map +7 -0
- package/dist/cjs/ds-styled/utilities/sizing.js +59 -0
- package/dist/cjs/ds-styled/utilities/sizing.js.map +7 -0
- package/dist/cjs/globalStyles.js +11 -18
- package/dist/cjs/globalStyles.js.map +2 -2
- package/dist/cjs/index.js +18 -24
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/mobileUtilities.js +17 -26
- package/dist/cjs/mobileUtilities.js.map +2 -2
- package/dist/cjs/spaceUtilities.js +9 -16
- package/dist/cjs/spaceUtilities.js.map +1 -1
- package/dist/cjs/th.js +48 -29
- package/dist/cjs/th.js.map +2 -2
- package/dist/cjs/theme.js +9 -16
- package/dist/cjs/theme.js.map +1 -1
- package/dist/cjs/themeProviderHOC.js +16 -20
- package/dist/cjs/themeProviderHOC.js.map +2 -2
- package/dist/cjs/utils.js +29 -37
- package/dist/cjs/utils.js.map +2 -2
- package/dist/esm/arithmetic.js +11 -6
- package/dist/esm/arithmetic.js.map +2 -2
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/ds-styled/index.js +14 -0
- package/dist/esm/ds-styled/index.js.map +7 -0
- package/dist/esm/{styled/index.js → ds-styled/styled.js} +35 -23
- package/dist/esm/ds-styled/styled.js.map +7 -0
- package/dist/esm/ds-styled/types.js +2 -0
- package/dist/esm/{styled/index.d.js.map → ds-styled/types.js.map} +0 -0
- package/dist/esm/ds-styled/utilities/background.js +19 -0
- package/dist/esm/ds-styled/utilities/background.js.map +7 -0
- package/dist/esm/ds-styled/utilities/border.js +152 -0
- package/dist/esm/ds-styled/utilities/border.js.map +7 -0
- package/dist/esm/ds-styled/utilities/helpers.js +46 -0
- package/dist/esm/ds-styled/utilities/helpers.js.map +7 -0
- package/dist/esm/ds-styled/utilities/index.js +8 -0
- package/dist/esm/ds-styled/utilities/index.js.map +7 -0
- package/dist/esm/ds-styled/utilities/magicCssTransform.js +36 -0
- package/dist/esm/ds-styled/utilities/magicCssTransform.js.map +7 -0
- package/dist/esm/{styled/styleGetters.js → ds-styled/utilities/resolvers.js} +2 -2
- package/dist/esm/ds-styled/utilities/resolvers.js.map +7 -0
- package/dist/esm/ds-styled/utilities/sizing.js +37 -0
- package/dist/esm/ds-styled/utilities/sizing.js.map +7 -0
- package/dist/esm/globalStyles.js +1 -1
- package/dist/esm/globalStyles.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mobileUtilities.js +8 -10
- package/dist/esm/mobileUtilities.js.map +2 -2
- package/dist/esm/spaceUtilities.js.map +1 -1
- package/dist/esm/th.js +39 -13
- package/dist/esm/th.js.map +2 -2
- package/dist/esm/theme.js.map +1 -1
- package/dist/esm/themeProviderHOC.js +7 -4
- package/dist/esm/themeProviderHOC.js.map +2 -2
- package/dist/esm/utils.js +5 -6
- package/dist/esm/utils.js.map +2 -2
- package/package.json +13 -13
- package/dist/cjs/styled/index.d.js +0 -27
- package/dist/cjs/styled/index.d.js.map +0 -7
- package/dist/cjs/styled/index.js +0 -105
- package/dist/cjs/styled/index.js.map +0 -7
- package/dist/cjs/styled/styleGetters.js +0 -56
- package/dist/cjs/styled/styleGetters.js.map +0 -7
- package/dist/cjs/styled/types.js +0 -35
- package/dist/cjs/styled/types.js.map +0 -7
- package/dist/cjs/styled/utils.js +0 -47
- package/dist/cjs/styled/utils.js.map +0 -7
- package/dist/esm/styled/index.d.js +0 -2
- package/dist/esm/styled/index.js.map +0 -7
- package/dist/esm/styled/styleGetters.js.map +0 -7
- package/dist/esm/styled/types.js +0 -6
- package/dist/esm/styled/types.js.map +0 -7
- package/dist/esm/styled/utils.js +0 -18
- package/dist/esm/styled/utils.js.map +0 -7
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/spaceUtilities.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { get } from 'lodash';\nimport { theme } from './theme';\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 (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)[]): 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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAoB;AACpB,mBAAsB;AAEf,gBAAgB,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;AACxB;AAEO,mBAAmB,QAA6C;AACrE,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,GAAG,mBAAM,MAAM;AACxB;AAEO,kBAAkB,OAAgC;AACvD,MAAI,OAAO,UAAU;AAAU,WAAO,uBAAI,oBAAO,KAAK,IAAI,GAAG,uBAAI,oBAAO,KAAK,MAAM;AACnF,SAAO,GAAG,QAAQ;AACpB;AAEO,wBACL,OACA,QACmB;AACnB,MAAI,CAAC;AAAO,WAAO;AACnB,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,kBAAkB,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,qBAAqB,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,iBAAiB,OAAgC;AACtD,MAAI,uBAAI,oBAAO,KAAK;AAAG,WAAO,GAAG,uBAAI,oBAAO,KAAK;AACjD,MAAI,OAAO,UAAU;AAAU,WAAO;AACtC,QAAM,MAAM,QAAQ,IAAI,KAAK,MAAM,IAAI,KAAK,IAAI;AAChD,SAAO,GAAG;AACZ;AAEO,yBAAyB,MAA8C;AAC5E,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
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/th.js
CHANGED
|
@@ -4,46 +4,66 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var th_exports = {};
|
|
29
22
|
__export(th_exports, {
|
|
23
|
+
hexToRgba: () => hexToRgba,
|
|
30
24
|
th: () => th
|
|
31
25
|
});
|
|
26
|
+
module.exports = __toCommonJS(th_exports);
|
|
32
27
|
var React = __toESM(require("react"));
|
|
28
|
+
const hexToRgba = (hex, alpha) => {
|
|
29
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
30
|
+
if (result) {
|
|
31
|
+
return `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${alpha})`;
|
|
32
|
+
}
|
|
33
|
+
return ``;
|
|
34
|
+
};
|
|
35
|
+
const colorGetter = (value, dfault = "") => ({ theme }) => {
|
|
36
|
+
const colorValues = value.split("-");
|
|
37
|
+
if (colorValues.length === 1)
|
|
38
|
+
return colorValues[0];
|
|
39
|
+
if (colorValues.length > 3)
|
|
40
|
+
return dfault;
|
|
41
|
+
const [colorType, colorValue, alpha] = colorValues;
|
|
42
|
+
const themeColor = theme.colors && theme.colors[colorType][colorValue];
|
|
43
|
+
if (!themeColor)
|
|
44
|
+
return dfault;
|
|
45
|
+
if (alpha) {
|
|
46
|
+
const alphaFloatingNumber = `0.${alpha.slice(1)}`;
|
|
47
|
+
return hexToRgba(themeColor, alphaFloatingNumber);
|
|
48
|
+
}
|
|
49
|
+
return themeColor;
|
|
50
|
+
};
|
|
51
|
+
const genericGetter = (property) => (value, dfault = "") => ({ theme }) => {
|
|
52
|
+
const parts = value.split("-");
|
|
53
|
+
let result = theme[property];
|
|
54
|
+
parts.forEach((part) => {
|
|
55
|
+
if (result)
|
|
56
|
+
result = result[part];
|
|
57
|
+
});
|
|
58
|
+
return result ?? dfault;
|
|
59
|
+
};
|
|
33
60
|
const th = (property) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
result = result[part];
|
|
41
|
-
});
|
|
42
|
-
return result ?? dfault;
|
|
43
|
-
};
|
|
44
|
-
return func;
|
|
45
|
-
};
|
|
46
|
-
return thGetter;
|
|
61
|
+
switch (property) {
|
|
62
|
+
case "colors":
|
|
63
|
+
return colorGetter;
|
|
64
|
+
default:
|
|
65
|
+
return genericGetter(property);
|
|
66
|
+
}
|
|
47
67
|
};
|
|
48
68
|
th.space = th("space");
|
|
49
69
|
th.fontSize = th("fontSizes");
|
|
@@ -54,5 +74,4 @@ th.font = th("fonts");
|
|
|
54
74
|
th.color = th("colors");
|
|
55
75
|
th.breakpoint = th("breakpoints");
|
|
56
76
|
th.media = th("media");
|
|
57
|
-
module.exports = __toCommonJS(th_exports);
|
|
58
77
|
//# sourceMappingURL=th.js.map
|
package/dist/cjs/th.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/th.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable indent */\nimport type { Theme } from '@elliemae/pui-theme';\n\nexport const hexToRgba = (hex: string, alpha: string) => {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\n if (result) {\n return `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${alpha})`;\n }\n return ``;\n};\n\ntype ThemeStringGetter = ({ theme }: { theme: Theme }) => string;\n\ntype ThGetter = (value: string, dfault?: string) => ThemeStringGetter;\n\ntype ThConstructor = ((property: keyof Theme) => ThGetter) & {\n space: ThGetter;\n fontSize: ThGetter;\n fontWeight: ThGetter;\n lineHeight: ThGetter;\n letterSpacing: ThGetter;\n font: ThGetter;\n color: ThGetter;\n breakpoint: ThGetter;\n media: ThGetter;\n};\n\nconst colorGetter: ThGetter =\n (value, dfault = '') =>\n ({ theme }) => {\n const colorValues = value.split('-');\n\n if (colorValues.length === 1) return colorValues[0];\n\n if (colorValues.length > 3) return dfault;\n\n const [colorType, colorValue, alpha] = colorValues as [\n keyof Theme['colors'],\n keyof Theme['colors'][keyof Theme['colors']],\n string,\n ];\n\n const themeColor = theme.colors && theme.colors[colorType][colorValue];\n\n if (!themeColor) return dfault;\n\n if (alpha) {\n const alphaFloatingNumber = `0.${alpha.slice(1)}`;\n\n return hexToRgba(themeColor, alphaFloatingNumber);\n }\n\n return themeColor;\n };\n\nconst genericGetter =\n (property: keyof Theme) =>\n (value: string, dfault = ''): ThemeStringGetter =>\n ({ theme }) => {\n const parts = value.split('-');\n let result = theme[property];\n parts.forEach((part) => {\n if (result) result = result[part as keyof typeof result];\n });\n return (result as unknown as string) ?? dfault;\n };\n\nexport const th: ThConstructor = (property): ThGetter => {\n switch (property) {\n case 'colors' as keyof Theme:\n return colorGetter;\n default:\n return genericGetter(property);\n }\n};\n\nth.space = th('space');\nth.fontSize = th('fontSizes');\nth.fontWeight = th('fontWeights');\nth.lineHeight = th('lineHeights');\nth.letterSpacing = th('letterSpacings');\nth.font = th('fonts');\nth.color = th('colors');\nth.breakpoint = th('breakpoints');\nth.media = th('media');\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGhB,MAAM,YAAY,CAAC,KAAa,UAAkB;AACvD,QAAM,SAAS,4CAA4C,KAAK,GAAG;AAEnE,MAAI,QAAQ;AACV,WAAO,QAAQ,SAAS,OAAO,IAAI,EAAE,MAAM,SAAS,OAAO,IAAI,EAAE,MAAM,SAAS,OAAO,IAAI,EAAE,MAAM;AAAA,EACrG;AACA,SAAO;AACT;AAkBA,MAAM,cACJ,CAAC,OAAO,SAAS,OACjB,CAAC,EAAE,YAAY;AACb,QAAM,cAAc,MAAM,MAAM,GAAG;AAEnC,MAAI,YAAY,WAAW;AAAG,WAAO,YAAY;AAEjD,MAAI,YAAY,SAAS;AAAG,WAAO;AAEnC,QAAM,CAAC,WAAW,YAAY,SAAS;AAMvC,QAAM,aAAa,MAAM,UAAU,MAAM,OAAO,WAAW;AAE3D,MAAI,CAAC;AAAY,WAAO;AAExB,MAAI,OAAO;AACT,UAAM,sBAAsB,KAAK,MAAM,MAAM,CAAC;AAE9C,WAAO,UAAU,YAAY,mBAAmB;AAAA,EAClD;AAEA,SAAO;AACT;AAEF,MAAM,gBACJ,CAAC,aACD,CAAC,OAAe,SAAS,OACzB,CAAC,EAAE,YAAY;AACb,QAAM,QAAQ,MAAM,MAAM,GAAG;AAC7B,MAAI,SAAS,MAAM;AACnB,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI;AAAQ,eAAS,OAAO;AAAA,EAC9B,CAAC;AACD,SAAQ,UAAgC;AAC1C;AAEK,MAAM,KAAoB,CAAC,aAAuB;AACvD,UAAQ;AAAA,SACD;AACH,aAAO;AAAA;AAEP,aAAO,cAAc,QAAQ;AAAA;AAEnC;AAEA,GAAG,QAAQ,GAAG,OAAO;AACrB,GAAG,WAAW,GAAG,WAAW;AAC5B,GAAG,aAAa,GAAG,aAAa;AAChC,GAAG,aAAa,GAAG,aAAa;AAChC,GAAG,gBAAgB,GAAG,gBAAgB;AACtC,GAAG,OAAO,GAAG,OAAO;AACpB,GAAG,QAAQ,GAAG,QAAQ;AACtB,GAAG,aAAa,GAAG,aAAa;AAChC,GAAG,QAAQ,GAAG,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/theme.js
CHANGED
|
@@ -4,33 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var theme_exports = {};
|
|
29
22
|
__export(theme_exports, {
|
|
30
23
|
theme: () => theme
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(theme_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
var import_pui_theme = require("@elliemae/pui-theme");
|
|
34
28
|
const theme = (0, import_pui_theme.getDefaultTheme)();
|
|
35
|
-
module.exports = __toCommonJS(theme_exports);
|
|
36
29
|
//# sourceMappingURL=theme.js.map
|
package/dist/cjs/theme.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/theme.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { getDefaultTheme } from '@elliemae/pui-theme';\nimport type { Theme } from '@elliemae/pui-theme';\n\nexport const theme = getDefaultTheme() as Theme;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAgC;AAGzB,MAAM,QAAQ,sCAAgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,37 +18,33 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var themeProviderHOC_exports = {};
|
|
43
36
|
__export(themeProviderHOC_exports, {
|
|
44
37
|
themeProviderHOC: () => themeProviderHOC
|
|
45
38
|
});
|
|
39
|
+
module.exports = __toCommonJS(themeProviderHOC_exports);
|
|
46
40
|
var React = __toESM(require("react"));
|
|
47
41
|
var import_react = __toESM(require("react"));
|
|
48
|
-
var import_styled_components = require("styled-components");
|
|
42
|
+
var import_styled_components = require("@xstyled/styled-components");
|
|
49
43
|
var import_theme = require("./theme");
|
|
50
|
-
const themeProviderHOC = (Component) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
const themeProviderHOC = (Component) => {
|
|
45
|
+
const WrappedComponent = (props) => /* @__PURE__ */ import_react.default.createElement(import_styled_components.ThemeProvider, {
|
|
46
|
+
theme: import_theme.theme
|
|
47
|
+
}, /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({}, props)));
|
|
48
|
+
return WrappedComponent;
|
|
49
|
+
};
|
|
54
50
|
//# sourceMappingURL=themeProviderHOC.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/themeProviderHOC.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { ThemeProvider } from 'styled-components';\nimport { theme } from './theme';\n\nexport const themeProviderHOC = (Component: React.ElementType) =>
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { ThemeProvider } from '@xstyled/styled-components';\nimport { theme } from './theme';\n\nexport const themeProviderHOC = (Component: React.ElementType) => {\n const WrappedComponent = (props: Record<string, unknown>): JSX.Element => (\n <ThemeProvider theme={theme}>\n <Component {...props} />\n </ThemeProvider>\n );\n return WrappedComponent;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,+BAA8B;AAC9B,mBAAsB;AAEf,MAAM,mBAAmB,CAAC,cAAiC;AAChE,QAAM,mBAAmB,CAAC,UACxB,mDAAC;AAAA,IAAc,OAAO;AAAA,KACpB,mDAAC,8BAAc,MAAO,CACxB;AAEF,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var utils_exports = {};
|
|
29
22
|
__export(utils_exports, {
|
|
30
23
|
active: () => active,
|
|
@@ -34,8 +27,6 @@ __export(utils_exports, {
|
|
|
34
27
|
buttonLink: () => buttonLink,
|
|
35
28
|
clearFocus: () => clearFocus,
|
|
36
29
|
color: () => color,
|
|
37
|
-
createGlobalStyle: () => import_styled_components.createGlobalStyle,
|
|
38
|
-
css: () => import_styled_components.css,
|
|
39
30
|
disabled: () => disabled,
|
|
40
31
|
fakeActive: () => fakeActive,
|
|
41
32
|
fakeBorder: () => fakeBorder,
|
|
@@ -45,7 +36,7 @@ __export(utils_exports, {
|
|
|
45
36
|
hover: () => hover,
|
|
46
37
|
iconColor: () => iconColor,
|
|
47
38
|
keyframes: () => keyframes,
|
|
48
|
-
kfrm: () =>
|
|
39
|
+
kfrm: () => import_styled_components2.keyframes,
|
|
49
40
|
onlyFirefox: () => onlyFirefox,
|
|
50
41
|
onlySafari: () => onlySafari,
|
|
51
42
|
onlySafariAndFirefox: () => onlySafariAndFirefox,
|
|
@@ -54,17 +45,19 @@ __export(utils_exports, {
|
|
|
54
45
|
textStyle: () => textStyle,
|
|
55
46
|
transition: () => transition,
|
|
56
47
|
truncate: () => truncate,
|
|
57
|
-
useTheme: () =>
|
|
58
|
-
withTheme: () =>
|
|
48
|
+
useTheme: () => import_styled_components2.useTheme,
|
|
49
|
+
withTheme: () => import_styled_components2.withTheme
|
|
59
50
|
});
|
|
51
|
+
module.exports = __toCommonJS(utils_exports);
|
|
60
52
|
var React = __toESM(require("react"));
|
|
61
53
|
var import_polished = require("polished");
|
|
62
54
|
var import_lodash = require("lodash");
|
|
63
|
-
var
|
|
55
|
+
var import_styled_components2 = require("@xstyled/styled-components");
|
|
64
56
|
var import_theme = require("./theme");
|
|
65
57
|
var import_mobileUtilities = require("./mobileUtilities");
|
|
58
|
+
var import_th = require("./th");
|
|
66
59
|
function truncate(width) {
|
|
67
|
-
return (props) =>
|
|
60
|
+
return (props) => import_styled_components2.css`
|
|
68
61
|
${!!width || props.width ? `width: ${props.width || width};` : ""}
|
|
69
62
|
white-space: nowrap;
|
|
70
63
|
overflow: hidden;
|
|
@@ -85,7 +78,7 @@ function disabled() {
|
|
|
85
78
|
`;
|
|
86
79
|
}
|
|
87
80
|
function keyframes(obj) {
|
|
88
|
-
return
|
|
81
|
+
return import_styled_components2.keyframes`${(0, import_lodash.reduce)(obj, (result, value, key) => `
|
|
89
82
|
${result}
|
|
90
83
|
${key}% {
|
|
91
84
|
${value}
|
|
@@ -97,21 +90,21 @@ function boxShadow(top, left, blur, color2, inset = false) {
|
|
|
97
90
|
return `box-shadow: ${inset ? "inset" : ""} ${top} ${left} ${blur} ${color2};`;
|
|
98
91
|
}
|
|
99
92
|
function color(variant = "neutral", type = 400) {
|
|
100
|
-
return
|
|
101
|
-
color: ${
|
|
93
|
+
return import_styled_components2.css`
|
|
94
|
+
color: ${import_th.th.color(`${variant}-${type}`)};
|
|
102
95
|
`;
|
|
103
96
|
}
|
|
104
97
|
function border(color2 = import_theme.theme.colors.brand[600], size = "1px", type = "solid") {
|
|
105
98
|
return `${size} ${type} ${color2}`;
|
|
106
99
|
}
|
|
107
100
|
function animation(animationKeyframes, animationLength, animationTimingFn) {
|
|
108
|
-
return (props) =>
|
|
101
|
+
return (props) => import_styled_components2.css`
|
|
109
102
|
animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}
|
|
110
103
|
${props.animationTimingFn || animationTimingFn};
|
|
111
104
|
`;
|
|
112
105
|
}
|
|
113
106
|
function focus(color2 = import_theme.theme.colors.brand[600]) {
|
|
114
|
-
return () =>
|
|
107
|
+
return () => import_styled_components2.css`
|
|
115
108
|
outline: none;
|
|
116
109
|
border: 1px solid ${color2};
|
|
117
110
|
box-shadow: inset 0 0 0 1px ${(0, import_polished.lighten)(0.3, color2)};
|
|
@@ -119,7 +112,7 @@ function focus(color2 = import_theme.theme.colors.brand[600]) {
|
|
|
119
112
|
`;
|
|
120
113
|
}
|
|
121
114
|
function focusAfter(color2) {
|
|
122
|
-
return
|
|
115
|
+
return import_styled_components2.css`
|
|
123
116
|
outline: none;
|
|
124
117
|
position: relative;
|
|
125
118
|
&:after {
|
|
@@ -136,14 +129,14 @@ function focusAfter(color2) {
|
|
|
136
129
|
`;
|
|
137
130
|
}
|
|
138
131
|
function active() {
|
|
139
|
-
return (props) =>
|
|
132
|
+
return (props) => import_styled_components2.css`
|
|
140
133
|
outline: none;
|
|
141
134
|
border: 1px solid ${props.theme.colors.brand[700]};
|
|
142
135
|
border-radius: 2px;
|
|
143
136
|
`;
|
|
144
137
|
}
|
|
145
138
|
function hover() {
|
|
146
|
-
return (props) =>
|
|
139
|
+
return (props) => import_styled_components2.css`
|
|
147
140
|
outline: 1px solid ${props.theme.colors.brand[600]};
|
|
148
141
|
outline-offset: -1px;
|
|
149
142
|
`;
|
|
@@ -215,7 +208,7 @@ function textStyle(type, weight = "regular") {
|
|
|
215
208
|
break;
|
|
216
209
|
case "link":
|
|
217
210
|
cssVar += `
|
|
218
|
-
line-height: ${props.theme.xl};
|
|
211
|
+
line-height: ${props.theme.space.xl};
|
|
219
212
|
color: ${props.theme.colors.brand[600]};
|
|
220
213
|
cursor: pointer;
|
|
221
214
|
`;
|
|
@@ -225,18 +218,18 @@ function textStyle(type, weight = "regular") {
|
|
|
225
218
|
};
|
|
226
219
|
}
|
|
227
220
|
function iconColor(variant = "neutral", type = 400) {
|
|
228
|
-
return
|
|
229
|
-
fill: ${
|
|
221
|
+
return import_styled_components2.css`
|
|
222
|
+
fill: ${import_th.th.color(`${variant}-${type}`)};
|
|
230
223
|
`;
|
|
231
224
|
}
|
|
232
225
|
function fakeBorder() {
|
|
233
|
-
return
|
|
226
|
+
return import_styled_components2.css`
|
|
234
227
|
box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};
|
|
235
228
|
border-radius: 2px;
|
|
236
229
|
`;
|
|
237
230
|
}
|
|
238
231
|
function fakeActive() {
|
|
239
|
-
return
|
|
232
|
+
return import_styled_components2.css`
|
|
240
233
|
outline: none;
|
|
241
234
|
box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};
|
|
242
235
|
border-radius: 2px;
|
|
@@ -260,7 +253,7 @@ function transition(t = "all 1s ease") {
|
|
|
260
253
|
transition: ${t};
|
|
261
254
|
`;
|
|
262
255
|
}
|
|
263
|
-
const onlySafariAndFirefox = (styles) =>
|
|
256
|
+
const onlySafariAndFirefox = (styles) => import_styled_components2.css`
|
|
264
257
|
@media not all and (min-resolution: 0.001dpcm) {
|
|
265
258
|
${styles}
|
|
266
259
|
}
|
|
@@ -290,5 +283,4 @@ const safariAndFirefoxBold = (color2) => `
|
|
|
290
283
|
-webkit-text-stroke: 0.4px ${color2};
|
|
291
284
|
}
|
|
292
285
|
`;
|
|
293
|
-
module.exports = __toCommonJS(utils_exports);
|
|
294
286
|
//# sourceMappingURL=utils.js.map
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport { Keyframes, css, withTheme, keyframes as kfrm,
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-shadow */\n\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\n\nimport type { Theme } from '@elliemae/pui-theme';\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport { Keyframes, FlattenSimpleInterpolation } from 'styled-components';\nimport { css, withTheme, keyframes as kfrm, useTheme } from '@xstyled/styled-components';\nimport { theme } from './theme';\nimport { toMobile } from './mobileUtilities';\nimport { th } from './th';\n\nexport { withTheme, rgba, useTheme, kfrm };\n\ntype PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\nexport function truncate(width?: string) {\n return (props: PropsWithTheme<{ width?: string }>) => css`\n ${!!width || props.width ? `width: ${(props.width || width) as string};` : ''}\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n}\n\nexport function flexCenter(): string {\n return `\n display: flex;\n justify-content: center;\n align-items: center;\n `;\n}\n\nexport function disabled(): string {\n return `\n cursor: not-allowed;\n pointer-events: none;\n `;\n}\n\nexport function keyframes(obj: Record<string, string>): Keyframes {\n return kfrm`${reduce(\n obj,\n (result, value, key) => `\n ${result}\n ${key}% {\n ${value}\n }\n `,\n '',\n )}\n `;\n}\n\n// eslint-disable-next-line max-params\nexport function boxShadow(top: string, left: string, blur: string, color: string, inset = false): string {\n return `box-shadow: ${inset ? 'inset' : ''} ${top} ${left} ${blur} ${color};`;\n}\n\nexport function color(variant = 'neutral', type: string | number = 400) {\n return css`\n color: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function border(color = theme.colors.brand[600], size = '1px', type = 'solid'): string {\n return `${size} ${type} ${color}`;\n}\n\nexport function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string) {\n return (props: { animationKeyframes?: string; animationLength?: string; animationTimingFn?: string }) => css`\n animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}\n ${props.animationTimingFn || animationTimingFn};\n `;\n}\n// 0.0769\nexport function focus(color: string = theme.colors.brand[600]) {\n return () => css`\n outline: none;\n border: 1px solid ${color};\n box-shadow: inset 0 0 0 1px ${lighten(0.3, color)};\n border-radius: 2px;\n `;\n}\n\nexport function focusAfter(color: string) {\n return css`\n outline: none;\n position: relative;\n &:after {\n content: '';\n z-index: 10;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n ${focus(color)}\n }\n `;\n}\n\nexport function active() {\n return (props: PropsWithTheme) => css`\n outline: none;\n border: 1px solid ${props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function hover() {\n return (props: PropsWithTheme) => css`\n outline: 1px solid ${props.theme.colors.brand[600]};\n outline-offset: -1px;\n `;\n}\n\nexport function textStyle(type: string, weight: keyof Theme['fontWeights'] = 'regular') {\n // eslint-disable-next-line complexity\n return (props: { theme: Theme }): string => {\n let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;\n // eslint-disable-next-line default-case\n switch (type) {\n case 'h1':\n cssVar += `\n font-size: ${toMobile('2.7692rem')};\n line-height: normal;\n `;\n break;\n case 'h2':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[800])};\n line-height: normal;\n `;\n break;\n case 'h3':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[700])};\n line-height: 1.2;\n `;\n break;\n case 'h4':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[600])};\n line-height: normal;\n `;\n break;\n case 'h5':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n `;\n break;\n case 'section-header':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n text-transform: uppercase;\n `;\n break;\n case 'body':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'body-small':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[300])};\n line-height: normal;\n `;\n break;\n case 'body-micro':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.microText[200])};\n line-height: normal;\n `;\n break;\n case 'list':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'link':\n cssVar += `\n line-height: ${props.theme.space.xl};\n color: ${props.theme.colors.brand[600]};\n cursor: pointer;\n `;\n break;\n }\n return cssVar;\n };\n}\n\nexport function iconColor(variant = 'neutral', type = 400) {\n return css`\n fill: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function fakeBorder() {\n return css`\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};\n border-radius: 2px;\n `;\n}\n\nexport function fakeActive() {\n return css`\n outline: none;\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function clearFocus(): string {\n return `\n border: none;\n box-shadow: none;\n `;\n}\n\nexport function buttonLink(): string {\n return `\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n `;\n}\n\nexport function transition(t = 'all 1s ease'): string {\n return `\n transition: ${t};\n `;\n}\n\nexport const onlySafariAndFirefox = (styles: string): FlattenSimpleInterpolation => css`\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n`;\n\nexport const onlySafari = (styles: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n `;\n\nexport const onlyFirefox = (styles: string): string => `\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n `;\n\nexport const safariAndFirefoxBold = (color: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/arithmetic.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
function getNumberAndUnit(numberStrWithUnit) {
|
|
3
|
-
const
|
|
3
|
+
const matchResult = String(numberStrWithUnit).match(/[a-z]+|[(/^\-?\d*.\d+|\d+),?]+/gi);
|
|
4
|
+
let number = "0";
|
|
5
|
+
let unit = "px";
|
|
6
|
+
if (matchResult) {
|
|
7
|
+
[number, unit] = matchResult;
|
|
8
|
+
}
|
|
4
9
|
return { number, unit };
|
|
5
10
|
}
|
|
6
11
|
function op(operator, n1, n2) {
|
|
@@ -8,15 +13,15 @@ function op(operator, n1, n2) {
|
|
|
8
13
|
const { number: number2, unit: unit2 } = getNumberAndUnit(n2);
|
|
9
14
|
switch (operator) {
|
|
10
15
|
case "*":
|
|
11
|
-
return Number(number) * Number(number2)
|
|
16
|
+
return `${Number(number) * Number(number2)}${unit || unit2}`;
|
|
12
17
|
case "+":
|
|
13
|
-
return Number(number) + Number(number2)
|
|
18
|
+
return `${Number(number) + Number(number2)}${unit || unit2}`;
|
|
14
19
|
case "-":
|
|
15
|
-
return Number(number) - Number(number2)
|
|
20
|
+
return `${Number(number) - Number(number2)}${unit || unit2}`;
|
|
16
21
|
case "/":
|
|
17
|
-
return Number(number) / Number(number2)
|
|
22
|
+
return `${Number(number) / Number(number2)}${unit || unit2}`;
|
|
18
23
|
default:
|
|
19
|
-
return Number(number) + Number(number2)
|
|
24
|
+
return `${Number(number) + Number(number2)}${unit || unit2}`;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/arithmetic.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export function getNumberAndUnit(
|
|
5
|
-
"mappings": "AAAA;ACAO,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAO,0BAA0B,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,YAAY,UAAkB,IAAY,IAA6B;AAC5E,QAAM,EAAE,QAAQ,SAAS,iBAAiB,EAAE;AAC5C,QAAM,EAAE,QAAQ,SAAS,MAAM,UAAU,iBAAiB,EAAE;AAC5D,UAAQ;AAAA,SACD;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,SAClD;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,SAClD;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,SAClD;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA;AAErD,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA;AAE3D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/constants.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "AAAA;ACAO,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;
|
|
5
|
+
"mappings": "AAAA;ACAO,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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./styled";
|
|
3
|
+
import { layout, space, flexboxes, grids, boxShadow } from "@xstyled/system";
|
|
4
|
+
export * from "./utilities/border";
|
|
5
|
+
export * from "./utilities/background";
|
|
6
|
+
export * from "./utilities/sizing";
|
|
7
|
+
export {
|
|
8
|
+
boxShadow as boxShadows,
|
|
9
|
+
flexboxes,
|
|
10
|
+
grids,
|
|
11
|
+
layout,
|
|
12
|
+
space
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ds-styled/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './styled';\n\nexport { layout, space, flexboxes, grids, boxShadow as boxShadows } from '@xstyled/system';\nexport * from './utilities/border';\nexport * from './utilities/background';\nexport * from './utilities/sizing';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA;AACA;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|